parent
7bffc8bf97
commit
ef9a212ece
3 changed files with 173 additions and 123 deletions
|
@ -79,39 +79,46 @@ function getFullPath($dirname) {
|
|||
// check configuration
|
||||
$errmsgs = array();
|
||||
if (!isset($davconfig['digest.file'])) {
|
||||
array_push($errmsgs, 'digest.file not defined');
|
||||
array_push($errmsgs, 'digest.file is not defined.');
|
||||
} elseif (!is_readable($davconfig['digest.file']) ||
|
||||
!is_writable($davconfig['digest.file'])) {
|
||||
array_push($errmsgs,
|
||||
'The specified digest file is not readable and writable.');
|
||||
}
|
||||
if (!isset($davconfig['group.file'])) {
|
||||
array_push($errmsgs, 'group.file not defined');
|
||||
array_push($errmsgs, 'group.file is not defined.');
|
||||
} elseif (!is_readable($davconfig['group.file']) ||
|
||||
!is_writable($davconfig['group.file'])) {
|
||||
array_push($errmsgs,
|
||||
'The specified group file is not readable and writable.');
|
||||
}
|
||||
if (!isset($davconfig['namemap.file'])) {
|
||||
array_push($errmsgs, 'namemap.file not defined');
|
||||
array_push($errmsgs, 'namemap.file is not defined.');
|
||||
} elseif (!is_readable($davconfig['namemap.file']) ||
|
||||
!is_writable($davconfig['namemap.file'])) {
|
||||
array_push($errmsgs,
|
||||
'The specified name mapping file is not readable and writable.');
|
||||
}
|
||||
if (!isset($davconfig['dav.dir'])) {
|
||||
array_push($errmsgs, 'dav.dir not defined');
|
||||
array_push($errmsgs, 'dav.dir is not defined.');
|
||||
} elseif (!is_dir($davconfig['dav.dir']) ||
|
||||
!is_readable($davconfig['dav.dir']) ||
|
||||
!is_writable($davconfig['dav.dir'])) {
|
||||
array_push($errmsgs,
|
||||
'The specified DAV directory is no directory or not accessable.');
|
||||
}
|
||||
if (empty($davconfig['dav.realm'])) {
|
||||
array_push($errmsgs, 'dav.realm is not defined.');
|
||||
}
|
||||
if (empty($davconfig['dav.uri'])) {
|
||||
array_push($errmsgs, 'dav.uri is not defined.');
|
||||
}
|
||||
if (!empty($errmsgs)) {
|
||||
errorAsHtml(implode("<br />", $errmsgs));
|
||||
}
|
||||
|
||||
$namemap = json_decode(readfile($davconfig['namemap.file']), true);
|
||||
$namemapdata = file_get_contents($davconfig['namemap.file']);
|
||||
$namemap = json_decode($namemapdata, true);
|
||||
if ($namemap === NULL) {
|
||||
$namemap = array();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue