CVE-2023-4448 (PHP, published 2023-08-21T02:15Z)
Description: value: A vulnerability was found in OpenRapid RapidCMS 1.3.1 and classified as critical. This issue affects some unknown processing of the file admin/run-movepass.php. The manipulation of the argument password/password2 leads to weak password recovery. The attack may be initiated remotely. The exploit has been disclosed to the public and may be used. The identifier of the patch is 4dff387283060961c362d50105ff8da8ea40bcbe. It is recommended to apply a patch to fix this issue. The identifier VDB-237569 was assigned to this vulnerability.
Severity: nan (CVSS v3 base score: 9.8)
Weakness: CWE-640 \u2014 Weak Password Recovery Mechanism for Forgotten Password
The product contains a mechanism for users to recover or change their passwords without knowing the original password, but the mechanism is weak.
Repository: https://github.com/OpenRapid/rapidcms
Files changed:
admin/admin_user/login.php
admin/admin_user/loginout.php
admin/admin_user/movepass.php
admin/admin_user/run-movepass.php
admin/admin_user/runlogin.php
admin/article/article-add-run.php
admin/article/article-add.php
admin/article/article-chat-delete.php
admin/article/article-chat.php
admin/article/article-del.php
admin/article/article-edit-run.php
admin/article/article-edit.php
admin/article/article.php
admin/article/run-tool.php
admin/article/tool.php
admin/article/upload.php
admin/category/cate-add-run.php
admin/category/cate-add.php
admin/category/cate-del.php
admin/category/cate-edit-run.php
admin/category/cate-edit.php
admin/category/category.php
admin/check.php
admin/config/mail.php
admin/config/rewrite.php
admin/config/run-close.php
admin/config/run-mail.php
admin/config/run-rewrite.php
admin/config/run-setting.php
admin/config/server.php
admin/config/setting.php
admin/config/uploadicon.php
admin/drawer.php
admin/function/download-plugin.php
admin/function/download-template.php
admin/function/plugin-del.php
admin/function/plugin-move.php
admin/function/plugin.php
admin/function/plus-back-run.php
admin/function/plus-back-upload-sql.php
admin/function/plus-back-upload.php
admin/function/plus-shark-run.php
admin/function/plus-shark.php
admin/function/plus.php
admin/function/temp-run.php
admin/function/temp.php
admin/header.php
admin/index.php
admin/system/about.php
admin/system/update-run.php
admin/system/update.php
admin/user/user-del.php
admin/user/user-move-run.php
admin/user/user-move.php
admin/user/user.php
install/install-config/install.json
resource/config/index.json
resource/config/tool.json
template/default/article.php
template/default/category.php
template/default/menu.php
Commit message: 1.3.1.2


Vulnerable code:
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>
    <style>
    * {
        font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    }
</style>
<div class="medium" style=" text-align:center;display: flex;gap: 47px;">
    <img style="Border-radius:10px" width="200px" src="../../../upload/logo.png">
    <div>
        <div style="color:black;font-size: 20px;" class="mdui-typo">
            <h1 style="font-weight: bold;">RapidCMS</h1>
        </div>
        <div style="color:black;font-size: 10px;" class="mdui-typo">
            <h1>简单好用的官网CMS系统</h1>
        </div>
    </div>
</div>

<script src="../../../../../../resource/js/mtu.min.js"></script>
<script src="../../../../../../resource/js/mdui.min.js"></script>

</body>
</html>
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
  
}else{
    Header("Location: index.php");
}
include("../resource/variable.php");
$json_string = file_get_contents('../install/sql-config/sql.json');
include("../resource/variable.php");
$json_string = file_get_contents('../install/sql-config/sql.json');
Header("Location: index.php");
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {
    $timenow = date('Y-m-d H:i:s');
    $cont2=rawurlencode(htmlspecialchars($_POST["content"]));
      $str='INSERT INTO `rapidcmspage`(`id`, `title`, `content`, `time`, `categoryid`) VALUES ("'.$_POST["id"].'","'.rawurlencode($_POST["title"]).'","'.$cont2.'","'.$timenow.'","'.$_POST["categoryid"].'")';

	  $result=mysqli_query($link,$str);
    sendalert("增加成功！");
     
  }
}
?>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {

      $str="DELETE FROM `rapidcmschat` WHERE id='".$_GET["id"]."'";
	  $result=mysqli_query($link,$str);
      echo "<script>window.opener=null;window.open('','_self');window.close();</script>";
    
  }
}
?>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {

      $str="DELETE FROM `rapidcmspage` WHERE id='".$_GET["id"]."'";
	  $result=mysqli_query($link,$str);
      sendalert("删除成功！请刷新");
  }
}
?>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {
    $timenow = date('Y-m-d H:i:s');
    $cont2=rawurlencode(htmlspecialchars($_POST["content"]));
       
    $str='  UPDATE `rapidcmspage` SET `title`="'.rawurlencode($_POST["title"]).'",`content`="'.$cont2.'",`time`="'.$timenow.'" WHERE `id`="'.$_POST["id"].'"';

	  $result=mysqli_query($link,$str);
      sendalert("修改成功！");
  }
}
?>
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
    
    <? include("drawer.php"); ?>
    <script>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
                            $json_string = file_get_contents('../install/sql-config/sql.json');
                                echo '<option value="' . $row[0] . '">' . $row[1] . '</option>';
    <script src="mdui-editor/js/editor.js"></script>
            imageUploadSuffix: ['png'],

use PhpMyAdmin\Charsets;

        include("../resource/variable.php");
        function encode($string = '', $skey = 'cxphp')
        {
            $strArr = str_split(base64_encode($string));
            $strCount = count($strArr);
            foreach (str_split($skey) as $key => $value)
                $key < $strCount && $strArr[$key] .= $value;
            return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
        }

        define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
        define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
        $json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
        $dataxxx = json_decode($json_string, true);
        $link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
        $sql = "select password from `rapidcmsadmin` where username=\"admin\"";
        $result = mysqli_query($link, $sql);
        $pass = mysqli_fetch_row($result);
        $pa = $pass[0];

        if ($_COOKIE["admin"] != encode('admin', $pa)) {
            Header("Location: login.php");
        }
         
         <link rel="stylesheet" href="http://kindeditor.net/ke4/themes/default/default.css" />
         <script charset="utf-8" src="http://kindeditor.net/ke4/kindeditor-min.js"></script>
         <script charset="utf-8" src="http://kindeditor.net/ke4/lang/zh-CN.js"></script>
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>
    <? include("drawer.php"); ?>


         <div class="mdui-container"  id="page-question" style="margin:auto;">
                define('BASE_PATH2', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
                define('BASE_PATH3', str_replace('\\', '/', realpath(dirname(BASE_PATH2) . '/')) . "/");
                $json_string = file_get_contents(BASE_PATH3 . '/install/sql-config/sql.json');
         
                    echo '<div class="mdui-card answers">          <h1  style="text-align:center;">
        
                    echo '<div class="item" id="chat_'.$row[0].'"><div class="mc-user-line"><div class="mc-user-popover"><a class="avatar user-popover-trigger"><i class="mdui-list-item-icon mdui-icon material-icons">people</i></a>    ';
                    echo '</div></div><div class="content mdui-typo"><p>' . $row[2] . '</p>';
                      echo '</div><div class="flex-grow"></div><div class="mc-options-button">    ';
                    echo '<li class="mdui-menu-item"><a onclick="copyText(\'' . $row[0] . '\')" class="mdui-ripple">复制评论ID</a></li><li class="mdui-menu-item"><a target="_blank" onclick="document.getElementById(\'chat_'.$row[0].'\').style.display=\'none\';" href="article-chat-delete.php?id='.$row[0].'" class="mdui-ripple">删除评论</a></li></ul></div></div></div>    ';
                    echo '</div>';
             
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
    <? include("drawer.php"); ?>
                            $json_string = file_get_contents('../install/sql-config/sql.json');
                                echo $row[1];
                            $json_string = file_get_contents('../install/sql-config/sql.json');
                                    echo '<option selected="selected" value="' . $row[0] . '">' . $row[1] . '</option>';
                                    echo '<option value="' . $row[0] . '">' . $row[1] . '</option>';
    <script src="mdui-editor/js/editor.js"></script>
        function sub1() {
            document.getElementById("area").innerHTML = document.getElementById("content").innerHTML;
            imageUploadSuffix: ['png'],
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}
define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>

    <script type="text/javascript" language="javascript"> 
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
                            $json_string = file_get_contents('../install/sql-config/sql.json');
                                echo "<td>$row[1]</td>";
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {

      $str='INSERT INTO `rapidcmscategory`(`id`, `name`, `pic`, `num`) VALUES ("'.$_POST["id"].'","'.rawurlencode($_POST["name"]).'","'.$_POST["pic"].'",'.$_POST["num"].')';

	  $result=mysqli_query($link,$str);
      sendalert("增加成功！");
  }
}
?>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>
<script>
    function randomString(length,) {
        var chars='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
    var result = '';
    for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
    return result;
}
function resetnum(){
    document.getElementById("ranid").value=randomString(10);
}
window.onload = function () {
    resetnum()
}


    </script>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

        <div class="mdui-card">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px">分类设置</div>
            </div>
           
                <m-scrollbar style="height: 800px;width:900px;text-align:left ">
                <div id="login" class="mc-account mc-login mdui-dialog mdui-dialog-open " style="overflow: hidden;z-index:999;display: block; top: 150.104px; height: 700px;">
                <button class="mdui-btn mdui-btn-icon close" onclick="window.location.href='category.php'"><i class="mdui-icon material-icons">close</i></button>
 
<div class="mdui-dialog-title">新增</div>
<form method="post" action="cate-add-run.php">

    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
        <label class="mdui-textfield-label">唯一ID（10位字符）</label>
    <input class="mdui-textfield-input" style="width:90%" type="text" name="id" id="ranid" value="onload" required="">
  <i   style="cursor:pointer;position: absolute;left: 92%" onclick="resetnum(10)" class="mdui-icon material-icons">&#xe5d5;</i>
