From 11d515ef4ec2ad1211b6873c04ce8acb6ca3bcaa Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind1991@gmail.com>
Date: Tue, 6 Jul 2010 10:30:08 +0200
Subject: [PATCH] Fix page not refreshing after login

---
 inc/lib_log.php  |  1 -
 inc/lib_user.php | 10 +++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/inc/lib_log.php b/inc/lib_log.php
index 3e0d3d1609..1244a44a93 100755
--- a/inc/lib_log.php
+++ b/inc/lib_log.php
@@ -49,7 +49,6 @@ class OC_LOG {
    */
   public static function event($user,$type,$message){
     $result = OC_DB::query('insert into log (timestamp,user,type,message) values ("'.time().'","'.addslashes($user).'","'.addslashes($type).'","'.addslashes($message).'")');
-    OC_DB::free_result($result);
   }
 
 
diff --git a/inc/lib_user.php b/inc/lib_user.php
index e5d994dd02..7a75e02ece 100755
--- a/inc/lib_user.php
+++ b/inc/lib_user.php
@@ -40,8 +40,16 @@ class OC_USER {
 	public static function loginlisener(){
 		if(isset($_POST['loginbutton']) and isset($_POST['password']) and isset($_POST['login'])){
 			if(OC_USER::login($_POST['login'],$_POST['password'])){
+				echo 1;
 				OC_LOG::event($_SESSION['username'],1,'');
-				return('');
+				echo 2;
+				if((isset($CONFIG_HTTPFORCESSL) and $CONFIG_HTTPFORCESSL) or isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on') { 
+					$url = "https://". $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; 
+				}else{
+					$url = "http://". $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; 
+				}
+				header("Location: $url");
+				die();
 			}else{
 				return('error');
 			} 
-- 
GitLab