Change all the "new class" by "new Class"
This commit is contained in:
@@ -59,24 +59,24 @@ class Userssql extends Users
|
||||
public function connect ()
|
||||
{
|
||||
if ($this->table === null)
|
||||
throw new Exception (dgettext ("domframework", "No SQL table defined"),
|
||||
throw new \Exception (dgettext ("domframework", "No SQL table defined"),
|
||||
500);
|
||||
if ($this->fieldEmail === null)
|
||||
throw new Exception (dgettext ("domframework",
|
||||
throw new \Exception (dgettext ("domframework",
|
||||
"No fieldIdentifier defined"), 500);
|
||||
if ($this->fieldPassword === null)
|
||||
throw new Exception (dgettext ("domframework",
|
||||
throw new \Exception (dgettext ("domframework",
|
||||
"No fieldPassword defined"), 500);
|
||||
if ($this->fieldLastname === null)
|
||||
throw new Exception (dgettext ("domframework",
|
||||
throw new \Exception (dgettext ("domframework",
|
||||
"No fieldLastname defined"), 500);
|
||||
if ($this->fieldFirstname === null)
|
||||
throw new Exception (dgettext ("domframework",
|
||||
throw new \Exception (dgettext ("domframework",
|
||||
"No fieldFirstname defined"), 500);
|
||||
if ($this->fieldLastchange === null)
|
||||
throw new Exception (dgettext ("domframework",
|
||||
throw new \Exception (dgettext ("domframework",
|
||||
"No fieldLastchange defined"), 500);
|
||||
$this->db = new dblayer ($this->dsn, $this->username, $this->password,
|
||||
$this->db = new Dblayer ($this->dsn, $this->username, $this->password,
|
||||
$this->driver_options);
|
||||
$this->db->table = $this->table;
|
||||
$this->db->fields = array (
|
||||
@@ -179,7 +179,7 @@ class Userssql extends Users
|
||||
$this->checkPassword ($oldpassword);
|
||||
$this->checkPassword ($newpassword);
|
||||
if ($this->checkValidPassword ($email, $oldpassword) !== true)
|
||||
throw new Exception (dgettext ("domframework",
|
||||
throw new \Exception (dgettext ("domframework",
|
||||
"Bad old password provided"), 401);
|
||||
$cryptedPassword = $this->cryptPasswd ($newpassword);
|
||||
return $this->db->update ($email,
|
||||
@@ -202,7 +202,7 @@ class Userssql extends Users
|
||||
$data = $this->db->read (array (array ($this->fieldEmail, $email)),
|
||||
array ($this->fieldPassword));
|
||||
if (count ($data) === 0)
|
||||
throw new Exception (dgettext ("domframework",
|
||||
throw new \Exception (dgettext ("domframework",
|
||||
"No information found for this email"), 404);
|
||||
$cryptedPassword = $this->cryptPasswd ($newpassword);
|
||||
return $this->db->update ($email,
|
||||
@@ -224,10 +224,10 @@ class Userssql extends Users
|
||||
$data = $this->db->read (array (array ($this->fieldEmail, $email)),
|
||||
array ($this->fieldPassword));
|
||||
if (count ($data) === 0)
|
||||
throw new Exception (dgettext ("domframework",
|
||||
throw new \Exception (dgettext ("domframework",
|
||||
"No information found for this email"), 404);
|
||||
if (! isset ($data[0][$this->fieldPassword]))
|
||||
throw new Exception (dgettext ("domframework",
|
||||
throw new \Exception (dgettext ("domframework",
|
||||
"No password available for this email"), 404);
|
||||
$cryptedPassword = $data[0][$this->fieldPassword];
|
||||
if (crypt ($password, $cryptedPassword) !== $cryptedPassword)
|
||||
|
||||
Reference in New Issue
Block a user