import v1.1.0_RC2 | 2009-09-20
This commit is contained in:
@ -51,6 +51,7 @@ class Install_CredentialsController extends CommunityID_Controller_Action
|
||||
}
|
||||
|
||||
$this->_importDb();
|
||||
$this->_createAdmin($form);
|
||||
|
||||
if (!$this->_writeConfig($form)) {
|
||||
throw new Exception('Couldn\'t write to config file ' . APP_DIR . DIRECTORY_SEPARATOR . 'config.php');
|
||||
@ -142,6 +143,22 @@ class Install_CredentialsController extends CommunityID_Controller_Action
|
||||
$this->_runSqlFILE('final.sql');
|
||||
}
|
||||
|
||||
private function _createAdmin(Install_Form_Install $form)
|
||||
{
|
||||
$users = new Users_Model_Users();
|
||||
$user = $users->createRow();
|
||||
$user->username = $form->getValue('adminUsername');
|
||||
$user->accepted_eula = 1;
|
||||
$user->registration_date = date('Y-m-d');
|
||||
$user->openid = '';
|
||||
$user->setClearPassword($form->getValue('password1'));
|
||||
$user->firstname = 'Admin';
|
||||
$user->lastname = 'User';
|
||||
$user->email = $form->getValue('supportemail');
|
||||
$user->role = Users_Model_User::ROLE_ADMIN;
|
||||
$user->save();
|
||||
}
|
||||
|
||||
function _runSqlFile($fileName) {
|
||||
$fp = fopen(APP_DIR . DIRECTORY_SEPARATOR . "/setup/$fileName", 'r');
|
||||
$query = '';
|
||||
|
@ -71,6 +71,11 @@ class Install_UpgradeController extends CommunityID_Controller_Action
|
||||
$upgradedVersion = $this->_runUpgrades(false);
|
||||
|
||||
$this->_helper->FlashMessenger->addMessage($this->view->translate('Upgrade was successful. You are now on version %s', $upgradedVersion));
|
||||
|
||||
// we need to logout user in case the user table changed
|
||||
Zend_Auth::getInstance()->clearIdentity();
|
||||
Zend_Session::forgetMe();
|
||||
|
||||
$this->_redirect('/');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user