1 Star 0 Fork 3

lping/phpredisadmin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
logout.php 1.11 KB
一键复制 编辑 原始数据 按行查看 历史
Erik Dubbelboer 提交于 2019-09-27 20:10 . Make all paths relative
<?php
require_once 'includes/common.inc.php';
if (!empty($config['cookie_auth'])) {
// Cookie-based auth
setcookie('phpRedisAdminLogin', '', 1);
header("Location: login.php");
die();
} else {
// HTTP Digest auth
$needed_parts = array(
'nonce' => 1,
'nc' => 1,
'cnonce' => 1,
'qop' => 1,
'username' => 1,
'uri' => 1,
'response' => 1
);
$data = array();
$keys = implode('|', array_keys($needed_parts));
preg_match_all('/('.$keys.')=(?:([\'"])([^\2]+?)\2|([^\s,]+))/', $_SERVER['PHP_AUTH_DIGEST'], $matches, PREG_SET_ORDER);
foreach ($matches as $m) {
$data[$m[1]] = $m[3] ? $m[3] : $m[4];
unset($needed_parts[$m[1]]);
}
if (!isset($_GET['nonce'])) {
header('Location: logout.php?nonce='.$data['nonce']);
die;
}
if ($data['nonce'] == $_GET['nonce']) {
unset($_SERVER['PHP_AUTH_DIGEST']);
if (!empty($config['cookie_auth'])) {
$login = authCookie();
} else {
$login = authHttpDigest();
}
}
header('Location: logout.php');
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/lpings/phpredisadmin.git
git@gitee.com:lpings/phpredisadmin.git
lpings
phpredisadmin
phpredisadmin
master

搜索帮助