[Mod Request] Chall...
 
Notifications
Clear all

[Mod Request] Challenge Submission Limited to Admin Account

7 Posts
2 Users
0 Reactions
1,729 Views
(@kaylashay)
Posts: 11
Active Member
Topic starter
 

I've searched the forums for any information on this and have not come across anything.

What I would like is a way for the submission of Challenges to only occur when an admin account is logged in instead of any user account.


 
Posted : 12/03/2008 9:54 pm
(@Seiji)
Posts: 0
 

My site is down so I can't help you too much  ;/
But... I'll try ^^"

Let's see... try this:

1. BACKUP modules/challenges/challenges.php

2. FIND (around line 43)
if(($action && ($action != "add" || !$anonchallenges)) && !isMEMBER) accessDenied( );

3. CHANGE TO:
if($action != "respond" && !isADMIN) { errorExit("Only admins can add challenges" ); }

4. BACKUP modules/challenges/browse.php

5. FIND (around line 28)
$output .= "<div id='pagetitle'>"._CHALLENGES."</div><div class="respond"><a href=""modules/challenges/challenges.php?action=add">"._ISSUECHALLENGE."</a></div>".build_alphalinks("browse.php?type=challenges&amp;"," $let);

6. CHANGE TO:
      $output .= "<div id='pagetitle'>"._CHALLENGES."</div>";
      if (isADMIN) $output .= "<div class="respond"><a href=""modules/challenges/challenges.php?action=add">"._ISSUECHALLENGE."</a></div>";"
      $output .= build_alphalinks("browse.php?type=challenges&amp;", $let);

I'm not sure if this will work and if this is all the changes you need to do, since my site if offline... .-.'
Post here if that worked. Hope it helps.


 
Posted : 14/03/2008 12:15 pm
(@kaylashay)
Posts: 11
Active Member
Topic starter
 

That worked! Or at least hasn't caused a problem yet. Thanks!


 
Posted : 16/03/2008 5:53 pm
(@Seiji)
Posts: 0
 

You're welcome... I'm glad it helped (:

I just saw that you need to do again the step 6, the way I wrote only admins will se the page title "Challenges". It's correct now, sorry ^^"


 
Posted : 16/03/2008 11:33 pm
(@kaylashay)
Posts: 11
Active Member
Topic starter
 

Thanks... I was just coming to say that I ran into the problem.


 
Posted : 17/03/2008 12:55 am
(@kaylashay)
Posts: 11
Active Member
Topic starter
 

Okay... I'm running into an error with this.

I tried changing the step six code and receive the following error:

Parse error: parse error, unexpected T_STRING in /home/content/i/h/e/iheartgibbs/html/modules/challenges/browse.php on line 29

I changed the following on browse.php

if (isADMIN) $output .= "<div id='pagetitle'>"._CHALLENGES."</div><div class="respond"><a href=""modules/challenges/challenges.php?action=add">"._ISSUECHALLENGE."</a></div>";"
       $output .= build_alphalinks("browse.php?type=challenges&amp;", $let);

to

 $output .= "<div id='pagetitle'>"._CHALLENGES."</div>";
      if (isADMIN) $output .= "<div class="respond"><a href=""modules/challenges/challenges.php?action=add">"._ISSUECHALLENGE."</a></div>";"
      $output .= build_alphalinks("browse.php?type=challenges&amp;", $let);

 
Posted : 17/03/2008 1:17 am
(@Seiji)
Posts: 0
 

Hummmm... weird, it's working fine here.

Usually "unexpected T_STRING" usually is problem with concatenation.


 
Posted : 20/03/2008 1:46 am
Share: