Go to the documentation of this file.
25 require
'../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
27 require_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');
42 $arrayofparameters = array(
43 'DAV_RESTICT_ON_IP'=>array(
'css'=>
'minwidth200',
'enabled'=>1),
44 'DAV_ALLOW_PRIVATE_DIR'=>array(
'css'=>
'minwidth200',
'enabled'=>2),
45 'DAV_ALLOW_PUBLIC_DIR'=>array(
'css'=>
'minwidth200',
'enabled'=>1),
46 'DAV_ALLOW_ECM_DIR'=>array(
'css'=>
'minwidth200',
'enabled'=>
isModEnabled(
'ecm'))
50 dol_mkdir($conf->dav->dir_output.
'/temp');
51 dol_mkdir($conf->dav->dir_output.
'/public');
52 dol_mkdir($conf->dav->dir_output.
'/private');
59 include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
71 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
75 print
'<form name="agendasetupform" action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
76 print
'<input type="hidden" name="token" value="'.newToken().
'">';
82 if ($action ==
'edit') {
83 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
84 print
'<input type="hidden" name="token" value="'.newToken().
'">';
85 print
'<input type="hidden" name="action" value="update">';
87 print
'<table class="noborder centpercent nomarginbottom">';
88 print
'<tr class="liste_titre"><td>'.$langs->trans(
"Parameter").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
90 foreach ($arrayofparameters as $key => $val) {
91 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
95 print
'<tr class="oddeven"><td>';
96 $tooltiphelp = (($langs->trans($key.
'Tooltip') != $key.
'Tooltip') ? $langs->trans($key.
'Tooltip') :
'');
97 $label = $langs->trans($key);
98 if ($key ==
'DAV_RESTICT_ON_IP') {
99 $label = $langs->trans(
"RESTRICT_ON_IP");
100 $tooltiphelp .=
' '.$langs->trans(
"Example").
': '.$langs->trans(
"IPListExample");
102 print
$form->textwithpicto($label, $tooltiphelp);
104 if ($key ==
'DAV_ALLOW_PRIVATE_DIR') {
105 print $langs->trans(
"AlwaysActive");
106 } elseif ($key ==
'DAV_ALLOW_PUBLIC_DIR' || $key ==
'DAV_ALLOW_ECM_DIR') {
109 print
'<input name="'.$key.
'" class="flat '.(empty($val[
'css']) ?
'minwidth200' : $val[
'css']).
'" value="'.
getDolGlobalString($key).
'">';
116 print
'<br><div class="center">';
117 print
'<input class="button button-save" type="submit" value="'.$langs->trans(
"Save").
'">';
123 print
'<table class="noborder centpercent nomarginbottom">';
124 print
'<tr class="liste_titre"><td>'.$langs->trans(
"Parameter").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
126 foreach ($arrayofparameters as $key => $val) {
127 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
131 print
'<tr class="oddeven"><td>';
132 $tooltiphelp = (($langs->trans($key.
'Tooltip') != $key.
'Tooltip') ? $langs->trans($key.
'Tooltip') :
'');
133 $label = $langs->trans($key);
134 if ($key ==
'DAV_RESTICT_ON_IP') {
135 $label = $langs->trans(
"RESTRICT_ON_IP");
136 $tooltiphelp .=
' <span class="opacitymedium">'.$langs->trans(
"Example").
': '.$langs->trans(
"IPListExample").
'</span>';
138 print
$form->textwithpicto($label, $tooltiphelp);
139 print
'</td><td class="minwidth200">';
140 if ($key ==
'DAV_ALLOW_PRIVATE_DIR') {
141 print $langs->trans(
"AlwaysActive");
142 } elseif ($key ==
'DAV_ALLOW_PUBLIC_DIR' || $key ==
'DAV_ALLOW_ECM_DIR') {
152 print
'<div class="tabsAction">';
153 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>';
169 print
'<span class="opacitymedium">'.$langs->trans(
"WebDAVSetupDesc").
"</span><br>\n";
174 $urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
175 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
181 $url =
'<a href="'.$urlwithroot.
'/dav/fileserver.php" target="_blank" rel="noopener noreferrer">'.$urlwithroot.
'/dav/fileserver.php</a>';
183 $message .=
img_picto(
'',
'globe').
' '.str_replace(
'{url}', $url, $langs->trans(
"WebDavServer",
'WebDAV',
''));
184 $message .=
'<div class="urllink"><input type="text" id="webdavpublicurl" class="quatrevingtpercent" value="'.$urlwithroot.
'/dav/fileserver.php">';
185 $message .=
'<a href="'.$urlwithroot.
'/dav/fileserver.php" target="_blank" rel="noopener noreferrer">';
186 $message .=
' '.img_picto(
'',
'globe');
188 $message .=
'</div>';
193 $urlEntity = (
isModEnabled(
'multicompany') ?
'?entity=' . $conf->entity :
'');
194 $url =
'<a href="' . $urlwithroot .
'/dav/fileserver.php/public/' . $urlEntity .
'" target="_blank" rel="noopener noreferrer">' . $urlwithroot .
'/dav/fileserver.php/public/' . $urlEntity .
'</a>';
196 $message .=
img_picto(
'',
'globe') .
' ' . str_replace(
'{url}', $url, $langs->trans(
"WebDavServer",
'WebDAV public',
''));
197 $message .=
'<div class="urllink"><input type="text" id="webdavurl" class="quatrevingtpercent" value="' . $urlwithroot .
'/dav/fileserver.php/public/' . $urlEntity .
'">';
198 $message .=
'<a href="' . $urlwithroot .
'/dav/fileserver.php/public/' . $urlEntity .
'" target="_blank" rel="noopener noreferrer">';
199 $message .=
' ' .
img_picto(
'',
'globe');
201 $message .=
'</div>';
209 require_once DOL_DOCUMENT_ROOT.
'/includes/sabre/autoload.php';
210 $version = Sabre\DAV\Version::VERSION;
211 print
'<span class="opacitymedium">'.$langs->trans(
"BaseOnSabeDavVersion").
' : '.$version.
'</span>';
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
isModEnabled($module)
Is Dolibarr module enabled.
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.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
ajax_autoselect($htmlname, $addlink='', $textonlink='Link')
Make content of an input box selected when we click into input field.
if(!defined('CDAV_CONTACT_TAG')) if(!defined('CDAV_URI_KEY')) dav_admin_prepare_head()
Prepare array with list of tabs.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)