Don't retrieve user list if we don't display it anyway.
authorJan Schneider <jan@horde.org>
Tue, 2 Mar 2010 18:17:42 +0000 (19:17 +0100)
committerJan Schneider <jan@horde.org>
Tue, 2 Mar 2010 18:17:42 +0000 (19:17 +0100)
horde/services/shares/edit.php
kronolith/perms.php

index a05bc7b..0fa50b9 100644 (file)
@@ -261,7 +261,9 @@ if (is_a($share, 'PEAR_Error')) {
     $title = sprintf(_("Edit permissions for \"%s\""), $share->get('name'));
 }
 
-if ($auth->hasCapability('list')) {
+if ($auth->hasCapability('list') &&
+    ($conf['auth']['list_users'] == 'list' ||
+     $conf['auth']['list_users'] == 'both')) {
     $userList = $auth->listUsers();
     if ($userList instanceof PEAR_Error) {
         Horde::logMessage($userList, __FILE__, __LINE__, PEAR_LOG_ERR);
index aa95bd3..0914b3f 100644 (file)
@@ -270,7 +270,9 @@ if ($share instanceof PEAR_Error) {
     $title = sprintf(_("Edit Permissions for %s"), $share->get('name'));
 }
 
-if ($auth->hasCapability('list')) {
+if ($auth->hasCapability('list') &&
+    ($conf['auth']['list_users'] == 'list' ||
+     $conf['auth']['list_users'] == 'both')) {
     try {
         $userList = $auth->listUsers();
     } catch (Exception $e) {