Customising the log in page

Customising the log in page

by Gary Attwood -
Number of replies: 34
I'm not sure where to post this question.

Does anyone know how to customise the log in page so that you just have the simple log in box without the headers or footers or the message box alongside it.

In our site you can't get in without logging in.

We would like the login box with our graphic background to the page and a logo instead of any headings I have included a picture of roughly what we would like to achieve.

We would be using 1.5 and our graphics person is customising the "Wood" theme for this. I am not sure what we would need to edit.

I would be very grateful if anyone could point us in the right direction.

Thank you very much.

Gary Attwood
E-learning Manager
English Teacher
Attachment Loginpagesketch.jpg
Average of ratings: Useful (1)
In reply to Gary Attwood

Re: Customising the log in page

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Gary,

Please check Administration >> Users >> Authentication for the option to enter an alternate login URL. smile
In reply to Helen Foster

Re: Customising the log in page

by Gary Attwood -
Dear Helen,

Thanks for the info.

I wonder if there are any example forms in use. I was a little afraid of testing as it looks as if one can be locked completely out of the site if the form doesn't work.

I'll probably need to post another question on that issue. If you have any ideas though that would be great.

Thank you very much for the help.

Gary Attwood

In reply to Gary Attwood

Re: Customising the log in page

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Gary,

Could you test things out on a local Moodle site? I don't know of any examples forms in use, however the code you need to include on the login page is as follows:
<form method="post" action="http://yoursite.com/login/index.php">
<fieldset>
<label for="username">Username:</label><input type="text" name="username" id="username" />
<label for="password">Password:</label><input type="password" name="password" id="password" />
</fieldset>
<fieldset>
<input type="submit" value="Login" />
</fieldset>
</form>

Average of ratings: Useful (2)
In reply to Helen Foster

Re: Customising the log in page

by Chardelle Busch -
Picture of Core developers
If you take a look at the very bottom of the login/index.php page, you will see: print header..., include html..., print footer. You could try deleting the print header and footer lines, and then changing the html form by adding your image: login/index_form.html, but be careful with that--it contains a lot of code!
In reply to Chardelle Busch

Re: Customising the log in page

by Gary Attwood -
Thanks Chardelle,
This is also very useful for our designer who will certainly have a go at it.
We'll be looking at the design at the end of July, but I have put these questions up well in advance so we can plan ahead.
Thank you for your help.
Gary
In reply to Gary Attwood

Re: Customising the log in page

by W Page -
Hi Gary!

The code Helen provided is essential for logging into a Moodle site.  Also I would suggest (if there is a problem) a link to a contact person or a contact form that sends e-mail.

Chardelle also offered good advice to get the page to layout as you want.  In your design there really is no visible header and footer.

I would only add that a simple way to achieve what you want is to do the layout using tables.  However, it seems that everyone is now CSSing so you may want to try it that way as well.  Your "web" person should be helpful with this.

Please let us see the final design.

WP1
In reply to W Page

Re: Customising the log in page

by Gary Attwood -
Thanks for the tips.

Yes, our graphics man wants to get rid of the header and footer on the log in page so our clients just see our company name and logo.

Not sure yet what approach we'll eventually try (either customising the current log in page removing code or writing our own log in page after adjusting the settings in moodle). We'll have a meeting in a couple of weeks and go over the ideas we've gathered and set up a few tests.

We will definately let anyone who is interested see the final result.

We currently use our site for course management in our small language school and we also run a small number of private e-learning courses.

Moodle's great.

It's great to get so much very specific and detailed online assistance.

Fantastic.

Thank you all.
In reply to Gary Attwood

Re: Customising the log in page

by W Page -

Hi Gary!

I forgot to add this suggestion in my previous post. Ask your designer about changing the colors of the form button [login, password] so that they blend in better with the color on the page. smile

WP1

In reply to W Page

Re: Customising the log in page

by Gary Attwood -
Long time in replying to this but our site has now been up a couple of months with a new theme and our customised log in page.

If you want to visit our mirror site then visit:

ecourseline.biz/moodle and log in using Testuser as both id and password.
There are 2 demo courses inside.
They are slightly rough but the writing demo has good samples of quicktime media and video.


Best wishes,
Gary
In reply to Helen Foster

Re: Customising the log in page

by Gary Attwood -
Wow Helen!
Thanks! This code helps a lot.
I am more of a multi media expert than web form designer, or php scripter, so this shows me the idea.
I'll have to try a few tests.
Thank you for your help.
Cheers,
Gary
In reply to Gary Attwood

Re: Customising the log in page

by Angela Crouch -
I was also trying to do something similar and this posting helped a lot. Thank you. 

