X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fuser.php;h=df871c5468ac7d3abb7087adb87635b453633d25;hb=9521f39ebea7603098e4f96f5edb6c85a40fc646;hp=989c8b0e049fdb983639cf62c8ce523c81199cbe;hpb=e92135a2dc3a11af737c93491b3dcb7fe3ab159e;p=friendica.git diff --git a/include/user.php b/include/user.php index 989c8b0e04..df871c5468 100644 --- a/include/user.php +++ b/include/user.php @@ -130,7 +130,7 @@ function create_user($arr) { $r = q("SELECT * FROM `user` WHERE `email` = '%s' LIMIT 1", dbesc($email) ); - if(count($r)) + if (dbm::is_result($r)) $result['message'] .= t('Cannot use that email.') . EOL; } @@ -143,7 +143,7 @@ function create_user($arr) { WHERE `nickname` = '%s' LIMIT 1", dbesc($nickname) ); - if(count($r)) + if (dbm::is_result($r)) $result['message'] .= t('Nickname is already registered. Please choose another.') . EOL; // Check deleted accounts that had this nickname. Doesn't matter to us, @@ -153,7 +153,7 @@ function create_user($arr) { WHERE `username` = '%s' LIMIT 1", dbesc($nickname) ); - if(count($r)) + if (dbm::is_result($r)) $result['message'] .= t('Nickname was once registered here and may not be re-used. Please choose another.') . EOL; if(strlen($result['message'])) { @@ -216,13 +216,13 @@ function create_user($arr) { dbesc($default_service_class) ); - if($r) { + if ($r) { $r = q("SELECT * FROM `user` WHERE `username` = '%s' AND `password` = '%s' LIMIT 1", dbesc($username), dbesc($new_password_encoded) ); - if($r !== false && count($r)) { + if (dbm::is_result($r)) { $u = $r[0]; $newuid = intval($r[0]['uid']); } @@ -241,7 +241,7 @@ function create_user($arr) { WHERE `nickname` = '%s' ", dbesc($nickname) ); - if((count($r) > 1) && $newuid) { + if ((dbm::is_result($r)) && (count($r) > 1) && $newuid) { $result['message'] .= t('Nickname is already registered. Please choose another.') . EOL; q("DELETE FROM `user` WHERE `uid` = %d", intval($newuid) @@ -262,7 +262,7 @@ function create_user($arr) { intval($netpublish) ); - if($r === false) { + if ($r === false) { $result['message'] .= t('An error occurred creating your default profile. Please try again.') . EOL; // Start fresh next time. $r = q("DELETE FROM `user` WHERE `uid` = %d", @@ -283,7 +283,7 @@ function create_user($arr) { intval($newuid), dbesc(t('Friends')) ); - if($r && count($r)) { + if (dbm::is_result($r)) { $def_gid = $r[0]['id']; q("UPDATE `user` SET `def_gid` = %d WHERE `uid` = %d", @@ -325,24 +325,27 @@ function create_user($arr) { $r = $img->store($newuid, 0, $hash, $filename, t('Profile Photos'), 4 ); - if($r === false) + if ($r === false) { $photo_failure = true; + } $img->scaleImage(80); $r = $img->store($newuid, 0, $hash, $filename, t('Profile Photos'), 5 ); - if($r === false) + if ($r === false) { $photo_failure = true; + } $img->scaleImage(48); $r = $img->store($newuid, 0, $hash, $filename, t('Profile Photos'), 6 ); - if($r === false) + if ($r === false) { $photo_failure = true; + } - if(! $photo_failure) { + if (! $photo_failure) { q("UPDATE `photo` SET `profile` = 1 WHERE `resource-id` = '%s' ", dbesc($hash) );