]> git.mxchange.org Git - friendica-addons.git/blobdiff - dav/SabreDAV/examples/basicauth.php
Initial Release of the calendar plugin
[friendica-addons.git] / dav / SabreDAV / examples / basicauth.php
diff --git a/dav/SabreDAV/examples/basicauth.php b/dav/SabreDAV/examples/basicauth.php
new file mode 100644 (file)
index 0000000..75552f3
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+
+// !!!! Make sure the Sabre directory is in the include_path !!!
+// example:
+// set_include_path('lib/' . PATH_SEPARATOR . get_include_path());
+
+// settings
+date_default_timezone_set('Canada/Eastern');
+
+// Files we need
+require_once 'Sabre/autoload.php';
+
+$u = 'admin';
+$p = '1234';
+
+$auth = new Sabre_HTTP_BasicAuth();
+
+$result = $auth->getUserPass();
+
+if (!$result || $result[0]!=$u || $result[1]!=$p) {
+
+    $auth->requireLogin();
+    echo "Authentication required\n";
+    die();
+
+}