Back to the module list

Sympa authentication

Sympa is an open-source mailling list software available at https://www.sympa.org/.

The module allow to delegate the authentication of the user by the Sympa server, in a specific mailling list.

$auth = new Domframework\Authsympa ();
$auth->wsdl = "https://lists.domain.tld/sympa/wsdl";
$auth->list = "listtest@lists.domain.tld";
$auth->connect ();
var_dump ($auth->authentication ("user@domain.tld", "Pa$$word!"));

The class definition

Class Domframework\Authsympa

Namespace Domframework

Description

/**
 User authentication against SYMPA server
 Sympa is a mailling list server. It can handle authentication with
 - a username (a email adress)
 - a password
 - a list to check if the user is recorded in
 - a Sympa SOAP server WSDL
 - the part of list which should be test : subscriber, owner, editor
 It use the SOAP protocol. So the PHP SOAP library is needed and the network
 must be open between the Web server and the Sympa server.
 POC :
 $auth = new Authsympa ();
 $auth->wsdl = "https://lists.domain.tld/sympa/wsdl";
 $auth->list = "listtest@lists.domain.tld";
 $auth->connect ();
 var_dump ($auth->authentication ("user@domain.tld", "Pa$$word!"));

Properties

public $appName;
/**
 The application name
public $function="subscriber";
/**
 Function of the user in the mailling list
 can be subscriber, owner, editor
public $list;
/**
 Mailling list to be checked if user is present
public $wsdl;
/**
 URL of the WSDL Sympa server

Methods

public function __construct ()
/**
 Check if the SOAP module is available in PHP

public function authentication ( $email, $password)
/**
 Try to authenticate the email/password of the user
 @param string $email Email to authenticate
 @param string $password Password to authenticate

public function changepassword ( $oldpassword, $newpassword)
/**
 Method to change the password
 @param string $oldpassword The old password (to check if the user have the
 rights to change the password)
 @param string $newpassword The new password to be recorded

public function connect ()
/**
 Connect to the Sympa server

public function getdetails ()
/**
 Return all the parameters recorded for the authenticate user

public function listusers ()
/**
 List all the users available in the database
 Return firstname, lastname, mail, with mail is an array

public function logout ()
/**
 Method to disconnect the authenticated user

public function overwritepassword ( $email, $newpassword)
/**
 Method to overwrite the password (without oldpassword check)
 Must be reserved to the administrators. For the users, use changepassword
 method
 @param string $email the user identifier to select
 @param string $newpassword The new password to be recorded

public function pageHTML ( $baseURL, $message="", $url="", $alreadyAuth=false)
/**
 Display the authentication page
 The message is displayed to the user in case of error
 The url is the caller url to go back if authentication is correct
 @param string $baseURL The URL base to use for the links
 @param string|null $message Message to display to the user
 @param string|null $url URL to go back after successful authentication
 @param mixed $alreadyAuth If the user is already authenticated, the value
 will be displayed if the user is coming on the page.