fight stupidity - teach your customers not to use password == username
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -64,7 +64,7 @@ class DbManager {
|
||||
* @param string $password
|
||||
* @param int $last_accnumber
|
||||
*
|
||||
* @return string $username
|
||||
* @return string|bool $username if successful or false of username is equal to the password
|
||||
*/
|
||||
public function createDatabase($loginname = null, $password = null, $last_accnumber = 0) {
|
||||
|
||||
@@ -84,6 +84,11 @@ class DbManager {
|
||||
$username = $loginname . Settings::Get('customer.mysqlprefix') . (intval($last_accnumber) + 1);
|
||||
}
|
||||
|
||||
// don't use a password that is the same as the username
|
||||
if ($username == $password) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// now create the database itself
|
||||
$this->getManager()->createDatabase($username);
|
||||
$this->_log->logAction(USR_ACTION, LOG_INFO, "created database '" . $username . "'");
|
||||
|
||||
Reference in New Issue
Block a user