</div>
    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
        <label class="mdui-textfield-label">名称</label>
    <input class="mdui-textfield-input" type="text" name="name" required=""></div>
    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
        <label class="mdui-textfield-label">图标ID（在MDUI中获取&#XXXX;）</label>
    <input class="mdui-textfield-input" style="width:90%" type="text" name="pic" required="">
    <i   style="cursor:pointer;position: absolute;left: 92%" onclick="window.open('https://www.mdui.org/docs/material_icon')" class="mdui-icon material-icons">&#xe250;</i>
    </div>
    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
        <label class="mdui-textfield-label">权重（大的在前面）</label>
    <input class="mdui-textfield-input" type="number" name="num" required=""></div>

    <div class="actions mdui-clearfix">
       <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button>
    </div>
</form>
</div>
                </m-scrollbar>
  
        </div>

    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>



<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {

      $str="DELETE FROM `rapidcmscategory` WHERE id='".$_GET["id"]."'";
	  $result=mysqli_query($link,$str);
      sendalert("删除成功！请刷新");
  }
}
?>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {
  
      $str='  UPDATE `rapidcmscategory` SET `name`="'.rawurlencode($_POST["name"]).'",`pic`="'.$_POST["pic"].'",`num`='.$_POST["num"].' WHERE `id`="'.$_POST["id"].'"';
        echo $str;
	  $result=mysqli_query($link,$str);
      sendalert("修改成功！");
  }
}
?>
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH2',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH3',str_replace('\\','/',realpath(dirname(BASE_PATH2).'/'))."/");
$json_string = file_get_contents(BASE_PATH3.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];
if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}
define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>
    <? include("drawer.php"); ?>
    <script type="text/javascript" language="javascript"> 
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
                    $json_string = file_get_contents('../install/sql-config/sql.json');
                        echo "<td>$row[1]</td>";
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple  mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>

    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">

</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary:79, 55, 139; --color-accent: 79, 55, 139;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}
define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary:79, 55, 139; --color-accent: 79, 55, 139;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
include("../resource/variable.php");
  $path = "../" . $path1;
  $filename1 = '../resource/config/header.json';
  sendalert("上传成功");
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../plugin/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>


    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <div class="medium" style=" text-align:center;display: flex">

        <div>
            <div style="color:black;font-size: 20px;" class="mdui-typo">
                <h1 style="font-weight: bold;">插件获取</h1>
                <h5>插件名称：<?php echo $_GET["name"]; ?> </h5>
                
                <br>


                <?php

$arrContextOptions=array(
    "ssl"=>array(
        "verify_peer"=>false,
        "verify_peer_name"=>false,
    ),
);  
file_put_contents("../plugin/".$_GET["name"].".zip", file_get_contents("http://cdn.jsdelivr.net/gh/codewyx/cmscdn/plugin/".$_GET["name"].".zip", false, stream_context_create($arrContextOptions)));
            
                require_once('pclzip.lib.php');

                $zip = new PclZip("../plugin/".$_GET["name"].".zip");
                $result = $zip->extract(PCLZIP_OPT_PATH, "../plugin/");
                if ($result == 0) {
                    echo '<br>输入错误';
                    unlink("../plugin/" . $_GET["name"] . ".zip");
                } else {
                    echo '<br>导入成功';
                    unlink("../plugin/" . $_GET["name"] . ".zip");
                }

                ?>
            </div>

        </div>
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>


    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <div class="medium" style=" text-align:center;display: flex">

        <div>
            <div style="color:black;font-size: 20px;" class="mdui-typo">
                <h1 style="font-weight: bold;">模板获取</h1>
                <h5>模板名称：<?php echo $_GET["name"]; ?> </h5>
                
                <br>


                <?php

$arrContextOptions=array(
    "ssl"=>array(
        "verify_peer"=>false,
        "verify_peer_name"=>false,
    ),
);  
file_put_contents("../template/".$_GET["name"].".zip", file_get_contents("http://cdn.jsdelivr.net/gh/codewyx/cmscdn/".$_GET["name"].".zip", false, stream_context_create($arrContextOptions)));
            
                require_once('pclzip.lib.php');

                $zip = new PclZip("../template/" .$_GET["name"].".zip");
                $result = $zip->extract(PCLZIP_OPT_PATH, "../template/");
                if ($result == 0) {
                    echo '<br>输入错误';
                    unlink("../template/" . $_GET["name"] . ".zip");
                } else {
                    echo '<br>导入成功';
                    unlink("../template/" . $_GET["name"] . ".zip");
                }

                ?>
            </div>

        </div>
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
        <a href="index.php">
                <a href="setting.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">基本设置</a>
                <a href="server.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">服务设置</a>
                <a href="mail.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">邮件设置</a>
                <a href="rewrite.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">伪静态设置</a>
        <a href="user.php">
                <a href="category.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">查看分类</a>
                <a href="cate-add.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">新增分类</a>
                <a href="article.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">查看文章</a>
                <a href="article-add.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">新增文章</a>
                <a href="tool.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">小组件</a>
        <a href="temp.php">
        <a href="plugin.php">
        <a href="movepass.php">
            <li class="mdui-list-item mdui-ripple" style="font-size:15px!important">
                <i class="mdui-list-item-icon mdui-icon material-icons">&#xe22b;</i>
                <div class="mdui-list-item-content" style="font-size:15px!important">修改密码</div>
            </li>
        </a>
                <a href="update.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">检查更新</a>
                <a href="plus.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">高级功能</a>
                <a href="about.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">关于</a>

</div>
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
$json_string = file_get_contents(BASE_PATH1 . 'install/sql-config/sql.json');
copydir("../resource/config", $dir . "config");
include("../resource/variable.php");
require_once('pclzip.lib.php');
require_once('pclzip.lib.php');
include("../resource/variable.php");
$json_string = file_get_contents('../install/sql-config/sql.json');
define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
    Header("Location: ./login.php");
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary:79, 55, 139; --color-accent: 79, 55, 139;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

        <div class="mdui-card">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px">修改管理员密码</div>
            </div>
            <form method="post" action="run-movepass.php">
                <m-scrollbar style="height: 300px;width:900px">
                    <div class="mdui-card-content" style="font-size:15px;text-align:left">
                        <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
                            <label class="mdui-textfield-label">输入密码</label>
                            <input class="mdui-textfield-input" name="password" type="password"
                              required="">
                              <div class="mdui-textfield-error">密码不能为空</div>
                        </div>
                        <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
                            <label class="mdui-textfield-label">重复密码</label>
                            <input class="mdui-textfield-input" name="password2" type="password"
                               required="">
                               <div class="mdui-textfield-error">重复密码不能为空</div>
                        </div>
                      
                        <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">提交</button>

                    </div>
                </m-scrollbar>
            </form>
        </div>
       
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}

function removeDir($dirName)
{
    if (!is_dir($dirName)) {
        return false;
    }
    $handle = @opendir($dirName);
    while (($file = @readdir($handle)) !== false) {
        if ($file != '.' && $file != '..') {
            $dir = $dirName . '/' . $file;
            is_dir($dir) ? removeDir($dir) : @unlink($dir);
        }
    }
    closedir($handle);
    @rmdir($dirName);
}
removeDir('../plugin/' . $_GET["id"]);
echo "<script type='text/javascript'>window.location.href='plugin.php'</script>";
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
$json_string=file_get_contents('../plugin/'. $_GET["id"]."/version.json");
$row = json_decode($json_string, true);
if($row["use"]==true){
    $data = array();
    $data['key'] =$row["key"];
    $data['name'] = $row["name"];
    $data['version'] = $row["version"];
    $data['author'] = $row["author"];
    $data['use'] = false;
    $json_string = json_encode($data);
    
    file_put_contents('../plugin/'. $_GET["id"]."/version.json", $json_string);

   }else{
    $data = array();
    $data['key'] =$row["key"];
    $data['name'] = $row["name"];
    $data['version'] = $row["version"];
    $data['author'] = $row["author"];
    $data['use'] = true;
    $json_string = json_encode($data);
    
    file_put_contents('../plugin/'. $_GET["id"]."/version.json", $json_string);
   }
   echo "<script type='text/javascript'>window.location.href='plugin.php'</script>"
?>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>

    <script type="text/javascript" language="javascript">
        function confirmAct() {
            if (confirm('确定要删除插件吗?')) {
                return true;
            }
            return false;
        }

        function confirmAct1() {
            if (confirm('确定要禁用插件吗?')) {
                return true;
            }
            return false;
        }

        function confirmAct2() {
            if (confirm('确定要启用插件吗?')) {
                return true;
            }
            return false;
        }
    </script>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    
    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

        <div class="mdui-card" style="overflow:scroll">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px;">插件设置</div>

            </div> 
            <div class="mdui-divider"></div> <br>
            <m-scrollbar style="height: 650px;width:900px;">
          
            <form method="get" action="download-plugin.php" style="text-align:left;padding:0 0 0 250px">
                    <div style="  display: flex;gap: 47px;">

                        <div>输入Key加载插件：<input style="width:300px" class="mdui-textfield-input" name="name" type="text" value="" required=""> </div>
                        <div><button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button><br><br>
                        </div>




                    </div>
                </form>
                <br>
                <div class="mdui-divider"></div>  <br>
                <div style="width:90%;position: absolute;left: 50%;    transform: translateX(-50%  );" class="mdui-table-fluid">

                    <table class="mdui-table">
                        <thead>
                            <tr>
                                <th>ID-Key</th>
                                <th>名称</th>
                                <th>版本</th>
                                <th>作者</th>
                                <th>状态</th>
                                <th class="mdui-table-col-numeric"> </th>
                            </tr>
                        </thead>
                        <tbody>

                            <?php




                            $file = scandir("../plugin");

                            for ($i = 2; $i < count($file); $i++) {
                                if($file[$i]==".gitkeep"){
                                    
                                }else{
                                    $json_string = file_get_contents('../plugin/' . $file[$i] . "/version.json");
                                    $row = json_decode($json_string, true);
                                    echo "<tr>";
                                    echo "</tr>";
                                    echo "<td>" . $row["key"] . "</td>";
                                    echo "<td>" . $row["name"] . "</td>";
                                    echo "<td>" . $row["version"] . "</td>";
                                    echo "<td>" . $row["author"] . "</td>";
                                    if ($row["use"] == true) {
                                        echo "<td style='color:green'><strong>启用</strong></td>";
                                        echo '<td><a target="_blank" href="' . '../plugin/' . $file[$i] . "/setting.php" . '"><button class="mdui-btn mdui-btn-icon mdui-ripple">   <i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe3c9;</i></button></a>';
                                        echo '<a onclick="return confirmAct1();" href="plugin-move.php?id=' . $file[$i] . '"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe644;</i></button></a>';
                                    } else {
                                        echo "<td style='color:red'><strong>禁用</strong></td>";
                                        echo '<td><a target="_blank" href="' . '../plugin/' . $file[$i] . "/setting.php" . '"><button class="mdui-btn mdui-btn-icon mdui-ripple">   <i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe3c9;</i></button></a>';
                                        echo '<a onclick="return confirmAct2();" href="plugin-move.php?id=' . $file[$i] . '"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe86c;</i></button></a>';
                                    }
    
    
                                    echo '<a onclick="return confirmAct();" href="plugin-del.php?id=' . $file[$i] . '"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe872;</i></button></a>&nbsp;';
    
                                    echo "</td>";
                                }
                         
                            }



                            ?>


                        </tbody>
                    </table>
                </div>
            </m-scrollbar>

        </div>

    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">

