[Pkg-owncloud-commits] [owncloud] 374/394: backported session fix from pull request #1898 to stable 45 to fix #1049

David Prévot taffit at alioth.debian.org
Fri Nov 8 23:12:53 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v4.5.10
in repository owncloud.

commit 4968050d404acb4937f675e22757558f9d56a01c
Author: Bernhard Posselt <nukeawhale at gmail.com>
Date:   Thu Mar 7 11:28:36 2013 +0100

    backported session fix from pull request #1898 to stable 45 to fix #1049
---
 lib/base.php |   21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/lib/base.php b/lib/base.php
index e5da51e..9f39e82 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -271,7 +271,22 @@ class OC{
 		// set the session name to the instance id - which is unique
 		session_name(OC_Util::getInstanceId());
 
-		session_start();
+		// if session cant be started break with http 500 error
+		if (session_start() === false){
+			OC_Log::write('core', 'Session could not be initialized', 
+				OC_Log::ERROR);
+			
+			header('HTTP/1.1 500 Internal Server Error');
+			OC_Util::addStyle("styles");
+			$error = 'Session could not be initialized. Please contact your ';
+			$error .= 'system administrator';
+
+			$tmpl = new OC_Template('', 'error', 'guest');
+			$tmpl->assign('errors', array(1 => array('error' => $error)));
+			$tmpl->printPage();
+
+			exit();
+		}
 	}
 
 	public static function init() {
@@ -389,8 +404,8 @@ class OC{
 		OC_Hook::connect('OC_Filesystem', 'write', 'OC_Filesystem', 'isBlacklisted');
 		OC_Hook::connect('OC_Filesystem', 'rename', 'OC_Filesystem', 'isBlacklisted');
 
-		// register subadmin hooks
-		OC_Hook::connect('OC_User', 'post_deleteUser', 'OC_SubAdmin', 'post_deleteUser');
+		// register subadmin hooks
+		OC_Hook::connect('OC_User', 'post_deleteUser', 'OC_SubAdmin', 'post_deleteUser');
 		OC_Hook::connect('OC_User', 'post_deleteGroup', 'OC_SubAdmin', 'post_deleteGroup');
 		
 		//make sure temporary files are cleaned up

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list