src/common/docman/actions/trashdir.php -text
src/common/docman/actions/trashfile.php -text
src/common/docman/actions/updateenginesearch.php -text
+src/common/docman/actions/updatewebdavinterface.php -text
src/common/docman/engine/parser_doc.php -text
src/common/docman/engine/parser_html.php -text
src/common/docman/engine/parser_list.txt -text
src/common/docman/engine/parser_text.php -text
src/common/docman/include/utils.php -text
src/common/docman/include/vtemplate.class.php -text
+src/common/docman/include/webdav.php -text
src/common/docman/views/addfile.php -text
src/common/docman/views/addsubdocgroup.php -text
src/common/docman/views/admin.php -text
src/db/20100924-theme.sql -text
src/db/20100926-pfo-rbac.sql -text
src/db/20100927-pfo-rbac.sql -text
+src/db/20101012-docman-webdav.sql -text
src/db/FTI-20061025.sql -text
src/db/gforge-data-mysql.sql -text
src/db/gforge-struct-mysql.sql -text
--- /dev/null
+<?php
+/**
+ * FusionForge Documentation Manager
+ *
+ * Copyright 2010, Franck Villaume - Capgemini
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+if ( !forge_check_perm ('docman', $group_id, 'approve')) {
+ $return_msg= _('Docman Action Denied');
+ session_redirect('/docman/?group_id='.$group_id.'&warning_msg='.urlencode($return_msg));
+} else {
+
+ if ($_POST['status']) {
+ $status = 1;
+ $return_msg= _('Webdav Interface updated successfully : Active');
+ } else {
+ $status = 0;
+ $return_msg= _('Webdav Interface updated successfully : Off');
+ }
+
+ if (!$g->setDocmanWebdav($status))
+ session_redirect('/docman/?group_id='.$group_id.'&view=admin&warning_msg='.urlencode($g->getErrorMessage()));
+
+ session_redirect('/docman/?group_id='.$group_id.'&view=admin&feedback='.urlencode($return_msg));
+}
+?>
--- /dev/null
+<?php
+
+/**
+ * FusionForge Documentation Manager
+ *
+ * Copyright 2010, Franck Villaume - Capgemini
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* webdav extended class based on pear package */
+/* http://pear.php.net/package/HTTP_WebDAV_Server/ */
+
+require_once "HTTP/WebDAV/Server.php";
+
+class HTTP_WebDAV_Server_Docman extends HTTP_WebDAV_Server {
+
+ function GET(&$options) {
+ echo "<html><head><title>Index of ".htmlspecialchars($options['path'])."</title></head>\n";
+ echo "<h1>Index of ".htmlspecialchars($options['path'])."</h1>\n";
+ echo "</html>\n";
+ exit;
+ }
+
+}
+?>
echo '<a href="#" onclick="javascript:displayAdminDiv(\'adminoptions\')" ><h4>'. _('Admin Options') .'</h4></a>';
echo '<div id="adminoptions" style="display:none;" >';
+
echo '<form id="backup" name="backup" method="post" action="'. util_make_url ('/docman/view.php/'.$group_id.'/backup') .'" >';
echo '<ul>';
echo '<li><input id="submitbackup" type="button" value="'. _('Extract documents and directories as an archive') .'" onclick="javascript:doIt(\'backup\')"></li>';
echo '</ul>';
echo '</form>';
+
echo '<form id="searchengine" name="searchengine" method="post" action="?group_id='.$group_id.'&action=updateenginesearch" >';
echo '<ul>';
echo '</form>';
}
}
+
+ if (forge_get_config('use_webdav')) {
+ echo '<form id="webdavinterface" name="searchengine" method="post" action="?group_id='.$group_id.'&action=updatewebdavinterface" >';
+ echo '<ul>';
+ $webdavStatus = '1';
+ $labelWebdavInterface = _('Enable Webdav Interface');
+ if ($g->useWebDav()) {
+ $webdavStatus = '0';
+ $labelWebdavInterface = _('Disable Webdav Interface');
+ }
+ echo '<li><input name="status" type="hidden" value="'.$webdavStatus.'"><input id="submitweddavinterface" type="button" value="'.$labelWebdavInterface.'" onclick="javascript:doIt(\'webdavinterface\')"></li>';
+ echo '</ul>';
+ echo '</form>';
+ }
+
echo '</div></div>';
}
?>
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+echo '<div class="docmanDivIncluded">';
+if ($g->useWebdav()) {
+ echo '<p>'. _('Documents parsing is also available thru webdav').'</p>';
+ echo '<p>' . util_make_link('/docman/view.php/'.$group_id.'/webdav',_('Direct Webdav URL')) . '</p>';
+}
+echo '</div>';
?>
-<div class="docmanDivIncluded">
-<p>this is help</p>
-</div>
}
}
/**
- * usesDocmanSearch - whether or not this group has opted to use docman search engine.
+ * useDocmanSearch - whether or not this group has opted to use docman search engine.
*
* @return boolean use_docman_search.
*/
}
}
+ /**
+ * useWebdav - whether or not this group has opted to use webdav interface.
+ *
+ * @return boolean use_docman_search.
+ */
+ function useWebdav() {
+
+ if (forge_get_config('use_webdav')) {
+ return $this->data_array['use_webdav'];
+ } else {
+ return false;
+ }
+ }
+
/**
* usesFTP - whether or not this group has opted to use FTP.
*
return $this->membersArr;
}
+ function setDocmanWebdav($status) {
+ db_begin();
+ /* if we activate search engine, we probably want to reindex */
+ $res = db_query_params ('UPDATE groups SET use_webdav=$1 WHERE group_id=$2',
+ array ($status,
+ $this->getID())) ;
+
+ if (!$res) {
+ $this->setError(sprintf(_('ERROR - Could Not Update Group UseWebdab Status: %s'),db_error()));
+ db_rollback();
+ return false;
+ } else {
+ $this->data_array['use_webdav']=$status;
+ db_commit();
+ return true;
+ }
+ }
+
function setDocmanSearchStatus($status) {
db_begin();
/* if we activate search engine, we probably want to reindex */
"$fusionforge_basedir/common", "$fusionforge_basedir/www",
"$fusionforge_basedir/plugins", "$fusionforge_basedir",
"$fusionforge_basedir/www/include",
- "/usr/share/php"));
+ "/usr/share/php","/usr/share/pear"));
// By default, the include_path is changed to include path needed by Gforge.
// If this does not work, then set defines to real path directly.
--- /dev/null
+ALTER TABLE GROUPS ADD COLUMN use_webdav INT;
+ALTER TABLE GROUPS ALTER COLUMN use_webdav SET DEFAULT 1;
+UPDATE GROUPS SET use_webdav = 0;
*
* Copyright 2000, Quentin Cregan/Sourceforge
* Copyright 2002-2003, Tim Perdue/GForge, LLC
- * Copyright 2010, Franck Villaume
+ * Copyright 2010, Franck Villaume - Capgemini
*
* This file is part of FusionForge.
*
case "trashdir":
case "trashfile":
case "updateenginesearch":
+ case "updatewebdavinterface":
include ("docman/actions/$action.php");
;;
}
*
* Copyright 2000, Quentin Cregan/Sourceforge
* Copyright 2002-2003, Tim Perdue/GForge, LLC
- * Copyright 2010, Franck Villaume
+ * Copyright 2010, Franck Villaume - Capgemini
*
* This file is part of FusionForge.
*
require_once $gfcommon.'docman/DocumentFactory.class.php';
require_once $gfcommon.'docman/DocumentGroupFactory.class.php';
require_once $gfcommon.'docman/include/utils.php';
+require_once $gfcommon.'docman/include/webdav.php';
session_require_perm ('project_read', $group_id) ;
$group_id=$arr[3];
$docid=$arr[4];
-if ($docid != 'backup' ) {
+if ($docid != 'backup' && $docid != 'webdav' ) {
$docname=urldecode($arr[5]);
$g =& group_get_object($group_id);
$warning_msg = _('No documents to backup.');
session_redirect('/docman/?group_id='.$group_id.'&view=admin&warning_msg='.urlencode($warning_msg));
}
+} else if ( $docid == 'webdav' ) {
+ $_SERVER['REQUEST_URI'] = '';
+ $_SERVER['SCRIPT_NAME'] = '';
+ $server = new HTTP_WebDAV_Server_Docman;
+ $server->ServeRequest();
+ exit;
} else {
exit_error(_('No document to display - invalid or inactive document number.'),'docman');
}