New file |
0,0 → 1,64 |
<?php |
/** |
* PHP Version 5 |
* |
* @category PHP |
* @package projet_bp |
* @author aurelien <aurelien@tela-botanica.org> |
* @copyright 2010 Tela-Botanica |
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL |
* @version SVN: <svn_id> |
* @link /doc/projet_bp/ |
*/ |
|
class Suppression extends ProjetService { |
|
public function getElement($uid) { |
|
$id_utilisateur = (isset($_GET['id_utilisateur'])) ? $_GET['id_utilisateur'] : false; |
$mail = (isset($_GET['mail'])) ? $_GET['mail'] : false; |
|
if(!$id_utilisateur) { |
return false; |
} |
|
// on selectionne la liste des projets auxquel on est inscrit |
$projets = $this->obtenirProjetsPourParticipant($id_utilisateur); |
|
// si pas de projets, rien à faire |
if(count($projets) <= 0) { |
$this->envoyer("OK"); |
return; |
} |
|
foreach($projets as $projet) { |
|
$id_projet = $projet['p_id']; |
|
$suppression_participant = $this->supprimerParticipantAProjet($id_utilisateur, $id_projet); |
|
if($mail) { |
$id_projet = $projet['p_id']; |
$listes = $this->obtenirListesAssocieesAuProjet($id_projet); |
|
// si pas de liste, rien à faire |
if(count($listes) <= 0) { |
continue; |
} |
|
$nom_liste = $listes[0]['pl_nom_liste']; |
|
// on modifie l'abonnement |
if($this->estAbonneAListe($nom_liste, $mail)) { |
if(!$this->desinscriptionListe($nom_liste, $mail)) { |
$this->envoyer("false"); |
} |
} |
} |
} |
|
$this->envoyer("OK"); |
return; |
} |
} |
?> |