From 8465f76e7e1aa5512d62905cc60a10f0fe3f0e02 Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Sat, 16 Apr 2011 12:18:42 +0200 Subject: Use OC_CONFIG where possible --- index.php | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'index.php') 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 )); + } } ?> -- cgit v1.2.3