</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <br><br>
    <div style=" position:  relative;left:15%">
        <div class="mdui-card" style="width:70%;height:300px; ">
            <div class="mdui-card-primary" style="text-align:center;">
                <div class="mdui-card-primary-title" style="font-size:30px">从SharkCMS迁移数据</div>
            </div>
            <br>
            <label class="mdui-textfield-label">&nbsp;&nbsp;&nbsp;选择导入方式</label>
            &nbsp;&nbsp;&nbsp;
            <label class="mdui-radio">
                <input type="radio" name="group1" checked />
                <i class="mdui-radio-icon"></i>
                从本程序所在数据库导入
            </label>

            <label class="mdui-radio">
                <input type="radio" name="group1" disabled />
                <i class="mdui-radio-icon"></i>
                从其他数据库导入（暂不支持）
            </label>
            <br>  <br>
            &nbsp;&nbsp;&nbsp;<a href="plus-shark-run.php"><button name="sub" class="mdui-btn mdui-btn-raised mdui-text-color-black action-btn">一键导入文章</button></a>
       
        </div>
    </div>
    <br>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">

</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <br><br>
    <div style=" position:  relative;left:15%">
        <div class="mdui-card" style="width:70%;height:300px; ">
            <div class="mdui-card-primary" style="text-align:center;">
                <div class="mdui-card-primary-title" style="font-size:30px">数据设置</div>
            </div>
            <div class="mdui-tab" mdui-tab>
                <a href="#move1" class="mdui-ripple">备份数据</a>
                <a href="#move2" class="mdui-ripple">导入备份</a>
           <a href="#move3" class="mdui-ripple">迁移数据</a> 
            </div>
            <div id="move1" class="mdui-p-a-2">
            <label class="mdui-textfield-label">备份系统数据，树立安全意识</label>
               
                <a href="plus-back-run.php"><button name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">备份数据</button></a>
           </div>
            <div id="move2" class="mdui-p-a-2">
            <label class="mdui-textfield-label">配置文件暂不支持，请解压后手动复制粘贴</label>
            
           <!--    <form enctype="multipart/form-data" id="fileupdateform" method="post" action="plus-back-upload-sql.php"><button for="file" onclick="document.getElementById('file').click()" type="button" style="color:black" class="mdui-btn mdui-btn-raised  action-btn">导入.sql文件</button><br>                    <input style="display: none;" onchange="document.getElementById('fileupdateform').submit()"   name="file"  id="file" type="file" required=""></form>
    --></div>
           <div id="move3" class="mdui-p-a-2">
            <label class="mdui-textfield-label">迁移其他数据，便捷导入内容</label>
                   <a href="plus-shark.php"><button name="sub" class="mdui-btn mdui-btn-raised mdui-text-color-black action-btn">从SharkCMS迁移数据</button></a>
       
            </div>
         </div>
    </div>
    <br>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
$data1 = array();
if($_POST["close"]=="on"){
    $data1['close'] = "true";
}else{
    $data1['close'] = "false";
}
$data1['template'] = $data_index["template"];
$data1['version'] = $data_index["version"];
$data1['rewrite'] = $data_index["rewrite"];

$json_string1 = json_encode($data1);
$filename1 = '../resource/config/index.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
sendalert("修改成功！");
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
$data1 = array();
if($_POST["logonwithmail"]=="on"){
    $data1['logonwithmail'] = "true";
}else{
    $data1['logonwithmail'] = "false";
}
$data1['smtp'] = $_POST["smtp"];
$data1['secure'] = $_POST["secure"];
$data1['port'] = $_POST["port"];
$data1['username'] = $_POST["username"];
$data1['password'] = $_POST["password"];
$json_string1 = json_encode($data1);
$filename1 = '../resource/config/mail.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
sendalert("修改成功！");
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
$data1 = array();
if($_POST["rewrite"]=="on"){
    $data1['rewrite'] = "true";
}else{
    $data1['rewrite'] = "false";
}
$data1['template'] = $data_index["template"];
$data1['version'] = $data_index["version"];
$data1['close'] = $data_index["close"];

$json_string1 = json_encode($data1);
$filename1 = '../resource/config/index.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
sendalert("修改成功！");
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
$data1 = array();
$data1['headname'] = $_POST["headname"];
$data1['title'] = $_POST["title"];
$data1['icon'] =  $data_header["icon"];
$data1['description'] = $_POST["description"];
$data1['keywords'] = $_POST["keywords"];
$data1['introduce'] = $_POST["introduce"];
$data1['con'] = $_POST["con"];
$json_string1 = json_encode($data1);
$filename1 = '../resource/config/header.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
sendalert("修改成功");
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
$data1 = array();
if($_POST["tool"]=="on"){
    $data1['tool'] = "true";
}else{
    $data1['tool'] = "false";
}
$data1['kind'] = $_POST["kind"];
if ($_POST["kind"] == "one") {
    $data1['content'] = '<center><p id="hitokoto"><a style="color:#000000" href="#" id="hitokoto_text">获取中...</a></p></center><script>fetch(\'https://v1.hitokoto.cn\').then(response => response.json()).then(data => {const hitokoto = document.querySelector(\'#hitokoto_text\');hitokoto.href = \'https://hitokoto.cn/?uuid=\' + data.uuid;
        if (data.from_who == null) {
        hitokoto.innerHTML = "「 " + data.hitokoto + " 」<br>——" + data.from;
        }else {
        hitokoto.innerHTML = "「 " + data.hitokoto + " 」<br>——" + data.from_who + "「" + data.from + "」"
        }}).catch(console.error)
        </script>';
} else {
    $data1['content'] = $_POST["content"];
}


$json_string1 = json_encode($data1);
$filename1 = '../resource/config/tool.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"tool.php\"</script>";
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary:79, 55, 139; --color-accent: 79, 55, 139;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">


        <div class="mdui-card" style="width:900px">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px">网站服务设置</div>
            </div>
            <form method="post" action="run-close.php">
            <div class="mdui-card-content" style="font-size:15px;text-align:left">
            <label class="mdui-switch">
                            启用网页维护&nbsp;&nbsp;&nbsp;
                            <input <?
                                    if ($data_index["close"]  == "true") {
                                        echo " checked='true'";
                                    }
                                    ?> name="close" type="checkbox" />
                            <i class="mdui-switch-icon"></i>
                        </label> 
                        <br> <br>
                        <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">确认</button>
                  
            </div>
            </form>
        </div>
        <br>
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}
define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">

</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>

    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
$data1 = array();
$data1['template'] = $_POST["template"];
$data1['version'] = $data_index["version"];
$data1['rewrite'] = $data_index["rewrite"];
$data1['close'] = $data_index["close"];
$json_string1 = json_encode($data1);
$filename1 = '../resource/config/index.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
sendalert("修改成功！");
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>

    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <div style=" position:  relative;left:25%;top:10%">


        <div class="mdui-card" style="width:600px">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px">设置模板</div>
            </div>
            <m-scrollbar style="font-size:15px;height: 400px">
                <div class="mdui-card-content" style="font-size:18px;text-align:left">
                    当前模板：<? echo $data_index["template"] ?>
                    &nbsp;&nbsp;&nbsp;          &nbsp;&nbsp;&nbsp;          &nbsp;&nbsp;     <a  target="_blank" href="../../../../template/<? echo $data_index["template"] ?>/setting.php"><button type="button" style="color:black" class="mdui-btn mdui-btn-raised  action-btn">模板单独设置</button></a><br><br>
                    <form method="post" action="temp-run.php"> 切换模板：
                        <select class="mdui-select" name="template" mdui-select>



                            <?php

                            $file = scandir("../template");

                            for ($i = 2; $i < count($file); $i++) {
                                echo '  <option value="' . $file[$i] . '">' . $file[$i] . '</option>';
                            }
                            ?></select>
                        &nbsp;&nbsp;&nbsp;
                        <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button><br><br>
                    </form>
                    <form method="get" action="download-template.php"> 输入Key加载模板：
                      <div style="display: inline;">  
                    <input style="width:300px" class="mdui-textfield-input" name="name" type="text"
                                value="" required="">
                                <br>
                        <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button><br><br>
                        </div>
                    </form>
                    <a  target="_blank" href="https://www.yuque.com/rapid/cms/yo0y1er0vg6rl86g"><button type="button" style="color:black" class="mdui-btn mdui-btn-raised  action-btn">进入文档获取模板</button><br><br></a>
                     

                </div>
            </m-scrollbar>

        </div>
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">

