Commit da5e7a02 authored by tbrehm's avatar tbrehm
Browse files

Fixed a problem in the session initialization

parent c2831504
......@@ -53,15 +53,15 @@ class app {
$this->load('db_'.$this->_conf['db_type']);
$this->db = new db;
}
if($this->_conf['start_session'] == true) {
//* Start the session
if($conf["start_session"] == true) {
session_start();
//* Initialise vars if session is not set
if( !isset($_SESSION['s']['id']) ){
$_SESSION['s'] = array( 'id' => session_id(),
'theme' => $this->_conf['theme'],
'language' => $this->_conf['language']
);
}
//* Initialize session variables
if(!isset($_SESSION['s']['id']) ) $_SESSION["s"]['id'] = session_id();
if(empty($_SESSION["s"]["theme"])) $_SESSION["s"]['theme'] = $conf['theme'];
if(empty($_SESSION["s"]["language"])) $_SESSION["s"]['language'] = $conf['language'];
}
}
......
......@@ -27,7 +27,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
error_reporting(E_ALL|E_STRICT);
error_reporting(E_ALL|E_NOTICE);
header('Pragma: no-cache');
header('Cache-Control: no-store, no-cache, max-age=0, must-revalidate');
......
......@@ -61,7 +61,7 @@ function submitLoginForm(formname) {
var userNameObj = frm.username;
if(userNameObj.value == ''){
userNameObj.focus();
return;q
return;
}
var passwordObj = frm.passwort;
if(passwordObj.value == ''){
......
......@@ -36,11 +36,12 @@ public $status = '';
private $target = '';
public function render() {
if(isset($_SESSION['s']['user']) && is_array($_SESSION['s']['user']) && is_array($_SESSION['s']['module'])) {
die('HEADER_REDIRECT:'.$_SESSION['s']['module']['startpage']);
}
global $app;
global $app, $conf;
$app->uses('tpl');
$app->tpl->newTemplate('form.tpl.htm');
......@@ -64,14 +65,14 @@ public function render() {
$_SESSION['s']['user'] = $user;
$_SESSION['s']['user']['theme'] = isset($user['app_theme']) ? $user['app_theme'] : 'default';
$_SESSION['s']['language'] = $user['language'];
//print_r($_SESSION);
$_SESSION["s"]['theme'] = $_SESSION['s']['user']['theme'];
if(is_file($_SESSION['s']['user']['startmodule'].'/lib/module.conf.php')) {
include_once($_SESSION['s']['user']['startmodule'].'/lib/module.conf.php');
$_SESSION['s']['module'] = $module;
}
echo 'HEADER_REDIRECT:'.$_SESSION['s']['module']['startpage'];
//echo 'HEADER_REDIRECT:content.php?s_mod=admin&s_pg=index';
exit;
} else {
$error = $app->lng(1003);
......
......@@ -12,8 +12,9 @@ $list_def_file = "list/mail_domain.list.php";
* End Form configuration
******************************************/
// Checking module permissions
if(!stristr($_SESSION["s"]["user"]["modules"],$_SESSION["s"]["module"]["name"])) {
if(!stristr($_SESSION["s"]["user"]["modules"],'mail')) {
header("Location: ../index.php");
exit;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment