mirror of
https://github.com/e107inc/e107.git
synced 2025-07-25 00:41:52 +02:00
Issue #5476 Emulation tweaks.
This commit is contained in:
34
class2.php
34
class2.php
@@ -549,6 +549,8 @@ if(!isset($_E107['no_session']) && !isset($_E107['no_lan']))
|
|||||||
|
|
||||||
define('USERCLASS_LIST', $emulatedUser['user_class']);
|
define('USERCLASS_LIST', $emulatedUser['user_class']);
|
||||||
define('ADMINPERMS', $emulatedUser['user_perms']);
|
define('ADMINPERMS', $emulatedUser['user_perms']);
|
||||||
|
define('USERID', $emulatedUser['user_id']);
|
||||||
|
define('USERNAME', $emulatedUser['user_name']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1649,10 +1651,15 @@ function init_session()
|
|||||||
}
|
}
|
||||||
|
|
||||||
e107::getDebug()->logTime('[init_session: Constants]');
|
e107::getDebug()->logTime('[init_session: Constants]');
|
||||||
|
|
||||||
|
|
||||||
define('ADMIN', $user->isAdmin());
|
define('ADMIN', $user->isAdmin());
|
||||||
define('ADMINID', $user->getAdminId());
|
define('ADMINID', $user->getAdminId());
|
||||||
define('ADMINNAME', $user->getAdminName());
|
define('ADMINNAME', $user->getAdminName());
|
||||||
define('ADMINPERMS', $user->getAdminPerms());
|
if(!defined('ADMINPERMS'))
|
||||||
|
{
|
||||||
|
define('ADMINPERMS', $user->getAdminPerms());
|
||||||
|
}
|
||||||
define('ADMINEMAIL', $user->getAdminEmail());
|
define('ADMINEMAIL', $user->getAdminEmail());
|
||||||
define('ADMINPWCHANGE', $user->getAdminPwchange());
|
define('ADMINPWCHANGE', $user->getAdminPwchange());
|
||||||
|
|
||||||
@@ -1676,8 +1683,16 @@ function init_session()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// we shouldn't use getValue() here, it's there for e.g. shortcodes, profile page render etc.
|
// we shouldn't use getValue() here, it's there for e.g. shortcodes, profile page render etc.
|
||||||
define('USERID', $user->getId());
|
if(!defined('USERID'))
|
||||||
define('USERNAME', $user->get('user_name'));
|
{
|
||||||
|
define('USERID', $user->getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!defined('USERNAME'))
|
||||||
|
{
|
||||||
|
define('USERNAME', $user->get('user_name'));
|
||||||
|
}
|
||||||
|
|
||||||
define('USERURL', $user->get('user_homepage', false)); //required for BC
|
define('USERURL', $user->get('user_homepage', false)); //required for BC
|
||||||
define('USEREMAIL', $user->get('user_email'));
|
define('USEREMAIL', $user->get('user_email'));
|
||||||
define('USER', true);
|
define('USER', true);
|
||||||
@@ -1753,7 +1768,10 @@ function init_session()
|
|||||||
}
|
}
|
||||||
|
|
||||||
e107::getDebug()->logTime('[init_session: getClassList]');
|
e107::getDebug()->logTime('[init_session: getClassList]');
|
||||||
define('USERCLASS_LIST', $user->getClassList(true));
|
if(!defined('USERCLASS_LIST'))
|
||||||
|
{
|
||||||
|
define('USERCLASS_LIST', $user->getClassList(true));
|
||||||
|
}
|
||||||
define('e_CLASS_REGEXP', $user->getClassRegex());
|
define('e_CLASS_REGEXP', $user->getClassRegex());
|
||||||
define('e_NOBODY_REGEXP', '(^|,)'.e_UC_NOBODY.'(,|$)');
|
define('e_NOBODY_REGEXP', '(^|,)'.e_UC_NOBODY.'(,|$)');
|
||||||
|
|
||||||
@@ -1813,7 +1831,7 @@ function cookie($name, $value, $expire=0, $path = e_HTTP, $domain = '', $secure
|
|||||||
|
|
||||||
if(!empty($_E107['cli']))
|
if(!empty($_E107['cli']))
|
||||||
{
|
{
|
||||||
return null;
|
return;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
if(!e_SUBDOMAIN || (defined('MULTILANG_SUBDOMAIN') && MULTILANG_SUBDOMAIN === true))
|
if(!e_SUBDOMAIN || (defined('MULTILANG_SUBDOMAIN') && MULTILANG_SUBDOMAIN === true))
|
||||||
@@ -2112,7 +2130,7 @@ class error_handler
|
|||||||
* @param $file
|
* @param $file
|
||||||
* @param $line
|
* @param $line
|
||||||
* @param $context (deprecated since PHP 7.2.0)
|
* @param $context (deprecated since PHP 7.2.0)
|
||||||
* @return bool
|
* @return bool|void
|
||||||
*/
|
*/
|
||||||
function handle_error($type, $message, $file, $line, $context = null) {
|
function handle_error($type, $message, $file, $line, $context = null) {
|
||||||
$startup_error = (!defined('E107_DEBUG_LEVEL')); // Error before debug system initialized
|
$startup_error = (!defined('E107_DEBUG_LEVEL')); // Error before debug system initialized
|
||||||
@@ -2144,7 +2162,7 @@ class error_handler
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case E_USER_ERROR:
|
case E_USER_ERROR:
|
||||||
if ($this->debug == true)
|
if ($this->debug === true)
|
||||||
{
|
{
|
||||||
$error['short'] = " Internal Error Message: {$message}, Line <mark>{$line}</mark> of {$file}<br />\n";
|
$error['short'] = " Internal Error Message: {$message}, Line <mark>{$line}</mark> of {$file}<br />\n";
|
||||||
$trace = debug_backtrace();
|
$trace = debug_backtrace();
|
||||||
@@ -2160,7 +2178,7 @@ class error_handler
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user