</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary:79, 55, 139; --color-accent: 79, 55, 139;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

        <div class="mdui-card">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px">小组件设置</div>
            </div>
            <form method="post" action="run-tool.php">
                <m-scrollbar style="height: 620px;width:900px">
                    <div class="mdui-card-content" style="font-size:15px;text-align:left">

                        <label class="mdui-switch">
                            开启小组件&nbsp;&nbsp;&nbsp;
                            <input <?
                                    if ($data_tool["tool"]  == "true") {
                                        echo " checked='true'";
                                    }
                                    ?> name="tool" type="checkbox" />
                            <i class="mdui-switch-icon"></i>
                        </label> <br>
                        <label class="mdui-textfield-label">选择小组件</label>
                        <select class="mdui-select" name="kind" id="kind" onchange="kindmove()" mdui-select>
                            <?

                            if ($data_tool["kind"] == "one") {
                                echo ' <option value="one" selected>一言</option>';
                                echo '   <option value="write" >自定义</option>';
                            } else {
                                echo ' <option value="one" >一言</option>';
                                echo '   <option value="write" selected>自定义</option>';
                            }
                            ?>


                        </select> <br> <br>
                        <div id="con" style="display:none" class="mdui-textfield  mdui-textfield-has-bottom ">
                            <label class="mdui-textfield-label">输入内容</label>


                            <textarea rows="7" class="mdui-textfield-input" name="content" type="text" required=""><? echo $data_tool["content"]; ?></textarea>
                        </div>
                        <br>
                        <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">提交</button>

                    </div>
                </m-scrollbar>
            </form>
        </div>

    </div>
    <script>
        function kindmove(){
if(document.getElementById("kind").value=="write"){
    document.getElementById("con").style.display="inline";
}else{
    document.getElementById("con").style.display="none";
}
        }
        window.onload=()=>{
            kindmove()
        }
    </script>
    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">

</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>


    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <div class="medium" style=" text-align:center;display: flex">

        <div>
            <div style="color:black;font-size: 20px;" class="mdui-typo">
                <h1 style="font-weight: bold;">版本更新</h1>
                <h5>正在更新中，版本：<?php echo $_GET["version"]; ?> </h5>

                <br>


                <?php

                $arrContextOptions = array(
                    "ssl" => array(
                        "verify_peer" => false,
                        "verify_peer_name" => false,
                    ),
                );
                file_put_contents("../upload/" . $_GET["version"] . ".zip", file_get_contents("http://cdn.jsdelivr.net/gh/codewyx/cmscdn/version/" . $_GET["version"] . ".zip", false, stream_context_create($arrContextOptions)));

                require_once('pclzip.lib.php');

                $zip = new PclZip("../upload/" . $_GET["version"] . ".zip");
                $result = $zip->extract(PCLZIP_OPT_PATH, "../");
                if ($result == 0) {
                    echo '<br>更新失败';
                    unlink("../upload/" . $_GET["version"] . ".zip");
                } else {
                    echo '<br>更新成功';
                    unlink("../upload/" . $_GET["version"] . ".zip");
                }

                ?>
            </div>

        </div>
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
<?php
$fileInfo=$_FILES['file'];
$name=$fileInfo['name'];
$pathname = pathinfo($name)["extension"];
$filename =  pathinfo($name, PATHINFO_FILENAME); 
$filePath=$fileInfo['tmp_name'];
//$name = iconv('utf-8', 'gb2312', $filename);
$str=rand(); 

$path="../upload/upload_".md5($str).".".$pathname;
move_uploaded_file($filePath,$path);
echo json_encode([
  "code" => 0,
  "data" => [
    "url" => $path,
    "name" => $name
  ]
 ]);
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];
//测试

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {

      $str="DELETE FROM `rapidcmsuser` WHERE username='".$_GET["username"]."'";
	  $result=mysqli_query($link,$str);
      sendalert("删除成功！");
  }
}
?>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {
    $password1=md5(sha1(md5($_POST["password"])));
      $str="UPDATE `rapidcmsuser` SET `password`= '".$password1."' WHERE username='".$_POST["username"]."'";

	  $result=mysqli_query($link,$str);
    sendalert("修改成功！");
  }
}
?>
<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/'))."/");
define('BASE_PATH1',str_replace('\\','/',realpath(dirname(BASE_PATH).'/'))."/");
$json_string = file_get_contents(BASE_PATH1.'/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin',$pa)) {
    Header("Location: login.php"); 
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>

    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

        <div class="mdui-card">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px">用户设置</div>
            </div>
           
                <m-scrollbar style="height: 650px;width:900px;text-align:left ">
                <div id="login" class="mc-account mc-login mdui-dialog mdui-dialog-open " style="overflow: hidden;z-index:999;display: block; top: 150.104px; height: 540.792px;">
                <button class="mdui-btn mdui-btn-icon close" onclick="window.location.href='user.php'"><i class="mdui-icon material-icons">close</i></button>
 
<div class="mdui-dialog-title">修改用户密码</div>
<form method="post" action="user-move-run.php">
<div style="display:none" class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom "><label class="mdui-textfield-label">用户名</label><input class="mdui-textfield-input" value="<?echo $_GET["username"]?>"  name="username" type="text" >
        <div class="mdui-textfield-error">账号不能为空</div>
    </div>
    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom "><label class="mdui-textfield-label">用户名</label><input class="mdui-textfield-input" value="<?echo $_GET["username"]?>" type="text" disabled="true">
        <div class="mdui-textfield-error">账号不能为空</div>
    </div>
    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom"><label class="mdui-textfield-label">新密码</label><input class="mdui-textfield-input" name="password" type="password" required="">
        <div class="mdui-textfield-error">密码不能为空</div>
    </div>
    <div class="actions mdui-clearfix">
       <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">修改</button>
    </div>
</form>
</div>
                </m-scrollbar>
  
        </div>

    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>



<?php
include("../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

define('BASE_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/')) . "/");
define('BASE_PATH1', str_replace('\\', '/', realpath(dirname(BASE_PATH) . '/')) . "/");
$json_string = file_get_contents(BASE_PATH1 . '/install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: login.php");
}
?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("drawer.php"); ?>

    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

        <div class="mdui-card" style="overflow:scroll">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px;">用户设置</div>
            </div>
           
                <m-scrollbar style="height: 650px;width:900px;">
                    <div style="width:80%;position: absolute;left: 50%;    transform: translateX(-50%  );"  class="mdui-table-fluid">
                        <table class="mdui-table">
                            <thead>
                                <tr>
                                    <th>用户名</th>
                                    <th>用户状态</th>
                                    <th  class="mdui-table-col-numeric"> </th>
                                </tr>
                            </thead>
                            <tbody>

                    <?php
                    $table_name = "rapidcmsuser";
                    $json_string = file_get_contents('../install/sql-config/sql.json');
                    $data = json_decode($json_string, true);
                    $conn = mysqli_connect($data['server'], $data['dbusername'], $data['dbpassword'], $data['dbname']);
                    $sql = 'select * from `' . $table_name . '`';
                    $res = mysqli_query($conn, $sql);
                    $colums = mysqli_num_fields($res);
                    while ($row = mysqli_fetch_row($res)) {
                       echo "<tr>";
                        echo "</tr>";
                        echo "<td>$row[0]</td>";
                        echo "<td>$row[2]</td>";
                        echo '<td ><a href="user-del.php?username='.$row[0].'"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe872;</i></button></a>&nbsp;&nbsp;&nbsp;&nbsp;';
                        echo '<a href="user-move.php?username='.$row[0].'"><button class="mdui-btn mdui-btn-icon mdui-ripple">   <i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe3c9;</i></button></a></td>';
                    }
                    ?>
                                  
                               
                            </tbody>
                        </table>
                    </div>
                </m-scrollbar>
  
        </div>

    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
{"close":"false","template":"default","version":"1.3.1","rewrite":"false"}
{"tool":"true","kind":"one","content":"<center><p id=\"hitokoto\"><a style=\"color:#000000\" href=\"#\" id=\"hitokoto_text\">\u83b7\u53d6\u4e2d...<\/a><\/p><\/center><script>fetch('https:\/\/v1.hitokoto.cn').then(response => response.json()).then(data => {const hitokoto = document.querySelector('#hitokoto_text');hitokoto.href = 'https:\/\/hitokoto.cn\/?uuid=' + data.uuid;\r\n        if (data.from_who == null) {\r\n        hitokoto.innerHTML = \"\u300c \" + data.hitokoto + \" \u300d<br>\u2014\u2014\" + data.from;\r\n        }else {\r\n        hitokoto.innerHTML = \"\u300c \" + data.hitokoto + \" \u300d<br>\u2014\u2014\" + data.from_who + \"\u300c\" + data.from + \"\u300d\"\r\n        }}).catch(console.error)\r\n        <\/script>"}
                echo ' <div class="mdui-typo" style="padding: 10px;">'.$data_tool["content"].'</div><br></div><br>';
<body class=" mdui-appbar-with-toolbar mdui-theme-accent-indigo mdui-theme-primary-indigo mdui-text-color-white mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">

Fixed code:
<?php
//Cookie消掉
setcookie("admin", "", time()-3600,'/');

//获取返回位置

      $goto="login.php";

//直接返回
echo"<script type="."\""."text/javascript"."\"".">"."window.location="."\"".$goto."\""."</script>";
?>
<?php
include("../header.php");

?>
    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

        <div class="mdui-card">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px">修改管理员密码</div>
            </div>
            <form method="post" action="run-movepass.php">
                <m-scrollbar style="height: 300px;width:900px">
                    <div class="mdui-card-content" style="font-size:15px;text-align:left">
                        <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
                            <label class="mdui-textfield-label">输入密码</label>
                            <input class="mdui-textfield-input" name="password" type="password"
                              required="">
                              <div class="mdui-textfield-error">密码不能为空</div>
                        </div>
                        <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
                            <label class="mdui-textfield-label">重复密码</label>
                            <input class="mdui-textfield-input" name="password2" type="password"
                               required="">
                               <div class="mdui-textfield-error">重复密码不能为空</div>
                        </div>
                      
                        <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">提交</button>

                    </div>
                </m-scrollbar>
            </form>
        </div>
       
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
include("../check.php");
$json_string = file_get_contents('../../install/sql-config/sql.json');
include("../../variable.php");
$json_string = file_get_contents('../../install/sql-config/sql.json');
Header("Location: ../index.php");
<?php
include("../check.php");

