Add possibility to declare wiki hooks.
[platal.git] / classes / mmlist.php
index b6fe5b5..50aee1b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2007 Polytechnique.org                              *
+ *  Copyright (C) 2003-2010 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
 
 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";
@@ -32,11 +39,6 @@ class MMList extends XmlrpcClient
             $this->bt = new PlBacktrace('MMList');
         }
     }
-
-    public function __call($method, $args)
-    {
-        return parent::__call($method, $args);
-    }
 }
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: