Browse Source
Fix 404 when loading css etc. for admins
For admins, the relative path to css etc. is '', not '../'
pull/764/merge
Christian Boltz
4 weeks ago
No known key found for this signature in database
GPG Key ID: C6A682EA63C82F1C
4 changed files with
17 additions and
3 deletions
-
model/PFASmarty.php
-
public/users/app-passwords.php
-
public/users/totp-exceptions.php
-
public/users/totp.php
|
|
@ -58,6 +58,20 @@ class PFASmarty |
|
|
|
$this->configureTheme('');// default to something.
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* get relative path to css etc. based on permissions (user vs. admin) |
|
|
|
* Note: this function only works after login |
|
|
|
*/ |
|
|
|
public function getRelPath() |
|
|
|
{ |
|
|
|
if (authentication_has_role('user')) { |
|
|
|
return '../'; |
|
|
|
} else { |
|
|
|
return ''; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param string $rel_path - relative path for referenced css etc dependencies - e.g. users/edit.php needs '../' else, it's ''. |
|
|
|
*/ |
|
|
|
|
|
@ -29,7 +29,7 @@ |
|
|
|
require_once('../common.php'); |
|
|
|
|
|
|
|
$smarty = PFASmarty::getInstance(); |
|
|
|
$smarty->configureTheme('../'); |
|
|
|
$smarty->configureTheme($smarty->getRelPath()); |
|
|
|
|
|
|
|
$username = authentication_get_username(); |
|
|
|
$pPassword_text = ""; |
|
|
|
|
|
@ -30,7 +30,7 @@ |
|
|
|
require_once(__DIR__ . '/../common.php'); |
|
|
|
|
|
|
|
$smarty = PFASmarty::getInstance(); |
|
|
|
$smarty->configureTheme('../'); |
|
|
|
$smarty->configureTheme($smarty->getRelPath()); |
|
|
|
|
|
|
|
$username = authentication_get_username(); |
|
|
|
list($local_part, $domain) = explode('@', $username); |
|
|
|
|
|
@ -27,7 +27,7 @@ |
|
|
|
require_once('../common.php'); |
|
|
|
|
|
|
|
$smarty = PFASmarty::getInstance(); |
|
|
|
$smarty->configureTheme('../'); |
|
|
|
$smarty->configureTheme($smarty->getRelPath()); |
|
|
|
|
|
|
|
$username = authentication_get_username(); |
|
|
|
$pPassword_password_current_text = ""; |
|
|
|