configure the start-site depending on group?

Hello,

I have two groups: Manager and "normal" User.

Each group should start with different search-forms:

T9eSpK.jpg


The "User" has permission to custom page "Filter" and no permission to "Filter (Manager)".

If logged in a "User" the application start with the custom php file "test_search.php" -> fine!

The "Manager" has permission to the custom page "Filter (Manager)" and no permission to "Filter".
If logged in a "Manager" the application tried to open the custom page "test_search.php", but he has zu permission, so that error occured:

1aMyLH.jpg


How can I now configure the start-site depending on, which group is logged in?

Thanks and regards!
Michael

You are using DaDaBIK version 9.4-Monterosso enterprise,
PHP Version: 7.1.31
mysql version: 5.7.27
Web server: Apache
Client: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0
 

eugenio

Administrator
Staff member
Hello,
if you mean assigning different home pages to different groups it is not possible. You could, however, create a general homepage with some PHP code that redirects the user to another page, according to user's group.

Best,
 

juergen_mueller

DaDaBIK Guru
You can do that by adding a php source file with a code similar to this one:

if($group == $group and $language_group == 'german' ){
include ('home_de.txt');
include ('clients/'.$groupname.'/'.$group.'.txt');

} elseif ($group == $group and $language_group == 'french') {
include ('home_fr.txt');
include ('clients/'.$groupname.'/'.$group.'.txt');


} elseif ($group == $group and $language_group == 'english') {
include ('home_en.txt');
include ('clients/'.$groupname.'/'.$group.'.txt');
}
else {
echo 'Für ' . $group . ' gibt es keine eigene Homepage.';
}


The $group.txt files contain additional pages, depending on the user's group and language. I even added another .txt file for each group depending on the group name.

The txt. files can contain virtually anything: html, php, javascript..

Put everything into the custom_php_files folder.

The txt files can stored wherever you want as long as the path is set correctly.

The variables $groupname, $group are set in a dadabik_startup_function

Best,

Juergen
 
Hello,

thanks. I have now this solution ....
[pre]
<?php
global $current_id_group;

if($current_id_group==3 || $current_id_group==4) {
include('test_search.php');
} else {
echo "<script>";
echo "window.setTimeout('window.location = \"https://www.domain.com/entwicklung/dadabik/index.php?function=show_search_form&show_result_static_page=1&id_static_page=6\"',0);";
echo "</script>";
}
?>
[/pre]

... and it works fine!
Regards
Michael
 
Top