]> git.mxchange.org Git - friendica.git/blobdiff - mod/regmod.php
Bugfix Diaspora: We exited with the wrong return values and the guid for messages...
[friendica.git] / mod / regmod.php
index 19fc047cc51abba9d256bd22c75ebbdce347ee1e..3c860120882fd0d54f071f9e48b9fa92bec00174 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use Friendica\App;
+
 require_once('include/enotify.php');
 require_once('include/user.php');
 
@@ -54,7 +56,7 @@ function user_allow($hash) {
 
        pop_lang();
 
-       if ($res) {
+       if($res) {
                info( t('Account approved.') . EOL );
                return true;
        }
@@ -72,7 +74,7 @@ function user_deny($hash) {
                dbesc($hash)
        );
 
-       if (! dbm::is_result($register)) {
+       if (!dbm::is_result($register)) {
                return false;
        }
 
@@ -80,20 +82,10 @@ function user_deny($hash) {
                intval($register[0]['uid'])
        );
 
-       $r = q("DELETE FROM `user` WHERE `uid` = %d",
-               intval($register[0]['uid'])
-       );
-       $r = q("DELETE FROM `contact` WHERE `uid` = %d",
-               intval($register[0]['uid'])
-       );
-       $r = q("DELETE FROM `profile` WHERE `uid` = %d",
-               intval($register[0]['uid'])
-       );
+       dba::delete('user', array('uid' => $register[0]['uid']));
+       dba::delete('register', array('hash' => $register[0]['hash']));
 
-       $r = q("DELETE FROM `register` WHERE `hash` = '%s'",
-               dbesc($register[0]['hash'])
-       );
-       notice( sprintf(t('Registration revoked for %s'), $user[0]['username']) . EOL);
+       notice(sprintf(t('Registration revoked for %s'), $user[0]['username']) . EOL);
        return true;
 
 }