From d334c07a7fd74890d9c6b8684231a424c5b09f99 Mon Sep 17 00:00:00 2001 From: Mark Unwin Date: Mon, 28 May 2018 12:46:40 +1000 Subject: [PATCH] Redo ldap server logon logs. Comment out the check_db util function (not required). --- code_igniter/application/controllers/util.php | 16 ++++++++++++++++ code_igniter/application/models/m_logon.php | 9 ++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/code_igniter/application/controllers/util.php b/code_igniter/application/controllers/util.php index ec98256a6..f1c21b479 100644 --- a/code_igniter/application/controllers/util.php +++ b/code_igniter/application/controllers/util.php @@ -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 diff --git a/code_igniter/application/models/m_logon.php b/code_igniter/application/models/m_logon.php index 5de7dc271..5c5596819 100644 --- a/code_igniter/application/models/m_logon.php +++ b/code_igniter/application/models/m_logon.php @@ -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']); @@ -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) { @@ -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);