case 'groupLogin':
// taken from dkd_redirect_at_login written by Ingmar Schlecht; database-field changed
$groupData = $this->frontendController->fe_user->groupData;
- $res = $this->databaseConnection->exec_SELECTquery(
- 'felogin_redirectPid',
- $this->frontendController->fe_user->usergroup_table,
- 'felogin_redirectPid<>\'\' AND uid IN (' . implode(',', $groupData['uid']) . ')'
- );
- if ($row = $this->databaseConnection->sql_fetch_row($res)) {
+ if (!empty($groupData['uid'])) {
// take the first group with a redirect page
- $redirect_url[] = $this->pi_getPageLink($row[0]);
+ $row = $this->databaseConnection->exec_SELECTgetSingleRow(
+ 'felogin_redirectPid',
+ $this->frontendController->fe_user->usergroup_table,
+ 'felogin_redirectPid<>\'\' AND uid IN (' . implode(',', $groupData['uid']) . ')'
+ );
+ if ($row) {
+ $redirect_url[] = $this->pi_getPageLink($row['felogin_redirectPid']);
+ }
}
break;
case 'userLogin':
- $res = $this->databaseConnection->exec_SELECTquery(
+ $row = $this->databaseConnection->exec_SELECTgetSingleRow(
'felogin_redirectPid',
$this->frontendController->fe_user->user_table,
$this->frontendController->fe_user->userid_column . '=' . $this->frontendController->fe_user->user['uid'] . ' AND felogin_redirectPid<>\'\''
);
- if ($row = $this->databaseConnection->sql_fetch_row($res)) {
- $redirect_url[] = $this->pi_getPageLink($row[0]);
+ if ($row) {
+ $redirect_url[] = $this->pi_getPageLink($row['felogin_redirectPid']);
}
break;
case 'login':