From 975e0440f970ecccbb5dbc0a026f6cd43eb80ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Schneider?= Date: Tue, 20 Mar 2012 13:53:46 +0100 Subject: [PATCH] Restructuring Mongoose --- .../{admin/admin.php => back/index.php} | 2 +- .../WWWRoot/{admin => back}/phpinfo.php | 0 CoreVersions/Baikal_0.1/WWWRoot/front/cal.php | 56 ++++++++++++++++++ .../Baikal_0.1/WWWRoot/front/card.php | 55 +++++++++++++++++ .../WWWRoot/{index-fe.php => front/index.php} | 0 CoreVersions/Baikal_0.1/WWWRoot/index.php | 4 +- Specific/db/baikal.sqlite | Bin 14336 -> 14336 bytes html/cal.php | 2 +- html/card.php | 2 +- html/index.php | 2 +- 10 files changed, 116 insertions(+), 7 deletions(-) rename CoreVersions/Baikal_0.1/WWWRoot/{admin/admin.php => back/index.php} (91%) rename CoreVersions/Baikal_0.1/WWWRoot/{admin => back}/phpinfo.php (100%) create mode 100755 CoreVersions/Baikal_0.1/WWWRoot/front/cal.php create mode 100755 CoreVersions/Baikal_0.1/WWWRoot/front/card.php rename CoreVersions/Baikal_0.1/WWWRoot/{index-fe.php => front/index.php} (100%) mode change 100755 => 120000 CoreVersions/Baikal_0.1/WWWRoot/index.php diff --git a/CoreVersions/Baikal_0.1/WWWRoot/admin/admin.php b/CoreVersions/Baikal_0.1/WWWRoot/back/index.php similarity index 91% rename from CoreVersions/Baikal_0.1/WWWRoot/admin/admin.php rename to CoreVersions/Baikal_0.1/WWWRoot/back/index.php index b71c012..1520222 100644 --- a/CoreVersions/Baikal_0.1/WWWRoot/admin/admin.php +++ b/CoreVersions/Baikal_0.1/WWWRoot/back/index.php @@ -28,7 +28,7 @@ ini_set("display_errors", 1); error_reporting(E_ALL); define("BAIKAL_CONTEXT", TRUE); define("BAIKAL_CONTEXT_ADMIN", TRUE); -require_once("../../Bootstrap.php"); +require_once(dirname(dirname(dirname(__FILE__))) . "/Bootstrap.php"); # ../../, symlink-safe require_once(BAIKAL_PATH_WWWROOT . "classes/BaikalAdmin.php"); require_once(BAIKAL_PATH_WWWROOT . "classes/BaikalTools.php"); diff --git a/CoreVersions/Baikal_0.1/WWWRoot/admin/phpinfo.php b/CoreVersions/Baikal_0.1/WWWRoot/back/phpinfo.php similarity index 100% rename from CoreVersions/Baikal_0.1/WWWRoot/admin/phpinfo.php rename to CoreVersions/Baikal_0.1/WWWRoot/back/phpinfo.php diff --git a/CoreVersions/Baikal_0.1/WWWRoot/front/cal.php b/CoreVersions/Baikal_0.1/WWWRoot/front/cal.php new file mode 100755 index 0000000..d2cdabc --- /dev/null +++ b/CoreVersions/Baikal_0.1/WWWRoot/front/cal.php @@ -0,0 +1,56 @@ + +* All rights reserved +* +* http://baikal.codr.fr +* +* This script is part of the Baïkal Server project. The Baïkal +* Server project is free software; you can redistribute it +* and/or modify it under the terms of the GNU General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* The GNU General Public License can be found at +* http://www.gnu.org/copyleft/gpl.html. +* +* This script is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* This copyright notice MUST APPEAR in all copies of the script! +***************************************************************/ + +define("BAIKAL_CONTEXT", TRUE); +require_once("../Core/Bootstrap.php"); + +if(!defined("BAIKAL_CAL_ENABLED") || BAIKAL_CAL_ENABLED !== TRUE) { + throw new ErrorException("Baikal CalDAV is disabled.", 0, 255, __FILE__, __LINE__); +} + +# Backends +$authBackend = new Sabre_DAV_Auth_Backend_PDO($pdo); +$principalBackend = new Sabre_DAVACL_PrincipalBackend_PDO($pdo); +$calendarBackend = new Sabre_CalDAV_Backend_PDO($pdo); + +# Directory structure +$nodes = array( + new Sabre_CalDAV_Principal_Collection($principalBackend), + new Sabre_CalDAV_CalendarRootNode($principalBackend, $calendarBackend), +); + +# Initializing server +$server = new Sabre_DAV_Server($nodes); +$server->setBaseUri(BAIKAL_CAL_BASEURI); + +# Server Plugins +$server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend, BAIKAL_AUTH_REALM)); +$server->addPlugin(new Sabre_DAVACL_Plugin()); +$server->addPlugin(new Sabre_CalDAV_Plugin()); + + +# And off we go! +$server->exec(); \ No newline at end of file diff --git a/CoreVersions/Baikal_0.1/WWWRoot/front/card.php b/CoreVersions/Baikal_0.1/WWWRoot/front/card.php new file mode 100755 index 0000000..1d23026 --- /dev/null +++ b/CoreVersions/Baikal_0.1/WWWRoot/front/card.php @@ -0,0 +1,55 @@ + +* All rights reserved +* +* http://baikal.codr.fr +* +* This script is part of the Baïkal Server project. The Baïkal +* Server project is free software; you can redistribute it +* and/or modify it under the terms of the GNU General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* The GNU General Public License can be found at +* http://www.gnu.org/copyleft/gpl.html. +* +* This script is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* This copyright notice MUST APPEAR in all copies of the script! +***************************************************************/ + +define("BAIKAL_CONTEXT", TRUE); +require_once("../Core/Bootstrap.php"); + +if(!defined("BAIKAL_CARD_ENABLED") || BAIKAL_CARD_ENABLED !== TRUE) { + throw new ErrorException("Baikal CardDAV is disabled.", 0, 255, __FILE__, __LINE__); +} + +# Backends +$authBackend = new Sabre_DAV_Auth_Backend_PDO($pdo); +$principalBackend = new Sabre_DAVACL_PrincipalBackend_PDO($pdo); +$carddavBackend = new Sabre_CardDAV_Backend_PDO($pdo); + +# Setting up the directory tree +$nodes = array( + new Sabre_DAVACL_PrincipalCollection($principalBackend), + new Sabre_CardDAV_AddressBookRoot($principalBackend, $carddavBackend), +); + +# The object tree needs in turn to be passed to the server class +$server = new Sabre_DAV_Server($nodes); +$server->setBaseUri(BAIKAL_CARD_BASEURI); + +# Plugins +$server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend, BAIKAL_AUTH_REALM)); +$server->addPlugin(new Sabre_CardDAV_Plugin()); +$server->addPlugin(new Sabre_DAVACL_Plugin()); + +# And off we go! +$server->exec(); \ No newline at end of file diff --git a/CoreVersions/Baikal_0.1/WWWRoot/index-fe.php b/CoreVersions/Baikal_0.1/WWWRoot/front/index.php similarity index 100% rename from CoreVersions/Baikal_0.1/WWWRoot/index-fe.php rename to CoreVersions/Baikal_0.1/WWWRoot/front/index.php diff --git a/CoreVersions/Baikal_0.1/WWWRoot/index.php b/CoreVersions/Baikal_0.1/WWWRoot/index.php deleted file mode 100755 index e00b5b1..0000000 --- a/CoreVersions/Baikal_0.1/WWWRoot/index.php +++ /dev/null @@ -1,3 +0,0 @@ -Baïkal Admin"; diff --git a/CoreVersions/Baikal_0.1/WWWRoot/index.php b/CoreVersions/Baikal_0.1/WWWRoot/index.php new file mode 120000 index 0000000..5d08100 --- /dev/null +++ b/CoreVersions/Baikal_0.1/WWWRoot/index.php @@ -0,0 +1 @@ +back/index.php \ No newline at end of file diff --git a/Specific/db/baikal.sqlite b/Specific/db/baikal.sqlite index c08b67f2f31533a2e57d079a6f838ae8b3545ed2..620f9723a55ef3eaf5e38a3b45ff4505795f7386 100755 GIT binary patch delta 576 zcma)(KTiTd5XEPmLk&n_q6NX?8VeCT;ecR_i9u*glmrNb&UJ4ICkJ;~@Lz>iwp#EF zY>b5gsfmV8T0Vu=^d2G=8f_qkEhs*az%CFG{Z%QOO)A zs@F{{p;wu1QKP1uaA8)s#*6gSsLNE-1h3VOO|$$xB5g^Uw<%q~u1)D+e3!UD33!Pc z09Jn`F>3ItM#Th^OXiY?S${5@N~GFL(t;B)4fu!+Ot-ER*jPsg6ac1p$^;a!gn4lp zI2U@I`(_-F|A$y`s%3}+l1KcQk87C!TRL(-vy95LlCF*O|3A|b{?oNlpTbmX1j5O8SkexS>V9x~n} EpA8qeo&W#< delta 42 scmZoDXegK<&8Ra`#+gxPW5N>V#Vi~g5G=y8m_-A~*5KI8qVb0v00nIeQvd(} diff --git a/html/cal.php b/html/cal.php index 6e7a2ae..b4498e0 120000 --- a/html/cal.php +++ b/html/cal.php @@ -1 +1 @@ -./baikal/cal.php \ No newline at end of file +./baikal/front/cal.php \ No newline at end of file diff --git a/html/card.php b/html/card.php index 4f6118f..25398fe 120000 --- a/html/card.php +++ b/html/card.php @@ -1 +1 @@ -./baikal/card.php \ No newline at end of file +./baikal/front/card.php \ No newline at end of file diff --git a/html/index.php b/html/index.php index 4caba67..3559cfe 120000 --- a/html/index.php +++ b/html/index.php @@ -1 +1 @@ -./baikal/index-fe.php \ No newline at end of file +./baikal/front/index.php \ No newline at end of file