From d5b4aa54ea022cf0a43f92252e1106c1b9e1fa0c Mon Sep 17 00:00:00 2001 From: Deon George Date: Tue, 30 Jun 2009 21:50:46 +1000 Subject: [PATCH] RELEASE 1.1.0.4 --- VERSION | 2 +- config/config.php.example | 11 +- htdocs/cmd.php | 9 +- htdocs/images/favicon.ico | Bin 501 -> 902 bytes htdocs/index.php | 5 +- htdocs/login.php | 4 +- lib/Entry.php | 16 +- lib/EntryWriter1.php | 22 +- lib/common.php | 9 +- lib/config_default.php | 62 ++--- lib/functions.php | 315 +++++++++++------------ lib/page.php | 21 +- lib/server_functions.php | 10 +- lib/template_functions.php | 6 +- templates/modification/inetOrgPerson.xml | 2 +- 15 files changed, 262 insertions(+), 232 deletions(-) diff --git a/VERSION b/VERSION index 2b18102..d3da947 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -$Name: RELEASE-1_1_0_3 $ +$Name: RELEASE-1_1_0_4 $ diff --git a/config/config.php.example b/config/config.php.example index 4c380ae..0872fd4 100644 --- a/config/config.php.example +++ b/config/config.php.example @@ -84,13 +84,14 @@ $config->custom->commands['all'] = array( 'credits' => true), 'purge' => true, 'schema' => true, - 'import' => false, + 'import' => true, 'export' => true, + 'logout' => true, 'search' => array('simple_search' => true, - 'predefined_search' => false, - 'advanced_search' => false), - 'server_refresh' => false, - 'server_info' => false, + 'predefined_search' => true, + 'advanced_search' => true), + 'server_refresh' => true, + 'server_info' => true, 'entry_refresh' => true, 'entry_move' => true, 'entry_internal_attributes_show' => true, diff --git a/htdocs/cmd.php b/htdocs/cmd.php index fce9f57..c2ba30d 100644 --- a/htdocs/cmd.php +++ b/htdocs/cmd.php @@ -1,5 +1,5 @@ O^;lT&e_~5HAq)MB;eO=kE)zDkOS_9g~;$o?_wouE$7D_P? zYtYsZjKm8_YLq5)6N#l&u?Z$#3J)L{(oh?+R@_Us+i$&fki3mV>f$sszDGmTQR}*SroV<+B z7bOsia`uY}{J{`@<0)?ad6m-NcaMDi@hQq8XGuJEm>th|viJ3a*m-37+aHPT>Y}D5 zO3*N<4pnmF_8i`w6vujc8Qr&E*J-}_=sf4fCb;Po()IYvHfMfnwZ32W3aL6 zNp3D&f!lZZ?9eb{eS4Vv-~{h?9pXg)2)|vJ<(HXRYKccaMRg}i^(Lfwzt!|y^URObTj+&EDolSx|<$*JI*_u zuj%`;!U{6jwwsYX1I%BY(|EgbKjs?m5*l|`R@|IqZr_FIOQDcotC{S*@xwxa*yk* YMe{(9{HK7{tQA@BYF()kDm_O21(rh|qyPW_ literal 501 zcmex=O8CaQFSXh`@fdnfnD;qlx2Rjh(b8~a@2=WUF3GxdH z3X92z3yVmJ3JOXnN=V7d%FD|Oiz}%p$*IW5$;*KZVFYSrXJhB%;NX)J5fqUl8T>!M zAjrYM$H2$TsKme|$jB_n`2Prl7}#$RPe4dE7IvVxvH$}UBQpy#12asHk(r5wRgg_c zSdoF9!?188P?0DoTu=ZLGf-GskbwzFBTxa5%P1)9c=7)&1|DWcpzX|p4E79HBx|l{ zTwQIvJ63de;8stbwW_`@9Cv0c`K~E@@tDd9oQ`9!VqqE@b-Q8uMgj^%0_)x!4Y0hcWPSbvOWqTmGbf8&yIQB--~9h30H$($ AfdBvi diff --git a/htdocs/index.php b/htdocs/index.php index 372a8de..0793a84 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -1,5 +1,5 @@ isLoginStringEnabled()) { - $login['dn'] = str_replace('',$ldapserver->getLoginAttr(),$ldapserver->getLoginString()); + $login['dn'] = str_replace('',$login['val'],$ldapserver->getLoginString()); if (DEBUG_ENABLED) debug_log('LoginStringDN: [%s]',64,__FILE__,__LINE__,__METHOD__,$login['dn']); diff --git a/lib/Entry.php b/lib/Entry.php index 660e210..697c31a 100644 --- a/lib/Entry.php +++ b/lib/Entry.php @@ -1,5 +1,5 @@ selected_template)) + return $this->selected_template; + else + return ''; + } + + public function getTemplateTitle() { + if (isset($this->selected_template['title'])) + return $this->templates[$this->selected_template]['title']; + else + return _('No Template'); + } + /** * Visit the entry and its attributes * diff --git a/lib/EntryWriter1.php b/lib/EntryWriter1.php index 813263b..5c30bae 100644 --- a/lib/EntryWriter1.php +++ b/lib/EntryWriter1.php @@ -1,5 +1,5 @@ '; echo $this->ldapserver->name; echo '     '; + echo _('Distinguished Name'); echo _(':'); echo ' '; echo htmlspecialchars($entry->getDn()); - echo ''; + echo ''; + echo '
'; + + echo _('Template'); + echo _(':'); + echo ' '; + echo htmlspecialchars($entry->getTemplateTitle()); + echo ''; + if ($entry->getTemplateName()) { + echo ' ('; + echo htmlspecialchars($entry->getTemplateName()); + echo ')'; + } + echo ''; } protected function drawDefaultEditingEntryMenu($entry) { @@ -2288,8 +2302,8 @@ class EntryWriter1 extends EntryWriter { protected function drawObjectClassAttributeIcon($attribute, $val) { if (strlen($val) > 0) { - $href = htmlspecialchars(sprintf('cmd.php?cmd=schema&server_id=%s&view=objectClasses&viewvalue=%s', - $this->ldapserver->server_id, $val)); + $href = sprintf('cmd.php?cmd=schema&server_id=%s&view=objectClasses&viewvalue=%s', + $this->ldapserver->server_id, $val); printf('Info ', _('View the schema description for this objectClass'), htmlspecialchars($href)); } diff --git a/lib/common.php b/lib/common.php index 6074d0e..5b771b2 100644 --- a/lib/common.php +++ b/lib/common.php @@ -1,5 +1,5 @@ array('cn','sn','uid','postalAddress','telephoneNumber')); } + private function getConfigArray($usecache=true) { + global $CACHE; + + if ($usecache && isset($CACHE[__METHOD__])) + return $CACHE[__METHOD__]; + + foreach ($this->default as $key => $vals) + $CACHE[__METHOD__][$key] = $vals; + + foreach ($this->custom as $key => $vals) + foreach ($vals as $index => $val) + $CACHE[__METHOD__][$key][$index]['value'] = $val; + + return $CACHE[__METHOD__]; + } + + /** + * Get a configuration value. + */ public function GetValue($key,$index) { + $config = $this->getConfigArray(); - $value = null; - - if (! isset($this->default->$key)) - pla_error(sprintf('A call was made in [%s] to GetValue requesting [%s] that isnt predefined.', + if (! isset($config[$key])) + error(sprintf('A call was made in [%s] to GetValue requesting [%s] that isnt predefined.', basename($_SERVER['PHP_SELF']),$key)); - else - $default = $this->default->$key; - if (! isset($default[$index])) - pla_error("Requesting a index [$index] that isnt predefined."); - else - $default = $default[$index]; + if (! isset($config[$key][$index])) + error("Requesting a index [$index] that isnt predefined."); - if (isset($default['default'])) - $value = $default['default']; - - if (isset($this->custom->$key)) { - $custom = $this->custom->$key; - - if (isset($custom[$index])) - $value = $custom[$index]; - } - - //print "Returning [$value] for key [$key], index [$index]
"; - return $value; + return isset($config[$key][$index]['value']) ? $config[$key][$index]['value'] : $config[$key][$index]['default']; } /** @@ -515,23 +518,23 @@ class Config { if (isset($this->default->$masterkey)) { if (! is_array($masterdetails)) - pla_error("Error in configuration file, [$masterdetails] should be an ARRAY."); + error("Error in configuration file, [$masterdetails] should be an ARRAY."); foreach ($masterdetails as $key => $value) { # Test that the key is correct. if (! in_array($key,array_keys($this->default->$masterkey))) - pla_error("Error in configuration file, [$key] has not been defined as a PLA configurable variable."); + error("Error in configuration file, [$key] has not been defined as a PLA configurable variable."); # Test if its should be an array or not. if (is_array($this->default->{$masterkey}[$key]['default']) && ! is_array($value)) - pla_error("Error in configuration file, {$masterkey}['$key'] SHOULD be an array of values."); + error("Error in configuration file, {$masterkey}['$key'] SHOULD be an array of values."); if (! is_array($this->default->{$masterkey}[$key]['default']) && is_array($value)) - pla_error("Error in configuration file, {$masterkey}['$key'] should NOT be an array of values."); + error("Error in configuration file, {$masterkey}['$key'] should NOT be an array of values."); } } else { - pla_error("Error in configuration file, [$masterkey] has not been defined as a PLA MASTER configurable variable."); + error("Error in configuration file, [$masterkey] has not been defined as a PLA MASTER configurable variable."); } } } @@ -627,7 +630,8 @@ class Config { */ public function getFriendlyHTML($attr) { if ($this->haveFriendlyName($attr)) - return sprintf('%s',_('Alias for'),$attr,htmlspecialchars($this->getFriendlyName($attr))); + return sprintf('%s', + _('Alias for'),$attr,htmlspecialchars($this->getFriendlyName($attr))); else return $attr; } diff --git a/lib/functions.php b/lib/functions.php index cccea1d..549336c 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -1,5 +1,5 @@ '; + $body .= sprintf('%s:%s (%s)',_('Error'),$errstr,$errtype); + $body .= sprintf('%s:%s %s %s, %s %s', + _('File'),$file,_('line'),$lineno,_('caller'),$caller); + $body .= sprintf('Versions:PLA: %s, PHP: %s, SAPI: %s', + pla_version(),phpversion(),php_sapi_name()); + $body .= sprintf('Web server:%s',$_SERVER['SERVER_SOFTWARE']); + + if (function_exists('get_href')) + $body .= sprintf('
%s.
', + get_href('search_bug',"&summary_keyword=".htmlspecialchars($errstr)), + _('Please check and see if this bug has been reported')); + $body .= ''; + + system_message(array( + 'title'=>_('You found a non-fatal phpLDAPadmin bug!'), + 'body'=>$body, + 'type'=>'error')); + + return; + } + + # If this is a more serious error, call the error call. + error(sprintf('%s: %s',$errtype,$errstr),'error',-1,true,true); +} + /** * Returns the phpLDAPadmin version currently running. The version * is read from the file named VERSION. @@ -156,7 +241,7 @@ function check_config($config_file) { 'type'=>'error')); # Make sure their session save path is writable, if they are using a file system session module, that is. - if ( ! strcasecmp('Files',session_module_name() && ! is_writable(realpath(session_save_path())))) + if (! strcasecmp('Files',session_module_name() && ! is_writable(realpath(session_save_path())))) system_message(array( 'title'=>_('Missing required extension'), 'body'=> 'Your PHP session configuration is incorrect. Please check the value of session.save_path in your php.ini to ensure that the directory specified there exists and is writable. The current setting of "'.session_save_path().'" is un-writable by the web server.', @@ -298,7 +383,7 @@ function cmd_control_pane() { */ function debug_dump($variable,$die=false,$onlydebugaddr=false) { if ($onlydebugaddr && - $_SESSION[APPCONFIG]->GetValue('debug','addr') && + isset($_SESSION[APPCONFIG]) && $_SESSION[APPCONFIG]->GetValue('debug','addr') && $_SERVER['HTTP_X_FORWARDED_FOR'] != $_SESSION[APPCONFIG]->GetValue('debug','addr') && $_SERVER['REMOTE_ADDR'] != $_SESSION[APPCONFIG]->GetValue('debug','addr')) return; @@ -424,24 +509,58 @@ function error($msg,$type='note',$fatal=false,$backtrace=false) { global $www; global $counter; - # if the error is fatal, we'll need to stop here. - if (! isset($www['page']) && $fatal) - $www['page'] = new page(null); - # Just a check to see that we are called right. if (! isset($www['page']) && ! $fatal) die("Function error called incorrectly [$msg]"); + # if the error is fatal, we'll need to stop here. + if (! isset($www['page'])) + $www['page'] = new page(null); + $www['page']->setsysmsg(array('title'=>_('Error'),'body'=>$msg,'type'=>$type)); # Spin loop detection if ($counter++ > 20) { - debug_dump("Spin loop detection."); + debug_dump('Spin loop detection.'); debug_dump(array('msg'=>$msg,'session'=>$_SESSION['sysmsg'],'www'=>$www),1); } - if ($fatal) + # Do we have a backtrace to display? + if ($backtrace) { + $backtraceblock = new block(); + $backtraceblock->SetTitle('PHP Debug Backtrace'); + + $body = ''; + $body .= "\n"; + foreach (debug_backtrace() as $error => $line) { + $body .= sprintf('', + _('File'),isset($line['file']) ? $line['file'] : '',isset($line['line']) ? $line['line'] : ''); + + $body .= sprintf(''; + $body .= "\n"; + } + $body .= '
%s%s (%s)
 %s%s', + _('Function'),$line['function']); + + if (isset($line['args'])) + if (file_exists(LIBDIR.'../tools/unserialize.php')) + $body .= sprintf(' (%s)', + '/tools/unserialize.php', + htmlspecialchars(serialize($line['args'])), + htmlspecialchars(serialize($line['args']))); + else + $body .= sprintf(' (%s)',htmlspecialchars(serialize($line['args']))); + $body .= '
