Skip to content

Commit da5e7a0

Browse files
committed
Fixed a problem in the session initialization
1 parent c283150 commit da5e7a0

File tree

5 files changed

+17
-15
lines changed

5 files changed

+17
-15
lines changed

interface/lib/app.inc.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ public function __construct()
5353
$this->load('db_'.$this->_conf['db_type']);
5454
$this->db = new db;
5555
}
56-
if($this->_conf['start_session'] == true) {
56+
57+
//* Start the session
58+
if($conf["start_session"] == true) {
5759
session_start();
58-
//* Initialise vars if session is not set
59-
if( !isset($_SESSION['s']['id']) ){
60-
$_SESSION['s'] = array( 'id' => session_id(),
61-
'theme' => $this->_conf['theme'],
62-
'language' => $this->_conf['language']
63-
);
64-
}
60+
61+
//* Initialize session variables
62+
if(!isset($_SESSION['s']['id']) ) $_SESSION["s"]['id'] = session_id();
63+
if(empty($_SESSION["s"]["theme"])) $_SESSION["s"]['theme'] = $conf['theme'];
64+
if(empty($_SESSION["s"]["language"])) $_SESSION["s"]['language'] = $conf['language'];
6565
}
6666
}
6767

interface/lib/config.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
*/
2929

30-
error_reporting(E_ALL|E_STRICT);
30+
error_reporting(E_ALL|E_NOTICE);
3131

3232
header('Pragma: no-cache');
3333
header('Cache-Control: no-store, no-cache, max-age=0, must-revalidate');

interface/web/js/scrigo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function submitLoginForm(formname) {
6161
var userNameObj = frm.username;
6262
if(userNameObj.value == ''){
6363
userNameObj.focus();
64-
return;q
64+
return;
6565
}
6666
var passwordObj = frm.passwort;
6767
if(passwordObj.value == ''){

interface/web/login/index.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ class login_index {
3636
private $target = '';
3737

3838
public function render() {
39+
3940
if(isset($_SESSION['s']['user']) && is_array($_SESSION['s']['user']) && is_array($_SESSION['s']['module'])) {
4041
die('HEADER_REDIRECT:'.$_SESSION['s']['module']['startpage']);
4142
}
4243

43-
global $app;
44+
global $app, $conf;
4445
$app->uses('tpl');
4546
$app->tpl->newTemplate('form.tpl.htm');
4647

@@ -64,14 +65,14 @@ public function render() {
6465
$_SESSION['s']['user'] = $user;
6566
$_SESSION['s']['user']['theme'] = isset($user['app_theme']) ? $user['app_theme'] : 'default';
6667
$_SESSION['s']['language'] = $user['language'];
67-
//print_r($_SESSION);
68+
$_SESSION["s"]['theme'] = $_SESSION['s']['user']['theme'];
69+
6870
if(is_file($_SESSION['s']['user']['startmodule'].'/lib/module.conf.php')) {
6971
include_once($_SESSION['s']['user']['startmodule'].'/lib/module.conf.php');
7072
$_SESSION['s']['module'] = $module;
7173
}
72-
7374
echo 'HEADER_REDIRECT:'.$_SESSION['s']['module']['startpage'];
74-
//echo 'HEADER_REDIRECT:content.php?s_mod=admin&s_pg=index';
75+
7576
exit;
7677
} else {
7778
$error = $app->lng(1003);

interface/web/mail/mail_domain_list.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
* End Form configuration
1313
******************************************/
1414

15+
1516
// Checking module permissions
16-
if(!stristr($_SESSION["s"]["user"]["modules"],$_SESSION["s"]["module"]["name"])) {
17+
if(!stristr($_SESSION["s"]["user"]["modules"],'mail')) {
1718
header("Location: ../index.php");
1819
exit;
1920
}

0 commit comments

Comments
 (0)