// 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';
}
{
$a = $addresses->get(Profile::ADDRESS_PRO);
foreach ($a as $address) {
- if ($address->type == Address::LINK_JOB && array_key_exists($address->jobid, $this->jobs)) {
+ if ($address->type == Address::LINK_JOB && array_key_exists($address->id, $this->jobs)) {
$this->jobs[$address->id]->setAddress($address);
}
}
}
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'),
</td>
<td>
{if $mail->broken}<span style="color: #f00">{/if}
- {if $mail->email == 'googleapps'}<a href="admin/googleapps/user/{$user->login()}">{/if}
+ {if $mail->type == 'googleapps'}<a href="admin/googleapps/user/{$user->login()}">{/if}
{$mail->display_email}
- {if $mail->email == 'googleapps'}</a>{/if}
+ {if $mail->type == 'googleapps'}</a>{/if}
{if $mail->broken}<em> (en panne)</em></span>{/if}
</td>
<td>
{/if}
{if #globals.mailstorage.googleapps_active# or hasPerm('admin') or $googleapps}
+{if hasPerm('gapps')}
<br />
<p id="googleapps">
Grâce à un partenariat avec Google, Polytechnique.org te propose également un compte
</tr>
</table>
{/if}
+{/if}
{if $eleve}
<h1>Pour les élèves (non encore diplômés)</h1>
--- /dev/null
+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: