cvs: pear /Perm_LiveUser/examples example_medium.php
| From: | Arnaud Limbourg | Date: | Sat, 07 Dec 2002 18:23:58 +0000 |
| Subject: | cvs: pear /Perm_LiveUser/examples example_medium.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-7771@lists.php.net to get a copy of this message | ||
arnaud Sat Dec 7 13:23:58 2002 EDT
Modified files:
/pear/Perm_LiveUser/examples example_medium.php
Log:
* match the api change (does not change much since the constants are integers)
Index: pear/Perm_LiveUser/examples/example_medium.php
diff -u pear/Perm_LiveUser/examples/example_medium.php:1.2
pear/Perm_LiveUser/examples/example_medium.php:1.3
--- pear/Perm_LiveUser/examples/example_medium.php:1.2 Sat Dec 7 13:19:00 2002
+++ pear/Perm_LiveUser/examples/example_medium.php Sat Dec 7 13:23:58 2002
@@ -66,14 +66,15 @@
// Okay, he's in. Now let's display some content dependent of
// his access rights in our application. Let's pretend the current
// AuthArea of our application is the Coffeemaker section...
- if ($level = $LoMa->checkRight(LIVEUSER_AREA_COFFEEMAKER, LIVEUSER_RIGHT_MAKE_COFFEE)) {
+ if ($level = $LoMa->checkRight(LIVEUSER_RIGHT_MAKE_COFFEE, LIVEUSER_AREA_COFFEEMAKER)) {
echo "Congrats, you're in the Coffeemaker section and have ";
echo 'the right to make coffee !';
} else {
echo "Your coffee tastes so bad, I won't allow you to make some";
}
- if ($level = $LoMa->checkRight(LIVEUSER_AREA_COFFEEMAKER, LIVEUSER_RIGHT_DRINK_COFFEE)) {
+ $LoMa->setCurrentArea(LIVEUSER_AREA_COFFEEMAKER);
+ if ($level = $LoMa->checkRight(array(LIVEUSER_RIGHT_DRINK_COFFEE,
LIVEUSER_RIGHT_MAKE_COFFEE))) {
echo 'Yey ! You can even drink some coffee';
} else {
echo 'Well, sorry dude, you cannot drink in here';