Is there a way to provide an option on our smaller login form to enable someone to create an account? 

As it is right now, I have the login username and password boxes but I'd like for a link to direct them to signing up for the site. 

Any tips?
In reply to Angela Crouch

Re: Customising the log in page

by Juan David Martínez Pavony -

Hello Angela.

When you talk about your "small login form" what do you mean? Are you using the login page of Moodle? Are you using an alternative one?

I think you should let us know more about your Moodle setup.

I guess the answer you are looking for is not as easy as it appears to be. It all depends on your authentication method for Moodle.

If you have e-mail authentication method, a person is able to create its own user and password through an e-mail confirmation mechanism. If you choose no authentication method, anyone can sign up. If you select any other method, then an external system must exists to grant access for an user and a person can not choose the one of its preference.

In the other hand, if you choose manual accounts only method, only accounts created by the admin (manually created or loaded up from text files) can login.

Anyway, you EVER can setup an alternative URL to accomplish authentication tasks for all of the authentication methods in Moodle.

Hope this helps.

Good luck.

In reply to Angela Crouch

Re: Customising the log in page

by Angela Crouch -
Hi Juan,

I have a username and password form on my webpage that allows the user to login to their moodle classroom (action is pointing to the moodle login page).  If I have a new user however, is there a seperate link I can use or can I direct them to the original login page to sign up for their account?


In reply to Angela Crouch

Re: Customising the log in page

by Juan David Martínez Pavony -

Hello again.

I think you can try something like http://yourmoodle/login/signup.php

There you can create an user. (see my image down here)

Let us know.

Attachment 1.JPG
In reply to Juan David Martínez Pavony

Re: Customising the log in page

by Angela Crouch -
That is an interesting link you sent, but I'm not sure that it relates to what I'm trying to do.

I have this box on my webpage:  Training Login box

I want them to type in their username and password (if they are already signed up) or click on the "New User" link and it will take them to the registration page for Moodle. 

Any ideas?


In reply to Angela Crouch

Re: Customising the log in page

by Juan David Martínez Pavony -

Hello Angela.

Does your whole login page look like mine (see image)? Does it have those options? Which is the authentication method you are using?

Default method for authentication is e-mail based. If you choose it, then you have a "Create new account" button in your login page (instead of the "New User? Register here" link). I guess that is what you are looking for. Doesn't it?

See you.

Attachment LoginPage.JPG
In reply to Juan David Martínez Pavony

Re: Customising the log in page

by Bernardo Carvalho -

hi guys this thread is really helpful, but as a newbie I still cant find the solution to my problem: I would like to edit the following block of text on the login page:

Hi! For full access to courses you'll need to take a minute to create a new account for yourself on this web site. Each of the individual courses may also have a one-time "enrolment key", which you won't need until later. Here are the steps:

  1. Fill out the New Account form with your details.
  2. An email will be immediately sent to your email address.
  3. Read your email, and click on the web link it contains.
  4. Your account will be confirmed and you will be logged in.
  5. Now, select the course you want to participate in.
  6. If you are prompted for a "enrolment key" - use the one that your teacher has given you. This will "enrol" you in the course.
  7. You can now access the full course. From now on you will only need to enter your personal username and password (in the form on this page) to log in and access any course you have enrolled in.

but I cant find the source for it??! anyone help, please?

Many thanks,

Bernardo

In reply to Bernardo Carvalho

Re: Customising the log in page

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
In versions of Moodle up to 1.5.4,
  1. log in as Admin
  2. go to Administration » Configuration » Language » Edit strings
  3. locate string "loginsteps" and edit...
Joseph
In reply to Joseph Rézeau

Re: Customising the log in page

by Tracy Young -
WHat about version 1.9+?
In reply to Juan David Martínez Pavony

Re: Customising the log in page

by maryory urdaneta -
Hi good afternoon,

This is to consult as I can do to customize the login, in order to evaluate each user at logon. The idea is to display a message only to some students, those that meet certain characteristics. I mean, the idea is that the system at some point to assess whether a student will pursue a common area will display a warning message should be aware of the messages from your professor.
But I want to evaluate the logon, I have been checking in login / index.php and login / index_form.html but I do not understand where to modify it to evaluate this.

Thanks in advance. triste
In reply to Helen Foster

Re: Customising the log in page - direct to specific course?

by John Patten -

Hello All!

I was creating a custom login page, thanks to the code Helen submitted. It works fine, but I'd also like to have the student go directly to a specific course and not the main Moodle page. I guess this is being controlled by cookies on the user's browser.

