Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Session hash variables in objects

Post Reply
Vladimir
Posts: 8
Joined: Wed Sep 28, 2011 2:11 pm
Location: Russia

Session hash variables in objects

Unread post 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?
zazzium
Posts: 84
Joined: Mon Jul 04, 2011 12:52 am

Re: Session hash variables in objects

Unread post by zazzium »

Check whether the php register_globals are turned on
Vladimir
Posts: 8
Joined: Wed Sep 28, 2011 2:11 pm
Location: Russia

Re: Session hash variables in objects

Unread post 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.
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Session hash variables in objects

Unread post by admin »

Vladimir,

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

Steven
Vladimir
Posts: 8
Joined: Wed Sep 28, 2011 2:11 pm
Location: Russia

Re: Session hash variables in objects

Unread post 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.
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Session hash variables in objects

Unread post 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
Post Reply