Contents

 
Home
PHPRunner 6.1 manual
Prev Page Next Page
 
 

PHPRunner session variables

 

To print the current state of all session variables from the event use the following:

print_r ($_SESSION);

yellowbulbNote: <table name> in the variable name should be replaced with the actual table name i.e. $_SESSION["<table name>_SelectedSQL"] becomes $_SESSION["Cars_SelectedSQL"].

Variable name

Description

$_SESSION["UserID"]

Logged user ID.

$_SESSION["GroupID"]

GroupID that user belongs to. Populated if User Group Security turned on (used for static permissions only).

$_SESSION["UserRights"]["<table name>"]

User permissions for selected table (used for dynamic permissions).

To get the value of this variable use special function GetUserPermissions("<table name>") that returns set of permissions for current user in the AEDSPIM format, where

A - add, E - edit, D - delete, S - search/list, P - print/export, I - import, M -admin group.

$permissions = GetUserPermissions("Cars");

If you need to assign the value to the variable, use the variable directly.

$_SESSION["UserRights"]["Cars"] = "AEDSPI";

$_SESSION["language"]

Current selected language e.g. "English" or "Spanish".

To get the value of this variable use special function mlang_getcurrentlang() that returns current selected language.

If you need to assign the value to the variable, use the variable directly.

$_SESSION["language"]="English";

$_SESSION["MyURL"]

If user is trying to access one of password-protected pages directly e.g. pagename_edit.php?editid1=3 this page address is saved in $_SESSION["MyURL"] variable and user is redirected to the login page.

After successful login user will be redirected to that page.

$_SESSION["AccessLevel"]

ACCESS_LEVEL_GUEST - guest user

ACCESS_LEVEL_USER - regular user

ACCESS_LEVEL_ADMINGROUP - user belongs to the admin group

ACCESS_LEVEL_ADMIN - admin user

Obsolete.

$_SESSION["OwnerID"]

OwnerID value from the login table. Obsolete.

$_SESSION["_<table name>_OwnerID"]

OwnerID value from the login table that applies to <table name> table.

$_SESSION["UserName"]

Logged user name displayed in the Logged as <> phrase.

Variable name

Description

$_SESSION["<table name>_search"]

0 - show all records

1 - basic search

2 - advanced search

$_SESSION["<table name>_searchfield"]

Basic search field

$_SESSION["<table name>_searchoption"]

Basic search option (Equals, Contains, etc)

$_SESSION["<table name>_searchfor"]

Basic search for phrase

$_SESSION["<table name>_pagenumber"]

Current page number

$_SESSION["<table name>_asearchnot"]

Advanced search - array with NOT option value for each field

$_SESSION["<table name>_asearchopt"]

Advanced search - array with search option value for each field (Equals, Contains etc)

$_SESSION["<table name>_asearchfor"]

Advanced search - array with with search for value for each field

$_SESSION["<table name>_asearchfor2"]

Advanced search - array with with second search for value for each field (Between search)

$_SESSION["<table name>_asearchfortype"]

AND or OR search

$_SESSION["<table name>_mastertable"]

Master table name

$_SESSION["<table name>_masterkey1"],

$_SESSION["<table name>_masterkey2"] etc

Master table foreign key values

$_SESSION["<table name>_orderby"]

Order by clause (aFieldName or dFieldName). "a" means ascending, "d" means descending sort order.

$_SESSION["<table name>_pagesize"]

Number of records per page. Readonly.

If you need to change page size programmatically add the following code to After table initialized event:

global $tables_data, $strTableName;

$tables_data[$strTableName][".pageSize"] = 100;

 

$_SESSION["<table name>_sql"]

SQL query without WHERE and ORDER BY. Populated on the list page to be used on Print/Export pages.

$_SESSION["<table name>_where"]

WHERE clause. Populated on the list page to be used on Print/Export pages.

$_SESSION["<table name>_order"]

ORDER By clause ("Order by make asc"). Populated on the list page to be used on Print/Export pages.

$_SESSION["BackURL"]

URL to return after password was changed

$_SESSION["<table name>_SelectedSQL"]

Export page - SQL query when page is in "export selected" mode

$_SESSION["<table name>_SelectedWhere"]

Export page - WHERE clause when page is in "export selected" mode

Converted from CHM to HTML with chm2web Standard 2.85 (unicode)