admin import uses now msg functions

main
Philip Häusler 11 years ago
parent 7df8b967f3
commit ec4f173a61

@ -30,7 +30,7 @@ function admin_import() {
fclose($test_handle);
unlink('../import/tmp');
} else {
$msg = error("Webserver has no write-permission on import directory.", true);
error("Webserver has no write-permission on import directory.");
}
if (isset ($_REQUEST['submit'])) {
@ -40,7 +40,7 @@ function admin_import() {
if (!$fp) {
$ok = false;
$msg = error("File 'https://$PentabarfXMLhost/$PentabarfXMLpath" . $_REQUEST["url"] . "' not readable!" . "[$errstr ($errno)]", true);
error("File 'https://$PentabarfXMLhost/$PentabarfXMLpath" . $_REQUEST["url"] . "' not readable!" . "[$errstr ($errno)]");
} else {
$fileOut = fopen($import_file, "w");
$head = 'GET /' . $PentabarfXMLpath . $_REQUEST["url"] . ' HTTP/1.1' . "\r\n" .
@ -86,7 +86,7 @@ function admin_import() {
}
fclose($fileOut);
fclose($fp);
$msg .= success("Es wurden $Zeilen Zeilen eingelesen.", true);
success("Es wurden $Zeilen Zeilen eingelesen.");
}
}
elseif (isset ($_FILES['xcal_file']) && ($_FILES['xcal_file']['error'] == 0)) {
@ -94,16 +94,16 @@ function admin_import() {
libxml_use_internal_errors(true);
if (simplexml_load_file($import_file) === false) {
$ok = false;
$msg = error("No valid xml/xcal file provided.", true);
error("No valid xml/xcal file provided.");
unlink($import_file);
}
} else {
$ok = false;
$msg = error("File upload went wrong.", true);
error("File upload went wrong.");
}
} else {
$ok = false;
$msg = error("Please provide some data.", true);
error("Please provide some data.");
}
}
@ -112,7 +112,7 @@ function admin_import() {
else
$html .= template_render('../templates/admin_import_input.html', array (
'link' => page_link_to('admin_import'),
'msg' => $msg,
'msg' => msg(),
'url' => "https://$PentabarfXMLhost/$PentabarfXMLpath"
));
break;

Loading…
Cancel
Save