1
0
Fork 0

Fixed a bug in the log in process which led to redirecting to installation.

Dieser Commit ist enthalten in:
DSB 2012-10-27 13:39:33 +00:00
Ursprung 0fad2875f6
Commit 87f951530e
4 geänderte Dateien mit 31 neuen und 28 gelöschten Zeilen

Datei anzeigen

@ -204,8 +204,7 @@ class InstallController extends Msd_Controller_Action
$form->getElement('pass_confirm')->getValidator('Identical')->setToken($postData['pass']);
if ($form->isValid($postData)) {
$ini = new Msd_Ini();
$ini->set('name', $postData['user'], 'user');
$ini->set('pass', md5($postData['pass']), 'user');
$ini->set('user[\'' . $postData['user'] . '\']', md5($postData['pass']), 'users');
$ini->saveFile(APPLICATION_PATH . '/configs/users.ini');
$redirectUrl = $this->view->url(array('controller' => 'install', 'action' => 'step4'), null, true);
$this->_response->setRedirect($redirectUrl);

Datei anzeigen

@ -39,6 +39,16 @@ class Msd_Action_Helper_AssignConfigAndLanguage extends Zend_Controller_Action_H
$view = $this->getView();
$config = Msd_Registry::getConfig();
if ($config->getParam('configFile', 'defaultConfig.ini') == 'defaultConfig.ini') {
$configFiles = Msd_File::getConfigNames();
if (isset($configFiles[0])) {
// we do have saved configurations - load the first one
$config->load($configFiles[0]);
Msd_Registry::setConfig($config);
$dynamicConfig = Msd_Registry::getDynamicConfig();
$dynamicConfig->setParam('configFile', $configFiles[0]);
Msd_Registry::setDynamicConfig($dynamicConfig);
} else {
// nothing found -> redirect to installation
$redirectUrl = $view->serverUrl() . $view->url(
array(
'controller' => 'install',
@ -49,6 +59,7 @@ class Msd_Action_Helper_AssignConfigAndLanguage extends Zend_Controller_Action_H
$redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');
$redirector->gotoUrl($redirectUrl);
}
}
$view->config = $config;
$view->dynamicConfig = Msd_Registry::getDynamicConfig();
$view->lang = Msd_Language::getInstance();

Datei anzeigen

@ -96,14 +96,11 @@ class Msd_Auth_Adapter_Ini implements Zend_Auth_Adapter_Interface
}
$authResult = false;
foreach ($this->_users as $userId => $user) {
if (
$this->_username == $user['name'] &&
md5($this->_password) == $user['pass']
) {
foreach ($this->_users['users']['user'] as $name => $pass) {
if ($this->_username == $name && md5($this->_password) == $pass) {
$authResult = array(
'id' => $userId,
'name' => $user['name'],
'id' => $name,
'name' => $name,
);
}
}

Datei anzeigen

@ -157,14 +157,10 @@ class Msd_User
}
$usersConfig = new Msd_Ini($this->_usersFile);
$users = $usersConfig->get('user');
$users = $usersConfig->get('users');
$hasValidUser = false;
foreach ($users as $user) {
if (isset($user['name']) && isset($user['pass'])) {
if (!empty($users)) {
$hasValidUser = true;
break;
}
}
if (!$hasValidUser) {
return self::NO_VALID_USER;