diff options
author | Jakob Sack <kde@jakobsack.de> | 2011-04-16 12:18:42 +0200 |
---|---|---|
committer | Jakob Sack <kde@jakobsack.de> | 2011-04-16 12:18:42 +0200 |
commit | 8465f76e7e1aa5512d62905cc60a10f0fe3f0e02 (patch) | |
tree | f1eeb87ca8d680f285eb2065eb17da12e3745a20 /index.php | |
parent | 77fe7240f08a8461a5e8910bd3f732508b0f91e7 (diff) | |
download | nextcloud-server-8465f76e7e1aa5512d62905cc60a10f0fe3f0e02.tar.gz nextcloud-server-8465f76e7e1aa5512d62905cc60a10f0fe3f0e02.zip |
Use OC_CONFIG where possible
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/index.php b/index.php index 62a515fa20f..2f56510bfbb 100644 --- a/index.php +++ b/index.php @@ -24,29 +24,31 @@ require_once( 'lib/base.php' ); require_once( 'appconfig.php' ); require_once( 'template.php' ); +var_dump( $_SESSION ); +//exit; if( OC_USER::isLoggedIn()){ - if( $_GET["logout"] ){ - OC_USER::logout(); - OC_TEMPLATE::printGuestPage( "", "logout" ); - } - else{ - header( "Location: ".OC_APPCONFIG::getValue( "core", "defaultpage", "files/index.php" )); - exit(); - } + if( $_GET["logout"] ){ + OC_USER::logout(); + OC_TEMPLATE::printGuestPage( "", "logout" ); + } + else{ + header( "Location: ".OC_APPCONFIG::getValue( "core", "defaultpage", "files/index.php" )); + exit(); + } } else{ - if( OC_USER::login( $_POST["user"], $_POST["password"] )){ - header( "Location: ".OC_APPCONFIG::getValue( "core", "defaultpage", "files/index.php" )); - exit(); - } - else{ - $error = false; - // Say "bad login" in case the user wanted to login - if( $_POST["user"] && $_POST["password"] ){ - $error = true; - } - OC_TEMPLATE::printGuestPage( "", "login", array( "error" => $error )); - } + if( OC_USER::login( $_POST["user"], $_POST["password"] )){ + header( "Location: ".OC_APPCONFIG::getValue( "core", "defaultpage", "files/index.php" )); + exit(); + } + else{ + $error = false; + // Say "bad login" in case the user wanted to login + if( $_POST["user"] && $_POST["password"] ){ + $error = true; + } + OC_TEMPLATE::printGuestPage( "", "login", array( "error" => $error )); + } } ?> |