Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: SMF Customization Team on September 25, 2009, 05:40:36 PM

Title: Allow Access in Maintenance Mode
Post by: SMF Customization Team on September 25, 2009, 05:40:36 PM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=2170)

Allow Access In Maintenance Mode



Original Author: Arantor (http://www.simplemachines.org/community/index.php?action=profile;u=265135) | Current Author: SMF Customization Team (http://www.simplemachines.org/community/index.php?action=profile;u=1)
Supported Languages: English, Spanish, Russian, Portuguese
Link To Mod (http://custom.simplemachines.org/mods/index.php?mod=2170) | Mod Discussion (http://www.simplemachines.org/community/index.php?topic=338635.0) | Other SMF Customization Team Mods (http://custom.simplemachines.org/mods/index.php?action=profile;u=1)



Summary:
This mod allows admins to grant forum access to trusted membergroups while the forum is in maintenance mode.

The usual "Remember, this forum is in 'Maintenance Mode'." reminder is also given to those other groups, while regular users are still barred.

Compatibility:
Compatible with SMF 1.1 & 2.0

Installation Information:
The Package Manager should work in most cases, if you have problems installing please use the discussion thread as well as Manual Installation of Mods (http://docs.simplemachines.org/index.php?topic=402)

Change Log:
Version 1.2 - October 12, 2011
+ Added 2.0x support
! Fixed 2.x error which prevented the mod from working

Version 1.1 - June 17, 2011
+ Added Portuguese support

Version 1.1 - October 15, 2009
+ Added Spanish support
+ Added 2.0 RC2 support

Version 1.0 - September 24, 2009
  Original release



Copyright (c) 2015, Simple Machines, under BSD 3-Clause License.
All rights reserved.
Title: Re: Allow Access in Maintenance Mode
Post by: Ken. on September 25, 2009, 06:01:32 PM
Nice Mod, thanks Arantor.  ;)
Title: Re: Allow Access in Maintenance Mode
Post by: mirahalo on September 27, 2009, 11:00:21 AM
as always heres spanish translation ;)


$txt['permissionname_admin_maintmode'] = 'Permitir acceso en modo mantenimiento';
$txt['permissionhelp_admin_maintmode'] = 'Esta opcion permite a los usuarios de este grupo de usuarios acceder a el foro aun estando en modo mantenimiento.';


good for spanish_es and spanish_latin  and its utf8 versions as well.
Title: Re: Allow Access in Maintenance Mode
Post by: Arantor on September 27, 2009, 11:02:42 AM
Many thanks 130860 :)

I'll add that shortly when I brush up the main mod page.
Title: Re: Allow Access in Maintenance Mode
Post by: edi67 on September 27, 2009, 06:11:24 PM
nice one
Title: Re: Allow Access in Maintenance Mode
Post by: Cal O'Shaw on September 28, 2009, 02:01:33 AM
Woo-hoo!  Thanks, Arantor!  This was my request way back when and I was able to get some help from Karl Benson and a few other SMF Wizards to implement a hand-coded version.

I'm going to see about extracting my manual code and using your MOD (I really have been uncomfortable with it and wondered if it would break our site when we tried to upgrade to 2.0.x).

Grazie mille!

Cal
Title: Re: Allow Access in Maintenance Mode
Post by: Arantor on September 28, 2009, 03:05:37 AM
Cal, when you do the upgrade from 1.x to 2.x, all mods get removed anyway as all the files get replaced, so you should be able to strike that one off the list of upgrade concerns.

I had actually forgotten that you'd documented it manually before.
Title: Re: Allow Access in Maintenance Mode
Post by: mirahalo on October 08, 2009, 12:42:46 PM
ok, me again, this time with the xml file ;)

greetings!
Title: Re: Allow Access in Maintenance Mode
Post by: Arantor on October 08, 2009, 12:47:34 PM
Thanks :)

I'll get that added on next week when I'm back at home.
Title: Re: Allow Access in Maintenance Mode
Post by: Arantor on October 12, 2009, 06:30:20 PM
Donated to SMF Customization Team :)

