From dc51645d04c30c0ede89cf6ed2bfc2589524caf3 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sat, 31 May 2008 23:26:21 +0200 Subject: [PATCH] Finish pluging group perms. Signed-off-by: Florent Bruneau --- class.xorg.auth.php | 8 ++++++++ widget.post.perms.php | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/class.xorg.auth.php b/class.xorg.auth.php index 03f340a..9181ff4 100644 --- a/class.xorg.auth.php +++ b/class.xorg.auth.php @@ -202,6 +202,14 @@ class xorgAuth extends dcAuth { public function getInfo($n) { $this->buildFromSession(); + if ($n == 'xorg_group_member') { + global $core; + if ($core->blog->settings('xorg_blog_owner') != $_SESSION['xorg-group']) { + return false; + } + $perm = $this->xorg_infos['grpauth']; + return $this->isSuperAdmin() || $perm == 'admin' || $perm == 'membre'; + } return parent::getInfo($n); } diff --git a/widget.post.perms.php b/widget.post.perms.php index 1d6e9ce..249c135 100644 --- a/widget.post.perms.php +++ b/widget.post.perms.php @@ -7,13 +7,18 @@ class xorgPostPermsWidget { 'auth' => array('text' => 'Visible par les X', 'selected' => false)); $pos = 'public'; + global $core; + $type = $core->blog->settings->get('xorg_blog_type'); + if ($type == 'group-admin' || $type == 'group-member') { + $choices['group'] = array('text' => 'Visible par les membres du groupe', + 'selected' => false); + } if (!is_null($post)) { $metas = unserialize($post->field('post_meta')); if (isset($metas['post_xorg_perms'])) { $pos = $metas['post_xorg_perms']; } } else { - global $core; $pos = $core->auth->getOption('post_xorg_perms'); if ($pos && !isset($choices[$pos])) { $pos = 'auth'; -- 2.1.4