Added CSRF checks to Calendar. Expect some error messages - and report them ;)
This commit is contained in:
parent
1f4d6896df
commit
06ff6c6d7d
|
@ -9,6 +9,8 @@
|
|||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('calendar');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$calendarid = $_POST['calendarid'];
|
||||
$calendar = OC_Calendar_App::getCalendar($calendarid, true);
|
||||
if(!$calendar){
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('calendar');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$cal = $_POST["calendarid"];
|
||||
$calendar = OC_Calendar_App::getCalendar($cal, true);
|
||||
|
|
|
@ -6,11 +6,10 @@
|
|||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// Check if we are a user
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('calendar');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
if(trim($_POST['name']) == ''){
|
||||
OCP\JSON::error(array('message'=>'empty'));
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
// Check if we are a user
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('calendar');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
if(trim($_POST['name']) == ''){
|
||||
OCP\JSON::error(array('message'=>'empty'));
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('calendar');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
foreach ($_POST as $key=>$element) {
|
||||
debug('_POST: '.$key.'=>'.print_r($element, true));
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('calendar');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$id = $_POST['id'];
|
||||
$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('calendar');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$id = $_POST['id'];
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$id = $_POST['id'];
|
||||
$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('calendar');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$errarr = OC_Calendar_Object::validateRequest($_POST);
|
||||
if($errarr){
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$id = $_POST['id'];
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ ob_start();
|
|||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\App::checkAppEnabled('calendar');
|
||||
OCP\JSON::callCheck();
|
||||
session_write_close();
|
||||
|
||||
$nl="\r\n";
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
if(isset($_POST["firstday"])){
|
||||
OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'firstday', $_POST["firstday"]);
|
||||
OCP\JSON::success();
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
if(isset($_POST["timeformat"])){
|
||||
OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', $_POST["timeformat"]);
|
||||
OCP\JSON::success();
|
||||
|
|
|
@ -14,6 +14,7 @@ $l=OC_L10N::get('calendar');
|
|||
// Check if we are a user
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('calendar');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
// Get data
|
||||
if( isset( $_POST['timezone'] ) ){
|
||||
|
|
Loading…
Reference in New Issue