ecshop 本地测试登陆时为什么默认执行的是privilege.php而不是index.php
从代码中并没又找到ECSHOP有修改aphache配置的地方,那为什么在浏览器中打上localhost/ecshop/admin/之后就默认知性privilege.php...
从代码中并没又找到ECSHOP有修改aphache配置的地方,那为什么在浏览器中打上localhost/ecshop/admin/之后就默认知性privilege.php?不是应该先执行index.php吗?而且index.php中也没有判断跳转privilege.php的语句啊
展开
3个回答
展开全部
肯定有的你看下admin/includes/init.php下这段代码。没登陆。肯定是跳转到登陆页面了
/* 验证管理员身份 */
if ((!isset($_SESSION['admin_id']) || intval($_SESSION['admin_id']) <= 0) &&
$_REQUEST['act'] != 'login' && $_REQUEST['act'] != 'signin' &&
$_REQUEST['act'] != 'forget_pwd' && $_REQUEST['act'] != 'reset_pwd' && $_REQUEST['act'] != 'check_order')
{
/* session 不存在,检查cookie */
if (!empty($_COOKIE['ECSCP']['admin_id']) && !empty($_COOKIE['ECSCP']['admin_pass']))
{
// 找到了cookie, 验证cookie信息
$sql = 'SELECT user_id, user_name, password, action_list, last_login ' .
' FROM ' .$ecs->table('admin_user') .
" WHERE user_id = '" . intval($_COOKIE['ECSCP']['admin_id']) . "'";
$row = $db->GetRow($sql);
if (!$row)
{
// 没有找到这个记录
setcookie($_COOKIE['ECSCP']['admin_id'], '', 1);
setcookie($_COOKIE['ECSCP']['admin_pass'], '', 1);
if (!empty($_REQUEST['is_ajax']))
{
make_json_error($_LANG['priv_error']);
}
else
{
ecs_header("Location: privilege.php?act=login\n");
}
exit;
}
else
{
// 检查密码是否正确
if (md5($row['password'] . $_CFG['hash_code']) == $_COOKIE['ECSCP']['admin_pass'])
{
!isset($row['last_time']) && $row['last_time'] = '';
set_admin_session($row['user_id'], $row['user_name'], $row['action_list'], $row['last_time']);
// 更新最后登录时间和IP
$db->query('UPDATE ' . $ecs->table('admin_user') .
" SET last_login = '" . gmtime() . "', last_ip = '" . real_ip() . "'" .
" WHERE user_id = '" . $_SESSION['admin_id'] . "'");
}
else
{
setcookie($_COOKIE['ECSCP']['admin_id'], '', 1);
setcookie($_COOKIE['ECSCP']['admin_pass'], '', 1);
if (!empty($_REQUEST['is_ajax']))
{
make_json_error($_LANG['priv_error']);
}
else
{
ecs_header("Location: privilege.php?act=login\n");
}
exit;
}
}
}
else
{
if (!empty($_REQUEST['is_ajax']))
{
make_json_error($_LANG['priv_error']);
}
else
{
ecs_header("Location: privilege.php?act=login\n");
}
exit;
}
}
/* 验证管理员身份 */
if ((!isset($_SESSION['admin_id']) || intval($_SESSION['admin_id']) <= 0) &&
$_REQUEST['act'] != 'login' && $_REQUEST['act'] != 'signin' &&
$_REQUEST['act'] != 'forget_pwd' && $_REQUEST['act'] != 'reset_pwd' && $_REQUEST['act'] != 'check_order')
{
/* session 不存在,检查cookie */
if (!empty($_COOKIE['ECSCP']['admin_id']) && !empty($_COOKIE['ECSCP']['admin_pass']))
{
// 找到了cookie, 验证cookie信息
$sql = 'SELECT user_id, user_name, password, action_list, last_login ' .
' FROM ' .$ecs->table('admin_user') .
" WHERE user_id = '" . intval($_COOKIE['ECSCP']['admin_id']) . "'";
$row = $db->GetRow($sql);
if (!$row)
{
// 没有找到这个记录
setcookie($_COOKIE['ECSCP']['admin_id'], '', 1);
setcookie($_COOKIE['ECSCP']['admin_pass'], '', 1);
if (!empty($_REQUEST['is_ajax']))
{
make_json_error($_LANG['priv_error']);
}
else
{
ecs_header("Location: privilege.php?act=login\n");
}
exit;
}
else
{
// 检查密码是否正确
if (md5($row['password'] . $_CFG['hash_code']) == $_COOKIE['ECSCP']['admin_pass'])
{
!isset($row['last_time']) && $row['last_time'] = '';
set_admin_session($row['user_id'], $row['user_name'], $row['action_list'], $row['last_time']);
// 更新最后登录时间和IP
$db->query('UPDATE ' . $ecs->table('admin_user') .
" SET last_login = '" . gmtime() . "', last_ip = '" . real_ip() . "'" .
" WHERE user_id = '" . $_SESSION['admin_id'] . "'");
}
else
{
setcookie($_COOKIE['ECSCP']['admin_id'], '', 1);
setcookie($_COOKIE['ECSCP']['admin_pass'], '', 1);
if (!empty($_REQUEST['is_ajax']))
{
make_json_error($_LANG['priv_error']);
}
else
{
ecs_header("Location: privilege.php?act=login\n");
}
exit;
}
}
}
else
{
if (!empty($_REQUEST['is_ajax']))
{
make_json_error($_LANG['priv_error']);
}
else
{
ecs_header("Location: privilege.php?act=login\n");
}
exit;
}
}
展开全部
肯定有的你看下admin/includes/init.php下这段代码。没登陆。肯定是跳转到登陆页面了
/* 验证管理员身份 */
if ((!isset($_SESSION['admin_id']) || intval($_SESSION['admin_id']) <= 0) &&
$_REQUEST['act'] != 'login' && $_REQUEST['act'] != 'signin' &&
$_REQUEST['act'] != 'forget_pwd' && $_REQUEST['act'] != 'reset_pwd' && $_REQUEST['act'] != 'check_order')
{
/* session 不存在,检查cookie */
if (!empty($_COOKIE['ECSCP']['admin_id']) && !empty($_COOKIE['ECSCP']['admin_pass']))
{
// 找到了cookie, 验证cookie信息
$sql = 'SELECT user_id, user_name, password, action_list, last_login ' .
' FROM ' .$ecs->table('admin_user') .
" WHERE user_id = '" . intval($_COOKIE['ECSCP']['admin_id']) . "'";
$row = $db->GetRow($sql);
if (!$row)
{
// 没有找到这个记录
setcookie($_COOKIE['ECSCP']['admin_id'], '', 1);
setcookie($_COOKIE['ECSCP']['admin_pass'], '', 1);
if (!empty($_REQUEST['is_ajax']))
{
make_json_error($_LANG['priv_error']);
}
else
{
ecs_header("Location: privilege.php?act=login\n");
}
exit;
}
else
{
// 检查密码是否正确
if (md5($row['password'] . $_CFG['hash_code']) == $_COOKIE['ECSCP']['admin_pass'])
{
!isset($row['last_time']) && $row['last_time'] = '';
set_admin_session($row['user_id'], $row['user_name'], $row['action_list'], $row['last_time']);
// 更新最后登录时间和IP
$db->query('UPDATE ' . $ecs->table('admin_user') .
" SET last_login = '" . gmtime() . "', last_ip = '" . real_ip() . "'" .
" WHERE user_id = '" . $_SESSION['admin_id'] . "'");
}
else
{
setcookie($_COOKIE['ECSCP']['admin_id'], '', 1);
setcookie($_COOKIE['ECSCP']['admin_pass'], '', 1);
if (!empty($_REQUEST['is_ajax']))
{
make_json_error($_LANG['priv_error']);
}
else
{
ecs_header("Location: privilege.php?act=login\n");
}
exit;
}
}
}
else
{
if (!empty($_REQUEST['is_ajax']))
{
make_json_error($_LANG['priv_error']);
}
else
{
ecs_header("Location: privilege.php?act=login\n");
}
exit;
}
}
/* 验证管理员身份 */
if ((!isset($_SESSION['admin_id']) || intval($_SESSION['admin_id']) <= 0) &&
$_REQUEST['act'] != 'login' && $_REQUEST['act'] != 'signin' &&
$_REQUEST['act'] != 'forget_pwd' && $_REQUEST['act'] != 'reset_pwd' && $_REQUEST['act'] != 'check_order')
{
/* session 不存在,检查cookie */
if (!empty($_COOKIE['ECSCP']['admin_id']) && !empty($_COOKIE['ECSCP']['admin_pass']))
{
// 找到了cookie, 验证cookie信息
$sql = 'SELECT user_id, user_name, password, action_list, last_login ' .
' FROM ' .$ecs->table('admin_user') .
" WHERE user_id = '" . intval($_COOKIE['ECSCP']['admin_id']) . "'";
$row = $db->GetRow($sql);
if (!$row)
{
// 没有找到这个记录
setcookie($_COOKIE['ECSCP']['admin_id'], '', 1);
setcookie($_COOKIE['ECSCP']['admin_pass'], '', 1);
if (!empty($_REQUEST['is_ajax']))
{
make_json_error($_LANG['priv_error']);
}
else
{
ecs_header("Location: privilege.php?act=login\n");
}
exit;
}
else
{
// 检查密码是否正确
if (md5($row['password'] . $_CFG['hash_code']) == $_COOKIE['ECSCP']['admin_pass'])
{
!isset($row['last_time']) && $row['last_time'] = '';
set_admin_session($row['user_id'], $row['user_name'], $row['action_list'], $row['last_time']);
// 更新最后登录时间和IP
$db->query('UPDATE ' . $ecs->table('admin_user') .
" SET last_login = '" . gmtime() . "', last_ip = '" . real_ip() . "'" .
" WHERE user_id = '" . $_SESSION['admin_id'] . "'");
}
else
{
setcookie($_COOKIE['ECSCP']['admin_id'], '', 1);
setcookie($_COOKIE['ECSCP']['admin_pass'], '', 1);
if (!empty($_REQUEST['is_ajax']))
{
make_json_error($_LANG['priv_error']);
}
else
{
ecs_header("Location: privilege.php?act=login\n");
}
exit;
}
}
}
else
{
if (!empty($_REQUEST['is_ajax']))
{
make_json_error($_LANG['priv_error']);
}
else
{
ecs_header("Location: privilege.php?act=login\n");
}
exit;
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
其实是一样的
ecshop后台的首页地址有是 index.php。
但是进去之后会跳转到privilege.php。
如果你要修改首页部分的代码也可以看看 templates
目录里 index.html.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询