Subversion Repositories Applications.papyrus

Rev

Rev 508 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 508 Rev 515
Line 17... Line 17...
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU General Public                                            |
18
// | You should have received a copy of the GNU General Public                                            |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: inscription_liste.class.php,v 1.3 2005-10-04 10:12:16 alexandre_tb Exp $
22
// CVS : $Id: inscription_liste.class.php,v 1.4 2005-10-07 08:27:33 alexandre_tb Exp $
23
/**
23
/**
24
* Application projet
24
* Application projet
25
*
25
*
26
* La classe inscription_liste
26
* La classe inscription_liste
27
*
27
*
Line 29... Line 29...
29
//Auteur original :
29
//Auteur original :
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
31
//Autres auteurs :
31
//Autres auteurs :
32
*@author        Aucun
32
*@author        Aucun
33
*@copyright     Tela-Botanica 2000-2004
33
*@copyright     Tela-Botanica 2000-2004
34
*@version       $Revision: 1.3 $
34
*@version       $Revision: 1.4 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
Line 37... Line 37...
37
 
37
 
Line 120... Line 120...
120
            }
120
            }
121
        }
121
        }
Line 122... Line 122...
122
        
122
        
123
        // Ajout dans la liste des commandes au serveur
123
        // Ajout dans la liste des commandes au serveur
124
        // On inscrit le créateur de la liste
-
 
125
        // On lance une commande pour ezmlm.sh
-
 
126
        $commande = new commande_serveur (PROJET_CHEMIN_APPLI.'script_cron/ezmlm.sh') ;
-
 
127
        if (PEAR::isError($commande)) {
-
 
128
            echo $commande->getMessage() ;
-
 
129
        }
124
        // On inscrit le créateur de la liste
130
        $commande_ajout_utilisateur = 'sudo -u vpopmail /usr/local/bin/ezmlm/ezmlm-sub '.
125
        $resultat_ajout_utilisateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/ajout_abonne.php?domaine='.
131
                                    '/home/vpopmail/domains/'.$liste->getDomaine().'/'.$liste->getNom().' '.
-
 
132
                                    $utilisateur->getInfo('mail');
-
 
-
 
126
                  $liste->getDomaine().'&liste='.$liste->getNom().'&mail='.$utilisateur->getInfo('mail')) ;
133
        $commande->ajouterCommande($commande_ajout_utilisateur) ;
127
          
Line 134... Line 128...
134
    } // end of member function inscrireUtilisateur
128
    } // end of member function inscrireUtilisateur
135
 
129
 
136
    /**
130
    /**
Line 143... Line 137...
143
     */
137
     */
144
    function desinscrireUtilisateur( &$utilisateur, &$liste )
138
    function desinscrireUtilisateur( &$utilisateur, &$liste )
145
    {
139
    {
146
        $requete = 'delete from projet_inscription_liste where pil_id_utilisateur='.$utilisateur->getInfo('identifiant').' and pil_id_liste='.$liste->getId() ;
140
        $requete = 'delete from projet_inscription_liste where pil_id_utilisateur='.$utilisateur->getInfo('identifiant').' and pil_id_liste='.$liste->getId() ;
147
        $resultat = $this->_db->query ($requete) ;
141
        $resultat = $this->_db->query ($requete) ;
148
        $commande_serveur = new commande_serveur(PROJET_CHEMIN_APPLI.'script_cron/ezmlm.sh') ;
-
 
149
        // On désinscrit l'utilisateur de la liste
-
 
150
        $commande_supressoin_utilisateur = 'sudo -u vpopmail /usr/local/bin/ezmlm/ezmlm-unsub '.
142
        $resultat_suppression_utilisateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/suppression_abonne.php?domaine='.
151
                                    '/home/vpopmail/domains/'.$liste->getDomaine().'/'.$liste->getNom().' '.
143
                  $liste->getDomaine().'&liste='.$liste->getNom().'&mail='.$utilisateur->getInfo('mail')) ;
152
                                    $utilisateur->getInfo('mail');
-
 
153
        $commande_serveur->ajouterCommande ($commande_supressoin_utilisateur) ;
-
 
-
 
144
 
154
    } // end of member function desinscrireUtilisateur
145
    } // end of member function desinscrireUtilisateur
Line 155... Line 146...
155
 
146
 
156
    /**
147
    /**
157
     * 
148
     * 
Line 220... Line 211...
220
     * @return int
211
     * @return int
221
     * @access public
212
     * @access public
222
     */
213
     */
223
    function getStatutInscrit( $id_liste,  &$auth )
214
    function getStatutInscrit( $id_liste,  &$auth )
224
    {
215
    {
225
        /*
-
 
226
        $requete = 'select pil_id_liste, pil_id_statut from projet_inscription_liste where pil_id_utilisateur='.$id_utilisateur.
-
 
227
                    ' and pil_id_liste='.$id_liste;
-
 
228
        $resultat = $this->_db->query ($requete) ;
-
 
229
        if (DB::isError ($resultat)) {
-
 
230
            die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
-
 
231
        }
-
 
232
        
216
       
233
        $ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
-
 
234
        
-
 
235
        return $ligne->pil_id_statut;
-
 
236
        */
-
 
237
        // Récupération de la liste des listes !!
217
        // Récupération de la liste des listes !!
238
        $requete = 'select pl_nom_liste, pl_domaine from projet_liste where pl_id_liste='.$id_liste ;
218
        $requete = 'select pl_nom_liste, pl_domaine from projet_liste where pl_id_liste='.$id_liste ;
239
        $resultat = $this->_db->query ($requete) ;
219
        $resultat = $this->_db->query ($requete) ;
240
        if (DB::isError ($resultat)) {
220
        if (DB::isError ($resultat)) {
241
            die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
221
            die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;