仰望星辰工作室

better-staridc-MNBT

better-staridc-MNBT/ user/api/domain.php 1.1 KB · 41 行 原始文件
Z zfhsh first commit 1 天前
1<?php
2// urllist/erurl/tjurl/scurl/seturl 已迁移至 domain_shop 插件(user/api/bind.php)
3// 由 mnbt_plugin_dispatch_ajax 优先分发,本文件仅保留 hqzmlls 与 listurl
4if($egn=='hqzmlls') {
5 //获取当前运行目录(非/)下的子目录列表
6 $arr=[];
7 include("../class.php");
8 $api = new bt_api($btipe,$btkeye);
9 $yxml = ($api->yxmlrhq($zjid,$os_xt.$yhc['sqldz']) ?: [])['runPath']['runPath'] ?? '/';
10 //获取运行目录
11 if($yxml!='/') {
12 $listz = $api->urlzmlls($zjid) ?: [];
13 //子目录域名
14 foreach (($listz['binding'] ?? []) as $val) {
15 //子目录
16 if(substr($val['path'],0,3)!='../') {
17 $arr[]=$val['domain'];
18 }
19 }
20 }
21 if(empty($arr)) {
22 exit('false');
23 } else {
24 exit(json_encode($arr,256));
25 }
26 return;
27}
28if($egn=='listurl') {
29 //获取域名列表(包含子目录)
30 include("../class.php");
31 $api = new bt_api($btipe,$btkeye);
32 $data=$api->get_site_domains($yhc['btid']);
33 $arr=[];
34 foreach (($data['domains'] ?? []) as $val) {
35 if($val['name']!=$yhc['sqldz']) {
36 $arr['domains'][]=["name"=>$val['name']];
37 }
38 }
39 exit(json_encode($arr,256));
40 return;
41}