X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fadmin.php;h=1cbe24e71d989bad74988fcfb3059ba939c8c0da;hb=e86b8ef782c784b578740660078c3907a23a9da6;hp=89514397f0da0fea80fe51703b13cf7a41599b8b;hpb=5e60fa8210b502797209de770780d6d7ba81b86c;p=friendica.git diff --git a/mod/admin.php b/mod/admin.php index 89514397f0..1cbe24e71d 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -33,10 +33,6 @@ use Friendica\Util\Network; use Friendica\Util\Strings; use Friendica\Util\Temporal; -require_once 'include/enotify.php'; -require_once 'include/text.php'; -require_once 'include/items.php'; - /** * @brief Process send data from the admin panels subpages * @@ -93,12 +89,10 @@ function admin_post(App $a) $theme = $a->argv[2]; if (is_file("view/theme/$theme/config.php")) { - $orig_theme = Renderer::$theme; - $orig_page = $a->page; - $orig_session_theme = $_SESSION['theme']; + $a->setCurrentTheme($theme); + require_once "view/theme/$theme/theme.php"; require_once "view/theme/$theme/config.php"; - $_SESSION['theme'] = $theme; $init = $theme . '_init'; if (function_exists($init)) { @@ -107,17 +101,13 @@ function admin_post(App $a) if (function_exists('theme_admin_post')) { theme_admin_post($a); } - - $_SESSION['theme'] = $orig_session_theme; - Renderer::$theme = $orig_theme; - $a->page = $orig_page; } info(L10n::t('Theme settings updated.')); if ($a->isAjax()) { return; } - $return_path = 'admin/themes/' . $theme; + $return_path = 'admin/themes/' . $theme . (!empty($_GET['mode']) ? '?mode=' . $_GET['mode'] : ''); break; case 'tos': admin_page_tos_post($a); @@ -1444,9 +1434,7 @@ function admin_page_site(App $a) $banner = 'logoFriendica'; } - $banner = htmlspecialchars($banner); $info = Config::get('config', 'info'); - $info = htmlspecialchars($info); // Automatically create temporary paths get_temppath(); @@ -1764,7 +1752,7 @@ function admin_page_users_post(App $a) Thank you and welcome to %4$s.')); $preamble = sprintf($preamble, $user['username'], Config::get('config', 'sitename')); - $body = sprintf($body, System::baseUrl(), $user['email'], $result['password'], Config::get('config', 'sitename')); + $body = sprintf($body, System::baseUrl(), $user['nickname'], $result['password'], Config::get('config', 'sitename')); notification([ 'type' => SYSTEM_EMAIL, @@ -2318,12 +2306,10 @@ function admin_page_themes(App $a) $admin_form = ''; if (is_file("view/theme/$theme/config.php")) { - $orig_theme = Renderer::$theme; - $orig_page = $a->page; - $orig_session_theme = $_SESSION['theme']; + $a->setCurrentTheme($theme); + require_once "view/theme/$theme/theme.php"; require_once "view/theme/$theme/config.php"; - $_SESSION['theme'] = $theme; $init = $theme . "_init"; if (function_exists($init)) { @@ -2333,10 +2319,6 @@ function admin_page_themes(App $a) if (function_exists('theme_admin')) { $admin_form = theme_admin($a); } - - $_SESSION['theme'] = $orig_session_theme; - Renderer::$theme = $orig_theme; - $a->page = $orig_page; } $screenshot = [Theme::getScreenshot($theme), L10n::t('Screenshot')]; @@ -2351,7 +2333,7 @@ function admin_page_themes(App $a) '$toggle' => L10n::t('Toggle'), '$settings' => L10n::t('Settings'), '$baseurl' => System::baseUrl(true), - '$addon' => $theme, + '$addon' => $theme . (!empty($_GET['mode']) ? '?mode=' . $_GET['mode'] : ''), '$status' => $status, '$action' => $action, '$info' => Theme::getInfo($theme),