]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/User.php
Function renamed
[friendica.git] / src / Model / User.php
index d33cf284075d8a70611bf9de5a3e2c812a7bf8c2..11d55e7f7e26529fa507f8ddacd2b5a60124b385 100644 (file)
@@ -35,7 +35,7 @@ use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
 use Friendica\DI;
-use Friendica\Module\Register;
+use Friendica\Module;
 use Friendica\Network\HTTPClient\Client\HttpClientAccept;
 use Friendica\Security\TwoFactor\Model\AppSpecificPassword;
 use Friendica\Network\HTTPException;
@@ -816,14 +816,14 @@ class User
         * Empties the password reset token field just in case.
         *
         * @param int    $uid
-        * @param string $pasword_hashed
+        * @param string $password_hashed
         * @return bool
         * @throws Exception
         */
-       private static function updatePasswordHashed(int $uid, string $pasword_hashed): bool
+       private static function updatePasswordHashed(int $uid, string $password_hashed): bool
        {
                $fields = [
-                       'password' => $pasword_hashed,
+                       'password' => $password_hashed,
                        'pwdreset' => null,
                        'pwdreset_time' => null,
                        'legacy_password' => false
@@ -851,7 +851,7 @@ class User
         * Checks if a nickname is in the list of the forbidden nicknames
         *
         * Check if a nickname is forbidden from registration on the node by the
-        * admin. Forbidden nicknames (e.g. role namess) can be configured in the
+        * admin. Forbidden nicknames (e.g. role names) can be configured in the
         * admin panel.
         *
         * @param string $nickname The nickname that should be checked
@@ -1232,7 +1232,7 @@ class User
 
                                $resource_id = Photo::newResource();
 
-                               // Not using Photo::PROFILE_PHOTOS here, so that it is discovered as translateble string
+                               // Not using Photo::PROFILE_PHOTOS here, so that it is discovered as translatable string
                                $profile_album = DI::l10n()->t('Profile Photos');
 
                                $r = Photo::store($image, $uid, 0, $resource_id, $filename, $profile_album, 4);
@@ -1377,7 +1377,7 @@ class User
         * permanently against re-registration, as the person was not yet
         * allowed to have friends on this system
         *
-        * @return bool True, if the deny was successfull
+        * @return bool True, if the deny was successful
         * @throws Exception
         */
        public static function deny(string $hash): bool
@@ -1792,7 +1792,7 @@ class User
         *
         * @param int    $start Start count (Default is 0)
         * @param int    $count Count of the items per page (Default is @see Pager::ITEMS_PER_PAGE)
-        * @param string $type  The type of users, which should get (all, bocked, removed)
+        * @param string $type  The type of users, which should get (all, blocked, removed)
         * @param string $order Order of the user list (Default is 'contact.name')
         * @param bool   $descending Order direction (Default is ascending)
         * @return array|bool The list of the users
@@ -1890,17 +1890,17 @@ class User
                }
 
                $register_policy = DI::config()->get('config', 'register_policy');
-               if (!in_array($register_policy, [Register::OPEN, Register::CLOSED])) {
+               if (!in_array($register_policy, [Module\Register::OPEN, Module\Register::CLOSED])) {
                        Logger::debug('Unsupported register policy.', ['policy' => $register_policy]);
                        return;
                }
 
                $users = DBA::count('user', ['blocked' => false, 'account_removed' => false, 'account_expired' => false]);
-               if (($users >= $max_registered_users) && ($register_policy == Register::OPEN)) {
-                       DI::config()->set('config', 'register_policy', Register::CLOSED);
+               if (($users >= $max_registered_users) && ($register_policy == Module\Register::OPEN)) {
+                       DI::config()->set('config', 'register_policy', Module\Register::CLOSED);
                        Logger::notice('Max users reached, registration is closed.', ['users' => $users, 'max' => $max_registered_users]);
-               } elseif (($users < $max_registered_users) && ($register_policy == Register::CLOSED)) {
-                       DI::config()->set('config', 'register_policy', Register::OPEN);
+               } elseif (($users < $max_registered_users) && ($register_policy == Module\Register::CLOSED)) {
+                       DI::config()->set('config', 'register_policy', Module\Register::OPEN);
                        Logger::notice('Below maximum users, registration is opened.', ['users' => $users, 'max' => $max_registered_users]);
                } else {
                        Logger::debug('Unchanged register policy', ['policy' => $register_policy, 'users' => $users, 'max' => $max_registered_users]);