Maintenance Mode Access

Maintenance Mode Access

by Alan Schrock -
Number of replies: 6

Hi All,

Several years ago, we moved from an external hosting company to onsite hosting. With that hosting, they disabled the ability in the GUI to turn on Maintenance mode. It has a note saying "Contact Hosting Company" in that area and doesn't work. So, somehow, they have disabled this permission from the administrative user. There is no role for administrative user that I can find, and I have looked at many tables in the DB, and I can find a capabilities table that has it, I can't figure out where capabilities are assigned. I can naturally just edit the config.php, but it would be nice to have this capability also in the GUI. Anyone know where I can re-enable this? I don't even see the mdl_capabilities table in the 3.5 ER.

Thanks

Alan

Average of ratings: -
In reply to Alan Schrock

Re: Maintenance Mode Access

by Ken Task -
Picture of Particularly helpful Moodlers

What is "3.5 ER"?   Might need to give the version/release date seen in Notifications.

As far as tables, in a stock 3.5.highest, there is a 'mdl_role_capabilities' table but am certain many responders would think direct manipulation of DB isn't a good idea.   One thing for sure ... before you 'play' ... backup your DB and know how to restore it! smile

How has the site been upgraded all these years?

Might be best to clone the site and then work on this issue with the clone.

'spirit of sharing', Ken

In reply to Ken Task

Re: Maintenance Mode Access

by Alan Schrock -

Hi Ken and all,

Yes, I have a test server that I routinely use for things like upgrade testing, and things like this and am very familiar with databases. In this case, the hosting company already had dinked in the database to make this change.

I had seen that table. Capabilities have the login while in Maintenance mode but no restrictions on putting the system in maintenance mode. And, site administrators have a different way they are handled.

Naturally, I can use config.php and put the maintenance mode on in there, but it would be nice to also have this option in the GUI as my final testing is done in there after upgrades are complete.

Alan


In reply to Alan Schrock

Re: Maintenance Mode Access

by Ken Task -
Picture of Particularly helpful Moodlers

Well, if tables are ok, what's left?   Code!

How have you updated/upgraded all along?  The old way involved copying back into new code things like themes, config.php, and maybe even hacks of code.

How about trying a 3rd site ... for testing ... copy of DB using, copy of moodledata (that could be minimal), only in the third use git for installing a side load of the core code - most likely where the hacks were made.

So y'all can't talk to former provider?

'spirit of sharing', Ken


In reply to Ken Task

Re: Maintenance Mode Access

by Alan Schrock -

Sorry, I created some confusion. It must be in a table somewhere as the only file I copy over (other than plugins) in an upgrade is config.php and it isn't in there. I do see the message modified, but I just can't figure out the table/field to modify.

The company we moved from was being bought out by another one, so it is complicated now to go back to them or I would.

Alan

In reply to Alan Schrock

Re: Maintenance Mode Access

by Ken Task -
Picture of Particularly helpful Moodlers

Ok, then ... it's a DB table(s) tweak.   Same suggestion about a 3rd site only don't clone.  A fresh 3.x ... including new DB ... do set up manual accounts, a teacher account, and a student account (dummies).   Have only one admin level user ... that would be user ID 2 the person/account that installed initially.

Using that small test site, compare the tables related.  Since you have only one admin level account, user ID 2.

So you've kept only config.php ... what about theme?  Wonder if there was any tweakie done to theme - css hide elements or whatever + language (change the error message one would see) to give the **appearance** of restriction?

Having never been in your same situation and never hacked/tweaked any site I administer/have administered in the past for the same exact restriction am trying to think of ways for you to slueth.

Any/all are welcome to join in at this point! smile

'spirit of sharing', Ken


In reply to Ken Task

Re: Maintenance Mode Access

by Alan Schrock -

And, the answer is, drum roll...

My previous hosting provider isn't sold in the States so I asked them. It was actually in the config.php. I had

$CFG->maintenance_enabled=0;

With that as a config item, it disables the GUI from being able to adjust it. I commented it, and all is well.

How silly, but at least it is resolved.

Thanks

Alan

Average of ratings: Useful (1)