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'=>$conf->ecm->enabled)
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') {
107 print
$form->selectyesno($key, $conf->global->$key, 1);
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 print
'<tr class="oddeven"><td>';
128 $tooltiphelp = (($langs->trans($key.
'Tooltip') != $key.
'Tooltip') ? $langs->trans($key.
'Tooltip') :
'');
129 $label = $langs->trans($key);
130 if ($key ==
'DAV_RESTICT_ON_IP') {
131 $label = $langs->trans(
"RESTRICT_ON_IP");
132 $tooltiphelp .=
' <span class="opacitymedium">'.$langs->trans(
"Example").
': '.$langs->trans(
"IPListExample").
'</span>';
134 print
$form->textwithpicto($label, $tooltiphelp);
135 print
'</td><td class="minwidth200">';
136 if ($key ==
'DAV_ALLOW_PRIVATE_DIR') {
137 print $langs->trans(
"AlwaysActive");
138 } elseif ($key ==
'DAV_ALLOW_PUBLIC_DIR' || $key ==
'DAV_ALLOW_ECM_DIR') {
139 print
yn($conf->global->$key);
141 print $conf->global->$key;
148 print
'<div class="tabsAction">';
149 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>';
165 print
'<span class="opacitymedium">'.$langs->trans(
"WebDAVSetupDesc").
"</span><br>\n";
170 $urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
171 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
177 $url =
'<a href="'.$urlwithroot.
'/dav/fileserver.php" target="_blank" rel="noopener noreferrer">'.$urlwithroot.
'/dav/fileserver.php</a>';
179 $message .=
img_picto(
'',
'globe').
' '.str_replace(
'{url}', $url, $langs->trans(
"WebDavServer",
'WebDAV',
''));
180 $message .=
'<div class="urllink"><input type="text" id="webdavpublicurl" class="quatrevingtpercent" value="'.$urlwithroot.
'/dav/fileserver.php">';
181 $message .=
'<a href="'.$urlwithroot.
'/dav/fileserver.php" target="_blank" rel="noopener noreferrer">';
182 $message .=
' '.img_picto(
'',
'globe');
184 $message .=
'</div>';
188 if (!empty($conf->global->DAV_ALLOW_PUBLIC_DIR)) {
189 $urlEntity = (
isModEnabled(
'multicompany') ?
'?entity=' . $conf->entity :
'');
190 $url =
'<a href="' . $urlwithroot .
'/dav/fileserver.php/public/' . $urlEntity .
'" target="_blank" rel="noopener noreferrer">' . $urlwithroot .
'/dav/fileserver.php/public/' . $urlEntity .
'</a>';
192 $message .=
img_picto(
'',
'globe') .
' ' . str_replace(
'{url}', $url, $langs->trans(
"WebDavServer",
'WebDAV public',
''));
193 $message .=
'<div class="urllink"><input type="text" id="webdavurl" class="quatrevingtpercent" value="' . $urlwithroot .
'/dav/fileserver.php/public/' . $urlEntity .
'">';
194 $message .=
'<a href="' . $urlwithroot .
'/dav/fileserver.php/public/' . $urlEntity .
'" target="_blank" rel="noopener noreferrer">';
195 $message .=
' ' .
img_picto(
'',
'globe');
197 $message .=
'</div>';
205 require_once DOL_DOCUMENT_ROOT.
'/includes/sabre/autoload.php';
206 $version = Sabre\DAV\Version::VERSION;
207 print
'<span class="opacitymedium">'.$langs->trans(
"BaseOnSabeDavVersion").
' : '.$version.
'</span>';
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.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
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.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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.