]> git.mxchange.org Git - friendica.git/blobdiff - mod/admin.php
Merge pull request #3949 from annando/further-information
[friendica.git] / mod / admin.php
index 78e37afef6ff119c762017a4301dfd1f2d8f09d2..4b3e01b3d4688a07e3910c6104bb049d420a339c 100644 (file)
@@ -11,10 +11,11 @@ use Friendica\Core\System;
 use Friendica\Core\Config;
 use Friendica\Core\Worker;
 use Friendica\Database\DBM;
+use Friendica\Model\User;
 
-require_once("include/enotify.php");
-require_once("include/text.php");
-require_once('include/items.php');
+require_once 'include/enotify.php';
+require_once 'include/text.php';
+require_once 'include/items.php';
 
 /**
  * @brief Process send data from the admin panels subpages
@@ -705,7 +706,7 @@ function admin_page_site_post(App $a) {
        check_form_security_token_redirectOnErr('/admin/site', 'admin_site');
 
        if (!empty($_POST['republish_directory'])) {
-               Worker::add(PRIORITY_LOW, 'directory');
+               Worker::add(PRIORITY_LOW, 'Directory');
                return;
        }
 
@@ -778,7 +779,7 @@ function admin_page_site_post(App $a) {
                $users = q("SELECT `uid` FROM `user` WHERE `account_removed` = 0 AND `account_expired` = 0");
 
                foreach ($users as $user) {
-                       Worker::add(PRIORITY_HIGH, 'notifier', 'relocate', $user['uid']);
+                       Worker::add(PRIORITY_HIGH, 'Notifier', 'relocate', $user['uid']);
                }
 
                info("Relocation started. Could take a while to complete.");
@@ -867,7 +868,7 @@ function admin_page_site_post(App $a) {
        // Has the directory url changed? If yes, then resubmit the existing profiles there
        if ($global_directory != Config::get('system', 'directory') && ($global_directory != '')) {
                Config::set('system', 'directory', $global_directory);
-               Worker::add(PRIORITY_LOW, 'directory');
+               Worker::add(PRIORITY_LOW, 'Directory');
        }
 
        if ($a->get_path() != "") {
@@ -1237,7 +1238,7 @@ function admin_page_site(App $a) {
                '$timeout'              => array('timeout', t("Network timeout"), (x(Config::get('system','curl_timeout'))?Config::get('system','curl_timeout'):60), t("Value is in seconds. Set to 0 for unlimited (not recommended).")),
                '$maxloadavg'           => array('maxloadavg', t("Maximum Load Average"), ((intval(Config::get('system','maxloadavg')) > 0)?Config::get('system','maxloadavg'):50), t("Maximum system load before delivery and poll processes are deferred - default 50.")),
                '$maxloadavg_frontend'  => array('maxloadavg_frontend', t("Maximum Load Average (Frontend)"), ((intval(Config::get('system','maxloadavg_frontend')) > 0)?Config::get('system','maxloadavg_frontend'):50), t("Maximum system load before the frontend quits service - default 50.")),
-               '$min_memory'           => array('min_memory', t("Minimal Memory"), ((intval(Config::get('system','min_memory')) > 0)?Config::get('system','min_memory'):0), t("Minimal free memory in MB for the poller. Needs access to /proc/meminfo - default 0 (deactivated).")),
+               '$min_memory'           => array('min_memory', t("Minimal Memory"), ((intval(Config::get('system','min_memory')) > 0)?Config::get('system','min_memory'):0), t("Minimal free memory in MB for the worker. Needs access to /proc/meminfo - default 0 (deactivated).")),
                '$optimize_max_tablesize'=> array('optimize_max_tablesize', t("Maximum table size for optimization"), $optimize_max_tablesize, t("Maximum table size (in MB) for the automatic optimization - default 100 MB. Enter -1 to disable it.")),
                '$optimize_fragmentation'=> array('optimize_fragmentation', t("Minimum level of fragmentation"), ((intval(Config::get('system','optimize_fragmentation')) > 0)?Config::get('system','optimize_fragmentation'):30), t("Minimum fragmenation level to start the automatic optimization - default value is 30%.")),
 
@@ -1264,7 +1265,7 @@ function admin_page_site(App $a) {
                '$rino'                 => array('rino', t("RINO Encryption"), intval(Config::get('system','rino_encrypt')), t("Encryption layer between nodes."), array("Disabled", "RINO1 (deprecated)", "RINO2")),
 
                '$worker_queues'        => array('worker_queues', t("Maximum number of parallel workers"), Config::get('system','worker_queues'), t("On shared hosters set this to 2. On larger systems, values of 10 are great. Default value is 4.")),
-               '$worker_dont_fork'     => array('worker_dont_fork', t("Don't use 'proc_open' with the worker"), Config::get('system','worker_dont_fork'), t("Enable this if your system doesn't allow the use of 'proc_open'. This can happen on shared hosters. If this is enabled you should increase the frequency of poller calls in your crontab.")),
+               '$worker_dont_fork'     => array('worker_dont_fork', t("Don't use 'proc_open' with the worker"), Config::get('system','worker_dont_fork'), t("Enable this if your system doesn't allow the use of 'proc_open'. This can happen on shared hosters. If this is enabled you should increase the frequency of worker calls in your crontab.")),
                '$worker_fastlane'      => array('worker_fastlane', t("Enable fastlane"), Config::get('system','worker_fastlane'), t("When enabed, the fastlane mechanism starts an additional worker if processes with higher priority are blocked by processes of lower priority.")),
                '$worker_frontend'      => array('worker_frontend', t('Enable frontend worker'), Config::get('system','frontend_worker'), sprintf(t('When enabled the Worker process is triggered when backend access is performed (e.g. messages being delivered). On smaller sites you might want to call %s/worker on a regular basis via an external cron job. You should only enable this option if you cannot utilize cron/scheduled jobs on your server.'), System::baseUrl())),
 
@@ -1443,9 +1444,8 @@ function admin_page_users_post(App $a) {
                notice(sprintf(tt("%s user blocked/unblocked", "%s users blocked/unblocked", count($users)), count($users)));
        }
        if (x($_POST,'page_users_delete')) {
-               require_once("include/Contact.php");
                foreach ($users as $uid) {
-                       user_remove($uid);
+                       User::remove($uid);
                }
                notice(sprintf(tt("%s user deleted", "%s users deleted", count($users)), count($users)));
        }
@@ -1491,8 +1491,7 @@ function admin_page_users(App $a) {
                        case "delete":
                                check_form_security_token_redirectOnErr('/admin/users', 'admin_users', 't');
                                // delete user
-                               require_once("include/Contact.php");
-                               user_remove($uid);
+                               User::remove($uid);
 
                                notice(sprintf(t("User '%s' deleted"), $user[0]['username']).EOL);
                                break;