header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {
    $timenow = date('Y-m-d H:i:s');
    $cont2=rawurlencode(htmlspecialchars($_POST["content"]));
      $str='INSERT INTO `rapidcmspage`(`id`, `title`, `content`, `time`, `categoryid`) VALUES ("'.$_POST["id"].'","'.rawurlencode($_POST["title"]).'","'.$cont2.'","'.$timenow.'","'.$_POST["categoryid"].'")';
	  $result=mysqli_query($link,$str);
    sendalert("增加成功！");
     
  }
}
?>
include("../check.php");


    <? include("../drawer.php"); ?>

    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
   
   <script>
                            $json_string = file_get_contents('../../install/sql-config/sql.json');
                                echo '<option value="' . $row[0] . '">' .  urldecode($row[1]) . '</option>';
    <script src="../src/mdui-editor/js/editor.js"></script>
            imageUploadSuffix: ['png','jpg','gif','jpeg'],
<?php
include("../check.php");
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {

      $str="DELETE FROM `rapidcmschat` WHERE id='".$_GET["id"]."'";
	  $result=mysqli_query($link,$str);
      echo "<script>window.opener=null;window.open('','_self');window.close();</script>";
    
  }
}
?>
        include("../check.php");

         <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
             <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
             <span class="mdui-typo-title">RapidCMS 管理后台</span>
         </div>
         <? include("../drawer.php"); ?>
         <div class="mdui-container" id="page-question" style="margin:auto;">

                $json_string = file_get_contents('../../install/sql-config/sql.json');

                echo '<div class="mdui-card answers">          <h1  style="text-align:center;">

                    echo '<div class="item" id="chat_' . $row[0] . '"><div class="mc-user-line"><div class="mc-user-popover"><a class="avatar user-popover-trigger"><i class="mdui-list-item-icon mdui-icon material-icons">people</i></a>    ';
                    echo '</div></div><div class="content mdui-typo"><p>' . urldecode($row[2]) . '<div class="mdui-typo-caption-opacity">点赞数：' . $row[3] . '</div></p>';
                    echo '</div><div class="flex-grow"></div><div class="mc-options-button">    ';
                    echo '<li class="mdui-menu-item"><a onclick="copyText(\'' . $row[0] . '\')" class="mdui-ripple">复制评论ID</a></li><li class="mdui-menu-item"><a target="_blank" onclick="document.getElementById(\'chat_' . $row[0] . '\').style.display=\'none\';" href="article-chat-delete.php?id=' . $row[0] . '" class="mdui-ripple">删除评论</a></li></ul></div></div></div>    ';
                echo '</div>';

<?php
include("../check.php");
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {

      $str="DELETE FROM `rapidcmspage` WHERE id='".$_GET["id"]."'";
	  $result=mysqli_query($link,$str);
      sendalert("删除成功！请刷新");
  }
}
?>
<?php
include("../check.php");
header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {
    $timenow = date('Y-m-d H:i:s');
    $cont2=rawurlencode(htmlspecialchars($_POST["content"]));
       
    $str='  UPDATE `rapidcmspage` SET `title`="'.rawurlencode($_POST["title"]).'",`content`="'.$cont2.'",`time`="'.$timenow.'" WHERE `id`="'.$_POST["id"].'"';

	  $result=mysqli_query($link,$str);
      sendalert("修改成功！");
  }
}
?>
include("../check.php");
    <? include("../drawer.php"); ?>
                            $json_string = file_get_contents('../../install/sql-config/sql.json');
                                echo urldecode($row[1]);
                            $json_string = file_get_contents('../../install/sql-config/sql.json');
                                    echo '<option selected="selected" value="' . $row[0] . '">' . urldecode($row[1]) . '</option>';
                                    echo '<option value="' . $row[0] . '">' .  urldecode($row[1]) . '</option>';
    <script src="../src/mdui-editor/js/editor.js"></script>
        function sub1(){
            document.getElementById("area").innerHTML= document.getElementById("content").innerHTML;
            imageUploadSuffix: ['png','jpg','gif','jpeg'],
include("../header.php");
?>  <script type="text/javascript" language="javascript"> 
                            $json_string = file_get_contents('../../install/sql-config/sql.json');
                                echo "<td>".urldecode($row[1])."</td>";
<?php
include("../check.php");
$data1 = array();
if ($_POST["tool"] == "on") {
    $data1['tool'] = "true";
} else {
    $data1['tool'] = "false";
}
$data1['kind'] = $_POST["kind"];
if ($_POST["kind"] == "one") {
    $data1['content'] = '<center><p id="hitokoto"><a style="color:#000000" href="#" id="hitokoto_text">获取中...</a></p></center><script>fetch(\'https://v1.hitokoto.cn\').then(response => response.json()).then(data => {const hitokoto = document.querySelector(\'#hitokoto_text\');hitokoto.href = \'https://hitokoto.cn/?uuid=\' + data.uuid;
        if (data.from_who == null) {
        hitokoto.innerHTML = "「 " + data.hitokoto + " 」<br>——" + data.from;
        }else {
        hitokoto.innerHTML = "「 " + data.hitokoto + " 」<br>——" + data.from_who + "「" + data.from + "」"
        }}).catch(console.error)
        </script>';
} else if ($_POST["kind"] == "time") {
    $data1['content'] = '<center><a  id="time_is_link" rel="nofollow" style="display:none"></a><span id="China_z43d" style="font-size:25px;"></span><script src="https://widget.time.is/t.js"></script><script>time_is_widget.init({China_z43d:{}});</script></center>';
} else {
    $data1['content'] = $_POST["content"];
}


$json_string1 = json_encode($data1);
$filename1 = '../../resource/config/tool.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"tool.php\"</script>";
<?php
include("../header.php");

?>

<div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

    <div class="mdui-card">

        <div class="mdui-card-primary">
            <div class="mdui-card-primary-title" style="font-size:30px">小组件设置</div>
        </div>
        <form method="post" action="run-tool.php">
            <m-scrollbar style="height: 620px;width:900px">
                <div class="mdui-card-content" style="font-size:15px;text-align:left">

                    <label class="mdui-switch">
                        开启小组件&nbsp;&nbsp;&nbsp;
                        <input <?
                                if ($data_tool["tool"]  == "true") {
                                    echo " checked='true'";
                                }
                                ?> name="tool" type="checkbox" />
                        <i class="mdui-switch-icon"></i>
                    </label> <br>
                    <label class="mdui-textfield-label">选择小组件</label>
                    <select class="mdui-select" name="kind" id="kind" onchange="kindmove()" mdui-select>
                        <?

                        if ($data_tool["kind"] == "one") {
                            echo ' <option value="one" selected>一言</option>';
                            echo '   <option value="time" >时间</option>';
                            echo '   <option value="write" >自定义</option>';
                        } else if ($data_tool["kind"] == "time") {
                            echo ' <option value="one" >一言</option>';
                            echo '   <option value="time" selected>时间</option>';
                            echo '   <option value="write" >自定义</option>';
                        } else {
                            echo ' <option value="one" >一言</option>';
                            echo '   <option value="time" >时间</option>';
                            echo '   <option value="write" selected>自定义</option>';
                        }
                        ?>


                    </select> <br> <br>
                    <div id="con" style="display:none" class="mdui-textfield  mdui-textfield-has-bottom ">
                        <label class="mdui-textfield-label">输入内容</label>


                        <textarea rows="7" class="mdui-textfield-input" name="content" type="text" required=""><? echo $data_tool["content"]; ?></textarea>
                    </div>
                    <br>
                    <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">提交</button>

                </div>
            </m-scrollbar>
        </form>
    </div>

</div>
<script>
    function kindmove() {
        if (document.getElementById("kind").value == "write") {
            document.getElementById("con").style.display = "inline";
        } else {
            document.getElementById("con").style.display = "none";
        }
    }
    window.onload = () => {
        kindmove()
    }
</script>
<script src="../../../../../../resource/js/mtu.min.js"></script>
<script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
<?php
function isImage($imgPath){
if($imgPath=="jpg"||$imgPath=="png"||$imgPath=="gif"||$imgPath=="jpeg"){
return true;
}else{
  return false;
}
}

$fileInfo = $_FILES['file'];
$name = $fileInfo['name'];
$pathname = pathinfo($name)["extension"];
$filename =  pathinfo($name, PATHINFO_FILENAME);
$filePath = $fileInfo['tmp_name'];
if(isImage($pathname)==false){
  exit;
}
 //$name = iconv('utf-8', 'gb2312', $filename);
  $str = rand();
  $path = "../../upload/upload_" . md5($str) . "." . $pathname;
  move_uploaded_file($filePath, $path);
  echo json_encode([
    "code" => 0,
    "data" => [
      "url" => $path,
      "name" => $name
    ]
  ]);
<?php
include("../check.php");

header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {

      $str='INSERT INTO `rapidcmscategory`(`id`, `name`, `pic`, `num`) VALUES ("'.$_POST["id"].'","'.rawurlencode($_POST["name"]).'","'.$_POST["pic"].'",'.$_POST["num"].')';

	  $result=mysqli_query($link,$str);
      sendalert("增加成功！");
  }
}
?>
<?php
include("../header.php");

?>


<script>
    function randomString(length, ) {
        var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
        var result = '';
        for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
        return result;
    }

    function resetnum() {
        document.getElementById("ranid").value = randomString(10);
    }
    window.onload = function() {
        resetnum()
    }