I'll add Spanish support shortly though.
Title: Re: Allow Access in Maintenance Mode
Post by: Arantor on October 15, 2009, 07:14:37 AM
Spanish support has been added to this package, bumping it to version 1.1. I also added support for 2.0 RC2 for Charter users (though I cannot imagine this needing to change afterwards, but I'll retest on RC2-public when it arrives)
Title: Re: Allow Access in Maintenance Mode
Post by: InfoStrides on December 28, 2009, 04:35:50 PM
Nice mod! Thanks.
Title: Re: Allow Access in Maintenance Mode
Post by: Xenmorph on January 10, 2010, 10:54:08 PM
I seem to be having problems with this mod,

I have tried it on my work in progress RC2 forum which is heavily moded and I have also tried it on a Fresh install of RC2 with no mods.

in both scenarios it just reloads the Login page when Any member but Admin tries to login while in maintenance mode ?

I have set the Permissions, Am i missing something ?
Title: Re: Allow Access in Maintenance Mode
Post by: Arantor on January 10, 2010, 10:55:17 PM
What did you set permissions to?
Title: Re: Allow Access in Maintenance Mode
Post by: Xenmorph on January 11, 2010, 09:21:04 AM
Permission set to ALLOW access in maintenance Mode
Title: Re: Allow Access in Maintenance Mode
Post by: Arantor on January 11, 2010, 09:26:01 AM
Which group is that for?
Title: Re: Allow Access in Maintenance Mode
Post by: Xenmorph on January 11, 2010, 09:41:11 AM
Those are the permissions for a New non post based group I created called "Tester".
Title: Re: Allow Access in Maintenance Mode
Post by: Arantor on January 11, 2010, 09:42:46 AM
And they can't access the forum at all in maintenance mode? Weird.

What other mods do you have? What URL were you trying to get to?
Title: Re: Allow Access in Maintenance Mode
Post by: Xenmorph on January 11, 2010, 10:01:49 AM
Quote from: Arantor on January 11, 2010, 09:42:46 AM
And they can't access the forum at all in maintenance mode? Weird.

What other mods do you have? What URL were you trying to get to?

Ok I will keep this simple and not involve the Production site I am putting together for now which is were I first encountered the problem.


So I then Created a Fresh install of RC2 Public to see if it was the Mod or a conflict with other mods I had.

I am still Having this issue on a Fresh Install of SMF RC2 Public with No other modifications using the Curve Theme.

Set Permission for Global Moderator to allow.

No Errors in Log or while installing and I Have taken a look through the Code Manually and it all appears to be there.

Pics attached from Fresh RC2 Public installation.





Title: Re: Allow Access in Maintenance Mode
Post by: Arantor on January 11, 2010, 10:21:26 AM
So if you log in with a global moderator account it doesn't work? Weird - it works for me at first glance. I guess I need to re-test it more thoroughly on RC2 (I originally wrote it on 2.0 RC1.2)
Title: Re: Allow Access in Maintenance Mode
Post by: Bugo on February 14, 2010, 05:51:06 AM
Russian translation:

// Allow Access in Maintenance Mode
$txt['permissionname_admin_maintmode'] = 'Разрешить просмотр форума во время техобслуживания';
$txt['permissionhelp_admin_maintmode'] = 'Члены этой группы смогут просматривать и использовать форум даже в режиме техобслуживания.';
Title: Re: Allow Access in Maintenance Mode
Post by: Arantor on February 14, 2010, 07:43:49 AM
Thanks. I hope the Customization Team can add this is, since I no longer have the ability to update it (given that I originally wrote it)
Title: Re: Allow Access in Maintenance Mode
Post by: Norv on March 09, 2010, 05:08:53 PM
Xenmorph: Really sorry for the delay on this.
I can confirm the issue. I'll be looking into it as soon as possible.
Title: Re: Allow Access in Maintenance Mode
Post by: cj82 on March 30, 2010, 04:02:24 PM
Does this mod work with rc3? If not how can I make compatible with it?
Title: Re: Allow Access in Maintenance Mode
Post by: Norv on March 30, 2010, 05:42:51 PM
It should work, yes. It does have a bug though (reported on some installations, not everybody experiences it), which does not depend on RC3.
Title: Re: Allow Access in Maintenance Mode
Post by: cj82 on March 31, 2010, 09:56:03 AM
Good. I have the bug and don't understand where is the problem.

[EDIT]
The problem is in row 545 of LogInOut.php file

        if (empty($maintenance) || allowedTo('admin_maintmode'))
redirectexit('action=login2;sa=check;member=' . $user_info['id'], $context['server']['needs_login_fix']);
else
redirectexit('action=logout;' . $context['session_var'] . '=' . $context['session_id'], $context['server']['needs_login_fix']);


In that point the user hasn't any permission ( I have a dump of $user_info: Array ( .... [permissions] => Array (
Title: Re: Allow Access in Maintenance Mode
Post by: xKroniK13x on April 21, 2011, 01:33:39 PM
Sorry for the big bump.
I am trying to install this MOD to my forums. The installation works fine except my custom theme's index.template.php does not have the line
if ($context['in_maintenance'] && $context['user']['is_admin'])
in it at all.

I have manually searched for lines similar to it, and not one line in the file even says maintenance.  :o
I have tried running the forum without the lines but it does not work. It just treats it as standard maintenance mode. I have indeed modified the permissions for the group.

I am using the theme Archway on SMF 2.0RC5 if that is needed.

Any help is greatly appreciated.

Thanks,
Corey
Title: Re: Allow Access in Maintenance Mode
Post by: nukinfuts29 on May 23, 2011, 11:34:04 AM
Any hope of this working with RC5? I have manually installed it several times, and even though i can complete every step it still will not allow my global mods (with permissions set) to access the forum in maint mode.

I saw the post two up from mine and checked that line, but i do not see what he is trying to say.

Thanks!
Title: Re: Allow Access in Maintenance Mode
Post by: Jade Elizabeth on July 16, 2011, 02:23:29 AM
Quote from: xKroniK13x on April 21, 2011, 01:33:39 PM
Sorry for the big bump.
I am trying to install this MOD to my forums. The installation works fine except my custom theme's index.template.php does not have the line
if ($context['in_maintenance'] && $context['user']['is_admin'])
in it at all.

I have manually searched for lines similar to it, and not one line in the file even says maintenance.  :o
I have tried running the forum without the lines but it does not work. It just treats it as standard maintenance mode. I have indeed modified the permissions for the group.

I am using the theme Archway on SMF 2.0RC5 if that is needed.

Any help is greatly appreciated.

Thanks,
Corey

I have this issue too, and I'm on 2.0. From what I can see though, that line mentioned only displays notifications about it being in admin mode so it shouldnt hinder it?
Title: Re: Allow Access in Maintenance Mode
Post by: IchBin™ on July 18, 2011, 12:18:56 PM
Exactly right Jade! That's only for where it shows those notifications in the user area of the theme. If a custom theme doesn't have that code there's no need to add the bits for this mod in that section.
Title: Re: Allow Access in Maintenance Mode
Post by: Jade Elizabeth on July 19, 2011, 04:09:56 AM
Quote from: IchBin™ on July 18, 2011, 12:18:56 PM
Exactly right Jade! That's only for where it shows those notifications in the user area of the theme. If a custom theme doesn't have that code there's no need to add the bits for this mod in that section.

But it doesnt work at all... :(
Title: Re: Allow Access in Maintenance Mode
Post by: IchBin™ on July 19, 2011, 09:17:41 AM
What doesn't work?
Title: Re: Allow Access in Maintenance Mode
Post by: Jade Elizabeth on July 19, 2011, 09:20:01 AM
The entire mod. I quoted someone saying that without that part in the theme the mod doesnt work.
Title: Re: Allow Access in Maintenance Mode
Post by: IchBin™ on July 19, 2011, 09:57:25 AM
So it doesn't work on a custom theme if you can't put those lines in it? Or it doesn't matter what you do, the mod doesn't even work in the default theme?
Title: Re: Allow Access in Maintenance Mode
Post by: Illori on July 19, 2011, 10:19:38 AM
it works fine on the default theme, but if you cant find that line on a custom theme i dont think the mod will work at all.
Title: Re: Allow Access in Maintenance Mode
Post by: IchBin™ on July 19, 2011, 10:41:51 AM
The mod should still work if the template code is not found. It should still allow specified member groups access to the forum when in maintenance mode. If that is not the case, we need to look closer at the mod.
Title: Re: Allow Access in Maintenance Mode
Post by: Jade Elizabeth on July 20, 2011, 04:39:34 AM
I think you might want to test it darls, cause I just cannot get it to work at all :(.
Title: Re: Allow Access in Maintenance Mode
Post by: Illori on July 20, 2011, 06:30:31 AM
i have a clean smf 2.0 install, installed this mod on it, it installed cleanly. made a test account, gave that account permission to log in while in maintenance mode. put forum in maintenance mode, tried to log in with the account and it would not allow them to log in, if i take the forum out of maintenance mode and try to log in the account can log in, and i put it back in maintenance mode they stay logged in.

i even installed an older RC4 version of the mod and the test user can not log in while in maintenance mode.
Title: Re: Allow Access in Maintenance Mode
Post by: IchBin™ on July 20, 2011, 11:49:33 AM
Illori, did I read your post wrong? You are saying the mod didn't work as advertised?

I just did a test install as well, and when a member group was given permission to login while in maintenance mode, there were no problems. Once the permission was removed they weren't allowed to login as expected.

Jade, would you like me to look at this on your site?
Title: Re: Allow Access in Maintenance Mode
Post by: Illori on July 20, 2011, 11:56:35 AM
you are correct Ich i tested it on a clean install with curve theme and it did not work at all.
Title: Re: Allow Access in Maintenance Mode
Post by: Illori on July 20, 2011, 12:10:02 PM
if you want to see the install i just duplicated it again on my live server, send me a message and i can let you take a look.
Title: Re: Allow Access in Maintenance Mode
Post by: Illori on July 20, 2011, 12:21:00 PM
tested this mod with 1.1.14 the login somewhat works, but you get a "Session verification failed. Please try logging out and back in again, and then try again." error upon login  if you go back [using link on the page] and refresh the page you can then see the forum.
Title: Re: Allow Access in Maintenance Mode
Post by: Jade Elizabeth on July 28, 2011, 12:11:17 AM
What Illori's describing is exactly the problem :).
Title: Re: Allow Access in Maintenance Mode
Post by: matt1122 on August 01, 2011, 01:16:17 PM
This is not working at all for me, either. I gave Global Moderators the appropriate permission, but they just get looped back to the "Forum is in Maintenance Mode" screen when trying to log in.
Title: Re: Allow Access in Maintenance Mode
Post by: Illori on August 01, 2011, 01:18:04 PM
IchBin i believe is trying to look further into this mod, but due to real life has not given us an update on the status.
Title: Re: Allow Access in Maintenance Mode
Post by: matt1122 on August 01, 2011, 04:04:42 PM
I'm not sure it's a problem with the modification. Without this mod installed, isn't anyone with "admin_forum" permission supposed to be able to access the forum when it's in maintenance mode? Because this wasn't working either.
Title: Re: Allow Access in Maintenance Mode
Post by: Illori on August 01, 2011, 05:52:20 PM
this is an issue with the mod as stated above. the mod allows others access and those can not access the forum where admin can.
Title: Re: Allow Access in Maintenance Mode
Post by: matt1122 on August 01, 2011, 08:30:39 PM
Edit: Unless the session verification message is being hidden in maintenance mode, which would be horribly unhelpful...

Okay, well here's what I see looking at the modification's code: Before the changes, we're checking if the user is allowed to admin_forum. This modification adds a permission called admin_maintmode and changes all of the conditional statements to check for that permission instead of admin_forum. However, even if a usergroup has the admin_forum permission, they are not able to access the forum while in maintenance mode (with or without the mod).

This means that there is probably a second condition specified somewhere checking if the user is a member of group 1. My understanding was that admins should be able to create additional admin groups which can access the forum in maintenance mode even without this modification, but that this modification let administrators allow people to access the forum in maintenance mode without giving their group the admin_forum permission (which comes with additional privileges). Even if the checking for group 1 is intentional, then the mod needs to be changed to account for that fact.

(This is all on 2.0.)
Title: Re: Allow Access in Maintenance Mode
Post by: Jade Elizabeth on August 15, 2011, 07:04:41 AM
Thanks to everyone looking into it :).
Title: Re: Allow Access in Maintenance Mode
Post by: IchBin™ on August 15, 2011, 11:03:35 AM
Haven't figured it out yet.. It would seem that the allowedTo() check needs to be input earlier as it's not pickup up the permission on login.
Title: Re: Allow Access in Maintenance Mode
Post by: MaNaRa on August 22, 2011, 06:03:44 PM
I have the smf 2.0 and this mod doesn't work to my forum...
I'm use a custom theme, any help please? Really I need it  :-\
Title: Re: Allow Access in Maintenance Mode
Post by: IchBin™ on October 13, 2011, 01:48:20 PM
This mod has been updated, and should fix the current issue of not being able to login for someone with maintenance access. Big thanks to Spuds for taking the time to figure out the problem and fixing it.
Title: Re: Allow Access in Maintenance Mode
Post by: wilkolak on August 20, 2013, 07:57:44 AM
It looks like it doesn't work anymore @ 2.0.5. Any chance for update or help?

Cheers,
OG
Title: Re: Allow Access in Maintenance Mode
Post by: IchBin™ on August 20, 2013, 09:17:12 PM
Should still work. You just need to emulate the version number. click the advanced link in the package manager, and put in the current supported version of the mod. It should install then. If it fails, post back.
Title: Re: Allow Access in Maintenance Mode
Post by: wilkolak on August 21, 2013, 03:58:27 AM
I didn't have problems with install. It just didn't grant acces (after setting group privileges, etc.)
I've uninstalled it and some other mods, installed again and now it works. I don't know what was the problem. Maybe I did something wrong or there were some conflicts. It works now and that's great!

Thanks!
Title: Re: Allow Access in Maintenance Mode
Post by: Chris180 on January 31, 2014, 12:09:22 AM
I just installed this and it functions 100% on 2.0.7 without emulation. The only problem I have encountered is that there is no "Remember - This forum is in 'Maintenance Mode'." message displayed.

I am not sure why. Could it be to do with the fact I switched to utf-8 British-English for the forum?

Anyway, not a huge deal, the point is the mod does work, but that text display would be very handy :).
Title: Re: Allow Access in Maintenance Mode
Post by: Arantor on January 31, 2014, 12:13:15 AM
Your theme may not have it - not all themes do.
Title: Re: Allow Access in Maintenance Mode
Post by: Chris180 on January 31, 2014, 01:21:23 PM
Quote from: Sir Cumber-Patcher on January 31, 2014, 12:13:15 AM
Your theme may not have it - not all themes do.

I definitely has it as it shows with the main admin account, just not the 'approved accounts' so i'm not sure what the issues is :(. Again, not a huge deal but I just thought I would mention it.
Title: Re: Allow Access in Maintenance Mode
Post by: von COLLINZO on January 31, 2014, 04:24:27 PM
Nice mod :D
Title: Re: Allow Access in Maintenance Mode
Post by: LpxL on September 22, 2016, 01:40:07 PM
Turkish (utf8) translation

$txt['permissionname_admin_maintmode'] = 'Bakım modunda foruma girebilir';
$txt['permissionhelp_admin_maintmode'] = 'Bu seçenek kullanıcının bakım modunda forumda gezinebilmesini sağlar.';
Title: Re: Allow Access in Maintenance Mode
Post by: aodio on November 05, 2016, 09:07:49 PM
Works great !!.. cheers for that  ;)
Title: Re: Allow Access in Maintenance Mode
Post by: Adam Bryant on November 19, 2017, 04:03:18 PM
Hello. Before is starting to write my problem, i want to apoliogize about my english skill. I live in hungary, and the English Education system, not the best here. Thank you.

The problem: I installed the SMF 2.0.14 and Simpleportal 2.3.7. I made a forum for the Role Play server, so i make Admin1,2,3,4, Admin Controller membergroups. I want to set who can see the forum While the maintenance mod activated, so i donwloaded the "Allow Access in Maintenance mod" I set the privileges correctly, but the problems started here.. The user logged succesfully to the server, but he Did't see the main page, just the Forum section. He couldn't see the Blocks, etc etc...