From 80949e825555595b3c240092b0192b496aadf209 Mon Sep 17 00:00:00 2001 From: Toni Haryanto Date: Wed, 26 Nov 2014 14:47:07 +0700 Subject: [PATCH] add caution for unchanged default admin password --- sites/default/users/admin.json | 6 +++--- system/application/core/Admin_Controller.php | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sites/default/users/admin.json b/sites/default/users/admin.json index 3b5dc72..ee449b1 100755 --- a/sites/default/users/admin.json +++ b/sites/default/users/admin.json @@ -1,5 +1,5 @@ { - "username": "admin", - "password": "password", - "passconf": "password" + "username": "admin", + "password": "password", + "passconf": "password" } \ No newline at end of file diff --git a/system/application/core/Admin_Controller.php b/system/application/core/Admin_Controller.php index 2b3e785..aafd892 100644 --- a/system/application/core/Admin_Controller.php +++ b/system/application/core/Admin_Controller.php @@ -8,6 +8,12 @@ public function __construct() // set theme $this->template->set_theme($this->config->item('admin_theme')); + + if(file_exists('sites/'.SITE_SLUG.'/users/admin.json')){ + $admin = json_decode(file_get_contents('sites/'.SITE_SLUG.'/users/admin.json'), true); + if(isset($admin['password']) && $admin['password'] == 'password') + $this->template->set('warning', 'Change your default admin password to secure one in Users settings page first.'); + } } } \ No newline at end of file