25require
'../main.inc.php';
26require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
27require_once DOL_DOCUMENT_ROOT.
'/dav/dav.lib.php';
30$langs->loadLangs(array(
"admin",
"other",
"agenda"));
37$action =
GETPOST(
'action',
'aZ09');
38$backtopage =
GETPOST(
'backtopage',
'alpha');
44$arrayofparameters = array(
45 'DAV_RESTICT_ON_IP'=>array(
'css'=>
'minwidth200',
'enabled'=>1),
46 'DAV_ALLOW_PRIVATE_DIR'=>array(
'css'=>
'minwidth200',
'enabled'=>2),
47 'DAV_ALLOW_PUBLIC_DIR'=>array(
'css'=>
'minwidth200',
'enabled'=>1),
48 'DAV_ALLOW_ECM_DIR'=>array(
'css'=>
'minwidth200',
'enabled'=>isModEnabled(
'ecm'))
53dol_mkdir($conf->dav->dir_output.
'/public');
54dol_mkdir($conf->dav->dir_output.
'/private');
61include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
63if ($action ==
'update') {
72$help_url =
'EN:Module_DAV';
74llxHeader(
'', $langs->trans(
"DAVSetup"), $help_url);
76$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
80print
'<form name="agendasetupform" action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
81print
'<input type="hidden" name="token" value="'.newToken().
'">';
87if ($action ==
'edit') {
88 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
89 print
'<input type="hidden" name="token" value="'.newToken().
'">';
90 print
'<input type="hidden" name="action" value="update">';
92 print
'<table class="noborder centpercent nomarginbottom">';
93 print
'<tr class="liste_titre"><td>'.$langs->trans(
"Parameter").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
95 foreach ($arrayofparameters as $key => $val) {
96 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
100 print
'<tr class="oddeven"><td>';
101 $tooltiphelp = (($langs->trans($key.
'Tooltip') != $key.
'Tooltip') ? $langs->trans($key.
'Tooltip') :
'');
102 $label = $langs->trans($key);
103 if ($key ==
'DAV_RESTICT_ON_IP') {
104 $label = $langs->trans(
"RESTRICT_ON_IP");
105 $tooltiphelp .=
' '.$langs->trans(
"Example").
': '.$langs->trans(
"IPListExample");
107 print $form->textwithpicto($label, $tooltiphelp);
109 if ($key ==
'DAV_ALLOW_PRIVATE_DIR') {
110 print $langs->trans(
"AlwaysActive");
111 } elseif ($key ==
'DAV_ALLOW_PUBLIC_DIR' || $key ==
'DAV_ALLOW_ECM_DIR') {
114 print
'<input name="'.$key.
'" class="flat '.(empty($val[
'css']) ?
'minwidth200' : $val[
'css']).
'" value="'.
getDolGlobalString($key).
'">';
121 print
'<br><div class="center">';
122 print
'<input class="button button-save" type="submit" value="'.$langs->trans(
"Save").
'">';
128 print
'<table class="noborder centpercent nomarginbottom">';
129 print
'<tr class="liste_titre"><td>'.$langs->trans(
"Parameter").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
131 foreach ($arrayofparameters as $key => $val) {
132 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
136 print
'<tr class="oddeven"><td>';
137 $tooltiphelp = (($langs->trans($key.
'Tooltip') != $key.
'Tooltip') ? $langs->trans($key.
'Tooltip') :
'');
138 $label = $langs->trans($key);
139 if ($key ==
'DAV_RESTICT_ON_IP') {
140 $label = $langs->trans(
"RESTRICT_ON_IP");
141 $tooltiphelp .=
' <span class="opacitymedium">'.$langs->trans(
"Example").
': '.$langs->trans(
"IPListExample").
'</span>';
143 print $form->textwithpicto($label, $tooltiphelp);
144 print
'</td><td class="minwidth200">';
145 if ($key ==
'DAV_ALLOW_PRIVATE_DIR') {
146 print $langs->trans(
"AlwaysActive");
147 } elseif ($key ==
'DAV_ALLOW_PUBLIC_DIR' || $key ==
'DAV_ALLOW_ECM_DIR') {
157 print
'<div class="tabsAction">';
158 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.newToken().
'">'.$langs->trans(
"Modify").
'</a>';
174print
'<span class="opacitymedium">'.$langs->trans(
"WebDAVSetupDesc").
"</span><br>\n";
179$urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
180$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
186$url =
'<a href="'.$urlwithroot.
'/dav/fileserver.php" target="_blank" rel="noopener noreferrer">'.$urlwithroot.
'/dav/fileserver.php</a>';
188$message .=
img_picto(
'',
'globe').
' '.str_replace(
'{url}', $url, $langs->trans(
"WebDavServer",
'WebDAV',
''));
189$message .=
'<div class="urllink"><input type="text" id="webdavpublicurl" class="quatrevingtpercent" value="'.$urlwithroot.
'/dav/fileserver.php">';
190$message .=
'<a href="'.$urlwithroot.
'/dav/fileserver.php" target="_blank" rel="noopener noreferrer">';
191$message .=
' '.img_picto(
'',
'globe');
198 $urlEntity = (isModEnabled(
'multicompany') ?
'?entity=' . $conf->entity :
'');
199 $url =
'<a href="' . $urlwithroot .
'/dav/fileserver.php/public/' . $urlEntity .
'" target="_blank" rel="noopener noreferrer">' . $urlwithroot .
'/dav/fileserver.php/public/' . $urlEntity .
'</a>';
201 $message .=
img_picto(
'',
'globe') .
' ' . str_replace(
'{url}', $url, $langs->trans(
"WebDavServer",
'WebDAV public',
''));
202 $message .=
'<div class="urllink"><input type="text" id="webdavurl" class="quatrevingtpercent" value="' . $urlwithroot .
'/dav/fileserver.php/public/' . $urlEntity .
'">';
203 $message .=
'<a href="' . $urlwithroot .
'/dav/fileserver.php/public/' . $urlEntity .
'" target="_blank" rel="noopener noreferrer">';
204 $message .=
' ' .
img_picto(
'',
'globe');
206 $message .=
'</div>';
214require_once DOL_DOCUMENT_ROOT.
'/includes/sabre/autoload.php';
215$version = Sabre\DAV\Version::VERSION;
216print
'<span class="opacitymedium">'.$langs->trans(
"BaseOnSabeDavVersion").
' : '.$version.
'</span>';
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
if(!defined('CDAV_CONTACT_TAG')) if(!defined( 'CDAV_URI_KEY')) dav_admin_prepare_head()
Prepare array with list of tabs.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
ajax_autoselect($htmlname, $addlink='', $textonlink='Link')
Make content of an input box selected when we click into input field.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.