forked from craigk5n/webcalendar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcss_cacher.php
More file actions
49 lines (38 loc) · 1.28 KB
/
css_cacher.php
File metadata and controls
49 lines (38 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php // $Id: css_cacher.php,v 1.26 2010/08/22 21:03:25 cknudsen Exp $
define( '_ISVALID', true );
include 'includes/translate.php';
include 'includes/config.php';
include 'includes/dbi4php.php';
include 'includes/formvars.php';
include 'includes/functions.php';
do_config( 'includes/settings.php' );
include 'includes/' . $user_inc;
include_once 'includes/access.php';
include_once 'includes/validate.php';
include_once 'includes/gradient.php';
load_global_settings();
@session_start();
$empTmp = ( ! empty( $_SESSION['webcal_tmp_login'] ) );
// If calling script uses 'guest', we must also.
$GLOBALS['user'] = ! empty( $_GET['login'] )
? $_GET['login']
: ( ! empty( $_REQUEST['login'] )
? $_REQUEST['login']
: ( $empTmp
? $_SESSION['webcal_tmp_login']
: ( empty( $_SESSION['webcal_login'] )
? '__public__'
: $_SESSION['webcal_login'] ) ) );
load_user_preferences( $GLOBALS['user'] );
unset( $_SESSION['webcal_tmp_login'] );
// If we are calling from admin or pref, expire CSS yesterday.
// Otherwise, expire tomorrow.
$expTime = time() + 86400;
if( $empTmp )
$expTime = time() - 86400;
header( 'Content-type: text/css' );
header( 'Cache-Control: Public' );
header( 'Pragma: Public' );
send_no_cache_header();
include_once 'includes/css/styles.php';
?>