Project

General

Profile

Bug #20365 » 10993_v2.diff

Administrator Admin, 2009-04-27 16:35

View differences:

typo3/sysext/install/mod/class.tx_install.php (working copy)
</tr>
<tr>
<td valign="top" nowrap="nowrap">'.$this->fontTag1.'Password:</span></td>
<td valign="top" nowrap="nowrap"><strong>'.$this->fontTag1.''.TYPO3_db_password.'</span></strong></td>
<td valign="top" nowrap="nowrap"><strong>'.$this->fontTag1.'********'.'</span></strong></td>
</tr>
<tr>
<td valign="top" nowrap="nowrap">'.$this->fontTag1.'Host:</span></td>
......
</td>
<td valign="top">
'.$this->fontTag2.'
<input type="text" name="TYPO3_INSTALL[localconf.php][typo_db_password]" value="'.TYPO3_db_password.'"></span><br />
<input type="password" name="TYPO3_INSTALL[localconf.php][typo_db_password]" value="'.TYPO3_db_password.'"></span><br />
</td>
</tr>
<tr>
......
} else {
$cInfo='
Username: <strong>'.TYPO3_db_username.'</strong>
Password: <strong>'.TYPO3_db_password.'</strong>
Password: <strong>********</strong>
Host: <strong>'.TYPO3_db_host.'</strong>
';
if (!TYPO3_db_host || !TYPO3_db_username) {
......
<table border="0" cellpadding="0" cellspacing="0">';
$out.=$this->wrapInCells('Username:', '<input type="text" name="TYPO3_INSTALL[localconf.php][typo_db_username]" value="'.htmlspecialchars(TYPO3_db_username?TYPO3_db_username:($this->config_array['sql.safe_mode_user']?$this->config_array['sql.safe_mode_user']:"")).'">'.($this->config_array['sql.safe_mode_user']?"<br />sql.safe_mode_user: <strong>".$this->config_array['sql.safe_mode_user']."</strong>":""));
$out.=$this->wrapInCells('Password:', '<input type="text" name="TYPO3_INSTALL[localconf.php][typo_db_password]" value="'.htmlspecialchars(TYPO3_db_password).'">');
$out.=$this->wrapInCells('Password:', '<input type="password" name="TYPO3_INSTALL[localconf.php][typo_db_password]" value="'.htmlspecialchars(TYPO3_db_password).'">');
$out.=$this->wrapInCells('Host:', '<input type="text" name="TYPO3_INSTALL[localconf.php][typo_db_host]" value="'.htmlspecialchars(TYPO3_db_host).'">');
if ($this->config_array['mysqlConnect']) {
$dbArr = $this->getDatabaseList();
......
$cInfo='
Username: <strong>'.TYPO3_db_username.'</strong>
Password: <strong>'.TYPO3_db_password.'</strong>
Password: <strong>********</strong>
Host: <strong>'.TYPO3_db_host.'</strong>
';
$this->message($headCode, 'Connected to SQL database successfully',"
......
if ($whichTables['be_users']) {
if (is_array($this->INSTALL['database_adminUser'])) {
$username = preg_replace('/[^\da-z._-]/i', '', trim($this->INSTALL['database_adminUser']['username']));
$pass = trim($this->INSTALL['database_adminUser']['password']);
$pass = trim($this->INSTALL['database_adminUser']['password2']);
if ($username && $pass) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'be_users', 'username='.$GLOBALS['TYPO3_DB']->fullQuoteStr($username, 'be_users'));
if (!$GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
if ($pass != trim($this->INSTALL['database_adminUser']['password'])) {
$this->message($headCode, 'Passwords are not equal!', '
The passwords entered twice are not equal.',2,1);
} else {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'be_users', 'username='.$GLOBALS['TYPO3_DB']->fullQuoteStr($username, 'be_users'));
if (!$GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
$insertFields = array(
'username' => $username,
'password' => md5($pass),
'admin' => 1,
'uc' => '',
'fileoper_perms' => 0,
'tstamp' => time(),
'crdate' => time()
);
$insertFields = array(
'username' => $username,
'password' => md5($pass),
'admin' => 1,
'uc' => '',
'fileoper_perms' => 0,
'tstamp' => time(),
'crdate' => time()
);
$result = $GLOBALS['TYPO3_DB']->exec_INSERTquery('be_users', $insertFields);
$result = $GLOBALS['TYPO3_DB']->exec_INSERTquery('be_users', $insertFields);
$this->isBasicComplete($headCode);
$this->isBasicComplete($headCode);
if ($result) {
$this->message($headCode,'User created','
Username: <strong>'.htmlspecialchars($username).'</strong><br />
Password: <strong>'.htmlspecialchars($pass).'</strong><br />',
1,1);
if ($result) {
$this->message($headCode,'User created','
Username: <strong>'.htmlspecialchars($username).'</strong><br />
Password: <strong>********</strong><br />',
1,1);
} else {
$this->message($headCode,'User not created','
Error: <strong>'.htmlspecialchars($GLOBALS['TYPO3_DB']->sql_error()).'</strong><br />',
3,1);
}
} else {
$this->message($headCode,'User not created','
Error: <strong>'.htmlspecialchars($GLOBALS['TYPO3_DB']->sql_error()).'</strong><br />',
3,1);
$this->message($headCode,'Username not unique!','
The username, <strong>'.htmlspecialchars($username).'</strong>, was not unique.',2,1);
}
} else {
$this->message($headCode,'Username not unique!','
The username, <strong>'.htmlspecialchars($username).'</strong>, was not unique.',2,1);
}
}
}
$content = '
<input type="text" name="TYPO3_INSTALL[database_adminUser][username]"> username - unique, no space, lowercase<br />
<input type="text" name="TYPO3_INSTALL[database_adminUser][password]"> password
<input type="password" name="TYPO3_INSTALL[database_adminUser][password]"> password
<input type="password" name="TYPO3_INSTALL[database_adminUser][password2]"> password (repeated)
';
$form = $this->getUpdateDbFormWrap($action_type, $content);
$this->message($headCode,'Create admin user',"
(5-5/7)