Add files via upload
User and admin password change bug fix. Now passwords generate as it was supposed to be.
This commit is contained in:
parent
50b2d37490
commit
5baf64f84b
@ -92,11 +92,12 @@ class dbUsers extends dbJSON
|
|||||||
$user['salt'] = $this->generateSalt();
|
$user['salt'] = $this->generateSalt();
|
||||||
$user['password'] = $this->generatePasswordHash($args['password'], $user['salt']);
|
$user['password'] = $this->generatePasswordHash($args['password'], $user['salt']);
|
||||||
$user['tokenAuth'] = $this->generateAuthToken();
|
$user['tokenAuth'] = $this->generateAuthToken();
|
||||||
|
// Save the database
|
||||||
|
$this->db[$args['username']] = $user;
|
||||||
|
return $this->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save the database
|
|
||||||
$this->db[$args['username']] = $user;
|
|
||||||
return $this->save();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete an user
|
// Delete an user
|
||||||
@ -122,7 +123,7 @@ class dbUsers extends dbJSON
|
|||||||
|
|
||||||
public function generateAuthToken()
|
public function generateAuthToken()
|
||||||
{
|
{
|
||||||
return md5( uniqid().time().DOMAIN );
|
return md5(uniqid().time().DOMAIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateRememberToken()
|
public function generateRememberToken()
|
||||||
@ -150,7 +151,7 @@ class dbUsers extends dbJSON
|
|||||||
public function setPassword($username, $password)
|
public function setPassword($username, $password)
|
||||||
{
|
{
|
||||||
$args['username'] = $username;
|
$args['username'] = $username;
|
||||||
$args['password'] = $hash;
|
$args['password'] = $password;
|
||||||
|
|
||||||
return $this->set($args);
|
return $this->set($args);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user