From: Florent Bruneau Date: Tue, 30 Dec 2008 21:54:09 +0000 (+0100) Subject: Add a special abstract method PlUser::password(): we want to be able to X-Git-Tag: core/1.0.1~37 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=35fff9b04585817e74f4709f36b70d959ce3224c;p=platal.git Add a special abstract method PlUser::password(): we want to be able to fetch the password of a user but we don't want to store this password in the session (or whatever). Signed-off-by: Florent Bruneau --- diff --git a/classes/mmlist.php b/classes/mmlist.php index a16b1c6..9dadd09 100644 --- a/classes/mmlist.php +++ b/classes/mmlist.php @@ -21,9 +21,16 @@ class MMList extends XmlrpcClient { - public function __construct($uid, $pass, $fqdn = null) + public function __construct($user, $pass = null, $fqdn = null) { global $globals; + if ($user instanceof PlUser) { + $fqdn = $pass; + $uid = $user->id(); + $pass = $user->password(); + } else { + $uid = $user; + } $dom = is_null($fqdn) ? $globals->mail->domain : $fqdn; $url = "http://$uid:$pass@{$globals->lists->rpchost}:{$globals->lists->rpcport}/$dom"; diff --git a/classes/pluser.php b/classes/pluser.php index 0377bdc..ef9c58f 100644 --- a/classes/pluser.php +++ b/classes/pluser.php @@ -154,6 +154,8 @@ abstract class PlUser return $this->promo; } + abstract public function password(); + // Fallback value is GENDER_MALE. public function isFemale() {