forked from assimon/dujiaoka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.php
547 lines (503 loc) · 23.5 KB
/
install.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
<?php
/**
* 云尚发卡安装程序
*
* 安装完成后建议删除此文件
* @author Ashang
* @website http://www.yunscx.com
*/
// 定义目录分隔符
define('DS', DIRECTORY_SEPARATOR);
// 定义根目录
define('ROOT_PATH', __DIR__ . DS);
// 定义应用目录
define('APP_PATH', ROOT_PATH . 'app' . DS);
// 安装包目录
define('INSTALL_PATH', ROOT_PATH . 'install' . DS );
// 判断文件或目录是否有写的权限
function is_really_writable($file)
{
if (DIRECTORY_SEPARATOR == '/' AND @ ini_get("safe_mode") == FALSE)
{
return is_writable($file);
}
if (!is_file($file) OR ( $fp = @fopen($file, "r+")) === FALSE)
{
return FALSE;
}
fclose($fp);
return TRUE;
}
$sitename = "云尚发卡系统";
$link = array(
'qqun' => "//shang.qq.com/wpa/qunwpa?idkey=1e49d2248419ff6332a24991a124148fde9e89aa531835ad51f8ad0e474d9974",
);
//错误信息
$errInfo = '';
//数据库配置文件
$dbConfigFile = APP_PATH . 'db.php';
// 锁定的文件
$lockFile = INSTALL_PATH . 'install.lock';
if (is_file($lockFile))
{
$errInfo = "当前已经安装{$sitename},如果需要重新安装,请手动移除/install/install.lock文件";
}
else if (version_compare(PHP_VERSION, '5.5.0', '<'))
{
$errInfo = "当前版本(" . PHP_VERSION . ")过低,请使用PHP5.5以上版本";
}
else if (!extension_loaded("PDO"))
{
$errInfo = "当前未开启PDO,无法进行安装";
}
else if (!is_really_writable($dbConfigFile))
{
$errInfo = "当前权限不足,无法写入配置文件/Config.php";
}
// 当前是POST请求
if (!$errInfo && isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST')
{
$err = '';
$mysqlHostname = isset($_POST['mysqlHost']) ? $_POST['mysqlHost'] : 'localhost';
$mysqlHostport = 3306;
$hostArr = explode(':', $mysqlHostname);
if (count($hostArr) > 1)
{
$mysqlHostname = $hostArr[0];
$mysqlHostport = $hostArr[1];
}
$mysqlUsername = isset($_POST['mysqlUsername']) ? $_POST['mysqlUsername'] : 'root';
$mysqlPassword = isset($_POST['mysqlPassword']) ? $_POST['mysqlPassword'] : '';
$mysqlDatabase = isset($_POST['mysqlDatabase']) ? $_POST['mysqlDatabase'] : 'ysfk';
$adminUsername = isset($_POST['adminUsername']) ? $_POST['adminUsername'] : 'admin';
$adminPassword = isset($_POST['adminPassword']) ? $_POST['adminPassword'] : '123456';
$adminPasswordConfirmation = isset($_POST['adminPasswordConfirmation']) ? $_POST['adminPasswordConfirmation'] : '123456';
$adminEmail = isset($_POST['adminEmail']) ? $_POST['adminEmail'] : '[email protected]';
if ($adminPassword !== $adminPasswordConfirmation)
{
echo "两次输入的密码不一致";
exit;
}
else if (!preg_match("/^\w+$/", $adminUsername))
{
echo "用户名只能输入字母、数字、下划线";
exit;
}
else if (!preg_match("/^[\S]+$/", $adminPassword))
{
echo "密码不能包含空格";
exit;
}
else if (strlen($adminUsername) < 3 || strlen($adminUsername) > 12)
{
echo "用户名请输入3~12位字符";
exit;
}
else if (strlen($adminPassword) < 6 || strlen($adminPassword) > 16)
{
echo "密码请输入6~16位字符";
exit;
}
try
{
//检测能否读取安装文件
$sql = @file_get_contents(INSTALL_PATH . 'ysfk.sql');
if (!$sql)
{
throw new Exception("无法读取/install/ysfk.sql文件,请检查是否有读权限");
}
$pdo = new PDO("mysql:host={$mysqlHostname};port={$mysqlHostport}", $mysqlUsername, $mysqlPassword, array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"
));
$pdo->query("CREATE DATABASE IF NOT EXISTS `{$mysqlDatabase}` CHARACTER SET utf8 COLLATE utf8_general_ci;");
$pdo->query("USE `{$mysqlDatabase}`");
$pdo->exec($sql);
$conphp = "<?php
return [
'server'=>'".$mysqlHostname."',
'port'=>'".$mysqlHostport."',
'user'=>'".$mysqlUsername."',
'pass'=>'".$mysqlPassword."',
'name'=>'".$mysqlDatabase."',
'prefix'=>'ys_',
'driver'=>'pdo',
'debug'=>true,
];";
//检测能否成功写入数据库配置
$result = @file_put_contents($dbConfigFile, $conphp);
if (!$result)
{
throw new Exception("无法写入数据库信息到db.php文件,请检查是否有写权限");
}
//检测能否成功写入lock文件
$result = @file_put_contents($lockFile, 1);
if (!$result)
{
throw new Exception("无法写入安装锁定到/install/install.lock文件,请检查是否有写权限");
}
$newPassword = sha1($adminPassword);
$pdo->query("UPDATE ys_admin SET adminname = '{$adminUsername}',adminpass = '{$newPassword}'WHERE id = 1");
echo "success";
}
catch (Exception $e)
{
$err = $e->getMessage();
}
catch (PDOException $e)
{
$err = $e->getMessage();
}
echo $err;
exit;
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>安装<?php echo $sitename; ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
<meta name="renderer" content="webkit">
<style>
body {
background: #fff;
margin: 0;
padding: 0;
line-height: 1.5;
}
body, input, button {
font-family: 'Open Sans', sans-serif;
font-size: 16px;
color: #7E96B3;
}
.container {
max-width: 515px;
margin: 0 auto;
padding: 20px;
text-align: center;
}
a {
color: #18bc9c;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
h1 {
margin-top:0;
margin-bottom: 10px;
}
h2 {
font-size: 28px;
font-weight: normal;
color: #3C5675;
margin-bottom: 0;
}
form {
margin-top: 40px;
}
.form-group {
margin-bottom: 20px;
}
.form-group .form-field:first-child input {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.form-group .form-field:last-child input {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
.form-field input {
background: #EDF2F7;
margin: 0 0 1px;
border: 2px solid transparent;
transition: background 0.2s, border-color 0.2s, color 0.2s;
width: 100%;
padding: 15px 15px 15px 180px;
box-sizing: border-box;
}
.form-field input:focus {
border-color: #18bc9c;
background: #fff;
color: #444;
outline: none;
}
.form-field label {
float: left;
width: 160px;
text-align: right;
margin-right: -160px;
position: relative;
margin-top: 18px;
font-size: 14px;
pointer-events: none;
opacity: 0.7;
}
button,.btn {
background: #3C5675;
color: #fff;
border: 0;
font-weight: bold;
border-radius: 4px;
cursor: pointer;
padding: 15px 30px;
-webkit-appearance: none;
}
button[disabled] {
opacity: 0.5;
}
#error,.error,#success,.success {
background: #D83E3E;
color: #fff;
padding: 15px 20px;
border-radius: 4px;
margin-bottom: 20px;
}
#success {
background:#3C5675;
}
#error a, .error a {
color:white;
text-decoration: underline;
}
</style>
</head>
<body>
<div class="container">
<h1>
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="200px" height="57px" viewBox="0 0 200 57" enable-background="new 0 0 200 57" xml:space="preserve"> <image id="image0" width="200" height="57" x="0" y="0"
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAA5CAYAAABzlmQiAAAABGdBTUEAALGPC/xhBQAAACBjSFJN
AAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAA
CXBIWXMAAA7DAAAOwwHHb6hkAAAfSklEQVR42u2deXxdVbX4v2ufczM3aZPcDG1o2iRlCJaikZoE
yiVJQwsi4hD0KSIqDxze04c8Hg8HCtYBUVARBcSnwkMGK/gTtNZOEIZOEAQqoYU2aUvbNGPn5Obe
e/b6/XFu2rQkaTpAgXe/n55Pc/bdZ+99zj1rr73W2ntfSJAgQYIECRIkSJAgQYIECRIkSJAgQYIE
CRIkSJAgwf855M0qt6ioKCXZ2lzxvGmWWDkqJ2BkolG2WdEtxnFfVjWr0j2v56X29l5Aj/fDSJDg
YI65gJTk5+cptsHA+QrTEPIF3CGyxhTt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WWFVdo8prjkO3CC/Fj+dU3esXLPjrxldffbW3rKzsL9ayUURfdhx50Vq2WWtuf/zxRX8r
KpqywBjaQV8MBJzXPM92gq5obW3d29zc3D9lypQ/eJ62iLBGVV7atm3rK3l5wVXhcPQfjiNhEdkN
+qAxcndLS0v/pEmTPGNkbWtr6ysAxcUlfZ5H88aNLR0AkyeXRI2R5S0tLT2jeQ9Gy7H8CbZAaX7w
eoRvAQq6QQ3fSBnb9chQ9sTJubmFUVf+C9UvIpKiylYsF7d0di4ryc0tU4ebRORDMtzaCtWNqlzX
0tH1MIf5OxeTC4IfN6r3IpIKeFboFmW7KKkIE4jvB2aRa1u3ddzKoGHbxNy0woCT/mUVnSnKiwGP
W9d0db02KM8BEz6HOB/83HWY85HyHbKXrKmpvQWk5PHHlwy1v9Zwdb3dGNW9vhWNOGYUFxenuH17
L8HwVZBTFVTQDYo8j9VtKuIJpIFOBipEJFvRPagsRZy5Ldu2NQ16KKY0f9wpinuGES3W+A/TiKVD
HWmWdG/5unU9R7qWQSYV5M5w4AqFSlEmIOIqeCgdIryAyG8uaet49MZhgoVzwNy4f9/btxWHEJAE
h8Gb8TPQUpaRkWvTky8T5EpESgd9pgN1qh9DecYx8r0+k/TMCBF78J0JA209nDlGI1JWVpacFA6n
99q+oBF3gqO2x/PM1kggsHvz5s3hY1XPW01NzaxTXdcGFi1a9MLxbss7nTfrd9IBKM7KGmvSAlON
tdNA8tQPTLUbazY4Sby4dnPH0W42nSBBggQJEiRIkCBBggQJEiRIkCBBggQJEiRIMBz/H193nnnZ
dYl/AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE4LTA0LTE2VDIxOjMxOjQ4KzA4OjAwxqyu7wAAACV0
RVh0ZGF0ZTptb2RpZnkAMjAxOC0wNC0xNlQyMTozMTo0OCswODowMLfxFlMAAAAASUVORK5CYII=" />
</svg>
</h1>
<h2><?php echo $sitename; ?></h2>
<div>
<p>若你在安装中遇到麻烦可点击 <a href="<?php echo $link['qqun']; ?>">QQ交流群</a></p>
<form method="post">
<?php if ($errInfo): ?>
<div class="error">
<?php echo $errInfo; ?>
</div>
<?php endif; ?>
<div id="error" style="display:none"></div>
<div id="success" style="display:none"></div>
<div class="form-group">
<div class="form-field">
<label>MySQL 数据库地址</label>
<input name="mysqlHost" value="127.0.0.1" required="">
</div>
<div class="form-field">
<label>MySQL 数据库名</label>
<input name="mysqlDatabase" value="yunsfaka" required="">
</div>
<div class="form-field">
<label>MySQL 用户名</label>
<input name="mysqlUsername" value="root" required="">
</div>
<div class="form-field">
<label>MySQL 密码</label>
<input type="password" name="mysqlPassword">
</div>
</div>
<div class="form-group">
<div class="form-field">
<label>管理者用户名</label>
<input name="adminUsername" value="admin" required="" />
</div>
<div class="form-field">
<label>管理者密码</label>
<input type="password" name="adminPassword" required="">
</div>
<div class="form-field">
<label>重复密码</label>
<input type="password" name="adminPasswordConfirmation" required="">
</div>
</div>
<div class="form-buttons">
<button type="submit" <?php echo $errInfo ? 'disabled' : '' ?>>点击安装</button>
</div>
</form>
<script src="https://cdn.bootcss.com/jquery/2.1.4/jquery.min.js"></script>
<script>
$(function () {
$('form :input:first').select();
$('form').on('submit', function (e) {
e.preventDefault();
var $button = $(this).find('button')
.text('安装中...')
.prop('disabled', true);
$.post('', $(this).serialize())
.done(function (ret) {
if (ret === 'success') {
$('#error').hide();
$("#success").text("安装成功!开始你的<?php echo $sitename; ?>之旅吧!").show();
$('<a class="btn" href="/">访问首页</a> <a class="btn" href="/ysmd" style="background:#18bc9c">访问后台</a>').insertAfter($button);
$button.remove();
} else {
$('#error').show().text(ret);
$button.prop('disabled', false).text('点击安装');
$("html,body").animate({
scrollTop: 0
}, 500);
}
})
.fail(function (data) {
$('#error').show().text('发生错误:\n\n' + data.responseText);
$button.prop('disabled', false).text('点击安装');
$("html,body").animate({
scrollTop: 0
}, 500);
});
return false;
});
});
</script>
</div>
</div>
</body>
</html>