From: Stéphane Jacob Date: Wed, 2 Nov 2011 10:46:57 +0000 (+0100) Subject: Adds flags to distinguish notified animators on xnet. X-Git-Tag: xorg/1.1.4~42 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=efef6e67a2a102111a58dabf73d81c6f1072bb71;p=platal.git Adds flags to distinguish notified animators on xnet. Signed-off-by: Stéphane Jacob --- diff --git a/classes/userfilter/conditions.inc.php b/classes/userfilter/conditions.inc.php index 2604a37..bb9ad83 100644 --- a/classes/userfilter/conditions.inc.php +++ b/classes/userfilter/conditions.inc.php @@ -858,12 +858,19 @@ class UFC_NLSubscribed extends UserFilterCondition */ class UFC_Group extends UserFilterCondition { + const BOTH = 0; + const NOTIFIED = 1; + const UNNOTIFIED = 2; + private $group; private $anim; - public function __construct($group, $anim = false) + private $notified; + + public function __construct($group, $anim = false, $notified = self::BOTH) { $this->group = $group; $this->anim = $anim; + $this->notified = $notified; } public function buildCondition(PlFilter $uf) @@ -877,6 +884,10 @@ class UFC_Group extends UserFilterCondition if ($this->anim) { $where .= ' AND gpm' . $sub . '.perms = \'admin\''; } + if ($this->notified != self::BOTH) { + $where .= ' AND ' . ($this->notified == self::UNNOTIFIED ? 'NOT ' : '') + . "FIND_IN_SET('notify', gpm" . $sub . '.flags)'; + } return $where; } } diff --git a/upgrade/1.1.4/11_groups.sql b/upgrade/1.1.4/11_groups.sql new file mode 100644 index 0000000..6910c8e --- /dev/null +++ b/upgrade/1.1.4/11_groups.sql @@ -0,0 +1,3 @@ +ALTER TABLE group_members ADD COLUMN flags SET('notify') NOT NULL DEFAULT ''; + +-- vim:set syntax=mysql: