Add a special abstract method PlUser::password(): we want to be able to
[platal.git] / classes / mmlist.php
index a16b1c6..9dadd09 100644 (file)
 
 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";