Fix event error/success json message
This commit is contained in:
parent
7c5e389067
commit
0660133d2e
|
@ -33,12 +33,12 @@ if($errarr){
|
|||
$data = OC_Calendar_Object::find($id);
|
||||
if (!$data)
|
||||
{
|
||||
echo json_encode(array("error"=>"true"));
|
||||
echo json_encode(array('status'=>'error'));
|
||||
exit;
|
||||
}
|
||||
$calendar = OC_Calendar_Calendar::findCalendar($data['calendarid']);
|
||||
if($calendar['userid'] != OC_User::getUser()){
|
||||
echo json_encode(array("error"=>"true"));
|
||||
echo json_encode(array('status'=>'error'));
|
||||
exit;
|
||||
}
|
||||
$vcalendar = Sabre_VObject_Reader::read($data['calendardata']);
|
||||
|
|
|
@ -29,13 +29,13 @@ if(!OC_USER::isLoggedIn()) {
|
|||
$errarr = OC_Calendar_Object::validateRequest($_POST);
|
||||
if($errarr){
|
||||
//show validate errors
|
||||
$errarr["error"] = "true";
|
||||
$errarr['status'] = 'error';
|
||||
echo json_encode($errarr);
|
||||
exit;
|
||||
}else{
|
||||
$cal = $_POST['calendar'];
|
||||
$vcalendar = OC_Calendar_Object::createVCalendarFromRequest($_POST);
|
||||
$result = OC_Calendar_Object::add($cal, $vcalendar->serialize());
|
||||
echo json_encode(array("success"=>"true"));
|
||||
echo json_encode(array('status'=>'success'));
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue