Request for the list of the global variable available in Dadabik.

  • Thread starter Deleted member 75341
  • Start date
D

Deleted member 75341

Guest
Hello Mr. Tacchini,
Is possible to have the list/index of the global variable available in dadabik?
Thanks in advance.
 

eugenio

Administrator
Staff member
Hello,
there isn't any official list, some variables typically used in custom code are:

- $conn (the db connection)
- $quote (the quote to use, according to your DBMS)
- $current_user and $current_group (they contain the username and the group ID of the user currently logged; in case authentication is disabled, the two variables will be set as "nobody")
- all the variables in config.php

Best,
 

D

New member
I have a custom function for row level filtering Right now, it functions very well. Every user except admin is filtered perfectly. I need to filter based on a secondary group called Masters. I have several companies that I am trying to keep separate, but each company needs the same basic functionality. Each company has multiple admins. I made a secondary group called master. Since master has permissions to nothing it allows me to keep all these admins in a group where they cannot see accross the other companies. Problem is I can't figure out how to get the row filter to work with a secondary group. I am hoping you have another global variable to handle this, or another idea.

$custom_filters['Tickets']='dadabik_custom_filter_tickets';
function dadabik_custom_filter_tickets()
{
global $current_id_user, $current_id_group, $ids_group_others;

if ($current_id_group !=1){ /* This is where I need to compare the secondary group masters which is group id 31 and not allow it in the filter.*/

$filter="Tickets.id_user='".$current_id_user."'";

}
else{
$filter="1=1";
}

return $filter;

I tried $ids_group_others, but in reality since there can be many secondary groups, I would assume that there would be some type of an array associated with this. Any ideas on how I should approach this?

Thanks

Your current DaDaBIK version​

You are using DaDaBIK version 11.8-Elba enterprise, installed on 12-09-2022 (installation code: 18442637ee4274312a), the latest version of DaDaBIK is 11.8-Elba released on 12-05-2022

You are running the latest release of DaDaBIK

In case you want to upgrade to a more powerful edition (from Pro to Enterprise/Platinum, from Enterprise to Platinum) please contact us.

System info​

PHP Version: 7.4.33

sqlserver version: 16.00.0900

Web server: Microsoft-IIS/10.0

Client: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.54

URL installation: https://smallbizpc.com/program_files/
 

eugenio

Administrator
Staff member
$ids_group_others is not a global variable. For the current logged in user, you can find the additional groups in
$_SESSION['logged_user_infos_ar']['ids_group_others']
and the groups by default are separated with ~, e.g.
~3~2~
for group 3 + 2

best,
 
Top