]> git.mxchange.org Git - friendica.git/commitdiff
Add @TODO comments per @nupplaphil review in various Admin modules
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 2 May 2019 14:20:02 +0000 (10:20 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 2 May 2019 14:20:02 +0000 (10:20 -0400)
src/Module/Admin/Queue.php
src/Module/Admin/Site.php
src/Module/Admin/Users.php

index 748a12a6a6332eee33a64e1733263545afc57a58..e89aa53c620e4e65e789ae1baaea6c6ad215581e 100644 (file)
@@ -39,6 +39,7 @@ class Queue extends BaseAdminModule
                        $info = L10n::t('This page lists the currently queued worker jobs. These jobs are handled by the worker cronjob you\'ve set up during install.');
                }
 
+               // @TODO Move to Model\WorkerQueue::getEntries()
                $entries = DBA::select('workerqueue', ['id', 'parameter', 'created', 'priority'], $condition, ['order' => ['priority']]);
 
                $r = [];
index 37507ca9964f6171814a9bbecbe9fce4a53cfd14..5d2004ca5fbf988961e51671f9dc973671792450 100644 (file)
@@ -483,6 +483,7 @@ class Site extends BaseAdminModule
                ];
 
                /* get user names to make the install a personal install of X */
+               // @TODO Move to Model\User::getNames()
                $user_names = [];
                $user_names['---'] = L10n::t('Multi user instance');
 
index d9852e98d0488fbc9159cfb79761234981aef799..92dddd9f73b3e323ea6138af8ecd1c227ab8c69f 100644 (file)
@@ -91,11 +91,13 @@ class Users extends BaseAdminModule
                }
 
                if (!empty($_POST['page_users_block'])) {
+                       // @TODO Move this to Model\User:block($users);
                        DBA::update('user', ['blocked' => 1], ['uid' => $users]);
                        notice(L10n::tt('%s user blocked', '%s users blocked', count($users)));
                }
 
                if (!empty($_POST['page_users_unblock'])) {
+                       // @TODO Move this to Model\User:unblock($users);
                        DBA::update('user', ['blocked' => 0], ['uid' => $users]);
                        notice(L10n::tt('%s user unblocked', '%s users unblocked', count($users)));
                }
@@ -139,7 +141,7 @@ class Users extends BaseAdminModule
                        // @TODO: Replace with parameter from router
                        $action = $a->argv[2];
                        $uid = $a->argv[3];
-                       $user = DBA::selectFirst('user', ['username', 'blocked'], ['uid' => $uid]);
+                       $user = User::getById($uid, ['username', 'blocked']);
                        if (!DBA::isResult($user)) {
                                notice('User not found' . EOL);
                                $a->internalRedirect('admin/users');
@@ -160,11 +162,13 @@ class Users extends BaseAdminModule
                                        break;
                                case 'block':
                                        parent::checkFormSecurityTokenRedirectOnError('/admin/users', 'admin_users', 't');
+                                       // @TODO Move this to Model\User:block([$uid]);
                                        DBA::update('user', ['blocked' => 1], ['uid' => $uid]);
                                        notice(L10n::t('User "%s" blocked', $user['username']));
                                        break;
                                case 'unblock':
                                        parent::checkFormSecurityTokenRedirectOnError('/admin/users', 'admin_users', 't');
+                                       // @TODO Move this to Model\User:unblock([$uid]);
                                        DBA::update('user', ['blocked' => 0], ['uid' => $uid]);
                                        notice(L10n::t('User "%s" unblocked', $user['username']));
                                        break;
@@ -178,7 +182,7 @@ class Users extends BaseAdminModule
 
                $pager = new Pager($a->query_string, 100);
 
-               /* ordering */
+               // @TODO Move below block to Model\User::getUsers($start, $count, $order = 'contact.name', $order_direction = '+')
                $valid_orders = [
                        'contact.name',
                        'user.email',