Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/index.php b/index.php
index 46105a106fb..23bc4fb7764 100644
--- a/index.php
+++ b/index.php
@@ -48,8 +48,7 @@ elseif(OC_User::isLoggedIn()) {
exit();
}
else {
- header("Location: ".OC::$WEBROOT.'/'.OC_Appconfig::getValue("core", "defaultpage", "files/index.php"));
- exit();
+ OC_Util::redirectToDefaultPage();
}
}
@@ -61,7 +60,7 @@ elseif(isset($_COOKIE["oc_remember_login"]) && $_COOKIE["oc_remember_login"]) {
if(OC_User::userExists($_COOKIE['oc_username']) &&
OC_Preferences::getValue($_COOKIE['oc_username'], "login", "token") == $_COOKIE['oc_token']) {
OC_User::setUserId($_COOKIE['oc_username']);
- header("Location: ". OC::$WEBROOT.'/'.OC_Appconfig::getValue("core", "defaultpage", "files/index.php"));
+ OC_Util::redirectToDefaultPage();
}
else {
OC_Template::printGuestPage("", "login", array("error" => true));
@@ -72,7 +71,6 @@ elseif(isset($_COOKIE["oc_remember_login"]) && $_COOKIE["oc_remember_login"]) {
elseif(isset($_POST["user"]) && isset($_POST['password'])) {
OC_App::loadApps();
if(OC_User::login($_POST["user"], $_POST["password"])) {
- header("Location: ".OC::$WEBROOT.'/'.OC_Appconfig::getValue("core", "defaultpage", "files/index.php"));
if(!empty($_POST["remember_login"])){
error_log("Setting remember login to cookie");
$token = md5($_POST["user"].time());
@@ -82,7 +80,7 @@ elseif(isset($_POST["user"]) && isset($_POST['password'])) {
else {
OC_User::unsetMagicInCookie();
}
- exit();
+ OC_Util::redirectToDefaultPage();
}
else {
if(isset($_COOKIE["oc_username"])){