]> git.mxchange.org Git - friendica.git/blobdiff - mod/admin.php
Fix function naming
[friendica.git] / mod / admin.php
index 372210c403efd6b448a78cebfcca60e7c33c178b..b0fb6d47262a23024e8d0df63c464a2cd438f4c5 100644 (file)
@@ -18,13 +18,14 @@ use Friendica\Database\DBA;
 use Friendica\Database\DBStructure;
 use Friendica\Model\Contact;
 use Friendica\Model\Item;
+use Friendica\Model\Register;
 use Friendica\Model\User;
 use Friendica\Module\Login;
 use Friendica\Module\Tos;
 use Friendica\Util\Arrays;
 use Friendica\Util\DateTimeFormat;
-use Friendica\Util\Temporal;
 use Friendica\Util\Network;
+use Friendica\Util\Temporal;
 
 require_once 'include/enotify.php';
 require_once 'include/text.php';
@@ -33,11 +34,11 @@ require_once 'include/items.php';
 /**
  * @brief Process send data from the admin panels subpages
  *
- * This function acts as relais for processing the data send from the subpages
+ * This function acts as relay for processing the data send from the subpages
  * of the admin panel. Depending on the 1st parameter of the url (argv[1])
  * specialized functions are called to process the data from the subpages.
  *
- * The function itself does not return anything, but the subsequencely function
+ * The function itself does not return anything, but the subsequently function
  * return the HTML for the pages of the admin panel.
  *
  * @param App $a
@@ -77,7 +78,7 @@ function admin_post(App $a)
                                break;
                        case 'themes':
                                if ($a->argc < 2) {
-                                       if (is_ajax()) {
+                                       if ($a->isAjax()) {
                                                return;
                                        }
                                        goaway('admin/');
@@ -107,7 +108,7 @@ function admin_post(App $a)
                                }
 
                                info(L10n::t('Theme settings updated.'));
-                               if (is_ajax()) {
+                               if ($a->isAjax()) {
                                        return;
                                }
                                $return_path = 'admin/themes/' . $theme;
@@ -286,7 +287,7 @@ function admin_content(App $a)
                $o = admin_page_summary($a);
        }
 
-       if (is_ajax()) {
+       if ($a->isAjax()) {
                echo $o;
                killme();
                return '';
@@ -895,8 +896,7 @@ function admin_page_summary(App $a)
 
        logger('accounts: ' . print_r($accounts, true), LOGGER_DATA);
 
-       $r = q("SELECT COUNT(`id`) AS `count` FROM `register`");
-       $pending = $r[0]['count'];
+       $pending = Register::getPendingCount();
 
        $r = q("SELECT COUNT(*) AS `total` FROM `queue` WHERE 1");
        $queue = (($r) ? $r[0]['total'] : 0);
@@ -912,10 +912,10 @@ function admin_page_summary(App $a)
        $r = q("SHOW variables LIKE 'max_allowed_packet'");
        $max_allowed_packet = (($r) ? $r[0]['Value'] : 0);
 
-       $server_settings = ['label' => L10n::t('Server Settings'), 
-                               'php' => ['upload_max_filesize' => ini_get('upload_max_filesize'), 
-                                                 'post_max_size' => ini_get('post_max_size'), 
-                                                 'memory_limit' => ini_get('memory_limit')], 
+       $server_settings = ['label' => L10n::t('Server Settings'),
+                               'php' => ['upload_max_filesize' => ini_get('upload_max_filesize'),
+                                                 'post_max_size' => ini_get('post_max_size'),
+                                                 'memory_limit' => ini_get('memory_limit')],
                                'mysql' => ['max_allowed_packet' => $max_allowed_packet]];
 
        $t = get_markup_template('admin/summary.tpl');
@@ -1792,11 +1792,7 @@ function admin_page_users(App $a)
        }
 
        /* get pending */
-       $pending = q("SELECT `register`.*, `contact`.`name`, `user`.`email`
-                                FROM `register`
-                                INNER JOIN `contact` ON `register`.`uid` = `contact`.`uid`
-                                INNER JOIN `user` ON `register`.`uid` = `user`.`uid`;");
-
+       $pending = Register::getPending();
 
        /* get users */
        $total = q("SELECT COUNT(*) AS `total` FROM `user` WHERE 1");
@@ -1922,7 +1918,7 @@ function admin_page_users(App $a)
 
                '$h_users' => L10n::t('Users'),
                '$h_newuser' => L10n::t('New User'),
-               '$th_deleted' => [L10n::t('Name'), L10n::t('Email'), L10n::t('Register date'), L10n::t('Last login'), L10n::t('Last item'), L10n::t('Deleted since')],
+               '$th_deleted' => [L10n::t('Name'), L10n::t('Email'), L10n::t('Register date'), L10n::t('Last login'), L10n::t('Last item'), L10n::t('Delete in')],
                '$th_users' => $th_users,
                '$order_users' => $order,
                '$order_direction_users' => $order_direction,
@@ -2536,7 +2532,7 @@ function admin_page_features_post(App $a)
  */
 function admin_page_features(App $a)
 {
-       if ((argc() > 1) && (argv(1) === 'features')) {
+       if (($a->argc > 1) && ($a->getArgumentValue(1) === 'features')) {
                $arr = [];
                $features = Feature::get(false);