From ad576c6ab43242fad2b7489296a05158babc08e3 Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Tue, 09 Feb 2016 09:08:33 -0500
Subject: [PATCH] Merge branch 'stable-3.1' of git.ispconfig.org:ispconfig/ispconfig3 into stable-3.1
---
security/check.php | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/security/check.php b/security/check.php
index dc930c5..cfa820f 100644
--- a/security/check.php
+++ b/security/check.php
@@ -53,18 +53,20 @@
$data_file = $data_dir.'/admincount';
//get number of admins
$tmp = $app->db->queryOneRecord("SELECT count(userid) AS number FROM sys_user WHERE typ = 'admin'");
- $admin_user_count_new = intval($tmp['number']);
-
- if(is_file($data_file)) {
- $admin_user_count_old = intval(file_get_contents($data_file));
- if($admin_user_count_new != $admin_user_count_old) {
- $alert .= "The number of ISPConfig administrator users has changed. Old: $admin_user_count_old New: $admin_user_count_new \n";
+ if($tmp) {
+ $admin_user_count_new = intval($tmp['number']);
+
+ if(is_file($data_file)) {
+ $admin_user_count_old = intval(file_get_contents($data_file));
+ if($admin_user_count_new != $admin_user_count_old) {
+ $alert .= "The number of ISPConfig administrator users has changed. Old: $admin_user_count_old New: $admin_user_count_new \n";
+ file_put_contents($data_file,$admin_user_count_new);
+ }
+ } else {
+ // first run, so we save the current count
file_put_contents($data_file,$admin_user_count_new);
+ chmod($data_file,0700);
}
- } else {
- // first run, so we save the current count
- file_put_contents($data_file,$admin_user_count_new);
- chmod($data_file,0700);
}
}
--
Gitblit v1.9.1