ID | Project | Category | Submitted / Last Updated |
---|---|---|---|
00831 | UserSpice | Misc | 2020-03-16 21:52:04 / 2020-07-22 20:05:52 |
Reported | George Lewe | Assigned To | Unassigned |
Priority | none | Reported | 5.1.1 |
Status | closed | Resolution Version and Commit | |
Summary | dbnav items only allow logged in and logged out, not both | ||
Description |
x This is not a bug but rather an improvement request. The dbnav script loops through each nav item. It renders the item based on the "User must be logged in" value but does it exclusively. It only shows the item if a user is logged in or not, but not in both cases. A Help menu for example is usually available in both cases. If "User must be logged" is set to "No" then my assumption was that the item is also shown when the user is logged in. But it is not. I suggest to add a third value=2 with title "Both". In _admin_nav_item.php this could look like: <div class="form-group"> <label>Show when login status is...</label> <select class="form-control" name="logged_in"> <option value="0" <?php if ($item->logged_in == 0) echo 'selected="selected"'; ?> >Logged out</option> <option value="1" <?php if ($item->logged_in == 1) echo 'selected="selected"'; ?> >Logged in</option> <option value="2" <?php if ($item->logged_in == 2) echo 'selected="selected"'; ?> >Both</option> </select> </div> In dbnav.php this could be checked as follows: ... if ($user->isLoggedIn()) { if ((hasPerm($authorizedGroups,$user->data()->id) || in_array(0,$authorizedGroups)) && $value['logged_in']>=1) { ... |
xxxxxxxxxx
<p>The menu system needs an overhaul. Right now you have to create 2 items. </p>