</script>
<div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

    <div class="mdui-card">

        <div class="mdui-card-primary">
            <div class="mdui-card-primary-title" style="font-size:30px">分类设置</div>
        </div>

        <m-scrollbar style="height: 800px;width:900px;text-align:left ">
            <div id="login" class="mc-account mc-login mdui-dialog mdui-dialog-open " style="overflow: hidden;z-index:999;display: block; top: 150.104px; height: 700px;">
                <button class="mdui-btn mdui-btn-icon close" onclick="window.location.href='category.php'"><i class="mdui-icon material-icons">close</i></button>

                <div class="mdui-dialog-title">新增</div>
                <form method="post" action="cate-add-run.php">

                    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
                        <label class="mdui-textfield-label">唯一ID（10位字符）</label>
                        <input class="mdui-textfield-input" style="width:90%" type="text" name="id" id="ranid" value="onload" required="">
                        <i style="cursor:pointer;position: absolute;left: 92%" onclick="resetnum(10)" class="mdui-icon material-icons">&#xe5d5;</i>
                    </div>
                    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
                        <label class="mdui-textfield-label">名称</label>
                        <input class="mdui-textfield-input" type="text" name="name" required="">
                    </div>
                    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
                        <label class="mdui-textfield-label">图标ID（在MDUI中获取&#XXXX;）</label>
                        <input class="mdui-textfield-input" style="width:90%" type="text" name="pic" required="">
                        <i style="cursor:pointer;position: absolute;left: 92%" onclick="window.open('https://www.mdui.org/docs/material_icon')" class="mdui-icon material-icons">&#xe250;</i>
                    </div>
                    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom ">
                        <label class="mdui-textfield-label">权重（大的在前面）</label>
                        <input class="mdui-textfield-input" type="number" name="num" required="">
                    </div>

                    <div class="actions mdui-clearfix">
                        <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button>
                    </div>
                </form>
            </div>
        </m-scrollbar>

    </div>

</div>

<script src="../../../../../../resource/js/mtu.min.js"></script>
<script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
<?php
include("../check.php");

header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {

      $str="DELETE FROM `rapidcmscategory` WHERE id='".$_GET["id"]."'";
	  $result=mysqli_query($link,$str);
      sendalert("删除成功！请刷新");
  }
}
?>
<?php
include("../check.php");

header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {
  
      $str='  UPDATE `rapidcmscategory` SET `name`="'.rawurlencode($_POST["name"]).'",`pic`="'.$_POST["pic"].'",`num`='.$_POST["num"].' WHERE `id`="'.$_POST["id"].'"';
      
	  $result=mysqli_query($link,$str);
      sendalert("修改成功！");
  }
}
?>
include("../header.php");


$json_string = file_get_contents('../../install/sql-config/sql.json');
include("../header.php");
<script type="text/javascript" language="javascript"> 
                    $json_string = file_get_contents('../../install/sql-config/sql.json');
                        echo "<td>".urldecode($row[1])."</td>";
<?php
include("../../resource/variable.php");
function encode($string = '', $skey = 'cxphp')
{
    $strArr = str_split(base64_encode($string));
    $strCount = count($strArr);
    foreach (str_split($skey) as $key => $value)
        $key < $strCount && $strArr[$key] .= $value;
    return str_replace(array('=', '+', '/'), array('O0O0O', 'o000o', 'oo00o'), join('', $strArr));
}

