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 ++++++++++++++++++++++ .../web/infcloud/auth/plugins/generic_conf.inc | 12 +++++ radicale_web/web/infcloud/auth/plugins/ldap.inc | 37 ++++++++++++++ .../web/infcloud/auth/plugins/ldap_conf.inc | 12 +++++ 4 files changed, 119 insertions(+) create mode 100644 radicale_web/web/infcloud/auth/plugins/generic.inc create mode 100644 radicale_web/web/infcloud/auth/plugins/generic_conf.inc create mode 100644 radicale_web/web/infcloud/auth/plugins/ldap.inc create mode 100644 radicale_web/web/infcloud/auth/plugins/ldap_conf.inc (limited to 'radicale_web/web/infcloud/auth/plugins') 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 diff --git a/radicale_web/web/infcloud/auth/plugins/generic_conf.inc b/radicale_web/web/infcloud/auth/plugins/generic_conf.inc new file mode 100644 index 0000000..01c2b32 --- /dev/null +++ b/radicale_web/web/infcloud/auth/plugins/generic_conf.inc @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/radicale_web/web/infcloud/auth/plugins/ldap.inc b/radicale_web/web/infcloud/auth/plugins/ldap.inc new file mode 100644 index 0000000..f7012e5 --- /dev/null +++ b/radicale_web/web/infcloud/auth/plugins/ldap.inc @@ -0,0 +1,37 @@ + \ No newline at end of file diff --git a/radicale_web/web/infcloud/auth/plugins/ldap_conf.inc b/radicale_web/web/infcloud/auth/plugins/ldap_conf.inc new file mode 100644 index 0000000..c9242c7 --- /dev/null +++ b/radicale_web/web/infcloud/auth/plugins/ldap_conf.inc @@ -0,0 +1,12 @@ + \ No newline at end of file -- cgit