added admin password file

This commit is contained in:
jeena 2013-07-08 22:40:09 +02:00
parent b47299adca
commit 2156d3f5c6
4 changed files with 18 additions and 5 deletions

2
.gitignore vendored
View file

@ -1 +1,3 @@
.DS_Store
config/admin.ini
config/database.config.ini

View file

@ -12,7 +12,7 @@ class AdminController extends Katharsis_Controller_Abstract
public function loginAction()
{
if($this->_getParam('password') == '')
if($this->_getParam('password') == $this->getPassword())
{
$_SESSION['logged'] = 1;
$this->_location('index');
@ -29,4 +29,14 @@ class AdminController extends Katharsis_Controller_Abstract
$_SESSION['logged'] = 0;
$this->_location('gate');
}
// Private
private function getPassword()
{
$admin_ini = parse_ini_file('config/admin.ini');
$password = $admin_ini["password"];
return $password;
}
}

1
config/admin.ini.example Normal file
View file

@ -0,0 +1 @@
password = test

View file

@ -1,5 +1,5 @@
[connection:development:default]
host = 127.0.0.1
user = root
password =
[connection:development:default]
host = 127.0.0.1
user = root
password =
database = seinheit_ch