aboutsummaryrefslogtreecommitdiff
path: root/radicale_web/web/infcloud/auth/index.php
diff options
context:
space:
mode:
authorUnrud <unrud@openaliasbox.org>2017-03-10 23:02:35 +0100
committerUnrud <unrud@openaliasbox.org>2017-03-11 00:42:55 +0100
commite8e32f7a1194baabd6e158805f40396c667e6c56 (patch)
tree03d0cc2d188fcc148e726f0a6b24e8821a9e8635 /radicale_web/web/infcloud/auth/index.php
parentInit (diff)
downloadradicaleinfcloud-e8e32f7a1194baabd6e158805f40396c667e6c56.tar.gz
radicaleinfcloud-e8e32f7a1194baabd6e158805f40396c667e6c56.tar.bz2
radicaleinfcloud-e8e32f7a1194baabd6e158805f40396c667e6c56.zip
Add InfCloud
Diffstat (limited to 'radicale_web/web/infcloud/auth/index.php')
-rw-r--r--radicale_web/web/infcloud/auth/index.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/radicale_web/web/infcloud/auth/index.php b/radicale_web/web/infcloud/auth/index.php
new file mode 100644
index 0000000..e92f005
--- /dev/null
+++ b/radicale_web/web/infcloud/auth/index.php
@@ -0,0 +1,33 @@
+<?php
+ require_once('config.inc');
+ require_once('common.inc');
+ require_once('cross_domain.inc');
+ require_once('plugins/'.$config['auth_method'].'.inc'); // configured module - it defines the 'MODULE_authenticate()' function
+
+ if(call_user_func($config['auth_method'].'_authenticate')!==1)
+ {
+ // HTTP authentication (exit if unsuccessfull)
+ if($config['auth_send_authenticate_header'])
+ header('WWW-Authenticate: Basic realm="Inf-IT Auth Module"');
+ header('HTTP/1.0 401 Unauthorized');
+echo <<<HTML
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
+<html>
+ <head>
+ <title>401 Authorization Required</title>
+ </head>
+ <body>
+ <h1>Authorization Required</h1>
+ <p>This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.</p>
+ </body>
+</html>
+HTML;
+ exit(0);
+ }
+ else
+ {
+ header('Content-type: text/xml; charset="utf-8"');
+ header('Cache-Control: max-age=0, must-revalidate, no-cache, no-store, no-transform, private');
+ echo array_to_xml($config['accounts']);
+ }
+?> \ No newline at end of file
bgstack15