class MailmanSpip (View source)

Class to manage mailman and spip

Properties

DoliDB $db
string $error
string[] $errors
array<string, string> $mladded_ok
array<string, string> $mladded_ko
array<string, string> $mlremoved_ok
array<string, string> $mlremoved_ko

Methods

__construct(DoliDB $db)

Constructor

bool
isSpipEnabled()

Function used to check if SPIP is enabled on the system

bool
checkSpipConfig()

Function used to check if the SPIP config is correct

bool|DoliDB
connectSpip()

Function used to connect to SPIP

add_to_spip(Adherent $object)

Fonction qui donne les droits redacteurs dans spip

del_to_spip(Adherent $object)

Fonction qui enleve les droits redacteurs dans spip

is_in_spip(object $object)

Indicate if the user is an existing editor in spip

add_to_mailman(Adherent|stdClass $object, $listes = '')

Subscribe an email to all mailing-lists

del_to_mailman(Adherent|stdClass $object, $listes = '')

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

Details

__construct(DoliDB $db)

Constructor

Parameters

DoliDB $db

Database handler

bool isSpipEnabled()

Function used to check if SPIP is enabled on the system

Return Value

bool

bool checkSpipConfig()

Function used to check if the SPIP config is correct

Return Value

bool

bool|DoliDB connectSpip()

Function used to connect to SPIP

Return Value

bool|DoliDB

Boolean of DoliDB

add_to_spip(Adherent $object)

Fonction qui donne les droits redacteurs dans spip

Parameters

Adherent $object

Object with data (->firstname, ->lastname, ->email and ->login) @return int =0 if KO, >0 if OK

del_to_spip(Adherent $object)

Fonction qui enleve les droits redacteurs dans spip

Parameters

Adherent $object

Object with data (->login) @return int =0 if KO, >0 if OK

is_in_spip(object $object)

Indicate if the user is an existing editor in spip

Parameters

object $object

Object with data (->login) @return int 1=exists, 0=does not exists, -1=error

add_to_mailman(Adherent|stdClass $object, $listes = '')

Subscribe an email to all mailing-lists

Parameters

Adherent|stdClass $object

Object with data (->email, ->pass, ->element, ->type) @param string $listes To force mailing-list (string separated with ,) @return int Return integer <0 if KO, >=0 if OK

$listes

del_to_mailman(Adherent|stdClass $object, $listes = '')

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

Parameters

Adherent|stdClass $object

Object with data (->email, ->pass, ->element, ->type) @param string $listes To force mailing-list (string separated with ,) @return int Return integer <0 if KO, >=0 if OK

$listes