mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-09-23 06:39:18 +00:00
Import patch from Maxime.
This commit is contained in:
parent
242d95fc08
commit
97aff18dbe
@ -133,12 +133,12 @@ class Tools {
|
|||||||
$path = "/".substr($file,0,-4).$path_ics;
|
$path = "/".substr($file,0,-4).$path_ics;
|
||||||
dbg_error_log( "importFromDirectory", "importing to $path");
|
dbg_error_log( "importFromDirectory", "importing to $path");
|
||||||
include_once("caldav-PUT-functions.php");
|
include_once("caldav-PUT-functions.php");
|
||||||
$qry = new PgQuery( "SELECT * FROM usr WHERE username = ?;", substr($file,0,-4) );
|
if ( $user = getUserByName(substr($file,0,-4),'importFromDirectory',__LINE__,__FILE__)) {
|
||||||
if ( $qry->Exec("importFromDirectory") && $user = $qry->Fetch() ) {
|
|
||||||
$user_no = $user->user_no;
|
$user_no = $user->user_no;
|
||||||
}
|
}
|
||||||
controlRequestContainer(substr($file,0,-4),$user_no, $path,false);
|
if(controlRequestContainer(substr($file,0,-4),$user_no, $path,false) === -1)
|
||||||
import_collection($ics,$user_no,$path,false);
|
continue;
|
||||||
|
import_collection($ics,$user_no,$path,1);
|
||||||
$c->messages[] = sprintf(i18n("all events of user %s were deleted and replaced by those from file %s"),substr($file,0,-4),$dir.'/'.$file);
|
$c->messages[] = sprintf(i18n("all events of user %s were deleted and replaced by those from file %s"),substr($file,0,-4),$dir.'/'.$file);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -153,4 +153,4 @@ class Tools {
|
|||||||
|
|
||||||
include("page-footer.php");
|
include("page-footer.php");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -53,9 +53,10 @@
|
|||||||
if ( check_string($ics) ) {
|
if ( check_string($ics) ) {
|
||||||
$path = "/".$user->Get("username").$path_ics;
|
$path = "/".$user->Get("username").$path_ics;
|
||||||
include("caldav-PUT-functions.php");
|
include("caldav-PUT-functions.php");
|
||||||
controlRequestContainer($user->Get("username"),$user->user_no, $path,false);
|
if(controlRequestContainer($user->Get("username"),$user->user_no, $path,false) === true ){
|
||||||
import_collection($ics,$user->user_no,$path,false);
|
import_collection($ics,$user->user_no,$path,$session->user_no);
|
||||||
$c->messages[] = sprintf(translate("All events of user %s were deleted and replaced by those from the file."),$user->Get("username"));
|
$c->messages[] = sprintf(translate("All events of user %s were deleted and replaced by those from the file."),$user->Get("username"));
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
$c->messages[] = sprintf(translate("The file %s is not UTF-8 encoded, please check the error for more details."),$dir.'/'.$file);
|
$c->messages[] = sprintf(translate("The file %s is not UTF-8 encoded, please check the error for more details."),$dir.'/'.$file);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user