please commit this patch

Anton Nehoroshih anton@valuehost.ru
Wed, 1 Aug 2001 13:49:28 +0400


add chmod action in gollem


Index: gollem/manager.php
===================================================================
RCS file: /cvs/horde/gollem/manager.php,v
retrieving revision 1.17
diff -c -r1.17 manager.php
*** gollem/manager.php  2001/07/17 10:11:06     1.17
--- gollem/manager.php  2001/08/01 09:33:43
***************
*** 81,86 ****
--- 81,98 ----
       }
       break;
  
+  case CHMOD_MODIFY:
+      if (isset($HTTP_POST_VARS['items']) && is_array($HTTP_POST_VARS['items']) && count($HTTP_POST_VARS['items']) &&
($HTTP_POST_VARS['chmod'])) {
+          foreach ($HTTP_POST_VARS['items'] as $item) {
+              if (@ftp_site($gollem['stream'], "CHMOD ".$HTTP_POST_VARS['chmod']." $item")) {
+                  Horde::raiseMessage(_("Chmod done: ") . $item, HORDE_SUCCESS); 
+              } else {
+                  Horde::raiseMessage(_("Cannot chmod ") . $item, HORDE_ERROR); 
+              }
+          }
+      }
+      break;
+ 
   case UPLOAD_FILE:
       if ($HTTP_POST_FILES['file_upload']['size'] > 0 && (Horde::getTempDir() == dirname($HTTP_POST_FILES['file_upload']['tmp_name']))) {
           $safe_file = safe_file($HTTP_POST_FILES['file_upload']['tmp_name']);
Index: gollem/lib/Gollem.php
===================================================================
RCS file: /cvs/horde/gollem/lib/Gollem.php,v
retrieving revision 1.29
diff -c -r1.29 Gollem.php
*** gollem/lib/Gollem.php       2001/07/03 14:51:23     1.29
--- gollem/lib/Gollem.php       2001/08/01 09:33:45
***************
*** 20,25 ****
--- 20,26 ----
  /** @const FORWARDS_ADD Add a forward.             */ define('FORWARDS_ADD', 107);
  /** @const FORWARDS_DELETE Delete a forward.       */ define('FORWARDS_DELETE', 108);
  /** @const FORWARDS_MODIFY Modify a forward.       */ define('FORWARDS_MODIFY', 109);
+ /** @const CHMOD_MODIFY Modify a chmod.                  */ define('CHMOD_MODIFY', 110);
  
  // Sort types
  /** @const SORT_TYPE Sort by file type. */ define('SORT_TYPE', 0);
***************
*** 178,184 ****
                                             $conf['log']['ident'], $conf['log']['conf']);
                      if (!empty($HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'])) {
                          $entry = sprintf('FAILED LOGIN %s (forwarded for [%s]) to %s:%s[%s] as %s',
!                                          $HTTP_SERVER_VARS['REMOTE_ADDR'], $HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'], $gollem['server'],
$gollem['port'], $gollem['user']);
                      } else {
                          $entry = sprintf('FAILED LOGIN %s to %s:%s as %s',
                                           $HTTP_SERVER_VARS['REMOTE_ADDR'], $gollem['server'], $gollem['port'], $gollem['user']);
--- 179,186 ----
                                             $conf['log']['ident'], $conf['log']['conf']);
                      if (!empty($HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'])) {
                          $entry = sprintf('FAILED LOGIN %s (forwarded for [%s]) to %s:%s[%s] as %s',
!                                          $HTTP_SERVER_VARS['REMOTE_ADDR'], $HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'], 
!                                        $gollem['server'], $gollem['port'], $gollem['user'],'');
                      } else {
                          $entry = sprintf('FAILED LOGIN %s to %s:%s as %s',
                                           $HTTP_SERVER_VARS['REMOTE_ADDR'], $gollem['server'], $gollem['port'], $gollem['user']);
Index: gollem/templates/manager/actions.inc
===================================================================
RCS file: /cvs/horde/gollem/templates/manager/actions.inc,v
retrieving revision 1.8
diff -c -r1.8 actions.inc
*** gollem/templates/manager/actions.inc        2001/07/02 10:12:49     1.8
--- gollem/templates/manager/actions.inc        2001/08/01 09:33:47
***************
*** 10,15 ****
--- 10,16 ----
              <?php if (@count($list)): ?>
              <option value="<?= RENAME_ITEMS ?>"><?= _("Rename Items") ?></option>
              <option value="<?= DELETE_ITEMS ?>"><?= _("Delete Items") ?></option>
+             <option value="<?= CHMOD_MODIFY ?>"><?= _("Chmod Items") ?></option>
              <?php endif; ?>
          </select>
          <?php if ($conf['user']['online_help'] && $browser->hasFeature('javascript')) echo Help::link('gollem', 'file-actions') ?>
Index: gollem/templates/manager/file_headers.inc
===================================================================
RCS file: /cvs/horde/gollem/templates/manager/file_headers.inc,v
retrieving revision 1.5
diff -c -r1.5 file_headers.inc
*** gollem/templates/manager/file_headers.inc   2001/06/14 19:02:13     1.5
--- gollem/templates/manager/file_headers.inc   2001/08/01 09:33:47
***************
*** 8,14 ****
          <a href="<?= Horde::applicationUrl('manager.php?sortby=' . SORT_TYPE . '&sortdir=' . abs(1 - $prefs->getValue('sortdir')));
?>"><?= Horde::img($prefs->getValue('sortdir') ? 'down.gif' : 'up.gif', 'alt="' . _("Sort Direction") . '"'); ?></a>
          <a href="<?= Horde::applicationUrl('manager.php?sortby=' . SORT_TYPE) ?>"><?= _("Type") ?></a>&nbsp;
      </th>
!     <th class="<?= ($prefs->getValue('sortby') == SORT_NAME) ? 'selected' : 'item' ?>" width="70%" align="left" nowrap="nowrap">
          <a href="<?= Horde::applicationUrl('manager.php?sortby=' . SORT_NAME . '&sortdir=' . abs(1 - $prefs->getValue('sortdir')));
?>"><?= Horde::img($prefs->getValue('sortdir') ? 'down.gif' : 'up.gif', 'alt="' . _("Sort Direction") . '"'); ?></a>
          <a href="<?= Horde::applicationUrl('manager.php?sortby=' . SORT_NAME) ?>"><?= _("Name") ?></a>
      </th>
--- 8,14 ----
          <a href="<?= Horde::applicationUrl('manager.php?sortby=' . SORT_TYPE . '&sortdir=' . abs(1 - $prefs->getValue('sortdir')));
?>"><?= Horde::img($prefs->getValue('sortdir') ? 'down.gif' : 'up.gif', 'alt="' . _("Sort Direction") . '"'); ?></a>
          <a href="<?= Horde::applicationUrl('manager.php?sortby=' . SORT_TYPE) ?>"><?= _("Type") ?></a>&nbsp;
      </th>
!     <th class="<?= ($prefs->getValue('sortby') == SORT_NAME) ? 'selected' : 'item' ?>" width="60%" align="left" nowrap="nowrap">
          <a href="<?= Horde::applicationUrl('manager.php?sortby=' . SORT_NAME . '&sortdir=' . abs(1 - $prefs->getValue('sortdir')));
?>"><?= Horde::img($prefs->getValue('sortdir') ? 'down.gif' : 'up.gif', 'alt="' . _("Sort Direction") . '"'); ?></a>
          <a href="<?= Horde::applicationUrl('manager.php?sortby=' . SORT_NAME) ?>"><?= _("Name") ?></a>
      </th>
***************
*** 19,23 ****
--- 19,32 ----
      <th class="<?= ($prefs->getValue('sortby') == SORT_SIZE) ? 'selected' : 'item' ?>" width="4%" align="right" nowrap="nowrap">
          <a href="<?= Horde::applicationUrl('manager.php?sortby=' . SORT_SIZE . '&sortdir=' . abs(1 - $prefs->getValue('sortdir')));
?>"><?= Horde::img($prefs->getValue('sortdir') ? 'down.gif' : 'up.gif', 'alt="' . _("Sort Direction") . '"'); ?></a>
          <a href="<?= Horde::applicationUrl('manager.php?sortby=' . SORT_SIZE) ?>"><?= _("Size") ?></a>
+     </th>
+     <th class="item" width="3%" align="right" nowrap="nowrap">
+         <?= _("Permission") ?></a>
+     </th>
+     <th class="item" width="3%" align="right" nowrap="nowrap">
+         <?= _("Owner") ?></a>
+     </th>
+     <th class="item" width="3%" align="right" nowrap="nowrap">
+         <?= _("Group") ?></a>
      </th>
  </tr>
Index: gollem/templates/manager/file_summaries.inc
===================================================================
RCS file: /cvs/horde/gollem/templates/manager/file_summaries.inc,v
retrieving revision 1.11
diff -c -r1.11 file_summaries.inc
*** gollem/templates/manager/file_summaries.inc 2001/07/17 10:11:18     1.11
--- gollem/templates/manager/file_summaries.inc 2001/08/01 09:33:47
***************
*** 26,29 ****
--- 26,33 ----
      </td>
      <td width="10%" nowrap="nowrap"><?= strftime($conf['manager']['date_format'], $item['date']); ?></td>
      <td width="5%" align="right"><?= $item['type'] == '**dir' ? '-' : number_format($item['size'],0,'.',','); ?></td>
+     <td width="10%" nowrap="nowrap"><?= $item['perms'] ?></td>
+     <td width="10%" nowrap="nowrap"><?= $item['owner'] ?></td>
+     <td width="10%" nowrap="nowrap"><?= $item['group'] ?></td>
+     
  </tr>
Index: gollem/templates/manager/header.inc
===================================================================
RCS file: /cvs/horde/gollem/templates/manager/header.inc,v
retrieving revision 1.6
diff -c -r1.6 header.inc
*** gollem/templates/manager/header.inc 2001/06/14 19:02:14     1.6
--- gollem/templates/manager/header.inc 2001/08/01 09:33:47
***************
*** 3,8 ****
--- 3,9 ----
  <input type="hidden" name="new_folder" value="" />
  <input type="hidden" name="new_names" value="" />
  <input type="hidden" name="old_names" value="" />
+ <input type="hidden" name="chmod" value="" />
  <table border="0" align="center" width="100%" cellpadding="0" cellspacing="0">
  <tr>
      <td class="header" align="center">