dolibarr  20.0.0-beta
Public Member Functions | Private Member Functions | List of all members
MailmanSpip Class Reference

Class to manage mailman and spip. More...

Public Member Functions

 __construct ($db)
 Constructor. More...
 
 isSpipEnabled ()
 Function used to check if SPIP is enabled on the system. More...
 
 checkSpipConfig ()
 Function used to check if the SPIP config is correct. More...
 
 connectSpip ()
 Function used to connect to SPIP. More...
 
 add_to_spip ($object)
 Fonction qui donne les droits redacteurs dans spip. More...
 
 del_to_spip ($object)
 Fonction qui enleve les droits redacteurs dans spip. More...
 
 is_in_spip ($object)
 Indicate if the user is an existing editor in spip. More...
 
 add_to_mailman ($object, $listes='')
 Subscribe an email to all mailing-lists. More...
 
 del_to_mailman ($object, $listes='')
 Unsubscribe an email from all mailing-lists Used when a user is resiliated. More...
 

Private Member Functions

 callMailman ($object, $url, $list)
 Function used to connect to Mailman. More...
 

Detailed Description

Class to manage mailman and spip.

Definition at line 40 of file mailmanspip.class.php.

Constructor & Destructor Documentation

◆ __construct()

MailmanSpip::__construct (   $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 83 of file mailmanspip.class.php.

Member Function Documentation

◆ add_to_mailman()

MailmanSpip::add_to_mailman (   $object,
  $listes = '' 
)

Subscribe an email to all mailing-lists.

Parameters
Adherent$objectObject with data (->email, ->pass, ->element, ->type)
string$listesTo force mailing-list (string separated with ,)
Returns
int Return integer <0 if KO, >=0 if OK

Definition at line 311 of file mailmanspip.class.php.

◆ add_to_spip()

MailmanSpip::add_to_spip (   $object)

Fonction qui donne les droits redacteurs dans spip.

Parameters
Adherent$objectObject with data (->firstname, ->lastname, ->email and ->login)
Returns
int =0 if KO, >0 if OK

Definition at line 176 of file mailmanspip.class.php.

References checkSpipConfig(), connectSpip(), dol_syslog(), and isSpipEnabled().

◆ callMailman()

MailmanSpip::callMailman (   $object,
  $url,
  $list 
)
private

Function used to connect to Mailman.

Parameters
Adherent$objectObject with the data
string$urlMailman URL to be called with patterns
string$listName of mailing-list
Returns
mixed Boolean or string

Definition at line 142 of file mailmanspip.class.php.

◆ checkSpipConfig()

MailmanSpip::checkSpipConfig ( )

Function used to check if the SPIP config is correct.

Returns
boolean

Definition at line 107 of file mailmanspip.class.php.

References getDolGlobalString().

Referenced by add_to_spip(), del_to_spip(), and is_in_spip().

◆ connectSpip()

MailmanSpip::connectSpip ( )

Function used to connect to SPIP.

Returns
boolean|DoliDB Boolean of DoliDB

Definition at line 121 of file mailmanspip.class.php.

References dol_syslog(), getDolGlobalInt(), getDolGlobalString(), and getDoliDBInstance().

Referenced by add_to_spip(), del_to_spip(), and is_in_spip().

◆ del_to_mailman()

MailmanSpip::del_to_mailman (   $object,
  $listes = '' 
)

Unsubscribe an email from all mailing-lists Used when a user is resiliated.

Parameters
Adherent$objectObject with data (->email, ->pass, ->element, ->type)
string$listesTo force mailing-list (string separated with ,)
Returns
int Return integer <0 if KO, >=0 if OK

Definition at line 381 of file mailmanspip.class.php.

◆ del_to_spip()

MailmanSpip::del_to_spip (   $object)

Fonction qui enleve les droits redacteurs dans spip.

Parameters
Adherent$objectObject with data (->login)
Returns
int =0 if KO, >0 if OK

Definition at line 223 of file mailmanspip.class.php.

References $object, checkSpipConfig(), connectSpip(), dol_syslog(), and isSpipEnabled().

◆ is_in_spip()

MailmanSpip::is_in_spip (   $object)

Indicate if the user is an existing editor in spip.

Parameters
object$objectObject with data (->login)
Returns
int 1=exists, 0=does not exists, -1=error

Definition at line 264 of file mailmanspip.class.php.

References $object, checkSpipConfig(), connectSpip(), and isSpipEnabled().

◆ isSpipEnabled()

MailmanSpip::isSpipEnabled ( )

Function used to check if SPIP is enabled on the system.

Returns
boolean

Definition at line 93 of file mailmanspip.class.php.

References getDolGlobalInt().

Referenced by add_to_spip(), del_to_spip(), and is_in_spip().


The documentation for this class was generated from the following file: