Skip to content

Commit

Permalink
Redo ldap server logon logs. Comment out the check_db util function (…
Browse files Browse the repository at this point in the history
…not required).
  • Loading branch information
mark-unwin committed May 28, 2018
1 parent b4adcb3 commit d334c07
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
16 changes: 16 additions & 0 deletions code_igniter/application/controllers/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,22 @@ public function summary_tables()
header('Content-Type: application/json');
echo json_encode($json);
}


// public function check_db()
// {
// $this->load->model('m_configuration');
// $this->m_configuration->load();
// $json = new stdClass();
// $json->file_version = $this->config->config['web_internal_version'];
// $json->db_version = $this->config->config['internal_version'];
// $json->db_upgrade = false;
// if ($this->config->config['internal_version'] < $this->config->config['web_internal_version']) {
// $json->db_upgrade = true;
// }
// header('Content-Type: application/json');
// echo json_encode($json);
// }
}
// End of file util.php
// Location: ./controllers/util.php
9 changes: 4 additions & 5 deletions code_igniter/application/models/m_logon.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ public function logon($id = '')

// Auth against any configured LDAP servers
if ($this->db->table_exists('ldap_servers')) {
$log->summary = 'LDAP Servers table exists, querying.';
$log->detail = '';
$log->severity = 7;
stdlog($log);
if (!empty($user['domain'])) {
$sql = "/* m_logon::logon */ " . "SELECT * FROM ldap_servers WHERE domain LIKE ?";
$data = array($user['domain']);
Expand All @@ -138,8 +134,9 @@ public function logon($id = '')
}
$ldap_servers = $query->result();
if (!empty($ldap_servers)) {
$log->summary = 'LDAP server list retrieved.';
$log->summary = 'LDAP Servers table exists and is not empty.';
$log->detail = count($ldap_servers) . ' LDAP servers retrieved from database.';
$log->severity = 7;
stdlog($log);
// We have configured ldap_servers - validate
foreach ($ldap_servers as $ldap) {
Expand Down Expand Up @@ -529,6 +526,8 @@ public function logon($id = '')
}
}
}
$log->status = 'HTTP/1.1 401 Unauthorized';
$log->summary = 'Invalid logon attempt.';
$log->severity = 5;
$log->message = "User $username attempted to log on with invalid credentials. IP " . $_SERVER['REMOTE_ADDR'];
stdlog($log);
Expand Down

0 comments on commit d334c07

Please sign in to comment.