mirror of
https://github.com/tznb1/TwoNav.git
synced 2025-08-10 08:51:49 +00:00
v2.1.03-20231019
This commit is contained in:
@@ -1194,9 +1194,17 @@ function write_theme(){
|
||||
}
|
||||
}else{
|
||||
$s_templates[$fn] = $name;
|
||||
if($fn == 'transit'){
|
||||
$site = unserialize(get_db('user_config','v',['uid'=>UID,'k'=>'s_site']));
|
||||
if($site['link_model'] != 'Transition'){
|
||||
$site['link_model'] = 'Transition';
|
||||
update_db("user_config",["v"=>$site],["k"=>'s_site',"uid"=>UID]);
|
||||
$msg = ',已同步链接模式为过渡页面';
|
||||
}
|
||||
}
|
||||
}
|
||||
//更新数据
|
||||
update_db('user_config',['v'=>$s_templates],['uid'=>UID,'k'=>'s_templates'],[1,'设置成功']);
|
||||
update_db('user_config',['v'=>$s_templates],['uid'=>UID,'k'=>'s_templates'],[1,"设置成功{$msg}"]);
|
||||
|
||||
//配置主题信息
|
||||
}elseif($_GET['type'] == 'config'){
|
||||
|
||||
@@ -402,6 +402,7 @@ function other_root(){
|
||||
delfile($dir,30);
|
||||
$size = $_SESSION['CleanCacheSize'];
|
||||
unset($_SESSION['CleanCacheSize']);
|
||||
clean_cache();
|
||||
if($size == 0){
|
||||
msg(1,'暂无可清理缓存');
|
||||
}
|
||||
@@ -465,11 +466,12 @@ function other_services(){
|
||||
msg(-1,'请求官方服务器失败,请稍后再试');
|
||||
}
|
||||
$data = json_decode($Res["content"], true);
|
||||
$msg = $data['msg'];
|
||||
// 如果是保存设置
|
||||
if($_GET['type'] == 'save_key'){
|
||||
$data = $data['data'];
|
||||
if(!isset($data['order_id']) || empty($data['order_id'])){
|
||||
msg(-1,'保存失败,请核对信息是否有误');
|
||||
msg(-1,empty($msg) ? '保存失败,请核对信息是否有误<br />' : $msg);
|
||||
}
|
||||
//判断是否为IP
|
||||
if(preg_match("/^(\d+\.\d+\.\d+\.\d+):*\d*$/",$domain,$host)) {
|
||||
|
||||
@@ -150,7 +150,7 @@ $db_config = array(
|
||||
// mysql
|
||||
if($_POST['db_type'] === 'mysql' || $_POST['db_type'] === 'mariadb'){
|
||||
if( !isset($_POST['db_host']) || !isset($_POST['db_port']) || !isset($_POST['db_name']) || !isset($_POST['db_user']) || !isset($_POST['db_password']) ){
|
||||
msg(-1,'MySQL配置错误,请检查..');
|
||||
msg(-1,'数据库配置错误,请检查..');
|
||||
}
|
||||
|
||||
require (DIR.'/system/Medoo.php'); //载入框架
|
||||
@@ -164,13 +164,15 @@ $db_config = array(
|
||||
'password' => $_POST['db_password'],
|
||||
'charset' => 'utf8mb4'
|
||||
]);
|
||||
$ver = $db->info ()['version'];
|
||||
if($_POST['db_type'] === 'mysql'){
|
||||
if(version_compare($db->info ()['version'],'5.6.0','<')){
|
||||
msg(-1,'MySQL数据库版本不能低于5.6,当前版本:'.$db->info ()['version']);
|
||||
if(version_compare($ver,'5.6.0','<')){
|
||||
msg(-1,'MySQL数据库版本不能低于5.6,当前版本:'.$ver);
|
||||
}
|
||||
}else{
|
||||
if(version_compare($db->info ()['version'],'10.1.0','<')){
|
||||
msg(-1,'MariaDB数据库版本不能低于10.1,当前版本:'.$db->info ()['version']);
|
||||
preg_match('/(\d+\.\d+\.\d+)-MariaDB/', $ver, $matches);
|
||||
if(version_compare($matches[1],'10.1.0','<')){
|
||||
msg(-1,'MariaDB数据库版本不能低于10.1,当前版本:'.$ver);
|
||||
}
|
||||
}
|
||||
}catch (Exception $e) {
|
||||
|
||||
@@ -1 +1 @@
|
||||
v2.1.02-20231012
|
||||
v2.1.03-20231019
|
||||
Reference in New Issue
Block a user