@ -58,7 +58,7 @@ function admin_post(App $a)
// do not allow a page manager to access the admin panel at all.
if (x($_SESSION, 'submanage') & & intval ($_SESSION['submanage'])) {
if (!empty ($_SESSION['submanage'])) {
return;
}
@ -167,14 +167,14 @@ function admin_content(App $a)
return Login::form();
}
if (x($_SESSION, 'submanage') & & intval ($_SESSION['submanage'])) {
if (!empty ($_SESSION['submanage'])) {
return "";
}
// APC deactivated, since there are problems with PHP 5.5
//if (function_exists("apc_delete")) {
// $toDelete = new APCIterator('user', APC_ITER_VALUE);
// apc_delete($toDelete);
// $toDelete = new APCIterator('user', APC_ITER_VALUE);
// apc_delete($toDelete);
//}
// Header stuff
$a->page['htmlhead'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('admin/settings_head.tpl'), []);
@ -321,7 +321,7 @@ function admin_page_tos(App $a)
'$title' => L10n::t('Administration'),
'$page' => L10n::t('Terms of Service'),
'$displaytos' => ['displaytos', L10n::t('Display Terms of Service'), Config::get('system', 'tosdisplay'), L10n::t('Enable the Terms of Service page. If this is enabled a link to the terms will be added to the registration form and the general information page.')],
'$displayprivstatement' => ['displayprivstatement', L10n::t('Display Privacy Statement'), Config::get('system','tosprivstatement'), L10n::t('Show some informations regarding the needed information to operate the node according e.g. to < a href = "%s" target = "_blank" > EU-GDPR< / a > .','https://en.wikipedia.org/wiki/General_Data_Protection_Regulation')],
'$displayprivstatement' => ['displayprivstatement', L10n::t('Display Privacy Statement'), Config::get('system', 'tosprivstatement'), L10n::t('Show some informations regarding the needed information to operate the node according e.g. to < a href = "%s" target = "_blank" > EU-GDPR< / a > .', 'https://en.wikipedia.org/wiki/General_Data_Protection_Regulation')],
'$preview' => L10n::t('Privacy Statement Preview'),
'$privtext' => $tos->privacy_complete,
'$tostext' => ['tostext', L10n::t('The Terms of Service'), Config::get('system', 'tostext'), L10n::t('Enter the Terms of Service for your node here. You can use BBCode. Headers of sections should be [h2] and below.')],
@ -329,6 +329,7 @@ function admin_page_tos(App $a)
'$submit' => L10n::t('Save Settings'),
]);
}
/**
* @brief Process send data from Admin TOS Page
*
@ -338,13 +339,13 @@ function admin_page_tos_post(App $a)
{
BaseModule::checkFormSecurityTokenRedirectOnError('/admin/tos', 'admin_tos');
if (!x($_POST, "page_tos" )) {
if (empty($_POST['page_tos'] )) {
return;
}
$displaytos = ((x($_POST, 'displaytos')) ? True : False );
$displayprivstatement = ((x($_POST, 'displayprivstatement')) ? True : False );
$tostext = ((x($_POST, 'tostext') ) ? strip_tags(trim($_POST['tostext'])) : '');
$displaytos = !empty($_POST['displaytos'] );
$displayprivstatement = !empty($_POST['displayprivstatement'] );
$tostext = (!empty($_POST['tostext'] ) ? strip_tags(trim($_POST['tostext'])) : '');
Config::set('system', 'tosdisplay', $displaytos);
Config::set('system', 'tosprivstatement', $displayprivstatement);
@ -354,6 +355,7 @@ function admin_page_tos_post(App $a)
return; // NOTREACHED
}
/**
* @brief Subpage to modify the server wide block list via the admin panel.
*
@ -407,13 +409,13 @@ function admin_page_blocklist(App $a)
*/
function admin_page_blocklist_post(App $a)
{
if (!x($_POST, "page_blocklist_save") & & (!x($_POST['page_blocklist_edit']) )) {
if (empty($_POST['page_blocklist_save']) & & empty($_POST['page_blocklist_edit'] )) {
return;
}
BaseModule::checkFormSecurityTokenRedirectOnError('/admin/blocklist', 'admin_blocklist');
if (x ($_POST['page_blocklist_save'])) {
if (!empty ($_POST['page_blocklist_save'])) {
// Add new item to blocklist
$blocklist = Config::get('system', 'blocklist');
$blocklist[] = [
@ -429,7 +431,7 @@ function admin_page_blocklist_post(App $a)
// Trimming whitespaces as well as any lingering slashes
$domain = Strings::escapeTags(trim($domain, "\x00..\x1F/"));
$reason = Strings::escapeTags(trim($_POST['reason'][$id]));
if (!x ($_POST['delete'][$id])) {
if (empty ($_POST['delete'][$id])) {
$blocklist[] = [
'domain' => $domain,
'reason' => $reason
@ -451,12 +453,12 @@ function admin_page_blocklist_post(App $a)
*/
function admin_page_contactblock_post(App $a)
{
$contact_url = x($_POST, 'contact_url') ? $_POST['contact_url'] : '' ;
$contacts = x($_POST, 'contacts') ? $_POST['contacts'] : [] ;
$contact_url = defaults($_POST, 'contact_url', '') ;
$contacts = defaults($_POST, 'contacts', []) ;
BaseModule::checkFormSecurityTokenRedirectOnError('/admin/contactblock', 'admin_contactblock');
if (x($_POST, 'page_contactblock_block' )) {
if (!empty($_POST['page_contactblock_block'] )) {
$contact_id = Contact::getIdForURL($contact_url);
if ($contact_id) {
Contact::block($contact_id);
@ -465,7 +467,7 @@ function admin_page_contactblock_post(App $a)
notice(L10n::t("Could not find any contact entry for this URL \x28%s\x29", $contact_url));
}
}
if (x($_POST, 'page_contactblock_unblock' )) {
if (!empty($_POST['page_contactblock_unblock'] )) {
foreach ($contacts as $uid) {
Contact::unblock($uid);
}
@ -559,13 +561,13 @@ function admin_page_deleteitem(App $a)
*/
function admin_page_deleteitem_post(App $a)
{
if (!x ($_POST['page_deleteitem_submit'])) {
if (empty ($_POST['page_deleteitem_submit'])) {
return;
}
BaseModule::checkFormSecurityTokenRedirectOnError('/admin/deleteitem/', 'admin_deleteitem');
if (x ($_POST['page_deleteitem_submit'])) {
if (!empty ($_POST['page_deleteitem_submit'])) {
$guid = trim(Strings::escapeTags($_POST['deleteitemguid']));
// The GUID should not include a "/", so if there is one, we got an URL
// and the last part of it is most likely the GUID.
@ -838,7 +840,7 @@ function admin_page_workerqueue(App $a, $deferred)
$info = L10n::t('This page lists the currently queued worker jobs. These jobs are handled by the worker cronjob you\'ve set up during install.');
}
$entries = DBA::select('workerqueue', ['id', 'parameter', 'created', 'priority'], $condition, ['order'=> ['priority']]);
$entries = DBA::select('workerqueue', ['id', 'parameter', 'created', 'priority'], $condition, ['order' => ['priority']]);
$r = [];
while ($entry = DBA::fetch($entries)) {
@ -938,7 +940,7 @@ function admin_page_summary(App $a)
$users = 0;
foreach ($r as $u) {
$accounts[$u['page-flags']][1] = $u['count'];
$users+= $u['count'];
$users += $u['count'];
}
Logger::log('accounts: ' . print_r($accounts, true), Logger::DATA);
@ -962,10 +964,10 @@ function admin_page_summary(App $a)
$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')],
'mysql' => ['max_allowed_packet' => $max_allowed_packet]];
'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 = Renderer::getMarkupTemplate('admin/summary.tpl');
return Renderer::replaceMacros($t, [
@ -1001,17 +1003,17 @@ function admin_page_site_post(App $a)
return;
}
if (!x($_POST, "page_site" )) {
if (empty($_POST['page_site'] )) {
return;
}
// relocate
if (x($_POST, 'relocate') & & x($_POST, 'relocate_url' ) & & $_POST['relocate_url'] != "") {
if (!empty($_POST['relocate']) & & !empty($_POST['relocate_url'] ) & & $_POST['relocate_url'] != "") {
$new_url = $_POST['relocate_url'];
$new_url = rtrim($new_url, "/");
$parsed = @parse_url($new_url);
if (!is_array($parsed) || !x($parsed, 'host') || !x($parsed, 'scheme' )) {
if (!is_array($parsed) || empty($parsed['host']) || empty($parsed['scheme'] )) {
notice(L10n::t("Can not parse base url. Must have at least < scheme > ://< domain > "));
$a->internalRedirect('admin/site');
}
@ -1046,6 +1048,7 @@ function admin_page_site_post(App $a)
$a->internalRedirect('admin/site');
}
}
// update tables
// update profile links in the format "http://server.tld"
update_table($a, "profile", ['photo', 'thumb'], $old_url, $new_url);
@ -1059,7 +1062,7 @@ function admin_page_site_post(App $a)
update_table($a, "gcontact", ['connect', 'addr'], $old_host, $new_host);
// update config
Config::set('system', 'hostname', parse_url($new_url, PHP_URL_HOST));
Config::set('system', 'hostname', parse_url($new_url, PHP_URL_HOST));
Config::set('system', 'url', $new_url);
$a->setBaseURL($new_url);
@ -1076,98 +1079,97 @@ function admin_page_site_post(App $a)
}
// end relocate
$sitename = ((x($_POST,'sitename')) ? Strings::escapeTags(trim($_POST['sitename'])) : '');
$hostname = ((x($_POST,'hostname')) ? Strings::escapeTags(trim($_POST['hostname'])) : '');
$sender_email = ((x($_POST,'sender_email')) ? Strings::escapeTags(trim($_POST['sender_email'])) : '');
$banner = ((x($_POST,'banner')) ? trim($_POST['banner']) : false);
$shortcut_icon = ((x($_POST,'shortcut_icon')) ? Strings::escapeTags(trim($_POST['shortcut_icon'])) : '');
$touch_icon = ((x($_POST,'touch_icon')) ? Strings::escapeTags(trim($_POST['touch_icon'])) : '');
$info = ((x($_POST,'info')) ? trim($_POST['info']) : false);
$language = ((x($_POST,'language')) ? Strings::escapeTags(trim($_POST['language'])) : '');
$theme = ((x($_POST,'theme')) ? Strings::escapeTags(trim($_POST['theme'])) : '');
$theme_mobile = ((x($_POST,'theme_mobile')) ? Strings::escapeTags(trim($_POST['theme_mobile'])) : '');
$maximagesize = ((x($_POST,'maximagesize')) ? intval(trim($_POST['maximagesize'])) : 0);
$maximagelength = ((x($_POST,'maximagelength')) ? intval(trim($_POST['maximagelength'])) : MAX_IMAGE_LENGTH);
$jpegimagequality = ((x($_POST,'jpegimagequality')) ? intval(trim($_POST['jpegimagequality'])) : JPEG_QUALITY);
$register_policy = ((x($_POST,'register_policy')) ? intval(trim($_POST['register_policy'])) : 0);
$daily_registrations = ((x($_POST,'max_daily_registrations')) ? intval(trim($_POST['max_daily_registrations'])) :0);
$abandon_days = ((x($_POST,'abandon_days')) ? intval(trim($_POST['abandon_days'])) : 0);
$register_text = ((x($_POST,'register_text')) ? strip_tags(trim($_POST['register_text'])) : '');
$allowed_sites = ((x($_POST,'allowed_sites')) ? Strings::escapeTags(trim($_POST['allowed_sites'])) : '');
$allowed_email = ((x($_POST,'allowed_email')) ? Strings::escapeTags(trim($_POST['allowed_email'])) : '');
$forbidden_nicknames = ((x($_POST,'forbidden_nicknames')) ? strtolower(Strings::escapeTags(trim($_POST['forbidden_nicknames']))) : '');
$no_oembed_rich_content = x($_POST,'no_oembed_rich_content');
$allowed_oembed = ((x($_POST,'allowed_oembed')) ? Strings::escapeTags(trim($_POST['allowed_oembed'])) : '');
$block_public = ((x($_POST,'block_public')) ? True : False);
$force_publish = ((x($_POST,'publish_all')) ? True : False);
$global_directory = ((x($_POST,'directory')) ? Strings::escapeTags(trim($_POST['directory'])) : '');
$newuser_private = ((x($_POST,'newuser_private')) ? True : False);
$enotify_no_content = ((x($_POST,'enotify_no_content')) ? True : False);
$private_addons = ((x($_POST,'private_addons')) ? True : False);
$disable_embedded = ((x($_POST,'disable_embedded')) ? True : False);
$allow_users_remote_self = ((x($_POST,'allow_users_remote_self')) ? True : False);
$explicit_content = ((x($_POST,'explicit_content')) ? True : False);
$no_multi_reg = ((x($_POST,'no_multi_reg')) ? True : False);
$no_openid = !((x($_POST,'no_openid')) ? True : False);
$no_regfullname = !((x($_POST,'no_regfullname')) ? True : False);
$community_page_style = ((x($_POST,'community_page_style')) ? intval(trim($_POST['community_page_style'])) : 0);
$max_author_posts_community_page = ((x($_POST,'max_author_posts_community_page')) ? intval(trim($_POST['max_author_posts_community_page'])) : 0);
$verifyssl = ((x($_POST,'verifyssl')) ? True : False);
$proxyuser = ((x($_POST,'proxyuser')) ? Strings::escapeTags(trim($_POST['proxyuser'])) : '');
$proxy = ((x($_POST,'proxy')) ? Strings::escapeTags(trim($_POST['proxy'])) : '');
$timeout = ((x($_POST,'timeout')) ? intval(trim($_POST['timeout'])) : 60);
$maxloadavg = ((x($_POST,'maxloadavg')) ? intval(trim($_POST['maxloadavg'])) : 50);
$maxloadavg_frontend = ((x($_POST,'maxloadavg_frontend')) ? intval(trim($_POST['maxloadavg_frontend'])) : 50);
$min_memory = ((x($_POST,'min_memory')) ? intval(trim($_POST['min_memory'])) : 0);
$optimize_max_tablesize = ((x($_POST,'optimize_max_tablesize')) ? intval(trim($_POST['optimize_max_tablesize'])): 100);
$optimize_fragmentation = ((x($_POST,'optimize_fragmentation')) ? intval(trim($_POST['optimize_fragmentation'])): 30);
$poco_completion = ((x($_POST,'poco_completion')) ? intval(trim($_POST['poco_completion'])) : false);
$poco_requery_days = ((x($_POST,'poco_requery_days')) ? intval(trim($_POST['poco_requery_days'])) : 7);
$poco_discovery = ((x($_POST,'poco_discovery')) ? intval(trim($_POST['poco_discovery'])) : 0);
$poco_discovery_since = ((x($_POST,'poco_discovery_since')) ? intval(trim($_POST['poco_discovery_since'])) : 30);
$poco_local_search = ((x($_POST,'poco_local_search')) ? intval(trim($_POST['poco_local_search'])) : false);
$nodeinfo = ((x($_POST,'nodeinfo')) ? intval(trim($_POST['nodeinfo'])) : false);
$dfrn_only = ((x($_POST,'dfrn_only')) ? True : False);
$ostatus_disabled = !((x($_POST,'ostatus_disabled')) ? True : False);
$ostatus_full_threads = ((x($_POST,'ostatus_full_threads')) ? True : False);
$diaspora_enabled = ((x($_POST,'diaspora_enabled')) ? True : False);
$ssl_policy = ((x($_POST,'ssl_policy')) ? intval($_POST['ssl_policy']) : 0);
$force_ssl = ((x($_POST,'force_ssl')) ? True : False);
$hide_help = ((x($_POST,'hide_help')) ? True : False);
$dbclean = ((x($_POST,'dbclean')) ? True : False);
$dbclean_expire_days = ((x($_POST,'dbclean_expire_days')) ? intval($_POST['dbclean_expire_days']) : 0);
$dbclean_unclaimed = ((x($_POST,'dbclean_unclaimed')) ? intval($_POST['dbclean_unclaimed']) : 0);
$dbclean_expire_conv = ((x($_POST,'dbclean_expire_conv')) ? intval($_POST['dbclean_expire_conv']) : 0);
$suppress_tags = ((x($_POST,'suppress_tags')) ? True : False);
$itemcache = ((x($_POST,'itemcache')) ? Strings::escapeTags(trim($_POST['itemcache'])) : '');
$itemcache_duration = ((x($_POST,'itemcache_duration')) ? intval($_POST['itemcache_duration']) : 0);
$max_comments = ((x($_POST,'max_comments')) ? intval($_POST['max_comments']) : 0);
$temppath = ((x($_POST,'temppath')) ? Strings::escapeTags(trim($_POST['temppath'])) : '');
$basepath = ((x($_POST,'basepath')) ? Strings::escapeTags(trim($_POST['basepath'])) : '');
$singleuser = ((x($_POST,'singleuser')) ? Strings::escapeTags(trim($_POST['singleuser'])) : '');
$proxy_disabled = ((x($_POST,'proxy_disabled')) ? True : False);
$only_tag_search = ((x($_POST,'only_tag_search')) ? True : False);
$rino = ((x($_POST,'rino')) ? intval($_POST['rino']) : 0);
$check_new_version_url = ((x($_POST, 'check_new_version_url')) ? Strings::escapeTags(trim($_POST['check_new_version_url'])) : 'none');
$worker_queues = ((x($_POST,'worker_queues')) ? intval($_POST['worker_queues']) : 10);
$worker_dont_fork = ((x($_POST,'worker_dont_fork')) ? True : False);
$worker_fastlane = ((x($_POST,'worker_fastlane')) ? True : False);
$worker_frontend = ((x($_POST,'worker_frontend')) ? True : False);
$relay_directly = ((x($_POST,'relay_directly')) ? True : False);
$relay_server = ((x($_POST,'relay_server')) ? Strings::escapeTags(trim($_POST['relay_server'])) : '');
$relay_subscribe = ((x($_POST,'relay_subscribe')) ? True : False);
$relay_scope = ((x($_POST,'relay_scope')) ? Strings::escapeTags(trim($_POST['relay_scope'])) : '');
$relay_server_tags = ((x($_POST,'relay_server_tags')) ? Strings::escapeTags(trim($_POST['relay_server_tags'])) : '');
$relay_user_tags = ((x($_POST,'relay_user_tags')) ? True : False);
$active_panel = (defaults($_POST, 'active_panel', '') ? "#" . Strings::escapeTags(trim($_POST['active_panel'])) : '');
$sitename = (!empty($_POST['sitename']) ? Strings::escapeTags(trim($_POST['sitename'])) : '');
$hostname = (!empty($_POST['hostname']) ? Strings::escapeTags(trim($_POST['hostname'])) : '');
$sender_email = (!empty($_POST['sender_email']) ? Strings::escapeTags(trim($_POST['sender_email'])) : '');
$banner = (!empty($_POST['banner']) ? trim($_POST['banner']) : false);
$shortcut_icon = (!empty($_POST['shortcut_icon']) ? Strings::escapeTags(trim($_POST['shortcut_icon'])) : '');
$touch_icon = (!empty($_POST['touch_icon']) ? Strings::escapeTags(trim($_POST['touch_icon'])) : '');
$info = (!empty($_POST['info']) ? trim($_POST['info']) : false);
$language = (!empty($_POST['language']) ? Strings::escapeTags(trim($_POST['language'])) : '');
$theme = (!empty($_POST['theme']) ? Strings::escapeTags(trim($_POST['theme'])) : '');
$theme_mobile = (!empty($_POST['theme_mobile']) ? Strings::escapeTags(trim($_POST['theme_mobile'])) : '');
$maximagesize = (!empty($_POST['maximagesize']) ? intval(trim($_POST['maximagesize'])) : 0);
$maximagelength = (!empty($_POST['maximagelength']) ? intval(trim($_POST['maximagelength'])) : MAX_IMAGE_LENGTH);
$jpegimagequality = (!empty($_POST['jpegimagequality']) ? intval(trim($_POST['jpegimagequality'])) : JPEG_QUALITY);
$register_policy = (!empty($_POST['register_policy']) ? intval(trim($_POST['register_policy'])) : 0);
$daily_registrations = (!empty($_POST['max_daily_registrations']) ? intval(trim($_POST['max_daily_registrations'])) : 0);
$abandon_days = (!empty($_POST['abandon_days']) ? intval(trim($_POST['abandon_days'])) : 0);
$register_text = (!empty($_POST['register_text']) ? strip_tags(trim($_POST['register_text'])) : '');
$allowed_sites = (!empty($_POST['allowed_sites']) ? Strings::escapeTags(trim($_POST['allowed_sites'])) : '');
$allowed_email = (!empty($_POST['allowed_email']) ? Strings::escapeTags(trim($_POST['allowed_email'])) : '');
$forbidden_nicknames = (!empty($_POST['forbidden_nicknames']) ? strtolower(Strings::escapeTags(trim($_POST['forbidden_nicknames']))) : '');
$no_oembed_rich_content = !empty($_POST['no_oembed_rich_content']);
$allowed_oembed = (!empty($_POST['allowed_oembed']) ? Strings::escapeTags(trim($_POST['allowed_oembed'])) : '');
$block_public = !empty($_POST['block_public']);
$force_publish = !empty($_POST['publish_all']);
$global_directory = (!empty($_POST['directory']) ? Strings::escapeTags(trim($_POST['directory'])) : '');
$newuser_private = !empty($_POST['newuser_private']);
$enotify_no_content = !empty($_POST['enotify_no_content']);
$private_addons = !empty($_POST['private_addons']);
$disable_embedded = !empty($_POST['disable_embedded']);
$allow_users_remote_self = !empty($_POST['allow_users_remote_self']);
$explicit_content = !empty($_POST['explicit_content']);
$no_multi_reg = !empty($_POST['no_multi_reg']);
$no_openid = !empty($_POST['no_openid']);
$no_regfullname = !empty($_POST['no_regfullname']);
$community_page_style = (!empty($_POST['community_page_style']) ? intval(trim($_POST['community_page_style'])) : 0);
$max_author_posts_community_page = (!empty($_POST['max_author_posts_community_page']) ? intval(trim($_POST['max_author_posts_community_page'])) : 0);
$verifyssl = !empty($_POST['verifyssl']);
$proxyuser = (!empty($_POST['proxyuser']) ? Strings::escapeTags(trim($_POST['proxyuser'])) : '');
$proxy = (!empty($_POST['proxy']) ? Strings::escapeTags(trim($_POST['proxy'])) : '');
$timeout = (!empty($_POST['timeout']) ? intval(trim($_POST['timeout'])) : 60);
$maxloadavg = (!empty($_POST['maxloadavg']) ? intval(trim($_POST['maxloadavg'])) : 50);
$maxloadavg_frontend = (!empty($_POST['maxloadavg_frontend']) ? intval(trim($_POST['maxloadavg_frontend'])) : 50);
$min_memory = (!empty($_POST['min_memory']) ? intval(trim($_POST['min_memory'])) : 0);
$optimize_max_tablesize = (!empty($_POST['optimize_max_tablesize']) ? intval(trim($_POST['optimize_max_tablesize'])) : 100);
$optimize_fragmentation = (!empty($_POST['optimize_fragmentation']) ? intval(trim($_POST['optimize_fragmentation'])) : 30);
$poco_completion = (!empty($_POST['poco_completion']) ? intval(trim($_POST['poco_completion'])) : false);
$poco_requery_days = (!empty($_POST['poco_requery_days']) ? intval(trim($_POST['poco_requery_days'])) : 7);
$poco_discovery = (!empty($_POST['poco_discovery']) ? intval(trim($_POST['poco_discovery'])) : 0);
$poco_discovery_since = (!empty($_POST['poco_discovery_since']) ? intval(trim($_POST['poco_discovery_since'])) : 30);
$poco_local_search = !empty($_POST['poco_local_search']);
$nodeinfo = !empty($_POST['nodeinfo']);
$dfrn_only = !empty($_POST['dfrn_only']);
$ostatus_disabled = !empty($_POST['ostatus_disabled']);
$ostatus_full_threads = !empty($_POST['ostatus_full_threads']);
$diaspora_enabled = !empty($_POST['diaspora_enabled']);
$ssl_policy = (!empty($_POST['ssl_policy']) ? intval($_POST['ssl_policy']) : 0);
$force_ssl = !empty($_POST['force_ssl']);
$hide_help = !empty($_POST['hide_help']);
$dbclean = !empty($_POST['dbclean']);
$dbclean_expire_days = (!empty($_POST['dbclean_expire_days']) ? intval($_POST['dbclean_expire_days']) : 0);
$dbclean_unclaimed = (!empty($_POST['dbclean_unclaimed']) ? intval($_POST['dbclean_unclaimed']) : 0);
$dbclean_expire_conv = (!empty($_POST['dbclean_expire_conv']) ? intval($_POST['dbclean_expire_conv']) : 0);
$suppress_tags = !empty($_POST['suppress_tags']);
$itemcache = (!empty($_POST['itemcache']) ? Strings::escapeTags(trim($_POST['itemcache'])) : '');
$itemcache_duration = (!empty($_POST['itemcache_duration']) ? intval($_POST['itemcache_duration']) : 0);
$max_comments = (!empty($_POST['max_comments']) ? intval($_POST['max_comments']) : 0);
$temppath = (!empty($_POST['temppath']) ? Strings::escapeTags(trim($_POST['temppath'])) : '');
$basepath = (!empty($_POST['basepath']) ? Strings::escapeTags(trim($_POST['basepath'])) : '');
$singleuser = (!empty($_POST['singleuser']) ? Strings::escapeTags(trim($_POST['singleuser'])) : '');
$proxy_disabled = !empty($_POST['proxy_disabled']);
$only_tag_search = !empty($_POST['only_tag_search']);
$rino = (!empty($_POST['rino']) ? intval($_POST['rino']) : 0);
$check_new_version_url = (!empty($_POST['check_new_version_url']) ? Strings::escapeTags(trim($_POST['check_new_version_url'])) : 'none');
$worker_queues = (!empty($_POST['worker_queues']) ? intval($_POST['worker_queues']) : 10);
$worker_dont_fork = !empty($_POST['worker_dont_fork']);
$worker_fastlane = !empty($_POST['worker_fastlane']);
$worker_frontend = !empty($_POST['worker_frontend']);
$relay_directly = !empty($_POST['relay_directly']);
$relay_server = (!empty($_POST['relay_server']) ? Strings::escapeTags(trim($_POST['relay_server'])) : '');
$relay_subscribe = !empty($_POST['relay_subscribe']);
$relay_scope = (!empty($_POST['relay_scope']) ? Strings::escapeTags(trim($_POST['relay_scope'])) : '');
$relay_server_tags = (!empty($_POST['relay_server_tags']) ? Strings::escapeTags(trim($_POST['relay_server_tags'])) : '');
$relay_user_tags = !empty($_POST['relay_user_tags']);
$active_panel = (!empty($_POST['active_panel']) ? "#" . Strings::escapeTags(trim($_POST['active_panel'])) : '');
// Has the directory url changed? If yes, then resubmit the existing profiles there
if ($global_directory != Config::get('system', 'directory') & & ($global_directory != '')) {
@ -1217,24 +1219,24 @@ function admin_page_site_post(App $a)
);
}
}
Config::set('system', 'ssl_policy', $ssl_policy);
Config::set('system', 'maxloadavg', $maxloadavg);
Config::set('system', 'maxloadavg_frontend', $maxloadavg_frontend);
Config::set('system', 'min_memory', $min_memory);
Config::set('system', 'ssl_policy' , $ssl_policy);
Config::set('system', 'maxloadavg' , $maxloadavg);
Config::set('system', 'maxloadavg_frontend' , $maxloadavg_frontend);
Config::set('system', 'min_memory' , $min_memory);
Config::set('system', 'optimize_max_tablesize', $optimize_max_tablesize);
Config::set('system', 'optimize_fragmentation', $optimize_fragmentation);
Config::set('system', 'poco_completion', $poco_completion);
Config::set('system', 'poco_requery_days', $poco_requery_days);
Config::set('system', 'poco_discovery', $poco_discovery);
Config::set('system', 'poco_discovery_since', $poco_discovery_since);
Config::set('system', 'poco_local_search', $poco_local_search);
Config::set('system', 'nodeinfo', $nodeinfo);
Config::set('config', 'sitename', $sitename);
Config::set('config', 'hostname', $hostname);
Config::set('config', 'sender_email', $sender_email);
Config::set('system', 'suppress_tags', $suppress_tags);
Config::set('system', 'shortcut_icon', $shortcut_icon);
Config::set('system', 'touch_icon', $touch_icon);
Config::set('system', 'poco_completion' , $poco_completion);
Config::set('system', 'poco_requery_days' , $poco_requery_days);
Config::set('system', 'poco_discovery' , $poco_discovery);
Config::set('system', 'poco_discovery_since' , $poco_discovery_since);
Config::set('system', 'poco_local_search' , $poco_local_search);
Config::set('system', 'nodeinfo' , $nodeinfo);
Config::set('config', 'sitename' , $sitename);
Config::set('config', 'hostname' , $hostname);
Config::set('config', 'sender_email' , $sender_email);
Config::set('system', 'suppress_tags' , $suppress_tags);
Config::set('system', 'shortcut_icon' , $shortcut_icon);
Config::set('system', 'touch_icon' , $touch_icon);
if ($banner == "") {
Config::delete('system', 'banner');
@ -1261,49 +1263,49 @@ function admin_page_site_post(App $a)
} else {
Config::set('system', 'singleuser', $singleuser);
}
Config::set('system', 'maximagesize', $maximagesize);
Config::set('system', 'max_image_length', $maximagelength);
Config::set('system', 'jpeg_quality', $jpegimagequality);
Config::set('system', 'maximagesize' , $maximagesize);
Config::set('system', 'max_image_length' , $maximagelength);
Config::set('system', 'jpeg_quality' , $jpegimagequality);
Config::set('config', 'register_policy', $register_policy);
Config::set('config', 'register_policy' , $register_policy);
Config::set('system', 'max_daily_registrations', $daily_registrations);
Config::set('system', 'account_abandon_days', $abandon_days);
Config::set('config', 'register_text', $register_text);
Config::set('system', 'allowed_sites', $allowed_sites);
Config::set('system', 'allowed_email', $allowed_email);
Config::set('system', 'forbidden_nicknames', $forbidden_nicknames);
Config::set('system', 'no_oembed_rich_content', $no_oembed_rich_content);
Config::set('system', 'allowed_oembed', $allowed_oembed);
Config::set('system', 'block_public', $block_public);
Config::set('system', 'publish_all', $force_publish);
Config::set('system', 'newuser_private', $newuser_private);
Config::set('system', 'enotify_no_content', $enotify_no_content);
Config::set('system', 'disable_embedded', $disable_embedded);
Config::set('system', 'account_abandon_days' , $abandon_days);
Config::set('config', 'register_text' , $register_text);
Config::set('system', 'allowed_sites' , $allowed_sites);
Config::set('system', 'allowed_email' , $allowed_email);
Config::set('system', 'forbidden_nicknames' , $forbidden_nicknames);
Config::set('system', 'no_oembed_rich_content' , $no_oembed_rich_content);
Config::set('system', 'allowed_oembed' , $allowed_oembed);
Config::set('system', 'block_public' , $block_public);
Config::set('system', 'publish_all' , $force_publish);
Config::set('system', 'newuser_private' , $newuser_private);
Config::set('system', 'enotify_no_content' , $enotify_no_content);
Config::set('system', 'disable_embedded' , $disable_embedded);
Config::set('system', 'allow_users_remote_self', $allow_users_remote_self);
Config::set('system', 'explicit_content', $explicit_content);
Config::set('system', 'check_new_version_url', $check_new_version_url);
Config::set('system', 'explicit_content' , $explicit_content);
Config::set('system', 'check_new_version_url' , $check_new_version_url);
Config::set('system', 'block_extended_register', $no_multi_reg);
Config::set('system', 'no_openid', $no_openid);
Config::set('system', 'no_regfullname', $no_regfullname);
Config::set('system', 'community_page_style', $community_page_style);
Config::set('system', 'no_openid' , $no_openid);
Config::set('system', 'no_regfullname' , $no_regfullname);
Config::set('system', 'community_page_style' , $community_page_style);
Config::set('system', 'max_author_posts_community_page', $max_author_posts_community_page);
Config::set('system', 'verifyssl', $verifyssl);
Config::set('system', 'proxyuser', $proxyuser);
Config::set('system', 'proxy', $proxy);
Config::set('system', 'curl_timeout', $timeout);
Config::set('system', 'dfrn_only', $dfrn_only);
Config::set('system', 'ostatus_disabled', $ostatus_disabled);
Config::set('system', 'ostatus_full_threads', $ostatus_full_threads);
Config::set('system', 'diaspora_enabled', $diaspora_enabled);
Config::set('config', 'private_addons', $private_addons);
Config::set('system', 'force_ssl', $force_ssl);
Config::set('system', 'hide_help', $hide_help);
Config::set('system', 'dbclean', $dbclean);
Config::set('system', 'dbclean-expire-days', $dbclean_expire_days);
Config::set('system', 'verifyssl' , $verifyssl);
Config::set('system', 'proxyuser' , $proxyuser);
Config::set('system', 'proxy' , $proxy);
Config::set('system', 'curl_timeout' , $timeout);
Config::set('system', 'dfrn_only' , $dfrn_only);
Config::set('system', 'ostatus_disabled' , $ostatus_disabled);
Config::set('system', 'ostatus_full_threads' , $ostatus_full_threads);
Config::set('system', 'diaspora_enabled' , $diaspora_enabled);
Config::set('config', 'private_addons' , $private_addons);
Config::set('system', 'force_ssl' , $force_ssl);
Config::set('system', 'hide_help' , $hide_help);
Config::set('system', 'dbclean' , $dbclean);
Config::set('system', 'dbclean-expire-days' , $dbclean_expire_days);
Config::set('system', 'dbclean_expire_conversation', $dbclean_expire_conv);
if ($dbclean_unclaimed == 0) {