aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-06-27 22:25:37 -0700
committerredmatrix <git@macgirvin.com>2016-06-27 22:25:37 -0700
commit7d7f43c2056fd50ff26aed5df553bf4936ead196 (patch)
tree8aa181cc6c1c60a803178976be03ddfa1981b7d1 /Zotlabs/Lib
parent30a5fe30617ef19d7cb896783442d43277ce5a8e (diff)
downloadvolse-hubzilla-7d7f43c2056fd50ff26aed5df553bf4936ead196.tar.gz
volse-hubzilla-7d7f43c2056fd50ff26aed5df553bf4936ead196.tar.bz2
volse-hubzilla-7d7f43c2056fd50ff26aed5df553bf4936ead196.zip
still working through some issues with curl magic-auth
fixed profile photo upload
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r--Zotlabs/Lib/SuperCurl.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/Zotlabs/Lib/SuperCurl.php b/Zotlabs/Lib/SuperCurl.php
index 40ca1addb..fd47c399c 100644
--- a/Zotlabs/Lib/SuperCurl.php
+++ b/Zotlabs/Lib/SuperCurl.php
@@ -26,6 +26,7 @@ class SuperCurl {
private $request_method = 'GET';
private $upload = false;
+ private $cookies = false;
private function set_data($s) {
@@ -62,6 +63,11 @@ class SuperCurl {
case 'http_auth':
$this->auth = $v;
break;
+ case 'magicauth':
+ $this->magicauth = $v;
+ \Zotlabs\Daemon\Master::Summon([ 'CurlAuth', $v ]);
+ sleep(2);
+ break;
case 'custom':
$this->request_method = $v;
break;
@@ -90,8 +96,17 @@ class SuperCurl {
function exec() {
$opts = $this->curlopts;
+ $url = $this->url;
if($this->auth)
$opts['http_auth'] = $this->auth;
+ if($this->magicauth) {
+ $opts['cookiejar'] = 'store/[data]/cookie_' . $this->magicauth;
+ $opts['cookiefile'] = 'store/[data]/cookie_' . $this->magicauth;
+ $opts['cookie'] = 'PHPSESSID=' . trim(file_get_contents('store/[data]/cookien_' . $this->magicauth));
+ $c = channelx_by_n($this->magicauth);
+ if($c)
+ $url = zid($this->url,$c['channel_address'] . '@' . \App::get_hostname());
+ }
if($this->custom)
$opts['custom'] = $this->custom;
if($this->headers)