| Re: Automatically deleting files in cache/templates_c dir on admin logout |
| by McDonald on 2005/11/8 22:40:09 Thanks for the reply. I will see what I can do with the script. Thanx! |
| Re: Automatically deleting files in cache/templates_c dir on admin logout |
| by Dave_L on 2005/11/8 16:50:58 I recalled a similar issue I dealt with in my chess module by having the submit link only in the main menu, and placing code in the module's xoops_version.php so that the link is only shown to authorized users. Here's the relevant code. le="color: #000000"><?php ... $modversion['sub'][2]['name'] = _MI_CHESS_SMNAME2; $modversion['sub'][2]['url'] = 'index.php'; // Conditional menu items global $xoopsModule, $xoopsModuleConfig, $xoopsUser; if (is_object($xoopsModule) and $xoopsModule->getVar('dirname') == 'chess') { // Display create-game menu item if current user has the play-chess right. if (!empty($xoopsModuleConfig['groups_play']) and is_array($xoopsModuleConfig['groups_play']) and ( in_array(XOOPS_GROUP_ANONYMOUS, $xoopsModuleConfig['groups_play']) or ( is_object($xoopsUser) and count(array_intersect($xoopsUser->getGroups(), $xoopsModuleConfig['groups_play'])) > 0 ) ) ) { $modversion['sub'][3]['name'] = _MI_CHESS_SMNAME3; $modversion['sub'][3]['url'] = 'create.php'; } // Display ratings menu item if ratings system is enabled. if ($xoopsModuleConfig['rating_system'] != 'none') { $modversion['sub'][4]['name'] = _MI_CHESS_SMNAME4; $modversion['sub'][4]['url'] = 'ratings.php'; } // Display my-games menu item if current user is logged in. if (is_object($xoopsUser)) { $modversion['sub'][5]['name'] = _MI_CHESS_SMNAME5; $modversion['sub'][5]['url'] = 'player_stats.php?player_uid=' . $xoopsUser->getVar('uid'); } } ...
|
| Re: Automatically deleting files in cache/templates_c dir on admin logout |
| by McDonald on 2005/11/8 15:43:32 I prefer to have caching enabled to speed up my site because WF-Links is using 165 categories and over 1300 links. I think actually that the solution for this should be in the module and not in XOOPS itself. |
| Re: Automatically deleting files in cache/templates_c dir on admin logout |
| by Dave_L on 2005/11/8 15:08:14 That's the main headache of caching: how to cache a page that contains user-specific information. For modules in which I've had the problem, I've solved it by disabling caching for those pages. There might be a better solution for your case, but I'm not familiar with the WF-Links module. |
| Re: Automatically deleting files in cache/templates_c dir on admin logout |
| by McDonald on 2005/11/8 13:56:20 I am using WF-Links on my frontpage and only registered visitors can submit a link. This means that when somebody signs in the 'Submit link' option will be visible to him/her and otherwise not. Recently I noticed that when cache has been selected for WF-Links that 'Submit link' stays visible after logging out. When clicking 'Submit link' you're taken for a short while to the admin panel with a 'Sorry, you don't have permission' message. I don't mind the message but I don't like it that anonymous visitors are taken to the admin panel even for a short time. So I thought that automatically cleaning the 2 folders would solve the problem. It should not only do this for admins but also when a registered visitor logs out of course. I have the module to clean the templates_c folder installed. |