I try to summarize what was this four hours-to-solve problem :D
Well, in portal and in forum index I have the Quick Links block. I modified it in order to let some link to be shown only by admin, here's the code:
- <div id="main_links2" style="display: none; position: relative; padding-top: 0px; padding-bottom: 0px;">
- <table border="0" cellpadding="0" cellspacing="4" width="100%" class="forumline-no2">
- <tbody>
- <!-- BEGIN mg_switch_user_is_admin -->
- <tr>
- <td align="left" width="8">{IMG_ARROW_RIGHT}</td>
- <td class="genmed" align="left">{ADMIN_LINK}</a></td>
- </tr>
- <!-- END mg_switch_user_is_admin -->
and
- <!-- BEGIN mg_switch_user_is_admin -->
- <tr>
- <td width="8" align="left" valign="middle">{IMG_ARROW_RIGHT}</td>
- <td class="genmed" align="left"><a href="{U_DOWNLOADS}">{L_DOWNLOADS}</a></td>
- </tr>
- <tr>
- <td width="8" align="left" valign="middle">{IMG_ARROW_RIGHT}</td>
- <td class="genmed" align="left"><a href="{U_DB_GEN}">{L_DB_GEN}</a></td>
- </tr>
- <tr>
- <td width="8" align="left" valign="middle">{IMG_ARROW_RIGHT}</td>
- <td class="genmed" align="left"><a href="{U_SUDOKU}">{L_SUDOKU}</a></td>
- </tr>
- <!-- END mg_switch_user_is_admin -->
- </tbody>
- </table>
- </div>
and in "Info" section
- <div id="info_links2" style="display: none; position: relative;">
- <table border="0" cellpadding="0" cellspacing="4" width="100%" class="forumline-no2">
- <tbody>
- <!-- BEGIN mg_switch_user_is_admin -->
- <tr>
- <td width="8" align="left" valign="middle">{IMG_ARROW_RIGHT}</td>
- <td class="genmed" align="left"><a href="{U_HACKS_LIST}">{L_HACKS_LIST}</a></td>
- </tr>
- <tr>
- <td width="8" align="left" valign="middle">{IMG_ARROW_RIGHT}</td>
- <td class="genmed" align="left"><a href="{U_REFERRERS}">{L_REFERRERS}</a></td>
- </tr>
- <!-- END mg_switch_user_is_admin -->
- <tr>
- <td width="8" align="left" valign="middle">{IMG_ARROW_RIGHT}</td>
- <td class="genmed" align="left"><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></td>
- </tr>
- <!-- BEGIN mg_switch_user_is_admin -->
- <tr>
- <td width="8" align="left" valign="middle">{IMG_ARROW_RIGHT}</td>
- <td class="genmed" align="left"><a href="{U_STATISTICS}">{L_STATISTICS}</a></td>
- </tr>
- <tr>
- <td width="8" align="left" valign="middle">{IMG_ARROW_RIGHT}</td>
- <td class="genmed" align="left"><a href="{U_SITE_HIST}">{L_SITE_HIST}</a></td>
- </tr>
- <!-- END mg_switch_user_is_admin -->
- </tbody>
- </table>
Very simple, I just used the user_is_admin switch in order to disable some links to users.
Yesterday, navigating the ACP I saw two users playing sudoku, which should have been disabled (I'm monitoring query usage, XS is not kinda... light :D ), as you can see from the code. I checked the code but I was sure nobody (other admins) had touched it, and so it was. I tried anyway to change something in the code just to see what happened when I saw a thing that astonished me: users and guests could see ACP link and try login.
I spent a lot of time looking for some error in the code but I was wrong 'cause the problem wasn't there. But changing the nav_quick_links.tpl I could see that the Quick Links block in forum index was modified by my changes and the block in portal index wasn't.
So I found it was a caching problem.
So, caching THAT block in portal (I suppose in forum index it's not cached?) causes a very "funny" thing... If I empty the cache I can see what follows:
- Empty cache, an admin logins and load the portal, even guests can see all links.
- Empty cache, a user (even guest) without admin privileges load the portal, admin doesn't see the links as if he wasn't admin.
In a few words first to come decides... :mrblue: (now I'm laughing 'cause I don't want to bore you more than necessary, but I stayed up till four am :( )
Ok then... I solved for now disabling caching system, but this obviously causes my portal index to generate more than FIFTY queries... and I cannot effort such amount.
Another solution could be totally remove the links... but I'd like to solve it less brutally...
Sincerely I don't know when this thing started, I found it yesterday. Anyway I don't think it has always been like that 'cause when I modified the switch I tested it as admin, user and guest and all worked fine.
Well I think it's all... any suggestion?
