Fix event error/success json message

This commit is contained in:
Bart Visscher 2011-09-18 17:12:31 +02:00
parent 7c5e389067
commit 0660133d2e
2 changed files with 4 additions and 4 deletions

View File

@ -33,12 +33,12 @@ if($errarr){
$data = OC_Calendar_Object::find($id); $data = OC_Calendar_Object::find($id);
if (!$data) if (!$data)
{ {
echo json_encode(array("error"=>"true")); echo json_encode(array('status'=>'error'));
exit; exit;
} }
$calendar = OC_Calendar_Calendar::findCalendar($data['calendarid']); $calendar = OC_Calendar_Calendar::findCalendar($data['calendarid']);
if($calendar['userid'] != OC_User::getUser()){ if($calendar['userid'] != OC_User::getUser()){
echo json_encode(array("error"=>"true")); echo json_encode(array('status'=>'error'));
exit; exit;
} }
$vcalendar = Sabre_VObject_Reader::read($data['calendardata']); $vcalendar = Sabre_VObject_Reader::read($data['calendardata']);

View File

@ -29,13 +29,13 @@ if(!OC_USER::isLoggedIn()) {
$errarr = OC_Calendar_Object::validateRequest($_POST); $errarr = OC_Calendar_Object::validateRequest($_POST);
if($errarr){ if($errarr){
//show validate errors //show validate errors
$errarr["error"] = "true"; $errarr['status'] = 'error';
echo json_encode($errarr); echo json_encode($errarr);
exit; exit;
}else{ }else{
$cal = $_POST['calendar']; $cal = $_POST['calendar'];
$vcalendar = OC_Calendar_Object::createVCalendarFromRequest($_POST); $vcalendar = OC_Calendar_Object::createVCalendarFromRequest($_POST);
$result = OC_Calendar_Object::add($cal, $vcalendar->serialize()); $result = OC_Calendar_Object::add($cal, $vcalendar->serialize());
echo json_encode(array("success"=>"true")); echo json_encode(array('status'=>'success'));
} }
?> ?>