Commit ec405f625bad318b1fb576a5c3a0f18e1d079ee7
1 parent
361aef10
KTS-3478
"On user login, some users would prefer to be redirected to the browse view, and not to the dashboard" Implemented. Committed By: Conrad Vermeulen Reviewed By: Megan Watson git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@8748 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
17 additions
and
2 deletions
login.php
| ... | ... | @@ -342,9 +342,24 @@ class LoginPageDispatcher extends KTDispatcher { |
| 342 | 342 | $url = $redirect; |
| 343 | 343 | // else redirect to the dashboard if there is none |
| 344 | 344 | } else { |
| 345 | - $url = KTUtil::kt_url().'/dashboard.php'; | |
| 345 | + $url = KTUtil::kt_url(); | |
| 346 | + | |
| 347 | + $config = KTConfig::getSingleton(); | |
| 348 | + $redirectToBrowse = $config->get('KnowledgeTree/redirectToBrowse', false); | |
| 349 | + $redirectToDashboardList = $config->get('KnowledgeTree/redirectToBrowseExceptions', ''); | |
| 350 | + | |
| 351 | + if ($redirectToBrowse) | |
| 352 | + { | |
| 353 | + $exceptionsList = explode(',', str_replace(' ','',$redirectToDashboardList)); | |
| 354 | + $user = User::get($_SESSION['userID']); | |
| 355 | + $username = $user->getUserName(); | |
| 356 | + $url .= (in_array($username, $exceptionsList))?'/dashboard.php':'/browse.php'; | |
| 357 | + } | |
| 358 | + else | |
| 359 | + { | |
| 360 | + $url .= '/dashboard.php'; | |
| 361 | + } | |
| 346 | 362 | } |
| 347 | - | |
| 348 | 363 | exit(redirect($url)); |
| 349 | 364 | } |
| 350 | 365 | } | ... | ... |