$json_string = file_get_contents('../../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link = mysqli_connect($dataxxx['server'], $dataxxx['dbusername'], $dataxxx['dbpassword'], $dataxxx['dbname']);
$sql = "select password from `rapidcmsadmin` where username=\"admin\"";
$result = mysqli_query($link, $sql);
$pass = mysqli_fetch_row($result);
$pa = $pass[0];

if ($_COOKIE["admin"] != encode('admin', $pa)) {
    Header("Location: ../admin_user/login.php");
}

?>
<? include("../header.php"); ?>
<? include("../header.php"); ?>
<?php
include("../check.php");

$data1 = array();
if($_POST["close"]=="on"){
    $data1['close'] = "true";
}else{
    $data1['close'] = "false";
}
$data1['template'] = $data_index["template"];
$data1['version'] = $data_index["version"];
$data1['rewrite'] = $data_index["rewrite"];

$json_string1 = json_encode($data1);
$filename1 = '../../resource/config/index.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"server.php\"</script>";
<?php
include("../check.php");

$data1 = array();
if($_POST["logonwithmail"]=="on"){
    $data1['logonwithmail'] = "true";
}else{
    $data1['logonwithmail'] = "false";
}
$data1['smtp'] = $_POST["smtp"];
$data1['secure'] = $_POST["secure"];
$data1['port'] = $_POST["port"];
$data1['username'] = $_POST["username"];
$data1['password'] = $_POST["password"];
$json_string1 = json_encode($data1);
$filename1 = '../../resource/config/mail.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"mail.php\"</script>";
<?php
include("../check.php");

$data1 = array();
if($_POST["rewrite"]=="on"){
    $data1['rewrite'] = "true";
}else{
    $data1['rewrite'] = "false";
}
$data1['template'] = $data_index["template"];
$data1['version'] = $data_index["version"];
$data1['close'] = $data_index["close"];

$json_string1 = json_encode($data1);
$filename1 = '../../resource/config/index.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"rewrite.php\"</script>";
<?php
include("../check.php");
$data1 = array();
$data1['headname'] = $_POST["headname"];
$data1['title'] = $_POST["title"];
$data1['icon'] =  $data_header["icon"];
$data1['description'] = $_POST["description"];
$data1['keywords'] = $_POST["keywords"];
$data1['introduce'] = $_POST["introduce"];
$data1['con'] = $_POST["con"];
$json_string1 = json_encode($data1);
$filename1 = '../../resource/config/header.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"setting.php\"</script>";
<? include("../header.php"); ?>
    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">


        <div class="mdui-card" style="width:900px">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px">网站服务设置</div>
            </div>
            <form method="post" action="run-close.php">
            <div class="mdui-card-content" style="font-size:15px;text-align:left">
            <label class="mdui-switch">
                            启用网页维护&nbsp;&nbsp;&nbsp;
                            <input <?
                                    if ($data_index["close"]  == "true") {
                                        echo " checked='true'";
                                    }
                                    ?> name="close" type="checkbox" />
                            <i class="mdui-switch-icon"></i>
                        </label> 
                        <br> <br>
                        <button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">确认</button>
                  
            </div>
            </form>
        </div>
        <br>
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
<? include("../header.php"); ?>
include("../check.php");
  $path = "../../" . $path1;
  $filename1 = '../../resource/config/header.json';
  echo "<script type=" . "\"" . "text/javascript" . "\"" . ">" . "window.location=\"setting.php\"</script>";
        <a href="../../admin/index.php">
                <a href="../../admin/config/setting.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">基本设置</a>
                <a href="../../admin/config/server.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">服务设置</a>
                <a href="../../admin/config/mail.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">邮件设置</a>
                <a href="../../admin/config/rewrite.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">伪静态设置</a>
        <a href="../../admin/user/user.php">
                <a href="../../admin/category/category.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">查看分类</a>
                <a href="../../admin/category/cate-add.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">新增分类</a>
                <a href="../../admin/article/article.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">查看文章</a>
                <a href="../../admin/article/article-add.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">新增文章</a>
                <a href="../../admin/article/tool.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">小组件</a>
        <a href="../../admin/function/temp.php">
        <a href="../../admin/function/plugin.php">
        <div class="mdui-collapse" mdui-collapse>
            <div class="mdui-collapse-item">
                <div class="mdui-collapse-item-header">
                    <li class="mdui-collapse-item-header mdui-list-item mdui-ripple" style="font-size:15px!important">
                    <i class="mdui-list-item-icon mdui-icon material-icons">assignment_ind</i>
                        <div class="mdui-list-item-content" style="font-size:15px!important">账户</div>
                        <div class="mdui-collapse-item-arrow">
                            <i class="mdui-collapse-item-arrow mdui-icon material-icons">keyboard_arrow_down</i>
                        </div>
                    </li>
                </div>
                <div class="mdui-collapse-item-body mdui-list">
                <a href="../../admin/admin_user/movepass.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">修改密码</a>
                <a href="../../admin/admin_user/loginout.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">退出登录</a>
                </div>
            </div>
        </div>

                <a href="../../admin/system/update.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">检查更新</a>
                <a href="../../admin/function/plus.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">高级功能</a>
                <a href="../../admin/system/about.php" style="padding-left: 72px;" class="mdui-list-item mdui-ripple">关于</a>
      
</div>
<?php
include("../header.php");

?>
    <div class="medium" style=" text-align:center;display: flex">

        <div>
            <div style="color:black;font-size: 20px;" class="mdui-typo">
                <h1 style="font-weight: bold;">插件获取</h1>
                <h5>插件名称：<?php echo $_GET["name"]; ?> </h5>
                
                <br>


                <?php

$arrContextOptions=array(
    "ssl"=>array(
        "verify_peer"=>false,
        "verify_peer_name"=>false,
    ),
);  
file_put_contents("../../plugin/".$_GET["name"].".zip", file_get_contents("http://cdn.jsdelivr.net/gh/codewyx/cmscdn/plugin/".$_GET["name"].".zip", false, stream_context_create($arrContextOptions)));
            
require_once('../src/pclzip.lib.php');

                $zip = new PclZip("../plugin/".$_GET["name"].".zip");
                $result = $zip->extract(PCLZIP_OPT_PATH, "../plugin/");
                if ($result == 0) {
                    echo '<br>输入错误';
                    unlink("../../plugin/" . $_GET["name"] . ".zip");
                } else {
                    echo '<br>导入成功';
                    unlink("../../plugin/" . $_GET["name"] . ".zip");
                }

                ?>
            </div>

        </div>
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
<?php
include("../header.php");

?>
    <div class="medium" style=" text-align:center;display: flex">

        <div>
            <div style="color:black;font-size: 20px;" class="mdui-typo">
                <h1 style="font-weight: bold;">模板获取</h1>
                <h5>模板名称：<?php echo $_GET["name"]; ?> </h5>
                
                <br>


                <?php

$arrContextOptions=array(
    "ssl"=>array(
        "verify_peer"=>false,
        "verify_peer_name"=>false,
    ),
);  
file_put_contents("../../template/".$_GET["name"].".zip", file_get_contents("http://cdn.jsdelivr.net/gh/codewyx/cmscdn/".$_GET["name"].".zip", false, stream_context_create($arrContextOptions)));
            
                require_once('../src/pclzip.lib.php');

                $zip = new PclZip("../../template/" .$_GET["name"].".zip");
                $result = $zip->extract(PCLZIP_OPT_PATH, "../template/");
                if ($result == 0) {
                    echo '<br>输入错误';
                    unlink("../../template/" . $_GET["name"] . ".zip");
                } else {
                    echo '<br>导入成功';
                    unlink("../../template/" . $_GET["name"] . ".zip");
                }

                ?>
            </div>

        </div>
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
<?php
include("../check.php");
function removeDir($dirName)
{
    if (!is_dir($dirName)) {
        return false;
    }
    $handle = @opendir($dirName);
    while (($file = @readdir($handle)) !== false) {
        if ($file != '.' && $file != '..') {
            $dir = $dirName . '/' . $file;
            is_dir($dir) ? removeDir($dir) : @unlink($dir);
        }
    }
    closedir($handle);
    @rmdir($dirName);
}
removeDir('../../plugin/' . $_GET["id"]);
echo "<script type='text/javascript'>window.location.href='plugin.php'</script>";
<?php
include("../check.php");
$json_string=file_get_contents('../../plugin/'. $_GET["id"]."/version.json");
$row = json_decode($json_string, true);
if($row["use"]==true){
    $data = array();
    $data['key'] =$row["key"];
    $data['name'] = $row["name"];
    $data['version'] = $row["version"];
    $data['author'] = $row["author"];
    $data['use'] = false;
    $json_string = json_encode($data);
    
    file_put_contents('../../plugin/'. $_GET["id"]."/version.json", $json_string);

   }else{
    $data = array();
    $data['key'] =$row["key"];
    $data['name'] = $row["name"];
    $data['version'] = $row["version"];
    $data['author'] = $row["author"];
    $data['use'] = true;
    $json_string = json_encode($data);
    
    file_put_contents('../../plugin/'. $_GET["id"]."/version.json", $json_string);
   }
   echo "<script type='text/javascript'>window.location.href='plugin.php'</script>"
?>
<?php
include("../header.php");

?>
<script type="text/javascript" language="javascript">
    function confirmAct() {
        if (confirm('确定要删除插件吗?')) {
            return true;
        }
        return false;
    }

    function confirmAct1() {
        if (confirm('确定要禁用插件吗?')) {
            return true;
        }
        return false;
    }

    function confirmAct2() {
        if (confirm('确定要启用插件吗?')) {
            return true;
        }
        return false;
    }
</script>
<div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

    <div class="mdui-card" style="overflow:scroll">

        <div class="mdui-card-primary">
            <div class="mdui-card-primary-title" style="font-size:30px;">插件设置</div>

        </div>
        <div class="mdui-divider"></div> <br>
        <m-scrollbar style="height: 650px;width:900px;">

            <form method="get" action="download-plugin.php" style="text-align:left;padding:0 0 0 250px">
                <div style="  display: flex;gap: 47px;">

                    <div>输入Key加载插件：<input style="width:300px" class="mdui-textfield-input" name="name" type="text" value="" required=""> </div>
                    <div><button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button><br><br>
                    </div>




                </div>
            </form>
            <br>
            <div class="mdui-divider"></div> <br>
            <div style="width:90%;position: absolute;left: 50%;    transform: translateX(-50%  );" class="mdui-table-fluid">

                <table class="mdui-table">
                    <thead>
                        <tr>
                            <th>ID-Key</th>
                            <th>名称</th>
                            <th>版本</th>
                            <th>作者</th>
                            <th>状态</th>
                            <th class="mdui-table-col-numeric"> </th>
                        </tr>
                    </thead>
                    <tbody>

                        <?php




                        $file = scandir("../../plugin");

                        for ($i = 2; $i < count($file); $i++) {
                            if ($file[$i] == ".gitkeep") {
                            } else {
                                $json_string = file_get_contents('../../plugin/' . $file[$i] . "/version.json");
                                $row = json_decode($json_string, true);
                                echo "<tr>";
                                echo "</tr>";
                                echo "<td>" . $row["key"] . "</td>";
                                echo "<td>" . $row["name"] . "</td>";
                                echo "<td>" . $row["version"] . "</td>";
                                echo "<td>" . $row["author"] . "</td>";
                                if ($row["use"] == true) {
                                    echo "<td style='color:green'><strong>启用</strong></td>";
                                    echo '<td><a target="_blank" href="' . '../../plugin/' . $file[$i] . "/setting.php" . '"><button class="mdui-btn mdui-btn-icon mdui-ripple">   <i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe3c9;</i></button></a>';
                                    echo '<a onclick="return confirmAct1();" href="plugin-move.php?id=' . $file[$i] . '"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe644;</i></button></a>';
                                } else {
                                    echo "<td style='color:red'><strong>禁用</strong></td>";
                                    echo '<td><a target="_blank" href="' . '../../plugin/' . $file[$i] . "/setting.php" . '"><button class="mdui-btn mdui-btn-icon mdui-ripple">   <i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe3c9;</i></button></a>';
                                    echo '<a onclick="return confirmAct2();" href="plugin-move.php?id=' . $file[$i] . '"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe86c;</i></button></a>';
                                }


                                echo '<a onclick="return confirmAct();" href="plugin-del.php?id=' . $file[$i] . '"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe872;</i></button></a>&nbsp;';

                                echo "</td>";
                            }
                        }



                        ?>


                    </tbody>
                </table>
            </div>
        </m-scrollbar>

    </div>

</div>

<script src="../../../../../../resource/js/mtu.min.js"></script>
<script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
include("../check.php");
$json_string = file_get_contents('../../install/sql-config/sql.json');
copydir("../../resource/config", $dir . "config");

include("../check.php");
require_once('../src/pclzip.lib.php');
require_once('../src/pclzip.lib.php');

include("../check.php");
$json_string = file_get_contents('../../install/sql-config/sql.json');
<?php
include("../header.php");

?>
    <br><br>
    <div style=" position:  relative;left:15%">
        <div class="mdui-card" style="width:70%;height:300px; ">
            <div class="mdui-card-primary" style="text-align:center;">
                <div class="mdui-card-primary-title" style="font-size:30px">从SharkCMS迁移数据</div>
            </div>
            <br>
            <label class="mdui-textfield-label">&nbsp;&nbsp;&nbsp;选择导入方式</label>
            &nbsp;&nbsp;&nbsp;
            <label class="mdui-radio">
                <input type="radio" name="group1" checked />
                <i class="mdui-radio-icon"></i>
                从本程序所在数据库导入
            </label>

            <label class="mdui-radio">
                <input type="radio" name="group1" disabled />
                <i class="mdui-radio-icon"></i>
                从其他数据库导入（暂不支持）
            </label>
            <br>  <br>
            &nbsp;&nbsp;&nbsp;<a href="plus-shark-run.php"><button name="sub" class="mdui-btn mdui-btn-raised mdui-text-color-black action-btn">一键导入文章</button></a>
       
        </div>
    </div>
    <br>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
<?php
include("../header.php");

?>
    <br><br>
    <div style=" position:  relative;left:15%">
        <div class="mdui-card" style="width:70%;height:300px; ">
            <div class="mdui-card-primary" style="text-align:center;">
                <div class="mdui-card-primary-title" style="font-size:30px">数据设置</div>
            </div>
            <div class="mdui-tab" mdui-tab>
                <a href="#move1" class="mdui-ripple">备份数据</a>
                <a href="#move2" class="mdui-ripple">导入备份</a>
           <a href="#move3" class="mdui-ripple">迁移数据</a> 
            </div>
            <div id="move1" class="mdui-p-a-2">
            <label class="mdui-textfield-label">备份系统数据，树立安全意识</label>
               
                <a href="plus-back-run.php"><button name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">备份数据</button></a>
           </div>
            <div id="move2" class="mdui-p-a-2">
            <label class="mdui-textfield-label">配置文件暂不支持，请解压后手动复制粘贴</label>
            
           <!--    <form enctype="multipart/form-data" id="fileupdateform" method="post" action="plus-back-upload-sql.php"><button for="file" onclick="document.getElementById('file').click()" type="button" style="color:black" class="mdui-btn mdui-btn-raised  action-btn">导入.sql文件</button><br>                    <input style="display: none;" onchange="document.getElementById('fileupdateform').submit()"   name="file"  id="file" type="file" required=""></form>
    --></div>
           <div id="move3" class="mdui-p-a-2">
            <label class="mdui-textfield-label">迁移其他数据，便捷导入内容</label>
                   <a href="plus-shark.php"><button name="sub" class="mdui-btn mdui-btn-raised mdui-text-color-black action-btn">从SharkCMS迁移数据</button></a>
       
            </div>
         </div>
    </div>
    <br>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
<?php
include("../check.php");
$data1 = array();
$data1['template'] = $_POST["template"];
$data1['version'] = $data_index["version"];
$data1['rewrite'] = $data_index["rewrite"];
$data1['close'] = $data_index["close"];
$json_string1 = json_encode($data1);
$filename1 = '../../resource/config/index.json';
$fp1 = fopen($filename1, "w");
$len1 = fwrite($fp1, $json_string1);
fclose($fp1);
sendalert("修改成功！");
<?php
include("../header.php");

?>
    <div style=" position:  relative;left:25%;top:10%">


        <div class="mdui-card" style="width:600px">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px">设置模板</div>
            </div>
            <m-scrollbar style="font-size:15px;height: 400px">
                <div class="mdui-card-content" style="font-size:18px;text-align:left">
                    当前模板：<? echo $data_index["template"] ?>
                    &nbsp;&nbsp;&nbsp;          &nbsp;&nbsp;&nbsp;          &nbsp;&nbsp;     <a  target="_blank" href="../../../../template/<? echo $data_index["template"] ?>/setting.php"><button type="button" style="color:black" class="mdui-btn mdui-btn-raised  action-btn">模板单独设置</button></a><br><br>
                    <form method="post" action="temp-run.php"> 切换模板：
                        <select class="mdui-select" name="template" mdui-select>



                            <?php

                            $file = scandir("../../template");

                            for ($i = 2; $i < count($file); $i++) {
                                echo '  <option value="' . $file[$i] . '">' . $file[$i] . '</option>';
                            }
                            ?></select>
                        &nbsp;&nbsp;&nbsp;
                        <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button><br><br>
                    </form>
                    <form method="get" action="download-template.php"> 输入Key加载模板：
                      <div style="display: inline;">  
                    <input style="width:300px" class="mdui-textfield-input" name="name" type="text"
                                value="" required="">
                                <br>
                        <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">确认</button><br><br>
                        </div>
                    </form>
                    <a  target="_blank" href="https://www.yuque.com/rapid/cms/yo0y1er0vg6rl86g"><button type="button" style="color:black" class="mdui-btn mdui-btn-raised  action-btn">进入文档获取模板</button><br><br></a>
                     

                </div>
            </m-scrollbar>

        </div>
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
<? include("check.php"); ?>

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>RapidCMS管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon"" href=" ../../../resource/img/icon.png" type="image/x-icon" />
    <link rel="stylesheet" href="../../../../resource/css/mdui.min.css" />
    <link rel="stylesheet" href="../../../resource/css/mtu.min.css">
    <link rel="stylesheet" href="../../../resource/css/style.css">
    <link rel="stylesheet" href="../../../template/default/theme.css">
    
</head>

<body class=" mdui-appbar-with-toolbar mdui-theme-accent-deep-purple mdui-theme-primary-deep-purple mdui-text-color-white mdui-drawer-body-left" style="--color-primary:79, 55, 139; --color-accent: 79, 55, 139;">
    <div class="mdui-toolbar mdui-color-theme mdui-text-color-white mdui-appbar mdui-appbar-fixed mdui-headroom">
        <button class="drawer mdui-btn mdui-btn-icon mdui-ripple" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></button>
        <span class="mdui-typo-title">RapidCMS 管理后台</span>
    </div>

    <? include("../drawer.php"); ?>
    <style>
        * {
            font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        }
    </style>
$json_string = file_get_contents('../install/sql-config/sql.json');
    Header("Location: admin_user/login.php");
<?php
include("../header.php");

?>
<div class="medium" style=" text-align:center;display: flex;gap: 47px;">
    <img style="Border-radius:10px" width="200px" src="../../../upload/logo.png">
    <div>
        <div style="color:black;font-size: 20px;" class="mdui-typo">
            <h1 style="font-weight: bold;">RapidCMS</h1>
        </div>
        <div style="color:black;font-size: 10px;" class="mdui-typo">
            <h1>简单好用的官网CMS系统</h1>
        </div>
    </div>
</div>

<script src="../../../../../../resource/js/mtu.min.js"></script>
<script src="../../../../../../resource/js/mdui.min.js"></script>

</body>
</html>
<?php
include("../header.php");

?>
    <div class="medium" style=" text-align:center;display: flex">

        <div>
            <div style="color:black;font-size: 20px;" class="mdui-typo">
                <h1 style="font-weight: bold;">版本更新</h1>
                <h5>正在更新中，版本：<?php echo $_GET["version"]; ?> </h5>

                <br>


                <?php

                $arrContextOptions = array(
                    "ssl" => array(
                        "verify_peer" => false,
                        "verify_peer_name" => false,
                    ),
                );
                file_put_contents("../../upload/" . $_GET["version"] . ".zip", file_get_contents("http://cdn.jsdelivr.net/gh/codewyx/cmscdn/version/" . $_GET["version"] . ".zip", false, stream_context_create($arrContextOptions)));

                require_once('../src/pclzip.lib.php');

                $zip = new PclZip("../../upload/" . $_GET["version"] . ".zip");
                $result = $zip->extract(PCLZIP_OPT_PATH, "../");
                if ($result == 0) {
                    echo '<br>更新失败';
                    unlink("../../upload/" . $_GET["version"] . ".zip");
                } else {
                    echo '<br>更新成功';
                    unlink("../../upload/" . $_GET["version"] . ".zip");
                }

                ?>
            </div>

        </div>
    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>

</body>

</html>
include("../header.php");
<?php
include("../check.php");

header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {

      $str="DELETE FROM `rapidcmsuser` WHERE username='".$_GET["username"]."'";
	  $result=mysqli_query($link,$str);
      sendalert("删除成功！");
  }
}
?>
<?php
include("../check.php");

