]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/User.php
AP Bugfix: Following a soapbox now works / rapid follow/unfollow should work now
[friendica.git] / src / Model / User.php
index a43ef06f970619105a9cd8e29f84f86972697aa5..7432b75774b22516165ad664e1102fb4d3f97f91 100644 (file)
@@ -31,6 +31,23 @@ require_once 'include/text.php';
  */
 class User
 {
+       /**
+        * @brief Returns the user id of a given profile url
+        *
+        * @param string $profile
+        *
+        * @return integer user id
+        */
+       public static function getIdForURL($url)
+       {
+               $self = DBA::selectFirst('contact', ['uid'], ['nurl' => normalise_link($url), 'self' => true]);
+               if (!DBA::isResult($self)) {
+                       return false;
+               } else {
+                       return $self['uid'];
+               }
+       }
+
        /**
         * @brief Get owner data by user id
         *
@@ -495,7 +512,7 @@ class User
                $spubkey = $sres['pubkey'];
 
                $insert_result = DBA::insert('user', [
-                       'guid'     => System::createGUID(32),
+                       'guid'     => System::createUUID(),
                        'username' => $username,
                        'password' => $new_password_encoded,
                        'email'    => $email,
@@ -730,7 +747,7 @@ class User
                DBA::insert('userd', ['username' => $user['nickname']]);
 
                // The user and related data will be deleted in "cron_expire_and_remove_users" (cronjobs.php)
-               DBA::update('user', ['account_removed' => true, 'account_expires_on' => DateTimeFormat::utc($t . " + 7 day")], ['uid' => $uid]);
+               DBA::update('user', ['account_removed' => true, 'account_expires_on' => DateTimeFormat::utc(DateTimeFormat::utcNow() . " + 7 day")], ['uid' => $uid]);
                Worker::add(PRIORITY_HIGH, "Notifier", "removeme", $uid);
 
                // Send an update to the directory