The following warnings occurred: | ||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
Permissions for pages - Printable Version +- UserSpice (https://userspice.com/forums) +-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23) +--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26) +--- Thread: Permissions for pages (/showthread.php?tid=278) |
Permissions for pages - kampfaffe - 09-22-2016 Hello, I have set the permissions for my own pages in the dashboard. The side only shall be shown if one has the right to it (Admin) I hope somebody can say me what I have made wrong. Best regards, kampfaffe Permissions for pages - brian - 09-22-2016 Hi, I'm not sure I understand what the issue is. What is not working as expected? Permissions for pages - mudmin - 09-22-2016 Ahh. I see what you're saying. You only want a particular element of the page to be shown if you are an admin. That is very similar to the way we do the menus. Whatever you want to "hide" for non admin users, wrap the entire thing in this statement... Code: <?php if (checkMenu(2,$user->data()->id)){ Code: } ?> Permissions for pages - kampfaffe - 09-23-2016 Hello, thank you for response. That sounds good, but it don`t work for me. At the moment, this is my script for the menu of the homepage: <pre> <pre> Code: <nav> </pre> Now, i wan't to hide the following: <pre> <pre> Code: <li class="purple"><a href="#">Erstellen</a> So I did this: <pre> Code: <?php if (checkMenu(2,$user->data()->id)){ </pre> But now, there is the following Error in the Apache log: PHP Parse error: syntax error, unexpected '<' in /var/www/html/secret/sani/termine.php on line 35. Thank you for your help! Permissions for pages - mudmin - 09-23-2016 Can you paste these chunks of code over at pastebin.com or hastebin.com and share the links back here so I can read them a little bit better. We're working on a fix for the code in our forums, but right now, I can't read that very well. Permissions for pages - kampfaffe - 09-23-2016 Hello, here with Hastebin: At the moment, this is my script for the menu of the homepage: http://hastebin.com/qikiwehoba.html Now, I wan’t to hide the following: http://hastebin.com/emenokuxog.html So I did this: http://hastebin.com/ufucoxojeb.html But now, there is the following Error in the Apache log: PHP Parse error: syntax error, unexpected '<' in /var/www/html/secret/sani/menu/index.html on line 19 Permissions for pages - mudmin - 09-24-2016 When you make that change, you are essentially going from html here: </li> to php and then back to html and then back to php and back to html. Each time you need to make sure you close php and reopen it. So, instead of ... Code: <?php if (checkMenu(2,$user->data()->id)){ Code: <li class="purple"><a href="/sani/admin/erstellen.php">Erstellen</a> Code: </li> Code: } ?> It should be Code: <?php if (checkMenu(2,$user->data()->id)){ ?> Code: <li class="purple"><a href="/sani/admin/erstellen.php">Erstellen</a> Code: </li> Code: <?php } ?> Code: </ul> I hope that helps. |