No Admin login

No Admin login

by Terry Coates -
Number of replies: 5

I am in dire need of assistance.

A couple of days ago I enabled maintenance mode on my Moodle 3.2.1 install. Little did I realize it doesn't work like I am used to and, of course, I was totally locked out of my site. I made no changes while the site was in maintenance mode.

I seem to have more than one problem in trying to get it back and I am losing valuable development time. Any help here would be greatly appreciated. I am out of ideas.

Problem 1: The cli scripts won't run because I get the following errors:

Warning: Unexpected character in input:  '\' (ASCII=92) state=1 in [path_to_site]/lib/setup.php on line 783

Warning: Unexpected character in input:  '\' (ASCII=92) state=1 in [path_to_site]/lib/setup.php on line 783

Parse error: syntax error, unexpected T_STRING in [path_to_site]/lib/setup.php on line 783

Line 783 of setup.php, which I have not modified is this:

\core\session\manager::start();

Problem 2: Disabled maintenance mode and still can't get admin access:

I tried a few solutions to the problem in the forum. Adding the line to config.php didn't seem to anything (must have been for 2.x?). I deleted the cache directories from the Moodle data directories. Finally, I edited the database entry in mdl_config and set maintenance_enabled to zero.

Now, I believe maintenance is not enabled, because I can see the class I am developing at the site root, but when I try to go to mysite/admin, I am redirected to mysite/login/index.php which only allows guest access.

Other details:

Originally I had this installed under a joomla site with Joomdle installed and I enabled single-sign-on. I have moved it to be accessible through its own sub-domain but it hasn't made a difference.

I am using the Campus theme and I disabled the "local login" button, but did not disable "all logins".

The site is hosted with Webfaction, running under php 7 and it can be viewed at elearning.disctraininghub.com


Let me know if there is any more information I can provide.

Average of ratings: -
In reply to Terry Coates

Re: No Admin login

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Problem 1... your PHP version for command line is too old  (run 'php --version' to check). CLI php is a different thing to the web version. They can easily be two different versions.

When I go to your site, there is no login form. Is that what you would normally expect? I don't know anything about the 'campus theme' but disabling 'local login' doesn't sound like a good thing to me.

EDIT
Help text says, "Hide the local login on login page. NOTE: Only enable this if all users are remote.". 

That's seems like a crazy option - your primary administrator(s) should never be remote. Gareth Barnard is really active in these forums. You might want to ask him how to get out of that one, although you should be able to find the setting 'hidelocallogin' in the config somewhere.  You could also just delete the theme (or move it well out of the way). It will revert to the standard theme which should get your login form back.

Average of ratings: Useful (1)
In reply to Howard Miller

Re: No Admin login

by Terry Coates -

Thanks for helping out so quickly.

When I do the php version check, I get 5.2.17, which as you suggested is different than the php7 that a web page would report. I'll have to check into how to get access to a new version from the shell.

Regarding the login screen, all of my users would be redirected from our main website either already logged in (via joomdle single sign-on) or they would have access to what they need as a guest user.

And THANK-YOU for the theme suggestion. I just re-named the campus directory and I am now logged into the back end!

I owe you one, naw, TWO beverages of your choosing. Must be present to win.

In reply to Terry Coates

Re: No Admin login

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Next time I'm in Cincinnati big grin

I think your beverage funds are probably safe!

In reply to Howard Miller

Re: No Admin login

by Иван Ионов -

Tell me please please, whether there can be a problem if the website initially had the http Protocol and later changed it to https ? Understand that it is unlikely, but my proxy provider (advanced.name) it happened.

In reply to Terry Coates

Re: No Admin login

by ping liu -

1. Check & modify Theme_Campus CSS Files : 

     path:  ~\xampp\apps\moodle\moodledata\localcache\theme\.....\campus\css

     modify body.hidelocallogin .loginbox .loginsub{display:none} to 

                  body.hidelocallogin .loginbox .loginsub{display:block}


2. Check moodle table:     mdl_config_plugins

    SELECT * FROM `mdl_config_plugins` WHERE plugin='theme_campus' and name like 'hidelocal%' 

    update the value of hidelocallogin to ''


Have a good luck !