added admin password file
This commit is contained in:
parent
b47299adca
commit
2156d3f5c6
4 changed files with 18 additions and 5 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1,3 @@
|
|||
.DS_Store
|
||||
config/admin.ini
|
||||
config/database.config.ini
|
||||
|
|
|
@ -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
1
config/admin.ini.example
Normal file
|
@ -0,0 +1 @@
|
|||
password = test
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue