<?php     session_start();  
include 'language/languagefile.php';

if ($set_theme==""){
    $set_theme="day-theme";
}
$tableName = 'onlineconvert_reg'; // 替换为你的表名  

$user_name="";// 用户名
$user_email="";// 用户邮箱
$user_reg_type=""; // 注册类型
$user_usd_day="";// 还有多少天
$user_alltime=""; // 总计分30天和365天
$user_reg_time=""; // 注册时间
$user_reg_string=""; // 生成字符串用于判断

//生成字符串
function generate_password1($length = 30)
{
  // 密码字符集，可任意添加你需要的字符  
  $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
  $password = '';
  for ($i = 0; $i < $length; $i++) {
    $password .= $chars[mt_rand(0, strlen($chars) - 1)];
  }
  return $password;
}

function validateLogin($email, $conn, $tableName) {  
    global $user_name,$user_email,$user_usd_day,$user_alltime,$user_reg_time,$user_reg_type,$user_reg_string;
    // 预处理SQL语句，用于查询用户  
    $stmt = $conn->prepare("SELECT * FROM " . $tableName . " WHERE email = ?");  
      
    // 绑定参数  
    $stmt->bind_param("s", $email);  
      
    // 执行查询  
    $stmt->execute();  
      
    // 获取结果  
    $result = $stmt->get_result();  
    $user = $result->fetch_assoc();  
      
    // 检查用户是否存在  
    if ($user) {
            // 注册时间  
            $specifiedTime = $user['signup_date']; 
            
            // 创建DateTime对象表示指定时间  
            $dateTime = new DateTime($specifiedTime);  
            
            // 创建DateTime对象表示当前时间  
            $now = new DateTime();  
            
            if (stripos($user['user_type'], "year") !== false) {  
            // 将指定时间加一年  
            $dateTime->modify('+365 days');  
            $alltime=365;
            }else{
            // 将指定时间加一个月  
            $dateTime->modify('+30 days');  
            $alltime=30;
            }

            // 获取两个DateTime对象的时间戳  
            $nowTimestamp = $now->getTimestamp();  
            $dateTimeTimestamp = $dateTime->getTimestamp();  
            
            // 计算时间戳之间的差异（秒）  
            $differenceInSeconds = $dateTimeTimestamp - $nowTimestamp;  
            
            // 将秒转换为天（注意：这里我们假设一天有86400秒）  
            $differenceInDays = floor($differenceInSeconds / 86400);  
            
            // 如果结果为负数，表示$now晚于$dateTime（即已过期），我们可以取绝对值来获取天数差  
            // 但通常我们会以不同的方式处理这种情况，比如输出“已过期”  
            if ($differenceInDays < 0) {
                $usertime="expired";
            } else {  
                $usertime="valid";
            }

            //有效内是valid, expired是过期
            if ($usertime=="valid"){
                $user_name=$user['username'];// 用户名
                $user_email=$email;// 用户邮箱
                $user_reg_type=$user['user_type'];
                $user_usd_day=$differenceInDays; // 还有多少天
                $user_alltime=$alltime; // 总计分30天和365天
                $user_reg_time=$specifiedTime; // 注册时间
                $user_reg_string=generate_password1(); // 生成字符串用于判断

                // SQL语句  
                $sql = "UPDATE onlineconvert_reg SET reset = ? WHERE username = ? AND email = ?";
                // 准备语句  
                $stmt = $conn->prepare($sql);  
                // 绑定参数  
                $stmt->bind_param("sss", $user_reg_string, $user_name, $user_email);  
                // 执行语句  
                $stmt->execute();
                // 用户和密码验证成功，并且使用在有效内。
                return "valid";
            }else{
                // 用户和密码验证成功，但是使用期过期。
                return "expired";
            }

    } else {  
        // 用户不存在  
        return "user_error"; // 登录失败  
    }  
      
    // 关闭语句  
    $stmt->close();  
      
    // 注意：通常不需要在这里关闭数据库连接，因为它可能在其他地方被重用  
    $conn->close();  
}

