Support the list_users setting in Kronolith too.
authorJan Schneider <jan@horde.org>
Thu, 6 Aug 2009 16:44:21 +0000 (18:44 +0200)
committerJan Schneider <jan@horde.org>
Thu, 6 Aug 2009 16:44:42 +0000 (18:44 +0200)
kronolith/docs/CHANGES
kronolith/templates/perms/perms.inc

index a64d711..5a3355f 100644 (file)
@@ -23,6 +23,8 @@ v3.0-git
 v2.3.2-cvs
 ----------
 
+[jan] Add configuration whether to show user drop down list or text field in
+      permissions dialog (requires Horde 3.3.5).
 [jan] Propagate the 'modified' API method (Request #8274).
 [cjh] Fix the signature of the kronolith/import API method
       (rpolli@babel.it, Bug #8309).
index 1907fa7..c4a42dd 100644 (file)
@@ -210,50 +210,77 @@ foreach ($userperms as $user => $uperm) {
   <td>&nbsp;</td>
 </tr>
 <?php } } ?>
-<!-- New user row -->
+
+<!-- New user rows -->
+<?php if ($auth->hasCapability('list') && (!isset($GLOBALS['conf']['auth']['list_users']) || $GLOBALS['conf']['auth']['list_users'] == 'list' || $GLOBALS['conf']['auth']['list_users'] == 'both')): ?>
 <tr>
-<?php if ($auth->hasCapability('list')): ?>
   <td class="light">
     <label for="u_names_new" class="hidden"><?php echo _("Select a user to add:") ?></label>
-    <select id="u_names_new" name="u_names[||new]">
+    <select id="u_names_new" name="u_names[||new_select]">
       <option value=""><?php echo _("Select a user to add:") ?></option>
 <?php
 foreach ($userList as $user) {
-    if (!isset($userperms[Auth::addHook($user)]) &&
+    if (!isset($userperms[Horde_Auth::addHook($user)]) &&
         $user != Horde_Auth::removeHook($owner)) {
 ?>
       <option value="<?php echo htmlspecialchars($user) ?>"><?php echo htmlspecialchars($user) ?></option>
 <?php } } ?>
     </select>
   </td>
-<?php else: ?>
+  <td align="center">
+    <input type="checkbox" id="u_show_new" name="u_show[||new_select]" />
+    <label for="u_show_new" class="hidden"><?php echo _("Show") ?></label>
+  </td>
+  <td align="center">
+    <input type="checkbox" id="u_read_new" name="u_read[||new_select]" />
+    <label for="u_read_new" class="hidden"><?php echo _("Read") ?></label>
+  </td>
+  <td align="center">
+    <input type="checkbox" id="u_edit_new" name="u_edit[||new_select]" />
+    <label for="u_edit_new" class="hidden"><?php echo _("Edit") ?></label>
+  </td>
+  <td align="center">
+    <input type="checkbox" id="u_delete_new" name="u_delete[||new_select]" />
+    <label for="u_delete_new" class="hidden"><?php echo _("Delete") ?></label>
+  </td>
+  <td align="center">
+    <input type="checkbox" id="u_delegate_new" name="u_delegate[||new_select]" />
+    <label for="u_delegate_new" class="hidden"><?php echo _("Delegate") ?></label>
+  </td>
+</tr>
+<?php endif; ?>
+<?php if (!$auth->hasCapability('list') || !isset($GLOBALS['conf']['auth']['list_users']) || $GLOBALS['conf']['auth']['list_users'] == 'input' || $GLOBALS['conf']['auth']['list_users'] == 'both'): ?>
+<tr>
   <td class="light">
+<?php if ($auth->hasCapability('list') && isset($GLOBALS['conf']['auth']['list_users']) && $GLOBALS['conf']['auth']['list_users'] == 'both'): ?>
+    <?php echo _("Or enter a user name:") ?>
+<?php endif; ?>
     <label for="u_names_new" class="hidden"><?php echo _("User to add:") ?></label>
-    <input type="text" id="u_names_new" name="u_names[||new]" />
+    <input type="text" id="u_names_new" name="u_names[||new_input]" />
   </td>
-<?php endif; ?>
   <td align="center">
-    <input type="checkbox" id="u_show_new" name="u_show[||new]" />
+    <input type="checkbox" id="u_show_new" name="u_show[||new_input]" />
     <label for="u_show_new" class="hidden"><?php echo _("Show") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="u_read_new" name="u_read[||new]" />
+    <input type="checkbox" id="u_read_new" name="u_read[||new_input]" />
     <label for="u_read_new" class="hidden"><?php echo _("Read") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="u_edit_new" name="u_edit[||new]" />
+    <input type="checkbox" id="u_edit_new" name="u_edit[||new_input]" />
     <label for="u_edit_new" class="hidden"><?php echo _("Edit") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="u_delete_new" name="u_delete[||new]" />
+    <input type="checkbox" id="u_delete_new" name="u_delete[||new_input]" />
     <label for="u_delete_new" class="hidden"><?php echo _("Delete") ?></label>
   </td>
   <td align="center">
-    <input type="checkbox" id="u_delegate_new" name="u_delegate[||new]" />
+    <input type="checkbox" id="u_delegate_new" name="u_delegate[||new_input]" />
     <label for="u_delegate_new" class="hidden"><?php echo _("Delegate") ?></label>
   </td>
   <td>&nbsp;</td>
 </tr>
+<?php endif; ?>
 
 <!-- Spacer -->
 <tr><td colspan="7">&nbsp;</td></tr>