Skip to content
Snippets Groups Projects
Commit 777eb1d8 authored by Lukas Reschke's avatar Lukas Reschke
Browse files

CSRF check in the settings

parent ec7bb86b
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,8 @@ $oldPassword=isset($_POST["oldpassword"])?$_POST["oldpassword"]:'';
// Check if we are a user
OC_JSON::checkLoggedIn();
OCP\JSON::callCheck();
if( (!OC_Group::inGroup( OC_User::getUser(), 'admin' ) && ($username!=OC_User::getUser() || !OC_User::checkPassword($username,$oldPassword)))) {
OC_JSON::error( array( "data" => array( "message" => "Authentication error" )));
exit();
......
......@@ -9,6 +9,8 @@ if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' ))
exit();
}
OCP\JSON::callCheck();
$groupname = $_POST["groupname"];
// Does the group exist?
......
......@@ -8,6 +8,7 @@ if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' ))
OC_JSON::error(array("data" => array( "message" => "Authentication error" )));
exit();
}
OCP\JSON::callCheck();
$groups = array();
if( isset( $_POST["groups"] )){
......
......@@ -2,6 +2,7 @@
// Init owncloud
require_once('../../lib/base.php');
OC_JSON::checkAdminUser();
OCP\JSON::callCheck();
OC_JSON::setContentTypeHeader();
OC_App::disable($_POST['appid']);
......
......@@ -3,6 +3,7 @@
// Init owncloud
require_once('../../lib/base.php');
OC_JSON::checkAdminUser();
OCP\JSON::callCheck();
OC_JSON::setContentTypeHeader();
if(OC_App::enable($_POST['appid'])){
......
......@@ -2,8 +2,8 @@
// Init owncloud
require_once('../../lib/base.php');
OC_JSON::checkLoggedIn();
OCP\JSON::callCheck();
$l=OC_L10N::get('core');
......
......@@ -6,6 +6,7 @@ require_once('../../lib/base.php');
$l=OC_L10N::get('settings');
OC_JSON::checkLoggedIn();
OCP\JSON::callCheck();
OC_JSON::checkAppEnabled('user_openid');
// Get data
......
......@@ -4,6 +4,7 @@
require_once('../../lib/base.php');
OC_JSON::checkAdminUser();
OCP\JSON::callCheck();
$name = $_POST["groupname"];
......
......@@ -4,6 +4,7 @@
require_once('../../lib/base.php');
OC_JSON::checkAdminUser();
OCP\JSON::callCheck();
$username = $_POST["username"];
......
......@@ -6,6 +6,7 @@ require_once('../../lib/base.php');
$l=OC_L10N::get('settings');
OC_JSON::checkLoggedIn();
OCP\JSON::callCheck();
// Get data
......
......@@ -7,6 +7,7 @@
require_once('../../lib/base.php');
OC_Util::checkAdminUser();
OCP\JSON::callCheck();
OC_Config::setValue( 'loglevel', $_POST['level'] );
......
......@@ -9,6 +9,7 @@
require_once('../../lib/base.php');
OC_JSON::checkAdminUser();
OCP\JSON::callCheck();
$username = isset($_POST["username"])?$_POST["username"]:'';
......
......@@ -4,6 +4,7 @@
require_once('../../lib/base.php');
OC_JSON::checkAdminUser();
OCP\JSON::callCheck();
$success = true;
$error = "add user to";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment