Remove login link from pages or disable logging in for users

Remove login link from pages or disable logging in for users

by Jordan Floyd -
Number of replies: 4

Hi,

I'm not sure which forum to post this in, this was the best guess.

I am using moodle as a "brochure site" and would like to disable logging in for other users, (still allowing the admin to).

If this is not possible, which there is a high chance of, then is it possible to remove the login links of the top of all the pages.

Cheers

Jordan

Average of ratings: -
In reply to Jordan Floyd

Re: Remove login link from pages or disable logging in for users

by Jordan Floyd -

I worked it out. To do so, may vary from each theme. Find the php file/s that contain: echo $OUTPUT->login_info();

In my case, there were two. (theme fusion): frontpage.php and general.php, both in the layout folder of the theme.

Comment out the line above, and you've done it. Note: There is more than one copy of the line in each file (header and footer).

Once you've done it, you'll notice that the alignment is out by one line.

To fix it, find the start of the PHP tag before the commented out line: eg.) <?php if (

Before it, copy and paste the following into the lines ABOVE the tag.

<html><br></html>

It should then look something like this (this is the header, the footer looks different):

<html><br></html>

<?php if (!
empty($PAGE->layout_options['langmenu'])) {
echo $OUTPUT->lang_menu(); }
//echo $OUTPUT->login_info();
echo $PAGE->headingmenu 
?>

 

If done right, the login link and text should be removed, and everything stayed in allignment! smile

If anyone needs any help, just ask

Cheers

In reply to Jordan Floyd

Re: Remove login link from pages or disable logging in for users

by Leticia Dark-rose -
Hi,

Is there a way to lock out all users (except admins) through locking or hiding parts the Front Page of Moodle?

Thanks

Leticia

In reply to Leticia Dark-rose

Re: Remove login link from pages or disable logging in for users

by Ken Task -
Picture of Particularly helpful Moodlers

@Leticia .... If I am understanding you correctly, see:

https://docs.moodle.org/29/en/Maintenance_mode

and there is a third ... in config.php file of the site, add a line:

$CFG->maintenance_enabled="1";

To disable, comment above line out - leaving it for the next time to desire to enable.

Admin users must go to the URL of the site /admin/ to login.

'spirit of sharing', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Remove login link from pages or disable logging in for users

by Leticia Dark-rose -

Hi Ken,

thank you so much for the prompt reply and your 'sharing'  - it makes us all better with Moodle smile

Your response was exactly what I needed.

Kind Regards,

Leticia