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('/');
|
||||
}
|
||||
|
||||
|
@ -14,31 +14,53 @@ class Install_Form_Install extends Zend_Form
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$hostname = new Zend_Form_Element_Text('hostname');
|
||||
$hostname->setLabel('Hostname:')
|
||||
$hostname = new Monkeys_Form_Element_Text('hostname');
|
||||
$hostname->setLabel('Hostname')
|
||||
->setDescription('usually localhost')
|
||||
->setRequired(true)
|
||||
->setDecoratorOptions(array('dontMarkRequired' => true))
|
||||
->setValue('localhost');
|
||||
|
||||
$dbname = new Zend_Form_Element_Text('dbname');
|
||||
$dbname->setLabel('Database name:')
|
||||
$dbname = new Monkeys_Form_Element_Text('dbname');
|
||||
$dbname->setLabel('Database name')
|
||||
->setRequired(true)
|
||||
->setDecoratorOptions(array('dontMarkRequired' => true))
|
||||
->setValue(Zend_Registry::get('config')->database->params->dbname);
|
||||
|
||||
$dbusername = new Zend_Form_Element_Text('dbusername');
|
||||
$dbusername->setLabel('Database username:')
|
||||
->setRequired(true);
|
||||
$dbusername = new Monkeys_Form_Element_Text('dbusername');
|
||||
$dbusername->setLabel('Database username')
|
||||
->setRequired(true)
|
||||
->setDecoratorOptions(array('dontMarkRequired' => true));
|
||||
|
||||
$dbpassword = new Zend_Form_Element_Password('dbpassword');
|
||||
$dbpassword->setLabel('Database password:');
|
||||
$dbpassword = new Monkeys_Form_Element_Password('dbpassword');
|
||||
$dbpassword->setLabel('Database password');
|
||||
|
||||
$supportemail = new Zend_Form_Element_Text('supportemail');
|
||||
$supportemail->setLabel('Support E-mail:')
|
||||
$supportemail = new Monkeys_Form_Element_Text('supportemail');
|
||||
$supportemail->setLabel('Support E-mail')
|
||||
->setDescription('Will be used as the sender for any message sent by the system, and as the recipient for user feedback')
|
||||
->addFilter('StringToLower')
|
||||
->addValidator('EmailAddress')
|
||||
->setRequired(true);
|
||||
->setRequired(true)
|
||||
->setDecoratorOptions(array('dontMarkRequired' => true));
|
||||
|
||||
$this->addElements(array($hostname, $dbname, $dbusername, $dbpassword, $supportemail));
|
||||
$adminUsername = new Monkeys_Form_Element_Text('adminUsername');
|
||||
$adminUsername->setLabel('Username')
|
||||
->setRequired(true)
|
||||
->setDecoratorOptions(array('dontMarkRequired' => true));
|
||||
|
||||
$password1 = new Monkeys_Form_Element_Password('password1');
|
||||
$password1->setLabel('Enter password')
|
||||
->setRequired(true)
|
||||
->setDecoratorOptions(array('dontMarkRequired' => true))
|
||||
->addValidator(new Monkeys_Validate_PasswordConfirmation());
|
||||
|
||||
$password2 = new Monkeys_Form_Element_Password('password2');
|
||||
$password2->setLabel('Enter password again')
|
||||
->setRequired(true)
|
||||
->setDecoratorOptions(array('dontMarkRequired' => true));
|
||||
|
||||
|
||||
$this->addElements(array($hostname, $dbname, $dbusername, $dbpassword, $supportemail,
|
||||
$adminUsername, $password1, $password2));
|
||||
}
|
||||
}
|
||||
|
@ -1,44 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
|
||||
* @license http://creativecommons.org/licenses/BSD/ BSD License
|
||||
* @author Keyboard Monkeys Ltd.
|
||||
* @since Textroller 0.9
|
||||
* @package TextRoller
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
|
||||
class InstallForm extends Zend_Form
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$hostname = new Zend_Form_Element_Text('hostname');
|
||||
$hostname->setLabel('Hostname:')
|
||||
->setDescription('usually localhost')
|
||||
->setRequired(true)
|
||||
->setValue('localhost');
|
||||
|
||||
$dbname = new Zend_Form_Element_Text('dbname');
|
||||
$dbname->setLabel('Database name:')
|
||||
->setRequired(true)
|
||||
->setValue(Zend_Registry::get('config')->database->params->dbname);
|
||||
|
||||
$dbusername = new Zend_Form_Element_Text('dbusername');
|
||||
$dbusername->setLabel('Database username:')
|
||||
->setRequired(true);
|
||||
|
||||
$dbpassword = new Zend_Form_Element_Password('dbpassword');
|
||||
$dbpassword->setLabel('Database password:');
|
||||
|
||||
$supportemail = new Zend_Form_Element_Text('supportemail');
|
||||
$supportemail->setLabel('Support E-mail:')
|
||||
->setDescription('Will be used as the sender for any message sent by the system, and as the recipient for user feedback')
|
||||
->addFilter('StringToLower')
|
||||
->addValidator('EmailAddress')
|
||||
->setRequired(true);
|
||||
|
||||
$this->addElements(array($hostname, $dbname, $dbusername, $dbpassword, $supportemail));
|
||||
}
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
<h3>
|
||||
<?php echo $this->translate('The installation was performed successfully') ?>
|
||||
<?= $this->translate('The installation was performed successfully') ?>
|
||||
</h3>
|
||||
<div style="margin-top:20px">
|
||||
<div>
|
||||
You can login as the administrator with the username "admin" and the password "admin"<br />
|
||||
Please note that this user is only meant for administrative tasks, and cannot have an OpenID credential.
|
||||
<?= $this->translate('You can login as the administrator with the username and password you just provided.') ?><br />
|
||||
<?= $this->translate('Please note that this user is only meant for administrative tasks, and cannot have an OpenID credential.') ?>
|
||||
</div>
|
||||
<div style="margin-top:20px">
|
||||
<input type="button" id="start" value="<?php echo $this->translate('Finish') ?>" />
|
||||
@ -13,7 +13,7 @@
|
||||
var oButton = new YAHOO.widget.Button(
|
||||
"start",
|
||||
{
|
||||
onclick: {fn: function() {location.href="<?php echo $this->base ?>"}}
|
||||
onclick: {fn: function() {location.href="<?php echo $this->base ?>/"}}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
@ -1,14 +1,22 @@
|
||||
<h3>
|
||||
<?php echo $this->translate('Database and E-mail information') ?>
|
||||
</h3>
|
||||
<form name="installform" method="post" action="<?php echo $this->base ?>/install/credentials/save" class="longLabelsForm">
|
||||
<dl>
|
||||
<form name="installform" method="post" action="<?php echo $this->base ?>/install/credentials/save" class="formGrid">
|
||||
<h3>
|
||||
<?php echo $this->translate('Database and E-mail information') ?>
|
||||
</h3>
|
||||
<div class="yui-gf" style="margin-top:20px">
|
||||
<?php echo $this->form->hostname ?>
|
||||
<?php echo $this->form->dbname ?>
|
||||
<?php echo $this->form->dbusername ?>
|
||||
<?php echo $this->form->dbpassword ?>
|
||||
<?php echo $this->form->supportemail ?>
|
||||
</dl>
|
||||
</div>
|
||||
<h3>
|
||||
<?php echo $this->translate('Administrator User Information') ?>
|
||||
</h3>
|
||||
<div class="yui-gf" style="margin-top:20px">
|
||||
<?php echo $this->form->adminUsername ?>
|
||||
<?php echo $this->form->password1 ?>
|
||||
<?php echo $this->form->password2 ?>
|
||||
</div>
|
||||
<input type="submit" id="send" value="<?php echo $this->translate('Send') ?>" />
|
||||
<script type="text/javascript">
|
||||
var oButton = new YAHOO.widget.Button("send");
|
||||
|
Reference in New Issue
Block a user