]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Comet/bayeux.class.inc.php
Localisation updates from http://translatewiki.net.
[quix0rs-gnu-social.git] / plugins / Comet / bayeux.class.inc.php
index 602a7b6446cb6b034f0e3d2640df15f72a8b8f4e..39ad8a8fc6aa15c0d6b130df382f444fbeb9c97e 100644 (file)
@@ -26,9 +26,12 @@ class Bayeux
     private $oCurl = '';
     private $nNextId = 0;
 
+    private $sUser = '';
+    private $sPassword = '';
+
     public $sUrl = '';
 
-    function __construct($sUrl)
+    function __construct($sUrl, $sUser='', $sPassword='')
     {
         $this->sUrl = $sUrl;
 
@@ -43,6 +46,10 @@ class Bayeux
         curl_setopt($this->oCurl, CURLOPT_POST, 1);
         curl_setopt($this->oCurl, CURLOPT_RETURNTRANSFER,1);
 
+        if (!is_null($sUser) && mb_strlen($sUser) > 0) {
+            curl_setopt($this->oCurl, CURLOPT_USERPWD,"$sUser:$sPassword");
+        }
+
         $this->handShake();
     }
 
@@ -69,8 +76,6 @@ class Bayeux
 
         $oReturn = json_decode($data);
 
-        common_debug(print_r($oReturn, true));
-
         if (is_array($oReturn)) {
             $oReturn = $oReturn[0];
         }