[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [BP][ENH] When switching users, show the login module even if the...
"luci \(@luciash\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <68933416df06c_2c51b1e946513b@gitlab-sidekiq-low-urgency-cpu-bound-v2-78cc7c49f-nr76t.mail> |
luci pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki
Commits:
0cbead43 by NasserNgandu at 2025-08-06T10:45:59+00:00
[BP][ENH] When switching users, show the login module even if the non-administrator normally does not have this module
---
* [NEW] When switching users, show the login module even if the...
---
* [FIX] Permutation of username field and checbox Keep login box visible.
---
* [FIX] Permutation of username field and checbox Keep login box visible.
See merge request tikiwiki/tiki!7157
* [NEW] When switching users, show the login module even if the non-administrator normally does not have this module
---
* [FIX] Pipeline Fix
* [NEW] added button to keep login box visible.
* [FIX] Pipeline Fix.
* [FIX] Pipeline Fix.
* [FIX] Back to first commit with improvement on checking if user is switched.
* [FIX] Pipeline Fix
* [NEW] When switching users, show the login module even if the non-administrator normally does not have this module
See merge request tikiwiki/tiki!6972
See merge request tikiwiki/tiki!8024
See merge request tikiwiki/tiki!8037
- - - - -
3 changed files:
- lib/modules/modlib.php
- templates/modules/mod-login_box.tpl
- tiki-login.php
Changes:
=====================================
lib/modules/modlib.php
=====================================
@@ -515,6 +515,12 @@ class ModLib extends TikiLib
global $section, $page, $prefs, $user;
$tikilib = TikiLib::lib('tiki');
+ if (TikiLib::lib('login')->isSwitched() && isset($_SESSION["keep_login_box_visible"]) && $_SESSION["keep_login_box_visible"] == 'y') {
+ if ($module["name"] === "login_box" && (! isset($module["mode"]) || isset($module["mode"]) === "module")) {
+ return true;
+ }
+ }
+ // TODO: Check this if it behaves well on other "Admin" pages when UAB is enabled
$topLogin = $module['name'] === 'login_box' && $module['position'] === 'top';
$topQA = $module['name'] === 'quickadmin' && $module['position'] === 'top';
$footer = $module['position'] === 'bottom';
=====================================
templates/modules/mod-login_box.tpl
=====================================
@@ -80,6 +80,15 @@ $('label[for="login-remember-module_{{$module_logo_instance}}"]').on('click', fu
{ticket}
<fieldset>
<legend class="fs-5">{tr}Switch User{/tr}</legend>
+ {if empty($login_module.can_revert)}
+ <div class="col-md-12 col-sm-12">
+ <div class="checkbox">
+ <label class="col-form-label">
+ <input class="form-check-input" type="checkbox" name="keep_login_box_visible"> {tr}Keep login box visible{/tr}
+ </label>
+ </div>
+ </div>
+ {/if}
<div class="mb-3 mx-0">
<label class="col-form-label" for="login-switchuser_{$module_logo_instance}">
{if $prefs.login_is_email eq 'y'}
=====================================
tiki-login.php
=====================================
@@ -102,6 +102,7 @@ if (isset($_REQUEST['su']) && $access->checkCsrf(true)) {
$loginlib->switchUser($_REQUEST['username']);
$access->redirect();
}
+ $_SESSION["keep_login_box_visible"] = isset($_REQUEST["keep_login_box_visible"]) ? 'y' : 'n';
$access->redirect($_SESSION['loginfrom']);
}
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/0cbead439ad4de3a0e246a96553f6df83c6d8e54
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/0cbead439ad4de3a0e246a96553f6df83c6d8e54
You're receiving this email because of your account on gitlab.com.
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs