The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
switching index.php
#5
I'm not 100{3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d} sure that I'm understanding, but I think I get the gist.

There is a file usersc/custom_login_script.php which decides what happens just after someone logs in. I don't know your access levels but let's assume that you have 1 for user, 2 for admin, 3 for your "other" group. The thing you want to think about is that everyone probably has user access 1 so you want to do that last.

You can do something like

Code:
if(hasPerm([2],$user->data()->id)){
Code:
Redirect::to($us_url_root.'users/admin.php');
Code:
}elseif(hasPerm([3],$user->data()->id)){
Code:
Redirect::to($us_url_root.'users/someotherpage.php');
Code:
}else{
Code:
Redirect::to($us_url_root.'users/account.php');
Code:
}

Note that hasPerm takes an array so you can do [3,4,5,6,7]
  Reply


Messages In This Thread
switching index.php - by dsuggs - 11-29-2017, 04:42 PM
switching index.php - by mudmin - 11-29-2017, 07:45 PM
switching index.php - by dsuggs - 12-15-2017, 06:53 PM
switching index.php - by s.farg - 02-13-2018, 01:22 PM
switching index.php - by mudmin - 02-13-2018, 03:54 PM
switching index.php - by s.farg - 02-13-2018, 04:17 PM
switching index.php - by mudmin - 02-13-2018, 04:20 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)