<?php
/***************************************************************************
- * Copyright (C) 2003-2009 Polytechnique.org *
+ * Copyright (C) 2003-2011 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
{
switch ($action) {
case 'yes':
- $this->UpdateOnYes();
+ $this->UpdateOnDismiss();
pl_redirect('googleapps');
break;
}
}
- protected function GetDisplayText()
+ public function template()
+ {
+ return 'reminder/gapps.tpl';
+ }
+ public function title()
+ {
+ return "Création d'un compte Google Apps";
+ }
+ public function info()
{
- return "Polytechnique.org te fournit un compte Google Apps qui te permet
- de disposer des applications web de Google (GMail, Google Calendar,
- Google Docs, et bien d'autres) sur ton adresse Polytechnique.org
- habituelle (en savoir plus).";
+ return 'Xorg/GoogleApps';
}
- public static function IsCandidate(User &$user, $candidate)
+ public static function IsCandidate(User $user, $candidate)
{
+ if (!$user->checkPerms(User::PERM_MAIL)) {
+ return false;
+ }
+
require_once 'googleapps.inc.php';
- return GoogleAppsAccount::account_status($user->id());
+ $isSubscribed = GoogleAppsAccount::account_status($user->id());
+ if ($isSubscribed == 'disabled') {
+ $isSubscribed = false;
+ }
+ if ($isSubscribed) {
+ Reminder::MarkCandidateAsAccepted($user->id(), $candidate);
+ }
+ return !$isSubscribed;
}
}