Some bug corrections with passwords and username
This commit is contained in:
parent
7a0bd1701a
commit
7d8e6c178f
4 changed files with 7 additions and 10 deletions
|
@ -253,11 +253,11 @@ class Member {
|
|||
*
|
||||
* @param string $fullName
|
||||
* @param Right $rights
|
||||
* @param string $password
|
||||
* @param string $new_password
|
||||
* @param number $birthday
|
||||
* @param string $mail
|
||||
*/
|
||||
public function setInformations($fullName, array $rights, $password, $birthday, $mail) {
|
||||
public function setInformations($fullName, array $rights, $new_password, $birthday, $mail) {
|
||||
|
||||
$fullName = InputSanitizer::Sanitize($fullName);
|
||||
$birthday = InputSanitizer::Number($birthday);
|
||||
|
@ -267,8 +267,8 @@ class Member {
|
|||
$this->fullname = $fullName;
|
||||
$this->mail = $mail;
|
||||
|
||||
if ($password) {
|
||||
$passwordHash = hash("sha512", $password);
|
||||
if (strlen($new_password) > 4) {
|
||||
$passwordHash = hash("sha512", $new_password);
|
||||
} else {
|
||||
$passwordHash = "disabled";
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ class InputSanitizer {
|
|||
*/
|
||||
public static function Username($input) {
|
||||
$input = preg_replace("/[^a-z]+/i", "", $input);
|
||||
$input = strtolower($input);
|
||||
return $input;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
remote.connection=Cransmontana.ch
|
||||
remote.directory=
|
||||
remote.connection=accm
|
||||
remote.directory=/httpdocs
|
||||
remote.upload.directly=true
|
||||
run.as=REMOTE
|
||||
url=http://www.accransmontana.ch/
|
||||
|
|
|
@ -195,10 +195,6 @@ FORM;
|
|||
$password = "";
|
||||
}
|
||||
|
||||
if (!$password && $user) {
|
||||
$password = $user->getPassword();
|
||||
}
|
||||
|
||||
if (!$user) {
|
||||
$user = Member::Create($fullName, $username, $password, $birthday, $mail, $memberRightsArray);
|
||||
} else {
|
||||
|
|
Reference in a new issue