]> git.mxchange.org Git - friendica.git/blobdiff - mod/admin.php
Add Contact Object
[friendica.git] / mod / admin.php
index 02e40836c9b2bbbe2b64a77d256cda5f34dbdb10..67313e060303e7f48b6ea8652f8b504b3d9569c8 100644 (file)
@@ -10,6 +10,8 @@ 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");
@@ -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');
        }
@@ -621,7 +623,7 @@ function admin_page_summary(App $a) {
        if (Config::get('system', 'check_new_version_url', 'none') != 'none' ) {
                $gitversion = Config::get('system','git_friendica_version');
                if (version_compare(FRIENDICA_VERSION, $gitversion) < 0) {
-                       $warningtext[] = t('There is a new version of Friendica available for download.');
+                       $warningtext[] = sprintf(t('There is a new version of Friendica available for download. Your current version is %1$s, upstream version is %2$s'), $FRIENDICA_VERSION, $gitversion);
                        $showwarning = true;
                }
        }
@@ -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() != "") {
@@ -944,7 +946,7 @@ function admin_page_site_post(App $a) {
        }
 
        if ($info == "") {
-               del_config('config','info');
+               Config::delete('config','info');
        } else {
                Config::set('config','info',$info);
        }
@@ -952,12 +954,12 @@ function admin_page_site_post(App $a) {
        Config::set('system','theme', $theme);
 
        if ($theme_mobile == '---') {
-               del_config('system','mobile-theme');
+               Config::delete('system','mobile-theme');
        } else {
                Config::set('system','mobile-theme', $theme_mobile);
        }
        if ($singleuser == '---') {
-               del_config('system','singleuser');
+               Config::delete('system','singleuser');
        } else {
                Config::set('system','singleuser', $singleuser);
        }
@@ -1048,7 +1050,7 @@ function admin_page_site(App $a) {
        if (strlen(Config::get('system','directory_submit_url')) &&
                !strlen(Config::get('system','directory'))) {
                        Config::set('system','directory', dirname(Config::get('system','directory_submit_url')));
-                       del_config('system','directory_submit_url');
+                       Config::delete('system','directory_submit_url');
        }
 
        /* Installed themes */
@@ -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') {
@@ -2234,12 +2236,12 @@ function admin_page_features_post(App $a) {
                        } else {
                                $val = 0;
                        }
-                       Config::set('feature',$feature,$val);
+                       Config::set('feature', $feature, $val);
 
                        if (x($_POST, $featurelock)) {
                                Config::set('feature_lock', $feature, $val);
                        } else {
-                               del_config('feature_lock', $feature);
+                               Config::delete('feature_lock', $feature);
                        }
                }
        }
@@ -2273,10 +2275,7 @@ function admin_page_features(App $a) {
                        $arr[$fname][0] = $fdata[0];
                        foreach (array_slice($fdata,1) as $f) {
 
-                               $set = Config::get('feature',$f[0]);
-                               if ($set === false) {
-                                       $set = $f[3];
-                               }
+                               $set = Config::get('feature', $f[0], $f[3]);
                                $arr[$fname][1][] = array(
                                        array('feature_' .$f[0],$f[1],$set,$f[2],array(t('Off'), t('On'))),
                                        array('featurelock_' .$f[0],sprintf(t('Lock feature %s'),$f[1]),(($f[4] !== false) ? "1" : ''),'',array(t('Off'), t('On')))