forked from MightyGorgon/icy_phoenix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
remove_cookies.php
61 lines (53 loc) · 1.35 KB
/
remove_cookies.php
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
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
*
* @package Icy Phoenix
* @version $Id$
* @copyright (c) 2008 Icy Phoenix
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
*
* @Extra credits for this file
* geocator ([email protected])
*
*/
define('IN_ICYPHOENIX', true);
if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
include(IP_ROOT_PATH . 'common.' . PHP_EXT);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
// End session management
$confirm = ($_POST['confirm'] ? true : false);
if (isset($_POST['cancel']))
{
redirect(append_sid('index.' . PHP_EXT));
}
if ($confirm)
{
$cookies_array = array('u', 'k', 'sid', 'f_all', 'f', 't');
foreach ($cookies_array as $cookie_name)
{
$user->set_cookie($cookie_name, '', time() - 3600);
}
message_die(GENERAL_MESSAGE, $lang['Cookies_deleted']);
}
else
{
// Not confirmed, show confirmation message
$template->set_filenames(array('confirm' => 'confirm_body.tpl'));
$template->assign_vars(array(
'MESSAGE_TITLE' => $lang['Confirm'],
'MESSAGE_TEXT' => $lang['cookies_confirm'],
'L_YES' => $lang['Yes'],
'L_NO' => $lang['No'],
'S_CONFIRM_ACTION' => append_sid('remove_cookies.' . PHP_EXT)
)
);
full_page_generation('confirm_body.tpl', $lang['Delete_cookies'], '', '');
}
?>