mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-07 20:04:32 +02:00
Bug fix for style.php
Fixes issue I stumbled across when you visit someone's profile while you are NOT logged into that server it *should* show the profile using the server's default Frio scheme setting, but it was pulling the $uid for the profile you are looking at along with their $scheme preference instead. So if the default was set to Frio "Dark" and the person whose profile you're looking at has it set to "Light" you would see that instead of "Dark." But it would work properly on the login page or the info page. It was only messed up on profiles because it was pulling the wrong user ID number. The user ID *should* be 0 (zero) for anyone who is not logged in. So I wrapped the user settings in a check for whether or not the person currently viewing the profile is logged in or not. At least I *think* this is how to check if a user is logged in. It seems to work on my dev server. This is something you'd never notice if the person whose profile you're looking at had the same Frio scheme as the site default, and you'd also never notice it if you were looking at profiles while logged in because then it uses your own scheme preference.
This commit is contained in:
parent
cf56aa3a64
commit
0160a523cd
1 changed files with 19 additions and 15 deletions
|
@ -52,6 +52,7 @@ if (DI::mode()->has(\Friendica\App\Mode::MAINTENANCEDISABLED)) {
|
|||
$login_bg_color = DI::config()->get('frio', 'login_bg_color') ?: $login_bg_color;
|
||||
$modified = DI::config()->get('frio', 'css_modified') ?: $modified;
|
||||
|
||||
if (DI::userSession()->getLocalUserId()) {
|
||||
// Get the UID of the profile owner.
|
||||
$uid = $_REQUEST['puid'] ?? 0;
|
||||
if ($uid) {
|
||||
|
@ -69,6 +70,9 @@ if (DI::mode()->has(\Friendica\App\Mode::MAINTENANCEDISABLED)) {
|
|||
$bg_image_option = DI::pConfig()->get($uid, 'frio', 'bg_image_option') ?: $bg_image_option;
|
||||
$modified = DI::pConfig()->get($uid, 'frio', 'css_modified') ?: $modified;
|
||||
}
|
||||
} else {
|
||||
$uid = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$login_bg_image && !$login_bg_color) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue