namespace fixes

parent 5c526d1c
......@@ -56,13 +56,13 @@ class UsersAdmin extends Core\ModuleController {
} elseif (Core\Validate::formToken() === false) {
Core\Registry::get('View')->setContent(Core\Functions::errorBox(Core\Registry::get('Lang')->t('system', 'form_already_submitted')));
} else {
$salt = salt(12);
$salt = Core\Functions::salt(12);
$insert_values = array(
'id' => '',
'super_user' => (int) $_POST['super_user'],
'nickname' => Core\Functions::strEncode($_POST['nickname']),
'pwd' => generateSaltedPassword($salt, $_POST['pwd']) . ':' . $salt,
'pwd' => Core\Functions::generateSaltedPassword($salt, $_POST['pwd']) . ':' . $salt,
'realname' => Core\Functions::strEncode($_POST['realname']),
'gender' => (int) $_POST['gender'],
'birthday' => $_POST['birthday'],
......@@ -348,8 +348,8 @@ class UsersAdmin extends Core\ModuleController {
// Neues Passwort
if (!empty($_POST['new_pwd']) && !empty($_POST['new_pwd_repeat'])) {
$salt = salt(12);
$new_pwd = generateSaltedPassword($salt, $_POST['new_pwd']);
$salt = Core\Functions::salt(12);
$new_pwd = Core\Functions::generateSaltedPassword($salt, $_POST['new_pwd']);
$update_values['pwd'] = $new_pwd . ':' . $salt;
}
......
......@@ -62,7 +62,7 @@ class UsersFrontend extends Core\ModuleController {
// Neues Passwort
if (!empty($_POST['new_pwd']) && !empty($_POST['new_pwd_repeat'])) {
$salt = salt(12);
$salt = Core\Functions::salt(12);
$new_pwd = Core\Functions::generateSaltedPassword($salt, $_POST['new_pwd']);
$update_values['pwd'] = $new_pwd . ':' . $salt;
}
......@@ -263,7 +263,7 @@ class UsersFrontend extends Core\ModuleController {
Core\Registry::get('View')->setContent(Core\Functions::errorBox(Core\Registry::get('Lang')->t('system', 'form_already_submitted')));
} else {
// Neues Passwort und neuen Zufallsschlüssel erstellen
$new_password = salt(8);
$new_password = Core\Functions::salt(8);
$host = htmlentities($_SERVER['HTTP_HOST']);
// Je nachdem, wie das Feld ausgefüllt wurde, dieses auswählen
......@@ -285,7 +285,7 @@ class UsersFrontend extends Core\ModuleController {
// Das Passwort des Benutzers nur abändern, wenn die E-Mail erfolgreich versendet werden konnte
if ($mail_sent === true) {
$salt = salt(12);
$salt = Core\Functions::salt(12);
$bool = Core\Registry::get('Db')->update(DB_PRE . 'users', array('pwd' => Core\Functions::generateSaltedPassword($salt, $new_password) . ':' . $salt, 'login_errors' => 0), array('id' => $user['id']));
}
......@@ -421,7 +421,7 @@ class UsersFrontend extends Core\ModuleController {
$body = str_replace(array('{name}', '{mail}', '{password}', '{title}', '{host}'), array($_POST['nickname'], $_POST['mail'], $_POST['pwd'], CONFIG_SEO_TITLE, $host), Core\Registry::get('Lang')->t('users', 'register_mail_message'));
$mail_sent = Core\Functions::generateEmail('', $_POST['mail'], $settings['mail'], $subject, $body);
$salt = salt(12);
$salt = Core\Functions::salt(12);
$insert_values = array(
'id' => '',
'nickname' => Core\Functions::strEncode($_POST['nickname']),
......
......@@ -40,9 +40,9 @@ abstract class UsersFunctions {
public static function userEmailExists($mail, $id = '')
{
if (Core\Validate::isNumber($id) === true) {
return Core\Validate::email($mail) === true && Core\Registry::get('Db')->executeQuery('SELECT COUNT(*) FROM ' . DB_PRE . 'users WHERE id != ? AND mail = ?', array($id, $mail), array(\PDO::PARAM_INT, \PDO::PARAM_STR))->fetch(PDO::FETCH_COLUMN) > 0 ? true : false;
return Core\Validate::email($mail) === true && Core\Registry::get('Db')->executeQuery('SELECT COUNT(*) FROM ' . DB_PRE . 'users WHERE id != ? AND mail = ?', array($id, $mail), array(\PDO::PARAM_INT, \PDO::PARAM_STR))->fetch(\PDO::FETCH_COLUMN) > 0 ? true : false;
} else {
return Core\Validate::email($mail) === true && Core\Registry::get('Db')->executeQuery('SELECT COUNT(*) FROM ' . DB_PRE . 'users WHERE mail = ?', array($mail), array(\PDO::PARAM_STR))->fetch(PDO::FETCH_COLUMN) > 0 ? true : false;
return Core\Validate::email($mail) === true && Core\Registry::get('Db')->executeQuery('SELECT COUNT(*) FROM ' . DB_PRE . 'users WHERE mail = ?', array($mail), array(\PDO::PARAM_STR))->fetch(\PDO::FETCH_COLUMN) > 0 ? true : false;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment