From 10eef51a0f086ad148928ba965c330599b4765cb Mon Sep 17 00:00:00 2001 From: Unrud Date: Sun, 4 Jun 2017 17:16:11 +0200 Subject: Update package for new web plugin interface --- radicale_infcloud/web/auth/plugins/generic.inc | 58 ++++++++++++++++++++++ .../web/auth/plugins/generic_conf.inc | 12 +++++ radicale_infcloud/web/auth/plugins/ldap.inc | 37 ++++++++++++++ radicale_infcloud/web/auth/plugins/ldap_conf.inc | 12 +++++ 4 files changed, 119 insertions(+) create mode 100644 radicale_infcloud/web/auth/plugins/generic.inc create mode 100644 radicale_infcloud/web/auth/plugins/generic_conf.inc create mode 100644 radicale_infcloud/web/auth/plugins/ldap.inc create mode 100644 radicale_infcloud/web/auth/plugins/ldap_conf.inc (limited to 'radicale_infcloud/web/auth/plugins') diff --git a/radicale_infcloud/web/auth/plugins/generic.inc b/radicale_infcloud/web/auth/plugins/generic.inc new file mode 100644 index 0000000..8e6b14b --- /dev/null +++ b/radicale_infcloud/web/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_infcloud/web/auth/plugins/generic_conf.inc b/radicale_infcloud/web/auth/plugins/generic_conf.inc new file mode 100644 index 0000000..01c2b32 --- /dev/null +++ b/radicale_infcloud/web/auth/plugins/generic_conf.inc @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/radicale_infcloud/web/auth/plugins/ldap.inc b/radicale_infcloud/web/auth/plugins/ldap.inc new file mode 100644 index 0000000..f7012e5 --- /dev/null +++ b/radicale_infcloud/web/auth/plugins/ldap.inc @@ -0,0 +1,37 @@ + \ No newline at end of file diff --git a/radicale_infcloud/web/auth/plugins/ldap_conf.inc b/radicale_infcloud/web/auth/plugins/ldap_conf.inc new file mode 100644 index 0000000..c9242c7 --- /dev/null +++ b/radicale_infcloud/web/auth/plugins/ldap_conf.inc @@ -0,0 +1,12 @@ + \ No newline at end of file -- cgit