Re: Redirect if admin
2008-11-01 08:01:41 GMT
$admin = (!getAuthorised(2));
?>
if ($admin)
{echo "";
}
else
{
echo get_vocab("rep_for_nweekly");
}
?>
-----Original Message-----
From: Glenn Pillsbury [mailto:gpillsbury <at> PACIFIC.EDU]
Sent: 21 October 2008 20:31
To: Campbell Morrison; General purpose list (support/developers/users)
Subject: Re: [MRBS-general] Redirect if admin
I would second Campbell's last suggestion. Instead of having two separate pages (which would both need to be touched for updates, etc), having a single page with specific elements restricted to admin would solve both the problem you're having with the redirect and make the system easier for you to maintain.Just my $.02.GlennFrom: Campbell Morrison [mailto:mail <at> campbellmorrison.co.uk]
Sent: Tuesday, October 21, 2008 10:04 AM
To: General purpose list (support/developers/users)
Subject: Re: [MRBS-general] Redirect if admin
When you press Save you go to edit_entry_handler.php, and then when that has finished it sends you back to $returl, which is the HTTP_REFERER for edit_entry.So my guess as to what is happening is that when a member goes to edit_entry, he is then redirected to edit_entry_member and so edit_entry becomes the $returl, rather than day.php or whatever.If this is the case I suspect you'll see that the booking has in fact been made, but you've just come back to where you started. Check the value of $returl by looking at the source of the edit_entry_member page: it's a hidden parameter in the form.To get it to work, you'll have to get $returl right. Or else just have a single page with some of the sections of the form enclosed by if ($admin) {...} sections (where $admin is a boolean set at entry when you do your getAuthorised test.Campbell----- Original Message -----From: Simon HunterSent: Tuesday, October 21, 2008 5:13 PMSubject: [MRBS-general] Redirect if adminHi
I have a small problem. I'm trying to create two types of 'edit_entry.php' forms, one for ordinary users (edit_entry_member.php) and one for administrators (edit_entry_.php). The administrator version is the full blown form, with repeat days, etc. The ordinary one is stripped out, ie it lacks a lot of functionality of the admin version (don't want to give the user too many booking options).I used the following code:
if(!getAuthorised(2))
{
header("Location:edit_entry_member.php?&day=$day&month=$month&year=$year");
exit;
}ie I setup a redirect if not admin, then go to 'edit_entry_member.php'
The redirect works fine. The problem is that when the ordinary member (edit_entry_member.php) clicks the 'save' button, nothing happens. Is it a javascript error? Or php error?
Any help much appreciated
Simon
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
mrbs-general mailing list
mrbs-general <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mrbs-general
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________ mrbs-general mailing list mrbs-general <at> lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mrbs-general
RSS Feed