summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/base.php b/lib/base.php
index 8a095cbbb61..0e98cbf38e6 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -246,6 +246,8 @@ class OC{
OC_Util::addScript( "jquery-tipsy" );
OC_Util::addScript( "oc-dialogs" );
OC_Util::addScript( "js" );
+ // request protection token MUST be defined after the jquery library but before any $('document').ready()
+ OC_Util::addScript( "requesttoken" );
OC_Util::addScript( "eventsource" );
OC_Util::addScript( "config" );
//OC_Util::addScript( "multiselect" );
@@ -532,11 +534,7 @@ class OC{
}
protected static function tryFormLogin() {
- if(!isset($_POST["user"])
- || !isset($_POST['password'])
- || !isset($_SESSION['sectoken'])
- || !isset($_POST['sectoken'])
- || ($_SESSION['sectoken']!=$_POST['sectoken']) ) {
+ if(!isset($_POST["user"]) || !isset($_POST['password'])) {
return false;
}
@@ -557,7 +555,8 @@ class OC{
else {
OC_User::unsetMagicInCookie();
}
- OC_Util::redirectToDefaultPage();
+ header( 'Location: '.$_SERVER['REQUEST_URI'] );
+ exit();
}
return true;
}