X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fadmin.php;h=4f0622532f45d3f02a073c0255efbecb409dd980;hb=d60f96f0e17d751d614af28e029546d1ff003ee6;hp=49596578b8f4e1b0b45bc2ebc737e891cfbf663e;hpb=289dde39ce42414d5c3ffb138bf5f7ed846b3eaa;p=friendica.git diff --git a/mod/admin.php b/mod/admin.php index 49596578b8..4f0622532f 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -363,7 +363,7 @@ function admin_page_blocklist_post(App $a) { * This subpage of the admin panel offers the nodes admin to delete an item from * the node, given the GUID or the display URL such as http://example.com/display/123456. * The item will then be marked as deleted in the database and processed accordingly. - * + * * @param App $a * @return string */ @@ -606,10 +606,9 @@ function admin_page_queue(App $a) { * @return string */ function admin_page_summary(App $a) { - global $db; // are there MyISAM tables in the DB? If so, trigger a warning message $r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine` = 'myisam' AND `table_schema` = '%s' LIMIT 1", - dbesc($db->database_name())); + dbesc(dba::database_name())); $showwarning = false; $warningtext = array(); if (dbm::is_result($r)) { @@ -626,6 +625,15 @@ function admin_page_summary(App $a) { $warningtext[] = t('The database update failed. Please run "php include/dbstructure.php update" from the command line and have a look at the errors that might appear.'); } + $last_worker_call = Config::get('system', 'last_poller_execution', false); + if (!$last_worker_call) { + $showwarning = true; + $warningtext[] = t('The worker was never executed. Please check your database structure!'); + } elseif ((strtotime(datetime_convert()) - strtotime($last_worker_call)) > 60 * 60) { + $showwarning = true; + $warningtext[] = sprintf(t('The last worker execution was on %s UTC. This is older than one hour. Please check your crontab settings.'), $last_worker_call); + } + $r = q("SELECT `page-flags`, COUNT(`uid`) AS `count` FROM `user` GROUP BY `page-flags`"); $accounts = array( array(t('Normal Account'), 0), @@ -683,11 +691,16 @@ function admin_page_summary(App $a) { * @param App $a */ function admin_page_site_post(App $a) { - if (!x($_POST,"page_site")) { + check_form_security_token_redirectOnErr('/admin/site', 'admin_site'); + + if (!empty($_POST['republish_directory'])) { + proc_run(PRIORITY_LOW, 'include/directory.php'); return; } - check_form_security_token_redirectOnErr('/admin/site', 'admin_site'); + if (!x($_POST,"page_site")) { + return; + } // relocate if (x($_POST,'relocate') && x($_POST,'relocate_url') && $_POST['relocate_url'] != "") { @@ -712,7 +725,7 @@ function admin_page_site_post(App $a) { $old_host = str_replace("http://", "@", normalise_link($old_url)); function update_table($table_name, $fields, $old_url, $new_url) { - global $db, $a; + global $a; $dbold = dbesc($old_url); $dbnew = dbesc($new_url); @@ -729,7 +742,7 @@ function admin_page_site_post(App $a) { $q = sprintf("UPDATE %s SET %s;", $table_name, $upds); $r = q($q); if (!$r) { - notice("Failed updating '$table_name': ".$db->error); + notice("Failed updating '$table_name': ".dba::errorMessage()); goaway('admin/site'); } } @@ -927,16 +940,16 @@ function admin_page_site_post(App $a) { set_config('system','language', $language); set_config('system','theme', $theme); - if ($theme_mobile === '---') { + if ($theme_mobile == '---') { del_config('system','mobile-theme'); } else { set_config('system','mobile-theme', $theme_mobile); - } - if ($singleuser === '---') { - del_config('system','singleuser'); - } else { - set_config('system','singleuser', $singleuser); - } + } + if ($singleuser == '---') { + del_config('system','singleuser'); + } else { + set_config('system','singleuser', $singleuser); + } set_config('system', 'maximagesize', $maximagesize); set_config('system', 'max_image_length', $maximagelength); set_config('system', 'jpeg_quality', $jpegimagequality); @@ -1098,7 +1111,7 @@ function admin_page_site(App $a) { /* Banner */ $banner = get_config('system','banner'); if ($banner == false) { - $banner = 'logoFriendica'; + $banner = 'logoFriendica'; } $banner = htmlspecialchars($banner); $info = get_config('config','info'); @@ -1143,6 +1156,7 @@ function admin_page_site(App $a) { '$title' => t('Administration'), '$page' => t('Site'), '$submit' => t('Save Settings'), + '$republish' => t('Republish users to directory'), '$registration' => t('Registration'), '$upload' => t('File upload'), '$corporate' => t('Policies'), @@ -1162,11 +1176,11 @@ function admin_page_site(App $a) { '$info' => array('info', t('Additional Info'), $info, sprintf(t('For public servers: you can add additional information here that will be listed at %s/siteinfo.'), get_server())), '$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices), '$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - change theme settings"), $theme_choices), - '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile-theme'), t("Theme for mobile devices"), $theme_choices_mobile), + '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), Config::get('system', 'mobile-theme', '---'), t("Theme for mobile devices"), $theme_choices_mobile), '$ssl_policy' => array('ssl_policy', t("SSL link policy"), (string) intval(get_config('system','ssl_policy')), t("Determines whether generated links should be forced to use SSL"), $ssl_choices), '$force_ssl' => array('force_ssl', t("Force SSL"), get_config('system','force_ssl'), t("Force all Non-SSL requests to SSL - Attention: on some systems it could lead to endless loops.")), '$hide_help' => array('hide_help', t("Hide help entry from navigation menu"), get_config('system','hide_help'), t("Hides the menu entry for the Help pages from the navigation menu. You can still access it calling /help directly.")), - '$singleuser' => array('singleuser', t("Single user instance"), get_config('system','singleuser'), t("Make this instance multi-user or single-user for the named user"), $user_names), + '$singleuser' => array('singleuser', t("Single user instance"), Config::get('system', 'singleuser', '---'), t("Make this instance multi-user or single-user for the named user"), $user_names), '$maximagesize' => array('maximagesize', t("Maximum image size"), get_config('system','maximagesize'), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")), '$maximagelength' => array('maximagelength', t("Maximum image length"), get_config('system','max_image_length'), t("Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.")), '$jpegimagequality' => array('jpegimagequality', t("JPEG image quality"), get_config('system','jpeg_quality'), t("Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.")), @@ -1225,7 +1239,7 @@ function admin_page_site(App $a) { '$proxy_disabled' => array('proxy_disabled', t("Disable picture proxy"), get_config('system','proxy_disabled'), t("The picture proxy increases performance and privacy. It shouldn't be used on systems with very low bandwith.")), '$only_tag_search' => array('only_tag_search', t("Only search in tags"), get_config('system','only_tag_search'), t("On large systems the text search can slow down the system extremely.")), - '$relocate_url' => array('relocate_url', t("New base url"), System::baseUrl(), t("Change base url for this server. Sends relocate message to all DFRN contacts of all users.")), + '$relocate_url' => array('relocate_url', t("New base url"), System::baseUrl(), t("Change base url for this server. Sends relocate message to all Friendica and Diaspora* contacts of all users.")), '$rino' => array('rino', t("RINO Encryption"), intval(get_config('system','rino_encrypt')), t("Encryption layer between nodes."), array("Disabled", "RINO1 (deprecated)", "RINO2")),