Welcome to the nuBuilder Forums!

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

Changing SQL query of the Browse Form

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Janusz
nuBuilder Team
Posts: 506
Joined: Fri Dec 28, 2018 1:41 pm
Location: Krakow, Poland
Has thanked: 8 times
Been thanked: 18 times

Re: Changing SQL query of the Browse Form

Unread post by Janusz »

checking more the downloaded file by wget - it looks like that only html part of code is downloaded and php part not - so probably can be used directly without security risk - but not sure for that.

Maybe - can someone else share the opinion regarding security of code from the example from link above - I mean is the password in that file protected from being disclosed?
If you like nuBuilder, please leave a review on SourceForge
nc07
Posts: 118
Joined: Tue Jun 04, 2019 4:05 am
Has thanked: 5 times
Been thanked: 22 times

Re: Changing SQL query of the Browse Form

Unread post by nc07 »

Thanks Januz,

I have figured a way out, needs some testing, we'll see how it works.

regards
nc07
Janusz
nuBuilder Team
Posts: 506
Joined: Fri Dec 28, 2018 1:41 pm
Location: Krakow, Poland
Has thanked: 8 times
Been thanked: 18 times

Re: Changing SQL query of the Browse Form

Unread post by Janusz »

Hi,
If you need some data just for review only - so maybe you could use directly www page(s) - and protect them with the password(s). Then they will have access to data even without login into nuBuilder.
If you like nuBuilder, please leave a review on SourceForge
nc07
Posts: 118
Joined: Tue Jun 04, 2019 4:05 am
Has thanked: 5 times
Been thanked: 22 times

Re: Changing SQL query of the Browse Form

Unread post by nc07 »

Janusz wrote:Hi,
If you need some data just for review only - so maybe you could use directly www page(s) - and protect them with the password(s). Then they will have access to data even without login into nuBuilder.
Thanks Januz,

At the moment I would like them to access data through NuBuilder user but may be later we may consider other options.

regards
nc07
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Changing SQL query of the Browse Form

Unread post by admin »

nc07,

See if this makes sense.

It will allow any of 3 users.

Create a Table and Form...
man3.JPG
With these fields...
man2.JPG

Code: Select all


$s = "

CREATE TABLE #TABLE_ID#
SELECT * FROM storage

JOIN manager ON man_zzzzsys_user_id = sto_zzzzsys_user_id
JOIN access ON zzzzsys_access_id = man_zzzzsys_access_id

WHERE 'manager_id' = '#USER_ID#'
OR sto_zzzzsys_user_id = '#USER_ID#'
OR (sal_code = '#ACCESS_LEVEL_CODE#' AND man_zzzzsys_user_id = '#USER_ID#')

";
(I have invented a field I have called sto_zzzzsys_user_id in your storage table.)

WHERE 'manager_id' = '#USER_ID#' gets General Manager (hard coded User ID)
OR sto_zzzzsys_user_id = '#USER_ID#' gets User
OR (sal_code = '#ACCESS_LEVEL_CODE#' AND man_zzzzsys_user_id = '#USER_ID#') gets Manager


Steven
You do not have the required permissions to view the files attached to this post.
nc07
Posts: 118
Joined: Tue Jun 04, 2019 4:05 am
Has thanked: 5 times
Been thanked: 22 times

Re: Changing SQL query of the Browse Form

Unread post by nc07 »

Thanks, Steven for your guidance,

I will do trials and let you know of the outcome.

Best Regards
nc07
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Changing SQL query of the Browse Form

Unread post by admin »

ok
Post Reply