Compare commits

...

1195 Commits
1.1 ... master

Author SHA1 Message Date
5bb162322c
Create CITATION.cff 2024-05-30 12:39:46 +09:00
90404f225a
Update README.md 2024-05-30 12:38:19 +09:00
cc589e846d Update KOREAN.MD 2024-05-30 12:35:35 +09:00
d265428c6c Update KOREAN.MD 2024-05-30 12:34:28 +09:00
e1f46ae830 Update KOREAN.MD 2024-05-30 12:33:09 +09:00
1feb411bd6 Update KOREAN.MD 2024-05-30 12:32:05 +09:00
4d4c0007ae
Delete fixindent.sh 2024-05-30 12:22:30 +09:00
58bd748595
Delete bootstrap.707.sh 2024-05-30 12:21:21 +09:00
53b5bb581c
Update bootstrap.sh 2024-05-30 12:21:08 +09:00
972dd24c2b
Update uri.php 2024-04-29 22:40:51 +09:00
9d97db2025
Update uri.php 2024-04-29 22:40:32 +09:00
09f48b47a1
Update FUNDING.yml 2024-04-29 22:26:08 +09:00
aa2bb12335
Update README.md 2024-04-29 22:22:32 +09:00
412607fd12
Update README.md 2024-04-29 22:16:02 +09:00
029067b632
Update SECURITY.md 2024-04-29 22:11:10 +09:00
fc44237b3e
Update README.md 2024-04-29 22:08:59 +09:00
1828e58b8a
Update README.md 2024-04-29 22:07:59 +09:00
a14a75265c
Update README.md 2024-04-29 22:07:45 +09:00
b9e7548f78
Update README.md 2023-08-08 14:43:51 +09:00
e147898521
Update webpagetool.php 2023-04-14 18:11:32 +09:00
d4e50a358b
Update KOREAN.MD 2023-04-14 18:08:24 +09:00
1a69e04d8c
Delete CDN_HOWTO.md 2023-04-14 18:07:12 +09:00
7ea72da491
Update KOREAN.MD 2023-04-14 18:07:02 +09:00
8b0f5408f6
Update KOREAN.MD 2023-04-14 18:05:32 +09:00
0b784ff93f
Update KOREAN.MD 2023-04-14 18:01:24 +09:00
fac10baaee
Delete VERSION.MD 2023-04-14 17:58:38 +09:00
a0a5b1335c
Update README.md 2023-04-14 17:55:44 +09:00
b977776afc
Update README.md 2023-04-14 17:53:14 +09:00
b456c997da
Update README.md 2023-04-12 16:02:15 +09:00
4b0e7aa33a
Update README.md 2023-04-12 15:52:36 +09:00
3dcccb72e1
Update README.md 2023-04-12 15:51:39 +09:00
e9cc30e5a4
Update README.md 2023-04-12 15:49:52 +09:00
7382caa63d
Update README.md 2023-04-12 15:45:27 +09:00
831650987c
Update README.md 2023-04-12 15:36:46 +09:00
2405477555
Update README.md 2023-02-27 20:02:05 +09:00
730ec0b5a1
Update README.md 2023-02-27 20:01:50 +09:00
4e89184f21
Update README.md 2023-02-27 20:01:24 +09:00
70d7478d1c
Update webpagetool.php 2022-12-19 10:30:31 +09:00
c327e6b0fa
Update SECURITY.md 2022-12-12 16:23:23 +09:00
350130acbe
Update SECURITY.md 2022-12-12 16:22:54 +09:00
920f271ee4
Update SECURITY.md 2022-12-12 16:21:34 +09:00
f0fcaaed24
Update SECURITY.md 2022-12-12 16:19:27 +09:00
536ba9e6b3
Update SECURITY.md 2022-12-12 16:17:45 +09:00
3cb8178a0d Add the email contact to report abuse 2022-11-25 23:15:20 +09:00
bf788db964
Update uri.php 2022-09-29 14:17:24 +09:00
53618152e6
Update networktool.php 2022-09-16 16:11:12 +09:00
058449948f
Update networktool.php 2022-09-16 16:03:00 +09:00
85ddf36fa8
Update networktool.php 2022-09-16 16:02:35 +09:00
161029471a
Update networktool.php 2022-09-16 16:02:16 +09:00
3d602957d3
Update hiddentool.php 2022-09-13 20:42:35 +09:00
8045256d37
Update SECURITY.md 2022-01-17 10:42:37 +09:00
e3044d09b3
Update uri.php 2021-10-27 16:11:21 +09:00
f2a4ec38f7
Update uri.php 2021-10-27 14:53:54 +09:00
4cd4980ccc
Update uri.php 2021-10-27 14:53:26 +09:00
da907aa4c1
Merge pull request #140 from gnh1201/patch-master-20210817
Fix #138 Routing failure
2021-08-17 14:50:31 +09:00
8a3c90d37c
Update uri.php 2021-08-17 14:48:35 +09:00
74363530ec
Update webpagetool.php 2021-05-27 14:50:04 +09:00
450abe5d92
Update hiddentool.php 2021-05-25 00:05:37 +09:00
226f152a46
Create hiddentool.php 2021-05-24 22:18:48 +09:00
959a2b6d90
Update coupang.api.php 2021-05-22 06:00:38 +09:00
1a5a22eb88
Update coupang.api.php 2021-05-22 06:00:14 +09:00
4fef129951
Update coupang.api.php 2021-05-22 05:46:20 +09:00
14cd9a5153
Update coupang.api.php 2021-05-22 05:46:03 +09:00
177ddeef58
Update coupang.api.php 2021-05-22 05:32:24 +09:00
a0e3d27388
Update coupang.api.php 2021-05-22 05:31:40 +09:00
8d8a27cf41
Update coupang.api.php 2021-05-22 05:31:12 +09:00
de0f4289ba
Update coupang.api.php 2021-05-22 05:30:39 +09:00
875d9b0af8
Update coupang.api.php 2021-05-22 05:29:55 +09:00
0c28b5b59f
Update coupang.api.php 2021-05-22 05:29:23 +09:00
caa26cd1ea
Create coupang.api.php 2021-05-22 05:28:08 +09:00
9174356265
Update security.php 2021-05-22 05:11:41 +09:00
ea7b0e82a5
Update l10n.ini.php 2021-04-04 04:42:49 +09:00
f2f843e540
Update README.md 2021-04-02 14:09:15 +09:00
781c964c4c
Update README.md 2021-04-02 14:08:30 +09:00
445e41a25f
Update README.md 2021-04-02 14:08:01 +09:00
3e65438e3d
Fix mistyping in database.php
Fix mistyping in database.php
2021-03-23 08:13:16 +09:00
372ae4ddcd
Update webpagetool.php 2021-02-01 16:58:16 +09:00
52ccbd7663
Update webpagetool.php 2021-02-01 16:55:23 +09:00
e675be840b
Update webpagetool.php 2021-02-01 16:51:16 +09:00
ea694b98a5
Update webpagetool.php 2021-02-01 16:48:41 +09:00
25fc749e27
Update uri.php 2020-12-26 03:14:02 +09:00
1da455529b
Update uri.php 2020-12-25 23:30:23 +09:00
587850b61c
Update SECURITY.md 2020-11-30 10:56:59 +09:00
2f680f0579
Update SECURITY.md 2020-11-30 10:56:46 +09:00
f7f2ca64d0
Rename storage/conf/l10n.ini.php to storage/config/l10n.ini.php 2020-10-14 15:08:03 +09:00
f0cf124dea
Update l10n.ini.php 2020-10-14 15:07:44 +09:00
17c59eba23
Create l10n.ini.php 2020-10-14 15:07:27 +09:00
ef3907c5ce
Update webpagetool.php 2020-07-16 15:10:39 +09:00
4be3e6b4fd
Update webpagetool.php 2020-07-16 15:10:23 +09:00
718a1cfa00
Update exectool.php 2020-07-10 17:19:38 +09:00
0896073b9b
Update exectool.php 2020-07-10 17:16:30 +09:00
1ee86700cd
Update exectool.php 2020-07-10 16:38:45 +09:00
b859a236a8
Update exectool.php 2020-07-10 16:37:58 +09:00
c266f2ea45
Update README.md 2020-07-09 19:47:08 +09:00
f0b0103007
Update README.md 2020-07-09 19:45:27 +09:00
a5f6484843
Update README.md 2020-07-09 19:37:33 +09:00
203739dd43
Update README.md 2020-07-09 19:36:50 +09:00
17a602fdd1
Update README.md 2020-07-09 19:35:37 +09:00
fd6d94e5a6
Update README.md 2020-07-09 18:24:39 +09:00
83d5419e8e
Update README.md 2020-07-09 18:21:56 +09:00
90d1057492
Update README.md 2020-07-09 18:19:41 +09:00
7fa3ef2a43
Update README.md 2020-07-09 18:18:07 +09:00
858d7d6353
Update README.md 2020-07-09 18:16:37 +09:00
c4e4d7b489
Update README.md 2020-07-09 18:12:54 +09:00
ceafd68894
Update README.md 2020-07-09 18:08:44 +09:00
189deae1cf
Update README.md 2020-07-01 17:36:54 +09:00
db66198dee
Update README.md 2020-07-01 17:36:21 +09:00
493d9f307a
Update README.md 2020-07-01 17:35:03 +09:00
69a8c3605c
Update README.md 2020-07-01 11:09:17 +09:00
1e376f52bb
Update README.md 2020-07-01 11:04:25 +09:00
6e0bc5481f
Update README.md 2020-07-01 11:02:35 +09:00
6ab48520ec
Update README.md 2020-07-01 11:01:25 +09:00
ad8ccfe9cb
Update README.md 2020-07-01 10:55:26 +09:00
d27ef05ea5
Update README.md 2020-07-01 10:51:53 +09:00
b36a87019a
Update storage.php 2020-06-21 17:19:53 +09:00
e490264725
Update logger.php 2020-06-21 17:16:39 +09:00
43972172ff
Update logger.php 2020-06-21 17:16:27 +09:00
ed06978230
Update storage.php 2020-06-21 17:07:46 +09:00
f35cdeb3a0
Update storage.php 2020-06-21 17:04:18 +09:00
4dc7b9f6ad
Update logger.ini.php 2020-06-21 16:57:09 +09:00
bf3ea2dbf4
Update logger.ini.php 2020-06-21 16:40:50 +09:00
3af1c8d5b8
Update logger.ini.php 2020-06-21 16:39:21 +09:00
6c24844935
Update storage.php 2020-06-16 16:50:17 +09:00
3621d23a37
Update storage.php 2020-06-16 16:46:48 +09:00
8905dde7fb
Update storage.php 2020-06-16 16:46:12 +09:00
36c0bf53f5
Update security.ini.php 2020-06-16 16:42:54 +09:00
746e82f5a5
Update security.ini.php 2020-06-16 16:42:15 +09:00
513f9a59f2
Update security.ini.php 2020-06-16 16:36:52 +09:00
54fe0e3356
Update storage.php 2020-06-16 10:13:16 +09:00
bee5ef35a5
Update storage.php 2020-06-16 10:11:52 +09:00
7ff7010c34
Update logger.php 2020-06-14 20:09:32 +09:00
67b6055196
Update index.php 2020-06-14 18:49:33 +09:00
b176d1efb4
Update index.php 2020-06-14 18:49:21 +09:00
cf24d39b9a
Update and rename log.ini.php to logger.ini.php 2020-06-14 18:48:17 +09:00
40cdd0ddb9
Update logger.php 2020-06-14 18:46:53 +09:00
e9395cca4d
Update logger.php 2020-06-14 18:45:36 +09:00
6669676bae
Update logger.php 2020-06-14 18:45:15 +09:00
2f2f2f3c1b
Update README.md 2020-06-03 14:56:33 +09:00
8cf28c910b
Update README.md 2020-06-03 14:55:40 +09:00
08a010599e
Update README.md 2020-06-03 14:54:58 +09:00
8248ad2840
Update README.md 2020-05-29 11:11:55 +09:00
0ee85db921
Update README.md 2020-05-29 11:11:20 +09:00
b8829df18a
Update webpagetool.php 2020-05-29 09:40:58 +09:00
f215034928
Update string.utils.php 2020-05-27 11:11:02 +09:00
1d226d54d1
Update SECURITY.md 2020-05-25 15:54:10 +09:00
abe5fb0d0e
Update SECURITY.md 2020-05-25 15:53:49 +09:00
64e7fd9765
Update SECURITY.md 2020-05-25 15:51:41 +09:00
3ecf6fa6bf
Update uri.php 2020-05-21 14:15:41 +09:00
fb1e4bf37a
Update uri.php 2020-05-21 14:15:05 +09:00
f9db90f031
Update uri.php 2020-05-21 14:09:43 +09:00
d62e0859e4
Update README.md 2020-05-21 11:45:14 +09:00
f307fd50bc
Update README.md 2020-05-21 11:40:43 +09:00
f6062d5c68
Update README.md 2020-05-21 11:40:09 +09:00
e524c1e199
Update README.md 2020-05-21 11:38:53 +09:00
ffba3b04cd
Update README.md 2020-05-21 11:38:06 +09:00
eca23ede6e
Update README.md 2020-05-21 11:33:44 +09:00
ed86e30fe2
Update README.md 2020-05-21 11:33:20 +09:00
72e9b51b8f
Update README.md 2020-05-21 11:31:58 +09:00
f6c459d134
Update storage.php 2020-05-04 23:54:06 +09:00
ed02dd066f
Update storage.php 2020-05-04 23:53:15 +09:00
d9802557a6
Update database.php 2020-04-29 15:01:04 +09:00
f2f1c4e458
Update database.php 2020-04-29 14:58:05 +09:00
410f3a6890
Update zabbix.api.php 2020-04-29 13:37:40 +09:00
b667703092
Update logger.php 2020-04-28 11:40:25 +09:00
4dacbbf332
Update cli.php 2020-04-20 21:28:04 +09:00
201d3a4710
Update zabbix.api.php 2020-04-20 21:26:49 +09:00
02f4051ef3
Update cli.php 2020-04-20 20:53:07 +09:00
4f9ddb5634
Update webpagetool.php 2020-04-20 20:21:07 +09:00
32832519a1
Update cli.php 2020-04-20 20:11:46 +09:00
290e26cb63
Update README.md 2020-04-20 17:31:40 +09:00
02955f0f43
Update SSL.class.php 2020-04-17 18:21:43 +09:00
c7ee370f4e
Update SSL.class.php 2020-04-17 18:08:11 +09:00
d4cce046eb
Update UUID.class.php 2020-04-17 18:06:28 +09:00
21a0fa9e1b
Update UUID.class.php 2020-04-17 18:06:16 +09:00
2823d81758
Update UUID.class.php 2020-04-17 18:03:25 +09:00
6c3484e67f
Update SSL.class.php 2020-04-17 17:55:46 +09:00
99d02b27b3
Update SSL.class.php 2020-04-17 17:54:47 +09:00
7cc52cd8e4
Create SSL.class.php 2020-04-17 17:50:16 +09:00
461f0f3e19
Update database.php 2020-04-16 16:20:53 +09:00
65135d36a3
Update database.php 2020-04-16 16:20:38 +09:00
2745ede24a
Update README.md 2020-04-13 12:00:01 +09:00
033a36c4bf
Update README.md 2020-04-13 11:58:19 +09:00
91ba9b4248
Update CDN_HOWTO.md 2020-04-12 22:22:38 +09:00
e881e4a002
Update CDN_HOWTO.md 2020-04-12 22:18:18 +09:00
f1c8e01b44
Update uri.php 2020-04-12 21:46:20 +09:00
61d8069b76
Update uri.php 2020-04-12 21:45:37 +09:00
512ee523d7
Update uri.ini.php 2020-04-12 21:40:10 +09:00
63316a7b8a
Update uri.php 2020-04-12 21:38:41 +09:00
aab22b89e1
Update uri.php 2020-04-12 21:38:13 +09:00
094e5d2bd3
Update CDN_HOWTO.md 2020-04-12 20:47:34 +09:00
66735e0c59
Update uri.ini.php 2020-04-12 20:47:07 +09:00
adbaa6a7d9
Update CDN_HOWTO.md 2020-04-12 19:58:35 +09:00
189922a500
Update CDN_HOWTO.md 2020-04-12 19:54:29 +09:00
2a610015d6
Update CDN_HOWTO.md 2020-04-12 19:52:00 +09:00
ff448fb1ad
Update CDN_HOWTO.md 2020-04-12 19:51:45 +09:00
7fb319ed75
Update CDN_HOWTO.md 2020-04-12 19:51:17 +09:00
b9f8b78cc4
Update CDN_HOWTO.md 2020-04-12 19:49:44 +09:00
6c54104977
Update CDN_HOWTO.md 2020-04-12 19:46:37 +09:00
75d4dfc18e
Update CDN_HOWTO.md 2020-04-12 19:33:14 +09:00
102b5643cf
Update CDN_HOWTO.md 2020-04-12 19:31:42 +09:00
dce66940fc
Update CDN_HOWTO.md 2020-04-12 19:31:14 +09:00
ea44b3fa47
Update and rename test.md to CDN_HOWTO.md 2020-04-12 19:29:42 +09:00
671b5b08e3
Create test.md 2020-04-12 19:29:16 +09:00
38805aaf65
Update uri.php 2020-04-12 18:43:31 +09:00
f802210bd4
Update uri.ini.php 2020-04-12 18:39:57 +09:00
1165ee3b67
Update view_welcome.php 2020-04-12 18:39:11 +09:00
57b4a9cef1
Update deprecated.ini.php 2020-04-12 18:37:39 +09:00
c586ee2001
Update database.php 2020-04-12 18:36:37 +09:00
c38ea4bb68
Update base.php 2020-04-12 18:34:52 +09:00
eb5cebf360
Update uri.php 2020-04-12 18:21:56 +09:00
0c56893b05
Update uri.php 2020-04-12 18:21:07 +09:00
f42785d9b2
Update uri.ini.php 2020-04-12 18:12:01 +09:00
56ecbddbda
Update uri.php 2020-04-12 18:11:33 +09:00
d74eed052d
Update uri.php 2020-04-12 18:08:45 +09:00
5894116a74
Update uri.ini.php 2020-04-12 17:57:01 +09:00
fca583c683
Update webpagetool.php 2020-04-08 14:33:49 +09:00
fcf23af78d
Update webpagetool.php 2020-04-08 14:28:43 +09:00
3ec8ab5db5
Update database.php 2020-04-08 13:50:31 +09:00
83a79e0693
Update database.php 2020-04-08 13:40:26 +09:00
5e4da8f2ca
Update webpagetool.php 2020-04-06 00:02:23 +09:00
32210df8a5
Update string.utils.php 2020-03-27 15:18:19 +09:00
beef878da9
Update webpagetool.php 2020-03-26 10:20:39 +09:00
bc4c34c1b4
Update database.php 2020-03-25 12:04:33 +09:00
309977c6cb
Update database.php 2020-03-25 11:55:46 +09:00
c97400d7ce
Update database.php 2020-03-25 11:48:49 +09:00
bd1b8bebac
Update config.php 2020-03-25 11:43:55 +09:00
89596fe643
Update config.php 2020-03-25 11:43:09 +09:00
f8f0603df9
Update database.php 2020-03-25 11:42:44 +09:00
f6265108b2
Update database.php 2020-03-25 11:42:28 +09:00
bb1c3a1b59
Update config.php 2020-03-25 11:41:37 +09:00
b40c1e518a
Update database.php 2020-03-25 11:21:47 +09:00
81b05fe550
Update database.php 2020-03-25 11:21:00 +09:00
80c0d01b81
Update database.php 2020-03-25 10:32:17 +09:00
8c93ea1629
Update database.php 2020-03-25 10:25:59 +09:00
7b6dde0460
Update zabbix.api.php 2020-03-06 11:32:07 +09:00
5ce876afb2
Update zabbix.api.php 2020-03-05 10:43:24 +09:00
a62297c82d
Update zabbix.api.php 2020-03-05 10:26:47 +09:00
41cf7bf2ff
Update zabbix.api.php 2020-03-03 11:29:05 +09:00
fcf186fe46
Update perftool.php 2020-03-02 10:11:12 +09:00
8cb6cf52d5
Update perftool.php 2020-03-02 10:10:00 +09:00
dbf6f31e98
Update colona.v1.format.php 2020-03-01 02:37:45 +09:00
71ae7f061c
Update storage.php 2020-02-28 17:29:27 +09:00
d1316a89bc
Update storage.php 2020-02-28 16:57:36 +09:00
cd3a446a54
Update base.php 2020-02-26 16:12:10 +09:00
a920baaa83
Update webpagetool.php 2020-02-25 18:36:26 +09:00
7c44bbb263
Update base.php 2020-02-25 16:07:44 +09:00
303118ad92
Update perftool.php 2020-02-25 14:15:12 +09:00
ed08db7c24
Update system.ini.php 2020-02-24 17:50:50 +09:00
cc2773c2d2
Update perftool.php 2020-02-24 17:50:05 +09:00
5d5ecbe8a9
Update perftool.php 2020-02-24 14:51:56 +09:00
d7f21964b5
Update perftool.php 2020-02-24 14:50:29 +09:00
ee80807b5e
Update migrate.1.5.php 2020-02-24 14:04:15 +09:00
6112a16718
Create migrate.1.5.php 2020-02-24 14:03:45 +09:00
bfa2fc4009
Update index.php 2020-02-24 12:29:31 +09:00
daa5299450
Update perftool.php 2020-02-24 12:29:09 +09:00
91d3a550fb
Update database.php 2020-02-22 19:16:38 +09:00
8a2a3def51
Update database.php 2020-02-21 18:10:45 +09:00
a604fa9a8c
Update base.php 2020-02-21 14:19:42 +09:00
b0a538459d
Update string.utils.php 2020-02-21 14:12:01 +09:00
a6976d1a56
Update base.php 2020-02-21 14:04:42 +09:00
adcfbd2e30
Update string.utils.php 2020-02-21 13:53:12 +09:00
6ccdb2d1b5
Update string.utils.php 2020-02-21 13:51:31 +09:00
d7031e7a21
Update string.utils.php 2020-02-21 13:50:30 +09:00
3a19961640
Update deprecated.ini.php 2020-02-21 13:41:47 +09:00
3e19711ae0
Update deprecated.ini.php 2020-02-21 13:33:54 +09:00
b3d8f9bc36
Rename deprecated.ini to deprecated.ini.php 2020-02-21 13:32:07 +09:00
42a7df1f5a
Create deprecated.ini 2020-02-21 13:31:55 +09:00
3853cbd9e2
Update base.php 2020-02-21 12:06:33 +09:00
cd18ee6701
Update database.php 2020-02-20 16:41:14 +09:00
73bf61ccb1
Update database.php 2020-02-20 16:40:46 +09:00
eaa8085914
Update database.php 2020-02-20 14:30:54 +09:00
b99c86075c
Update database.php 2020-02-20 14:30:25 +09:00
f6b3fd69c2
typo fixed colona.v1.format.php 2020-02-20 12:14:41 +09:00
0eea52779f
Update database.php 2020-02-20 11:46:02 +09:00
77c75931b8
Typo fix database.php 2020-02-20 11:11:37 +09:00
2f7b0e058e
Update system.ini.php 2020-02-19 16:00:28 +09:00
1f730f59e7
Update index.php 2020-02-19 15:59:22 +09:00
d3ab19a83b
Update perftool.php 2020-02-19 15:01:39 +09:00
11023c3cda
Update perftool.php 2020-02-19 14:57:35 +09:00
491116531f
Update perftool.php 2020-02-19 14:43:33 +09:00
afd3e5d566
Create perftool.php 2020-02-19 14:43:06 +09:00
44c025dc29
Update index.php 2020-02-18 15:40:49 +09:00
6b3d3ba169
Update webpagetool.php 2020-02-18 14:01:23 +09:00
ce9197822e
Update index.php 2020-02-18 13:25:46 +09:00
608a859573
Update index.php 2020-02-18 12:39:49 +09:00
abeeee18a6
Update index.php 2020-02-18 12:38:14 +09:00
1460b0021e
Update index.php 2020-02-18 12:37:03 +09:00
94e0aa6066
Update config.php 2020-02-18 12:31:02 +09:00
ce70a68884
Update config.php 2020-02-18 12:29:47 +09:00
06515408b2
Update index.php 2020-02-18 12:24:27 +09:00
016da48242
Update config.php 2020-02-18 12:23:13 +09:00
47e5d97de2
Update config.php 2020-02-18 12:22:23 +09:00
6f9d9185b0
Update database.php 2020-02-17 21:17:58 +09:00
b5033238f6
Update database.php 2020-02-17 21:05:05 +09:00
910674455f
Update database.php 2020-02-17 20:57:08 +09:00
f54750dfea
Update database.php 2020-02-17 20:55:59 +09:00
9233c87f1f
Update database.php 2020-02-17 20:13:48 +09:00
252b063a1d
Update composer.json 2020-02-17 19:09:21 +09:00
792e1db128
Update README.md 2020-02-17 18:56:12 +09:00
150d360876
Update README.md 2020-02-17 18:39:22 +09:00
3f98e44f9c
Update README.md 2020-02-17 18:37:42 +09:00
d1af92ab22 update readme 2020-02-17 12:36:34 +09:00
352a3ef234 update readme 2020-02-17 12:35:16 +09:00
efd11f28fb
Update webpagetool.php 2020-02-13 19:36:14 +09:00
dc56f6b737
Update webpagetool.php 2020-02-13 19:34:54 +09:00
ae0e6f85db
Update webpagetool.php 2020-02-13 17:38:40 +09:00
7eb03c4340
Update webpagetool.php 2020-02-13 15:40:56 +09:00
1dabd10883
Update webpagetool.php 2020-02-13 15:37:56 +09:00
03aaa13aca
Update webpagetool.php 2020-02-13 15:29:25 +09:00
6e950c506b
Update webpagetool.php 2020-02-13 14:25:52 +09:00
c2b9b431a0
Update database.php 2020-02-13 11:04:14 +09:00
a99d81acaf Update uri.php 2020-02-10 16:43:00 +09:00
1be46fb794 Update base.php 2020-02-10 15:24:25 +09:00
0e1af27684 big change: check_function_exists() -> is_fn() 2020-02-10 15:23:04 +09:00
17303a5909
Update base.php 2020-02-08 17:35:10 +09:00
41b454fa0e
Update base.php 2020-02-08 17:34:52 +09:00
e747bcc2d9 Update pgkcp.lnk.php 2020-02-08 17:33:53 +09:00
0b6b01b9ed
Update pgkcp.lnk.php 2020-02-08 17:31:41 +09:00
cc79e17b93
Update webpagetool.php 2020-02-07 17:15:22 +09:00
b6f75980d2
Update webpagetool.php 2020-02-07 16:01:10 +09:00
042e6f4226
Update webpagetool.php 2020-02-07 15:38:27 +09:00
7e836f5615
Update webpagetool.php 2020-02-07 15:24:12 +09:00
e014326bc1
Update database.php 2020-02-07 10:49:14 +09:00
5bbd7b86f9
Update README.md 2020-02-07 10:29:34 +09:00
fa15d9f286
Update README.md 2020-02-07 10:24:39 +09:00
c09c7118a0
Update README.md 2020-02-07 10:23:58 +09:00
61e1f2f64e
Update README.md 2020-02-07 10:23:32 +09:00
f951089db7
Update README.md 2020-02-07 10:23:10 +09:00
1471396934
Update README.md 2020-02-07 10:21:18 +09:00
82b3167779
Update system.ini.php 2020-02-06 13:37:13 +09:00
793c238d97
Update index.php 2020-02-06 13:36:22 +09:00
0b47ec6447
Update system.ini.php 2020-02-06 13:27:54 +09:00
279d449704
Update system.ini.php 2020-02-06 13:27:38 +09:00
aec3f0d675
Update database.php 2020-02-06 09:22:02 +09:00
29198b0d5a
Update index.php 2020-02-05 21:57:14 +09:00
8776048502
Update database.php 2020-02-05 21:56:42 +09:00
3bc800cbf5
Update index.php 2020-02-05 21:55:26 +09:00
be9843edd3
Update README.md 2020-02-05 15:21:24 +09:00
85f97b1c3a
Update README.md 2020-02-05 15:21:00 +09:00
2c49d4d527
Update README.md 2020-02-05 11:43:30 +09:00
a7e5250ac0
Update README.md 2020-02-05 11:43:12 +09:00
530fcc216b
Update database.php 2020-02-05 11:29:31 +09:00
61d88d74e7
Update database.php 2020-02-05 11:29:03 +09:00
8238963319
Update zabbix.api.php 2020-02-05 10:25:24 +09:00
e10cad84c4
Update database.php 2020-02-04 19:22:52 +09:00
d1b9d1303a
Update database.php 2020-02-04 19:21:45 +09:00
e1931d98ad
Update security.php 2020-02-04 19:18:05 +09:00
fbe181e23b
Update security.php 2020-02-04 19:14:51 +09:00
040d3f83b8
Update security.php 2020-02-04 19:14:14 +09:00
f056fbe0e1
Update security.php 2020-02-04 19:08:52 +09:00
cab2ea1004
Update security.php 2020-02-04 17:40:43 +09:00
ce7789b9e7
Update zabbix.api.php 2020-02-04 14:54:42 +09:00
1c0b8f302c
Update index.php 2020-01-29 20:46:18 +09:00
b503dd4ad8
Update index.php 2020-01-29 20:44:01 +09:00
39b2536a09
Update index.php 2020-01-29 20:43:38 +09:00
6c80d9e478
Update config.php 2020-01-29 20:43:14 +09:00
d91ae7cc04
Update index.php 2020-01-29 20:41:17 +09:00
4d51c91b22
Update README.md 2020-01-29 00:53:48 +09:00
c7b94a02f8
Update README.md 2020-01-29 00:50:58 +09:00
911395f8c7
Update README.md 2020-01-29 00:48:37 +09:00
7d405ad1d0
Update README.md 2020-01-29 00:44:49 +09:00
eff39f1243
Update README.md 2020-01-29 00:42:50 +09:00
5f89a419b1
Update README.md 2020-01-28 22:02:24 +09:00
2bfc07c58d
Update README.md 2020-01-28 21:55:37 +09:00
298ad1adf0
Update README.md 2020-01-28 21:47:01 +09:00
abe6d97c54
Update README.md 2020-01-28 21:44:38 +09:00
974ae06b27
Update README.md 2020-01-28 21:44:21 +09:00
5104877c14
Update README.md 2020-01-28 21:43:08 +09:00
c5d6a3eabe
Update README.md 2020-01-28 21:42:38 +09:00
d22d91057a
Update README.md 2020-01-28 21:42:14 +09:00
bbe082c014
Update README.md 2020-01-28 21:41:14 +09:00
4bc40c1280
Update README.md 2020-01-28 21:40:23 +09:00
ab361bbca6
Update README.md 2020-01-28 21:39:48 +09:00
a59d46b286
Update README.md 2020-01-28 21:31:17 +09:00
c9e04bc690
Update README.md 2020-01-28 21:26:26 +09:00
a9eba5ac83
Update README.md 2020-01-28 21:25:02 +09:00
45e5f3fd4b
Update README.md 2020-01-28 21:24:45 +09:00
551ca72065
Update README.md 2020-01-28 21:23:10 +09:00
168de14d6b
Update README.md 2020-01-28 21:21:32 +09:00
c11f7eae2a
Update README.md 2020-01-28 21:19:23 +09:00
c732eb299a
Update README.md 2020-01-28 21:11:46 +09:00
b0a8460fb7
Update README.md 2020-01-28 21:10:49 +09:00
8b8b15b885
Update README.md 2020-01-28 21:10:09 +09:00
1db2e57e23
Update README.md 2020-01-28 21:09:22 +09:00
06a254cfdd
Update README.md 2020-01-28 21:07:17 +09:00
e6fa1a7aef
Update README.md 2020-01-28 21:04:42 +09:00
52ec156577
Update README.md 2020-01-28 21:02:21 +09:00
5aa38adce7
Update database.php 2020-01-28 13:54:44 +09:00
dcebd777af
Update database.php 2020-01-28 13:53:10 +09:00
cee6509dfa
Update database.php 2020-01-28 13:49:37 +09:00
339d10e94c
Update database.php 2020-01-28 13:49:10 +09:00
03f28612a8 big changed: scope -> shared_var 2020-01-28 13:39:54 +09:00
e51f00f7bc big changed: scope -> shared_var 2020-01-28 13:36:56 +09:00
4eeff3100a
Update database.php 2020-01-28 11:13:34 +09:00
9463cc91e4
Update database.php 2020-01-28 11:08:53 +09:00
4e38e01c0e
Update database.php 2020-01-28 11:06:04 +09:00
dddccbc46d
Update database.php 2020-01-27 21:34:07 +09:00
f5e399cb50
Update database.php 2020-01-27 21:33:04 +09:00
e06d9ada34
Update zabbix.api.php 2020-01-27 20:26:38 +09:00
2a05f2dca9
Update zabbix.api.php 2020-01-27 19:47:03 +09:00
f6edabc3cc
Update zabbix.api.php 2020-01-27 17:51:03 +09:00
93e8922c4c
Update json.format.php 2020-01-27 17:04:12 +09:00
c8b0448d4b
Update database.php 2020-01-27 16:51:10 +09:00
8734ccea00
Update database.php 2020-01-27 16:39:52 +09:00
f852f7f68c
Update database.php 2020-01-27 14:51:03 +09:00
3b187f6cd4
Update database.php 2020-01-27 14:36:15 +09:00
f2c80e8e56
Update orderpay.step2.pgkcp.php 2020-01-25 03:20:06 +09:00
eb3b1e3606
Update orderpay.step3.pgkcp.php 2020-01-25 03:13:15 +09:00
e3aec9fbea
Update orderpay.pgkcp.php 2020-01-25 03:12:55 +09:00
364e3fcf65
Update orderpay.step2.pgkcp.php 2020-01-25 03:12:40 +09:00
6f4044fb72
Update orderpay.pgkcp.php 2020-01-25 03:12:07 +09:00
8a052b52b3
Update string.utils.php 2020-01-25 03:09:20 +09:00
5995640f1c
Update string.utils.php 2020-01-25 02:49:36 +09:00
cdf1d910a9
Update string.utils.php 2020-01-25 02:46:15 +09:00
9508d3f2b7
Update string.utils.php 2020-01-25 02:42:47 +09:00
c11f8d32ec
Update ordercomplete.pgkcp.php 2020-01-25 02:03:10 +09:00
575321ac10
Update ordercomplete.pgkcp.php 2020-01-25 02:02:20 +09:00
49c2d31ccb
Update view_orderpay.pgkcp.php 2020-01-25 01:41:08 +09:00
06497b6c99
Update view_orderpay.step3.pgkcp.php 2020-01-25 01:40:22 +09:00
f73293c138
Update view_orderpay.step2.pgkcp.php 2020-01-25 01:39:53 +09:00
a4a555bcef
Update view_orderpay.pgkcp.php 2020-01-25 01:39:27 +09:00
0fb945fcde
Update orderpay.pgkcp.php 2020-01-25 01:07:27 +09:00
6fce47d9b6
Update rfc3164.proto.php 2020-01-23 21:47:47 +09:00
ba31880a1f
Update logger.php 2020-01-23 21:44:27 +09:00
8c8edfe44e
Update logger.php 2020-01-23 21:43:58 +09:00
61d926bd68
Update rfc3164.proto.php 2020-01-23 21:31:00 +09:00
d23f5dd3e6
Update and rename logging.ini.php to log.ini.php 2020-01-23 21:27:15 +09:00
c299218795
Create logging.ini.php 2020-01-23 21:26:48 +09:00
5a1b0f09b8
Update rfc3164.proto.php 2020-01-23 21:23:11 +09:00
5eab10985e
Update rfc3164.proto.php 2020-01-23 21:22:51 +09:00
909ce7bf96
Update rfc3164.proto.php 2020-01-23 21:22:29 +09:00
599b97c6f3
Update rfc3164.proto.php 2020-01-23 21:21:41 +09:00
99284792a8
Create rfc3164.proto.php 2020-01-23 21:19:34 +09:00
bcb5483bc6
Update database.php 2020-01-22 00:37:11 +09:00
538f189285
Update database.php 2020-01-22 00:33:29 +09:00
f1161d2744
Update composer.json 2020-01-21 21:03:07 +09:00
1cd166b67b
Update README.md 2020-01-21 20:58:17 +09:00
cd1daacebf
Update README.md 2020-01-21 20:57:57 +09:00
8cd60d567f
Update composer.json 2020-01-21 20:56:40 +09:00
cfd1173178
Update composer.json 2020-01-21 20:56:05 +09:00
dff6b47d25
Update database.php 2020-01-19 14:50:14 +09:00
98ddfa2401
Update database.php 2020-01-19 13:35:16 +09:00
242274b1b6
Update uri.php 2020-01-19 11:02:11 +09:00
399b8e2638
Update system.ini.php 2020-01-17 13:11:55 +09:00
22e13fe753
Update index.php 2020-01-17 13:09:22 +09:00
c30158ab1c
Update database.php 2020-01-16 15:51:20 +09:00
04425ecd04
Update database.php 2020-01-16 15:32:36 +09:00
53954c3917
Update webpagetool.php 2020-01-16 14:13:37 +09:00
2c71f243e2
Update webpagetool.php 2020-01-16 14:13:10 +09:00
aaffec4006
Update database.php 2020-01-14 21:18:39 +09:00
07c362cb15
Update json.format.php 2020-01-14 11:30:15 +09:00
6713e2f654
Update json.format.php 2020-01-14 11:28:39 +09:00
fc9459f814
Update pgkcp.lnk.php 2020-01-13 14:34:19 +09:00
ad5b477cce
Update database.php 2020-01-10 19:36:22 +09:00
2c51652c8b
Update database.php 2020-01-10 19:32:43 +09:00
daca6e01fc
Update database.php 2020-01-10 11:34:04 +09:00
2b4c6eda84
Update database.php 2020-01-10 11:33:14 +09:00
7fd4143c71
Update database.php 2020-01-09 22:15:30 +09:00
e7590171f3
Update database.php 2020-01-09 22:09:01 +09:00
ce7cc612ac
Update database.php 2020-01-09 22:03:41 +09:00
f33bf7da19
Update database.php 2020-01-09 21:59:16 +09:00
36528fab7a
Update database.php 2020-01-09 21:57:41 +09:00
e4d3eafb49
Update database.php 2020-01-09 21:56:05 +09:00
47372684a1
Update database.php 2020-01-09 21:53:02 +09:00
78f54a5dc2
Update database.php 2020-01-09 21:45:36 +09:00
1ee91a710c
Update database.php 2020-01-09 21:34:25 +09:00
384ecc9ed4
Update database.php 2020-01-09 21:26:03 +09:00
2b9a3e7885
Update database.php 2020-01-09 21:17:02 +09:00
e2b9419499
Update database.php 2020-01-09 21:01:23 +09:00
156aa6ed6b
Update database.php 2020-01-09 20:37:35 +09:00
38ca5cfa61
Update database.php 2020-01-09 20:34:13 +09:00
c3840a10de
Update database.php 2020-01-09 20:23:27 +09:00
1584001aaf
Update database.php 2020-01-09 20:20:52 +09:00
af00d15975
Update database.ini.php 2020-01-09 20:15:03 +09:00
f986054aee
Update database.php 2020-01-09 20:14:16 +09:00
61757a9ffe
Update database.ini.php 2020-01-09 19:45:33 +09:00
6d094abaae
Update database.php 2020-01-09 19:45:01 +09:00
4b5e30dfc9
Update database.php 2020-01-09 19:39:52 +09:00
944b14662d
Update database.php 2020-01-09 19:34:34 +09:00
b70dd192c3
Update database.php 2020-01-09 18:19:15 +09:00
29987d84ce
Update database.php 2020-01-09 17:53:00 +09:00
92de2eb40e
Update database.php 2020-01-09 17:49:26 +09:00
815d9488ff
Update database.php 2020-01-09 17:48:37 +09:00
c446db7ebb
Update database.php 2020-01-09 17:27:50 +09:00
5cf9234791
Update database.php 2020-01-09 17:25:32 +09:00
065f528a1f
Update database.php 2020-01-09 17:22:58 +09:00
539cd7e521
Update database.php 2020-01-09 17:20:12 +09:00
8377fa6961
Update database.php 2020-01-09 17:15:09 +09:00
85927fec44
Update database.php 2020-01-09 13:29:24 +09:00
8675e50ba4
Update database.php 2020-01-09 13:25:15 +09:00
fb2f088402
Update database.php 2020-01-09 13:23:15 +09:00
9fb4ea7b13
Update database.php 2020-01-09 13:08:05 +09:00
a142488ccc
Update orderpay.step2.pgkcp.php 2020-01-09 02:38:45 +09:00
d4ff2f3ed9
Update database.php 2020-01-08 22:34:57 +09:00
1de809b3bc
Update database.php 2020-01-08 22:33:33 +09:00
a029d3baac
Update database.php 2020-01-08 22:06:14 +09:00
ed624a586f
Update database.php 2020-01-08 15:46:16 +09:00
1f6990a2fc
Update database.php 2020-01-02 14:35:16 +09:00
853d0996dd
Update database.php 2020-01-02 13:39:28 +09:00
140a20c13e
Update database.php 2020-01-02 00:27:36 +09:00
66eebcf21c
Update database.php 2020-01-01 17:12:57 +09:00
60227262ac
Update database.php 2019-12-31 17:08:11 +09:00
50cc0d6207
Update database.php 2019-12-31 17:03:45 +09:00
ca4a0d7a37
Update database.php 2019-12-31 17:01:05 +09:00
f0a2e731c0
Update database.php 2019-12-31 16:23:44 +09:00
1d703439f2
Update database.php 2019-12-31 16:23:09 +09:00
fe33636194
Update database.php 2019-12-31 16:05:28 +09:00
cb3d85d11a
Update database.php 2019-12-31 16:04:54 +09:00
b8dcb87e08
Update database.ini.php 2019-12-31 16:00:26 +09:00
953ecdfa53
Update database.php 2019-12-31 15:59:10 +09:00
961d5f5ec2
Update database.php 2019-12-31 15:57:36 +09:00
732ae3901a
Update database.php 2019-12-30 21:17:27 +09:00
ff5f097d77
Merge pull request #68 from gnh1201/auto-partitioning-1
Auto partitioning 1
2019-12-30 21:16:20 +09:00
7337955af3
Update database.php 2019-12-30 21:15:42 +09:00
349e2f19ae
Update database.php 2019-12-30 21:15:00 +09:00
bf91280b50
Update database.php 2019-12-30 18:07:16 +09:00
2e7a18f10f
Update config.php 2019-12-30 17:41:41 +09:00
cc8cf1b992
Update database.php 2019-12-30 17:16:54 +09:00
bb6fe3418d
Update database.php 2019-12-30 17:15:50 +09:00
7ff38c9d1a
Update database.php 2019-12-30 17:13:07 +09:00
7eddd7eccb
Update database.php 2019-12-30 16:56:25 +09:00
941a2eacfc
Update database.php 2019-12-30 16:43:11 +09:00
8b45ca2660
Update database.php 2019-12-30 16:41:23 +09:00
5ec1a640e8
Update database.php 2019-12-30 16:22:45 +09:00
9b27de8c45
Update json.format.php 2019-12-19 11:04:10 +09:00
2eae693cb1
Update logger.php 2019-12-05 19:41:58 +09:00
08ccf30f8e
Update config.php 2019-12-05 16:02:15 +09:00
65ba89198f
Update config.php 2019-12-05 15:59:52 +09:00
3790b69a3e
Update database.php 2019-12-05 15:49:04 +09:00
c58ad19dcc
Update orderform.widget.php 2019-11-22 23:34:17 +09:00
2db6118cbe
Update view_orderform.widget.php 2019-11-22 23:33:51 +09:00
05773071cb
Update orderpay.pgkcp.php 2019-11-22 23:11:20 +09:00
5d9f453a48
Update orderpay.pgkcp.1.js 2019-11-22 23:10:48 +09:00
5e63ef5cda
Update lguplus.ini.php 2019-11-17 22:52:16 +09:00
58cd93a93a
Update system.ini.php 2019-11-17 22:42:02 +09:00
b6ddcf38e7
Update database.php 2019-11-17 22:41:24 +09:00
a653aef496
Update database.php 2019-11-17 22:38:06 +09:00
5fcdfc0f03
Update config.php 2019-11-17 22:34:51 +09:00
8d2271109a
Update system.ini.php 2019-11-17 22:29:39 +09:00
f4f84f5f68
Update storage.php 2019-11-15 16:39:50 +09:00
08a409324d
Update index.php 2019-11-15 15:56:44 +09:00
a2b6bcdfa7
Update index.php 2019-11-15 15:55:16 +09:00
b3ae89c9fa
Update storage.php 2019-11-15 15:53:42 +09:00
406c4a958b
Update storage.php 2019-11-15 15:53:10 +09:00
33d72b07cb
Update index.php 2019-11-15 15:50:14 +09:00
f882241bce
Update storage.php 2019-11-15 15:48:59 +09:00
e8c798235c
Update system.ini.php 2019-11-15 15:46:10 +09:00
be6d49897c
Update index.php 2019-11-15 15:45:16 +09:00
eb4fbac464
Update system.ini.php 2019-11-15 15:22:18 +09:00
f6d3f9a4ab
Update system.ini.php 2019-11-15 15:13:55 +09:00
76cc72d459
Update README.md 2019-11-15 11:39:07 +09:00
c508af96b3
Update README.md 2019-11-15 11:37:53 +09:00
ec310c1749
Update README.md 2019-11-15 11:32:27 +09:00
a4f5634b52
Update storage.php 2019-11-15 11:20:27 +09:00
be72e12590
Update storage.php 2019-11-15 11:15:14 +09:00
9c8afadab5
Update index.php 2019-11-15 11:12:21 +09:00
7632204dc1
Update index.php 2019-11-15 11:10:19 +09:00
fb68c2e7e1
Update index.php 2019-11-15 11:09:43 +09:00
0c1c203427
Update storage.php 2019-11-15 11:07:29 +09:00
c1e0f92b91
Update index.php 2019-11-15 10:47:41 +09:00
d05d35c55e
Update index.php 2019-11-15 10:39:49 +09:00
e3b6ceccc9
Update storage.php 2019-11-14 15:03:26 +09:00
c7b17838c6
Update webpagetool.php 2019-11-14 14:57:16 +09:00
941e6569c5
Update storage.php 2019-11-14 14:56:13 +09:00
d49894dd4f
Update webpagetool.php 2019-11-14 14:05:49 +09:00
46c9d3d836
Update config.php 2019-11-14 13:52:57 +09:00
19aa62f289
Update webpagetool.php 2019-11-14 13:26:42 +09:00
03662ada43
Update webpagetool.php 2019-11-14 12:13:39 +09:00
3ae2693b99
Update system.ini.php 2019-11-14 12:00:00 +09:00
d373691a25
Update webpagetool.php 2019-11-13 17:29:19 +09:00
7b71a3cccb
Update zabbix.api.php 2019-11-13 17:22:33 +09:00
8abc0be61b
Update zabbix.api.php 2019-11-13 17:20:35 +09:00
50d08956ec
Update storage.php 2019-11-13 17:16:58 +09:00
0b6bb751c3
Update storage.php 2019-11-13 17:11:21 +09:00
c58c37f476
Update webpagetool.php 2019-11-13 17:09:16 +09:00
c73419b220
Update webpagetool.php 2019-11-13 17:07:32 +09:00
efaf4fc876
Update storage.php 2019-11-13 17:06:32 +09:00
2751260700
Update system.ini.php 2019-11-13 16:52:44 +09:00
ce9a66d60e
Update webpagetool.php 2019-11-13 16:48:04 +09:00
ef7dd30233
Update webpagetool.php 2019-11-13 16:44:10 +09:00
cc606cf278
Update zabbix.api.php 2019-11-12 16:41:50 +09:00
50d086de36
Update webpagetool.php 2019-11-12 16:36:07 +09:00
2731a3589f
Update webpagetool.php 2019-11-12 16:14:27 +09:00
7cdc02e817
Update webpagetool.php 2019-11-12 16:04:53 +09:00
105dceae08
Update webpagetool.php 2019-11-12 15:50:25 +09:00
73f56ccc7d
Update webpagetool.php 2019-11-12 15:49:58 +09:00
737afe81a3
Update webpagetool.php 2019-11-12 15:49:10 +09:00
b277db4493
Update zabbix.api.php 2019-11-12 15:10:09 +09:00
f407444918
Update database.php 2019-11-10 19:27:02 +09:00
ef90fa3045
Create thumbnail.youtube.php 2019-10-25 11:49:54 +09:00
1ebba738d8
Update twilio.api.php 2019-10-25 10:55:08 +09:00
5b1a82f4b6
Update webpagetool.php 2019-10-25 10:53:14 +09:00
54bde739e6
Update database.php 2019-10-21 11:05:30 +09:00
105073e0ec
Update database.php 2019-10-21 11:03:19 +09:00
36ce21f0b9
Update uri.php 2019-10-17 15:54:15 +09:00
8198038055
Update config.php 2019-10-16 22:29:33 +09:00
60ca514d5a
Update config.php 2019-10-16 22:26:35 +09:00
52e9012a14
Update database.php 2019-10-16 19:59:14 +09:00
b650be47fd
Update uri.php 2019-10-16 17:09:40 +09:00
fde620cecc
Update json.format.php 2019-10-15 20:45:32 +09:00
0d1925f168
Update string.utils.php 2019-10-15 19:38:58 +09:00
e9b0a21300
Update database.php 2019-10-15 19:30:29 +09:00
cdeaba3a6b
Update database.php 2019-10-15 19:25:31 +09:00
d89d57eddd
Update database.php 2019-10-15 17:37:21 +09:00
3fd7591968
Update database.php 2019-10-15 17:32:00 +09:00
d5318a298f
Update database.php 2019-10-15 17:31:29 +09:00
a02efcd1dc
Update security.php 2019-10-15 10:54:46 +09:00
0ecfe27a92
Update security.ini.php 2019-10-15 10:53:07 +09:00
986801889e
Update view_orderpay.pgkcp.php 2019-10-14 01:55:25 +09:00
bbcc751464
Update payman.js 2019-10-14 01:54:13 +09:00
0a8f5eec28
Update orderpay.pgkcp.1.js 2019-10-14 01:44:39 +09:00
a4e8152d4c
Update ordercomplete.pgkcp.php 2019-10-14 01:16:47 +09:00
b8af7b66e7
Update ordercomplete.pgkcp.php 2019-10-14 01:16:17 +09:00
d746bf15c6
Update orderpay.pgkcp.php 2019-10-14 00:43:14 +09:00
05dee1b4b9
Update lguplus.install.php 2019-10-13 22:44:28 +09:00
19164cf0cc
Update lguplus.api.php 2019-10-13 22:44:01 +09:00
ccdc8de9d3
Update and rename lguplus.autoinst.php to lguplus.install.php 2019-10-13 22:42:41 +09:00
f7e445991f
Update pgkcp.lnk.php 2019-10-13 22:41:55 +09:00
1eb0b17ae7
Update pgkcp.install.php 2019-10-13 22:41:30 +09:00
ab018b8a70
Create lguplus.autoinst.php 2019-10-13 22:40:52 +09:00
74188463c3
Create pgkcp.install.php 2019-10-13 22:36:02 +09:00
5a2deb4142
Update view_orderform.php 2019-10-13 22:32:31 +09:00
4d4518457d
Update security.php 2019-10-13 22:17:53 +09:00
d30e7b01ae
Update index.php 2019-10-13 22:17:27 +09:00
ec582bc69c
Update config.php 2019-10-13 22:05:06 +09:00
9b4341ae1e
Update index.php 2019-10-13 22:04:34 +09:00
bc328dd978
Create index.php 2019-10-13 22:01:16 +09:00
1e59f624f0
Update config.php 2019-10-13 21:08:18 +09:00
c0d3d872b1
Update uri.php 2019-10-13 21:07:39 +09:00
1ae319b6c1
Update database.php 2019-10-13 21:07:26 +09:00
a7140a1f0f
Update index.php 2019-10-13 21:07:07 +09:00
a855a7dc0e
Update index.php 2019-10-13 20:36:55 +09:00
f1ee9dfc54
Update config.php 2019-10-13 20:24:48 +09:00
2f4d02de1d
Update index.php 2019-10-13 20:24:23 +09:00
a0f8c5aa79
Update config.php 2019-10-13 20:01:15 +09:00
6fa780dbcc
Update config.php 2019-10-13 19:59:32 +09:00
7f8d897a0b
Update config.php 2019-10-13 19:57:48 +09:00
b83382ceee
Update pgkcp.lnk.php 2019-10-13 01:35:54 +09:00
e9a74c07d7
Update pgkcp.lnk.php 2019-10-13 01:29:31 +09:00
773c98b9a7
Create compress.zip.php 2019-10-13 01:20:49 +09:00
fb5a711b2e
Update pgkcp.lnk.php 2019-10-13 01:10:55 +09:00
c655bb450e
Update storage.php 2019-10-13 01:09:27 +09:00
629ef90722
Update storage.php 2019-10-13 01:08:13 +09:00
0ed4a5f425
Update storage.php 2019-10-13 01:07:13 +09:00
25e40067fb
Update pgkcp.lnk.php 2019-10-13 00:44:30 +09:00
bb09665916
Update pgkcp.lnk.php 2019-10-13 00:42:09 +09:00
d3e9af255b
Update pgkcp.lnk.php 2019-10-13 00:32:42 +09:00
9cd61c21a9
Update json.format.php 2019-10-13 00:29:07 +09:00
8fa2039379
Update json.format.php 2019-10-13 00:27:19 +09:00
29794f103c
Update webpagetool.php 2019-10-13 00:26:29 +09:00
60726530f3
Update database.php 2019-10-13 00:24:56 +09:00
997131e327
Update json.format.php 2019-10-13 00:22:53 +09:00
f1d50b8a51
Create json.format.php 2019-10-13 00:21:20 +09:00
bc5a359434
Update storage.php 2019-10-11 21:44:15 +09:00
584dcbfa0a
Update security.php 2019-10-11 17:07:51 +09:00
5dad30418f
Create index.php 2019-10-11 17:02:45 +09:00
95be079e1c
Update index.php 2019-10-11 17:02:23 +09:00
e7d34e597e
Update security.php 2019-10-11 17:00:44 +09:00
c885d9e08b
Update security.php 2019-10-11 17:00:14 +09:00
eadb4be415
Update database.php 2019-10-11 02:04:00 +09:00
f36b518758
Update config.php 2019-10-10 16:10:32 +09:00
6a6388fbd9
Update config.php 2019-10-08 15:21:30 +09:00
4ab4573230
Update lguplus.api.php 2019-10-08 14:53:40 +09:00
b94d647e98
Update lguplus.api.php 2019-10-08 14:32:04 +09:00
7c46532d7a add lguplus sms sdk 2019-10-08 10:24:00 +09:00
91a8fd0c72
Update lguplus.api.php 2019-10-08 10:19:22 +09:00
1d9e9553ae
Update lguplus.ini.php 2019-10-08 10:16:37 +09:00
dd9aba4e01
Update lguplus.ini.php 2019-10-08 10:15:39 +09:00
1e3ea67b2b
Create lguplus.ini.php 2019-10-07 19:12:00 +09:00
d0be44facc
Update api.twilio.php 2019-10-07 19:10:03 +09:00
fb62d9f165
Update api.twilio.php 2019-10-07 19:09:24 +09:00
658e2b6a5e
Update api.twilio.php 2019-10-07 19:01:45 +09:00
16b2bf2186
Update api.twilio.php 2019-10-07 19:01:11 +09:00
cb62eef752
Update api.twilio.php 2019-10-07 18:55:51 +09:00
2894386112
Create lguplus.api.php 2019-10-07 18:49:37 +09:00
7e1a709b17
Update orderpay.pgkcp.php 2019-10-06 03:05:58 +09:00
c58e382ad0
Update orderpay.step3.pgkcp.php 2019-10-06 03:04:41 +09:00
30bcee3e4a
Update orderpay.step2.pgkcp.php 2019-10-06 03:04:19 +09:00
c413b84ce7
Update webpagetool.php 2019-10-06 02:13:06 +09:00
cefbd93e1f
Update database.php 2019-10-04 13:00:38 +09:00
271d5a533c
Update database.php 2019-10-04 12:57:39 +09:00
b0e46845ab
Update database.php 2019-10-04 12:56:37 +09:00
a932e44eab
Update database.php 2019-10-04 10:28:43 +09:00
7a1c66eba5
Update database.php 2019-10-04 10:26:06 +09:00
b5767cfad8
Update database.php 2019-10-02 20:49:22 +09:00
e60f487117
Update database.php 2019-10-02 20:47:53 +09:00
099f65e210
Update database.php 2019-10-02 20:40:50 +09:00
332d073b11
Update database.php 2019-10-02 20:38:14 +09:00
bc59c3bad7
Update database.php 2019-10-02 20:33:54 +09:00
b2041e776a
Update database.php 2019-10-02 20:28:48 +09:00
fdbba15fbd
Update database.php 2019-10-01 18:30:50 +09:00
5a80fad2c7
Update string.utils.php 2019-09-30 16:40:47 +09:00
f63cfd3a4b
Update security.php 2019-09-30 15:14:16 +09:00
06010e34b3
Update database.php 2019-09-30 14:41:12 +09:00
b4b6a62ee7
Update database.php 2019-09-30 14:30:48 +09:00
e46b0195c2
Update database.php 2019-09-30 11:39:14 +09:00
1ed4722894
Update string.utils.php 2019-09-30 11:03:48 +09:00
31759a0ef8
Update string.utils.php 2019-09-30 11:01:48 +09:00
b3a30ef34d
Update database.php 2019-09-27 14:43:40 +09:00
efff663955
Update colona.v1.format.php 2019-09-26 17:19:54 +09:00
a2d25ee30d
Update colona.v1.format.php 2019-09-26 17:08:55 +09:00
f3f696aa5e
Update colona.v1.format.php 2019-09-26 17:07:15 +09:00
8eadbc8cb3
Update string.utils.php 2019-09-26 17:05:03 +09:00
cd1ae416f8
Update database.php 2019-09-25 17:05:36 +09:00
9cb1bd6638
Update database.php 2019-09-25 16:48:08 +09:00
96874a7cae
Update colona.v1.format.php 2019-09-25 15:47:54 +09:00
ecf6c9bca4
Update and rename colona.format.v1.php to colona.v1.format.php 2019-09-25 15:22:23 +09:00
f440a95d92
Update and rename parse.colona.php to colona.format.v1.php 2019-09-25 15:15:34 +09:00
0c1e2ee8f8
Create parse.colona.php 2019-09-25 15:13:57 +09:00
e7e0afd088
Update database.mysql.cmd.php 2019-09-16 13:40:00 +09:00
dc9673c6b4
Update database.mysql.cmd.php 2019-09-16 13:31:44 +09:00
09da36cf36
Update database.mysql.cmd.php 2019-09-16 13:28:35 +09:00
4512a7fdfc
Update database.mysql.cmd.php 2019-09-16 13:28:11 +09:00
1bfedfb09b
Update database.mysql.cmd.php 2019-09-16 13:17:12 +09:00
337a6fbf82
Update database.mysql.cmd.php 2019-09-16 11:40:48 +09:00
feb2a7d594
Update database.mysql.cmd.php 2019-09-16 10:51:09 +09:00
2ebf144992
Add files via upload 2019-09-11 13:35:04 +09:00
040f4cba23
Update 3rdparty.ini.php 2019-09-11 12:00:29 +09:00
ebddf89ae3
Update twilio.api.php 2019-09-11 11:59:53 +09:00
51b17a3059
Update string.utils.php 2019-09-11 11:58:56 +09:00
9c0e6d28e6
Update string.utils.php 2019-09-11 11:40:01 +09:00
2aadb4cf0e
Update string.utils.php 2019-09-11 11:38:34 +09:00
588301c29f
Update 3rdparty.ini.php 2019-09-09 16:23:43 +09:00
ffb635d499
Update twilio.api.php 2019-09-09 16:21:57 +09:00
ba21f4e5cf
Update catsplit.format.php 2019-07-16 16:16:05 +09:00
96eef131e1
Delete colortool.php 2019-07-16 16:14:25 +09:00
9a52bd5071
Delete archivetool.php 2019-07-16 16:13:42 +09:00
9faebbc970
Delete pChart2.lnk.php 2019-07-16 16:13:35 +09:00
7275126cea
Update index.php 2019-07-16 16:11:25 +09:00
e79e80646c
Delete securitytool.lnk.php 2019-07-16 16:10:55 +09:00
5d28ffbddc
Update SECURITY.md 2019-07-16 16:10:08 +09:00
3e64be4198
Update SECURITY.md 2019-07-16 16:04:25 +09:00
72ef267f2e
Update SECURITY.md 2019-07-16 16:02:48 +09:00
6736697bcd
Update SECURITY.md 2019-07-16 16:02:09 +09:00
f5d311fc36
Update SECURITY.md 2019-07-16 15:56:02 +09:00
813df6af57
Update SECURITY.md 2019-07-16 15:48:19 +09:00
fc901df6b7
Update security.php 2019-07-16 15:41:15 +09:00
f9f5587cfa
Update index.php 2019-07-16 15:40:57 +09:00
7d86475948
Update index.php 2019-07-16 15:33:43 +09:00
2af7d7d745
Update index.php 2019-07-16 15:31:43 +09:00
45c3413d7b
Create colortool.php 2019-07-14 19:48:09 +09:00
8ba364bd4d
Update database.php 2019-07-14 16:37:07 +09:00
e51e06a9b4
Update database.php 2019-07-14 16:36:08 +09:00
0ea368e92e
Update database.php 2019-07-14 14:54:41 +09:00
9ae6ab79e9
Update database.php 2019-07-14 14:12:32 +09:00
ef49d3e940
Update database.php 2019-07-14 14:11:19 +09:00
f0d7b5af80
Update database.php 2019-07-14 14:04:49 +09:00
57f0937590
Update database.php 2019-07-14 14:00:53 +09:00
4ee2a1128d
Update database.php 2019-07-14 13:34:58 +09:00
5c3a5c8608
Update security.php 2019-06-19 13:01:08 +09:00
ab9e0ad798
Update database.php 2019-06-18 17:33:51 +09:00
6d5e8beada
Update database.php 2019-06-18 17:01:46 +09:00
0bc123b387
Update database.php 2019-06-18 16:48:51 +09:00
2b78e5cb38
Update database.php 2019-06-18 16:20:14 +09:00
1925a391b8
Update database.php 2019-06-18 16:17:30 +09:00
923eb1e3cc fix 2019-06-17 17:22:33 +09:00
fd9a18aa02 Merge branch 'master' of https://github.com/gnh1201/reasonableframework 2019-06-17 17:21:37 +09:00
cfc9e185d6 test 2019-06-17 17:21:18 +09:00
2d820429c9
Update cli.php 2019-06-17 16:42:38 +09:00
66c025d767
Update SECURITY.md 2019-06-17 15:44:30 +09:00
2e1d5fed16
Update index.php 2019-06-17 15:42:48 +09:00
f9ffa3b60d add interface for security vendors 2019-06-17 15:30:05 +09:00
4e21f29e83
Update security.php 2019-06-17 15:24:38 +09:00
e96b77617d
Update index.php 2019-06-17 15:21:55 +09:00
548d5f643e
Update storage.php 2019-06-15 17:34:14 +09:00
c7b89a5ace
Update spreadsheet-reader.lnk.php 2019-06-15 15:31:52 +09:00
36d7628865
Update string.utils.php 2019-06-13 11:53:48 +09:00
2cea5d54fa
Update database.php 2019-06-12 21:16:16 +09:00
230600c87d
Update database.php 2019-06-12 21:06:52 +09:00
c150666394
Update database.php 2019-06-12 21:05:57 +09:00
75e3402971 add purecss 2019-06-12 20:43:58 +09:00
df9030cded
Update base.php 2019-06-12 20:39:33 +09:00
d6b3b63264
Update base.php 2019-06-12 20:39:09 +09:00
190de76e2e
Update uri.php 2019-06-12 20:35:00 +09:00
6407555750
Update README.md 2019-06-11 11:49:14 +09:00
92f25e09dd
Update README.md 2019-06-11 09:17:11 +09:00
d69e416f0e
Update README.md 2019-06-11 09:14:36 +09:00
0c516f1dff
Update SECURITY.md 2019-06-09 20:30:29 +09:00
b355e43cb6 fix 2019-06-09 20:24:50 +09:00
284dd0b3c5
Update uri.php 2019-06-06 22:35:15 +09:00
378f4e29f3
Update uri.php 2019-06-06 22:34:25 +09:00
fa2a1743d6
Update uri.php 2019-06-06 22:33:52 +09:00
f84f194709
Update catsplit.format.php 2019-06-06 12:57:40 +09:00
61876c7566
Update catsplit.format.php 2019-06-06 12:14:34 +09:00
1134d3f7a4
Update webpagetool.php 2019-06-05 13:01:10 +09:00
3d94dd8296
Update security.php 2019-06-05 12:57:41 +09:00
ffed154e4c
Update SECURITY.md 2019-06-05 12:50:25 +09:00
3f8645b78d
Update SECURITY.md 2019-06-05 12:47:04 +09:00
3389c937cf
Update README.md 2019-06-05 12:45:42 +09:00
7889e7bc00
Update README.md 2019-06-04 21:18:17 +09:00
d9aa5e8ae0
Update README.md 2019-06-04 21:15:08 +09:00
d9de95451f
Update SECURITY.md 2019-06-04 21:06:50 +09:00
7a8719ea6f
Update SECURITY.md 2019-06-04 21:02:58 +09:00
2e99c53a76
Create SECURITY.md 2019-06-04 21:02:34 +09:00
07e75bdfd9
Update README.md 2019-06-04 20:12:55 +09:00
4095dadd6a
Update README.md 2019-06-04 20:06:08 +09:00
a220b4e541
Update security.php 2019-06-04 19:00:59 +09:00
6d485d9ee4
Update index.php 2019-06-04 19:00:43 +09:00
955b36f659
Update and rename php-sec-psc.lnk.php to php-sec-scc.lnk.php 2019-06-04 18:56:18 +09:00
d4c78899d8
Update security.php 2019-06-04 18:56:00 +09:00
0f8f7473bb
Update and rename php-shelldetect.php to php-sec-shell.lnk.php 2019-06-04 18:54:00 +09:00
f4ad3a9ac8
Update and rename php-secure-config-check.php to php-sec-psc.lnk.php 2019-06-04 18:53:33 +09:00
f6ab7eb6bf
Update and rename php-firewall.lnk.php to php-sec-fw.lnk.php 2019-06-04 18:53:06 +09:00
a94e79b73e
Update and rename php-ddos-shield.lnk.php to php-sec-ddos.lnk.php 2019-06-04 18:52:37 +09:00
536fddd3e0
Update security.php 2019-06-04 18:51:58 +09:00
288f2c72d6
Update and rename php-webshell-detect.php to php-shelldetect.php 2019-06-04 18:48:55 +09:00
3e2c6d2fec
Update README.md 2019-06-04 18:46:04 +09:00
0fbfe80580
Update README.md 2019-06-04 18:45:11 +09:00
6772ae887a
Update security.php 2019-06-04 17:27:16 +09:00
7c64dcb9fd
Update index.php 2019-06-04 17:26:17 +09:00
9cde4d1bd5
Update index.php 2019-06-04 17:25:53 +09:00
380a21985d
Create php-secure-config-check.php 2019-06-04 17:23:42 +09:00
4d640a77f7
Create php-webshell-detect.php 2019-06-04 17:23:10 +09:00
ca9895ea75
Update index.php 2019-06-04 17:20:30 +09:00
632964211c
Update security.php 2019-06-04 17:16:58 +09:00
3857dc0a6c
Update security.php 2019-06-04 17:16:21 +09:00
174b32991d
Update index.php 2019-06-04 17:14:34 +09:00
5e808fe1bc
Update index.php 2019-06-04 17:12:52 +09:00
1ea5036324
Update index.php 2019-06-04 17:04:42 +09:00
39a71862b6
Update README.md 2019-06-04 16:13:07 +09:00
2915c9177d
Update README.md 2019-06-04 16:12:51 +09:00
691a716483
Update index.php 2019-06-04 15:44:38 +09:00
6ab6e8b331
Update index.php 2019-06-04 15:43:37 +09:00
c63f43661f
Update php-firewall.lnk.php 2019-06-04 15:43:02 +09:00
3f4467ca31
Update php-ddos-shield.lnk.php 2019-06-04 15:42:47 +09:00
1632599a36
Create php-ddos-shield.lnk.php 2019-06-04 15:42:16 +09:00
53226a3013
Create php-firewall.lnk.php 2019-06-04 15:41:30 +09:00
dfba529646
Update index.php 2019-06-04 15:36:29 +09:00
6602d2f52a
Update index.php 2019-06-04 15:36:02 +09:00
8b99d3d803
Update index.php 2019-06-04 15:35:34 +09:00
33b9d96802
Update storage.php 2019-06-02 04:30:52 +09:00
1c40f1ad46
Update catsplit.format.php 2019-06-01 19:51:47 +09:00
92987bf4bc
Update catsplit.format.php 2019-06-01 19:51:34 +09:00
5ccabbc147
Update base.php 2019-06-01 19:32:01 +09:00
25f679f062
Update catsplit.format.php 2019-06-01 14:35:34 +09:00
a26e285980
Update logger.php 2019-05-27 17:16:04 +09:00
bf1e509c45
Update and rename rsf.format.php to catsplit.format.php 2019-05-27 17:15:28 +09:00
97ba5ba1b9
Update logger.php 2019-05-27 16:35:15 +09:00
0dae261a6d
Update webhooktool.php 2019-05-26 03:12:08 +09:00
2616e81714
Update webhooktool.php 2019-05-26 03:11:35 +09:00
ad840ce526
Update logger.php 2019-05-26 02:51:13 +09:00
459838c4e8
Update logger.php 2019-05-26 02:43:28 +09:00
bededbbdb1
Update storage.php 2019-05-26 02:41:08 +09:00
8c54ba8eeb
Update storage.php 2019-05-26 02:37:39 +09:00
50739c3d26
Update logger.php 2019-05-26 02:33:30 +09:00
87088b7d5e
Update rsf.format.php 2019-05-26 02:24:10 +09:00
ecf355abb7
Update rsf.format.php 2019-05-26 02:20:29 +09:00
871203fdbd
Update rsf.format.php 2019-05-26 02:16:24 +09:00
ca1e9e18cb
Update rsf.format.php 2019-05-26 02:04:29 +09:00
686ce773f4
Create rsf.format.php 2019-05-26 02:02:45 +09:00
ecfbebb645
Update api.whois.kr.php 2019-05-26 00:45:36 +09:00
bbbc208893
Update api.whois.kr.php 2019-05-26 00:44:47 +09:00
14644f9962
Create api.whois.kr.php 2019-05-26 00:43:58 +09:00
fcc1e1c4a0
Update webpagetool.php 2019-05-25 23:44:06 +09:00
10f5136871
Update webpagetool.php 2019-05-25 23:27:39 +09:00
7cddb46720
Update webpagetool.php 2019-05-25 23:26:49 +09:00
6d34d7a164
Update webproxy.php 2019-05-25 20:40:02 +09:00
76a19fbc3e
Update logger.php 2019-05-25 20:39:13 +09:00
a76ddc8a09
Update webhooktool.php 2019-05-25 20:37:22 +09:00
793b846a43
Update webhooktool.php 2019-05-25 20:37:03 +09:00
bcec63fb8e
Update logger.php 2019-05-25 20:33:07 +09:00
4819a19eac
Update webhooktool.php 2019-05-25 20:29:52 +09:00
c85de7f257
Update webhooktool.php 2019-05-25 16:18:25 +09:00
2559c9097a
Update index.php 2019-05-24 16:34:04 +09:00
f80331e289
Update database.php 2019-05-24 16:28:09 +09:00
5e381377cc
Update database.php 2019-05-24 11:32:14 +09:00
8d844f8496
Update and rename .github/FUNDING.yml to FUNDING.yml 2019-05-24 10:45:59 +09:00
2445f8662a
Update index.php 2019-05-24 01:58:50 +09:00
671aa580ba
Update database.php 2019-05-24 00:42:22 +09:00
44575179eb
Update database.php 2019-05-24 00:39:49 +09:00
fcc97f0ac8
Update index.php 2019-05-24 00:35:54 +09:00
641c1a8c32
Update index.php 2019-05-24 00:22:03 +09:00
de87e84775
Update index.php 2019-05-24 00:18:34 +09:00
eb83665028
Update base.php 2019-05-23 16:38:26 +09:00
b2722ec8fd
Update webproxy.php 2019-05-22 10:33:28 +09:00
6171db84cb fix 2019-05-20 18:51:31 +09:00
91aa1af46b fix 2019-05-20 18:06:08 +09:00
6998361a48 fix 2019-05-20 18:04:44 +09:00
7f58103713 fix 2019-05-20 18:03:31 +09:00
cbbc76fad2 fix 2019-05-20 17:20:36 +09:00
ceca4bda79 fix vendor, indentation 2019-05-20 17:19:05 +09:00
be8ecf2d5e
Update database.php 2019-05-20 15:27:30 +09:00
82e0f704aa
Update database.php 2019-05-20 13:46:52 +09:00
2493cfee10
Update uri.php 2019-05-13 19:13:47 +09:00
c5b499718a
Update security.php 2019-05-13 18:58:51 +09:00
c471e1bef2
Update storage.php 2019-05-13 18:09:13 +09:00
0561ce9f33
Update storage.php 2019-05-13 18:08:36 +09:00
e7accfa96a
Update config.php 2019-05-13 18:03:03 +09:00
61049a17e1
Update security.ini.php 2019-05-11 15:31:46 +09:00
d6ef1aede2
Update security.php 2019-05-11 15:30:17 +09:00
02ddd9bc1e
Update security.php 2019-05-11 15:27:08 +09:00
d0f4dca65f
Update security.php 2019-05-11 15:24:56 +09:00
bd0055740a
Update security.php 2019-05-11 15:22:30 +09:00
c2c421c14e
Update database.alt.php 2019-05-11 15:20:46 +09:00
65cc6952a5
Create database.mssql.pdo.php 2019-05-11 15:20:08 +09:00
9419429423
Update database.alt.php 2019-05-11 13:09:13 +09:00
9f4bf105ae
Update security.php 2019-05-09 09:40:24 +09:00
f3ce63c3f5
Update security.php 2019-05-09 09:40:11 +09:00
fc3794ce91
Update security.php 2019-05-09 09:38:39 +09:00
3c57983fcd
Update storage.php 2019-05-09 09:36:01 +09:00
89ae1eaf41
Update security.php 2019-05-09 09:30:26 +09:00
676da49d98
Update README.md 2019-05-09 09:22:02 +09:00
57b2ba5975
Update README.md 2019-05-09 09:21:04 +09:00
4239ee918e
Update README.md 2019-05-09 09:09:38 +09:00
53efc63100
Update README.md 2019-05-09 09:09:05 +09:00
1b97225cd1
Update database.php 2019-05-04 19:30:59 +09:00
c96e33350e
Update webhooktool.php 2019-05-04 16:06:32 +09:00
8aafb8de01
Update webhooktool.php 2019-05-04 16:03:27 +09:00
d96d349d89
Update webhooktool.php 2019-05-04 16:00:29 +09:00
85a6808efc
Update webhooktool.php 2019-05-04 15:57:48 +09:00
89ac75a60f
Create webhooktool.php 2019-05-04 15:53:21 +09:00
968f7db690
Update string.utils.php 2019-05-04 15:22:13 +09:00
871644854c
Update database.php 2019-05-03 20:28:51 +09:00
ca32f7c101
Update database.php 2019-05-03 20:19:43 +09:00
0ab27c35bc
Update database.php 2019-05-03 20:04:04 +09:00
81e66754f4
Update string.utils.php 2019-05-03 19:48:34 +09:00
1b1bdbb150
Update database.php 2019-05-03 19:44:07 +09:00
26e88b4858
Update database.php 2019-05-03 17:49:40 +09:00
04b9f61451
Update string.utils.php 2019-05-03 14:43:26 +09:00
3819217e72
Update string.utils.php 2019-05-03 14:41:04 +09:00
e187c7dbe1
Update index.php 2019-05-03 13:33:40 +09:00
a7e6c9677e
Update mobileswitcher.php 2019-05-03 09:08:17 +09:00
04c102d36f
Update database.php 2019-05-02 09:50:09 +09:00
a1fa930972
Update view_mobileswitcher.php 2019-04-29 04:51:42 +09:00
8e9672d635
Update mobileswitcher.php 2019-04-29 04:50:57 +09:00
531343afc4
Update mobileswitcher.php 2019-04-29 04:28:47 +09:00
5c9d505728
Update mobileswitcher.php 2019-04-29 03:43:13 +09:00
4626549730
Update mobiletool.php 2019-04-29 02:48:52 +09:00
ef0fb08157
Create view_mobileswitcher.php 2019-04-29 02:48:09 +09:00
75963a89e7
Create mobileswitcher.php 2019-04-29 02:47:15 +09:00
53ac08b647
Update mobiletool.php 2019-04-29 01:21:58 +09:00
beff73d2de
Update mobiletool.php 2019-04-29 00:28:51 +09:00
710f71a73e
Create mobiletool.php 2019-04-29 00:28:21 +09:00
80f9d7b5d3
Update database.php 2019-04-29 00:01:04 +09:00
376409bca5
Update base.php 2019-04-28 23:58:14 +09:00
eb2a8263d7
Update database.php 2019-04-28 23:46:40 +09:00
bc96b08755
Update base.php 2019-04-28 14:06:07 +09:00
d0c9c5d38f
Update database.php 2019-04-28 14:05:16 +09:00
b624bbd80a
Update README.md 2019-04-26 10:52:32 +09:00
6036344873
Update security.php 2019-04-24 20:45:08 +09:00
7b705f80c5
Update database.mysql.cmd.php 2019-04-24 20:33:43 +09:00
fd3c19cfda
Update webpagetool.php 2019-04-24 20:26:26 +09:00
ca116cb935
Update uri.php 2019-04-22 13:23:46 +09:00
895e547acd Update api.twilio.php 2019-04-16 08:09:43 +00:00
c922ef2b80 fix 2019-04-16 07:16:11 +00:00
cab583fd1c
Update and rename api.newuuid.php to api.uuid.php 2019-04-16 09:57:40 +09:00
2e73954e1b
Update zabbix.api.php 2019-04-16 09:53:40 +09:00
28877bbdbe
Update 3rdparty.ini.php 2019-04-15 16:22:36 +09:00
3438a0d16e
Update api.mailgun.php 2019-04-15 16:21:35 +09:00
2769bab7aa
Create api.mailgun.php 2019-04-15 16:20:01 +09:00
e7e773ec54
Update mailgun.api.php 2019-04-15 16:08:13 +09:00
456e304ebc
Update twilio.api.php 2019-04-15 16:05:25 +09:00
6bfa4e9c63
Update api.zabbix.php 2019-04-15 16:02:59 +09:00
3b920ba0e5
Update zabbix.api.php 2019-04-15 16:02:33 +09:00
bbdbe6464d
Update 3rdparty.ini.php 2019-04-15 15:59:23 +09:00
fe4adb7b0c
Update 3rdparty.ini.php 2019-04-15 15:55:59 +09:00
dfa190a9df
Update mailgun.api.php 2019-04-15 15:55:05 +09:00
08d6246fba
Create bootstrap.707.sh 2019-04-15 15:38:36 +09:00
2a1f67b8e9
Update 3rdparty.ini.php 2019-04-15 15:33:39 +09:00
b8b9ff9e95
Update webpagetool.php 2019-04-15 15:27:50 +09:00
cd47174b30
Update webpagetool.php 2019-04-15 15:26:51 +09:00
5b596ef21a
Update api.twilio.php 2019-04-15 15:20:15 +09:00
27693cca9e
Update and rename api.twilo.php to api.twilio.php 2019-04-15 15:19:57 +09:00
3a5138a3f2
Update twilio.api.php 2019-04-15 15:18:52 +09:00
8160577d6e
Update api.zabbix.php 2019-04-15 15:16:20 +09:00
6387d685e7
Update api.zabbix.php 2019-04-15 15:16:07 +09:00
8bb946ace2
Update zabbix.api.php 2019-04-15 15:15:01 +09:00
58e53462e0
Update database.php 2019-04-15 15:08:35 +09:00
076035da0f
Update twilio.api.php 2019-04-15 14:15:08 +09:00
5abc5b2a4c
Update webpagetool.php 2019-04-15 14:14:19 +09:00
03c1200941
Update twilio.api.php 2019-04-15 14:06:50 +09:00
8827bfe8e0
Update webpagetool.php 2019-04-15 14:05:40 +09:00
8d7c46f342
Update webpagetool.php 2019-04-15 14:00:53 +09:00
2c5c337fa0
Update and rename thirdparty.ini.php to 3rdparty.ini.php 2019-04-15 13:43:23 +09:00
c1b83de1fb
Update api.social.php 2019-04-15 13:42:13 +09:00
4926f59e79
Rename socialtools.php to socialtool.php 2019-04-15 13:41:58 +09:00
79784245d8
Update and rename api.socialhub.php to api.social.php 2019-04-15 13:41:19 +09:00
13d7d49279
Update and rename socialhub.utl.php to socialtools.php 2019-04-15 13:38:48 +09:00
3acbddba3b
Delete vworld.ini.php 2019-04-15 13:37:05 +09:00
5310662ed1
Update thirdparty.ini.php 2019-04-15 13:36:57 +09:00
82bd8b7458
Create thirdparty.ini.php 2019-04-15 13:36:29 +09:00
e7019f22e4
Update api.zabbix.php 2019-04-15 13:33:01 +09:00
51b76839c3
Update api.zabbix.php 2019-04-15 13:32:31 +09:00
70ac4d9f8c
Update api.twilo.php 2019-04-15 13:30:13 +09:00
4b6c118e63 add multiple methods of get_requested_value() 2019-04-15 04:27:59 +00:00
5bdeabe3ab add multiple methods of get_requested_value() 2019-04-15 04:23:20 +00:00
2b26a1a817
Update uri.php 2019-04-15 11:10:55 +09:00
01470a41c4
Update api.twilo.php 2019-04-15 10:58:34 +09:00
fba64d4079
Update api.twilo.php 2019-04-15 10:58:16 +09:00
2b5ae71d10
Update api.twilo.php 2019-04-15 10:53:41 +09:00
4b930ab68a
Create api.twilo.php 2019-04-15 10:53:19 +09:00
f279467c66 Update composer.json 2019-04-12 11:22:31 +00:00
56ff3b6258 Merge branch 'master' of https://github.com/gnh1201/reasonableframework 2019-04-12 07:54:49 +00:00
54bb47deee fix 2019-04-12 07:54:37 +00:00
60aee15a76
Update composer.json 2019-04-12 16:40:49 +09:00
ef6339c7c6
Update composer.json 2019-04-12 16:07:53 +09:00
4d9b86d173 add pchart 2019-04-12 15:33:17 +09:00
b09723757e Merge branch 'master' of https://github.com/gnh1201/reasonableframework 2019-04-12 15:32:15 +09:00
d9d6109067 add pchart 2019-04-12 15:31:52 +09:00
ac29a7b625
Create mailgun.api.php 2019-04-12 14:57:45 +09:00
a3e41edd57
Update twilio.api.php 2019-04-10 20:29:53 +09:00
df236810ad twilio api 2019-04-10 20:28:40 +09:00
f1b4e2dd95
Update webpagetool.php 2019-04-10 20:21:01 +09:00
12a51ce2ab
Update webpagetool.php 2019-04-10 20:20:15 +09:00
e8d5653b7d
Update webpagetool.php 2019-04-10 20:18:06 +09:00
660761a2b8
Update webpagetool.php 2019-04-10 20:11:56 +09:00
d693f575ed
Update base.php 2019-04-10 20:10:48 +09:00
d862d76cbb
Update base.php 2019-04-10 20:08:27 +09:00
7d9c3c0841
Update webpagetool.php 2019-04-10 20:01:50 +09:00
613761a505
Update api.zabbix.php 2019-04-09 19:41:44 +09:00
847edab82e
Update zabbix.api.php 2019-04-09 19:41:21 +09:00
162fedd2ef
Update base.php 2019-04-09 17:32:20 +09:00
78af1b5db0 zabbix api 2019-04-09 15:11:37 +09:00
43462e4d9a zabbix api 2019-04-09 14:55:56 +09:00
bebfdce0a6 Merge branch 'master' of https://github.com/gnh1201/reasonableframework 2019-04-08 16:17:35 +09:00
cee5168076 zabbix api 2019-04-08 16:17:09 +09:00
3554c55b0c
Create twilio.api.php 2019-04-08 15:57:38 +09:00
c1ff4db42a zabbix api 2019-04-08 15:52:03 +09:00
4f72befc28
Update and rename zabbix.rpc.php to zabbix.api.php 2019-04-08 15:32:14 +09:00
025f22d7f1
Update zabbix.rpc.php 2019-04-08 10:19:23 +09:00
e974610602
Create zabbix.rpc.php 2019-04-08 09:12:14 +09:00
99431bd990
Update database.php 2019-04-08 00:06:43 +09:00
86be63f7df
Update database.php 2019-04-08 00:02:09 +09:00
4016fe37d3
fix log files permission 2019-04-07 15:01:42 +09:00
3d0fc91063
Update README.md 2019-04-06 21:13:38 +09:00
1119384439
Update exectool.php 2019-04-06 21:10:17 +09:00
0f5381fc14
Create database.mysql.cmd.php 2019-04-06 21:04:49 +09:00
006e13cb13
Added mysql.cmd connection driver 2019-04-06 20:50:01 +09:00
354ed9348c
Update database.php 2019-04-03 12:00:00 +09:00
d7c9604b59
Update database.php 2019-04-03 11:48:56 +09:00
d19a34395f
Update database.php 2019-04-03 11:41:09 +09:00
299216033c
Update database.php 2019-04-03 08:55:29 +09:00
cfb58f3b29
Update database.php 2019-04-01 17:47:58 +09:00
ca411afe8b
Update database.php 2019-04-01 17:30:02 +09:00
5c0dc3cafc
Update database.php 2019-04-01 17:29:24 +09:00
2bf0f8b17b
Update database.php 2019-04-01 17:27:14 +09:00
da1f8f2f09
Update database.php 2019-04-01 17:08:32 +09:00
490d17d269
Update base.php 2019-04-01 17:07:30 +09:00
1c922bc4b9
Update database.php 2019-04-01 16:53:58 +09:00
49520296be
Update database.php 2019-04-01 16:44:45 +09:00
25895fb771
Update database.php 2019-04-01 16:19:22 +09:00
a2c20bed27
Update webpagetool.php 2019-04-01 11:33:09 +09:00
6486e87dc0
Update database.mysql.old.php 2019-04-01 11:25:25 +09:00
26e7a2f5c2
Update webapp.php 2019-04-01 11:12:23 +09:00
c6f4cf55ec
Update uri.php 2019-03-28 14:51:17 +09:00
6a20739eb6
Update uri.php 2019-03-28 14:23:26 +09:00
e031244899
Update logger.php 2019-03-28 14:10:25 +09:00
a8b8633126
Update storage.php 2019-03-28 14:09:43 +09:00
27f03431aa
Update logger.php 2019-03-28 14:07:47 +09:00
bf68cf0a3a
Update base.php 2019-03-28 14:06:59 +09:00
0ceaabdfc6
Update README.md 2019-03-28 14:00:02 +09:00
8200581ff3
Update README.md 2019-03-15 16:50:13 +09:00
a8066b68fd
Update README.md 2019-03-15 10:49:27 +09:00
7371db7184
Update README.md 2019-03-15 10:10:33 +09:00
a57e3e1e16
Update README.md 2019-03-15 10:06:32 +09:00
2cf1cfdac4
Update README.md 2019-03-15 10:04:30 +09:00
732fe3828a
Update README.md 2019-03-15 10:03:46 +09:00
0f2be651a5
Update README.md 2019-03-15 10:03:33 +09:00
253bf5eea1
Update README.md 2019-03-12 10:42:40 +09:00
260d314b34
Update view_welcome.php 2019-03-12 10:42:14 +09:00
3c6f993dfc
Update README.md 2019-03-12 10:41:11 +09:00
83e0bb5b2d
Update README.md 2019-03-12 10:40:58 +09:00
278ac693cc
Update README.md 2019-03-12 10:38:20 +09:00
826e9512cb
Update README.md 2019-03-12 10:34:42 +09:00
a9a4ff0eba
Update README.md 2019-03-12 10:34:14 +09:00
5d4f451107
Update storage.php 2019-03-09 20:25:48 +09:00
add895b839
Update storage.php 2019-03-08 01:41:30 +09:00
215beed570
Update webapp.php 2019-03-08 01:37:13 +09:00
2263dff0cf
Update uri.php 2019-03-07 11:59:54 +09:00
50f0b77bde
Update uri.php 2019-03-07 11:16:11 +09:00
f56976c116
Update uri.php 2019-03-07 11:12:28 +09:00
c60c160f0e
Update uri.php 2019-03-07 11:10:48 +09:00
7b9c4607f6
Update index.php 2019-03-07 11:09:43 +09:00
3c5e7adba2
Adjust module priority 2019-03-07 11:08:52 +09:00
3815b0e2cf
Update base.php 2019-03-05 10:11:27 +09:00
28a5d9d7bf
Update base.php 2019-03-05 10:06:58 +09:00
e39f1b7b36
Update string.utils.php 2019-02-26 19:04:54 +09:00
d357ec257a
Update database.php 2019-02-26 18:23:53 +09:00
fc30285fd0
Update database.php 2019-02-26 18:22:10 +09:00
6295c19cbd
Update string.utils.php 2019-02-26 18:14:59 +09:00
4deace135a
Update string.utils.php 2019-02-26 18:06:19 +09:00
c5c8deaa40
Update string.utils.php 2019-02-26 17:40:46 +09:00
ea4527b915
Update string.utils.php 2019-02-26 17:35:31 +09:00
f64f6a6f92
Update database.oracle.php 2019-02-26 16:25:36 +09:00
30444145a9
Update bootstrap.sh 2019-02-26 16:24:34 +09:00
f7a68c25dd
Rename _.htaccess.txt to _.htaccess 2019-02-26 16:24:35 +09:00
dc8268d802
Rename storage/config/example.htaccess.txt to storage/example/_.htaccess.txt 2019-02-26 16:23:37 +09:00
afac9da61c
Rename storage/config/tnsname.orax.txt to storage/example/tnsname.orax 2019-02-26 16:22:42 +09:00
ae0c30cc42
Rename storage/helloworld.htaccess.txt to storage/config/example.htaccess.txt 2019-02-26 16:22:13 +09:00
78107d0230
Update and rename tnsname.orax.php to tnsname.orax.txt 2019-02-26 16:21:53 +09:00
8cd1bacf09
Update and rename tnsname.orax to tnsname.orax.php 2019-02-26 16:18:18 +09:00
c035a31847
Update country.kr.php 2019-02-26 16:12:45 +09:00
8fc09353d3
Update security.php 2019-02-26 16:11:31 +09:00
cb6c6238ee
Update orderpay.step2.pgkcp.php 2019-02-26 16:05:19 +09:00
ba320a6ab9
Update hybridauth.lnk.php 2019-02-26 16:04:05 +09:00
d5eeb04554
Update and rename string.utl.php to string.utils.php 2019-02-26 16:03:12 +09:00
26773028cf
Update country.kr.php 2019-02-26 16:02:30 +09:00
31d2f675cf
Update string.utl.php 2019-02-26 16:01:18 +09:00
da29e3b2c1
Update and rename naturename.kr.php to country.kr.php 2019-02-26 16:00:04 +09:00
fec76384ec
Rename storage/country/korean/lastname.txt to storage/country/kr.lastname.txt 2019-02-26 15:55:28 +09:00
1d0af01552
Rename storage/country/korean/firstname.txt to storage/country/kr.firstname.txt 2019-02-26 15:55:15 +09:00
0e7bd43eb9
Create firstname.txt 2019-02-26 15:51:28 +09:00
9b6001691d
Rename prefix.txt to lastname.txt 2019-02-26 15:48:14 +09:00
7fe95ba208
Create prefix.txt 2019-02-26 15:47:35 +09:00
dc93c38313
Update string.utl.php 2019-02-26 15:38:05 +09:00
f8fd84339e
Update security.php 2019-02-26 15:34:05 +09:00
f52b038ba7
Update security.ini.php 2019-02-26 15:31:08 +09:00
f9baddf80a
Update security.ini.php 2019-02-26 15:27:04 +09:00
b29c9588f1
Update security.ini.php 2019-02-26 15:26:35 +09:00
e7ce41ddba
Update security.php 2019-02-26 15:23:21 +09:00
d2b871cb5a
Update string.utl.php 2019-02-26 15:06:57 +09:00
2ed40e017d
Update networktool.php 2019-02-26 15:05:35 +09:00
8c60df4494
Update string.utl.php 2019-02-26 15:04:05 +09:00
57285afc42
Update webpagetool.php 2019-02-26 15:01:26 +09:00
59414fbe2c
Update database.oracle.php 2019-02-26 14:57:23 +09:00
5feac462e5
Update database.alt.php 2019-02-26 14:44:54 +09:00
b631d57574
Update is_email.php 2019-02-26 14:42:16 +09:00
b98663a291 fix check_function_exists 2019-02-26 14:40:03 +09:00
6f9a01dd01
Update base.php 2019-02-26 14:36:04 +09:00
ae4f2628f4
Update README.md 2019-02-26 11:59:49 +09:00
b51da8cbec
Update README.md 2019-02-26 11:59:19 +09:00
e4cc01face
Create bootstrap.sh 2019-02-26 11:57:54 +09:00
090a22761f
Rename helloworld.htaccess to storage/helloworld.htaccess.txt 2019-02-26 11:56:27 +09:00
862d44ef01
Create helloworld.htaccess 2019-02-26 11:54:58 +09:00
653518d50d
Update database.php 2019-02-26 11:50:25 +09:00
0f744857d4
Update cli.php 2019-02-26 11:47:25 +09:00
374d9046f3
Update base.php 2019-02-26 11:45:19 +09:00
d3cc98c478
Update base.php 2019-02-26 11:44:23 +09:00
ed3409a14b fix check_valid_function 2019-02-26 11:39:32 +09:00
fa69ce339d
Update database.oracle.php 2019-02-26 11:34:49 +09:00
dedebe5ecb
Update base.php 2019-02-26 11:31:08 +09:00
94f8884083 replace function_exists(bool) to check_valid_function(bool) 2019-02-26 11:29:24 +09:00
e306c2dced
Update base.php 2019-02-26 11:26:51 +09:00
b332bf0ac6
Update base.php 2019-02-26 11:23:20 +09:00
78d7ea32a4
Update base.php 2019-02-26 11:22:05 +09:00
b9f0fb1368
Update database.php 2019-02-26 11:20:54 +09:00
5771190b78
Update base.php 2019-02-26 11:17:44 +09:00
7ab5dfb706
Update database.php 2019-02-26 11:03:30 +09:00
82e35e0ee3
Update database.php 2019-02-25 14:46:51 +09:00
8dedeb286b
Update webapp.php 2019-02-24 23:34:03 +09:00
c2818b644a
Update webapp.php 2019-02-24 23:32:43 +09:00
46c179ee53
Update webapp.php 2019-02-23 07:36:14 +09:00
d306929844
Update webapp.php 2019-02-23 06:49:43 +09:00
fee82cecc7
Update webapp.php 2019-02-23 06:37:33 +09:00
a55509ed4b
Create webapp.md 2019-02-23 05:32:09 +09:00
9237569b4f
Update uri.php 2019-02-23 05:31:36 +09:00
6f20ca06b1
Update webapp.php 2019-02-23 05:30:35 +09:00
7602ad2e19
Update webapp.php 2019-02-23 05:07:04 +09:00
58578352a1
Update uri.php 2019-02-23 03:57:17 +09:00
0b5ffc1579
Create webapp.php 2019-02-23 03:15:06 +09:00
e6553f919e
Update uri.php 2019-02-23 03:12:32 +09:00
b60bb75b31
Update base.php 2019-02-23 02:53:58 +09:00
ebc5233e26
Update uri.php 2019-02-23 02:51:33 +09:00
273e803288
Update base.php 2019-02-23 02:02:51 +09:00
b7eefd8edf
Update database.alt.php 2019-02-23 01:22:39 +09:00
f2b18ce314
Update database.php 2019-02-23 00:51:27 +09:00
d2264160e0
Update database.php 2019-02-23 00:43:31 +09:00
eb5f05c444
Update uri.php 2019-02-22 23:52:04 +09:00
8fec3be4e2
Update uri.php 2019-02-22 23:46:35 +09:00
54ed2820f4
Update uri.php 2019-02-22 23:46:13 +09:00
3b8ae917b2
Update index.php 2019-02-22 23:37:01 +09:00
e7f6afce81
Update index.php 2019-02-22 23:35:58 +09:00
c8f38cf499
Update uri.php 2019-02-22 23:34:56 +09:00
196664d529
Update webpagetool.php 2019-02-20 20:52:24 +09:00
e25ea2331a
Update webpagetool.php 2019-02-20 20:51:35 +09:00
9e3442f623
Update README.md 2019-02-20 02:16:18 +09:00
b96807cfc5
Update README.md 2019-02-20 02:13:56 +09:00
ba91d80c02
Update README.md 2019-02-20 02:12:40 +09:00
39c409a827
Update README.md 2019-02-20 02:12:13 +09:00
cb4b5a41d4
Update README.md 2019-02-20 02:11:54 +09:00
ab3b54f05a
Update README.md 2019-02-20 02:09:55 +09:00
47838e880e
Update README.md 2019-02-20 02:09:41 +09:00
e06f0aedad
Update README.md 2019-02-20 02:09:11 +09:00
44d7668121
Update README.md 2019-02-20 02:08:26 +09:00
e5869f0bf1
Update cli.php 2019-02-20 01:21:19 +09:00
d098c8d9e4
Update index.php 2019-02-20 01:21:01 +09:00
9dbca511fe
Delete allreporting.php 2019-02-20 01:18:05 +09:00
8902591672
Update cli.php 2019-02-20 01:17:46 +09:00
7922ad2d34
Update index.php 2019-02-20 01:17:33 +09:00
40a62f4542
Update cli.php 2019-02-20 01:13:13 +09:00
f6f2bdee1f
Update index.php 2019-02-20 01:13:01 +09:00
652ae03468
Update uri.php 2019-02-20 01:06:40 +09:00
fd2e83222c
Update uri.php 2019-02-20 01:03:48 +09:00
7b902e4450
Update README.md 2019-02-16 18:23:17 +09:00
bfd1347c4c
Update README.md 2019-02-16 18:22:10 +09:00
aba4a5b388
Update README.md 2019-02-16 16:33:52 +09:00
5390ddc0a0
Update README.md 2019-02-16 15:45:46 +09:00
fd9253ebd7
Update README.md 2019-02-16 15:44:40 +09:00
a3ae932025
Update README.md 2019-02-16 15:42:05 +09:00
0ef2c3dbb5
Update README.md 2019-02-16 15:41:15 +09:00
bf768777fa
Update README.md 2019-02-16 15:40:43 +09:00
9e53a48d7d
Update README.md 2019-02-16 15:39:31 +09:00
15c0fb8f27
Update README.md 2019-02-16 15:39:13 +09:00
a3588509a9
Update README.md 2019-02-16 15:34:35 +09:00
5e33a5af1f
Create ping.php 2019-02-16 15:27:12 +09:00
417 changed files with 60983 additions and 7212 deletions

11
CITATION.cff Normal file
View File

@ -0,0 +1,11 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Go"
given-names: "Namhyeon"
orcid: "https://orcid.org/0009-0006-8421-0911"
title: "ReasonableFramework"
version: v1.6.8
doi: 10.5281/zenodo.11392417
date-released: 2024-05-30
url: "https://github.com/gnh1201/reasonableframework"

8
FUNDING.yml Normal file
View File

@ -0,0 +1,8 @@
# These are supported funding model platforms
github: gnh1201
open_collective: welsonjs
liberapay: catswords
custom: ['https://www.buymeacoffee.com/catswords', 'https://toss.me/catswords']
patreon: catswords # Replace with a single Patreon username
ko_fi: catswords

107
KOREAN.MD
View File

@ -1,55 +1,98 @@
## 기반 소프트웨어 # 본 웹 어플리케이션에 대하여
본 웹 어플리케이션은 ReasonableFramework 기반으로 작성됨. https://github.com/gnh1201/reasonableframework
본 웹 소프트웨어는 ReasonableFramework 기반으로 작성되었습니다.
https://github.com/gnh1201/reasonableframework
## 적재된 모듈 목록 ## 적재된 모듈 목록
* System: base (시스템 기반) * System: base (시스템 기반)
* System: config (시스템 설정) * System: config (시스템 설정)
* System: database (데이터베이스) * System: database (데이터베이스)
* System: logger (로그) * System: logger (로그)
* System: uri (URI 및 URL 제어) * System: uri (URI 및 URL 제어)
* System: security (보안) * System: security (보안)
* Helper: paginate (페이지 네비게이션) * Helper: paginate (페이지 네비게이션)
* Helper: gnuboard, gnuboard.config, gnuboard.lib (그누보드 설정 및 라이브러리 연동) * Helper: gnuboard, gnuboard.config, gnuboard.lib (그누보드 설정 및 라이브러리 연동)
* Helper: vworld (국토교통부 vworld 연동) * Helper: vworld (국토교통부 vworld 연동)
* Helper: wprest (워드프레스[wordpress] REST API 클라이언트) * Helper: wprest (워드프레스[wordpress] REST API 클라이언트)
* Hepler: webpagetool (Proxy 설정, UA 설정, JSON/DOM 파서를 지원하는 HTTP 클라이언트) * Hepler: webpagetool (Proxy 설정, UA 설정, JSON/DOM 파서를 지원하는 HTTP 클라이언트)
* Helper: noreporting, allreporting (오류 출력 범위를 설정) * Helper: noreporting, allreporting (오류 출력 범위를 설정)
* Helper: isemail.lnk (is_email 지원 -> /vendor/isemail) * Helper: isemail.lnk (is_email 지원 -> /vendor/isemail)
* Helper: metaparser.lnk (HTML META 데이터 파싱 지원 -> /vendor/PHP-MetaParser) * Helper: metaparser.lnk (HTML META 데이터 파싱 지원 -> /vendor/PHP-MetaParser)
* Helper: simple_html_dom (HTML DOM 처리기) * Helper: simple_html_dom (HTML DOM 처리기)
* Helper: oracle (오라클 데이터베이스 접속 및 쿼리) * Helper: oracle (오라클 데이터베이스 접속 및 쿼리)
* Helper: exectool (PHP 명령행 실행 지원) * Helper: exectool (PHP 명령행 실행 지원)
* 그 외 다양한 사양 지원을 위한 모듈들
## 기술지원 ## 오픈소스 라이선스
* 이 프로젝트는 LGPL 3.0 오픈소스 라이선스 하에 배포됨.
* Website: https://exts.kr/go/home
* E-mail: support@exts.kr
## 저작권
* LGPL (별도의 오픈소스 라이센스 문서에 기입 요망)
## 최근변경 ## 최근변경
* 2024-05-30
* 2018-07-22 ## 정적 파일 호스팅 관련 지침 (카페24 CDN 또는 Amazon S3)
본 지침은 버전 v1.6.8를 기준으로 한다.
### 정적 파일 호스팅 서비스의 예시
- 카페24 ([10G 광아우토반 FullSSD+](https://hosting.cafe24.com/?controller=new_product_page&page=autobahn) 웹 호스팅 상품 기준)
- Amazon S3
- Object Storage
### 카페24 정적 파일 호스팅 사용자
1. 카페24(cafe24.com) 관리자 페이지에 로그인하여, CDN/스트리밍 도메인 정보를 얻는다.
1. 메인 웹 사이트 로그인 -> `나의서비스관리` 클릭
2. 좌측 메뉴에서 `서비스 접속관리` -> `서비스 접속 정보` 클릭
3. CDN/스트리밍 정보 확인
```
*** CDN ***
CDN 하드 용량: 200M
CDN 트래픽 용량: 500M
FTP 주소: iup.cdn2.cafe24.com
FTP 포트: 21
FTP 아이디: [사용자 아이디]
*** 스트리밍 ***
스트리밍 하드 용량: 200M
스트리밍 트래픽 용량: 500M
FTP 주소: wm-004.cafe24.com
FTP 포트: 5565
FTP 아이디: [사용자 아이디]
```
4. CDN의 경우, `https://[사용자 아이디].cdn2.cafe24.com`(예시)가 접속 주소가 된다.
5. 스트리밍의 경우, `mms://wm-004.cafe24.com/[사용자 아이디]/abc.mp3`(예시)가 접속 주소가 된다.
2. ResonableFramework v1.6.8 설치 및 CDN/스트리밍 설정
1. [깃허브 저장소](https://github.com/gnh1201/reasonableframework) 접속 후 `Release` 탭을 누르고 `v1.6.8` 또는 최신 버전을 내려받는다.
2. `storage/config/uri.ini.php` 파일의 CDN/스트리밍 관련 부분을 아래와 같이 수정한다.
```
base_cdn_url = https://[사용자 아이디].cdn2.cafe24.com
base_vod_url = mms://wm-004.cafe24.com/[사용자 아이디]
```
3. `route` 폴더 밑에 `cdntest.php` 이름의 빈 파일을 만들고, 아래와 같이 입력 후 저장한다.
```
<?php
$data = array(
"imageurl" => get_cdn_link("/picture.jpg");
);
renderView("view_cdntest", $data);
```
4. `view` 폴더 밑에 `view_cdntest.php` 이름의 빈 파일을 만들고, 아래와 같이 입력 후 저장한다.
```
<img src="<?php echo $imageurl; ?>" alt="this is cdn test">
```
5. 사용하고 있는 웹 호스팅에 reasonableframework-master 폴더 아래의 모든 파일을 업로드한다.
6. 1번에서 얻은 FTP 정보를 이용하여, CDN 서버에 `picture.jpg` 이름으로 임의의 JPG 그림 파일을 업로드한다.
7. 웹 브라우저를 열고 `http://[웹 호스팅 주소]/?route=cdntest`에 접속하여 그림이 잘 뜨는지 확인한다.
### Amazon S3 또는 Object Storage 사용자
- 해당 정적 파일 호스팅 업체에서 제공하는 공통 링크를 확인한 뒤, 해당 링크를 `storage/config/uri.ini.php` 파일의 `base_cdn_url`에 반영한다.
## 기술지원 및 문의사항
- 웹사이트: https://catswords.social/@catswords_oss
- 이메일: abuse@catswords.net

126
README.md
View File

@ -1,10 +1,18 @@
# Reasonable PHP Framework # ReasonableFramework
- Reasonable Framework is PHP framework for make solid and secure web development. ![License LGPLv3](https://img.shields.io/github/license/gnh1201/reasonableframework.svg)
- Old version name: Very Simple PHP Framework (VSPF) [![DOI](https://zenodo.org/badge/114566493.svg)](https://zenodo.org/doi/10.5281/zenodo.11392416)
## Specification ReasonableFramework is RVHM structured PHP framework. aka, RSF, VSPF, C-2020-018490
- Database connection (via PDO, MySQLi (MySQL Improved), MySQL Tranditional, Oracle(OCI))
- Route (Controller), Helper, View Structrue (Model is optional) ## Specifications
- Various types of database connection drivers. e.g, PHP PDO, MySQLi, Legacy MySQL, MySQL over the shell, Oracle(OCI)
- No OOP, Just `RVHM` structure
- R is Route. like as `controller`
- V is View
- H is Helper. like a `import` on Python, Go, NodeJS
- M is Model. it implemented with `KV bind`(like as `Map` data structure), Model is optional.
- Controllable shared variables: Minimize abuse of global variables. Inspired by the `scope` of AngularJS, and `SharedPreferences` of Android Framework
- CGI style compatibility prepared for industrial applications: This framework can utilize both the latest object-oriented style and the CGI style required in industrial applications.
## Compatible ## Compatible
- Tested in PHP 5.3.3 - Tested in PHP 5.3.3
@ -12,65 +20,69 @@
## How to use ## How to use
- Extract or clone this project to your (restrictive) shared web hosting. - Extract or clone this project to your (restrictive) shared web hosting.
- You can use and intergrate all of PHP packages without Composer and additional extensions! (supported autoloader) - You can intergrate all of PHP projects (linear, modular (ex. `autoloader`), or others) without complicated extensions.
- You can use and rewrite by route feature! without heavy frameworks! - You can write your code and rewrite by `route` parameter without heavy framework. (like as `controller`)
- You can write your back-end code in route. (the same as controller) - You can add your custom `ini.php` configuration file in `config` directory.
- You can config database if you add your custom ini file in config directory.
- Enjoy it! - Enjoy it!
## Map of structure ## Map of structure
![Map of ResaonableFramework structure](https://github.com/gnh1201/reasonableframework/raw/master/assets/img/reasonableframework.jpg) ![Map of structure](https://github.com/gnh1201/reasonableframework/raw/master/assets/img/reasonableframework.jpg)
## Roadmap: Support legacy
- Support critical legacy web server (old: PHP 4.x ~ modern: 7.x)
- Support critical old browser (old: IE 6 ~ modern: IE 11)
- Do Clean & Modern PHP without hard studies.
## Contact me
- Go Namhyeon <gnh1201@gmail.com>
- Website: https://exts.kr/go/home
## Quick Start ## Quick Start
1. git clone https://github.com/gnh1201/reasonableframework.git 1. git clone https://github.com/gnh1201/reasonableframework.git
2. set up database configuration: storage/config/database.ini 2. edit database configuration: `/storage/config/database.ini.php`
3. make route/example.php 3. create new file: `/route/example.php`
4. go to [base_url]/?route=example 4. go to `http://:base_url/?route=example` or `http://:base_url/example/`(if set `.htaccess`) in the web browser.
5. enjoy it. 5. code it.
## Website example ## Use cases
- [Send severities from Zabbix to Grafana](https://gist.github.com/gnh1201/792964e9719d2f62157cf46e394888f5)
- [REST API Integration (Papago Translation REST API)](https://gist.github.com/gnh1201/081484e6f5e10bd3be819093ba5f49c8)
- [Payment Gateway Integration](https://github.com/gnh1201/reasonableframework/blob/master/route/orderpay.pgkcp.php)
## Remote logging
- Remote logging feature based on [RFC3164(The BSD Syslog Protocol)](https://tools.ietf.org/html/rfc3164)
## Tested on free web hostings
| Provider | Pass? | Tested version | Note
| ---------------------- | ------ | -------------- | -------------------------- |
| [vultr.com](https://catswords.re.kr/go/vultr) (Vultr Holdings Co.) | :heavy_check_mark: Passed | v1.6.5.2 | Paid, Pre-configured LAMP server |
| cafe24.com (Cafe24 Inc.) | :heavy_check_mark: Passed | v1.6.2 | Paid |
| woobi.co.kr (MyCGI) | :heavy_check_mark: Passed | v1.6.2 | |
| dothome.co.kr (Anysecure Inc.) | :heavy_check_mark: Passed | v1.5 | |
| ivyro.net (Smileserv Inc.) | :heavy_check_mark: Passed | v1.5 | |
| 000webhost.com | :warning: Warn | v1.5 | Advertising logo |
| freewebhostingarea.com | :heavy_check_mark: Passed | v1.5 | |
| infinityfree.net | :warning: Warn | v1.5 | Anti-crawling |
| freehosting.io | :heavy_check_mark: Passed | v1.5 | |
| freehostingeu.com | :warning: Warn | v1.5 | CURL blocked |
| freehostingnoads.net | :warning: Warn | v1.5 | CURL blocked |
| awardspace.com | :warning: Warn | v1.5 | CURL blocked |
## How to use CLI (Command-line interface)
``` ```
<?php $ php cli.php --route :route --session-id :session_id
if(!defined("_DEF_RSF_")) set_error_exit("do not allow access");
loadHelper("string.utl");
$copyright = read_storage_file("copyright.txt", array(
"storage_type" => "terms"
));
$lines = explode_by_line($copyright);
foreach($lines as $line) {
$copyright .= "<p>" . $line . "</p>";
}
$data = array(
"copyright" => $copyright
);
renderView('templates/default/header');
renderView('view_copyright', $data);
renderView('templates/default/footer');
?>
``` ```
## CLI mode example ## Comment about PSR standards
``` Many people are saying that this project seems to be distant from the [PSR](https://www.php-fig.org/psr/) standards, and that claim is correct.
$ php cli.php --route [route name]
```
## Korean The coding convention of this project is similar to the CGI style that was widely used in the early 2000s. Moreover, this style is still observed in solutions written in PHP that are sold in markets such as [WordPress](https://wordpress.org/) plugins, [a local-optimized CMS](https://github.com/gnuboard/gnuboard5), or [Codecanyon](https://codecanyon.net/) in 2023.
- Resonable PHP Framework(이유있는 PHP 프레임워크)는 한국의 웹 개발 환경에 적합한 PHP 프레임워크입니다.
- Composer를 포함한 별도의 개발 보조 도구, PHP 플러그인, PHP 프레임워크가 사용 불가능한 환경에 적합합니다. Although this project hardly uses object-oriented concepts and does not use package managers like Composer much, it still incorporates concepts such as Model, View, Controller, Router, and Helper that are proposed in modern frameworks, and we have made efforts to provide a similar experience as much as possible.
- 개발 팀원을 대상으로 객체지향(OOP) 교육이 이루어지지 않아도, 그에 준하는 생존주기(Life cycle)를 보장합니다.
- Resonable PHP Framework는 CSRF, XSS, SQL Injection 보안 조치를 기본적으로 가지고 있습니다. We made efforts to address common security vulnerabilities (XSS, CSRF, SQL injection) in web applications, and included many code snippets that were designed to minimize reliance on specific DBMS or communication drivers.
- 한국에서 사용되는 각종 CMS와 API와 연동되어 한국 환경에서 사용 빈도가 높은 구현 유형을 작성하는데 적합합니다.
- MVC 모델과 유사하지만 기존 개발 스킬로도 사용할 수 있도록 더 유연한 모델을 가지고 있습니다. The specifications that this project offers are still in demand in enterprise environments, so it can be a useful solution if you happen to be in such a situation.
Whenever this project was introduced, I received a lot of questions about PSR, and I also made efforts to find customers who were willing to pay for a PSR version, such as holding conferences for existing customers. However, there is still no good news. Until good news comes, my plan is to mainly maintain this project.
If you want to comply with the PSR standards and your colleagues are also ready to learn them humbly, we recommend that you consider [Codeigniter](https://github.com/bcit-ci/CodeIgniter) (which has a similar structure to this project) or [Silm Framework](https://github.com/slimphp/Slim).
## Security Policy
- [Security policy](SECURITY.md)
## Contact us
- abuse@catswords.net
- ActivityPub [@catswords_oss@catswords.social](https://catswords.social/@catswords_oss)

23
SECURITY.md Normal file
View File

@ -0,0 +1,23 @@
# Security Policy
## Supported Versions
Use this section to tell people about which versions of your project are
currently being supported with security updates.
| Version | Supported |
| ------- | ------------------------------------------ |
| 1.6.x | :white_check_mark: (Current) |
| 1.5.x | :x: (EOL: 2020-08-25) |
| < 1.5 | :x: |
## Reporting a Vulnerability
Use this section to tell people how to report a vulnerability.
Tell them where to go, how often they can expect to get an update on a
reported vulnerability, what to expect if the vulnerability is accepted or
declined, etc.
## Contact us
* ActivityPub [@catswords_oss@catswords.social](https://catswords.social/@catswords_oss)
* abuse@catswords.net

View File

@ -1,2 +0,0 @@
# Confirmed version
Last confirmed: 2018-03-09 22:00 (KST, GMT+09:00, Seoul)

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

View File

@ -1,85 +1,107 @@
function payman_get_check_msgs() { function payman_get_check_msgs() {
return { return {
"good_name": "상품명을 기재하여야 합니다.", "good_name": "상품명을 기재하여야 합니다.",
"good_mny": "가격을 기재하여야 합니다.", "good_mny": "가격을 기재하여야 합니다.",
"buyr_name": "구매자 이름이 없습니다.\n\n로그인하시거나 회원 정보에서 반드시 등록하여 주세요.", "buyr_name": "구매자 이름이 없습니다.\n\n로그인하시거나 회원 정보에서 반드시 등록하여 주세요.",
"buyr_mail": "구매자 이메일이 없습니다.\n\n로그인하시거나 회원 정보에서 반드시 등록하여 주세요.", "buyr_mail": "구매자 이메일이 없습니다.\n\n로그인하시거나 회원 정보에서 반드시 등록하여 주세요.",
"buyr_tel1": "구매자 전화번호가 없습니다.\n\n로그인하시거나 회원 정보에서 반드시 등록하여 주세요." "buyr_tel1": "구매자 전화번호가 없습니다.\n\n로그인하시거나 회원 정보에서 반드시 등록하여 주세요."
}; };
} }
function payman_load_widget(data) { function payman_load_widget(data) {
var is_available = true; var is_available = true;
var req_data = { var req_data = {
"route": "orderform.widget", "route": "orderform.widget",
"redirect_url": window.location.href "redirect_url": window.location.href
}; };
var check_msgs = payman_get_check_msgs(); var check_msgs = payman_get_check_msgs();
var allows_zero = ["good_mny"]; var allows_zero = ["good_mny", "redirect_url"];
for(var k in check_msgs) { for(var k in check_msgs) {
if( !(k in data) || (allows_zero.indexOf(k) < 0 && data[k] == "") ) { if( !(k in data) || (allows_zero.indexOf(k) < 0 && data[k] == "") ) {
alert(check_msgs[k]); alert(check_msgs[k]);
is_available = false; is_available = false;
break; break;
} else { } else {
req_data[k] = data[k]; req_data[k] = data[k];
} }
}
if("redirect_url" in data) {
req_data['redirect_url'] = data['redirect_url'];
} }
if(is_available == true) { if(is_available == true) {
$.ajax({ $.ajax({
type: "post", type: "post",
dataType: "text", dataType: "text",
url: "/payman/", url: "/payman/",
data: req_data, data: req_data,
success: function(req) { success: function(req) {
$("#area_payman").html(req); $("#area_payman").html(req);
} }
}); });
} }
return is_available; return is_available;
} }
function payman_set_data(name, data) { function payman_set_data(name, data) {
$("#payman_" + name).val(data); $("#payman_" + name).val(data);
} }
function payman_get_data(name) { function payman_get_data(name) {
return $("#payman_" + name).val(); return $("#payman_" + name).val();
} }
function payman_set_base64(name, data) { function payman_set_base64(name, data) {
var req_data = { var req_data = {
"route": "base64", "route": "base64",
"action": "encode", "action": "encode",
"data": data "data": data
}; };
$.ajax({ $.ajax({
type: "post", type: "post",
dataType: "json", dataType: "json",
url: "/payman/", url: "/payman/",
data: req_data, data: req_data,
success: function(req) { success: function(req) {
payman_set_data(name, req.result); payman_set_data(name, req.result);
} }
}); });
} }
function payman_submit() { function payman_submit() {
var check_msgs = payman_get_check_msgs(); var check_msgs = payman_get_check_msgs();
for(var k in check_msgs) { for(var k in check_msgs) {
if(payman_get_data(k) == "") { if(payman_get_data(k) == "") {
alert(check_msgs[k]); alert(check_msgs[k]);
return false; return false;
} }
} }
$("#payman_orderform").submit(); $("#payman_orderform").submit();
return true; return true;
}
function payman_submit_nw() {
var check_msgs = payman_get_check_msgs();
for(var k in check_msgs) {
if(payman_get_data(k) == "") {
alert(check_msgs[k]);
return false;
}
}
var $obj = $("#payman_orderform");
var nw = window.open("", "payman_window", "height=600,width=786,modal=yes,alwaysRaised=yes");
$obj.attr("target", "payman_window");
$obj.submit();
nw.focus();
return true;
} }

5
bootstrap.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
#find . -type d -exec chmod 0755 {} \;
#find . -type f -exec chmod 0644 {} \;
chmod -R u+rwX,go+rX,go-w .
cp ./storage/example/_.htaccess ./.htaccess

111
cli.php
View File

@ -2,32 +2,53 @@
<?php <?php
/** /**
* @file cli.php * @file cli.php
* @date 2018-07-22 * @created_on 2018-07-22
* @author Go Namhyeon <gnh1201@gmail.com> * @created_on 2020-04-20
* @author Go Namhyeon <abuse@catswords.net>
* @brief ReasonableFramework CLI mode * @brief ReasonableFramework CLI mode
* @cvs http://github.com/gnh1201/reasonableframework * @cvs http://github.com/gnh1201/reasonableframework
*/ */
// example: php cli.php --route=welcome
define("_DEF_VSPF_", true); // compatible to VSPF define("_DEF_VSPF_", true); // compatible to VSPF
define("_DEF_RSF_", true); // compatible to RSF define("_DEF_RSF_", true); // compatible to RSF
define("APP_DEVELOPMENT", false); // set the status of development
define("DOC_EOL", "\r\n"); // set the 'end of line'
// development mode
if(APP_DEVELOPMENT == true) {
error_reporting(E_ALL);
@ini_set("log_errors", 1);
@ini_set("error_log", sprintf("%s/storage/sandbox/logs/error.log", getcwd()));
} else {
error_reporting(E_ERROR | E_PARSE);
}
@ini_set("display_errors", 1);
// set shared vars
$shared_vars = array();
// define system modules // define system modules
$load_systems = array("base", "storage", "config", "security", "uri"); $load_systems = array("base", "storage", "config", "security", "database", "uri", "logger");
// load system modules // load system modules
foreach($load_systems as $system_name) { foreach($load_systems as $system_name) {
$system_inc_file = "./system/" . $system_name . ".php"; $system_inc_file = "./system/" . $system_name . ".php";
if(file_exists($system_inc_file)) { if(file_exists($system_inc_file)) {
if($system_name == "base") { if($system_name == "base") {
include($system_inc_file); include($system_inc_file);
register_loaded("system", $system_inc_file); register_loaded("system", $system_inc_file);
} else { } else {
loadModule($system_name); loadModule($system_name);
} }
} } else {
echo "ERROR: Dose not exists " . $system_inc_file;
exit;
}
} }
// get configurations // get config
$config = get_config(); $config = get_config();
// set max_execution_time // set max_execution_time
@ -35,58 +56,42 @@ $max_execution_time = get_value_in_array("max_execution_time", $config, 0);
@ini_set("max_execution_time", $max_execution_time); @ini_set("max_execution_time", $max_execution_time);
//@set_time_limit($max_execution_time); //@set_time_limit($max_execution_time);
// set memory limit
$memory_limit = get_value_in_array("memory_limit", $config, "");
if(!empty($memory_limit)) {
@ini_set("memory_limit", $memory_limit);
@ini_set("suhosin.memory_limit", $memory_limit);
}
// autoload module // autoload module
if(!array_key_empty("enable_autoload", $config)) { if(!array_key_empty("enable_autoload", $config)) {
set_autoloader(); set_autoloader();
} }
// set timezone // set timezone
$default_timezone = get_value_in_array("timezone", $config, "UTC"); $default_timezone = get_value_in_array("timezone", $config, "UTC");
date_default_timezone_set($default_timezone); date_default_timezone_set($default_timezone);
// default route // set default route
$route = "welcome"; $route = "welcome";
// parse arguments // set arguments of command line
$num_of_args = count($argv); $opts = getopt("r::h::", array("route::", "host::"));
if($num_of_args > 1) { if(!empty($opts['route'])) {
foreach($argv as $k=>$v) { $route = $opts['route'];
switch($v) {
case "--route":
if($k < ($num_of_args - 1)) {
$route = $argv[$k + 1];
} else {
set_error("invaild argument");
show_errors();
}
break;
case "--static-ip":
if($k < ($num_of_args - 1)) {
$host = $argv[$k + 1];
set_scope("static_ip", $host);
} else {
set_error("invaild argument");
show_errors();
}
break;
}
}
} else {
set_error("not enough arguments");
show_errors();
} }
// load route // set global variables
if(empty($route)) { set_shared_var("route", $route);
$route = get_value_in_array("default_route", $config, "welcome"); set_shared_var("host", $opts['host']);
} else {
$route_names = explode('/', $route); // get PID(Process ID)
if(count($route_names) > 1) { set_shared_var("mypid", getmypid());
$route = $route_names[0];
} // set database connection
} set_shared_var("dbc", get_db_connect());
// load route file // load route file
if(!loadRoute($route, $scope)) { if(!loadRoute($route, $shared_vars)) {
loadRoute("errors/404", $scope); loadRoute("errors/404", $shared_vars);
} }

View File

@ -1,12 +1,14 @@
{ {
"name": "gnh1201/reasonableframework", "name": "gnh1201/reasonableframework",
"description": "Reasonable Framework is PHP framework for make solid and secure web development.", "description": "ReasonableFramework is RVHM structured PHP framework with common security",
"license": "LGPL-3.0", "license": "LGPL-3.0",
"authors": [ "authors": [
{ {
"name": "Go Namhyeon", "name": "Go Namhyeon",
"email": "gnh1201@gmail.com" "email": "abuse@catswords.net"
} }
], ],
"require": {} "require": {
"phpoffice/phpspreadsheet": "~1.8"
}
} }

View File

@ -17,87 +17,87 @@ Simplified BSD (aka FreeBSD) license. See LICENSE.
* @version 0.5.0 * @version 0.5.0
*/ */
class JSLoader { class JSLoader {
protected $cfg = array(); protected $cfg = array();
protected $scripts = array(); protected $scripts = array();
protected $output; protected $output;
public function __construct($cfg = array()) { public function __construct($cfg = array()) {
$this->cfg = array_merge($this->get_default_cfg() , $cfg); $this->cfg = array_merge($this->get_default_cfg() , $cfg);
} }
protected function get_default_cfg(){ protected function get_default_cfg(){
$default_cfg = array( $default_cfg = array(
'file_system_path' => "./", 'file_system_path' => "./",
'concat' => false, 'concat' => false,
'function_wrapper' => false, 'function_wrapper' => false,
'indent_string' => " ", 'indent_string' => " ",
// False for an external script or for concatenating output from multiple // False for an external script or for concatenating output from multiple
// instances. // instances.
'script_wrapper' => true, 'script_wrapper' => true,
'with_header' => true 'with_header' => true
); );
return $default_cfg; return $default_cfg;
} }
public function parse_scripts($scripts) { public function parse_scripts($scripts) {
$scripts = explode("\n", $scripts); $scripts = explode("\n", $scripts);
foreach($scripts as $script_i => & $script) { foreach($scripts as $script_i => & $script) {
if (!strlen($script = trim($script)) || $script[0] === "#") { if (!strlen($script = trim($script)) || $script[0] === "#") {
unset($scripts[$script_i]); unset($scripts[$script_i]);
} }
} }
return $scripts; return $scripts;
} }
public function set_scripts($scripts, $cfg = array()) { public function set_scripts($scripts, $cfg = array()) {
$default_cfg = array( $default_cfg = array(
'add' => false 'add' => false
); );
$cfg = array_merge($default_cfg, $cfg); $cfg = array_merge($default_cfg, $cfg);
if (!is_array($scripts)) { if (!is_array($scripts)) {
$scripts = $this->parse_scripts($scripts); $scripts = $this->parse_scripts($scripts);
} }
if (!$cfg['add']) { if (!$cfg['add']) {
$this->scripts = array(); $this->scripts = array();
} }
$this->scripts = array_merge($this->scripts, $scripts); $this->scripts = array_merge($this->scripts, $scripts);
} }
public function add_scripts($scripts) public function add_scripts($scripts)
{ {
$this->set_scripts($scripts, array( $this->set_scripts($scripts, array(
'add' => true 'add' => true
)); ));
} }
public function get_output() { public function get_output() {
$scripts = $this->scripts ? $this->scripts : array(); $scripts = $this->scripts ? $this->scripts : array();
if ($this->cfg['concat']) { if ($this->cfg['concat']) {
foreach($scripts as & $script) { foreach($scripts as & $script) {
$file = $script; $file = $script;
$file = rtrim($this->cfg['file_system_path'], "/") . "/{$file}"; $file = rtrim($this->cfg['file_system_path'], "/") . "/{$file}";
$script = file_get_contents($file); $script = file_get_contents($file);
} }
$scripts = join("\n\n", $scripts); $scripts = join("\n\n", $scripts);
if ($this->cfg['function_wrapper']) { if ($this->cfg['function_wrapper']) {
$scripts = explode("\n", $scripts); $scripts = explode("\n", $scripts);
foreach($scripts as & $line) { foreach($scripts as & $line) {
if ($line !== "") { if ($line !== "") {
$line = "{$this->cfg['indent_string']}{$line}"; $line = "{$this->cfg['indent_string']}{$line}";
} }
} }
$scripts = join("\n", $scripts); $scripts = join("\n", $scripts);
$scripts = <<<DOCHERE $scripts = <<<DOCHERE
( function () { ( function () {
{$scripts} {$scripts}
@ -105,35 +105,35 @@ class JSLoader {
} )(); } )();
DOCHERE; DOCHERE;
} }
// if // if
if ($this->cfg['script_wrapper']) { if ($this->cfg['script_wrapper']) {
$scripts = <<<DOCHERE $scripts = <<<DOCHERE
<script> <script>
{$scripts} {$scripts}
</script> </script>
DOCHERE; DOCHERE;
} elseif ($this->cfg['with_header']) { } elseif ($this->cfg['with_header']) {
header("Content-Type: text/javascript"); header("Content-Type: text/javascript");
} }
$scripts = array( $scripts = array(
$scripts $scripts
); );
} }
else { else {
foreach($scripts as & $script) { foreach($scripts as & $script) {
$script = <<<DOCHERE $script = <<<DOCHERE
<script src="{$script}"></script> <script src="{$script}"></script>
DOCHERE; DOCHERE;
} }
} }
$this->output = join("\n\n\n", $scripts); $this->output = join("\n\n\n", $scripts);
return $this->output; return $this->output;
} }
} }

86
helper/SSL.class.php Normal file
View File

@ -0,0 +1,86 @@
<?php
// https://stackoverflow.com/questions/3464113/is-it-possible-to-read-ssl-information-in-php-from-any-website
if(!class_exists("SSL")) {
class SSL {
public $domain, $validFrom, $validTo, $issuer, $validity, $validitytot, $crtValRemaining;
private static function instantiate($url, $info) {
$obj = new static;
$obj->domain = $url;
$obj->validFrom = $info['validFrom'];
$obj->validTo = $info['validTo'];
$obj->issuer = $info['issuer'];
$obj->validity = $info['validity'];
$obj->validitytot = $info['validitytot'];
$obj->crtValRemaining = $info['crtValRemaining'];
return $obj;
}
public static function getSSLinfo($url, $port=443) {
$ssl_info = [];
$certinfo = static::getCertificateDetails($url, $port);
$validFrom_time_t_m = static::dateFormatMonth($certinfo['validFrom_time_t']);
$validTo_time_t_m = static::dateFormatMonth($certinfo['validTo_time_t']);
$validFrom_time_t = static::dateFormat($certinfo['validFrom_time_t']);
$validTo_time_t = static::dateFormat($certinfo['validTo_time_t']);
$current_t = static::dateFormat(time());
$ssl_info['validFrom'] = $validFrom_time_t_m;
$ssl_info['validTo'] = $validTo_time_t_m;
$ssl_info['issuer'] = $certinfo['issuer']['O'];
$ssl_info['validity'] = static::diffDate($current_t, $validTo_time_t)." days";
$ssl_info['validitytot'] = (static::diffDate($validFrom_time_t, $validTo_time_t)-1).' days';
$ssl_info['crtValRemaining'] = $certinfo['validTo_time_t'];
return static::instantiate($url, $ssl_info); // return an object
}
private static function getCertificateDetails($url, $port=443) {
$urlStr = strtolower(trim($url));
$parsed = parse_url($urlStr);// add http://
if (empty($parsed['scheme'])) {
$urlStr = 'http://' . ltrim($urlStr, '/');
}
$orignal_parse = parse_url($urlStr, PHP_URL_HOST);
$get = stream_context_create(array("ssl" => array("capture_peer_cert" => TRUE)));
$read = stream_socket_client("ssl://".$orignal_parse.":".$port, $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $get);
$cert = stream_context_get_params($read);
$certinfo = openssl_x509_parse($cert['options']['ssl']['peer_certificate']);
return $certinfo;
}
private static function dateFormat($stamp) {
return strftime("%Y-%m-%d", $stamp);
}
private static function dateFormatMonth($stamp) {
return strftime("%Y-%b-%d", $stamp);
}
private static function diffDate($from, $to) {
$date1=date_create($from);
$date2=date_create($to);
$diff=date_diff($date1,$date2);
return ltrim($diff->format("%R%a"), "+");
}
}
}
/*
## Example
```
$certInfo = SSL::getSSLinfo('stackoverflow.com');
echo $certInfo->validFrom .'<br>';
echo $certInfo->validTo .'<br>';
echo $certInfo->issuer .'<br>';
echo $certInfo->validity .'<br>';
echo $certInfo->validitytot .'<br>';
echo $certInfo->crtValRemaining .'<br>';
```
*/

View File

@ -12,143 +12,146 @@
* @author Andrew Moore * @author Andrew Moore
* @link http://www.php.net/manual/en/function.uniqid.php#94959 * @link http://www.php.net/manual/en/function.uniqid.php#94959
*/ */
class UUID if(!class_exists("UUID"))
{ {
/** class UUID
* Generate v3 UUID {
* /**
* Version 3 UUIDs are named based. They require a namespace (another * Generate v3 UUID
* valid UUID) and a value (the name). Given the same namespace and *
* name, the output is always the same. * Version 3 UUIDs are named based. They require a namespace (another
* * valid UUID) and a value (the name). Given the same namespace and
* @param uuid $namespace * name, the output is always the same.
* @param string $name *
*/ * @param uuid $namespace
public static function v3($namespace, $name) * @param string $name
{ */
if(!self::is_valid($namespace)) return false; public static function v3($namespace, $name)
{
if(!self::is_valid($namespace)) return false;
// Get hexadecimal components of namespace // Get hexadecimal components of namespace
$nhex = str_replace(array('-','{','}'), '', $namespace); $nhex = str_replace(array('-','{','}'), '', $namespace);
// Binary Value // Binary Value
$nstr = ''; $nstr = '';
// Convert Namespace UUID to bits // Convert Namespace UUID to bits
for($i = 0; $i < strlen($nhex); $i+=2) for($i = 0; $i < strlen($nhex); $i+=2)
{ {
$nstr .= chr(hexdec($nhex[$i].$nhex[$i+1])); $nstr .= chr(hexdec($nhex[$i].$nhex[$i+1]));
} }
// Calculate hash value // Calculate hash value
$hash = md5($nstr . $name); $hash = md5($nstr . $name);
return sprintf('%08s-%04s-%04x-%04x-%12s', return sprintf('%08s-%04s-%04x-%04x-%12s',
// 32 bits for "time_low" // 32 bits for "time_low"
substr($hash, 0, 8), substr($hash, 0, 8),
// 16 bits for "time_mid" // 16 bits for "time_mid"
substr($hash, 8, 4), substr($hash, 8, 4),
// 16 bits for "time_hi_and_version", // 16 bits for "time_hi_and_version",
// four most significant bits holds version number 3 // four most significant bits holds version number 3
(hexdec(substr($hash, 12, 4)) & 0x0fff) | 0x3000, (hexdec(substr($hash, 12, 4)) & 0x0fff) | 0x3000,
// 16 bits, 8 bits for "clk_seq_hi_res", // 16 bits, 8 bits for "clk_seq_hi_res",
// 8 bits for "clk_seq_low", // 8 bits for "clk_seq_low",
// two most significant bits holds zero and one for variant DCE1.1 // two most significant bits holds zero and one for variant DCE1.1
(hexdec(substr($hash, 16, 4)) & 0x3fff) | 0x8000, (hexdec(substr($hash, 16, 4)) & 0x3fff) | 0x8000,
// 48 bits for "node" // 48 bits for "node"
substr($hash, 20, 12) substr($hash, 20, 12)
); );
} }
/** /**
* *
* Generate v4 UUID * Generate v4 UUID
* *
* Version 4 UUIDs are pseudo-random. * Version 4 UUIDs are pseudo-random.
*/ */
public static function v4() public static function v4()
{ {
return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
// 32 bits for "time_low" // 32 bits for "time_low"
mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff),
// 16 bits for "time_mid" // 16 bits for "time_mid"
mt_rand(0, 0xffff), mt_rand(0, 0xffff),
// 16 bits for "time_hi_and_version", // 16 bits for "time_hi_and_version",
// four most significant bits holds version number 4 // four most significant bits holds version number 4
mt_rand(0, 0x0fff) | 0x4000, mt_rand(0, 0x0fff) | 0x4000,
// 16 bits, 8 bits for "clk_seq_hi_res", // 16 bits, 8 bits for "clk_seq_hi_res",
// 8 bits for "clk_seq_low", // 8 bits for "clk_seq_low",
// two most significant bits holds zero and one for variant DCE1.1 // two most significant bits holds zero and one for variant DCE1.1
mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0x3fff) | 0x8000,
// 48 bits for "node" // 48 bits for "node"
mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff) mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
); );
} }
/** /**
* Generate v5 UUID * Generate v5 UUID
* *
* Version 5 UUIDs are named based. They require a namespace (another * Version 5 UUIDs are named based. They require a namespace (another
* valid UUID) and a value (the name). Given the same namespace and * valid UUID) and a value (the name). Given the same namespace and
* name, the output is always the same. * name, the output is always the same.
* *
* @param uuid $namespace * @param uuid $namespace
* @param string $name * @param string $name
*/ */
public static function v5($namespace, $name) public static function v5($namespace, $name)
{ {
if(!self::is_valid($namespace)) return false; if(!self::is_valid($namespace)) return false;
// Get hexadecimal components of namespace // Get hexadecimal components of namespace
$nhex = str_replace(array('-','{','}'), '', $namespace); $nhex = str_replace(array('-','{','}'), '', $namespace);
// Binary Value // Binary Value
$nstr = ''; $nstr = '';
// Convert Namespace UUID to bits // Convert Namespace UUID to bits
for($i = 0; $i < strlen($nhex); $i+=2) for($i = 0; $i < strlen($nhex); $i+=2)
{ {
$nstr .= chr(hexdec($nhex[$i].$nhex[$i+1])); $nstr .= chr(hexdec($nhex[$i].$nhex[$i+1]));
} }
// Calculate hash value // Calculate hash value
$hash = sha1($nstr . $name); $hash = sha1($nstr . $name);
return sprintf('%08s-%04s-%04x-%04x-%12s', return sprintf('%08s-%04s-%04x-%04x-%12s',
// 32 bits for "time_low" // 32 bits for "time_low"
substr($hash, 0, 8), substr($hash, 0, 8),
// 16 bits for "time_mid" // 16 bits for "time_mid"
substr($hash, 8, 4), substr($hash, 8, 4),
// 16 bits for "time_hi_and_version", // 16 bits for "time_hi_and_version",
// four most significant bits holds version number 5 // four most significant bits holds version number 5
(hexdec(substr($hash, 12, 4)) & 0x0fff) | 0x5000, (hexdec(substr($hash, 12, 4)) & 0x0fff) | 0x5000,
// 16 bits, 8 bits for "clk_seq_hi_res", // 16 bits, 8 bits for "clk_seq_hi_res",
// 8 bits for "clk_seq_low", // 8 bits for "clk_seq_low",
// two most significant bits holds zero and one for variant DCE1.1 // two most significant bits holds zero and one for variant DCE1.1
(hexdec(substr($hash, 16, 4)) & 0x3fff) | 0x8000, (hexdec(substr($hash, 16, 4)) & 0x3fff) | 0x8000,
// 48 bits for "node" // 48 bits for "node"
substr($hash, 20, 12) substr($hash, 20, 12)
); );
} }
public static function is_valid($uuid) { public static function is_valid($uuid)
return preg_match('/^\{?[0-9a-f]{8}\-?[0-9a-f]{4}\-?[0-9a-f]{4}\-?'. {
'[0-9a-f]{4}\-?[0-9a-f]{12}\}?$/i', $uuid) === 1; return preg_match('/^\{?[0-9a-f]{8}\-?[0-9a-f]{4}\-?[0-9a-f]{4}\-?'.
} '[0-9a-f]{4}\-?[0-9a-f]{12}\}?$/i', $uuid) === 1;
}
}
} }
?>

View File

@ -1,3 +0,0 @@
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);

32
helper/api.whois.kr.php Normal file
View File

@ -0,0 +1,32 @@
<?php
/**
* @file api.whois.kr.php
* @date 2019-05-26
* @author Go Namhyeon <abuse@catswords.net>
* @brief KISA Whois/Domain/IP/AS Query Helper (https://whois.kr)
*/
if(!is_fn("get_whois_kr")) {
function get_whois_kr($name, $key, $type="whois") {
$response = false;
switch($type) {
case "whois":
$response = get_web_json("http://whois.kisa.or.kr/openapi/whois.jsp", "get.cache", array(
"query" => $name,
"key" => $key,
"answer" => "json",
));
break;
case "ipascc":
$response = get_web_json("http://whois.kisa.or.kr/openapi/ipascc.jsp", "get.cache", array(
"query" => $name,
"key" => $key,
"answer" => "json",
));
break;
}
}
return $response;
}

View File

@ -1,3 +0,0 @@
<?php
// archivetool.php
// todo

View File

@ -0,0 +1,58 @@
<?php
/**
* @file catsplit.format.php
* @date 2019-05-28
* @author Go Namhyeon <abuse@catswords.net>
* @brief Catsplit format encoder
* @documentation https://github.com/gnh1201/catsplit-format
*/
if(!is_fn("catsplit_unescape")) {
function catsplit_unescape($data) {
return trim($data);
}
}
if(!is_fn("casplit_escape")) {
function casplit_escape($data) {
return htmlspecialchars($data);
}
}
if(!is_fn("catsplit_encode")) {
function catsplit_encode($data) {
$_ks = array();
$_vs = array();
foreach($data as $k=>$v) {
$_ks[] = $k;
$_vs[] = make_safe_argument($v);
}
$_ks = array_map("casplit_escape", $_ks);
$_vs = array_map("casplit_escape", $_vs);
return sprintf("('%s')<=(%s)", implode("','", $_vs), implode(",", $_ks));
}
}
if(!is_fn("catsplit_decode")) {
function catsplit_decode($data) {
$s_final = array();
// step 1
$s1 = explode(")<=(", substr($data, 1, -1));
// step 2
$s2a = array_map("catsplit_unescape", explode(",", $s1[0]));
$s2b = array_map("catsplit_unescape", explode(",", $s1[1]));
// step 3
$s3 = array_combine($s2b, $s2a);
// step 4
foreach($s3 as $k=>$v) {
$s_final[$k] = substr(stripslashes($v), 1, -1);
}
return $s_final;
}
}

View File

@ -0,0 +1,38 @@
<?php
// Go Namhyeon <abuse@catswords.net>
// 2019-09-25
if(!is_fn("decode_colona_format")) {
function decode_colona_format($data) {
$lines = explode_by_line(remove_utf8_bom($data));
$jobargs = array();
$eof = false;
$delimiter = ":";
$jobkey = "";
$jobvalue = "";
foreach($lines as $line) {
$pos = strpos($line, $delimiter);
if($eof) {
if($line == "EOF;") {
$jobargs[$jobkey] = $jobvalue;
$eof = false;
} else {
$jobvalue .= $line;
}
} elseif($pos !== false) {
$jobkey = rtrim(substr($line, 0, $pos));
$jobvalue = ltrim(substr($line, $pos + strlen($delimiter)));
if($jobvalue == "<<<EOF") {
$jobvalue = "";
$eof = true;
} else {
$jobargs[$jobkey] = $jobvalue;
}
}
}
return $jobargs;
}
}

31
helper/compress.zip.php Normal file
View File

@ -0,0 +1,31 @@
<?php
// @date 2019-10-13
// @author Go Namhyeon <abuse@catswords.net>
if(!is_fn("unzip")) {
function unzip($src, $dst, $options=array()) {
$flag = false;
$method = get_value_in_array("method", $options, "ZipArchive");
switch($method) {
case "ZipArchive":
$handle = new ZipArchive;
$res = $handle->open($src);
if ($res === TRUE) {
$zip->extractTo($dst);
$zip->close();
$flag = true;
}
break;
case "unzip":
if(loadHelper("exectool")) {
exec_command(sprintf("unzip -d '%s' '%s'", make_safe_argument($src), make_safe_argument($dst)));
$flag = true;
}
break;
}
return $flag;
}
}

51
helper/country.kr.php Normal file
View File

@ -0,0 +1,51 @@
<?php
/**
* @file country.kr.php
* @date 2018-04-15
* @author Go Namhyeon <abuse@catswords.net>
* @brief Country Helper (Korean)
*/
// parse telephone number
if(!is_fn("get_kr_parsed_tel_number")) {
function get_kr_parsed_tel_number($tel) {
$output = preg_replace("/[^0-9]/", "", $tel); // 숫자 이외 제거
$local_code = substr($tel, 0, 2);
if ($local_code == '02') {
$output = preg_replace("/([0-9]{2})([0-9]{3,4})([0-9]{4})$/", "\\1-\\2-\\3", $tel);
} elseif (strlen($tel) == '8' && in_array($local_code, array('15', '16', '18'))) {
$output = preg_replace("/([0-9]{4})([0-9]{4})$/", "\\1-\\2", $tel); // 지능망 번호이면
} else {
$output = preg_replace("/([0-9]{3})([0-9]{3,4})([0-9]{4})$/", "\\1-\\2-\\3", $tel);
}
return $output;
}
}
if(!is_fn("get_kr_get_lastname")) {
function get_kr_get_lastname()
if(loadHelper("string.utils")) {
$words = read_storage_file_by_line("kr.lastname.txt", array(
"storage_type" => "country",
)));
return $words[get_random_index($words)];
}
}
}
if(!is_fn("get_kr_get_firstname")) {
function get_kr_get_firstname() {
if(loadHelper("string.utils")) {
$words = read_storage_file_by_line("kr.firstname.txt", array(
"storage_type" => "country",
)));
return $words[get_random_index($words)];
}
}
}
if(!is_fn("get_kr_get_generated_name")) {
function get_kr_get_generated_name() {
return sprintf("%s%s", get_kr_get_lastname(), get_kr_get_firstname());
}
}

41
helper/coupang.api.php Normal file
View File

@ -0,0 +1,41 @@
<?php
// Coupang Products Search API
// https://coupa.ng/bZ3Kba
// https://developers.coupangcorp.com/hc/ko/articles/360033461914-HMAC-Signature-%EC%83%9D%EC%84%B1
loadHelper("webpagetool");
if(!is_fn("coupang_get_signature")) {
function coupang_get_signature($method, $path, $query, $ACCESS_KEY, $SECRET_KEY) {
$datetime = date("ymd") . 'T' . date("His") . 'Z';
$message = $datetime . strtoupper($method) . str_replace("?", "", $path) . http_build_query($query);
$algorithm = "HmacSHA256";
$signature = hmacsha256_sign_message($message, $SECRET_KEY);
return "CEA algorithm=HmacSHA256, access-key=" . $ACCESS_KEY . ", signed-date=" . $datetime . ", signature=" . $signature;
}
}
if(!is_fn("coupang_search_items")) {
function coupang_search_items($keyword, $ACCESS_KEY, $SECRET_KEY) {
$URL_PARTS = array("https://api-gateway.coupang.com", "/v2/providers/affiliate_open_api/apis/openapi/v1", "/products/search");
$BASE_URL = $URL_PARTS[0] . $URL_PARTS[1];
$method = "get";
$path = $URL_PARTS[1] . $URL_PARTS[2];
$query = array(
"keyword" => $keyword,
"limit" => 20, // default is 20
//"subId" => "" // default is null
);
$response = get_web_page($BASE_URL . $URL_PARTS[2], $method, array(
"headers" => array(
"Authorization" => coupang_get_signature($method, $path, $query, $ACCESS_KEY, $SECRET_KEY)
),
"data" => $query
));
var_dump($response);
}
}

View File

@ -2,160 +2,132 @@
/** /**
* @file database.alt.php * @file database.alt.php
* @date 2018-09-10 * @date 2018-09-10
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief Database alternative driver switcher * @brief Database alternative driver switcher
*/ */
if(!function_exists("exec_db_alt_callback")) { if(!is_fn("exec_db_alt_callback")) {
function exec_db_alt_callback($rules, $params=array()) { function exec_db_alt_callback($rules, $params=array(), $driver="") {
$result = false; $result = false;
$db_driver = empty($driver) ? get_db_driver() : $driver;
foreach($rules as $rule) { foreach($rules as $rule) {
if($rule['driver'] == $driver) { if($rule['driver'] == $db_driver) {
if(loadHelper(sprintf("database.%s", $rule['driver']))) { if(loadHelper(sprintf("database.%s", $rule['driver']))) {
if(function_exists($rule['callback'])) { if(is_fn($rule['callback'])) {
if(is_array($params) && count($params) > 0) { if(is_array($params) && count($params) > 0) {
$result = call_user_func_array($rule['callback'], $params); $result = call_user_func_array($rule['callback'], $params);
} else { } else {
$result = call_user_func($rule['callback']); $result = call_user_func($rule['callback']);
} }
} }
} else { } else {
set_error(sprintf("Can not load %s database driver.", $rule['driver'])); set_error(sprintf("Can not load %s database driver.", $rule['driver']));
show_errors(); show_errors();
} }
break; break;
} }
} }
return $result; return $result;
} }
} }
if(!function_exists("get_db_alt_connect")) { if(!is_fn("get_db_alt_connect")) {
function get_db_alt_connect($driver) { function get_db_alt_connect($driver) {
$conn = false; $conn = false;
$config = get_config(); $config = get_config();
$rules = array( $rules = array(
array( array("driver" => "mysql.pdo", "callback" => "get_db_mysql_pdo_connect"),
"driver" => "mysql.pdo", array("driver" => "mysql.imp", "callback" => "get_db_mysql_imp_connect"),
"callback" => "get_db_mysql_pdo_connect" array("driver" => "mysql.old", "callback" => "get_db_mysql_old_connect"),
), array("driver" => "mysql.cmd", "callback" => "get_db_mysql_cmd_connect"),
array( array("driver" => "oracle", "callback" => "get_db_oracle_connect"),
"driver" => "mysql.imp", array("driver" => "pgsql", "callback" => "get_db_pgsql_connect"),
"callback" => "get_db_mysql_imp_connect" array("driver" => "mssql.pdo", "callback" => "get_db_mssql_pdo_connect"),
), );
array(
"driver" => "mysql.old",
"callback" => "get_db_mysql_old_connect"
),
array(
"driver" => "oracle",
"callback" => "get_db_oracle_connect"
),
array(
"driver" => "pgsql",
"callback" => "get_db_pgsql_connect"
)
);
$conn = exec_db_alt_callback($rules); $conn = exec_db_alt_callback($rules, array(), $driver);
return $conn; return $conn;
} }
} }
if(!function_exists("exec_db_alt_query")) { if(!is_fn("exec_db_alt_query")) {
function exec_db_alt_query($sql, $bind=array(), $driver="") { function exec_db_alt_query($sql, $bind=array(), $options=array()) {
$result = false; $result = false;
$rules = array( // allow custom db connection object
array( if(array_key_empty("dbc", $options)) {
"driver" => "mysql.pdo", if(!array_key_empty("driver", $options)) {
"callback" => "exec_db_mysql_pdo_query" $options['dbc'] = get_db_alt_connect($options['driver']);
), } else {
array( $options['dbc'] = get_dbc_object();
"driver" => "mysql.imp", }
"callback" => "exec_db_mysql_imp_query" }
),
array(
"driver" => "mysql.old",
"callback" => "exec_db_mysql_old_query"
),
array(
"driver" => "oracle",
"callback" => "exec_db_oracle_query"
),
array(
"driver" => "pgsql",
"callback" => "exec_db_pgsql_query"
)
);
$result = exec_db_alt_callback($rules, array($sql, $bind)); $rules = array(
array("driver" => "mysql.pdo", "callback" => "exec_db_mysql_pdo_query"),
array("driver" => "mysql.imp", "callback" => "exec_db_mysql_imp_query"),
array("driver" => "mysql.old", "callback" => "exec_db_mysql_old_query"),
array("driver" => "mysql.cmd", "callback" => "exec_db_mysql_cmd_query"),
array("driver" => "oracle", "callback" => "exec_db_oracle_query"),
array("driver" => "pgsql", "callback" => "exec_db_pgsql_query"),
array("driver" => "mssql.pdo", "callback" => "exec_db_mssql_pdo_query"),
);
return $result; $result = exec_db_alt_callback($rules, array($sql, $bind, $options), $driver);
}
return $result;
}
} }
if(!function_exists("exec_db_alt_fetch_all")) { if(!is_fn("exec_db_alt_fetch_all")) {
function exec_db_alt_fetch_all($sql, $bind=array()) { function exec_db_alt_fetch_all($sql, $bind=array(), $options=array()) {
$rows = array(); $rows = array();
$rules = array( $driver = get_value_in_array("driver", $options, "");
array( $rules = array(
"driver" => "mysql.pdo", array("driver" => "mysql.pdo", "callback" => "exec_db_mysql_pdo_fetch_all"),
"callback" => "exec_db_mysql_pdo_fetch_all" array("driver" => "mysql.imp", "callback" => "exec_db_mysql_imp_fetch_all"),
), array("driver" => "mysql.old", "callback" => "exec_db_mysql_old_fetch_all"),
array( array("driver" => "mysql.cmd", "callback" => "exec_db_mysql_cmd_fetch_all"),
"driver" => "mysql.imp", array("driver" => "oracle", "callback" => "exec_db_oracle_fetch_all"),
"callback" => "exec_db_mysql_imp_fetch_all" array("driver" => "pgsql", "callback" => "exec_db_pgsql_fetch_all"),
), array("driver" => "mssql.pdo", "callback" => "exec_db_mssql_fetch_all"),
array( );
"driver" => "mysql.old",
"callback" => "exec_db_mysql_old_fetch_all"
),
array(
"driver" => "oracle",
"callback" => "exec_db_oracle_fetch_all"
),
array(
"driver" => "pgsql",
"callback" => "exec_db_pgsql_fetch_all"
)
);
$rows = exec_db_alt_callback($rules, array($sql, $bind)); $rows = exec_db_alt_callback($rules, array($sql, $bind, $options), $driver);
return $rows; return $rows;
} }
} }
if(!function_exists("exec_db_alt_fetch")) { if(!is_fn("exec_db_alt_fetch")) {
function exec_db_alt_fetch($sql, $bind) { function exec_db_alt_fetch($sql, $bind) {
$fetched = false; $fetched = false;
$rows = exec_db_alt_fetch_all($sql, $bind); $rows = exec_db_alt_fetch_all($sql, $bind);
foreach($rows as $row) { foreach($rows as $row) {
$fetched = $row; $fetched = $row;
break; break;
} }
return $fetched; return $fetched;
} }
} }
if(!function_exists("get_db_alt_last_id")) { if(!is_fn("get_db_alt_last_id")) {
function get_db_alt_last_id($driver) { function get_db_alt_last_id($driver) {
$last_id = false; $last_id = false;
if($driver == "mysql.imp") { if($driver == "mysql.imp") {
$last_id = @mysqli_insert_id(); $last_id = @mysqli_insert_id();
} elseif($driver == "mysql.old") { } elseif($driver == "mysql.old") {
$last_id = @mysql_insert_id(); $last_id = @mysql_insert_id();
} }
return $last_id; return $last_id;
} }
} }

View File

@ -0,0 +1,56 @@
<?php
// database.mssql.pdo.php
if(!is_fn("get_db_mssql_pdo_connect")) {
function get_db_mssql_pdo_connect() {
$conn = false;
$config = get_config();
try {
$conn = new PDO(
sprintf(
"dblib:host=%s;dbname=%s",
$config['db_mssql_host'],
$config['db_mssql_name']
),
$config['db_mssql_username'],
$config['db_mssql_password']
);
$conn->exec("SET CHARACTER SET utf8");
$conn->query("SET ANSI_NULLS ON");
$conn->query("SET ANSI_WARNINGS ON");
} catch(PDOException $e) {
set_error($e->getMessage());
show_errors();
}
return $conn;
}
}
if(!is_fn("exec_db_mssql_pdo_query")) {
function exec_db_mssql_pdo_query($sql, $bind=array(), $options=array()) {
$dbc = get_value_in_array("dbc", $options, get_dbc_object());
if($dbc !== false) {
$binded_sql = get_db_binded_sql($sql, $bind);
$sth = $dbc->prepare($binded_sql);
$sth->execute();
}
return $sth;
}
}
if(!is_fn("exec_db_mssql_pdo_fetch_all")) {
function exec_db_mssql_pdo_fetch_all($sql, $bind=array(), $options=array()) {
$rows = array();
$sth = exec_db_mssql_pdo_query($sql, $bind, $options);
$sth->setFetchMode(PDO::FETCH_ASSOC);
$rows = $sth->fetchAll();
return $rows;
}
}

View File

@ -0,0 +1,78 @@
<?php
/**
* @file database.mysql.cmd.php
* @date 2019-04-06
* @auther Go Namhyeon <abuse@catswords.net>
* @brief MySQL(MariaDB) command line driver
*/
if(!is_fn("get_db_mysql_cmd_connect")) {
function get_db_mysql_cmd_connect() {
$result = false;
$config = get_config();
if(loadHelper("exectool")) {
$args = array("mysql");
$args[] = sprintf("-u'%s'", $config['db_username']);
$args[] = sprintf("-p'%s'", $config['db_password']);
$args[] = sprintf("-h'%s'", $config['db_host']);
$args[] = "-s"; // --slient
$args[] = "-N"; // --skip-column-names
$args[] = "-e'select 1'";
$cmd = implode(" ", $args);
$result = exec_command($cmd);
}
return $result;
}
}
if(!is_fn("exec_db_mysql_cmd_query")) {
function exec_db_mysql_cmd_query($sql, $bind) {
$result = false;
$config = get_config();
$sql = get_db_binded_sql($sql, $bind);
if(loadHelper("exectool")) {
$args = array("mysql");
$args[] = sprintf("-u'%s'", $config['db_username']);
$args[] = sprintf("-p'%s'", $config['db_password']);
$args[] = sprintf("-h'%s'", $config['db_host']);
$args[] = "-s"; // --slient
$args[] = sprintf("-D'%s'", $config['db_name']);
$args[] = sprintf("-e'%s'", make_safe_argument($sql));
$cmd = implode(" ", $args);
$result = exec_command($cmd);
}
return $result;
}
}
if(!is_fn("exec_db_mysql_cmd_fetch_all")) {
function exec_db_mysql_cmd_fetch_all($sql, $bind) {
$result = false;
$tsvData = exec_db_mysql_cmd_query($sql, $bind);
$lines = explode(DOC_EOL, $tsvData);
$rows = array();
if(is_fn("str_getcsv")) {
foreach($lines as $line) {
$rows[] = str_getcsv($line, "\t");
}
} else {
foreach($lines as $line) {
$rows[] = explode("\t", $line);
}
}
if(count($rows) > 0) {
$result = $rows;
}
return $result;
}
}

View File

@ -2,55 +2,55 @@
/** /**
* @file database.mysql.imp.php * @file database.mysql.imp.php
* @date 2018-09-10 * @date 2018-09-10
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief MySQLi database helper * @brief MySQLi database helper
*/ */
if(!function_exists("get_db_mysql_imp_connect")) { if(!is_fn("get_db_mysql_imp_connect")) {
function get_db_mysql_imp_connect() { function get_db_mysql_imp_connect() {
$conn = false; $conn = false;
$config = get_config(); $config = get_config();
$conn = @mysqli_connect($config['db_host'], $config['db_username'], $config['db_password'], $config['db_name']); $conn = @mysqli_connect($config['db_host'], $config['db_username'], $config['db_password'], $config['db_name']);
$errno = @mysqli_connect_errno(); $errno = @mysqli_connect_errno();
if($errno) { if($errno) {
set_error(sprintf("Failed to connect to MySQL: %s", $errno)); set_error(sprintf("Failed to connect to MySQL: %s", $errno));
show_errors(); show_errors();
} }
return $conn; return $conn;
} }
} }
if(!function_exists("exec_db_mysql_imp_query")) { if(!is_fn("exec_db_mysql_imp_query")) {
function exec_db_mysql_imp_query($sql, $bind) { function exec_db_mysql_imp_query($sql, $bind) {
$result = false; $result = false;
$dbc = get_dbc_object(); $dbc = get_dbc_object();
$binded_sql = get_db_binded_sql($sql, $bind); $binded_sql = get_db_binded_sql($sql, $bind);
$result = @mysqli_query($dbc, $binded_sql); $result = @mysqli_query($dbc, $binded_sql);
return $result; return $result;
} }
} }
if(!function_exists("exec_db_mysql_imp_fetch_all")) { if(!is_fn("exec_db_mysql_imp_fetch_all")) {
function exec_db_mysql_imp_fetch_all($sql, $bind) { function exec_db_mysql_imp_fetch_all($sql, $bind) {
$rows = array(); $rows = array();
$result = exec_db_mysql_imp_query($sql, $bind); $result = exec_db_mysql_imp_query($sql, $bind);
while($row = mysqli_fetch_array($result)) { while($row = mysqli_fetch_array($result)) {
$rows[] = $row; $rows[] = $row;
} }
return $rows; return $rows;
} }
} }
if(!function_exists("close_db_mysql_imp_connect")) { if(!is_fn("close_db_mysql_imp_connect")) {
function close_db_mysql_imp_connect() { function close_db_mysql_imp_connect() {
$dbc = get_scope("dbc"); $dbc = get_shared_var("dbc");
return mysqli_close($dbc); return mysqli_close($dbc);
} }
} }

View File

@ -2,58 +2,58 @@
/** /**
* @file database.mysql.old.php * @file database.mysql.old.php
* @date 2018-09-14 * @date 2018-09-14
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief MySQL-old (lower than 5.4) database helper * @brief MySQL-old (lower than 5.4) database helper
*/ */
if(!function_exists("get_db_mysql_old_connect")) { if(!is_fn("get_db_mysql_old_connect")) {
function get_db_mysql_old_connect() { function get_db_mysql_old_connect() {
$conn = false; $conn = false;
$config = get_config(); $config = get_config();
$conn = @mysql_connect($config['db_host'], $config['db_username'], $config['db_password']); $conn = @mysql_connect($config['db_host'], $config['db_username'], $config['db_password']);
if(!$conn) { if(!$conn) {
set_error("Could not connect: " . @mysql_error()); set_error("Could not connect: " . @mysql_error());
show_errors(); show_errors();
} }
if(!@mysql_select_db('database_name', $conn)) { if(!@mysql_select_db($config['db_name'], $conn)) {
set_error("Could not select database."); set_error("Could not select database.");
show_errors(); show_errors();
} }
return $conn; return $conn;
} }
} }
if(!function_exists("exec_db_mysql_old_query")) { if(!is_fn("exec_db_mysql_old_query")) {
function exec_db_mysql_old_query($sql, $bind) { function exec_db_mysql_old_query($sql, $bind) {
$result = false; $result = false;
$dbc = get_dbc_object(); $dbc = get_dbc_object();
$binded_sql = get_db_binded_sql($sql, $bind); $binded_sql = get_db_binded_sql($sql, $bind);
$result = @mysql_query($dbc, $binded_sql); $result = @mysql_query($dbc, $binded_sql);
return $result; return $result;
} }
} }
if(!function_exists("exec_db_mysql_old_fetch_all")) { if(!is_fn("exec_db_mysql_old_fetch_all")) {
function exec_db_mysql_old_fetch_all($sql, $bind) { function exec_db_mysql_old_fetch_all($sql, $bind) {
$rows = array(); $rows = array();
$result = exec_db_mysql_old_query($sql, $bind); $result = exec_db_mysql_old_query($sql, $bind);
while($row = @mysql_fetch_array($result)) { while($row = @mysql_fetch_array($result)) {
$rows[] = $row; $rows[] = $row;
} }
return $rows; return $rows;
} }
} }
if(!function_exists("close_db_mysql_old_connect")) { if(!is_fn("close_db_mysql_old_connect")) {
function close_db_mysql_old_connect() { function close_db_mysql_old_connect() {
$dbc = get_scope("dbc"); $dbc = get_shared_var("dbc");
return mysql_close($dbc); return mysql_close($dbc);
} }
} }

View File

@ -2,111 +2,140 @@
/** /**
* @file oracle.php * @file oracle.php
* @date 2018-03-27 * @date 2018-03-27
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief Oracle database helper for ReasonableFramework * @brief Oracle database helper for ReasonableFramework
*/ */
if(!function_exists("get_db_orable_binded_sql")) { if(!is_fn("check_db_oracle_installed")) {
function get_db_orable_binded_sql($sql, $bind) { function check_db_oracle_installed() {
return get_db_binded_sql($sql, $bind); $fn = check_invalid_function(array(
} "NO_FUNCTION_OCI_PARSE" => "oci_parse",
"NO_FUNCTION_OCI_EXECUTE" => "oci_execute",
"NO_FUNCTION_OCI_FETCH_ASSOC" => "oci_fetch_assoc",
"NO_FUNCTION_OCI_FREE_STATEMENT" => "oci_free_statement",
"NO_FUNCTION_OCI_CLOSE" => "oci_close",
));
$is_installed = ($fn == -1);
if(!$is_installed) {
set_error($fn);
}
return $is_installed;
}
} }
if(!function_exists("get_db_oracle_stmt")) { if(!is_fn("get_db_orable_binded_sql")) {
function get_db_oracle_stmt($sql, $bind) { function get_db_orable_binded_sql($sql, $bind) {
$stmt = NULL; return get_db_binded_sql($sql, $bind);
}
$sql = get_db_orable_binded_sql($sql, $bind);
$stmt = oci_parse($conn, $sql);
return $stmt;
}
} }
if(!function_exists("exec_db_oracle_connect")) { if(!is_fn("get_db_oracle_stmt")) {
function exec_db_oracle_connect($host, $port, $user, $password, $options=array()) { function get_db_oracle_stmt($sql, $bind) {
$conn = NULL; $stmt = NULL;
$envs = get_value_in_array("envs", $options, array());
if(!function_exists("oci_connect")) { if(!check_db_oracle_installed()) {
exit("OCI (Oracle Extension for PHP) not installed!"); show_errors();
} }
if(array_key_empty("NLS_LANG", $envs)) { $sql = get_db_orable_binded_sql($sql, $bind);
$envs["NLS_LANG"] = "KOREAN_KOREA.AL32UTF8"; $stmt = oci_parse($conn, $sql);
}
// set environment variables return $stmt;
foreach($envs as $env) { }
putenv($env);
}
// get oracle db connection info
$dbs_id = read_storage_file("tnsname.orax", array(
"storage_type" => "config"
));
// set replace rules
$dbs_rules = array(
"protocol" => get_value_in_array("service_name", $options, "TCP"),
"service_name" => get_value_in_array("service_name", $options, "ORCL"),
"host" => $host,
"port" => $port,
"server_type" => "DEDICATED"
);
// parse db connection info
foreach($dbs_rules as $k=>$v) {
$dbs_id = str_replace("%" . $k . "%", $v, $dbs_id);
}
// set db connection
$conn = @oci_connect($user, $password, $dbs_id);
return $conn;
}
} }
if(!function_exists("exec_db_oracle_fetch_all")) { if(!is_fn("exec_db_oracle_connect")) {
function exec_db_oracle_fetch_all($sql, $bind, $conn) { function exec_db_oracle_connect($host, $port, $user, $password, $options=array()) {
$rows = array(); $conn = NULL;
$envs = get_value_in_array("envs", $options, array());
$required_functions = array("oci_parse", "oci_execute", "oci_fetch_assoc", "oci_free_statement"); if(!check_db_oracle_installed()) {
foreach($required_functions as $func_name) { show_errors();
if(!function_exists($func_name)) { }
exit("OCI (Oracle Extension for PHP) not installed!");
}
}
$stmt = get_db_oracle_stmt($sql, $bind); if(array_key_empty("NLS_LANG", $envs)) {
oci_execute($stmt); $envs["NLS_LANG"] = "KOREAN_KOREA.AL32UTF8";
}
while($row = oci_fetch_assoc($stmt)) { // set environment variables
$rows[] = $row; foreach($envs as $env) {
} putenv($env);
}
oci_free_statement($stmt); // get oracle db connection info
$dbs_id = read_storage_file("tnsname.orax", array(
"storage_type" => "example",
));
return $rows; // set replace rules
} $dbs_rules = array(
"protocol" => get_value_in_array("service_name", $options, "TCP"),
"service_name" => get_value_in_array("service_name", $options, "ORCL"),
"host" => $host,
"port" => $port,
"server_type" => "DEDICATED"
);
// parse db connection info
foreach($dbs_rules as $k=>$v) {
$dbs_id = str_replace("%" . $k . "%", $v, $dbs_id);
}
// set db connection
$conn = @oci_connect($user, $password, $dbs_id);
return $conn;
}
} }
if(!function_exists("exec_db_oracle_query")) { if(!is_fn("exec_db_oracle_fetch_all")) {
function exec_db_oracle_query($sql, $bind, $conn) { function exec_db_oracle_fetch_all($sql, $bind, $conn) {
$flag = false; $rows = array();
$stmt = get_db_oracle_stmt($sql, $bind); if(!check_db_oracle_installed()) {
$flag = oci_execute($stmt); show_errors();
}
oci_free_statement($stmt); $stmt = get_db_oracle_stmt($sql, $bind);
oci_execute($stmt);
return $flag; while($row = oci_fetch_assoc($stmt)) {
} $rows[] = $row;
}
oci_free_statement($stmt);
return $rows;
}
} }
if(!function_exists("close_db_oracle_connect")) { if(!is_fn("exec_db_oracle_query")) {
function close_db_oracle_connect() { function exec_db_oracle_query($sql, $bind, $conn) {
$dbc = get_scope("dbc"); $flag = false;
return oci_close($dbc);
} if(!check_db_oracle_installed()) {
show_errors();
}
$stmt = get_db_oracle_stmt($sql, $bind);
$flag = oci_execute($stmt);
oci_free_statement($stmt);
return $flag;
}
}
if(!is_fn("close_db_oracle_connect")) {
function close_db_oracle_connect() {
$dbc = get_shared_var("dbc");
if(!check_db_oracle_installed()) {
show_errors();
}
return @oci_close($dbc);
}
} }

View File

@ -1,8 +1,9 @@
<?php <?php
/** /**
* @file exectool.php * @file exectool.php
* @date 2018-07-22 * @created_on 2018-07-22
* @auther Go Namhyeon <gnh1201@gmail.com> * @updated_on 2020-07-10
* @author Go Namhyeon <abuse@catswords.net>
* @forked from https://github.com/scipag/PHPUtilities * @forked from https://github.com/scipag/PHPUtilities
* @brief ExecTool helper * @brief ExecTool helper
*/ */
@ -13,7 +14,7 @@
* in the webserver configuration. The function execTests returns an array, which * in the webserver configuration. The function execTests returns an array, which
* contains names of all successful tested PHP functions. * contains names of all successful tested PHP functions.
*/ */
if(!function_exists("exec_test")) { if(!is_fn("exec_test")) {
function exec_test() { function exec_test() {
$cmd = "whoami"; $cmd = "whoami";
$cmdPath = "/usr/bin/whoami"; $cmdPath = "/usr/bin/whoami";
@ -103,7 +104,7 @@ if(!function_exists("exec_test")) {
/* /*
* exec_command() executes a command (like "whoami") with the submited method * exec_command() executes a command (like "whoami") with the submited method
*/ */
if(!function_exists("exec_command")) { if(!is_fn("exec_command")) {
function exec_command($command, $method="shell_exec", $options=array()) { function exec_command($command, $method="shell_exec", $options=array()) {
$return = false; $return = false;
@ -133,7 +134,12 @@ if(!function_exists("exec_command")) {
return $return; return $return;
} }
if ($method == "") { // An 'async' option will be return PID
if(array_key_equals("async", $options, true)) {
$command = sprintf("%s 1>/dev/null 2>&1 & echo $!;", $command);
}
if (empty($method)) {
// ob_start() will turn on output buffering to collect all output from // ob_start() will turn on output buffering to collect all output from
// exec_test() and ob_end_clean() will clean the buffer afterwards ("garbage collection") // exec_test() and ob_end_clean() will clean the buffer afterwards ("garbage collection")
ob_start(); ob_start();
@ -157,7 +163,6 @@ if(!function_exists("exec_command")) {
case "exec": case "exec":
exec($command, $output); exec($command, $output);
var_dump($output);
break; break;
case "shell_exec": case "shell_exec":
@ -201,6 +206,11 @@ if(!function_exists("exec_command")) {
$return = ob_get_clean(); $return = ob_get_clean();
// PID is integer
if(array_key_equals("async", $options, true)) {
$return = intval(rtrim($return));
}
return $return; return $return;
} }
} }

View File

@ -2,297 +2,297 @@
/** /**
* @file gnuboard.php * @file gnuboard.php
* @date 2018-05-27 * @date 2018-05-27
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief Database Helper for Gnuboard 4, Gnuboard 5 * @brief Database Helper for Gnuboard 4, Gnuboard 5
*/ */
// get database prefix // get database prefix
if(!function_exists("gnb_get_db_prefix")) { if(!is_fn("gnb_get_db_prefix")) {
function gnb_get_db_prefix($version=4) { function gnb_get_db_prefix($version=4) {
return ($version > 4) ? "g5_" : "g4_"; return ($version > 4) ? "g5_" : "g4_";
} }
} }
// get table // get table
if(!function_exists("gnb_get_db_table")) { if(!is_fn("gnb_get_db_table")) {
function gnb_get_db_table($tablename) { function gnb_get_db_table($tablename) {
return (gnb_get_db_prefix() . $tablename); return (gnb_get_db_prefix() . $tablename);
} }
} }
// get write table // get write table
if(!function_exists("gnb_get_write_table")) { if(!is_fn("gnb_get_write_table")) {
function gnb_get_write_table($tablename, $version=4) { function gnb_get_write_table($tablename, $version=4) {
$write_prefix = gnb_get_db_prefix() . "write_"; $write_prefix = gnb_get_db_prefix() . "write_";
$write_table = $write_prefix . $tablename; $write_table = $write_prefix . $tablename;
return $write_table; return $write_table;
} }
} }
// get write next // get write next
if(!function_exists("gnb_get_write_next")) { if(!is_fn("gnb_get_write_next")) {
function gnb_get_write_next($tablename) { function gnb_get_write_next($tablename) {
$row = exec_db_fetch("select min(wr_num) as min_wr_num from " . gnb_get_write_table($tablename)); $row = exec_db_fetch("select min(wr_num) as min_wr_num from " . gnb_get_write_table($tablename));
return (intval(get_value_in_array("min_wr_num", $row, 0)) - 1); return (intval(get_value_in_array("min_wr_num", $row, 0)) - 1);
} }
} }
// write post // write post
if(!function_exists("gnb_write_post")) { if(!is_fn("gnb_write_post")) {
function gnb_write_post($tablename, $data=array(), $version=4) { function gnb_write_post($tablename, $data=array(), $version=4) {
$result = 0; $result = 0;
$write_table = gnb_get_write_table($tablename); $write_table = gnb_get_write_table($tablename);
$mb_id = get_current_user_name(); $mb_id = get_current_user_name();
// load helpers // load helpers
loadHelper("networktool"); loadHelper("networktool");
loadHelper("naturename.kr"); loadHelper("naturename.kr");
$write_fields = array(); $write_fields = array();
$write_default_fields = array( $write_default_fields = array(
"mb_id" => $mb_id, "mb_id" => $mb_id,
"wr_num" => gnb_get_write_next($tablename), "wr_num" => gnb_get_write_next($tablename),
"wr_reply" => "", "wr_reply" => "",
"wr_parent" => "", "wr_parent" => "",
"wr_comment_reply" => "", "wr_comment_reply" => "",
"ca_name" => "", "ca_name" => "",
"wr_option" => "", "wr_option" => "",
"wr_subject" => make_random_id(), "wr_subject" => make_random_id(),
"wr_content" => make_random_id(), "wr_content" => make_random_id(),
"wr_link1" => "", "wr_link1" => "",
"wr_link2" => "", "wr_link2" => "",
"wr_link1_hit" => 0, "wr_link1_hit" => 0,
"wr_link2_hit" => 0, "wr_link2_hit" => 0,
"wr_trackback" => "", "wr_trackback" => "",
"wr_hit" => 0, "wr_hit" => 0,
"wr_good" => 0, "wr_good" => 0,
"wr_nogood" => 0, "wr_nogood" => 0,
"wr_password" => gnb_get_password(make_random_id()), "wr_password" => gnb_get_password(make_random_id()),
"wr_name" => naturename_kr_get_generated_name(), "wr_name" => naturename_kr_get_generated_name(),
"wr_email" => "", "wr_email" => "",
"wr_homepage" => "", "wr_homepage" => "",
"wr_datetime" => get_current_datetime(), "wr_datetime" => get_current_datetime(),
"wr_last" => get_current_datetime(), "wr_last" => get_current_datetime(),
"wr_ip" => get_network_client_addr(), "wr_ip" => get_network_client_addr(),
"wr_1" => "", "wr_1" => "",
"wr_2" => "", "wr_2" => "",
"wr_3" => "", "wr_3" => "",
"wr_4" => "", "wr_4" => "",
"wr_5" => "", "wr_5" => "",
"wr_6" => "", "wr_6" => "",
"wr_7" => "", "wr_7" => "",
"wr_8" => "", "wr_8" => "",
"wr_9" => "", "wr_9" => "",
"wr_10" => "", "wr_10" => "",
); );
foreach($write_default_fields as $k=>$v) { foreach($write_default_fields as $k=>$v) {
if(in_array($k, array("mb_id", "wr_num"))) { if(in_array($k, array("mb_id", "wr_num"))) {
$write_fields[$k] = $v; $write_fields[$k] = $v;
} else { } else {
$write_fields[$k] = array_key_empty($k, $data) ? $v : $data[$k]; $write_fields[$k] = array_key_empty($k, $data) ? $v : $data[$k];
} }
} }
foreach($data as $k=>$v) { foreach($data as $k=>$v) {
if(!in_array($k, $write_default_fields)) { if(!in_array($k, $write_default_fields)) {
$write_fields[$k] = $v; $write_fields[$k] = $v;
} }
} }
if(count($write_fields) > 0) { if(count($write_fields) > 0) {
$sql = get_bind_to_sql_insert($write_table, $write_fields); $sql = get_bind_to_sql_insert($write_table, $write_fields);
if(exec_db_query($sql, $write_fields)) { if(exec_db_query($sql, $write_fields)) {
$result = get_db_last_id(); $result = get_db_last_id();
} }
} }
return $result; return $result;
} }
} }
if(!function_exists("gnb_get_posts")) { if(!is_fn("gnb_get_posts")) {
function gnb_get_posts($table_name, $page=1, $limit=20, $options=array()) { function gnb_get_posts($table_name, $page=1, $limit=20, $options=array()) {
$sql = "select * from " . gnb_get_write_table($table_name) . " order by wr_id desc" . get_page_range($page, $limit); $sql = "select * from " . gnb_get_write_table($table_name) . " order by wr_id desc" . get_page_range($page, $limit);
return exec_db_fetch_all($sql); return exec_db_fetch_all($sql);
} }
} }
if(!function_exists("gnb_get_post_by_id")) { if(!is_fn("gnb_get_post_by_id")) {
function gnb_get_post_by_id($table_name, $post_id) { function gnb_get_post_by_id($table_name, $post_id) {
$sql = "select * from " . gnb_get_write_table($table_name) . " where wr_id = :wr_id"; $sql = "select * from " . gnb_get_write_table($table_name) . " where wr_id = :wr_id";
return exec_db_fetch($sql, array( return exec_db_fetch($sql, array(
"wr_id" => $post_id "wr_id" => $post_id
)); ));
} }
} }
if(!function_exists("gnb_set_post_parameters")) { if(!is_fn("gnb_set_post_parameters")) {
function gnb_set_post_parameters($tablename, $wr_id, $bind=array()) { function gnb_set_post_parameters($tablename, $wr_id, $bind=array()) {
$flag = false; $flag = false;
$excludes = array("wr_id"); $excludes = array("wr_id");
$write_table = gnb_get_write_table($tablename); $write_table = gnb_get_write_table($tablename);
$bind['wr_id'] = get_value_in_array("wr_id", $bind, $wr_id); $bind['wr_id'] = get_value_in_array("wr_id", $bind, $wr_id);
$sql = "update " . $write_table . " set " . get_bind_to_sql_update_set($bind, $excludes) . " where wr_id = :wr_id"; $sql = "update " . $write_table . " set " . get_bind_to_sql_update_set($bind, $excludes) . " where wr_id = :wr_id";
$flag = exec_db_query($sql, $bind); $flag = exec_db_query($sql, $bind);
return $flag; return $flag;
} }
} }
// get member data // get member data
if(!function_exists("gnb_get_member")) { if(!is_fn("gnb_get_member")) {
function gnb_get_member($user_name, $tablename="member") { function gnb_get_member($user_name, $tablename="member") {
$result = array(); $result = array();
$bind = array( $bind = array(
"mb_id" => $user_name, "mb_id" => $user_name,
); );
$member_table = gnb_get_db_table($tablename); $member_table = gnb_get_db_table($tablename);
$result = exec_db_fetch("select * from " . $member_table . " where mb_id = :mb_id", $bind); $result = exec_db_fetch("select * from " . $member_table . " where mb_id = :mb_id", $bind);
return $result; return $result;
} }
} }
// get password // get password
if(!function_exists("gnb_get_password")) { if(!is_fn("gnb_get_password")) {
function gnb_get_password($password) { function gnb_get_password($password) {
$bind = array( $bind = array(
"password" => $password, "password" => $password,
); );
$row = exec_db_fetch("select password(:password) as pass", $bind); $row = exec_db_fetch("select password(:password) as pass", $bind);
return get_value_in_array("pass", $row, ""); return get_value_in_array("pass", $row, "");
} }
} }
// get config // get config
if(!function_exists("gnb_get_config")) { if(!is_fn("gnb_get_config")) {
function gnb_get_config($tablename="config") { function gnb_get_config($tablename="config") {
$result = array(); $result = array();
$config_table = gnb_get_db_table($tablename); $config_table = gnb_get_db_table($tablename);
$result = exec_db_fetch("select * from " . $config_table); $result = exec_db_fetch("select * from " . $config_table);
return $result; return $result;
} }
} }
// run login process // run login process
if(!function_exists("gnb_process_safe_login")) { if(!is_fn("gnb_process_safe_login")) {
function gnb_process_safe_login($user_name, $user_password) { function gnb_process_safe_login($user_name, $user_password) {
$result = false; $result = false;
$mb = gnb_get_member($user_name); $mb = gnb_get_member($user_name);
if(!array_key_empty("mb_id", $mb)) { if(!array_key_empty("mb_id", $mb)) {
$user_profile = array( $user_profile = array(
"user_id" => $mb['mb_no'], "user_id" => $mb['mb_no'],
"user_password" => get_password(gnb_get_password($mb['mb_password'])), "user_password" => get_password(gnb_get_password($mb['mb_password'])),
); );
$result = process_safe_login($mb['mb_id'], gnb_get_password($mb['mb_password']), $user_profile); $result = process_safe_login($mb['mb_id'], gnb_get_password($mb['mb_password']), $user_profile);
} }
return $result; return $result;
} }
} }
// run join member // run join member
if(!function_exists("gnb_join_member")) { if(!is_fn("gnb_join_member")) {
function gnb_join_member($user_name, $user_password, $data=array(), $tablename="member") { function gnb_join_member($user_name, $user_password, $data=array(), $tablename="member") {
$result = false; $result = false;
$member_table = gnb_get_db_table($tablename); $member_table = gnb_get_db_table($tablename);
$gnb_config = gnb_get_config(); $gnb_config = gnb_get_config();
// load helpers // load helpers
loadHelper("networktool"); loadHelper("networktool");
loadHelper("naturename.kr"); loadHelper("naturename.kr");
// get member info // get member info
$mb = gnb_get_member($user_name); $mb = gnb_get_member($user_name);
// allow join if not exists duplicated members // allow join if not exists duplicated members
if(array_key_empty("mb_id", $mb)) { if(array_key_empty("mb_id", $mb)) {
$member_fields = array(); $member_fields = array();
$member_default_fields = array( $member_default_fields = array(
"mb_id" => $user_name, "mb_id" => $user_name,
"ug_id" => "", "ug_id" => "",
"mb_password" => gnb_get_password($user_password), "mb_password" => gnb_get_password($user_password),
"mb_name" => naturename_kr_get_generated_name(), "mb_name" => naturename_kr_get_generated_name(),
"mb_jumin" => "", "mb_jumin" => "",
"mb_sex" => "", "mb_sex" => "",
"mb_birth" => "", "mb_birth" => "",
"mb_nick" => get_generated_name(), "mb_nick" => get_generated_name(),
"mb_nick_date" => "", "mb_nick_date" => "",
"mb_password_q" => "", "mb_password_q" => "",
"mb_password_a" => "", "mb_password_a" => "",
"mb_email" => "", "mb_email" => "",
"mb_homepage" => "", "mb_homepage" => "",
"mb_tel" => "", "mb_tel" => "",
"mb_hp" => "", "mb_hp" => "",
"mb_zip1" => "", "mb_zip1" => "",
"mb_zip2" => "", "mb_zip2" => "",
"mb_addr1" => "", "mb_addr1" => "",
"mb_addr2" => "", "mb_addr2" => "",
"mb_addr3" => "", "mb_addr3" => "",
"mb_addr_jibeon" => "", "mb_addr_jibeon" => "",
"mb_signature" => "", "mb_signature" => "",
"mb_profile" => "", "mb_profile" => "",
"mb_today_login" => get_current_datetime(), "mb_today_login" => get_current_datetime(),
"mb_datetime" => get_current_datetime(), "mb_datetime" => get_current_datetime(),
"mb_ip" => get_network_client_addr(), "mb_ip" => get_network_client_addr(),
"mb_level" => get_value_in_array("cf_register_level", $gnb_config), "mb_level" => get_value_in_array("cf_register_level", $gnb_config),
"mb_recommend" => "", "mb_recommend" => "",
"mb_login_ip" => get_network_client_addr(), "mb_login_ip" => get_network_client_addr(),
"mb_mailling" => "", "mb_mailling" => "",
"mb_sms" => "", "mb_sms" => "",
"mb_open" => "", "mb_open" => "",
"mb_open_date" => get_current_datetime(), "mb_open_date" => get_current_datetime(),
"mb_1" => "", "mb_1" => "",
"mb_2" => "", "mb_2" => "",
"mb_3" => "", "mb_3" => "",
"mb_4" => "", "mb_4" => "",
"mb_5" => "", "mb_5" => "",
"mb_6" => "", "mb_6" => "",
"mb_7" => "", "mb_7" => "",
"mb_8" => "", "mb_8" => "",
"mb_9" => "", "mb_9" => "",
"mb_10" => "", "mb_10" => "",
); );
foreach($member_default_fields as $k=>$v) { foreach($member_default_fields as $k=>$v) {
if(in_array($k, array("mb_id", "mb_password"))) { if(in_array($k, array("mb_id", "mb_password"))) {
$member_fields[$k] = $v; $member_fields[$k] = $v;
} else { } else {
$member_fields[$k] = array_key_empty($k, $data) ? $v : $data[$k]; $member_fields[$k] = array_key_empty($k, $data) ? $v : $data[$k];
} }
} }
foreach($data as $k=>$v) { foreach($data as $k=>$v) {
if(!in_array($k, $member_default_fields)) { if(!in_array($k, $member_default_fields)) {
$member_fields[$k] = $v; $member_fields[$k] = $v;
} }
} }
if(count($member_fields) > 0) { if(count($member_fields) > 0) {
$sql = get_bind_to_sql_insert($member_table, $member_fields); $sql = get_bind_to_sql_insert($member_table, $member_fields);
$result = exec_db_query($sql, $member_fields); $result = exec_db_query($sql, $member_fields);
} }
} }
return $result; return $result;
} }
} }
if(!function_exists("gnb_make_pipelined_data")) { if(!is_fn("gnb_make_pipelined_data")) {
function gnb_make_pipelined_data($data, $delimiter="|") { function gnb_make_pipelined_data($data, $delimiter="|") {
foreach($data as $k=>$v) { foreach($data as $k=>$v) {
$data[$k] = str_replace($delimiter, " ", $v); $data[$k] = str_replace($delimiter, " ", $v);
} }
return implode($delimiter, $data); return implode($delimiter, $data);
} }
} }

24
helper/hiddentool.php Normal file
View File

@ -0,0 +1,24 @@
<?php
/**
* @file hiddentool.php
* @created_on 2021-05-24
* @updated_on 2022-09-13
* @author Go Namhyeon <abuse@catswords.net>
* @brief Tools for Hidden Services (e.g. Tor, I2P, etc...)
*/
if (!is_fn("detect_hidden_service")) {
function detect_hidden_service() {
$score = 0;
$suffixes = array("onion", "i2p", "crypto");
$forwarded_host = get_header_value("X-Forwarded-Host");
if (!empty($forwarded_host)) {
if (in_array(end(explode('.', $forwarded_host)), $suffixes)) {
$score += 1;
}
}
return $score;
};
}

View File

@ -2,77 +2,77 @@
/** /**
* @file hybridauth.dbt.php * @file hybridauth.dbt.php
* @date 2018-04-15 * @date 2018-04-15
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief HybridAuth DB Helper * @brief HybridAuth DB Helper
*/ */
if(!function_exists("store_hybridauth_session")) { if(!is_fn("store_hybridauth_session")) {
function store_hybridauth_session($data, $user_id) { function store_hybridauth_session($data, $user_id) {
$connection_id = false; $connection_id = false;
$bind = array( $bind = array(
"user_id" => $user_id, "user_id" => $user_id,
"hybridauth_session" => $data "hybridauth_session" => $data
); );
$sql = get_bind_to_sql_insert("users_connections", $bind); $sql = get_bind_to_sql_insert("users_connections", $bind);
if(exec_db_query($sql, $bind)) { if(exec_db_query($sql, $bind)) {
$connection_id = get_db_last_id(); $connection_id = get_db_last_id();
} }
return $connection_id; return $connection_id;
} }
} }
if(!function_exists("get_stored_hybridauth_session")) { if(!is_fn("get_stored_hybridauth_session")) {
function get_stored_hybridauth_session($connection_id) { function get_stored_hybridauth_session($connection_id) {
$stored_session = false; $stored_session = false;
$bind = array( $bind = array(
"connection_id" => $connection_id "connection_id" => $connection_id
); );
$sql = get_bind_to_sql_select("users_connections", $bind); $sql = get_bind_to_sql_select("users_connections", $bind);
$row = exec_db_fetch($sql, $bind); $row = exec_db_fetch($sql, $bind);
$stored_session = get_value_in_array("hybridauth_session", $row, $stored_session); $stored_session = get_value_in_array("hybridauth_session", $row, $stored_session);
return $stored_session; return $stored_session;
} }
} }
if(!function_exists("get_hybridauth_connection_info")) { if(!is_fn("get_hybridauth_connection_info")) {
function get_hybridauth_connection_info($connection_id) { function get_hybridauth_connection_info($connection_id) {
$connection_info = false; $connection_info = false;
$bind = array( $bind = array(
"connection_id" => $connection_id "connection_id" => $connection_id
); );
$sql = get_bind_to_sql_select("users_connections", $bind); $sql = get_bind_to_sql_select("users_connections", $bind);
$row = exec_db_fetch($sql, $bind); $row = exec_db_fetch($sql, $bind);
if(!array_key_empty("connection_id", $row)) { if(!array_key_empty("connection_id", $row)) {
$connection_info = $row; $connection_info = $row;
} }
return $connection_info; return $connection_info;
} }
} }
if(!function_exists("get_hybridauth_connection_id")) { if(!is_fn("get_hybridauth_connection_id")) {
function get_hybridauth_connection_id($user_id) { function get_hybridauth_connection_id($user_id) {
$connection_id = false; $connection_id = false;
$bind = array( $bind = array(
"user_id" => $user_id "user_id" => $user_id
); );
$sql = get_bind_to_sql_select("users_connections", $bind, array( $sql = get_bind_to_sql_select("users_connections", $bind, array(
"setorders" => array("connection_id desc"), "setorders" => array("connection_id desc"),
"setpage" => 1, "setpage" => 1,
"setlimit" => 1 "setlimit" => 1
)); ));
$row = exec_db_fetch($sql, $bind); $row = exec_db_fetch($sql, $bind);
$connection_id = get_value_in_array("connection_id", $row, $connection_id); $connection_id = get_value_in_array("connection_id", $row, $connection_id);
return $connection_id; return $connection_id;
} }
} }

View File

@ -2,67 +2,67 @@
/** /**
* @file hybridauth.lnk.php * @file hybridauth.lnk.php
* @date 2018-09-26 * @date 2018-09-26
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief HybridAuth library RSF Linker * @brief HybridAuth library RSF Linker
***/ ***/
if(!function_exists("hybridauth_load")) { if(!is_fn("hybridauth_load")) {
function hybridauth_load($provider="") { function hybridauth_load($provider="") {
$result = false; $result = false;
$configfile = "./vendor/hybridauth/hybridauth/config.php"; $configfile = "./vendor/hybridauth/hybridauth/config.php";
$required_files = array( $required_files = array(
"hybridauth/hybridauth/Hybrid/Auth", "hybridauth/hybridauth/Hybrid/Auth",
"hybridauth/hybridauth/Hybrid/Endpoint" "hybridauth/hybridauth/Hybrid/Endpoint"
); );
// support facebook (php graph api v5) // support facebook (php graph api v5)
$provider = strtolower($provider); $provider = strtolower($provider);
switch($provider) { switch($provider) {
case "facebook": case "facebook":
$required_files[] = "facebook-sdk-v5/src/Facebook/autoload"; $required_files[] = "facebook-sdk-v5/src/Facebook/autoload";
break; break;
} }
// load required files // load required files
foreach($required_files as $file) { foreach($required_files as $file) {
$inc_file = "./vendor/" . $file . ".php"; $inc_file = "./vendor/" . $file . ".php";
if(!file_exists($inc_file)) { if(!file_exists($inc_file)) {
set_error("File not exists. " . $inc_file); set_error("File not exists. " . $inc_file);
show_errors(); show_errors();
} else { } else {
include("./vendor/" . $file . ".php"); include("./vendor/" . $file . ".php");
} }
} }
if(file_exists($configfile)) { if(file_exists($configfile)) {
$result = $configfile; $result = $configfile;
} }
return $result; return $result;
} }
} }
if(!function_exists("hybridauth_check_redirect")) { if(!is_fn("hybridauth_check_redirect")) {
function hybridauth_check_redirect() { function hybridauth_check_redirect() {
$flag = false; $flag = false;
$requests = get_requests(); $requests = get_requests();
if(loadHelper("string.utl")) { if(loadHelper("string.utils")) {
foreach($requests['_ALL'] as $k=>$v) { foreach($requests['_ALL'] as $k=>$v) {
if(startsWith($k, "hauth")) { if(startsWith($k, "hauth")) {
$flag = true; $flag = true;
break; break;
} }
} }
} }
return $flag; return $flag;
} }
} }
if(!function_exists("hybridauth_process")) { if(!is_fn("hybridauth_process")) {
function hybridauth_process() { function hybridauth_process() {
Hybrid_Endpoint::process(); Hybrid_Endpoint::process();
} }
} }

View File

@ -2,13 +2,13 @@
/** /**
* @file isemail.lnk.php * @file isemail.lnk.php
* @date 2018-03-02 * @date 2018-03-02
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief IsEmail library linker * @brief IsEmail library linker
*/ */
if(!function_exists("is_email")) { if(!is_fn("is_email")) {
$inc_file = "./vendor/isemail/is_email.php"; $inc_file = "./vendor/_dist/isemail/is_email.php";
if(file_exists($inc_file)) { if(file_exists($inc_file)) {
include($inc_file); include($inc_file);
} }
} }

32
helper/jCryption.lnk.php Normal file
View File

@ -0,0 +1,32 @@
<?php
/**
* @file jCryption.lnk.php
* @date 2018-09-30
* @author Go Namhyeon <abuse@catswords.net>
* @brief jCryption (alternative HTTPS on javascript) Helper
*/
if(!is_fn("jCryption_load")) {
function jCryption_load() {
$required_files = array(
"jCryption/sqAES",
"jCryption/JCryption"
);
foreach($required_files as $file) {
$inc_file = get_current_working_dir() . "/vendor/_dist/" . $file . ".php";
if(file_exists($inc_file)) {
include($inc_file);
}
}
}
}
if(!is_fn("jCryption_get")) {
function jCryption_get($idx=0, $selector="") {
$s = array();
$s[] = "JCryption::decrypt();";
$s[] = sprintf("$(function(){$(\"%s\").jCryption();});", $selector);
$s[] = sprintf("%s/vendor/_dist/jCryption/js/jquery.jcryption.3.1.0.js", base_url());
return $s[$idx];
}
}

View File

@ -1,42 +0,0 @@
<?php
/**
* @file jcryption.lnk.php
* @date 2018-09-30
* @author Go Namhyeon <gnh1201@gmail.com>
* @brief jCryption (alternative HTTPS on javascript) Helper
*/
if(!function_exists("jcryption_load")) {
function jcryption_load() {
$required_files = array(
"jCryption/sqAES",
"jCryption/JCryption"
);
foreach($required_files as $file) {
$inc_file = get_current_working_dir() . "/vendor/" . $file . ".php";
if(file_exists($inc_file)) {
include($inc_file);
}
}
}
}
if(!function_exists("jcryption_get_code")) {
function jcryption_get_code() {
return "JCryption::decrypt();";
}
}
if(!function_exists("jcryption_get_jscode")) {
function jcryption_get_jscode($selector) {
return "$(function() { $(" . $selector . ").jCryption(); });";
}
}
if(!function_exists("jcryption_get_js_url")) {
function jcryption_get_js_url() {
return "JCryption::decrypt();";
}
return base_url() . "vendor/jCryption/js/jquery.jcryption.3.1.0.js";
}
}

69
helper/json.format.php Normal file
View File

@ -0,0 +1,69 @@
<?php
// @created_on 2019-10-13
// @updated_on 2020-01-27
// @author Go Namhyeon <abuse@catswords.net>
if(!is_fn("json_decode_ex")) {
function json_decode_ex($data, $options=array()) {
$result = false;
$is_assoc = array_key_equals("assoc", $options, true);
$invalid_fn = array(
"NO_FUNCTION_JSON_DECODE" => "json_decode",
"NO_FUNCTION_JSON_LAST_ERROR" => "json_last_error",
);
$error = check_invalid_function($invalid_fn);
if($error == JSON_ERROR_NONE) {
if($is_assoc) {
$result = json_decode($data, true);
} else {
$result = json_decode($data);
}
} else {
$result = new stdClass();
$result->error = $error;
}
return $result;
}
}
if(!is_fn("json_encode_ex")) {
function json_encode_ex($data, $options=array()) {
$result = false;
$is_adaptive = array_key_equals("adaptive", $options, true);
$is_pretty = array_key_equals("pretty", $options, true);
$invalid_fn = array(
"NO_FUNCTION_JSON_ENCODE" => "json_decode",
"NO_FUNCTION_JSON_LAST_ERROR" => "json_last_error",
);
$error = check_invalid_function($invalid_fn);
if($error == JSON_ERROR_NONE) {
if($is_adaptive) {
// 2018-06-01: Adaptive JSON is always quotes without escape non-ascii characters
$lines = array();
foreach($data as $k=>$v) {
if(is_array($v)) {
$lines[] = sprintf("\"%s\":%s", make_safe_argument($k), get_adaptive_json($v));
} else {
$lines[] = sprintf("\"%s\":\"%s\"", make_safe_argument($k), make_safe_argument($v));
}
}
$result = "{" . implode(",", $lines) . "}";
} else {
if($is_pretty) {
$result = json_encode($data, JSON_PRETTY_PRINT);
} else {
$result = json_encode($data);
}
}
} else {
$result = sprintf("{\"error\": \"%s\"}", $error);
}
return $result;
}
}

View File

@ -2,7 +2,7 @@
/** /**
* @file kimsboard7.dbt.php * @file kimsboard7.dbt.php
* @date 2018-08-20 * @date 2018-08-20
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief Database Helper for Kimsboard 7 (experimental) * @brief Database Helper for Kimsboard 7 (experimental)
*/ */

75
helper/lguplus.api.php Normal file
View File

@ -0,0 +1,75 @@
<?php
/**
* @file lguplus.api.php
* @date 2019-10-07
* @author Go Namhyeon <abuse@catswords.net>
* @brief `LGU+`or `LGUPlus` is trandmark of LGUPlus Co. Ltd.
*/
require_once("./vendor/_dist/lguplus/openapi/message.php");
use openapi\message;
function lguplus_get_config() {
$config = get_config();
return array(
"enabled" => $config['lguplus_enabled'],
"key" => $config['lguplus_key'],
"secret" => $config['lguplus_secret'],
"from" => $config['lguplus_from'],
"country" => $config['lguplus_country'],
"subject" => $config['lguplus_subject']
);
}
function lguplus_send_message($message, $to="") {
$cnf = lguplus_get_config();
$data = array(
"response" => false,
"error" => false
);
if(!array_key_equals("enabled", $cnf, 1)) {
$data['error'] = "this is disabled. please set lguplus_enabled to 1";
return $data;
}
try {
$API_KEY = $cnf['key'];
$API_PWD = $cnf['secret'];
$msg = new message($API_KEY, $API_PWD, 1, false);
$ch = $msg->getHandle( "/v1/send" );
$data = array(
"send_type" => "S", // 발송형태(R:예약,S:즉시)
"msg_type" => "S", // SMS : S, LMS : L, MMS : M
"to" => $to, // 수신자번호, ","으로 구분하여 100개까지 지정 가능하다.
"from" => get_value_in_array("from", $cnf, "01000000000"), // 발신자 번호, 발신자 번호는 사전등록된 번호여야 한다.
"subject" => get_value_in_array("subject", $cnf, "Untitled text message"), // LMS, MMS 의 경우, 제목을 입력할 수 있다.
"msg" => $message, // 메시지 본문 내용
"device_id" => "", // 디바이스 아이디를 지정하여 특정 디바이스를 발송제어할 수 있다.
"datetime" => "", // 예약시간(YYYYMMDDHH24MI)
"country" => get_value_in_array("country", $cnf, "82"), // 국가 코드
);
$msg->setData( $ch, $data );
$response = $msg->sendPost($ch);
$data['response'] = $response;
if ($response === FALSE) {
$data['error'] = array(
"code" => curl_error($ch),
"message" => "CURL_ERROR"
);
}
} catch(Exception $e) {
$data['error'] = array(
"code" => $e->getCode(),
"message" => $e->getMessage()
);
}
return $data;
}

View File

@ -0,0 +1,22 @@
<?php
/**
* @file lguplus.install.php
* @date 2019-10-13
* @author Go Namhyeon <abuse@catswords.net>
* @brief `LGU+`or `LGUPlus` is trandmark of LGUPlus Co. Ltd.
*/
if(!defined("_DEF_RSF_")) set_error_exit("do not allow access");
if(!is_fn("lguplus_install")) {
function lguplus_install() {
$response = get_web_page("https://openapi.sms.uplus.co.kr/sdkFile/php_sdk.zip");
$fw = write_storage_file($response['content'], array(
"extension" => "zip"
));
@unzip($fw, get_storage_path());
// todo
}
}

48
helper/mailgun.api.php Normal file
View File

@ -0,0 +1,48 @@
<?php
/**
* @file mailgun.api.php
* @date 2019-04-12
* @author Go Namhyeon <abuse@catswords.net>
* @brief Mailgun REST API interface module
* @documentation https://documentation.mailgun.com/en/latest/api-sending.html
*/
if(!is_fn("mailgun_get_config")) {
function mailgun_get_config() {
$config = get_config();
return array(
"domain" => get_value_in_array("mailgun_domain", $config, ""),
"name" => get_value_in_array("mailgun_name", $config, "John Doe"),
"from" => get_value_in_array("mailgun_from", $config, ""),
"apikey" => get_value_in_array("mailgun_apikey", $config, ""),
);
}
}
if(!is_fn("mailgun_send_message")) {
function mailgun_send_message($content, $to, $subject="Untitled") {
$response = false;
// get mailgun configuration
$cnf = mailgun_get_config();
// make request
if(loadHelper("webpagetool")) {
$response = get_web_json(sprintf("https://api.mailgun.net/v3/%s/messages", $domain), array(
"headers" => array(
"Content-Type" => "multipart/form-data",
"Authentication" => array("Basic", "api", $cnf['apikey']),
),
"data" => array(
"from" => sprintf("%s <%s>", $cnf['name'], $cnf['from']),
"to" => $to,
"subject" => $subject,
"text" => $content,
),
));
}
return $response;
}
}

View File

@ -2,15 +2,15 @@
/** /**
* @file metaparser.lnk.php * @file metaparser.lnk.php
* @date 2018-03-21 * @date 2018-03-21
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief PHP-Metaparser library linker * @brief PHP-Metaparser library linker
*/ */
if(!class_exists("MetaParser")) { if(!class_exists("MetaParser")) {
$usenames = array( $usenames = array(
"PHP-MetaParser/MetaParser.class" "PHP-MetaParser/MetaParser.class"
); );
foreach($usenames as $name) { foreach($usenames as $name) {
include("./vendor/" . $name . ".php"); include("./vendor/" . $name . ".php");
} }
} }

21
helper/migrate.1.5.php Normal file
View File

@ -0,0 +1,21 @@
<?php
// @file migrate.1.5.php
// migration helper from ResaonbleFramework 1.5
if(!is_fn("check_function_exists")) {
function check_function_exists($fn) {
return is_fn($fn);
}
}
if(!is_fn("set_scope")) {
function set_scope($k, $v) {
return set_shared_var($k, $v);
}
}
if(!is_fn("get_scope")) {
function get_scope($k) {
return get_shared_var($k);
}
}

74
helper/mobiletool.php Normal file
View File

@ -0,0 +1,74 @@
<?php
/**
* @file mobiletool.php
* @date 2019-04-29
* @author Go Namhyeon <abuse@catswords.net>
* @brief Mobile Tool
* @documentation https://www.w3.org/Mobile/training/device-detection/mobile_detector.txt
*/
if(!is_fn("detect_mobile")) {
function detect_mobile() {
// This function returns the value of a local variable ($dm)
// that is 0 if a desktop client is detected and > 0 for mobile.
// Adapted only very lightly from original code posted PascalV in response to
// the lightweight device detection (http://mobiforge.com/developing/story/lightweight-device-detection-php)
$dm = 0;
if(preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone)/i', strtolower($_SERVER['HTTP_USER_AGENT']))) {
$dm++;
}
if((strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml') > 0) or ((isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE'])))) {
$dm++;
}
$mobile_ua = strtolower(substr($_SERVER['HTTP_USER_AGENT'], 0, 4));
$mobile_agents = array(
'w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac',
'blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno',
'ipaq','java','jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-',
'maui','maxo','midp','mits','mmef','mobi','mot-','moto','mwbp','nec-',
'newt','noki','oper','palm','pana','pant','phil','play','port','prox',
'qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar',
'sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-',
'tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp',
'wapr','webc','winw','winw','xda','xda-'
);
if(in_array($mobile_ua, $mobile_agents)) {
$dm++;
}
if(strpos(strtolower($_SERVER['ALL_HTTP']),'operamini') > 0) {
$dm++;
}
if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']),' ppc;') > 0) {
$dm++;
}
if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'windows ce') > 0) {
$dm++;
} elseif(strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'windows') > 0) {
$dm = 0;
}
if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'iemobile') > 0) {
$dm++;
}
// detect android os
if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'android') > 0) {
$dm++;
}
// detect tizen os
if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'tizen') > 0) {
$dm++;
}
return $dm;
}
}

View File

@ -1,25 +0,0 @@
<?php
/**
* @file naturename.kr.php
* @date 2018-04-15
* @author Go Namhyeon <gnh1201@gmail.com>
* @brief Korean nature name generator
*/
function naturename_kr_get_prefix_name() {
$words = "김,이,박,최,정,강,조,윤,장,임,고";
$prefix_names = explode(",", $words);
shuffle($prefix_names);
return $prefix_names[0];
}
function naturename_kr_get_suffix_name($year="", $gender="") {
$words = "영자,정자,순자,춘자,경자,옥자,명자,숙자,정순,화자,영수,영호,영식,정웅,영길,영일,정수,정남,광수,중수,정숙,영숙,영순,영희,정희,옥순,영철,종수,정식,정호,영환,명숙,경숙,순옥,현숙,성수,성호,상철,경수,상호,미경,미숙,경희,미영,영미,영진,병철,진호,재호,은정,은주,은영,현주,은경,지영,현정,미정,정훈,성훈,성진,상훈,성민,상현,준호,선영,지연,혜진,지훈,민수,지혜,지은,수진,은지,아름,지현,보람,현우,동현,준영,진우,유진,민지,수빈,지원,현지,예진,예지,민석,준혁,승현,서연,민서,서현,서영,수민,예원,민준,민재,도현,현준,승민,지민,서윤,예은,하은,지우,윤서,준서,우진,건우,예준,지후,채원,하윤,지아,은서,서준,주원,시우,도윤";
$suffix_names = explode(",", $words);
shuffle($suffix_names);
return $suffix_names[0];
}
function naturename_kr_get_generated_name() {
return naturename_kr_get_prefix_name() . naturename_kr_get_suffix_name();
}

View File

@ -1,12 +1,13 @@
<?php <?php
/** /**
* @file networktool.php * @file networktool.php
* @date 2018-04-11 * @created_on 2018-04-11
* @author Go Namhyeon <gnh1201@gmail.com> * @updated_on 2022-09-16
* @author Go Namhyeon <abuse@catswords.net>
* @brief Network tool helper * @brief Network tool helper
*/ */
if(!function_exists("get_network_event")) { if(!is_fn("get_network_event")) {
function get_network_event() { function get_network_event() {
$config = get_config(); $config = get_config();
@ -24,7 +25,7 @@ if(!function_exists("get_network_event")) {
} }
} }
if(!function_exists("get_network_client_addr")) { if(!is_fn("get_network_client_addr")) {
function get_network_client_addr() { function get_network_client_addr() {
$addr = ''; $addr = '';
if (isset($_SERVER['HTTP_CLIENT_IP'])) if (isset($_SERVER['HTTP_CLIENT_IP']))
@ -47,7 +48,7 @@ if(!function_exists("get_network_client_addr")) {
} }
} }
if(!function_exists("get_network_server_addr")) { if(!is_fn("get_network_server_addr")) {
function get_network_server_addr() { function get_network_server_addr() {
$addr = ''; $addr = '';
if(isset($_SERVER['SERVER_ADDR']) && isset($_SERVER['SERVER_PORT'])) { if(isset($_SERVER['SERVER_ADDR']) && isset($_SERVER['SERVER_PORT'])) {
@ -56,7 +57,7 @@ if(!function_exists("get_network_server_addr")) {
$addr = $_SERVER['SERVER_ADDR']; $addr = $_SERVER['SERVER_ADDR'];
} else if(isset($_SERVER['LOCAL_ADDR'])) { } else if(isset($_SERVER['LOCAL_ADDR'])) {
$addr = $_SERVER['LOCAL_ADDR']; $addr = $_SERVER['LOCAL_ADDR'];
} else if(function_exists('gethostname') && function_exists('gethostbyname')) { } else if(is_fn(array("gethostname", "gethostbyname"))) {
$host = gethostname(); $host = gethostname();
$addr = gethostbyname($host); $addr = gethostbyname($host);
} else { } else {
@ -66,14 +67,14 @@ if(!function_exists("get_network_server_addr")) {
} }
} }
if(!function_exists("get_network_hostname")) { if(!is_fn("get_network_hostname")) {
function get_network_hostname() { function get_network_hostname() {
$host = ''; $host = '';
if(isset($_SERVER['HTTP_HOST'])) { if(isset($_SERVER['HTTP_HOST'])) {
$host = $_SERVER['HTTP_HOST']; $host = $_SERVER['HTTP_HOST'];
} else if(isset($_SERVER['SERVER_NAME'])) { } else if(isset($_SERVER['SERVER_NAME'])) {
$host = $_SERVER['SERVER_NAME']; $host = $_SERVER['SERVER_NAME'];
} else if(function_exists('gethostname')) { } else if(!is_fn('gethostname')) {
$host = gethostname(); $host = gethostname();
} else { } else {
$host = 'UNKNOWN'; $host = 'UNKNOWN';
@ -83,46 +84,54 @@ if(!function_exists("get_network_hostname")) {
} }
} }
if(!function_exists("check_secure_protocol")) { if(!is_fn("check_secure_protocol")) {
function check_secure_protocol() { function check_secure_protocol() {
return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443; return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443;
} }
} }
if(!function_exists("get_os_platform")) { if(!is_fn("get_os_platform")) {
function get_os_platform() { function get_os_platform() {
$os = ""; $os = "";
if(defined("PHP_OS")) { if(defined("PHP_OS")) {
$os = PHP_OS; $os = PHP_OS;
} else { } else {
$os = php_uname(s); $os = php_uname(s);
} }
return $os; return $os;
} }
} }
if(!function_exists("get_network_outbound_addr")) { if(!is_fn("get_network_outbound_addr")) {
function get_network_outbound_addr($protocol="") { function get_network_outbound_addr($protocol="") {
$addr = false; $addr = false;
$config = get_config(); $config = get_config();
// via icanhazip.com // via icanhazip.com
if(loadHelper("webpagetool")) { if(loadHelper("webpagetool")) {
$remote_host = "http://" . ($protocol == "ipv6" ? "ipv6." : "") . "icanhazip.com"; $remote_host = "http://" . ($protocol == "ipv6" ? "ipv6." : "") . "icanhazip.com";
$response = get_web_page($remote_host, "get.cache"); $response = get_web_page($remote_host, "get.cache");
$addr = get_value_in_array("content", $response, $addr); $addr = get_value_in_array("content", $response, $addr);
} }
// via opendns.com // via opendns.com
if(!$addr && loadHelper("exectool")) { if(!$addr && loadHelper("exectool")) {
$cmd = "dig +short myip.opendns.com @resolver1.opendns.com"; $cmd = "dig +short myip.opendns.com @resolver1.opendns.com";
$addr = exec_command($cmd, "shell_exec", array( $addr = exec_command($cmd, "shell_exec", array(
"cache" => true "cache" => true
)); ));
} }
return $addr; return $addr;
} }
}
if(!is_fn("detect_perf_agent")) {
function detect_perf_agent() {
$evt = get_network_event();
$agent = $evt['agent'];
return preg_match('(PingdomPageSpeed|GTmetrix)', $agent) === 1;
}
} }

View File

@ -2,19 +2,19 @@
/** /**
* @file obfuscator.php * @file obfuscator.php
* @date 2018-10-21 * @date 2018-10-21
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief PHP Obfuscator for ReasonableFramework * @brief PHP Obfuscator for ReasonableFramework
*/ */
if(!function_exists("get_obfuscator")) { if(!is_fn("get_obfuscator")) {
function get_obfuscator() { function get_obfuscator() {
$obfuscator = rand(1, 15); $obfuscator = rand(1, 15);
set_scope("obfuscator", $obfuscator); set_shared_var("obfuscator", $obfuscator);
return $obfuscator; return $obfuscator;
} }
} }
if(!function_exists("get_obfuscated_result")) { if(!is_fn("get_obfuscated_result")) {
function get_obfuscated_result($raw) { function get_obfuscated_result($raw) {
$result = false; $result = false;

View File

@ -2,98 +2,98 @@
/** /**
* @file pagenate.php * @file pagenate.php
* @date 2018-01-01 * @date 2018-01-01
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief Page navigation helper * @brief Page navigation helper
*/ */
if(!function_exists("paginate_get_current_page")) { if(!is_fn("paginate_get_current_page")) {
function paginate_get_current_page($page=1) { function paginate_get_current_page($page=1) {
$current_page = 1; $current_page = 1;
if($page > 0) { if($page > 0) {
$current_page = $page; $current_page = $page;
} }
return $current_page; return $current_page;
} }
} }
if(!function_exists("paginate_get_total_pages")) { if(!is_fn("paginate_get_total_pages")) {
function paginate_get_total_pages($item_per_page=1.0, $total_records=1.0) { function paginate_get_total_pages($item_per_page=1.0, $total_records=1.0) {
$total_pages = 1; $total_pages = 1;
if($item_per_page > 0) { if($item_per_page > 0) {
$total_pages = ceil($total_records / $item_per_page); $total_pages = ceil($total_records / $item_per_page);
} }
return $total_pages; return $total_pages;
} }
} }
if(!function_exists("paginate_get_query_string")) { if(!is_fn("paginate_get_query_string")) {
function paginate_get_query_string() { function paginate_get_query_string() {
loadHelper("networktool"); loadHelper("networktool");
$net_event = get_network_event(); $net_event = get_network_event();
return get_value_in_array("query", $net_event, ""); return get_value_in_array("query", $net_event, "");
} }
} }
// https://www.sanwebe.com/2011/05/php-pagination-function // https://www.sanwebe.com/2011/05/php-pagination-function
if(!function_exists("paginate_make_html")) { if(!is_fn("paginate_make_html")) {
function paginate_make_html($item_per_page, $current_page, $total_records, $total_pages, $page_url, $qry='') { function paginate_make_html($item_per_page, $current_page, $total_records, $total_pages, $page_url, $qry='') {
$pagination = ''; $pagination = '';
if($total_pages > 0 && $total_pages != 1 && $current_page <= $total_pages) { //verify total pages and current page number if($total_pages > 0 && $total_pages != 1 && $current_page <= $total_pages) { //verify total pages and current page number
$pagination .= '<ul class="pagination justify-content-end">'; $pagination .= '<ul class="pagination justify-content-end">';
$right_links = $current_page + 3; $right_links = $current_page + 3;
$previous = $current_page - 3; //previous link $previous = $current_page - 3; //previous link
$next = $current_page + 1; //next link $next = $current_page + 1; //next link
$first_link = true; //boolean var to decide our first link $first_link = true; //boolean var to decide our first link
// prevent minus page number // prevent minus page number
if($previous < 0) { if($previous < 0) {
$previous = 1; $previous = 1;
} }
$qry_url = ''; $qry_url = '';
if(!empty($qry)) { if(!empty($qry)) {
$qry_url = '?' . $qry; $qry_url = '?' . $qry;
} }
if($current_page > 1) { if($current_page > 1) {
$previous_link = ($previous == 0) ? 1 : $previous; $previous_link = ($previous == 0) ? 1 : $previous;
$pagination .= '<li class="page-item first"><a class="page-link" href="' . $page_url . '1' . $qry_url.'" title="First">&laquo;</a></li>'; //first link $pagination .= '<li class="page-item first"><a class="page-link" href="' . $page_url . '1' . $qry_url.'" title="First">&laquo;</a></li>'; //first link
$pagination .= '<li class="page-item"><a class="page-link" href="' . $page_url . $previous_link . $qry_url.'" title="Previous">&lt;</a></li>'; //previous link $pagination .= '<li class="page-item"><a class="page-link" href="' . $page_url . $previous_link . $qry_url.'" title="Previous">&lt;</a></li>'; //previous link
for($i = ($current_page-2); $i < $current_page; $i++) { //Create left-hand side links for($i = ($current_page-2); $i < $current_page; $i++) { //Create left-hand side links
if($i > 0) { if($i > 0) {
$pagination .= '<li class="page-item"><a class="page-link" href="' . $page_url . $i . $qry_url . '">' . $i . '</a></li>'; $pagination .= '<li class="page-item"><a class="page-link" href="' . $page_url . $i . $qry_url . '">' . $i . '</a></li>';
} }
} }
$first_link = false; //set first link to false $first_link = false; //set first link to false
} }
if($first_link) { //if current active page is first link if($first_link) { //if current active page is first link
$pagination .= '<li class="page-item first active"><a class="page-link" href="#">' . $current_page . '</a></li>'; $pagination .= '<li class="page-item first active"><a class="page-link" href="#">' . $current_page . '</a></li>';
} elseif($current_page == $total_pages) { //if it's the last active link } elseif($current_page == $total_pages) { //if it's the last active link
$pagination .= '<li class="page-item last active"><a class="page-link" href="#">' . $current_page . '</a></li>'; $pagination .= '<li class="page-item last active"><a class="page-link" href="#">' . $current_page . '</a></li>';
} else { //regular current link } else { //regular current link
$pagination .= '<li class="page-item active"><a class="page-link" href="#">' . $current_page . '</a></li>'; $pagination .= '<li class="page-item active"><a class="page-link" href="#">' . $current_page . '</a></li>';
} }
for($i = $current_page+1; $i < $right_links ; $i++) { //create right-hand side links for($i = $current_page+1; $i < $right_links ; $i++) { //create right-hand side links
if($i <= $total_pages) { if($i <= $total_pages) {
$pagination .= '<li class="page-item"><a class="page-link" href="' . $page_url . $i . $qry_url.'">' . $i . '</a></li>'; $pagination .= '<li class="page-item"><a class="page-link" href="' . $page_url . $i . $qry_url.'">' . $i . '</a></li>';
} }
} }
if($current_page < $total_pages) { if($current_page < $total_pages) {
$next_link = ($i > $total_pages) ? $total_pages : $i; $next_link = ($i > $total_pages) ? $total_pages : $i;
$pagination .= '<li class="page-item"><a class="page-link" href="'. $page_url . $next_link . $qry_url.'" >&gt;</a></li>'; //next link $pagination .= '<li class="page-item"><a class="page-link" href="'. $page_url . $next_link . $qry_url.'" >&gt;</a></li>'; //next link
$pagination .= '<li class="page-item last"><a class="page-link" href="' . $page_url . $total_pages . $qry_url.'" title="Last">&raquo;</a></li>'; //last link $pagination .= '<li class="page-item last"><a class="page-link" href="' . $page_url . $total_pages . $qry_url.'" title="Last">&raquo;</a></li>'; //last link
} }
$pagination .= '</ul>'; $pagination .= '</ul>';
} }
return $pagination; //return pagination links return $pagination; //return pagination links
} }
} }

68
helper/perftool.php Normal file
View File

@ -0,0 +1,68 @@
<?php
/**
* @file perftool.php
* @created_on 2020-02-19
* @updated_on 2020-02-24
* @author Go Namhyeon <abuse@catswords.net>
* @brief PerfTool helper
*/
if(!is_fn("get_cpu_idle")) {
function get_cpu_idle() {
$idle = false;
if(loadHelper("exectool")) {
$idle = floatval(trim(exec_command("top -n 1 -b | grep -i Cpu\(s\) | awk '{print \$8}'"))) / 100.0;
}
return $idle;
}
}
if(!is_fn("get_cpu_idle2")) {
function get_cpu_idle2() {
$idle = false;
if(loadHelper("exectool")) {
$idle = floatval(trim(exec_command("grep 'cpu ' /proc/stat | awk '{idle=(\$5)/(\$2+\$4+\$5)} END {print idle}'")));
}
return $idle;
}
}
if(!is_fn("set_min_cpu_idle")) {
function set_min_cpu_idle($ratio=0.01) {
$wait = 0;
// default (cpu_sleep_time): 3 seconds
$cpu_sleep_time = floatval(get_value_in_array("cpu_sleep_time", $config, 3));
if($ratio > 0 && $ratio < 1) {
while(get_cpu_idle() < $ratio) {
if($wait == 0) {
write_common_log("CPU usage exceeded. wait a few seconds...", "helper/preftool");
}
sleep($cpu_sleep_time);
$wait++;
}
}
if($wait > 0) {
write_common_log(sprintf("CPU usage recovered. waited %s seconds ago", ($wait * $cpu_sleep_time)), "helper/preftool");
}
}
}
if(!is_fn("set_cpu_usage_limit")) {
function set_cpu_usage_limit($ratio=0.9) {
$config = get_config();
$num_cores = get_value_in_array("cpu_num_cores", $config, 1);
$pid = get_shared_var("mypid");
if(!empty($pid) && loadHelper("exectool")) {
write_common_log(sprintf("Limited CPU usage (%s, %s)<=(PID, LIMIT)", $pid, ($ratio * $num_cores) * 100), "helper/perftool");
exec_command(sprintf("cpulimit --pid %s --limit %s", $pid, ($ratio * $num_cores) * 100));
}
}
}

39
helper/pgkcp.install.php Normal file
View File

@ -0,0 +1,39 @@
<?php
/**
* @file pgkcp.install.php
* @date 2019-10-13
* @author Go Namhyeon <abuse@catswords.net>
* @brief KCP PG(Payment Gateway) Auto-Install Tool
*/
if(!defined("_DEF_RSF_")) set_error_exit("do not allow access");
loadHelper("pgkcp.lnk");
if(!is_fn("install_pgkcp")) {
function install_pgkcp() {
$response = get_web_page("https://admin8.kcp.co.kr/assist/download/sampleDownload", "get", array(
"type1" => "FM01",
"type2" => "FS04"
));
// step 1
$fw = write_storage_file($response['content'], array(
"extension" => "zip"
));
@unzip($fw, get_storage_path());
// step 2
$fw = write_storage_file("", array(
"mode" => "fake",
"filename" => sprintf("NHNKCP_PAYMENT_STANDARD_PHP/NHNKCP_PAYMENT_STANDARD_LINUX_PHP.zip"),
));
@unzip($fw, get_storage_path());
// step 3
exec_command("cp -r %s/NHNKCP_PAYMENT_STANDARD_LINUX_PHP/* %s/", get_storage_path(), get_pgkcp_dir());
// if success, directory exists
return is_dir(get_pgkcp_dir());
}
}

View File

@ -1,93 +1,106 @@
<?php <?php
/** /**
* @file pgkcp.lnk.php * @file pgkcp.lnk.php
* @date 2018-08-25 * @created_on 2018-08-25
* @author Go Namhyeon <gnh1201@gmail.com> * @updated_on 2020-01-13
* @author Go Namhyeon <abuse@catswords.net>
* @brief KCP PG(Payment Gateway) Helper * @brief KCP PG(Payment Gateway) Helper
*/ */
if(!defined("_DEF_RSF_")) set_error_exit("do not allow access"); if(!defined("_DEF_RSF_")) set_error_exit("do not allow access");
if(!function_exists("get_pgkcp_config")) { loadHelper("json.format");
function get_pgkcp_config() { loadHelper("webpagetool");
$pgkcp_config = array(); loadHelper("compress.zip");
loadHelper("exectool");
// include configuration file if(!is_fn("get_pgkcp_config")) {
$inc_file = get_current_working_dir() . "/vendor/pgkcp/cfg/site_conf_inc.php"; function get_pgkcp_dir() {
if(file_exists($inc_file)) { return get_current_working_dir() . "/vendor/_dist/pgkcp";
include($inc_file); }
$pgkcp_config = array(
"g_conf_home_dir" => $g_conf_home_dir,
"g_conf_log_path" => $g_conf_log_path,
"g_conf_gw_url" => $g_conf_gw_url,
"g_conf_js_url" => $g_conf_js_url,
"g_wsdl" => $g_wsdl,
"g_conf_site_cd" => $g_conf_site_cd,
"g_conf_site_key" => $g_conf_site_key,
"g_conf_site_name" => $g_conf_site_name,
"g_conf_log_level" => $g_conf_log_level,
"g_conf_gw_port" => $g_conf_gw_port,
"module_type" => $module_type,
);
// read configuration file
$fr = read_storage_file("api.config.pgkcp.json", array(
"storage_type" => "payman"
));
if(!empty($fr)) {
$api_config = json_decode($fr, true);
$api_config_fields = array("g_conf_gw_url", "g_conf_js_url", "g_conf_site_cd", "g_conf_site_key", "g_conf_site_name");
foreach($api_config_fields as $name) {
$pgkcp_config[$name] = get_value_in_array($name, $api_config, $pgkcp_config[$name]);
}
}
} else {
set_error("PGKCP configuration file does not exists.");
show_errors();
}
// check installed platform
$platform = get_pgkcp_platform($pgkcp_config);
if(empty($platform)) {
set_error("pp_cli or pp_cli.exe file not found");
show_errors();
} else {
$pgkcp_config['g_conf_platform'] = $platform;
}
return $pgkcp_config;
}
} }
if(!function_exists("get_pgkcp_platform")) { if(!is_fn("get_pgkcp_config")) {
function get_pgkcp_platform($pgkcp_config) { function get_pgkcp_config() {
$platform = false; $pgkcp_config = array();
$exe_files = array( // include configuration file
"default" => $pgkcp_config['g_conf_home_dir'] . "/bin/pp_cli", $inc_file = get_pgkcp_dir() . "/cfg/site_conf_inc.php";
"win32" => $pgkcp_config['g_conf_home_dir'] . "/bin/pp_cli.exe" if(file_exists($inc_file)) {
); include($inc_file);
foreach($exe_files as $k=>$v) { $pgkcp_config = array(
if(file_exists($v)) { "g_conf_home_dir" => $g_conf_home_dir,
$platform = $k; "g_conf_log_path" => $g_conf_log_path,
break; "g_conf_gw_url" => $g_conf_gw_url,
} "g_conf_js_url" => $g_conf_js_url,
} "g_wsdl" => $g_wsdl,
"g_conf_site_cd" => $g_conf_site_cd,
"g_conf_site_key" => $g_conf_site_key,
"g_conf_site_name" => $g_conf_site_name,
"g_conf_log_level" => $g_conf_log_level,
"g_conf_gw_port" => $g_conf_gw_port,
"module_type" => $module_type,
);
return $platform; // read configuration file
} $fr = read_storage_file("api.config.pgkcp.json", array(
"storage_type" => "payman"
));
if(!empty($fr)) {
$_pgkcp_config = json_decode($fr);
$pgkcp_config['g_conf_gw_url'] = get_property_value("g_conf_gw_url", $_pgkcp_config);
$pgkcp_config['g_conf_js_url'] = get_property_value("g_conf_js_url", $_pgkcp_config);
$pgkcp_config['g_conf_site_cd'] = get_property_value("g_conf_site_cd", $_pgkcp_config);
$pgkcp_config['g_conf_site_key'] = get_property_value("g_conf_site_key", $_pgkcp_config);
$pgkcp_config['g_conf_site_name'] = get_property_value("g_conf_site_name", $_pgkcp_config);
}
} else {
set_error("PGKCP configuration file does not exists.");
show_errors();
}
// check installed platform
$platform = get_pgkcp_platform($pgkcp_config);
if(empty($platform)) {
set_error("pp_cli(pp_cli.exe) file is not found or executable");
show_errors();
} else {
$pgkcp_config['g_conf_platform'] = $platform;
}
return $pgkcp_config;
}
} }
if(!function_exists("load_pgkcp_library")) { if(!is_fn("get_pgkcp_platform")) {
function load_pgkcp_library() { function get_pgkcp_platform($pgkcp_config) {
$inc_file = get_current_working_dir() . "/vendor/pgkcp/res/pp_cli_hub_lib.php"; $platform = false;
if(file_exists($inc_file)) {
include($inc_file); $executables = array(
} else { "default" => $pgkcp_config['g_conf_home_dir'] . "/bin/pp_cli",
set_error("PGKCP payment library file does not exists."); "win32" => $pgkcp_config['g_conf_home_dir'] . "/bin/pp_cli.exe"
show_errors(); );
}
} foreach($executables as $k=>$v) {
if(file_exists($v) && is_executable($v)) {
$platform = $k;
break;
}
}
return $platform;
}
}
if(!is_fn("load_pgkcp_library")) {
function load_pgkcp_library() {
$inc_file = get_pgkcp_dir() . "/sample/pp_cli_hub_lib.php";
if(file_exists($inc_file)) {
include($inc_file);
} else {
set_error("PGKCP payment library file does not exists.");
show_errors();
}
}
} }

39
helper/rfc3164.proto.php Normal file
View File

@ -0,0 +1,39 @@
<?php
/*
* @file rfc3164.proto.php
* @author Go Namhyeon <abuse@catswords.net> (Modified)
* @author Troy Davis (@tory) - https://gist.github.com/troy/2220679 (Original)
* @brief Helper for RFC3164(The BSD Syslog Protocol) - https://tools.ietf.org/html/rfc3164
* @created_on 2018-03-02
* @updated_on 2020-01-23
*/
if(!is_fn("rfc3164_get_config")) {
function rfc3164_get_config() {
$config = get_config();
return array(
"enabled" => get_value_in_array("rfc3164_enabled", $config, ""),
"host" => get_value_in_array("rfc3164_host", $config, ""),
"port" => get_value_in_array("rfc3164_port", $config, "")
);
}
}
if(!is_fn("rfc3164_send_message")) {
function rfc3164_send_message($message, $component = "web", $program = "next_big_thing") {
$_config = rfc3164_get_config();
$enabled = array_key_equals("enabled", $_config, 1);
$host = get_value_in_array("host", $_config, "");
$port = get_value_in_array("port", $_config, "");
if($enabled !== false) {
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
foreach(explode("\n", $message) as $line) {
$syslog_message = "<22>" . date('M d H:i:s ') . $program . ' ' . $component . ': ' . $line;
socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, $host, $port);
}
socket_close($sock);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,128 +0,0 @@
<?php
/**
* @file socialhub.utl.php
* @date 2018-09-27
* @author Go Namhyeon <gnh1201@gmail.com>
* @brief SocialHub Utilities (refactoring from SocioRouter Utilities)
*/
if(!function_exists("socialhub_send_message")) {
function socialhub_send_message($provider, $adapter, $message, $options=array()) {
$response = false;
$status = array(
"message" => $message
);
switch($provider) {
case "facebook":
$status['link'] = get_value_in_array("link", $options, "");
$status['picture'] = get_value_in_array("picture", $options, "");
$response = $adapter->setUserStatus($status);
break;
case "linkedin":
$status['content'] = array(
"title" => get_value_in_array("title", $options, ""),
"description" => get_value_in_array("description", $options, ""),
"submitted-url" => get_value_in_array("link", $options, ""),
"submitted-image-url" => get_value_in_array("picture", $options, "")
);
$status['visibility'] = array(
"code" => "anyone"
);
$response = $adapter->setUserStatus($status);
break;
case "twitter":
$status['link'] = get_value_in_array("link", $options, "");
$status['picture'] = get_value_in_array("picture", $options, "");
$response = $adapter->setUserStatus($status);
break;
default:
set_error("Unknown provider");
show_errors();
}
return $response;
}
}
if(!function_exists("socialhub_parse_object_id")) {
function socialhub_parse_object_id($provider, $response) {
$object_id = false;
switch($provider) {
case "facebook":
$decodedBody = get_property_value("decodedBody", $response, true);
$object_id = $decodedBody['id'];
break;
case "linkedin":
$object_id = get_property_value("updateKey", $response);
break;
case "twitter":
$object_id = get_property_value("id_str", $response);
break;
}
return $object_id;
}
}
if(!function_exists("socialhub_get_object")) {
function socialhub_get_object($provider, $adapter, $object_id) {
$result = false;
$access_token = $adapter->getAccessToken();
switch($provider) {
case "facebook":
$result = array(
"post" => socialhub_get_object_facebook($provider, $adapter, $object_id, "post"),
"likes" => socialhub_get_object_facebook($provider, $adapter, $object_id, "likes"),
"comments" => socialhub_get_object_facebook($provider, $adapter, $object_id, "comments"),
"sharedposts" => socialhub_get_object_facebook($provider, $adapter, $object_id, "sharedposts"),
"reactions" => socialhub_get_object_facebook($provider, $adapter, $object_id, "reactions"),
);
break;
}
return $result;
}
}
if(!function_exists("socialhub_get_object_facebook")) {
function socialhub_get_object_facebook($adapter, $object_id, $type="post") {
$result = false;
$response = false;
try {
switch($object_type) {
case "post":
$response = $adapter->api()->get("/" . $object_id, $access_token);
break;
case "likes":
$response = $adapter->api()->get("/" . $object_id . "/likes", $access_token);
break;
case "comments":
$response = $adapter->api()->get("/" . $object_id . "/comments", $access_token);
break;
case "sharedposts":
$response = $adapter->api()->get("/" . $object_id . "/sharedposts", $access_token);
break;
case "reactions":
$response = $adapter->api()->get("/" . $object_id . "/reactions", $access_token);
break;
}
} catch(Exception $e) {
set_error($e->getMessage());
show_errors();
}
// get response body
$body = get_property_value("body", $response, true);
$decoded_body = json_decode($body);
$result = $decoded_body;
return $result;
}
}

128
helper/socialtool.php Normal file
View File

@ -0,0 +1,128 @@
<?php
/**
* @file socialtools.php
* @date 2018-09-27
* @author Go Namhyeon <abuse@catswords.net>
* @brief SocialTools (refactoring from SocioRouter)
*/
if(!is_fn("social_send_message")) {
function social_send_message($provider, $adapter, $message, $options=array()) {
$response = false;
$status = array(
"message" => $message
);
switch($provider) {
case "facebook":
$status['link'] = get_value_in_array("link", $options, "");
$status['picture'] = get_value_in_array("picture", $options, "");
$response = $adapter->setUserStatus($status);
break;
case "linkedin":
$status['content'] = array(
"title" => get_value_in_array("title", $options, ""),
"description" => get_value_in_array("description", $options, ""),
"submitted-url" => get_value_in_array("link", $options, ""),
"submitted-image-url" => get_value_in_array("picture", $options, "")
);
$status['visibility'] = array(
"code" => "anyone"
);
$response = $adapter->setUserStatus($status);
break;
case "twitter":
$status['link'] = get_value_in_array("link", $options, "");
$status['picture'] = get_value_in_array("picture", $options, "");
$response = $adapter->setUserStatus($status);
break;
default:
set_error("Unknown provider");
show_errors();
}
return $response;
}
}
if(!is_fn("social_parse_object_id")) {
function social_parse_object_id($provider, $response) {
$object_id = false;
switch($provider) {
case "facebook":
$decodedBody = get_property_value("decodedBody", $response, true);
$object_id = $decodedBody['id'];
break;
case "linkedin":
$object_id = get_property_value("updateKey", $response);
break;
case "twitter":
$object_id = get_property_value("id_str", $response);
break;
}
return $object_id;
}
}
if(!is_fn("social_get_object")) {
function social_get_object($provider, $adapter, $object_id) {
$result = false;
$access_token = $adapter->getAccessToken();
switch($provider) {
case "facebook":
$result = array(
"post" => social_get_object_facebook($provider, $adapter, $object_id, "post"),
"likes" => social_get_object_facebook($provider, $adapter, $object_id, "likes"),
"comments" => social_get_object_facebook($provider, $adapter, $object_id, "comments"),
"sharedposts" => social_get_object_facebook($provider, $adapter, $object_id, "sharedposts"),
"reactions" => social_get_object_facebook($provider, $adapter, $object_id, "reactions"),
);
break;
}
return $result;
}
}
if(!is_fn("social_get_object_facebook")) {
function social_get_object_facebook($adapter, $object_id, $type="post") {
$result = false;
$response = false;
try {
switch($object_type) {
case "post":
$response = $adapter->api()->get("/" . $object_id, $access_token);
break;
case "likes":
$response = $adapter->api()->get("/" . $object_id . "/likes", $access_token);
break;
case "comments":
$response = $adapter->api()->get("/" . $object_id . "/comments", $access_token);
break;
case "sharedposts":
$response = $adapter->api()->get("/" . $object_id . "/sharedposts", $access_token);
break;
case "reactions":
$response = $adapter->api()->get("/" . $object_id . "/reactions", $access_token);
break;
}
} catch(Exception $e) {
set_error($e->getMessage());
show_errors();
}
// get response body
$body = get_property_value("body", $response, true);
$decoded_body = json_decode($body);
$result = $decoded_body;
return $result;
}
}

View File

@ -2,67 +2,67 @@
/** /**
* @file spreadsheet-reader.lnk.php * @file spreadsheet-reader.lnk.php
* @date 2018-09-20 * @date 2018-09-20
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief Excel file parser * @brief Excel file parser
***/ ***/
if(!function_exists("parse_excel_file")) { if(!is_fn("parse_excel_file")) {
function parse_excel_file($filepath, $format="xlsx", $setColumnName=false) { function parse_excel_file($filepath, $format="xlsx", $setColumnName=false) {
$rows = array(); $rows = array();
$required_files = array( $required_files = array(
"spreadsheet-reader/php-excel-reader/excel_reader2", "spreadsheet-reader/php-excel-reader/excel_reader2",
"spreadsheet-reader/SpreadsheetReader", "spreadsheet-reader/SpreadsheetReader",
//"spreadsheet-reader/SpreadsheetReader_CSV", //"spreadsheet-reader/SpreadsheetReader_CSV",
//"spreadsheet-reader/SpreadsheetReader_XLSX", //"spreadsheet-reader/SpreadsheetReader_XLSX",
//"spreadsheet-reader/SpreadsheetReader_XLS", //"spreadsheet-reader/SpreadsheetReader_XLS",
//"spreadsheet-reader/SpreadsheetReader_ODS" //"spreadsheet-reader/SpreadsheetReader_ODS"
); );
foreach($required_files as $file) { foreach($required_files as $file) {
include("./vendor/" . $file . ".php"); include("./vendor/_dist/" . $file . ".php");
} }
$spreadsheet = false; $spreadsheet = false;
$columnNames = array(); $columnNames = array();
$fileFormat = strtolower($format);
/* /*
if($fileFormat == "xlsx") { $fileFormat = strtolower($format);
$spreadsheet = new SpreadsheetReader_XLSX($filepath); if($fileFormat == "xlsx") {
} elseif($fileFormat == "xls") { $spreadsheet = new SpreadsheetReader_XLSX($filepath);
$spreadsheet = new SpreadsheetReader_XLS($filepath); } elseif($fileFormat == "xls") {
} elseif($fileFormat == "csv") { $spreadsheet = new SpreadsheetReader_XLS($filepath);
$spreadsheet = new SpreadsheetReader_CSV($filepath); } elseif($fileFormat == "csv") {
} elseif($fileFormat == "ods") { $spreadsheet = new SpreadsheetReader_CSV($filepath);
$spreadsheet = new SpreadsheetReader_ODS($filepath); } elseif($fileFormat == "ods") {
} else { $spreadsheet = new SpreadsheetReader_ODS($filepath);
$spreadsheet = new SpreadsheetReader($filepath); } else {
} $spreadsheet = new SpreadsheetReader($filepath);
*/ }
$spreadsheet = new SpreadsheetReader($filepath); */
$spreadsheet = new SpreadsheetReader($filepath);
foreach($spreadsheet as $index=>$row) { foreach($spreadsheet as $index=>$row) {
if(!$setColumnName) { if(!$setColumnName) {
$rows[] = $row; $rows[] = $row;
} else { } else {
if($index > 0) { if($index > 0) {
$i = 0; $i = 0;
$cols = array(); $cols = array();
foreach($row as $col) { foreach($row as $col) {
if((count($columnNames) - 1) > $i) { if((count($columnNames) - 1) > $i) {
$cols[$columnNames[$i]] = $col; $cols[$columnNames[$i]] = $col;
} else { } else {
$cols[] = $col; $cols[] = $col;
} }
$i++; $i++;
} }
$rows[] = $cols; $rows[] = $cols;
} else { } else {
$columnNames = array_merge($columnNames, $row); $columnNames = array_merge($columnNames, $row);
} }
} }
} }
return $rows; return $rows;
} }
} }

View File

@ -1,7 +1,7 @@
/** /**
* @file staticgen.php * @file staticgen.php
* @date 2018-07-22 * @date 2018-07-22
* @auther Go Namhyeon <gnh1201@gmail.com> * @auther Go Namhyeon <abuse@catswords.net>
* @brief Static Web Generation Tool for ResaonableFramework * @brief Static Web Generation Tool for ResaonableFramework
*/ */

318
helper/string.utils.php Normal file
View File

@ -0,0 +1,318 @@
<?php
/**
* @file string.utils.php
* @created_on 2018-05-27
* @updated_on 2020-02-21
* @author Go Namhyeon <abuse@catswords.net>
* @brief String utility helper
*/
if(!is_fn("get_converted_string")) {
function get_converted_string($str, $to_charset="detect", $from_charset="detect") {
$result = false;
// detect charset (input)
if($form_charset == "detect") {
if(is_fn(array("mb_detect_encoding", "mb_detect_order"))) {
$from_charset = mb_detect_encoding($str, mb_detect_order(), true);
} else {
$from_charset = "ISO-8859-1";
}
}
// detect charset (output)
if($to_charset == "detect") {
if(is_fn("mb_internal_encoding")) {
$to_charset = mb_internal_encoding();
} elseif(is_fn("iconv_get_encoding")) {
$to_charset = iconv_get_encoding("internal_encoding");
} else {
$_candidates = array(
ini_get("default_charset"),
ini_get("iconv.internal_encoding"),
ini_get("mbstring.internal_encoding"),
"UTF-8"
);
foreach($_candidates as $_candidate) {
if(!empty($_candidate)) {
$to_charset = $_candidate;
break;
}
}
}
}
// normalize charset (UPPERCASE)
$from_charset = strtoupper($from_charset);
$to_charset = strtoupper($to_charset);
// test conditions
if($from_charset == $to_charset) {
$result = $str;
} elseif(is_fn("iconv")) {
$result = iconv($from_charset, $to_charset, $str);
} elseif(is_fn("mb_convert_encoding")) {
$result = mb_convert_encoding($str, $to_charset, $from_charset);
}
return $result;
}
}
if(!is_fn("nl2p")) {
function nl2p($str) {
$paragraphs = "";
foreach(explode_by_line($str) as $line) {
if(trim($line)) {
$paragraphs .= '<p>' . $line . '</p>';
}
}
return $paragraphs;
}
}
if(!is_fn("br2nl")) {
function br2nl($string) {
return preg_replace('/\<br(\s*)?\/?\>/i', DOC_EOL, $string);
}
}
if(!is_fn("br2p")) {
function br2p($string) {
return nl2p(br2nl($string));
}
}
if(!is_fn("get_formatted_number")) {
function get_formatted_number($value) {
return number_format(floatval($value));
}
}
if(!is_fn("get_cutted_string")) {
function get_cutted_string($str, $start, $len=null, $charset="utf-8") {
$result = "";
if(is_fn("iconv_substr")) {
$result = iconv_substr($str, $start, $len, $charset);
} elseif(is_fn("mb_substr")) {
$result = mb_substr($str, $start, $len, $charset);
} else {
$result = substr($str, $start, $len);
}
return $result;
}
}
if(!is_fn("get_string_length")) {
function get_string_length($str, $charset="utf-8") {
$len = 0;
if(is_fn("iconv_strlen")) {
$len = iconv_strlen($str, $charset);
} elseif(is_fn("mb_strlen")) {
$len = mb_strlen($str, $charset);
} else {
$len = strlen($str);
}
return $len;
}
}
if(!is_fn("get_splitted_strings")) {
function get_splitted_strings($str, $len=32, $chsarset="utf-8") {
$strings = array();
$_len = get_string_length($str);
$_pos = 0;
if($len >= $_len) {
$strings[] = $str;
} else {
$__len = ceil($_len / $len);
for($i = 0; $i < $__len; $i++) {
$_pos = $len * $i;
$strings[] = get_cutted_string($str, $_pos, $len, $charset);
}
if($_len - $_pos > 0) {
$strings[] = $strings[] = get_cutted_string($str, $_pos);
}
}
return $strings;
}
}
if(!is_fn("explode_by_line")) {
function explode_by_line($str) {
return preg_split('/\n|\r\n?/', $str);
}
}
// Deprecated: split_by_line()
if(!is_fn("split_by_line")) {
function split_by_line($str) {
return explode_by_line($str);
}
}
if(!is_fn("explode_storage_file_by_line")) {
function explode_storage_file_by_line($filename, $options=array()) {
return explode_by_line(read_storage_file($filename, $options));
}
}
if(!is_fn("strlike")) {
function strlike($haystack, $needle) {
$flag = false;
$s = explode("%", $needle);
$d = count($s);
switch($d) {
case 3:
$flag = (strpos($haystack, $s[1]) !== false);
break;
case 2:
if($s[1] == "") {
//$flag = (strpos($haystack, $s[0]) === 0);
$flag = is_prefix($haystack, $s[0]);
} elseif($s[0] == "") {
//$flag = (strpos($haystack, $s[1]) !== false);
$flag = is_suffix($haystack, $s[1]);
}
break;
default:
$flag = ($needle === $haystack);
}
return $flag;
}
}
if(!is_fn("is_prefix")) {
function is_prefix($haystack, $needle) {
$length = strlen($needle);
return (substr($haystack, 0, $length) === $needle);
}
}
if(!is_fn("is_suffix")) {
function is_suffix($haystack, $needle) {
$length = strlen($needle);
if($length == 0) {
return true;
}
return (substr($haystack, -$length) === $needle);
}
}
if(!is_fn("multi_explode")) {
function multi_explode($delimiters, $string) {
$ready = str_replace($delimiters, $delimiters[0], $string);
$launch = explode($delimiters[0], $ready);
return $launch;
}
}
if(!is_fn("multi_strpos")) {
function multi_strpos($string, $delimiters, $offset=0) {
$last_pos = strlen($string) - 1;
$pos = $last_pos;
if($offset > 0) {
$string = substr($offset);
}
foreach($delimiters as $s) {
$new_pos = strpos($string, $s);
if($new_pos !== false && $pos > $new_pos) {
$pos = $new_pos;
}
}
return (($pos < $last_pos) ? $pos : false);
}
}
if(!is_fn("parse_pipelined_data")) {
function parse_pipelined_data($pipelined_data, $keynames=array()) {
$result = array();
$parsed_data = explode("|", $pipelined_data);
if(count($keynames) > 0) {
$i = 0;
foreach($keynames as $name) {
$result[$name] = $parsed_data[$i];
$i++;
}
} else {
$result = $parsed_data;
}
return $result;
}
}
// https://stackoverflow.com/questions/10290849/how-to-remove-multiple-utf-8-bom-sequences
if(!is_fn("remove_utf8_bom")) {
function remove_utf8_bom($text) {
$bom = pack('H*','EFBBBF');
$text = preg_replace("/^$bom/", '', $text);
return $text;
}
}
if(!is_fn("get_tokenized_text")) {
function get_tokenized_text($text, $delimiters=array()) {
if(count($delimiters) > 0) {
return array_values(array_filter(multi_explode($delimiters, $text)));
} else {
return preg_split('/\s+/', $text, -1, PREG_SPLIT_NO_EMPTY);
}
}
}
if(!is_fn("get_highlighted_html_by_words")) {
function get_highlighted_html_by_word($word, $text, $delimiters=array()) {
$html = $text;
$words = get_tokenized_text($word, $delimiters);
if(check_array_length($words, 0) > 0) {
$html = preg_replace(sprintf("/%s/i", implode("|", $words)), "<strong class=\"highlight\">$0</strong>", $text);
}
return $html;
}
}
if(!is_fn("get_floating_percentage")) {
function get_floating_percentage($x, $a=5) {
return round(floatval($x) / 100.0, $a);
}
}
// https://stackoverflow.com/questions/13108157
if(!is_fn("get_csv_from_array")) {
function get_csv_from_array($data, $delimiter = ',', $enclosure = '"', $escape_char = "\\") {
$f = fopen('php://memory', 'r+');
foreach ($data as $item) {
fputcsv($f, $item, $delimiter, $enclosure, $escape_char);
}
rewind($f);
return stream_get_contents($f);
}
}
if(!is_fn("eregi")) {
function eregi($pattern, $subject, &$matches=NULL) {
return preg_match(sprintf("/%s/i", $pattern), $subject, $matches);
}
}
if(!is_fn("eregi_replace")) {
function eregi_replace($pattern, $replacement, $subject) {
return preg_replace(sprintf("/%s/i", $pattern), $replacement, $subject);
}
}

View File

@ -1,164 +0,0 @@
<?php
/**
* @file string.utl.php
* @date 2018-05-27
* @author Go Namhyeon <gnh1201@gmail.com>
* @brief String utility helper
*/
// for Korean Telephone Number
if(!function_exists("parse_tel_number_kr")) {
function parse_tel_number_kr($tel) {
$output = preg_replace("/[^0-9]/", "", $tel); // 숫자 이외 제거
$local_code = substr($tel, 0, 2);
if ($local_code == '02') {
$output = preg_replace("/([0-9]{2})([0-9]{3,4})([0-9]{4})$/", "\\1-\\2-\\3", $tel);
} elseif (strlen($tel) == '8' && in_array($local_code, array('15', '16', '18'))) {
$output = preg_replace("/([0-9]{4})([0-9]{4})$/", "\\1-\\2", $tel); // 지능망 번호이면
} else {
$output = preg_replace("/([0-9]{3})([0-9]{3,4})([0-9]{4})$/", "\\1-\\2-\\3", $tel);
}
return $output;
}
}
if(!function_exists("get_converted_string")) {
function get_converted_string($str, $to_charset, $from_charset) {
$result = false;
if($form_charset == "detect") {
if(function_exists("mb_detect_encoding") && function_exists("mb_detect_order")) {
$from_charset = mb_detect_encoding($str, mb_detect_order(), true);
} else {
$from_charset = "ISO-8859-1";
}
}
if(function_exists("iconv")) {
$result = iconv($from_charset, $to_charset, $str);
} elseif(function_exists("mb_convert_encoding")) {
$result = mb_convert_encoding($str, $to_charset, $from_charset);
}
return $result;
}
}
if(!function_exists("nl2p")) {
function nl2p($string) {
$paragraphs = '';
foreach (explode("\n", $string) as $line) {
if (trim($line)) {
$paragraphs .= '<p>' . $line . '</p>';
}
}
return $paragraphs;
}
}
if(!function_exists("br2nl")) {
function br2nl($string) {
return preg_replace('/\<br(\s*)?\/?\>/i', "\n", $string);
}
}
if(!function_exists("br2p")) {
function br2p($string) {
return nl2p(br2nl($string));
}
}
if(!function_exists("get_formatted_number")) {
function get_formatted_number($value) {
return number_format(floatval($value));
}
}
if(!function_exists("get_cutted_string")) {
function get_cutted_string($str, $start, $len=0, $charset="utf-8") {
$result = "";
if(function_exists("iconv_substr")) {
$result = iconv_substr($str, $start, $len, $charset);
} elseif(function_exists("mb_substr")) {
$result = mb_substr($str, $start, $len, $charset);
} else {
$result = substr($str, $start, $len);
}
return $result;
}
}
if(!function_exists("explode_by_line")) {
function explode_by_line($str) {
return preg_split('/\n|\r\n?/', $str);
}
}
if(!function_exists("read_storage_file_by_line")) {
function read_storage_file_by_line($filename, $options=array()) {
return explode_by_line(read_storage_file($filename, $options));
}
}
// https://stackoverflow.com/questions/834303/startswith-and-endswith-functions-in-php
if(!function_exists("startsWith")) {
function startsWith($haystack, $needle) {
$length = strlen($needle);
return (substr($haystack, 0, $length) === $needle);
}
}
if(!function_exists("endsWith")) {
function endsWith($haystack, $needle) {
$length = strlen($needle);
if($length == 0) {
return true;
}
return (substr($haystack, -$length) === $needle);
}
}
// https://stackoverflow.com/questions/4955433/php-multiple-delimiters-in-explode/27767665#27767665
if(!function_exists("multiexplode")) {
function multiexplode($delimiters, $string) {
$ready = str_replace($delimiters, $delimiters[0], $string);
$launch = explode($delimiters[0], $ready);
return $launch;
}
}
if(!function_exists("parse_pipelined_data")) {
function parse_pipelined_data($pipelined_data, $keynames=array()) {
$result = array();
$parsed_data = explode("|", $pipelined_data);
if(count($keynames) > 0) {
$i = 0;
foreach($keynames as $name) {
$result[$name] = $parsed_data[$i];
$i++;
}
} else {
$result = $parsed_data;
}
return $result;
}
}
if(function_exists("eregi_compatible")) {
function eregi_compatible($pattern, $subject, &$matches=NULL) {
return preg_match(sprintf("/%s/i", $pattern), $subject, $matches);
}
}
if(function_exists("eregi_replace_compatible")) {
function eregi_replace_compatible($pattern, $replacement, $subject) {
return preg_replace(sprintf("/%s/i", $pattern), $replacement, $subject);
}
}

View File

@ -2,78 +2,78 @@
/** /**
* @file tablewiz.php * @file tablewiz.php
* @date 2018-02-26 * @date 2018-02-26
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief TableWiz helper * @brief TableWiz helper
*/ */
if(!function_exists("tablewiz_cut_str")) { if(!is_fn("tablewiz_cut_str")) {
function tablewiz_cut_str($str, $strlimit=0) { function tablewiz_cut_str($str, $strlimit=0) {
$plaintext = strip_tags($str); $plaintext = strip_tags($str);
// if use html, do not cut text // if use html, do not cut text
if($strlimit > 0 && $str != $plaintext) { if($strlimit > 0 && $str != $plaintext) {
$str = substr($str, 0, $strlimit); $str = substr($str, 0, $strlimit);
} }
return $str; return $str;
} }
} }
if(!function_exists("tablewiz_create")) { if(!is_fn("tablewiz_create")) {
function tablewiz_create($rows, $bind=array(), $domid="", $domclass="", $strlimit=0, $thead_html=array(), $tbody_html_list=array()) { function tablewiz_create($rows, $bind=array(), $domid="", $domclass="", $strlimit=0, $thead_html=array(), $tbody_html_list=array()) {
$html = ""; $html = "";
if(count($rows) == 0) { if(count($rows) == 0) {
return $html; return $html;
} }
$dom_element_name = make_random_id(10); $dom_element_name = make_random_id(10);
$domid = empty($domid) ? "tablewiz_id_" . $dom_element_name : $domid; $domid = empty($domid) ? "tablewiz_id_" . $dom_element_name : $domid;
$domclass = empty($domclass) ? "tablewiz_class_" . $dom_element_name : $domclass; $domclass = empty($domclass) ? "tablewiz_class_" . $dom_element_name : $domclass;
$html_th_elms = ""; $html_th_elms = "";
foreach($rows[0] as $k=>$v) { foreach($rows[0] as $k=>$v) {
$html_th_text = array_key_empty($k, $bind) ? $k : $bind[$k]; $html_th_text = array_key_empty($k, $bind) ? $k : $bind[$k];
$html_th_elms .= "<th>" . tablewiz_cut_str($html_th_text, $strlimit) . "</th>"; $html_th_elms .= "<th>" . tablewiz_cut_str($html_th_text, $strlimit) . "</th>";
} }
// append contents in thead // append contents in thead
foreach($thead_html as $k=>$v) { foreach($thead_html as $k=>$v) {
$html_th_elms .= "<th>" . tablewiz_cut_str($v, $strlimit) . "</th>"; $html_th_elms .= "<th>" . tablewiz_cut_str($v, $strlimit) . "</th>";
} }
$html_tr_elms = ""; $html_tr_elms = "";
foreach($rows as $idx=>$record) { foreach($rows as $idx=>$record) {
$html_tr_elms .= "<tr>"; $html_tr_elms .= "<tr>";
foreach($record as $k=>$v) { foreach($record as $k=>$v) {
$html_tr_elms .= "<td>" . tablewiz_cut_str($v, $strlimit) . "</td>"; $html_tr_elms .= "<td>" . tablewiz_cut_str($v, $strlimit) . "</td>";
} }
$html_tr_elms .= "</tr>"; $html_tr_elms .= "</tr>";
// append contents in tbody // append contents in tbody
if(count($tbody_html_list) > $idx) { if(count($tbody_html_list) > $idx) {
$tbody_html = $tbody_html_list[$idx]; $tbody_html = $tbody_html_list[$idx];
if(is_array($tbody_html)) { if(is_array($tbody_html)) {
foreach($tbody_html as $k=>$v) { foreach($tbody_html as $k=>$v) {
$html_tr_elms .= "<td>" . tablewiz_cut_str($v, $strlimit) . "</td>"; $html_tr_elms .= "<td>" . tablewiz_cut_str($v, $strlimit) . "</td>";
} }
} }
} }
} }
$html .= <<<EOF $html .= <<<EOF
<table id="$domid" class="$domclass" border="1" cellspacing="0"> <table id="$domid" class="$domclass" border="1" cellspacing="0">
<thead> <thead>
<tr> <tr>
$html_th_elms $html_th_elms
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
$html_tr_elms $html_tr_elms
</tbody> </tbody>
</table> </table>
EOF; EOF;
return $html; return $html;
} }
} }

View File

@ -0,0 +1,36 @@
<?php
if(!is_fn("get_youtube_thumbnail")) {
function get_youtube_thumbnail($vi) {
$ytimgs = array();
$ytimg_urls = array();
$ytimg_url = "http://img.youtube.com/vi/:vi/:rs.jpg";
$ytimg_types = array(
"t0" => "0",
"t1" => "1",
"t2" => "2",
"t3" => "3",
"de" => "default",
"mq" => "mqdefault",
"hq" => "hqdefault",
"sd" => "sddefault",
"mx" => "maxresdefault"
);
foreach($ytimg_types as $k=>$v) {
$url = get_web_binded_url($ytimg_url, array(
"vi" => $vi,
"rs" => $v
));
$response = get_web_page($url, "get.cache");
$ytimgs[$k] = $response['content'];
$fpath = write_storage_file($response['content'], array(
"filename" => $response['sha1']
));
$ytimg_urls[$k] = get_storage_url() . "/" . $response['sha1'];
}
return $ytimg_urls;
}
}

View File

@ -2,12 +2,12 @@
/** /**
* @file timetool.php * @file timetool.php
* @date 2018-09-26 * @date 2018-09-26
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief Time tools * @brief Time tools
*/ */
/* Query a time server (C) 1999-09-29, Ralf D. Kloth (QRQ.software) <ralf at qrq.de> */ /* Query a time server (C) 1999-09-29, Ralf D. Kloth (QRQ.software) <ralf at qrq.de> */
if(!function_exists("query_time_server")) { if(!is_fn("query_time_server")) {
function query_time_server($timeserver, $socket) { function query_time_server($timeserver, $socket) {
// parameters: server, socket, error code, error text, timeout // parameters: server, socket, error code, error text, timeout
$fp = fsockopen($timeserver,$socket,$err,$errstr,5); $fp = fsockopen($timeserver,$socket,$err,$errstr,5);
@ -28,7 +28,7 @@ if(!function_exists("query_time_server")) {
} }
} }
if(!function_exists("get_server_time")) { if(!is_fn("get_server_time")) {
function get_server_time($timeserver="time.bora.net") { function get_server_time($timeserver="time.bora.net") {
$timestamp = false; $timestamp = false;
$timercvd = query_time_server($timeserver, 37); $timercvd = query_time_server($timeserver, 37);

97
helper/twilio.api.php Normal file
View File

@ -0,0 +1,97 @@
<?php
/**
* @file twilio.api.php
* @date 2019-04-08
* @author Go Namhyeon <abuse@catswords.net>
* @brief Twilio REST API interface module
* @documentation https://www.twilio.com/docs/sms/send-messages
*/
if(!is_fn("twilio_get_config")) {
function twilio_get_config() {
$config = get_config();
return array(
"sid" => get_value_in_array("twilio_sid", $config, ""),
"token" => get_value_in_array("twilio_token", $config, ""),
"from" => get_value_in_array("twilio_from", $config, ""),
"char_limit" => get_value_in_array("twilio_char_limit", $config, 160)
);
}
}
if(!is_fn("twilio_get_message_blocks")) {
function twilio_parse_messages($message) {
$strings = array();
$cnf = twilio_get_config();
if(loadHelper("string.utils")) {
$strings = get_splitted_strings($message, $cnf['char_limit']);
} else {
$strings[] = substr($messages, 0, $cnf['char_limit']);
}
return $strings;
}
}
if(!is_fn("twilio_send_message")) {
function twilio_send_message($message, $to) {
$response = false;
$cnf = twilio_get_config();
$messages = twilio_parse_messages($message);
if(loadHelper("webpagetool")) {
$bind = array(
"sid" => $cnf['sid']
);
$request_url = get_web_binded_url("https://api.twilio.com/2010-04-01/Accounts/:sid/Messages.json", $bind);
foreach($messages as $_message) {
$response = get_web_json($request_url, "post.cmd", array(
"headers" => array(
"Content-Type" => "application/x-www-form-urlencoded",
"Authentication" => array("Basic", $cnf['sid'], $cnf['token']),
),
"data" => array(
"Body" => $_message,
"From" => $cnf['from'],
"To" => $to,
)
));
}
}
return $response;
}
}
if(!is_fn("twilio_send_voice")) {
function twilio_send_voice($message="", $to) {
$response = false;
$cnf = twilio_get_config();
$url = "http://catswords.re.kr/ep/storage/data/voice.xml";
if(loadHelper("webpagetool")) {
$bind = array(
"sid" => $cnf['sid']
);
$request_url = sprintf("https://api.twilio.com/2010-04-01/Accounts/:sid/Calls.json", $bind);
$response = get_web_page($request_url, "post.cmd", array(
"headers" => array(
"Content-Type" => "application/x-www-form-urlencoded",
"Authentication" => array("Basic", $cnf['sid'], $cnf['token']),
),
"data" => array(
"Url" => $url,
"From" => $cnf['from'],
"To" => $to,
),
));
}
return $response;
}
}

View File

@ -2,253 +2,253 @@
/** /**
* @file vworld.php * @file vworld.php
* @date 2018-01-11 * @date 2018-01-11
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief Geo Helper based on vWorld (vworld.kr, molit.go.kr) * @brief Geo Helper based on vWorld (vworld.kr, molit.go.kr)
*/ */
if(!function_exists("vworld_utf8_replace")) { if(!is_fn("vworld_utf8_replace")) {
function vworld_utf8_replace($data) { function vworld_utf8_replace($data) {
$regex = <<<'END' $regex = <<<'END'
/ /
( (
(?: [\x00-\x7F] # single-byte sequences 0xxxxxxx (?: [\x00-\x7F] # single-byte sequences 0xxxxxxx
| [\xC0-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx | [\xC0-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx
| [\xE0-\xEF][\x80-\xBF]{2} # triple-byte sequences 1110xxxx 10xxxxxx * 2 | [\xE0-\xEF][\x80-\xBF]{2} # triple-byte sequences 1110xxxx 10xxxxxx * 2
| [\xF0-\xF7][\x80-\xBF]{3} # quadruple-byte sequence 11110xxx 10xxxxxx * 3 | [\xF0-\xF7][\x80-\xBF]{3} # quadruple-byte sequence 11110xxx 10xxxxxx * 3
){1,100} # ...one or more times ){1,100} # ...one or more times
) )
| . # anything else | . # anything else
/x /x
END; END;
if (is_array($data)) { if (is_array($data)) {
foreach ($data as $k=>$v) { foreach ($data as $k=>$v) {
$data[$k] = vworld_utf8_replace($v); $data[$k] = vworld_utf8_replace($v);
} }
} }
else if (is_string($data)) { else if (is_string($data)) {
$data = preg_replace($regex, '$1', $data); $data = preg_replace($regex, '$1', $data);
} }
return $data; return $data;
} }
} }
if(!function_exists("vworld_geocode_keyword")) { if(!is_fn("vworld_geocode_keyword")) {
function vworld_geocode_keyword($keyword, $category="Poi", $multiple=false) { function vworld_geocode_keyword($keyword, $category="Poi", $multiple=false) {
global $config; global $config;
$geopoint = array( $geopoint = array(
"address" => "", "address" => "",
"latitude" => "", // y-pos "latitude" => "", // y-pos
"longitude" => "" // x-pos "longitude" => "" // x-pos
); );
$req_urls = array( $req_urls = array(
"http://map.vworld.kr/search.do" // 키워드로 요청 "http://map.vworld.kr/search.do" // 키워드로 요청
); );
// Poi 는 장소 검색. Jibun은 지번주소 검색. Juso는 도로명주소 검색 // Poi 는 장소 검색. Jibun은 지번주소 검색. Juso는 도로명주소 검색
$poss_cates = array("Poi", "Jibun", "Juso"); $poss_cates = array("Poi", "Jibun", "Juso");
if(!in_array($category, $poss_cates)) { if(!in_array($category, $poss_cates)) {
$category = "Poi"; $category = "Poi";
} }
$callback = ""; $callback = "";
$q = $keyword; $q = $keyword;
$pageUnit = 1; $pageUnit = 1;
$output = "json"; $output = "json";
$pageIndex = 1; $pageIndex = 1;
$apiKey = $config['vworld_api_key']; $apiKey = $config['vworld_api_key'];
// 전송 내용 명시 // 전송 내용 명시
$req_data = array( $req_data = array(
"callback" => $callback, "callback" => $callback,
"q" => $q, "q" => $q,
"category" => $category, "category" => $category,
"pageUnit" => $pageUnit, "pageUnit" => $pageUnit,
"output" => $output, "output" => $output,
"pageIndex" => $pageIndex, "pageIndex" => $pageIndex,
"apiKey" => $apiKey "apiKey" => $apiKey
); );
$req_data_query = http_build_query($req_data); $req_data_query = http_build_query($req_data);
$req_props = ""; $req_props = "";
$req_cnt = 0; $req_cnt = 0;
$succ_flag = false; // 성공했는지 여부 $succ_flag = false; // 성공했는지 여부
foreach($req_urls as $base_url) { foreach($req_urls as $base_url) {
$req_props = ""; $req_props = "";
$req_real_url = $base_url . '?' . $req_data_query; $req_real_url = $base_url . '?' . $req_data_query;
// request addr2coord // request addr2coord
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $req_real_url); curl_setopt($ch,CURLOPT_URL, $req_real_url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
// curl_setopt($ch,CURLOPT_HEADER, false); // curl_setopt($ch,CURLOPT_HEADER, false);
if($req_output = curl_exec($ch)) { if($req_output = curl_exec($ch)) {
if(!empty(trim($req_output))) { if(!empty(trim($req_output))) {
$req_props = json_decode($req_output); $req_props = json_decode($req_output);
// 좌표만을 추출 // 좌표만을 추출
$geo_list = array(); $geo_list = array();
foreach($req_props->LIST as $req_row) { foreach($req_props->LIST as $req_row) {
$req_row = get_object_vars($req_row); $req_row = get_object_vars($req_row);
$geo_list[] = $req_row; $geo_list[] = $req_row;
} }
// 단일인지 복수인지 // 단일인지 복수인지
if(count($geo_list) > 0) { if(count($geo_list) > 0) {
if($multiple == false) { if($multiple == false) {
$req_props = $geo_list[0]; $req_props = $geo_list[0];
} else { } else {
$req_props = $geo_list; $req_props = $geo_list;
} }
$succ_flag = true; $succ_flag = true;
} else { } else {
$succ_flag = false; $succ_flag = false;
} }
} }
} }
curl_close($ch); curl_close($ch);
// 요청 횟수를 기록 // 요청 횟수를 기록
$req_cnt++; $req_cnt++;
// 성공했을 시 다음 주소로 넘어가지 않음 // 성공했을 시 다음 주소로 넘어가지 않음
if($succ_flag == true) { if($succ_flag == true) {
$xpos = $req_props['xpos']; $xpos = $req_props['xpos'];
$ypos = $req_props['ypos']; $ypos = $req_props['ypos'];
// store lat and lon // store lat and lon
if($ypos > 0 && $xpos > 0) { if($ypos > 0 && $xpos > 0) {
$geopoint['address'] = $req_props['juso']; $geopoint['address'] = $req_props['juso'];
$geopoint['latitude'] = $ypos; $geopoint['latitude'] = $ypos;
$geopoint['longitude'] = $xpos; $geopoint['longitude'] = $xpos;
} }
break; break;
} elseif($req_cnt = count($req_urls)) { } elseif($req_cnt = count($req_urls)) {
$req_props = array(); $req_props = array();
} else { } else {
$req_props = array(); $req_props = array();
} }
} }
return $geopoint; return $geopoint;
} }
} }
// get geocode from vworld // get geocode from vworld
if(!function_exists("vworld_geocode_addr2coord")) { if(!is_fn("vworld_geocode_addr2coord")) {
function vworld_geocode_addr2coord($addr) { function vworld_geocode_addr2coord($addr) {
global $config; global $config;
$geopoint = array( $geopoint = array(
"address" => "", "address" => "",
"latitude" => "", // y-pos "latitude" => "", // y-pos
"longitude" => "" // x-pos "longitude" => "" // x-pos
); );
// base url // base url
$req_urls = array( $req_urls = array(
"http://apis.vworld.kr/jibun2coord.do", // 구주소 요청 "http://apis.vworld.kr/jibun2coord.do", // 구주소 요청
"http://apis.vworld.kr/new2coord.do" // 신주소 요청 "http://apis.vworld.kr/new2coord.do" // 신주소 요청
); );
// 기본 설정 // 기본 설정
$apiKey = $config['vworld_api_key']; $apiKey = $config['vworld_api_key'];
$domain = $config['vworld_api_domain']; $domain = $config['vworld_api_domain'];
$output = "json"; $output = "json";
$epsg = "EPSG:4326"; // default is EPSG:4326 $epsg = "EPSG:4326"; // default is EPSG:4326
$callback = ""; $callback = "";
// 전송 내용 명시 // 전송 내용 명시
$req_data = array( $req_data = array(
"q" => $addr, "q" => $addr,
"apiKey" => $apiKey, "apiKey" => $apiKey,
"domain" => $domain, "domain" => $domain,
"output" => $output, "output" => $output,
"epsg" => $epsg, "epsg" => $epsg,
"callback" => $callback "callback" => $callback
); );
$req_data_query = http_build_query($req_data); $req_data_query = http_build_query($req_data);
$req_props = ""; $req_props = "";
$req_cnt = 0; $req_cnt = 0;
$succ_flag = false; // 성공했는지 여부 $succ_flag = false; // 성공했는지 여부
foreach($req_urls as $base_url) { foreach($req_urls as $base_url) {
$req_props = ""; $req_props = "";
$req_real_url = $base_url . '?' . $req_data_query; $req_real_url = $base_url . '?' . $req_data_query;
// request addr2coord // request addr2coord
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $req_real_url); curl_setopt($ch, CURLOPT_URL, $req_real_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// curl_setopt($ch,CURLOPT_HEADER, false); // curl_setopt($ch,CURLOPT_HEADER, false);
if($req_output = curl_exec($ch)) { if($req_output = curl_exec($ch)) {
if(!empty(trim($req_output))) { if(!empty(trim($req_output))) {
$req_props = json_decode($req_output); $req_props = json_decode($req_output);
if(count($req_props) > 0) { if(count($req_props) > 0) {
$req_props = get_object_vars($req_props); $req_props = get_object_vars($req_props);
$req_props = vworld_utf8_replace($req_props); $req_props = vworld_utf8_replace($req_props);
$succ_flag = true; $succ_flag = true;
} }
} }
} }
curl_close($ch); curl_close($ch);
// 요청 횟수를 기록 // 요청 횟수를 기록
$req_cnt++; $req_cnt++;
// 성공했을 시 다음 주소로 넘어가지 않음 // 성공했을 시 다음 주소로 넘어가지 않음
if($succ_flag == true) { if($succ_flag == true) {
$xpos = 0; $xpos = 0;
$ypos = 0; $ypos = 0;
switch($epsg) { switch($epsg) {
case "EPSG:900913": case "EPSG:900913":
$xpos = $req_props['EPSG_900913_X'] ; $xpos = $req_props['EPSG_900913_X'] ;
$ypos = $req_props['EPSG_900913_Y']; $ypos = $req_props['EPSG_900913_Y'];
if($xpos > 0 && $ypos> 0) { if($xpos > 0 && $ypos> 0) {
$geopoint['address'] = $req_props['JUSO']; $geopoint['address'] = $req_props['JUSO'];
$geopoint['latitude'] = $ypos; $geopoint['latitude'] = $ypos;
$geopoint['longitude'] = $xpos; $geopoint['longitude'] = $xpos;
} }
break; break;
case "EPSG:4326": // default is EPSG:4326 case "EPSG:4326": // default is EPSG:4326
default: default:
$xpos = $req_props['EPSG_4326_X']; $xpos = $req_props['EPSG_4326_X'];
$ypos = $req_props['EPSG_4326_Y']; $ypos = $req_props['EPSG_4326_Y'];
if($xpos > 0 && $ypos> 0) { if($xpos > 0 && $ypos> 0) {
$geopoint['address'] = $req_props['JUSO']; $geopoint['address'] = $req_props['JUSO'];
$geopoint['latitude'] = $ypos; $geopoint['latitude'] = $ypos;
$geopoint['longitude'] = $xpos; $geopoint['longitude'] = $xpos;
} }
break; break;
} }
break; break;
} elseif($req_cnt = count($req_urls)) { } elseif($req_cnt = count($req_urls)) {
$req_props = ""; $req_props = "";
} else { } else {
$req_props = ""; $req_props = "";
} }
} }
return $geopoint; return $geopoint;
} }
} }
if(!function_exists("vworld_adaptive_addr2coord")) { if(!is_fn("vworld_adaptive_addr2coord")) {
function vworld_adaptive_addr2coord($addr) { function vworld_adaptive_addr2coord($addr) {
$geopoint = array( $geopoint = array(
"address" => "", "address" => "",
"latitude" => "", // y-pos "latitude" => "", // y-pos
"longitude" => "" // x-pos "longitude" => "" // x-pos
); );
if(!empty($addr)) { if(!empty($addr)) {
$georesult = vworld_geocode_keyword($addr); $georesult = vworld_geocode_keyword($addr);
if(empty($georesult["address"])) { if(empty($georesult["address"])) {
$georesult = vworld_geocode_addr2coord($addr); $georesult = vworld_geocode_addr2coord($addr);
} }
if(empty($georesult["address"])) { if(empty($georesult["address"])) {
$addr_blocks = explode(' ', $addr); $addr_blocks = explode(' ', $addr);
$newaddr = implode(' ', array_slice($addr_blocks, 0, -1)); $newaddr = implode(' ', array_slice($addr_blocks, 0, -1));
$georesult = vworld_adaptive_addr2coord($newaddr); $georesult = vworld_adaptive_addr2coord($newaddr);
} }
} }
return $georesult; return $georesult;
} }
} }

74
helper/webhooktool.php Normal file
View File

@ -0,0 +1,74 @@
<?php
/**
* @file webhooktool.php
* @date 2019-05-04
* @author Go Namhyeon <abuse@catswords.net>
* @brief WebhookTools
* @trademark
* * `NateOn` is trademark of SK Communications Co Ltd., SK Planet Co Ltd., or other SK businesses.
* * `Discord' is trademark of Discord Inc. (Originally Hammer And Chisel)
* * `Slack` is trademark of Slack Technologies Inc.
*/
if(!is_fn("send_web_hook")) {
function send_web_hook($message, $networkid, $options=array()) {
$response = false;
$id = get_value_in_array("id", $options, "");
$username = get_value_in_array("username", $options, "ReasonableBot");
$message = str_replace("http:", "hxxp:", $message);
switch($networkid) {
case "nateon":
$request_url = sprintf("https://teamroom.nate.com/api/webhook/%s", $id);
if(loadHelper("webpagetool")) {
$response = get_web_page($request_url, "post", array(
"headers" => array(
"Content-Type" => "application/x-www-form-urlencoded",
),
"data" => array(
"content" => urlencode($message),
),
));
}
break;
case "discord":
$request_url = sprintf("https://discordapp.com/api/webhooks/%s", $id);
if(loadHelper("webpagetool")) {
$response = get_web_json($request_url, "jsondata", array(
"headers" => array(
"Content-Type" => "application/json",
),
"data" => array(
"content" => $message,
"username" => $username,
),
));
}
break;
case "slack":
$request_url = sprintf("https://hooks.slack.com/services/%s", $id);
if(loadHelper("webpagetool")) {
$response = get_web_json($request_url, "jsondata", array(
"headers" => array(
"Content-Type" => "application/json",
),
"data" => array(
"channel" => sprintf("#%s", get_value_in_array("channel", $options, "general")),
"username" => $username,
"text" => $message,
"icon_emoji" => sprintf(":%s:", get_value_in_array("emoji", $options, "ghost")),
),
));
}
break;
}
return $response;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -2,211 +2,211 @@
/** /**
* @file wprest.php * @file wprest.php
* @date 2018-03-14 * @date 2018-03-14
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief Wordpress Rest API helper * @brief Wordpress Rest API helper
*/ */
if(!function_exists("get_wp_posts")) { if(!is_fn("get_wp_posts")) {
function get_wp_posts($wp_server_url) { function get_wp_posts($wp_server_url) {
$results = array(); $results = array();
$posts = parse_wp_posts($wp_server_url); $posts = parse_wp_posts($wp_server_url);
$url_res = parse_url($wp_server_url); $url_res = parse_url($wp_server_url);
$origin = $url_res['host']; $origin = $url_res['host'];
foreach($posts as $post) { foreach($posts as $post) {
$title = $post['title']; $title = $post['title'];
$content = $post['content']; $content = $post['content'];
$link = $post['link']; $link = $post['link'];
$object_id = $post['id']; $object_id = $post['id'];
$new_message = get_wp_new_message($title, $content, $link); $new_message = get_wp_new_message($title, $content, $link);
$alt_message = get_wp_new_message($title, $content); $alt_message = get_wp_new_message($title, $content);
$results[] = array( $results[] = array(
"origin" => $origin, "origin" => $origin,
"title" => $title, "title" => $title,
"content" => $content, "content" => $content,
"link" => $link, "link" => $link,
"message" => $new_message, "message" => $new_message,
"alt_message" => $alt_message, "alt_message" => $alt_message,
"object_id" => $object_id, "object_id" => $object_id,
"hash_title" => get_hashed_text($title), "hash_title" => get_hashed_text($title),
"hash_content" => get_hashed_text($content), "hash_content" => get_hashed_text($content),
"hash_link" => get_hashed_text($link), "hash_link" => get_hashed_text($link),
"hash_message" => get_hashed_text($new_message), "hash_message" => get_hashed_text($new_message),
"hash_alt_message" => get_hashed_text($alt_message) "hash_alt_message" => get_hashed_text($alt_message)
); );
} }
return $results; return $results;
} }
} }
if(!function_exists("parse_wp_posts")) { if(!is_fn("parse_wp_posts")) {
function parse_wp_posts($wp_server_url) { function parse_wp_posts($wp_server_url) {
$rest_no_route = false; $rest_no_route = false;
$posts = array(); $posts = array();
$results = array(); $results = array();
$response = get_web_json($wp_server_url, "get", array( $response = get_web_json($wp_server_url, "get", array(
"rest_route" => "/wp/v2/posts/" "rest_route" => "/wp/v2/posts/"
)); ));
$code = get_value_in_object("code", $response); $code = get_value_in_object("code", $response);
if($code === "rest_no_route") { if($code === "rest_no_route") {
$rest_no_route = true; $rest_no_route = true;
$response = get_web_xml($wp_server_url, "get", array( $response = get_web_xml($wp_server_url, "get", array(
"feed" => "rss2" "feed" => "rss2"
)); ));
} }
if($rest_no_route === false) { if($rest_no_route === false) {
$posts = $response; $posts = $response;
foreach($posts as $post) { foreach($posts as $post) {
$results[] = array( $results[] = array(
"title" => get_clean_xss($post->title->rendered, 1), "title" => get_clean_xss($post->title->rendered, 1),
"content" => get_clean_xss($post->content->rendered, 1), "content" => get_clean_xss($post->content->rendered, 1),
"link" => get_clean_xss($post->guid->rendered, 1), "link" => get_clean_xss($post->guid->rendered, 1),
"id" => $post->id, "id" => $post->id,
); );
} }
} else { } else {
$posts = $response->channel->item; $posts = $response->channel->item;
foreach($posts as $post) { foreach($posts as $post) {
$post_link = get_clean_xss($post->link); $post_link = get_clean_xss($post->link);
$post_link_paths = array_filter(explode("/", $post_link), "strlen"); $post_link_paths = array_filter(explode("/", $post_link), "strlen");
$results[] = array( $results[] = array(
"title" => get_clean_xss($post->title), "title" => get_clean_xss($post->title),
"content" => get_clean_xss($post->description), "content" => get_clean_xss($post->description),
"link" => $post_link, "link" => $post_link,
"id" => end($post_link_paths), "id" => end($post_link_paths),
); );
} }
} }
return $results; return $results;
} }
} }
if(!function_exists("get_wp_new_message")) { if(!is_fn("get_wp_new_message")) {
function get_wp_new_message($title, $content, $link="") { function get_wp_new_message($title, $content, $link="") {
$new_message = ""; $new_message = "";
$clean_title = get_clean_text($title); $clean_title = get_clean_text($title);
$clean_content = get_clean_text($content); $clean_content = get_clean_text($content);
$clean_llnk = get_clean_text($link); $clean_llnk = get_clean_text($link);
$message = $clean_title . " \n" . $clean_content; $message = $clean_title . " \n" . $clean_content;
$words = explode(' ', $message); $words = explode(' ', $message);
$words_choice = array_slice($words, 0, 30); $words_choice = array_slice($words, 0, 30);
$new_message = trim(implode(' ', $words_choice)); $new_message = trim(implode(' ', $words_choice));
if(!empty($clean_llnk)) { if(!empty($clean_llnk)) {
$new_message .= " " . $clean_llnk; $new_message .= " " . $clean_llnk;
} }
return $new_message; return $new_message;
} }
} }
if(!function_exists("authenticate_wp")) { if(!is_fn("authenticate_wp")) {
function authenticate_wp($wp_server_url, $client_id, $client_secret, $route="", $code="", $scope="basic", $state="") { function authenticate_wp($wp_server_url, $client_id, $client_secret, $route="", $code="", $scope="basic", $state="") {
$flag = false; $flag = false;
$wp_access_token = get_session("wp_access_token"); $wp_access_token = get_session("wp_access_token");
$result = array( $result = array(
"redirect_uri" => false, "redirect_uri" => false,
"response" => false "response" => false
); );
if(empty($wp_access_token)) { if(empty($wp_access_token)) {
if(empty($code)) { if(empty($code)) {
// step 1 // step 1
$redirect_uri = get_web_build_qs($wp_server_url . "/oauth/authorize", array( $redirect_uri = get_web_build_qs($wp_server_url . "/oauth/authorize", array(
"client_id" => $client_id, "client_id" => $client_id,
"redirect_uri" => get_route_link($route), "redirect_uri" => get_route_link($route),
"response_type" => "code", "response_type" => "code",
"scope" => $scope, "scope" => $scope,
"state" => $state "state" => $state
)); ));
$result['redirect_uri'] = $redirect_uri; $result['redirect_uri'] = $redirect_uri;
} else { } else {
// step 2 // step 2
$response = get_web_json($wp_server_url . "/oauth/token/", "jsondata", array( $response = get_web_json($wp_server_url . "/oauth/token/", "jsondata", array(
"headers" => array( "headers" => array(
"Content-Type" => "application/x-www-form-urlencoded", "Content-Type" => "application/x-www-form-urlencoded",
"Authorization" => sprintf("Basic %s", base64_encode($client_id . ":" . $client_secret)) "Authorization" => sprintf("Basic %s", base64_encode($client_id . ":" . $client_secret))
), ),
"data" => array( "data" => array(
"grant_type" => "authorization_code", "grant_type" => "authorization_code",
"code" => $code, "code" => $code,
"client_id" => $client_id, "client_id" => $client_id,
"client_secret" => $client_secret, "client_secret" => $client_secret,
"redirect_uri" => get_route_link($route), "redirect_uri" => get_route_link($route),
"state" => $state "state" => $state
) )
)); ));
// store access token to session // store access token to session
set_session("wp_access_token", $response->access_token); set_session("wp_access_token", $response->access_token);
set_session("wp_expires_in", $response->expires_in); set_session("wp_expires_in", $response->expires_in);
set_session("wp_token_type", $response->token_type); set_session("wp_token_type", $response->token_type);
set_session("wp_scope", $response->scope); set_session("wp_scope", $response->scope);
set_session("refresh_token", $response->refresh_token); set_session("refresh_token", $response->refresh_token);
// store respose to result // store respose to result
$result['redirect_uri'] = get_route_link($route); $result['redirect_uri'] = get_route_link($route);
$result['response'] = $response; $result['response'] = $response;
} }
if(!array_key_empty("redirect_uri", $result)) { if(!array_key_empty("redirect_uri", $result)) {
redirect_uri($result['redirect_uri']); redirect_uri($result['redirect_uri']);
} }
} else { } else {
$flag = true; $flag = true;
} }
return $result; return $result;
} }
} }
if(!function_exists("write_wp_post")) { if(!is_fn("write_wp_post")) {
function write_wp_post($wp_server_url, $access_token, $data=array()) { function write_wp_post($wp_server_url, $access_token, $data=array()) {
$default_data = array( $default_data = array(
"title" => "Untitled", "title" => "Untitled",
"content" => "insert your content", "content" => "insert your content",
"author" => 2, "author" => 2,
"status" => "publish", "status" => "publish",
"categories" => "" "categories" => ""
); );
foreach($data as $k=>$v) { foreach($data as $k=>$v) {
$default_data[$k] = $v; $default_data[$k] = $v;
} }
$response = get_web_json(get_web_build_qs($wp_server_url, array( $response = get_web_json(get_web_build_qs($wp_server_url, array(
"rest_route" => "/wp/v2/posts" "rest_route" => "/wp/v2/posts"
)), "jsondata", array( )), "jsondata", array(
"headers" => array( "headers" => array(
"Content-Type" => "application/x-www-form-urlencoded", "Content-Type" => "application/x-www-form-urlencoded",
"Authorization" => "Bearer " . $access_token "Authorization" => "Bearer " . $access_token
), ),
"data" => $default_data "data" => $default_data
) )
); );
return $response; return $response;
} }
} }
if(!function_exists("get_wp_categories")) { if(!is_fn("get_wp_categories")) {
function get_wp_categories($wp_server_url, $access_token) { function get_wp_categories($wp_server_url, $access_token) {
$response = get_web_json(get_web_build_qs($wp_server_url, array( $response = get_web_json(get_web_build_qs($wp_server_url, array(
"rest_route" => "/wp/v2/categories" "rest_route" => "/wp/v2/categories"
)), "get"); )), "get");
return $response; return $response;
} }
} }

321
helper/zabbix.api.php Normal file
View File

@ -0,0 +1,321 @@
<?php
/**
* @file zabbix.api.php
* @created_on 2019-04-08
* @updated_on 2020-03-05
* @author Go Namhyeon <abuse@catswords.net>
* @brief Zabbix JSON-RPC API (3.0) interface module
* @documentation https://www.zabbix.com/documentation/current/ (4.4)
*/
if(!is_fn("get_zabbix_config")) {
function get_zabbix_config() {
$config = get_config();
return array(
"host" => get_value_in_array("zabbix_host", $config, "127.0.0.1"),
"username" => get_value_in_array("zabbix_username", $config, "Admin"),
"password" => get_value_in_array("zabbix_password", $config, "zabbix"),
"protocol" => get_value_in_array("zabbix_protocol", $config, "http"),
);
}
}
if(!is_fn("zabbix_get_base_url")) {
function zabbix_get_api_url() {
$cnf = get_zabbix_config();
return sprintf("%s://%s/zabbix/api_jsonrpc.php", $cnf['protocol'], $cnf['host']);
}
}
if(!is_fn("zabbix_get_id")) {
function zabbix_get_id() {
return 1;
}
}
if(!is_fn("zabbix_authenticate")) {
function zabbix_authenticate() {
$response = false;
// get zabbix configuration
$cnf = get_zabbix_config();
// get zabbix api url
$zabbix_api_url = zabbix_get_api_url($cnf['host'], $cnf['protocol']);
// connect to zabbix server
if(loadHelper("webpagetool")) {
$response = get_web_json($zabbix_api_url, "jsonrpc2.cache", array(
"method" => "user.login",
"params" => array(
"user" => $cnf['username'],
"password" => $cnf['password'],
),
"id" => zabbix_get_id(),
"auth" => null
));
}
// set connection to global scope
set_shared_var("zabbix_api_url", $zabbix_api_url);
set_shared_var("zabbix_auth", get_property_value("result", $response));
return $response;
}
}
if(!is_fn("zabbix_get_hostgroups")) {
function zabbix_get_hostgroups() {
$hostgroups = false;
$response = false;
// get zabbix authentication
$zabbix_api_url = get_shared_var("zabbix_api_url");
$zabbix_auth = get_shared_var("zabbix_auth");
// connect to zabbix server
if(loadHelper("webpagetool")) {
$response = get_web_json($zabbix_api_url, "jsonrpc2.cache", array(
"method" => "hostgroup.get",
"params" => array(
"output" => "extend"
),
"id" => zabbix_get_id(),
"auth" => $zabbix_auth
));
$hostgroups = get_property_value("result", $response);
}
return $hostgroups;
}
}
if(!is_fn("zabbix_get_hosts")) {
function zabbix_get_hosts() {
$hosts = false;
$response = false;
// get zabbix authentication
$zabbix_api_url = get_shared_var("zabbix_api_url");
$zabbix_auth = get_shared_var("zabbix_auth");
// connect to zabbix server
if(loadHelper("webpagetool")) {
$response = get_web_json($zabbix_api_url, "jsonrpc2.cache", array(
"method" => "host.get",
"params" => array(
"output" => array("hostid", "host", "status"),
"selectInterfaces" => array("interfaceid", "ip"),
"selectGroups" => "extend"
),
"id" => zabbix_get_id(),
"auth" => $zabbix_auth
));
$hosts = get_property_value("result", $response);
}
return $hosts;
}
}
if(!is_fn("zabbix_retrieve_hosts")) {
function zabbix_retrieve_hosts() {
return zabbix_get_hosts();
}
}
if(!is_fn("zabbix_get_items")) {
function zabbix_get_items($hostids=null) {
$items = false;
$results = false;
$response = false;
// get zabbix authentication
$zabbix_api_url = get_shared_var("zabbix_api_url");
$zabbix_auth = get_shared_var("zabbix_auth");
// connect to zabbix server
if(loadHelper("webpagetool")) {
$response = get_web_json($zabbix_api_url, "jsonrpc2.cache", array(
"method" => "host.get",
"params" => array(
"selectInventory" => true,
"selectItems" => array("name", "key_", "status", "lastvalue", "units", "itemid", "lastclock", "value_type", "itemid"),
"output" => "extend",
"hostids" => $hostids,
"expandDescription" => 1,
"expandData" => 1,
),
"id" => zabbix_get_id(),
"auth" => $zabbix_auth
));
$results = get_property_value("result", $response);
foreach($results as $result) {
$items = get_property_value("items", $result);
break;
}
}
return $items;
}
}
if(!is_fn("zabbix_get_problems")) {
function zabbix_get_problems($hostids=null) {
$problems = false;
$response = false;
// get zabbix authentication
$zabbix_api_url = get_shared_var("zabbix_api_url");
$zabbix_auth = get_shared_var("zabbix_auth");
// connect to zabbix server
if(loadHelper("webpagetool")) {
$response = get_web_json($zabbix_api_url, "jsonrpc2.cache", array(
"method" => "problem.get",
"params" => array(
"output" => "extend",
"selectAcknowledges" => "extend",
"selectTags" => "extend",
"selectSuppressionData" => "extend",
"hostids" => $hostids,
"recent" => "false",
//"suppressed" => "false",
//"acknowledged" => "false",
//"sortfield" => ["eventid"],
//"sortorder" => "DESC",
//"time_from" => get_current_datetime(array("adjust" => "1 hour"))
),
"id" => zabbix_get_id(),
"auth" => $zabbix_auth
));
}
$problems = get_property_value("result", $response);
return $problems;
}
}
if(!is_fn("zabbix_get_triggers")) {
function zabbix_get_triggers($hostids=null) {
$triggers = false;
$response = false;
// get zabbix authentication
$zabbix_api_url = get_shared_var("zabbix_api_url");
$zabbix_auth = get_shared_var("zabbix_auth");
if(loadHelper("webpagetool")) {
$response = get_web_json($zabbix_api_url, "jsonrpc2.cache", array(
"method" => "trigger.get",
"params" => array(
"hostids" => $hostids,
"output" => "extend",
"selectFunctions" => "extend",
"filter" => array(
"value" => 1,
"status" => 0
)
),
"id" => zabbix_get_id(),
"auth" => $zabbix_auth
));
}
$triggers = get_property_value("result", $response);
return $triggers;
}
}
if(!is_fn("zabbix_get_alerts")) {
function zabbix_get_alerts($hostids=null, $time_from=0, $time_till=0) {
$alerts = false;
$response = false;
// get zabbix authentication
$zabbix_api_url = get_shared_var("zabbix_api_url");
$zabbix_auth = get_shared_var("zabbix_auth");
if(loadHelper("webpagetool")) {
$params = array(
"output" => "extend",
"hostids" => $hostids,
"sortfield" => array("clock", "eventid"),
"sortorder" => "DESC"
);
if($time_from > 0) {
$params['time_from'] = $time_from - 1;
}
if($time_till > 0) {
$params['time_till'] = $time_till + 1;
}
$response = get_web_json($zabbix_api_url, "jsonrpc2.cache", array(
"method" => "event.get",
"params" => array(
"output" => "extend",
"hostids" => $hostids,
"sortfield" => array("clock", "eventid"),
"sortorder" => "DESC"
),
"auth" => $zabbix_auth,
"id" => zabbix_get_id()
));
$alerts = get_property_value("result", $response);
}
return $alerts;
}
}
if(!is_fn("zabbix_get_records")) {
function zabbix_get_records($itemids, $now_dt="", $adjust="-24h", $value_type=3) {
$records = false;
$response = false;
// get current datetime
if(empty($now_dt)) {
$now_dt = get_current_datetime();
}
// get zabbix authentication
$zabbix_api_url = get_shared_var("zabbix_api_url");
$zabbix_auth = get_shared_var("zabbix_auth");
// set time range variables
$time_from = get_current_timestamp(array("now" => $now_dt, "adjust" => $adjust));
$time_till = get_current_timestamp(array("now" => $now_dt));
// get history
// 0-numeric float; 1-character; 2-log; 3-numeric unsigned; 4-text
if(loadHelper("webpagetool")) {
$params = array(
"output" => "extend",
"history" => $value_type,
"itemids" => $itemids,
"sortfield" => "clock",
"sortorder" => "DESC",
"time_from" => $time_from,
"time_till" => $time_till
);
$response = get_web_json($zabbix_api_url, "jsonrpc2.cache", array(
"method" => "history.get",
"params" => $params,
"auth" => $zabbix_auth,
"id" => zabbix_get_id()
));
$records = get_property_value("result", $response);
}
return $records;
}
}

View File

@ -2,121 +2,121 @@
/** /**
* @file zeroboard4.dbt.php * @file zeroboard4.dbt.php
* @date 2018-08-20 * @date 2018-08-20
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief Database Helper for Zeroboard 4 PL 9 (experimental) * @brief Database Helper for Zeroboard 4 PL 9 (experimental)
*/ */
// get database prefix // get database prefix
if(!function_exists("zb4_get_db_prefix")) { if(!is_fn("zb4_get_db_prefix")) {
function zb4_get_db_prefix() { function zb4_get_db_prefix() {
return "zetyx_"; return "zetyx_";
} }
} }
// get table // get table
if(!function_exists("zb4_get_db_table")) { if(!is_fn("zb4_get_db_table")) {
function zb4_get_db_table($tablename) { function zb4_get_db_table($tablename) {
return (zb4_get_db_prefix() . $tablename); return (zb4_get_db_prefix() . $tablename);
} }
} }
// get write table // get write table
if(!function_exists("zb4_get_write_table")) { if(!is_fn("zb4_get_write_table")) {
function zb4_get_write_table($tablename, $version=4) { function zb4_get_write_table($tablename, $version=4) {
$write_prefix = zb4_get_db_prefix() . "board_"; $write_prefix = zb4_get_db_prefix() . "board_";
$write_table = $write_prefix . $tablename; $write_table = $write_prefix . $tablename;
return $write_table; return $write_table;
} }
} }
// write post // write post
if(!function_exists("zb4_write_post")) { if(!is_fn("zb4_write_post")) {
function zb4_write_post($tablename, $data=array()) { function zb4_write_post($tablename, $data=array()) {
$result = 0; $result = 0;
$write_table = zb4_get_write_table($tablename); $write_table = zb4_get_write_table($tablename);
$mb_id = get_current_user_name(); $mb_id = get_current_user_name();
// load helpers // load helpers
loadHelper("networktool"); loadHelper("networktool");
loadHelper("naturename.kr"); loadHelper("naturename.kr");
$write_fields = array(); $write_fields = array();
$write_default_fields = array( $write_default_fields = array(
//"no" => "", // auto increment //"no" => "", // auto increment
"division" => "1", "division" => "1",
"headnum" => "0", "headnum" => "0",
"arrangenum" => "0", "arrangenum" => "0",
"depth" => "0", "depth" => "0",
"prev_no" => "0", "prev_no" => "0",
"next_no" => "0", "next_no" => "0",
"father" => "0", "father" => "0",
"child" => "0", "child" => "0",
"ismember" => "0", "ismember" => "0",
"islevel" => "10", "islevel" => "10",
"memo" => "" "memo" => ""
"ip" => get_network_client_addr(), "ip" => get_network_client_addr(),
"password" => "", "password" => "",
"name" => naturename_kr_get_generated_name(), "name" => naturename_kr_get_generated_name(),
"homepage" => "", "homepage" => "",
"email" => "", "email" => "",
"subject" => "", "subject" => "",
"use_html" => "0", "use_html" => "0",
"reply_mail" => "0", "reply_mail" => "0",
"category" => "1", "category" => "1",
"is_secret" => "0", "is_secret" => "0",
"sitelink1" => "", "sitelink1" => "",
"sitelink2" => "", "sitelink2" => "",
"file_name1" => "", "file_name1" => "",
"file_name2" => "", "file_name2" => "",
"s_file_name1" => "", "s_file_name1" => "",
"s_file_name2" => "", "s_file_name2" => "",
"download1" => "0", "download1" => "0",
"download2" => "0", "download2" => "0",
"reg_date" => "0", "reg_date" => "0",
"hit" => "0", "hit" => "0",
"vote" => "0", "vote" => "0",
"total_comment" => "0", "total_comment" => "0",
"x" => "", "x" => "",
"y" => "", "y" => "",
); );
foreach($write_default_fields as $k=>$v) { foreach($write_default_fields as $k=>$v) {
if(in_array($k, array("mb_id", "wr_num"))) { if(in_array($k, array("mb_id", "wr_num"))) {
$write_fields[$k] = $v; $write_fields[$k] = $v;
} else { } else {
$write_fields[$k] = array_key_empty($k, $data) ? $v : $data[$k]; $write_fields[$k] = array_key_empty($k, $data) ? $v : $data[$k];
} }
} }
foreach($data as $k=>$v) { foreach($data as $k=>$v) {
if(!in_array($k, $write_default_fields)) { if(!in_array($k, $write_default_fields)) {
$write_fields[$k] = $v; $write_fields[$k] = $v;
} }
} }
if(count($write_fields) > 0) { if(count($write_fields) > 0) {
$sql = get_bind_to_sql_insert($write_table, $write_fields); $sql = get_bind_to_sql_insert($write_table, $write_fields);
if(exec_db_query($sql, $write_fields)) { if(exec_db_query($sql, $write_fields)) {
$result = get_db_last_id(); $result = get_db_last_id();
} }
} }
return $result; return $result;
} }
} }
if(!function_exists("zb4_get_posts")) { if(!is_fn("zb4_get_posts")) {
function zb4_get_posts($table_name, $page=1, $limit=20, $options=array()) { function zb4_get_posts($table_name, $page=1, $limit=20, $options=array()) {
$sql = "select * from " . zb4_get_write_table($table_name) . " order by no desc" . get_page_range($page, $limit); $sql = "select * from " . zb4_get_write_table($table_name) . " order by no desc" . get_page_range($page, $limit);
return exec_db_fetch_all($sql); return exec_db_fetch_all($sql);
} }
} }
if(!function_exists("zb4_get_post_by_id")) { if(!is_fn("zb4_get_post_by_id")) {
function zb4_get_post_by_id($table_name, $post_id) { function zb4_get_post_by_id($table_name, $post_id) {
$sql = "select * from " . zb4_get_write_table($table_name) . " where no = :no"; $sql = "select * from " . zb4_get_write_table($table_name) . " where no = :no";
return exec_db_fetch($sql, array( return exec_db_fetch($sql, array(
"no" => $post_id "no" => $post_id
)); ));
} }
} }

152
index.php
View File

@ -1,41 +1,125 @@
<?php <?php
/** /**
* @file index.php * @file index.php
* @date 2018-05-27 * @created_on 2018-05-27
* @author Go Namhyeon <gnh1201@gmail.com> * @updated_on 2020-06-14
* @brief ReasonableFramework * @author Go Namhyeon <abuse@catswords.net>
* @cvs http://github.com/gnh1201/reasonableframework * @brief ReasonableFramework is RVHM structured PHP framework with common security
* @cvs https://github.com/gnh1201/reasonableframework
* @sponsor https://patreon.com/catswords (with advanced security)
*/ */
define("_DEF_VSPF_", true); // compatible to VSPF define("_DEF_VSPF_", true); // compatible to VSPF
define("_DEF_RSF_", true); // compatible to RSF define("_DEF_RSF_", true); // compatible to RSF
define("APP_DEVELOPMENT", false); // set the status of development
define("DOC_EOL", "\r\n"); // set the 'end of line'
define("CORS_DOMAINS", false); // common security: allow origin domains (e.g. example.org,*.example.org)
define("PHP_FIREWALL_REQUEST_URI", strip_tags($_SERVER['REQUEST_URI'])); // advanced security
define("PHP_FIREWALL_ACTIVATION", false); // advanced security
define("PHP_DDOS_PROTECTION", false); // advanced security
// development mode
if(APP_DEVELOPMENT == true) {
error_reporting(E_ALL);
@ini_set("log_errors", 1);
@ini_set("error_log", sprintf("%s/storage/sandbox/logs/error.log", getcwd()));
} else {
error_reporting(E_ERROR | E_PARSE);
}
@ini_set("display_errors", 1);
// CORS Security (https or http)
if(CORS_DOMAINS !== false) {
$domains = explode(",", CORS_DOMAINS);
$_origin = array_key_exists("HTTP_ORIGIN", $_SERVER) ? $_SERVER['HTTP_ORIGIN'] : "";
$origins = array();
if(!in_array("*", $domains)) {
foreach($domains as $domain) {
if(!empty($domain)) {
if(substr($domain, 0, 2) == "*.") { // support wildcard
$needle = substr($domain, 1);
$length = strlen($needle);
if(substr($_origin, -$length) === $needle) {
$origins[] = $_origin;
}
} else {
$origins[] = sprintf("https://%s", $domain);
$origins[] = sprintf("http://%s", $domain);
}
}
}
if(count($origins) > 0) {
if(in_array($_origin, $origins)) {
header(sprintf("Access-Control-Allow-Origin: %s", $_origin));
} else {
header(sprintf("Access-Control-Allow-Origin: %s", $origins[0]));
}
}
} else {
header("Access-Control-Allow-Origin: *");
}
}
// set shared vars
$shared_vars = array();
// define system modules // define system modules
$load_systems = array("base", "storage", "config", "database", "uri", "security", "logger"); $load_systems = array("base", "storage", "config", "security", "database", "uri", "logger");
// load system modules // load system modules
foreach($load_systems as $system_name) { foreach($load_systems as $system_name) {
$system_inc_file = "./system/" . $system_name . ".php"; $system_inc_file = "./system/" . $system_name . ".php";
if(file_exists($system_inc_file)) { if(file_exists($system_inc_file)) {
if($system_name == "base") { if($system_name == "base") {
include($system_inc_file); include($system_inc_file);
register_loaded("system", $system_inc_file); register_loaded("system", $system_inc_file);
} else { } else {
loadModule($system_name); loadModule($system_name);
} }
} } else {
echo "ERROR: Dose not exists " . $system_inc_file;
exit;
}
} }
// get config
$config = get_config(); $config = get_config();
// get requests
$requests = get_requests(); $requests = get_requests();
// get PID(Process ID)
set_shared_var("mypid", getmypid());
// set database connection
// variable _unset_dbc: will not connect to database
$_unset_dbc = get_requested_value("_unset_dbc");
if(empty($_unset_dbc)) {
set_shared_var("dbc", get_db_connect());
}
// set max_execution_time // set max_execution_time
$max_execution_time = get_value_in_array("max_execution_time", $config, 0); $max_execution_time = get_value_in_array("max_execution_time", $config, -1);
@ini_set("max_execution_time", $max_execution_time); set_max_execution_time($max_execution_time);
// set memory limit
$memory_limit = get_value_in_array("memory_limit", $config, -1);
set_memory_limit($memory_limit);
// set upload max filesize
$upload_max_filesize = get_value_in_array("upload_max_filesize", $config, -1);
set_upload_max_filesize($upload_max_filesize);
// set post max size
$post_max_size = get_value_in_array("post_max_size", $config, -1);
set_post_max_size($post_max_size);
// start session
start_isolated_session();
// set autoloader // set autoloader
if(!array_key_empty("enable_autoload", $config)) { if(!array_key_empty("enable_autoload", $config)) {
set_autoloader(); set_autoloader();
} }
// set timezone // set timezone
@ -43,22 +127,28 @@ $default_timezone = get_value_in_array("timezone", $config, "UTC");
date_default_timezone_set($default_timezone); date_default_timezone_set($default_timezone);
// write visit log // write visit log
write_visit_log(); $log_mode_visit = get_value_in_array("log_mode_visit", $config, "");
write_visit_log($log_mode_visit);
// route controller // get requested route
$route = get_value_in_array("route", $requests['all'], ""); $route = read_route();
// advanced security: PHP firewall
if(PHP_FIREWALL_ACTIVATION !== false) {
loadHelper("php-firewall.lnk");
}
// advanced security: DDOS protection
if(PHP_DDOS_PROTECTION !== false) {
loadHelper("php-ddos.lnk");
}
// load route // load route
if(empty($route)) { if(!loadRoute($route, $shared_vars)) {
$route = get_value_in_array("default_route", $config, "welcome"); loadRoute("errors/404", $shared_vars);
} else {
$route_names = explode('/', $route);
if(count($route_names) > 1) {
$route = $route_names[0];
}
} }
// load route file // disconnect database
if(!loadRoute($route, $scope)) { close_db_connect();
loadRoute("errors/404", $scope);
} // EOF

View File

@ -2,17 +2,17 @@
/** /**
* @file api.getorder.pgkcp.php * @file api.getorder.pgkcp.php
* @date 2018-09-24 * @date 2018-09-24
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief KCP PG(Payment Gateway) get completed order * @brief KCP PG(Payment Gateway) get completed order
*/ */
$ordr_idxx = get_requested_value("ordr_idxx"); $ordr_idxx = get_requested_value("ordr_idxx");
if(empty($ordr_idxx)) { if(empty($ordr_idxx)) {
set_error("ordr_idxx can not empty"); set_error("ordr_idxx can not empty");
show_errors(); show_errors();
} }
header("Content-type:application/json"); header("Content-type:application/json");
echo read_storage_file(get_hashed_text($ordr_idxx) . ".json", array( echo read_storage_file(get_hashed_text($ordr_idxx) . ".json", array(
"storage_type" => "payman" "storage_type" => "payman"
)); ));

View File

@ -2,7 +2,7 @@
/** /**
* @file api.gnuboard.php * @file api.gnuboard.php
* @date 2018-05-31 * @date 2018-05-31
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief Integration controller for Gnuboard CMS 4.x, 5.x * @brief Integration controller for Gnuboard CMS 4.x, 5.x
*/ */
@ -19,43 +19,43 @@ $bo_table = get_requested_value("bo_table");
$data = array(); $data = array();
$result = array( $result = array(
"success" => false "success" => false
); );
switch($action) { switch($action) {
case "write": case "write":
$version = get_requested_value("version"); $version = get_requested_value("version");
$data = array( $data = array(
"wr_subject" => get_requested_value("wr_subject"), "wr_subject" => get_requested_value("wr_subject"),
"wr_content" => get_requested_value("wr_content"), "wr_content" => get_requested_value("wr_content"),
); );
for($i = 0; $i < 10; $i++) { for($i = 0; $i < 10; $i++) {
$data["wr_" . $i] = get_requested_value("wr_" . $i); $data["wr_" . $i] = get_requested_value("wr_" . $i);
} }
if($wr_id = gnb_write_post($bo_table, $data, $version)) { if($wr_id = gnb_write_post($bo_table, $data, $version)) {
$result = array( $result = array(
"success" => true, "success" => true,
"data" => array( "data" => array(
"wr_id" => $wr_id, "wr_id" => $wr_id,
), ),
); );
} }
break; break;
case "read": case "read":
$wr_id = get_requested_value("wr_id"); $wr_id = get_requested_value("wr_id");
$row = gnb_get_post_by_id($bo_table, $wr_id); $row = gnb_get_post_by_id($bo_table, $wr_id);
if(!array_key_empty("wr_id", $row)) { if(!array_key_empty("wr_id", $row)) {
$result = array( $result = array(
"success" => true, "success" => true,
"data" => $row "data" => $row
); );
} }
} }
set_header_content_type("json"); set_header_content_type("json");

18
route/api.mailgun.php Normal file
View File

@ -0,0 +1,18 @@
<?php
/**
* @file api.mailgun.php
* @date 2019-04-15
* @author Go Namhyeon <abuse@catswords.net>
* @brief Mailgun API controller
*/
loadHelper("mailgun.api");
$content = get_requested_value("content", array("_JSON", "_ALL"));
$subject = get_requested_value("subject", array("_JSON", "_ALL"));
$to = get_requested_value("to", array("_JSON", "_ALL"));
$response = mailgun_send_message($content, $to, $subject);
header("Content-Type: application/json");
echo json_encode($response);

View File

@ -2,7 +2,7 @@
/** /**
* @file api.setconfig.pgkcp.php * @file api.setconfig.pgkcp.php
* @date 2018-09-30 * @date 2018-09-30
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief KCP PG(Payment Gateway) set configuration API * @brief KCP PG(Payment Gateway) set configuration API
*/ */
@ -17,39 +17,39 @@ $api_config = array();
$config_filename = "api.config.pgkcp.json"; $config_filename = "api.config.pgkcp.json";
if($mode == "clear") { if($mode == "clear") {
$rm = remove_stroage_file($config_filename, array( $rm = remove_stroage_file($config_filename, array(
"storage_type" => "payman" "storage_type" => "payman"
)); ));
if(!$rm) { if(!$rm) {
echo get_callable_token("failed"); echo get_callable_token("failed");
} else { } else {
echo get_callable_token("success"); echo get_callable_token("success");
} }
exit; exit;
} }
if($mode == "test") { if($mode == "test") {
$api_config['g_conf_gw_url'] = "testpaygw.kcp.co.kr"; $api_config['g_conf_gw_url'] = "testpaygw.kcp.co.kr";
$api_config['g_conf_js_url'] = "https://testpay.kcp.co.kr/plugin/payplus_web.jsp"; $api_config['g_conf_js_url'] = "https://testpay.kcp.co.kr/plugin/payplus_web.jsp";
$api_config['g_conf_site_cd'] = "T0000"; $api_config['g_conf_site_cd'] = "T0000";
$api_config['g_conf_site_key'] = "3grptw1.zW0GSo4PQdaGvsF__"; $api_config['g_conf_site_key'] = "3grptw1.zW0GSo4PQdaGvsF__";
$api_config['g_conf_site_name'] = get_generated_name(); $api_config['g_conf_site_name'] = get_generated_name();
} else { } else {
$api_config['g_conf_gw_url'] = "paygw.kcp.co.kr"; $api_config['g_conf_gw_url'] = "paygw.kcp.co.kr";
$api_config['g_conf_js_url'] = "https://pay.kcp.co.kr/plugin/payplus_web.jsp"; $api_config['g_conf_js_url'] = "https://pay.kcp.co.kr/plugin/payplus_web.jsp";
$api_config['g_conf_site_cd'] = $site_cd; $api_config['g_conf_site_cd'] = $site_cd;
$api_config['g_conf_site_key'] = $site_key; $api_config['g_conf_site_key'] = $site_key;
$api_config['g_conf_site_name'] = (empty($site_name) ? get_generated_name() : $site_name); $api_config['g_conf_site_name'] = (empty($site_name) ? get_generated_name() : $site_name);
} }
$api_config_encoded = json_encode($api_config); $api_config_encoded = json_encode($api_config);
$fw = write_storage_file($api_config_encoded, array( $fw = write_storage_file($api_config_encoded, array(
"storage_type" => "payman", "storage_type" => "payman",
"filename" => $config_filename "filename" => $config_filename
)); ));
if(!$fw) { if(!$fw) {
echo get_callable_token("failed"); echo get_callable_token("failed");
} else { } else {
echo get_callable_token("success"); echo get_callable_token("success");
} }

231
route/api.social.php Normal file
View File

@ -0,0 +1,231 @@
<?php
/**
* @file api.social.php
* @date 2018-09-26
* @author Go Namhyeon <abuse@catswords.net>
* @brief SocialTools API (refactoring from SocioRouter API)
*/
loadHelper("hybridauth.lnk");
loadHelper("hybridauth.dbt");
loadHelper("socialtool");
set_session_token();
$_token = get_session_token();
$provider = get_requested_value("provider");
$action = get_requested_value("action");
$redirect_uri = get_requested_value("redirect_uri");
$user_id = get_requested_value("user_id");
$connection_id = get_requested_value("connection_id");
$message = get_requested_value("message");
// if make new connection
if($action != "new") {
$api_session_id = get_session("api_session_id");
} else {
$api_session_id = "";
set_session("api_session_id", $api_session_id);
}
$session_data = array();
if(!empty($api_session_id)) {
$fr = read_storage_file($api_session_id, array(
"storage_type" => "session"
));
if(!$fr) {
// renew api session id
$api_session_id = "";
set_session("api_session_id", $api_session_id);
} else {
$session_data = json_decode($fr);
$provider = get_property_value("provider", $session_data);
$action = get_property_value("action", $session_data);
$redirect_uri = get_property_value("redirect_uri", $session_data);
$user_id = get_property_value("user_id", $session_data);
$connection_id = get_property_value("connection_id", $session_data);
$message = get_property_value("message", $session_data);
}
}
if(empty($provider)) {
set_error("provider is required field.");
show_errors();
}
$hauth_adapter = null;
$hauth_session = null;
$hauth_profile = null;
// load library
$configfile = hybridauth_load($provider);
if(!$configfile) {
set_error("can not load hybridauth library");
show_errors();
}
$hauth = new Hybrid_Auth($configfile);
// try session restore
$session_flag = false;
if(!empty($connection_id)) {
$hauth_session = get_stored_hybridauth_session($connection_id);
if(!empty($hauth_session)) {
try {
$hauth->restoreSessionData($hauth_session);
$session_flag = true;
} catch(Exception $e) {
set_error("maybe, your connection is broken.");
show_errors();
}
}
}
// check hybridauth request
if($hauth->isConnectedWith($provider)) {
$hauth_session = $hauth->getSessionData();
$connection_id = store_hybridauth_session($hauth_session, $user_id);
if($connection_id) {
$session_flag = true;
}
}
// save session
$api_session_id = get_hashed_text(make_random_id(32));
$session_data = array(
"api_session_id" => $api_session_id,
"provider" => $provider,
"action" => $action,
"redirect_uri" => $redirect_uri,
"user_id" => $user_id,
"connection_id" => $connection_id,
"message" => $message
);
$fw = write_storage_file(json_encode($session_data), array(
"storage_type" => "session",
"filename" => $api_session_id
));
if(!$fw) {
set_error("maybe, your storage is write-protected.");
show_errors();
} else {
set_session("api_session_id", $api_session_id);
}
if(hybridauth_check_redirect()) {
hybridauth_process();
}
// try authenticate
try {
if(!$session_flag) {
$hauth_adapter = $hauth->authenticate($provider);
} else {
$hauth_adapter = $hauth->getAdapter($provider);
}
$session_flag = true;
} catch(Exception $e) {
$hauth_adapter = $hauth->authenticate($provider);
}
if(!$session_flag) {
// if failed authenticate
redirect_uri(get_route_link("api.social", array(
"provider" => $provider,
"action" => $action,
"redirect_uri" => $redirect_uri,
"user_id" => $user_id,
"connection_id" => $connection_id
), false));
}
// get user profile
$hauth_profile = $hauth_adapter->getUserProfile();
// do action
$context = array();
switch($action) {
case "inbound":
break;
case "outbound":
$response = social_send_message($provider, $hauth_adapter, $message);
$object_id = social_parse_object_id($provider, $response);
$context = array(
"success" => !(!$object_id),
"message" => "Have a nice day",
"user_id" => $user_id,
"provider" => $provider,
"object_id" => $object_id
);
break;
case "new":
$context = array(
"success" => true,
"message" => "Authenticated",
"user_id" => $user_id,
"provider" => $provider,
"profile" => $hauth_profile,
);
break;
case "login":
$context = array(
"success" => true,
"message" => "Authenticated",
"user_id" => $user_id,
"provider" => $provider,
"profile" => $hauth_profile,
);
break;
case "bgworker":
$response = social_send_message($provider, $hauth_adapter, $message);
$object_id = social_parse_object_id($provider, $response);
$context = array(
"success" => !(!$object_id),
"message" => "Have a nice day",
"id" => $user_id,
"connection" => $connection_id,
"provider" => $provider,
"object_id" => $object_id
);
break;
case "cancel": // listen cancel authenticated callback
break;
case "delete": // listen delete ping
break;
case "accept": // listen accept ping
break;
case "object": // get object by id
$object_id = get_requested_value("object_id");
$context = array(
"success" => true,
"message" => "Found",
"response" => social_get_object($provider, $hauth_adapter, $object_id)
);
break;
default:
set_error("Unknown action");
show_errors();
}
if(empty($redirect_uri)) {
header("Content-Type: application/json");
echo json_encode($context);
} else {
$_display_name = get_hashed_text($hauth_profile->displayName, "base64");
$_idt_hash = get_hashed_text($hauth_profile->identifier, "sha1");
$_idt_name = $_idt_hash . "@" . $provider;
$_idt = get_hashed_text($_idt_name, "sha1");
// renew api session id
$api_session_id = "";
set_session("api_session_id", $api_session_id);
// go to redirect uri
redirect_with_params($redirect_uri, array(
"connection_id" => $connection_id,
"provider" => $provider,
"display_name" => $_display_name,
"idt" => $_idt,
"_token" => $_token
));
}

View File

@ -1,231 +0,0 @@
<?php
/**
* @file api.socialhub.php
* @date 2018-09-26
* @author Go Namhyeon <gnh1201@gmail.com>
* @brief SocialHub API (refactoring from SocioRouter API)
*/
loadHelper("hybridauth.lnk");
loadHelper("hybridauth.dbt");
loadHelper("socialhub.utl");
set_session_token();
$_token = get_session_token();
$provider = get_requested_value("provider");
$action = get_requested_value("action");
$redirect_uri = get_requested_value("redirect_uri");
$user_id = get_requested_value("user_id");
$connection_id = get_requested_value("connection_id");
$message = get_requested_value("message");
// if make new connection
if($action != "new") {
$api_session_id = get_session("api_session_id");
} else {
$api_session_id = "";
set_session("api_session_id", $api_session_id);
}
$session_data = array();
if(!empty($api_session_id)) {
$fr = read_storage_file($api_session_id, array(
"storage_type" => "session"
));
if(!$fr) {
// renew api session id
$api_session_id = "";
set_session("api_session_id", $api_session_id);
} else {
$session_data = json_decode($fr);
$provider = get_property_value("provider", $session_data);
$action = get_property_value("action", $session_data);
$redirect_uri = get_property_value("redirect_uri", $session_data);
$user_id = get_property_value("user_id", $session_data);
$connection_id = get_property_value("connection_id", $session_data);
$message = get_property_value("message", $session_data);
}
}
if(empty($provider)) {
set_error("provider is required field.");
show_errors();
}
$hauth_adapter = null;
$hauth_session = null;
$hauth_profile = null;
// load library
$configfile = hybridauth_load($provider);
if(!$configfile) {
set_error("can not load hybridauth library");
show_errors();
}
$hauth = new Hybrid_Auth($configfile);
// try session restore
$session_flag = false;
if(!empty($connection_id)) {
$hauth_session = get_stored_hybridauth_session($connection_id);
if(!empty($hauth_session)) {
try {
$hauth->restoreSessionData($hauth_session);
$session_flag = true;
} catch(Exception $e) {
set_error("maybe, your connection is broken.");
show_errors();
}
}
}
// check hybridauth request
if($hauth->isConnectedWith($provider)) {
$hauth_session = $hauth->getSessionData();
$connection_id = store_hybridauth_session($hauth_session, $user_id);
if($connection_id) {
$session_flag = true;
}
}
// save session
$api_session_id = get_hashed_text(make_random_id(32));
$session_data = array(
"api_session_id" => $api_session_id,
"provider" => $provider,
"action" => $action,
"redirect_uri" => $redirect_uri,
"user_id" => $user_id,
"connection_id" => $connection_id,
"message" => $message
);
$fw = write_storage_file(json_encode($session_data), array(
"storage_type" => "session",
"filename" => $api_session_id
));
if(!$fw) {
set_error("maybe, your storage is write-protected.");
show_errors();
} else {
set_session("api_session_id", $api_session_id);
}
if(hybridauth_check_redirect()) {
hybridauth_process();
}
// try authenticate
try {
if(!$session_flag) {
$hauth_adapter = $hauth->authenticate($provider);
} else {
$hauth_adapter = $hauth->getAdapter($provider);
}
$session_flag = true;
} catch(Exception $e) {
$hauth_adapter = $hauth->authenticate($provider);
}
if(!$session_flag) {
// if failed authenticate
redirect_uri(get_route_link("api.socialhub", array(
"provider" => $provider,
"action" => $action,
"redirect_uri" => $redirect_uri,
"user_id" => $user_id,
"connection_id" => $connection_id
), false));
}
// get user profile
$hauth_profile = $hauth_adapter->getUserProfile();
// do action
$context = array();
switch($action) {
case "inbound":
break;
case "outbound":
$response = socialhub_send_message($provider, $hauth_adapter, $message);
$object_id = socialhub_parse_object_id($provider, $response);
$context = array(
"success" => !(!$object_id),
"message" => "Have a nice day",
"user_id" => $user_id,
"provider" => $provider,
"object_id" => $object_id
);
break;
case "new":
$context = array(
"success" => true,
"message" => "Authenticated",
"user_id" => $user_id,
"provider" => $provider,
"profile" => $hauth_profile,
);
break;
case "login":
$context = array(
"success" => true,
"message" => "Authenticated",
"user_id" => $user_id,
"provider" => $provider,
"profile" => $hauth_profile,
);
break;
case "bgworker":
$response = socialhub_send_message($provider, $hauth_adapter, $message);
$object_id = socialhub_parse_object_id($provider, $response);
$context = array(
"success" => !(!$object_id),
"message" => "Have a nice day",
"id" => $user_id,
"connection" => $connection_id,
"provider" => $provider,
"object_id" => $object_id
);
break;
case "cancel": // listen cancel authenticated callback
break;
case "delete": // listen delete ping
break;
case "accept": // listen accept ping
break;
case "object": // get object by id
$object_id = get_requested_value("object_id");
$context = array(
"success" => true,
"message" => "Found",
"response" => socialhub_get_object($provider, $hauth_adapter, $object_id)
);
break;
default:
set_error("Unknown action");
show_errors();
}
if(empty($redirect_uri)) {
header("Content-Type: application/json");
echo json_encode($context);
} else {
$_display_name = get_hashed_text($hauth_profile->displayName, "base64");
$_idt_hash = get_hashed_text($hauth_profile->identifier, "sha1");
$_idt_name = $_idt_hash . "@" . $provider;
$_idt = get_hashed_text($_idt_name, "sha1");
// renew api session id
$api_session_id = "";
set_session("api_session_id", $api_session_id);
// go to redirect uri
redirect_with_params($redirect_uri, array(
"connection_id" => $connection_id,
"provider" => $provider,
"display_name" => $_display_name,
"idt" => $_idt,
"_token" => $_token
));
}

58
route/api.twilio.php Normal file
View File

@ -0,0 +1,58 @@
<?php
/**
* @file api.twilio.php
* @date 2019-04-15
* @author Go Namhyeon <abuse@catswords.net>
* @brief Twilio API controller (or domestic API)
*/
loadHelper("twilio.api"); // for voice, or international
loadHelper("lguplus.api"); // for domestic
loadHelper("string.utils");
$action = get_requested_value("action", array("_JSON", "_ALL"));
$message = get_requested_value("message", array("_JSON", "_ALL"));
$to = get_requested_value("to", array("_JSON", "_ALL"));
$country = get_requested_value("country", array("_JSON", "_ALL"));
$is_domestic = array_key_equals("lguplus_country", $config, $country);
if(!$is_domestic) {
$to = sprintf("+%s%s", $country, $to);
} else {
$to = sprintf("%s%s", (substr($to, 0, 1) == "0" ? "" : "0"), $to);
}
$response = false;
// temporary filter (example)
$terms = get_tokenized_text($message);
if(in_array("fuck", $terms) || in_array("bitch", $terms) || in_array("hell", $terms)) {
$action = "denied";
}
switch($action) {
case "text":
if(!$is_domestic) {
$response = twilio_send_message($message, $to);
} else {
$response = lguplus_send_message($message, $to);
}
break;
case "voice":
$response = twilio_send_voice($message, $to);
break;
case "denied":
$response = array("error" => "action is denied");
break;
default:
$response = array("error" => "action is required");
break;
}
write_common_log(sprintf("message: %s, to: %s", $message, $to), "api.twilio");
header("Content-Type: application/json");
echo json_encode($response);

View File

@ -1,8 +1,8 @@
<?php <?php
/** /**
* @file api.newuuid.php * @file api.uuid.php
* @date 2018-08-19 * @date 2018-08-19
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief UUID Generator API * @brief UUID Generator API
*/ */

22
route/api.zabbix.php Normal file
View File

@ -0,0 +1,22 @@
<?php
/**
* @file api.zabbix.php
* @date 2019-04-15
* @author Go Namhyeon <abuse@catswords.net>
* @brief Zabbix API
*/
loadHelper("zabbix.api");
$data = array();
$data['authenticate'] = zabbix_authenticate();
$data['hosts'] = zabbix_retrieve_hosts();
$data['items'] = array();
foreach($data['hosts']->result as $host) {
$data['items'][$host->hostid] = zabbix_get_items($host->hostid);
}
header("Content-type: application/json");
echo json_encode($data);

40
route/mobileswitcher.php Normal file
View File

@ -0,0 +1,40 @@
<?php
/**
* @file mobileswitcher.php
* @date 2019-04-29
* @author Go Namhyeon <abuse@catswords.net>
* @brief mobile device switcher
*/
loadHelper("mobiletool");
loadHelper("networktool");
$do = get_requested_value("do");
$from = get_requested_value("from");
$redirect_url = get_requested_value("redirect_url");
$dm = detect_mobile();
$ne = get_network_event();
if($from == "pc") {
$dm = 1;
} elseif($from == "mobile") {
$dm = 0;
}
$data = array(
"action" => $action,
"from" => $from,
"dm" => $dm,
"redirect_url" => get_final_link($redirect_url, array(
"action" => "mobileswitcher",
"dm" => $dm,
"do" => $do,
"redirect_url" => get_final_link($redirect_url, array(
"action" => "mobileswitcher",
"dm" => $dm,
), false),
)),
"ua" => get_hashed_text($ne['agent'], "base64"),
);
renderView("view_mobileswitcher", $data);

View File

@ -1,15 +1,16 @@
<?php <?php
/** /**
* @file ordercomplete.pgkcp.php * @file ordercomplete.pgkcp.php
* @date 2018-09-03 * @created_on 2018-09-03
* @author Go Namhyeon <gnh1201@gmail.com> * @updated_on 2020-01-25
* @brief KCP PG(Payment Gateway) contoller when complete * @author Go Namhyeon <abuse@catswords.net>
* @brief KCP PG(Payment Gateway) contoller when completed
*/ */
// detect CSRF attack // detect CSRF attack
if(check_token_abuse_by_requests("_token", "_POST")) { if(check_token_abuse_by_requests("_token", "_POST")) {
set_error("Access denied. (Expired session or Website attacker)"); set_error("Access denied because of security violation");
show_errors(); show_errors();
} }
// set token // set token
@ -26,39 +27,68 @@ $pay_method_alias = get_requested_value("pay_method_alias");
// A001: free plan (무료) // A001: free plan (무료)
// A002: hand-writing payment (수기결제, 무통장입금 등) // A002: hand-writing payment (수기결제, 무통장입금 등)
$action = "cancel"; $action = "cancel";
if(in_array($res_cd, array("0000", "A001")) { if(in_array($res_cd, array("0000", "A001"))) {
$action = "complete"; $action = "complete";
} elseif(in_array($res_cd, array("A002")) { } elseif(in_array($res_cd, array("A002"))) {
$action = "hold"; $action = "hold";
} }
// check ordr_idxx // check ordr_idxx
if(empty($ordr_idxx)) { if(empty($ordr_idxx)) {
set_error("ordr_idxx can not empty"); set_error("ordr_idxx is required");
set_errors(); show_errors();
} }
// write storage file // write storage file
$fd = json_encode($requests['_POST']); $fd = json_encode($requests['_POST']);
$fw = write_storage_file($fd, array( $fw = write_storage_file($fd, array(
"filename" => get_hashed_text($ordr_idxx) . ".json", "filename" => get_hashed_text($ordr_idxx) . ".json",
"storage_type" => "payman" "storage_type" => "payman"
)); ));
// check write-protected // check write-protected
if(!$fw) { if(!$fw) {
set_error("maybe, your storage is write-protected."); set_error("maybe, your storage is write-protected.");
show_errors(); show_errors();
} }
// response
$_token = get_session_token();
if(empty($redirect_url)) {
$jscontent = <<<EOF
<!doctype html>
<html>
<head>
<meta charset="utf8">
</head>
<body>
<script type="text/javascript">//<!--<![CDATA[
if(window.opener && !window.opener.closed) {
window.opener.payman_callback({
"token": "$_token",
"ordr_idxx": "$ordr_idxx",
"res_cd": "$res_cd",
"pay_method_alias": "$pay_method_alias"
});
window.close();
self.close();
this.close();
}
//]]>--></script>
</body>
</html>
EOF;
echo $jscontent;
} else {
// redirect // redirect
redirect_uri(get_final_link($redirect_url, array( redirect_uri(get_final_link($redirect_url, array(
"_token" => get_session_token(), "_token" => $_token,
"_route" => get_requested_value("route"), "_route" => get_requested_value("route"),
"_action" => $action, "_action" => $action,
"_ordr_idxx" => $ordr_idxx, "_ordr_idxx" => $ordr_idxx,
"_res_cd" => $res_cd, "_res_cd" => $res_cd,
"_pay_method_alias" => $pay_method_alias "_pay_method_alias" => $pay_method_alias
), false), array( ), false), array(
"check_origin" => true "check_origin" => true
)); ));
}

View File

@ -2,7 +2,7 @@
/** /**
* @file orderform.php * @file orderform.php
* @date 2018-09-03 * @date 2018-09-03
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief order form * @brief order form
*/ */
@ -13,16 +13,16 @@ set_session_token();
$pay_method_alias = get_requested_value("pay_method_alias"); $pay_method_alias = get_requested_value("pay_method_alias");
$data = array( $data = array(
"_token" => get_session_token(), "_token" => get_session_token(),
"_next_route" => "orderpay.pgkcp", "_next_route" => "orderpay.pgkcp",
"redirect_url" => get_requested_value("redirect_url"), "redirect_url" => get_requested_value("redirect_url"),
"pay_method_alias" => (!empty($pay_method_alias) ? $pay_method_alias : "CRE"), "pay_method_alias" => (!empty($pay_method_alias) ? $pay_method_alias : "CRE"),
"good_name" => get_requested_value("good_name"), "good_name" => get_requested_value("good_name"),
"good_mny" => get_requested_value("good_mny"), "good_mny" => get_requested_value("good_mny"),
"buyr_name" => get_requested_value("buyr_name"), "buyr_name" => get_requested_value("buyr_name"),
"buyr_mail" => get_requested_value("buyr_mail"), "buyr_mail" => get_requested_value("buyr_mail"),
"buyr_tel1" => get_requested_value("buyr_tel1"), "buyr_tel1" => get_requested_value("buyr_tel1"),
"pay_data" => get_requested_value("pay_data"), "pay_data" => get_requested_value("pay_data"),
); );
renderView("view_orderform", $data); renderView("view_orderform", $data);

View File

@ -6,16 +6,17 @@ set_session_token();
$pay_method_alias = get_requested_value("pay_method_alias"); $pay_method_alias = get_requested_value("pay_method_alias");
$data = array( $data = array(
"_token" => get_session_token(), "_token" => get_session_token(),
"_next_route" => "orderpay.pgkcp", "_next_route" => "orderpay.pgkcp",
"redirect_url" => get_requested_value("redirect_url"), "redirect_url" => get_requested_value("redirect_url"),
"pay_method_alias" => (!empty($pay_method_alias) ? $pay_method_alias : "CRE"), "pay_method_alias" => (!empty($pay_method_alias) ? $pay_method_alias : "CRE"),
"good_name" => get_requested_value("good_name"), "good_name" => get_requested_value("good_name"),
"good_mny" => get_requested_value("good_mny"), "good_mny" => get_requested_value("good_mny"),
"buyr_name" => get_requested_value("buyr_name"), "buyr_name" => get_requested_value("buyr_name"),
"buyr_mail" => get_requested_value("buyr_mail"), "buyr_mail" => get_requested_value("buyr_mail"),
"buyr_tel1" => get_requested_value("buyr_tel1"), "buyr_tel1" => get_requested_value("buyr_tel1"),
"pay_data" => get_requested_value("pay_data"), "pay_data" => get_requested_value("pay_data"),
"eng_flag" => get_requested_value("eng_flag")
); );
renderView("view_orderform.widget", $data); renderView("view_orderform.widget", $data);

View File

@ -2,28 +2,30 @@
/** /**
* @file orderpay.pgkcp.php * @file orderpay.pgkcp.php
* @date 2018-08-25 * @date 2018-08-25
* @author Go Namhyeon <gnh1201@gmail.com> * @updated 2019-10-14
* @author Go Namhyeon <abuse@catswords.net>
* @brief KCP PG(Payment Gateway) Controller * @brief KCP PG(Payment Gateway) Controller
*/ */
if(!defined("_DEF_RSF_")) set_error_exit("do not allow access"); if(!defined("_DEF_RSF_")) set_error_exit("do not allow access");
$debug = get_requested_value("debug"); $debug = get_requested_value("debug");
$mode = get_requested_value("mode");
if($debug != "true") { if($debug != "true") {
// 필수 항목 체크 // 필수 항목 체크
$required_fields = array("pay_method_alias", "good_name", "good_mny", "buyr_name", "buyr_mail", "buyr_tel1", "chk_agree"); $required_fields = array("pay_method_alias", "good_name", "good_mny", "buyr_name", "buyr_mail", "buyr_tel1", "chk_agree");
foreach($required_fields as $name) { foreach($required_fields as $name) {
if(array_key_empty($name, $requests['_ALL'])) { if(array_key_empty($name, $requests['_ALL'])) {
set_error_exit("required field is empty. " . $name); set_error_exit("required field is empty. " . $name);
} }
} }
// detect CSRF attack // detect CSRF attack
if(check_token_abuse_by_requests("_token")) { if($mode != "widget" && check_token_abuse_by_requests("_token")) {
set_error("Access denied. (Expired session or Website attacker)"); set_error("Access denied because of security violation");
show_errors(); show_errors();
} }
} }
set_session_token(); set_session_token();
@ -40,46 +42,47 @@ extract($pgkcp_config);
// initalize data // initalize data
$payinfo = array(); $payinfo = array();
$data = array( $data = array(
"payinfo" => $payinfo, "payinfo" => $payinfo,
"redirect_url" => get_requested_value("redirect_url"), "redirect_url" => get_requested_value("redirect_url"),
"_token" => get_session_token(), "_token" => get_session_token(),
"_next_route" => "orderpay.step2.pgkcp", "_next_route" => "orderpay.step2.pgkcp",
); );
// 1. 주문 정보 입력: 결제에 필요한 주문 정보를 입력 및 설정합니다. // 1. 주문 정보 입력: 결제에 필요한 주문 정보를 입력 및 설정합니다.
$fieldnames = array( $fieldnames = array(
"pay_method", // 지불 방법 "redirect_url", // Redirect URL
"pay_method_alias", // 지불 방법 별칭 "pay_method", // 지불 방법
"ordr_idxx", // 주문 번호 "pay_method_alias", // 지불 방법 별칭
"good_name", // 상품 이름 "ordr_idxx", // 주문 번호
"good_mny", // 결제 금액 "good_name", // 상품 이름
"buyr_name", // 주문자 이름 "good_mny", // 결제 금액
"buyr_mail", // 주문자 전자우편(이메일) 주소 "buyr_name", // 주문자 이름
"buyr_tel1", // 주문자 연락처 1 "buyr_mail", // 주문자 전자우편(이메일) 주소
"buyr_tel2", // 주문자 연락처 2 "buyr_tel1", // 주문자 연락처 1
"pay_data" // 주문 상세 데이터 "buyr_tel2", // 주문자 연락처 2
"pay_data" // 주문 상세 데이터
); );
foreach($fieldnames as $name) { foreach($fieldnames as $name) {
$payinfo[$name] = make_safe_argument(get_requested_value($name)); $payinfo[$name] = make_safe_argument(get_requested_value($name));
} }
// pay_method 처리 // pay_method 처리
$pay_method_rules = array( $pay_method_rules = array(
"CRE" => "100000000000", // 신용카드 "CRE" => "100000000000", // 신용카드
"ACC" => "010000000000", // 계좌이체 "ACC" => "010000000000", // 계좌이체
"VAC" => "001000000000", // 가상계좌 "VAC" => "001000000000", // 가상계좌
"POI" => "000100000000", // 포인트 "POI" => "000100000000", // 포인트
"PHO" => "000010000000", // 휴대폰 "PHO" => "000010000000", // 휴대폰
"GIF" => "000000001000", // 상품권 "GIF" => "000000001000", // 상품권
"ARS" => "000000000010", // ARS "ARS" => "000000000010", // ARS
"CAV" => "111000000000" // 신용카드/계좌이체/가상계좌 "CAV" => "111000000000" // 신용카드/계좌이체/가상계좌
); );
$pay_method = get_value_in_array("pay_method", $payinfo, $pay_method_rules['CRE']); $pay_method = get_value_in_array("pay_method", $payinfo, $pay_method_rules['CRE']);
$pay_method_alias = get_value_in_array("pay_method_alias", $payinfo, ""); $pay_method_alias = get_value_in_array("pay_method_alias", $payinfo, "");
foreach($pay_method_rules as $k=>$v) { foreach($pay_method_rules as $k=>$v) {
if(array_key_exists($pay_method_alias, $pay_method_rules)) { if(array_key_exists($pay_method_alias, $pay_method_rules)) {
$pay_method = $pay_method_rules[$pay_method_alias]; $pay_method = $pay_method_rules[$pay_method_alias];
} }
} }
$payinfo['pay_method'] = $pay_method; $payinfo['pay_method'] = $pay_method;
@ -92,13 +95,13 @@ $payinfo['site_name'] = $g_conf_site_name;
// 할부옵션: 0 ~ 18 개월까지, 50,000원 이상만 가능 // 할부옵션: 0 ~ 18 개월까지, 50,000원 이상만 가능
$payinfo['quotaopt'] = get_requested_value("quotaopt"); $payinfo['quotaopt'] = get_requested_value("quotaopt");
if(array_key_empty("quotaopt", $payinfo)) { if(array_key_empty("quotaopt", $payinfo)) {
$payinfo['quotaopt'] = 12; $payinfo['quotaopt'] = 12;
} }
// 결제 금액/화폐단위: 필수항목 // 결제 금액/화폐단위: 필수항목
$currency = get_requested_value("currency"); $currency = get_requested_value("currency");
if(array_key_empty("currency", $payinfo)) { if(array_key_empty("currency", $payinfo)) {
$payinfo['currency'] = "WON"; $payinfo['currency'] = "WON";
} }
// 3. 변경 제한 영역: 표준 웹 설정 영역 // 3. 변경 제한 영역: 표준 웹 설정 영역
@ -108,6 +111,8 @@ $payinfo['res_msg'] = "";
$payinfo['enc_info'] = ""; $payinfo['enc_info'] = "";
$payinfo['enc_data'] = ""; $payinfo['enc_data'] = "";
$payinfo['ret_pay_method'] = ""; $payinfo['ret_pay_method'] = "";
$payinfo['tran_cd'] = ""; // tran_cd가 유효하여야만 이후 tno 반환
$payinfo['use_pay_method'] = "";
$payinfo['ordr_chk'] = ""; // 주문정보 검증 관련 정보 $payinfo['ordr_chk'] = ""; // 주문정보 검증 관련 정보
// 변경 제한 영역: 현금영수증 관련 정보 // 변경 제한 영역: 현금영수증 관련 정보
@ -120,36 +125,36 @@ $payinfo['good_expr'] = "";
// 4. 옵션 정보: 결제에 필요한 추가 옵션 정보를 입력 및 설정합니다. // 4. 옵션 정보: 결제에 필요한 추가 옵션 정보를 입력 및 설정합니다.
$default_options = array( $default_options = array(
"used_card_YN" => "Y", // 사용카드 설정 여부 파라미터 "used_card_YN" => "Y", // 사용카드 설정 여부 파라미터
"used_card" => "CCBC:CCKM:CCSS", // 사용카드 설정 파라미터 "used_card" => "CCBC:CCKM:CCSS", // 사용카드 설정 파라미터
"used_card_CCXX" => "Y", // 해외카드 구분 파라미터 ((해외비자, 해외마스터, 해외JCB) "used_card_CCXX" => "Y", // 해외카드 구분 파라미터 ((해외비자, 해외마스터, 해외JCB)
"save_ocb" => "Y", // 신용카드 결제시 OK캐쉬백 적립 여부 "save_ocb" => "Y", // 신용카드 결제시 OK캐쉬백 적립 여부
"fix_inst" => "07", // 고정 할부 개월 수 선택 "fix_inst" => "07", // 고정 할부 개월 수 선택
"kcp_noint" => "", // 설정할부: '', 일반할부: 'N', 무이자할부: 'Y' "kcp_noint" => "", // 설정할부: '', 일반할부: 'N', 무이자할부: 'Y'
"kcp_noint_quota" => "CCBC-02:03:06,CCKM-03:06,CCSS-03:06:09", "kcp_noint_quota" => "CCBC-02:03:06,CCKM-03:06,CCSS-03:06:09",
// 전 카드 2,3,6개월 무이자(국민,비씨,엘지,삼성,신한,현대,롯데,외환) : ALL-02:03:04 // 전 카드 2,3,6개월 무이자(국민,비씨,엘지,삼성,신한,현대,롯데,외환) : ALL-02:03:04
// BC 2,3,6개월, 국민 3,6개월, 삼성 6,9개월 무이자 : CCBC-02:03:06,CCKM-03:06,CCSS-03:06:04 // BC 2,3,6개월, 국민 3,6개월, 삼성 6,9개월 무이자 : CCBC-02:03:06,CCKM-03:06,CCSS-03:06:04
"wish_vbank_list" => "05:03:04:07:11:23:26:32:34:81:71", // 가상계좌 은행 선택 파라미터 (은행코드는 매뉴얼을 참조) "wish_vbank_list" => "05:03:04:07:11:23:26:32:34:81:71", // 가상계좌 은행 선택 파라미터 (은행코드는 매뉴얼을 참조)
"vcnt_expire_term" => "3", // 가상계좌 입금 기한 설정하는 파라미터 - 발급일 + 3일 "vcnt_expire_term" => "3", // 가상계좌 입금 기한 설정하는 파라미터 - 발급일 + 3일
"vcnt_expire_term_time" => "120000", // 가상계좌 입금 시간 설정하는 파라미터 (HHMMSS 형식, 기본값은 23시59분59초) "vcnt_expire_term_time" => "120000", // 가상계좌 입금 시간 설정하는 파라미터 (HHMMSS 형식, 기본값은 23시59분59초)
"complex_pnt_yn" => "N", // 포인트 결제시 복합 결제(신용카드+포인트) 여부를 결정 "complex_pnt_yn" => "N", // 포인트 결제시 복합 결제(신용카드+포인트) 여부를 결정
"disp_tax_yn" => "Y", // 현금영수증 등록 창을 출력 여부를 설정하는 파라미터 "disp_tax_yn" => "Y", // 현금영수증 등록 창을 출력 여부를 설정하는 파라미터
"site_logo" => "", // 사이트 로고, 로고 용량이 150 X 50 이상일 경우 site_name 값이 표시 "site_logo" => "", // 사이트 로고, 로고 용량이 150 X 50 이상일 경우 site_name 값이 표시
"eng_flag" => "", // 결제창 영문 표시 파라미터, 사용 시 'Y'로 설정 "eng_flag" => "", // 결제창 영문 표시 파라미터, 사용 시 'Y'로 설정
"tax_flag" => "TG03", // 변경불가: 과세품목코드 "tax_flag" => "TG03", // 변경불가: 과세품목코드
"comm_tax_mny" => "", // 과세금액 "comm_tax_mny" => "", // 과세금액
"comm_vat_mny" => "", // 부가세 "comm_vat_mny" => "", // 부가세
"comm_free_mny" => "", // 비과세금액 "comm_free_mny" => "", // 비과세금액
"skin_indx" => "1", // 스킨 변경 파라미터. 7개 (1~7) 지원 "skin_indx" => "1", // 스킨 변경 파라미터. 7개 (1~7) 지원
"good_cd" => "", // 상품코드 설정 파라미터 "good_cd" => "", // 상품코드 설정 파라미터
"shop_user_id" => "", // 가맹점에서 관리하는 고객 아이디, 상품권 결제 시 반드시 입력 "shop_user_id" => "", // 가맹점에서 관리하는 고객 아이디, 상품권 결제 시 반드시 입력
"pt_memcorp_cd" => "" // 복지포인트 결제시 가맹점에 할당되어진 코드 값을 입력 "pt_memcorp_cd" => "" // 복지포인트 결제시 가맹점에 할당되어진 코드 값을 입력
); );
foreach($default_options as $k=>$v) { foreach($default_options as $k=>$v) {
$req_value = get_requested_value($k); $req_value = get_requested_value($k);
if(!empty($req_value)) { if(!empty($req_value)) {
$payinfo[$k] = ($req_value === "_DEFAULT_") ? $v : $req_value; $payinfo[$k] = ($req_value === "_DEFAULT_") ? $v : $req_value;
} }
} }
// 설정 불러오기 // 설정 불러오기
@ -173,19 +178,19 @@ $data['pgkcp_action_url'] = base_url();
// 디버그 시 // 디버그 시
if($debug == "true") { if($debug == "true") {
$auto_fills = array( $auto_fills = array(
"good_name" => "테스트 상품", "good_name" => "테스트 상품",
"good_mny" => "1", "good_mny" => "1",
"buyr_name" => "홍길동", "buyr_name" => "홍길동",
"buyr_mail" => "webmaster@example.org", "buyr_mail" => "webmaster@example.org",
"buyr_tel1" => "01000000000" "buyr_tel1" => "01000000000"
); );
foreach($auto_fills as $k=>$v) { foreach($auto_fills as $k=>$v) {
if(array_key_empty($k, $payinfo)) { if(array_key_empty($k, $payinfo)) {
$payinfo[$k] = $v; $payinfo[$k] = $v;
} }
} }
$data['payinfo'] = $payinfo; $data['payinfo'] = $payinfo;
} }
// 결제창 불러오기 // 결제창 불러오기

View File

@ -1,8 +1,9 @@
<?php <?php
/** /**
* @file orderpay.step2.pgkcp.php * @file orderpay.step2.pgkcp.php
* @date 2018-08-27 * @created_on 2018-08-27
* @author Go Namhyeon <gnh1201@gmail.com> * @updated_on 2020-01-25
* @author Go Namhyeon <abuse@catswords.net>
* @brief KCP PG(Payment Gateway) contoller when done * @brief KCP PG(Payment Gateway) contoller when done
*/ */
@ -10,13 +11,13 @@ if(!defined("_DEF_RSF_")) set_error_exit("do not allow access");
// detect CSRF attack // detect CSRF attack
if(check_token_abuse_by_requests("_token", "_POST")) { if(check_token_abuse_by_requests("_token", "_POST")) {
set_error("Access denied. (Expired session or Website attacker)"); set_error("Access denied because of security violation");
show_errors(); show_errors();
} }
loadHelper("webpagetool"); // load webpage tools loadHelper("webpagetool"); // load webpage tools
loadHelper("networktool"); // load network tools loadHelper("networktool"); // load network tools
loadHelper("string.utl"); // load string utility loadHelper("string.utils"); // load string utility
loadHelper("pgkcp.lnk"); // load KCP PG Helper loadHelper("pgkcp.lnk"); // load KCP PG Helper
loadHelper("JSLoader.class"); // load javascript loader loadHelper("JSLoader.class"); // load javascript loader
@ -33,68 +34,68 @@ load_pgkcp_library();
$payres = array(); $payres = array();
$payinfo = array(); $payinfo = array();
$fieldnames = array( $fieldnames = array(
"req_tx", "req_tx",
"tran_cd", "tran_cd",
"cust_ip", "cust_ip",
"ordr_idxx", "ordr_idxx",
"good_name", "good_name",
"res_cd", "res_cd",
"res_msg", "res_msg",
"res_en_msg", "res_en_msg",
"tno", "tno",
"buyr_name", "buyr_name",
"buyr_tel1", "buyr_tel1",
"buyr_tel2", "buyr_tel2",
"buyr_mail", "buyr_mail",
"pay_method_alias", "pay_method_alias",
"pay_method", "pay_method",
"use_pay_method", "use_pay_method",
"bSucc", "bSucc",
"app_time", "app_time",
"amount", "amount",
"total_amount", "total_amount",
"coupon_mny", "coupon_mny",
"app_time", "app_time",
"amount", "amount",
"total_amount", "total_amount",
"coupon_mny", "coupon_mny",
"card_cd", "card_cd",
"card_name", "card_name",
"app_no", "app_no",
"noinf", "noinf",
"quota", "quota",
"partcanc_yn", "partcanc_yn",
"card_bin_type_01", "card_bin_type_01",
"card_bin_type_02", "card_bin_type_02",
"card_mny", "card_mny",
"bank_name", "bank_name",
"bank_code", "bank_code",
"bk_mny", "bk_mny",
"bankname", "bankname",
"depositor", "depositor",
"account", "account",
"va_date", "va_date",
"pnt_issue", "pnt_issue",
"pnt_amount", "pnt_amount",
"pnt_app_time", "pnt_app_time",
"pnt_app_no", "pnt_app_no",
"add_pnt", "add_pnt",
"use_pnt", "use_pnt",
"rsv_pnt", "rsv_pnt",
"commid", "commid",
"mobile_no", "mobile_no",
"shop_user_id", "shop_user_id",
"tk_van_code", "tk_van_code",
"tk_app_no", "tk_app_no",
"cash_yn", "cash_yn",
"cash_authno", "cash_authno",
"cash_tr_code", "cash_tr_code",
"cash_id_info", "cash_id_info",
"cash_no", "cash_no",
"pay_data" "pay_data"
); );
foreach($fieldnames as $name) { foreach($fieldnames as $name) {
$payinfo[$name] = make_safe_argument(get_requested_value($name)); $payinfo[$name] = make_safe_argument(get_requested_value($name));
} }
// set current ip address // set current ip address
@ -108,11 +109,11 @@ extract($payinfo);
// initalize data // initalize data
$data = array( $data = array(
"payres" => $payres, "payres" => $payres,
"payinfo" => $payinfo, "payinfo" => $payinfo,
"redirect_url" => get_requested_value("redirect_url"), "redirect_url" => get_requested_value("redirect_url"),
"_token" => get_session_token(), "_token" => get_session_token(),
"_next_route" => "orderpay.step3.pgkcp", "_next_route" => "orderpay.step3.pgkcp",
); );
// 02. 인스턴스 생성 및 초기화 // 02. 인스턴스 생성 및 초기화
@ -121,128 +122,128 @@ $c_PayPlus->mf_clear();
// 03. 처리 요청 정보 설정 // 03. 처리 요청 정보 설정
if($req_tx == "pay") { if($req_tx == "pay") {
$c_PayPlus->mf_set_ordr_data( "ordr_mony", get_requested_value("good_mny") ); $c_PayPlus->mf_set_ordr_data( "ordr_mony", get_requested_value("good_mny") );
$c_PayPlus->mf_set_encx_data( get_requested_value("enc_data"), get_requested_value("enc_info") ); $c_PayPlus->mf_set_encx_data( get_requested_value("enc_data"), get_requested_value("enc_info") );
} }
// 04. 실행 // 04. 실행
if($tran_cd != "") { if($tran_cd != "") {
// 응답 전문 처리 // 응답 전문 처리
$c_PayPlus->mf_do_tx( "", $g_conf_home_dir, $g_conf_site_cd, $g_conf_site_key, $tran_cd, "", $c_PayPlus->mf_do_tx( "", $g_conf_home_dir, $g_conf_site_cd, $g_conf_site_key, $tran_cd, "",
$g_conf_gw_url, $g_conf_gw_port, "payplus_cli_slib", $ordr_idxx, $g_conf_gw_url, $g_conf_gw_port, "payplus_cli_slib", $ordr_idxx,
$cust_ip, $g_conf_log_level, 0, 0, $g_conf_log_path ); $cust_ip, $g_conf_log_level, 0, 0, $g_conf_log_path );
$payres['res_cd'] = $c_PayPlus->m_res_cd; // 결과 코드 $payres['res_cd'] = $c_PayPlus->m_res_cd; // 결과 코드
$payres['res_msg'] = $c_PayPlus->m_res_msg; // 결과 메시지 $payres['res_msg'] = $c_PayPlus->m_res_msg; // 결과 메시지
// 결과 영문 메세지 // 결과 영문 메세지
//$payres['res_en_msg'] = $c_PayPlus->mf_get_res_data( "res_en_msg" ); //$payres['res_en_msg'] = $c_PayPlus->mf_get_res_data( "res_en_msg" );
} else { } else {
$c_PayPlus->m_res_cd = "9562"; $c_PayPlus->m_res_cd = "9562";
$c_PayPlus->m_res_msg = "연동 오류 tran_cd값이 설정되지 않았습니다."; $c_PayPlus->m_res_msg = "연동 오류 tran_cd값이 설정되지 않았습니다.";
} }
// 05. 승인 결과 값 추출 // 05. 승인 결과 값 추출
if($req_tx == "pay") { if($req_tx == "pay") {
if($res_cd == "0000") { if($res_cd == "0000") {
$payres['tno'] = $c_PayPlus->mf_get_res_data("tno"); // KCP 거래 고유 번호 $payres['tno'] = $c_PayPlus->mf_get_res_data("tno"); // KCP 거래 고유 번호
$payres['amount'] = $c_PayPlus->mf_get_res_data("amount"); // KCP 실제 거래 금액 $payres['amount'] = $c_PayPlus->mf_get_res_data("amount"); // KCP 실제 거래 금액
$payres['pnt_issue'] = $c_PayPlus->mf_get_res_data("pnt_issue"); // 결제 포인트사 코드 $payres['pnt_issue'] = $c_PayPlus->mf_get_res_data("pnt_issue"); // 결제 포인트사 코드
$payres['coupon_mny'] = $c_PayPlus->mf_get_res_data("coupon_mny" ); // 쿠폰금액 $payres['coupon_mny'] = $c_PayPlus->mf_get_res_data("coupon_mny" ); // 쿠폰금액
switch($use_pay_method) { switch($use_pay_method) {
case "100000000000": // 05-1. 신용카드 승인 결과 처리 case "100000000000": // 05-1. 신용카드 승인 결과 처리
$payres['card_cd'] = $c_PayPlus->mf_get_res_data( "card_cd" ); // 카드사 코드 $payres['card_cd'] = $c_PayPlus->mf_get_res_data( "card_cd" ); // 카드사 코드
$payres['card_name'] = $c_PayPlus->mf_get_res_data( "card_name" ); // 카드 종류 $payres['card_name'] = $c_PayPlus->mf_get_res_data( "card_name" ); // 카드 종류
$payres['app_time'] = $c_PayPlus->mf_get_res_data( "app_time" ); // 승인 시간 $payres['app_time'] = $c_PayPlus->mf_get_res_data( "app_time" ); // 승인 시간
$payres['app_no'] = $c_PayPlus->mf_get_res_data( "app_no" ); // 승인 번호 $payres['app_no'] = $c_PayPlus->mf_get_res_data( "app_no" ); // 승인 번호
$payres['noinf'] = $c_PayPlus->mf_get_res_data( "noinf" ); // 무이자 여부 ( 'Y' : 무이자 ) $payres['noinf'] = $c_PayPlus->mf_get_res_data( "noinf" ); // 무이자 여부 ( 'Y' : 무이자 )
$payres['quota'] = $c_PayPlus->mf_get_res_data( "quota" ); // 할부 개월 수 $payres['quota'] = $c_PayPlus->mf_get_res_data( "quota" ); // 할부 개월 수
$payres['partcanc_yn'] = $c_PayPlus->mf_get_res_data( "partcanc_yn" ); // 부분취소 가능유무 $payres['partcanc_yn'] = $c_PayPlus->mf_get_res_data( "partcanc_yn" ); // 부분취소 가능유무
$payres['card_bin_type_01'] = $c_PayPlus->mf_get_res_data( "card_bin_type_01" ); // 카드구분1 $payres['card_bin_type_01'] = $c_PayPlus->mf_get_res_data( "card_bin_type_01" ); // 카드구분1
$payres['card_bin_type_02'] = $c_PayPlus->mf_get_res_data( "card_bin_type_02" ); // 카드구분2 $payres['card_bin_type_02'] = $c_PayPlus->mf_get_res_data( "card_bin_type_02" ); // 카드구분2
$payres['card_mny'] = $c_PayPlus->mf_get_res_data( "card_mny" ); // 카드결제금액 $payres['card_mny'] = $c_PayPlus->mf_get_res_data( "card_mny" ); // 카드결제금액
// 05-1.1. 복합결제(포인트+신용카드) 승인 결과 처리 // 05-1.1. 복합결제(포인트+신용카드) 승인 결과 처리
if(in_array($pnt_issue, array("SCSK", "SCWB"))) { if(in_array($pnt_issue, array("SCSK", "SCWB"))) {
$payres['pnt_amount'] = $c_PayPlus->mf_get_res_data ( "pnt_amount" ); // 적립금액 or 사용금액 $payres['pnt_amount'] = $c_PayPlus->mf_get_res_data ( "pnt_amount" ); // 적립금액 or 사용금액
$payres['pnt_app_time'] = $c_PayPlus->mf_get_res_data ( "pnt_app_time" ); // 승인시간 $payres['pnt_app_time'] = $c_PayPlus->mf_get_res_data ( "pnt_app_time" ); // 승인시간
$payres['pnt_app_no'] = $c_PayPlus->mf_get_res_data ( "pnt_app_no" ); // 승인번호 $payres['pnt_app_no'] = $c_PayPlus->mf_get_res_data ( "pnt_app_no" ); // 승인번호
$payres['add_pnt'] = $c_PayPlus->mf_get_res_data ( "add_pnt" ); // 발생 포인트 $payres['add_pnt'] = $c_PayPlus->mf_get_res_data ( "add_pnt" ); // 발생 포인트
$payres['use_pnt'] = $c_PayPlus->mf_get_res_data ( "use_pnt" ); // 사용가능 포인트 $payres['use_pnt'] = $c_PayPlus->mf_get_res_data ( "use_pnt" ); // 사용가능 포인트
$payres['rsv_pnt'] = $c_PayPlus->mf_get_res_data ( "rsv_pnt" ); // 총 누적 포인트 $payres['rsv_pnt'] = $c_PayPlus->mf_get_res_data ( "rsv_pnt" ); // 총 누적 포인트
$payres['total_amount'] = $amount + $pnt_amount; // 복합결제시 총 거래금액 $payres['total_amount'] = $amount + $pnt_amount; // 복합결제시 총 거래금액
} }
break; // END 05-1 break; // END 05-1
case "010000000000": // 05-2. 계좌이체 승인 결과 처리 case "010000000000": // 05-2. 계좌이체 승인 결과 처리
$payres['app_time'] = $c_PayPlus->mf_get_res_data( "app_time" ); // 승인 시간 $payres['app_time'] = $c_PayPlus->mf_get_res_data( "app_time" ); // 승인 시간
$payres['bank_name'] = $c_PayPlus->mf_get_res_data( "bank_name" ); // 은행명 $payres['bank_name'] = $c_PayPlus->mf_get_res_data( "bank_name" ); // 은행명
$payres['bank_code'] = $c_PayPlus->mf_get_res_data( "bank_code" ); // 은행코드 $payres['bank_code'] = $c_PayPlus->mf_get_res_data( "bank_code" ); // 은행코드
$payres['bk_mny'] = $c_PayPlus->mf_get_res_data( "bk_mny" ); // 계좌이체결제금액 $payres['bk_mny'] = $c_PayPlus->mf_get_res_data( "bk_mny" ); // 계좌이체결제금액
break; // END 05-2 break; // END 05-2
case "001000000000": // 05-3. 가상계좌 승인 결과 처리 case "001000000000": // 05-3. 가상계좌 승인 결과 처리
$payres['bankname'] = $c_PayPlus->mf_get_res_data( "bankname" ); // 입금할 은행 이름 $payres['bankname'] = $c_PayPlus->mf_get_res_data( "bankname" ); // 입금할 은행 이름
$payres['depositor'] = $c_PayPlus->mf_get_res_data( "depositor" ); // 입금할 계좌 예금주 $payres['depositor'] = $c_PayPlus->mf_get_res_data( "depositor" ); // 입금할 계좌 예금주
$payres['account'] = $c_PayPlus->mf_get_res_data( "account" ); // 입금할 계좌 번호 $payres['account'] = $c_PayPlus->mf_get_res_data( "account" ); // 입금할 계좌 번호
$payres['va_date'] = $c_PayPlus->mf_get_res_data( "va_date" ); // 가상계좌 입금마감시간 $payres['va_date'] = $c_PayPlus->mf_get_res_data( "va_date" ); // 가상계좌 입금마감시간
break; // END 05-3 break; // END 05-3
case "000100000000": // 05-4. 포인트 승인 결과 처리 case "000100000000": // 05-4. 포인트 승인 결과 처리
$payres['pnt_amount'] = $c_PayPlus->mf_get_res_data( "pnt_amount" ); // 적립금액 or 사용금액 $payres['pnt_amount'] = $c_PayPlus->mf_get_res_data( "pnt_amount" ); // 적립금액 or 사용금액
$payres['pnt_app_time'] = $c_PayPlus->mf_get_res_data( "pnt_app_time" ); // 승인시간 $payres['pnt_app_time'] = $c_PayPlus->mf_get_res_data( "pnt_app_time" ); // 승인시간
$payres['pnt_app_no'] = $c_PayPlus->mf_get_res_data( "pnt_app_no" ); // 승인번호 $payres['pnt_app_no'] = $c_PayPlus->mf_get_res_data( "pnt_app_no" ); // 승인번호
$payres['add_pnt'] = $c_PayPlus->mf_get_res_data( "add_pnt" ); // 발생 포인트 $payres['add_pnt'] = $c_PayPlus->mf_get_res_data( "add_pnt" ); // 발생 포인트
$payres['use_pnt'] = $c_PayPlus->mf_get_res_data( "use_pnt" ); // 사용가능 포인트 $payres['use_pnt'] = $c_PayPlus->mf_get_res_data( "use_pnt" ); // 사용가능 포인트
$payres['rsv_pnt'] = $c_PayPlus->mf_get_res_data( "rsv_pnt" ); // 적립 포인트 $payres['rsv_pnt'] = $c_PayPlus->mf_get_res_data( "rsv_pnt" ); // 적립 포인트
break; // END 05-4 break; // END 05-4
case "000010000000": // 05-5. 휴대폰 승인 결과 처리 case "000010000000": // 05-5. 휴대폰 승인 결과 처리
$payres['app_time'] = $c_PayPlus->mf_get_res_data( "hp_app_time" ); // 승인 시간 $payres['app_time'] = $c_PayPlus->mf_get_res_data( "hp_app_time" ); // 승인 시간
$payres['commid'] = $c_PayPlus->mf_get_res_data( "commid" ); // 통신사 코드 $payres['commid'] = $c_PayPlus->mf_get_res_data( "commid" ); // 통신사 코드
$payres['mobile_no'] = $c_PayPlus->mf_get_res_data( "mobile_no" ); // 휴대폰 번호 $payres['mobile_no'] = $c_PayPlus->mf_get_res_data( "mobile_no" ); // 휴대폰 번호
break; // END 05-5 break; // END 05-5
case "000000001000": // 05-6. 상품권 승인 결과 처리 case "000000001000": // 05-6. 상품권 승인 결과 처리
$payres['app_time'] = $c_PayPlus->mf_get_res_data( "tk_app_time" ); // 승인 시간 $payres['app_time'] = $c_PayPlus->mf_get_res_data( "tk_app_time" ); // 승인 시간
$payres['tk_van_code'] = $c_PayPlus->mf_get_res_data( "tk_van_code" ); // 발급사 코드 $payres['tk_van_code'] = $c_PayPlus->mf_get_res_data( "tk_van_code" ); // 발급사 코드
$payres['tk_app_no'] = $c_PayPlus->mf_get_res_data( "tk_app_no" ); // 승인 번호 $payres['tk_app_no'] = $c_PayPlus->mf_get_res_data( "tk_app_no" ); // 승인 번호
break; // END 05-6 break; // END 05-6
} }
// 05-7. 현금영수증 결과 처리 // 05-7. 현금영수증 결과 처리
$payres['cash_authno'] = $c_PayPlus->mf_get_res_data( "cash_authno" ); // 현금 영수증 승인 번호 $payres['cash_authno'] = $c_PayPlus->mf_get_res_data( "cash_authno" ); // 현금 영수증 승인 번호
$payres['cash_no'] = $c_PayPlus->mf_get_res_data( "cash_no" ); // 현금 영수증 거래 번호 $payres['cash_no'] = $c_PayPlus->mf_get_res_data( "cash_no" ); // 현금 영수증 거래 번호
} }
} }
// checking vaild payment method // checking vaild payment method
$res_succ_flag = false; $res_succ_flag = false;
$pay_method_alias = get_value_in_array("pay_method_alias", $payinfo, ""); $pay_method_alias = get_value_in_array("pay_method_alias", $payinfo, "");
$pay_method_rules = array( $pay_method_rules = array(
"CRE" => "100000000000", // 신용카드 "CRE" => "100000000000", // 신용카드
"ACC" => "010000000000", // 계좌이체 "ACC" => "010000000000", // 계좌이체
"VAC" => "001000000000", // 가상계좌 "VAC" => "001000000000", // 가상계좌
"POI" => "000100000000", // 포인트 "POI" => "000100000000", // 포인트
"PHO" => "000010000000", // 휴대폰 "PHO" => "000010000000", // 휴대폰
"GIF" => "000000001000", // 상품권 "GIF" => "000000001000", // 상품권
"ARS" => "000000000010", // ARS "ARS" => "000000000010", // ARS
"CAV" => "111000000000", // 신용카드/계좌이체/가상계좌 "CAV" => "111000000000", // 신용카드/계좌이체/가상계좌
"NOP" => "" // 수기결제/무통장입금 "NOP" => "" // 수기결제/무통장입금
); );
foreach($pay_method_rules as $k=>$v) { foreach($pay_method_rules as $k=>$v) {
if($pay_method_alias == $k) { if($pay_method_alias == $k) {
$payres['use_pay_method_alias'] = $k; $payres['use_pay_method_alias'] = $k;
$res_succ_flag = true; $res_succ_flag = true;
break; break;
} }
} }
$payres['bSucc'] = $res_succ_flag ? "true" : "false"; $payres['bSucc'] = $res_succ_flag ? "true" : "false";
@ -251,29 +252,34 @@ extract($payres);
// cancel payment when failed // cancel payment when failed
if($req_tx == "pay") { if($req_tx == "pay") {
if($res_cd == "0000") { if($res_cd == "0000") {
if($bSucc == "false") { if($bSucc == "false") {
$c_PayPlus->mf_clear(); $c_PayPlus->mf_clear();
$payres['tran_cd'] = "00200000"; $payres['tran_cd'] = "00200000";
$c_PayPlus->mf_set_modx_data( "tno", $tno ); // KCP 원거래 거래번호 $c_PayPlus->mf_set_modx_data( "tno", $tno ); // KCP 원거래 거래번호
$c_PayPlus->mf_set_modx_data( "mod_type", "STSC" ); // 원거래 변경 요청 종류 $c_PayPlus->mf_set_modx_data( "mod_type", "STSC" ); // 원거래 변경 요청 종류
$c_PayPlus->mf_set_modx_data( "mod_ip", $cust_ip); // 변경 요청자 IP $c_PayPlus->mf_set_modx_data( "mod_ip", $cust_ip); // 변경 요청자 IP
$c_PayPlus->mf_set_modx_data( "mod_desc", "결과 처리 오류 - 자동 취소" ); // 변경 사유 $c_PayPlus->mf_set_modx_data( "mod_desc", "결과 처리 오류 - 자동 취소" ); // 변경 사유
// 응답 전문 처리 // 응답 전문 처리
$c_PayPlus->mf_do_tx( $c_PayPlus->mf_do_tx(
"", $g_conf_home_dir, $g_conf_site_cd, $g_conf_site_key, $tran_cd, "", "", $g_conf_home_dir, $g_conf_site_cd, $g_conf_site_key, $tran_cd, "",
$g_conf_gw_url, $g_conf_gw_port, "payplus_cli_slib", $ordr_idxx, $g_conf_gw_url, $g_conf_gw_port, "payplus_cli_slib", $ordr_idxx,
$cust_ip, $g_conf_log_level, 0, 0, $g_conf_log_path $cust_ip, $g_conf_log_level, 0, 0, $g_conf_log_path
); );
$payres['res_cd'] = $c_PayPlus->m_res_cd; $payres['res_cd'] = $c_PayPlus->m_res_cd;
$payres['res_msg'] = $c_PayPlus->m_res_msg; $payres['res_msg'] = $c_PayPlus->m_res_msg;
} }
} }
} // End of [res_cd = "0000"] } // End of [res_cd = "0000"]
// set encoding
foreach($payres as $k=>$v) {
$payres[$k] = get_converted_string($v, "utf-8", "cp949");
}
// set result // set result
extract($payres); extract($payres);
@ -288,7 +294,7 @@ $data['jsoutput'] = $jsoutput;
// convert payres to payinfo // convert payres to payinfo
foreach($payres as $k=>$v) { foreach($payres as $k=>$v) {
$payinfo[$k] = $v; $payinfo[$k] = $v;
} }
$data['payinfo'] = $payinfo; $data['payinfo'] = $payinfo;

View File

@ -2,7 +2,7 @@
/** /**
* @file orderpay.step3.pgkcp.php * @file orderpay.step3.pgkcp.php
* @date 2018-08-27 * @date 2018-08-27
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <abuse@catswords.net>
* @brief KCP PG(Payment Gateway) contoller when done * @brief KCP PG(Payment Gateway) contoller when done
*/ */
@ -10,8 +10,8 @@ if(!defined("_DEF_RSF_")) set_error_exit("do not allow access");
// detect CSRF attack // detect CSRF attack
if(check_token_abuse_by_requests("_token", "_POST")) { if(check_token_abuse_by_requests("_token", "_POST")) {
set_error("Access denied. (Expired session or Website attacker)"); set_error("Access denied because of security violation");
show_errors(); show_errors();
} }
// set token // set token
@ -31,73 +31,73 @@ extract($pgkcp_config);
// 지불 결과 // 지불 결과
$payres = array(); $payres = array();
$payinfo = array( $payinfo = array(
// 공통 // 공통
"site_cd" => get_requested_value("site_cd"), // 사이트코드 "site_cd" => get_requested_value("site_cd"), // 사이트코드
"req_tx" => get_requested_value("req_tx"), // 요청 구분(승인/취소) "req_tx" => get_requested_value("req_tx"), // 요청 구분(승인/취소)
"use_pay_method" => get_requested_value("use_pay_method"), // 사용 결제 수단 "use_pay_method" => get_requested_value("use_pay_method"), // 사용 결제 수단
"bSucc" => get_requested_value("bSucc"), // 업체 DB 정상처리 완료 여부 "bSucc" => get_requested_value("bSucc"), // 업체 DB 정상처리 완료 여부
"res_cd" => get_requested_value("res_cd"), // 업체 DB 정상처리 완료 여부 "res_cd" => get_requested_value("res_cd"), // 업체 DB 정상처리 완료 여부
"res_msg" => get_requested_value("res_msg"), // 결과메시지 "res_msg" => get_requested_value("res_msg"), // 결과메시지
"res_msg_bsucc" => "", // 결과메시지 상세 "res_msg_bsucc" => "", // 결과메시지 상세
"amount" => get_requested_value("amount"), // KCP 실제 거래 금액 "amount" => get_requested_value("amount"), // KCP 실제 거래 금액
"ordr_idxx" => get_requested_value("ordr_idxx"), // 주문번호 "ordr_idxx" => get_requested_value("ordr_idxx"), // 주문번호
"tno" => get_requested_value("tno"), // KCP 거래번호 "tno" => get_requested_value("tno"), // KCP 거래번호
"good_name" => get_requested_value("good_name"), // 상품명 "good_name" => get_requested_value("good_name"), // 상품명
"buyr_name" => get_requested_value("buyr_name"), // 구매자명 "buyr_name" => get_requested_value("buyr_name"), // 구매자명
"buyr_tel1" => get_requested_value("buyr_tel1"), // 구매자 전화번호 "buyr_tel1" => get_requested_value("buyr_tel1"), // 구매자 전화번호
"buyr_tel2" => get_requested_value("buyr_tel2"), // 구매자 휴대폰번호 "buyr_tel2" => get_requested_value("buyr_tel2"), // 구매자 휴대폰번호
"buyr_mail" => get_requested_value("buyr_mail"), // 구매자 E-Mail "buyr_mail" => get_requested_value("buyr_mail"), // 구매자 E-Mail
// 공통 2 // 공통 2
"pnt_issue" => get_requested_value("pnt_issue"), // 포인트 서비스사 "pnt_issue" => get_requested_value("pnt_issue"), // 포인트 서비스사
"app_time" => get_requested_value("app_time"), // 승인시간 (공통) "app_time" => get_requested_value("app_time"), // 승인시간 (공통)
// 신용카드 // 신용카드
"card_cd" => get_requested_value("card_cd"), // 카드코드 "card_cd" => get_requested_value("card_cd"), // 카드코드
"card_name" => get_requested_value("card_name"), // 카드명 "card_name" => get_requested_value("card_name"), // 카드명
"noinf" => get_requested_value("noinf"), // 무이자 여부 "noinf" => get_requested_value("noinf"), // 무이자 여부
"quota" => get_requested_value("quota"), // 할부개월 "quota" => get_requested_value("quota"), // 할부개월
"app_no" => get_requested_value("app_no"), // 승인번호 "app_no" => get_requested_value("app_no"), // 승인번호
// 계좌이체 // 계좌이체
"bank_name" => get_requested_value("bank_name"), // 은행명 "bank_name" => get_requested_value("bank_name"), // 은행명
"bank_code" => get_requested_value("bank_code"), // 은행코드 "bank_code" => get_requested_value("bank_code"), // 은행코드
// 가상계좌 // 가상계좌
"bankname" => get_requested_value("bankname"), // 입금할 은행 "bankname" => get_requested_value("bankname"), // 입금할 은행
"depositor" => get_requested_value("depositor"), // 입금할 계좌 예금주 "depositor" => get_requested_value("depositor"), // 입금할 계좌 예금주
"account" => get_requested_value("account"), // 입금할 계좌 번호 "account" => get_requested_value("account"), // 입금할 계좌 번호
"va_date" => get_requested_value("va_date"), // 가상계좌 입금마감시간 "va_date" => get_requested_value("va_date"), // 가상계좌 입금마감시간
// 포인트 // 포인트
"add_pnt" => get_requested_value("add_pnt"), // 발생 포인트 "add_pnt" => get_requested_value("add_pnt"), // 발생 포인트
"use_pnt" => get_requested_value("use_pnt"), // 사용가능 포인트 "use_pnt" => get_requested_value("use_pnt"), // 사용가능 포인트
"rsv_pnt" => get_requested_value("rsv_pnt"), // 총 누적 포인트 "rsv_pnt" => get_requested_value("rsv_pnt"), // 총 누적 포인트
"pnt_app_time" => get_requested_value("pnt_app_time"), // 승인시간 "pnt_app_time" => get_requested_value("pnt_app_time"), // 승인시간
"pnt_app_no" => get_requested_value("pnt_app_no"), // 승인번호 "pnt_app_no" => get_requested_value("pnt_app_no"), // 승인번호
"pnt_amount" => get_requested_value("pnt_amount"), // 적립금액 or 사용금액 "pnt_amount" => get_requested_value("pnt_amount"), // 적립금액 or 사용금액
// 상품권 // 상품권
"tk_van_code" => get_requested_value("tk_van_code"), // 발급사 코드 "tk_van_code" => get_requested_value("tk_van_code"), // 발급사 코드
"tk_app_no" => get_requested_value("tk_app_no"), // 승인 번호 "tk_app_no" => get_requested_value("tk_app_no"), // 승인 번호
// 휴대전화 // 휴대전화
"commid" => get_requested_value("tk_app_no"), // 통신사 코드 "commid" => get_requested_value("tk_app_no"), // 통신사 코드
"mobile_no" => get_requested_value("mobile_no"), // 휴대폰 번호 "mobile_no" => get_requested_value("mobile_no"), // 휴대폰 번호
// 현금영수증 // 현금영수증
"cash_yn" => get_requested_value("cash_yn"), // 현금영수증 등록 여부 "cash_yn" => get_requested_value("cash_yn"), // 현금영수증 등록 여부
"cash_authno" => get_requested_value("cash_authno"), // 현금영수증 승인 번호 "cash_authno" => get_requested_value("cash_authno"), // 현금영수증 승인 번호
"cash_tr_code" => get_requested_value("cash_authno"), // 현금영수증 발행 구분 "cash_tr_code" => get_requested_value("cash_authno"), // 현금영수증 발행 구분
"cash_id_info" => get_requested_value("cash_id_info"), // 현금영수증 등록 번호 "cash_id_info" => get_requested_value("cash_id_info"), // 현금영수증 등록 번호
"cash_no" => get_requested_value("cash_no"), // 현금영수증 거래 번호 "cash_no" => get_requested_value("cash_no"), // 현금영수증 거래 번호
// 확장 // 확장
"pay_method_alias" => get_requested_value("pay_method_alias"), // 결제방법 별칭 "pay_method_alias" => get_requested_value("pay_method_alias"), // 결제방법 별칭
"pay_method" => get_requested_value("pay_method"), // 사용 결제 수단 "pay_method" => get_requested_value("pay_method"), // 사용 결제 수단
// 요청 상세 전문 // 요청 상세 전문
"pay_data" => get_requested_value("pay_data"), // 요청 상세 전문 "pay_data" => get_requested_value("pay_data"), // 요청 상세 전문
); );
// extract payinfo // extract payinfo
@ -105,34 +105,34 @@ extract($payinfo);
// initalize data // initalize data
$data = array( $data = array(
"payres" => $payres, "payres" => $payres,
"payinfo" => $payinfo, "payinfo" => $payinfo,
"redirect_url" => get_requested_value("redirect_url"), "redirect_url" => get_requested_value("redirect_url"),
"_token" => get_session_token(), "_token" => get_session_token(),
"_next_route" => "ordercomplete.pgkcp", "_next_route" => "ordercomplete.pgkcp",
); );
// 이름 지정 // 이름 지정
$req_tx_name = ""; $req_tx_name = "";
$req_tx_names = array( $req_tx_names = array(
"pay" => "지불", "pay" => "지불",
"mod" => "매입/취소" "mod" => "매입/취소"
); );
if(array_key_exists($req_tx, $req_tx_names)) { if(array_key_exists($req_tx, $req_tx_names)) {
$req_tx_name = $req_tx_names[$req_tx]; $req_tx_name = $req_tx_names[$req_tx];
} }
$payres['req_tx_name'] = $req_tx_name; $payres['req_tx_name'] = $req_tx_name;
// 가맹점 측 DB 처리 실패시 상세 결과 메시지 설정 // 가맹점 측 DB 처리 실패시 상세 결과 메시지 설정
$res_msg_bsucc = ""; $res_msg_bsucc = "";
if($req_tx == "pay") { if($req_tx == "pay") {
if($bSucc == "false") { if($bSucc == "false") {
if ($res_cd == "0000") { if ($res_cd == "0000") {
$res_msg_bsucc = "결제는 정상적으로 이루어졌지만 업체에서 결제 결과를 처리하는 중 오류가 발생하여 시스템에서 자동으로 취소 요청을 하였습니다. 업체로 문의하여 확인하시기 바랍니다."; $res_msg_bsucc = "결제는 정상적으로 이루어졌지만 업체에서 결제 결과를 처리하는 중 오류가 발생하여 시스템에서 자동으로 취소 요청을 하였습니다. 업체로 문의하여 확인하시기 바랍니다.";
} else { } else {
$res_msg_bsucc = "결제는 정상적으로 이루어졌지만 업체에서 결제 결과를 처리하는 중 오류가 발생하여 시스템에서 자동으로 취소 요청을 하였으나, 취소가 실패 되었습니다. 업체로 문의하여 확인하시기 바랍니다."; $res_msg_bsucc = "결제는 정상적으로 이루어졌지만 업체에서 결제 결과를 처리하는 중 오류가 발생하여 시스템에서 자동으로 취소 요청을 하였으나, 취소가 실패 되었습니다. 업체로 문의하여 확인하시기 바랍니다.";
} }
} }
} }
$payres['res_msg_bsucc'] = $req_tx_name; $payres['res_msg_bsucc'] = $req_tx_name;
@ -148,7 +148,7 @@ $data['jsoutput'] = $jsoutput;
// convert payres to payinfo // convert payres to payinfo
foreach($payres as $k=>$v) { foreach($payres as $k=>$v) {
$payinfo[$k] = $v; $payinfo[$k] = $v;
} }
$data['payinfo'] = $payinfo; $data['payinfo'] = $payinfo;

View File

@ -3,7 +3,7 @@ if(!defined("_DEF_RSF_")) set_error_exit("do not allow access");
$data = array( $data = array(
"name" => "Hong gil dong", "name" => "Hong gil dong",
"email" => "support@exts.kr", "email" => "abuse@catswords.net",
"tel" => ""01000000000", "tel" => ""01000000000",
"base_url" => base_url() "base_url" => base_url()
); );

2
route/ping.php Normal file
View File

@ -0,0 +1,2 @@
<?php
echo "pong";

103
route/webapp.php Normal file
View File

@ -0,0 +1,103 @@
<?php
/**
* @file webapp.php
* @date 2019-02-23
* @author Go Namhyeon <abuse@catswords.net>
* @brief Isolator(Compatibility mode) for legacy application
*/
loadHelper("isemail.lnk");
if(!defined("_DEF_RSF_")) set_error_exit("do not allow access");
// Protect GET method
foreach($_GET as $k=>$v) {
$_GET[$k] = get_requested_value($k, "_GET");
}
// Protect POST method
foreach($_POST as $k=>$v) {
$_POST[$k] = get_requested_value($k, "_POST");
}
// Protect REQUEST(ALL) method
foreach($_REQUEST as $k=>$v) {
$_REQUEST[$k] = get_requested_value($k, "_ALL");
}
// get self filename
$self_filename = "";
// get routes
$routes = read_route_all();
// set path and URL
$webapp_root = $_SERVER["DOCUMENT_ROOT"] . "/webapp";
$webapp_url = base_url() . "webapp";
// set DOCUMENT_ROOT forcely
$_SERVER["DOCUMENT_ROOT"] = $webapp_root;
// set file path
$appfile = $webapp_root . "/" . implode("/", $routes);
$appfile_path = $appfile . ".php";
// get end of routes
$is_static_file = false;
$is_redirect_to_index = false;
$end_route = end($routes);
$end_routes_attributes = explode(".", $end_route);
$end_fra = $end_routes_attributes[0];
$end_era = end($end_routes_attributes);
if($end_era == "php" || file_exists($appfile_path)) {
$appfile_path = str_replace(".php.php", ".php", $appfile_path);
if(file_exists($appfile_path)) {
include($appfile_path);
$self_filename = $end_fra . ".php";
} else {
set_error("Webapp 404 Not Found");
show_errors();
}
} else {
if(file_exists($appfile . "/index.php")) {
$appfile .= "/index.php";
if(empty($end_era)) {
include($appfile);
} else {
$is_redirect_to_index = true;
}
} elseif(file_exists($appfile . "/index.html")) {
$is_static_file = true;
$appfile .= "/index.html";
if(empty($end_era)) {
$end_era = "html";
} else {
$is_redirect_to_index = true;
}
} else {
$is_static_file = true;
}
}
if($is_redirect_to_index == true) {
redirect_uri(base_url() . implode("/", $routes) . "/");
exit;
}
if($is_static_file == true) {
if(file_exists($appfile)) {
set_header_content_type($end_era);
header("Cache-Control: max-age=86400");
$fp = fopen($appfile, "r") or die("404 Not Found");
while(!feof($fp)) {
echo fread($fp, 8192);
}
fclose($fp);
} else {
set_error("404 Not Found");
show_errors();
}
}

View File

@ -4,17 +4,21 @@ if(!defined("_DEF_RSF_")) set_error_exit("do not allow access");
loadHelper("webpagetool"); loadHelper("webpagetool");
$method = get_requested_value("method"); $method = get_requested_value("method");
$mime = get_requested_value("mime"); // example: text/html, image/jpeg
$url = get_requested_value("url"); $url = get_requested_value("url");
$res_method = "get.cache"; $res_method = "get.cache";
$res_methods = explode(".", $method); $res_methods = explode(".", $method);
if(in_array("nocache", $res_methods)) { if(in_array("nocache", $res_methods)) {
$res_method = "get"; $res_method = "get";
} }
if(!empty($url)) { if(!empty($url)) {
$response = get_web_page($url, $res_method); $response = get_web_page($url, $res_method);
echo $response['content']; if(!empty($mime)) {
header(sprintf("Content-Type: %s", $mime));
}
print_r($response['content']);
} }
write_common_log(sprintf("%s\t%s\t%s", get_current_datetime(), "webproxy", $url)); write_common_log($url, "webproxy");

View File

@ -13,36 +13,36 @@ $action = get_requested_value("action");
$response = false; $response = false;
switch($action) { switch($action) {
case "write": case "write":
$form_data = array( $form_data = array(
"title" => get_requested_value("title"), "title" => get_requested_value("title"),
"content" => get_requested_value("content"), "content" => get_requested_value("content"),
"author" => 2, "author" => 2,
"status" => get_requested_value("status"), "status" => get_requested_value("status"),
"categories" => get_requested_value("categories") "categories" => get_requested_value("categories")
); );
// run post // run post
$response = write_wp_post($wp_server_url, $wp_access_token, $form_data); $response = write_wp_post($wp_server_url, $wp_access_token, $form_data);
redirect_uri(get_route_link($route)); redirect_uri(get_route_link($route));
break; break;
default: default:
// set session token // set session token
set_session_token(); set_session_token();
// authenticate // authenticate
$client_id = ""; $client_id = "";
$client_secret = ""; $client_secret = "";
authenticate_wp($wp_server_url, $client_id, $client_secret, $route, $code); authenticate_wp($wp_server_url, $client_id, $client_secret, $route, $code);
$categories = get_wp_categories($wp_server_url, $wp_access_token); $categories = get_wp_categories($wp_server_url, $wp_access_token);
$data = array( $data = array(
"route" => $route, "route" => $route,
"categories" => $categories, "categories" => $categories,
"_token" => get_session_token() "_token" => get_session_token()
); );
renderView("view_wppost", $data); renderView("view_wppost", $data);
} }

View File

@ -0,0 +1,18 @@
<?php
return <<<EOF
[3rdparty]
zabbix_host=
zabbix_username=
zabbix_password=
zabbix_protocol=http
twilio_sid=
twilio_token=
twilio_from=
twilio_char_limit=160
vworld_api_key=
vworld_api_domain=
mailgun_domain=
mailgun_name=
mailgun_from=
mailgun_apikey=
EOF;

View File

@ -6,5 +6,8 @@ db_host = localhost
db_name = dbname db_name = dbname
db_username = dbusername db_username = dbusername
db_password = dbpassword db_password = dbpassword
db_retry_limit = 3
db_fetch_mode = sql
db_separated_tables =
storage_dir = storage storage_dir = storage
EOF; EOF;

View File

@ -0,0 +1,5 @@
<?php
return <<<EOF
[deprecated]
deprecated_fn=check_invalid_function,check_function_exists,array_multikey_empty,split_by_line,startsWith,endsWith
EOF;

View File

@ -29,15 +29,15 @@ return array(
"Google" => array( "Google" => array(
"enabled" => true, "enabled" => true,
"keys" => array( "keys" => array(
"id" => get_value_in_array("sns_google_id", $config, ""), "id" => get_value_in_array("social_google_id", $config, ""),
"secret" => get_value_in_array("sns_google_secret", $config, ""), "secret" => get_value_in_array("social_google_secret", $config, ""),
), ),
), ),
"Facebook" => array( "Facebook" => array(
"enabled" => true, "enabled" => true,
"keys" => array( "keys" => array(
"id" => get_value_in_array("sns_facebook_id", $config, ""), "id" => get_value_in_array("social_facebook_id", $config, ""),
"secret" => get_value_in_array("sns_facebook_secret", $config, ""), "secret" => get_value_in_array("social_facebook_secret", $config, ""),
), ),
"trustForwarded" => false, "trustForwarded" => false,
"scope" => array("email", "public_profile"), "scope" => array("email", "public_profile"),
@ -45,8 +45,8 @@ return array(
"Twitter" => array( "Twitter" => array(
"enabled" => true, "enabled" => true,
"keys" => array( "keys" => array(
"key" => get_value_in_array("sns_twitter_key", $config, ""), "key" => get_value_in_array("social_twitter_key", $config, ""),
"secret" => get_value_in_array("sns_twitter_secret", $config, ""), "secret" => get_value_in_array("social_twitter_secret", $config, ""),
), ),
"includeEmail" => false, "includeEmail" => false,
), ),
@ -58,8 +58,8 @@ return array(
"LinkedIn" => array( "LinkedIn" => array(
"enabled" => true, "enabled" => true,
"keys" => array( "keys" => array(
"id" => get_value_in_array("sns_linkedin_id", $config, ""), "id" => get_value_in_array("social_linkedin_id", $config, ""),
"secret" => get_value_in_array("sns_linkedin_secret", $config, ""), "secret" => get_value_in_array("social_linkedin_secret", $config, ""),
), ),
"fields" => array(), "fields" => array(),
), ),

View File

@ -0,0 +1,6 @@
<?php
return <<<EOF
[l10n]
l10n_enabled=0
l10n_default_language=ko
EOF;

View File

@ -0,0 +1,11 @@
<?php
return <<<EOF
lguplus_enabled = 1
lguplus_key = ""
lguplus_secret = ""
lguplus_id = ""
lguplus_pw = ""
lguplus_from = ""
lguplus_country = "82"
lguplus_subject = "Untitled text message"
EOF;

View File

@ -0,0 +1,9 @@
<?php
return <<<EOF
[logger]
rfc3164_enabled=0
rfc3164_host=logs6.papertrailapp.com
rfc3164_port=42986
log_rotate_size=104857600
log_rotate_ratio=0.9
EOF;

View File

@ -4,7 +4,12 @@ return <<<EOF
masterkey=ZVScK4o3DTQsQjyr masterkey=ZVScK4o3DTQsQjyr
masteriv=qcLHsW6g11E1JEAF masteriv=qcLHsW6g11E1JEAF
salt=H6hclwzFplRQw39C salt=H6hclwzFplRQw39C
saltdisabled=0
adjectives=warty,hoary,breezy,dapper,edgy,feisty,gutsy,hardy,intrepid,jaunty,karmic,lucid,maverick,natty,oneiric,precise,quantal,raring,saucy,trusty,utopic,vivid,wliy,xeniel,yakkety,zesty adjectives=warty,hoary,breezy,dapper,edgy,feisty,gutsy,hardy,intrepid,jaunty,karmic,lucid,maverick,natty,oneiric,precise,quantal,raring,saucy,trusty,utopic,vivid,wliy,xeniel,yakkety,zesty
animals=warthog,hedgehog,badger,drake,eft,fawn,gibbon,heron,ibex,jackalope,koala,lynx,meerkat,narwhal,ocelot,pangolin,quetzal,ringtail,salamander,tahr,unicorn,vervet,werewolf,xerus,yak,zapus animals=warthog,hedgehog,badger,drake,eft,fawn,gibbon,heron,ibex,jackalope,koala,lynx,meerkat,narwhal,ocelot,pangolin,quetzal,ringtail,salamander,tahr,unicorn,vervet,werewolf,xerus,yak,zapus
httpencrypt=auto https=auto
hashalgos=md5,sha1,crypt,crc32,base64,sql_password
sandboxdisabled=1
allowextensionsdisabled=1
allowextensions=png,gif,jpg,jpeg,tif,xls,ppt,doc,xlsx,pptx,docx,odt,odp,ods,xlsm,tiff,pdf,xlsm,mp3,ogg,m4a,wma,wav
EOF; EOF;

Some files were not shown because too many files have changed in this diff Show More