From d058a28521a1d2004eda0f64127cbc8a27f02c0e Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sat, 2 Apr 2011 14:24:36 +0200 Subject: [PATCH] Temporarly removes gapps acces to phd and master. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- include/emails.inc.php | 3 ++- modules/googleapps.php | 2 +- templates/emails/redirect.tpl | 2 ++ upgrade/1.1.0/xx_03_types.sql | 10 ++++++++++ 4 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 upgrade/1.1.0/xx_03_types.sql diff --git a/include/emails.inc.php b/include/emails.inc.php index 74eb015..37653fd 100644 --- a/include/emails.inc.php +++ b/include/emails.inc.php @@ -606,7 +606,8 @@ class Email // Google Apps storage is available for users with valid Google Apps account. require_once 'googleapps.inc.php'; - if ($globals->mailstorage->googleapps_domain && + if ($user->checkPerms('gapps') && + $globals->mailstorage->googleapps_domain && GoogleAppsAccount::account_status($user->id()) == 'active') { $storages[] = 'googleapps'; } diff --git a/modules/googleapps.php b/modules/googleapps.php index bbe1c9f..e02c253 100644 --- a/modules/googleapps.php +++ b/modules/googleapps.php @@ -29,7 +29,7 @@ class GoogleAppsModule extends PLModule } return array( - 'googleapps' => $this->make_hook('index', AUTH_MDP, 'mail'), + 'googleapps' => $this->make_hook('index', AUTH_MDP, 'gapps'), 'admin/googleapps' => $this->make_hook('admin', AUTH_MDP, 'admin'), 'admin/googleapps/job' => $this->make_hook('admin_job', AUTH_MDP, 'admin'), 'admin/googleapps/user' => $this->make_hook('admin_user', AUTH_MDP, 'admin'), diff --git a/templates/emails/redirect.tpl b/templates/emails/redirect.tpl index 194235d..fe168b3 100644 --- a/templates/emails/redirect.tpl +++ b/templates/emails/redirect.tpl @@ -257,6 +257,7 @@ {/if} {if #globals.mailstorage.googleapps_active# or hasPerm('admin') or $googleapps} +{if hasPerm('gapps')}

Grâce à un partenariat avec Google, Polytechnique.org te propose également un compte @@ -294,6 +295,7 @@ {/if} +{/if} {if $eleve}

Pour les élèves (non encore diplômés)

diff --git a/upgrade/1.1.0/xx_03_types.sql b/upgrade/1.1.0/xx_03_types.sql new file mode 100644 index 0000000..f5922b5 --- /dev/null +++ b/upgrade/1.1.0/xx_03_types.sql @@ -0,0 +1,10 @@ +ALTER TABLE account_types MODIFY COLUMN perms SET('groups','mail','directory_ax','directory_private','edit_directory','forums','lists','payment','api_user_readonly','gapps') NOT NULL DEFAULT ''; + +UPDATE account_types + SET perms = 'groups,mail,directory_private,forums,lists,payment,gapps' + WHERE type = 'x'; +UPDATE account_types + SET perms = 'groups,mail,directory_private,forums,lists,payment' + WHERE type = 'master' OR type = 'phd'; + +-- vim:set syntax=mysql: -- 2.1.4