$setshow="";
// 示例用法  
if ($_SERVER["REQUEST_METHOD"] == "POST") {  
    include 'mysql/mysql_link.php';
    // 设置字符集为utf8mb4  
    $conn->set_charset("utf8mb4");  
    $username = $_POST['username'] ?? '';  


    // 检查CSRF Token  
    if (!isset($_POST['csrf_token']) || $_POST['csrf_token'] !== $_SESSION['csrf_token']) {  
        $setshow="error";
        $infor_title=$forgot_tip;
        $infor_str=$forgot_tipstr;
    }else{
        $getvalid=validateLogin($username, $conn, $tableName);  
        switch ($getvalid) {
            case 'valid':
                include 'onlineconvert/forgot_send_email.php';
                $setshow = "info";
                $infor_title = $forgot_send;
                $infor_str = $forgot_sendstr;
                break;
            case 'expired':
                $setshow = "warning";
                $infor_title = $forgot_warning;
                $infor_str = $forgot_warningstr.", <a href='".$wwwurl."/pricing'>".$register_user."</a>";
                break;
            case 'user_error':
                $setshow = "error";
                $infor_title = $forgot_error;
                $infor_str = $forgot_errorstr.", <a href='".$wwwurl."/pricing'>".$register_user."</a>";
                break;
        }
    }
}else{
    // 检查是否已存在CSRF Token，如果不存在则生成一个新的  
    if (!isset($_SESSION['csrf_token'])) {  
        // 使用openssl_random_pseudo_bytes函数生成一个安全的随机字符串  
        $_SESSION['csrf_token'] = bin2hex(openssl_random_pseudo_bytes(32));  
    }  
}
?><!doctype html>
<html lang="<?php echo $c_lang; ?>">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700&display=swap" rel="stylesheet">
    <title>OnlineConvert - <?php echo $user_title;?></title>
    <script src="./js/jquery-3.2.1.min.js"></script>
    <script>
        var confirm_ok="<?php echo $confirm_ok;?>";
        var cancel_ok="<?php echo $cancel_ok;?>";
    </script>
    <script src="./js/NZ-MsgBox.min.js"></script>
    <script src="./js/NZ-Drag.min.js"></script>
    <link rel="stylesheet" href="./css/login.css">
    <link rel="icon" type="image/png" sizes="32x32" href="<?php echo $wwwurl;?>/favicon/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="<?php echo $wwwurl;?>/favicon/favicon-16x16.png">
    <link rel="manifest" href="<?php echo $wwwurl;?>/favicon/site.webmanifest">
    <link rel="mask-icon" href="<?php echo $wwwurl;?>/favicon/safari-pinned-tab.svg" color="#5bbad5">
    <link rel="shortcut icon" href="<?php echo $wwwurl;?>/favicon/favicon.ico">
    <meta name="apple-mobile-web-app-title" content="<?php echo $oc_title;?>">
    <meta name="application-name" content="<?php echo $oc_title;?>">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="msapplication-TileColor" content="#2b5797">
    <meta name="msapplication-config" content="<?php echo $wwwurl;?>/favicon/browserconfig.xml">
    <meta name="theme-color" content="#ffffff">
    <script src="./js/iconfont.js" type="text/javascript"></script>
