Fixed a bug in the log in process which led to redirecting to installation.
Dieser Commit ist enthalten in:
Ursprung
0fad2875f6
Commit
87f951530e
4 geänderte Dateien mit 31 neuen und 28 gelöschten Zeilen
|
@ -204,8 +204,7 @@ class InstallController extends Msd_Controller_Action
|
||||||
$form->getElement('pass_confirm')->getValidator('Identical')->setToken($postData['pass']);
|
$form->getElement('pass_confirm')->getValidator('Identical')->setToken($postData['pass']);
|
||||||
if ($form->isValid($postData)) {
|
if ($form->isValid($postData)) {
|
||||||
$ini = new Msd_Ini();
|
$ini = new Msd_Ini();
|
||||||
$ini->set('name', $postData['user'], 'user');
|
$ini->set('user[\'' . $postData['user'] . '\']', md5($postData['pass']), 'users');
|
||||||
$ini->set('pass', md5($postData['pass']), 'user');
|
|
||||||
$ini->saveFile(APPLICATION_PATH . '/configs/users.ini');
|
$ini->saveFile(APPLICATION_PATH . '/configs/users.ini');
|
||||||
$redirectUrl = $this->view->url(array('controller' => 'install', 'action' => 'step4'), null, true);
|
$redirectUrl = $this->view->url(array('controller' => 'install', 'action' => 'step4'), null, true);
|
||||||
$this->_response->setRedirect($redirectUrl);
|
$this->_response->setRedirect($redirectUrl);
|
||||||
|
|
|
@ -39,15 +39,26 @@ class Msd_Action_Helper_AssignConfigAndLanguage extends Zend_Controller_Action_H
|
||||||
$view = $this->getView();
|
$view = $this->getView();
|
||||||
$config = Msd_Registry::getConfig();
|
$config = Msd_Registry::getConfig();
|
||||||
if ($config->getParam('configFile', 'defaultConfig.ini') == 'defaultConfig.ini') {
|
if ($config->getParam('configFile', 'defaultConfig.ini') == 'defaultConfig.ini') {
|
||||||
$redirectUrl = $view->serverUrl() . $view->url(
|
$configFiles = Msd_File::getConfigNames();
|
||||||
array(
|
if (isset($configFiles[0])) {
|
||||||
'controller' => 'install',
|
// we do have saved configurations - load the first one
|
||||||
'action' => 'index',
|
$config->load($configFiles[0]);
|
||||||
null,
|
Msd_Registry::setConfig($config);
|
||||||
true)
|
$dynamicConfig = Msd_Registry::getDynamicConfig();
|
||||||
);
|
$dynamicConfig->setParam('configFile', $configFiles[0]);
|
||||||
$redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');
|
Msd_Registry::setDynamicConfig($dynamicConfig);
|
||||||
$redirector->gotoUrl($redirectUrl);
|
} else {
|
||||||
|
// nothing found -> redirect to installation
|
||||||
|
$redirectUrl = $view->serverUrl() . $view->url(
|
||||||
|
array(
|
||||||
|
'controller' => 'install',
|
||||||
|
'action' => 'index',
|
||||||
|
null,
|
||||||
|
true)
|
||||||
|
);
|
||||||
|
$redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');
|
||||||
|
$redirector->gotoUrl($redirectUrl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$view->config = $config;
|
$view->config = $config;
|
||||||
$view->dynamicConfig = Msd_Registry::getDynamicConfig();
|
$view->dynamicConfig = Msd_Registry::getDynamicConfig();
|
||||||
|
|
|
@ -65,7 +65,7 @@ class Msd_Auth_Adapter_Ini implements Zend_Auth_Adapter_Interface
|
||||||
*/
|
*/
|
||||||
public function setUsername($username)
|
public function setUsername($username)
|
||||||
{
|
{
|
||||||
$this->_username = (string) $username;
|
$this->_username = (string)$username;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -77,7 +77,7 @@ class Msd_Auth_Adapter_Ini implements Zend_Auth_Adapter_Interface
|
||||||
*/
|
*/
|
||||||
public function setPassword($password)
|
public function setPassword($password)
|
||||||
{
|
{
|
||||||
$this->_password = (string) $password;
|
$this->_password = (string)$password;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -96,14 +96,11 @@ class Msd_Auth_Adapter_Ini implements Zend_Auth_Adapter_Interface
|
||||||
}
|
}
|
||||||
|
|
||||||
$authResult = false;
|
$authResult = false;
|
||||||
foreach ($this->_users as $userId => $user) {
|
foreach ($this->_users['users']['user'] as $name => $pass) {
|
||||||
if (
|
if ($this->_username == $name && md5($this->_password) == $pass) {
|
||||||
$this->_username == $user['name'] &&
|
|
||||||
md5($this->_password) == $user['pass']
|
|
||||||
) {
|
|
||||||
$authResult = array(
|
$authResult = array(
|
||||||
'id' => $userId,
|
'id' => $name,
|
||||||
'name' => $user['name'],
|
'name' => $name,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,15 +156,11 @@ class Msd_User
|
||||||
return self::NO_USER_FILE;
|
return self::NO_USER_FILE;
|
||||||
}
|
}
|
||||||
|
|
||||||
$usersConfig = new Msd_Ini($this->_usersFile);
|
$usersConfig = new Msd_Ini($this->_usersFile);
|
||||||
$users = $usersConfig->get('user');
|
$users = $usersConfig->get('users');
|
||||||
|
|
||||||
$hasValidUser = false;
|
$hasValidUser = false;
|
||||||
foreach ($users as $user) {
|
if (!empty($users)) {
|
||||||
if (isset($user['name']) && isset($user['pass'])) {
|
$hasValidUser = true;
|
||||||
$hasValidUser = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!$hasValidUser) {
|
if (!$hasValidUser) {
|
||||||
return self::NO_VALID_USER;
|
return self::NO_VALID_USER;
|
||||||
|
|
Laden …
In neuem Issue referenzieren