Miscellaneous minor updates

This commit is contained in:
Deon George
2009-08-28 20:07:56 +10:00
parent 52fbd24b2c
commit 9cb27e3a70
10 changed files with 23 additions and 20 deletions

View File

@@ -1113,7 +1113,7 @@ class Template extends xmlTemplate {
$sattr = $this->getServer()->getSchemaAttribute($checkattr);
# If the attribute is the same as in the XML file, then dont need to do anything.
if (! strcasecmp($sattr->getName(),$checkattr))
if (! $sattr || ! strcasecmp($sattr->getName(),$checkattr))
continue;
$formula = preg_replace("/$checkattr/",$sattr->getName(),$formula);

View File

@@ -683,7 +683,7 @@ class Config {
}
public function configDefinition($key,$index,$config) {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
if (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',3,0,__FILE__,__LINE__,__METHOD__,$fargs);
if (! is_array($config) || ! array_key_exists('desc',$config) || ! array_key_exists('default',$config))

View File

@@ -427,7 +427,7 @@ abstract class DS {
*/
public function isSessionValid() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',17,0,__FILE__,__LINE__,__METHOD__,$fargs,true);
debug_log('Entered (%%)',17,1,__FILE__,__LINE__,__METHOD__,$fargs,true);
return true;
}

View File

@@ -7,7 +7,7 @@
*/
/**
* This abstract class provides the basic variables and methods for LDAP datastores:wq
* This abstract class provides the basic variables and methods for LDAP datastores
*
* @package phpLDAPadmin
* @subpackage DataStore
@@ -243,7 +243,6 @@ class ldap extends DS {
* Login to the database with the application user/password
*
* @return boolean true|false for successful login.
* @todo isLoginStringEnabled() based logins
*/
public function login($user=null,$pass=null,$method=null,$new=false) {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
@@ -487,7 +486,7 @@ class ldap extends DS {
return null;
$detail = array_shift($result);
if (! isset($detail['dn']))
die('ERROR: DN missing?');
else

View File

@@ -486,8 +486,8 @@ function debug_log($msg,$level,$indent) {
static $debug_file;
# In case we are called before we are fully initialised or if debugging is not set.
if (! isset($_SESSION[APPCONFIG]) ||
! ($_SESSION[APPCONFIG]->getValue('debug','file') || $_SESSION[APPCONFIG]->getValue('debug','syslog')))
if (! isset($_SESSION[APPCONFIG])
|| ! ($_SESSION[APPCONFIG]->getValue('debug','file') || $_SESSION[APPCONFIG]->getValue('debug','syslog')))
return;
$debug_level = $_SESSION[APPCONFIG]->getValue('debug','level');
@@ -2860,6 +2860,7 @@ function binSIDtoText($binsid) {
* or true to have the returned array sorted by DN (uses ksort)
* or an array of attribute names to sort by attribute values
* @return array Array of values keyed by $key.
* @todo sort is not being performed
*/
function return_ldap_hash($base,$filter,$key,$attrs,$sort=true) {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))

View File

@@ -42,7 +42,7 @@ abstract class SchemaItem {
public function getOID() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',9,0,__FILE__,__LINE__,__METHOD__,$fargs);
debug_log('Entered (%%)',9,1,__FILE__,__LINE__,__METHOD__,$fargs,$this->oid);
return $this->oid;
}