<?php
require_once __DIR__ . '/../MPHX/common.php';

if (is_admin_login()) {
    header('Location: /admin/index.php');
    exit;
}
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>后台登录 - 宝塔主机管理系统</title>
    <link rel="stylesheet" href="/static/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/css/all.min.css">
    <link rel="stylesheet" href="css/login.css">
</head>
<body>
    <div class="login-box">
        <div class="login-header">
            <i class="fas fa-server"></i>
            <h2>后台登录</h2>
            <p>MLEOE宝塔系统</p>
        </div>
        <form id="loginForm">
            <div class="form-group">
                <label for="user">用户名</label>
                <input type="text" class="form-control" id="user" name="user" required autofocus placeholder="请输入用户名">
            </div>
            <div class="form-group">
                <label for="pass">密码</label>
                <input type="password" class="form-control" id="pass" name="pass" required placeholder="请输入密码">
            </div>
            <?php if ($conf['yzm'] == 'true'): ?>
            <div class="form-group">
                <label for="code">验证码</label>
                <div class="captcha-box">
                    <input type="text" class="form-control" id="code" name="code" required placeholder="请输入验证码">
                    <img src="code.php" onclick="this.src='code.php?t='+Math.random()" title="点击刷新">
                </div>
            </div>
            <?php endif; ?>
            <button type="button" class="btn btn-primary btn-login" onclick="login(this)">
                <i class="fas fa-sign-in-alt"></i> 登录
            </button>
        </form>
        <div class="text-center mt-3">
            <a href="../user/login.php" class="text-muted">用户登录</a>
        </div>
    </div>
    
    <script src="/static/js/jquery.min.js"></script>
    <script src="js/login.js"></script>
</body>
</html>