Page 1 of 1

Session hash variables in objects

Posted: Thu Oct 20, 2011 1:50 am
by Vladimir
When I try to use the session hash variables (#access_level#, #zzsys_user_id#, #session_id#) in SQL fields of several objects, nothing displays.
E.g. SELECT '#access_level#' -> nothing
When I log in as globeadmin, SELECT IF('#access_level#'='globeadmin',1,0) -> displays 0.
It is strange, because as described in Wiki http://wiki.nubuilder.com/tiki-index.ph ... uilderDocs, these variables must be available in objects...
Maybe anybody can explain this please?

Re: Session hash variables in objects

Posted: Thu Oct 20, 2011 3:35 pm
by zazzium
Check whether the php register_globals are turned on

Re: Session hash variables in objects

Posted: Thu Oct 20, 2011 4:42 pm
by Vladimir
[
zazzium wrote:Check whether the php register_globals are turned on
You are right, zazzium. But I cannot change it, because I use shared hosting. I solve the problem by replacing

Code: Select all

$ses = nuSession($GLOBALS[nuCookieName('security_check')]);
in replaceVariablesInString function (common.php) to:

Code: Select all

$ses = nuSession($_COOKIE[nuCookieName('security_check')]);
Thank you for reply.

Re: Session hash variables in objects

Posted: Mon Oct 31, 2011 10:41 pm
by admin
Vladimir,

We are trying to fix a couple of bugs related to this at the moment.

Steven

Re: Session hash variables in objects

Posted: Tue Nov 01, 2011 9:22 am
by Vladimir
Steven,

I suggest also to add following to replaceVariablesInString():

Code: Select all

$pString = str_replace("#ses#", $ses->zzsys_session_id, $pString);
$pString = str_replace("#session_id#", $ses->zzsys_session_id, $pString);
because #ses# and #session_id# does not initializing in objects of form.

Thank you.

Re: Session hash variables in objects

Posted: Fri Nov 04, 2011 1:32 am
by admin
Vladimir,

From version 11.11.03 you don't need globals on.

The next version will have these hash variables available for use..

#ses# ($ses->zzsys_session_id)
#session_id# ($ses->zzsys_session_id)
#session_parameter# ($ses->sss_parameter)
#access_level# ($ses->sss_access_level)
#zzsys_user_id# ($ses->sss_zzsys_user_id)
#zzsys_user_group_name# ($ses->sss_zzsys_user_group_name)
#small# ($ses->sss_small)
#clone# ($_GET['c'])
#dir# ($_GET['dir'])
#formID# ($_GET['f'])
#id# (id parameter)
#recordID# (id parameter)
#TT# (temp table name)
#browseTable# (temp table name)


Steven