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::checkLoggedIn();
|
||||||
OCP\JSON::checkAppEnabled('calendar');
|
OCP\JSON::checkAppEnabled('calendar');
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$calendarid = $_POST['calendarid'];
|
$calendarid = $_POST['calendarid'];
|
||||||
$calendar = OC_Calendar_App::getCalendar($calendarid, true);
|
$calendar = OC_Calendar_App::getCalendar($calendarid, true);
|
||||||
if(!$calendar){
|
if(!$calendar){
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -6,11 +6,10 @@
|
||||||
* See the COPYING-README file.
|
* See the COPYING-README file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 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();
|
||||||
|
|
||||||
foreach ($_POST as $key=>$element) {
|
foreach ($_POST as $key=>$element) {
|
||||||
debug('_POST: '.$key.'=>'.print_r($element, true));
|
debug('_POST: '.$key.'=>'.print_r($element, true));
|
||||||
|
|
|
@ -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){
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
$id = $_POST['id'];
|
$id = $_POST['id'];
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ ob_start();
|
||||||
|
|
||||||
OCP\JSON::checkLoggedIn();
|
OCP\JSON::checkLoggedIn();
|
||||||
OCP\App::checkAppEnabled('calendar');
|
OCP\App::checkAppEnabled('calendar');
|
||||||
|
OCP\JSON::callCheck();
|
||||||
session_write_close();
|
session_write_close();
|
||||||
|
|
||||||
$nl="\r\n";
|
$nl="\r\n";
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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();
|
||||||
|
|
|
@ -14,6 +14,7 @@ $l=OC_L10N::get('calendar');
|
||||||
// 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();
|
||||||
|
|
||||||
// Get data
|
// Get data
|
||||||
if( isset( $_POST['timezone'] ) ){
|
if( isset( $_POST['timezone'] ) ){
|
||||||
|
|
Loading…
Reference in New Issue