</head>
<body class="<?php echo $set_theme;?>">

    <div class="d-lg-flex half">
        <div class="bg order-1 order-md-2"><img style="display:block; margin-bottom:32px;max-width:320px;" src="./img/Reset-password.svg" alt="OnlineConvert">
            <h1 class="title2"><?php echo $forgot_title;?></h1>
            <p><?php echo $forgot_titlestr;?></p>
        </div>
        <div class="contents order-2 order-md-1">


            <div class="container">
                <div class="row align-items-center justify-content-center">
                    <div class="col-md-7">


                        <div class="mb-4" style="text-align: center;">
                        <a class="onlineicon" href="<?php echo $wwwurl;?>">
                    <svg viewBox="0 0 414.56 75.2" style="height: 40px;" xmlns="http://www.w3.org/2000/svg"><path d="m283.91 49.96c-1.1 3.7-3.8 6.6-8.8 6.6-6.7 0-10.3-5.4-10.3-12s3.5-12.1 10.3-12.1c5.1 0 8.1 2.8 8.8 6.7h-1.8c-1.1-3.1-3.1-5.1-7.1-5.1-5.8 0-8.3 5.4-8.3 10.5s2.4 10.3 8.4 10.3c3.8 0 5.7-2 7-4.8-.1-.1 1.8-.1 1.8-.1z" fill="#dc3e15"></path><path d="m302.01 47.86c0 4.7-2.6 8.8-7.6 8.8-4.6 0-7.3-3.7-7.3-8.8 0-4.8 2.7-8.8 7.5-8.8 4.3 0 7.4 3.5 7.4 8.8zm-13.3 0c0 3.9 2.1 7.2 5.7 7.2s5.6-3 5.6-7.2c0-3.9-2-7.2-5.7-7.2-3.8-.1-5.6 3.2-5.6 7.2z" fill="#dc3e15"></path><path d="m306.11 43.66v-4.3h1.7c.1.5.1 2.7.1 3.2.7-1.7 2-3.6 5.5-3.6 3 0 5.6 1.7 5.6 6.4v10.9h-1.8v-10.7c0-3-1.3-4.9-4.2-4.9-3.9 0-5.4 3.4-5.4 7.1v8.5h-1.7z" fill="#dc3e15"></path><path d="m343.31 50.76c2.3 3.7 5.4 4.9 8.3 3.3 2.7-1.6 2.8-3.7 2.6-5.2l1.4-.9c.5 2.3.3 5.4-3.3 7.4-4.4 2.6-8.3-.2-10.5-3.8-2.5-4.2-2.5-8.9 1.7-11.5 4.5-2.7 8.2.3 9.8 3.1.2.3.5.8.7 1.2zm8.5-6.8c-1.7-2.9-4.7-4.2-7.4-2.5-3 1.8-3.1 4.7-1.6 7.9z" fill="#4caf50"></path><path d="m359.11 43.96v-4.6h1.7c0 .5.1 1.6.1 3.7 1-2.5 3.2-4.1 5.8-4.2v1.8c-3.5.2-5.8 2.7-5.8 6.6v8.8h-1.8z" fill="#dc3e15"></path><path d="m368.41 39.36h3.2v-5.3h1.7v5.3h3.9v1.6h-3.9v10.9c0 1.9.3 3 2 3 .5 0 1.2 0 1.8-.2v1.5c-.6.2-1.4.3-2 .3-2.1 0-3.4-1.1-3.4-3.7v-11.8h-3.2v-1.6z" fill="#dc3e15"></path><path d="m380.91 47.96c0 4.4 2.1 7.1 5.4 7.1s4.3-1.8 4.8-3.2h1.7c-.7 2.1-2.5 4.8-6.6 4.8-5.2 0-7.1-4.4-7.1-8.8 0-4.8 2.4-8.9 7.3-8.9 5.2 0 6.9 4.5 6.9 7.6v1.4zm10.7-1.5c0-3.4-1.9-6-5.2-6-3.5 0-5.1 2.4-5.4 6z" fill="#dc3e15"></path><path d="m397.41 43.96v-4.6h1.7c0 .5.1 1.6.1 3.7 1-2.5 3.2-4.1 5.8-4.2v1.8c-3.5.2-5.8 2.7-5.8 6.6v8.8h-1.7z" fill="#dc3e15"></path><path d="m290.31 32.46h31.6l8.4 23.8h2l6.4-17h-1.8l-5.6 15.4-8.3-23.6h-32.6z" fill="#4caf50"></path><path d="m365.21 17.76 35.4-8c4.3-.9 8.4 1.7 9.4 6 .9 4.3-1.7 8.4-6 9.4l-35.4 8c-4.3.9-8.4-1.7-9.4-6-.9-4.2 1.8-8.4 6-9.4z" fill="#4caf50"></path><path d="m365.41 30.36c-.1-.4 0-.7.2-1s.5-.5.9-.6.7 0 1 .2.5.5.6.9 0 .7-.2 1-.5.5-.9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1-3-1s-2.2.3-3.1 1-1.6 1.6-2.1 2.8-.8 2.7-.8 4.3z"></path></g><path d="m89.58 28.41-.94.86c-6.49-.84-10.76 2.61-15.16 7.18-6.54 6.78-12.65 14-18.67 21.27l-1.88.69c.12.23-.05.4-.5.52-10.48 0-28.15 1.44-37.64-.52l1.75-2.78c12.08-13.18 23.94-26.36 35.58-39.54l1.3-.08c2.5-2.64 5.77-6.41 8.68-8.78 14.71-12 32.49 3.97 27.48 21.19z" fill="#fabb05"></path><path d="m24.2 26.34c-6.81 7.33-13.1 15.32-20.31 22.24-4.86-13.86 6.69-27.44 20.31-22.24z" fill="#4285f3"></path><path d="m95.27 32.03c-.55-.51-5.29-3.52-5.69-3.62-4.52-1.12-10.26.93-13.62 4.14-7.45 7.12-16.37 17.79-23.04 25.85-.11.13-.48.17-.5.52 10.85 0 24.72 1.08 35.17 0 12.18-1.26 16.59-18.64 7.68-26.89z" fill="#e64100"></path><path d="m46.49 11.86c-1.22-.19-4.2-.16-5.45 0-5.41.71-12.89 10.23-16.84 14.48l-1.45.58c-5.89 6.2-11.73 12.51-17.51 18.91l-1.35 2.75c1.73 4.94 5.98 8.81 10.9 9.83 12.6-12.96 24.56-26.58 36.9-39.81.71-.76 1.13-1.96 1.73-2.59-1.49-1.73-4.78-3.81-6.93-4.14z" fill="#00a90c"></path></svg>
  </a>
                            <a class="onlineicon-dark" href="<?php echo $wwwurl;?>">
                            <img src="./img/gray-dark.svg">
                            </a>
                            <a class="onlineicon-day" href="<?php echo $wwwurl;?>">
                            <img src="./img/gray.svg">
                            </a>
                            <h3><?php echo $reset_password;?></h3>
                            <p><?php echo $reset_passwordstr;?></p>
                        </div>
                        <form method="post" id="loginForm">
                            <div class="form-group first">
                                <label class="username" for="username"><?php echo $user_ee;?>:</label>
                                <svg class="icon" style="width: 1em;height: 1em;vertical-align: middle;fill: #4CAF50;overflow: hidden;position: absolute;top: 33px;left: 22px;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6590"><path d="M874.666667 181.333333H149.333333c-40.533333 0-74.666667 34.133333-74.666666 74.666667v512c0 40.533333 34.133333 74.666667 74.666666 74.666667h725.333334c40.533333 0 74.666667-34.133333 74.666666-74.666667V256c0-40.533333-34.133333-74.666667-74.666666-74.666667z m-725.333334 64h725.333334c6.4 0 10.666667 4.266667 10.666666 10.666667v25.6L512 516.266667l-373.333333-234.666667V256c0-6.4 4.266667-10.666667 10.666666-10.666667z m725.333334 533.333334H149.333333c-6.4 0-10.666667-4.266667-10.666666-10.666667V356.266667l356.266666 224c4.266667 4.266667 10.666667 4.266667 17.066667 4.266666s12.8-2.133333 17.066667-4.266666l356.266666-224V768c0 6.4-4.266667 10.666667-10.666666 10.666667z" p-id="6591"></path></svg>
                                <input type="text" class="form-control" name="username" id="username">
                            </div>
                            <div class="emailE"><span id="emailError" class="error"></span></div>
                            <input type="hidden" name="csrf_token" value="<?php echo htmlspecialchars($_SESSION['csrf_token']); ?>">
                            <input type="submit" value="<?php echo $reset_password;?>" style="margin-top: 20px;" class="btn btn-block btn-primary">
                            <div class="social-login">
                                <span class="google d-flex justify-content-center align-items-center">
                                    <span class="icon-google mr-3"><?php echo $reset_have_account;?> <a href="login"><?php echo $user_login;?></a>
                                </span>
                            </div>
                            <div class="line"></div>
                            <div class="social-login">
                                <span class="google d-flex justify-content-center align-items-center">
                                    <span class="icon-google mr-3"></span><?php echo $user_notaccount;?> <a href="pricing"><?php echo $user_sign;?></a>
                                </span>
                            </div>
                            <a class="playstore-button" href="<?php echo $wwwurl;?>">
                            <svg fill="currentColor" class="iconhome" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6758" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M636.416 116.224c108.544 108.544 217.088 217.088 325.12 326.144 17.92 17.92 25.6 41.984 25.6 67.584 0.512 128 1.024 256 1.024 384 0 51.2-41.472 92.672-92.672 94.208-30.72 0.512-61.44-0.512-92.672-0.512-7.68-8.192-7.168-18.432-7.168-28.16 0-49.664-0.512-99.84 0-149.504 2.048-82.432 0-164.864 1.024-247.296 0-17.408-9.728-28.672-20.992-39.424-86.016-79.36-163.328-167.424-247.808-248.32-7.68-7.168-15.872-14.336-21.504-24.064-3.584-8.704 2.048-14.848 7.168-19.968 35.328-35.84 71.168-71.68 107.008-107.008 4.608-4.096 9.216-8.192 15.872-7.68z" fill="#5D85F1" p-id="6759"></path><path d="M636.416 116.224c-43.008 44.032-86.016 88.064-129.024 131.584-3.072 10.24-11.776 15.872-18.432 23.04-91.648 92.16-183.296 183.296-274.944 275.456-54.784 54.272-109.056 109.056-163.328 162.816-6.656 6.656-12.288 16.384-24.064 15.872 0-74.752-0.512-149.504 0-224.256 0.512-23.552 10.752-44.544 28.16-61.952 127.488-128.512 254.976-257.024 382.976-385.024 38.912-38.912 96.768-38.4 136.704 0.512 20.992 19.968 41.472 41.472 61.952 61.952z" fill="#CA5539" p-id="6760"></path><path d="M802.304 802.816c0 61.44 0.512 122.88 0.512 184.32-158.208 0.512-316.416 0.512-474.624 0.512-38.912 0-78.336-0.512-117.76-0.512-6.144-5.632-7.168-13.312-7.168-20.992-0.512-47.616-0.512-95.232 0-142.848 0-7.68 1.024-15.36 6.144-21.504 10.24-7.168 22.016-6.144 33.28-6.144h526.336c11.776 0 24.064-1.536 33.28 7.168z" fill="#62A64A" p-id="6761"></path><path d="M211.456 802.816c0 61.44-0.512 122.88-0.512 184.32-31.232 0-62.976 1.536-94.208 0.512-49.152-1.536-90.112-43.008-90.624-92.672-0.512-56.832 0.512-113.664 0.512-170.496 54.784-54.272 109.568-109.056 164.864-163.328l18.432-16.896c9.216 8.192 8.192 19.456 8.192 30.208 0.512 66.56 0.512 133.12 0 200.192 0 9.728 0.512 19.968-6.656 28.16z" fill="#EAC139" p-id="6762"></path></svg>
  <span class="texts">
    <span class="text-1"><?php echo $main_title;?></span>
    <span class="text-2">Cloud Converter</span>
  </span>
