/[drupal]/contributions/modules/cacherouter/cacherouter.module
ViewVC logotype

Contents of /contributions/modules/cacherouter/cacherouter.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download) (as text)
Fri Dec 26 09:52:36 2008 UTC (10 months, 4 weeks ago) by slantview
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +21 -0 lines
File MIME type: text/x-php
Merge with DRUPAL-7--1
1 <?php
2 /**
3 * $Id: cacherouter.module,v 1.1.2.2 2008/12/26 02:23:54 slantview Exp $
4 *
5 * @file cacherouter.module
6 * @author Steve Rude <steve@slantview.com>
7 */
8
9 /**
10 * Implementation of hook_user
11 *
12 * When logged in you don't want to hit the page_fast_cache or else you will serve
13 * a cached page to a logged in user.
14 */
15 function cacherouter_user($op, &$edit, &$account, $category = NULL) {
16 if (!variable_get('page_cache_fastpath', TRUE)) {
17 return;
18 }
19
20 switch ($op) {
21 case 'login':
22 setcookie('cacherouter', TRUE, time() + (60 * 60 * 24 * 30), '/');
23 break;
24 case 'logout':
25 //Set in past to delete cookie
26 setcookie('cacherouter', TRUE, time() - 3600, '/');
27 break;
28 }
29 }
30
31 function cacherouter_menu() {
32 $items = array();
33
34 $items['admin/settings/cacherouter'] = array(
35 'title' => t('CacheRouter Admin'),
36 'description' => t("View CacheRouter Usage Information."),
37 'page callback' => 'cacherouter_admin_stats_page',
38 'page arguments' => array(3),
39 'access arguments' => array('view cacherouter stats'),
40 'file' => 'cacherouter.admin.inc',
41 );
42
43 return $items;
44 }
45
46 function cacherouter_perm() {
47 return array('view cacherouter stats');
48 }

  ViewVC Help
Powered by ViewVC 1.1.2