security_check_session_saved_user_key
security_check_session_saved_user_key
security_check_session_saved_user_key(string $session_user_key, bool $check_if_numeric )
Parameter | Description |
---|---|
$session_user_key | A session key in your project (for example "user_id") that you want the engine to check for its existence in the session before allowing any access to your private report. |
$check_if_numeric | If this parameter is true, the engine will also check if the value of the "$session_user_key " is a numeric value. If this parameter is omitted, false will be used. |
$report = new ReportOptions(SRE_PRIVATE_REPORT);
$report->select_tables(array("items"))
->select_all_fields()
->security_init("some_login_page_url","some_logout_page_url","project1")
->security_check_session_saved_user_key("user_id")
->security_check_session_saved_group_key("group", array("sales", "admins"));
$engine = new CustomEngine($report);
$report_path = $engine->create_report();
if ($report_path) {
echo "Your report URL:" . $report_path;
}