I'm running Moodle 2.6.11. Here's the thing:
(1) I enabled Maintenance Mode via the Server settings. And it worked. I got the appropriate screen.
(2) BUT ... there was no login displayed for site admins in the top RH corner of the screen. I understood there would be.
(3) So, I followed a forum suggestion and edited the config.php file to include the following line: $CFG->maintenance-enabled=0
(4) Then I logged in as admin, returned to Server settings, and discovered that maintenance had been disabled (with a comment that it was set in config.php).
(5) I then returned to config.php and commented out the $CFG line, as suggested.
(6) Then all hell broke loose! When I returned to the site, all I got was the error message: Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.
And that's where things remain. I am totally locked out. I've checked the data root info in config.php, and on my server, and it's correct. So too are all my file permissions.