Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

#USER_ID# for non globeadmin?

Questions related to using nuBuilder Forte.
Post Reply
miasoft
Posts: 156
Joined: Wed Dec 23, 2020 12:28 pm
Location: Russia, Volgograd
Has thanked: 32 times
Been thanked: 7 times
Contact:

#USER_ID# for non globeadmin?

Unread post by miasoft »

I see
[USER_ID] => globeadmin
if I login as globeadmin.
But what will be the value of [USER_ID] for non admin account?
How can I run nuDebug() in user mode?
Wbr, miasoft.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: #USER_ID# for non globeadmin?

Unread post by kev1n »

Hi,

Could you describe a bit what you want to do exactly?
nac
Posts: 115
Joined: Tue Dec 12, 2017 11:28 pm
Location: Aberdeen, UK
Has thanked: 9 times
Been thanked: 12 times

Re: #USER_ID# for non globeadmin?

Unread post by nac »

Hello miasoft,

It would be unusual to provide access to the debug records to any user other than the developer (globeadmin). As kev1n says, it would be helpful to know what you have in mind.

If you just want to examine debug records whilst accessing the application as a user (rather than as globeadmin) then all you need to do is have two browsers open. In one of them, open the nuBuilder application as globeadmin and in the other, login with the user account. That way you can see the debug records generated by the user account.

You can put nuDebug(nuHash()); in the BE PHP of the 'home' form and that will show you the user_id of the logged in user, for that session as well as other information.

Neil
miasoft
Posts: 156
Joined: Wed Dec 23, 2020 12:28 pm
Location: Russia, Volgograd
Has thanked: 32 times
Been thanked: 7 times
Contact:

Re: #USER_ID# for non globeadmin?

Unread post by miasoft »

kev1n wrote:Hi,
Could you describe a bit what you want to do exactly?
I have SQL-qwr for Browse:
SELECT mtabel.* FROM mtabel
where
manager_id='#USER_ID#'
and some records with manager_id='globeadmin'
ans some records with manager_id='man1'
If my login is "globeadmin" I get right records. But if login is "man1" I have no records.
I can't test value #USER_ID# under login "man1" :(
Wbr, miasoft.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: #USER_ID# for non globeadmin?

Unread post by kev1n »

#USER_ID# contains the primary key (zzzzsys_user_id) of the table zzzzsys_user and not the login name.

If manager_id contains the login name, you need a join with the zzzzsys_user table.

The SQL is then going to look something like this:

Code: Select all

SELECT mtabel.* FROM mtabel
LEFT JOIN zzzzsys_user ON sus_login_name = manager_id
WHERE zzzzsys_user_id  = '#USER_ID#'
miasoft
Posts: 156
Joined: Wed Dec 23, 2020 12:28 pm
Location: Russia, Volgograd
Has thanked: 32 times
Been thanked: 7 times
Contact:

Re: #USER_ID# for non globeadmin?

Unread post by miasoft »

Very strange, maybe I misunderstood something
12.01_1.png
You do not have the required permissions to view the files attached to this post.
Wbr, miasoft.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: #USER_ID# for non globeadmin?

Unread post by kev1n »

For a user, #USER_ID# contains the primary key (zzzzsys_user_id) of the zzzzsys_user table.

E.g:

Code: Select all

[0] : Array
(
    [USER_ID] => 5fe2cef8cdb0cf0
    [USER_GROUP_ID] => 5fe2ceed176ce09
    [HOME_ID] => nuhome
    [GLOBAL_ACCESS] => 0
    [ACCESS_LEVEL_CODE] => test

)

apmuthu
Posts: 249
Joined: Sun Dec 06, 2020 6:50 am
Location: Chennai, India, Singapore

Re: #USER_ID# for non globeadmin?

Unread post by apmuthu »

Since the said user table also has sus_name and sus_login_name fileds they can be available in the array stated for use as:

Code: Select all

#USER_NAME#
#USER_LOGIN_NAME#
miasoft
Posts: 156
Joined: Wed Dec 23, 2020 12:28 pm
Location: Russia, Volgograd
Has thanked: 32 times
Been thanked: 7 times
Contact:

Re: #USER_ID# for non globeadmin?

Unread post by miasoft »

Thanks a lot for helping with #USER_ID# and SQL source! Now everything works perfectly!
kev1n wrote:#USER_ID# contains the primary key (zzzzsys_user_id) of the table
zzzzsys_user and not the login name.
If manager_id contains the login name, you need a join with the zzzzsys_user table.
The SQL is then going to look something like this:

Code: Select all

SELECT mtabel.* FROM mtabel
LEFT JOIN zzzzsys_user ON sus_login_name = manager_id
WHERE zzzzsys_user_id  = '#USER_ID#'
Wbr, miasoft.
Post Reply