choose the first page to open on after login

prettem

Member
Hello Eugenio,
one more question to this topic please.
I tried to navigate on startup to a single page depending on logged in user name with this code, but its not working, I am landing on the home page.

many thanks for your help,
best regards
Manuel

$custom_startup_function = 'dadabik_startup';

function dadabik_startup (){
global $conn, $current_user;

if (isset($_GET['pdf_template'])){
$_POST['pdf_template'] = $_GET['pdf_template'];
}

if ($_SESSION['logged_user_infos_ar']["username_user"] == "ernst"){
<------>$my_table = 'vokabel_wiederholung';
<------>}
else
<------>{
<------>$my_table = 'funktionen';
}

#Startseite
if (!isset($_GET['tablename']) && (!isset($_GET['function']) || $_GET['function'] !== 'show_static_page') && (!isset($_GET['function']) || $_GET['function'] !== 'edit_account') && basename($_SERVER['SCRIPT_NAME'], '.php') === 'index'){
header('location:'.$site_url.'index.php?function=search&tablename='.urlencode($my_table));
}
}


About/upgrade​

DaDaBIK™ is a product conceived and developed by Eugenio Tacchini
Copyright © 2001-2022 Eugenio Tacchini
Proudly ❤️ made in Emilia
dadabik.com

Your current DaDaBIK version​

You are using DaDaBIK version 11.7-Elba enterprise, installed on 03.10.2022 (installation code: 18260633b0f37e7bc0), the latest version of DaDaBIK is 11.7-Elba released on 18.08.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.16
mysql version: 5.7.33-0ubuntu0.16.04.1
Web server: nginx/1.18.0
Client: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 OPR/92.0.0.0
 
Last edited:

prettem

Member
I got it running now, but I have to disable both custom page "Enabled" and "Home"

1666694878673.png

This function is up and running:

$custom_startup_function = 'dadabik_startup';

function dadabik_startup (){
global $conn, $current_user;

if (isset($_GET['pdf_template'])){
$_POST['pdf_template'] = $_GET['pdf_template'];
}

if ($_SESSION['logged_user_infos_ar']['username_user'] == "ernst"){
<------>$my_table = 'vokabel_wiederholung';
<------>}
else
<------>{
<------>$my_table = 'funktionen';
<------>}


//Startseite
if (!isset($_GET['tablename']) && (!isset($_GET['function']) || $_GET['function'] !== 'show_static_page') && (!isset($_GET['function']) || $_GET['function'] !== 'edit_account') && basename($_SERVER['SCRIPT_NAME'], '.php') === 'index'){
<------>header('location:'.$site_url.'index.php?function=search&tablename='.urlencode($my_table));
}
//Ende Startseite.

}

best regards
Manuel
 
Last edited:
Top