diff options
author | friendica <info@friendica.com> | 2012-08-16 00:51:03 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-08-16 00:51:03 -0700 |
commit | eb911443aaee63f414cd95de4dabf60e2f14a994 (patch) | |
tree | 7c8eb42e2602b572f430474648aec611f0c20c47 /include/account.php | |
parent | 5b547ae991624924c0ef11dbe36ae57f5ec2182b (diff) | |
download | volse-hubzilla-eb911443aaee63f414cd95de4dabf60e2f14a994.tar.gz volse-hubzilla-eb911443aaee63f414cd95de4dabf60e2f14a994.tar.bz2 volse-hubzilla-eb911443aaee63f414cd95de4dabf60e2f14a994.zip |
more zregister cleanup and theme separation
Diffstat (limited to 'include/account.php')
-rw-r--r-- | include/account.php | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/include/account.php b/include/account.php index 91891ab23..652048e29 100644 --- a/include/account.php +++ b/include/account.php @@ -12,7 +12,8 @@ function check_account_email($email) { $result = array('error' => false, 'message' => ''); - // Caution: empty email isn't counted as an error in this function. Check emptiness separately. + // Caution: empty email isn't counted as an error in this function. + // Check for empty value separately. if(! strlen($email)) return $result; @@ -32,10 +33,25 @@ function check_account_email($email) { if($result['message']) $result['error'] = true; - return $result; + $arr = array('email' => $email, 'result' => $result); + call_hooks('check_account_email', $arr); + + return $arr['result']; } +function check_account_password($password) { + $result = array('error' => false, 'message' => ''); + + // The only validation we perform by default is pure Javascript to + // check minimum length and that both entered passwords match. + // Use hooked functions to perform complexity requirement checks. + + $arr = array('password' => $password, 'result' => $result); + call_hooks('check_account_password', $arr); + return $arr['result']; + +} function create_account($arr) { @@ -77,6 +93,13 @@ function create_account($arr) { return $result; } + $password_result = check_account_password($password); + + if(! $password_result['error']) { + $result['message'] = $password_result['message']; + return $result; + } + $password_encoded = hash('whirlpool',$password); $r = q("INSERT INTO account |