mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-25 16:19:00 +01:00
Started adding in some eventlog reporting
This commit is contained in:
parent
7017e7223c
commit
3c64f8fc3e
@ -38,6 +38,11 @@
|
||||
error_reporting(0);
|
||||
|
||||
$ldap = ldap_connect($phpgw_info['server']['ldap_host']);
|
||||
if (! $ldap)
|
||||
{
|
||||
$phpgw->log->message('F-Abort, Failed connecting to LDAP server for authenication, execution stopped');
|
||||
$phpgw->log->commit();
|
||||
}
|
||||
|
||||
/* find the dn for this uid, the uid is not always in the dn */
|
||||
$sri = ldap_search($ldap, $phpgw_info['server']['ldap_context'], 'uid='.$username);
|
||||
|
@ -196,7 +196,7 @@
|
||||
*/
|
||||
function ldapConnect($host = '', $dn = '', $passwd = '')
|
||||
{
|
||||
global $phpgw_info;
|
||||
global $phpgw_info, $phpgw;
|
||||
|
||||
if (! $host)
|
||||
{
|
||||
@ -216,6 +216,9 @@
|
||||
// connect to ldap server
|
||||
if (! $ds = ldap_connect($host))
|
||||
{
|
||||
$phpgw->log->message('F-Abort, Failed connecting to LDAP server');
|
||||
$phpgw->log->commit();
|
||||
|
||||
printf("<b>Error: Can't connect to LDAP server %s!</b><br>",$host);
|
||||
return False;
|
||||
}
|
||||
@ -223,6 +226,9 @@
|
||||
// bind as admin, we not to able to do everything
|
||||
if (! ldap_bind($ds,$dn,$passwd))
|
||||
{
|
||||
$phpgw->log->message('F-Abort, Failed binding to LDAP server');
|
||||
$phpgw->log->commit();
|
||||
|
||||
printf("<b>Error: Can't bind to LDAP server: %s!</b><br>",$dn);
|
||||
return False;
|
||||
}
|
||||
|
@ -127,6 +127,8 @@
|
||||
$this->read_repositories($phpgw_info['server']['cache_phpgw_info']);
|
||||
if ($this->user['expires'] != -1 && $this->user['expires'] < time())
|
||||
{
|
||||
$phpgw->log->message('W-VerifySession, account loginid %1 is expired',$this->account_lid);
|
||||
$phpgw->log->commit();
|
||||
return False;
|
||||
}
|
||||
|
||||
@ -138,6 +140,9 @@
|
||||
|
||||
if ($userid_array[1] != $phpgw_info['user']['domain'])
|
||||
{
|
||||
$phpgw->log->message('W-VerifySession, the domains %1 and %2 don\t match',$userid_array[1],$phpgw_info['user']['domain']);
|
||||
$phpgw->log->commit();
|
||||
|
||||
return False;
|
||||
}
|
||||
|
||||
@ -145,6 +150,10 @@
|
||||
{
|
||||
if (PHP_OS != 'Windows' && (! $phpgw_info['user']['session_ip'] || $phpgw_info['user']['session_ip'] != $this->getuser_ip()))
|
||||
{
|
||||
// This needs some better wording
|
||||
$phpgw->log->message('W-VerifySession, IP %1 doesn\'t match IP %2 in session table',$this->getuser_ip(),$phpgw_info['user']['session_ip']);
|
||||
$phpgw->log->commit();
|
||||
|
||||
return False;
|
||||
}
|
||||
}
|
||||
@ -156,6 +165,10 @@
|
||||
|
||||
if (! $this->account_lid)
|
||||
{
|
||||
// This needs some better wording
|
||||
$phpgw->log->message('W-VerifySession, account_id is empty');
|
||||
$phpgw->log->commit();
|
||||
|
||||
return False;
|
||||
}
|
||||
else
|
||||
@ -251,6 +264,9 @@
|
||||
$this->read_repositories(False);
|
||||
if ($this->user['expires'] != -1 && $this->user['expires'] < time())
|
||||
{
|
||||
$phpgw->log->message('W-LoginFailure, account loginid %1 is expired',$this->account_lid);
|
||||
$phpgw->log->commit();
|
||||
|
||||
return False;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user