'; + $body .= "\n"; + $backtraceblock->SetBody($body); + + $www['page']->block_add('body',$backtraceblock); + } + + if ($fatal) { $www['page']->display(array('tree'=>false)); + die(); + } } /** @@ -492,6 +611,9 @@ function system_message($msg,$redirect=null) { if (! isset($msg['title']) && ! isset($msg['body'])) return null; + if (! isset($msg['type'])) + $msg['type'] = 'info'; + $_SESSION['sysmsg'][] = $msg; if ($redirect) { @@ -614,13 +736,13 @@ function get_cached_item($server_id,$item,$subitem='null') { # Check config to make sure session-based caching is enabled. if ($_SESSION[APPCONFIG]->GetValue('cache',$item)) { - global $cache; - if (isset($cache[$server_id][$item][$subitem])) { + global $CACHE; + if (isset($CACHE[$server_id][$item][$subitem])) { if (DEBUG_ENABLED) debug_log('Returning MEMORY cached [%s] (%s)',1,__FILE__,__LINE__,__METHOD__, $item,$subitem); - $return = $cache[$server_id][$item][$subitem]; + $return = $CACHE[$server_id][$item][$subitem]; } elseif (isset($_SESSION['cache'][$server_id][$item][$subitem])) { if (DEBUG_ENABLED) @@ -628,7 +750,7 @@ function get_cached_item($server_id,$item,$subitem='null') { $item,$subitem); $return = $_SESSION['cache'][$server_id][$item][$subitem]; - $cache[$server_id][$item][$subitem] = $return; + $CACHE[$server_id][$item][$subitem] = $return; } } @@ -652,9 +774,9 @@ function set_cached_item($server_id,$item,$subitem='null',$data) { # Check config to make sure session-based caching is enabled. if ($_SESSION[APPCONFIG]->GetValue('cache',$item)) { - global $cache; + global $CACHE; - $cache[$server_id][$item][$subitem] = $data; + $CACHE[$server_id][$item][$subitem] = $data; $_SESSION['cache'][$server_id][$item][$subitem] = $data; return true; @@ -1631,177 +1753,42 @@ function support_oid_to_text($oid_id) { * @see ldap_errno * @see pla_verbose_error */ -function pla_error($msg,$ldap_err_msg=null,$ldap_err_no=-1,$fatal=true,$backtrace=null) { +function pla_error($msg,$ldap_err_msg=null,$ldap_err_no=-1,$fatal=true) { if (defined('DEBUG_ENABLED') && (DEBUG_ENABLED)) debug_log('Entered with (%s,%s,%s,%s,%s)',1,__FILE__,__LINE__,__METHOD__, $msg,$ldap_err_msg,$ldap_err_no,$fatal,$backtrace); - $server = isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : 'undefined'; - - if ($fatal) { - include_once HTDOCDIR.'header.php'; - echo ''; - } - - echo '
'; - echo ''; - - printf('',_('Error')); - - echo ''; - echo ''; - printf('',$msg); - echo ''; - - echo ''; + $title = ''; if (function_exists('syslog_err')) syslog_err($msg); if ($ldap_err_msg) - printf('',_('LDAP said'),htmlspecialchars($ldap_err_msg)); + $title = sprintf('%s: %s',_('LDAP said'),htmlspecialchars($ldap_err_msg)); if ($ldap_err_no != -1) { + $body = '
%s
Warning%s
 
