From 2c86d36840b04dfceaba65d7972ba8a5283fcd13 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sun, 16 Sep 2007 13:42:20 +0200 Subject: [PATCH] FS#28 - step 1: more flexible member list visibility on Xnet - public: the list is accessible to everyone (after authentication) so, it will be available on Xorg - member: the list is accessible to the members of the group - private: the list access is restricted to the admin of the group Signed-off-by: Florent Bruneau --- include/xnet/page.inc.php | 10 +++++----- include/xnet/session.inc.php | 2 +- modules/xnetgrp.php | 4 ++-- templates/xnetgrp/edit.tpl | 8 ++++++-- upgrade/0.9.15/03_asso.sql | 5 +++++ 5 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 upgrade/0.9.15/03_asso.sql diff --git a/include/xnet/page.inc.php b/include/xnet/page.inc.php index 6190b5f..2c38d17 100644 --- a/include/xnet/page.inc.php +++ b/include/xnet/page.inc.php @@ -88,17 +88,17 @@ class XnetPage extends PlatalPage $sub['signaler un bug'] = array('href' => 'send_bug', 'class' => 'popup_840x600'); $menu["no_title"] = $sub; + $perms = S::v('perms'); if (S::logged() && $globals->asso()) { $sub = array(); $dim = $globals->asso('diminutif'); $sub['présentation'] = "login/$dim/"; - if (may_update() || (is_member() && $globals->asso('pub') == 'public') - || $globals->asso('cat') == 'Promotions') { + if ($perms->hasFlag('groupannu')) { $sub['annuaire du groupe'] = "$dim/annuaire"; $sub['trombinoscope'] = "$dim/trombi"; $sub['carte'] = "$dim/geoloc"; } - if (is_member() || may_update()) { + if ($perms->hasFlag('groupmember')) { if ($globals->asso('forum')) { $sub['forum'] = "$dim/forum"; } @@ -107,14 +107,14 @@ class XnetPage extends PlatalPage } } $sub['événement'] = "$dim/events"; - if (may_update() || is_member()) { + if ($perms->hasFlag('groupmember')) { $sub['télépaiement'] = "$dim/payment"; } $menu[$globals->asso('nom')] = $sub; } - if (S::logged() && may_update()) { + if (is_object($perms) && $perms->hasFlag('groupadmin')) { $sub = array(); $sub['modifier l\'accueil'] = "$dim/edit"; $sub['gérer les annonces'] = "$dim/admin/announces"; diff --git a/include/xnet/session.inc.php b/include/xnet/session.inc.php index 2159954..29a519e 100644 --- a/include/xnet/session.inc.php +++ b/include/xnet/session.inc.php @@ -55,7 +55,7 @@ class XnetSession } if (is_member()) { $perms->addFlag('groupmember'); - if ($globals->asso('pub') == 'public') { + if ($globals->asso('pub') != 'private') { $perms->addFlag('groupannu'); } } diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index 85dcdf0..96fccc2 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -240,7 +240,7 @@ class XnetGrpModule extends PLModule Post::v('descr'), Post::v('site'), Post::v('mail'), Post::v('resp'), Post::v('forum'), Post::v('mail_domain'), - Post::has('ax'), Post::has('pub')?'private':'public', + Post::has('ax'), Post::v('pub'), Post::v('sub_url'), Post::v('inscriptible'), Post::v('unsub_url'),$globals->asso('id')); if (Post::v('mail_domain')) { @@ -257,7 +257,7 @@ class XnetGrpModule extends PLModule Post::v('descr'), Post::v('site'), Post::v('mail'), Post::v('resp'), Post::v('forum'), Post::has('ax'), - Post::has('pub')?'private':'public', + Post::has('pub'), Post::v('sub_url'), Post::v('unsub_url'), $globals->asso('id')); } diff --git a/templates/xnetgrp/edit.tpl b/templates/xnetgrp/edit.tpl index c7d94aa..886cdaf 100644 --- a/templates/xnetgrp/edit.tpl +++ b/templates/xnetgrp/edit.tpl @@ -169,8 +169,12 @@ - - liste des membres privée + Diffusion de la liste des membres : + diff --git a/upgrade/0.9.15/03_asso.sql b/upgrade/0.9.15/03_asso.sql new file mode 100644 index 0000000..88301a4 --- /dev/null +++ b/upgrade/0.9.15/03_asso.sql @@ -0,0 +1,5 @@ +use groupex; +ALTER TABLE asso CHANGE COLUMN pub pub enum('public','private','membre') not null default 'public'; +use x4dat; + +# vim:set syntax=mysql: -- 2.1.4