aboutsummaryrefslogtreecommitdiffstats
path: root/include/account.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-08-26 23:05:00 -0700
committerfriendica <info@friendica.com>2012-08-26 23:05:00 -0700
commit5ff6e9348b41bc87b03bafc4d9df73b383af074e (patch)
treec26b1b26cd38f7ec78e83905266053618a3e1db4 /include/account.php
parentf0e299a97a8c46fd66bbc47e5b84d4b76d763154 (diff)
downloadvolse-hubzilla-5ff6e9348b41bc87b03bafc4d9df73b383af074e.tar.gz
volse-hubzilla-5ff6e9348b41bc87b03bafc4d9df73b383af074e.tar.bz2
volse-hubzilla-5ff6e9348b41bc87b03bafc4d9df73b383af074e.zip
a few minor changes
Diffstat (limited to 'include/account.php')
-rw-r--r--include/account.php37
1 files changed, 14 insertions, 23 deletions
diff --git a/include/account.php b/include/account.php
index fe0be87bc..e08b129f3 100644
--- a/include/account.php
+++ b/include/account.php
@@ -102,7 +102,6 @@ function create_account($arr) {
return $result;
}
-
$email_result = check_account_email($email);
if($email_result['error']) {
@@ -142,7 +141,7 @@ function create_account($arr) {
return($result);
}
- $r = q("select * from account where account_email = '%s' and password = '%s' limit 1",
+ $r = q("select * from account where account_email = '%s' and account_password = '%s' limit 1",
dbesc($email),
dbesc($password_encoded)
);
@@ -153,34 +152,26 @@ function create_account($arr) {
logger('create_account: could not retrieve newly created account');
}
- $result['success'] = true;
+ // Set the parent record to the current record_id if no parent was provided
+
+ if(! $parent) {
+ $r = q("update account set account_parent = %d where account_id = %d limit 1",
+ intval($result['account']['account_id']),
+ intval($result['account']['account_id'])
+ );
+ if(! $r) {
+ logger('create_account: failed to set parent');
+ }
+ $result['account']['parent'] = $result['account']['account_id'];
+ }
+ $result['success'] = true;
$result['email'] = $email;
$result['password'] = $password;
return $result;
}
-/**
- * Verify login credentials
- *
- * Returns account record on success, null on failure
- *
- */
-
-function account_verify_password($email,$pass) {
- $r = q("select * from account where email = '%s'",
- dbesc($email)
- );
- if(! ($r && count($r)))
- return null;
- foreach($r as $record) {
- if(hash('whirlpool',$record['account_salt'] . $pass) === $record['account_password']) {
- return $record;
- }
- }
- return null;
-}
function send_reg_approval_email($arr) {