File tree Expand file tree Collapse file tree 2 files changed +23
-19
lines changed
Expand file tree Collapse file tree 2 files changed +23
-19
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,8 @@ public function shutdown(EventInterface $event): void {
100100 }
101101 $ access [$ role ] = $ this ->_checkUser ($ tmpUser , $ params );
102102 }
103+
104+ $ data ['config ' ] = $ authUserComponent ->getConfig ();
103105 $ data ['access ' ] = $ access ;
104106
105107 $ this ->_data = $ data ;
Original file line number Diff line number Diff line change 88 * @var array $availableRoles
99 * @var bool[] $access
1010 * @var string $path;
11+ * @var array<string, mixed> $config
1112 */
1213
1314use Cake \Error \Debugger ;
2728?>
2829
2930<section class="section-tile">
30- <h1>TinyAuth</h1>
31+ <h1>TinyAuth</h1>
3132
3233 <h2>Current URL</h2>
3334 <?php
5960 <?php
6061 if (Config::get ('aclAdapter ' )) {
6162 if (!empty ($ user )) {
63+ $ primaryKey = $ config ['idColumn ' ];
6264
63- echo '<p>Logged in with ID <b style="font-weight: bold"> ' . h ($ user [' id ' ]) . '</b></p> ' ;
65+ echo '<p>Logged in with ID <b style="font-weight: bold"> ' . h ($ user [$ primaryKey ]) . '</b></p> ' ;
6466
6567 echo 'Roles:<br/> ' ;
6668 Debugger::dump ($ roles );
7779 <br/>
7880
7981 <?php if (!empty ($ access )) { ?>
80- <p>
81- <?php if (!$ isPublic ) { ?>
82- The following roles have access to this action:
83- <?php } else { ?>
84- The following roles would have access to this action once you revoke public access:
85- <?php } ?>
86- </p>
87- <ul>
88- <?php
89- foreach ($ availableRoles as $ role => $ id ) {
90- echo '<li> ' ;
91- echo ($ access [$ role ] ? '<b style="font-weight: bold; color: green">✓</b> ' : '<b style="font-weight: bold; color: red">🚫</b> ' ) . ' ' ;
92- echo h ($ role ) . ' (id ' . $ id . ') ' ;
93- echo '</li> ' ;
94- }
95- ?>
96- </ul>
82+ <p>
83+ <?php if (!$ isPublic ) { ?>
84+ The following roles have access to this action:
85+ <?php } else { ?>
86+ The following roles would have access to this action once you revoke public access:
87+ <?php } ?>
88+ </p>
89+ <ul>
90+ <?php
91+ foreach ($ availableRoles as $ role => $ id ) {
92+ echo '<li> ' ;
93+ echo ($ access [$ role ] ? '<b style="font-weight: bold; color: green">✓</b> ' : '<b style="font-weight: bold; color: red">🚫</b> ' ) . ' ' ;
94+ echo h ($ role ) . ' (id ' . $ id . ') ' ;
95+ echo '</li> ' ;
96+ }
97+ ?>
98+ </ul>
9799 <?php } ?>
98100
99101</section>
You can’t perform that action at this time.
0 commit comments