diff --git a/authimap.php b/authimap.php index c7b48ee..b0e228a 100644 --- a/authimap.php +++ b/authimap.php @@ -18,6 +18,9 @@ class authimap extends auth /** IMAP SSL CheckCertificate */ public $imapSSLCheckCertificates = true; + /** The details available after authentication */ + private $details = null; + /** Check the availablity of the IMAP support in PHP */ function __construct () { @@ -40,6 +43,7 @@ class authimap extends auth $imap = new imap ($this->imapServer, $this->imapPort, $email, $password, $this->imapSSL, $this->imapSSLCheckCertificates); + $this->details = array ("email"=>$email); // Let the throw Exception be catched by the parent return true; } @@ -47,8 +51,7 @@ class authimap extends auth /** Return all the parameters recorded for the authenticate user */ public function getdetails () { - throw new Exception (dgettext("domframework", - "Can't get details for IMAP users"), 405); + return $this->details; } /** Method to change the password diff --git a/authsympa.php b/authsympa.php index da85ebb..79e3d46 100644 --- a/authsympa.php +++ b/authsympa.php @@ -35,7 +35,7 @@ class authsympa extends auth /** Temporary auth key used betwwen commands */ private $authkey = null; /** Email of the user if the authentication is correct */ - private $email = null; + private $details = null; /** Check if the SOAP module is available in PHP */ public function __construct () @@ -70,19 +70,18 @@ class authsympa extends auth throw new Exception (dgettext("domframework", "Can't connect with provided email/password to sympa"), 401); - $this->email = $email; $rc = $this->client->authenticateAndRun ($email, $this->authkey, 'amI', array ($this->list, $this->function, $email)); if ($rc === null) return FALSE; + $this->details = array ("email"=>$email); return $rc; } /** Return all the parameters recorded for the authenticate user */ public function getdetails () { - throw new Exception (dgettext("domframework", - "The details can't be provided by Sympa"), 404); + return $this->details; } /** Method to change the password