Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Group ID may log in during maintenance mode

Asked Modified Viewed 3,586 times
T
Toes
T
Toes 10
  • Junior Member, joined since
  • Contributed 11 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
asked
Junior Member

Could someone show me how to allow a certain user group access while the site is in maintenance mode?
Not the admins,but regular members of a certain group ID.
In this case ID 5.
0 replies

8 posts

T
Toes
T
Toes 10
  • Junior Member, joined since
  • Contributed 11 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Junior Member

Anyone?
0 replies
S
Sveinungs
S
  • Veteran Member, joined since
  • Contributed 935 posts on the community forums.
  • Started 3 threads in the forums
answered
Veteran Member

Hi.
You could try to edit ../themes/templates/header.php.

Find:
if ($settings['maintenance'] == "1" && !iADMIN) { redirect(BASEDIR."maintenance.php"); }


Change it to something like:
if ($settings['maintenance'] == "1" && !iADMIN && !checkgroup("4")) { redirect(BASEDIR."maintenance.php"); }


Should do the trick?
0 replies
H
HobbyMan
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
answered
Veteran Member

!iADMIN && !checkgroup("4") will only allow users in group id 4 who are Admins access to the site.

if ($settings['maintenance'] == "1" &&  !checkgroup("4")) { redirect(BASEDIR."maintenance.php"); }


should work.
0 replies
S
Sveinungs
S
  • Veteran Member, joined since
  • Contributed 935 posts on the community forums.
  • Started 3 threads in the forums
answered
Veteran Member

@HobbyMan - so you should think. But actually !iADMIN && !checkgroup("4"wink will allow iADMIN + group id 4 to log in.
Just check it out smile
Edited by Sveinungs on 01-06-2009 06:50,
0 replies
H
HobbyMan
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
answered
Veteran Member

I'm not disputing you. But, I tried it on an offline site before posting and your code wouldn't allow access.

Isn't your code asking...

if you're not an Admin AND if you're not in group_id 4 then redirect to maintenance.php ???


--
Edited by HobbyMan on 01-06-2009 16:41,
0 replies
B
blackfox101
B
  • Member, joined since
  • Contributed 82 posts on the community forums.
  • Started 14 threads in the forums
answered
Member

very true hobby.

The statments is attcually saying if member is an admin and is also in the user group 4

This statment it should be using should be if the member is an admin OR in the group id of 4

replace && with || and it should work
0 replies
H
HobbyMan
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
answered
Veteran Member

Forgot about ||
Thanx :D
0 replies
B
blackfox101
B
  • Member, joined since
  • Contributed 82 posts on the community forums.
  • Started 14 threads in the forums
answered
Member

no problems :D
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 8 posts
  • Votes 0 votes
  • Topic users 4 members

4 participants

S
S
  • Veteran Member, joined since
  • Contributed 935 posts on the community forums.
  • Started 3 threads in the forums
H
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
B
B
  • Member, joined since
  • Contributed 82 posts on the community forums.
  • Started 14 threads in the forums
T
T
Toes 10
  • Junior Member, joined since
  • Contributed 11 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet