RELEASE 0.9.6c

This commit is contained in:
Deon George 2009-06-30 19:25:54 +10:00
parent 0074652abf
commit bc6a3bea7a
8 changed files with 87 additions and 25 deletions

View File

@ -1 +1 @@
0.9.6b 0.9.6c

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/functions.php,v 1.251 2005/03/26 01:18:24 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/functions.php,v 1.252 2005/04/15 13:16:58 wurley Exp $
/** /**
* A collection of functions used throughout phpLDAPadmin. * A collection of functions used throughout phpLDAPadmin.
@ -2264,7 +2264,7 @@ function pla_error( $msg, $ldap_err_msg=null, $ldap_err_no=-1, $fatal=true )
<?php <?php
if ( isset($use_syslog) and $use_syslog ) if ( isset($use_syslog) and $use_syslog )
syslog_msg ( LOG_ERR, $msg ); syslog_err ( $msg );
if( $ldap_err_msg ) { if( $ldap_err_msg ) {
echo sprintf($lang['ldap_said'], htmlspecialchars( $ldap_err_msg )); echo sprintf($lang['ldap_said'], htmlspecialchars( $ldap_err_msg ));
@ -2286,7 +2286,7 @@ function pla_error( $msg, $ldap_err_msg=null, $ldap_err_no=-1, $fatal=true )
} }
if ( isset($use_syslog) and $use_syslog ) if ( isset($use_syslog) and $use_syslog )
syslog_msg ( LOG_ERR,sprintf($lang['ferror_number_short'], $ldap_err_no) ); syslog_err ( sprintf($lang['ferror_number_short'], $ldap_err_no) );
} }
?> ?>
<br /> <br />
@ -3789,7 +3789,7 @@ function debug_log($msg,$level=0) {
$debug_level = -1; $debug_level = -1;
if ($level <= $debug_level) if ($level <= $debug_level)
return syslog_msg( LOG_NOTICE,sprintf('%s(%s): %s',$caller,$level,$msg) ); return syslog_notice( sprintf('%s(%s): %s',$caller,$level,$msg) );
} }
function enc_type_select_list($enc_type) { function enc_type_select_list($enc_type) {

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/hooks.php,v 1.5 2005/04/05 07:34:24 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/hooks.php,v 1.6 2005/04/15 13:16:59 wurley Exp $
/** /**
* Functions related to hooks management. * Functions related to hooks management.
@ -58,11 +58,10 @@ function run_hook ( $hook_name, $args ) {
global $hooks; global $hooks;
$debug = 0; $debug = 0;
if ($debug) syslog_debug ( "Running hook $hook_name." );
syslog_msg ( LOG_DEBUG, "Running hook $hook_name." );
if ( ! array_key_exists ( $hook_name, $hooks ) ) { if ( ! array_key_exists ( $hook_name, $hooks ) ) {
syslog_msg ( LOG_NOTICE,"Hook '$hook_name' not defined !\n" ); syslog_notice ( "Hook '$hook_name' not defined !\n" );
return true; return true;
} }
@ -75,25 +74,22 @@ function run_hook ( $hook_name, $args ) {
* numerical weight. */ * numerical weight. */
while ( list ( $key, $hook ) = each ( $hooks[$hook_name] ) ) { while ( list ( $key, $hook ) = each ( $hooks[$hook_name] ) ) {
array_push ( $rollbacks, $hook['rollback_function'] ); array_push ( $rollbacks, $hook['rollback_function'] );
if ($debug) syslog_debug ( "Calling " . $hook['hook_function'] . "\n" );
syslog_msg ( LOG_DEBUG,"Calling " . $hook['hook_function'] . "\n" );
$result = call_user_func_array ( $hook['hook_function'], $args ); $result = call_user_func_array ( $hook['hook_function'], $args );
syslog_msg ( "Called " . $hook['hook_function'] . "\n" ); syslog_notice ( "Called " . $hook['hook_function'] . "\n" );
/** If a procedure fails, its optional rollback is executed with /** If a procedure fails, its optional rollback is executed with
* the same arguments. After that, all rollbacks from * the same arguments. After that, all rollbacks from
* previously executed procedures are executed in the reverse * previously executed procedures are executed in the reverse
* order. */ * order. */
if ( $result != true ) { if ( $result != true ) {
if ($debug) syslog_debug ( "Function " . $hook['hook_function'] . " returned $result\n" );
syslog_msg ( LOG_DEBUG, "Function " . $hook['hook_function'] . " returned $result\n" );
while ( $rollbacks ) { while ( $rollbacks ) {
$rollback = array_pop ( $rollbacks ); $rollback = array_pop ( $rollbacks );
if ( $rollback != false ) { if ( $rollback != false ) {
if ($debug) syslog_debug ( "Executing rollback $rollback\n" );
syslog_msg ( LOG_DEBUG,"Executing rollback $rollback\n" );
call_user_func_array ( $rollback, $args ); call_user_func_array ( $rollback, $args );
} }
} }

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/login.php,v 1.41 2005/04/03 09:24:41 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/login.php,v 1.42 2005/04/15 13:16:59 wurley Exp $
/** /**
* For servers whose auth_type is set to 'cookie' or 'session'. Pass me the login info * For servers whose auth_type is set to 'cookie' or 'session'. Pass me the login info
@ -120,7 +120,7 @@ if( ! is_resource( $ds ) ) {
else else
pla_error( $lang['bad_user_name_or_password'] ); pla_error( $lang['bad_user_name_or_password'] );
syslog_msg ( LOG_NOTICE,"Authentification FAILED for $dn" ); syslog_notice ( "Authentification FAILED for $dn" );
} }
$ldapserver->auth_type = $save_auth_type; $ldapserver->auth_type = $save_auth_type;
@ -132,7 +132,7 @@ $_SESSION['tree'][$ldapserver->server_id] = array();
$_SESSION['tree_icons'][$ldapserver->server_id] = array(); $_SESSION['tree_icons'][$ldapserver->server_id] = array();
if( ! $anon_bind ) { if( ! $anon_bind ) {
syslog_msg ( LOG_NOTICE,"Authentification successful for $dn" ); syslog_notice ( "Authentification successful for $dn" );
} }
session_write_close(); session_write_close();

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/logout.php,v 1.14 2005/03/16 11:20:25 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/logout.php,v 1.15 2005/04/15 13:16:59 wurley Exp $
/** /**
* For servers whose auth_type is set to 'cookie' or 'session'. Pass me * For servers whose auth_type is set to 'cookie' or 'session'. Pass me
@ -22,7 +22,7 @@ if( ! $ldapserver->haveAuthInfo())
pla_error( $lang['no_one_logged_in'] ); pla_error( $lang['no_one_logged_in'] );
if( in_array($ldapserver->auth_type, array('cookie','session')) ) { if( in_array($ldapserver->auth_type, array('cookie','session')) ) {
syslog_msg ( LOG_NOTICE,"Logout for " . get_logged_in_dn( $ldapserver ) ); syslog_notice ( "Logout for " . get_logged_in_dn( $ldapserver ) );
unset_login_dn( $ldapserver ) or pla_error( $lang['could_not_logout'] ); unset_login_dn( $ldapserver ) or pla_error( $lang['could_not_logout'] );
unset_lastactivity( $ldapserver ); unset_lastactivity( $ldapserver );
} else } else

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/syslog.php,v 1.5 2005/04/05 07:34:23 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/syslog.php,v 1.7 2005/04/18 21:24:44 wurley Exp $
/** /**
* Functions related to syslog logging. * Functions related to syslog logging.
@ -53,4 +53,66 @@ function syslog_msg ( $emergency, $log_string, $ldapserver=null ) {
return true; return true;
} }
/**
* Issue an error message via syslog.
*
* @param log_string Log message to send to syslog.
* @param server_id If set, print the logged user as well.
*
* @return true on success.
*/
function syslog_error ( $log_string, $ldapserver=null ) {
global $use_syslog;
if ( isset($use_syslog) && $use_syslog != false)
return syslog_msg ( LOG_ERR, $log_string, $ldapserver );
}
/**
* Issue a warning message via syslog.
*
* @param log_string Log message to send to syslog.
* @param server_id If set, print the logged user as well.
*
* @return true on success.
*/
function syslog_warning ( $log_string, $ldapserver=null ) {
global $use_syslog;
if ( isset($use_syslog) && $use_syslog != false)
return syslog_msg ( LOG_WARNING, $log_string, $ldapserver );
}
/**
* Issue a notice message via syslog.
*
* @param log_string Log message to send to syslog.
* @param server_id If set, print the logged user as well.
*
* @return true on success.
*/
function syslog_notice ( $log_string, $ldapserver=null ) {
global $use_syslog;
if ( isset($use_syslog) && $use_syslog != false)
return syslog_msg ( LOG_NOTICE, $log_string, $ldapserver );
}
/**
* Issue a debug message via syslog, only if $log_level is set to
* 'debug' from the config file.
*
* @param log_string Log message to send to syslog.
* @param server_id If set, print the logged user as well.
*
* @return true on success or if debug log is not activated.
*/
function syslog_debug ( $log_string, $ldapserver=null ) {
global $log_level;
if ( isset($log_level) and $log_level == 'debug' )
return syslog_msg ( LOG_DEBUG, $log_string, $ldapserver );
return true;
}
?> ?>

View File

@ -1,5 +1,5 @@
<?php <?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/modification/default.php,v 1.82 2005/03/21 21:17:29 wurley Exp $ // $Header: /cvsroot/phpldapadmin/phpldapadmin/templates/modification/default.php,v 1.83 2005/04/22 10:56:32 wurley Exp $
/* /*
@ -281,8 +281,12 @@ foreach( $attrs as $attr => $vals ) {
} }
// is this attribute required because its the RDN // is this attribute required because its the RDN
if (preg_match("/^${attr}=/",$rdn)) if (preg_match("/^${attr}=/",$rdn)) {
if( trim( $attr_note ) )
$attr_note .= ', ';
$attr_note .= "&nbsp;<acronym title=\"" . $lang['required_by_entry'] . "\">" . 'rdn' . "</acronym>&nbsp;"; $attr_note .= "&nbsp;<acronym title=\"" . $lang['required_by_entry'] . "\">" . 'rdn' . "</acronym>&nbsp;";
}
?> ?>
<?php <?php

View File

@ -70,7 +70,7 @@ function session_timed_out( $ldapserver )
if ( ( time()-$last_activity ) > ( $session_timeout*60 ) ) { if ( ( time()-$last_activity ) > ( $session_timeout*60 ) ) {
if( in_array($ldapserver->auth_type, array('cookie','session')) ) { if( in_array($ldapserver->auth_type, array('cookie','session')) ) {
syslog_msg ( LOG_NOTICE,"Logout for " . get_logged_in_dn( $ldapserver ) ); syslog_notice ( "Logout for " . get_logged_in_dn( $ldapserver ) );
unset_login_dn( $ldapserver ) or pla_error( $lang['could_not_logout'] ); unset_login_dn( $ldapserver ) or pla_error( $lang['could_not_logout'] );
} }