edit_base.inc/edit_order.php:
change the order of the includes and change them to require. move session start away and only set session name as the session is no started automatically. set_paths.inc: missing form set detection, auto create picture cache root folder if it does not exist Class.Login.inc set new acl var show_ea_extra. Is set to 1 if the user has more than one edit access group
This commit is contained in:
@@ -42,13 +42,14 @@
|
||||
$ECHO_ALL = 0;
|
||||
// $DEBUG_TMPL = 0;
|
||||
}
|
||||
include(LIBS."Class.Form.Generate.inc");
|
||||
include(LIBS."Class.Login.inc");
|
||||
// set session name here
|
||||
define('SET_SESSION_NAME', EDIT_SESSION_NAME);
|
||||
// login class
|
||||
require(LIBS."Class.Login.inc");
|
||||
// form generate for edit interface
|
||||
require(LIBS."Class.Form.Generate.inc");
|
||||
// Smarty: and the small extend for l10n calls
|
||||
require(LIBS.'Class.Smarty.Extend.inc');
|
||||
// start session here
|
||||
session_name(EDIT_SESSION_NAME);
|
||||
session_start();
|
||||
|
||||
// set default lang if not set otherwise
|
||||
if (!$lang)
|
||||
|
||||
@@ -31,12 +31,11 @@
|
||||
$ECHO_ALL = 0;
|
||||
// $DEBUG_TMPL = 0;
|
||||
}
|
||||
include(LIBS."Class.DB.IO.inc");
|
||||
include(LIBS."Class.Login.inc");
|
||||
// set session name
|
||||
define('SET_SESSION_NAME', EDIT_SESSION_NAME);
|
||||
require(LIBS."Class.Login.inc");
|
||||
require(LIBS."Class.DB.IO.inc");
|
||||
require(LIBS.'Class.Smarty.Extend.inc');
|
||||
// start session here
|
||||
session_name(EDIT_SESSION_NAME);
|
||||
session_start();
|
||||
|
||||
// default lang
|
||||
if (!$lang)
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
$TEMPLATE = DEFAULT_TEMPLATE;
|
||||
$TEMPLATE_DIR = $TEMPLATE.'/';
|
||||
// master template
|
||||
$MASTER_TEMPLATE_NAME = '';
|
||||
if (!$MASTER_TEMPLATE_NAME)
|
||||
$MASTER_TEMPLATE_NAME = MASTER_TEMPLATE_NAME;
|
||||
|
||||
@@ -40,7 +41,7 @@
|
||||
|
||||
// set include & template names
|
||||
$CONTENT_INCLUDE = str_replace(".php", ".tpl", $cms->page_name);
|
||||
$FORM_NAME = str_replace(".php", "", $cms->page_name);
|
||||
$FORM_NAME = !$FORM_NAME ? str_replace(".php", "", $cms->page_name) : $FORM_NAME;
|
||||
// strip tpl and replace it with inc
|
||||
// php include file per page
|
||||
$cms->INC_TEMPLATE_NAME = str_replace(".tpl", ".inc", $CONTENT_INCLUDE);
|
||||
@@ -62,6 +63,8 @@
|
||||
$cms->pictures = LAYOUT.$TEMPLATE_DIR.IMAGES."/";
|
||||
$cms->cache_pictures = LAYOUT.$TEMPLATE_DIR.CACHE.IMAGES.'/';
|
||||
$cms->cache_pictures_root = ROOT.$cms->cache_pictures;
|
||||
if (!is_dir($cms->cache_pictures_root))
|
||||
mkdir($cms->cache_pictures_root);
|
||||
$template_set = $TEMPLATE;
|
||||
|
||||
// if we don't find the master template, set the template path back AND set the insert template as absolute path
|
||||
@@ -107,7 +110,7 @@
|
||||
$smarty->l10n->l10nReloadMOfile($lang, $cms->lang_dir);
|
||||
}
|
||||
|
||||
$cms->debug("LANGUAGE", "L: $lang | ".$cms->lang_dir." | MO File: ".$cms->l->mofile);
|
||||
// $cms->debug("LANGUAGE", "L: $lang | ".$cms->lang_dir." | MO File: ".$cms->l->mofile);
|
||||
$cms->debug("LANGUAGE", "SL: ".$_SESSION['DEFAULT_CHARSET']." | ".$_SESSION['LANG']." | ".$_SESSION['DEFAULT_LANG']);
|
||||
$cms->debug("TEMPLATE", "P: ".$smarty->getTemplateDir()[0]);
|
||||
|
||||
|
||||
@@ -516,7 +516,7 @@
|
||||
if (!$this->acl['info']['admin'])
|
||||
{
|
||||
// this is the base if nothing is set
|
||||
$this->acl['acl']['user'] = DEFAULT_ACL_LEVEL;
|
||||
$this->acl['acl']['user'] = DEFAULT_ACL_LEVEL; // old base ACL
|
||||
$this->acl['acl']['max'] = DEFAULT_ACL_LEVEL;
|
||||
// group ACL 0
|
||||
if ($_SESSION['GROUP_ACL_LEVEL'] != -1)
|
||||
@@ -566,6 +566,11 @@
|
||||
$this->acl['acl']['edit_access'][$unit['id']] = !$this->acl['info']['admin'] ? ($unit['acl_level'] != -1 ? $unit['acl_level'] : $this->acl['acl']['page']) : 100;
|
||||
$this->acl['info']['edit_access'][$unit['id']] = $unit['name'];
|
||||
}
|
||||
// flag if to show extra edit access drop downs (because user has multiple groups assigned)
|
||||
if (count($_SESSION['UNIT'] > 1))
|
||||
$this->acl['acl']['show_ea_extra'] = 1;
|
||||
else
|
||||
$this->acl['acl']['show_ea_extra'] = 0;
|
||||
// set the default edit access
|
||||
$this->acl['info']['default_edit_access'] = $_SESSION['UNIT_DEFAULT'];
|
||||
// integrate the default_acl list, but only for the keyword -> level
|
||||
|
||||
Reference in New Issue
Block a user