HACK名称: 清除Cookies[整理版]
整理者: KBO(HKpDev.)
原作者: 不详
修改程序: include/globel.php, member.php
修改模版: footer.htm
安装难度: 低
发布日期: 19-09-2005 23:00
声明: 这个是我自行修改的,有点程序参考了其他HACK,如有冒犯 抱歉抱歉
1.1 在include/globel..php中查找(就是清除cookies的function)
- function clearcookies() {
- global $timestamp, $cookiepath, $cookiedomain, $discuz_uid, $discuz_user, $discuz_pw, $discuz_secques, $adminid, $groupid, $credit;
- setcookie('_discuz_uid', '', $timestamp - 86400 * 365, $cookiepath, $cookiedomain);
- setcookie('_discuz_pw', '', $timestamp - 86400 * 365, $cookiepath, $cookiedomain);
- setcookie('_discuz_secques', '', $timestamp - 86400 * 365, $cookiepath, $cookiedomain);
- $groupid = 7;
- $discuz_uid = $adminid = $credit = 0;
- $discuz_user = $discuz_pw = $discuz_secques = '';
- }
复制代码
替换为(装了浏览主题密码的删除代码中的"//")
- function clearcookies() {
- global $timestamp, $cookiepath, $cookiedomain, $discuz_uid, $discuz_user, $discuz_pw, $discuz_secques, $adminid, $groupid, $credit;
- setcookie('_discuz_uid', '', $timestamp - 86400 * 365, $cookiepath, $cookiedomain);
- setcookie('_discuz_pw', '', $timestamp - 86400 * 365, $cookiepath, $cookiedomain);
- setcookie('_discuz_secques', '', $timestamp - 86400 * 365, $cookiepath, $cookiedomain);
- setcookie('onlinedetail', 0, $timestamp - 86400 * 365, $cookiepath, $cookiedomain);
- setcookie('sid', '', $timestamp - 86400 * 365, $cookiepath, $cookiedomain);
- setcookie("fidpw$fid", '', $timestamp - 86400 * 365, $cookiepath, $cookiedomain);
- // setcookie("tidpw$tid", '', $timestamp - 86400 * 365, $cookiepath, $cookiedomain);
- setcookie('oldtopics', '', $timestamp - 86400 * 365, $cookiepath, $cookiedomain);
- setcookie('cookietime', '', $timestamp - 86400 * 365, $cookiepath, $cookiedomain);
- setcookie('_cookietime', '', $timestamp - 86400 * 365, $cookiepath, $cookiedomain);
- setcookie('expand_menu', '', $timestamp - 86400 * 365, $cookiepath, $cookiedomain);
- $groupid = 7;
- $styleid = $_DCACHE['settings']['styleid'];
- $discuz_uid = $adminid = $credit = 0;
- if($adminid >0){
- $query = $db->query("DELETE FROM $table_adminsessions WHERE sid='$sid' OR dateline<$timestamp-3600", 'SILENT');
- }
- $discuz_user = $discuz_pw = $discuz_secques = '';
- }
复制代码
2.1 在member.php中查找
- } else {
- showmessage('undefined_action', NULL, 'HALTED');
复制代码
之上加入
- //清除所有cookies操作 FOR Discuz! 2.5 BY KBO(HKpDev.)
- } elseif($action == 'clearallcookies') {
- clearcookies();
- showmessage('所有cookies均已清除!', dreferer());
- //结束
复制代码
3.1 在footer.htm中查找
- <a href="$siteurl" class="mediumtxt" target="_blank">$sitename</a>
复制代码
在后加入
- - <a href="member.php?action=clearallcookies" class="mediumtxt">清除Cookies</a>
复制代码
完成 |