S
S
seekinganswers2015-08-05 13:05:06
CMS
seekinganswers, 2015-08-05 13:05:06

And how to change the main page for a registered user?

Good afternoon! I ask for your help, dear Toasters :) There is a website, it has two main pages, one for those who are not registered, the second for registered users, here is the code that is responsible for this (if I understood everything correctly). The question is how can I replace it so that the registered user gets to index.php . Honestly, for me, all this is a dense forest. After all, I understand correctly, it is not enough for me to change the line "header('Location: auger.com.ru/catalog ');die();" on header('Location: auger.com.ru/index.php ');die();
<? global $USER; if($USER->IsAuthorized())/*if(1)*/
if ($APPLICATION->GetCurPage(true) == SITE_DIR."index.php"){
header('Location: auger.com. en/catalog ');die();
?>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2015-08-05
@seekinganswers

You almost solved the issue!
Home:

<? global $USER;
if($USER->IsAuthorized()) {
include('include/auth_index.php');
} else {
include('include/notauth_index.php');
}
?>

The include directory is at the root, and there are two files in it - one with the contents of the main one for authorized, the second for unauthorized ones.
According to the idea, it would be nice not to be as grouped as I wrote, but with the help of the Bitrix includes of the included areas, but will you already do this yourself?

K
Konstantin Dovnar, 2015-08-05
@SolidlSnake

The user logs in through your login form and, when entering the correct data, receives a unique identifier in the cookie in a way convenient for you, after already checking whether the user has such an identifier and whether everything is in order with him, let him into the desired page.
Dig towards the session .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question