change landing page BEFORE login

change landing page BEFORE login

by Alex gk -
Number of replies: 4

Hi all

What we need is to set up a new landing page before users login, in a subdirectory, called: " /my/ " when users visits our site. One of the pages will have the login system. 

Do you know how to implement the appropriate redirects to " /my/index.html " and in which files to add them? 

Thank you (using version 2.8 in 2021 : sorry about that !)


Average of ratings: -
In reply to Alex gk

Re: change landing page BEFORE login

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Set the https://docs.moodle.org/en/Dashboard#Default_home_page to "Site" and visitors (not logged in) will see a common "landing page" which Moodle calls the https://docs.moodle.org/en/Front_page.

Possibly the idea of a dashboard arrived after the rel. 2.8. Either way rel. https://docs.moodle.org/dev/Releases#Moodle_2.8 has a backlog of 4 years of security holes. Please note that, in case you have enquiries on how to upgrade Moodle, there is a different forum, the Installing and upgrading help forum.
In reply to Visvanath Ratnaweera

Απάντηση: Re: change landing page BEFORE login

by Alex gk -
Thanx for the guidance
In reply to Alex gk

Απάντηση: Re: change landing page BEFORE login

by Alex gk -
i finally managed to make the redirection to /my/index.html by adding in the index.php the following lines:

if (!isloggedin()) {
redirect($CFG->wwwroot .'/my/');
}

I also created an html form in /my/login.html like this:

form  action="../login/index.php"  method="POST">
                    input id="username" type="text"     name="username" >
                    input id='password' type=password name="password">                    
                    input id='enterbtn' type="SUBMIT" value="Είσοδος">
/form>

With this form i can succesfully login if i enter the correct credentials.
If i enter wrong credentials it also redirects me correctly to /login/index.php.

But the PROBLEM now is that even if browser 'keeps' filled in the form fields 
the correct credentials then
it fails to login and redirects me somehow back to /my/login.html

Do you know why this is happenning?

P.S. I have deleted the first "<" intetionally
In reply to Alex gk

Re: Απάντηση: Re: change landing page BEFORE login

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Well, if you do that kind of violent treatment, you should know what you're doing.
;-(

Moodle has a couple of APIs for programmers - none of them looks vaguely similar to what you are doing. You might want to request the forum moderator to move your enquiry to the General developer forum for their attention.