%s: %s
'; + $ldap_err_no = ('0x'.str_pad(dechex($ldap_err_no),2,0,STR_PAD_LEFT)); $verbose_error = pla_verbose_error($ldap_err_no); if ($verbose_error) { - printf('',_('Error number'),$ldap_err_no,$verbose_error['title']); - printf('',_('Description'),$verbose_error['desc']); + $body .= sprintf('',_('Error number'),$ldap_err_no,$verbose_error['title']); + $body .= sprintf('',_('Description'),$verbose_error['desc']); } else { - printf('',_('Error number'),$ldap_err_no); - printf('',_('Description'),_('no description available')); + $body .= sprintf('',_('Error number'),$ldap_err_no); + $body .= sprintf('',_('Description'),_('no description available')); } - - echo ''; + $body .= '
%s: %s (%s)
%s: %s
%s: %s (%s)
%s: %s
%s: %s
%s: (%s)
%s: %s
%s: (%s)
 
'; if (function_exists('syslog_err')) syslog_err(sprintf('%s %s',_('Error number'),$ldap_err_no)); - } elseif ((defined('DEBUG_ENABLED') && DEBUG_ENABLED && function_exists('debug_backtrace')) || $backtrace) { - printf('%s',_('Backtrace')); - - if (is_null($backtrace)) - $backtrace = debug_backtrace(); - - printf(' %s%s', - 'PHP Version',phpversion()); - printf(' %s%s', - 'PLA Version',pla_version()); - printf(' %s%s', - 'PHP SAPI',php_sapi_name()); - printf(' %s%s', - 'Web Server',$server); - - echo ' '; - - foreach ($backtrace as $error => $line) { - printf(' %s%s (%s)', - _('File'),isset($line['file']) ? $line['file'] : '',isset($line['line']) ? $line['line'] : ''); - printf('%s%s
',_('Function'),$line['function']);
-			if (isset($line['args'])) print_r($line['args']);
-			echo '
'; - } - - /* -
- - */ - } - echo ''; - echo '
'; - - if ($fatal) { - echo ''; - echo ''; - die(); - } -} - -/** - * phpLDAPadmin's custom error handling function. When a PHP error occurs, - * PHP will call this function rather than printing the typical PHP error string. - * This provides phpLDAPadmin the ability to format an error message more "pretty" - * and provide a link for users to submit a bug report. This function is not to - * be called by users. It is exclusively for the use of PHP internally. If this - * function is called by PHP from within a context where error handling has been - * disabled (ie, from within a function called with "@" prepended), then this - * function does nothing. - * - * @param int $errno The PHP error number that occurred (ie, E_ERROR, E_WARNING, E_PARSE, etc). - * @param string $errstr The PHP error string provided (ie, "Warning index "foo" is undefined) - * @param string $file The file in which the PHP error ocurred. - * @param int $lineno The line number on which the PHP error ocurred - * - * @see set_error_handler - */ -function pla_error_handler($errno,$errstr,$file,$lineno) { - if (defined('DEBUG_ENABLED') && DEBUG_ENABLED) - debug_log('Entered with (%s,%s,%s,%s)',1,__FILE__,__LINE__,__METHOD__, - $errno,$errstr,$file,$lineno); - - /* error_reporting will be 0 if the error context occurred - * within a function call with '@' preprended (ie, @ldap_bind() ); - * So, don't report errors if the caller has specifically - * disabled them with '@' - */ - if (ini_get('error_reporting') == 0 || error_reporting() == 0) - return; - - $file = basename($file); - $caller = basename($_SERVER['PHP_SELF']); - $errtype = ''; - - switch ($errno) { - case E_STRICT: $errtype = 'E_STRICT'; break; - case E_ERROR: $errtype = 'E_ERROR'; break; - case E_WARNING: $errtype = 'E_WARNING'; break; - case E_PARSE: $errtype = 'E_PARSE'; break; - case E_NOTICE: $errtype = 'E_NOTICE'; break; - case E_CORE_ERROR: $errtype = 'E_CORE_ERROR'; break; - case E_CORE_WARNING: $errtype = 'E_CORE_WARNING'; break; - case E_COMPILE_ERROR: $errtype = 'E_COMPILE_ERROR'; break; - case E_COMPILE_WARNING: $errtype = 'E_COMPILE_WARNING'; break; - case E_USER_ERROR: $errtype = 'E_USER_ERROR'; break; - case E_USER_WARNING: $errtype = 'E_USER_WARNING'; break; - case E_USER_NOTICE: $errtype = 'E_USER_NOTICE'; break; - case E_ALL: $errtype = 'E_ALL'; break; - - default: $errtype = sprintf('%s: %s',_('Unrecognized error number'),$errno); + } else { + $body = $msg; } - $errstr = preg_replace('/\s+/',' ',$errstr); - - if ($errno == E_NOTICE) { - $body = ''; - $body .= sprintf('',_('Error'),$errstr,$errtype); - $body .= sprintf('', - _('File'),$file,_('line'),$lineno,_('caller'),$caller); - $body .= sprintf('', - pla_version(),phpversion(),php_sapi_name()); - $body .= sprintf('',$_SERVER['SERVER_SOFTWARE']); - - $body .= sprintf('', - get_href('search_bug',"&summary_keyword=".htmlspecialchars($errstr)), - _('Please check and see if this bug has been reported')); - $body .= '
%s:%s (%s)
%s:%s %s %s, %s %s
Versions:PLA: %s, PHP: %s, SAPI: %s
Web server:%s
%s.
'; - - system_message(array( - 'title'=>_('You found a non-fatal phpLDAPadmin bug!'), - 'body'=>$body, - 'type'=>'error')); - - return; - } - - pla_error(sprintf('%s: %s',$errtype,$errstr),null,-1,true,debug_backtrace()); + system_message(array('title'=>$title ? $title : 'Error','body'=>$body,'type'=>'error'),$fatal ? 'index.php' : null); } /** @@ -2284,7 +2271,7 @@ function pla_explode_dn($dn,$with_attributes=0) { if (DEBUG_ENABLED) debug_log('Returning NULL - NO result.',1,__FILE__,__LINE__,__METHOD__); - return null; + return array(); } # Remove our count value that ldap_explode_dn returns us. diff --git a/lib/page.php b/lib/page.php index e173717..59ed212 100644 --- a/lib/page.php +++ b/lib/page.php @@ -1,5 +1,5 @@ _default['stylecss'] = CSSDIR.'style.css'; - $this->_default['logo'] = 'images/logo_small.jpg'; - $this->_default['sysmsg']['error'] = 'images/warning.png'; - $this->_default['sysmsg']['warn'] = 'images/notice.png'; - $this->_default['sysmsg']['info'] = 'images/light-big.png'; + $this->_default['logo'] = IMGDIR.'logo_small.jpg'; + $this->_default['sysmsg']['error'] = IMGDIR.'warning.png'; + $this->_default['sysmsg']['warn'] = IMGDIR.'notice.png'; + $this->_default['sysmsg']['info'] = IMGDIR.'light-big.png'; # Capture any output so far (in case we send some headers below) - there shouldnt be any output anyway. $preOutput = ''; @@ -162,13 +162,14 @@ class page { foreach (cmd_control_pane() as $cmd => $cmddetails) { $cmds = preg_split('/:/',$cmd); - if ($_SESSION[APPCONFIG]->isCommandAvailable($cmds)) { - if ((isset($cmddetails['enable']) && trim($cmddetails['enable'])) || ! isset($cmddetails['enable'])) { - printf('%s',$cmddetails['link']); + if (defined('APPCONFIG') && isset($_SESSION[APPCONFIG]) && method_exists($_SESSION[APPCONFIG],'isCommandAvailable')) + if ($_SESSION[APPCONFIG]->isCommandAvailable($cmds)) { + if ((isset($cmddetails['enable']) && trim($cmddetails['enable'])) || ! isset($cmddetails['enable'])) { + printf('%s',$cmddetails['link']); - $empty = false; + $empty = false; + } } - } } if ($empty) diff --git a/lib/server_functions.php b/lib/server_functions.php index 14001e0..c2e361b 100644 --- a/lib/server_functions.php +++ b/lib/server_functions.php @@ -1,5 +1,5 @@ GetValue('appearance','custom_templates_only') + && ! preg_match('/^custom_/',$file)) + continue; + $objXML = new xml2array(); $xmldata = $objXML->parse(TMPLDIR.'modification/'.$file); diff --git a/templates/modification/inetOrgPerson.xml b/templates/modification/inetOrgPerson.xml index 1456ab6..385b472 100644 --- a/templates/modification/inetOrgPerson.xml +++ b/templates/modification/inetOrgPerson.xml @@ -4,7 +4,7 @@ Address Book Entry ^uid=.*, images/user.png -1 +0 uid