</a>
                        </form>
                    </div>
                </div>
                <div style=" position: absolute; bottom: 20px; font-size: 12px; ">© <?php echo date('Y');?> Cloud-Converter.com, <?php echo $copyall;?>. </div>
            </div>
        </div>
    </div>
    <script>
        $(function() {
            'use strict';
            $.NZ_MsgBox.tooltip({
                tiptarget: $(".playstore-button"),
                content: "<?php echo $main_title;?><div style='font-size:12px;margin-top: 4px;'><?php echo $main_title_str;?></span>",
                location: "right"
            });
            <?php if($setshow!==""){ ?>
                $.NZ_MsgBox.tipsbar({ title: "<?php echo $infor_title;?>", content: "<?php echo $infor_str;?>", type: "<?php echo $setshow;?>", location: "top", showtime: 4000 });
            <?php } ?>
            $('.form-control').on('input', function() {
                var $field = $(this).closest('.form-group');
                if (this.value) {
                    $field.addClass('field--not-empty');
                } else {
                    $field.removeClass('field--not-empty');
                }
            });

            $('#loginForm').on('submit', function(event) {  
        event.preventDefault(); 
        $('#emailError').text('');
        var email = $('#username').val();  
        var isValid = true;  
        if (email.trim() === '') {  
            $('.emailE').show();
            $('#emailError').text('<?php echo $reset_email;?>');  
            $('#username').focus();
            return false;
            isValid = false;  
        }  

        var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/;  
        if (!emailPattern.test(email)) {  
            $('.emailE').show();
            $('#username').focus();
            $('#emailError').text('<?php echo $reset_emailstr;?>');  
            return false;
            isValid = false;  
        }  
        $('.emailE').hide();

        if (isValid) {  
            this.submit();  
        }  
    });  

        });
    </script>
</body>

</html>