質問編集履歴
1
セキュリティの関わる問題なので削除させていただきました。
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
セキュリティの関わる問題なので削除させていただきました。
|
test
CHANGED
@@ -1,201 +1 @@
|
|
1
|
-
下記コードでエラーが起きるのですが
|
2
|
-
|
3
|
-
原因が全くわかりません。。
|
4
|
-
|
5
|
-
<?php
|
6
|
-
|
7
|
-
で開始して
|
8
|
-
|
9
|
-
?>で閉じようとすると
|
10
|
-
|
11
|
-
>の色がおかしくなるのでコードに原因があると思うのですが。。
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
バージョンは5.3です
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
```php
|
20
|
-
|
21
|
-
///////////////////////////////////////////////////////////////////
|
22
|
-
|
23
|
-
//IP範囲チェック
|
24
|
-
|
25
|
-
///////////////////////////////////////////////////////////////////
|
26
|
-
|
27
|
-
function IpCheck(){
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
$access_ip = CommonComponent::getAccessIp();
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
$sql = "SELECT start_ip, last_ip FROM allow_ips AS AllowIps WHERE INET_ATON(?) between INET_ATON(start_ip) and INET_ATON(last_ip)";
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
$ips = $this->AllowIps->query($sql,array($this->$access_ip);
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
return $ips;
|
44
|
-
|
45
|
-
}
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
///////////////////////////////////////////////////////////////////
|
52
|
-
|
53
|
-
//フラグIP範囲チェック
|
54
|
-
|
55
|
-
///////////////////////////////////////////////////////////////////
|
56
|
-
|
57
|
-
function FigIpCheck(){
|
58
|
-
|
59
|
-
$access_ip = CommonComponent::getAccessIp();
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
$sql = "SELECT start_ip, last_ip, full_access_flg FROM allow_ips AS AllowIps WHERE INET_ATON(?) between INET_ATON(start_ip) and INET_ATON(last_ip)";
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
$ips = $this->AllowIps->query($sql,array($this->$access_ip));
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
return $ips;
|
72
|
-
|
73
|
-
}
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
///////////////////////////////////////////////////////////////////
|
78
|
-
|
79
|
-
//識別します
|
80
|
-
|
81
|
-
///////////////////////////////////////////////////////////////////
|
82
|
-
|
83
|
-
function identification(){
|
84
|
-
|
85
|
-
$results=CommonComponent::CheckExplainParce($u_userid,$u_id);
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
foreach ($results as $result) {
|
90
|
-
|
91
|
-
//$results[$cnt]->typeを抜き出す
|
92
|
-
|
93
|
-
$u_type=$result->type;
|
94
|
-
|
95
|
-
//更新系の場合
|
96
|
-
|
97
|
-
if( eregi($u_type,"^insert|^create table|^create database|^drop database|^drop table")){
|
98
|
-
|
99
|
-
//対象のDBを$results[$cnt]->dbを$resultsから抽出
|
100
|
-
|
101
|
-
$u_db=$result->db;
|
102
|
-
|
103
|
-
//対象のDBが個人情報DBか識別
|
104
|
-
|
105
|
-
$dbcheck = $this->PrivateHiveDb->find('count', array(
|
106
|
-
|
107
|
-
'conditions' => array('PrivateHiveDb.hive_database' => $u_db)
|
108
|
-
|
109
|
-
);
|
110
|
-
|
111
|
-
//対象のDBが個人情報系の場合
|
112
|
-
|
113
|
-
if($dbcheck){
|
114
|
-
|
115
|
-
// 接続元IP情報
|
116
|
-
|
117
|
-
$ips=CommonComponent::IpCheck();
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
if (empty($ips)) {
|
122
|
-
|
123
|
-
return 1;
|
124
|
-
|
125
|
-
}
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
}else{
|
130
|
-
|
131
|
-
//対象のDBが非個人情報の場合
|
132
|
-
|
133
|
-
// 接続元IP情報
|
134
|
-
|
135
|
-
$ips=CommonComponent::FlgIpCheck();
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
foreach ($ips as $row) {
|
140
|
-
|
141
|
-
if ($row['full_access_flg'] == '0') {
|
142
|
-
|
143
|
-
|
1
|
+
セキュリティの関わる問題なので削除させていただきました。
|
144
|
-
|
145
|
-
return 1;
|
146
|
-
|
147
|
-
}
|
148
|
-
|
149
|
-
}
|
150
|
-
|
151
|
-
}
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
}else{
|
156
|
-
|
157
|
-
//参照系の場合
|
158
|
-
|
159
|
-
//対象のDBを$results[$cnt]->dbを$resultsから抽出
|
160
|
-
|
161
|
-
$u_db=$result->db;
|
162
|
-
|
163
|
-
//対象のDBが個人情報DBか識別
|
164
|
-
|
165
|
-
$dbcheck = $this->PrivateHiveDb->find('count',array(
|
166
|
-
|
167
|
-
'conditions' => array('PrivateHiveDb.hive_database' => $u_db)
|
168
|
-
|
169
|
-
);
|
170
|
-
|
171
|
-
//対象のDBが更新系の場合
|
172
|
-
|
173
|
-
if($dbcheck){
|
174
|
-
|
175
|
-
// 接続元IP情報
|
176
|
-
|
177
|
-
$ips=CommonComponent::IpCheck();
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
if (empty($ips)) {
|
182
|
-
|
183
|
-
return 1;
|
184
|
-
|
185
|
-
}
|
186
|
-
|
187
|
-
}
|
188
|
-
|
189
|
-
}
|
190
|
-
|
191
|
-
}
|
192
|
-
|
193
|
-
return 0;
|
194
|
-
|
195
|
-
}
|
196
|
-
|
197
|
-
}
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
```
|