Exemplo n.º 1
0
 /**
  *  Function to delete a member from external tools like mailing-list, spip, etc.
  *
  *  @return     int     <0 if KO, >0 if OK
  */
 function del_to_abo()
 {
     global $conf, $langs;
     include_once DOL_DOCUMENT_ROOT . '/mailmanspip/class/mailmanspip.class.php';
     $mailmanspip = new MailmanSpip($this->db);
     $err = 0;
     // mailman
     if (!empty($conf->global->ADHERENT_USE_MAILMAN)) {
         $result = $mailmanspip->del_to_mailman($this);
         if ($result < 0) {
             if (!empty($mailmanspip->error)) {
                 $this->errors[] = $mailmanspip->error;
             }
             $err += 1;
         }
         foreach ($mailmanspip->mlremoved_ko as $tmplist => $tmpemail) {
             $langs->load("errors");
             $this->errors[] = $langs->trans("ErrorFailedToRemoveToMailmanList", $tmpemail, $tmplist);
         }
         foreach ($mailmanspip->mlremoved_ok as $tmplist => $tmpemail) {
             $langs->load("mailmanspip");
             $this->mesgs[] = $langs->trans("SuccessToRemoveToMailmanList", $tmpemail, $tmplist);
         }
     }
     if ($conf->global->ADHERENT_USE_SPIP && !empty($conf->mailmanspip->enabled)) {
         $result = $mailmanspip->del_to_spip($this);
         if ($result < 0) {
             $this->errors[] = $mailmanspip->error;
             $err += 1;
         }
     }
     if ($err) {
         // error
         return -$err;
     } else {
         return 1;
     }
 }
Exemplo n.º 2
0
        $object = new stdClass();
        $object->email = $email;
        $object->pass = $email;
        /*$object->element='member';
          $object->type='Preferred Partners'; */
        if ($action == 'testsubscribe') {
            $result = $mailmanspip->add_to_mailman($object);
            if ($result < 0) {
                $error++;
                setEventMessages($mailmanspip->error, $mailmanspip->errors, 'errors');
            } else {
                setEventMessages($langs->trans("MailmanCreationSuccess"), null);
            }
        }
        if ($action == 'testunsubscribe') {
            $result = $mailmanspip->del_to_mailman($object);
            if ($result < 0) {
                $error++;
                setEventMessages($mailmanspip->error, $mailmanspip->errors, 'errors');
            } else {
                setEventMessages($langs->trans("MailmanDeletionSuccess"), null);
            }
        }
    }
}
/*
 * View
 */
$help_url = '';
llxHeader('', $langs->trans("MailmanSpipSetup"), $help_url);
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
Exemplo n.º 3
0
 /**
  *  Fonction qui supprime l'adherent des abonnements automatiques mailing-list, spip, etc.
  *  TODO Move this into member deletion trigger (trigger of mailmanspip module)
  *
  *  @return     int     <0 if KO, >0 if OK
  */
 function del_to_abo()
 {
     global $conf;
     include_once DOL_DOCUMENT_ROOT . '/mailmanspip/class/mailmanspip.class.php';
     $mailmanspip = new MailmanSpip($db);
     $err = 0;
     // mailman
     if (!empty($conf->global->ADHERENT_USE_MAILMAN)) {
         $result = $mailmanspip->del_to_mailman($this);
         if ($result < 0) {
             $err += 1;
         }
     }
     if ($conf->global->ADHERENT_USE_SPIP && $conf->mailmanspip->enabled) {
         $result = $mailmanspip->del_to_spip($this);
         if ($result < 0) {
             $err += 1;
         }
     }
     if ($err) {
         // error
         return -$err;
     } else {
         return 1;
     }
 }