From 35fff9b04585817e74f4709f36b70d959ce3224c Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Tue, 30 Dec 2008 22:54:09 +0100 Subject: [PATCH] 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 --- classes/mmlist.php | 9 ++++++++- classes/pluser.php | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) 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() { -- 2.1.4