]> git.mxchange.org Git - friendica.git/blobdiff - mod/admin.php
Code cleanup
[friendica.git] / mod / admin.php
index 005473070eb9ed7beb51299e8935735e80e99400..28f890bb58b14811ce31979623b9187a99d58b64 100644 (file)
@@ -10,10 +10,12 @@ use Friendica\App;
 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
@@ -612,7 +614,7 @@ function admin_page_summary(App $a) {
                dbesc(dba::database_name()));
        $showwarning = false;
        $warningtext = array();
-       if (dbm::is_result($r)) {
+       if (DBM::is_result($r)) {
                $showwarning = true;
                $warningtext[] = sprintf(t('Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See <a href="%s">here</a> for a guide that may be helpful converting the table engines. You may also use the command <tt>php include/dbstructure.php toinnodb</tt> of your Friendica installation for an automatic conversion.<br />'), 'https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html');
        }
@@ -704,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;
        }
 
@@ -777,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.");
@@ -866,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() != "") {
@@ -1337,7 +1339,7 @@ function admin_page_dbsync(App $a) {
 
        $failed = array();
        $r = q("SELECT `k`, `v` FROM `config` WHERE `cat` = 'database' ");
-       if (dbm::is_result($r)) {
+       if (DBM::is_result($r)) {
                foreach ($r as $rr) {
                        $upd = intval(substr($rr['k'],7));
                        if ($upd < 1139 || $rr['v'] === 'success') {
@@ -1442,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)));
        }
@@ -1490,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;