diff --git a/apps/bookmarks/ajax/addBookmark.php b/apps/bookmarks/ajax/addBookmark.php old mode 100644 new mode 100755 index ceeb034ec9de728be900d959d309183f63bad847..9241dc8ddf6c3f0a22fbf83df8ee178270f5a2a5 --- a/apps/bookmarks/ajax/addBookmark.php +++ b/apps/bookmarks/ajax/addBookmark.php @@ -27,9 +27,9 @@ $RUNTIME_NOSETUPFS=true; // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('bookmarks'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('bookmarks'); require_once(OC::$APPSROOT . '/apps/bookmarks/bookmarksHelper.php'); $id = addBookmark($_GET['url'], $_GET['title'], $_GET['tags']); -OC_JSON::success(array('data' => $id)); \ No newline at end of file +OCP\JSON::success(array('data' => $id)); \ No newline at end of file diff --git a/apps/bookmarks/ajax/delBookmark.php b/apps/bookmarks/ajax/delBookmark.php index 984a85931692b314b37960ed2c4e6199d26c5fd5..f40192943e411afc71819d50172b6dbe2dd43768 100755 --- a/apps/bookmarks/ajax/delBookmark.php +++ b/apps/bookmarks/ajax/delBookmark.php @@ -27,8 +27,8 @@ $RUNTIME_NOSETUPFS=true; // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('bookmarks'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('bookmarks'); $params=array( htmlspecialchars_decode($_GET["url"]), @@ -59,4 +59,4 @@ $query = OC_DB::prepare(" $result = $query->execute(); // var_dump($params); -OC_JSON::success(array('data' => array())); +OCP\JSON::success(array('data' => array())); diff --git a/apps/bookmarks/ajax/editBookmark.php b/apps/bookmarks/ajax/editBookmark.php index 5bed9d08448a8dc08c81a83a70fc270dadb1e3bc..1b6d6d6ce44adcc9457b70f52a039a6890a7b44f 100755 --- a/apps/bookmarks/ajax/editBookmark.php +++ b/apps/bookmarks/ajax/editBookmark.php @@ -27,8 +27,8 @@ $RUNTIME_NOSETUPFS=true; // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('bookmarks'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('bookmarks'); $CONFIG_DBTYPE = OCP\Config::getSystemValue( "dbtype", "sqlite" ); if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){ diff --git a/apps/bookmarks/ajax/recordClick.php b/apps/bookmarks/ajax/recordClick.php index 6519de241b6967b6e1612026b570f89d7400ff1e..03d010637fc436255242cc85bf90e083be4502c9 100755 --- a/apps/bookmarks/ajax/recordClick.php +++ b/apps/bookmarks/ajax/recordClick.php @@ -27,8 +27,8 @@ $RUNTIME_NOSETUPFS=true; // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('bookmarks'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('bookmarks'); $query = OC_DB::prepare(" UPDATE *PREFIX*bookmarks diff --git a/apps/bookmarks/ajax/updateList.php b/apps/bookmarks/ajax/updateList.php old mode 100644 new mode 100755 index 6aa951bbb65479186be32ddeb6136c70881fea99..c919a5fc4392d17f586edef3ab8d10c8abf41ad3 --- a/apps/bookmarks/ajax/updateList.php +++ b/apps/bookmarks/ajax/updateList.php @@ -28,8 +28,8 @@ $RUNTIME_NOSETUPFS=true; // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('bookmarks'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('bookmarks'); //Filter for tag? @@ -47,4 +47,4 @@ if($sort == 'bookmarks_sorting_clicks') { $bookmarks = OC_Bookmarks_Bookmarks::findBookmarks($offset, $sqlSortColumn, $filterTag, true); -OC_JSON::success(array('data' => $bookmarks)); +OCP\JSON::success(array('data' => $bookmarks)); diff --git a/apps/calendar/ajax/calendar/activation.php b/apps/calendar/ajax/calendar/activation.php old mode 100644 new mode 100755 index c93a0495717c1c4da9d7903d817a139dd25e070c..3523590aa27df0180aaec803f183385eb3fb7f01 --- a/apps/calendar/ajax/calendar/activation.php +++ b/apps/calendar/ajax/calendar/activation.php @@ -7,13 +7,13 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('calendar'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('calendar'); $calendarid = $_POST['calendarid']; $calendar = OC_Calendar_App::getCalendar($calendarid);//access check OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']); $calendar = OC_Calendar_App::getCalendar($calendarid); -OC_JSON::success(array( +OCP\JSON::success(array( 'active' => $calendar['active'], 'eventSource' => OC_Calendar_Calendar::getEventSourceInfo($calendar), )); diff --git a/apps/calendar/ajax/calendar/delete.php b/apps/calendar/ajax/calendar/delete.php old mode 100644 new mode 100755 index 4bef912333c5b83a305a5149b61fadde27a3480a..a36a05346500c436b64892fb19e3257451c6548b --- a/apps/calendar/ajax/calendar/delete.php +++ b/apps/calendar/ajax/calendar/delete.php @@ -7,15 +7,15 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('calendar'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('calendar'); $cal = $_POST["calendarid"]; $calendar = OC_Calendar_App::getCalendar($cal); $del = OC_Calendar_Calendar::deleteCalendar($cal); if($del == true){ - OC_JSON::success(); + OCP\JSON::success(); }else{ - OC_JSON::error(array('error'=>'dberror')); + OCP\JSON::error(array('error'=>'dberror')); } ?> diff --git a/apps/calendar/ajax/calendar/edit.form.php b/apps/calendar/ajax/calendar/edit.form.php old mode 100644 new mode 100755 index d3f9629f1aea9a824b4b28fa45c02b3dc2ba70d0..17118c5165f5987f64e28d2dc2fcfc1e3eedd838 --- a/apps/calendar/ajax/calendar/edit.form.php +++ b/apps/calendar/ajax/calendar/edit.form.php @@ -7,8 +7,8 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('calendar'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('calendar'); $calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions(); $calendar = OC_Calendar_App::getCalendar($_GET['calendarid']); diff --git a/apps/calendar/ajax/calendar/edit.php b/apps/calendar/ajax/calendar/edit.php old mode 100644 new mode 100755 index d3f9629f1aea9a824b4b28fa45c02b3dc2ba70d0..17118c5165f5987f64e28d2dc2fcfc1e3eedd838 --- a/apps/calendar/ajax/calendar/edit.php +++ b/apps/calendar/ajax/calendar/edit.php @@ -7,8 +7,8 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('calendar'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('calendar'); $calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions(); $calendar = OC_Calendar_App::getCalendar($_GET['calendarid']); diff --git a/apps/calendar/ajax/calendar/new.form.php b/apps/calendar/ajax/calendar/new.form.php old mode 100644 new mode 100755 index 3de56460c2d65007e59f75b1a9a3612151720158..fa30b871e42611a35aa581fcecfaf932449dc4b8 --- a/apps/calendar/ajax/calendar/new.form.php +++ b/apps/calendar/ajax/calendar/new.form.php @@ -7,8 +7,8 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('calendar'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('calendar'); $calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions(); $calendar = array( 'id' => 'new', diff --git a/apps/calendar/ajax/calendar/new.php b/apps/calendar/ajax/calendar/new.php index b7136981633ad8467e3ad94a6a7b5ab2dd17b384..4b8688e3d1d2dd792bd4db78e29e9c6c45ca6210 100755 --- a/apps/calendar/ajax/calendar/new.php +++ b/apps/calendar/ajax/calendar/new.php @@ -9,17 +9,17 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('calendar'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('calendar'); if(trim($_POST['name']) == ''){ - OC_JSON::error(array('message'=>'empty')); + OCP\JSON::error(array('message'=>'empty')); exit; } $calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser()); foreach($calendars as $cal){ if($cal['displayname'] == $_POST['name']){ - OC_JSON::error(array('message'=>'namenotavailable')); + OCP\JSON::error(array('message'=>'namenotavailable')); exit; } } @@ -31,7 +31,7 @@ OC_Calendar_Calendar::setCalendarActive($calendarid, 1); $calendar = OC_Calendar_Calendar::find($calendarid); $tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields'); $tmpl->assign('calendar', $calendar); -OC_JSON::success(array( +OCP\JSON::success(array( 'page' => $tmpl->fetchPage(), 'eventSource' => OC_Calendar_Calendar::getEventSourceInfo($calendar), )); diff --git a/apps/calendar/ajax/calendar/overview.php b/apps/calendar/ajax/calendar/overview.php old mode 100644 new mode 100755 index f66d1eae8f80df8243a81e4ba6e73a1f333152c5..586bf3db814681c34ae58f976ec798d0fdb5c9e5 --- a/apps/calendar/ajax/calendar/overview.php +++ b/apps/calendar/ajax/calendar/overview.php @@ -8,8 +8,8 @@ $l10n = OC_L10N::get('calendar'); -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('calendar'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('calendar'); $output = new OC_TEMPLATE("calendar", "part.choosecalendar"); $output -> printpage(); ?> diff --git a/apps/calendar/ajax/calendar/update.php b/apps/calendar/ajax/calendar/update.php index 1e35035fa48be7ed53b95a5233fb127656aa2612..408ac9009127e946f6514b0e2c75e4f6333b12ab 100755 --- a/apps/calendar/ajax/calendar/update.php +++ b/apps/calendar/ajax/calendar/update.php @@ -9,17 +9,17 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('calendar'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('calendar'); if(trim($_POST['name']) == ''){ - OC_JSON::error(array('message'=>'empty')); + OCP\JSON::error(array('message'=>'empty')); exit; } $calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser()); foreach($calendars as $cal){ if($cal['displayname'] == $_POST['name'] && $cal['id'] != $_POST['id']){ - OC_JSON::error(array('message'=>'namenotavailable')); + OCP\JSON::error(array('message'=>'namenotavailable')); exit; } } @@ -32,7 +32,7 @@ OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']); $calendar = OC_Calendar_App::getCalendar($calendarid); $tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields'); $tmpl->assign('calendar', $calendar); -OC_JSON::success(array( +OCP\JSON::success(array( 'page' => $tmpl->fetchPage(), 'eventSource' => OC_Calendar_Calendar::getEventSourceInfo($calendar), )); diff --git a/apps/calendar/ajax/categories/rescan.php b/apps/calendar/ajax/categories/rescan.php index a8e62f64a5b0061daba96cd801a0d7f8f67d035e..93e8c50954a2733fbc37ebc5347a0cf738367504 100755 --- a/apps/calendar/ajax/categories/rescan.php +++ b/apps/calendar/ajax/categories/rescan.php @@ -7,15 +7,15 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('calendar'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('calendar'); foreach ($_POST as $key=>$element) { debug('_POST: '.$key.'=>'.print_r($element, true)); } function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('calendar','ajax/categories/rescan.php: '.$msg, OCP\Util::DEBUG); exit(); } @@ -39,4 +39,4 @@ if(count($events) == 0) { OC_Calendar_App::scanCategories($events); $categories = OC_Calendar_App::getCategoryOptions(); -OC_JSON::success(array('data' => array('categories'=>$categories))); +OCP\JSON::success(array('data' => array('categories'=>$categories))); diff --git a/apps/calendar/ajax/changeview.php b/apps/calendar/ajax/changeview.php index a637e62aad1c0e9985c41451a4198de575680be2..2c2d09ccb1294b2e5445538e7b16b67acfcfc1fe 100755 --- a/apps/calendar/ajax/changeview.php +++ b/apps/calendar/ajax/changeview.php @@ -5,8 +5,8 @@ * later. * See the COPYING-README file. */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('calendar'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('calendar'); $view = $_GET['v']; switch($view){ case 'agendaWeek': @@ -14,9 +14,9 @@ switch($view){ case 'list': break; default: - OC_JSON::error(array('message'=>'unexspected parameter: ' . $view)); + OCP\JSON::error(array('message'=>'unexspected parameter: ' . $view)); exit; } OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'currentview', $view); -OC_JSON::success(); +OCP\JSON::success(); ?> diff --git a/apps/calendar/ajax/event/delete.php b/apps/calendar/ajax/event/delete.php old mode 100644 new mode 100755 index 3b726651641151008d24a2f0c8813c08a6455599..cb30621af4d4c2d3defb8c7564ef25b161125dd1 --- a/apps/calendar/ajax/event/delete.php +++ b/apps/calendar/ajax/event/delete.php @@ -7,14 +7,14 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('calendar'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('calendar'); $id = $_POST['id']; $access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT); if($access != 'owner' && $access != 'rw'){ - OC_JSON::error(array('message'=>'permission denied')); + OCP\JSON::error(array('message'=>'permission denied')); exit; } $result = OC_Calendar_Object::delete($id); -OC_JSON::success(); +OCP\JSON::success(); diff --git a/apps/calendar/ajax/event/edit.form.php b/apps/calendar/ajax/event/edit.form.php index 675a417eba83ac3ebf895372a0594928bd377c8b..91d07d3897a11f1b809a8aab8d8bad6879dfc79d 100755 --- a/apps/calendar/ajax/event/edit.form.php +++ b/apps/calendar/ajax/event/edit.form.php @@ -11,13 +11,13 @@ if(!OCP\User::isLoggedIn()) { die('<script type="text/javascript">document.location = oc_webroot;</script>'); } -OC_JSON::checkAppEnabled('calendar'); +OCP\JSON::checkAppEnabled('calendar'); $id = $_GET['id']; $data = OC_Calendar_App::getEventObject($id, true, true); if(!$data){ - OC_JSON::error(array('data' => array('message' => self::$l10n->t('Wrong calendar')))); + OCP\JSON::error(array('data' => array('message' => self::$l10n->t('Wrong calendar')))); exit; } $access = OC_Calendar_App::getaccess($id, OC_Calendar_Share::EVENT); diff --git a/apps/calendar/ajax/event/edit.php b/apps/calendar/ajax/event/edit.php old mode 100644 new mode 100755 index 172488f6241ed34e165b03c3bbb7959b7d19e824..e615fb093de018035cbf12b2c603c034a6de856c --- a/apps/calendar/ajax/event/edit.php +++ b/apps/calendar/ajax/event/edit.php @@ -7,8 +7,8 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('calendar'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('calendar'); $id = $_POST['id']; @@ -21,14 +21,14 @@ if(!array_key_exists('calendar', $_POST)){ $access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT); if($access != 'owner' && $access != 'rw'){ - OC_JSON::error(array('message'=>'permission denied')); + OCP\JSON::error(array('message'=>'permission denied')); exit; } $errarr = OC_Calendar_Object::validateRequest($_POST); if($errarr){ //show validate errors - OC_JSON::error($errarr); + OCP\JSON::error($errarr); exit; }else{ $data = OC_Calendar_App::getEventObject($id, false, false); @@ -41,6 +41,6 @@ if($errarr){ if ($data['calendarid'] != $cal) { OC_Calendar_Object::moveToCalendar($id, $cal); } - OC_JSON::success(); + OCP\JSON::success(); } ?> diff --git a/apps/calendar/ajax/event/move.php b/apps/calendar/ajax/event/move.php old mode 100644 new mode 100755 index 75d174c13e1df42fc45b318de6740733e4c5f50b..8added69143b6a85c1064e2f862f074f074c29b5 --- a/apps/calendar/ajax/event/move.php +++ b/apps/calendar/ajax/event/move.php @@ -6,12 +6,12 @@ * See the COPYING-README file. */ -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); $id = $_POST['id']; $access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT); if($access != 'owner' && $access != 'rw'){ - OC_JSON::error(array('message'=>'permission denied')); + OCP\JSON::error(array('message'=>'permission denied')); exit; } $vcalendar = OC_Calendar_App::getVCalendar($id, false, false); @@ -43,4 +43,4 @@ $vevent->setDateTime('DTSTAMP', 'now', Sabre_VObject_Property_DateTime::UTC); $result = OC_Calendar_Object::edit($id, $vcalendar->serialize()); $lastmodified = $vevent->__get('LAST-MODIFIED')->getDateTime(); -OC_JSON::success(array('lastmodified'=>(int)$lastmodified->format('U'))); +OCP\JSON::success(array('lastmodified'=>(int)$lastmodified->format('U'))); diff --git a/apps/calendar/ajax/event/new.form.php b/apps/calendar/ajax/event/new.form.php index 376149b57c305bde4c5221858c372b8ceb07a844..42cdb81642e298925013594a61d74384381fabf9 100755 --- a/apps/calendar/ajax/event/new.form.php +++ b/apps/calendar/ajax/event/new.form.php @@ -11,10 +11,10 @@ if(!OCP\User::isLoggedIn()) { die('<script type="text/javascript">document.location = oc_webroot;</script>'); } -OC_JSON::checkAppEnabled('calendar'); +OCP\JSON::checkAppEnabled('calendar'); if (!isset($_POST['start'])){ - OC_JSON::error(); + OCP\JSON::error(); die; } $start = $_POST['start']; diff --git a/apps/calendar/ajax/event/new.php b/apps/calendar/ajax/event/new.php old mode 100644 new mode 100755 index 5e8c305e97a408631994d1682d7ee1b7cd6fd758..72d57be03bfb204a7d8b912b25dea94467d01192 --- a/apps/calendar/ajax/event/new.php +++ b/apps/calendar/ajax/event/new.php @@ -8,18 +8,18 @@ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('calendar'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('calendar'); $errarr = OC_Calendar_Object::validateRequest($_POST); if($errarr){ //show validate errors - OC_JSON::error($errarr); + OCP\JSON::error($errarr); exit; }else{ $cal = $_POST['calendar']; $vcalendar = OC_Calendar_Object::createVCalendarFromRequest($_POST); $result = OC_Calendar_Object::add($cal, $vcalendar->serialize()); - OC_JSON::success(); + OCP\JSON::success(); } ?> diff --git a/apps/calendar/ajax/event/resize.php b/apps/calendar/ajax/event/resize.php old mode 100644 new mode 100755 index 260b69144268ccf0c6173588cea1a7cf2488d056..0dc0a5fca7f800d7aca138fedb55a814921d2473 --- a/apps/calendar/ajax/event/resize.php +++ b/apps/calendar/ajax/event/resize.php @@ -6,13 +6,13 @@ * See the COPYING-README file. */ -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); $id = $_POST['id']; $access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT); if($access != 'owner' && $access != 'rw'){ - OC_JSON::error(array('message'=>'permission denied')); + OCP\JSON::error(array('message'=>'permission denied')); exit; } @@ -35,4 +35,4 @@ $vevent->setDateTime('DTSTAMP', 'now', Sabre_VObject_Property_DateTime::UTC); OC_Calendar_Object::edit($id, $vcalendar->serialize()); $lastmodified = $vevent->__get('LAST-MODIFIED')->getDateTime(); -OC_JSON::success(array('lastmodified'=>(int)$lastmodified->format('U'))); +OCP\JSON::success(array('lastmodified'=>(int)$lastmodified->format('U'))); diff --git a/apps/calendar/ajax/events.php b/apps/calendar/ajax/events.php old mode 100644 new mode 100755 index 8adaa4c98f395a6e8f26a8f05db624818d582a1c..2499c5163a2ae38e0bc597c302a9c8f7646c2f53 --- a/apps/calendar/ajax/events.php +++ b/apps/calendar/ajax/events.php @@ -9,8 +9,8 @@ require_once('when/When.php'); -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('calendar'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('calendar'); $start = (version_compare(PHP_VERSION, '5.3.0', '>='))?DateTime::createFromFormat('U', $_GET['start']):new DateTime('@' . $_GET['start']); $end = (version_compare(PHP_VERSION, '5.3.0', '>='))?DateTime::createFromFormat('U', $_GET['end']):new DateTime('@' . $_GET['end']); @@ -21,5 +21,5 @@ $output = array(); foreach($events as $event){ $output[] = OC_Calendar_App::generateEventOutput($event, $start, $end); } -OC_JSON::encodedPrint($output); +OCP\JSON::encodedPrint($output); ?> diff --git a/apps/calendar/ajax/import/dialog.php b/apps/calendar/ajax/import/dialog.php index 9ee989c0dee23310791aebb4055904e2d77a1274..e686066a993a852b884366dba56c1823a8d0105f 100755 --- a/apps/calendar/ajax/import/dialog.php +++ b/apps/calendar/ajax/import/dialog.php @@ -7,7 +7,7 @@ */ -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); OCP\App::checkAppEnabled('calendar'); $tmpl = new OC_Template('calendar', 'part.import'); $tmpl->assign('path', $_POST['path']); diff --git a/apps/calendar/ajax/import/import.php b/apps/calendar/ajax/import/import.php index 43dfb5493fcd0f4605c3e021ae15c56c93bd47e1..202af1eb46e02e3026eb8b929876ebf1d75a9cc5 100755 --- a/apps/calendar/ajax/import/import.php +++ b/apps/calendar/ajax/import/import.php @@ -7,7 +7,7 @@ */ //check for calendar rights or create new one ob_start(); -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); OCP\App::checkAppEnabled('calendar'); $nl="\r\n"; $comps = array('VEVENT'=>true, 'VTODO'=>true, 'VJOURNAL'=>true); @@ -24,7 +24,7 @@ if($_POST['method'] == 'new'){ }else{ $calendar = OC_Calendar_App::getCalendar($_POST['id']); if($calendar['userid'] != OCP\USER::getUser()){ - OC_JSON::error(); + OCP\JSON::error(); exit(); } $id = $_POST['id']; @@ -126,4 +126,4 @@ sleep(3); if(is_writable('import_tmp/')){ unlink($progressfile); } -OC_JSON::success(); +OCP\JSON::success(); diff --git a/apps/calendar/ajax/settings/getfirstday.php b/apps/calendar/ajax/settings/getfirstday.php index dfc8b304b690f6b3d7154ac0c45671f0bf8433ad..23b71bba043b3b150fdd4acfb6eed31247aa7b46 100755 --- a/apps/calendar/ajax/settings/getfirstday.php +++ b/apps/calendar/ajax/settings/getfirstday.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); $firstday = OCP\Config::getUserValue( OCP\USER::getUser(), 'calendar', 'firstday', 'mo'); -OC_JSON::encodedPrint(array('firstday' => $firstday)); +OCP\JSON::encodedPrint(array('firstday' => $firstday)); ?> diff --git a/apps/calendar/ajax/settings/gettimezonedetection.php b/apps/calendar/ajax/settings/gettimezonedetection.php index be01807bbb44da2967ccdaed77e88223acd32d2d..6bc9a07a1e97a5f6cd3aa66ef1384e0c3aaf492d 100755 --- a/apps/calendar/ajax/settings/gettimezonedetection.php +++ b/apps/calendar/ajax/settings/gettimezonedetection.php @@ -6,6 +6,6 @@ * See the COPYING-README file. */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('calendar'); -OC_JSON::success(array('detection' => OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection'))); \ No newline at end of file +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('calendar'); +OCP\JSON::success(array('detection' => OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection'))); \ No newline at end of file diff --git a/apps/calendar/ajax/settings/guesstimezone.php b/apps/calendar/ajax/settings/guesstimezone.php index 19aa778472d182d8a6fb13190a0f5794760cf954..13092777b78bdf54c9dc92850dfbb4a4b6dd7b2a 100755 --- a/apps/calendar/ajax/settings/guesstimezone.php +++ b/apps/calendar/ajax/settings/guesstimezone.php @@ -7,8 +7,8 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('calendar'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('calendar'); $l = OC_L10N::get('calendar'); @@ -18,10 +18,10 @@ $lng = $_GET['long']; $timezone = OC_Geo::timezone($lat, $lng); if($timezone == OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezone')){ - OC_JSON::success(); + OCP\JSON::success(); exit; } OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timezone', $timezone); $message = array('message'=> $l->t('New Timezone:') . $timezone); -OC_JSON::success($message); +OCP\JSON::success($message); ?> \ No newline at end of file diff --git a/apps/calendar/ajax/settings/setfirstday.php b/apps/calendar/ajax/settings/setfirstday.php index 0c6ab695365cac42c1b36e7c6cd29cafc58f41ca..373eeee796838ad8f1cebba4de35461d67dd737d 100755 --- a/apps/calendar/ajax/settings/setfirstday.php +++ b/apps/calendar/ajax/settings/setfirstday.php @@ -6,12 +6,12 @@ * See the COPYING-README file. */ -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); if(isset($_POST["firstday"])){ OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'firstday', $_POST["firstday"]); - OC_JSON::success(); + OCP\JSON::success(); }else{ - OC_JSON::error(); + OCP\JSON::error(); } ?> diff --git a/apps/calendar/ajax/settings/settimeformat.php b/apps/calendar/ajax/settings/settimeformat.php index d648545d9ca08d38bff5af923c8165f2875956a3..eae7be54e80ed2740b3b044f26bb866061fbd27e 100755 --- a/apps/calendar/ajax/settings/settimeformat.php +++ b/apps/calendar/ajax/settings/settimeformat.php @@ -6,12 +6,12 @@ * See the COPYING-README file. */ -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); if(isset($_POST["timeformat"])){ OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', $_POST["timeformat"]); - OC_JSON::success(); + OCP\JSON::success(); }else{ - OC_JSON::error(); + OCP\JSON::error(); } ?> diff --git a/apps/calendar/ajax/settings/settimezone.php b/apps/calendar/ajax/settings/settimezone.php index abe14bd0ec7d411ec4428c820dbc2a809335ada8..d2797a08aae6525769183050982926dcfec939f3 100755 --- a/apps/calendar/ajax/settings/settimezone.php +++ b/apps/calendar/ajax/settings/settimezone.php @@ -12,16 +12,16 @@ $l=OC_L10N::get('calendar'); // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('calendar'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('calendar'); // Get data if( isset( $_POST['timezone'] ) ){ $timezone=$_POST['timezone']; OCP\Config::setUserValue( OCP\USER::getUser(), 'calendar', 'timezone', $timezone ); - OC_JSON::success(array('data' => array( 'message' => $l->t('Timezone changed') ))); + OCP\JSON::success(array('data' => array( 'message' => $l->t('Timezone changed') ))); }else{ - OC_JSON::error(array('data' => array( 'message' => $l->t('Invalid request') ))); + OCP\JSON::error(array('data' => array( 'message' => $l->t('Invalid request') ))); } ?> diff --git a/apps/calendar/ajax/settings/timeformat.php b/apps/calendar/ajax/settings/timeformat.php index dbcfcb29b42968c69836fb679b5640fc06d83962..809164e870a50b5788fd9bbbf4a2c02eece349f2 100755 --- a/apps/calendar/ajax/settings/timeformat.php +++ b/apps/calendar/ajax/settings/timeformat.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); $timeformat = OCP\Config::getUserValue( OCP\USER::getUser(), 'calendar', 'timeformat', "24"); -OC_JSON::encodedPrint(array("timeformat" => $timeformat)); +OCP\JSON::encodedPrint(array("timeformat" => $timeformat)); ?> diff --git a/apps/calendar/ajax/settings/timezonedetection.php b/apps/calendar/ajax/settings/timezonedetection.php index 8cb375183bba17bdf74a6e0f6abff2c86454382a..ba5f2af5fd98d1aabb52c1f8934103c88dd7f09a 100755 --- a/apps/calendar/ajax/settings/timezonedetection.php +++ b/apps/calendar/ajax/settings/timezonedetection.php @@ -6,15 +6,15 @@ * See the COPYING-README file. */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('calendar'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('calendar'); if(array_key_exists('timezonedetection', $_POST)){ if($_POST['timezonedetection'] == 'on'){ OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection', 'true'); }else{ OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection', 'false'); } - OC_JSON::success(); + OCP\JSON::success(); }else{ - OC_JSON::error(); + OCP\JSON::error(); } \ No newline at end of file diff --git a/apps/calendar/ajax/share/activation.php b/apps/calendar/ajax/share/activation.php index 5c2fe8efd13f3595b363845e393dc045ce4eb850..5526e5230f49ff487b58b8275ce37ec4a31b4628 100755 --- a/apps/calendar/ajax/share/activation.php +++ b/apps/calendar/ajax/share/activation.php @@ -9,4 +9,4 @@ require_once('../../../../lib/base.php'); $id = strip_tags($_GET['id']); $activation = strip_tags($_GET['activation']); OC_Calendar_Share::set_active(OCP\USER::getUser(), $id, $activation); -OC_JSON::success(); \ No newline at end of file +OCP\JSON::success(); \ No newline at end of file diff --git a/apps/calendar/ajax/share/changepermission.php b/apps/calendar/ajax/share/changepermission.php index 431ef7964b6925b86f567873bee349327ff7ceb1..e4a4f186ab06548457eecb15467e7fd6802b1959 100755 --- a/apps/calendar/ajax/share/changepermission.php +++ b/apps/calendar/ajax/share/changepermission.php @@ -14,7 +14,7 @@ switch($idtype){ case 'event': break; default: - OC_JSON::error(array('message'=>'unexspected parameter')); + OCP\JSON::error(array('message'=>'unexspected parameter')); exit; } $sharewith = $_GET['sharewith']; @@ -25,16 +25,16 @@ switch($sharetype){ case 'public': break; default: - OC_JSON::error(array('message'=>'unexspected parameter')); + OCP\JSON::error(array('message'=>'unexspected parameter')); exit; } if($sharetype == 'user' && !OCP\User::userExists($sharewith)){ - OC_JSON::error(array('message'=>'user not found')); + OCP\JSON::error(array('message'=>'user not found')); exit; } if($sharetype == 'group' && !OC_Group::groupExists($sharewith)){ - OC_JSON::error(array('message'=>'group not found')); + OCP\JSON::error(array('message'=>'group not found')); exit; } $success = OC_Calendar_Share::changepermission($sharewith, $sharetype, $id, $permission, (($idtype=='calendar') ? OC_Calendar_Share::CALENDAR : OC_Calendar_Share::EVENT)); -OC_JSON::success(); \ No newline at end of file +OCP\JSON::success(); \ No newline at end of file diff --git a/apps/calendar/ajax/share/dropdown.php b/apps/calendar/ajax/share/dropdown.php index 988e18c0b0315b6b660d55171a98e1580dfe3666..bac487f0d0bf6c267d4cad9e11276476feb8a7d3 100755 --- a/apps/calendar/ajax/share/dropdown.php +++ b/apps/calendar/ajax/share/dropdown.php @@ -10,7 +10,7 @@ $user = OCP\USER::getUser(); $calid = $_GET['calid']; $calendar = OC_Calendar_Calendar::find($calid); if($calendar['userid'] != $user){ - OC_JSON::error(); + OCP\JSON::error(); exit; } $tmpl = new OC_Template('calendar', 'share.dropdown'); diff --git a/apps/calendar/ajax/share/share.php b/apps/calendar/ajax/share/share.php index 39d97522338bfef7bb55d1da01d8b22dc2c42b5e..3ce2bf1e21756a142d5e07c6bcb9b795577a2cdf 100755 --- a/apps/calendar/ajax/share/share.php +++ b/apps/calendar/ajax/share/share.php @@ -13,15 +13,15 @@ switch($idtype){ case 'event': break; default: - OC_JSON::error(array('message'=>'unexspected parameter')); + OCP\JSON::error(array('message'=>'unexspected parameter')); exit; } if($idtype == 'calendar' && !OC_Calendar_App::getCalendar($id)){ - OC_JSON::error(array('message'=>'permission denied')); + OCP\JSON::error(array('message'=>'permission denied')); exit; } if($idtype == 'event' && !OC_Calendar_App::getEventObject($id)){ - OC_JSON::error(array('message'=>'permission denied')); + OCP\JSON::error(array('message'=>'permission denied')); exit; } $sharewith = $_GET['sharewith']; @@ -32,28 +32,28 @@ switch($sharetype){ case 'public': break; default: - OC_JSON::error(array('message'=>'unexspected parameter')); + OCP\JSON::error(array('message'=>'unexspected parameter')); exit; } if($sharetype == 'user' && !OCP\User::userExists($sharewith)){ - OC_JSON::error(array('message'=>'user not found')); + OCP\JSON::error(array('message'=>'user not found')); exit; } if($sharetype == 'group' && !OC_Group::groupExists($sharewith)){ - OC_JSON::error(array('message'=>'group not found')); + OCP\JSON::error(array('message'=>'group not found')); exit; } if($sharetype == 'user' && OCP\USER::getUser() == $sharewith){ - OC_JSON::error(array('meesage'=>'you can not share with yourself')); + OCP\JSON::error(array('meesage'=>'you can not share with yourself')); } $success = OC_Calendar_Share::share(OCP\USER::getUser(), $sharewith, $sharetype, $id, (($idtype=='calendar') ? OC_Calendar_Share::CALENDAR : OC_Calendar_Share::EVENT)); if($success){ if($sharetype == 'public'){ - OC_JSON::success(array('message'=>$success)); + OCP\JSON::success(array('message'=>$success)); }else{ - OC_JSON::success(array('message'=>'shared')); + OCP\JSON::success(array('message'=>'shared')); } }else{ - OC_JSON::error(array('message'=>'can not share')); + OCP\JSON::error(array('message'=>'can not share')); exit; } \ No newline at end of file diff --git a/apps/calendar/ajax/share/unshare.php b/apps/calendar/ajax/share/unshare.php index e5676c72f311943905a873e761ef4251178c21d3..cbd5ed8e505bbe8c511e919578316be2c8a2c49d 100755 --- a/apps/calendar/ajax/share/unshare.php +++ b/apps/calendar/ajax/share/unshare.php @@ -13,7 +13,7 @@ switch($idtype){ case 'event': break; default: - OC_JSON::error(array('message'=>'unexspected parameter')); + OCP\JSON::error(array('message'=>'unexspected parameter')); exit; } $sharewith = $_GET['sharewith']; @@ -24,20 +24,20 @@ switch($sharetype){ case 'public': break; default: - OC_JSON::error(array('message'=>'unexspected parameter')); + OCP\JSON::error(array('message'=>'unexspected parameter')); exit; } if($sharetype == 'user' && !OCP\User::userExists($sharewith)){ - OC_JSON::error(array('message'=>'user not found')); + OCP\JSON::error(array('message'=>'user not found')); exit; }elseif($sharetype == 'group' && !OC_Group::groupExists($sharewith)){ - OC_JSON::error(array('message'=>'group not found')); + OCP\JSON::error(array('message'=>'group not found')); exit; } $success = OC_Calendar_Share::unshare(OCP\USER::getUser(), $sharewith, $sharetype, $id, (($idtype=='calendar') ? OC_Calendar_Share::CALENDAR : OC_Calendar_Share::EVENT)); if($success){ - OC_JSON::success(); + OCP\JSON::success(); }else{ - OC_JSON::error(array('message'=>'can not unshare')); + OCP\JSON::error(array('message'=>'can not unshare')); exit; } \ No newline at end of file diff --git a/apps/calendar/lib/app.php b/apps/calendar/lib/app.php index 8e2679a43f4504252327687a3da5cbd399f53ab8..e8fdbe8c78a59c1ca4ac891d0143bf14133c89e0 100755 --- a/apps/calendar/lib/app.php +++ b/apps/calendar/lib/app.php @@ -106,7 +106,7 @@ class OC_Calendar_App{ public static function isNotModified($vevent, $lastmodified){ $last_modified = $vevent->__get('LAST-MODIFIED'); if($last_modified && $lastmodified != $last_modified->getDateTime()->format('U')){ - OC_JSON::error(array('modified'=>true)); + OCP\JSON::error(array('modified'=>true)); exit; } return true; diff --git a/apps/contacts/ajax/activation.php b/apps/contacts/ajax/activation.php index b45d1a6ccbe844a393c3703280f2f0630c2894ae..388a3b5438c6d35fc8e8148bddd37764f62a01df 100755 --- a/apps/contacts/ajax/activation.php +++ b/apps/contacts/ajax/activation.php @@ -8,19 +8,19 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $bookid = $_POST['bookid']; $book = OC_Contacts_App::getAddressbook($bookid);// is owner access check if(!OC_Contacts_Addressbook::setActive($bookid, $_POST['active'])) { OCP\Util::writeLog('contacts','ajax/activation.php: Error activating addressbook: '.$bookid, OCP\Util::ERROR); - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error (de)activating addressbook.')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error (de)activating addressbook.')))); exit(); } -OC_JSON::success(array( +OCP\JSON::success(array( 'active' => OC_Contacts_Addressbook::isActive($bookid), 'bookid' => $bookid, 'book' => $book, diff --git a/apps/contacts/ajax/addbook.php b/apps/contacts/ajax/addbook.php old mode 100644 new mode 100755 index f466d57e12e1da59e9f2d7c3f675e9a885512d40..254af1c3f50fef55158bc23b110672351bb696eb --- a/apps/contacts/ajax/addbook.php +++ b/apps/contacts/ajax/addbook.php @@ -7,8 +7,8 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $book = array( 'id' => 'new', 'displayname' => '', diff --git a/apps/contacts/ajax/addcontact.php b/apps/contacts/ajax/addcontact.php index d87cbabe819549f42eb197608de2bc67edcda4d6..dc083df1fa54563768256b34ee1f15cfe8284a86 100755 --- a/apps/contacts/ajax/addcontact.php +++ b/apps/contacts/ajax/addcontact.php @@ -23,7 +23,7 @@ // Init owncloud function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/addcontact.php: '.$msg, OCP\Util::DEBUG); exit(); } @@ -32,8 +32,8 @@ function debug($msg) { } // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); foreach ($_POST as $key=>$element) { debug('_POST: '.$key.'=>'.$element); @@ -55,9 +55,9 @@ $vcard->setString('N',$n); $id = OC_Contacts_VCard::add($aid,$vcard); if(!$id) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('There was an error adding the contact.')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('There was an error adding the contact.')))); OCP\Util::writeLog('contacts','ajax/addcontact.php: Recieved non-positive ID on adding card: '.$id, OCP\Util::ERROR); exit(); } -OC_JSON::success(array('data' => array( 'id' => $id ))); +OCP\JSON::success(array('data' => array( 'id' => $id ))); diff --git a/apps/contacts/ajax/addproperty.php b/apps/contacts/ajax/addproperty.php index 8623c6fdca77aa895753c063cef1978bd73abbb4..bf23df6758509d688f1c434dd5009212824adda2 100755 --- a/apps/contacts/ajax/addproperty.php +++ b/apps/contacts/ajax/addproperty.php @@ -24,8 +24,8 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $id = isset($_POST['id'])?$_POST['id']:null; $name = isset($_POST['name'])?$_POST['name']:null; @@ -37,7 +37,7 @@ $vcard = OC_Contacts_App::getContactVCard($id); if(!is_array($value)){ $value = trim($value); if(!$value && in_array($name, array('TEL', 'EMAIL', 'ORG', 'BDAY', 'NICKNAME', 'NOTE'))) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Cannot add empty property.')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Cannot add empty property.')))); exit(); } } elseif($name === 'ADR') { // only add if non-empty elements. @@ -49,7 +49,7 @@ if(!is_array($value)){ } } if($empty) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('At least one of the address fields has to be filled out.')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('At least one of the address fields has to be filled out.')))); exit(); } } @@ -59,7 +59,7 @@ $current = $vcard->select($name); foreach($current as $item) { $tmpvalue = (is_array($value)?implode(';', $value):$value); if($tmpvalue == $item->value) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Trying to add duplicate property: ').$name.': '.$tmpvalue))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Trying to add duplicate property: ').$name.': '.$tmpvalue))); OCP\Util::writeLog('contacts','ajax/addproperty.php: Trying to add duplicate property: '.$name.': '.$tmpvalue, OCP\Util::DEBUG); exit(); } @@ -117,9 +117,9 @@ foreach ($parameters as $key=>$element) { $checksum = md5($vcard->children[$line]->serialize()); if(!OC_Contacts_VCard::edit($id,$vcard)) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error adding contact property.')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error adding contact property.')))); OCP\Util::writeLog('contacts','ajax/addproperty.php: Error updating contact property: '.$name, OCP\Util::ERROR); exit(); } -OC_JSON::success(array('data' => array( 'checksum' => $checksum ))); +OCP\JSON::success(array('data' => array( 'checksum' => $checksum ))); diff --git a/apps/contacts/ajax/categories/categoriesfor.php b/apps/contacts/ajax/categories/categoriesfor.php index c6b753a73b5674cb46e16e7c79c1d61faab042b8..846af300de8008d2aa8cca1f5ff30e94000070e3 100755 --- a/apps/contacts/ajax/categories/categoriesfor.php +++ b/apps/contacts/ajax/categories/categoriesfor.php @@ -7,12 +7,12 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $id = isset($_GET['id'])?$_GET['id']:null; if(is_null($id)) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('No ID provided')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('No ID provided')))); exit(); } $vcard = OC_Contacts_App::getContactVCard( $id ); @@ -20,9 +20,9 @@ foreach($vcard->children as $property){ //OCP\Util::writeLog('contacts','ajax/categories/checksumfor.php: '.$property->name, OCP\Util::DEBUG); if($property->name == 'CATEGORIES') { $checksum = md5($property->serialize()); - OC_JSON::success(array('data' => array('value'=>$property->value, 'checksum'=>$checksum))); + OCP\JSON::success(array('data' => array('value'=>$property->value, 'checksum'=>$checksum))); exit(); } } -OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error setting checksum.')))); +OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error setting checksum.')))); ?> diff --git a/apps/contacts/ajax/categories/delete.php b/apps/contacts/ajax/categories/delete.php index d1099da044af493045dd4760f18c51bd3c5ffad3..bee2dbe3f6b7411d96fafd22e8b163e4ad8fd819 100755 --- a/apps/contacts/ajax/categories/delete.php +++ b/apps/contacts/ajax/categories/delete.php @@ -7,15 +7,15 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); foreach ($_POST as $key=>$element) { debug('_POST: '.$key.'=>'.print_r($element, true)); } function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/categories/delete.php: '.$msg, OCP\Util::DEBUG); exit(); } @@ -55,6 +55,6 @@ $catman = new OC_VCategories('contacts'); $catman->delete($categories, $cards); debug('After delete: '.print_r($catman->categories(), true)); OC_Contacts_VCard::updateDataByID($cards); -OC_JSON::success(array('data' => array('categories'=>$catman->categories()))); +OCP\JSON::success(array('data' => array('categories'=>$catman->categories()))); ?> diff --git a/apps/contacts/ajax/categories/list.php b/apps/contacts/ajax/categories/list.php old mode 100644 new mode 100755 index 98c1c7051808905ca56c3832141ad82a71040de2..3ae7635390c8be9277c53b4e42e05f4ce9273a58 --- a/apps/contacts/ajax/categories/list.php +++ b/apps/contacts/ajax/categories/list.php @@ -7,11 +7,11 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $categories = OC_Contacts_App::getCategories(); -OC_JSON::success(array('data' => array('categories'=>$categories))); +OCP\JSON::success(array('data' => array('categories'=>$categories))); ?> diff --git a/apps/contacts/ajax/categories/rescan.php b/apps/contacts/ajax/categories/rescan.php index 37a19fbce4a66f9ff3bbbcb19ab133d85a798888..84a67dec0b1832da19e4c2b83a59abe7719f2790 100755 --- a/apps/contacts/ajax/categories/rescan.php +++ b/apps/contacts/ajax/categories/rescan.php @@ -7,15 +7,15 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); foreach ($_POST as $key=>$element) { debug('_POST: '.$key.'=>'.print_r($element, true)); } function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/categories/rescan.php: '.$msg, OCP\Util::DEBUG); exit(); } @@ -39,6 +39,6 @@ if(count($contacts) == 0) { OC_Contacts_App::scanCategories($contacts); $categories = OC_Contacts_App::getCategories(); -OC_JSON::success(array('data' => array('categories'=>$categories))); +OCP\JSON::success(array('data' => array('categories'=>$categories))); ?> diff --git a/apps/contacts/ajax/chooseaddressbook.php b/apps/contacts/ajax/chooseaddressbook.php old mode 100644 new mode 100755 index b47c872e9aaab432b71b18922f5994d3b00e3706..2fe55606d1d8df714a6c618ea69dbd800e727d5b --- a/apps/contacts/ajax/chooseaddressbook.php +++ b/apps/contacts/ajax/chooseaddressbook.php @@ -7,8 +7,8 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $output = new OC_TEMPLATE("contacts", "part.chooseaddressbook"); $output -> printpage(); diff --git a/apps/contacts/ajax/contactdetails.php b/apps/contacts/ajax/contactdetails.php index aa6aca4562a1369dde22edd7f8e51d8572200bc7..0cbd55258de657434fa932eecf7738701e13514f 100755 --- a/apps/contacts/ajax/contactdetails.php +++ b/apps/contacts/ajax/contactdetails.php @@ -23,14 +23,14 @@ // Init owncloud function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/contactdetails.php: '.$msg, OCP\Util::DEBUG); exit(); } // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $id = isset($_GET['id'])?$_GET['id']:null; if(is_null($id)) { @@ -69,4 +69,4 @@ if(isset($details['PHOTO'])) { } $details['id'] = $id; OC_Contacts_App::setLastModifiedHeader($vcard); -OC_JSON::success(array('data' => $details)); +OCP\JSON::success(array('data' => $details)); diff --git a/apps/contacts/ajax/contacts.php b/apps/contacts/ajax/contacts.php index f0e7dde088cd70ae8821f8848f2a7b157b81ac88..93e618a08007cd1626522c9183310810fede50e1 100755 --- a/apps/contacts/ajax/contacts.php +++ b/apps/contacts/ajax/contacts.php @@ -7,8 +7,8 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $ids = OC_Contacts_Addressbook::activeIds(OCP\USER::getUser()); $contacts = OC_Contacts_VCard::all($ids); @@ -16,5 +16,5 @@ $tmpl = new OC_TEMPLATE("contacts", "part.contacts"); $tmpl->assign('contacts', $contacts); $page = $tmpl->fetchPage(); -OC_JSON::success(array('data' => array( 'page' => $page ))); +OCP\JSON::success(array('data' => array( 'page' => $page ))); ?> diff --git a/apps/contacts/ajax/createaddressbook.php b/apps/contacts/ajax/createaddressbook.php index 3a331131a150ba07baafd01014594cc7f868b617..772232b67d7382f9a6ca25c4d8b0316f5950acc6 100755 --- a/apps/contacts/ajax/createaddressbook.php +++ b/apps/contacts/ajax/createaddressbook.php @@ -9,32 +9,32 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $userid = OCP\USER::getUser(); $name = trim(strip_tags($_POST['name'])); if(!$name) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Cannot add addressbook with an empty name.')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Cannot add addressbook with an empty name.')))); OCP\Util::writeLog('contacts','ajax/createaddressbook.php: Cannot add addressbook with an empty name: '.strip_tags($_POST['name']), OCP\Util::ERROR); exit(); } $bookid = OC_Contacts_Addressbook::add($userid, $name, null); if(!$bookid) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error adding addressbook.')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error adding addressbook.')))); OCP\Util::writeLog('contacts','ajax/createaddressbook.php: Error adding addressbook: '.$_POST['name'], OCP\Util::ERROR); exit(); } if(!OC_Contacts_Addressbook::setActive($bookid, 1)) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error activating addressbook.')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error activating addressbook.')))); OCP\Util::writeLog('contacts','ajax/createaddressbook.php: Error activating addressbook: '.$bookid, OCP\Util::ERROR); //exit(); } $addressbook = OC_Contacts_App::getAddressbook($bookid); $tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields'); $tmpl->assign('addressbook', $addressbook); -OC_JSON::success(array( +OCP\JSON::success(array( 'page' => $tmpl->fetchPage(), 'addressbook' => $addressbook, )); diff --git a/apps/contacts/ajax/cropphoto.php b/apps/contacts/ajax/cropphoto.php index 09bdbbc439a5d4b1211590c09c65adc5300e8da9..125dd1076022643b752e79c4e97dd5d262305f38 100755 --- a/apps/contacts/ajax/cropphoto.php +++ b/apps/contacts/ajax/cropphoto.php @@ -24,8 +24,8 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $tmp_path = $_GET['tmp_path']; $id = $_GET['id']; @@ -35,4 +35,4 @@ $tmpl->assign('tmp_path', $tmp_path); $tmpl->assign('id', $id); $page = $tmpl->fetchPage(); -OC_JSON::success(array('data' => array( 'page' => $page ))); +OCP\JSON::success(array('data' => array( 'page' => $page ))); diff --git a/apps/contacts/ajax/currentphoto.php b/apps/contacts/ajax/currentphoto.php index 488f064836bebeb3bdccbe961fd8689961791aaf..d8afa060b1eaab4326e585feab450abd352320b3 100755 --- a/apps/contacts/ajax/currentphoto.php +++ b/apps/contacts/ajax/currentphoto.php @@ -24,11 +24,11 @@ // Check if we are a user // Firefox and Konqueror tries to download application/json for me. --Arthur -OC_JSON::setContentTypeHeader('text/plain'); -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::setContentTypeHeader('text/plain'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/currentphoto.php: '.$msg, OCP\Util::ERROR); exit(); } @@ -55,7 +55,7 @@ if( is_null($contact)) { } if($image->valid()) { if($image->save($tmpfname)) { - OC_JSON::success(array('data' => array('id'=>$_GET['id'], 'tmp'=>$tmpfname))); + OCP\JSON::success(array('data' => array('id'=>$_GET['id'], 'tmp'=>$tmpfname))); exit(); } else { bailOut(OC_Contacts_App::$l10n->t('Error saving temporary file.')); diff --git a/apps/contacts/ajax/deletebook.php b/apps/contacts/ajax/deletebook.php old mode 100644 new mode 100755 index b80df526f9525c5ad6fd9abd0b5c1af98e272259..bcf6aa4432967f78135fe16a033cc42be8000ace --- a/apps/contacts/ajax/deletebook.php +++ b/apps/contacts/ajax/deletebook.php @@ -24,12 +24,12 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); //$id = $_GET['id']; $id = $_POST['id']; OC_Contacts_App::getAddressbook( $id ); // is owner access check OC_Contacts_Addressbook::delete($id); -OC_JSON::success(array('data' => array( 'id' => $id ))); +OCP\JSON::success(array('data' => array( 'id' => $id ))); diff --git a/apps/contacts/ajax/deletecard.php b/apps/contacts/ajax/deletecard.php index 84526e9b13b260855090c7fb20322cc383801346..46fd8252d472d296267b00748e3a1d176b68152d 100755 --- a/apps/contacts/ajax/deletecard.php +++ b/apps/contacts/ajax/deletecard.php @@ -20,7 +20,7 @@ * */ function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/saveproperty.php: '.$msg, OCP\Util::DEBUG); exit(); } @@ -29,8 +29,8 @@ function bailOut($msg) { // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $id = isset($_GET['id'])?$_GET['id']:null; if(!$id) { @@ -39,4 +39,4 @@ if(!$id) { $card = OC_Contacts_App::getContactObject( $id ); OC_Contacts_VCard::delete($id); -OC_JSON::success(array('data' => array( 'id' => $id ))); +OCP\JSON::success(array('data' => array( 'id' => $id ))); diff --git a/apps/contacts/ajax/deleteproperty.php b/apps/contacts/ajax/deleteproperty.php index 4c7538162189c9865f740f470a616172e8a20aae..9bb1208cdd1bc574311d457bee4702f38cbfab1c 100755 --- a/apps/contacts/ajax/deleteproperty.php +++ b/apps/contacts/ajax/deleteproperty.php @@ -24,8 +24,8 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $id = $_GET['id']; $checksum = $_GET['checksum']; @@ -33,16 +33,16 @@ $checksum = $_GET['checksum']; $vcard = OC_Contacts_App::getContactVCard( $id ); $line = OC_Contacts_App::getPropertyLineByChecksum($vcard, $checksum); if(is_null($line)){ - OC_JSON::error(array('data' => array( 'message' => OC_Contacts_App::$l10n->t('Information about vCard is incorrect. Please reload the page.')))); + OCP\JSON::error(array('data' => array( 'message' => OC_Contacts_App::$l10n->t('Information about vCard is incorrect. Please reload the page.')))); exit(); } unset($vcard->children[$line]); if(!OC_Contacts_VCard::edit($id,$vcard)) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error deleting contact property.')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error deleting contact property.')))); OCP\Util::writeLog('contacts','ajax/deleteproperty.php: Error deleting contact property', OCP\Util::ERROR); exit(); } -OC_JSON::success(array('data' => array( 'id' => $id ))); +OCP\JSON::success(array('data' => array( 'id' => $id ))); diff --git a/apps/contacts/ajax/editaddress.php b/apps/contacts/ajax/editaddress.php old mode 100644 new mode 100755 index 73f34ef5c6c58b52f5136523ed0d25f8c819eb13..4044eb5a359ffb1e4a5b28bab729a3059ea13706 --- a/apps/contacts/ajax/editaddress.php +++ b/apps/contacts/ajax/editaddress.php @@ -7,8 +7,8 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $id = $_GET['id']; $checksum = isset($_GET['checksum'])?$_GET['checksum']:''; diff --git a/apps/contacts/ajax/editaddressbook.php b/apps/contacts/ajax/editaddressbook.php old mode 100644 new mode 100755 index ef797778d959fc5e7e8ae56517d81c8c84cc198d..fe1806a7b8a6be532cff50fa68b3867c042d2148 --- a/apps/contacts/ajax/editaddressbook.php +++ b/apps/contacts/ajax/editaddressbook.php @@ -7,8 +7,8 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $addressbook = OC_Contacts_App::getAddressbook($_GET['bookid']); $tmpl = new OC_Template("contacts", "part.editaddressbook"); $tmpl->assign('new', false); diff --git a/apps/contacts/ajax/editname.php b/apps/contacts/ajax/editname.php index 331aa4c7742602733592f471574f4c8be8f35bd5..155bee70a7f2e5aa0ef91cc5dc12fe6622acb2e4 100755 --- a/apps/contacts/ajax/editname.php +++ b/apps/contacts/ajax/editname.php @@ -7,10 +7,10 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/editname.php: '.$msg, OCP\Util::DEBUG); exit(); } diff --git a/apps/contacts/ajax/importaddressbook.php b/apps/contacts/ajax/importaddressbook.php index dc251de201ad742527db09d085f96afe5ee1d6d7..bc02e814f5b776c519e99b316f62ec7282211d60 100755 --- a/apps/contacts/ajax/importaddressbook.php +++ b/apps/contacts/ajax/importaddressbook.php @@ -7,7 +7,7 @@ */ require_once('../../../lib/base.php'); -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); OCP\App::checkAppEnabled('contacts'); $upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize')); $post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size')); diff --git a/apps/contacts/ajax/importdialog.php b/apps/contacts/ajax/importdialog.php index bd195023dd21a0830efe18d69adbe03dbf6bcb4f..7a564ccec8339e3ea3e70dcf8cf9b13a0c7689e5 100755 --- a/apps/contacts/ajax/importdialog.php +++ b/apps/contacts/ajax/importdialog.php @@ -7,7 +7,7 @@ */ -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); OCP\App::checkAppEnabled('contacts'); $tmpl = new OC_Template('contacts', 'part.import'); $tmpl->assign('path', $_POST['path']); diff --git a/apps/contacts/ajax/loadcard.php b/apps/contacts/ajax/loadcard.php index 90ba3f66097551bea48a0c9ccb15b80eb2db186e..047db4d940c7f26a0ac101dffb9c389a52f3c291 100755 --- a/apps/contacts/ajax/loadcard.php +++ b/apps/contacts/ajax/loadcard.php @@ -23,7 +23,7 @@ // Init owncloud function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/loadcard.php: '.$msg, OCP\Util::DEBUG); exit(); } @@ -35,8 +35,8 @@ function debug($msg) { // } // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize')); $post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size')); @@ -58,4 +58,4 @@ $tmpl->assign('email_types',$email_types); $tmpl->assign('id',''); $page = $tmpl->fetchPage(); -OC_JSON::success(array('data' => array( 'page' => $page ))); +OCP\JSON::success(array('data' => array( 'page' => $page ))); diff --git a/apps/contacts/ajax/loadintro.php b/apps/contacts/ajax/loadintro.php old mode 100644 new mode 100755 index 1aa03a62f3820b7cec2edb2726ea6e330c815368..8ad828ebba34ebbea7abc45241e95c5ff71f17a6 --- a/apps/contacts/ajax/loadintro.php +++ b/apps/contacts/ajax/loadintro.php @@ -21,11 +21,11 @@ */ // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $tmpl = new OC_Template('contacts','part.no_contacts'); $page = $tmpl->fetchPage(); -OC_JSON::success(array('data' => array( 'page' => $page ))); +OCP\JSON::success(array('data' => array( 'page' => $page ))); diff --git a/apps/contacts/ajax/loadphoto.php b/apps/contacts/ajax/loadphoto.php index 8d40669a5b33e1a58e66a0a0dcf1d60926f684e2..9913fe13e11fa8eeaa80d667e3731a271daf3658 100755 --- a/apps/contacts/ajax/loadphoto.php +++ b/apps/contacts/ajax/loadphoto.php @@ -22,15 +22,15 @@ // Init owncloud // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); // foreach ($_POST as $key=>$element) { // OCP\Util::writeLog('contacts','ajax/savecrop.php: '.$key.'=>'.$element, OCP\Util::DEBUG); // } function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/loadphoto.php: '.$msg, OCP\Util::DEBUG); exit(); } @@ -59,5 +59,5 @@ if($refresh) { $tmpl->assign('refresh', 1); } $page = $tmpl->fetchPage(); -OC_JSON::success(array('data' => array('page'=>$page, 'checksum'=>$checksum))); +OCP\JSON::success(array('data' => array('page'=>$page, 'checksum'=>$checksum))); ?> diff --git a/apps/contacts/ajax/oc_photo.php b/apps/contacts/ajax/oc_photo.php index 8c6b95c556307df18a3a49ea57527028c8758ab8..0fd978e325a420f81f00860c19629d1d1e7c5e72 100755 --- a/apps/contacts/ajax/oc_photo.php +++ b/apps/contacts/ajax/oc_photo.php @@ -24,11 +24,11 @@ require_once('lib/base.php'); // Check if we are a user // Firefox and Konqueror tries to download application/json for me. --Arthur -OC_JSON::setContentTypeHeader('text/plain'); -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::setContentTypeHeader('text/plain'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/oc_photo.php: '.$msg, OCP\Util::ERROR); exit(); } @@ -66,7 +66,7 @@ if(!$image->fixOrientation()) { // No fatal error so we don't bail out. debug('Couldn\'t save correct image orientation: '.$tmpfname); } if($image->save($tmpfname)) { - OC_JSON::success(array('data' => array('id'=>$_GET['id'], 'tmp'=>$tmpfname))); + OCP\JSON::success(array('data' => array('id'=>$_GET['id'], 'tmp'=>$tmpfname))); exit(); } else { bailOut('Couldn\'t save temporary image: '.$tmpfname); diff --git a/apps/contacts/ajax/savecrop.php b/apps/contacts/ajax/savecrop.php index 958f9fd926c913429b7cf161c10b4973c962ebce..5418e26cd1048311ea431a676f78ec8f7b003c5d 100755 --- a/apps/contacts/ajax/savecrop.php +++ b/apps/contacts/ajax/savecrop.php @@ -26,18 +26,18 @@ OCP\Util::writeLog('contacts','ajax/savecrop.php: Huzzah!!!', OCP\Util::DEBUG); // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); // foreach ($_POST as $key=>$element) { // OCP\Util::writeLog('contacts','ajax/savecrop.php: '.$key.'=>'.$element, OCP\Util::DEBUG); // } // Firefox and Konqueror tries to download application/json for me. --Arthur -OC_JSON::setContentTypeHeader('text/plain'); +OCP\JSON::setContentTypeHeader('text/plain'); function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/savecrop.php: '.$msg, OCP\Util::DEBUG); exit(); } @@ -109,7 +109,7 @@ if(file_exists($tmp_path)) { $tmpl->assign('width', $image->width()); $tmpl->assign('height', $image->height()); $page = $tmpl->fetchPage(); - OC_JSON::success(array('data' => array('page'=>$page, 'tmp'=>$tmpfname))); + OCP\JSON::success(array('data' => array('page'=>$page, 'tmp'=>$tmpfname))); exit(); } else { if(file_exists($tmpfname)) { diff --git a/apps/contacts/ajax/saveproperty.php b/apps/contacts/ajax/saveproperty.php index b8b4a422cf2b6703086976751a0c60aed58c996a..0cd6d5b36fb74a602aad90f7bdd0582099a8e29f 100755 --- a/apps/contacts/ajax/saveproperty.php +++ b/apps/contacts/ajax/saveproperty.php @@ -24,11 +24,11 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/saveproperty.php: '.$msg, OCP\Util::DEBUG); exit(); } @@ -154,4 +154,4 @@ if(!OC_Contacts_VCard::edit($id,$vcard)) { exit(); } -OC_JSON::success(array('data' => array( 'line' => $line, 'checksum' => $checksum, 'oldchecksum' => $_POST['checksum'] ))); +OCP\JSON::success(array('data' => array( 'line' => $line, 'checksum' => $checksum, 'oldchecksum' => $_POST['checksum'] ))); diff --git a/apps/contacts/ajax/updateaddressbook.php b/apps/contacts/ajax/updateaddressbook.php index b016cf929390629f9393c0348cf0b9182b5d2cbf..13f1c15ac2333fc144fed1ed06b31b07039863e1 100755 --- a/apps/contacts/ajax/updateaddressbook.php +++ b/apps/contacts/ajax/updateaddressbook.php @@ -9,27 +9,27 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); $bookid = $_POST['id']; OC_Contacts_App::getAddressbook($bookid); // is owner access check $name = trim(strip_tags($_POST['name'])); if(!$name) { - OC_JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Cannot update addressbook with an empty name.')))); + OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Cannot update addressbook with an empty name.')))); OCP\Util::writeLog('contacts','ajax/updateaddressbook.php: Cannot update addressbook with an empty name: '.strip_tags($_POST['name']), OCP\Util::ERROR); exit(); } if(!OC_Contacts_Addressbook::edit($bookid, $name, null)) { - OC_JSON::error(array('data' => array('message' => $l->t('Error updating addressbook.')))); + OCP\JSON::error(array('data' => array('message' => $l->t('Error updating addressbook.')))); OCP\Util::writeLog('contacts','ajax/updateaddressbook.php: Error adding addressbook: ', OCP\Util::ERROR); //exit(); } if(!OC_Contacts_Addressbook::setActive($bookid, $_POST['active'])) { - OC_JSON::error(array('data' => array('message' => $l->t('Error (de)activating addressbook.')))); + OCP\JSON::error(array('data' => array('message' => $l->t('Error (de)activating addressbook.')))); OCP\Util::writeLog('contacts','ajax/updateaddressbook.php: Error (de)activating addressbook: '.$bookid, OCP\Util::ERROR); //exit(); } @@ -37,7 +37,7 @@ if(!OC_Contacts_Addressbook::setActive($bookid, $_POST['active'])) { $addressbook = OC_Contacts_App::getAddressbook($bookid); $tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields'); $tmpl->assign('addressbook', $addressbook); -OC_JSON::success(array( +OCP\JSON::success(array( 'page' => $tmpl->fetchPage(), 'addressbook' => $addressbook, )); diff --git a/apps/contacts/ajax/uploadimport.php b/apps/contacts/ajax/uploadimport.php index 51ae949b68073a81de72a76232d7f517fc850ca0..947d4670a29d233d1cbab2b31f872557b97bb15d 100755 --- a/apps/contacts/ajax/uploadimport.php +++ b/apps/contacts/ajax/uploadimport.php @@ -23,10 +23,10 @@ require_once('../../../lib/base.php'); // Check if we are a user -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/uploadimport.php: '.$msg, OCP\Util::ERROR); exit(); } @@ -42,7 +42,7 @@ $fn = (isset($_SERVER['HTTP_X_FILE_NAME']) ? $_SERVER['HTTP_X_FILE_NAME'] : fals if($fn) { if($view->file_put_contents('/'.$tmpfile, file_get_contents('php://input'))) { debug($fn.' uploaded'); - OC_JSON::success(array('data' => array('path'=>'', 'file'=>$tmpfile))); + OCP\JSON::success(array('data' => array('path'=>'', 'file'=>$tmpfile))); exit(); } else { bailOut(OC_Contacts_App::$l10n->t('Error uploading contacts to storage.')); @@ -52,7 +52,7 @@ if($fn) { // File input transfers are handled here if (!isset($_FILES['importfile'])) { OCP\Util::writeLog('contacts','ajax/uploadphoto.php: No file was uploaded. Unknown error.', OCP\Util::DEBUG); - OC_JSON::error(array('data' => array( 'message' => 'No file was uploaded. Unknown error' ))); + OCP\JSON::error(array('data' => array( 'message' => 'No file was uploaded. Unknown error' ))); exit(); } $error = $_FILES['importfile']['error']; @@ -73,7 +73,7 @@ $tmpfname = tempnam("/tmp", "occOrig"); if(file_exists($file['tmp_name'])) { if($view->file_put_contents('/'.$tmpfile, file_get_contents($file['tmp_name']))) { debug($fn.' uploaded'); - OC_JSON::success(array('data' => array('path'=>'', 'file'=>$tmpfile))); + OCP\JSON::success(array('data' => array('path'=>'', 'file'=>$tmpfile))); } else { bailOut(OC_Contacts_App::$l10n->t('Error uploading contacts to storage.')); } diff --git a/apps/contacts/ajax/uploadphoto.php b/apps/contacts/ajax/uploadphoto.php index 1148c271dcdd7c5be7e9f2b2e245b7f7d46526af..99015e2d50241f46f5761008d5b4df4375805984 100755 --- a/apps/contacts/ajax/uploadphoto.php +++ b/apps/contacts/ajax/uploadphoto.php @@ -24,11 +24,11 @@ // Check if we are a user // Firefox and Konqueror tries to download application/json for me. --Arthur -OC_JSON::setContentTypeHeader('text/plain'); -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('contacts'); +OCP\JSON::setContentTypeHeader('text/plain'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); function bailOut($msg) { - OC_JSON::error(array('data' => array('message' => $msg))); + OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/uploadphoto.php: '.$msg, OCP\Util::DEBUG); exit(); } @@ -42,7 +42,7 @@ if ($fn) { // AJAX call if (!isset($_GET['id'])) { OCP\Util::writeLog('contacts','ajax/uploadphoto.php: No contact ID was submitted.', OCP\Util::DEBUG); - OC_JSON::error(array('data' => array( 'message' => 'No contact ID was submitted.' ))); + OCP\JSON::error(array('data' => array( 'message' => 'No contact ID was submitted.' ))); exit(); } $id = $_GET['id']; @@ -58,7 +58,7 @@ if ($fn) { debug('Couldn\'t save correct image orientation: '.$tmpfname); } if($image->save($tmpfname)) { - OC_JSON::success(array('data' => array('mime'=>$_SERVER['CONTENT_TYPE'], 'name'=>$fn, 'id'=>$id, 'tmp'=>$tmpfname))); + OCP\JSON::success(array('data' => array('mime'=>$_SERVER['CONTENT_TYPE'], 'name'=>$fn, 'id'=>$id, 'tmp'=>$tmpfname))); exit(); } else { bailOut('Couldn\'t save temporary image: '.$tmpfname); @@ -71,12 +71,12 @@ if ($fn) { if (!isset($_POST['id'])) { OCP\Util::writeLog('contacts','ajax/uploadphoto.php: No contact ID was submitted.', OCP\Util::DEBUG); - OC_JSON::error(array('data' => array( 'message' => 'No contact ID was submitted.' ))); + OCP\JSON::error(array('data' => array( 'message' => 'No contact ID was submitted.' ))); exit(); } if (!isset($_FILES['imagefile'])) { OCP\Util::writeLog('contacts','ajax/uploadphoto.php: No file was uploaded. Unknown error.', OCP\Util::DEBUG); - OC_JSON::error(array('data' => array( 'message' => 'No file was uploaded. Unknown error' ))); + OCP\JSON::error(array('data' => array( 'message' => 'No file was uploaded. Unknown error' ))); exit(); } $error = $_FILES['imagefile']['error']; @@ -104,7 +104,7 @@ if(file_exists($file['tmp_name'])) { debug('Couldn\'t save correct image orientation: '.$tmpfname); } if($image->save($tmpfname)) { - OC_JSON::success(array('data' => array('mime'=>$file['type'],'size'=>$file['size'],'name'=>$file['name'], 'id'=>$_POST['id'], 'tmp'=>$tmpfname))); + OCP\JSON::success(array('data' => array('mime'=>$file['type'],'size'=>$file['size'],'name'=>$file['name'], 'id'=>$_POST['id'], 'tmp'=>$tmpfname))); exit(); } else { bailOut('Couldn\'t save temporary image: '.$tmpfname); diff --git a/apps/contacts/import.php b/apps/contacts/import.php index 2bcb40f7d42db71a237a4df8bbd02b31c35754d1..346db5924c693ed09ad2b4bb93a1a6081a473a08 100755 --- a/apps/contacts/import.php +++ b/apps/contacts/import.php @@ -8,7 +8,7 @@ //check for addressbooks rights or create new one ob_start(); -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); OCP\App::checkAppEnabled('contacts'); $nl = "\n"; $progressfile = 'import_tmp/' . md5(session_id()) . '.txt'; @@ -25,7 +25,7 @@ if(isset($_POST['fstype']) && $_POST['fstype'] == 'OC_FilesystemView') { $file = OC_Filesystem::file_get_contents($_POST['path'] . '/' . $_POST['file']); } if(!$file) { - OC_JSON::error(array('message' => 'Import file was empty.')); + OCP\JSON::error(array('message' => 'Import file was empty.')); exit(); } error_log('File: '.$file); @@ -137,4 +137,4 @@ if(isset($_POST['fstype']) && $_POST['fstype'] == 'OC_FilesystemView') { OCP\Util::writeLog('contacts','Import: Error unlinking OC_FilesystemView ' . '/' . $_POST['file'], OCP\Util::ERROR); } } -OC_JSON::success(array('data' => array('imported'=>$imported, 'failed'=>$failed))); +OCP\JSON::success(array('data' => array('imported'=>$imported, 'failed'=>$failed))); diff --git a/apps/contacts/lib/app.php b/apps/contacts/lib/app.php index f4b9562605e268fa0b2346f79905b841d2f28db9..58cc7f034620353b6650d1af9888f656fe25d704 100755 --- a/apps/contacts/lib/app.php +++ b/apps/contacts/lib/app.php @@ -20,11 +20,11 @@ class OC_Contacts_App { if( $addressbook === false || $addressbook['userid'] != OCP\USER::getUser()) { if ($addressbook === false) { OCP\Util::writeLog('contacts', 'Addressbook not found: '. $id, OCP\Util::ERROR); - OC_JSON::error(array('data' => array( 'message' => self::$l10n->t('Addressbook not found.')))); + OCP\JSON::error(array('data' => array( 'message' => self::$l10n->t('Addressbook not found.')))); } else { OCP\Util::writeLog('contacts', 'Addressbook('.$id.') is not from '.OCP\USER::getUser(), OCP\Util::ERROR); - OC_JSON::error(array('data' => array( 'message' => self::$l10n->t('This is not your addressbook.')))); + OCP\JSON::error(array('data' => array( 'message' => self::$l10n->t('This is not your addressbook.')))); } exit(); } @@ -35,7 +35,7 @@ class OC_Contacts_App { $card = OC_Contacts_VCard::find( $id ); if( $card === false ) { OCP\Util::writeLog('contacts', 'Contact could not be found: '.$id, OCP\Util::ERROR); - OC_JSON::error(array('data' => array( 'message' => self::$l10n->t('Contact could not be found.').' '.$id))); + OCP\JSON::error(array('data' => array( 'message' => self::$l10n->t('Contact could not be found.').' '.$id))); exit(); } diff --git a/apps/contacts/thumbnail.php b/apps/contacts/thumbnail.php index d7bf1fd8c3c2d72d043e0893a21bc8d517a59e60..11d1db03108bfc2ed4d8efd3f476794ba2735fe2 100755 --- a/apps/contacts/thumbnail.php +++ b/apps/contacts/thumbnail.php @@ -22,7 +22,7 @@ // Init owncloud -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); //OCP\User::checkLoggedIn(); OCP\App::checkAppEnabled('contacts'); diff --git a/apps/files/ajax/autocomplete.php b/apps/files/ajax/autocomplete.php old mode 100644 new mode 100755 index 8cdb6188a022f6d2dee9867d0386b0ae93893652..7ff34da96b3a9421b60fbdf1ba204bf450afc84c --- a/apps/files/ajax/autocomplete.php +++ b/apps/files/ajax/autocomplete.php @@ -5,7 +5,7 @@ // Init owncloud -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); // Get data $query = $_GET['term']; @@ -51,6 +51,6 @@ if(OC_Filesystem::file_exists($base) and OC_Filesystem::is_dir($base)){ } } } -OC_JSON::encodedPrint($files); +OCP\JSON::encodedPrint($files); ?> diff --git a/apps/files/ajax/delete.php b/apps/files/ajax/delete.php old mode 100644 new mode 100755 index d8a01d7acf1c3731b30f88a559bb31745d52aa56..ed155de0dc76cf5e13e17701767ffd2615a393e0 --- a/apps/files/ajax/delete.php +++ b/apps/files/ajax/delete.php @@ -3,7 +3,7 @@ // Init owncloud -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); // Get data $dir = stripslashes($_GET["dir"]); @@ -21,9 +21,9 @@ foreach($files as $file) { } if($success) { - OC_JSON::success(array("data" => array( "dir" => $dir, "files" => $files ))); + OCP\JSON::success(array("data" => array( "dir" => $dir, "files" => $files ))); } else { - OC_JSON::error(array("data" => array( "message" => "Could not delete:\n" . $filesWithError ))); + OCP\JSON::error(array("data" => array( "message" => "Could not delete:\n" . $filesWithError ))); } ?> diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php index 0bff5742ef46a925a5e5cff5c070c6deec46d5a8..520e54e708d9869e0966a2ab3feda971ac89ecb1 100755 --- a/apps/files/ajax/list.php +++ b/apps/files/ajax/list.php @@ -6,7 +6,7 @@ $RUNTIME_APPTYPES=array('filesystem'); // Init owncloud -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); // Load the files $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : ''; @@ -41,6 +41,6 @@ $list = new OC_Template( "files", "part.list", "" ); $list->assign( "files", $files ); $data = array('files' => $list->fetchPage()); -OC_JSON::success(array('data' => $data)); +OCP\JSON::success(array('data' => $data)); ?> diff --git a/apps/files/ajax/move.php b/apps/files/ajax/move.php old mode 100644 new mode 100755 index 0ad314f873c26b20606bdadd26461b0a9a74d17d..945fe4e7b82a55ad4080bc801e195328a68408b3 --- a/apps/files/ajax/move.php +++ b/apps/files/ajax/move.php @@ -3,7 +3,7 @@ // Init owncloud -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); // Get data $dir = stripslashes($_GET["dir"]); @@ -12,9 +12,9 @@ $target = stripslashes($_GET["target"]); if(OC_Files::move($dir,$file,$target,$file)){ - OC_JSON::success(array("data" => array( "dir" => $dir, "files" => $file ))); + OCP\JSON::success(array("data" => array( "dir" => $dir, "files" => $file ))); }else{ - OC_JSON::error(array("data" => array( "message" => "Could not move $file" ))); + OCP\JSON::error(array("data" => array( "message" => "Could not move $file" ))); } ?> diff --git a/apps/files/ajax/newfile.php b/apps/files/ajax/newfile.php old mode 100644 new mode 100755 index 472b577a32a23254e2c95454c78db850cc3fe419..2712b54f063378f081dd6ec183f92f63628cf552 --- a/apps/files/ajax/newfile.php +++ b/apps/files/ajax/newfile.php @@ -3,7 +3,7 @@ // Init owncloud -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); // Get the params $dir = isset( $_POST['dir'] ) ? stripslashes($_POST['dir']) : ''; @@ -12,13 +12,13 @@ $content = isset( $_POST['content'] ) ? $_POST['content'] : ''; $source = isset( $_POST['source'] ) ? stripslashes($_POST['source']) : ''; if($filename == '') { - OC_JSON::error(array("data" => array( "message" => "Empty Filename" ))); + OCP\JSON::error(array("data" => array( "message" => "Empty Filename" ))); exit(); } if($source){ if(substr($source,0,8)!='https://' and substr($source,0,7)!='http://'){ - OC_JSON::error(array("data" => array( "message" => "Not a valid source" ))); + OCP\JSON::error(array("data" => array( "message" => "Not a valid source" ))); exit(); } $sourceStream=fopen($source,'rb'); @@ -26,10 +26,10 @@ if($source){ $result=OC_Filesystem::file_put_contents($target,$sourceStream); if($result){ $mime=OC_Filesystem::getMimetype($target); - OC_JSON::success(array("data" => array('mime'=>$mime))); + OCP\JSON::success(array("data" => array('mime'=>$mime))); exit(); }else{ - OC_JSON::error(array("data" => array( "message" => "Error while downloading ".$source. ' to '.$target ))); + OCP\JSON::error(array("data" => array( "message" => "Error while downloading ".$source. ' to '.$target ))); exit(); } } @@ -39,9 +39,9 @@ if(OC_Files::newFile($dir, $filename, 'file')) { if($content){ OC_Filesystem::file_put_contents($dir.'/'.$filename,$content); } - OC_JSON::success(array("data" => array('content'=>$content))); + OCP\JSON::success(array("data" => array('content'=>$content))); exit(); } -OC_JSON::error(array("data" => array( "message" => "Error when creating the file" ))); +OCP\JSON::error(array("data" => array( "message" => "Error when creating the file" ))); diff --git a/apps/files/ajax/newfolder.php b/apps/files/ajax/newfolder.php old mode 100644 new mode 100755 index 2aff95e5b357afed91c55ad00624deeac142e3fc..512e0e1f6d99696dcbe288dfac2bc787ce87d48e --- a/apps/files/ajax/newfolder.php +++ b/apps/files/ajax/newfolder.php @@ -3,20 +3,20 @@ // Init owncloud -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); // Get the params $dir = isset( $_POST['dir'] ) ? stripslashes($_POST['dir']) : ''; $foldername = isset( $_POST['foldername'] ) ? stripslashes($_POST['foldername']) : ''; if(trim($foldername) == '') { - OC_JSON::error(array("data" => array( "message" => "Empty Foldername" ))); + OCP\JSON::error(array("data" => array( "message" => "Empty Foldername" ))); exit(); } if(OC_Files::newFile($dir, stripslashes($foldername), 'dir')) { - OC_JSON::success(array("data" => array())); + OCP\JSON::success(array("data" => array())); exit(); } -OC_JSON::error(array("data" => array( "message" => "Error when creating the folder" ))); +OCP\JSON::error(array("data" => array( "message" => "Error when creating the folder" ))); diff --git a/apps/files/ajax/rawlist.php b/apps/files/ajax/rawlist.php index 86119de2d1bfe562686950e74bc69fe48a39452f..36dd35cc73e86d4b196798092cd5615d450653de 100755 --- a/apps/files/ajax/rawlist.php +++ b/apps/files/ajax/rawlist.php @@ -7,7 +7,7 @@ $RUNTIME_APPTYPES=array('filesystem'); require_once('lib/template.php'); -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); // Load the files $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : ''; @@ -21,6 +21,6 @@ foreach( OC_Files::getdirectorycontent( $dir, $mimetype ) as $i ){ $files[] = $i; } -OC_JSON::success(array('data' => $files)); +OCP\JSON::success(array('data' => $files)); ?> diff --git a/apps/files/ajax/rename.php b/apps/files/ajax/rename.php old mode 100644 new mode 100755 index dc5d3962abd7c3160bf5273a4ae4fad1c240553e..e2fa3d54a61aad43feab0b0054e9c5125f6e705b --- a/apps/files/ajax/rename.php +++ b/apps/files/ajax/rename.php @@ -3,7 +3,7 @@ // Init owncloud -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); // Get data $dir = stripslashes($_GET["dir"]); @@ -12,10 +12,10 @@ $newname = stripslashes($_GET["newname"]); // Delete if( OC_Files::move( $dir, $file, $dir, $newname )) { - OC_JSON::success(array("data" => array( "dir" => $dir, "file" => $file, "newname" => $newname ))); + OCP\JSON::success(array("data" => array( "dir" => $dir, "file" => $file, "newname" => $newname ))); } else{ - OC_JSON::error(array("data" => array( "message" => "Unable to rename file" ))); + OCP\JSON::error(array("data" => array( "message" => "Unable to rename file" ))); } ?> diff --git a/apps/files/ajax/scan.php b/apps/files/ajax/scan.php old mode 100644 new mode 100755 index a227dcc3ffc93a5bef7a30896eeb83effc25e7ed..d36366caf491756e0abb67446c8e6e5fcdb684da --- a/apps/files/ajax/scan.php +++ b/apps/files/ajax/scan.php @@ -20,12 +20,12 @@ if($force or !OC_FileCache::inCache('')){ OC_DB::commit(); $eventSource->send('success',true); }else{ - OC_JSON::success(array('data'=>array('done'=>true))); + OCP\JSON::success(array('data'=>array('done'=>true))); exit; } }else{ if($checkOnly){ - OC_JSON::success(array('data'=>array('done'=>false))); + OCP\JSON::success(array('data'=>array('done'=>false))); exit; } if(isset($eventSource)){ diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php index ca64f58e14b5de95198a79f8e5b5d2a2a02b6cd9..d6c799af32c76e8069edea19d3dfaa863eebde22 100755 --- a/apps/files/ajax/upload.php +++ b/apps/files/ajax/upload.php @@ -4,12 +4,12 @@ // Firefox and Konqueror tries to download application/json for me. --Arthur -OC_JSON::setContentTypeHeader('text/plain'); +OCP\JSON::setContentTypeHeader('text/plain'); -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); if (!isset($_FILES['files'])) { - OC_JSON::error(array("data" => array( "message" => "No file was uploaded. Unknown error" ))); + OCP\JSON::error(array("data" => array( "message" => "No file was uploaded. Unknown error" ))); exit(); } foreach ($_FILES['files']['error'] as $error) { @@ -24,7 +24,7 @@ foreach ($_FILES['files']['error'] as $error) { UPLOAD_ERR_NO_TMP_DIR=>$l->t("Missing a temporary folder"), UPLOAD_ERR_CANT_WRITE=>$l->t('Failed to write to disk'), ); - OC_JSON::error(array("data" => array( "message" => $errors[$error] ))); + OCP\JSON::error(array("data" => array( "message" => $errors[$error] ))); exit(); } } @@ -38,7 +38,7 @@ foreach($files['size'] as $size){ $totalSize+=$size; } if($totalSize>OC_Filesystem::free_space('/')){ - OC_JSON::error(array("data" => array( "message" => "Not enough space available" ))); + OCP\JSON::error(array("data" => array( "message" => "Not enough space available" ))); exit(); } @@ -52,12 +52,12 @@ if(strpos($dir,'..') === false){ $result[]=array( "status" => "success", 'mime'=>$meta['mimetype'],'size'=>$meta['size'],'name'=>basename($target)); } } - OC_JSON::encodedPrint($result); + OCP\JSON::encodedPrint($result); exit(); }else{ $error='invalid dir'; } -OC_JSON::error(array('data' => array('error' => $error, "file" => $fileName))); +OCP\JSON::error(array('data' => array('error' => $error, "file" => $fileName))); ?> diff --git a/apps/files_sharing/ajax/email.php b/apps/files_sharing/ajax/email.php index 84202a23f5c4f5adc9fd67e35d720349988188c5..9eba203465e0f17b3e9f918c2d7a2d47bebd0ec9 100755 --- a/apps/files_sharing/ajax/email.php +++ b/apps/files_sharing/ajax/email.php @@ -1,6 +1,6 @@ <?php -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('files_sharing'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('files_sharing'); $user = OCP\USER::getUser(); // TODO translations $subject = $user + ' ' + 'shared a file with you'; diff --git a/apps/files_sharing/ajax/getitem.php b/apps/files_sharing/ajax/getitem.php index b15a81e6086b6024e9d7a4ea02097da5363eb0cf..d9404f7e3b4113e35136c31309855f305c929699 100755 --- a/apps/files_sharing/ajax/getitem.php +++ b/apps/files_sharing/ajax/getitem.php @@ -2,7 +2,7 @@ //$RUNTIME_NOAPPS = true; -OC_JSON::checkAppEnabled('files_sharing'); +OCP\JSON::checkAppEnabled('files_sharing'); require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php'); $userDirectory = "/".OCP\USER::getUser()."/files"; @@ -32,5 +32,5 @@ while ($source != "" && $source != "/" && $source != "." && $source != $userDire $source = dirname($source); } if (!empty($users)) { - OC_JSON::encodedPrint($users); + OCP\JSON::encodedPrint($users); } diff --git a/apps/files_sharing/ajax/setpermissions.php b/apps/files_sharing/ajax/setpermissions.php index fc907bd75170016eedb43a092be9cd6e24660553..73f59d73db2d49d9f79399705538c60404b8d1ca 100755 --- a/apps/files_sharing/ajax/setpermissions.php +++ b/apps/files_sharing/ajax/setpermissions.php @@ -2,7 +2,7 @@ //$RUNTIME_NOAPPS = true; -OC_JSON::checkAppEnabled('files_sharing'); +OCP\JSON::checkAppEnabled('files_sharing'); require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php'); $source = "/".OCP\USER::getUser()."/files".$_GET['source']; diff --git a/apps/files_sharing/ajax/share.php b/apps/files_sharing/ajax/share.php index eaaf2a3d244624389398b92030822dcc40d3effe..4863170f57cf6e18083c5d1d9a7f6870d58251fc 100755 --- a/apps/files_sharing/ajax/share.php +++ b/apps/files_sharing/ajax/share.php @@ -2,7 +2,7 @@ //$RUNTIME_NOAPPS = true; -OC_JSON::checkAppEnabled('files_sharing'); +OCP\JSON::checkAppEnabled('files_sharing'); require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php'); $userDirectory = "/".OCP\USER::getUser()."/files"; diff --git a/apps/files_sharing/ajax/toggleresharing.php b/apps/files_sharing/ajax/toggleresharing.php index 853b2bd5349283248168068d80c614be3fdbe2fe..673f00c5d18e57d5b483191f9cf0db0968f5adf7 100755 --- a/apps/files_sharing/ajax/toggleresharing.php +++ b/apps/files_sharing/ajax/toggleresharing.php @@ -1,7 +1,7 @@ <?php -OC_JSON::checkAppEnabled('files_sharing'); -OC_JSON::checkAdminUser(); +OCP\JSON::checkAppEnabled('files_sharing'); +OCP\JSON::checkAdminUser(); if ($_POST['resharing'] == true) { OCP\Config::setAppValue('files_sharing', 'resharing', 'yes'); } else { diff --git a/apps/files_sharing/ajax/unshare.php b/apps/files_sharing/ajax/unshare.php index 061d31e2a984d314e7c7c9cd959a13348e98d4d1..5056c59a3d45aa336ea3c547ebfd9de0f5394327 100755 --- a/apps/files_sharing/ajax/unshare.php +++ b/apps/files_sharing/ajax/unshare.php @@ -2,7 +2,7 @@ //$RUNTIME_NOAPPS = true; -OC_JSON::checkAppEnabled('files_sharing'); +OCP\JSON::checkAppEnabled('files_sharing'); require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php'); $source = "/".OCP\USER::getUser()."/files".$_GET['source']; diff --git a/apps/files_sharing/ajax/userautocomplete.php b/apps/files_sharing/ajax/userautocomplete.php index 83fdc3bdf4daaae1ab9fd7bdc0a64618cde9f31a..73b5f126984dcd3251fb0fda9f42cdca2ba6bb38 100755 --- a/apps/files_sharing/ajax/userautocomplete.php +++ b/apps/files_sharing/ajax/userautocomplete.php @@ -3,8 +3,8 @@ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('files_sharing'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('files_sharing'); $users = array(); $groups = array(); @@ -24,6 +24,6 @@ foreach ($userGroups as $group) { $users[] = "</optgroup>"; $groups[] = "</optgroup>"; $users = array_merge($users, $groups); -OC_JSON::encodedPrint($users); +OCP\JSON::encodedPrint($users); ?> diff --git a/apps/files_sharing/get.php b/apps/files_sharing/get.php index b17dc85c5baecc89465e1ed5c67fa50e676e3538..de3bc5f46dcfbbdd4b83c77ec8a2eac734140ea4 100755 --- a/apps/files_sharing/get.php +++ b/apps/files_sharing/get.php @@ -1,7 +1,7 @@ <?php $RUNTIME_NOSETUPFS=true; //don't setup the fs yet -OC_JSON::checkAppEnabled('files_sharing'); +OCP\JSON::checkAppEnabled('files_sharing'); require_once 'lib_share.php'; //get the path of the shared file diff --git a/apps/files_texteditor/ajax/loadfile.php b/apps/files_texteditor/ajax/loadfile.php old mode 100644 new mode 100755 index a946e26f210f60a641dd569393c872fb5160819f..c263306e71917b5805795f8d62ac7e44746e318f --- a/apps/files_texteditor/ajax/loadfile.php +++ b/apps/files_texteditor/ajax/loadfile.php @@ -25,7 +25,7 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); // Set the session key for the file we are about to edit. $dir = isset($_GET['dir']) ? $_GET['dir'] : ''; @@ -37,14 +37,14 @@ if(!empty($filename)) { $mtime = OC_Filesystem::filemtime($path); $filecontents = OC_Filesystem::file_get_contents($path); - OC_JSON::success(array('data' => array('filecontents' => $filecontents, 'write' => 'true', 'mtime' => $mtime))); + OCP\JSON::success(array('data' => array('filecontents' => $filecontents, 'write' => 'true', 'mtime' => $mtime))); } else { $mtime = OC_Filesystem::filemtime($path); $filecontents = OC_Filesystem::file_get_contents($path); - OC_JSON::success(array('data' => array('filecontents' => $filecontents, 'write' => 'false', 'mtime' => $mtime))); + OCP\JSON::success(array('data' => array('filecontents' => $filecontents, 'write' => 'false', 'mtime' => $mtime))); } } else { - OC_JSON::error(array('data' => array( 'message' => 'Invalid file path supplied.'))); + OCP\JSON::error(array('data' => array( 'message' => 'Invalid file path supplied.'))); } \ No newline at end of file diff --git a/apps/files_texteditor/ajax/mtime.php b/apps/files_texteditor/ajax/mtime.php old mode 100644 new mode 100755 index 436592c383f7417843a03396eda94c7af9ad487f..ee683722adddf2a56ff2ee999225e12ed94b3fb1 --- a/apps/files_texteditor/ajax/mtime.php +++ b/apps/files_texteditor/ajax/mtime.php @@ -25,7 +25,7 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); // Get the path from GET $path = isset($_GEt['path']) ? $_GET['path'] : ''; @@ -36,14 +36,14 @@ if($path != '') $mtime = OC_Filesystem::filemtime($path); if($mtime) { - OC_JSON::success(array('data' => array('path' => $path, 'mtime' => $mtime))); + OCP\JSON::success(array('data' => array('path' => $path, 'mtime' => $mtime))); } else { - OC_JSON::error(); + OCP\JSON::error(); } } else { - OC_JSON::error(); + OCP\JSON::error(); } \ No newline at end of file diff --git a/apps/files_texteditor/ajax/savefile.php b/apps/files_texteditor/ajax/savefile.php index 7c7fb90e7c6d21555fa3defc9fca17b5088a0b6e..4c260e237c5b554c4e9f599c3d86ff2125b33ab3 100755 --- a/apps/files_texteditor/ajax/savefile.php +++ b/apps/files_texteditor/ajax/savefile.php @@ -25,7 +25,7 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); // Get paramteres $filecontents = $_POST['filecontents']; @@ -39,7 +39,7 @@ if($path != '' && $mtime != '') if($mtime != $filemtime) { // Then the file has changed since opening - OC_JSON::error(); + OCP\JSON::error(); OCP\Util::writeLog('files_texteditor',"File: ".$path." modified since opening.",OCP\Util::ERROR); } else @@ -53,16 +53,16 @@ if($path != '' && $mtime != '') clearstatcache(); // Get new mtime $newmtime = OC_Filesystem::filemtime($path); - OC_JSON::success(array('data' => array('mtime' => $newmtime))); + OCP\JSON::success(array('data' => array('mtime' => $newmtime))); } else { // Not writeable! - OC_JSON::error(array('data' => array( 'message' => 'Insufficient permissions'))); + OCP\JSON::error(array('data' => array( 'message' => 'Insufficient permissions'))); OCP\Util::writeLog('files_texteditor',"User does not have permission to write to file: ".$path,OCP\Util::ERROR); } } } else { - OC_JSON::error(array('data' => array( 'message' => 'File path or mtime not supplied'))); + OCP\JSON::error(array('data' => array( 'message' => 'File path or mtime not supplied'))); OCP\Util::writeLog('files_texteditor',"Invalid path supplied:".$path,OCP\Util::ERROR); } diff --git a/apps/files_versions/ajax/getVersions.php b/apps/files_versions/ajax/getVersions.php index d12cf368f18b2b7823a437ba4e454e5895784fb0..5949c32ed16746b38cceef218508e5c540d003b1 100755 --- a/apps/files_versions/ajax/getVersions.php +++ b/apps/files_versions/ajax/getVersions.php @@ -1,7 +1,7 @@ <?php require_once('../../../lib/base.php'); -OC_JSON::checkAppEnabled('files_versions'); +OCP\JSON::checkAppEnabled('files_versions'); require_once('../versions.php'); $userDirectory = "/".OCP\USER::getUser()."/files"; @@ -23,7 +23,7 @@ if( OCA_Versions\Storage::isversioned( $source ) ) { $versionsSorted = array_reverse( $versionsFormatted ); if ( !empty( $versionsSorted ) ) { - OC_JSON::encodedPrint($versionsSorted); + OCP\JSON::encodedPrint($versionsSorted); } }else{ @@ -57,5 +57,5 @@ if( OCA_Versions\Storage::isversioned( $source ) ) { // $source = dirname($source); // } // if (!empty($users)) { -// OC_JSON::encodedPrint($users); +// OCP\JSON::encodedPrint($users); // } diff --git a/apps/files_versions/ajax/rollbackVersion.php b/apps/files_versions/ajax/rollbackVersion.php index a7b18c4e091a7bd41518322cfdc41d4e23674a8a..3faaafe935daf2a9d82134e48cbff20e7baee59f 100755 --- a/apps/files_versions/ajax/rollbackVersion.php +++ b/apps/files_versions/ajax/rollbackVersion.php @@ -1,7 +1,7 @@ <?php require_once('../../../lib/base.php'); -OC_JSON::checkAppEnabled('files_versions'); +OCP\JSON::checkAppEnabled('files_versions'); require_once('../versions.php'); $userDirectory = "/".OCP\USER::getUser()."/files"; diff --git a/apps/files_versions/ajax/togglesettings.php b/apps/files_versions/ajax/togglesettings.php index 49e314f86aa17d348447422508a215b7f53c97e4..d513d12dd6c044a89e8b6e4b9bcdbae42bdda8c9 100755 --- a/apps/files_versions/ajax/togglesettings.php +++ b/apps/files_versions/ajax/togglesettings.php @@ -1,7 +1,7 @@ <?php -OC_JSON::checkAppEnabled('files_versions'); -OC_JSON::checkAdminUser(); +OCP\JSON::checkAppEnabled('files_versions'); +OCP\JSON::checkAdminUser(); if (OCP\Config::getSystemValue('versions', 'true')=='true') { OCP\Config::setSystemValue('versions', 'false'); } else { diff --git a/apps/gallery/ajax/createAlbum.php b/apps/gallery/ajax/createAlbum.php index eaf5c296de98644a1bee3b400d9a21c2ed431e2a..61e2e9ae2e9928b90b4899a833e0495959f78750 100755 --- a/apps/gallery/ajax/createAlbum.php +++ b/apps/gallery/ajax/createAlbum.php @@ -22,11 +22,11 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('gallery'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('gallery'); OC_Gallery_Album::create(OCP\USER::getUser(), $_GET['album_name']); -OC_JSON::success(array('name' => $_GET['album_name'])); +OCP\JSON::success(array('name' => $_GET['album_name'])); ?> diff --git a/apps/gallery/ajax/galleryOp.php b/apps/gallery/ajax/galleryOp.php index c302a3a734c7fbb3bc65910df89133feaaf0121c..b9ca31901c322175288375e04a4e688071af6259 100755 --- a/apps/gallery/ajax/galleryOp.php +++ b/apps/gallery/ajax/galleryOp.php @@ -24,8 +24,8 @@ header('Content-type: text/html; charset=UTF-8') ; -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('gallery'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('gallery'); function handleRename($oldname, $newname) { OC_Gallery_Album::rename($oldname, $newname, OCP\USER::getUser()); @@ -61,16 +61,16 @@ function handleFilescan($cleanup) { if ($cleanup) OC_Gallery_Album::cleanup(); $pathlist = OC_Gallery_Scanner::find_paths(); sort($pathlist); - OC_JSON::success(array('paths' => $pathlist)); + OCP\JSON::success(array('paths' => $pathlist)); } function handleStoreSettings($root, $order) { if (!OC_Filesystem::file_exists($root)) { - OC_JSON::error(array('cause' => 'No such file or directory')); + OCP\JSON::error(array('cause' => 'No such file or directory')); return; } if (!OC_Filesystem::is_dir($root)) { - OC_JSON::error(array('cause' => $root . ' is not a directory')); + OCP\JSON::error(array('cause' => $root . ' is not a directory')); return; } @@ -80,7 +80,7 @@ function handleStoreSettings($root, $order) { $rescan = $current_root==$root?'no':'yes'; OCP\Config::setUserValue(OCP\USER::getUser(), 'gallery', 'root', $root); OCP\Config::setUserValue(OCP\USER::getUser(), 'gallery', 'order', $order); - OC_JSON::success(array('rescan' => $rescan)); + OCP\JSON::success(array('rescan' => $rescan)); } function handleGetGallery($path) { @@ -121,7 +121,7 @@ function handleGetGallery($path) { $token = $row['token']; } - OC_JSON::success(array('albums'=>$a, 'photos'=>$p, 'shared' => $shared, 'recursive' => $recursive, 'token' => $token)); + OCP\JSON::success(array('albums'=>$a, 'photos'=>$p, 'shared' => $shared, 'recursive' => $recursive, 'token' => $token)); } function handleShare($path, $share, $recursive) { @@ -134,23 +134,23 @@ function handleShare($path, $share, $recursive) { if ($row = $r->fetchRow()) { $albumId = $row['album_id']; } else { - OC_JSON::error(array('cause' => 'Couldn\'t find requested gallery')); + OCP\JSON::error(array('cause' => 'Couldn\'t find requested gallery')); exit; } if ($share == false) { OC_Gallery_Sharing::remove($albumId); - OC_JSON::success(array('sharing' => false)); + OCP\JSON::success(array('sharing' => false)); } else { // share, yeah \o/ $r = OC_Gallery_Sharing::getEntryByAlbumId($albumId); if (($row = $r->fetchRow())) { // update entry OC_Gallery_Sharing::updateSharingByToken($row['token'], $recursive); - OC_JSON::success(array('sharing' => true, 'token' => $row['token'], 'recursive' => $recursive == 1 ? true : false )); + OCP\JSON::success(array('sharing' => true, 'token' => $row['token'], 'recursive' => $recursive == 1 ? true : false )); } else { // and new sharing entry $date = new DateTime(); $token = md5($owner . $date->getTimestamp()); OC_Gallery_Sharing::addShared($token, intval($albumId), $recursive); - OC_JSON::success(array('sharing' => true, 'token' => $token, 'recursive' => $recursive == 1 ? true : false )); + OCP\JSON::success(array('sharing' => true, 'token' => $token, 'recursive' => $recursive == 1 ? true : false )); } } } @@ -160,11 +160,11 @@ if ($_GET['operation']) { switch($_GET['operation']) { case 'rename': handleRename($_GET['oldname'], $_GET['newname']); - OC_JSON::success(array('newname' => $_GET['newname'])); + OCP\JSON::success(array('newname' => $_GET['newname'])); break; case 'remove': handleRemove($_GET['name']); - OC_JSON::success(); + OCP\JSON::success(); break; case 'get_covers': handleGetThumbnails(urldecode($_GET['albumname'])); @@ -182,7 +182,7 @@ if ($_GET['operation']) { handleShare($_GET['path'], $_GET['share'] == 'true' ? true : false, $_GET['recursive']); break; default: - OC_JSON::error(array('cause' => 'Unknown operation')); + OCP\JSON::error(array('cause' => 'Unknown operation')); } } ?> diff --git a/apps/gallery/ajax/sharing.php b/apps/gallery/ajax/sharing.php index a1af75ad461171f9cd88198d6bebd02f68ff318f..1223320120b4aa7a41150542a9afea658974ba16 100755 --- a/apps/gallery/ajax/sharing.php +++ b/apps/gallery/ajax/sharing.php @@ -24,7 +24,7 @@ if (!isset($_GET['token']) || !isset($_GET['operation'])) { - OC_JSON::error(array('cause' => 'Not enought arguments')); + OCP\JSON::error(array('cause' => 'Not enought arguments')); exit; } @@ -32,7 +32,7 @@ $operation = $_GET['operation']; $token = $_GET['token']; if (!OC_Gallery_Sharing::isTokenValid($token)) { - OC_JSON::error(array('cause' => 'Given token is not valid')); + OCP\JSON::error(array('cause' => 'Given token is not valid')); exit; } @@ -65,7 +65,7 @@ function handleGetGallery($token, $path) { $photos[] = $row['file_path']; } - OC_JSON::success(array('albums' => $albums, 'photos' => $photos)); + OCP\JSON::success(array('albums' => $albums, 'photos' => $photos)); } function handleGetThumbnail($token, $imgpath) { diff --git a/apps/gallery/ajax/thumbnail.php b/apps/gallery/ajax/thumbnail.php index 92e9fd4269e15329201ea694f631a4445dad63d1..ff0cb44022ceedd403790df7c32ef6fe4c8e3ce2 100755 --- a/apps/gallery/ajax/thumbnail.php +++ b/apps/gallery/ajax/thumbnail.php @@ -22,8 +22,8 @@ */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('gallery'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('gallery'); $img = $_GET['img']; diff --git a/apps/gallery/lib/images_utils.php b/apps/gallery/lib/images_utils.php old mode 100644 new mode 100755 index eb50f5217eac1d4216b01395b3a08dffe3bbe057..ac3a383c97748985a0a44540510556882f86607e --- a/apps/gallery/lib/images_utils.php +++ b/apps/gallery/lib/images_utils.php @@ -21,8 +21,8 @@ * */ -OC_JSON::checkLoggedIn(); -OC_JSON::checkAppEnabled('gallery'); +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('gallery'); function CroppedThumbnail($imgSrc,$thumbnail_width,$thumbnail_height, $tgtImg, $shift) { //getting the image dimensions diff --git a/apps/media/ajax/api.php b/apps/media/ajax/api.php index 95259fdefa068f51ccd19c13557cae2867305ec0..130344ac6dcd28a8014b6f7a9d65bf6edb1f199a 100755 --- a/apps/media/ajax/api.php +++ b/apps/media/ajax/api.php @@ -23,7 +23,7 @@ header('Content-type: text/html; charset=UTF-8') ; -OC_JSON::checkAppEnabled('media'); +OCP\JSON::checkAppEnabled('media'); require_once(OC::$APPSROOT . '/apps/media/lib_collection.php'); require_once(OC::$APPSROOT . '/apps/media/lib_scanner.php'); @@ -64,7 +64,7 @@ if($arguments['action']){ $data['artists']=OC_MEDIA_COLLECTION::getArtists(); $data['albums']=OC_MEDIA_COLLECTION::getAlbums(); $data['songs']=OC_MEDIA_COLLECTION::getSongs(); - OC_JSON::encodedPrint($data); + OCP\JSON::encodedPrint($data); break; case 'scan': OC_DB::beginTransaction(); @@ -78,13 +78,13 @@ if($arguments['action']){ echo (OC_MEDIA_SCANNER::scanFile($arguments['path']))?'true':'false'; break; case 'get_artists': - OC_JSON::encodedPrint(OC_MEDIA_COLLECTION::getArtists($arguments['search'])); + OCP\JSON::encodedPrint(OC_MEDIA_COLLECTION::getArtists($arguments['search'])); break; case 'get_albums': - OC_JSON::encodedPrint(OC_MEDIA_COLLECTION::getAlbums($arguments['artist'],$arguments['search'])); + OCP\JSON::encodedPrint(OC_MEDIA_COLLECTION::getAlbums($arguments['artist'],$arguments['search'])); break; case 'get_songs': - OC_JSON::encodedPrint(OC_MEDIA_COLLECTION::getSongs($arguments['artist'],$arguments['album'],$arguments['search'])); + OCP\JSON::encodedPrint(OC_MEDIA_COLLECTION::getSongs($arguments['artist'],$arguments['album'],$arguments['search'])); break; case 'get_path_info': if(OC_Filesystem::file_exists($arguments['path'])){ @@ -97,7 +97,7 @@ if($arguments['action']){ $song=OC_MEDIA_COLLECTION::getSong($songId); $song['artist']=OC_MEDIA_COLLECTION::getArtistName($song['song_artist']); $song['album']=OC_MEDIA_COLLECTION::getAlbumName($song['song_album']); - OC_JSON::encodedPrint($song); + OCP\JSON::encodedPrint($song); } } break; @@ -122,7 +122,7 @@ if($arguments['action']){ $music=OC_FileCache::searchByMime('audio'); $ogg=OC_FileCache::searchByMime('application','ogg'); $music=array_merge($music,$ogg); - OC_JSON::encodedPrint($music); + OCP\JSON::encodedPrint($music); exit; } } diff --git a/apps/media/ajax/autoupdate.php b/apps/media/ajax/autoupdate.php index 1efbea3acefd2d18f8768b424810971c6a08171a..3122c7e6754193310f626343f3d9c226b714f284 100755 --- a/apps/media/ajax/autoupdate.php +++ b/apps/media/ajax/autoupdate.php @@ -28,11 +28,11 @@ $RUNTIME_NOAPPS=true; $RUNTIME_NOSETUPFS=true; -OC_JSON::checkAppEnabled('media'); +OCP\JSON::checkAppEnabled('media'); $autoUpdate=(isset($_GET['autoupdate']) and $_GET['autoupdate']=='true'); OCP\Config::setUserValue(OCP\USER::getUser(),'media','autoupdate',(integer)$autoUpdate); -OC_JSON::success(array('data' => $autoUpdate)); +OCP\JSON::success(array('data' => $autoUpdate)); ?> diff --git a/apps/media/tomahawk.php b/apps/media/tomahawk.php index d4f5ac6afadb15e4682101a43ca986fbfbdf6ef0..700a75bf41e87fd32f4d131b024943a99489324f 100755 --- a/apps/media/tomahawk.php +++ b/apps/media/tomahawk.php @@ -24,7 +24,7 @@ $_POST=$_GET; //debug require_once('../inc.php'); -OC_JSON::checkAppEnabled('media'); +OCP\JSON::checkAppEnabled('media'); require_once(OC::$APPSROOT . '/apps/media/lib_collection.php'); $user=isset($_POST['user'])?$_POST['user']:''; @@ -76,5 +76,5 @@ foreach($songs as $song) { 'score' => (float)1.0 ); } -OC_JSON::encodedPrint($results); +OCP\JSON::encodedPrint($results); ?> diff --git a/apps/user_migrate/ajax/export.php b/apps/user_migrate/ajax/export.php index ef8e331c68cd443b0a8b957e6665abe86c452c6a..07c35c7347018a20b405d8e08a715e6c7a6f74dc 100755 --- a/apps/user_migrate/ajax/export.php +++ b/apps/user_migrate/ajax/export.php @@ -24,33 +24,33 @@ // Check if we are a user -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); OCP\App::checkAppEnabled('user_migrate'); // Which operation if( $_GET['operation']=='create' ){ $uid = !empty( $_POST['uid'] ) ? $_POST['uid'] : OCP\USER::getUser(); if( $uid != OCP\USER::getUser() ){ // Needs to be admin to export someone elses account - OC_JSON::error(); + OCP\JSON::error(); die(); } // Create the export zip $response = json_decode( OC_Migrate::export( $uid ) ); if( !$response->success ){ // Error - OC_JSON::error(); + OCP\JSON::error(); die(); } else { // Save path in session $_SESSION['ocuserexportpath'] = $response->data; } - OC_JSON::success(); + OCP\JSON::success(); die(); } else if( $_GET['operation']=='download' ){ // Download the export $path = isset( $_SESSION['ocuserexportpath'] ) ? $_SESSION['ocuserexportpath'] : false; if( !$path ){ - OC_JSON::error(); + OCP\JSON::error(); } header("Content-Type: application/zip"); header("Content-Disposition: attachment; filename=" . basename($path)); diff --git a/lib/public/json.php b/lib/public/json.php new file mode 100644 index 0000000000000000000000000000000000000000..36d3bed807fc62f14b11ed01d73560c2ea6deb3a --- /dev/null +++ b/lib/public/json.php @@ -0,0 +1,94 @@ +<?php +/** +* ownCloud +* +* @author Frank Karlitschek +* @copyright 2010 Frank Karlitschek karlitschek@kde.org +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Affero General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + +/** + * Public interface of ownCloud for apps to use. + * JSON Class + * + */ + +// use OCP namespace for all classes that are considered public. +// This means that they should be used by apps instead of the internal ownCloud classes +namespace OCP; + +class JSON { + + + + /** + * Encode and print $data in JSON format + */ + public static function encodedPrint($data,$setContentType=true){ + return(\OC_JSON::encodedPrint($data,$setContentType)); + } + + /** + * Check if the user is logged in, send json error msg if not + */ + public static function checkLoggedIn(){ + return(\OC_JSON::checkLoggedIn()); + } + + + + /** + * Send json success msg + */ + public static function success($data = array()){ + return(\OC_JSON::success($data)); + } + + + /** + * Send json error msg + */ + public static function error($data = array()){ + return(\OC_JSON::error($data)); + } + + + /** + * set Content-Type header to jsonrequest + */ + public static function setContentTypeHeader($type='application/json'){ + return(\OC_JSON::setContentTypeHeader($type)); + } + + + /** + * Check if the app is enabled, send json error msg if not + */ + public static function checkAppEnabled($app){ + return(\OC_JSON::checkAppEnabled($app)); + } + + + /** + * Check if the user is a admin, send json error msg if not + */ + public static function checkAdminUser(){ + return(\OC_JSON::checkAdminUser()); + } + +} + +?>