header ( "Content-type:text/html;charset=utf-8" );
$json_string = file_get_contents('../../install/sql-config/sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx['server'],$dataxxx['dbusername'],$dataxxx['dbpassword']);

if($link)
{
    $select=mysqli_select_db($link,$dataxxx['dbname']);
  if($select)
  {
    $password1=md5(sha1(md5($_POST["password"])));
      $str="UPDATE `rapidcmsuser` SET `password`= '".$password1."' WHERE username='".$_POST["username"]."'";

	  $result=mysqli_query($link,$str);
    sendalert("修改成功！");
  }
}
?>
<?php
include("../header.php");

?>

    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

        <div class="mdui-card">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px">用户设置</div>
            </div>
           
                <m-scrollbar style="height: 650px;width:900px;text-align:left ">
                <div id="login" class="mc-account mc-login mdui-dialog mdui-dialog-open " style="overflow: hidden;z-index:999;display: block; top: 150.104px; height: 540.792px;">
                <button class="mdui-btn mdui-btn-icon close" onclick="window.location.href='user.php'"><i class="mdui-icon material-icons">close</i></button>
 
<div class="mdui-dialog-title">修改用户密码</div>
<form method="post" action="user-move-run.php">
<div style="display:none" class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom "><label class="mdui-textfield-label">用户名</label><input class="mdui-textfield-input" value="<?echo $_GET["username"]?>"  name="username" type="text" >
        <div class="mdui-textfield-error">账号不能为空</div>
    </div>
    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom "><label class="mdui-textfield-label">用户名</label><input class="mdui-textfield-input" value="<?echo $_GET["username"]?>" type="text" disabled="true">
        <div class="mdui-textfield-error">账号不能为空</div>
    </div>
    <div class="mdui-textfield mdui-textfield-floating-label mdui-textfield-has-bottom"><label class="mdui-textfield-label">新密码</label><input class="mdui-textfield-input" name="password" type="password" required="">
        <div class="mdui-textfield-error">密码不能为空</div>
    </div>
    <div class="actions mdui-clearfix">
       <button type="submit" name="sub" class="mdui-btn mdui-btn-raised mdui-color-theme action-btn">修改</button>
    </div>
</form>
</div>
                </m-scrollbar>
  
        </div>

    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>



<?php
include("../header.php");

?>

    <div style="    position: absolute;left: 60%;top:10%;text-align:center;    transform: translateX(-50%  );">

        <div class="mdui-card" style="overflow:scroll">

            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" style="font-size:30px;">用户设置</div>
            </div>
           
                <m-scrollbar style="height: 650px;width:900px;">
                    <div style="width:80%;position: absolute;left: 50%;    transform: translateX(-50%  );"  class="mdui-table-fluid">
                        <table class="mdui-table">
                            <thead>
                                <tr>
                                    <th>用户名</th>
                                    <th>用户状态</th>
                                    <th  class="mdui-table-col-numeric"> </th>
                                </tr>
                            </thead>
                            <tbody>

                    <?php
                    $table_name = "rapidcmsuser";
                    $json_string = file_get_contents('../../install/sql-config/sql.json');
                    $data = json_decode($json_string, true);
                    $conn = mysqli_connect($data['server'], $data['dbusername'], $data['dbpassword'], $data['dbname']);
                    $sql = 'select * from `' . $table_name . '`';
                    $res = mysqli_query($conn, $sql);
                    $colums = mysqli_num_fields($res);
                    while ($row = mysqli_fetch_row($res)) {
                       echo "<tr>";
                        echo "</tr>";
                        echo "<td>$row[0]</td>";
                        echo "<td>$row[2]</td>";
                        echo '<td ><a href="user-del.php?username='.$row[0].'"><button class="mdui-btn mdui-btn-icon mdui-ripple"><i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe872;</i></button></a>&nbsp;&nbsp;&nbsp;&nbsp;';
                        echo '<a href="user-move.php?username='.$row[0].'"><button class="mdui-btn mdui-btn-icon mdui-ripple">   <i style="color:#6E6E6E" class="mdui-icon material-icons">&#xe3c9;</i></button></a></td>';
                    }
                    ?>
                                  
                               
                            </tbody>
                        </table>
                    </div>
                </m-scrollbar>
  
        </div>

    </div>

    <script src="../../../../../../resource/js/mtu.min.js"></script>
    <script src="../../../../../../resource/js/mdui.min.js"></script>
</body>

</html>
{"lock":"install"}
{"template":"default","version":"1.3.1","rewrite":"false","close":"false"}
{"tool":"true","kind":"time","content":"<center><a  id=\"time_is_link\" rel=\"nofollow\" style=\"display:none\"><\/a><span id=\"China_z43d\" style=\"font-size:25px;\"><\/span><script src=\"https:\/\/widget.time.is\/t.js\"><\/script><script>time_is_widget.init({China_z43d:{}});<\/script><\/center>"}
<style>
    * {
        font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    }
</style>
                echo ' <div class="mdui-typo" style="padding: 10px;">' . $data_tool["content"] . '</div><br></div><br>';
<style>
    * {
        font-family: "MiSans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    }
</style>
<body class=" mdui-appbar-with-toolbar mdui-theme-accent-white  mdui-theme-primary-white mdui-text-color-black mdui-drawer-body-left" style="--color-primary: 63, 81, 181; --color-accent: 63, 81, 181;">
    <div class="mdui-toolbar mdui-color-white mdui-text-color-black mdui-appbar mdui-appbar-fixed mdui-headroom">