From e8e32f7a1194baabd6e158805f40396c667e6c56 Mon Sep 17 00:00:00 2001 From: Unrud Date: Fri, 10 Mar 2017 23:02:35 +0100 Subject: Add InfCloud --- radicale_web/web/infcloud/auth/plugins/generic.inc | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 radicale_web/web/infcloud/auth/plugins/generic.inc (limited to 'radicale_web/web/infcloud/auth/plugins/generic.inc') diff --git a/radicale_web/web/infcloud/auth/plugins/generic.inc b/radicale_web/web/infcloud/auth/plugins/generic.inc new file mode 100644 index 0000000..8e6b14b --- /dev/null +++ b/radicale_web/web/infcloud/auth/plugins/generic.inc @@ -0,0 +1,58 @@ +\n"; + return -2; + } + else + { + $request=""; + + $out="PROPFIND ".$pluginconfig['request']." HTTP/1.1\r\n"; + $out.="Host: $hostname_clean\r\n"; + $out.="Authorization: Basic ".base64_encode($_SERVER['PHP_AUTH_USER'].':'.$_SERVER['PHP_AUTH_PW'])."\r\n"; + $out.="Depth: 0\r\n"; + $out.="Content-Type: text/xml; charset=\"utf-8\"\r\n"; + $out.="Content-Length:". strlen($request)."\r\n\r\n"; + $out.=$request; + fwrite($fp, $out); + + $result=''; + if(!feof($fp)) + $result.=fgets($fp); + fclose($fp); + + if(strpos($result, 'HTTP/1.1 207')===0) + return 1; // auth successful + else + return -1; // auth unsuccessful + } + } + return 0; // empty username or password + } +?> \ No newline at end of file -- cgit