Add all the phpdocs to the domframework

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1246 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2014-03-24 19:44:34 +00:00
parent 1b52b410c3
commit 350aa1dea8
28 changed files with 472 additions and 148 deletions

View File

@@ -1,4 +1,9 @@
<?php
/** DomFramework
@package domframework
@author Dominique Fournier <dominique@fournier38.fr> */
require_once ("auth.php");
/** User authentication against SYMPA server
Sympa is a mailling list server. It can handle authentication with
- a username (a email adress)
@@ -7,31 +12,39 @@
- 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 :
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!"));
*/
require_once ("auth.php");
class authsympa extends auth
{
/** URL of the WSDL Sympa server */
public $wsdl = null;
/** Mailling list to be checked if user is present */
public $list = null;
public $function = "subscriber"; // can be subscriber, owner, editor
/** Function of the user in the mailling list
can be subscriber, owner, editor */
public $function = "subscriber";
/** Soap Client identifier */
private $client = null;
/** Temporary auth key used betwwen commands */
private $authkey = null;
/** Email of the user if the authentication is correct */
private $email = null;
/** Check if the SOAP module is available in PHP */
public function __construct ()
{
if (! class_exists ("SoapClient"))
throw new Exception (_("No SOAP PHP library available"), 500);
}
/** Connect to the Sympa server */
public function connect ()
{
if ($this->wsdl === null)
@@ -39,6 +52,9 @@ class authsympa extends auth
$this->client = new SoapClient($this->wsdl);
}
/** Try to authenticate the email/password of the user
@param string $email Email to authenticate
@param string $password Password to authenticate */
public function authentication ($email, $password)
{
if ($this->client === null)
@@ -58,11 +74,16 @@ class authsympa extends auth
return $rc;
}
/** Return all the parameters recorded for the authenticate user */
public function getdetails ()
{
throw new Exception (_("The details can't be provided by Sympa"), 404);
}
/** 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 changepassword ($oldpassword, $newpassword)
{
throw new Exception (_("The password can't be change for SYMPA users"),