Skip to content

Commit 47b52bb

Browse files
committed
修正多个ZIP包无法升级失败的Bug
修正sitemap插件读取 增加:加入收藏,设为首页,创建桌面图标等小工能 增加会员弹窗登录 完成会员多种登录方式 完善数据调用,实现api接口调用 完善订单,去除国家,省份,城市等下拉,改成填写框,以方便做外贸类网站
1 parent 9749a6c commit 47b52bb

34 files changed

+718
-777
lines changed

data/xml/langs.xml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
22
<root>
33
<cn>简体中文</cn>
4+
<en>English</en>
45
</root>

framework/admin/admin_control.php

+50-107
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ public function __construct()
2020

2121
public function index_f()
2222
{
23-
if(!$this->popedom["list"])
24-
{
23+
if(!$this->popedom["list"]){
2524
error(P_Lang('无权限,请联系超级管理员开放权限'),'','error');
2625
}
2726
$pageid = $this->get($this->config["pageid"],"int");
@@ -32,15 +31,13 @@ public function index_f()
3231
$condition = "1=1";
3332
$keywords = $this->get("keywords");
3433
$pageurl = $this->url("admin");
35-
if($keywords)
36-
{
34+
if($keywords){
3735
$condition .= " AND account LIKE '%".$keywords."%' ";
3836
$pageurl .= '&keywords='.rawurlencode($keywords);
3937
}
4038
$rslist = $this->model('admin')->get_list($condition,$offset,$psize);
4139
$total = $this->model('admin')->get_total($condition);
42-
if($total > $psize)
43-
{
40+
if($total > $psize){
4441
$pagelist = phpok_page($pageurl,$total,$pageid,$psize,"home=首页&prev=上一页&next=下一页&last=尾页&half=5&add=(total)/(psize)&always=1");
4542
$this->assign("pagelist",$pagelist);
4643
}
@@ -53,33 +50,25 @@ public function set_f()
5350
{
5451
$id = $this->get("id","int");
5552
$plist = array();
56-
if($id)
57-
{
58-
if(!$this->popedom["modify"])
59-
{
53+
if($id){
54+
if(!$this->popedom["modify"]){
6055
error(P_Lang('无权限,请联系超级管理员开放权限'),'','error');
6156
}
62-
if($id == $_SESSION["admin_id"])
63-
{
57+
if($id == $_SESSION["admin_id"]){
6458
error(P_Lang('您不能操作自己的信息'),$this->url("admin"),"error");
6559
}
6660
$this->assign("id",$id);
6761
$rs = $this->model('admin')->get_one($id);
68-
if($rs["if_system"] && !$_SESSION["admin_rs"]["if_system"])
69-
{
62+
if($rs["if_system"] && !$_SESSION["admin_rs"]["if_system"]){
7063
error(P_Lang("非系统管理员不能编辑系统管理员信息"),$this->url("admin"),"error");
7164
}
7265
$this->assign("rs",$rs);
73-
if(!$rs["if_system"])
74-
{
66+
if(!$rs["if_system"]){
7567
$plist = $this->model('admin')->get_popedom_list($id);
7668
}
7769
$category = $rs['category'] ? explode(",",$rs['category']) : array('all');
78-
}
79-
else
80-
{
81-
if(!$this->popedom["add"])
82-
{
70+
}else{
71+
if(!$this->popedom["add"]){
8372
error(P_Lang('无权限,请联系超级管理员开放权限'),'','error');
8473
}
8574
$category = array('all');
@@ -94,17 +83,12 @@ public function set_f()
9483
$c_rs = $this->model('sysmenu')->get_one_condition("appfile='list' AND parent_id>0");
9584
$this->assign("c_rs",$c_rs);
9685
$sitelist = $this->model('site')->get_all_site();
97-
if($sitelist)
98-
{
99-
foreach($sitelist AS $key=>$value)
100-
{
86+
if($sitelist){
87+
foreach($sitelist AS $key=>$value){
10188
$all_project = $this->model('project')->get_all_project($value["id"]);
102-
if($all_project)
103-
{
104-
foreach($all_project AS $k=>$v)
105-
{
106-
if($clist[$v["id"]])
107-
{
89+
if($all_project){
90+
foreach($all_project AS $k=>$v){
91+
if($clist[$v["id"]]){
10892
$all_project[$k]["_popedom"] = $clist[$v["id"]];
10993
}
11094
}
@@ -122,12 +106,9 @@ public function check_if_system_f()
122106
{
123107
$id = $this->get("id","int");
124108
$exit = $this->check_system($id);
125-
if($exit == "ok")
126-
{
109+
if($exit == "ok"){
127110
$this->json("ok",true);
128-
}
129-
else
130-
{
111+
}else{
131112
$this->json($exit);
132113
}
133114
}
@@ -136,20 +117,16 @@ public function check_system($id=0)
136117
{
137118
$condition = "if_system=1 AND status=1";
138119
$rslist = $this->model('admin')->get_list($condition,0,100);
139-
if(!$rslist)
140-
{
120+
if(!$rslist){
141121
return P_Lang('没有系统管理员,请检查');
142122
}
143123
$if_system = false;
144-
foreach($rslist AS $key=>$value)
145-
{
146-
if($value["id"] != $id)
147-
{
124+
foreach($rslist AS $key=>$value){
125+
if($value["id"] != $id){
148126
$if_system = true;
149127
}
150128
}
151-
if(!$if_system)
152-
{
129+
if(!$if_system){
153130
return P_Lang('至少需要有一位可登录的系统管理员,请检查!');
154131
}
155132
return "ok";
@@ -158,18 +135,15 @@ public function check_system($id=0)
158135
//删除管理员
159136
public function delete_f()
160137
{
161-
if(!$this->popedom['delete'])
162-
{
138+
if(!$this->popedom['delete']){
163139
$this->json(P_Lang('无权限,请联系超级管理员开放权限'));
164140
}
165141
$id = $this->get('id','int');
166-
if(!$id)
167-
{
142+
if(!$id){
168143
$this->json(P_Lang('未指定ID'));
169144
}
170145
$exit = $this->check_system($id);
171-
if($exit != "ok")
172-
{
146+
if($exit != "ok"){
173147
$this->json($exit);
174148
}
175149
$this->model('admin')->delete($id);
@@ -182,22 +156,19 @@ public function check_account_f()
182156
$id = $this->get("id","int");
183157
$account = $this->get("account");
184158
$str = $this->check_account($account,$id);
185-
if($str == "ok")
186-
{
159+
if($str == "ok"){
187160
$this->json("ok",true);
188161
}
189162
$this->json($str);
190163
}
191164

192165
public function check_account($account,$id=0)
193166
{
194-
if(!$account)
195-
{
167+
if(!$account){
196168
return P_Lang('账号不能为空');
197169
}
198170
$rs = $this->model('admin')->check_account($account,$id);
199-
if($rs)
200-
{
171+
if($rs){
201172
return P_Lang('账号已存在');
202173
}
203174
return "ok";
@@ -207,86 +178,64 @@ public function check_account($account,$id=0)
207178
public function save_f()
208179
{
209180
$id = $this->get("id","int");
210-
if($id && $id == $_SESSION["admin_id"])
211-
{
181+
if($id && $id == $_SESSION["admin_id"]){
212182
error(P_Lang('您不能操作自己的信息'),$this->url("admin"),"error");
213183
}
214-
if($id)
215-
{
216-
if(!$this->popedom["modify"])
217-
{
184+
if($id){
185+
if(!$this->popedom["modify"]){
218186
error(P_Lang('无权限,请联系超级管理员开放权限'),'','error');
219187
}
220-
}
221-
else
222-
{
223-
if(!$this->popedom["add"])
224-
{
188+
}else{
189+
if(!$this->popedom["add"]){
225190
error(P_Lang('无权限,请联系超级管理员开放权限'),'','error');
226191
}
227192
}
228193
$account = $this->get("account");
229-
if(!$account)
230-
{
194+
if(!$account){
231195
error(P_Lang('账号不能为空'),$this->url("admin","set","id=".$id),"error");
232196
}
233197
$check_str = $this->check_account($account,$id);
234-
if($check_str != "ok")
235-
{
198+
if($check_str != "ok"){
236199
error($check_str,$this->url("admin","set","id=".$id),"error");
237200
}
238201
$array = array();
239202
$array["account"] = $account;
240203
$pass = $this->get("pass");
241-
if(!$pass && !$id)
242-
{
204+
if(!$pass && !$id){
243205
error(P_Lang('密码不能为空'),$this->url("admin","set","id=".$id),"error");
244206
}
245-
if($pass)
246-
{
247-
if(strlen($pass) < 4)
248-
{
207+
if($pass){
208+
if(strlen($pass) < 4){
249209
error(P_Lang('密码长度不能少于4位'),$this->url("admin","set","id=".$id),"error");
250210
}
251211
$array["pass"] = password_create($pass);
252212
}
253213
$array['email'] = $this->get("email");
254-
if($this->popedom["status"])
255-
{
214+
if($this->popedom["status"]){
256215
$array["status"] = $this->get("status","int");
257216
}
258217
$if_system = $this->get("if_system","int");
259-
if(!$_SESSION["admin_rs"]["if_system"])
260-
{
218+
if(!$_SESSION["admin_rs"]["if_system"]){
261219
$if_system = 0;
262220
}
263221
$array["if_system"] = $if_system;
264222
$is_edit = false;
265-
if($id)
266-
{
223+
if($id){
267224
$st = $this->model('admin')->save($array,$id);
268-
if(!$st)
269-
{
225+
if(!$st){
270226
error(P_Lang('管理员信息更新失败,请检查'),$this->url("admin","set","id=".$id),"error");
271227
}
272228
$is_edit = true;
273-
}
274-
else
275-
{
229+
}else{
276230
$id = $this->model('admin')->save($array);
277-
if(!$id)
278-
{
231+
if(!$id){
279232
error(P_Lang('管理员信息添加失败,请检查'),$this->url("admin","set"),"error");
280233
}
281234
}
282-
//清空权限信息
283235
$this->model('admin')->clear_popedom($id);
284-
//更新普通管理员权限
285-
if(!$if_system)
286-
{
236+
if(!$if_system){
287237
$popedom = $this->get("popedom");
288-
if($popedom)
289-
{
238+
if($popedom){
290239
$popedom = array_unique($popedom);
291240
$this->model('admin')->save_popedom($popedom,$id);
292241
}
@@ -298,28 +247,22 @@ public function save_f()
298247
//更新管理员状态
299248
public function status_f()
300249
{
301-
if(!$this->popedom['status'])
302-
{
250+
if(!$this->popedom['status']){
303251
$this->json(P_Lang('无权限,请联系超级管理员开放权限'));
304252
}
305253
$id = $this->get('id','int');
306-
if(!$id)
307-
{
254+
if(!$id){
308255
$this->json(P_Lang('未指定ID'));
309256
}
310-
if($id == $_SESSION["admin_id"])
311-
{
257+
if($id == $_SESSION["admin_id"]){
312258
$this->json(P_Lang('您不能操作自己的信息'));
313259
}
314260
$rs = $this->model('admin')->get_one($id);
315261
$status = $rs["status"] ? 0 : 1;
316262
$action = $this->model('admin')->update_status($id,$status);
317-
if(!$action)
318-
{
263+
if(!$action){
319264
$this->json(P_Lang('更新状态失败'));
320-
}
321-
else
322-
{
265+
}else{
323266
$this->json($status,true);
324267
}
325268
}

framework/api/index_control.php

+12-21
Original file line numberDiff line numberDiff line change
@@ -10,61 +10,52 @@
1010
if(!defined("PHPOK_SET")){exit("<h1>Access Denied</h1>");}
1111
class index_control extends phpok_control
1212
{
13-
function __construct()
13+
public function __construct()
1414
{
1515
parent::control();
1616
}
1717

18-
function index_f()
18+
public function index_f()
1919
{
20-
if(!$this->site['api_code'])
21-
{
20+
if(!$this->site['api_code']){
2221
$this->json(P_Lang("系统未启用接口功能"));
2322
}
2423
$this->json(true);
2524
}
2625

27-
function phpok_f()
26+
public function phpok_f()
2827
{
29-
if(!$this->site['api_code'])
30-
{
28+
if(!$this->site['api_code']){
3129
$this->json(P_Lang("系统未启用接口功能"));
3230
}
3331
$token = $this->get("token");
34-
if(!$token)
35-
{
32+
if(!$token){
3633
$this->json(P_Lang("接口数据异常"));
3734
}
3835
$this->lib('token')->keyid($this->site['api_code']);
3936
$info = $this->lib('token')->decode($token);
40-
if(!$info)
41-
{
37+
if(!$info){
4238
$this->json(P_Lang('信息为空'));
4339
}
4440
$id = $info['id'];
45-
if(!$id)
46-
{
41+
if(!$id){
4742
$this->json(P_Lang('未指定数据调用中心ID'));
4843
}
4944
$param = $info['param'];
50-
if($param)
51-
{
52-
if(is_string($param))
53-
{
45+
if($param){
46+
if(is_string($param)){
5447
$pm = array();
5548
parse_str($param,$pm);
5649
$param = $pm;
5750
unset($pm);
5851
}
5952
}
6053
$list = $this->call->phpok($id,$param);
61-
if(!$list)
62-
{
54+
if(!$list){
6355
$this->json(P_Lang("没有获取到数据"));
6456
}
6557
$tpl = $this->get("tpl");
66-
if($tpl && $this->tpl->check_exists($tpl))
67-
{
58+
if($tpl && $this->tpl->check_exists($tpl)){
6859
$this->assign("rslist",$list);
6960
$info = $this->fetch($tpl);
7061
$this->json($info,true);

0 commit comments

Comments
 (0)