X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fuser.php;h=580af56f981ac21bf790021959c31b4b613fe148;hb=678de014ad2f2d1fc0915f83998eba0e325f8720;hp=eccfa7a08a69eead63ae65d62d531dc48cb5d8d7;hpb=e767e2d750585da48c913cc1b09f17a785ccfe8c;p=friendica.git diff --git a/include/user.php b/include/user.php index eccfa7a08a..580af56f98 100644 --- a/include/user.php +++ b/include/user.php @@ -27,12 +27,20 @@ function create_user($arr) { $openid_url = ((x($arr,'openid_url')) ? notags(trim($arr['openid_url'])) : ''); $photo = ((x($arr,'photo')) ? notags(trim($arr['photo'])) : ''); $password = ((x($arr,'password')) ? trim($arr['password']) : ''); + $password1 = ((x($arr,'password1')) ? trim($arr['password1']) : ''); + $confirm = ((x($arr,'confirm')) ? trim($arr['confirm']) : ''); $blocked = ((x($arr,'blocked')) ? intval($arr['blocked']) : 0); $verified = ((x($arr,'verified')) ? intval($arr['verified']) : 0); $publish = ((x($arr,'profile_publish_reg') && intval($arr['profile_publish_reg'])) ? 1 : 0); $netpublish = ((strlen(get_config('system','directory_submit_url'))) ? $publish : 0); + if ($password1 != $confirm) { + $result['message'] .= t('Passwords do not match. Password unchanged.') . EOL; + return $result; + } elseif ($password1 != "") + $password = $password1; + $tmp_str = $openid_url; if($using_invites) { @@ -189,8 +197,8 @@ function create_user($arr) { $spubkey = $sres['pubkey']; $r = q("INSERT INTO `user` ( `guid`, `username`, `password`, `email`, `openid`, `nickname`, - `pubkey`, `prvkey`, `spubkey`, `sprvkey`, `register_date`, `verified`, `blocked`, `timezone`, `service_class` ) - VALUES ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, 'UTC', '%s' )", + `pubkey`, `prvkey`, `spubkey`, `sprvkey`, `register_date`, `verified`, `blocked`, `timezone`, `service_class`, `default-location` ) + VALUES ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, 'UTC', '%s', '' )", dbesc(generate_user_guid()), dbesc($username), dbesc($new_password_encoded),