mirror of
https://gitlab.com/CodeSolutionsProject/CodeShare.git
synced 2026-02-23 21:33:48 +01:00
This commit is contained in:
@@ -382,9 +382,9 @@ class DB
|
||||
* @param $email user's email
|
||||
* @return int user's identifier
|
||||
*/
|
||||
public function loadIDU($email)
|
||||
public function loadIDU($field,$mode='email')
|
||||
{
|
||||
$query = "SELECT IDU FROM Users WHERE email='" . $email . "'";
|
||||
$query = "SELECT IDU FROM Users WHERE $mode='" . $field . "'";
|
||||
return $this->getQuery($query)["IDU"];
|
||||
}
|
||||
|
||||
@@ -434,7 +434,9 @@ class DB
|
||||
public function register($email, $pass, $nick)
|
||||
{
|
||||
if ($this->loadIDU($email))
|
||||
return false;
|
||||
return 'MAIL_IN_USE';
|
||||
else if ($this->loadIDU($nick,'nick'))
|
||||
return 'NICK_IN_USE';
|
||||
else {
|
||||
$password = hash('sha256', $pass);
|
||||
dbw_query($this->conn, "INSERT INTO Users (`email`,`pass`,`nick`) VALUES ('$email','$password','$nick')");
|
||||
|
||||
Reference in New Issue
Block a user