Commit 4edb8f135634d16a1f41a115a260bcf67a663c3c
1 parent
6fc41471
Merged in from DEV trunk...
KTC-95 "Update License Headers" Updated and added some missing headers. Committed By: Kevin Reviewed By: Conrad git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@6607 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
287 changed files
with
7326 additions
and
5604 deletions
Too many changes.
To preserve performance only 100 of 287 files are displayed.
about.php
| 1 | -<?php | |
| 2 | - | |
| 3 | -/** | |
| 4 | - * $Id: preferences.php 6203 2007-02-08 10:41:00Z kevin_fourie $ | |
| 5 | - * | |
| 6 | - * The contents of this file are subject to the KnowledgeTree Public | |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | - * compliance with the License. You may obtain a copy of the License at | |
| 9 | - * http://www.knowledgetree.com/KPL | |
| 10 | - * | |
| 11 | - * Software distributed under the License is distributed on an "AS IS" | |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 16 | - * | |
| 17 | - * The Original Code is: KnowledgeTree Open Source | |
| 18 | - * | |
| 19 | - * The Initial Developer of the Original Code is The Jam Warehouse Software | |
| 20 | - * (Pty) Ltd, trading as KnowledgeTree. | |
| 21 | - * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright | |
| 22 | - * (C) 2007 The Jam Warehouse Software (Pty) Ltd; | |
| 23 | - * All Rights Reserved. | |
| 24 | - * | |
| 25 | - */ | |
| 26 | - | |
| 27 | -// main library routines and defaults | |
| 28 | -require_once("config/dmsDefaults.php"); | |
| 29 | -require_once(KT_LIB_DIR . "/unitmanagement/Unit.inc"); | |
| 30 | - | |
| 31 | -require_once(KT_LIB_DIR . "/templating/templating.inc.php"); | |
| 32 | -require_once(KT_LIB_DIR . "/dispatcher.inc.php"); | |
| 33 | -require_once(KT_LIB_DIR . "/widgets/forms.inc.php"); | |
| 34 | - | |
| 35 | -class KTAbout extends KTStandardDispatcher { | |
| 36 | - var $sSection = 'aboutkt'; | |
| 37 | - | |
| 38 | - function do_main() { | |
| 39 | - global $default; | |
| 40 | - $this->aBreadcrumbs = array(array('action' => 'aboutkt', 'name' => _kt("About"))); | |
| 41 | - $oUser =& $this->oUser; | |
| 42 | - | |
| 43 | - $oTemplating =& KTTemplating::getSingleton(); | |
| 44 | - $oTemplate = $oTemplating->loadTemplate("ktcore/principals/about"); | |
| 45 | - | |
| 46 | - $aVersionInfo = explode(' ', $default->versionName); | |
| 47 | - foreach($aVersionInfo as $sVersionpiece){ | |
| 48 | - if(substr($sVersionpiece, 1, 1) == '.'){ | |
| 49 | - $sVersionNo = $sVersionpiece; | |
| 50 | - }else{ | |
| 51 | - $sVersionName .= " ".$sVersionpiece; | |
| 52 | - } | |
| 53 | - } | |
| 54 | - | |
| 55 | - $aTemplateData = array( | |
| 56 | - "context" => $this, | |
| 57 | - "versionname" => $sVersionName, | |
| 58 | - "versionnumber" => $sVersionNo, | |
| 59 | - ); | |
| 60 | - return $oTemplate->render($aTemplateData); | |
| 61 | - } | |
| 62 | -} | |
| 63 | - | |
| 64 | -$oDispatcher = new KTAbout(); | |
| 65 | -$oDispatcher->dispatch(); | |
| 66 | - | |
| 67 | -?> | |
| 1 | +<?php | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * $Id: preferences.php 6203 2007-02-08 10:41:00Z kevin_fourie $ | |
| 5 | + * | |
| 6 | + * The contents of this file are subject to the KnowledgeTree Public | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | + * compliance with the License. You may obtain a copy of the License at | |
| 9 | + * http://www.knowledgetree.com/KPL | |
| 10 | + * | |
| 11 | + * Software distributed under the License is distributed on an "AS IS" | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 21 | + * | |
| 22 | + * The Original Code is: KnowledgeTree Open Source | |
| 23 | + * | |
| 24 | + * The Initial Developer of the Original Code is The Jam Warehouse Software | |
| 25 | + * (Pty) Ltd, trading as KnowledgeTree. | |
| 26 | + * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright | |
| 27 | + * (C) 2007 The Jam Warehouse Software (Pty) Ltd; | |
| 28 | + * All Rights Reserved. | |
| 29 | + * Contributor( s): ______________________________________ | |
| 30 | + * | |
| 31 | + */ | |
| 32 | + | |
| 33 | +// main library routines and defaults | |
| 34 | +require_once("config/dmsDefaults.php"); | |
| 35 | +require_once(KT_LIB_DIR . "/unitmanagement/Unit.inc"); | |
| 36 | + | |
| 37 | +require_once(KT_LIB_DIR . "/templating/templating.inc.php"); | |
| 38 | +require_once(KT_LIB_DIR . "/dispatcher.inc.php"); | |
| 39 | +require_once(KT_LIB_DIR . "/widgets/forms.inc.php"); | |
| 40 | + | |
| 41 | +class KTAbout extends KTStandardDispatcher { | |
| 42 | + var $sSection = 'aboutkt'; | |
| 43 | + | |
| 44 | + function do_main() { | |
| 45 | + global $default; | |
| 46 | + $this->aBreadcrumbs = array(array('action' => 'aboutkt', 'name' => _kt("About"))); | |
| 47 | + $oUser =& $this->oUser; | |
| 48 | + | |
| 49 | + $oTemplating =& KTTemplating::getSingleton(); | |
| 50 | + $oTemplate = $oTemplating->loadTemplate("ktcore/principals/about"); | |
| 51 | + | |
| 52 | + $aVersionInfo = explode(' ', $default->versionName); | |
| 53 | + foreach($aVersionInfo as $sVersionpiece){ | |
| 54 | + if(substr($sVersionpiece, 1, 1) == '.'){ | |
| 55 | + $sVersionNo = $sVersionpiece; | |
| 56 | + }else{ | |
| 57 | + $sVersionName .= " ".$sVersionpiece; | |
| 58 | + } | |
| 59 | + } | |
| 60 | + | |
| 61 | + $aTemplateData = array( | |
| 62 | + "context" => $this, | |
| 63 | + "versionname" => $sVersionName, | |
| 64 | + "versionnumber" => $sVersionNo, | |
| 65 | + ); | |
| 66 | + return $oTemplate->render($aTemplateData); | |
| 67 | + } | |
| 68 | +} | |
| 69 | + | |
| 70 | +$oDispatcher = new KTAbout(); | |
| 71 | +$oDispatcher->dispatch(); | |
| 72 | + | |
| 73 | +?> | ... | ... |
action.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
admin.php
| ... | ... | @@ -3,15 +3,20 @@ |
| 3 | 3 | * $Id$ |
| 4 | 4 | * |
| 5 | 5 | * The contents of this file are subject to the KnowledgeTree Public |
| 6 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 6 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 7 | 7 | * compliance with the License. You may obtain a copy of the License at |
| 8 | 8 | * http://www.knowledgetree.com/KPL |
| 9 | 9 | * |
| 10 | 10 | * Software distributed under the License is distributed on an "AS IS" |
| 11 | - * basis, | |
| 12 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 13 | - * for the specific language governing rights and limitations under the | |
| 14 | - * License. | |
| 11 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 12 | + * See the License for the specific language governing rights and | |
| 13 | + * limitations under the License. | |
| 14 | + * | |
| 15 | + * All copies of the Covered Code must include on each user interface screen: | |
| 16 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 17 | + * (ii) the KnowledgeTree copyright notice | |
| 18 | + * in the same form as they appear in the distribution. See the License for | |
| 19 | + * requirements. | |
| 15 | 20 | * |
| 16 | 21 | * The Original Code is: KnowledgeTree Open Source |
| 17 | 22 | * |
| ... | ... | @@ -20,6 +25,7 @@ |
| 20 | 25 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 21 | 26 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 22 | 27 | * All Rights Reserved. |
| 28 | + * Contributor( s): ______________________________________ | |
| 23 | 29 | * |
| 24 | 30 | */ |
| 25 | 31 | ... | ... |
bin/automated_upgrade.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
bin/cleanup.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
bin/upgrade/pre-upgrade-3.0b3.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
bin/upgrade/upgrade-to-2.0.6.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
browse.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | * |
| 26 | 32 | * @version $Revision$ | ... | ... |
config/dmsDefaults.php
| ... | ... | @@ -7,15 +7,20 @@ |
| 7 | 7 | * Defines KnowledgeTree application defaults. |
| 8 | 8 | * |
| 9 | 9 | * The contents of this file are subject to the KnowledgeTree Public |
| 10 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 10 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 11 | 11 | * compliance with the License. You may obtain a copy of the License at |
| 12 | 12 | * http://www.knowledgetree.com/KPL |
| 13 | 13 | * |
| 14 | 14 | * Software distributed under the License is distributed on an "AS IS" |
| 15 | - * basis, | |
| 16 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 17 | - * for the specific language governing rights and limitations under the | |
| 18 | - * License. | |
| 15 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 16 | + * See the License for the specific language governing rights and | |
| 17 | + * limitations under the License. | |
| 18 | + * | |
| 19 | + * All copies of the Covered Code must include on each user interface screen: | |
| 20 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 21 | + * (ii) the KnowledgeTree copyright notice | |
| 22 | + * in the same form as they appear in the distribution. See the License for | |
| 23 | + * requirements. | |
| 19 | 24 | * |
| 20 | 25 | * The Original Code is: KnowledgeTree Open Source |
| 21 | 26 | * |
| ... | ... | @@ -24,6 +29,7 @@ |
| 24 | 29 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 25 | 30 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 26 | 31 | * All Rights Reserved. |
| 32 | + * Contributor( s): ______________________________________ | |
| 27 | 33 | * |
| 28 | 34 | */ |
| 29 | 35 | ... | ... |
config/siteMap.inc
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Defines site mappings- actions, pages and permissions. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | */ |
| 27 | 33 | ... | ... |
config/tableMappings.inc
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Stores the table mappings. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | */ |
| 27 | 33 | ... | ... |
control.php
| ... | ... | @@ -2,15 +2,20 @@ |
| 2 | 2 | |
| 3 | 3 | /* |
| 4 | 4 | * The contents of this file are subject to the KnowledgeTree Public |
| 5 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 5 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 6 | 6 | * compliance with the License. You may obtain a copy of the License at |
| 7 | 7 | * http://www.knowledgetree.com/KPL |
| 8 | 8 | * |
| 9 | 9 | * Software distributed under the License is distributed on an "AS IS" |
| 10 | - * basis, | |
| 11 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 12 | - * for the specific language governing rights and limitations under the | |
| 13 | - * License. | |
| 10 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 11 | + * See the License for the specific language governing rights and | |
| 12 | + * limitations under the License. | |
| 13 | + * | |
| 14 | + * All copies of the Covered Code must include on each user interface screen: | |
| 15 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 16 | + * (ii) the KnowledgeTree copyright notice | |
| 17 | + * in the same form as they appear in the distribution. See the License for | |
| 18 | + * requirements. | |
| 14 | 19 | * |
| 15 | 20 | * The Original Code is: KnowledgeTree Open Source |
| 16 | 21 | * |
| ... | ... | @@ -19,6 +24,7 @@ |
| 19 | 24 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 20 | 25 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 21 | 26 | * All Rights Reserved. |
| 27 | + * Contributor( s): ______________________________________ | |
| 22 | 28 | * |
| 23 | 29 | */ |
| 24 | 30 | ... | ... |
dashboard.php
| ... | ... | @@ -8,15 +8,20 @@ |
| 8 | 8 | * document, pending approval routing documents, etc. |
| 9 | 9 | * |
| 10 | 10 | * The contents of this file are subject to the KnowledgeTree Public |
| 11 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 11 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 12 | 12 | * compliance with the License. You may obtain a copy of the License at |
| 13 | 13 | * http://www.knowledgetree.com/KPL |
| 14 | 14 | * |
| 15 | 15 | * Software distributed under the License is distributed on an "AS IS" |
| 16 | - * basis, | |
| 17 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 18 | - * for the specific language governing rights and limitations under the | |
| 19 | - * License. | |
| 16 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 17 | + * See the License for the specific language governing rights and | |
| 18 | + * limitations under the License. | |
| 19 | + * | |
| 20 | + * All copies of the Covered Code must include on each user interface screen: | |
| 21 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 22 | + * (ii) the KnowledgeTree copyright notice | |
| 23 | + * in the same form as they appear in the distribution. See the License for | |
| 24 | + * requirements. | |
| 20 | 25 | * |
| 21 | 26 | * The Original Code is: KnowledgeTree Open Source |
| 22 | 27 | * |
| ... | ... | @@ -25,6 +30,7 @@ |
| 25 | 30 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 26 | 31 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 27 | 32 | * All Rights Reserved. |
| 33 | + * Contributor( s): ______________________________________ | |
| 28 | 34 | * |
| 29 | 35 | * |
| 30 | 36 | * @version $Revision$ | ... | ... |
examples/fieldsynchronisation/syncFieldFromLDAP.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
help.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
ktapi/ktapi.inc.php
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Implements a cleaner wrapper API for KnowledgeTree. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | */ |
| 27 | 33 | ... | ... |
ktwebdav/index.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
ktwebdav/ktwebdav.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
ktwebdav/lib/KTWebDAVServer.inc.php
| 1 | -<?php | |
| 2 | - | |
| 3 | -/** | |
| 4 | - * $Id$ | |
| 5 | - * | |
| 6 | - * The contents of this file are subject to the KnowledgeTree Public | |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | - * compliance with the License. You may obtain a copy of the License at | |
| 9 | - * http://www.knowledgetree.com/KPL | |
| 10 | - * | |
| 11 | - * Software distributed under the License is distributed on an "AS IS" | |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 16 | - * | |
| 17 | - * The Original Code is: KnowledgeTree Open Source | |
| 18 | - * | |
| 19 | - * The Initial Developer of the Original Code is The Jam Warehouse Software | |
| 20 | - * (Pty) Ltd, trading as KnowledgeTree. | |
| 21 | - * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright | |
| 22 | - * (C) 2007 The Jam Warehouse Software (Pty) Ltd; | |
| 23 | - * All Rights Reserved. | |
| 24 | - * | |
| 25 | - */ | |
| 26 | - | |
| 27 | -require_once 'HTTP/WebDAV/Server.php'; // thirdparty PEAR | |
| 28 | -require_once 'Config.php'; // thirdparty PEAR | |
| 29 | -require_once 'Log.php'; // thirdparty PEAR | |
| 30 | - | |
| 31 | -require_once '../config/dmsDefaults.php'; // This is our plug into KT. | |
| 32 | - | |
| 33 | - | |
| 34 | -DEFINE('STATUS_WEBDAV', 5); // Status code to handle 0 byte PUT FIXME: Do we still need this! | |
| 35 | - | |
| 36 | -/** | |
| 37 | - * KnowledgeTree access using WebDAV protocol | |
| 38 | - * | |
| 39 | - * @access public | |
| 40 | - */ | |
| 41 | -class KTWebDAVServer extends HTTP_WebDAV_Server | |
| 42 | -{ | |
| 43 | - /** | |
| 44 | - * String to be used in "X-Dav-Powered-By" header | |
| 45 | - * | |
| 46 | - * @var string | |
| 47 | - */ | |
| 48 | - var $dav_powered_by = 'KTWebDAV (1.0.0)'; | |
| 49 | - | |
| 50 | - /** | |
| 51 | - * Realm string to be used in authentication | |
| 52 | - * | |
| 53 | - * @var string | |
| 54 | - */ | |
| 55 | - var $http_auth_realm = 'KTWebDAV Server'; | |
| 56 | - | |
| 57 | - /** | |
| 58 | - * Path to KT install root | |
| 59 | - * | |
| 60 | - * @var string | |
| 61 | - */ | |
| 62 | - var $ktdmsPath = ''; | |
| 63 | - | |
| 64 | - /** | |
| 65 | - * Debug Info Toggle | |
| 66 | - * | |
| 67 | - * @var string | |
| 68 | - */ | |
| 69 | - var $debugInfo = 'off'; | |
| 70 | - | |
| 71 | - /** | |
| 72 | - * Safe Mode Toggle | |
| 73 | - * | |
| 74 | - * @var string | |
| 75 | - */ | |
| 76 | - var $safeMode = 'on'; | |
| 77 | - | |
| 78 | - /** | |
| 79 | - * Configuration Array | |
| 80 | - * | |
| 81 | - * @var array | |
| 82 | - */ | |
| 83 | - var $config = array(); | |
| 84 | - | |
| 85 | - /** | |
| 86 | - * Settings Section Configuration Array | |
| 87 | - * | |
| 88 | - * @var array | |
| 89 | - */ | |
| 90 | - var $settings = array(); | |
| 91 | - | |
| 92 | - /** | |
| 93 | - * Current User ID | |
| 94 | - * | |
| 95 | - * @var int | |
| 96 | - */ | |
| 97 | - var $userID; | |
| 98 | - | |
| 99 | - /** | |
| 100 | - * Current Method | |
| 101 | - * | |
| 102 | - * @var string | |
| 103 | - */ | |
| 104 | - var $currentMethod; | |
| 105 | - | |
| 106 | - /** | |
| 107 | - * Last Created Folder ID | |
| 108 | - * | |
| 109 | - * @var string | |
| 110 | - */ | |
| 111 | - var $lastFolderID; | |
| 112 | - | |
| 113 | - /** | |
| 114 | - * DAV Client | |
| 115 | - * | |
| 116 | - * @var String | |
| 117 | - */ | |
| 118 | - var $dav_client; | |
| 119 | - | |
| 120 | - /** | |
| 121 | - * Root Folder Name | |
| 122 | - * | |
| 123 | - * @var String | |
| 124 | - */ | |
| 125 | - var $rootFolder = 'Root Folder'; | |
| 126 | - | |
| 127 | - /** | |
| 128 | - * Last Message | |
| 129 | - * | |
| 130 | - * @var String | |
| 131 | - */ | |
| 132 | - var $lastMsg = ''; | |
| 133 | - | |
| 134 | - /** | |
| 135 | - * Constructor | |
| 136 | - * | |
| 137 | - * @param void | |
| 138 | - * @return void | |
| 139 | - */ | |
| 140 | - function KTWebDAVServer() { | |
| 141 | - | |
| 142 | - // CGI compatible auth setup | |
| 143 | - $altinfo = KTUtil::arrayGet( $_SERVER, 'kt_auth', KTUtil::arrayGet( $_SERVER, 'REDIRECT_kt_auth')); | |
| 144 | - if ( !empty( $altinfo) && !isset( $_SERVER['PHP_AUTH_USER'])) { | |
| 145 | - $val = $altinfo; | |
| 146 | - $pieces = explode( ' ', $val); // bad. | |
| 147 | - if ( $pieces[0] == 'Basic') { | |
| 148 | - $chunk = $pieces[1]; | |
| 149 | - $decoded = base64_decode( $chunk); | |
| 150 | - $credential_info = explode( ':', $decoded); | |
| 151 | - if ( count( $credential_info) == 2) { | |
| 152 | - $_SERVER['PHP_AUTH_USER'] = $credential_info[0]; | |
| 153 | - $_SERVER['PHP_AUTH_PW'] = $credential_info[1]; | |
| 154 | - $_SERVER["AUTH_TYPE"] = 'Basic'; | |
| 155 | - } | |
| 156 | - } | |
| 157 | - } | |
| 158 | - | |
| 159 | - // Let the base class do it's thing | |
| 160 | - parent::HTTP_WebDAV_Server(); | |
| 161 | - | |
| 162 | - // Load KTWebDAV config | |
| 163 | - if (!$this->initConfig()) { | |
| 164 | - $this->ktwebdavLog('Could not load configiration.', 'error'); | |
| 165 | - exit(0); | |
| 166 | - } | |
| 167 | - | |
| 168 | - if ($this->debugInfo == 'on') { | |
| 169 | - | |
| 170 | - $this->ktwebdavLog('====================='); | |
| 171 | - $this->ktwebdavLog(' Debug Info is : ' . $this->debugInfo); | |
| 172 | - $this->ktwebdavLog(' SafeMode is : ' . $this->safeMode); | |
| 173 | - $this->ktwebdavLog(' Root Folder is : ' . $this->rootFolder); | |
| 174 | - $this->ktwebdavLog('====================='); | |
| 175 | - } | |
| 176 | - | |
| 177 | - } | |
| 178 | - | |
| 179 | - /** | |
| 180 | - * Load KTWebDAV configuration from conf file | |
| 181 | - * | |
| 182 | - * @param void | |
| 183 | - * @return bool true on success | |
| 184 | - */ | |
| 185 | - function initConfig() { | |
| 186 | - | |
| 187 | - global $default; | |
| 188 | - $oConfig =& KTConfig::getSingleton(); | |
| 189 | - | |
| 190 | - // Assign Content | |
| 191 | - $this->debugInfo = $oConfig->get('KTWebDAVSettings/debug', 'off'); | |
| 192 | - $this->safeMode = $oConfig->get('KTWebDAVSettings/safemode', 'on'); | |
| 193 | - $this->rootFolder = $oConfig->get('KTWebDAVSettings/rootfolder', 'Root Folder'); | |
| 194 | - $this->kt_version = $default->systemVersion; | |
| 195 | - | |
| 196 | - return true; | |
| 197 | - } | |
| 198 | - | |
| 199 | - /** | |
| 200 | - * Log to the KTWebDAV logfile | |
| 201 | - * | |
| 202 | - * @todo Add other log levels for warning, profile, etc | |
| 203 | - * @param string log message | |
| 204 | - * @param bool debug only? | |
| 205 | - * @return bool true on success | |
| 206 | - */ | |
| 207 | - function ktwebdavLog($entry, $type = 'info', $debug_only = false) { | |
| 208 | - | |
| 209 | - if ($debug_only && $this->debugInfo != 'on') return false; | |
| 210 | - | |
| 211 | - $ident = 'KTWEBDAV'; | |
| 212 | - $conf = array('mode' => 0644, 'timeFormat' => '%X %x'); | |
| 213 | - $logger = &Log::singleton('file', '../var/log/ktwebdav-' . date('Y-m-d') . '.txt', $ident, $conf); | |
| 214 | - if ($type == 'error') $logger->log($entry, PEAR_LOG_ERR); | |
| 215 | - else $logger->log($entry, PEAR_LOG_INFO); | |
| 216 | - return true; | |
| 217 | - } | |
| 218 | - | |
| 219 | - /** | |
| 220 | - * Get the current UserID | |
| 221 | - * | |
| 222 | - * @access private | |
| 223 | - * @param void | |
| 224 | - * @return int userID | |
| 225 | - */ | |
| 226 | - function _getUserID() { | |
| 227 | - return $this->userID; | |
| 228 | - } | |
| 229 | - | |
| 230 | - /** | |
| 231 | - * Set the current UserID | |
| 232 | - * | |
| 233 | - * @access private | |
| 234 | - * @param void | |
| 235 | - * @return int UserID | |
| 236 | - */ | |
| 237 | - function _setUserID($iUserID) { | |
| 238 | - return $this->userID = $iUserID; | |
| 239 | - } | |
| 240 | - | |
| 241 | - /** | |
| 242 | - * Serve a webdav request | |
| 243 | - * | |
| 244 | - * @access public | |
| 245 | - * @param void | |
| 246 | - * @return void | |
| 247 | - */ | |
| 248 | - function ServeRequest() { | |
| 249 | - | |
| 250 | - global $default; | |
| 251 | - | |
| 252 | - if ($this->debugInfo == 'on') { | |
| 253 | - | |
| 254 | - $this->ktwebdavLog('_SERVER is ' . print_r($_SERVER, true), 'info', true); | |
| 255 | - } | |
| 256 | - | |
| 257 | - // Get the client info | |
| 258 | - $this->checkSafeMode(); | |
| 259 | - | |
| 260 | - // identify ourselves | |
| 261 | - $this->ktwebdavLog('WebDAV Server : ' . $this->dav_powered_by . ' [KT:'.$default->systemVersion."]", 'info', true); | |
| 262 | - header('X-Dav-Powered-By: '.$this->dav_powered_by . ' [KT:'.$default->systemVersion.']'); | |
| 263 | - | |
| 264 | - // check authentication | |
| 265 | - if (!$this->_check_auth()) { | |
| 266 | - $this->ktwebdavLog('401 Unauthorized - Authorisation failed.' .$this->lastMsg, 'info', true); | |
| 267 | - $this->ktwebdavLog('----------------------------------------', 'info', true); | |
| 268 | - $this->http_status('401 Unauthorized - Authorisation failed. ' .$this->lastMsg); | |
| 269 | - | |
| 270 | - // RFC2518 says we must use Digest instead of Basic | |
| 271 | - // but Microsoft Clients do not support Digest | |
| 272 | - // and we don't support NTLM and Kerberos | |
| 273 | - // so we are stuck with Basic here | |
| 274 | - header('WWW-Authenticate: Basic realm="'.($this->http_auth_realm).'"'); | |
| 275 | - | |
| 276 | - return; | |
| 277 | - } | |
| 278 | - | |
| 279 | - // check | |
| 280 | - if(! $this->_check_if_header_conditions()) { | |
| 281 | - $this->http_status('412 Precondition failed'); | |
| 282 | - return; | |
| 283 | - } | |
| 284 | - | |
| 285 | - // set path | |
| 286 | - $request_uri = $this->_urldecode(!empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/'); | |
| 287 | - $this->path = str_replace($_SERVER['SCRIPT_NAME'], '', $request_uri); | |
| 288 | - if(ini_get('magic_quotes_gpc')) { | |
| 289 | - $this->path = stripslashes($this->path); | |
| 290 | - } | |
| 291 | - | |
| 292 | - $this->ktwebdavLog('PATH_INFO is ' . $_SERVER['PATH_INFO'], 'info', true); | |
| 293 | - $this->ktwebdavLog('REQUEST_URI is ' . $_SERVER['REQUEST_URI'], 'info', true); | |
| 294 | - $this->ktwebdavLog('SCRIPT_NAME is ' . $_SERVER['SCRIPT_NAME'], 'info', true); | |
| 295 | - $this->ktwebdavLog('PHP_SELF is ' . $_SERVER['PHP_SELF'], 'info', true); | |
| 296 | - $this->ktwebdavLog('path set to ' . $this->path, 'info', true); | |
| 297 | - | |
| 298 | - // detect requested method names | |
| 299 | - $method = strtolower($_SERVER['REQUEST_METHOD']); | |
| 300 | - $wrapper = 'http_'.$method; | |
| 301 | - | |
| 302 | - $this->currentMethod = $method; | |
| 303 | - // activate HEAD emulation by GET if no HEAD method found | |
| 304 | - if ($method == 'head' && !method_exists($this, 'head')) { | |
| 305 | - // rfc2068 Sec: 10.2.1 | |
| 306 | - //HEAD the entity-header fields corresponding to the requested resource | |
| 307 | - // are sent in the response without any message-body | |
| 308 | - $method = 'get'; | |
| 309 | - } | |
| 310 | - $this->ktwebdavLog("Entering $method request", 'info', true); | |
| 311 | - | |
| 312 | - if (method_exists($this, $wrapper) && ($method == 'options' || method_exists($this, $method))) { | |
| 313 | - $this->$wrapper(); // call method by name | |
| 314 | - } else { // method not found/implemented | |
| 315 | - if ($_SERVER['REQUEST_METHOD'] == 'LOCK') { | |
| 316 | - $this->http_status('412 Precondition failed'); | |
| 317 | - } else { | |
| 318 | - $this->http_status('405 Method not allowed'); | |
| 319 | - header('Allow: '.join(', ', $this->_allow())); // tell client what's allowed | |
| 320 | - } | |
| 321 | - } | |
| 322 | - | |
| 323 | - $this->ktwebdavLog("Exiting $method request", 'info', true); | |
| 324 | - | |
| 325 | - } | |
| 326 | - | |
| 327 | - | |
| 328 | - /** | |
| 329 | - * check authentication if check is implemented | |
| 330 | - * | |
| 331 | - * @param void | |
| 332 | - * @return bool true if authentication succeded or not necessary | |
| 333 | - */ | |
| 334 | - function _check_auth() | |
| 335 | - { | |
| 336 | - $this->ktwebdavLog('Entering _check_auth...', 'info', true); | |
| 337 | - | |
| 338 | - if (method_exists($this, 'checkAuth')) { | |
| 339 | - // PEAR style method name | |
| 340 | - return $this->checkAuth(@$_SERVER['AUTH_TYPE'], | |
| 341 | - @$_SERVER['PHP_AUTH_USER'], | |
| 342 | - @$_SERVER['PHP_AUTH_PW']); | |
| 343 | - } else if (method_exists($this, 'check_auth')) { | |
| 344 | - // old (pre 1.0) method name | |
| 345 | - return $this->check_auth(@$_SERVER['AUTH_TYPE'], | |
| 346 | - @$_SERVER['PHP_AUTH_USER'], | |
| 347 | - @$_SERVER['PHP_AUTH_PW']); | |
| 348 | - } else { | |
| 349 | - // no method found -> no authentication required | |
| 350 | - return true; | |
| 351 | - } | |
| 352 | - } | |
| 353 | - | |
| 354 | - /** | |
| 355 | - * Authenticate user | |
| 356 | - * | |
| 357 | - * @access private | |
| 358 | - * @param string HTTP Authentication type (Basic, Digest, ...) | |
| 359 | - * @param string Username | |
| 360 | - * @param string Password | |
| 361 | - * @return bool true on successful authentication | |
| 362 | - */ | |
| 363 | - function checkAuth($sType, $sUser, $sPass) { | |
| 364 | - | |
| 365 | - $this->ktwebdavLog('Entering checkAuth params are: ', 'info', true); | |
| 366 | - $this->ktwebdavLog('sType: ' . $sType, 'info', true); | |
| 367 | - $this->ktwebdavLog('sUser: ' . $sUser, 'info', true); | |
| 368 | - $this->ktwebdavLog('sPass: ' . $sPass, 'info', true); | |
| 369 | - | |
| 370 | - // Authenticate user | |
| 371 | - | |
| 372 | - require_once(KT_LIB_DIR . '/authentication/authenticationutil.inc.php'); | |
| 373 | - | |
| 374 | - if ( empty($sUser) ) { | |
| 375 | - $this->ktwebdavLog('sUser is empty, returning false.', 'info', true); | |
| 376 | - return false; | |
| 377 | - } | |
| 378 | - | |
| 379 | - if ( empty($sPass) ) { | |
| 380 | - $this->ktwebdavLog('sPass is empty, returning false.', 'info', true); | |
| 381 | - return false; | |
| 382 | - } | |
| 383 | - | |
| 384 | - $oUser =& User::getByUsername($sUser); | |
| 385 | - if (PEAR::isError($oUser) || ($oUser === false)) { | |
| 386 | - $this->ktwebdavLog('User not found: ' . $sUser . '.', 'error'); | |
| 387 | - $this->lastMsg = 'User not found: ' . $sUser . '.'; | |
| 388 | - return false; | |
| 389 | - } | |
| 390 | - $authenticated = KTAuthenticationUtil::checkPassword($oUser, $sPass); | |
| 391 | - | |
| 392 | - if ($authenticated === false) { | |
| 393 | - $this->ktwebdavLog('Password incorrect for ' . $sUser . '.', 'error'); | |
| 394 | - $this->lastMsg = 'Password incorrect for ' . $sUser . '.'; | |
| 395 | - return false; | |
| 396 | - } | |
| 397 | - | |
| 398 | - if (PEAR::isError($authenticated)) { | |
| 399 | - $this->ktwebdavLog('Password incorrect for ' . $sUser . '.', 'error'); | |
| 400 | - $this->lastMsg = 'Password incorrect for ' . $sUser . '.'; | |
| 401 | - return false; | |
| 402 | - } | |
| 403 | - | |
| 404 | - $this->ktwebdavLog('UserID is: ' . $oUser->getId(), 'info', true ); | |
| 405 | - $this->_setUserID($oUser->getId()); | |
| 406 | - $_SESSION['userID'] = $this->_getUserID(); | |
| 407 | - $this->ktwebdavLog('SESSION UserID is: ' . $_SESSION['userID'], 'info', true ); | |
| 408 | - | |
| 409 | - $this->ktwebdavLog("Authentication Success.", 'info', true); | |
| 410 | - | |
| 411 | - return true; | |
| 412 | - } | |
| 413 | - | |
| 414 | - /** | |
| 415 | - * PROPFIND method handler | |
| 416 | - * | |
| 417 | - * @param array options | |
| 418 | - * @param array return array for file properties | |
| 419 | - * @return bool true on success | |
| 420 | - */ | |
| 421 | - function PROPFIND(&$options, &$files) { | |
| 422 | - | |
| 423 | - $this->ktwebdavLog("Entering PROPFIND. options are " . print_r($options, true), 'info', true); | |
| 424 | - | |
| 425 | - global $default; | |
| 426 | - | |
| 427 | - $fspath = $default->documentRoot . "/" . $this->rootFolder . $options["path"]; | |
| 428 | - $this->ktwebdavLog("fspath is " . $fspath, 'info', true); | |
| 429 | - | |
| 430 | - $path = $options["path"]; | |
| 431 | - | |
| 432 | - list($iFolderID, $iDocumentID) = $this->_folderOrDocument($path); | |
| 433 | - $this->ktwebdavLog("Folder/Doc is " . print_r(array($iFolderID, $iDocumentID), true), 'info', true); | |
| 434 | - | |
| 435 | - // Folder does not exist | |
| 436 | - if($iFolderID == '') return false; | |
| 437 | - | |
| 438 | - if (is_null($iDocumentID)) { | |
| 439 | - return $this->_PROPFINDFolder($options, $files, $iFolderID); | |
| 440 | - } | |
| 441 | - return $this->_PROPFINDDocument($options, $files, $iDocumentID); | |
| 442 | - | |
| 443 | - } | |
| 444 | - | |
| 445 | - /** | |
| 446 | - * PROPFIND helper for Folders | |
| 447 | - * | |
| 448 | - * @param array options | |
| 449 | - * @param array Return array for file props | |
| 450 | - * @param int Folder ID | |
| 451 | - * @return bool true on success | |
| 452 | - */ | |
| 453 | - function _PROPFINDFolder(&$options, &$files, $iFolderID) { | |
| 454 | - | |
| 455 | - global $default; | |
| 456 | - | |
| 457 | - $this->ktwebdavLog("Entering PROPFINDFolder. options are " . print_r($options, true), 'info', true); | |
| 458 | - | |
| 459 | - $folder_path = $options["path"]; | |
| 460 | - if (substr($folder_path, -1) != "/") { | |
| 461 | - $folder_path .= "/"; | |
| 462 | - } | |
| 463 | - $options["path"] = $folder_path; | |
| 464 | - | |
| 465 | - $files["files"] = array(); | |
| 466 | - $files["files"][] = $this->_fileinfoForFolderID($iFolderID, $folder_path); | |
| 467 | - | |
| 468 | - $oPerm =& KTPermission::getByName('ktcore.permissions.read'); | |
| 469 | - $oUser =& User::get($this->userID); | |
| 470 | - | |
| 471 | - if (!empty($options["depth"])) { | |
| 472 | - $aChildren = Folder::getList(array('parent_id = ?', $iFolderID)); | |
| 473 | - // FIXME: Truncation Time Workaround | |
| 474 | - //foreach (array_slice($aChildren, 0, 50) as $oChildFolder) { | |
| 475 | - foreach ($aChildren as $oChildFolder) { | |
| 476 | - // Check if the user has permissions to view this folder | |
| 477 | - $oFolderDetailsPerm =& KTPermission::getByName('ktcore.permissions.folder_details'); | |
| 478 | - | |
| 479 | - if(KTPermissionUtil::userHasPermissionOnItem($oUser, $oFolderDetailsPerm, $oChildFolder)) | |
| 480 | - { | |
| 481 | - $this->ktwebdavLog("Folder Details permissions GRANTED for user ". $_SESSION["userID"] ." on folder " . $oChildFolder->getName(), 'info', true); | |
| 482 | - $files["files"][] = $this->_fileinfoForFolder($oChildFolder, $folder_path . $oChildFolder->getName()); | |
| 483 | - } | |
| 484 | - else | |
| 485 | - { | |
| 486 | - $this->ktwebdavLog("Folder Details permissions DENIED for ". $_SESSION["userID"] ." on folder " . $oChildFolder->getName(), 'info', true); | |
| 487 | - } | |
| 488 | - } | |
| 489 | - $aDocumentChildren = Document::getList(array('folder_id = ? AND status_id = 1', $iFolderID)); | |
| 490 | - // FIXME: Truncation Time Workaround | |
| 491 | - //foreach (array_slice($aDocumentChildren, 0, 50) as $oChildDocument) { | |
| 492 | - foreach ($aDocumentChildren as $oChildDocument) { | |
| 493 | - // Check if the user has permissions to view this document | |
| 494 | - if (KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oChildDocument)) { | |
| 495 | - $this->ktwebdavLog("Read permissions GRANTED for ". $_SESSION["userID"] ." on document " . $oChildDocument->getName(), 'info', true); | |
| 496 | - $files["files"][] = $this->_fileinfoForDocument($oChildDocument, $folder_path . $oChildDocument->getFileName()); | |
| 497 | - } else $this->ktwebdavLog("Read permissions DENIED for ". $_SESSION["userID"] ." on document " . $oChildDocument->getName(), 'info', true); | |
| 498 | - } | |
| 499 | - } | |
| 500 | - return true; | |
| 501 | - } | |
| 502 | - | |
| 503 | - /** | |
| 504 | - * PROPFIND helper for Documents | |
| 505 | - * | |
| 506 | - * @param array options | |
| 507 | - * @param array Return array for file props | |
| 508 | - * @param int Document ID | |
| 509 | - * @return bool true on success | |
| 510 | - */ | |
| 511 | - function _PROPFINDDocument(&$options, &$files, $iDocumentID) { | |
| 512 | - | |
| 513 | - global $default; | |
| 514 | - | |
| 515 | - $this->ktwebdavLog("Entering PROPFINDDocument. files are " . print_r($files, true), 'info', true); | |
| 516 | - | |
| 517 | - $res = $this->_fileinfoForDocumentID($iDocumentID, $options["path"]); | |
| 518 | - $this->ktwebdavLog("_fileinfoForDocumentID result is " . print_r($res, true), 'info', true); | |
| 519 | - if ($res === false) { | |
| 520 | - return false; | |
| 521 | - } | |
| 522 | - $files["files"] = array(); | |
| 523 | - $files["files"][] = $res; | |
| 524 | - return true; | |
| 525 | - } | |
| 526 | - | |
| 527 | - /** | |
| 528 | - * PROPFIND helper for Document Info | |
| 529 | - * | |
| 530 | - * @param Document Document Object | |
| 531 | - * @param string Path | |
| 532 | - * @return array Doc info array | |
| 533 | - */ | |
| 534 | - function _fileinfoForDocument(&$oDocument, $path) { | |
| 535 | - | |
| 536 | - global $default; | |
| 537 | - | |
| 538 | - $this->ktwebdavLog("Entering _fileinfoForDocument. Document is " . print_r($oDocument, true), 'info', true); | |
| 539 | - | |
| 540 | - $fspath = $default->documentRoot . "/" . $this->rootFolder . $path; | |
| 541 | - $this->ktwebdavLog("fspath is " . $fspath, 'info', true); | |
| 542 | - | |
| 543 | - // create result array | |
| 544 | - $info = array(); | |
| 545 | - $info["path"] = $path; | |
| 546 | - $info["props"] = array(); | |
| 547 | - | |
| 548 | - // no special beautified displayname here ... | |
| 549 | - $info["props"][] = $this->mkprop("displayname", $oDocument->getName()); | |
| 550 | - | |
| 551 | - // creation and modification time | |
| 552 | - $info["props"][] = $this->mkprop("creationdate", strtotime($oDocument->getCreatedDateTime())); | |
| 553 | - $info["props"][] = $this->mkprop("getlastmodified", strtotime($oDocument->getVersionCreated())); | |
| 554 | - | |
| 555 | - // plain file (WebDAV resource) | |
| 556 | - $info["props"][] = $this->mkprop("resourcetype", ''); | |
| 557 | - // FIXME: Direct database access | |
| 558 | - $sQuery = array("SELECT mimetypes FROM $default->mimetypes_table WHERE id = ?", array($oDocument->getMimeTypeID())); | |
| 559 | - $res = DBUtil::getOneResultKey($sQuery, 'mimetypes'); | |
| 560 | - $info["props"][] = $this->mkprop("getcontenttype", $res); | |
| 561 | - | |
| 562 | - $info["props"][] = $this->mkprop("getcontentlength", $oDocument->getFileSize()); | |
| 563 | - | |
| 564 | - // explorer wants these? | |
| 565 | - $info["props"][] = $this->mkprop("name", ''); | |
| 566 | - $info["props"][] = $this->mkprop("parentname", ''); | |
| 567 | - $info["props"][] = $this->mkprop("href", ''); | |
| 568 | - $info["props"][] = $this->mkprop("ishidden", ''); | |
| 569 | - $info["props"][] = $this->mkprop("iscollection", ''); | |
| 570 | - $info["props"][] = $this->mkprop("isreadonly", ''); | |
| 571 | - $info["props"][] = $this->mkprop("contentclass", ''); | |
| 572 | - $info["props"][] = $this->mkprop("getcontentlanguage", ''); | |
| 573 | - $info["props"][] = $this->mkprop("lastaccessed", ''); | |
| 574 | - $info["props"][] = $this->mkprop("isstructureddocument", ''); | |
| 575 | - $info["props"][] = $this->mkprop("defaultdocument", ''); | |
| 576 | - $info["props"][] = $this->mkprop("isroot", ''); | |
| 577 | - | |
| 578 | - return $info; | |
| 579 | - } | |
| 580 | - | |
| 581 | - | |
| 582 | - /** | |
| 583 | - * PROPFIND helper for Document Info | |
| 584 | - * | |
| 585 | - * @param int Document ID | |
| 586 | - * @param string path | |
| 587 | - * @return array Doc info array | |
| 588 | - */ | |
| 589 | - function _fileinfoForDocumentID($iDocumentID, $path) { | |
| 590 | - | |
| 591 | - global $default; | |
| 592 | - | |
| 593 | - $this->ktwebdavLog("Entering _fileinfoForDocumentID. DocumentID is " . print_r($iDocumentID, true), 'info', true); | |
| 594 | - | |
| 595 | - if ($iDocumentID == '') return false; | |
| 596 | - | |
| 597 | - $oDocument =& Document::get($iDocumentID); | |
| 598 | - | |
| 599 | - if (is_null($oDocument) || ($oDocument === false) || PEAR::isError($oDocument)) { | |
| 600 | - return false; | |
| 601 | - } | |
| 602 | - | |
| 603 | - return $this->_fileinfoForDocument($oDocument, $path); | |
| 604 | - | |
| 605 | - } | |
| 606 | - | |
| 607 | - /** | |
| 608 | - * PROPFIND helper for Folder Info | |
| 609 | - * | |
| 610 | - * @param Folder Folder Object | |
| 611 | - * @param string $path | |
| 612 | - * @return array Folder info array | |
| 613 | - */ | |
| 614 | - function _fileinfoForFolder($oFolder, $path) { | |
| 615 | - | |
| 616 | - global $default; | |
| 617 | - | |
| 618 | - $this->ktwebdavLog("Entering _fileinfoForFolder. Folder is " . print_r($oFolder, true), 'info', true); | |
| 619 | - | |
| 620 | - // create result array | |
| 621 | - $info = array(); | |
| 622 | - $info["path"] = $path; | |
| 623 | - $fspath = $default->documentRoot . "/" . $this->rootFolder . $path; | |
| 624 | - //$fspath = $default->documentRoot . '/' . $oFolder->generateFolderPath($oFolder->getID()); | |
| 625 | - $info["props"] = array(); | |
| 626 | - | |
| 627 | - // no special beautified displayname here ... | |
| 628 | - $info["props"][] = $this->mkprop("displayname", $oFolder->getName()); | |
| 629 | - | |
| 630 | - // creation and modification time | |
| 631 | - //$info["props"][] = $this->mkprop("creationdate", strtotime($oFolder->getCreatedDateTime())); | |
| 632 | - //$info["props"][] = $this->mkprop("getlastmodified", strtotime($oFolder->getVersionCreated())); | |
| 633 | - | |
| 634 | - // directory (WebDAV collection) | |
| 635 | - $info["props"][] = $this->mkprop("resourcetype", "collection"); | |
| 636 | - $info["props"][] = $this->mkprop("getcontenttype", "httpd/unix-directory"); | |
| 637 | - $info["props"][] = $this->mkprop("getcontentlength", 0); | |
| 638 | - | |
| 639 | - return $info; | |
| 640 | - } | |
| 641 | - | |
| 642 | - /** | |
| 643 | - * PROPFIND method handler | |
| 644 | - * | |
| 645 | - * @param void | |
| 646 | - * @return void | |
| 647 | - */ | |
| 648 | - function http_PROPFIND() | |
| 649 | - { | |
| 650 | - $options = Array(); | |
| 651 | - $options["path"] = $this->path; | |
| 652 | - | |
| 653 | - // search depth from header (default is "infinity) | |
| 654 | - if (isset($_SERVER['HTTP_DEPTH'])) { | |
| 655 | - $options["depth"] = $_SERVER["HTTP_DEPTH"]; | |
| 656 | - } else { | |
| 657 | - $options["depth"] = "infinity"; | |
| 658 | - } | |
| 659 | - | |
| 660 | - // analyze request payload | |
| 661 | - $propinfo = new _parse_propfind("php://input"); | |
| 662 | - if (!$propinfo->success) { | |
| 663 | - $this->http_status("400 Error"); | |
| 664 | - return; | |
| 665 | - } | |
| 666 | - $options['props'] = $propinfo->props; | |
| 667 | - | |
| 668 | - // call user handler | |
| 669 | - if (!$this->PROPFIND($options, $files)) { | |
| 670 | - $this->http_status("404 Not Found"); | |
| 671 | - return; | |
| 672 | - } | |
| 673 | - | |
| 674 | - // collect namespaces here | |
| 675 | - $ns_hash = array(); | |
| 676 | - | |
| 677 | - // Microsoft Clients need this special namespace for date and time values | |
| 678 | - $ns_defs = "xmlns:ns0=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\""; | |
| 679 | - | |
| 680 | - // now we loop over all returned file entries | |
| 681 | - foreach($files["files"] as $filekey => $file) { | |
| 682 | - | |
| 683 | - // nothing to do if no properties were returned for a file | |
| 684 | - if (!isset($file["props"]) || !is_array($file["props"])) { | |
| 685 | - continue; | |
| 686 | - } | |
| 687 | - | |
| 688 | - // now loop over all returned properties | |
| 689 | - foreach($file["props"] as $key => $prop) { | |
| 690 | - // as a convenience feature we do not require that user handlers | |
| 691 | - // restrict returned properties to the requested ones | |
| 692 | - // here we strip all unrequested entries out of the response | |
| 693 | - | |
| 694 | - switch($options['props']) { | |
| 695 | - case "all": | |
| 696 | - // nothing to remove | |
| 697 | - break; | |
| 698 | - | |
| 699 | - case "names": | |
| 700 | - // only the names of all existing properties were requested | |
| 701 | - // so we remove all values | |
| 702 | - unset($files["files"][$filekey]["props"][$key]["val"]); | |
| 703 | - break; | |
| 704 | - | |
| 705 | - default: | |
| 706 | - $found = false; | |
| 707 | - | |
| 708 | - // search property name in requested properties | |
| 709 | - foreach((array)$options["props"] as $reqprop) { | |
| 710 | - if ( $reqprop["name"] == $prop["name"] | |
| 711 | - && $reqprop["xmlns"] == $prop["ns"]) { | |
| 712 | - $found = true; | |
| 713 | - break; | |
| 714 | - } | |
| 715 | - } | |
| 716 | - | |
| 717 | - // unset property and continue with next one if not found/requested | |
| 718 | - if (!$found) { | |
| 719 | - $files["files"][$filekey]["props"][$key]=''; | |
| 720 | - continue(2); | |
| 721 | - } | |
| 722 | - break; | |
| 723 | - } | |
| 724 | - | |
| 725 | - // namespace handling | |
| 726 | - if (empty($prop["ns"])) continue; // no namespace | |
| 727 | - $ns = $prop["ns"]; | |
| 728 | - if ($ns == "DAV:") continue; // default namespace | |
| 729 | - if (isset($ns_hash[$ns])) continue; // already known | |
| 730 | - | |
| 731 | - // register namespace | |
| 732 | - $ns_name = "ns".(count($ns_hash) + 1); | |
| 733 | - $ns_hash[$ns] = $ns_name; | |
| 734 | - $ns_defs .= " xmlns:$ns_name=\"$ns\""; | |
| 735 | - } | |
| 736 | - | |
| 737 | - // we also need to add empty entries for properties that were requested | |
| 738 | - // but for which no values where returned by the user handler | |
| 739 | - if (is_array($options['props'])) { | |
| 740 | - foreach($options["props"] as $reqprop) { | |
| 741 | - if($reqprop['name']=='') continue; // skip empty entries | |
| 742 | - | |
| 743 | - $found = false; | |
| 744 | - | |
| 745 | - // check if property exists in result | |
| 746 | - foreach($file["props"] as $prop) { | |
| 747 | - if ( $reqprop["name"] == $prop["name"] | |
| 748 | - && $reqprop["xmlns"] == $prop["ns"]) { | |
| 749 | - $found = true; | |
| 750 | - break; | |
| 751 | - } | |
| 752 | - } | |
| 753 | - | |
| 754 | - if (!$found) { | |
| 755 | - if($reqprop["xmlns"]==="DAV:" && $reqprop["name"]==="lockdiscovery") { | |
| 756 | - // lockdiscovery is handled by the base class | |
| 757 | - $files["files"][$filekey]["props"][] | |
| 758 | - = $this->mkprop("DAV:", | |
| 759 | - "lockdiscovery" , | |
| 760 | - $this->lockdiscovery($files["files"][$filekey]['path'])); | |
| 761 | - } else { | |
| 762 | - // add empty value for this property | |
| 763 | - $files["files"][$filekey]["noprops"][] = $this->mkprop($reqprop["xmlns"], $reqprop["name"], ''); | |
| 764 | - | |
| 765 | - // register property namespace if not known yet | |
| 766 | - if ($reqprop["xmlns"] != "DAV:" && !isset($ns_hash[$reqprop["xmlns"]])) { | |
| 767 | - $ns_name = "ns".(count($ns_hash) + 1); | |
| 768 | - $ns_hash[$reqprop["xmlns"]] = $ns_name; | |
| 769 | - $ns_defs .= " xmlns:$ns_name=\"$reqprop[xmlns]\""; | |
| 770 | - } | |
| 771 | - } | |
| 772 | - } | |
| 773 | - } | |
| 774 | - } | |
| 775 | - } | |
| 776 | - | |
| 777 | - // now we generate the reply header ... | |
| 778 | - $this->http_status("207 Multi-Status"); | |
| 779 | - header('Content-Type: text/xml; charset="utf-8"'); | |
| 780 | - | |
| 781 | - // ... and payload | |
| 782 | - echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; | |
| 783 | - echo "<D:multistatus xmlns:D=\"DAV:\">\n"; | |
| 784 | - | |
| 785 | - foreach($files["files"] as $file) { | |
| 786 | - // ignore empty or incomplete entries | |
| 787 | - if(!is_array($file) || empty($file) || !isset($file["path"])) continue; | |
| 788 | - $path = $file['path']; | |
| 789 | - if(!is_string($path) || $path==='') continue; | |
| 790 | - | |
| 791 | - echo " <D:response $ns_defs>\n"; | |
| 792 | - | |
| 793 | - $href = htmlspecialchars($this->_slashify($this->_mergePathes($_SERVER['SCRIPT_NAME'], $path))); | |
| 794 | - | |
| 795 | - echo " <D:href>$href</D:href>\n"; | |
| 796 | - | |
| 797 | - $this->ktwebdavLog("\nfile is: " . print_r($file, true), 'info', true); | |
| 798 | - | |
| 799 | - // report all found properties and their values (if any) | |
| 800 | - if (isset($file["props"]) && is_array($file["props"])) { | |
| 801 | - echo " <D:propstat>\n"; | |
| 802 | - echo " <D:prop>\n"; | |
| 803 | - | |
| 804 | - foreach($file["props"] as $key => $prop) { | |
| 805 | - | |
| 806 | - if (!is_array($prop)) continue; | |
| 807 | - if (!isset($prop["name"])) continue; | |
| 808 | - | |
| 809 | - $this->ktwebdavLog("Namespace is " . $prop["ns"], 'info', true); | |
| 810 | - | |
| 811 | - if (!isset($prop["val"]) || $prop["val"] === '' || $prop["val"] === false) { | |
| 812 | - // empty properties (cannot use empty() for check as "0" is a legal value here) | |
| 813 | - if($prop["ns"]=="DAV:") { | |
| 814 | - echo " <D:$prop[name]/>\n"; | |
| 815 | - } else if(!empty($prop["ns"])) { | |
| 816 | - echo " <".$ns_hash[$prop["ns"]].":$prop[name]/>\n"; | |
| 817 | - } else { | |
| 818 | - echo " <$prop[name] xmlns=\"\"/>"; | |
| 819 | - } | |
| 820 | - } else if ($prop["ns"] == "DAV:") { | |
| 821 | - $this->ktwebdavLog("Getting DAV: Properties...", 'info', true); | |
| 822 | - // some WebDAV properties need special treatment | |
| 823 | - switch ($prop["name"]) { | |
| 824 | - case "creationdate": | |
| 825 | - $this->ktwebdavLog("Getting creationdate...", 'info', true); | |
| 826 | - echo " <D:creationdate ns0:dt=\"dateTime.tz\">" | |
| 827 | - . gmdate("Y-m-d\\TH:i:s\\Z",$prop['val']) | |
| 828 | - . "</D:creationdate>\n"; | |
| 829 | - break; | |
| 830 | - case "getlastmodified": | |
| 831 | - $this->ktwebdavLog("Getting getlastmodified...", 'info', true); | |
| 832 | - echo " <D:getlastmodified ns0:dt=\"dateTime.rfc1123\">" | |
| 833 | - . gmdate("D, d M Y H:i:s ", $prop['val']) | |
| 834 | - . "GMT</D:getlastmodified>\n"; | |
| 835 | - break; | |
| 836 | - case "resourcetype": | |
| 837 | - $this->ktwebdavLog("Getting resourcetype...", 'info', true); | |
| 838 | - echo " <D:resourcetype><D:$prop[val]/></D:resourcetype>\n"; | |
| 839 | - break; | |
| 840 | - case "supportedlock": | |
| 841 | - $this->ktwebdavLog("Getting supportedlock...", 'info', true); | |
| 842 | - echo " <D:supportedlock>$prop[val]</D:supportedlock>\n"; | |
| 843 | - break; | |
| 844 | - case "lockdiscovery": | |
| 845 | - $this->ktwebdavLog("Getting lockdiscovery...", 'info', true); | |
| 846 | - echo " <D:lockdiscovery>\n"; | |
| 847 | - echo $prop["val"]; | |
| 848 | - echo " </D:lockdiscovery>\n"; | |
| 849 | - break; | |
| 850 | - default: | |
| 851 | - $this->ktwebdavLog("Getting default...", 'info', true); | |
| 852 | - $this->ktwebdavLog("name is: " . $prop['name'], 'info', true); | |
| 853 | - $this->ktwebdavLog("val is: " . $this->_prop_encode(htmlspecialchars($prop['val'])), 'info', true); | |
| 854 | - echo " <D:" . $prop['name'] .">" | |
| 855 | - . $this->_prop_encode(htmlspecialchars($prop['val'])) | |
| 856 | - . "</D:" . $prop['name'] . ">\n"; | |
| 857 | - break; | |
| 858 | - } | |
| 859 | - } else { | |
| 860 | - // properties from namespaces != "DAV:" or without any namespace | |
| 861 | - $this->ktwebdavLog('Getting != "DAV:" or without any namespace Properties...', 'info', true); | |
| 862 | - if ($prop["ns"]) { | |
| 863 | - echo " <" . $ns_hash[$prop["ns"]] . ":$prop[name]>" | |
| 864 | - . $this->_prop_encode(htmlspecialchars($prop['val'])) | |
| 865 | - . "</" . $ns_hash[$prop["ns"]] . ":$prop[name]>\n"; | |
| 866 | - } else { | |
| 867 | - echo " <$prop[name] xmlns=\"\">" | |
| 868 | - . $this->_prop_encode(htmlspecialchars($prop['val'])) | |
| 869 | - . "</$prop[name]>\n"; | |
| 870 | - } | |
| 871 | - } | |
| 872 | - } | |
| 873 | - | |
| 874 | - echo " </D:prop>\n"; | |
| 875 | - echo " <D:status>HTTP/1.1 200 OK</D:status>\n"; | |
| 876 | - echo " </D:propstat>\n"; | |
| 877 | - } | |
| 878 | - | |
| 879 | - // now report all properties requested but not found | |
| 880 | - $this->ktwebdavLog('Getting all properties requested but not found...', 'info', true); | |
| 881 | - if (isset($file["noprops"])) { | |
| 882 | - echo " <D:propstat>\n"; | |
| 883 | - echo " <D:prop>\n"; | |
| 884 | - | |
| 885 | - foreach($file["noprops"] as $key => $prop) { | |
| 886 | - if ($prop["ns"] == "DAV:") { | |
| 887 | - echo " <D:$prop[name]/>\n"; | |
| 888 | - } else if ($prop["ns"] == '') { | |
| 889 | - echo " <$prop[name] xmlns=\"\"/>\n"; | |
| 890 | - } else { | |
| 891 | - echo " <" . $ns_hash[$prop["ns"]] . ":$prop[name]/>\n"; | |
| 892 | - } | |
| 893 | - } | |
| 894 | - | |
| 895 | - echo " </D:prop>\n"; | |
| 896 | - echo " <D:status>HTTP/1.1 404 Not Found</D:status>\n"; | |
| 897 | - echo " </D:propstat>\n"; | |
| 898 | - } | |
| 899 | - | |
| 900 | - echo " </D:response>\n"; | |
| 901 | - } | |
| 902 | - | |
| 903 | - echo "</D:multistatus>\n"; | |
| 904 | - } | |
| 905 | - | |
| 906 | - /** | |
| 907 | - * PROPFIND helper for Folder Info | |
| 908 | - * | |
| 909 | - * @param int Folder ID | |
| 910 | - * @param string path | |
| 911 | - * @return array Folder info array | |
| 912 | - */ | |
| 913 | - function _fileinfoForFolderID($iFolderID, $path) { | |
| 914 | - | |
| 915 | - global $default; | |
| 916 | - | |
| 917 | - $this->ktwebdavLog("Entering _fileinfoForFolderID. FolderID is " . $iFolderID, 'info', true); | |
| 918 | - | |
| 919 | - if($iFolderID == '') return false; | |
| 920 | - | |
| 921 | - $oFolder =& Folder::get($iFolderID); | |
| 922 | - | |
| 923 | - if (is_null($oFolder) || ($oFolder === false)) { | |
| 924 | - $this->ktwebdavLog("oFolderID error. ", 'info', true); | |
| 925 | - return false; | |
| 926 | - } | |
| 927 | - | |
| 928 | - return $this->_fileinfoForFolder($oFolder, $path); | |
| 929 | - } | |
| 930 | - | |
| 931 | - /** | |
| 932 | - * GET method handler | |
| 933 | - * | |
| 934 | - * @param array parameter passing array | |
| 935 | - * @return bool true on success | |
| 936 | - */ | |
| 937 | - function GET(&$options) | |
| 938 | - { | |
| 939 | - // required for KT | |
| 940 | - global $default; | |
| 941 | - | |
| 942 | - $this->ktwebdavLog("Entering GET. options are " . print_r($options, true), 'info', true); | |
| 943 | - | |
| 944 | - // Get the client info | |
| 945 | - $this->checkSafeMode(); | |
| 946 | - | |
| 947 | - // get path to requested resource | |
| 948 | - $path = $options["path"]; | |
| 949 | - | |
| 950 | - list($iFolderID, $iDocumentID) = $this->_folderOrDocument($path); | |
| 951 | - | |
| 952 | - if ($iDocumentID === false) { | |
| 953 | - $this->ktwebdavLog("Document not found.", 'info', true); | |
| 954 | - return "404 Not found - Document not found."; | |
| 955 | - } | |
| 956 | - | |
| 957 | - if (is_null($iDocumentID)) { | |
| 958 | - return $this->_GETFolder($options, $iFolderID); | |
| 959 | - } | |
| 960 | - return $this->_GETDocument($options, $iDocumentID); | |
| 961 | - | |
| 962 | - } | |
| 963 | - | |
| 964 | - /** | |
| 965 | - * GET method helper | |
| 966 | - * | |
| 967 | - * @param array parameter passing array | |
| 968 | - * @param int MainFolder ID | |
| 969 | - * @return bool true on success | |
| 970 | - */ | |
| 971 | - function _GETFolder(&$options, $iMainFolderID) { | |
| 972 | - | |
| 973 | - global $default; | |
| 974 | - | |
| 975 | - $this->ktwebdavLog("Entering _GETFolder. options are " . print_r($options, true), 'info', true); | |
| 976 | - | |
| 977 | - $oMainFolder =& Folder::get($iMainFolderID); | |
| 978 | - $aFolderID = array(); | |
| 979 | - $aChildren = Folder::getList(array('parent_id = ?', $iMainFolderID)); | |
| 980 | - // $sFolderName = $oMainFolder->getName(); | |
| 981 | - | |
| 982 | - if (is_writeable("../var") && is_writeable("../var/log")) { | |
| 983 | - $writeperms = "<font color=\"green\"><b>OK</b></font>"; | |
| 984 | - }else { | |
| 985 | - $writeperms = "<font color=\"red\"><b>NOT SET</b></font>"; | |
| 986 | - } | |
| 987 | - | |
| 988 | - if ($this->ktdmsPath != '') { | |
| 989 | - $ktdir = $this->ktdmsPath; | |
| 990 | - } | |
| 991 | - | |
| 992 | - $srv_proto = split('/', $_SERVER['SERVER_PROTOCOL']); | |
| 993 | - | |
| 994 | - $data = "<html><head><title>KTWebDAV - The KnowledgeTree WebDAV Server</title></head>"; | |
| 995 | - $data .= "<body>"; | |
| 996 | - $data .= "<div align=\"center\"><IMG src=\"../resources/graphics/ktlogo-topbar_base.png\" width=\"308\" height=\"61\" border=\"0\"></div><br>"; | |
| 997 | - $data .= "<div align=\"center\"><h2><strong>Welcome to KnowledgeTree WebDAV Server</strong></h2></div><br><br>"; | |
| 998 | - $data .= "<div align=\"center\">To access KTWebDAV copy the following URL and paste it into your WebDAV enabled client...</div><br><br>"; | |
| 999 | - $data .= "<div align=\"center\"><strong>" . strtolower($srv_proto[0]) . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "</strong></div>"; | |
| 1000 | - $data .= "</body>"; | |
| 1001 | - | |
| 1002 | - $options['mimetype'] = 'text/html'; | |
| 1003 | - $options["data"] = $data; | |
| 1004 | - return true; | |
| 1005 | - } | |
| 1006 | - | |
| 1007 | - /** | |
| 1008 | - * GET method helper | |
| 1009 | - * | |
| 1010 | - * @param array parameter passing array | |
| 1011 | - * @param int Document ID | |
| 1012 | - * @return bool true on success | |
| 1013 | - */ | |
| 1014 | - function _GETDocument(&$options, $iDocumentID) { | |
| 1015 | - global $default; | |
| 1016 | - | |
| 1017 | - $oDocument =& Document::get($iDocumentID); | |
| 1018 | - | |
| 1019 | - // get a temp file, and read. NOTE: NEVER WRITE TO THIS | |
| 1020 | - $oStorage =& KTStorageManagerUtil::getSingleton(); | |
| 1021 | - $fspath = $oStorage->temporaryFile($oDocument); | |
| 1022 | - | |
| 1023 | - $this->ktwebdavLog("Filesystem Path is " . $fspath, 'info', true ); | |
| 1024 | - | |
| 1025 | - // detect resource type | |
| 1026 | - $mimetype = KTMime::getMimeTypeName($oDocument->getMimeTypeID()); | |
| 1027 | - $options['mimetype'] = KTMime::getFriendlyNameForString($mimetype); | |
| 1028 | - // detect modification time | |
| 1029 | - // see rfc2518, section 13.7 | |
| 1030 | - // some clients seem to treat this as a reverse rule | |
| 1031 | - // requiering a Last-Modified header if the getlastmodified header was set | |
| 1032 | - | |
| 1033 | - $options['mtime'] = $oDocument->getVersionCreated(); | |
| 1034 | - | |
| 1035 | - // detect resource size | |
| 1036 | - $options['size'] = $oDocument->getFileSize(); | |
| 1037 | - | |
| 1038 | - // no need to check result here, it is handled by the base class | |
| 1039 | - $options['stream'] = fopen($fspath, "r"); | |
| 1040 | - | |
| 1041 | - $this->ktwebdavLog("Method is " . $this->currentMethod, 'info', true ); | |
| 1042 | - | |
| 1043 | - if ($this->currentMethod == "get") { | |
| 1044 | - | |
| 1045 | - // create the document transaction record | |
| 1046 | - include_once(KT_LIB_DIR . '/documentmanagement/DocumentTransaction.inc'); | |
| 1047 | - $oDocumentTransaction = & new DocumentTransaction($oDocument, "Document viewed via KTWebDAV", 'ktcore.transactions.view'); | |
| 1048 | - $oDocumentTransaction->iUserID = $this->userID; | |
| 1049 | - $oDocumentTransaction->create(); | |
| 1050 | - | |
| 1051 | - } | |
| 1052 | - return true; | |
| 1053 | - } | |
| 1054 | - | |
| 1055 | - /** | |
| 1056 | - * GET method helper | |
| 1057 | - * | |
| 1058 | - * @param string directory path | |
| 1059 | - * @return array or false | |
| 1060 | - */ | |
| 1061 | - function _folderOrDocument($path) { | |
| 1062 | - | |
| 1063 | - global $default; | |
| 1064 | - | |
| 1065 | - $this->ktwebdavLog("Entering _folderOrDocument. path is " . $path, 'info', true); | |
| 1066 | - | |
| 1067 | - if ( !(strstr($path,"__BAOBABCLIENT__") === false) ) { | |
| 1068 | - return array(0, 1); | |
| 1069 | - } | |
| 1070 | - | |
| 1071 | - $sFileName = basename($path); | |
| 1072 | - // for windows replace backslash with forwardslash | |
| 1073 | - $sFolderPath = str_replace("\\", '/', dirname($path) ); | |
| 1074 | - | |
| 1075 | - if ($sFolderPath == "/" || $sFolderPath == "/ktwebdav") { | |
| 1076 | - $this->ktwebdavLog("This is the root folder.", 'info', true); | |
| 1077 | - $sFolderPath = $this->rootFolder; | |
| 1078 | - $iFolderID = 0; | |
| 1079 | - } else $iFolderID = 1; | |
| 1080 | - if ($sFileName == "ktwebdav.php") { | |
| 1081 | - $this->ktwebdavLog("This is the root folder file.", 'info', true); | |
| 1082 | - $sFileName = ''; | |
| 1083 | - } | |
| 1084 | - | |
| 1085 | - $this->ktwebdavLog("sFileName is " . $sFileName, 'info', true); | |
| 1086 | - $this->ktwebdavLog("sFolderName is " . $sFolderPath, 'info', true); | |
| 1087 | - $this->ktwebdavLog("iFolderID is " . $iFolderID, 'info', true); | |
| 1088 | - | |
| 1089 | - $aFolderNames = split('/', $sFolderPath); | |
| 1090 | - | |
| 1091 | - $this->ktwebdavLog("aFolderNames are: " . print_r($aFolderNames, true), 'info', true); | |
| 1092 | - $aRemaining = $aFolderNames; | |
| 1093 | - while (count($aRemaining)) { | |
| 1094 | - $sFolderName = $aRemaining[0]; | |
| 1095 | - $aRemaining = array_slice($aRemaining, 1); | |
| 1096 | - if ($sFolderName == '') { | |
| 1097 | - continue; | |
| 1098 | - } | |
| 1099 | - // FIXME: Direct database access | |
| 1100 | - $sQuery = "SELECT id FROM folders WHERE parent_id = ? AND name = ?"; | |
| 1101 | - $aParams = array($iFolderID, $sFolderName); | |
| 1102 | - $id = DBUtil::getOneResultKey(array($sQuery, $aParams), 'id'); | |
| 1103 | - if (PEAR::isError($id)) { | |
| 1104 | - $this->ktwebdavLog("A DB error occurred in _folderOrDocument", 'info', true); | |
| 1105 | - return false; | |
| 1106 | - } | |
| 1107 | - if (is_null($id)) { | |
| 1108 | - // Some intermediary folder path doesn't exist | |
| 1109 | - $this->ktwebdavLog("Some intermediary folder does not exist in _folderOrDocument", 'error', true); | |
| 1110 | - return array(false, false); | |
| 1111 | - } | |
| 1112 | - $iFolderID = (int)$id; | |
| 1113 | - $this->ktwebdavLog("iFolderID set to " . $iFolderID, 'info', true); | |
| 1114 | - } | |
| 1115 | - | |
| 1116 | - // FIXME: Direct database access | |
| 1117 | - // $sQuery = "SELECT id FROM documents WHERE folder_id = ? AND filename = ? AND status_id = 1"; | |
| 1118 | - $sQuery = "SELECT D.id "; | |
| 1119 | - $sQuery .= "FROM documents AS D "; | |
| 1120 | - $sQuery .= "LEFT JOIN document_metadata_version AS DM "; | |
| 1121 | - $sQuery .= "ON D.metadata_version_id = DM.id "; | |
| 1122 | - $sQuery .= "LEFT JOIN document_content_version AS DC "; | |
| 1123 | - $sQuery .= "ON DM.content_version_id = DC.id "; | |
| 1124 | - $sQuery .= "WHERE D.folder_id = ? AND DC.filename = ?"; | |
| 1125 | - | |
| 1126 | - $aParams = array($iFolderID, $sFileName); | |
| 1127 | - $iDocumentID = DBUtil::getOneResultKey(array($sQuery, $aParams), 'id'); | |
| 1128 | - | |
| 1129 | - if (PEAR::isError($iDocumentID)) { | |
| 1130 | - $this->ktwebdavLog("iDocumentID error in _folderOrDocument", 'info', true); | |
| 1131 | - return false; | |
| 1132 | - } | |
| 1133 | - | |
| 1134 | - if ($iDocumentID === null) { | |
| 1135 | - $this->ktwebdavLog("iDocumentID is null", 'info', true); | |
| 1136 | - // FIXME: Direct database access | |
| 1137 | - $sQuery = "SELECT id FROM folders WHERE parent_id = ? AND name = ?"; | |
| 1138 | - $aParams = array($iFolderID, $sFileName); | |
| 1139 | - $id = DBUtil::getOneResultKey(array($sQuery, $aParams), 'id'); | |
| 1140 | - if (PEAR::isError($id)) { | |
| 1141 | - $this->ktwebdavLog("A DB(2) error occurred in _folderOrDocument", 'info', true); | |
| 1142 | - return false; | |
| 1143 | - } | |
| 1144 | - if (is_null($id)) { | |
| 1145 | - if ($sFileName == '') { | |
| 1146 | - return array($iFolderID, null); | |
| 1147 | - } | |
| 1148 | - $this->ktwebdavLog("id is null in _folderOrDocument", 'info', true); | |
| 1149 | - return array($iFolderID, false); | |
| 1150 | - } | |
| 1151 | - if (substr($path, -1) !== "/") { | |
| 1152 | - $this->ktwebdavLog("Setting Location Header to " . "Location: " . $_SERVER["PHP_SELF"] . "/", 'info', true); | |
| 1153 | - header("Location: " . $_SERVER["PHP_SELF"] . "/"); | |
| 1154 | - } | |
| 1155 | - return array($id, null); | |
| 1156 | - } | |
| 1157 | - | |
| 1158 | - return array($iFolderID, (int)$iDocumentID); | |
| 1159 | - } | |
| 1160 | - | |
| 1161 | - /** | |
| 1162 | - * PUT method handler | |
| 1163 | - * | |
| 1164 | - * @param array parameter passing array | |
| 1165 | - * @return string HTTP status code or false | |
| 1166 | - */ | |
| 1167 | - function PUT(&$options) | |
| 1168 | - { | |
| 1169 | - global $default; | |
| 1170 | - | |
| 1171 | - if ($this->checkSafeMode()) { | |
| 1172 | - | |
| 1173 | - $this->ktwebdavLog("Entering PUT. options are " . print_r($options, true), 'info', true); | |
| 1174 | - $this->ktwebdavLog("dav_client is: " . $this->dav_client, 'info', true); | |
| 1175 | - | |
| 1176 | - $path = $options["path"]; | |
| 1177 | - | |
| 1178 | - $res = $this->_folderOrDocument($path); | |
| 1179 | - list($iFolderID, $iDocumentID) = $res; | |
| 1180 | - | |
| 1181 | - if ($iDocumentID === false && $iFolderID === false) { | |
| 1182 | - // Couldn't find intermediary paths | |
| 1183 | - /* | |
| 1184 | - * RFC2518: 8.7.1 PUT for Non-Collection Resources | |
| 1185 | - * | |
| 1186 | - * 409 (Conflict) - A PUT that would result in the creation | |
| 1187 | - * of a resource without an appropriately scoped parent collection | |
| 1188 | - * MUST fail with a 409 (Conflict). | |
| 1189 | - */ | |
| 1190 | - return "409 Conflict - Couldn't find intermediary paths"; | |
| 1191 | - } | |
| 1192 | - | |
| 1193 | - $oParentFolder =& Folder::get($iFolderID); | |
| 1194 | - // Check if the user has permissions to write in this folder | |
| 1195 | - $oPerm =& KTPermission::getByName('ktcore.permissions.write'); | |
| 1196 | - $oUser =& User::get($this->userID); | |
| 1197 | - if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oParentFolder)) { | |
| 1198 | - return "403 Forbidden - User does not have sufficient permissions"; | |
| 1199 | - } | |
| 1200 | - | |
| 1201 | - $this->ktwebdavLog("iDocumentID is " . $iDocumentID, 'info', true); | |
| 1202 | - | |
| 1203 | - if (is_null($iDocumentID)) { | |
| 1204 | - // This means there is a folder with the given path | |
| 1205 | - $this->ktwebdavLog("405 Method not allowed", 'info', true); | |
| 1206 | - return "405 Method not allowed - There is a folder with the given path"; | |
| 1207 | - } | |
| 1208 | - | |
| 1209 | - if ($iDocumentID == false) { | |
| 1210 | - $this->ktwebdavLog("iDocumentID is false", 'info', true); | |
| 1211 | - } | |
| 1212 | - | |
| 1213 | - if ($iDocumentID !== false) { | |
| 1214 | - // This means there is a document with the given path | |
| 1215 | - $oDocument = Document::get($iDocumentID); | |
| 1216 | - | |
| 1217 | - $this->ktwebdavLog("oDocument is " . print_r($oDocument, true), 'info', true); | |
| 1218 | - $this->ktwebdavLog("oDocument statusid is " . print_r($oDocument->getStatusID(), true), 'info', true); | |
| 1219 | - | |
| 1220 | - if ( ( (int)$oDocument->getStatusID() != STATUS_WEBDAV ) && ( (int)$oDocument->getStatusID() != DELETED )) { | |
| 1221 | - $this->ktwebdavLog("Trying to PUT to an existing document", 'info', true); | |
| 1222 | - if (!$this->dav_client == "MS" && !$this->dav_client == "MC") return "409 Conflict - There is a document with the given path"; | |
| 1223 | - } | |
| 1224 | - | |
| 1225 | - // FIXME: Direct filesystem access | |
| 1226 | - $fh = $options["stream"]; | |
| 1227 | - $sTempFilename = tempnam('/tmp', 'ktwebdav_dav_put'); | |
| 1228 | - $ofh = fopen($sTempFilename, 'w'); | |
| 1229 | - | |
| 1230 | - $contents = ''; | |
| 1231 | - while (!feof($fh)) { | |
| 1232 | - $contents .= fread($fh, 8192); | |
| 1233 | - } | |
| 1234 | - $fres = fwrite($ofh, $contents); | |
| 1235 | - $this->ktwebdavLog("A DELETED or CHECKEDOUT document exists. Overwriting...", 'info', true); | |
| 1236 | - $this->ktwebdavLog("Temp Filename is: " . $sTempFilename, 'info', true ); | |
| 1237 | - $this->ktwebdavLog("File write result size was: " . $fres, 'info', true ); | |
| 1238 | - | |
| 1239 | - fflush($fh); | |
| 1240 | - fclose($fh); | |
| 1241 | - fflush($ofh); | |
| 1242 | - fclose($ofh); | |
| 1243 | - $this->ktwebdavLog("Files have been flushed and closed.", 'info', true ); | |
| 1244 | - | |
| 1245 | - $name = basename($path); | |
| 1246 | - $aFileArray = array( | |
| 1247 | - "name" => $name, | |
| 1248 | - "size" => filesize($sTempFilename), | |
| 1249 | - "type" => false, | |
| 1250 | - "userID" => $this->_getUserID(), | |
| 1251 | - ); | |
| 1252 | - $this->ktwebdavLog("aFileArray is " . print_r($aFileArray, true), 'info', true); | |
| 1253 | - | |
| 1254 | - include_once(KT_LIB_DIR . '/filelike/fsfilelike.inc.php'); | |
| 1255 | - $aOptions = array( | |
| 1256 | - 'contents' => new KTFSFileLike($sTempFilename), | |
| 1257 | - 'metadata' => array(), | |
| 1258 | - 'novalidate' => true, | |
| 1259 | - ); | |
| 1260 | - $oDocument =& KTDocumentUtil::add($oParentFolder, $name, $oUser, $aOptions); | |
| 1261 | - | |
| 1262 | - if(PEAR::isError($oDocument)) { | |
| 1263 | - $this->ktwebdavLog("oDocument ERROR: " . $oDocument->getMessage(), 'info', true); | |
| 1264 | - unlink($sTempFilename); | |
| 1265 | - return "409 Conflict - " . $oDocument->getMessage(); | |
| 1266 | - } | |
| 1267 | - | |
| 1268 | - $this->ktwebdavLog("oDocument is " . print_r($oDocument, true), 'info', true); | |
| 1269 | - | |
| 1270 | - unlink($sTempFilename); | |
| 1271 | - return "204 No Content"; | |
| 1272 | - } | |
| 1273 | - | |
| 1274 | - $options["new"] = true; | |
| 1275 | - // FIXME: Direct filesystem access | |
| 1276 | - $fh = $options["stream"]; | |
| 1277 | - $sTempFilename = tempnam('/tmp', 'ktwebdav_dav_put'); | |
| 1278 | - $ofh = fopen($sTempFilename, 'w'); | |
| 1279 | - | |
| 1280 | - $contents = ''; | |
| 1281 | - while (!feof($fh)) { | |
| 1282 | - $contents .= fread($fh, 8192); | |
| 1283 | - } | |
| 1284 | - $fres = fwrite( $ofh, $contents); | |
| 1285 | - $this->ktwebdavLog("Content length was not 0, doing the whole thing.", 'info', true ); | |
| 1286 | - $this->ktwebdavLog("Temp Filename is: " . $sTempFilename, 'info', true ); | |
| 1287 | - $this->ktwebdavLog("File write result size was: " . $fres, 'info', true ); | |
| 1288 | - | |
| 1289 | - fflush($fh); | |
| 1290 | - fclose($fh); | |
| 1291 | - fflush($ofh); | |
| 1292 | - fclose($ofh); | |
| 1293 | - $this->ktwebdavLog("Files have been flushed and closed.", 'info', true ); | |
| 1294 | - | |
| 1295 | - $name = basename($path); | |
| 1296 | - $aFileArray = array( | |
| 1297 | - "name" => $name, | |
| 1298 | - "size" => filesize($sTempFilename), | |
| 1299 | - "type" => false, | |
| 1300 | - "userID" => $this->_getUserID(), | |
| 1301 | - ); | |
| 1302 | - $this->ktwebdavLog("aFileArray is " . print_r($aFileArray, true), 'info', true); | |
| 1303 | - | |
| 1304 | - include_once(KT_LIB_DIR . '/filelike/fsfilelike.inc.php'); | |
| 1305 | - $aOptions = array( | |
| 1306 | - 'contents' => new KTFSFileLike($sTempFilename), | |
| 1307 | - 'metadata' => array(), | |
| 1308 | - 'novalidate' => true, | |
| 1309 | - ); | |
| 1310 | - $oDocument =& KTDocumentUtil::add($oParentFolder, $name, $oUser, $aOptions); | |
| 1311 | - | |
| 1312 | - if(PEAR::isError($oDocument)) { | |
| 1313 | - $this->ktwebdavLog("oDocument ERROR: " . $oDocument->getMessage(), 'info', true); | |
| 1314 | - unlink($sTempFilename); | |
| 1315 | - return "409 Conflict - " . $oDocument->getMessage(); | |
| 1316 | - } | |
| 1317 | - | |
| 1318 | - $this->ktwebdavLog("oDocument is " . print_r($oDocument, true), 'info', true); | |
| 1319 | - | |
| 1320 | - unlink($sTempFilename); | |
| 1321 | - return "201 Created"; | |
| 1322 | - | |
| 1323 | - } else return "423 Locked - KTWebDAV is in SafeMode"; | |
| 1324 | - | |
| 1325 | - } | |
| 1326 | - | |
| 1327 | - /** | |
| 1328 | - * MKCOL method handler | |
| 1329 | - * | |
| 1330 | - * @param array parameter passing array | |
| 1331 | - * @return string HTTP status code or false | |
| 1332 | - */ | |
| 1333 | - function MKCOL($options) | |
| 1334 | - { | |
| 1335 | - $this->ktwebdavLog("Entering MKCOL. options are " . print_r($options, true), 'info', true); | |
| 1336 | - | |
| 1337 | - if ($this->checkSafeMode()) { | |
| 1338 | - | |
| 1339 | - global $default; | |
| 1340 | - | |
| 1341 | - if (!empty($_SERVER["CONTENT_LENGTH"])) { | |
| 1342 | - /* | |
| 1343 | - * RFC2518: 8.3.2 MKCOL status codes | |
| 1344 | - * | |
| 1345 | - * 415 (Unsupported Media Type)- The server does not support | |
| 1346 | - * the request type of the body. | |
| 1347 | - */ | |
| 1348 | - return "415 Unsupported media type"; | |
| 1349 | - } | |
| 1350 | - | |
| 1351 | - // Take Windows's escapes out | |
| 1352 | - $path = str_replace('\\', '' , $options['path']); | |
| 1353 | - | |
| 1354 | - | |
| 1355 | - $res = $this->_folderOrDocument($path); | |
| 1356 | - list($iFolderID, $iDocumentID) = $res; | |
| 1357 | - | |
| 1358 | - if ($iDocumentID === false && $iFolderID === false) { | |
| 1359 | - // Couldn't find intermediary paths | |
| 1360 | - /* | |
| 1361 | - * RFC2518: 8.3.2 MKCOL status codes | |
| 1362 | - * | |
| 1363 | - * 409 (Conflict) - A collection cannot be made at the | |
| 1364 | - * Request-URI until one or more intermediate collections | |
| 1365 | - * have been created. | |
| 1366 | - */ | |
| 1367 | - $this->ktwebdavLog("409 Conflict in MKCOL", 'info', true); | |
| 1368 | - return "409 Conflict - Couldn't find intermediary paths"; | |
| 1369 | - } | |
| 1370 | - | |
| 1371 | - | |
| 1372 | - if (is_null($iDocumentID)) { | |
| 1373 | - // This means there is a folder with the given path | |
| 1374 | - /* | |
| 1375 | - * RFC2518: 8.3.2 MKCOL status codes | |
| 1376 | - * | |
| 1377 | - * 405 (Method Not Allowed) - MKCOL can only be executed on | |
| 1378 | - * a deleted/non-existent resource. | |
| 1379 | - */ | |
| 1380 | - $this->ktwebdavLog("405 Method not allowed - There is a folder with the given path", 'info', true); | |
| 1381 | - return "405 Method not allowed - There is a folder with the given path"; | |
| 1382 | - } | |
| 1383 | - if ($iDocumentID !== false) { | |
| 1384 | - // This means there is a document with the given path | |
| 1385 | - /* | |
| 1386 | - * RFC2518: 8.3.2 MKCOL status codes | |
| 1387 | - * | |
| 1388 | - * 405 (Method Not Allowed) - MKCOL can only be executed on | |
| 1389 | - * a deleted/non-existent resource. | |
| 1390 | - */ | |
| 1391 | - $this->ktwebdavLog("405 Method not allowed - There is a document with the given path", 'info', true); | |
| 1392 | - return "405 Method not allowed - There is a document with the given path"; | |
| 1393 | - } | |
| 1394 | - | |
| 1395 | - $sFolderName = basename($path); | |
| 1396 | - $sFolderPath = dirname($path); | |
| 1397 | - | |
| 1398 | - $dest_fspath = $default->documentRoot . "/" . $this->rootFolder . $path; | |
| 1399 | - $this->ktwebdavLog("Will create a physical path of " . $dest_fspath, 'info', true); | |
| 1400 | - | |
| 1401 | - $oParentFolder =& Folder::get($iFolderID); | |
| 1402 | - $this->ktwebdavLog("Got an oParentFolder of " . print_r($oParentFolder, true), 'info', true); | |
| 1403 | - | |
| 1404 | - // Check if the user has permissions to write in this folder | |
| 1405 | - $oPerm =& KTPermission::getByName('ktcore.permissions.addFolder'); | |
| 1406 | - $oUser =& User::get($this->userID); | |
| 1407 | - | |
| 1408 | - $this->ktwebdavLog("oPerm is " . print_r($oPerm, true), 'info', true); | |
| 1409 | - $this->ktwebdavLog("oUser is " . print_r($oUser, true), 'info', true); | |
| 1410 | - $this->ktwebdavLog("oFolder is " . print_r($oParentFolder, true), 'info', true); | |
| 1411 | - | |
| 1412 | - if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oParentFolder)) { | |
| 1413 | - $this->ktwebdavLog("Permission denied.", 'info', true); | |
| 1414 | - return "403 Forbidden - User does not have sufficient permissions"; | |
| 1415 | - } else $this->ktwebdavLog("Permission granted.", 'info', true); | |
| 1416 | - | |
| 1417 | - | |
| 1418 | - include_once(KT_LIB_DIR . '/foldermanagement/folderutil.inc.php'); | |
| 1419 | - | |
| 1420 | - KTFolderUtil::add($oParentFolder, $sFolderName, $oUser); | |
| 1421 | - /* | |
| 1422 | - * RFC 2518: 8.3.2 MKCOL status codes | |
| 1423 | - * | |
| 1424 | - * 201 (Created) - The collection or structured resource was | |
| 1425 | - * created in its entirety. | |
| 1426 | - */ | |
| 1427 | - $this->ktwebdavLog("201 Created", 'info', true); | |
| 1428 | - return "201 Created"; | |
| 1429 | - | |
| 1430 | - } else return "423 Locked - KTWebDAV is in SafeMode"; | |
| 1431 | - } | |
| 1432 | - | |
| 1433 | - | |
| 1434 | - /** | |
| 1435 | - * DELETE method handler | |
| 1436 | - * | |
| 1437 | - * @param array parameter passing array | |
| 1438 | - * @return string HTTP status code or false | |
| 1439 | - */ | |
| 1440 | - function DELETE($options) | |
| 1441 | - { | |
| 1442 | - $this->ktwebdavLog("Entering DELETE. options are " . print_r($options, true), 'info', true); | |
| 1443 | - | |
| 1444 | - if ($this->checkSafeMode()) { | |
| 1445 | - | |
| 1446 | - $path = $options["path"]; | |
| 1447 | - $res = $this->_folderOrDocument($path); | |
| 1448 | - $this->ktwebdavLog("DELETE res is " . print_r($res, true), 'info', true); | |
| 1449 | - if ($res === false) { | |
| 1450 | - $this->ktwebdavLog("404 Not found - The Document was not found.", 'info', true); | |
| 1451 | - return "404 Not found - The Document was not found."; | |
| 1452 | - } | |
| 1453 | - list($iFolderID, $iDocumentID) = $res; | |
| 1454 | - | |
| 1455 | - if ($iDocumentID === false) { | |
| 1456 | - $this->ktwebdavLog("404 Not found - The Folder was not found.", 'info', true); | |
| 1457 | - return "404 Not found - The Folder was not found."; | |
| 1458 | - } | |
| 1459 | - | |
| 1460 | - if (is_null($iDocumentID)) { | |
| 1461 | - return $this->_DELETEFolder($options, $iFolderID); | |
| 1462 | - } | |
| 1463 | - return $this->_DELETEDocument($options, $iFolderID, $iDocumentID); | |
| 1464 | - | |
| 1465 | - } else return "423 Locked - KTWebDAV is in SafeMode"; | |
| 1466 | - } | |
| 1467 | - | |
| 1468 | - /** | |
| 1469 | - * DELETE method helper for Documents | |
| 1470 | - * | |
| 1471 | - * @param array parameter passing array | |
| 1472 | - * @param int Folder ID | |
| 1473 | - * @param int Document ID | |
| 1474 | - * @return string HTTP status code or false | |
| 1475 | - */ | |
| 1476 | - function _DELETEDocument($options, $iFolderID, $iDocumentID) { | |
| 1477 | - | |
| 1478 | - $this->ktwebdavLog("Entering _DELETEDocument. options are " . print_r($options, true), 'info', true); | |
| 1479 | - | |
| 1480 | - global $default; | |
| 1481 | - | |
| 1482 | - $oDocument =& Document::get($iDocumentID); | |
| 1483 | - | |
| 1484 | - // Check if the user has permissions to delete this document | |
| 1485 | - $oPerm =& KTPermission::getByName('ktcore.permissions.delete'); | |
| 1486 | - $oUser =& User::get($this->userID); | |
| 1487 | - if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oDocument)) { | |
| 1488 | - return "403 Forbidden - The user does not have sufficient permissions"; | |
| 1489 | - } | |
| 1490 | - | |
| 1491 | - $res = KTDocumentUtil::delete($oDocument, $_SERVER['HTTP_REASON']); | |
| 1492 | - | |
| 1493 | - if (PEAR::isError($res)) { | |
| 1494 | - $this->ktwebdavLog("404 Not Found - " . $res->getMessage(), 'info', true); | |
| 1495 | - return "404 Not Found - " . $res->getMessage(); | |
| 1496 | - } | |
| 1497 | - | |
| 1498 | - $this->ktwebdavLog("204 No Content", 'info', true); | |
| 1499 | - return "204 No Content"; | |
| 1500 | - } | |
| 1501 | - | |
| 1502 | - /** | |
| 1503 | - * DELETE method helper for Folders | |
| 1504 | - * | |
| 1505 | - * @param array paramter passing array | |
| 1506 | - * @param int Folder ID | |
| 1507 | - * @return string HTTP status code or false | |
| 1508 | - */ | |
| 1509 | - function _DELETEFolder($options, $iFolderID) { | |
| 1510 | - | |
| 1511 | - $this->ktwebdavLog("Entering _DELETEFolder. options are " . print_r($options, true), 'info', true); | |
| 1512 | - | |
| 1513 | - global $default; | |
| 1514 | - | |
| 1515 | - require_once(KT_LIB_DIR . "/foldermanagement/folderutil.inc.php"); | |
| 1516 | - | |
| 1517 | - // Check if the user has permissions to delete this folder | |
| 1518 | - $oFolder =& Folder::get($iFolderID); | |
| 1519 | - $oPerm =& KTPermission::getByName('ktcore.permissions.delete'); | |
| 1520 | - $oUser =& User::get($this->userID); | |
| 1521 | - if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oFolder)) { | |
| 1522 | - return "403 Forbidden - The user does not have sufficient permissions"; | |
| 1523 | - } | |
| 1524 | - $this->ktwebdavLog("Got an oFolder of " . print_r($oFolder, true), 'info', true); | |
| 1525 | - $this->ktwebdavLog("Got an oUser of " . print_r($oUser, true), 'info', true); | |
| 1526 | - $res = KTFolderUtil::delete($oFolder, $oUser, 'KTWebDAV Delete'); | |
| 1527 | - | |
| 1528 | - if (PEAR::isError($res)) { | |
| 1529 | - $this->ktwebdavLog("Delete Result error " . print_r($res, true), 'info', true); | |
| 1530 | - return "403 Forbidden - ".$res->getMessage(); | |
| 1531 | - } | |
| 1532 | - | |
| 1533 | - return "204 No Content"; | |
| 1534 | - } | |
| 1535 | - | |
| 1536 | - /** | |
| 1537 | - * MOVE method handler | |
| 1538 | - * | |
| 1539 | - * @param array parameter passing array | |
| 1540 | - * @return string HTTP status code or false | |
| 1541 | - */ | |
| 1542 | - function MOVE($options) | |
| 1543 | - { | |
| 1544 | - // Use the WebDAV standards way. | |
| 1545 | - // See rfc2518 Section 8.9 | |
| 1546 | - // This does a copy with delete | |
| 1547 | - // FIXME: This way does not retain document history and other info | |
| 1548 | - | |
| 1549 | - //return $this->COPY($options, true); | |
| 1550 | - | |
| 1551 | - // Use the KT way. | |
| 1552 | - // FIXME: This way does not allow overwrite | |
| 1553 | - | |
| 1554 | - $this->ktwebdavLog("Entering MOVE. options are " . print_r($options, true), 'info', true); | |
| 1555 | - | |
| 1556 | - if ($this->checkSafeMode()) { | |
| 1557 | - | |
| 1558 | - if (!empty($_SERVER["CONTENT_LENGTH"])) { // no body parsing yet | |
| 1559 | - $this->ktwebdavLog("415 Unsupported media type", 'info', true); | |
| 1560 | - return "415 Unsupported media type"; | |
| 1561 | - } | |
| 1562 | - | |
| 1563 | - /* // no moving to different WebDAV Servers yet | |
| 1564 | - if (isset($options["dest_url"])) { | |
| 1565 | - $this->ktwebdavLog("502 bad gateway - No moving to different WebDAV Servers yet", 'info', true); | |
| 1566 | - return "502 bad gateway - No moving to different WebDAV Servers yet"; | |
| 1567 | - } | |
| 1568 | - */ | |
| 1569 | - $source_path = $options["path"]; | |
| 1570 | - $source_res = $this->_folderOrDocument($source_path); | |
| 1571 | - if ($source_res === false) { | |
| 1572 | - $this->ktwebdavLog("404 Not found - Document was not found.", 'info', true); | |
| 1573 | - return "404 Not found - Document was not found."; | |
| 1574 | - } | |
| 1575 | - | |
| 1576 | - list($iFolderID, $iDocumentID) = $source_res; | |
| 1577 | - if ($iDocumentID === false) { | |
| 1578 | - $this->ktwebdavLog("404 Not found - Folder was not found.", 'info', true); | |
| 1579 | - return "404 Not found - Folder was not found."; | |
| 1580 | - } | |
| 1581 | - | |
| 1582 | - if (is_null($iDocumentID)) { | |
| 1583 | - // Source is a folder | |
| 1584 | - $movestat = $this->_MOVEFolder($options, $iFolderID); | |
| 1585 | - | |
| 1586 | - } else { | |
| 1587 | - // Source is a document | |
| 1588 | - $movestat = $this->_MOVEDocument($options, $iFolderID, $iDocumentID); | |
| 1589 | - | |
| 1590 | - } | |
| 1591 | - | |
| 1592 | - $this->ktwebdavLog("Final movestat result is: " . $movestat, 'info', true); | |
| 1593 | - return $movestat; | |
| 1594 | - | |
| 1595 | - } else return "423 Locked - KTWebDAV is in SafeMode"; | |
| 1596 | - | |
| 1597 | - } | |
| 1598 | - | |
| 1599 | - /** | |
| 1600 | - * MOVE method helper for Documents | |
| 1601 | - * | |
| 1602 | - * @param array parameter passing array | |
| 1603 | - * @param int Folder ID | |
| 1604 | - * @param int Document ID | |
| 1605 | - * @return string HTTP status code or false | |
| 1606 | - */ | |
| 1607 | - function _MOVEDocument($options, $iFolderID, $iDocumentID) { | |
| 1608 | - | |
| 1609 | - if ($options['dest'] == '') $options["dest"] = substr($options["dest_url"], strlen($_SERVER["SCRIPT_NAME"])); | |
| 1610 | - $this->ktwebdavLog("Entering _MOVEDocument. options are " . print_r($options, true), 'info', true); | |
| 1611 | - global $default; | |
| 1612 | - $new = true; | |
| 1613 | - //FIXME: refactor me into KTDocumentUtil | |
| 1614 | - | |
| 1615 | - $oDocument = Document::get($iDocumentID); | |
| 1616 | - $oSrcFolder = Folder::get($iFolderID); | |
| 1617 | - $oUser =& User::get($this->userID); | |
| 1618 | - | |
| 1619 | - $source_path = $options["path"]; | |
| 1620 | - $dest_path = urldecode($options["dest"]); | |
| 1621 | - | |
| 1622 | - // Is this a rename? | |
| 1623 | - if (dirname($source_path) == dirname($dest_path)) { | |
| 1624 | - // This is a rename | |
| 1625 | - //if ($options['overwrite'] != 'T') { | |
| 1626 | - // $this->ktwebdavLog("This is a Rename. Overwrite needs to be TRUE.", 'info', true); | |
| 1627 | - // return "412 Precondition Failed - This is a Rename. Overwrite needs to be TRUE."; | |
| 1628 | - //} | |
| 1629 | - $this->ktwebdavLog("Got an oDocument of " . print_r($oDocument, true), 'info', true); | |
| 1630 | - $this->ktwebdavLog("Got an new name of " . basename($dest_path), 'info', true); | |
| 1631 | - | |
| 1632 | - // Check if the user has permissions to write this document | |
| 1633 | - $oPerm =& KTPermission::getByName('ktcore.permissions.write'); | |
| 1634 | - $oUser =& User::get($this->userID); | |
| 1635 | - if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oDocument)) { | |
| 1636 | - return "403 Forbidden - User does not have sufficient permissions"; | |
| 1637 | - } | |
| 1638 | - $res = KTDocumentUtil::rename($oDocument, basename($dest_path), $oUser); | |
| 1639 | - if (PEAR::isError($res) || is_null($res) || ($res === false)) { | |
| 1640 | - return "404 Not Found - " . $res->getMessage(); | |
| 1641 | - } else { | |
| 1642 | - $this->ktwebdavLog("201 Created", 'info', true); | |
| 1643 | - return "201 Created"; | |
| 1644 | - } | |
| 1645 | - | |
| 1646 | - } | |
| 1647 | - | |
| 1648 | - list($iDestFolder, $iDestDoc) = $this->_folderOrDocument($dest_path); | |
| 1649 | - | |
| 1650 | - if (is_null($iDestDoc)) { | |
| 1651 | - // the dest is a folder | |
| 1652 | - } else if ($iDestDoc !== false) { | |
| 1653 | - // Document exists | |
| 1654 | - $this->ktwebdavLog("Destination Document exists.", 'info', true); | |
| 1655 | - $oReplaceDoc = Document::get($iDestDoc); | |
| 1656 | - if ($options['overwrite'] != 'T') { | |
| 1657 | - $this->ktwebdavLog("Overwrite needs to be TRUE.", 'info', true); | |
| 1658 | - return "412 Precondition Failed - Destination Document exists. Overwrite needs to be TRUE."; | |
| 1659 | - } | |
| 1660 | - $this->ktwebdavLog("Overwrite is TRUE, deleting Destination Document.", 'info', true); | |
| 1661 | - | |
| 1662 | - // Check if the user has permissions to delete this document | |
| 1663 | - $oPerm =& KTPermission::getByName('ktcore.permissions.delete'); | |
| 1664 | - $oUser =& User::get($this->userID); | |
| 1665 | - if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oReplaceDoc)) { | |
| 1666 | - return "403 Forbidden - User does not have sufficient permissions"; | |
| 1667 | - } | |
| 1668 | - KTDocumentUtil::delete($oReplaceDoc, 'KTWebDAV move overwrites target.'); | |
| 1669 | - $new = false; | |
| 1670 | - } | |
| 1671 | - | |
| 1672 | - $oDestFolder = Folder::get($iDestFolder); | |
| 1673 | - $this->ktwebdavLog("Got a destination folder of " . print_r($oDestFolder, true), 'info', true); | |
| 1674 | - | |
| 1675 | - // Check if the user has permissions to write in this folder | |
| 1676 | - $oPerm =& KTPermission::getByName('ktcore.permissions.write'); | |
| 1677 | - $oUser =& User::get($this->userID); | |
| 1678 | - if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oDestFolder)) { | |
| 1679 | - return "403 Forbidden - User does not have sufficient permissions"; | |
| 1680 | - } | |
| 1681 | - | |
| 1682 | - $oOriginalFolder = $oSrcFolder; | |
| 1683 | - $iOriginalFolderPermissionObjectId = $oOriginalFolder->getPermissionObjectId(); | |
| 1684 | - $iDocumentPermissionObjectId = $oDocument->getPermissionObjectId(); | |
| 1685 | - | |
| 1686 | - if ($iDocumentPermissionObjectId === $iOriginalFolderPermissionObjectId) { | |
| 1687 | - $oDocument->setPermissionObjectId($oDestFolder->getPermissionObjectId()); | |
| 1688 | - } | |
| 1689 | - | |
| 1690 | - //put the document in the new folder | |
| 1691 | - $oDocument->setFolderID($oDestFolder->getId()); | |
| 1692 | - if (!$oDocument->update(true)) { | |
| 1693 | - return "502 Bad Gateway - Document update failed."; | |
| 1694 | - } | |
| 1695 | - | |
| 1696 | - //move the document on the file system | |
| 1697 | - $oStorage =& KTStorageManagerUtil::getSingleton(); | |
| 1698 | - if (!$oStorage->moveDocument($oDocument, $oSrcFolder, $oDestFolder)) { | |
| 1699 | - $oDocument->setFolderID($oSrcDocumentFolder->getId()); | |
| 1700 | - $oDocument->update(true); | |
| 1701 | - return "502 Bad Gateway"; | |
| 1702 | - } | |
| 1703 | - | |
| 1704 | - $sMoveMessage = sprintf("Moved from %s/%s to %s/%s: %s", | |
| 1705 | - $oSrcFolder->getFullPath(), | |
| 1706 | - $oSrcFolder->getName(), | |
| 1707 | - $oDestFolder->getFullPath(), | |
| 1708 | - $oDestFolder->getName(), | |
| 1709 | - $_SERVER['HTTP_REASON']); | |
| 1710 | - | |
| 1711 | - // create the document transaction record | |
| 1712 | - $oDocumentTransaction = & new DocumentTransaction($oDocument, $sMoveMessage, 'ktcore.transactions.move'); | |
| 1713 | - $oDocumentTransaction->create(); | |
| 1714 | - | |
| 1715 | - $oKTTriggerRegistry = KTTriggerRegistry::getSingleton(); | |
| 1716 | - $aTriggers = $oKTTriggerRegistry->getTriggers('moveDocument', 'postValidate'); | |
| 1717 | - foreach ($aTriggers as $aTrigger) { | |
| 1718 | - $sTrigger = $aTrigger[0]; | |
| 1719 | - $oTrigger = new $sTrigger; | |
| 1720 | - $aInfo = array( | |
| 1721 | - "document" => $oDocument, | |
| 1722 | - "old_folder" => $oSrcFolder, | |
| 1723 | - "new_folder" => $oDestFolder, | |
| 1724 | - ); | |
| 1725 | - $oTrigger->setInfo($aInfo); | |
| 1726 | - $ret = $oTrigger->postValidate(); | |
| 1727 | - // FIXME: handle trigger subfailures. | |
| 1728 | - } | |
| 1729 | - | |
| 1730 | - if ($new) { | |
| 1731 | - return "201 Created"; | |
| 1732 | - } else { | |
| 1733 | - return "204 No Content"; | |
| 1734 | - } | |
| 1735 | - } | |
| 1736 | - | |
| 1737 | - /** | |
| 1738 | - * MOVE method helper for Folders | |
| 1739 | - * | |
| 1740 | - * @param array parameter passing array | |
| 1741 | - * @param int Folder ID | |
| 1742 | - * @return string HTTP status code or false | |
| 1743 | - | |
| 1744 | - */ | |
| 1745 | - function _MOVEFolder($options, $iFolderID) { | |
| 1746 | - | |
| 1747 | - if ($options['dest'] == '') $options["dest"] = substr($options["dest_url"], strlen($_SERVER["SCRIPT_NAME"])); | |
| 1748 | - $this->ktwebdavLog("Entering _MOVEFolder. options are " . print_r($options, true), 'info', true); | |
| 1749 | - | |
| 1750 | - if ($options["depth"] != "infinity") { | |
| 1751 | - // RFC 2518 Section 9.2, last paragraph | |
| 1752 | - $this->ktwebdavLog("400 Bad request", 'info', true); | |
| 1753 | - return "400 Bad request - depth must be 'inifinity'."; | |
| 1754 | - } | |
| 1755 | - | |
| 1756 | - global $default; | |
| 1757 | - | |
| 1758 | - $source_path = $options["path"]; | |
| 1759 | - $dest_path = urldecode($options["dest"]); | |
| 1760 | - | |
| 1761 | - $oSrcFolder = Folder::get($iFolderID); | |
| 1762 | - | |
| 1763 | - list($iDestFolder, $iDestDoc) = $this->_folderOrDocument($dest_path); | |
| 1764 | - | |
| 1765 | - $oDestFolder = Folder::get($iDestFolder); | |
| 1766 | - | |
| 1767 | - // Is this a rename? | |
| 1768 | - if (dirname($source_path) == dirname($dest_path)) { | |
| 1769 | - // This is a rename | |
| 1770 | - //if ($options['overwrite'] != 'T') { | |
| 1771 | - // $this->ktwebdavLog("This is a Rename. Overwrite needs to be TRUE.", 'info', true); | |
| 1772 | - // return "412 Precondition Failed - This is a Rename. Overwrite needs to be TRUE."; | |
| 1773 | - //} | |
| 1774 | - | |
| 1775 | - $this->ktwebdavLog("Got an oSrcFolder of " . print_r($oSrcFolder, true), 'info', true); | |
| 1776 | - $this->ktwebdavLog("Got an new name of " . basename($dest_path), 'info', true); | |
| 1777 | - | |
| 1778 | - include_once(KT_LIB_DIR . '/foldermanagement/folderutil.inc.php'); | |
| 1779 | - | |
| 1780 | - // Check if the user has permissions to write this folder | |
| 1781 | - $oPerm =& KTPermission::getByName('ktcore.permissions.folder_rename'); | |
| 1782 | - $oUser =& User::get($this->userID); | |
| 1783 | - if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oSrcFolder)) { | |
| 1784 | - return "403 Forbidden - User does not have sufficient permissions"; | |
| 1785 | - } | |
| 1786 | - $res = KTFolderUtil::rename($oSrcFolder, basename($dest_path), $oUser); | |
| 1787 | - if (PEAR::isError($res) || is_null($res) || ($res === false)) { | |
| 1788 | - return "404 Not Found - " . $res->getMessage(); | |
| 1789 | - } else { | |
| 1790 | - $this->ktwebdavLog("201 Created", 'info', true); | |
| 1791 | - return "201 Created"; | |
| 1792 | - } | |
| 1793 | - | |
| 1794 | - } | |
| 1795 | - | |
| 1796 | - if (is_null($iDestDoc)) { | |
| 1797 | - // the dest is a folder | |
| 1798 | - } else if ($iDestDoc !== false) { | |
| 1799 | - // Folder exists | |
| 1800 | - $this->ktwebdavLog("Destination Folder exists.", 'info', true); | |
| 1801 | - $oReplaceFolder = Folder::get($iDestDoc); | |
| 1802 | - if ($options['overwrite'] != 'T') { | |
| 1803 | - $this->ktwebdavLog("Overwrite needs to be TRUE.", 'info', true); | |
| 1804 | - return "412 Precondition Failed - Destination Folder exists. Overwrite needs to be TRUE."; | |
| 1805 | - } | |
| 1806 | - $this->ktwebdavLog("Overwrite is TRUE, deleting Destination Folder.", 'info', true); | |
| 1807 | - | |
| 1808 | - // Check if the user has permissions to delete this folder | |
| 1809 | - $oPerm =& KTPermission::getByName('ktcore.permissions.delete'); | |
| 1810 | - $oUser =& User::get($this->userID); | |
| 1811 | - if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oReplaceFolder)) { | |
| 1812 | - return "403 Forbidden - User does not have sufficient permissions"; | |
| 1813 | - } | |
| 1814 | - KTFolderUtil::delete($oReplaceFolder, 'KTWebDAV move overwrites target.'); | |
| 1815 | - $new = false; | |
| 1816 | - } | |
| 1817 | - | |
| 1818 | - include_once(KT_LIB_DIR . '/foldermanagement/folderutil.inc.php'); | |
| 1819 | - | |
| 1820 | - $oUser =& User::get($this->userID); | |
| 1821 | - $this->ktwebdavLog("Got an oSrcFolder of " . print_r($oSrcFolder, true), 'info', true); | |
| 1822 | - $this->ktwebdavLog("Got an oDestFolder of " . print_r($oDestFolder, true), 'info', true); | |
| 1823 | - $this->ktwebdavLog("Got an oUser of " . print_r($oUser, true), 'info', true); | |
| 1824 | - | |
| 1825 | - // Check if the user has permissions to write in this folder | |
| 1826 | - $oPerm =& KTPermission::getByName('ktcore.permissions.write'); | |
| 1827 | - $oUser =& User::get($this->userID); | |
| 1828 | - if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oDestFolder)) { | |
| 1829 | - return "403 Forbidden - User does not have sufficient permissions"; | |
| 1830 | - } | |
| 1831 | - KTFolderUtil::move($oSrcFolder, $oDestFolder, $oUser); | |
| 1832 | - | |
| 1833 | - $this->ktwebdavLog("201 Created", 'info', true); | |
| 1834 | - return "201 Created"; | |
| 1835 | - | |
| 1836 | - } | |
| 1837 | - | |
| 1838 | - /** | |
| 1839 | - * COPY method handler | |
| 1840 | - * | |
| 1841 | - * @param array parameter passing array | |
| 1842 | - * @param string delete source flag | |
| 1843 | - * @return string HTTP status code or false | |
| 1844 | - */ | |
| 1845 | - function COPY($options, $del = false) | |
| 1846 | - { | |
| 1847 | - $this->ktwebdavLog("Entering COPY. options are " . print_r($options, true), 'info', true); | |
| 1848 | - $this->ktwebdavLog("del is: " . $del, 'info', true); | |
| 1849 | - | |
| 1850 | - if ($this->checkSafeMode()) { | |
| 1851 | - | |
| 1852 | - if (!empty($_SERVER["CONTENT_LENGTH"])) { // no body parsing yet | |
| 1853 | - $this->ktwebdavLog("415 Unsupported media type", 'info', true); | |
| 1854 | - return "415 Unsupported media type - No body parsing yet"; | |
| 1855 | - } | |
| 1856 | - | |
| 1857 | - /* // no copying to different WebDAV Servers yet | |
| 1858 | - if (isset($options["dest_url"])) { | |
| 1859 | - $this->ktwebdavLog("502 bad gateway", 'info', true); | |
| 1860 | - return "502 bad gateway - No copying to different WebDAV Servers yet"; | |
| 1861 | - } | |
| 1862 | - */ | |
| 1863 | - $source_path = $options["path"]; | |
| 1864 | - $this->ktwebdavLog("SourcePath is: " . $source_path, 'info', true); | |
| 1865 | - $source_res = $this->_folderOrDocument($source_path); | |
| 1866 | - if ($source_res === false) { | |
| 1867 | - $this->ktwebdavLog("404 Not found - The document could not be found.", 'info', true); | |
| 1868 | - return "404 Not found - The document could not be found."; | |
| 1869 | - } | |
| 1870 | - | |
| 1871 | - list($iFolderID, $iDocumentID) = $source_res; | |
| 1872 | - if ($iDocumentID === false) { | |
| 1873 | - $this->ktwebdavLog("404 Not found - The folder could not be found.", 'info', true); | |
| 1874 | - return "404 Not found - The folder could not be found."; | |
| 1875 | - } | |
| 1876 | - | |
| 1877 | - if (is_null($iDocumentID)) { | |
| 1878 | - // Source is a folder | |
| 1879 | - $this->ktwebdavLog("Source is a Folder.", 'info', true); | |
| 1880 | - $copystat = $this->_COPYFolder($options, $iFolderID); | |
| 1881 | - | |
| 1882 | - } else { | |
| 1883 | - // Source is a document | |
| 1884 | - $this->ktwebdavLog("Source is a Document.", 'info', true); | |
| 1885 | - $copystat = $this->_COPYDocument($options, $iFolderID, $iDocumentID, $dest_folder_id); | |
| 1886 | - | |
| 1887 | - } | |
| 1888 | - | |
| 1889 | - // Delete the source if this is a move and the copy was ok | |
| 1890 | - if ($del && ($copystat{0} == "2")) { | |
| 1891 | - $delstat = $this->DELETE(array("path" => $options["path"])); | |
| 1892 | - $this->ktwebdavLog("DELETE in COPY/MOVE stat is: " . $delstat, 'info', true); | |
| 1893 | - if (($delstat{0} != "2") && (substr($delstat, 0, 3) != "404")) { | |
| 1894 | - return $delstat; | |
| 1895 | - } | |
| 1896 | - } | |
| 1897 | - | |
| 1898 | - $this->ktwebdavLog("Final copystat result is: " . $copystat, 'info', true); | |
| 1899 | - return $copystat; | |
| 1900 | - | |
| 1901 | - } else return "423 Locked - KTWebDAV is in SafeMode"; | |
| 1902 | - } | |
| 1903 | - | |
| 1904 | - /** | |
| 1905 | - * COPY method helper for Documents | |
| 1906 | - * | |
| 1907 | - * @param array parameter passing array | |
| 1908 | - * @param int Folder ID | |
| 1909 | - * @param int Document ID | |
| 1910 | - * @return string HTTP status code or false | |
| 1911 | - */ | |
| 1912 | - function _COPYDocument($options, $iFolderID, $iDocumentID) { | |
| 1913 | - | |
| 1914 | - if ($options['dest'] == '') $options["dest"] = substr($options["dest_url"], strlen($_SERVER["SCRIPT_NAME"])); | |
| 1915 | - $this->ktwebdavLog("Entering _COPYDocument. options are " . print_r($options, true), 'info', true); | |
| 1916 | - | |
| 1917 | - if ($options["depth"] != "infinity") { | |
| 1918 | - // RFC 2518 Section 9.2, last paragraph | |
| 1919 | - $this->ktwebdavLog("400 Bad request", 'info', true); | |
| 1920 | - return "400 Bad request - Depth must be 'infinity'."; | |
| 1921 | - } | |
| 1922 | - | |
| 1923 | - global $default; | |
| 1924 | - | |
| 1925 | - $source_path = $options["path"]; | |
| 1926 | - $dest_path = urldecode($options["dest"]); | |
| 1927 | - | |
| 1928 | - $oSrcFolder = Folder::get($iFolderID); | |
| 1929 | - | |
| 1930 | - list($iDestFolder, $iDestDoc) = $this->_folderOrDocument($dest_path); | |
| 1931 | - | |
| 1932 | - if (is_null($iDestDoc)) { | |
| 1933 | - // the dest is a folder | |
| 1934 | - // $this->ktwebdavLog("400 Bad request", 'info', true); | |
| 1935 | - return "400 Bad request - Destination is a Folder"; | |
| 1936 | - } else if ($iDestDoc !== false) { | |
| 1937 | - // Document exists | |
| 1938 | - $this->ktwebdavLog("Destination Document exists.", 'info', true); | |
| 1939 | - $oReplaceDoc = Document::get($iDestDoc); | |
| 1940 | - if ($options['overwrite'] != 'T') { | |
| 1941 | - $this->ktwebdavLog("Overwrite needs to be TRUE.", 'info', true); | |
| 1942 | - return "412 Precondition Failed - Destination Document exists. Overwrite needs to be TRUE."; | |
| 1943 | - } | |
| 1944 | - $this->ktwebdavLog("Overwrite is TRUE, deleting Destination Document.", 'info', true); | |
| 1945 | - | |
| 1946 | - // Check if the user has permissions to delete this document | |
| 1947 | - $oPerm =& KTPermission::getByName('ktcore.permissions.delete'); | |
| 1948 | - $oUser =& User::get($this->userID); | |
| 1949 | - if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oReplaceDoc)) { | |
| 1950 | - return "403 Forbidden - User does not have sufficient permissions"; | |
| 1951 | - } | |
| 1952 | - KTDocumentUtil::delete($oReplaceDoc, 'KTWebDAV copy with overwrite set.'); | |
| 1953 | - $new = false; | |
| 1954 | - } | |
| 1955 | - | |
| 1956 | - $oDestFolder = Folder::get($iDestFolder); | |
| 1957 | - $oSrcDoc = Document::get($iDocumentID); | |
| 1958 | - | |
| 1959 | - include_once(KT_LIB_DIR . '/foldermanagement/folderutil.inc.php'); | |
| 1960 | - | |
| 1961 | - $this->ktwebdavLog("Got an oSrcDoc of " . print_r($oSrcDoc, true), 'info', true); | |
| 1962 | - $this->ktwebdavLog("Got an oDestFolder of " . print_r($oDestFolder, true), 'info', true); | |
| 1963 | - | |
| 1964 | - // Check if the user has permissions to write in this folder | |
| 1965 | - $oPerm =& KTPermission::getByName('ktcore.permissions.write'); | |
| 1966 | - $oUser =& User::get($this->userID); | |
| 1967 | - if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oSrcDoc)) { | |
| 1968 | - return "403 Forbidden - User does not have sufficient permissions"; | |
| 1969 | - } | |
| 1970 | - KTDocumentUtil::copy($oSrcDoc, $oDestFolder, $_SERVER['HTTP_REASON']); | |
| 1971 | - | |
| 1972 | - // FIXME: Do failure checking here | |
| 1973 | - | |
| 1974 | - $new = false; | |
| 1975 | - if ($new) { | |
| 1976 | - $this->ktwebdavLog("201 Created", 'info', true); | |
| 1977 | - return "201 Created"; | |
| 1978 | - } else { | |
| 1979 | - $this->ktwebdavLog("204 No Content", 'info', true); | |
| 1980 | - return "204 No Content"; | |
| 1981 | - } | |
| 1982 | - } | |
| 1983 | - | |
| 1984 | - /** | |
| 1985 | - * COPY method helper for Folders | |
| 1986 | - * | |
| 1987 | - * @param array parameter passing array | |
| 1988 | - * @param int Parent Folder ID | |
| 1989 | - * @return string HTTP status code or false | |
| 1990 | - */ | |
| 1991 | - function _COPYFolder($options, $iFolderID) { | |
| 1992 | - | |
| 1993 | - if ($options['dest'] == '') $options["dest"] = substr($options["dest_url"], strlen($_SERVER["SCRIPT_NAME"])); | |
| 1994 | - $this->ktwebdavLog("Entering _COPYFolder. options are " . print_r($options, true), 'info', true); | |
| 1995 | - | |
| 1996 | - if ($options["depth"] != "infinity") { | |
| 1997 | - // RFC 2518 Section 9.2, last paragraph | |
| 1998 | - $this->ktwebdavLog("400 Bad request", 'info', true); | |
| 1999 | - return "400 Bad request - Depth must be 'infinity'."; | |
| 2000 | - } | |
| 2001 | - | |
| 2002 | - global $default; | |
| 2003 | - | |
| 2004 | - $new = true; | |
| 2005 | - | |
| 2006 | - $source_path = $options["path"]; | |
| 2007 | - $dest_path = urldecode($options["dest"]); | |
| 2008 | - | |
| 2009 | - $oSrcFolder = Folder::get($iFolderID); | |
| 2010 | - | |
| 2011 | - list($iDestFolder, $iDestDoc) = $this->_folderOrDocument($dest_path); | |
| 2012 | - | |
| 2013 | - $oDestFolder = Folder::get($iDestFolder); | |
| 2014 | - | |
| 2015 | - include_once(KT_LIB_DIR . '/foldermanagement/folderutil.inc.php'); | |
| 2016 | - | |
| 2017 | - if (is_null($iDestDoc)) { | |
| 2018 | - // the dest is a folder | |
| 2019 | - $this->ktwebdavLog("The Destination is a Folder.", 'info', true); | |
| 2020 | - } else if ($iDestDoc !== false) { | |
| 2021 | - // Folder exists | |
| 2022 | - $this->ktwebdavLog("Destination Folder exists.", 'info', true); | |
| 2023 | - $oReplaceFolder = Folder::get($iDestDoc); | |
| 2024 | - if ($options['overwrite'] != 'T') { | |
| 2025 | - $this->ktwebdavLog("Overwrite needs to be TRUE.", 'info', true); | |
| 2026 | - return "412 Precondition Failed - Destination Folder exists. Overwrite needs to be TRUE."; | |
| 2027 | - } | |
| 2028 | - $this->ktwebdavLog("Overwrite is TRUE, deleting Destination Folder.", 'info', true); | |
| 2029 | - | |
| 2030 | - // Check if the user has permissions to delete this folder | |
| 2031 | - $oPerm =& KTPermission::getByName('ktcore.permissions.delete'); | |
| 2032 | - $oUser =& User::get($this->userID); | |
| 2033 | - if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oReplaceFolder)) { | |
| 2034 | - return "403 Forbidden - User does not have sufficient permissions"; | |
| 2035 | - } | |
| 2036 | - KTFolderUtil::delete($oReplaceFolder, 'KTWebDAV move overwrites target.'); | |
| 2037 | - $new = false; | |
| 2038 | - } | |
| 2039 | - | |
| 2040 | - $oUser =& User::get($this->userID); | |
| 2041 | - $this->ktwebdavLog("Got an oSrcFolder of " . print_r($oSrcFolder, true), 'info', true); | |
| 2042 | - $this->ktwebdavLog("Got an oDestFolder of " . print_r($oDestFolder, true), 'info', true); | |
| 2043 | - $this->ktwebdavLog("Got an oUser of " . print_r($oUser, true), 'info', true); | |
| 2044 | - | |
| 2045 | - // Check if the user has permissions to write in this folder | |
| 2046 | - $oPerm =& KTPermission::getByName('ktcore.permissions.write'); | |
| 2047 | - $oUser =& User::get($this->userID); | |
| 2048 | - if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oDestFolder)) { | |
| 2049 | - return "403 Forbidden - User does not have sufficient permissions"; | |
| 2050 | - } | |
| 2051 | - KTFolderUtil::copy($oSrcFolder, $oDestFolder, $oUser, 'KTWebDAV Copy.'); | |
| 2052 | - | |
| 2053 | - if ($new) { | |
| 2054 | - $this->ktwebdavLog("201 Created", 'info', true); | |
| 2055 | - return "201 Created"; | |
| 2056 | - } else { | |
| 2057 | - $this->ktwebdavLog("204 No Content", 'info', true); | |
| 2058 | - return "204 No Content"; | |
| 2059 | - } | |
| 2060 | - | |
| 2061 | - } | |
| 2062 | - | |
| 2063 | - /** | |
| 2064 | - * LOCK method handler | |
| 2065 | - * | |
| 2066 | - * @param array parameter passing array | |
| 2067 | - * @return string HTTP status code or false | |
| 2068 | - */ | |
| 2069 | - function LOCK(&$options) | |
| 2070 | - { | |
| 2071 | - return "200 OK"; | |
| 2072 | - } | |
| 2073 | - | |
| 2074 | - /** | |
| 2075 | - * UNLOCK method handler | |
| 2076 | - * | |
| 2077 | - * @param array parameter passing array | |
| 2078 | - * @return string HTTP status code or false | |
| 2079 | - */ | |
| 2080 | - function UNLOCK(&$options) | |
| 2081 | - { | |
| 2082 | - return "200 OK"; | |
| 2083 | - } | |
| 2084 | - | |
| 2085 | - /** | |
| 2086 | - * checkLock() helper | |
| 2087 | - * | |
| 2088 | - * @param string resource path to check for locks | |
| 2089 | - * @return string HTTP status code or false | |
| 2090 | - */ | |
| 2091 | - function checkLock($path) | |
| 2092 | - { | |
| 2093 | - $result = false; | |
| 2094 | - | |
| 2095 | - return $result; | |
| 2096 | - } | |
| 2097 | - | |
| 2098 | - /** | |
| 2099 | - * checkSafeMode() helper | |
| 2100 | - * | |
| 2101 | - * @return string true or false | |
| 2102 | - */ | |
| 2103 | - function checkSafeMode() | |
| 2104 | - { | |
| 2105 | - | |
| 2106 | - // Check/Set the WebDAV Client | |
| 2107 | - $userAgentValue = $_SERVER['HTTP_USER_AGENT']; | |
| 2108 | - // KT Explorer | |
| 2109 | - if (stristr($userAgentValue,"Microsoft Data Access Internet Publishing Provider DAV")) { | |
| 2110 | - $this->dav_client = "MS"; | |
| 2111 | - $this->ktwebdavLog("WebDAV Client : " . $userAgentValue, 'info', true); | |
| 2112 | - } | |
| 2113 | - // Mac Finder | |
| 2114 | - if (stristr($userAgentValue,"Macintosh")) { | |
| 2115 | - $this->dav_client = "MC"; | |
| 2116 | - $this->ktwebdavLog("WebDAV Client : " . $userAgentValue, 'info', true); | |
| 2117 | - } | |
| 2118 | - // Konqueror | |
| 2119 | - if (stristr($userAgentValue,"Konqueror")) { | |
| 2120 | - $this->dav_client = "KO"; | |
| 2121 | - $this->ktwebdavLog("WebDAV Client : " . $userAgentValue, 'info', true); | |
| 2122 | - } | |
| 2123 | - // Neon Library ( Gnome Nautilus, cadaver, etc) | |
| 2124 | - if (stristr($userAgentValue,"neon")) { | |
| 2125 | - $this->dav_client = "NE"; | |
| 2126 | - $this->ktwebdavLog("WebDAV Client : " . $userAgentValue, 'info', true); | |
| 2127 | - } | |
| 2128 | - // Windows WebDAV | |
| 2129 | - if ($this->dav_client == 'MS' && $this->safeMode == 'off') { | |
| 2130 | - | |
| 2131 | - $this->ktwebdavLog("This is MS type client with SafeMode Off.", 'info', true); | |
| 2132 | - return true; | |
| 2133 | - | |
| 2134 | - } | |
| 2135 | - if ($this->dav_client == 'MS' && $this->safeMode != 'off') { | |
| 2136 | - | |
| 2137 | - $this->ktwebdavLog("This is MS type client with SafeMode On.", 'info', true); | |
| 2138 | - return false; | |
| 2139 | - | |
| 2140 | - } | |
| 2141 | - // Mac Finder | |
| 2142 | - if ($this->dav_client == 'MC') { | |
| 2143 | - | |
| 2144 | - $this->ktwebdavLog("This is Mac Finder type client which only supports SafeMode.", 'info', true); | |
| 2145 | - return false; | |
| 2146 | - | |
| 2147 | - } | |
| 2148 | - // Konqueror | |
| 2149 | - if ($this->dav_client == 'KO' && $this->safeMode == 'off') { | |
| 2150 | - | |
| 2151 | - $this->ktwebdavLog("This is Konqueror type client with SafeMode Off.", 'info', true); | |
| 2152 | - return true; | |
| 2153 | - | |
| 2154 | - } | |
| 2155 | - if ($this->dav_client == 'KO' && $this->safeMode != 'off') { | |
| 2156 | - | |
| 2157 | - $this->ktwebdavLog("This is Konqueror type client with SafeMode On.", 'info', true); | |
| 2158 | - return false; | |
| 2159 | - | |
| 2160 | - } | |
| 2161 | - // Neon Library (Gnome Nautilus, cadaver, etc.) | |
| 2162 | - if ($this->dav_client == 'NE' && $this->safeMode == 'off') { | |
| 2163 | - | |
| 2164 | - $this->ktwebdavLog("This is Neon type client with SafeMode Off.", 'info', true); | |
| 2165 | - return true; | |
| 2166 | - | |
| 2167 | - } | |
| 2168 | - if ($this->dav_client == 'NE' && $this->safeMode != 'off') { | |
| 2169 | - | |
| 2170 | - $this->ktwebdavLog("This is Neon type client with SafeMode On.", 'info', true); | |
| 2171 | - return false; | |
| 2172 | - | |
| 2173 | - } | |
| 2174 | - | |
| 2175 | - $this->ktwebdavLog("Unknown client. SafeMode needed.", 'info', true); | |
| 2176 | - return false; | |
| 2177 | - | |
| 2178 | - } | |
| 2179 | - | |
| 2180 | - } | |
| 2181 | - | |
| 2182 | - | |
| 2183 | - ?> | |
| 1 | +<?php | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * $Id$ | |
| 5 | + * | |
| 6 | + * The contents of this file are subject to the KnowledgeTree Public | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | + * compliance with the License. You may obtain a copy of the License at | |
| 9 | + * http://www.knowledgetree.com/KPL | |
| 10 | + * | |
| 11 | + * Software distributed under the License is distributed on an "AS IS" | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 21 | + * | |
| 22 | + * The Original Code is: KnowledgeTree Open Source | |
| 23 | + * | |
| 24 | + * The Initial Developer of the Original Code is The Jam Warehouse Software | |
| 25 | + * (Pty) Ltd, trading as KnowledgeTree. | |
| 26 | + * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright | |
| 27 | + * (C) 2007 The Jam Warehouse Software (Pty) Ltd; | |
| 28 | + * All Rights Reserved. | |
| 29 | + * Contributor( s): ______________________________________ | |
| 30 | + * | |
| 31 | + */ | |
| 32 | + | |
| 33 | +require_once 'HTTP/WebDAV/Server.php'; // thirdparty PEAR | |
| 34 | +require_once 'Config.php'; // thirdparty PEAR | |
| 35 | +require_once 'Log.php'; // thirdparty PEAR | |
| 36 | + | |
| 37 | +require_once '../config/dmsDefaults.php'; // This is our plug into KT. | |
| 38 | + | |
| 39 | + | |
| 40 | +DEFINE('STATUS_WEBDAV', 5); // Status code to handle 0 byte PUT FIXME: Do we still need this! | |
| 41 | + | |
| 42 | +/** | |
| 43 | + * KnowledgeTree access using WebDAV protocol | |
| 44 | + * | |
| 45 | + * @access public | |
| 46 | + */ | |
| 47 | +class KTWebDAVServer extends HTTP_WebDAV_Server | |
| 48 | +{ | |
| 49 | + /** | |
| 50 | + * String to be used in "X-Dav-Powered-By" header | |
| 51 | + * | |
| 52 | + * @var string | |
| 53 | + */ | |
| 54 | + var $dav_powered_by = 'KTWebDAV (1.0.0)'; | |
| 55 | + | |
| 56 | + /** | |
| 57 | + * Realm string to be used in authentication | |
| 58 | + * | |
| 59 | + * @var string | |
| 60 | + */ | |
| 61 | + var $http_auth_realm = 'KTWebDAV Server'; | |
| 62 | + | |
| 63 | + /** | |
| 64 | + * Path to KT install root | |
| 65 | + * | |
| 66 | + * @var string | |
| 67 | + */ | |
| 68 | + var $ktdmsPath = ''; | |
| 69 | + | |
| 70 | + /** | |
| 71 | + * Debug Info Toggle | |
| 72 | + * | |
| 73 | + * @var string | |
| 74 | + */ | |
| 75 | + var $debugInfo = 'off'; | |
| 76 | + | |
| 77 | + /** | |
| 78 | + * Safe Mode Toggle | |
| 79 | + * | |
| 80 | + * @var string | |
| 81 | + */ | |
| 82 | + var $safeMode = 'on'; | |
| 83 | + | |
| 84 | + /** | |
| 85 | + * Configuration Array | |
| 86 | + * | |
| 87 | + * @var array | |
| 88 | + */ | |
| 89 | + var $config = array(); | |
| 90 | + | |
| 91 | + /** | |
| 92 | + * Settings Section Configuration Array | |
| 93 | + * | |
| 94 | + * @var array | |
| 95 | + */ | |
| 96 | + var $settings = array(); | |
| 97 | + | |
| 98 | + /** | |
| 99 | + * Current User ID | |
| 100 | + * | |
| 101 | + * @var int | |
| 102 | + */ | |
| 103 | + var $userID; | |
| 104 | + | |
| 105 | + /** | |
| 106 | + * Current Method | |
| 107 | + * | |
| 108 | + * @var string | |
| 109 | + */ | |
| 110 | + var $currentMethod; | |
| 111 | + | |
| 112 | + /** | |
| 113 | + * Last Created Folder ID | |
| 114 | + * | |
| 115 | + * @var string | |
| 116 | + */ | |
| 117 | + var $lastFolderID; | |
| 118 | + | |
| 119 | + /** | |
| 120 | + * DAV Client | |
| 121 | + * | |
| 122 | + * @var String | |
| 123 | + */ | |
| 124 | + var $dav_client; | |
| 125 | + | |
| 126 | + /** | |
| 127 | + * Root Folder Name | |
| 128 | + * | |
| 129 | + * @var String | |
| 130 | + */ | |
| 131 | + var $rootFolder = 'Root Folder'; | |
| 132 | + | |
| 133 | + /** | |
| 134 | + * Last Message | |
| 135 | + * | |
| 136 | + * @var String | |
| 137 | + */ | |
| 138 | + var $lastMsg = ''; | |
| 139 | + | |
| 140 | + /** | |
| 141 | + * Constructor | |
| 142 | + * | |
| 143 | + * @param void | |
| 144 | + * @return void | |
| 145 | + */ | |
| 146 | + function KTWebDAVServer() { | |
| 147 | + | |
| 148 | + // CGI compatible auth setup | |
| 149 | + $altinfo = KTUtil::arrayGet( $_SERVER, 'kt_auth', KTUtil::arrayGet( $_SERVER, 'REDIRECT_kt_auth')); | |
| 150 | + if ( !empty( $altinfo) && !isset( $_SERVER['PHP_AUTH_USER'])) { | |
| 151 | + $val = $altinfo; | |
| 152 | + $pieces = explode( ' ', $val); // bad. | |
| 153 | + if ( $pieces[0] == 'Basic') { | |
| 154 | + $chunk = $pieces[1]; | |
| 155 | + $decoded = base64_decode( $chunk); | |
| 156 | + $credential_info = explode( ':', $decoded); | |
| 157 | + if ( count( $credential_info) == 2) { | |
| 158 | + $_SERVER['PHP_AUTH_USER'] = $credential_info[0]; | |
| 159 | + $_SERVER['PHP_AUTH_PW'] = $credential_info[1]; | |
| 160 | + $_SERVER["AUTH_TYPE"] = 'Basic'; | |
| 161 | + } | |
| 162 | + } | |
| 163 | + } | |
| 164 | + | |
| 165 | + // Let the base class do it's thing | |
| 166 | + parent::HTTP_WebDAV_Server(); | |
| 167 | + | |
| 168 | + // Load KTWebDAV config | |
| 169 | + if (!$this->initConfig()) { | |
| 170 | + $this->ktwebdavLog('Could not load configiration.', 'error'); | |
| 171 | + exit(0); | |
| 172 | + } | |
| 173 | + | |
| 174 | + if ($this->debugInfo == 'on') { | |
| 175 | + | |
| 176 | + $this->ktwebdavLog('====================='); | |
| 177 | + $this->ktwebdavLog(' Debug Info is : ' . $this->debugInfo); | |
| 178 | + $this->ktwebdavLog(' SafeMode is : ' . $this->safeMode); | |
| 179 | + $this->ktwebdavLog(' Root Folder is : ' . $this->rootFolder); | |
| 180 | + $this->ktwebdavLog('====================='); | |
| 181 | + } | |
| 182 | + | |
| 183 | + } | |
| 184 | + | |
| 185 | + /** | |
| 186 | + * Load KTWebDAV configuration from conf file | |
| 187 | + * | |
| 188 | + * @param void | |
| 189 | + * @return bool true on success | |
| 190 | + */ | |
| 191 | + function initConfig() { | |
| 192 | + | |
| 193 | + global $default; | |
| 194 | + $oConfig =& KTConfig::getSingleton(); | |
| 195 | + | |
| 196 | + // Assign Content | |
| 197 | + $this->debugInfo = $oConfig->get('KTWebDAVSettings/debug', 'off'); | |
| 198 | + $this->safeMode = $oConfig->get('KTWebDAVSettings/safemode', 'on'); | |
| 199 | + $this->rootFolder = $oConfig->get('KTWebDAVSettings/rootfolder', 'Root Folder'); | |
| 200 | + $this->kt_version = $default->systemVersion; | |
| 201 | + | |
| 202 | + return true; | |
| 203 | + } | |
| 204 | + | |
| 205 | + /** | |
| 206 | + * Log to the KTWebDAV logfile | |
| 207 | + * | |
| 208 | + * @todo Add other log levels for warning, profile, etc | |
| 209 | + * @param string log message | |
| 210 | + * @param bool debug only? | |
| 211 | + * @return bool true on success | |
| 212 | + */ | |
| 213 | + function ktwebdavLog($entry, $type = 'info', $debug_only = false) { | |
| 214 | + | |
| 215 | + if ($debug_only && $this->debugInfo != 'on') return false; | |
| 216 | + | |
| 217 | + $ident = 'KTWEBDAV'; | |
| 218 | + $conf = array('mode' => 0644, 'timeFormat' => '%X %x'); | |
| 219 | + $logger = &Log::singleton('file', '../var/log/ktwebdav-' . date('Y-m-d') . '.txt', $ident, $conf); | |
| 220 | + if ($type == 'error') $logger->log($entry, PEAR_LOG_ERR); | |
| 221 | + else $logger->log($entry, PEAR_LOG_INFO); | |
| 222 | + return true; | |
| 223 | + } | |
| 224 | + | |
| 225 | + /** | |
| 226 | + * Get the current UserID | |
| 227 | + * | |
| 228 | + * @access private | |
| 229 | + * @param void | |
| 230 | + * @return int userID | |
| 231 | + */ | |
| 232 | + function _getUserID() { | |
| 233 | + return $this->userID; | |
| 234 | + } | |
| 235 | + | |
| 236 | + /** | |
| 237 | + * Set the current UserID | |
| 238 | + * | |
| 239 | + * @access private | |
| 240 | + * @param void | |
| 241 | + * @return int UserID | |
| 242 | + */ | |
| 243 | + function _setUserID($iUserID) { | |
| 244 | + return $this->userID = $iUserID; | |
| 245 | + } | |
| 246 | + | |
| 247 | + /** | |
| 248 | + * Serve a webdav request | |
| 249 | + * | |
| 250 | + * @access public | |
| 251 | + * @param void | |
| 252 | + * @return void | |
| 253 | + */ | |
| 254 | + function ServeRequest() { | |
| 255 | + | |
| 256 | + global $default; | |
| 257 | + | |
| 258 | + if ($this->debugInfo == 'on') { | |
| 259 | + | |
| 260 | + $this->ktwebdavLog('_SERVER is ' . print_r($_SERVER, true), 'info', true); | |
| 261 | + } | |
| 262 | + | |
| 263 | + // Get the client info | |
| 264 | + $this->checkSafeMode(); | |
| 265 | + | |
| 266 | + // identify ourselves | |
| 267 | + $this->ktwebdavLog('WebDAV Server : ' . $this->dav_powered_by . ' [KT:'.$default->systemVersion."]", 'info', true); | |
| 268 | + header('X-Dav-Powered-By: '.$this->dav_powered_by . ' [KT:'.$default->systemVersion.']'); | |
| 269 | + | |
| 270 | + // check authentication | |
| 271 | + if (!$this->_check_auth()) { | |
| 272 | + $this->ktwebdavLog('401 Unauthorized - Authorisation failed.' .$this->lastMsg, 'info', true); | |
| 273 | + $this->ktwebdavLog('----------------------------------------', 'info', true); | |
| 274 | + $this->http_status('401 Unauthorized - Authorisation failed. ' .$this->lastMsg); | |
| 275 | + | |
| 276 | + // RFC2518 says we must use Digest instead of Basic | |
| 277 | + // but Microsoft Clients do not support Digest | |
| 278 | + // and we don't support NTLM and Kerberos | |
| 279 | + // so we are stuck with Basic here | |
| 280 | + header('WWW-Authenticate: Basic realm="'.($this->http_auth_realm).'"'); | |
| 281 | + | |
| 282 | + return; | |
| 283 | + } | |
| 284 | + | |
| 285 | + // check | |
| 286 | + if(! $this->_check_if_header_conditions()) { | |
| 287 | + $this->http_status('412 Precondition failed'); | |
| 288 | + return; | |
| 289 | + } | |
| 290 | + | |
| 291 | + // set path | |
| 292 | + $request_uri = $this->_urldecode(!empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/'); | |
| 293 | + $this->path = str_replace($_SERVER['SCRIPT_NAME'], '', $request_uri); | |
| 294 | + if(ini_get('magic_quotes_gpc')) { | |
| 295 | + $this->path = stripslashes($this->path); | |
| 296 | + } | |
| 297 | + | |
| 298 | + $this->ktwebdavLog('PATH_INFO is ' . $_SERVER['PATH_INFO'], 'info', true); | |
| 299 | + $this->ktwebdavLog('REQUEST_URI is ' . $_SERVER['REQUEST_URI'], 'info', true); | |
| 300 | + $this->ktwebdavLog('SCRIPT_NAME is ' . $_SERVER['SCRIPT_NAME'], 'info', true); | |
| 301 | + $this->ktwebdavLog('PHP_SELF is ' . $_SERVER['PHP_SELF'], 'info', true); | |
| 302 | + $this->ktwebdavLog('path set to ' . $this->path, 'info', true); | |
| 303 | + | |
| 304 | + // detect requested method names | |
| 305 | + $method = strtolower($_SERVER['REQUEST_METHOD']); | |
| 306 | + $wrapper = 'http_'.$method; | |
| 307 | + | |
| 308 | + $this->currentMethod = $method; | |
| 309 | + // activate HEAD emulation by GET if no HEAD method found | |
| 310 | + if ($method == 'head' && !method_exists($this, 'head')) { | |
| 311 | + // rfc2068 Sec: 10.2.1 | |
| 312 | + //HEAD the entity-header fields corresponding to the requested resource | |
| 313 | + // are sent in the response without any message-body | |
| 314 | + $method = 'get'; | |
| 315 | + } | |
| 316 | + $this->ktwebdavLog("Entering $method request", 'info', true); | |
| 317 | + | |
| 318 | + if (method_exists($this, $wrapper) && ($method == 'options' || method_exists($this, $method))) { | |
| 319 | + $this->$wrapper(); // call method by name | |
| 320 | + } else { // method not found/implemented | |
| 321 | + if ($_SERVER['REQUEST_METHOD'] == 'LOCK') { | |
| 322 | + $this->http_status('412 Precondition failed'); | |
| 323 | + } else { | |
| 324 | + $this->http_status('405 Method not allowed'); | |
| 325 | + header('Allow: '.join(', ', $this->_allow())); // tell client what's allowed | |
| 326 | + } | |
| 327 | + } | |
| 328 | + | |
| 329 | + $this->ktwebdavLog("Exiting $method request", 'info', true); | |
| 330 | + | |
| 331 | + } | |
| 332 | + | |
| 333 | + | |
| 334 | + /** | |
| 335 | + * check authentication if check is implemented | |
| 336 | + * | |
| 337 | + * @param void | |
| 338 | + * @return bool true if authentication succeded or not necessary | |
| 339 | + */ | |
| 340 | + function _check_auth() | |
| 341 | + { | |
| 342 | + $this->ktwebdavLog('Entering _check_auth...', 'info', true); | |
| 343 | + | |
| 344 | + if (method_exists($this, 'checkAuth')) { | |
| 345 | + // PEAR style method name | |
| 346 | + return $this->checkAuth(@$_SERVER['AUTH_TYPE'], | |
| 347 | + @$_SERVER['PHP_AUTH_USER'], | |
| 348 | + @$_SERVER['PHP_AUTH_PW']); | |
| 349 | + } else if (method_exists($this, 'check_auth')) { | |
| 350 | + // old (pre 1.0) method name | |
| 351 | + return $this->check_auth(@$_SERVER['AUTH_TYPE'], | |
| 352 | + @$_SERVER['PHP_AUTH_USER'], | |
| 353 | + @$_SERVER['PHP_AUTH_PW']); | |
| 354 | + } else { | |
| 355 | + // no method found -> no authentication required | |
| 356 | + return true; | |
| 357 | + } | |
| 358 | + } | |
| 359 | + | |
| 360 | + /** | |
| 361 | + * Authenticate user | |
| 362 | + * | |
| 363 | + * @access private | |
| 364 | + * @param string HTTP Authentication type (Basic, Digest, ...) | |
| 365 | + * @param string Username | |
| 366 | + * @param string Password | |
| 367 | + * @return bool true on successful authentication | |
| 368 | + */ | |
| 369 | + function checkAuth($sType, $sUser, $sPass) { | |
| 370 | + | |
| 371 | + $this->ktwebdavLog('Entering checkAuth params are: ', 'info', true); | |
| 372 | + $this->ktwebdavLog('sType: ' . $sType, 'info', true); | |
| 373 | + $this->ktwebdavLog('sUser: ' . $sUser, 'info', true); | |
| 374 | + $this->ktwebdavLog('sPass: ' . $sPass, 'info', true); | |
| 375 | + | |
| 376 | + // Authenticate user | |
| 377 | + | |
| 378 | + require_once(KT_LIB_DIR . '/authentication/authenticationutil.inc.php'); | |
| 379 | + | |
| 380 | + if ( empty($sUser) ) { | |
| 381 | + $this->ktwebdavLog('sUser is empty, returning false.', 'info', true); | |
| 382 | + return false; | |
| 383 | + } | |
| 384 | + | |
| 385 | + if ( empty($sPass) ) { | |
| 386 | + $this->ktwebdavLog('sPass is empty, returning false.', 'info', true); | |
| 387 | + return false; | |
| 388 | + } | |
| 389 | + | |
| 390 | + $oUser =& User::getByUsername($sUser); | |
| 391 | + if (PEAR::isError($oUser) || ($oUser === false)) { | |
| 392 | + $this->ktwebdavLog('User not found: ' . $sUser . '.', 'error'); | |
| 393 | + $this->lastMsg = 'User not found: ' . $sUser . '.'; | |
| 394 | + return false; | |
| 395 | + } | |
| 396 | + $authenticated = KTAuthenticationUtil::checkPassword($oUser, $sPass); | |
| 397 | + | |
| 398 | + if ($authenticated === false) { | |
| 399 | + $this->ktwebdavLog('Password incorrect for ' . $sUser . '.', 'error'); | |
| 400 | + $this->lastMsg = 'Password incorrect for ' . $sUser . '.'; | |
| 401 | + return false; | |
| 402 | + } | |
| 403 | + | |
| 404 | + if (PEAR::isError($authenticated)) { | |
| 405 | + $this->ktwebdavLog('Password incorrect for ' . $sUser . '.', 'error'); | |
| 406 | + $this->lastMsg = 'Password incorrect for ' . $sUser . '.'; | |
| 407 | + return false; | |
| 408 | + } | |
| 409 | + | |
| 410 | + $this->ktwebdavLog('UserID is: ' . $oUser->getId(), 'info', true ); | |
| 411 | + $this->_setUserID($oUser->getId()); | |
| 412 | + $_SESSION['userID'] = $this->_getUserID(); | |
| 413 | + $this->ktwebdavLog('SESSION UserID is: ' . $_SESSION['userID'], 'info', true ); | |
| 414 | + | |
| 415 | + $this->ktwebdavLog("Authentication Success.", 'info', true); | |
| 416 | + | |
| 417 | + return true; | |
| 418 | + } | |
| 419 | + | |
| 420 | + /** | |
| 421 | + * PROPFIND method handler | |
| 422 | + * | |
| 423 | + * @param array options | |
| 424 | + * @param array return array for file properties | |
| 425 | + * @return bool true on success | |
| 426 | + */ | |
| 427 | + function PROPFIND(&$options, &$files) { | |
| 428 | + | |
| 429 | + $this->ktwebdavLog("Entering PROPFIND. options are " . print_r($options, true), 'info', true); | |
| 430 | + | |
| 431 | + global $default; | |
| 432 | + | |
| 433 | + $fspath = $default->documentRoot . "/" . $this->rootFolder . $options["path"]; | |
| 434 | + $this->ktwebdavLog("fspath is " . $fspath, 'info', true); | |
| 435 | + | |
| 436 | + $path = $options["path"]; | |
| 437 | + | |
| 438 | + list($iFolderID, $iDocumentID) = $this->_folderOrDocument($path); | |
| 439 | + $this->ktwebdavLog("Folder/Doc is " . print_r(array($iFolderID, $iDocumentID), true), 'info', true); | |
| 440 | + | |
| 441 | + // Folder does not exist | |
| 442 | + if($iFolderID == '') return false; | |
| 443 | + | |
| 444 | + if (is_null($iDocumentID)) { | |
| 445 | + return $this->_PROPFINDFolder($options, $files, $iFolderID); | |
| 446 | + } | |
| 447 | + return $this->_PROPFINDDocument($options, $files, $iDocumentID); | |
| 448 | + | |
| 449 | + } | |
| 450 | + | |
| 451 | + /** | |
| 452 | + * PROPFIND helper for Folders | |
| 453 | + * | |
| 454 | + * @param array options | |
| 455 | + * @param array Return array for file props | |
| 456 | + * @param int Folder ID | |
| 457 | + * @return bool true on success | |
| 458 | + */ | |
| 459 | + function _PROPFINDFolder(&$options, &$files, $iFolderID) { | |
| 460 | + | |
| 461 | + global $default; | |
| 462 | + | |
| 463 | + $this->ktwebdavLog("Entering PROPFINDFolder. options are " . print_r($options, true), 'info', true); | |
| 464 | + | |
| 465 | + $folder_path = $options["path"]; | |
| 466 | + if (substr($folder_path, -1) != "/") { | |
| 467 | + $folder_path .= "/"; | |
| 468 | + } | |
| 469 | + $options["path"] = $folder_path; | |
| 470 | + | |
| 471 | + $files["files"] = array(); | |
| 472 | + $files["files"][] = $this->_fileinfoForFolderID($iFolderID, $folder_path); | |
| 473 | + | |
| 474 | + $oPerm =& KTPermission::getByName('ktcore.permissions.read'); | |
| 475 | + $oUser =& User::get($this->userID); | |
| 476 | + | |
| 477 | + if (!empty($options["depth"])) { | |
| 478 | + $aChildren = Folder::getList(array('parent_id = ?', $iFolderID)); | |
| 479 | + // FIXME: Truncation Time Workaround | |
| 480 | + //foreach (array_slice($aChildren, 0, 50) as $oChildFolder) { | |
| 481 | + foreach ($aChildren as $oChildFolder) { | |
| 482 | + // Check if the user has permissions to view this folder | |
| 483 | + $oFolderDetailsPerm =& KTPermission::getByName('ktcore.permissions.folder_details'); | |
| 484 | + | |
| 485 | + if(KTPermissionUtil::userHasPermissionOnItem($oUser, $oFolderDetailsPerm, $oChildFolder)) | |
| 486 | + { | |
| 487 | + $this->ktwebdavLog("Folder Details permissions GRANTED for user ". $_SESSION["userID"] ." on folder " . $oChildFolder->getName(), 'info', true); | |
| 488 | + $files["files"][] = $this->_fileinfoForFolder($oChildFolder, $folder_path . $oChildFolder->getName()); | |
| 489 | + } | |
| 490 | + else | |
| 491 | + { | |
| 492 | + $this->ktwebdavLog("Folder Details permissions DENIED for ". $_SESSION["userID"] ." on folder " . $oChildFolder->getName(), 'info', true); | |
| 493 | + } | |
| 494 | + } | |
| 495 | + $aDocumentChildren = Document::getList(array('folder_id = ? AND status_id = 1', $iFolderID)); | |
| 496 | + // FIXME: Truncation Time Workaround | |
| 497 | + //foreach (array_slice($aDocumentChildren, 0, 50) as $oChildDocument) { | |
| 498 | + foreach ($aDocumentChildren as $oChildDocument) { | |
| 499 | + // Check if the user has permissions to view this document | |
| 500 | + if (KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oChildDocument)) { | |
| 501 | + $this->ktwebdavLog("Read permissions GRANTED for ". $_SESSION["userID"] ." on document " . $oChildDocument->getName(), 'info', true); | |
| 502 | + $files["files"][] = $this->_fileinfoForDocument($oChildDocument, $folder_path . $oChildDocument->getFileName()); | |
| 503 | + } else $this->ktwebdavLog("Read permissions DENIED for ". $_SESSION["userID"] ." on document " . $oChildDocument->getName(), 'info', true); | |
| 504 | + } | |
| 505 | + } | |
| 506 | + return true; | |
| 507 | + } | |
| 508 | + | |
| 509 | + /** | |
| 510 | + * PROPFIND helper for Documents | |
| 511 | + * | |
| 512 | + * @param array options | |
| 513 | + * @param array Return array for file props | |
| 514 | + * @param int Document ID | |
| 515 | + * @return bool true on success | |
| 516 | + */ | |
| 517 | + function _PROPFINDDocument(&$options, &$files, $iDocumentID) { | |
| 518 | + | |
| 519 | + global $default; | |
| 520 | + | |
| 521 | + $this->ktwebdavLog("Entering PROPFINDDocument. files are " . print_r($files, true), 'info', true); | |
| 522 | + | |
| 523 | + $res = $this->_fileinfoForDocumentID($iDocumentID, $options["path"]); | |
| 524 | + $this->ktwebdavLog("_fileinfoForDocumentID result is " . print_r($res, true), 'info', true); | |
| 525 | + if ($res === false) { | |
| 526 | + return false; | |
| 527 | + } | |
| 528 | + $files["files"] = array(); | |
| 529 | + $files["files"][] = $res; | |
| 530 | + return true; | |
| 531 | + } | |
| 532 | + | |
| 533 | + /** | |
| 534 | + * PROPFIND helper for Document Info | |
| 535 | + * | |
| 536 | + * @param Document Document Object | |
| 537 | + * @param string Path | |
| 538 | + * @return array Doc info array | |
| 539 | + */ | |
| 540 | + function _fileinfoForDocument(&$oDocument, $path) { | |
| 541 | + | |
| 542 | + global $default; | |
| 543 | + | |
| 544 | + $this->ktwebdavLog("Entering _fileinfoForDocument. Document is " . print_r($oDocument, true), 'info', true); | |
| 545 | + | |
| 546 | + $fspath = $default->documentRoot . "/" . $this->rootFolder . $path; | |
| 547 | + $this->ktwebdavLog("fspath is " . $fspath, 'info', true); | |
| 548 | + | |
| 549 | + // create result array | |
| 550 | + $info = array(); | |
| 551 | + $info["path"] = $path; | |
| 552 | + $info["props"] = array(); | |
| 553 | + | |
| 554 | + // no special beautified displayname here ... | |
| 555 | + $info["props"][] = $this->mkprop("displayname", $oDocument->getName()); | |
| 556 | + | |
| 557 | + // creation and modification time | |
| 558 | + $info["props"][] = $this->mkprop("creationdate", strtotime($oDocument->getCreatedDateTime())); | |
| 559 | + $info["props"][] = $this->mkprop("getlastmodified", strtotime($oDocument->getVersionCreated())); | |
| 560 | + | |
| 561 | + // plain file (WebDAV resource) | |
| 562 | + $info["props"][] = $this->mkprop("resourcetype", ''); | |
| 563 | + // FIXME: Direct database access | |
| 564 | + $sQuery = array("SELECT mimetypes FROM $default->mimetypes_table WHERE id = ?", array($oDocument->getMimeTypeID())); | |
| 565 | + $res = DBUtil::getOneResultKey($sQuery, 'mimetypes'); | |
| 566 | + $info["props"][] = $this->mkprop("getcontenttype", $res); | |
| 567 | + | |
| 568 | + $info["props"][] = $this->mkprop("getcontentlength", $oDocument->getFileSize()); | |
| 569 | + | |
| 570 | + // explorer wants these? | |
| 571 | + $info["props"][] = $this->mkprop("name", ''); | |
| 572 | + $info["props"][] = $this->mkprop("parentname", ''); | |
| 573 | + $info["props"][] = $this->mkprop("href", ''); | |
| 574 | + $info["props"][] = $this->mkprop("ishidden", ''); | |
| 575 | + $info["props"][] = $this->mkprop("iscollection", ''); | |
| 576 | + $info["props"][] = $this->mkprop("isreadonly", ''); | |
| 577 | + $info["props"][] = $this->mkprop("contentclass", ''); | |
| 578 | + $info["props"][] = $this->mkprop("getcontentlanguage", ''); | |
| 579 | + $info["props"][] = $this->mkprop("lastaccessed", ''); | |
| 580 | + $info["props"][] = $this->mkprop("isstructureddocument", ''); | |
| 581 | + $info["props"][] = $this->mkprop("defaultdocument", ''); | |
| 582 | + $info["props"][] = $this->mkprop("isroot", ''); | |
| 583 | + | |
| 584 | + return $info; | |
| 585 | + } | |
| 586 | + | |
| 587 | + | |
| 588 | + /** | |
| 589 | + * PROPFIND helper for Document Info | |
| 590 | + * | |
| 591 | + * @param int Document ID | |
| 592 | + * @param string path | |
| 593 | + * @return array Doc info array | |
| 594 | + */ | |
| 595 | + function _fileinfoForDocumentID($iDocumentID, $path) { | |
| 596 | + | |
| 597 | + global $default; | |
| 598 | + | |
| 599 | + $this->ktwebdavLog("Entering _fileinfoForDocumentID. DocumentID is " . print_r($iDocumentID, true), 'info', true); | |
| 600 | + | |
| 601 | + if ($iDocumentID == '') return false; | |
| 602 | + | |
| 603 | + $oDocument =& Document::get($iDocumentID); | |
| 604 | + | |
| 605 | + if (is_null($oDocument) || ($oDocument === false) || PEAR::isError($oDocument)) { | |
| 606 | + return false; | |
| 607 | + } | |
| 608 | + | |
| 609 | + return $this->_fileinfoForDocument($oDocument, $path); | |
| 610 | + | |
| 611 | + } | |
| 612 | + | |
| 613 | + /** | |
| 614 | + * PROPFIND helper for Folder Info | |
| 615 | + * | |
| 616 | + * @param Folder Folder Object | |
| 617 | + * @param string $path | |
| 618 | + * @return array Folder info array | |
| 619 | + */ | |
| 620 | + function _fileinfoForFolder($oFolder, $path) { | |
| 621 | + | |
| 622 | + global $default; | |
| 623 | + | |
| 624 | + $this->ktwebdavLog("Entering _fileinfoForFolder. Folder is " . print_r($oFolder, true), 'info', true); | |
| 625 | + | |
| 626 | + // create result array | |
| 627 | + $info = array(); | |
| 628 | + $info["path"] = $path; | |
| 629 | + $fspath = $default->documentRoot . "/" . $this->rootFolder . $path; | |
| 630 | + //$fspath = $default->documentRoot . '/' . $oFolder->generateFolderPath($oFolder->getID()); | |
| 631 | + $info["props"] = array(); | |
| 632 | + | |
| 633 | + // no special beautified displayname here ... | |
| 634 | + $info["props"][] = $this->mkprop("displayname", $oFolder->getName()); | |
| 635 | + | |
| 636 | + // creation and modification time | |
| 637 | + //$info["props"][] = $this->mkprop("creationdate", strtotime($oFolder->getCreatedDateTime())); | |
| 638 | + //$info["props"][] = $this->mkprop("getlastmodified", strtotime($oFolder->getVersionCreated())); | |
| 639 | + | |
| 640 | + // directory (WebDAV collection) | |
| 641 | + $info["props"][] = $this->mkprop("resourcetype", "collection"); | |
| 642 | + $info["props"][] = $this->mkprop("getcontenttype", "httpd/unix-directory"); | |
| 643 | + $info["props"][] = $this->mkprop("getcontentlength", 0); | |
| 644 | + | |
| 645 | + return $info; | |
| 646 | + } | |
| 647 | + | |
| 648 | + /** | |
| 649 | + * PROPFIND method handler | |
| 650 | + * | |
| 651 | + * @param void | |
| 652 | + * @return void | |
| 653 | + */ | |
| 654 | + function http_PROPFIND() | |
| 655 | + { | |
| 656 | + $options = Array(); | |
| 657 | + $options["path"] = $this->path; | |
| 658 | + | |
| 659 | + // search depth from header (default is "infinity) | |
| 660 | + if (isset($_SERVER['HTTP_DEPTH'])) { | |
| 661 | + $options["depth"] = $_SERVER["HTTP_DEPTH"]; | |
| 662 | + } else { | |
| 663 | + $options["depth"] = "infinity"; | |
| 664 | + } | |
| 665 | + | |
| 666 | + // analyze request payload | |
| 667 | + $propinfo = new _parse_propfind("php://input"); | |
| 668 | + if (!$propinfo->success) { | |
| 669 | + $this->http_status("400 Error"); | |
| 670 | + return; | |
| 671 | + } | |
| 672 | + $options['props'] = $propinfo->props; | |
| 673 | + | |
| 674 | + // call user handler | |
| 675 | + if (!$this->PROPFIND($options, $files)) { | |
| 676 | + $this->http_status("404 Not Found"); | |
| 677 | + return; | |
| 678 | + } | |
| 679 | + | |
| 680 | + // collect namespaces here | |
| 681 | + $ns_hash = array(); | |
| 682 | + | |
| 683 | + // Microsoft Clients need this special namespace for date and time values | |
| 684 | + $ns_defs = "xmlns:ns0=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\""; | |
| 685 | + | |
| 686 | + // now we loop over all returned file entries | |
| 687 | + foreach($files["files"] as $filekey => $file) { | |
| 688 | + | |
| 689 | + // nothing to do if no properties were returned for a file | |
| 690 | + if (!isset($file["props"]) || !is_array($file["props"])) { | |
| 691 | + continue; | |
| 692 | + } | |
| 693 | + | |
| 694 | + // now loop over all returned properties | |
| 695 | + foreach($file["props"] as $key => $prop) { | |
| 696 | + // as a convenience feature we do not require that user handlers | |
| 697 | + // restrict returned properties to the requested ones | |
| 698 | + // here we strip all unrequested entries out of the response | |
| 699 | + | |
| 700 | + switch($options['props']) { | |
| 701 | + case "all": | |
| 702 | + // nothing to remove | |
| 703 | + break; | |
| 704 | + | |
| 705 | + case "names": | |
| 706 | + // only the names of all existing properties were requested | |
| 707 | + // so we remove all values | |
| 708 | + unset($files["files"][$filekey]["props"][$key]["val"]); | |
| 709 | + break; | |
| 710 | + | |
| 711 | + default: | |
| 712 | + $found = false; | |
| 713 | + | |
| 714 | + // search property name in requested properties | |
| 715 | + foreach((array)$options["props"] as $reqprop) { | |
| 716 | + if ( $reqprop["name"] == $prop["name"] | |
| 717 | + && $reqprop["xmlns"] == $prop["ns"]) { | |
| 718 | + $found = true; | |
| 719 | + break; | |
| 720 | + } | |
| 721 | + } | |
| 722 | + | |
| 723 | + // unset property and continue with next one if not found/requested | |
| 724 | + if (!$found) { | |
| 725 | + $files["files"][$filekey]["props"][$key]=''; | |
| 726 | + continue(2); | |
| 727 | + } | |
| 728 | + break; | |
| 729 | + } | |
| 730 | + | |
| 731 | + // namespace handling | |
| 732 | + if (empty($prop["ns"])) continue; // no namespace | |
| 733 | + $ns = $prop["ns"]; | |
| 734 | + if ($ns == "DAV:") continue; // default namespace | |
| 735 | + if (isset($ns_hash[$ns])) continue; // already known | |
| 736 | + | |
| 737 | + // register namespace | |
| 738 | + $ns_name = "ns".(count($ns_hash) + 1); | |
| 739 | + $ns_hash[$ns] = $ns_name; | |
| 740 | + $ns_defs .= " xmlns:$ns_name=\"$ns\""; | |
| 741 | + } | |
| 742 | + | |
| 743 | + // we also need to add empty entries for properties that were requested | |
| 744 | + // but for which no values where returned by the user handler | |
| 745 | + if (is_array($options['props'])) { | |
| 746 | + foreach($options["props"] as $reqprop) { | |
| 747 | + if($reqprop['name']=='') continue; // skip empty entries | |
| 748 | + | |
| 749 | + $found = false; | |
| 750 | + | |
| 751 | + // check if property exists in result | |
| 752 | + foreach($file["props"] as $prop) { | |
| 753 | + if ( $reqprop["name"] == $prop["name"] | |
| 754 | + && $reqprop["xmlns"] == $prop["ns"]) { | |
| 755 | + $found = true; | |
| 756 | + break; | |
| 757 | + } | |
| 758 | + } | |
| 759 | + | |
| 760 | + if (!$found) { | |
| 761 | + if($reqprop["xmlns"]==="DAV:" && $reqprop["name"]==="lockdiscovery") { | |
| 762 | + // lockdiscovery is handled by the base class | |
| 763 | + $files["files"][$filekey]["props"][] | |
| 764 | + = $this->mkprop("DAV:", | |
| 765 | + "lockdiscovery" , | |
| 766 | + $this->lockdiscovery($files["files"][$filekey]['path'])); | |
| 767 | + } else { | |
| 768 | + // add empty value for this property | |
| 769 | + $files["files"][$filekey]["noprops"][] = $this->mkprop($reqprop["xmlns"], $reqprop["name"], ''); | |
| 770 | + | |
| 771 | + // register property namespace if not known yet | |
| 772 | + if ($reqprop["xmlns"] != "DAV:" && !isset($ns_hash[$reqprop["xmlns"]])) { | |
| 773 | + $ns_name = "ns".(count($ns_hash) + 1); | |
| 774 | + $ns_hash[$reqprop["xmlns"]] = $ns_name; | |
| 775 | + $ns_defs .= " xmlns:$ns_name=\"$reqprop[xmlns]\""; | |
| 776 | + } | |
| 777 | + } | |
| 778 | + } | |
| 779 | + } | |
| 780 | + } | |
| 781 | + } | |
| 782 | + | |
| 783 | + // now we generate the reply header ... | |
| 784 | + $this->http_status("207 Multi-Status"); | |
| 785 | + header('Content-Type: text/xml; charset="utf-8"'); | |
| 786 | + | |
| 787 | + // ... and payload | |
| 788 | + echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; | |
| 789 | + echo "<D:multistatus xmlns:D=\"DAV:\">\n"; | |
| 790 | + | |
| 791 | + foreach($files["files"] as $file) { | |
| 792 | + // ignore empty or incomplete entries | |
| 793 | + if(!is_array($file) || empty($file) || !isset($file["path"])) continue; | |
| 794 | + $path = $file['path']; | |
| 795 | + if(!is_string($path) || $path==='') continue; | |
| 796 | + | |
| 797 | + echo " <D:response $ns_defs>\n"; | |
| 798 | + | |
| 799 | + $href = htmlspecialchars($this->_slashify($this->_mergePathes($_SERVER['SCRIPT_NAME'], $path))); | |
| 800 | + | |
| 801 | + echo " <D:href>$href</D:href>\n"; | |
| 802 | + | |
| 803 | + $this->ktwebdavLog("\nfile is: " . print_r($file, true), 'info', true); | |
| 804 | + | |
| 805 | + // report all found properties and their values (if any) | |
| 806 | + if (isset($file["props"]) && is_array($file["props"])) { | |
| 807 | + echo " <D:propstat>\n"; | |
| 808 | + echo " <D:prop>\n"; | |
| 809 | + | |
| 810 | + foreach($file["props"] as $key => $prop) { | |
| 811 | + | |
| 812 | + if (!is_array($prop)) continue; | |
| 813 | + if (!isset($prop["name"])) continue; | |
| 814 | + | |
| 815 | + $this->ktwebdavLog("Namespace is " . $prop["ns"], 'info', true); | |
| 816 | + | |
| 817 | + if (!isset($prop["val"]) || $prop["val"] === '' || $prop["val"] === false) { | |
| 818 | + // empty properties (cannot use empty() for check as "0" is a legal value here) | |
| 819 | + if($prop["ns"]=="DAV:") { | |
| 820 | + echo " <D:$prop[name]/>\n"; | |
| 821 | + } else if(!empty($prop["ns"])) { | |
| 822 | + echo " <".$ns_hash[$prop["ns"]].":$prop[name]/>\n"; | |
| 823 | + } else { | |
| 824 | + echo " <$prop[name] xmlns=\"\"/>"; | |
| 825 | + } | |
| 826 | + } else if ($prop["ns"] == "DAV:") { | |
| 827 | + $this->ktwebdavLog("Getting DAV: Properties...", 'info', true); | |
| 828 | + // some WebDAV properties need special treatment | |
| 829 | + switch ($prop["name"]) { | |
| 830 | + case "creationdate": | |
| 831 | + $this->ktwebdavLog("Getting creationdate...", 'info', true); | |
| 832 | + echo " <D:creationdate ns0:dt=\"dateTime.tz\">" | |
| 833 | + . gmdate("Y-m-d\\TH:i:s\\Z",$prop['val']) | |
| 834 | + . "</D:creationdate>\n"; | |
| 835 | + break; | |
| 836 | + case "getlastmodified": | |
| 837 | + $this->ktwebdavLog("Getting getlastmodified...", 'info', true); | |
| 838 | + echo " <D:getlastmodified ns0:dt=\"dateTime.rfc1123\">" | |
| 839 | + . gmdate("D, d M Y H:i:s ", $prop['val']) | |
| 840 | + . "GMT</D:getlastmodified>\n"; | |
| 841 | + break; | |
| 842 | + case "resourcetype": | |
| 843 | + $this->ktwebdavLog("Getting resourcetype...", 'info', true); | |
| 844 | + echo " <D:resourcetype><D:$prop[val]/></D:resourcetype>\n"; | |
| 845 | + break; | |
| 846 | + case "supportedlock": | |
| 847 | + $this->ktwebdavLog("Getting supportedlock...", 'info', true); | |
| 848 | + echo " <D:supportedlock>$prop[val]</D:supportedlock>\n"; | |
| 849 | + break; | |
| 850 | + case "lockdiscovery": | |
| 851 | + $this->ktwebdavLog("Getting lockdiscovery...", 'info', true); | |
| 852 | + echo " <D:lockdiscovery>\n"; | |
| 853 | + echo $prop["val"]; | |
| 854 | + echo " </D:lockdiscovery>\n"; | |
| 855 | + break; | |
| 856 | + default: | |
| 857 | + $this->ktwebdavLog("Getting default...", 'info', true); | |
| 858 | + $this->ktwebdavLog("name is: " . $prop['name'], 'info', true); | |
| 859 | + $this->ktwebdavLog("val is: " . $this->_prop_encode(htmlspecialchars($prop['val'])), 'info', true); | |
| 860 | + echo " <D:" . $prop['name'] .">" | |
| 861 | + . $this->_prop_encode(htmlspecialchars($prop['val'])) | |
| 862 | + . "</D:" . $prop['name'] . ">\n"; | |
| 863 | + break; | |
| 864 | + } | |
| 865 | + } else { | |
| 866 | + // properties from namespaces != "DAV:" or without any namespace | |
| 867 | + $this->ktwebdavLog('Getting != "DAV:" or without any namespace Properties...', 'info', true); | |
| 868 | + if ($prop["ns"]) { | |
| 869 | + echo " <" . $ns_hash[$prop["ns"]] . ":$prop[name]>" | |
| 870 | + . $this->_prop_encode(htmlspecialchars($prop['val'])) | |
| 871 | + . "</" . $ns_hash[$prop["ns"]] . ":$prop[name]>\n"; | |
| 872 | + } else { | |
| 873 | + echo " <$prop[name] xmlns=\"\">" | |
| 874 | + . $this->_prop_encode(htmlspecialchars($prop['val'])) | |
| 875 | + . "</$prop[name]>\n"; | |
| 876 | + } | |
| 877 | + } | |
| 878 | + } | |
| 879 | + | |
| 880 | + echo " </D:prop>\n"; | |
| 881 | + echo " <D:status>HTTP/1.1 200 OK</D:status>\n"; | |
| 882 | + echo " </D:propstat>\n"; | |
| 883 | + } | |
| 884 | + | |
| 885 | + // now report all properties requested but not found | |
| 886 | + $this->ktwebdavLog('Getting all properties requested but not found...', 'info', true); | |
| 887 | + if (isset($file["noprops"])) { | |
| 888 | + echo " <D:propstat>\n"; | |
| 889 | + echo " <D:prop>\n"; | |
| 890 | + | |
| 891 | + foreach($file["noprops"] as $key => $prop) { | |
| 892 | + if ($prop["ns"] == "DAV:") { | |
| 893 | + echo " <D:$prop[name]/>\n"; | |
| 894 | + } else if ($prop["ns"] == '') { | |
| 895 | + echo " <$prop[name] xmlns=\"\"/>\n"; | |
| 896 | + } else { | |
| 897 | + echo " <" . $ns_hash[$prop["ns"]] . ":$prop[name]/>\n"; | |
| 898 | + } | |
| 899 | + } | |
| 900 | + | |
| 901 | + echo " </D:prop>\n"; | |
| 902 | + echo " <D:status>HTTP/1.1 404 Not Found</D:status>\n"; | |
| 903 | + echo " </D:propstat>\n"; | |
| 904 | + } | |
| 905 | + | |
| 906 | + echo " </D:response>\n"; | |
| 907 | + } | |
| 908 | + | |
| 909 | + echo "</D:multistatus>\n"; | |
| 910 | + } | |
| 911 | + | |
| 912 | + /** | |
| 913 | + * PROPFIND helper for Folder Info | |
| 914 | + * | |
| 915 | + * @param int Folder ID | |
| 916 | + * @param string path | |
| 917 | + * @return array Folder info array | |
| 918 | + */ | |
| 919 | + function _fileinfoForFolderID($iFolderID, $path) { | |
| 920 | + | |
| 921 | + global $default; | |
| 922 | + | |
| 923 | + $this->ktwebdavLog("Entering _fileinfoForFolderID. FolderID is " . $iFolderID, 'info', true); | |
| 924 | + | |
| 925 | + if($iFolderID == '') return false; | |
| 926 | + | |
| 927 | + $oFolder =& Folder::get($iFolderID); | |
| 928 | + | |
| 929 | + if (is_null($oFolder) || ($oFolder === false)) { | |
| 930 | + $this->ktwebdavLog("oFolderID error. ", 'info', true); | |
| 931 | + return false; | |
| 932 | + } | |
| 933 | + | |
| 934 | + return $this->_fileinfoForFolder($oFolder, $path); | |
| 935 | + } | |
| 936 | + | |
| 937 | + /** | |
| 938 | + * GET method handler | |
| 939 | + * | |
| 940 | + * @param array parameter passing array | |
| 941 | + * @return bool true on success | |
| 942 | + */ | |
| 943 | + function GET(&$options) | |
| 944 | + { | |
| 945 | + // required for KT | |
| 946 | + global $default; | |
| 947 | + | |
| 948 | + $this->ktwebdavLog("Entering GET. options are " . print_r($options, true), 'info', true); | |
| 949 | + | |
| 950 | + // Get the client info | |
| 951 | + $this->checkSafeMode(); | |
| 952 | + | |
| 953 | + // get path to requested resource | |
| 954 | + $path = $options["path"]; | |
| 955 | + | |
| 956 | + list($iFolderID, $iDocumentID) = $this->_folderOrDocument($path); | |
| 957 | + | |
| 958 | + if ($iDocumentID === false) { | |
| 959 | + $this->ktwebdavLog("Document not found.", 'info', true); | |
| 960 | + return "404 Not found - Document not found."; | |
| 961 | + } | |
| 962 | + | |
| 963 | + if (is_null($iDocumentID)) { | |
| 964 | + return $this->_GETFolder($options, $iFolderID); | |
| 965 | + } | |
| 966 | + return $this->_GETDocument($options, $iDocumentID); | |
| 967 | + | |
| 968 | + } | |
| 969 | + | |
| 970 | + /** | |
| 971 | + * GET method helper | |
| 972 | + * | |
| 973 | + * @param array parameter passing array | |
| 974 | + * @param int MainFolder ID | |
| 975 | + * @return bool true on success | |
| 976 | + */ | |
| 977 | + function _GETFolder(&$options, $iMainFolderID) { | |
| 978 | + | |
| 979 | + global $default; | |
| 980 | + | |
| 981 | + $this->ktwebdavLog("Entering _GETFolder. options are " . print_r($options, true), 'info', true); | |
| 982 | + | |
| 983 | + $oMainFolder =& Folder::get($iMainFolderID); | |
| 984 | + $aFolderID = array(); | |
| 985 | + $aChildren = Folder::getList(array('parent_id = ?', $iMainFolderID)); | |
| 986 | + // $sFolderName = $oMainFolder->getName(); | |
| 987 | + | |
| 988 | + if (is_writeable("../var") && is_writeable("../var/log")) { | |
| 989 | + $writeperms = "<font color=\"green\"><b>OK</b></font>"; | |
| 990 | + }else { | |
| 991 | + $writeperms = "<font color=\"red\"><b>NOT SET</b></font>"; | |
| 992 | + } | |
| 993 | + | |
| 994 | + if ($this->ktdmsPath != '') { | |
| 995 | + $ktdir = $this->ktdmsPath; | |
| 996 | + } | |
| 997 | + | |
| 998 | + $srv_proto = split('/', $_SERVER['SERVER_PROTOCOL']); | |
| 999 | + | |
| 1000 | + $data = "<html><head><title>KTWebDAV - The KnowledgeTree WebDAV Server</title></head>"; | |
| 1001 | + $data .= "<body>"; | |
| 1002 | + $data .= "<div align=\"center\"><IMG src=\"../resources/graphics/ktlogo-topbar_base.png\" width=\"308\" height=\"61\" border=\"0\"></div><br>"; | |
| 1003 | + $data .= "<div align=\"center\"><h2><strong>Welcome to KnowledgeTree WebDAV Server</strong></h2></div><br><br>"; | |
| 1004 | + $data .= "<div align=\"center\">To access KTWebDAV copy the following URL and paste it into your WebDAV enabled client...</div><br><br>"; | |
| 1005 | + $data .= "<div align=\"center\"><strong>" . strtolower($srv_proto[0]) . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "</strong></div>"; | |
| 1006 | + $data .= "</body>"; | |
| 1007 | + | |
| 1008 | + $options['mimetype'] = 'text/html'; | |
| 1009 | + $options["data"] = $data; | |
| 1010 | + return true; | |
| 1011 | + } | |
| 1012 | + | |
| 1013 | + /** | |
| 1014 | + * GET method helper | |
| 1015 | + * | |
| 1016 | + * @param array parameter passing array | |
| 1017 | + * @param int Document ID | |
| 1018 | + * @return bool true on success | |
| 1019 | + */ | |
| 1020 | + function _GETDocument(&$options, $iDocumentID) { | |
| 1021 | + global $default; | |
| 1022 | + | |
| 1023 | + $oDocument =& Document::get($iDocumentID); | |
| 1024 | + | |
| 1025 | + // get a temp file, and read. NOTE: NEVER WRITE TO THIS | |
| 1026 | + $oStorage =& KTStorageManagerUtil::getSingleton(); | |
| 1027 | + $fspath = $oStorage->temporaryFile($oDocument); | |
| 1028 | + | |
| 1029 | + $this->ktwebdavLog("Filesystem Path is " . $fspath, 'info', true ); | |
| 1030 | + | |
| 1031 | + // detect resource type | |
| 1032 | + $mimetype = KTMime::getMimeTypeName($oDocument->getMimeTypeID()); | |
| 1033 | + $options['mimetype'] = KTMime::getFriendlyNameForString($mimetype); | |
| 1034 | + // detect modification time | |
| 1035 | + // see rfc2518, section 13.7 | |
| 1036 | + // some clients seem to treat this as a reverse rule | |
| 1037 | + // requiering a Last-Modified header if the getlastmodified header was set | |
| 1038 | + | |
| 1039 | + $options['mtime'] = $oDocument->getVersionCreated(); | |
| 1040 | + | |
| 1041 | + // detect resource size | |
| 1042 | + $options['size'] = $oDocument->getFileSize(); | |
| 1043 | + | |
| 1044 | + // no need to check result here, it is handled by the base class | |
| 1045 | + $options['stream'] = fopen($fspath, "r"); | |
| 1046 | + | |
| 1047 | + $this->ktwebdavLog("Method is " . $this->currentMethod, 'info', true ); | |
| 1048 | + | |
| 1049 | + if ($this->currentMethod == "get") { | |
| 1050 | + | |
| 1051 | + // create the document transaction record | |
| 1052 | + include_once(KT_LIB_DIR . '/documentmanagement/DocumentTransaction.inc'); | |
| 1053 | + $oDocumentTransaction = & new DocumentTransaction($oDocument, "Document viewed via KTWebDAV", 'ktcore.transactions.view'); | |
| 1054 | + $oDocumentTransaction->iUserID = $this->userID; | |
| 1055 | + $oDocumentTransaction->create(); | |
| 1056 | + | |
| 1057 | + } | |
| 1058 | + return true; | |
| 1059 | + } | |
| 1060 | + | |
| 1061 | + /** | |
| 1062 | + * GET method helper | |
| 1063 | + * | |
| 1064 | + * @param string directory path | |
| 1065 | + * @return array or false | |
| 1066 | + */ | |
| 1067 | + function _folderOrDocument($path) { | |
| 1068 | + | |
| 1069 | + global $default; | |
| 1070 | + | |
| 1071 | + $this->ktwebdavLog("Entering _folderOrDocument. path is " . $path, 'info', true); | |
| 1072 | + | |
| 1073 | + if ( !(strstr($path,"__BAOBABCLIENT__") === false) ) { | |
| 1074 | + return array(0, 1); | |
| 1075 | + } | |
| 1076 | + | |
| 1077 | + $sFileName = basename($path); | |
| 1078 | + // for windows replace backslash with forwardslash | |
| 1079 | + $sFolderPath = str_replace("\\", '/', dirname($path) ); | |
| 1080 | + | |
| 1081 | + if ($sFolderPath == "/" || $sFolderPath == "/ktwebdav") { | |
| 1082 | + $this->ktwebdavLog("This is the root folder.", 'info', true); | |
| 1083 | + $sFolderPath = $this->rootFolder; | |
| 1084 | + $iFolderID = 0; | |
| 1085 | + } else $iFolderID = 1; | |
| 1086 | + if ($sFileName == "ktwebdav.php") { | |
| 1087 | + $this->ktwebdavLog("This is the root folder file.", 'info', true); | |
| 1088 | + $sFileName = ''; | |
| 1089 | + } | |
| 1090 | + | |
| 1091 | + $this->ktwebdavLog("sFileName is " . $sFileName, 'info', true); | |
| 1092 | + $this->ktwebdavLog("sFolderName is " . $sFolderPath, 'info', true); | |
| 1093 | + $this->ktwebdavLog("iFolderID is " . $iFolderID, 'info', true); | |
| 1094 | + | |
| 1095 | + $aFolderNames = split('/', $sFolderPath); | |
| 1096 | + | |
| 1097 | + $this->ktwebdavLog("aFolderNames are: " . print_r($aFolderNames, true), 'info', true); | |
| 1098 | + $aRemaining = $aFolderNames; | |
| 1099 | + while (count($aRemaining)) { | |
| 1100 | + $sFolderName = $aRemaining[0]; | |
| 1101 | + $aRemaining = array_slice($aRemaining, 1); | |
| 1102 | + if ($sFolderName == '') { | |
| 1103 | + continue; | |
| 1104 | + } | |
| 1105 | + // FIXME: Direct database access | |
| 1106 | + $sQuery = "SELECT id FROM folders WHERE parent_id = ? AND name = ?"; | |
| 1107 | + $aParams = array($iFolderID, $sFolderName); | |
| 1108 | + $id = DBUtil::getOneResultKey(array($sQuery, $aParams), 'id'); | |
| 1109 | + if (PEAR::isError($id)) { | |
| 1110 | + $this->ktwebdavLog("A DB error occurred in _folderOrDocument", 'info', true); | |
| 1111 | + return false; | |
| 1112 | + } | |
| 1113 | + if (is_null($id)) { | |
| 1114 | + // Some intermediary folder path doesn't exist | |
| 1115 | + $this->ktwebdavLog("Some intermediary folder does not exist in _folderOrDocument", 'error', true); | |
| 1116 | + return array(false, false); | |
| 1117 | + } | |
| 1118 | + $iFolderID = (int)$id; | |
| 1119 | + $this->ktwebdavLog("iFolderID set to " . $iFolderID, 'info', true); | |
| 1120 | + } | |
| 1121 | + | |
| 1122 | + // FIXME: Direct database access | |
| 1123 | + // $sQuery = "SELECT id FROM documents WHERE folder_id = ? AND filename = ? AND status_id = 1"; | |
| 1124 | + $sQuery = "SELECT D.id "; | |
| 1125 | + $sQuery .= "FROM documents AS D "; | |
| 1126 | + $sQuery .= "LEFT JOIN document_metadata_version AS DM "; | |
| 1127 | + $sQuery .= "ON D.metadata_version_id = DM.id "; | |
| 1128 | + $sQuery .= "LEFT JOIN document_content_version AS DC "; | |
| 1129 | + $sQuery .= "ON DM.content_version_id = DC.id "; | |
| 1130 | + $sQuery .= "WHERE D.folder_id = ? AND DC.filename = ?"; | |
| 1131 | + | |
| 1132 | + $aParams = array($iFolderID, $sFileName); | |
| 1133 | + $iDocumentID = DBUtil::getOneResultKey(array($sQuery, $aParams), 'id'); | |
| 1134 | + | |
| 1135 | + if (PEAR::isError($iDocumentID)) { | |
| 1136 | + $this->ktwebdavLog("iDocumentID error in _folderOrDocument", 'info', true); | |
| 1137 | + return false; | |
| 1138 | + } | |
| 1139 | + | |
| 1140 | + if ($iDocumentID === null) { | |
| 1141 | + $this->ktwebdavLog("iDocumentID is null", 'info', true); | |
| 1142 | + // FIXME: Direct database access | |
| 1143 | + $sQuery = "SELECT id FROM folders WHERE parent_id = ? AND name = ?"; | |
| 1144 | + $aParams = array($iFolderID, $sFileName); | |
| 1145 | + $id = DBUtil::getOneResultKey(array($sQuery, $aParams), 'id'); | |
| 1146 | + if (PEAR::isError($id)) { | |
| 1147 | + $this->ktwebdavLog("A DB(2) error occurred in _folderOrDocument", 'info', true); | |
| 1148 | + return false; | |
| 1149 | + } | |
| 1150 | + if (is_null($id)) { | |
| 1151 | + if ($sFileName == '') { | |
| 1152 | + return array($iFolderID, null); | |
| 1153 | + } | |
| 1154 | + $this->ktwebdavLog("id is null in _folderOrDocument", 'info', true); | |
| 1155 | + return array($iFolderID, false); | |
| 1156 | + } | |
| 1157 | + if (substr($path, -1) !== "/") { | |
| 1158 | + $this->ktwebdavLog("Setting Location Header to " . "Location: " . $_SERVER["PHP_SELF"] . "/", 'info', true); | |
| 1159 | + header("Location: " . $_SERVER["PHP_SELF"] . "/"); | |
| 1160 | + } | |
| 1161 | + return array($id, null); | |
| 1162 | + } | |
| 1163 | + | |
| 1164 | + return array($iFolderID, (int)$iDocumentID); | |
| 1165 | + } | |
| 1166 | + | |
| 1167 | + /** | |
| 1168 | + * PUT method handler | |
| 1169 | + * | |
| 1170 | + * @param array parameter passing array | |
| 1171 | + * @return string HTTP status code or false | |
| 1172 | + */ | |
| 1173 | + function PUT(&$options) | |
| 1174 | + { | |
| 1175 | + global $default; | |
| 1176 | + | |
| 1177 | + if ($this->checkSafeMode()) { | |
| 1178 | + | |
| 1179 | + $this->ktwebdavLog("Entering PUT. options are " . print_r($options, true), 'info', true); | |
| 1180 | + $this->ktwebdavLog("dav_client is: " . $this->dav_client, 'info', true); | |
| 1181 | + | |
| 1182 | + $path = $options["path"]; | |
| 1183 | + | |
| 1184 | + $res = $this->_folderOrDocument($path); | |
| 1185 | + list($iFolderID, $iDocumentID) = $res; | |
| 1186 | + | |
| 1187 | + if ($iDocumentID === false && $iFolderID === false) { | |
| 1188 | + // Couldn't find intermediary paths | |
| 1189 | + /* | |
| 1190 | + * RFC2518: 8.7.1 PUT for Non-Collection Resources | |
| 1191 | + * | |
| 1192 | + * 409 (Conflict) - A PUT that would result in the creation | |
| 1193 | + * of a resource without an appropriately scoped parent collection | |
| 1194 | + * MUST fail with a 409 (Conflict). | |
| 1195 | + */ | |
| 1196 | + return "409 Conflict - Couldn't find intermediary paths"; | |
| 1197 | + } | |
| 1198 | + | |
| 1199 | + $oParentFolder =& Folder::get($iFolderID); | |
| 1200 | + // Check if the user has permissions to write in this folder | |
| 1201 | + $oPerm =& KTPermission::getByName('ktcore.permissions.write'); | |
| 1202 | + $oUser =& User::get($this->userID); | |
| 1203 | + if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oParentFolder)) { | |
| 1204 | + return "403 Forbidden - User does not have sufficient permissions"; | |
| 1205 | + } | |
| 1206 | + | |
| 1207 | + $this->ktwebdavLog("iDocumentID is " . $iDocumentID, 'info', true); | |
| 1208 | + | |
| 1209 | + if (is_null($iDocumentID)) { | |
| 1210 | + // This means there is a folder with the given path | |
| 1211 | + $this->ktwebdavLog("405 Method not allowed", 'info', true); | |
| 1212 | + return "405 Method not allowed - There is a folder with the given path"; | |
| 1213 | + } | |
| 1214 | + | |
| 1215 | + if ($iDocumentID == false) { | |
| 1216 | + $this->ktwebdavLog("iDocumentID is false", 'info', true); | |
| 1217 | + } | |
| 1218 | + | |
| 1219 | + if ($iDocumentID !== false) { | |
| 1220 | + // This means there is a document with the given path | |
| 1221 | + $oDocument = Document::get($iDocumentID); | |
| 1222 | + | |
| 1223 | + $this->ktwebdavLog("oDocument is " . print_r($oDocument, true), 'info', true); | |
| 1224 | + $this->ktwebdavLog("oDocument statusid is " . print_r($oDocument->getStatusID(), true), 'info', true); | |
| 1225 | + | |
| 1226 | + if ( ( (int)$oDocument->getStatusID() != STATUS_WEBDAV ) && ( (int)$oDocument->getStatusID() != DELETED )) { | |
| 1227 | + $this->ktwebdavLog("Trying to PUT to an existing document", 'info', true); | |
| 1228 | + if (!$this->dav_client == "MS" && !$this->dav_client == "MC") return "409 Conflict - There is a document with the given path"; | |
| 1229 | + } | |
| 1230 | + | |
| 1231 | + // FIXME: Direct filesystem access | |
| 1232 | + $fh = $options["stream"]; | |
| 1233 | + $sTempFilename = tempnam('/tmp', 'ktwebdav_dav_put'); | |
| 1234 | + $ofh = fopen($sTempFilename, 'w'); | |
| 1235 | + | |
| 1236 | + $contents = ''; | |
| 1237 | + while (!feof($fh)) { | |
| 1238 | + $contents .= fread($fh, 8192); | |
| 1239 | + } | |
| 1240 | + $fres = fwrite($ofh, $contents); | |
| 1241 | + $this->ktwebdavLog("A DELETED or CHECKEDOUT document exists. Overwriting...", 'info', true); | |
| 1242 | + $this->ktwebdavLog("Temp Filename is: " . $sTempFilename, 'info', true ); | |
| 1243 | + $this->ktwebdavLog("File write result size was: " . $fres, 'info', true ); | |
| 1244 | + | |
| 1245 | + fflush($fh); | |
| 1246 | + fclose($fh); | |
| 1247 | + fflush($ofh); | |
| 1248 | + fclose($ofh); | |
| 1249 | + $this->ktwebdavLog("Files have been flushed and closed.", 'info', true ); | |
| 1250 | + | |
| 1251 | + $name = basename($path); | |
| 1252 | + $aFileArray = array( | |
| 1253 | + "name" => $name, | |
| 1254 | + "size" => filesize($sTempFilename), | |
| 1255 | + "type" => false, | |
| 1256 | + "userID" => $this->_getUserID(), | |
| 1257 | + ); | |
| 1258 | + $this->ktwebdavLog("aFileArray is " . print_r($aFileArray, true), 'info', true); | |
| 1259 | + | |
| 1260 | + include_once(KT_LIB_DIR . '/filelike/fsfilelike.inc.php'); | |
| 1261 | + $aOptions = array( | |
| 1262 | + 'contents' => new KTFSFileLike($sTempFilename), | |
| 1263 | + 'metadata' => array(), | |
| 1264 | + 'novalidate' => true, | |
| 1265 | + ); | |
| 1266 | + $oDocument =& KTDocumentUtil::add($oParentFolder, $name, $oUser, $aOptions); | |
| 1267 | + | |
| 1268 | + if(PEAR::isError($oDocument)) { | |
| 1269 | + $this->ktwebdavLog("oDocument ERROR: " . $oDocument->getMessage(), 'info', true); | |
| 1270 | + unlink($sTempFilename); | |
| 1271 | + return "409 Conflict - " . $oDocument->getMessage(); | |
| 1272 | + } | |
| 1273 | + | |
| 1274 | + $this->ktwebdavLog("oDocument is " . print_r($oDocument, true), 'info', true); | |
| 1275 | + | |
| 1276 | + unlink($sTempFilename); | |
| 1277 | + return "204 No Content"; | |
| 1278 | + } | |
| 1279 | + | |
| 1280 | + $options["new"] = true; | |
| 1281 | + // FIXME: Direct filesystem access | |
| 1282 | + $fh = $options["stream"]; | |
| 1283 | + $sTempFilename = tempnam('/tmp', 'ktwebdav_dav_put'); | |
| 1284 | + $ofh = fopen($sTempFilename, 'w'); | |
| 1285 | + | |
| 1286 | + $contents = ''; | |
| 1287 | + while (!feof($fh)) { | |
| 1288 | + $contents .= fread($fh, 8192); | |
| 1289 | + } | |
| 1290 | + $fres = fwrite( $ofh, $contents); | |
| 1291 | + $this->ktwebdavLog("Content length was not 0, doing the whole thing.", 'info', true ); | |
| 1292 | + $this->ktwebdavLog("Temp Filename is: " . $sTempFilename, 'info', true ); | |
| 1293 | + $this->ktwebdavLog("File write result size was: " . $fres, 'info', true ); | |
| 1294 | + | |
| 1295 | + fflush($fh); | |
| 1296 | + fclose($fh); | |
| 1297 | + fflush($ofh); | |
| 1298 | + fclose($ofh); | |
| 1299 | + $this->ktwebdavLog("Files have been flushed and closed.", 'info', true ); | |
| 1300 | + | |
| 1301 | + $name = basename($path); | |
| 1302 | + $aFileArray = array( | |
| 1303 | + "name" => $name, | |
| 1304 | + "size" => filesize($sTempFilename), | |
| 1305 | + "type" => false, | |
| 1306 | + "userID" => $this->_getUserID(), | |
| 1307 | + ); | |
| 1308 | + $this->ktwebdavLog("aFileArray is " . print_r($aFileArray, true), 'info', true); | |
| 1309 | + | |
| 1310 | + include_once(KT_LIB_DIR . '/filelike/fsfilelike.inc.php'); | |
| 1311 | + $aOptions = array( | |
| 1312 | + 'contents' => new KTFSFileLike($sTempFilename), | |
| 1313 | + 'metadata' => array(), | |
| 1314 | + 'novalidate' => true, | |
| 1315 | + ); | |
| 1316 | + $oDocument =& KTDocumentUtil::add($oParentFolder, $name, $oUser, $aOptions); | |
| 1317 | + | |
| 1318 | + if(PEAR::isError($oDocument)) { | |
| 1319 | + $this->ktwebdavLog("oDocument ERROR: " . $oDocument->getMessage(), 'info', true); | |
| 1320 | + unlink($sTempFilename); | |
| 1321 | + return "409 Conflict - " . $oDocument->getMessage(); | |
| 1322 | + } | |
| 1323 | + | |
| 1324 | + $this->ktwebdavLog("oDocument is " . print_r($oDocument, true), 'info', true); | |
| 1325 | + | |
| 1326 | + unlink($sTempFilename); | |
| 1327 | + return "201 Created"; | |
| 1328 | + | |
| 1329 | + } else return "423 Locked - KTWebDAV is in SafeMode"; | |
| 1330 | + | |
| 1331 | + } | |
| 1332 | + | |
| 1333 | + /** | |
| 1334 | + * MKCOL method handler | |
| 1335 | + * | |
| 1336 | + * @param array parameter passing array | |
| 1337 | + * @return string HTTP status code or false | |
| 1338 | + */ | |
| 1339 | + function MKCOL($options) | |
| 1340 | + { | |
| 1341 | + $this->ktwebdavLog("Entering MKCOL. options are " . print_r($options, true), 'info', true); | |
| 1342 | + | |
| 1343 | + if ($this->checkSafeMode()) { | |
| 1344 | + | |
| 1345 | + global $default; | |
| 1346 | + | |
| 1347 | + if (!empty($_SERVER["CONTENT_LENGTH"])) { | |
| 1348 | + /* | |
| 1349 | + * RFC2518: 8.3.2 MKCOL status codes | |
| 1350 | + * | |
| 1351 | + * 415 (Unsupported Media Type)- The server does not support | |
| 1352 | + * the request type of the body. | |
| 1353 | + */ | |
| 1354 | + return "415 Unsupported media type"; | |
| 1355 | + } | |
| 1356 | + | |
| 1357 | + // Take Windows's escapes out | |
| 1358 | + $path = str_replace('\\', '' , $options['path']); | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + $res = $this->_folderOrDocument($path); | |
| 1362 | + list($iFolderID, $iDocumentID) = $res; | |
| 1363 | + | |
| 1364 | + if ($iDocumentID === false && $iFolderID === false) { | |
| 1365 | + // Couldn't find intermediary paths | |
| 1366 | + /* | |
| 1367 | + * RFC2518: 8.3.2 MKCOL status codes | |
| 1368 | + * | |
| 1369 | + * 409 (Conflict) - A collection cannot be made at the | |
| 1370 | + * Request-URI until one or more intermediate collections | |
| 1371 | + * have been created. | |
| 1372 | + */ | |
| 1373 | + $this->ktwebdavLog("409 Conflict in MKCOL", 'info', true); | |
| 1374 | + return "409 Conflict - Couldn't find intermediary paths"; | |
| 1375 | + } | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + if (is_null($iDocumentID)) { | |
| 1379 | + // This means there is a folder with the given path | |
| 1380 | + /* | |
| 1381 | + * RFC2518: 8.3.2 MKCOL status codes | |
| 1382 | + * | |
| 1383 | + * 405 (Method Not Allowed) - MKCOL can only be executed on | |
| 1384 | + * a deleted/non-existent resource. | |
| 1385 | + */ | |
| 1386 | + $this->ktwebdavLog("405 Method not allowed - There is a folder with the given path", 'info', true); | |
| 1387 | + return "405 Method not allowed - There is a folder with the given path"; | |
| 1388 | + } | |
| 1389 | + if ($iDocumentID !== false) { | |
| 1390 | + // This means there is a document with the given path | |
| 1391 | + /* | |
| 1392 | + * RFC2518: 8.3.2 MKCOL status codes | |
| 1393 | + * | |
| 1394 | + * 405 (Method Not Allowed) - MKCOL can only be executed on | |
| 1395 | + * a deleted/non-existent resource. | |
| 1396 | + */ | |
| 1397 | + $this->ktwebdavLog("405 Method not allowed - There is a document with the given path", 'info', true); | |
| 1398 | + return "405 Method not allowed - There is a document with the given path"; | |
| 1399 | + } | |
| 1400 | + | |
| 1401 | + $sFolderName = basename($path); | |
| 1402 | + $sFolderPath = dirname($path); | |
| 1403 | + | |
| 1404 | + $dest_fspath = $default->documentRoot . "/" . $this->rootFolder . $path; | |
| 1405 | + $this->ktwebdavLog("Will create a physical path of " . $dest_fspath, 'info', true); | |
| 1406 | + | |
| 1407 | + $oParentFolder =& Folder::get($iFolderID); | |
| 1408 | + $this->ktwebdavLog("Got an oParentFolder of " . print_r($oParentFolder, true), 'info', true); | |
| 1409 | + | |
| 1410 | + // Check if the user has permissions to write in this folder | |
| 1411 | + $oPerm =& KTPermission::getByName('ktcore.permissions.addFolder'); | |
| 1412 | + $oUser =& User::get($this->userID); | |
| 1413 | + | |
| 1414 | + $this->ktwebdavLog("oPerm is " . print_r($oPerm, true), 'info', true); | |
| 1415 | + $this->ktwebdavLog("oUser is " . print_r($oUser, true), 'info', true); | |
| 1416 | + $this->ktwebdavLog("oFolder is " . print_r($oParentFolder, true), 'info', true); | |
| 1417 | + | |
| 1418 | + if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oParentFolder)) { | |
| 1419 | + $this->ktwebdavLog("Permission denied.", 'info', true); | |
| 1420 | + return "403 Forbidden - User does not have sufficient permissions"; | |
| 1421 | + } else $this->ktwebdavLog("Permission granted.", 'info', true); | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + include_once(KT_LIB_DIR . '/foldermanagement/folderutil.inc.php'); | |
| 1425 | + | |
| 1426 | + KTFolderUtil::add($oParentFolder, $sFolderName, $oUser); | |
| 1427 | + /* | |
| 1428 | + * RFC 2518: 8.3.2 MKCOL status codes | |
| 1429 | + * | |
| 1430 | + * 201 (Created) - The collection or structured resource was | |
| 1431 | + * created in its entirety. | |
| 1432 | + */ | |
| 1433 | + $this->ktwebdavLog("201 Created", 'info', true); | |
| 1434 | + return "201 Created"; | |
| 1435 | + | |
| 1436 | + } else return "423 Locked - KTWebDAV is in SafeMode"; | |
| 1437 | + } | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + /** | |
| 1441 | + * DELETE method handler | |
| 1442 | + * | |
| 1443 | + * @param array parameter passing array | |
| 1444 | + * @return string HTTP status code or false | |
| 1445 | + */ | |
| 1446 | + function DELETE($options) | |
| 1447 | + { | |
| 1448 | + $this->ktwebdavLog("Entering DELETE. options are " . print_r($options, true), 'info', true); | |
| 1449 | + | |
| 1450 | + if ($this->checkSafeMode()) { | |
| 1451 | + | |
| 1452 | + $path = $options["path"]; | |
| 1453 | + $res = $this->_folderOrDocument($path); | |
| 1454 | + $this->ktwebdavLog("DELETE res is " . print_r($res, true), 'info', true); | |
| 1455 | + if ($res === false) { | |
| 1456 | + $this->ktwebdavLog("404 Not found - The Document was not found.", 'info', true); | |
| 1457 | + return "404 Not found - The Document was not found."; | |
| 1458 | + } | |
| 1459 | + list($iFolderID, $iDocumentID) = $res; | |
| 1460 | + | |
| 1461 | + if ($iDocumentID === false) { | |
| 1462 | + $this->ktwebdavLog("404 Not found - The Folder was not found.", 'info', true); | |
| 1463 | + return "404 Not found - The Folder was not found."; | |
| 1464 | + } | |
| 1465 | + | |
| 1466 | + if (is_null($iDocumentID)) { | |
| 1467 | + return $this->_DELETEFolder($options, $iFolderID); | |
| 1468 | + } | |
| 1469 | + return $this->_DELETEDocument($options, $iFolderID, $iDocumentID); | |
| 1470 | + | |
| 1471 | + } else return "423 Locked - KTWebDAV is in SafeMode"; | |
| 1472 | + } | |
| 1473 | + | |
| 1474 | + /** | |
| 1475 | + * DELETE method helper for Documents | |
| 1476 | + * | |
| 1477 | + * @param array parameter passing array | |
| 1478 | + * @param int Folder ID | |
| 1479 | + * @param int Document ID | |
| 1480 | + * @return string HTTP status code or false | |
| 1481 | + */ | |
| 1482 | + function _DELETEDocument($options, $iFolderID, $iDocumentID) { | |
| 1483 | + | |
| 1484 | + $this->ktwebdavLog("Entering _DELETEDocument. options are " . print_r($options, true), 'info', true); | |
| 1485 | + | |
| 1486 | + global $default; | |
| 1487 | + | |
| 1488 | + $oDocument =& Document::get($iDocumentID); | |
| 1489 | + | |
| 1490 | + // Check if the user has permissions to delete this document | |
| 1491 | + $oPerm =& KTPermission::getByName('ktcore.permissions.delete'); | |
| 1492 | + $oUser =& User::get($this->userID); | |
| 1493 | + if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oDocument)) { | |
| 1494 | + return "403 Forbidden - The user does not have sufficient permissions"; | |
| 1495 | + } | |
| 1496 | + | |
| 1497 | + $res = KTDocumentUtil::delete($oDocument, $_SERVER['HTTP_REASON']); | |
| 1498 | + | |
| 1499 | + if (PEAR::isError($res)) { | |
| 1500 | + $this->ktwebdavLog("404 Not Found - " . $res->getMessage(), 'info', true); | |
| 1501 | + return "404 Not Found - " . $res->getMessage(); | |
| 1502 | + } | |
| 1503 | + | |
| 1504 | + $this->ktwebdavLog("204 No Content", 'info', true); | |
| 1505 | + return "204 No Content"; | |
| 1506 | + } | |
| 1507 | + | |
| 1508 | + /** | |
| 1509 | + * DELETE method helper for Folders | |
| 1510 | + * | |
| 1511 | + * @param array paramter passing array | |
| 1512 | + * @param int Folder ID | |
| 1513 | + * @return string HTTP status code or false | |
| 1514 | + */ | |
| 1515 | + function _DELETEFolder($options, $iFolderID) { | |
| 1516 | + | |
| 1517 | + $this->ktwebdavLog("Entering _DELETEFolder. options are " . print_r($options, true), 'info', true); | |
| 1518 | + | |
| 1519 | + global $default; | |
| 1520 | + | |
| 1521 | + require_once(KT_LIB_DIR . "/foldermanagement/folderutil.inc.php"); | |
| 1522 | + | |
| 1523 | + // Check if the user has permissions to delete this folder | |
| 1524 | + $oFolder =& Folder::get($iFolderID); | |
| 1525 | + $oPerm =& KTPermission::getByName('ktcore.permissions.delete'); | |
| 1526 | + $oUser =& User::get($this->userID); | |
| 1527 | + if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oFolder)) { | |
| 1528 | + return "403 Forbidden - The user does not have sufficient permissions"; | |
| 1529 | + } | |
| 1530 | + $this->ktwebdavLog("Got an oFolder of " . print_r($oFolder, true), 'info', true); | |
| 1531 | + $this->ktwebdavLog("Got an oUser of " . print_r($oUser, true), 'info', true); | |
| 1532 | + $res = KTFolderUtil::delete($oFolder, $oUser, 'KTWebDAV Delete'); | |
| 1533 | + | |
| 1534 | + if (PEAR::isError($res)) { | |
| 1535 | + $this->ktwebdavLog("Delete Result error " . print_r($res, true), 'info', true); | |
| 1536 | + return "403 Forbidden - ".$res->getMessage(); | |
| 1537 | + } | |
| 1538 | + | |
| 1539 | + return "204 No Content"; | |
| 1540 | + } | |
| 1541 | + | |
| 1542 | + /** | |
| 1543 | + * MOVE method handler | |
| 1544 | + * | |
| 1545 | + * @param array parameter passing array | |
| 1546 | + * @return string HTTP status code or false | |
| 1547 | + */ | |
| 1548 | + function MOVE($options) | |
| 1549 | + { | |
| 1550 | + // Use the WebDAV standards way. | |
| 1551 | + // See rfc2518 Section 8.9 | |
| 1552 | + // This does a copy with delete | |
| 1553 | + // FIXME: This way does not retain document history and other info | |
| 1554 | + | |
| 1555 | + //return $this->COPY($options, true); | |
| 1556 | + | |
| 1557 | + // Use the KT way. | |
| 1558 | + // FIXME: This way does not allow overwrite | |
| 1559 | + | |
| 1560 | + $this->ktwebdavLog("Entering MOVE. options are " . print_r($options, true), 'info', true); | |
| 1561 | + | |
| 1562 | + if ($this->checkSafeMode()) { | |
| 1563 | + | |
| 1564 | + if (!empty($_SERVER["CONTENT_LENGTH"])) { // no body parsing yet | |
| 1565 | + $this->ktwebdavLog("415 Unsupported media type", 'info', true); | |
| 1566 | + return "415 Unsupported media type"; | |
| 1567 | + } | |
| 1568 | + | |
| 1569 | + /* // no moving to different WebDAV Servers yet | |
| 1570 | + if (isset($options["dest_url"])) { | |
| 1571 | + $this->ktwebdavLog("502 bad gateway - No moving to different WebDAV Servers yet", 'info', true); | |
| 1572 | + return "502 bad gateway - No moving to different WebDAV Servers yet"; | |
| 1573 | + } | |
| 1574 | + */ | |
| 1575 | + $source_path = $options["path"]; | |
| 1576 | + $source_res = $this->_folderOrDocument($source_path); | |
| 1577 | + if ($source_res === false) { | |
| 1578 | + $this->ktwebdavLog("404 Not found - Document was not found.", 'info', true); | |
| 1579 | + return "404 Not found - Document was not found."; | |
| 1580 | + } | |
| 1581 | + | |
| 1582 | + list($iFolderID, $iDocumentID) = $source_res; | |
| 1583 | + if ($iDocumentID === false) { | |
| 1584 | + $this->ktwebdavLog("404 Not found - Folder was not found.", 'info', true); | |
| 1585 | + return "404 Not found - Folder was not found."; | |
| 1586 | + } | |
| 1587 | + | |
| 1588 | + if (is_null($iDocumentID)) { | |
| 1589 | + // Source is a folder | |
| 1590 | + $movestat = $this->_MOVEFolder($options, $iFolderID); | |
| 1591 | + | |
| 1592 | + } else { | |
| 1593 | + // Source is a document | |
| 1594 | + $movestat = $this->_MOVEDocument($options, $iFolderID, $iDocumentID); | |
| 1595 | + | |
| 1596 | + } | |
| 1597 | + | |
| 1598 | + $this->ktwebdavLog("Final movestat result is: " . $movestat, 'info', true); | |
| 1599 | + return $movestat; | |
| 1600 | + | |
| 1601 | + } else return "423 Locked - KTWebDAV is in SafeMode"; | |
| 1602 | + | |
| 1603 | + } | |
| 1604 | + | |
| 1605 | + /** | |
| 1606 | + * MOVE method helper for Documents | |
| 1607 | + * | |
| 1608 | + * @param array parameter passing array | |
| 1609 | + * @param int Folder ID | |
| 1610 | + * @param int Document ID | |
| 1611 | + * @return string HTTP status code or false | |
| 1612 | + */ | |
| 1613 | + function _MOVEDocument($options, $iFolderID, $iDocumentID) { | |
| 1614 | + | |
| 1615 | + if ($options['dest'] == '') $options["dest"] = substr($options["dest_url"], strlen($_SERVER["SCRIPT_NAME"])); | |
| 1616 | + $this->ktwebdavLog("Entering _MOVEDocument. options are " . print_r($options, true), 'info', true); | |
| 1617 | + global $default; | |
| 1618 | + $new = true; | |
| 1619 | + //FIXME: refactor me into KTDocumentUtil | |
| 1620 | + | |
| 1621 | + $oDocument = Document::get($iDocumentID); | |
| 1622 | + $oSrcFolder = Folder::get($iFolderID); | |
| 1623 | + $oUser =& User::get($this->userID); | |
| 1624 | + | |
| 1625 | + $source_path = $options["path"]; | |
| 1626 | + $dest_path = urldecode($options["dest"]); | |
| 1627 | + | |
| 1628 | + // Is this a rename? | |
| 1629 | + if (dirname($source_path) == dirname($dest_path)) { | |
| 1630 | + // This is a rename | |
| 1631 | + //if ($options['overwrite'] != 'T') { | |
| 1632 | + // $this->ktwebdavLog("This is a Rename. Overwrite needs to be TRUE.", 'info', true); | |
| 1633 | + // return "412 Precondition Failed - This is a Rename. Overwrite needs to be TRUE."; | |
| 1634 | + //} | |
| 1635 | + $this->ktwebdavLog("Got an oDocument of " . print_r($oDocument, true), 'info', true); | |
| 1636 | + $this->ktwebdavLog("Got an new name of " . basename($dest_path), 'info', true); | |
| 1637 | + | |
| 1638 | + // Check if the user has permissions to write this document | |
| 1639 | + $oPerm =& KTPermission::getByName('ktcore.permissions.write'); | |
| 1640 | + $oUser =& User::get($this->userID); | |
| 1641 | + if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oDocument)) { | |
| 1642 | + return "403 Forbidden - User does not have sufficient permissions"; | |
| 1643 | + } | |
| 1644 | + $res = KTDocumentUtil::rename($oDocument, basename($dest_path), $oUser); | |
| 1645 | + if (PEAR::isError($res) || is_null($res) || ($res === false)) { | |
| 1646 | + return "404 Not Found - " . $res->getMessage(); | |
| 1647 | + } else { | |
| 1648 | + $this->ktwebdavLog("201 Created", 'info', true); | |
| 1649 | + return "201 Created"; | |
| 1650 | + } | |
| 1651 | + | |
| 1652 | + } | |
| 1653 | + | |
| 1654 | + list($iDestFolder, $iDestDoc) = $this->_folderOrDocument($dest_path); | |
| 1655 | + | |
| 1656 | + if (is_null($iDestDoc)) { | |
| 1657 | + // the dest is a folder | |
| 1658 | + } else if ($iDestDoc !== false) { | |
| 1659 | + // Document exists | |
| 1660 | + $this->ktwebdavLog("Destination Document exists.", 'info', true); | |
| 1661 | + $oReplaceDoc = Document::get($iDestDoc); | |
| 1662 | + if ($options['overwrite'] != 'T') { | |
| 1663 | + $this->ktwebdavLog("Overwrite needs to be TRUE.", 'info', true); | |
| 1664 | + return "412 Precondition Failed - Destination Document exists. Overwrite needs to be TRUE."; | |
| 1665 | + } | |
| 1666 | + $this->ktwebdavLog("Overwrite is TRUE, deleting Destination Document.", 'info', true); | |
| 1667 | + | |
| 1668 | + // Check if the user has permissions to delete this document | |
| 1669 | + $oPerm =& KTPermission::getByName('ktcore.permissions.delete'); | |
| 1670 | + $oUser =& User::get($this->userID); | |
| 1671 | + if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oReplaceDoc)) { | |
| 1672 | + return "403 Forbidden - User does not have sufficient permissions"; | |
| 1673 | + } | |
| 1674 | + KTDocumentUtil::delete($oReplaceDoc, 'KTWebDAV move overwrites target.'); | |
| 1675 | + $new = false; | |
| 1676 | + } | |
| 1677 | + | |
| 1678 | + $oDestFolder = Folder::get($iDestFolder); | |
| 1679 | + $this->ktwebdavLog("Got a destination folder of " . print_r($oDestFolder, true), 'info', true); | |
| 1680 | + | |
| 1681 | + // Check if the user has permissions to write in this folder | |
| 1682 | + $oPerm =& KTPermission::getByName('ktcore.permissions.write'); | |
| 1683 | + $oUser =& User::get($this->userID); | |
| 1684 | + if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oDestFolder)) { | |
| 1685 | + return "403 Forbidden - User does not have sufficient permissions"; | |
| 1686 | + } | |
| 1687 | + | |
| 1688 | + $oOriginalFolder = $oSrcFolder; | |
| 1689 | + $iOriginalFolderPermissionObjectId = $oOriginalFolder->getPermissionObjectId(); | |
| 1690 | + $iDocumentPermissionObjectId = $oDocument->getPermissionObjectId(); | |
| 1691 | + | |
| 1692 | + if ($iDocumentPermissionObjectId === $iOriginalFolderPermissionObjectId) { | |
| 1693 | + $oDocument->setPermissionObjectId($oDestFolder->getPermissionObjectId()); | |
| 1694 | + } | |
| 1695 | + | |
| 1696 | + //put the document in the new folder | |
| 1697 | + $oDocument->setFolderID($oDestFolder->getId()); | |
| 1698 | + if (!$oDocument->update(true)) { | |
| 1699 | + return "502 Bad Gateway - Document update failed."; | |
| 1700 | + } | |
| 1701 | + | |
| 1702 | + //move the document on the file system | |
| 1703 | + $oStorage =& KTStorageManagerUtil::getSingleton(); | |
| 1704 | + if (!$oStorage->moveDocument($oDocument, $oSrcFolder, $oDestFolder)) { | |
| 1705 | + $oDocument->setFolderID($oSrcDocumentFolder->getId()); | |
| 1706 | + $oDocument->update(true); | |
| 1707 | + return "502 Bad Gateway"; | |
| 1708 | + } | |
| 1709 | + | |
| 1710 | + $sMoveMessage = sprintf("Moved from %s/%s to %s/%s: %s", | |
| 1711 | + $oSrcFolder->getFullPath(), | |
| 1712 | + $oSrcFolder->getName(), | |
| 1713 | + $oDestFolder->getFullPath(), | |
| 1714 | + $oDestFolder->getName(), | |
| 1715 | + $_SERVER['HTTP_REASON']); | |
| 1716 | + | |
| 1717 | + // create the document transaction record | |
| 1718 | + $oDocumentTransaction = & new DocumentTransaction($oDocument, $sMoveMessage, 'ktcore.transactions.move'); | |
| 1719 | + $oDocumentTransaction->create(); | |
| 1720 | + | |
| 1721 | + $oKTTriggerRegistry = KTTriggerRegistry::getSingleton(); | |
| 1722 | + $aTriggers = $oKTTriggerRegistry->getTriggers('moveDocument', 'postValidate'); | |
| 1723 | + foreach ($aTriggers as $aTrigger) { | |
| 1724 | + $sTrigger = $aTrigger[0]; | |
| 1725 | + $oTrigger = new $sTrigger; | |
| 1726 | + $aInfo = array( | |
| 1727 | + "document" => $oDocument, | |
| 1728 | + "old_folder" => $oSrcFolder, | |
| 1729 | + "new_folder" => $oDestFolder, | |
| 1730 | + ); | |
| 1731 | + $oTrigger->setInfo($aInfo); | |
| 1732 | + $ret = $oTrigger->postValidate(); | |
| 1733 | + // FIXME: handle trigger subfailures. | |
| 1734 | + } | |
| 1735 | + | |
| 1736 | + if ($new) { | |
| 1737 | + return "201 Created"; | |
| 1738 | + } else { | |
| 1739 | + return "204 No Content"; | |
| 1740 | + } | |
| 1741 | + } | |
| 1742 | + | |
| 1743 | + /** | |
| 1744 | + * MOVE method helper for Folders | |
| 1745 | + * | |
| 1746 | + * @param array parameter passing array | |
| 1747 | + * @param int Folder ID | |
| 1748 | + * @return string HTTP status code or false | |
| 1749 | + | |
| 1750 | + */ | |
| 1751 | + function _MOVEFolder($options, $iFolderID) { | |
| 1752 | + | |
| 1753 | + if ($options['dest'] == '') $options["dest"] = substr($options["dest_url"], strlen($_SERVER["SCRIPT_NAME"])); | |
| 1754 | + $this->ktwebdavLog("Entering _MOVEFolder. options are " . print_r($options, true), 'info', true); | |
| 1755 | + | |
| 1756 | + if ($options["depth"] != "infinity") { | |
| 1757 | + // RFC 2518 Section 9.2, last paragraph | |
| 1758 | + $this->ktwebdavLog("400 Bad request", 'info', true); | |
| 1759 | + return "400 Bad request - depth must be 'inifinity'."; | |
| 1760 | + } | |
| 1761 | + | |
| 1762 | + global $default; | |
| 1763 | + | |
| 1764 | + $source_path = $options["path"]; | |
| 1765 | + $dest_path = urldecode($options["dest"]); | |
| 1766 | + | |
| 1767 | + $oSrcFolder = Folder::get($iFolderID); | |
| 1768 | + | |
| 1769 | + list($iDestFolder, $iDestDoc) = $this->_folderOrDocument($dest_path); | |
| 1770 | + | |
| 1771 | + $oDestFolder = Folder::get($iDestFolder); | |
| 1772 | + | |
| 1773 | + // Is this a rename? | |
| 1774 | + if (dirname($source_path) == dirname($dest_path)) { | |
| 1775 | + // This is a rename | |
| 1776 | + //if ($options['overwrite'] != 'T') { | |
| 1777 | + // $this->ktwebdavLog("This is a Rename. Overwrite needs to be TRUE.", 'info', true); | |
| 1778 | + // return "412 Precondition Failed - This is a Rename. Overwrite needs to be TRUE."; | |
| 1779 | + //} | |
| 1780 | + | |
| 1781 | + $this->ktwebdavLog("Got an oSrcFolder of " . print_r($oSrcFolder, true), 'info', true); | |
| 1782 | + $this->ktwebdavLog("Got an new name of " . basename($dest_path), 'info', true); | |
| 1783 | + | |
| 1784 | + include_once(KT_LIB_DIR . '/foldermanagement/folderutil.inc.php'); | |
| 1785 | + | |
| 1786 | + // Check if the user has permissions to write this folder | |
| 1787 | + $oPerm =& KTPermission::getByName('ktcore.permissions.folder_rename'); | |
| 1788 | + $oUser =& User::get($this->userID); | |
| 1789 | + if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oSrcFolder)) { | |
| 1790 | + return "403 Forbidden - User does not have sufficient permissions"; | |
| 1791 | + } | |
| 1792 | + $res = KTFolderUtil::rename($oSrcFolder, basename($dest_path), $oUser); | |
| 1793 | + if (PEAR::isError($res) || is_null($res) || ($res === false)) { | |
| 1794 | + return "404 Not Found - " . $res->getMessage(); | |
| 1795 | + } else { | |
| 1796 | + $this->ktwebdavLog("201 Created", 'info', true); | |
| 1797 | + return "201 Created"; | |
| 1798 | + } | |
| 1799 | + | |
| 1800 | + } | |
| 1801 | + | |
| 1802 | + if (is_null($iDestDoc)) { | |
| 1803 | + // the dest is a folder | |
| 1804 | + } else if ($iDestDoc !== false) { | |
| 1805 | + // Folder exists | |
| 1806 | + $this->ktwebdavLog("Destination Folder exists.", 'info', true); | |
| 1807 | + $oReplaceFolder = Folder::get($iDestDoc); | |
| 1808 | + if ($options['overwrite'] != 'T') { | |
| 1809 | + $this->ktwebdavLog("Overwrite needs to be TRUE.", 'info', true); | |
| 1810 | + return "412 Precondition Failed - Destination Folder exists. Overwrite needs to be TRUE."; | |
| 1811 | + } | |
| 1812 | + $this->ktwebdavLog("Overwrite is TRUE, deleting Destination Folder.", 'info', true); | |
| 1813 | + | |
| 1814 | + // Check if the user has permissions to delete this folder | |
| 1815 | + $oPerm =& KTPermission::getByName('ktcore.permissions.delete'); | |
| 1816 | + $oUser =& User::get($this->userID); | |
| 1817 | + if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oReplaceFolder)) { | |
| 1818 | + return "403 Forbidden - User does not have sufficient permissions"; | |
| 1819 | + } | |
| 1820 | + KTFolderUtil::delete($oReplaceFolder, 'KTWebDAV move overwrites target.'); | |
| 1821 | + $new = false; | |
| 1822 | + } | |
| 1823 | + | |
| 1824 | + include_once(KT_LIB_DIR . '/foldermanagement/folderutil.inc.php'); | |
| 1825 | + | |
| 1826 | + $oUser =& User::get($this->userID); | |
| 1827 | + $this->ktwebdavLog("Got an oSrcFolder of " . print_r($oSrcFolder, true), 'info', true); | |
| 1828 | + $this->ktwebdavLog("Got an oDestFolder of " . print_r($oDestFolder, true), 'info', true); | |
| 1829 | + $this->ktwebdavLog("Got an oUser of " . print_r($oUser, true), 'info', true); | |
| 1830 | + | |
| 1831 | + // Check if the user has permissions to write in this folder | |
| 1832 | + $oPerm =& KTPermission::getByName('ktcore.permissions.write'); | |
| 1833 | + $oUser =& User::get($this->userID); | |
| 1834 | + if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oDestFolder)) { | |
| 1835 | + return "403 Forbidden - User does not have sufficient permissions"; | |
| 1836 | + } | |
| 1837 | + KTFolderUtil::move($oSrcFolder, $oDestFolder, $oUser); | |
| 1838 | + | |
| 1839 | + $this->ktwebdavLog("201 Created", 'info', true); | |
| 1840 | + return "201 Created"; | |
| 1841 | + | |
| 1842 | + } | |
| 1843 | + | |
| 1844 | + /** | |
| 1845 | + * COPY method handler | |
| 1846 | + * | |
| 1847 | + * @param array parameter passing array | |
| 1848 | + * @param string delete source flag | |
| 1849 | + * @return string HTTP status code or false | |
| 1850 | + */ | |
| 1851 | + function COPY($options, $del = false) | |
| 1852 | + { | |
| 1853 | + $this->ktwebdavLog("Entering COPY. options are " . print_r($options, true), 'info', true); | |
| 1854 | + $this->ktwebdavLog("del is: " . $del, 'info', true); | |
| 1855 | + | |
| 1856 | + if ($this->checkSafeMode()) { | |
| 1857 | + | |
| 1858 | + if (!empty($_SERVER["CONTENT_LENGTH"])) { // no body parsing yet | |
| 1859 | + $this->ktwebdavLog("415 Unsupported media type", 'info', true); | |
| 1860 | + return "415 Unsupported media type - No body parsing yet"; | |
| 1861 | + } | |
| 1862 | + | |
| 1863 | + /* // no copying to different WebDAV Servers yet | |
| 1864 | + if (isset($options["dest_url"])) { | |
| 1865 | + $this->ktwebdavLog("502 bad gateway", 'info', true); | |
| 1866 | + return "502 bad gateway - No copying to different WebDAV Servers yet"; | |
| 1867 | + } | |
| 1868 | + */ | |
| 1869 | + $source_path = $options["path"]; | |
| 1870 | + $this->ktwebdavLog("SourcePath is: " . $source_path, 'info', true); | |
| 1871 | + $source_res = $this->_folderOrDocument($source_path); | |
| 1872 | + if ($source_res === false) { | |
| 1873 | + $this->ktwebdavLog("404 Not found - The document could not be found.", 'info', true); | |
| 1874 | + return "404 Not found - The document could not be found."; | |
| 1875 | + } | |
| 1876 | + | |
| 1877 | + list($iFolderID, $iDocumentID) = $source_res; | |
| 1878 | + if ($iDocumentID === false) { | |
| 1879 | + $this->ktwebdavLog("404 Not found - The folder could not be found.", 'info', true); | |
| 1880 | + return "404 Not found - The folder could not be found."; | |
| 1881 | + } | |
| 1882 | + | |
| 1883 | + if (is_null($iDocumentID)) { | |
| 1884 | + // Source is a folder | |
| 1885 | + $this->ktwebdavLog("Source is a Folder.", 'info', true); | |
| 1886 | + $copystat = $this->_COPYFolder($options, $iFolderID); | |
| 1887 | + | |
| 1888 | + } else { | |
| 1889 | + // Source is a document | |
| 1890 | + $this->ktwebdavLog("Source is a Document.", 'info', true); | |
| 1891 | + $copystat = $this->_COPYDocument($options, $iFolderID, $iDocumentID, $dest_folder_id); | |
| 1892 | + | |
| 1893 | + } | |
| 1894 | + | |
| 1895 | + // Delete the source if this is a move and the copy was ok | |
| 1896 | + if ($del && ($copystat{0} == "2")) { | |
| 1897 | + $delstat = $this->DELETE(array("path" => $options["path"])); | |
| 1898 | + $this->ktwebdavLog("DELETE in COPY/MOVE stat is: " . $delstat, 'info', true); | |
| 1899 | + if (($delstat{0} != "2") && (substr($delstat, 0, 3) != "404")) { | |
| 1900 | + return $delstat; | |
| 1901 | + } | |
| 1902 | + } | |
| 1903 | + | |
| 1904 | + $this->ktwebdavLog("Final copystat result is: " . $copystat, 'info', true); | |
| 1905 | + return $copystat; | |
| 1906 | + | |
| 1907 | + } else return "423 Locked - KTWebDAV is in SafeMode"; | |
| 1908 | + } | |
| 1909 | + | |
| 1910 | + /** | |
| 1911 | + * COPY method helper for Documents | |
| 1912 | + * | |
| 1913 | + * @param array parameter passing array | |
| 1914 | + * @param int Folder ID | |
| 1915 | + * @param int Document ID | |
| 1916 | + * @return string HTTP status code or false | |
| 1917 | + */ | |
| 1918 | + function _COPYDocument($options, $iFolderID, $iDocumentID) { | |
| 1919 | + | |
| 1920 | + if ($options['dest'] == '') $options["dest"] = substr($options["dest_url"], strlen($_SERVER["SCRIPT_NAME"])); | |
| 1921 | + $this->ktwebdavLog("Entering _COPYDocument. options are " . print_r($options, true), 'info', true); | |
| 1922 | + | |
| 1923 | + if ($options["depth"] != "infinity") { | |
| 1924 | + // RFC 2518 Section 9.2, last paragraph | |
| 1925 | + $this->ktwebdavLog("400 Bad request", 'info', true); | |
| 1926 | + return "400 Bad request - Depth must be 'infinity'."; | |
| 1927 | + } | |
| 1928 | + | |
| 1929 | + global $default; | |
| 1930 | + | |
| 1931 | + $source_path = $options["path"]; | |
| 1932 | + $dest_path = urldecode($options["dest"]); | |
| 1933 | + | |
| 1934 | + $oSrcFolder = Folder::get($iFolderID); | |
| 1935 | + | |
| 1936 | + list($iDestFolder, $iDestDoc) = $this->_folderOrDocument($dest_path); | |
| 1937 | + | |
| 1938 | + if (is_null($iDestDoc)) { | |
| 1939 | + // the dest is a folder | |
| 1940 | + // $this->ktwebdavLog("400 Bad request", 'info', true); | |
| 1941 | + return "400 Bad request - Destination is a Folder"; | |
| 1942 | + } else if ($iDestDoc !== false) { | |
| 1943 | + // Document exists | |
| 1944 | + $this->ktwebdavLog("Destination Document exists.", 'info', true); | |
| 1945 | + $oReplaceDoc = Document::get($iDestDoc); | |
| 1946 | + if ($options['overwrite'] != 'T') { | |
| 1947 | + $this->ktwebdavLog("Overwrite needs to be TRUE.", 'info', true); | |
| 1948 | + return "412 Precondition Failed - Destination Document exists. Overwrite needs to be TRUE."; | |
| 1949 | + } | |
| 1950 | + $this->ktwebdavLog("Overwrite is TRUE, deleting Destination Document.", 'info', true); | |
| 1951 | + | |
| 1952 | + // Check if the user has permissions to delete this document | |
| 1953 | + $oPerm =& KTPermission::getByName('ktcore.permissions.delete'); | |
| 1954 | + $oUser =& User::get($this->userID); | |
| 1955 | + if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oReplaceDoc)) { | |
| 1956 | + return "403 Forbidden - User does not have sufficient permissions"; | |
| 1957 | + } | |
| 1958 | + KTDocumentUtil::delete($oReplaceDoc, 'KTWebDAV copy with overwrite set.'); | |
| 1959 | + $new = false; | |
| 1960 | + } | |
| 1961 | + | |
| 1962 | + $oDestFolder = Folder::get($iDestFolder); | |
| 1963 | + $oSrcDoc = Document::get($iDocumentID); | |
| 1964 | + | |
| 1965 | + include_once(KT_LIB_DIR . '/foldermanagement/folderutil.inc.php'); | |
| 1966 | + | |
| 1967 | + $this->ktwebdavLog("Got an oSrcDoc of " . print_r($oSrcDoc, true), 'info', true); | |
| 1968 | + $this->ktwebdavLog("Got an oDestFolder of " . print_r($oDestFolder, true), 'info', true); | |
| 1969 | + | |
| 1970 | + // Check if the user has permissions to write in this folder | |
| 1971 | + $oPerm =& KTPermission::getByName('ktcore.permissions.write'); | |
| 1972 | + $oUser =& User::get($this->userID); | |
| 1973 | + if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oSrcDoc)) { | |
| 1974 | + return "403 Forbidden - User does not have sufficient permissions"; | |
| 1975 | + } | |
| 1976 | + KTDocumentUtil::copy($oSrcDoc, $oDestFolder, $_SERVER['HTTP_REASON']); | |
| 1977 | + | |
| 1978 | + // FIXME: Do failure checking here | |
| 1979 | + | |
| 1980 | + $new = false; | |
| 1981 | + if ($new) { | |
| 1982 | + $this->ktwebdavLog("201 Created", 'info', true); | |
| 1983 | + return "201 Created"; | |
| 1984 | + } else { | |
| 1985 | + $this->ktwebdavLog("204 No Content", 'info', true); | |
| 1986 | + return "204 No Content"; | |
| 1987 | + } | |
| 1988 | + } | |
| 1989 | + | |
| 1990 | + /** | |
| 1991 | + * COPY method helper for Folders | |
| 1992 | + * | |
| 1993 | + * @param array parameter passing array | |
| 1994 | + * @param int Parent Folder ID | |
| 1995 | + * @return string HTTP status code or false | |
| 1996 | + */ | |
| 1997 | + function _COPYFolder($options, $iFolderID) { | |
| 1998 | + | |
| 1999 | + if ($options['dest'] == '') $options["dest"] = substr($options["dest_url"], strlen($_SERVER["SCRIPT_NAME"])); | |
| 2000 | + $this->ktwebdavLog("Entering _COPYFolder. options are " . print_r($options, true), 'info', true); | |
| 2001 | + | |
| 2002 | + if ($options["depth"] != "infinity") { | |
| 2003 | + // RFC 2518 Section 9.2, last paragraph | |
| 2004 | + $this->ktwebdavLog("400 Bad request", 'info', true); | |
| 2005 | + return "400 Bad request - Depth must be 'infinity'."; | |
| 2006 | + } | |
| 2007 | + | |
| 2008 | + global $default; | |
| 2009 | + | |
| 2010 | + $new = true; | |
| 2011 | + | |
| 2012 | + $source_path = $options["path"]; | |
| 2013 | + $dest_path = urldecode($options["dest"]); | |
| 2014 | + | |
| 2015 | + $oSrcFolder = Folder::get($iFolderID); | |
| 2016 | + | |
| 2017 | + list($iDestFolder, $iDestDoc) = $this->_folderOrDocument($dest_path); | |
| 2018 | + | |
| 2019 | + $oDestFolder = Folder::get($iDestFolder); | |
| 2020 | + | |
| 2021 | + include_once(KT_LIB_DIR . '/foldermanagement/folderutil.inc.php'); | |
| 2022 | + | |
| 2023 | + if (is_null($iDestDoc)) { | |
| 2024 | + // the dest is a folder | |
| 2025 | + $this->ktwebdavLog("The Destination is a Folder.", 'info', true); | |
| 2026 | + } else if ($iDestDoc !== false) { | |
| 2027 | + // Folder exists | |
| 2028 | + $this->ktwebdavLog("Destination Folder exists.", 'info', true); | |
| 2029 | + $oReplaceFolder = Folder::get($iDestDoc); | |
| 2030 | + if ($options['overwrite'] != 'T') { | |
| 2031 | + $this->ktwebdavLog("Overwrite needs to be TRUE.", 'info', true); | |
| 2032 | + return "412 Precondition Failed - Destination Folder exists. Overwrite needs to be TRUE."; | |
| 2033 | + } | |
| 2034 | + $this->ktwebdavLog("Overwrite is TRUE, deleting Destination Folder.", 'info', true); | |
| 2035 | + | |
| 2036 | + // Check if the user has permissions to delete this folder | |
| 2037 | + $oPerm =& KTPermission::getByName('ktcore.permissions.delete'); | |
| 2038 | + $oUser =& User::get($this->userID); | |
| 2039 | + if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oReplaceFolder)) { | |
| 2040 | + return "403 Forbidden - User does not have sufficient permissions"; | |
| 2041 | + } | |
| 2042 | + KTFolderUtil::delete($oReplaceFolder, 'KTWebDAV move overwrites target.'); | |
| 2043 | + $new = false; | |
| 2044 | + } | |
| 2045 | + | |
| 2046 | + $oUser =& User::get($this->userID); | |
| 2047 | + $this->ktwebdavLog("Got an oSrcFolder of " . print_r($oSrcFolder, true), 'info', true); | |
| 2048 | + $this->ktwebdavLog("Got an oDestFolder of " . print_r($oDestFolder, true), 'info', true); | |
| 2049 | + $this->ktwebdavLog("Got an oUser of " . print_r($oUser, true), 'info', true); | |
| 2050 | + | |
| 2051 | + // Check if the user has permissions to write in this folder | |
| 2052 | + $oPerm =& KTPermission::getByName('ktcore.permissions.write'); | |
| 2053 | + $oUser =& User::get($this->userID); | |
| 2054 | + if (!KTPermissionUtil::userHasPermissionOnItem($oUser, $oPerm, $oDestFolder)) { | |
| 2055 | + return "403 Forbidden - User does not have sufficient permissions"; | |
| 2056 | + } | |
| 2057 | + KTFolderUtil::copy($oSrcFolder, $oDestFolder, $oUser, 'KTWebDAV Copy.'); | |
| 2058 | + | |
| 2059 | + if ($new) { | |
| 2060 | + $this->ktwebdavLog("201 Created", 'info', true); | |
| 2061 | + return "201 Created"; | |
| 2062 | + } else { | |
| 2063 | + $this->ktwebdavLog("204 No Content", 'info', true); | |
| 2064 | + return "204 No Content"; | |
| 2065 | + } | |
| 2066 | + | |
| 2067 | + } | |
| 2068 | + | |
| 2069 | + /** | |
| 2070 | + * LOCK method handler | |
| 2071 | + * | |
| 2072 | + * @param array parameter passing array | |
| 2073 | + * @return string HTTP status code or false | |
| 2074 | + */ | |
| 2075 | + function LOCK(&$options) | |
| 2076 | + { | |
| 2077 | + return "200 OK"; | |
| 2078 | + } | |
| 2079 | + | |
| 2080 | + /** | |
| 2081 | + * UNLOCK method handler | |
| 2082 | + * | |
| 2083 | + * @param array parameter passing array | |
| 2084 | + * @return string HTTP status code or false | |
| 2085 | + */ | |
| 2086 | + function UNLOCK(&$options) | |
| 2087 | + { | |
| 2088 | + return "200 OK"; | |
| 2089 | + } | |
| 2090 | + | |
| 2091 | + /** | |
| 2092 | + * checkLock() helper | |
| 2093 | + * | |
| 2094 | + * @param string resource path to check for locks | |
| 2095 | + * @return string HTTP status code or false | |
| 2096 | + */ | |
| 2097 | + function checkLock($path) | |
| 2098 | + { | |
| 2099 | + $result = false; | |
| 2100 | + | |
| 2101 | + return $result; | |
| 2102 | + } | |
| 2103 | + | |
| 2104 | + /** | |
| 2105 | + * checkSafeMode() helper | |
| 2106 | + * | |
| 2107 | + * @return string true or false | |
| 2108 | + */ | |
| 2109 | + function checkSafeMode() | |
| 2110 | + { | |
| 2111 | + | |
| 2112 | + // Check/Set the WebDAV Client | |
| 2113 | + $userAgentValue = $_SERVER['HTTP_USER_AGENT']; | |
| 2114 | + // KT Explorer | |
| 2115 | + if (stristr($userAgentValue,"Microsoft Data Access Internet Publishing Provider DAV")) { | |
| 2116 | + $this->dav_client = "MS"; | |
| 2117 | + $this->ktwebdavLog("WebDAV Client : " . $userAgentValue, 'info', true); | |
| 2118 | + } | |
| 2119 | + // Mac Finder | |
| 2120 | + if (stristr($userAgentValue,"Macintosh")) { | |
| 2121 | + $this->dav_client = "MC"; | |
| 2122 | + $this->ktwebdavLog("WebDAV Client : " . $userAgentValue, 'info', true); | |
| 2123 | + } | |
| 2124 | + // Konqueror | |
| 2125 | + if (stristr($userAgentValue,"Konqueror")) { | |
| 2126 | + $this->dav_client = "KO"; | |
| 2127 | + $this->ktwebdavLog("WebDAV Client : " . $userAgentValue, 'info', true); | |
| 2128 | + } | |
| 2129 | + // Neon Library ( Gnome Nautilus, cadaver, etc) | |
| 2130 | + if (stristr($userAgentValue,"neon")) { | |
| 2131 | + $this->dav_client = "NE"; | |
| 2132 | + $this->ktwebdavLog("WebDAV Client : " . $userAgentValue, 'info', true); | |
| 2133 | + } | |
| 2134 | + // Windows WebDAV | |
| 2135 | + if ($this->dav_client == 'MS' && $this->safeMode == 'off') { | |
| 2136 | + | |
| 2137 | + $this->ktwebdavLog("This is MS type client with SafeMode Off.", 'info', true); | |
| 2138 | + return true; | |
| 2139 | + | |
| 2140 | + } | |
| 2141 | + if ($this->dav_client == 'MS' && $this->safeMode != 'off') { | |
| 2142 | + | |
| 2143 | + $this->ktwebdavLog("This is MS type client with SafeMode On.", 'info', true); | |
| 2144 | + return false; | |
| 2145 | + | |
| 2146 | + } | |
| 2147 | + // Mac Finder | |
| 2148 | + if ($this->dav_client == 'MC') { | |
| 2149 | + | |
| 2150 | + $this->ktwebdavLog("This is Mac Finder type client which only supports SafeMode.", 'info', true); | |
| 2151 | + return false; | |
| 2152 | + | |
| 2153 | + } | |
| 2154 | + // Konqueror | |
| 2155 | + if ($this->dav_client == 'KO' && $this->safeMode == 'off') { | |
| 2156 | + | |
| 2157 | + $this->ktwebdavLog("This is Konqueror type client with SafeMode Off.", 'info', true); | |
| 2158 | + return true; | |
| 2159 | + | |
| 2160 | + } | |
| 2161 | + if ($this->dav_client == 'KO' && $this->safeMode != 'off') { | |
| 2162 | + | |
| 2163 | + $this->ktwebdavLog("This is Konqueror type client with SafeMode On.", 'info', true); | |
| 2164 | + return false; | |
| 2165 | + | |
| 2166 | + } | |
| 2167 | + // Neon Library (Gnome Nautilus, cadaver, etc.) | |
| 2168 | + if ($this->dav_client == 'NE' && $this->safeMode == 'off') { | |
| 2169 | + | |
| 2170 | + $this->ktwebdavLog("This is Neon type client with SafeMode Off.", 'info', true); | |
| 2171 | + return true; | |
| 2172 | + | |
| 2173 | + } | |
| 2174 | + if ($this->dav_client == 'NE' && $this->safeMode != 'off') { | |
| 2175 | + | |
| 2176 | + $this->ktwebdavLog("This is Neon type client with SafeMode On.", 'info', true); | |
| 2177 | + return false; | |
| 2178 | + | |
| 2179 | + } | |
| 2180 | + | |
| 2181 | + $this->ktwebdavLog("Unknown client. SafeMode needed.", 'info', true); | |
| 2182 | + return false; | |
| 2183 | + | |
| 2184 | + } | |
| 2185 | + | |
| 2186 | + } | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + ?> | ... | ... |
ktwebservice/KTDownloadManager.inc.php
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * KTDownloadManager manages files in the download_files table. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | */ |
| 27 | 33 | ... | ... |
ktwebservice/KTUploadManager.inc.php
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * KTUploadManager manages files in the uploaded_files table. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | */ |
| 27 | 33 | ... | ... |
ktwebservice/download.php
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * This does the download of a file based on the download_files table. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | */ |
| 27 | 33 | ... | ... |
ktwebservice/download_cleanup.php
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Cleans up the download_files table. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | */ |
| 27 | 33 | ... | ... |
ktwebservice/index.php
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * A wrapper for webservice.php |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | */ |
| 27 | 33 | ... | ... |
ktwebservice/upload.php
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * This uploads a file onto the file server. A web service method can later move the file to the correct location. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | */ |
| 27 | 33 | ... | ... |
ktwebservice/upload_cleanup.php
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Cleans up the uploaded_files table and the upload. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | */ |
| 27 | 33 | ... | ... |
ktwebservice/webservice.php
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * This implements the KnowledgeTree Web Service in SOAP. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | */ |
| 27 | 33 | ... | ... |
ktwsapi/php/examples/ktws_eg_add_document.php
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * This is a sample of how to add a document to the repository. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | */ |
| 27 | 33 | ... | ... |
ktwsapi/php/examples/ktws_eg_anonymous.php
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Demonstrates how to create an anonymous session. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | */ |
| 27 | 33 | ... | ... |
ktwsapi/php/examples/ktws_eg_checkin.php
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Demonstrates document checkout and checkin |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | */ |
| 27 | 33 | ... | ... |
ktwsapi/php/examples/ktws_eg_create_folder.php
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Demonstrates creating a folder in an active session. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | */ |
| 27 | 33 | ... | ... |
ktwsapi/php/examples/ktws_eg_doc_info.php
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Demonstrates using an active session and getting document info and metadata. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | */ |
| 27 | 33 | ... | ... |
ktwsapi/php/examples/ktws_eg_folder_listing.php
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Demonstrates document checkout and checkin |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | */ |
| 27 | 33 | ... | ... |
ktwsapi/php/ktwsapi.inc.php
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * This is the object model for the KnowledgeTree WebService. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | */ |
| 27 | 33 | ... | ... |
ktwsapi/php/ktwsapi_cfg.inc.php
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | |
| 6 | 6 | /* |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | */ |
| 27 | 33 | ... | ... |
lib/Log.inc
| ... | ... | @@ -10,15 +10,20 @@ define("ERROR", 2); |
| 10 | 10 | * File logging class. |
| 11 | 11 | * |
| 12 | 12 | * The contents of this file are subject to the KnowledgeTree Public |
| 13 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 13 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 14 | 14 | * compliance with the License. You may obtain a copy of the License at |
| 15 | 15 | * http://www.knowledgetree.com/KPL |
| 16 | 16 | * |
| 17 | 17 | * Software distributed under the License is distributed on an "AS IS" |
| 18 | - * basis, | |
| 19 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 20 | - * for the specific language governing rights and limitations under the | |
| 21 | - * License. | |
| 18 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 19 | + * See the License for the specific language governing rights and | |
| 20 | + * limitations under the License. | |
| 21 | + * | |
| 22 | + * All copies of the Covered Code must include on each user interface screen: | |
| 23 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 24 | + * (ii) the KnowledgeTree copyright notice | |
| 25 | + * in the same form as they appear in the distribution. See the License for | |
| 26 | + * requirements. | |
| 22 | 27 | * |
| 23 | 28 | * The Original Code is: KnowledgeTree Open Source |
| 24 | 29 | * |
| ... | ... | @@ -27,6 +32,7 @@ define("ERROR", 2); |
| 27 | 32 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 28 | 33 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 29 | 34 | * All Rights Reserved. |
| 35 | + * Contributor( s): ______________________________________ | |
| 30 | 36 | * |
| 31 | 37 | * |
| 32 | 38 | * @version $Revision$ | ... | ... |
lib/actions/actionregistry.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/actions/bulkaction.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id: documentaction.inc.php 5848 2006-08-16 15:58:51Z bshuttle $ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/actions/documentaction.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/actions/documentviewlet.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id: documentaction.inc.php 5848 2006-08-16 15:58:51Z bshuttle $ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/actions/entitylist.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id: entity.php 5758 2006-07-27 10:17:43Z bshuttle $ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/actions/folderaction.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/actions/portletregistry.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/alert/delivery/EmailAlert.inc
| ... | ... | @@ -6,15 +6,20 @@ require_once(KT_LIB_DIR . '/email/Email.inc'); |
| 6 | 6 | * Sends an email (subscription) alert. |
| 7 | 7 | * |
| 8 | 8 | * The contents of this file are subject to the KnowledgeTree Public |
| 9 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 9 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 10 | 10 | * compliance with the License. You may obtain a copy of the License at |
| 11 | 11 | * http://www.knowledgetree.com/KPL |
| 12 | 12 | * |
| 13 | 13 | * Software distributed under the License is distributed on an "AS IS" |
| 14 | - * basis, | |
| 15 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 16 | - * for the specific language governing rights and limitations under the | |
| 17 | - * License. | |
| 14 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 15 | + * See the License for the specific language governing rights and | |
| 16 | + * limitations under the License. | |
| 17 | + * | |
| 18 | + * All copies of the Covered Code must include on each user interface screen: | |
| 19 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 20 | + * (ii) the KnowledgeTree copyright notice | |
| 21 | + * in the same form as they appear in the distribution. See the License for | |
| 22 | + * requirements. | |
| 18 | 23 | * |
| 19 | 24 | * The Original Code is: KnowledgeTree Open Source |
| 20 | 25 | * |
| ... | ... | @@ -23,6 +28,7 @@ require_once(KT_LIB_DIR . '/email/Email.inc'); |
| 23 | 28 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 24 | 29 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 25 | 30 | * All Rights Reserved. |
| 31 | + * Contributor( s): ______________________________________ | |
| 26 | 32 | * |
| 27 | 33 | * |
| 28 | 34 | * @version $Revision$ | ... | ... |
lib/alert/delivery/SMSAlert.inc
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Sends an sms (subscription) alert (UNIMPLEMENTED). |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | * |
| 27 | 33 | * @version $Revision$ | ... | ... |
lib/authentication/Authenticator.inc
| ... | ... | @@ -6,15 +6,20 @@ require_once(KT_LIB_DIR . '/users/User.inc'); |
| 6 | 6 | * Interface class that performs all authentication functions. |
| 7 | 7 | * |
| 8 | 8 | * The contents of this file are subject to the KnowledgeTree Public |
| 9 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 9 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 10 | 10 | * compliance with the License. You may obtain a copy of the License at |
| 11 | 11 | * http://www.knowledgetree.com/KPL |
| 12 | 12 | * |
| 13 | 13 | * Software distributed under the License is distributed on an "AS IS" |
| 14 | - * basis, | |
| 15 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 16 | - * for the specific language governing rights and limitations under the | |
| 17 | - * License. | |
| 14 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 15 | + * See the License for the specific language governing rights and | |
| 16 | + * limitations under the License. | |
| 17 | + * | |
| 18 | + * All copies of the Covered Code must include on each user interface screen: | |
| 19 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 20 | + * (ii) the KnowledgeTree copyright notice | |
| 21 | + * in the same form as they appear in the distribution. See the License for | |
| 22 | + * requirements. | |
| 18 | 23 | * |
| 19 | 24 | * The Original Code is: KnowledgeTree Open Source |
| 20 | 25 | * |
| ... | ... | @@ -23,6 +28,7 @@ require_once(KT_LIB_DIR . '/users/User.inc'); |
| 23 | 28 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 24 | 29 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 25 | 30 | * All Rights Reserved. |
| 31 | + * Contributor( s): ______________________________________ | |
| 26 | 32 | * |
| 27 | 33 | * |
| 28 | 34 | * @version $Revision$ | ... | ... |
lib/authentication/DBAuthenticator.inc
| ... | ... | @@ -6,15 +6,20 @@ require_once(KT_LIB_DIR . "/authentication/Authenticator.inc"); |
| 6 | 6 | * Perform authentication tasks against the database. |
| 7 | 7 | * |
| 8 | 8 | * The contents of this file are subject to the KnowledgeTree Public |
| 9 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 9 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 10 | 10 | * compliance with the License. You may obtain a copy of the License at |
| 11 | 11 | * http://www.knowledgetree.com/KPL |
| 12 | 12 | * |
| 13 | 13 | * Software distributed under the License is distributed on an "AS IS" |
| 14 | - * basis, | |
| 15 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 16 | - * for the specific language governing rights and limitations under the | |
| 17 | - * License. | |
| 14 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 15 | + * See the License for the specific language governing rights and | |
| 16 | + * limitations under the License. | |
| 17 | + * | |
| 18 | + * All copies of the Covered Code must include on each user interface screen: | |
| 19 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 20 | + * (ii) the KnowledgeTree copyright notice | |
| 21 | + * in the same form as they appear in the distribution. See the License for | |
| 22 | + * requirements. | |
| 18 | 23 | * |
| 19 | 24 | * The Original Code is: KnowledgeTree Open Source |
| 20 | 25 | * |
| ... | ... | @@ -23,6 +28,7 @@ require_once(KT_LIB_DIR . "/authentication/Authenticator.inc"); |
| 23 | 28 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 24 | 29 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 25 | 30 | * All Rights Reserved. |
| 31 | + * Contributor( s): ______________________________________ | |
| 26 | 32 | * |
| 27 | 33 | * |
| 28 | 34 | * @version $Revision$ | ... | ... |
lib/authentication/authenticationprovider.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/authentication/authenticationproviderregistry.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/authentication/authenticationsource.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/authentication/authenticationutil.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/authentication/builtinauthenticationprovider.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/authentication/interceptor.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/authentication/interceptorinstances.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id: authenticationsource.inc.php 5758 2006-07-27 10:17:43Z bshuttle $ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/authentication/interceptorregistry.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/browse/BrowseColumns.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/browse/Criteria.inc
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Contains document browsing business logic. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | * |
| 27 | 33 | * @version $Revision$ | ... | ... |
lib/browse/DocumentCollection.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/browse/PartialQuery.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/browse/browseutil.inc.php
| ... | ... | @@ -6,15 +6,20 @@ |
| 6 | 6 | * Utilities helpful to traversing the document repository |
| 7 | 7 | * |
| 8 | 8 | * The contents of this file are subject to the KnowledgeTree Public |
| 9 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 9 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 10 | 10 | * compliance with the License. You may obtain a copy of the License at |
| 11 | 11 | * http://www.knowledgetree.com/KPL |
| 12 | 12 | * |
| 13 | 13 | * Software distributed under the License is distributed on an "AS IS" |
| 14 | - * basis, | |
| 15 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 16 | - * for the specific language governing rights and limitations under the | |
| 17 | - * License. | |
| 14 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 15 | + * See the License for the specific language governing rights and | |
| 16 | + * limitations under the License. | |
| 17 | + * | |
| 18 | + * All copies of the Covered Code must include on each user interface screen: | |
| 19 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 20 | + * (ii) the KnowledgeTree copyright notice | |
| 21 | + * in the same form as they appear in the distribution. See the License for | |
| 22 | + * requirements. | |
| 18 | 23 | * |
| 19 | 24 | * The Original Code is: KnowledgeTree Open Source |
| 20 | 25 | * |
| ... | ... | @@ -23,6 +28,7 @@ |
| 23 | 28 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 24 | 29 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 25 | 30 | * All Rights Reserved. |
| 31 | + * Contributor( s): ______________________________________ | |
| 26 | 32 | * |
| 27 | 33 | * |
| 28 | 34 | * @version $Revision$ | ... | ... |
lib/browse/columnentry.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id: columnentry.inc.php 5492 2006-06-04 20:50:43Z bshuttle $ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/browse/columnregistry.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id: columnregistry.inc.php 5492 2006-06-04 20:50:43Z bshuttle $ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/browse/criteriaregistry.php
| ... | ... | @@ -2,15 +2,20 @@ |
| 2 | 2 | |
| 3 | 3 | /* |
| 4 | 4 | * The contents of this file are subject to the KnowledgeTree Public |
| 5 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 5 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 6 | 6 | * compliance with the License. You may obtain a copy of the License at |
| 7 | 7 | * http://www.knowledgetree.com/KPL |
| 8 | 8 | * |
| 9 | 9 | * Software distributed under the License is distributed on an "AS IS" |
| 10 | - * basis, | |
| 11 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 12 | - * for the specific language governing rights and limitations under the | |
| 13 | - * License. | |
| 10 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 11 | + * See the License for the specific language governing rights and | |
| 12 | + * limitations under the License. | |
| 13 | + * | |
| 14 | + * All copies of the Covered Code must include on each user interface screen: | |
| 15 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 16 | + * (ii) the KnowledgeTree copyright notice | |
| 17 | + * in the same form as they appear in the distribution. See the License for | |
| 18 | + * requirements. | |
| 14 | 19 | * |
| 15 | 20 | * The Original Code is: KnowledgeTree Open Source |
| 16 | 21 | * |
| ... | ... | @@ -19,6 +24,7 @@ |
| 19 | 24 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 20 | 25 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 21 | 26 | * All Rights Reserved. |
| 27 | + * Contributor( s): ______________________________________ | |
| 22 | 28 | * |
| 23 | 29 | */ |
| 24 | 30 | ... | ... |
lib/config/config.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/dashboard/DashletDisables.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/dashboard/Notification.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/dashboard/NotificationRegistry.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/dashboard/dashlet.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/dashboard/dashletregistry.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/database/datetime.inc
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Contains datetime functions. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | * |
| 27 | 33 | * @version $Revision$ | ... | ... |
lib/database/dbcompat.inc
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/database/dbutil.inc
| ... | ... | @@ -6,15 +6,20 @@ |
| 6 | 6 | * Database access utility class |
| 7 | 7 | * |
| 8 | 8 | * The contents of this file are subject to the KnowledgeTree Public |
| 9 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 9 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 10 | 10 | * compliance with the License. You may obtain a copy of the License at |
| 11 | 11 | * http://www.knowledgetree.com/KPL |
| 12 | 12 | * |
| 13 | 13 | * Software distributed under the License is distributed on an "AS IS" |
| 14 | - * basis, | |
| 15 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 16 | - * for the specific language governing rights and limitations under the | |
| 17 | - * License. | |
| 14 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 15 | + * See the License for the specific language governing rights and | |
| 16 | + * limitations under the License. | |
| 17 | + * | |
| 18 | + * All copies of the Covered Code must include on each user interface screen: | |
| 19 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 20 | + * (ii) the KnowledgeTree copyright notice | |
| 21 | + * in the same form as they appear in the distribution. See the License for | |
| 22 | + * requirements. | |
| 18 | 23 | * |
| 19 | 24 | * The Original Code is: KnowledgeTree Open Source |
| 20 | 25 | * |
| ... | ... | @@ -23,6 +28,7 @@ |
| 23 | 28 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 24 | 29 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 25 | 30 | * All Rights Reserved. |
| 31 | + * Contributor( s): ______________________________________ | |
| 26 | 32 | * |
| 27 | 33 | * @version $Revision$ |
| 28 | 34 | * @author Neil Blakey-Milner, Jam Warehouse (Pty) Ltd, South Africa | ... | ... |
lib/database/lookup.inc
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Contains database helper functions. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | * |
| 27 | 33 | * @version $Revision$ | ... | ... |
lib/database/sqlfile.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/discussions/DiscussionComment.inc
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Represents a document discussion comment. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | * |
| 27 | 33 | * @version $Revision$ | ... | ... |
lib/discussions/DiscussionThread.inc
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Represents a document discussion thread. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | * |
| 27 | 33 | * @version $Revision$ | ... | ... |
lib/dispatcher.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/documentmanagement/Document.inc
| ... | ... | @@ -3,15 +3,20 @@ |
| 3 | 3 | * $Id$ |
| 4 | 4 | * |
| 5 | 5 | * The contents of this file are subject to the KnowledgeTree Public |
| 6 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 6 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 7 | 7 | * compliance with the License. You may obtain a copy of the License at |
| 8 | 8 | * http://www.knowledgetree.com/KPL |
| 9 | 9 | * |
| 10 | 10 | * Software distributed under the License is distributed on an "AS IS" |
| 11 | - * basis, | |
| 12 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 13 | - * for the specific language governing rights and limitations under the | |
| 14 | - * License. | |
| 11 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 12 | + * See the License for the specific language governing rights and | |
| 13 | + * limitations under the License. | |
| 14 | + * | |
| 15 | + * All copies of the Covered Code must include on each user interface screen: | |
| 16 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 17 | + * (ii) the KnowledgeTree copyright notice | |
| 18 | + * in the same form as they appear in the distribution. See the License for | |
| 19 | + * requirements. | |
| 15 | 20 | * |
| 16 | 21 | * The Original Code is: KnowledgeTree Open Source |
| 17 | 22 | * |
| ... | ... | @@ -20,6 +25,7 @@ |
| 20 | 25 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 21 | 26 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 22 | 27 | * All Rights Reserved. |
| 28 | + * Contributor( s): ______________________________________ | |
| 23 | 29 | * |
| 24 | 30 | * |
| 25 | 31 | * ------------------------------------------------------------------------- | ... | ... |
lib/documentmanagement/DocumentField.inc
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Represents a document field as per the database document_fields table. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | * |
| 27 | 33 | * @version $Revision$ | ... | ... |
lib/documentmanagement/DocumentFieldLink.inc
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Represents a document field link as per the database table document_fields_link. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | * |
| 27 | 33 | * @version $Revision$ | ... | ... |
lib/documentmanagement/DocumentLink.inc
| ... | ... | @@ -6,15 +6,20 @@ |
| 6 | 6 | * is defined through document collaboration. |
| 7 | 7 | * |
| 8 | 8 | * The contents of this file are subject to the KnowledgeTree Public |
| 9 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 9 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 10 | 10 | * compliance with the License. You may obtain a copy of the License at |
| 11 | 11 | * http://www.knowledgetree.com/KPL |
| 12 | 12 | * |
| 13 | 13 | * Software distributed under the License is distributed on an "AS IS" |
| 14 | - * basis, | |
| 15 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 16 | - * for the specific language governing rights and limitations under the | |
| 17 | - * License. | |
| 14 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 15 | + * See the License for the specific language governing rights and | |
| 16 | + * limitations under the License. | |
| 17 | + * | |
| 18 | + * All copies of the Covered Code must include on each user interface screen: | |
| 19 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 20 | + * (ii) the KnowledgeTree copyright notice | |
| 21 | + * in the same form as they appear in the distribution. See the License for | |
| 22 | + * requirements. | |
| 18 | 23 | * |
| 19 | 24 | * The Original Code is: KnowledgeTree Open Source |
| 20 | 25 | * |
| ... | ... | @@ -23,6 +28,7 @@ |
| 23 | 28 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 24 | 29 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 25 | 30 | * All Rights Reserved. |
| 31 | + * Contributor( s): ______________________________________ | |
| 26 | 32 | * |
| 27 | 33 | * |
| 28 | 34 | * @author Bryn Divey, Jam Warehouse (Pty) Ltd, South Africa | ... | ... |
lib/documentmanagement/DocumentTransaction.inc
| ... | ... | @@ -10,15 +10,20 @@ require_once(KT_LIB_DIR . "/documentmanagement/documentutil.inc.php"); |
| 10 | 10 | * in the database it may not be changed. |
| 11 | 11 | * |
| 12 | 12 | * The contents of this file are subject to the KnowledgeTree Public |
| 13 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 13 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 14 | 14 | * compliance with the License. You may obtain a copy of the License at |
| 15 | 15 | * http://www.knowledgetree.com/KPL |
| 16 | 16 | * |
| 17 | 17 | * Software distributed under the License is distributed on an "AS IS" |
| 18 | - * basis, | |
| 19 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 20 | - * for the specific language governing rights and limitations under the | |
| 21 | - * License. | |
| 18 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 19 | + * See the License for the specific language governing rights and | |
| 20 | + * limitations under the License. | |
| 21 | + * | |
| 22 | + * All copies of the Covered Code must include on each user interface screen: | |
| 23 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 24 | + * (ii) the KnowledgeTree copyright notice | |
| 25 | + * in the same form as they appear in the distribution. See the License for | |
| 26 | + * requirements. | |
| 22 | 27 | * |
| 23 | 28 | * The Original Code is: KnowledgeTree Open Source |
| 24 | 29 | * |
| ... | ... | @@ -27,6 +32,7 @@ require_once(KT_LIB_DIR . "/documentmanagement/documentutil.inc.php"); |
| 27 | 32 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 28 | 33 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 29 | 34 | * All Rights Reserved. |
| 35 | + * Contributor( s): ______________________________________ | |
| 30 | 36 | * |
| 31 | 37 | * |
| 32 | 38 | * @version $Revision$ | ... | ... |
lib/documentmanagement/DocumentTransactionType.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/documentmanagement/DocumentType.inc
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Represents a document type as per the database document_types_lookup table. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | * |
| 27 | 33 | * @version $Revision$ | ... | ... |
lib/documentmanagement/LinkType.inc
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Represents the type of link between documents |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | * |
| 27 | 33 | * @version $Revision$ | ... | ... |
lib/documentmanagement/MDTree.inc
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/documentmanagement/MetaData.inc
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Represents a document field lookups as per the database document_types_lookup table |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | * |
| 27 | 33 | * @version $Revision$ | ... | ... |
lib/documentmanagement/PhysicalDocumentManager.inc
| ... | ... | @@ -6,15 +6,20 @@ |
| 6 | 6 | * delete a physical document. |
| 7 | 7 | * |
| 8 | 8 | * The contents of this file are subject to the KnowledgeTree Public |
| 9 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 9 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 10 | 10 | * compliance with the License. You may obtain a copy of the License at |
| 11 | 11 | * http://www.knowledgetree.com/KPL |
| 12 | 12 | * |
| 13 | 13 | * Software distributed under the License is distributed on an "AS IS" |
| 14 | - * basis, | |
| 15 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 16 | - * for the specific language governing rights and limitations under the | |
| 17 | - * License. | |
| 14 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 15 | + * See the License for the specific language governing rights and | |
| 16 | + * limitations under the License. | |
| 17 | + * | |
| 18 | + * All copies of the Covered Code must include on each user interface screen: | |
| 19 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 20 | + * (ii) the KnowledgeTree copyright notice | |
| 21 | + * in the same form as they appear in the distribution. See the License for | |
| 22 | + * requirements. | |
| 18 | 23 | * |
| 19 | 24 | * The Original Code is: KnowledgeTree Open Source |
| 20 | 25 | * |
| ... | ... | @@ -23,6 +28,7 @@ |
| 23 | 28 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 24 | 29 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 25 | 30 | * All Rights Reserved. |
| 31 | + * Contributor( s): ______________________________________ | |
| 26 | 32 | * |
| 27 | 33 | * |
| 28 | 34 | * @version $Revision$ | ... | ... |
lib/documentmanagement/documentcontentversion.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/documentmanagement/documentcore.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/documentmanagement/documentmetadataversion.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/documentmanagement/documentutil.inc.php
| ... | ... | @@ -8,15 +8,20 @@ |
| 8 | 8 | * deleting documents from the repository. |
| 9 | 9 | * |
| 10 | 10 | * The contents of this file are subject to the KnowledgeTree Public |
| 11 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 11 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 12 | 12 | * compliance with the License. You may obtain a copy of the License at |
| 13 | 13 | * http://www.knowledgetree.com/KPL |
| 14 | 14 | * |
| 15 | 15 | * Software distributed under the License is distributed on an "AS IS" |
| 16 | - * basis, | |
| 17 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 18 | - * for the specific language governing rights and limitations under the | |
| 19 | - * License. | |
| 16 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 17 | + * See the License for the specific language governing rights and | |
| 18 | + * limitations under the License. | |
| 19 | + * | |
| 20 | + * All copies of the Covered Code must include on each user interface screen: | |
| 21 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 22 | + * (ii) the KnowledgeTree copyright notice | |
| 23 | + * in the same form as they appear in the distribution. See the License for | |
| 24 | + * requirements. | |
| 20 | 25 | * |
| 21 | 26 | * The Original Code is: KnowledgeTree Open Source |
| 22 | 27 | * |
| ... | ... | @@ -25,6 +30,7 @@ |
| 25 | 30 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 26 | 31 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 27 | 32 | * All Rights Reserved. |
| 33 | + * Contributor( s): ______________________________________ | |
| 28 | 34 | * |
| 29 | 35 | * |
| 30 | 36 | * @version $Revision$ | ... | ... |
lib/documentmanagement/observers.inc.php
| ... | ... | @@ -4,15 +4,20 @@ |
| 4 | 4 | * $Id$ |
| 5 | 5 | * |
| 6 | 6 | * The contents of this file are subject to the KnowledgeTree Public |
| 7 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 7 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 8 | 8 | * compliance with the License. You may obtain a copy of the License at |
| 9 | 9 | * http://www.knowledgetree.com/KPL |
| 10 | 10 | * |
| 11 | 11 | * Software distributed under the License is distributed on an "AS IS" |
| 12 | - * basis, | |
| 13 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 14 | - * for the specific language governing rights and limitations under the | |
| 15 | - * License. | |
| 12 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing rights and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + * All copies of the Covered Code must include on each user interface screen: | |
| 17 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 18 | + * (ii) the KnowledgeTree copyright notice | |
| 19 | + * in the same form as they appear in the distribution. See the License for | |
| 20 | + * requirements. | |
| 16 | 21 | * |
| 17 | 22 | * The Original Code is: KnowledgeTree Open Source |
| 18 | 23 | * |
| ... | ... | @@ -21,6 +26,7 @@ |
| 21 | 26 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 22 | 27 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 23 | 28 | * All Rights Reserved. |
| 29 | + * Contributor( s): ______________________________________ | |
| 24 | 30 | * |
| 25 | 31 | */ |
| 26 | 32 | ... | ... |
lib/email/Email.inc
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Contains static functions concerned with sending emails. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | * |
| 27 | 33 | * @version $Revision$ | ... | ... |
lib/filelike/filelike.inc.php
| ... | ... | @@ -6,15 +6,20 @@ |
| 6 | 6 | * close) that may not deal with files on the filesystem (or URLs). |
| 7 | 7 | * |
| 8 | 8 | * The contents of this file are subject to the KnowledgeTree Public |
| 9 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 9 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 10 | 10 | * compliance with the License. You may obtain a copy of the License at |
| 11 | 11 | * http://www.knowledgetree.com/KPL |
| 12 | 12 | * |
| 13 | 13 | * Software distributed under the License is distributed on an "AS IS" |
| 14 | - * basis, | |
| 15 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 16 | - * for the specific language governing rights and limitations under the | |
| 17 | - * License. | |
| 14 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 15 | + * See the License for the specific language governing rights and | |
| 16 | + * limitations under the License. | |
| 17 | + * | |
| 18 | + * All copies of the Covered Code must include on each user interface screen: | |
| 19 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 20 | + * (ii) the KnowledgeTree copyright notice | |
| 21 | + * in the same form as they appear in the distribution. See the License for | |
| 22 | + * requirements. | |
| 18 | 23 | * |
| 19 | 24 | * The Original Code is: KnowledgeTree Open Source |
| 20 | 25 | * |
| ... | ... | @@ -23,6 +28,7 @@ |
| 23 | 28 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 24 | 29 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 25 | 30 | * All Rights Reserved. |
| 31 | + * Contributor( s): ______________________________________ | |
| 26 | 32 | * |
| 27 | 33 | * |
| 28 | 34 | * @version $Revision$ | ... | ... |
lib/filelike/filelikeutil.inc.php
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Utilities using file-like objects |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | * |
| 27 | 33 | * @version $Revision$ | ... | ... |
lib/filelike/fsfilelike.inc.php
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Filelike wrapper for normal files (and streams too) |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | * |
| 27 | 33 | * @version $Revision$ | ... | ... |
lib/filelike/stringfilelike.inc.php
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Filelike wrapper for strings |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | * |
| 27 | 33 | * @version $Revision$ | ... | ... |
lib/foldermanagement/Folder.inc
| ... | ... | @@ -5,15 +5,20 @@ |
| 5 | 5 | * Represents as folder as the per the folders table in the database. |
| 6 | 6 | * |
| 7 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| 8 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 8 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 9 | 9 | * compliance with the License. You may obtain a copy of the License at |
| 10 | 10 | * http://www.knowledgetree.com/KPL |
| 11 | 11 | * |
| 12 | 12 | * Software distributed under the License is distributed on an "AS IS" |
| 13 | - * basis, | |
| 14 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 15 | - * for the specific language governing rights and limitations under the | |
| 16 | - * License. | |
| 13 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 14 | + * See the License for the specific language governing rights and | |
| 15 | + * limitations under the License. | |
| 16 | + * | |
| 17 | + * All copies of the Covered Code must include on each user interface screen: | |
| 18 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 19 | + * (ii) the KnowledgeTree copyright notice | |
| 20 | + * in the same form as they appear in the distribution. See the License for | |
| 21 | + * requirements. | |
| 17 | 22 | * |
| 18 | 23 | * The Original Code is: KnowledgeTree Open Source |
| 19 | 24 | * |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 23 | 28 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 24 | 29 | * All Rights Reserved. |
| 30 | + * Contributor( s): ______________________________________ | |
| 25 | 31 | * |
| 26 | 32 | * |
| 27 | 33 | * @version $Revision$ | ... | ... |
lib/foldermanagement/PhysicalFolderManagement.inc
| ... | ... | @@ -6,15 +6,20 @@ |
| 6 | 6 | * such as creating/deleting folders |
| 7 | 7 | * |
| 8 | 8 | * The contents of this file are subject to the KnowledgeTree Public |
| 9 | - * License Version 1.1 ("License"); You may not use this file except in | |
| 9 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 10 | 10 | * compliance with the License. You may obtain a copy of the License at |
| 11 | 11 | * http://www.knowledgetree.com/KPL |
| 12 | 12 | * |
| 13 | 13 | * Software distributed under the License is distributed on an "AS IS" |
| 14 | - * basis, | |
| 15 | - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 16 | - * for the specific language governing rights and limitations under the | |
| 17 | - * License. | |
| 14 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 15 | + * See the License for the specific language governing rights and | |
| 16 | + * limitations under the License. | |
| 17 | + * | |
| 18 | + * All copies of the Covered Code must include on each user interface screen: | |
| 19 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 20 | + * (ii) the KnowledgeTree copyright notice | |
| 21 | + * in the same form as they appear in the distribution. See the License for | |
| 22 | + * requirements. | |
| 18 | 23 | * |
| 19 | 24 | * The Original Code is: KnowledgeTree Open Source |
| 20 | 25 | * |
| ... | ... | @@ -23,6 +28,7 @@ |
| 23 | 28 | * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright |
| 24 | 29 | * (C) 2007 The Jam Warehouse Software (Pty) Ltd; |
| 25 | 30 | * All Rights Reserved. |
| 31 | + * Contributor( s): ______________________________________ | |
| 26 | 32 | * |
| 27 | 33 | * |
| 28 | 34 | * @version $Revision$ | ... | ... |