]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Register.php
Merge pull request #8175 from MrPetovan/task/revert-profile-default-tab
[friendica.git] / src / Model / Register.php
index 5311c80c268ad7404e9b4d256dab443db1a380c6..9f6d369744ec054d06da232f0becc373dc4b38d7 100644 (file)
@@ -3,6 +3,7 @@
 /**
  * @file src/Model/Register.php
  */
+
 namespace Friendica\Model;
 
 use Friendica\Database\DBA;
@@ -20,11 +21,12 @@ class Register
         * Return the list of pending registrations
         *
         * @return array
+        * @throws \Exception
         */
        public static function getPending()
        {
                $stmt = DBA::p(
-                       "SELECT `register`.*, `contact`.`name`, `user`.`email`
+                       "SELECT `register`.*, `contact`.`name`, `contact`.`url`, `contact`.`micro`, `user`.`email`
                        FROM `register`
                        INNER JOIN `contact` ON `register`.`uid` = `contact`.`uid`
                        INNER JOIN `user` ON `register`.`uid` = `user`.`uid`"
@@ -37,6 +39,7 @@ class Register
         * Returns the pending registration count
         *
         * @return int
+        * @throws \Exception
         */
        public static function getPendingCount()
        {
@@ -54,6 +57,7 @@ class Register
         *
         * @param  string $hash
         * @return array
+        * @throws \Exception
         */
        public static function getByHash($hash)
        {
@@ -63,8 +67,9 @@ class Register
        /**
         * Returns true if a register record exists with the provided hash
         *
-        * @param  string  $hash
+        * @param  string $hash
         * @return boolean
+        * @throws \Exception
         */
        public static function existsByHash($hash)
        {
@@ -75,10 +80,11 @@ class Register
         * Creates a register record for an invitation and returns the auto-generated code for it
         *
         * @return string
+        * @throws \Exception
         */
        public static function createForInvitation()
        {
-               $code = autoname(8) . srand(1000, 9999);
+               $code = Strings::getRandomName(8) . random_int(1000, 9999);
 
                $fields = [
                        'hash' => $code,
@@ -98,6 +104,7 @@ class Register
         * @param  string  $language The registration language
         * @param  string  $note     An additional message from the user
         * @return boolean
+        * @throws \Exception
         */
        public static function createForApproval($uid, $language, $note = '')
        {
@@ -122,8 +129,9 @@ class Register
        /**
         * Deletes a register record by the provided hash and returns the success of the database deletion
         *
-        * @param  string  $hash
+        * @param  string $hash
         * @return boolean
+        * @throws \Exception
         */
        public static function deleteByHash($hash)
        {