Re: [MRBS-general] Mod to hide admin type dropdown on add entryscreen
Brought to you by:
jberanek
From: Campbell M. <ma...@ca...> - 2009-09-23 15:22:15
|
Sorry - should be for ($c = "A"; $c <= "Z"; $c++) { if (!empty($typel[$c]) && ($is_admin || ($typel[$c] != "A"))) { echo " <option value=\"$c\"" . ($type == $c ? " selected=\"selected\"" : "") . ">$typel[$c]</option>\n"; } } (ie an extra closing parenthesis at the end of the third line) Campbell -----Original Message----- From: Phil Dunford [mailto:pdu...@bt...] Sent: 23 September 2009 16:18 To: ma...@ca...; 'General purpose list (support/developers/users)' Subject: Re: [MRBS-general] Mod to hide admin type dropdown on add entryscreen Wow - thanks for the rapid reply, Unless I'm doing it wrong (always possible) I think there may be a problem with the second block of code, I'm getting: Parse error: parse error, unexpected '{' in C:\Program Files\Apache Group\Apache2\htdocs\staffsecure\mrbsnew\edit_entry.php on line 717 Is it me or a typo? Regards Phil -----Original Message----- From: Campbell Morrison [mailto:ma...@ca...] Sent: 23 September 2009 15:40 To: 'General purpose list (support/developers/users)' Subject: Re: [MRBS-general] Mod to hide admin type dropdown on add entryscreen In edit_entry.php make the following two changes: (1) Around about line 50, replace if (!getAuthorised(1)) { showAccessDenied($day, $month, $year, $area, isset($room) ? $room : ""); exit; } with: if (!getAuthorised(1)) { showAccessDenied($day, $month, $year, $area, isset($room) ? $room : ""); exit; } // Need to know user name and if they are an admin $user = getUserName(); $is_admin = (isset($user) && authGetUserLevel($user)>=2) ; (2) Around about line 710, replace for ($c = "A"; $c <= "Z"; $c++) { if (!empty($typel[$c])) { echo " <option value=\"$c\"" . ($type == $c ? " selected=\"selected\"" : "") . ">$typel[$c]</option>\n"; } } with: for ($c = "A"; $c <= "Z"; $c++) { if (!empty($typel[$c]) && ($is_admin || ($typel[$c] != "A")) { echo " <option value=\"$c\"" . ($type == $c ? " selected=\"selected\"" : "") . ">$typel[$c]</option>\n"; } } I haven't tested this, but it should do the trick unless I've done something silly. Campbell -----Original Message----- From: Phil Dunford [mailto:pdu...@bt...] Sent: 23 September 2009 14:47 To: 'General purpose list (support/developers/users)' Subject: [MRBS-general] Mod to hide admin type dropdown on add entry screen I have just upgraded to the latest version. I have an administrator (A) type defined so that I can enter blocks which cannot be changed by anyone else and come up in pink. A long time ago, someone was kind enough to give me a mod for the old version so that if a non-administrator is logged in, they do not see the administrator option on the type drop down of the add entry screen. As it is they cannot delete my entries, but they can create pink entries. I recall it was only a line or so of code, but I can't for the life of me find it. Any help much appreciated. Phil ---------------------------------------------------------------------------- -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ mrbs-general mailing list mrb...@li... https://lists.sourceforge.net/lists/listinfo/mrbs-general Want to unsubscribe: mailto:mrb...@li...?subject=unsubscribe ---------------------------------------------------------------------------- -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ mrbs-general mailing list mrb...@li... https://lists.sourceforge.net/lists/listinfo/mrbs-general Want to unsubscribe: mailto:mrb...@li...?subject=unsubscribe ---------------------------------------------------------------------------- -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ mrbs-general mailing list mrb...@li... https://lists.sourceforge.net/lists/listinfo/mrbs-general Want to unsubscribe: mailto:mrb...@li...?subject=unsubscribe |