diff --git a/lib/ds.php b/lib/ds.php index 281c479..24f321c 100644 --- a/lib/ds.php +++ b/lib/ds.php @@ -661,6 +661,8 @@ class Datastore { if (! $isVisible || ($isVisible && $server->getValue('server','visible'))) $CACHE[$isVisible][$id] = $server; + masort($CACHE[$isVisible],'name'); + return $CACHE[$isVisible]; } diff --git a/lib/ds_ldap_pla.php b/lib/ds_ldap_pla.php index d3ae234..fe2274b 100644 --- a/lib/ds_ldap_pla.php +++ b/lib/ds_ldap_pla.php @@ -127,6 +127,19 @@ class ldap_pla extends ldap { 'default'=>null); } + public function __get($key) { + switch ($key) { + case 'name': + return $this->getValue('server','name'); + + default: + system_message(array( + 'title'=>_('Unknown request for Object value.'), + 'body'=>sprintf(_('Attempt to obtain value %s from %s'),$key,get_class($this)), + 'type'=>'error')); + } + } + /** * Gets whether the admin has configured phpLDAPadmin to show the "Create New" link in the tree viewer. * diff --git a/lib/functions.php b/lib/functions.php index 381a434..d26813a 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -1000,7 +1000,7 @@ function get_custom_file($index,$filename,$path) { * @return array Sorted multi demension array. */ function masort(&$data,$sortby,$rev=0) { - if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) + if (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs); # if the array to sort is null or empty