Added CSRF checks
This commit is contained in:
parent
e52ab59b40
commit
38271ded75
|
@ -29,6 +29,7 @@ $RUNTIME_NOSETUPFS=true;
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('bookmarks');
|
OCP\JSON::checkAppEnabled('bookmarks');
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
require_once(OC::$APPSROOT . '/apps/bookmarks/bookmarksHelper.php');
|
require_once(OC::$APPSROOT . '/apps/bookmarks/bookmarksHelper.php');
|
||||||
$id = addBookmark($_POST['url'], $_POST['title'], $_POST['tags']);
|
$id = addBookmark($_POST['url'], $_POST['title'], $_POST['tags']);
|
||||||
|
|
|
@ -29,6 +29,7 @@ $RUNTIME_NOSETUPFS=true;
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('bookmarks');
|
OCP\JSON::checkAppEnabled('bookmarks');
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$id = $_POST['id'];
|
$id = $_POST['id'];
|
||||||
if (!OC_Bookmarks_Bookmarks::deleteUrl($id)){
|
if (!OC_Bookmarks_Bookmarks::deleteUrl($id)){
|
||||||
|
|
|
@ -29,6 +29,7 @@ $RUNTIME_NOSETUPFS=true;
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('bookmarks');
|
OCP\JSON::checkAppEnabled('bookmarks');
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$CONFIG_DBTYPE = OCP\Config::getSystemValue( "dbtype", "sqlite" );
|
$CONFIG_DBTYPE = OCP\Config::getSystemValue( "dbtype", "sqlite" );
|
||||||
if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
|
if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('calendar');
|
OCP\JSON::checkAppEnabled('calendar');
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$cal = $_POST["calendarid"];
|
$cal = $_POST["calendarid"];
|
||||||
$calendar = OC_Calendar_App::getCalendar($cal, true);
|
$calendar = OC_Calendar_App::getCalendar($cal, true);
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('calendar');
|
OCP\JSON::checkAppEnabled('calendar');
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions();
|
$calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions();
|
||||||
$calendar = OC_Calendar_App::getCalendar($_GET['calendarid'], true);
|
$calendar = OC_Calendar_App::getCalendar($_GET['calendarid'], true);
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('calendar');
|
OCP\JSON::checkAppEnabled('calendar');
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
if(trim($_POST['name']) == ''){
|
if(trim($_POST['name']) == ''){
|
||||||
OCP\JSON::error(array('message'=>'empty'));
|
OCP\JSON::error(array('message'=>'empty'));
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('calendar');
|
OCP\JSON::checkAppEnabled('calendar');
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
if(trim($_POST['name']) == ''){
|
if(trim($_POST['name']) == ''){
|
||||||
OCP\JSON::error(array('message'=>'empty'));
|
OCP\JSON::error(array('message'=>'empty'));
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('calendar');
|
OCP\JSON::checkAppEnabled('calendar');
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$id = $_POST['id'];
|
$id = $_POST['id'];
|
||||||
$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);
|
$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('calendar');
|
OCP\JSON::checkAppEnabled('calendar');
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$id = $_POST['id'];
|
$id = $_POST['id'];
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$id = $_POST['id'];
|
$id = $_POST['id'];
|
||||||
$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);
|
$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('calendar');
|
OCP\JSON::checkAppEnabled('calendar');
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$errarr = OC_Calendar_Object::validateRequest($_POST);
|
$errarr = OC_Calendar_Object::validateRequest($_POST);
|
||||||
if($errarr){
|
if($errarr){
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
//check for calendar rights or create new one
|
//check for calendar rights or create new one
|
||||||
ob_start();
|
ob_start();
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
|
OCP\JSON::callCheck();
|
||||||
OCP\App::checkAppEnabled('calendar');
|
OCP\App::checkAppEnabled('calendar');
|
||||||
$nl="\r\n";
|
$nl="\r\n";
|
||||||
$comps = array('VEVENT'=>true, 'VTODO'=>true, 'VJOURNAL'=>true);
|
$comps = array('VEVENT'=>true, 'VTODO'=>true, 'VJOURNAL'=>true);
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
if(isset($_POST["firstday"])){
|
if(isset($_POST["firstday"])){
|
||||||
OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'firstday', $_POST["firstday"]);
|
OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'firstday', $_POST["firstday"]);
|
||||||
OCP\JSON::success();
|
OCP\JSON::success();
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
if(isset($_POST["timeformat"])){
|
if(isset($_POST["timeformat"])){
|
||||||
OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', $_POST["timeformat"]);
|
OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', $_POST["timeformat"]);
|
||||||
OCP\JSON::success();
|
OCP\JSON::success();
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
* later.
|
* later.
|
||||||
* See the COPYING-README file.
|
* See the COPYING-README file.
|
||||||
*/
|
*/
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$id = strip_tags($_GET['id']);
|
$id = strip_tags($_GET['id']);
|
||||||
$idtype = strip_tags($_GET['idtype']);
|
$idtype = strip_tags($_GET['idtype']);
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
* later.
|
* later.
|
||||||
* See the COPYING-README file.
|
* See the COPYING-README file.
|
||||||
*/
|
*/
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$id = strip_tags($_GET['id']);
|
$id = strip_tags($_GET['id']);
|
||||||
$idtype = strip_tags($_GET['idtype']);
|
$idtype = strip_tags($_GET['idtype']);
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
* later.
|
* later.
|
||||||
* See the COPYING-README file.
|
* See the COPYING-README file.
|
||||||
*/
|
*/
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$id = strip_tags($_GET['id']);
|
$id = strip_tags($_GET['id']);
|
||||||
$idtype = strip_tags($_GET['idtype']);
|
$idtype = strip_tags($_GET['idtype']);
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
|
|
||||||
OCP\User::checkAdminUser();
|
OCP\User::checkAdminUser();
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$sites = array();
|
$sites = array();
|
||||||
for ($i = 0; $i < sizeof($_POST['site_name']); $i++) {
|
for ($i = 0; $i < sizeof($_POST['site_name']); $i++) {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
|
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
// Get data
|
// Get data
|
||||||
$dir = stripslashes($_GET["dir"]);
|
$dir = stripslashes($_GET["dir"]);
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
|
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
// Get data
|
// Get data
|
||||||
$dir = stripslashes($_GET["dir"]);
|
$dir = stripslashes($_GET["dir"]);
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
|
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
// Get the params
|
// Get the params
|
||||||
$dir = isset( $_POST['dir'] ) ? stripslashes($_POST['dir']) : '';
|
$dir = isset( $_POST['dir'] ) ? stripslashes($_POST['dir']) : '';
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
|
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
// Get the params
|
// Get the params
|
||||||
$dir = isset( $_POST['dir'] ) ? stripslashes($_POST['dir']) : '';
|
$dir = isset( $_POST['dir'] ) ? stripslashes($_POST['dir']) : '';
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
|
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
// Get data
|
// Get data
|
||||||
$dir = stripslashes($_GET["dir"]);
|
$dir = stripslashes($_GET["dir"]);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
|
OCP\JSON::callCheck();
|
||||||
OCP\JSON::checkAppEnabled('files_sharing');
|
OCP\JSON::checkAppEnabled('files_sharing');
|
||||||
$user = OCP\USER::getUser();
|
$user = OCP\USER::getUser();
|
||||||
// TODO translations
|
// TODO translations
|
||||||
|
|
|
@ -3,6 +3,7 @@ require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
|
||||||
|
|
||||||
OCP\JSON::checkAppEnabled('files_sharing');
|
OCP\JSON::checkAppEnabled('files_sharing');
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$source = '/'.OCP\USER::getUser().'/files'.$_POST['source'];
|
$source = '/'.OCP\USER::getUser().'/files'.$_POST['source'];
|
||||||
$uid_shared_with = $_POST['uid_shared_with'];
|
$uid_shared_with = $_POST['uid_shared_with'];
|
||||||
|
|
|
@ -3,6 +3,7 @@ require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
|
||||||
|
|
||||||
OCP\JSON::checkAppEnabled('files_sharing');
|
OCP\JSON::checkAppEnabled('files_sharing');
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$userDirectory = '/'.OCP\USER::getUser().'/files';
|
$userDirectory = '/'.OCP\USER::getUser().'/files';
|
||||||
$sources = explode(';', $_POST['sources']);
|
$sources = explode(';', $_POST['sources']);
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
OCP\JSON::checkAppEnabled('files_sharing');
|
OCP\JSON::checkAppEnabled('files_sharing');
|
||||||
OCP\JSON::checkAdminUser();
|
OCP\JSON::checkAdminUser();
|
||||||
if ($_POST['resharing'] == true) {
|
if ($_POST['resharing'] == true) {
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
OCP\JSON::checkAppEnabled('files_sharing');
|
OCP\JSON::checkAppEnabled('files_sharing');
|
||||||
OCP\JSON::checkAdminUser();
|
OCP\JSON::checkAdminUser();
|
||||||
if ($_POST['allowSharingWithEveryone'] == true) {
|
if ($_POST['allowSharingWithEveryone'] == true) {
|
||||||
|
|
|
@ -3,6 +3,7 @@ require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
|
||||||
|
|
||||||
OCP\JSON::checkAppEnabled('files_sharing');
|
OCP\JSON::checkAppEnabled('files_sharing');
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$source = '/'.OCP\USER::getUser().'/files'.$_POST['source'];
|
$source = '/'.OCP\USER::getUser().'/files'.$_POST['source'];
|
||||||
$uid_shared_with = $_POST['uid_shared_with'];
|
$uid_shared_with = $_POST['uid_shared_with'];
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
// Get paramteres
|
// Get paramteres
|
||||||
$filecontents = isset($_POST['filecontents']) ? $_POST['filecontents'] : false;
|
$filecontents = isset($_POST['filecontents']) ? $_POST['filecontents'] : false;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
OCP\JSON::checkAppEnabled('files_versions');
|
OCP\JSON::checkAppEnabled('files_versions');
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
require_once('apps/files_versions/versions.php');
|
require_once('apps/files_versions/versions.php');
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('gallery');
|
OCP\JSON::checkAppEnabled('gallery');
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
OC_Gallery_Album::create(OCP\USER::getUser(), $_GET['album_name']);
|
OC_Gallery_Album::create(OCP\USER::getUser(), $_GET['album_name']);
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
if (!isset($_GET['token']) || !isset($_GET['operation'])) {
|
if (!isset($_GET['token']) || !isset($_GET['operation'])) {
|
||||||
OCP\JSON::error(array('cause' => 'Not enought arguments'));
|
OCP\JSON::error(array('cause' => 'Not enought arguments'));
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
// Init owncloud
|
// Init owncloud
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('tasks');
|
OCP\JSON::checkAppEnabled('tasks');
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$calendars = OC_Calendar_Calendar::allCalendars(OCP\User::getUser(), true);
|
$calendars = OC_Calendar_Calendar::allCalendars(OCP\User::getUser(), true);
|
||||||
$first_calendar = reset($calendars);
|
$first_calendar = reset($calendars);
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
// Init owncloud
|
// Init owncloud
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('tasks');
|
OCP\JSON::checkAppEnabled('tasks');
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$calendars = OC_Calendar_Calendar::allCalendars(OCP\User::getUser(), true);
|
$calendars = OC_Calendar_Calendar::allCalendars(OCP\User::getUser(), true);
|
||||||
$category_options = OC_Calendar_App::getCategoryOptions();
|
$category_options = OC_Calendar_App::getCategoryOptions();
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
// Init owncloud
|
// Init owncloud
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('tasks');
|
OCP\JSON::checkAppEnabled('tasks');
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$id = $_POST['id'];
|
$id = $_POST['id'];
|
||||||
$task = OC_Calendar_App::getEventObject( $id );
|
$task = OC_Calendar_App::getEventObject( $id );
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
// Init owncloud
|
// Init owncloud
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('tasks');
|
OCP\JSON::checkAppEnabled('tasks');
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$l10n = new OC_L10N('tasks');
|
$l10n = new OC_L10N('tasks');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue