Cleanups:

- added empty lines
- removed old-lost commented out line

Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2018-05-13 16:46:58 +02:00
parent 538760d9da
commit bacb7b70f6
No known key found for this signature in database
GPG Key ID: B72F8185C6C7BD78
2 changed files with 10 additions and 1 deletions

View File

@ -4517,6 +4517,7 @@ function api_account_update_profile_image($type)
} else { } else {
throw new InternalServerErrorException('Unsupported filetype'); throw new InternalServerErrorException('Unsupported filetype');
} }
// change specified profile or all profiles to the new resource-id // change specified profile or all profiles to the new resource-id
if ($is_default_profile) { if ($is_default_profile) {
$condition = ["`profile` AND `resource-id` != ? AND `uid` = ?", $data['photo']['id'], api_user()]; $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); Contact::updateSelfFromUserID(api_user(), true);
// Update global directory in background // Update global directory in background
//$user = api_get_user(get_app());
$url = System::baseUrl() . '/profile/' . get_app()->user['nickname']; $url = System::baseUrl() . '/profile/' . get_app()->user['nickname'];
if ($url && strlen(Config::get('system', 'directory'))) { if ($url && strlen(Config::get('system', 'directory'))) {
Worker::add(PRIORITY_LOW, "Directory", $url); Worker::add(PRIORITY_LOW, "Directory", $url);

View File

@ -1299,15 +1299,18 @@ function admin_page_site(App $a)
$user_names = []; $user_names = [];
$user_names['---'] = L10n::t('Multi user instance'); $user_names['---'] = L10n::t('Multi user instance');
$users = q("SELECT `username`, `nickname` FROM `user`"); $users = q("SELECT `username`, `nickname` FROM `user`");
foreach ($users as $user) { foreach ($users as $user) {
$user_names[$user['nickname']] = $user['username']; $user_names[$user['nickname']] = $user['username'];
} }
/* Banner */ /* Banner */
$banner = Config::get('system', 'banner'); $banner = Config::get('system', 'banner');
if ($banner == false) { if ($banner == false) {
$banner = '<a href="https://friendi.ca"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>'; $banner = '<a href="https://friendi.ca"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>';
} }
$banner = htmlspecialchars($banner); $banner = htmlspecialchars($banner);
$info = Config::get('config', 'info'); $info = Config::get('config', 'info');
$info = htmlspecialchars($info); $info = htmlspecialchars($info);
@ -1507,9 +1510,12 @@ function admin_page_dbsync(App $a)
if ($a->argc > 2 && intval($a->argv[2])) { if ($a->argc > 2 && intval($a->argv[2])) {
require_once 'update.php'; require_once 'update.php';
$func = 'update_' . intval($a->argv[2]); $func = 'update_' . intval($a->argv[2]);
if (function_exists($func)) { if (function_exists($func)) {
$retval = $func(); $retval = $func();
if ($retval === UPDATE_FAILED) { if ($retval === UPDATE_FAILED) {
$o .= L10n::t("Executing %s failed with error: %s", $func, $retval); $o .= L10n::t("Executing %s failed with error: %s", $func, $retval);
} elseif ($retval === UPDATE_SUCCESS) { } 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) . "<br />"; $o .= L10n::t('There was no additional update function %s that needed to be called.', $func) . "<br />";
Config::set('database', $func, 'success'); Config::set('database', $func, 'success');
} }
return $o; return $o;
} }
$failed = []; $failed = [];
$r = q("SELECT `k`, `v` FROM `config` WHERE `cat` = 'database' "); $r = q("SELECT `k`, `v` FROM `config` WHERE `cat` = 'database' ");
if (DBM::is_result($r)) { if (DBM::is_result($r)) {
foreach ($r as $rr) { foreach ($r as $rr) {
$upd = intval(substr($rr['k'], 7)); $upd = intval(substr($rr['k'], 7));
@ -1536,6 +1544,7 @@ function admin_page_dbsync(App $a)
$failed[] = $upd; $failed[] = $upd;
} }
} }
if (!count($failed)) { if (!count($failed)) {
$o = replace_macros(get_markup_template('structure_check.tpl'), [ $o = replace_macros(get_markup_template('structure_check.tpl'), [
'$base' => System::baseUrl(true), '$base' => System::baseUrl(true),