From bacb7b70f67371b3c9af15ef71aebaf195d1b7bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Sun, 13 May 2018 16:46:58 +0200 Subject: [PATCH] Cleanups: - added empty lines - removed old-lost commented out line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- include/api.php | 2 +- mod/admin.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/api.php b/include/api.php index 37ee56a3e3..ae2f06406e 100644 --- a/include/api.php +++ b/include/api.php @@ -4517,6 +4517,7 @@ function api_account_update_profile_image($type) } else { throw new InternalServerErrorException('Unsupported filetype'); } + // change specified profile or all profiles to the new resource-id if ($is_default_profile) { $condition = ["`profile` AND `resource-id` != ? AND `uid` = ?", $data['photo']['id'], api_user()]; @@ -4530,7 +4531,6 @@ function api_account_update_profile_image($type) Contact::updateSelfFromUserID(api_user(), true); // Update global directory in background - //$user = api_get_user(get_app()); $url = System::baseUrl() . '/profile/' . get_app()->user['nickname']; if ($url && strlen(Config::get('system', 'directory'))) { Worker::add(PRIORITY_LOW, "Directory", $url); diff --git a/mod/admin.php b/mod/admin.php index fd7558a8d4..1d6f1395a0 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -1299,15 +1299,18 @@ function admin_page_site(App $a) $user_names = []; $user_names['---'] = L10n::t('Multi user instance'); $users = q("SELECT `username`, `nickname` FROM `user`"); + foreach ($users as $user) { $user_names[$user['nickname']] = $user['username']; } /* Banner */ $banner = Config::get('system', 'banner'); + if ($banner == false) { $banner = 'logoFriendica'; } + $banner = htmlspecialchars($banner); $info = Config::get('config', 'info'); $info = htmlspecialchars($info); @@ -1507,9 +1510,12 @@ function admin_page_dbsync(App $a) if ($a->argc > 2 && intval($a->argv[2])) { require_once 'update.php'; + $func = 'update_' . intval($a->argv[2]); + if (function_exists($func)) { $retval = $func(); + if ($retval === UPDATE_FAILED) { $o .= L10n::t("Executing %s failed with error: %s", $func, $retval); } elseif ($retval === UPDATE_SUCCESS) { @@ -1522,11 +1528,13 @@ function admin_page_dbsync(App $a) $o .= L10n::t('There was no additional update function %s that needed to be called.', $func) . "
"; Config::set('database', $func, 'success'); } + return $o; } $failed = []; $r = q("SELECT `k`, `v` FROM `config` WHERE `cat` = 'database' "); + if (DBM::is_result($r)) { foreach ($r as $rr) { $upd = intval(substr($rr['k'], 7)); @@ -1536,6 +1544,7 @@ function admin_page_dbsync(App $a) $failed[] = $upd; } } + if (!count($failed)) { $o = replace_macros(get_markup_template('structure_check.tpl'), [ '$base' => System::baseUrl(true),