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);
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']);

View File

@ -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'));
}
?>