Is there a way I can set a value in the custom log in page so that the student is taken to a specific course and not the front Moodle page?

Thank you!

In reply to John Patten

Re: Customising the log in page - direct to specific course?

by Cory B -
Look for the following two lines of code in the file ~/login/index.php:

            reset_login_count();

            redirect($urltogo);

If you edit the $urltogo, you can change where someone is redirected to after they login. The lines before this code determine how that is set.

I hope this helps. smile
In reply to Cory B

Re: Customising the log in page - direct to specific course?

by Chuck Daniel -

I have a somewhat related question to this reply and to the topic in general.

I am a newbie to moodle but a software design engineer by training so am willing to make code modifications if necessary to accomplish my task.

Moodles design philosophy seems to be one of:

Register as a moodle user
Enroll for specific courses

What I would like to be able to do is have the registration and enrollment occur in one step.

The reason I want to do this is that I would like to have people coming to the site be able to register and join a specific course using an enrollment key that I provide them.  They will have paid to participate in the course outside of Moodle and I only want paid members to be able to join the site/course.

Can anyone please provide me with a method or feedback on the best way to accomplish this?  The multi-step join/enroll method will be confusing to the people I want to give access to the training so if I can combine them that would be the best for what I want to do.

I thought perhaps a custom login page might be the way to do this but am open to all possibilities.

Thanks in advance for your time.

I sincerely appreciate it!

-Chuck Daniel

In reply to Helen Foster

Re: Customising the log in page

by maryory urdaneta -
Hi good afternoon,

This is to consult as I can do to customize the login, in order to evaluate each user at logon. The idea is to display a message only to some students, those that meet certain characteristics. I mean, the idea is that the system at some point to assess whether a student will pursue a common area will display a warning message should be aware of the messages from your professor.
But I want to evaluate the logon, I have been checking in login / index.php and login / index_form.html but I do not understand where to modify it to evaluate this.

Thanks in advance.
In reply to Helen Foster

Re: Customising the log in page

by Fátima Silva -

I am a beginner at moodle...

I made this and when I click on access, moddle redirects to my login page, but it doesn´t recognize the login I´ve made im my login page... what I did wrong? I am in a loopong now...

Thanks for your help.

In reply to Fátima Silva

Re: Customising the log in page

by Greg Lyon -
Just some Guesses Fatima...but:

first off: Make sure you're using a valid login!
second: Make sure you're using form post back to the login/index.php page:
<form id="loginarea" method="POST" action="http://yourserver/yourmoodle/login/index.php">
<p>USER NAME:</p>
<p><input id="uid" type="text" name="username" id="username" /></p>
<p>PASSWORD:</p>
<p><input id="pwd" type="password" name="password" id="password" /></p>
<input id="gobutton" alt="submit" type="submit"value=" " name="submit" >
</form>

third: make sure you've changed your settings in moodle (which you must have or else you wouldn't be stuck in your loop).

Hope it helps!
Greg.
In reply to Helen Foster

Re: Customising the log in page

by Kester David -

Hi Guys, I'm not sure if i am posting in the right forum. However my issue is like this, how can I let moodle prompt the user with the login/index.php page upon requesting the site.

I want the users to login first before acessing the site.

kesterd@gmail.com

In reply to Helen Foster

Re: Customising the log in page

by Nadirshah Ferozepurwalla -

Hello, I have to implement this functionality,

But i cannot find the page at the address specified.

In reply to Nadirshah Ferozepurwalla

Re: Customising the log in page

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

That's hardly surprising as you have reopened a thread from nearly 10 years ago which would have related to Moodle1.x

The alternate log in url setting can now be found at http://your moodle/admin/settings.php?section=manageauths if that is what you actually want - depending on what you are trying to do, you could also try styling the existing login page through your theme.

Average of ratings: Useful (1)
In reply to Gary Attwood

Re: Customising the log in page

by Mike Johnson -

When I try to use the code for the login form posted above on a page outside of Moodle, I get this error message:

CGI Error

The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

But it never shows anything after the :

I'm trying to put this code into a page in our content management system so users can just log into Moodle directly from there.

Any ideas?

In reply to Mike Johnson

Re: Customising the log in page

by Olli Savolainen -
Hi all,

It seems that if I have a custom login page, there is no way of giving the user feedback about a failed login? Should I just copy some PHP code from login/index.php or do I have to customize login/index.php in place to have a login page that works properly?

Thanks,
Olli
In reply to Olli Savolainen

Customising the log in page

by arumugam M -

hi everyone. how to connect moodle with openbiblio with single login.can you explain how to get an idea?is there any plugin made in moodle?pls  let me know.