From 3936401fce62e083873b6d8291c0f7362ea78bd3 Mon Sep 17 00:00:00 2001 From: konrad Date: Sun, 25 Apr 2010 11:26:16 +0000 Subject: [PATCH] correct which entities have flags, translate flags to "canuse" bool flag git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@439 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- wob/customer.wolf | 3 --- wob/event.wolf | 36 +++++++++++++++++++++++++++++------- wob/order.wolf | 7 ++++++- wob/template.wolf | 14 +++++++++++++- www/inc/machine/session.php | 13 ++++++++++--- 5 files changed, 58 insertions(+), 15 deletions(-) diff --git a/wob/customer.wolf b/wob/customer.wolf index 8a305e5..b82fda5 100644 --- a/wob/customer.wolf +++ b/wob/customer.wolf @@ -22,7 +22,6 @@ - @@ -148,7 +147,6 @@ - @@ -162,7 +160,6 @@ - diff --git a/wob/event.wolf b/wob/event.wolf index 11ba054..b3a6c01 100644 --- a/wob/event.wolf +++ b/wob/event.wolf @@ -12,14 +12,16 @@ Name of the room Amount of people fitting into the room, zero means unlimited, this can be overridden per event. A short description of the room to help users. Currently not used extensively. + filter flags: defines who can use this room for new events (ignored once it is attached to an event) + stores seating arrangements - - - - + the room this seating arrangement belongs to + display name of the seating arrangement + XML representation of the seating arrangements + filter flags: defines who can use this arrangement for new events (ignored once it is attached to an event)
@@ -27,7 +29,7 @@ - + filter flags: defines who can use the category to define a new event (ignored once it is attached to an event) @@ -43,6 +45,7 @@ + filter flags: defines who can create events with this artist (ignored once it is attached to an event)
@@ -61,7 +64,7 @@ - + filter: who can sell tickets for this event @@ -72,7 +75,7 @@ - + filter: who can sell tickets in this category for this event
@@ -81,12 +84,18 @@ + + + + + + @@ -115,12 +124,16 @@ + + + + @@ -149,6 +162,7 @@ + calculated property: contains the amount of tickets currently contained in this price, ignored if sent from client calculated property: contains the amount of tickets currently contained in this price that are actually usable or reserved, ignored if sent from client @@ -168,6 +182,9 @@ + + + @@ -191,6 +208,8 @@ + + @@ -219,6 +238,9 @@ + + + diff --git a/wob/order.wolf b/wob/order.wolf index bee6109..7c32d03 100644 --- a/wob/order.wolf +++ b/wob/order.wolf @@ -19,6 +19,7 @@ + filter: who can log payments with this method @@ -133,7 +134,7 @@ usually the EAN code - + filter: who can sell this product @@ -151,12 +152,16 @@ + + + + diff --git a/wob/template.wolf b/wob/template.wolf index 3467d9c..d367a67 100644 --- a/wob/template.wolf +++ b/wob/template.wolf @@ -13,7 +13,7 @@ - + filter: who can use this template
@@ -24,6 +24,7 @@ + @@ -31,6 +32,12 @@ + + + + + + @@ -38,10 +45,15 @@ + + + + + diff --git a/www/inc/machine/session.php b/www/inc/machine/session.php index 41e51a9..4b99538 100644 --- a/www/inc/machine/session.php +++ b/www/inc/machine/session.php @@ -238,21 +238,28 @@ class Session /**checks the given flags item pattern (string or array of strings) and returns true if they match*/ public function checkFlags($iflg) { - //admin shortcut + //admin shortcut: allow everything if($this->hasFlag("_admin"))return true; - if(in_array("_admin",$this-roles))return true; - //actual check + if(in_array("_admin",$this->roles))return true; + //actual check for "mere mortals" if(is_array($iflg))$fp=$iflg; else $fp=explode(" ",$iflg); foreach($fp as $f){ + //discard dummies + $f=trim($f); + if($f=="")continue; + // flag starting with "+": check that user has it if($f[0]=="+"){ if(!$this->hasFlag(substr($f,1)))return false; }else + // flag starting with "-": check that user does not have it if($f[0]=="-"){ if($this->hasFlag(substr($f,1)))return false; } + // flag starting with anything else: errrm. error out else return false; } + //no matches, must be ok then return true; } }; -- 1.7.2.5