Some bug corrections with passwords and username

This commit is contained in:
Thomas Schwery 2010-11-13 19:25:32 +01:00
parent 7a0bd1701a
commit 7d8e6c178f
4 changed files with 7 additions and 10 deletions

View file

@ -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";
}

View file

@ -29,6 +29,7 @@ class InputSanitizer {
*/
public static function Username($input) {
$input = preg_replace("/[^a-z]+/i", "", $input);
$input = strtolower($input);
return $input;
}

View file

@ -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/

View file

@ -195,10 +195,6 @@ FORM;
$password = "";
}
if (!$password && $user) {
$password = $user->getPassword();
}
if (!$user) {
$user = Member::Create($fullName, $username, $password, $birthday, $mail, $memberRightsArray);
} else {