GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 423fe8...f48289 )
by gyeong-won
15:56 queued 08:14
created
modules/member/member.class.php 2 patches
Spacing   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -20,13 +20,13 @@  discard block
 block discarded – undo
20 20
 	 */
21 21
 	function member()
22 22
 	{
23
-		if(!Context::isInstalled()) return;
23
+		if (!Context::isInstalled()) return;
24 24
 
25 25
 		$oModuleModel = getModel('module');
26 26
 		$member_config = $oModuleModel->getModuleConfig('member');
27 27
 
28 28
 		// Set to use SSL upon actions related member join/information/password and so on. 2013.02.15
29
-		if(!Context::isExistsSSLAction('dispMemberModifyPassword') && Context::getSslStatus() == 'optional')
29
+		if (!Context::isExistsSSLAction('dispMemberModifyPassword') && Context::getSslStatus() == 'optional')
30 30
 		{
31 31
 			$ssl_actions = array('dispMemberModifyPassword', 'dispMemberSignUpForm', 'dispMemberModifyInfo', 'dispMemberModifyEmailAddress', 'dispMemberGetTempPassword', 'dispMemberResendAuthMail', 'dispMemberLoginForm', 'dispMemberFindAccount', 'dispMemberLeave', 'procMemberLogin', 'procMemberModifyPassword', 'procMemberInsert', 'procMemberModifyInfo', 'procMemberFindAccount', 'procMemberModifyEmailAddress', 'procMemberResendAuthMail', 'procMemberLeave'/*, 'getMemberMenu'*/, 'procMemberFindAccountByQuestion');
32 32
 			Context::addSSLActions($ssl_actions);
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
 		$oModuleController = getController('module');
45 45
 
46 46
 		$oDB = &DB::getInstance();
47
-		$oDB->addIndex("member_group","idx_site_title", array("site_srl","title"),true);
47
+		$oDB->addIndex("member_group", "idx_site_title", array("site_srl", "title"), true);
48 48
 
49 49
 		$oModuleModel = getModel('module');
50 50
 		$config = $oModuleModel->getModuleConfig('member');
51 51
 
52
-		if(empty($config))
52
+		if (empty($config))
53 53
 		{
54 54
 			$isNotInstall = true;
55 55
 			$config = new stdClass;
@@ -58,29 +58,29 @@  discard block
 block discarded – undo
58 58
 		// Set the basic information
59 59
 		$config->enable_join = 'Y';
60 60
 		$config->enable_openid = 'N';
61
-		if(!$config->enable_auth_mail) $config->enable_auth_mail = 'N';
62
-		if(!$config->image_name) $config->image_name = 'Y';
63
-		if(!$config->image_mark) $config->image_mark = 'Y';
64
-		if(!$config->profile_image) $config->profile_image = 'Y';
65
-		if(!$config->image_name_max_width) $config->image_name_max_width = '90';
66
-		if(!$config->image_name_max_height) $config->image_name_max_height = '20';
67
-		if(!$config->image_mark_max_width) $config->image_mark_max_width = '20';
68
-		if(!$config->image_mark_max_height) $config->image_mark_max_height = '20';
69
-		if(!$config->profile_image_max_width) $config->profile_image_max_width = '90';
70
-		if(!$config->profile_image_max_height) $config->profile_image_max_height = '90';
71
-		if($config->group_image_mark!='Y') $config->group_image_mark = 'N';
72
-		if(!$config->password_strength) $config->password_strength = 'normal';
61
+		if (!$config->enable_auth_mail) $config->enable_auth_mail = 'N';
62
+		if (!$config->image_name) $config->image_name = 'Y';
63
+		if (!$config->image_mark) $config->image_mark = 'Y';
64
+		if (!$config->profile_image) $config->profile_image = 'Y';
65
+		if (!$config->image_name_max_width) $config->image_name_max_width = '90';
66
+		if (!$config->image_name_max_height) $config->image_name_max_height = '20';
67
+		if (!$config->image_mark_max_width) $config->image_mark_max_width = '20';
68
+		if (!$config->image_mark_max_height) $config->image_mark_max_height = '20';
69
+		if (!$config->profile_image_max_width) $config->profile_image_max_width = '90';
70
+		if (!$config->profile_image_max_height) $config->profile_image_max_height = '90';
71
+		if ($config->group_image_mark != 'Y') $config->group_image_mark = 'N';
72
+		if (!$config->password_strength) $config->password_strength = 'normal';
73 73
 		
74
-		if(!$config->password_hashing_algorithm)
74
+		if (!$config->password_hashing_algorithm)
75 75
 		{
76 76
 			$oPassword = new Password();
77 77
 			$config->password_hashing_algorithm = $oPassword->getBestAlgorithm();
78 78
 		}
79
-		if(!$config->password_hashing_work_factor)
79
+		if (!$config->password_hashing_work_factor)
80 80
 		{
81 81
 			$config->password_hashing_work_factor = 8;
82 82
 		}
83
-		if(!$config->password_hashing_auto_upgrade)
83
+		if (!$config->password_hashing_auto_upgrade)
84 84
 		{
85 85
 			$config->password_hashing_auto_upgrade = 'Y';
86 86
 		}
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		$oMemberController = getController('member');
92 92
 		$oMemberAdminController = getAdminController('member');
93 93
 
94
-		if(!$config->signupForm || !is_array($config->signupForm))
94
+		if (!$config->signupForm || !is_array($config->signupForm))
95 95
 		{
96 96
 			$identifier = $isNotInstall ? 'email_address' : 'user_id';
97 97
 
@@ -106,10 +106,10 @@  discard block
 block discarded – undo
106 106
 			$oMemberAdminController->_createFindAccountByQuestion($config->identifier);
107 107
 		}
108 108
 		
109
-		$oModuleController->insertModuleConfig('member',$config);
109
+		$oModuleController->insertModuleConfig('member', $config);
110 110
 
111 111
 		$groups = $oMemberModel->getGroups();
112
-		if(!count($groups))
112
+		if (!count($groups))
113 113
 		{
114 114
 			// Set an administrator, regular member(group1), and associate member(group2)
115 115
 			$group_args = new stdClass;
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
 		$admin_args = new stdClass;
136 136
 		$admin_args->is_admin = 'Y';
137 137
 		$output = executeQuery('member.getMemberList', $admin_args);
138
-		if(!$output->data)
138
+		if (!$output->data)
139 139
 		{
140
-			$admin_info = Context::gets('password','nick_name','email_address', 'user_id');
141
-			if($admin_info->email_address)
140
+			$admin_info = Context::gets('password', 'nick_name', 'email_address', 'user_id');
141
+			if ($admin_info->email_address)
142 142
 			{
143 143
 				$admin_info->user_name = 'admin';
144 144
 				// Insert admin information
@@ -150,16 +150,16 @@  discard block
 block discarded – undo
150 150
 		// Register denied ID(default + module name)
151 151
 		$oModuleModel = getModel('module');
152 152
 		$module_list = $oModuleModel->getModuleList();
153
-		foreach($module_list as $key => $val)
153
+		foreach ($module_list as $key => $val)
154 154
 		{
155
-			$oMemberAdminController->insertDeniedID($val->module,'');
155
+			$oMemberAdminController->insertDeniedID($val->module, '');
156 156
 		}
157
-		$oMemberAdminController->insertDeniedID('www','');
158
-		$oMemberAdminController->insertDeniedID('root','');
159
-		$oMemberAdminController->insertDeniedID('administrator','');
160
-		$oMemberAdminController->insertDeniedID('telnet','');
161
-		$oMemberAdminController->insertDeniedID('ftp','');
162
-		$oMemberAdminController->insertDeniedID('http','');
157
+		$oMemberAdminController->insertDeniedID('www', '');
158
+		$oMemberAdminController->insertDeniedID('root', '');
159
+		$oMemberAdminController->insertDeniedID('administrator', '');
160
+		$oMemberAdminController->insertDeniedID('telnet', '');
161
+		$oMemberAdminController->insertDeniedID('ftp', '');
162
+		$oMemberAdminController->insertDeniedID('http', '');
163 163
 		// Create cache directory to use in the member module
164 164
 		FileHandler::makeDir('./files/member_extra_info/image_name');
165 165
 		FileHandler::makeDir('./files/member_extra_info/image_mark');
@@ -184,68 +184,68 @@  discard block
 block discarded – undo
184 184
 		$oModuleModel = getModel('module');
185 185
 		$oModuleController = getController('module');
186 186
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
187
-		if($oModuleModel->needUpdate($version_update_id))
187
+		if ($oModuleModel->needUpdate($version_update_id))
188 188
 		{
189 189
 			// check member directory (11/08/2007 added)
190
-			if(!is_dir("./files/member_extra_info")) return true;
190
+			if (!is_dir("./files/member_extra_info")) return true;
191 191
 			// check member directory (22/10/2007 added)
192
-			if(!is_dir("./files/member_extra_info/profile_image")) return true;
192
+			if (!is_dir("./files/member_extra_info/profile_image")) return true;
193 193
 			// Add a column(is_register) to "member_auth_mail" table (22/04/2008)
194 194
 			$act = $oDB->isColumnExists("member_auth_mail", "is_register");
195
-			if(!$act) return true;
195
+			if (!$act) return true;
196 196
 			// Add a column(site_srl) to "member_group_member" table (11/15/2008)
197
-			if(!$oDB->isColumnExists("member_group_member", "site_srl")) return true;
198
-			if(!$oDB->isColumnExists("member_group", "site_srl")) return true;
199
-			if($oDB->isIndexExists("member_group","uni_member_group_title")) return true;
197
+			if (!$oDB->isColumnExists("member_group_member", "site_srl")) return true;
198
+			if (!$oDB->isColumnExists("member_group", "site_srl")) return true;
199
+			if ($oDB->isIndexExists("member_group", "uni_member_group_title")) return true;
200 200
 
201 201
 			// Add a column for list_order (05/18/2011)
202
-			if(!$oDB->isColumnExists("member_group", "list_order")) return true;
202
+			if (!$oDB->isColumnExists("member_group", "list_order")) return true;
203 203
 
204 204
 			// image_mark 추가 (2009. 02. 14)
205
-			if(!$oDB->isColumnExists("member_group", "image_mark")) return true;
205
+			if (!$oDB->isColumnExists("member_group", "image_mark")) return true;
206 206
 			// Add c column for password expiration date
207
-			if(!$oDB->isColumnExists("member", "change_password_date")) return true;
207
+			if (!$oDB->isColumnExists("member", "change_password_date")) return true;
208 208
 
209 209
 			// Add columns of question and answer to verify a password
210
-			if(!$oDB->isColumnExists("member", "find_account_question")) return true;
211
-			if(!$oDB->isColumnExists("member", "find_account_answer")) return true;
210
+			if (!$oDB->isColumnExists("member", "find_account_question")) return true;
211
+			if (!$oDB->isColumnExists("member", "find_account_answer")) return true;
212 212
 
213
-			if(!$oDB->isColumnExists("member", "list_order")) return true;
214
-			if(!$oDB->isIndexExists("member","idx_list_order")) return true;
213
+			if (!$oDB->isColumnExists("member", "list_order")) return true;
214
+			if (!$oDB->isIndexExists("member", "idx_list_order")) return true;
215 215
 
216 216
 			$oModuleModel = getModel('module');
217 217
 			$config = $oModuleModel->getModuleConfig('member');
218 218
 			// check signup form ordering info
219
-			if(!$config->signupForm) return true;
219
+			if (!$config->signupForm) return true;
220 220
 
221 221
 			// check agreement field exist
222
-			if($config->agreement) return true;
222
+			if ($config->agreement) return true;
223 223
 
224
-			if($config->skin)
224
+			if ($config->skin)
225 225
 			{
226 226
 				$config_parse = explode('.', $config->skin);
227
-				if(count($config_parse) > 1)
227
+				if (count($config_parse) > 1)
228 228
 				{
229 229
 					$template_path = sprintf('./themes/%s/modules/member/', $config_parse[0]);
230
-					if(is_dir($template_path)) return true;
230
+					if (is_dir($template_path)) return true;
231 231
 				}
232 232
 			}
233 233
 
234 234
 			// supprot multilanguage agreement.
235
-			if(is_readable('./files/member_extra_info/agreement.txt')) return true;
235
+			if (is_readable('./files/member_extra_info/agreement.txt')) return true;
236 236
 
237 237
 			// 2013. 11. 22 add menu when popup document menu called
238
-			if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) return true;
239
-			if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) return true;
238
+			if (!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) return true;
239
+			if (!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) return true;
240 240
 
241 241
 			$oModuleController->insertUpdatedLog($version_update_id);
242 242
 		}
243 243
 
244
-		if(!is_readable('./files/ruleset/insertMember.xml')) return true;
245
-		if(!is_readable('./files/ruleset/login.xml')) return true;
246
-		if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) return true;
244
+		if (!is_readable('./files/ruleset/insertMember.xml')) return true;
245
+		if (!is_readable('./files/ruleset/login.xml')) return true;
246
+		if (!is_readable('./files/ruleset/find_member_account_by_question.xml')) return true;
247 247
 
248
-		if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) return true;
248
+		if ($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) return true;
249 249
 
250 250
 		return false;
251 251
 	}
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 		$oMemberAdminController = getAdminController('member');
264 264
 		$config = $oModuleModel->getModuleConfig('member');
265 265
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
266
-		if($oModuleModel->needUpdate($version_update_id))
266
+		if ($oModuleModel->needUpdate($version_update_id))
267 267
 		{
268 268
 			// Check member directory
269 269
 			FileHandler::makeDir('./files/member_extra_info/image_name');
@@ -271,74 +271,74 @@  discard block
 block discarded – undo
271 271
 			FileHandler::makeDir('./files/member_extra_info/signature');
272 272
 			FileHandler::makeDir('./files/member_extra_info/profile_image');
273 273
 			// Add a column
274
-			if(!$oDB->isColumnExists("member_auth_mail", "is_register"))
274
+			if (!$oDB->isColumnExists("member_auth_mail", "is_register"))
275 275
 			{
276 276
 				$oDB->addColumn("member_auth_mail", "is_register", "char", 1, "N", true);
277 277
 			}
278 278
 			// Add a column(site_srl) to "member_group_member" table (11/15/2008)
279
-			if(!$oDB->isColumnExists("member_group_member", "site_srl"))
279
+			if (!$oDB->isColumnExists("member_group_member", "site_srl"))
280 280
 			{
281 281
 				$oDB->addColumn("member_group_member", "site_srl", "number", 11, 0, true);
282 282
 				$oDB->addIndex("member_group_member", "idx_site_srl", "site_srl", false);
283 283
 			}
284
-			if(!$oDB->isColumnExists("member_group", "site_srl"))
284
+			if (!$oDB->isColumnExists("member_group", "site_srl"))
285 285
 			{
286 286
 				$oDB->addColumn("member_group", "site_srl", "number", 11, 0, true);
287
-				$oDB->addIndex("member_group","idx_site_title", array("site_srl","title"),true);
287
+				$oDB->addIndex("member_group", "idx_site_title", array("site_srl", "title"), true);
288 288
 			}
289
-			if($oDB->isIndexExists("member_group","uni_member_group_title"))
289
+			if ($oDB->isIndexExists("member_group", "uni_member_group_title"))
290 290
 			{
291
-				$oDB->dropIndex("member_group","uni_member_group_title",true);
291
+				$oDB->dropIndex("member_group", "uni_member_group_title", true);
292 292
 			}
293 293
 
294 294
 			// Add a column(list_order) to "member_group" table (05/18/2011)
295
-			if(!$oDB->isColumnExists("member_group", "list_order"))
295
+			if (!$oDB->isColumnExists("member_group", "list_order"))
296 296
 			{
297 297
 				$oDB->addColumn("member_group", "list_order", "number", 11, '', true);
298
-				$oDB->addIndex("member_group","idx_list_order", "list_order",false);
298
+				$oDB->addIndex("member_group", "idx_list_order", "list_order", false);
299 299
 				$output = executeQuery('member.updateAllMemberGroupListOrder');
300 300
 			}
301 301
 			// Add a column for image_mark (02/14/2009)
302
-			if(!$oDB->isColumnExists("member_group", "image_mark"))
302
+			if (!$oDB->isColumnExists("member_group", "image_mark"))
303 303
 			{
304 304
 				$oDB->addColumn("member_group", "image_mark", "text");
305 305
 			}
306 306
 			// Add a column for password expiration date
307
-			if(!$oDB->isColumnExists("member", "change_password_date"))
307
+			if (!$oDB->isColumnExists("member", "change_password_date"))
308 308
 			{
309 309
 				$oDB->addColumn("member", "change_password_date", "date");
310 310
 				executeQuery('member.updateAllChangePasswordDate');
311 311
 			}
312 312
 
313 313
 			// Add columns of question and answer to verify a password
314
-			if(!$oDB->isColumnExists("member", "find_account_question"))
314
+			if (!$oDB->isColumnExists("member", "find_account_question"))
315 315
 			{
316 316
 				$oDB->addColumn("member", "find_account_question", "number", 11);
317 317
 			}
318
-			if(!$oDB->isColumnExists("member", "find_account_answer"))
318
+			if (!$oDB->isColumnExists("member", "find_account_answer"))
319 319
 			{
320 320
 				$oDB->addColumn("member", "find_account_answer", "varchar", 250);
321 321
 			}
322 322
 
323
-			if(!$oDB->isColumnExists("member", "list_order"))
323
+			if (!$oDB->isColumnExists("member", "list_order"))
324 324
 			{
325 325
 				$oDB->addColumn("member", "list_order", "number", 11);
326 326
 				@set_time_limit(0);
327 327
 				$args->list_order = 'member_srl';
328
-				executeQuery('member.updateMemberListOrderAll',$args);
328
+				executeQuery('member.updateMemberListOrderAll', $args);
329 329
 				executeQuery('member.updateMemberListOrderAll');
330 330
 			}
331
-			if(!$oDB->isIndexExists("member","idx_list_order"))
331
+			if (!$oDB->isIndexExists("member", "idx_list_order"))
332 332
 			{
333
-				$oDB->addIndex("member","idx_list_order", array("list_order"));
333
+				$oDB->addIndex("member", "idx_list_order", array("list_order"));
334 334
 			}
335 335
 
336 336
 			$config = $oModuleModel->getModuleConfig('member');
337 337
 
338 338
 			// check agreement value exist
339
-			if($config->agreement)
339
+			if ($config->agreement)
340 340
 			{
341
-				$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
341
+				$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt';
342 342
 				$output = FileHandler::writeFile($agreement_file, $config->agreement);
343 343
 
344 344
 				$config->agreement = NULL;
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 			}
347 347
 
348 348
 			// check signup form ordering info
349
-			if(!$config->signupForm || !is_array($config->signupForm))
349
+			if (!$config->signupForm || !is_array($config->signupForm))
350 350
 			{
351 351
 				$identifier = 'user_id';
352 352
 
@@ -356,13 +356,13 @@  discard block
 block discarded – undo
356 356
 				$output = $oModuleController->updateModuleConfig('member', $config);
357 357
 			}
358 358
 
359
-			if($config->skin)
359
+			if ($config->skin)
360 360
 			{
361 361
 				$config_parse = explode('.', $config->skin);
362 362
 				if (count($config_parse) > 1)
363 363
 				{
364 364
 					$template_path = sprintf('./themes/%s/modules/member/', $config_parse[0]);
365
-					if(is_dir($template_path))
365
+					if (is_dir($template_path))
366 366
 					{
367 367
 						$config->skin = implode('|@|', $config_parse);
368 368
 						$oModuleController = getController('module');
@@ -372,15 +372,15 @@  discard block
 block discarded – undo
372 372
 			}
373 373
 			
374 374
 			// 2013. 11. 22 add menu when popup document menu called
375
-			if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after'))
375
+			if (!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after'))
376 376
 				$oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after');
377
-			if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after'))
377
+			if (!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after'))
378 378
 				$oModuleController->insertTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after');
379 379
 
380
-			if(is_readable('./files/member_extra_info/agreement.txt'))
380
+			if (is_readable('./files/member_extra_info/agreement.txt'))
381 381
 			{
382 382
 				$source_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
383
-				$target_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
383
+				$target_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt';
384 384
 
385 385
 				FileHandler::rename($source_file, $target_file);
386 386
 			}
@@ -389,14 +389,14 @@  discard block
 block discarded – undo
389 389
 		}
390 390
 
391 391
 		FileHandler::makeDir('./files/ruleset');
392
-		if(!is_readable('./files/ruleset/insertMember.xml'))
392
+		if (!is_readable('./files/ruleset/insertMember.xml'))
393 393
 			$oMemberAdminController->_createSignupRuleset($config->signupForm);
394
-		if(!is_readable('./files/ruleset/login.xml'))
394
+		if (!is_readable('./files/ruleset/login.xml'))
395 395
 			$oMemberAdminController->_createLoginRuleset($config->identifier);
396
-		if(!is_readable('./files/ruleset/find_member_account_by_question.xml'))
396
+		if (!is_readable('./files/ruleset/find_member_account_by_question.xml'))
397 397
 			$oMemberAdminController->_createFindAccountByQuestion($config->identifier);
398 398
 
399
-		if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset'))
399
+		if ($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset'))
400 400
 		{
401 401
 			$oMemberAdminController->_createSignupRuleset($config->signupForm);
402 402
 			$oModuleController->insertUpdatedLog('member.1.8.43.recreate_signup_ruleset');
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 	 */
420 420
 	function recordLoginError($error = 0, $message = 'success')
421 421
 	{
422
-		if($error == 0) return new Object($error, $message);
422
+		if ($error == 0) return new Object($error, $message);
423 423
 
424 424
 		// Create a member model object
425 425
 		$oMemberModel = getModel('member');
@@ -427,18 +427,18 @@  discard block
 block discarded – undo
427 427
 
428 428
 		// Check if there is recoding table.
429 429
 		$oDB = &DB::getInstance();
430
-		if(!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') return new Object($error, $message);
430
+		if (!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') return new Object($error, $message);
431 431
 
432 432
 		$args = new stdClass();
433 433
 		$args->ipaddress = $_SERVER['REMOTE_ADDR'];
434 434
 
435 435
 		$output = executeQuery('member.getLoginCountByIp', $args);
436
-		if($output->data && $output->data->count)
436
+		if ($output->data && $output->data->count)
437 437
 		{
438 438
 			$last_update = strtotime($output->data->last_update);
439
-			$term = intval($_SERVER['REQUEST_TIME']-$last_update);
439
+			$term = intval($_SERVER['REQUEST_TIME'] - $last_update);
440 440
 			//update, if IP address access in a short time, update count. If not, make count 1.
441
-			if($term < $config->max_error_count_time)
441
+			if ($term < $config->max_error_count_time)
442 442
 			{
443 443
 				$args->count = $output->data->count + 1;
444 444
 			}
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
 	 */
465 465
 	function recordMemberLoginError($error = 0, $message = 'success', $args = NULL)
466 466
 	{
467
-		if($error == 0 || !$args->member_srl) return new Object($error, $message);
467
+		if ($error == 0 || !$args->member_srl) return new Object($error, $message);
468 468
 
469 469
 		// Create a member model object
470 470
 		$oMemberModel = getModel('member');
@@ -472,21 +472,21 @@  discard block
 block discarded – undo
472 472
 
473 473
 		// Check if there is recoding table.
474 474
 		$oDB = &DB::getInstance();
475
-		if(!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') return new Object($error, $message);
475
+		if (!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') return new Object($error, $message);
476 476
 
477 477
 		$output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args);
478
-		if($output->data && $output->data->content)
478
+		if ($output->data && $output->data->content)
479 479
 		{
480 480
 			//update
481 481
 			$content = unserialize($output->data->content);
482
-			$content[] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']);
482
+			$content[] = array($_SERVER['REMOTE_ADDR'], Context::getLang($message), $_SERVER['REQUEST_TIME']);
483 483
 			$args->content = serialize($content);
484 484
 			$output = executeQuery('member.updateLoginCountHistoryByMemberSrl', $args);
485 485
 		}
486 486
 		else
487 487
 		{
488 488
 			//insert
489
-			$content[0] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']);
489
+			$content[0] = array($_SERVER['REMOTE_ADDR'], Context::getLang($message), $_SERVER['REQUEST_TIME']);
490 490
 			$args->content = serialize($content);
491 491
 			$output = executeQuery('member.insertLoginCountHistoryByMemberSrl', $args);
492 492
 		}
Please login to merge, or discard this patch.
Braces   +138 added lines, -56 removed lines patch added patch discarded remove patch
@@ -20,7 +20,9 @@  discard block
 block discarded – undo
20 20
 	 */
21 21
 	function member()
22 22
 	{
23
-		if(!Context::isInstalled()) return;
23
+		if(!Context::isInstalled()) {
24
+			return;
25
+		}
24 26
 
25 27
 		$oModuleModel = getModel('module');
26 28
 		$member_config = $oModuleModel->getModuleConfig('member');
@@ -58,18 +60,42 @@  discard block
 block discarded – undo
58 60
 		// Set the basic information
59 61
 		$config->enable_join = 'Y';
60 62
 		$config->enable_openid = 'N';
61
-		if(!$config->enable_auth_mail) $config->enable_auth_mail = 'N';
62
-		if(!$config->image_name) $config->image_name = 'Y';
63
-		if(!$config->image_mark) $config->image_mark = 'Y';
64
-		if(!$config->profile_image) $config->profile_image = 'Y';
65
-		if(!$config->image_name_max_width) $config->image_name_max_width = '90';
66
-		if(!$config->image_name_max_height) $config->image_name_max_height = '20';
67
-		if(!$config->image_mark_max_width) $config->image_mark_max_width = '20';
68
-		if(!$config->image_mark_max_height) $config->image_mark_max_height = '20';
69
-		if(!$config->profile_image_max_width) $config->profile_image_max_width = '90';
70
-		if(!$config->profile_image_max_height) $config->profile_image_max_height = '90';
71
-		if($config->group_image_mark!='Y') $config->group_image_mark = 'N';
72
-		if(!$config->password_strength) $config->password_strength = 'normal';
63
+		if(!$config->enable_auth_mail) {
64
+			$config->enable_auth_mail = 'N';
65
+		}
66
+		if(!$config->image_name) {
67
+			$config->image_name = 'Y';
68
+		}
69
+		if(!$config->image_mark) {
70
+			$config->image_mark = 'Y';
71
+		}
72
+		if(!$config->profile_image) {
73
+			$config->profile_image = 'Y';
74
+		}
75
+		if(!$config->image_name_max_width) {
76
+			$config->image_name_max_width = '90';
77
+		}
78
+		if(!$config->image_name_max_height) {
79
+			$config->image_name_max_height = '20';
80
+		}
81
+		if(!$config->image_mark_max_width) {
82
+			$config->image_mark_max_width = '20';
83
+		}
84
+		if(!$config->image_mark_max_height) {
85
+			$config->image_mark_max_height = '20';
86
+		}
87
+		if(!$config->profile_image_max_width) {
88
+			$config->profile_image_max_width = '90';
89
+		}
90
+		if(!$config->profile_image_max_height) {
91
+			$config->profile_image_max_height = '90';
92
+		}
93
+		if($config->group_image_mark!='Y') {
94
+			$config->group_image_mark = 'N';
95
+		}
96
+		if(!$config->password_strength) {
97
+			$config->password_strength = 'normal';
98
+		}
73 99
 		
74 100
 		if(!$config->password_hashing_algorithm)
75 101
 		{
@@ -187,39 +213,69 @@  discard block
 block discarded – undo
187 213
 		if($oModuleModel->needUpdate($version_update_id))
188 214
 		{
189 215
 			// check member directory (11/08/2007 added)
190
-			if(!is_dir("./files/member_extra_info")) return true;
216
+			if(!is_dir("./files/member_extra_info")) {
217
+				return true;
218
+			}
191 219
 			// check member directory (22/10/2007 added)
192
-			if(!is_dir("./files/member_extra_info/profile_image")) return true;
220
+			if(!is_dir("./files/member_extra_info/profile_image")) {
221
+				return true;
222
+			}
193 223
 			// Add a column(is_register) to "member_auth_mail" table (22/04/2008)
194 224
 			$act = $oDB->isColumnExists("member_auth_mail", "is_register");
195
-			if(!$act) return true;
225
+			if(!$act) {
226
+				return true;
227
+			}
196 228
 			// Add a column(site_srl) to "member_group_member" table (11/15/2008)
197
-			if(!$oDB->isColumnExists("member_group_member", "site_srl")) return true;
198
-			if(!$oDB->isColumnExists("member_group", "site_srl")) return true;
199
-			if($oDB->isIndexExists("member_group","uni_member_group_title")) return true;
229
+			if(!$oDB->isColumnExists("member_group_member", "site_srl")) {
230
+				return true;
231
+			}
232
+			if(!$oDB->isColumnExists("member_group", "site_srl")) {
233
+				return true;
234
+			}
235
+			if($oDB->isIndexExists("member_group","uni_member_group_title")) {
236
+				return true;
237
+			}
200 238
 
201 239
 			// Add a column for list_order (05/18/2011)
202
-			if(!$oDB->isColumnExists("member_group", "list_order")) return true;
240
+			if(!$oDB->isColumnExists("member_group", "list_order")) {
241
+				return true;
242
+			}
203 243
 
204 244
 			// image_mark 추가 (2009. 02. 14)
205
-			if(!$oDB->isColumnExists("member_group", "image_mark")) return true;
245
+			if(!$oDB->isColumnExists("member_group", "image_mark")) {
246
+				return true;
247
+			}
206 248
 			// Add c column for password expiration date
207
-			if(!$oDB->isColumnExists("member", "change_password_date")) return true;
249
+			if(!$oDB->isColumnExists("member", "change_password_date")) {
250
+				return true;
251
+			}
208 252
 
209 253
 			// Add columns of question and answer to verify a password
210
-			if(!$oDB->isColumnExists("member", "find_account_question")) return true;
211
-			if(!$oDB->isColumnExists("member", "find_account_answer")) return true;
254
+			if(!$oDB->isColumnExists("member", "find_account_question")) {
255
+				return true;
256
+			}
257
+			if(!$oDB->isColumnExists("member", "find_account_answer")) {
258
+				return true;
259
+			}
212 260
 
213
-			if(!$oDB->isColumnExists("member", "list_order")) return true;
214
-			if(!$oDB->isIndexExists("member","idx_list_order")) return true;
261
+			if(!$oDB->isColumnExists("member", "list_order")) {
262
+				return true;
263
+			}
264
+			if(!$oDB->isIndexExists("member","idx_list_order")) {
265
+				return true;
266
+			}
215 267
 
216 268
 			$oModuleModel = getModel('module');
217 269
 			$config = $oModuleModel->getModuleConfig('member');
218 270
 			// check signup form ordering info
219
-			if(!$config->signupForm) return true;
271
+			if(!$config->signupForm) {
272
+				return true;
273
+			}
220 274
 
221 275
 			// check agreement field exist
222
-			if($config->agreement) return true;
276
+			if($config->agreement) {
277
+				return true;
278
+			}
223 279
 
224 280
 			if($config->skin)
225 281
 			{
@@ -227,25 +283,41 @@  discard block
 block discarded – undo
227 283
 				if(count($config_parse) > 1)
228 284
 				{
229 285
 					$template_path = sprintf('./themes/%s/modules/member/', $config_parse[0]);
230
-					if(is_dir($template_path)) return true;
286
+					if(is_dir($template_path)) {
287
+						return true;
288
+					}
231 289
 				}
232 290
 			}
233 291
 
234 292
 			// supprot multilanguage agreement.
235
-			if(is_readable('./files/member_extra_info/agreement.txt')) return true;
293
+			if(is_readable('./files/member_extra_info/agreement.txt')) {
294
+				return true;
295
+			}
236 296
 
237 297
 			// 2013. 11. 22 add menu when popup document menu called
238
-			if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) return true;
239
-			if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) return true;
298
+			if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) {
299
+				return true;
300
+			}
301
+			if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) {
302
+				return true;
303
+			}
240 304
 
241 305
 			$oModuleController->insertUpdatedLog($version_update_id);
242 306
 		}
243 307
 
244
-		if(!is_readable('./files/ruleset/insertMember.xml')) return true;
245
-		if(!is_readable('./files/ruleset/login.xml')) return true;
246
-		if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) return true;
308
+		if(!is_readable('./files/ruleset/insertMember.xml')) {
309
+			return true;
310
+		}
311
+		if(!is_readable('./files/ruleset/login.xml')) {
312
+			return true;
313
+		}
314
+		if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) {
315
+			return true;
316
+		}
247 317
 
248
-		if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) return true;
318
+		if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) {
319
+			return true;
320
+		}
249 321
 
250 322
 		return false;
251 323
 	}
@@ -372,10 +444,12 @@  discard block
 block discarded – undo
372 444
 			}
373 445
 			
374 446
 			// 2013. 11. 22 add menu when popup document menu called
375
-			if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after'))
376
-				$oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after');
377
-			if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after'))
378
-				$oModuleController->insertTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after');
447
+			if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) {
448
+							$oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after');
449
+			}
450
+			if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) {
451
+							$oModuleController->insertTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after');
452
+			}
379 453
 
380 454
 			if(is_readable('./files/member_extra_info/agreement.txt'))
381 455
 			{
@@ -389,12 +463,15 @@  discard block
 block discarded – undo
389 463
 		}
390 464
 
391 465
 		FileHandler::makeDir('./files/ruleset');
392
-		if(!is_readable('./files/ruleset/insertMember.xml'))
393
-			$oMemberAdminController->_createSignupRuleset($config->signupForm);
394
-		if(!is_readable('./files/ruleset/login.xml'))
395
-			$oMemberAdminController->_createLoginRuleset($config->identifier);
396
-		if(!is_readable('./files/ruleset/find_member_account_by_question.xml'))
397
-			$oMemberAdminController->_createFindAccountByQuestion($config->identifier);
466
+		if(!is_readable('./files/ruleset/insertMember.xml')) {
467
+					$oMemberAdminController->_createSignupRuleset($config->signupForm);
468
+		}
469
+		if(!is_readable('./files/ruleset/login.xml')) {
470
+					$oMemberAdminController->_createLoginRuleset($config->identifier);
471
+		}
472
+		if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) {
473
+					$oMemberAdminController->_createFindAccountByQuestion($config->identifier);
474
+		}
398 475
 
399 476
 		if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset'))
400 477
 		{
@@ -419,7 +496,9 @@  discard block
 block discarded – undo
419 496
 	 */
420 497
 	function recordLoginError($error = 0, $message = 'success')
421 498
 	{
422
-		if($error == 0) return new Object($error, $message);
499
+		if($error == 0) {
500
+			return new Object($error, $message);
501
+		}
423 502
 
424 503
 		// Create a member model object
425 504
 		$oMemberModel = getModel('member');
@@ -427,7 +506,9 @@  discard block
 block discarded – undo
427 506
 
428 507
 		// Check if there is recoding table.
429 508
 		$oDB = &DB::getInstance();
430
-		if(!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') return new Object($error, $message);
509
+		if(!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') {
510
+			return new Object($error, $message);
511
+		}
431 512
 
432 513
 		$args = new stdClass();
433 514
 		$args->ipaddress = $_SERVER['REMOTE_ADDR'];
@@ -441,16 +522,14 @@  discard block
 block discarded – undo
441 522
 			if($term < $config->max_error_count_time)
442 523
 			{
443 524
 				$args->count = $output->data->count + 1;
444
-			}
445
-			else
525
+			} else
446 526
 			{
447 527
 				$args->count = 1;
448 528
 			}
449 529
 			unset($oMemberModel);
450 530
 			unset($config);
451 531
 			$output = executeQuery('member.updateLoginCountByIp', $args);
452
-		}
453
-		else
532
+		} else
454 533
 		{
455 534
 			//insert
456 535
 			$args->count = 1;
@@ -464,7 +543,9 @@  discard block
 block discarded – undo
464 543
 	 */
465 544
 	function recordMemberLoginError($error = 0, $message = 'success', $args = NULL)
466 545
 	{
467
-		if($error == 0 || !$args->member_srl) return new Object($error, $message);
546
+		if($error == 0 || !$args->member_srl) {
547
+			return new Object($error, $message);
548
+		}
468 549
 
469 550
 		// Create a member model object
470 551
 		$oMemberModel = getModel('member');
@@ -472,7 +553,9 @@  discard block
 block discarded – undo
472 553
 
473 554
 		// Check if there is recoding table.
474 555
 		$oDB = &DB::getInstance();
475
-		if(!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') return new Object($error, $message);
556
+		if(!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') {
557
+			return new Object($error, $message);
558
+		}
476 559
 
477 560
 		$output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args);
478 561
 		if($output->data && $output->data->content)
@@ -482,8 +565,7 @@  discard block
 block discarded – undo
482 565
 			$content[] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']);
483 566
 			$args->content = serialize($content);
484 567
 			$output = executeQuery('member.updateLoginCountHistoryByMemberSrl', $args);
485
-		}
486
-		else
568
+		} else
487 569
 		{
488 570
 			//insert
489 571
 			$content[0] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']);
Please login to merge, or discard this patch.
modules/member/member.admin.view.php 2 patches
Spacing   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -43,16 +43,16 @@  discard block
 block discarded – undo
43 43
 
44 44
 		// if member_srl exists, set memberInfo
45 45
 		$member_srl = Context::get('member_srl');
46
-		if($member_srl) 
46
+		if ($member_srl) 
47 47
 		{
48 48
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
49
-			if(!$this->memberInfo)
49
+			if (!$this->memberInfo)
50 50
 			{
51
-				Context::set('member_srl','');
51
+				Context::set('member_srl', '');
52 52
 			}
53 53
 			else
54 54
 			{
55
-				Context::set('member_info',$this->memberInfo);
55
+				Context::set('member_info', $this->memberInfo);
56 56
 			}
57 57
 		}
58 58
 
@@ -79,30 +79,30 @@  discard block
 block discarded – undo
79 79
 
80 80
 		$filter = Context::get('filter_type');
81 81
 		global $lang;
82
-		switch($filter)
82
+		switch ($filter)
83 83
 		{
84
-			case 'super_admin' : Context::set('filter_type_title', $lang->cmd_show_super_admin_member);break;
85
-			case 'site_admin' : Context::set('filter_type_title', $lang->cmd_show_site_admin_member);break;
86
-			default : Context::set('filter_type_title', $lang->cmd_show_all_member);break;
84
+			case 'super_admin' : Context::set('filter_type_title', $lang->cmd_show_super_admin_member); break;
85
+			case 'site_admin' : Context::set('filter_type_title', $lang->cmd_show_site_admin_member); break;
86
+			default : Context::set('filter_type_title', $lang->cmd_show_all_member); break;
87 87
 		}
88 88
 		// retrieve list of groups for each member
89
-		if($output->data)
89
+		if ($output->data)
90 90
 		{
91
-			foreach($output->data as $key => $member)
91
+			foreach ($output->data as $key => $member)
92 92
 			{
93
-				$output->data[$key]->group_list = $oMemberModel->getMemberGroups($member->member_srl,0);
93
+				$output->data[$key]->group_list = $oMemberModel->getMemberGroups($member->member_srl, 0);
94 94
 			}
95 95
 		}
96 96
 		$config = $this->memberConfig;
97 97
 		$memberIdentifiers = array('user_id'=>'user_id', 'user_name'=>'user_name', 'nick_name'=>'nick_name');
98 98
 		$usedIdentifiers = array();	
99 99
 
100
-		if(is_array($config->signupForm))
100
+		if (is_array($config->signupForm))
101 101
 		{
102
-			foreach($config->signupForm as $signupItem)
102
+			foreach ($config->signupForm as $signupItem)
103 103
 			{
104
-				if(!count($memberIdentifiers)) break;
105
-				if(in_array($signupItem->name, $memberIdentifiers) && ($signupItem->required || $signupItem->isUse))
104
+				if (!count($memberIdentifiers)) break;
105
+				if (in_array($signupItem->name, $memberIdentifiers) && ($signupItem->required || $signupItem->isUse))
106 106
 				{
107 107
 					unset($memberIdentifiers[$signupItem->name]);
108 108
 					$usedIdentifiers[$signupItem->name] = $lang->{$signupItem->name};
@@ -140,14 +140,14 @@  discard block
 block discarded – undo
140 140
 	{
141 141
 		$config = $this->memberConfig;
142 142
 
143
-		if($config->redirect_url)
143
+		if ($config->redirect_url)
144 144
 		{
145 145
 			$mid = str_ireplace(Context::getDefaultUrl(), '', $config->redirect_url);
146 146
 
147 147
 			$siteModuleInfo = Context::get('site_module_info');
148 148
 
149 149
 			$oModuleModel = getModel('module');
150
-			$moduleInfo = $oModuleModel->getModuleInfoByMid($mid, (int)$siteModuleInfo->site_srl);
150
+			$moduleInfo = $oModuleModel->getModuleInfoByMid($mid, (int) $siteModuleInfo->site_srl);
151 151
 
152 152
 			$config->redirect_url = $moduleInfo->module_srl;
153 153
 			Context::set('config', $config);
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
 		Context::set('editor', $editor);
174 174
 
175 175
 		$signupForm = $config->signupForm;
176
-		foreach($signupForm as $val)
176
+		foreach ($signupForm as $val)
177 177
 		{
178
-			if($val->name == 'user_id')
178
+			if ($val->name == 'user_id')
179 179
 			{
180 180
 				$userIdInfo = $val;
181 181
 				break;
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 		}
184 184
 
185 185
 		$oSecurity = new Security();
186
-		if($userIdInfo->isUse)
186
+		if ($userIdInfo->isUse)
187 187
 		{
188 188
 			// get denied ID list
189 189
 			Context::set('useUserID', 1);
@@ -274,16 +274,16 @@  discard block
 block discarded – undo
274 274
 		Context::set('editor', $editor);
275 275
 
276 276
 		$signupForm = $config->signupForm;
277
-		foreach($signupForm as $val)
277
+		foreach ($signupForm as $val)
278 278
 		{
279
-			if($val->name == 'user_id')
279
+			if ($val->name == 'user_id')
280 280
 			{
281 281
 				$userIdInfo = $val;
282 282
 				break;
283 283
 			}
284 284
 		}
285 285
 
286
-		if($userIdInfo->isUse)
286
+		if ($userIdInfo->isUse)
287 287
 		{
288 288
 			// get denied ID list
289 289
 			Context::set('useUserID', 1);
@@ -344,14 +344,14 @@  discard block
 block discarded – undo
344 344
 		$oMemberModel = getModel('member');
345 345
 
346 346
 		$memberInfo = Context::get('member_info');
347
-		if(isset($memberInfo))
347
+		if (isset($memberInfo))
348 348
 		{
349 349
 			$memberInfo->signature = $oMemberModel->getSignature($this->memberInfo->member_srl);
350 350
 		}
351 351
 		Context::set('member_info', $memberInfo);
352 352
 
353 353
 		// get an editor for the signature
354
-		if($memberInfo->member_srl)
354
+		if ($memberInfo->member_srl)
355 355
 		{
356 356
 			$oEditorModel = getModel('editor');
357 357
 			$option = new stdClass();
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 		}
406 406
 
407 407
 		$member_config = $this->memberConfig;
408
-		if(!$this->memberConfig)
408
+		if (!$this->memberConfig)
409 409
 		{
410 410
 			$member_config = $this->memberConfig = $oMemberModel->getMemberConfig();
411 411
 		}
@@ -416,25 +416,25 @@  discard block
 block discarded – undo
416 416
 		$formTags = array();
417 417
 		global $lang;
418 418
 
419
-		foreach($member_config->signupForm as $no=>$formInfo)
419
+		foreach ($member_config->signupForm as $no=>$formInfo)
420 420
 		{
421
-			if(!$formInfo->isUse)continue;
421
+			if (!$formInfo->isUse)continue;
422 422
 
423 423
 			// 회원 본인이 아닌 경우 입력 폼 제거
424
-			if($formInfo->name == 'find_account_question' && $memberInfo['member_srl'] !== $logged_info->member_srl)
424
+			if ($formInfo->name == 'find_account_question' && $memberInfo['member_srl'] !== $logged_info->member_srl)
425 425
 			{
426 426
 				unset($member_config->signupForm[$no]);
427 427
 				continue;
428 428
 			}
429 429
 
430
-			if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue;
430
+			if ($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue;
431 431
 
432 432
 			$formTag = new stdClass();
433 433
 			$inputTag = '';
434 434
 			$formTag->title = ($formInfo->isDefaultForm) ? $lang->{$formInfo->name} : $formInfo->title;
435
-			if($isAdmin)
435
+			if ($isAdmin)
436 436
 			{
437
-				if($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
437
+				if ($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
438 438
 			}
439 439
 			else
440 440
 			{
@@ -442,28 +442,28 @@  discard block
 block discarded – undo
442 442
 			}
443 443
 			$formTag->name = $formInfo->name;
444 444
 
445
-			if($formInfo->isDefaultForm)
445
+			if ($formInfo->isDefaultForm)
446 446
 			{
447
-				if($formInfo->imageType)
447
+				if ($formInfo->imageType)
448 448
 				{
449 449
 					$formTag->type = 'image';
450
-					if($formInfo->name == 'profile_image')
450
+					if ($formInfo->name == 'profile_image')
451 451
 					{
452 452
 						$target = $memberInfo['profile_image'];
453 453
 						$functionName = 'doDeleteProfileImage';
454 454
 					}
455
-					else if($formInfo->name == 'image_name')
455
+					else if ($formInfo->name == 'image_name')
456 456
 					{
457 457
 						$target = $memberInfo['image_name'];
458 458
 						$functionName = 'doDeleteImageName';
459 459
 					}
460
-					else if($formInfo->name == 'image_mark')
460
+					else if ($formInfo->name == 'image_mark')
461 461
 					{
462 462
 						$target = $memberInfo['image_mark'];
463 463
 						$functionName = 'doDeleteImageMark';
464 464
 					}
465 465
 
466
-					if($target->src)
466
+					if ($target->src)
467 467
 					{
468 468
 						$inputTag = sprintf('<input type="hidden" name="__%s_exist" value="true" /><span id="%s"><img src="%s" alt="%s" /> <button type="button" onclick="%s(%d);return false;">%s</button></span>',
469 469
 							$formInfo->name,
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
 						$lang->{$formInfo->name.'_max_height'},
487 487
 						$member_config->{$formInfo->name.'_max_height'});
488 488
 					}//end imageType
489
-					else if($formInfo->name == 'birthday')
489
+					else if ($formInfo->name == 'birthday')
490 490
 					{
491 491
 						$formTag->type = 'date';
492 492
 						$inputTag = sprintf('<input type="hidden" name="birthday" id="date_birthday" value="%s" /><input type="text" placeholder="YYYY-MM-DD" name="birthday_ui" class="inputDate" id="birthday" value="%s" readonly="readonly" /> <input type="button" value="%s" class="btn dateRemover" />',
@@ -494,16 +494,16 @@  discard block
 block discarded – undo
494 494
 							zdate($memberInfo['birthday'], 'Y-m-d', false),
495 495
 							$lang->cmd_delete);
496 496
 					}
497
-					else if($formInfo->name == 'find_account_question')
497
+					else if ($formInfo->name == 'find_account_question')
498 498
 					{
499 499
 						$disabled = (!!$memberInfo['member_srl']) ? 'disabled="disabled"' : '';
500 500
 
501 501
 						$formTag->type = 'select';
502 502
 						$inputTag = '<select name="find_account_question" id="find_account_question" style="display:block;margin:0 0 8px 0" %s>%s</select>';
503 503
 						$optionTag = array();
504
-						foreach($lang->find_account_question_items as $key=>$val)
504
+						foreach ($lang->find_account_question_items as $key=>$val)
505 505
 						{
506
-							if($key == $memberInfo['find_account_question']) $selected = 'selected="selected"';
506
+							if ($key == $memberInfo['find_account_question']) $selected = 'selected="selected"';
507 507
 							else $selected = '';
508 508
 							$optionTag[] = sprintf('<option value="%s" %s >%s</option>',
509 509
 								$key,
@@ -511,24 +511,24 @@  discard block
 block discarded – undo
511 511
 								$val);
512 512
 						}
513 513
 						$inputTag = sprintf($inputTag, $disabled, implode('', $optionTag));
514
-						$inputTag .= '<input type="text" name="find_account_answer" id="find_account_answer" title="'.Context::getLang('find_account_answer').'" value="" ' . $disabled . ' />';
514
+						$inputTag .= '<input type="text" name="find_account_answer" id="find_account_answer" title="'.Context::getLang('find_account_answer').'" value="" '.$disabled.' />';
515 515
 
516
-						if($disabled) {
517
-							$inputTag .= ' <label><input type="checkbox" name="modify_find_account_answer" value="Y" /> ' . Context::getLang('cmd_modify') . '</label>';
516
+						if ($disabled) {
517
+							$inputTag .= ' <label><input type="checkbox" name="modify_find_account_answer" value="Y" /> '.Context::getLang('cmd_modify').'</label>';
518 518
 							$inputTag .= '<script>(function($) {$(function() {$(\'[name=modify_find_account_answer]\').change(function() {var $this = $(this); if($this.prop(\'checked\')) {$(\'[name=find_account_question],[name=find_account_answer]\').attr(\'disabled\', false); } else {$(\'[name=find_account_question]\').attr(\'disabled\', true); $(\'[name=find_account_answer]\').attr(\'disabled\', true).val(\'\'); } }); }); })(jQuery);</script>';
519 519
 						}
520 520
 					}
521
-					else if($formInfo->name == 'email_address')
521
+					else if ($formInfo->name == 'email_address')
522 522
 					{
523 523
 						$formTag->type = 'email';
524 524
 						$inputTag = '<input type="email" name="email_address" id="email_address" value="'.$memberInfo['email_address'].'" />';
525 525
 					}
526
-					else if($formInfo->name == 'homepage')
526
+					else if ($formInfo->name == 'homepage')
527 527
 					{
528 528
 						$formTag->type = 'url';
529 529
 						$inputTag = '<input type="url" name="homepage" id="homepage" value="'.$memberInfo['homepage'].'" />';
530 530
 					}
531
-					else if($formInfo->name == 'blog')
531
+					else if ($formInfo->name == 'blog')
532 532
 					{
533 533
 						$formTag->type = 'url';
534 534
 						$inputTag = '<input type="url" name="blog" id="blog" value="'.$memberInfo['blog'].'" />';
@@ -549,92 +549,92 @@  discard block
 block discarded – undo
549 549
 					$extentionReplace = array();
550 550
 
551 551
 					$formTag->type = $extendForm->column_type;
552
-					if($extendForm->column_type == 'text')
552
+					if ($extendForm->column_type == 'text')
553 553
 					{
554 554
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
555 555
 					}
556
-					else if($extendForm->column_type == 'homepage')
556
+					else if ($extendForm->column_type == 'homepage')
557 557
 					{
558 558
 						$template = '<input type="url" name="%column_name%" id="%column_name%" value="%value%" />';
559 559
 					}
560
-					else if($extendForm->column_type == 'email_address')
560
+					else if ($extendForm->column_type == 'email_address')
561 561
 					{
562 562
 						$template = '<input type="email" name="%column_name%" id="%column_name%" value="%value%" />';
563 563
 					}
564
-					else if($extendForm->column_type == 'tel')
564
+					else if ($extendForm->column_type == 'tel')
565 565
 					{
566 566
 						$extentionReplace = array('tel_0' => $extendForm->value[0],
567 567
 							'tel_1' => $extendForm->value[1],
568 568
 							'tel_2' => $extendForm->value[2]);
569 569
 						$template = '<input type="tel" name="%column_name%[]" id="%column_name%" value="%tel_0%" size="4" maxlength="4" style="width:30px" title="First Number" /> - <input type="tel" name="%column_name%[]" value="%tel_1%" size="4" maxlength="4" style="width:35px" title="Second Number" /> - <input type="tel" name="%column_name%[]" value="%tel_2%" size="4" maxlength="4" style="width:35px" title="Third Number" />';
570 570
 					}
571
-					else if($extendForm->column_type == 'textarea')
571
+					else if ($extendForm->column_type == 'textarea')
572 572
 					{
573 573
 						$template = '<textarea name="%column_name%" id="%column_name%" rows="4" cols="42">%value%</textarea>';
574 574
 					}
575
-					else if($extendForm->column_type == 'checkbox')
575
+					else if ($extendForm->column_type == 'checkbox')
576 576
 					{
577 577
 						$template = '';
578
-						if($extendForm->default_value)
578
+						if ($extendForm->default_value)
579 579
 						{
580 580
 							$template = '<div style="padding-top:5px">%s</div>';
581 581
 							$__i = 0;
582 582
 							$optionTag = array();
583
-							foreach($extendForm->default_value as $v)
583
+							foreach ($extendForm->default_value as $v)
584 584
 							{
585 585
 								$checked = '';
586
-								if(is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"';
586
+								if (is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"';
587 587
 								$optionTag[] = '<label for="%column_name%'.$__i.'"><input type="checkbox" id="%column_name%'.$__i.'" name="%column_name%[]" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
588 588
 								$__i++;
589 589
 							}
590 590
 							$template = sprintf($template, implode('', $optionTag));
591 591
 						}
592 592
 					}
593
-					else if($extendForm->column_type == 'radio')
593
+					else if ($extendForm->column_type == 'radio')
594 594
 					{
595 595
 						$template = '';
596
-						if($extendForm->default_value)
596
+						if ($extendForm->default_value)
597 597
 						{
598 598
 							$template = '<div style="padding-top:5px">%s</div>';
599 599
 							$optionTag = array();
600
-							foreach($extendForm->default_value as $v)
600
+							foreach ($extendForm->default_value as $v)
601 601
 							{
602
-								if($extendForm->value == $v)$checked = 'checked="checked"';
602
+								if ($extendForm->value == $v)$checked = 'checked="checked"';
603 603
 								else $checked = '';
604 604
 								$optionTag[] = '<label><input type="radio" name="%column_name%" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
605 605
 							}
606 606
 							$template = sprintf($template, implode('', $optionTag));
607 607
 						}
608 608
 					}
609
-					else if($extendForm->column_type == 'select')
609
+					else if ($extendForm->column_type == 'select')
610 610
 					{
611 611
 						$template = '<select name="'.$formInfo->name.'" id="'.$formInfo->name.'">%s</select>';
612 612
 						$optionTag = array();
613 613
 						$optionTag[] = sprintf('<option value="">%s</option>', $lang->cmd_select);
614
-						if($extendForm->default_value)
614
+						if ($extendForm->default_value)
615 615
 						{
616
-							foreach($extendForm->default_value as $v)
616
+							foreach ($extendForm->default_value as $v)
617 617
 							{
618
-								if($v == $extendForm->value) $selected = 'selected="selected"';
618
+								if ($v == $extendForm->value) $selected = 'selected="selected"';
619 619
 								else $selected = '';
620 620
 								$optionTag[] = sprintf('<option value="%s" %s >%s</option>', $v, $selected, $v);
621 621
 							}
622 622
 						}
623 623
 						$template = sprintf($template, implode('', $optionTag));
624 624
 					}
625
-					else if($extendForm->column_type == 'kr_zip')
625
+					else if ($extendForm->column_type == 'kr_zip')
626 626
 					{
627 627
 						$krzipModel = getModel('krzip');
628
-						if($krzipModel && method_exists($krzipModel , 'getKrzipCodeSearchHtml' ))
628
+						if ($krzipModel && method_exists($krzipModel, 'getKrzipCodeSearchHtml'))
629 629
 						{
630 630
 							$template = $krzipModel->getKrzipCodeSearchHtml($extendForm->column_name, $extendForm->value);
631 631
 						}
632 632
 					}
633
-					else if($extendForm->column_type == 'jp_zip')
633
+					else if ($extendForm->column_type == 'jp_zip')
634 634
 					{
635 635
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
636 636
 					}
637
-					else if($extendForm->column_type == 'date')
637
+					else if ($extendForm->column_type == 'date')
638 638
 					{
639 639
 						$extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete);
640 640
 						$template = '<input type="hidden" name="%column_name%" id="date_%column_name%" value="%value%" /><input type="text" placeholder="YYYY-MM-DD" class="inputDate" value="%date%" readonly="readonly" /> <input type="button" value="%cmd_delete%" class="btn dateRemover" />';
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 					$replace = array_merge($extentionReplace, $replace);
644 644
 					$inputTag = preg_replace_callback('@%(\w+)%@', function($n) use($replace) { return $replace[$n[1]]; }, $template);
645 645
 
646
-					if($extendForm->description)
646
+					if ($extendForm->description)
647 647
 						$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
648 648
 				}
649 649
 				$formTag->inputTag = $inputTag;
@@ -674,12 +674,12 @@  discard block
 block discarded – undo
674 674
 	function dispMemberAdminInsertJoinForm() {
675 675
 		// Get the value of join_form
676 676
 		$member_join_form_srl = Context::get('member_join_form_srl');
677
-		if($member_join_form_srl)
677
+		if ($member_join_form_srl)
678 678
 		{
679 679
 			$oMemberModel = getModel('member');
680 680
 			$join_form = $oMemberModel->getJoinForm($member_join_form_srl);
681 681
 
682
-			if(!$join_form) Context::set('member_join_form_srl','',true);
682
+			if (!$join_form) Context::set('member_join_form_srl', '', true);
683 683
 			else
684 684
 			{
685 685
 				Context::set('join_form', $join_form);
Please login to merge, or discard this patch.
Braces   +62 added lines, -57 removed lines patch added patch discarded remove patch
@@ -49,8 +49,7 @@  discard block
 block discarded – undo
49 49
 			if(!$this->memberInfo)
50 50
 			{
51 51
 				Context::set('member_srl','');
52
-			}
53
-			else
52
+			} else
54 53
 			{
55 54
 				Context::set('member_info',$this->memberInfo);
56 55
 			}
@@ -101,7 +100,9 @@  discard block
 block discarded – undo
101 100
 		{
102 101
 			foreach($config->signupForm as $signupItem)
103 102
 			{
104
-				if(!count($memberIdentifiers)) break;
103
+				if(!count($memberIdentifiers)) {
104
+					break;
105
+				}
105 106
 				if(in_array($signupItem->name, $memberIdentifiers) && ($signupItem->required || $signupItem->isUse))
106 107
 				{
107 108
 					unset($memberIdentifiers[$signupItem->name]);
@@ -316,7 +317,9 @@  discard block
 block discarded – undo
316 317
 		$extendForm = $oMemberModel->getCombineJoinForm($this->memberInfo);
317 318
 		Context::set('extend_form_list', $extendForm);
318 319
 		$memberInfo = get_object_vars(Context::get('member_info'));
319
-		if (!is_array($memberInfo['group_list'])) $memberInfo['group_list'] = array();
320
+		if (!is_array($memberInfo['group_list'])) {
321
+			$memberInfo['group_list'] = array();
322
+		}
320 323
 		Context::set('memberInfo', $memberInfo);
321 324
 
322 325
 		$disableColumns = array('password', 'find_account_question', 'find_account_answer');
@@ -418,7 +421,9 @@  discard block
 block discarded – undo
418 421
 
419 422
 		foreach($member_config->signupForm as $no=>$formInfo)
420 423
 		{
421
-			if(!$formInfo->isUse)continue;
424
+			if(!$formInfo->isUse) {
425
+				continue;
426
+			}
422 427
 
423 428
 			// 회원 본인이 아닌 경우 입력 폼 제거
424 429
 			if($formInfo->name == 'find_account_question' && $memberInfo['member_srl'] !== $logged_info->member_srl)
@@ -427,18 +432,23 @@  discard block
 block discarded – undo
427 432
 				continue;
428 433
 			}
429 434
 
430
-			if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue;
435
+			if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') {
436
+				continue;
437
+			}
431 438
 
432 439
 			$formTag = new stdClass();
433 440
 			$inputTag = '';
434 441
 			$formTag->title = ($formInfo->isDefaultForm) ? $lang->{$formInfo->name} : $formInfo->title;
435 442
 			if($isAdmin)
436 443
 			{
437
-				if($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
438
-			}
439
-			else
444
+				if($formInfo->mustRequired) {
445
+					$formTag->title = '<em style="color:red">*</em> '.$formTag->title;
446
+				}
447
+			} else
440 448
 			{
441
-				if ($formInfo->required && $formInfo->name != 'password') $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
449
+				if ($formInfo->required && $formInfo->name != 'password') {
450
+					$formTag->title = '<em style="color:red">*</em> '.$formTag->title;
451
+				}
442 452
 			}
443 453
 			$formTag->name = $formInfo->name;
444 454
 
@@ -451,13 +461,11 @@  discard block
 block discarded – undo
451 461
 					{
452 462
 						$target = $memberInfo['profile_image'];
453 463
 						$functionName = 'doDeleteProfileImage';
454
-					}
455
-					else if($formInfo->name == 'image_name')
464
+					} else if($formInfo->name == 'image_name')
456 465
 					{
457 466
 						$target = $memberInfo['image_name'];
458 467
 						$functionName = 'doDeleteImageName';
459
-					}
460
-					else if($formInfo->name == 'image_mark')
468
+					} else if($formInfo->name == 'image_mark')
461 469
 					{
462 470
 						$target = $memberInfo['image_mark'];
463 471
 						$functionName = 'doDeleteImageMark';
@@ -473,8 +481,7 @@  discard block
 block discarded – undo
473 481
 							$functionName,
474 482
 							$memberInfo['member_srl'],
475 483
 							$lang->cmd_delete);
476
-					}
477
-					else
484
+					} else
478 485
 					{
479 486
 						$inputTag = sprintf('<input type="hidden" name="__%s_exist" value="false" />', $formInfo->name);
480 487
 					}
@@ -493,8 +500,7 @@  discard block
 block discarded – undo
493 500
 							$memberInfo['birthday'],
494 501
 							zdate($memberInfo['birthday'], 'Y-m-d', false),
495 502
 							$lang->cmd_delete);
496
-					}
497
-					else if($formInfo->name == 'find_account_question')
503
+					} else if($formInfo->name == 'find_account_question')
498 504
 					{
499 505
 						$disabled = (!!$memberInfo['member_srl']) ? 'disabled="disabled"' : '';
500 506
 
@@ -503,8 +509,11 @@  discard block
 block discarded – undo
503 509
 						$optionTag = array();
504 510
 						foreach($lang->find_account_question_items as $key=>$val)
505 511
 						{
506
-							if($key == $memberInfo['find_account_question']) $selected = 'selected="selected"';
507
-							else $selected = '';
512
+							if($key == $memberInfo['find_account_question']) {
513
+								$selected = 'selected="selected"';
514
+							} else {
515
+								$selected = '';
516
+							}
508 517
 							$optionTag[] = sprintf('<option value="%s" %s >%s</option>',
509 518
 								$key,
510 519
 								$selected,
@@ -517,23 +526,19 @@  discard block
 block discarded – undo
517 526
 							$inputTag .= ' <label><input type="checkbox" name="modify_find_account_answer" value="Y" /> ' . Context::getLang('cmd_modify') . '</label>';
518 527
 							$inputTag .= '<script>(function($) {$(function() {$(\'[name=modify_find_account_answer]\').change(function() {var $this = $(this); if($this.prop(\'checked\')) {$(\'[name=find_account_question],[name=find_account_answer]\').attr(\'disabled\', false); } else {$(\'[name=find_account_question]\').attr(\'disabled\', true); $(\'[name=find_account_answer]\').attr(\'disabled\', true).val(\'\'); } }); }); })(jQuery);</script>';
519 528
 						}
520
-					}
521
-					else if($formInfo->name == 'email_address')
529
+					} else if($formInfo->name == 'email_address')
522 530
 					{
523 531
 						$formTag->type = 'email';
524 532
 						$inputTag = '<input type="email" name="email_address" id="email_address" value="'.$memberInfo['email_address'].'" />';
525
-					}
526
-					else if($formInfo->name == 'homepage')
533
+					} else if($formInfo->name == 'homepage')
527 534
 					{
528 535
 						$formTag->type = 'url';
529 536
 						$inputTag = '<input type="url" name="homepage" id="homepage" value="'.$memberInfo['homepage'].'" />';
530
-					}
531
-					else if($formInfo->name == 'blog')
537
+					} else if($formInfo->name == 'blog')
532 538
 					{
533 539
 						$formTag->type = 'url';
534 540
 						$inputTag = '<input type="url" name="blog" id="blog" value="'.$memberInfo['blog'].'" />';
535
-					}
536
-					else
541
+					} else
537 542
 					{
538 543
 						$formTag->type = 'text';
539 544
 						$inputTag = sprintf('<input type="text" name="%s" id="%s" value="%s" />',
@@ -552,27 +557,22 @@  discard block
 block discarded – undo
552 557
 					if($extendForm->column_type == 'text')
553 558
 					{
554 559
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
555
-					}
556
-					else if($extendForm->column_type == 'homepage')
560
+					} else if($extendForm->column_type == 'homepage')
557 561
 					{
558 562
 						$template = '<input type="url" name="%column_name%" id="%column_name%" value="%value%" />';
559
-					}
560
-					else if($extendForm->column_type == 'email_address')
563
+					} else if($extendForm->column_type == 'email_address')
561 564
 					{
562 565
 						$template = '<input type="email" name="%column_name%" id="%column_name%" value="%value%" />';
563
-					}
564
-					else if($extendForm->column_type == 'tel')
566
+					} else if($extendForm->column_type == 'tel')
565 567
 					{
566 568
 						$extentionReplace = array('tel_0' => $extendForm->value[0],
567 569
 							'tel_1' => $extendForm->value[1],
568 570
 							'tel_2' => $extendForm->value[2]);
569 571
 						$template = '<input type="tel" name="%column_name%[]" id="%column_name%" value="%tel_0%" size="4" maxlength="4" style="width:30px" title="First Number" /> - <input type="tel" name="%column_name%[]" value="%tel_1%" size="4" maxlength="4" style="width:35px" title="Second Number" /> - <input type="tel" name="%column_name%[]" value="%tel_2%" size="4" maxlength="4" style="width:35px" title="Third Number" />';
570
-					}
571
-					else if($extendForm->column_type == 'textarea')
572
+					} else if($extendForm->column_type == 'textarea')
572 573
 					{
573 574
 						$template = '<textarea name="%column_name%" id="%column_name%" rows="4" cols="42">%value%</textarea>';
574
-					}
575
-					else if($extendForm->column_type == 'checkbox')
575
+					} else if($extendForm->column_type == 'checkbox')
576 576
 					{
577 577
 						$template = '';
578 578
 						if($extendForm->default_value)
@@ -583,14 +583,15 @@  discard block
 block discarded – undo
583 583
 							foreach($extendForm->default_value as $v)
584 584
 							{
585 585
 								$checked = '';
586
-								if(is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"';
586
+								if(is_array($extendForm->value) && in_array($v, $extendForm->value)) {
587
+									$checked = 'checked="checked"';
588
+								}
587 589
 								$optionTag[] = '<label for="%column_name%'.$__i.'"><input type="checkbox" id="%column_name%'.$__i.'" name="%column_name%[]" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
588 590
 								$__i++;
589 591
 							}
590 592
 							$template = sprintf($template, implode('', $optionTag));
591 593
 						}
592
-					}
593
-					else if($extendForm->column_type == 'radio')
594
+					} else if($extendForm->column_type == 'radio')
594 595
 					{
595 596
 						$template = '';
596 597
 						if($extendForm->default_value)
@@ -599,14 +600,16 @@  discard block
 block discarded – undo
599 600
 							$optionTag = array();
600 601
 							foreach($extendForm->default_value as $v)
601 602
 							{
602
-								if($extendForm->value == $v)$checked = 'checked="checked"';
603
-								else $checked = '';
603
+								if($extendForm->value == $v) {
604
+									$checked = 'checked="checked"';
605
+								} else {
606
+									$checked = '';
607
+								}
604 608
 								$optionTag[] = '<label><input type="radio" name="%column_name%" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
605 609
 							}
606 610
 							$template = sprintf($template, implode('', $optionTag));
607 611
 						}
608
-					}
609
-					else if($extendForm->column_type == 'select')
612
+					} else if($extendForm->column_type == 'select')
610 613
 					{
611 614
 						$template = '<select name="'.$formInfo->name.'" id="'.$formInfo->name.'">%s</select>';
612 615
 						$optionTag = array();
@@ -615,26 +618,26 @@  discard block
 block discarded – undo
615 618
 						{
616 619
 							foreach($extendForm->default_value as $v)
617 620
 							{
618
-								if($v == $extendForm->value) $selected = 'selected="selected"';
619
-								else $selected = '';
621
+								if($v == $extendForm->value) {
622
+									$selected = 'selected="selected"';
623
+								} else {
624
+									$selected = '';
625
+								}
620 626
 								$optionTag[] = sprintf('<option value="%s" %s >%s</option>', $v, $selected, $v);
621 627
 							}
622 628
 						}
623 629
 						$template = sprintf($template, implode('', $optionTag));
624
-					}
625
-					else if($extendForm->column_type == 'kr_zip')
630
+					} else if($extendForm->column_type == 'kr_zip')
626 631
 					{
627 632
 						$krzipModel = getModel('krzip');
628 633
 						if($krzipModel && method_exists($krzipModel , 'getKrzipCodeSearchHtml' ))
629 634
 						{
630 635
 							$template = $krzipModel->getKrzipCodeSearchHtml($extendForm->column_name, $extendForm->value);
631 636
 						}
632
-					}
633
-					else if($extendForm->column_type == 'jp_zip')
637
+					} else if($extendForm->column_type == 'jp_zip')
634 638
 					{
635 639
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
636
-					}
637
-					else if($extendForm->column_type == 'date')
640
+					} else if($extendForm->column_type == 'date')
638 641
 					{
639 642
 						$extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete);
640 643
 						$template = '<input type="hidden" name="%column_name%" id="date_%column_name%" value="%value%" /><input type="text" placeholder="YYYY-MM-DD" class="inputDate" value="%date%" readonly="readonly" /> <input type="button" value="%cmd_delete%" class="btn dateRemover" />';
@@ -643,8 +646,9 @@  discard block
 block discarded – undo
643 646
 					$replace = array_merge($extentionReplace, $replace);
644 647
 					$inputTag = preg_replace_callback('@%(\w+)%@', function($n) use($replace) { return $replace[$n[1]]; }, $template);
645 648
 
646
-					if($extendForm->description)
647
-						$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
649
+					if($extendForm->description) {
650
+											$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
651
+					}
648 652
 				}
649 653
 				$formTag->inputTag = $inputTag;
650 654
 				$formTags[] = $formTag;
@@ -679,8 +683,9 @@  discard block
 block discarded – undo
679 683
 			$oMemberModel = getModel('member');
680 684
 			$join_form = $oMemberModel->getJoinForm($member_join_form_srl);
681 685
 
682
-			if(!$join_form) Context::set('member_join_form_srl','',true);
683
-			else
686
+			if(!$join_form) {
687
+				Context::set('member_join_form_srl','',true);
688
+			} else
684 689
 			{
685 690
 				Context::set('join_form', $join_form);
686 691
 				$security = new Security();
Please login to merge, or discard this patch.
modules/member/member.admin.controller.php 2 patches
Spacing   +175 added lines, -175 removed lines patch added patch discarded remove patch
@@ -24,31 +24,31 @@  discard block
 block discarded – undo
24 24
 		// if(Context::getRequestMethod() == "GET") return new Object(-1, "msg_invalid_request");
25 25
 		// Extract the necessary information in advance
26 26
 		$logged_info = Context::get('logged_info');
27
-		if($logged_info->is_admin != 'Y' || !checkCSRF())
27
+		if ($logged_info->is_admin != 'Y' || !checkCSRF())
28 28
 		{
29 29
 			return new Object(-1, 'msg_invalid_request');
30 30
 		}
31 31
 
32
-		$args = Context::gets('member_srl','email_address','find_account_answer', 'allow_mailing','allow_message','denied','is_admin','description','group_srl_list','limit_date');
33
-		$oMemberModel = &getModel ('member');
34
-		$config = $oMemberModel->getMemberConfig ();
32
+		$args = Context::gets('member_srl', 'email_address', 'find_account_answer', 'allow_mailing', 'allow_message', 'denied', 'is_admin', 'description', 'group_srl_list', 'limit_date');
33
+		$oMemberModel = &getModel('member');
34
+		$config = $oMemberModel->getMemberConfig();
35 35
 		$getVars = array();
36
-		if($config->signupForm)
36
+		if ($config->signupForm)
37 37
 		{
38
-			foreach($config->signupForm as $formInfo)
38
+			foreach ($config->signupForm as $formInfo)
39 39
 			{
40
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
40
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
41 41
 				{
42 42
 					$getVars[] = $formInfo->name;
43 43
 				}
44 44
 			}
45 45
 		}
46
-		foreach($getVars as $val)
46
+		foreach ($getVars as $val)
47 47
 		{
48 48
 			$args->{$val} = Context::get($val);
49 49
 		}
50 50
 		$args->member_srl = Context::get('member_srl');
51
-		if(Context::get('reset_password'))
51
+		if (Context::get('reset_password'))
52 52
 			$args->password = Context::get('reset_password');
53 53
 		else unset($args->password);
54 54
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 		unset($all_args->error_return_url);
61 61
 		unset($all_args->success_return_url);
62 62
 		unset($all_args->ruleset);
63
-		if(!isset($args->limit_date)) $args->limit_date = "";
63
+		if (!isset($args->limit_date)) $args->limit_date = "";
64 64
 		unset($all_args->password);
65 65
 		unset($all_args->password2);
66 66
 		unset($all_args->reset_password);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 		$extra_vars = delObjectVars($all_args, $args);
69 69
 		$args->extra_vars = serialize($extra_vars);
70 70
 		// Check if an original member exists having the member_srl
71
-		if($args->member_srl)
71
+		if ($args->member_srl)
72 72
 		{
73 73
 			// Create a member model object
74 74
 			$oMemberModel = getModel('member');
@@ -76,14 +76,14 @@  discard block
 block discarded – undo
76 76
 			$columnList = array('member_srl');
77 77
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl, 0, $columnList);
78 78
 			// If no original member exists, make a new one
79
-			if($member_info->member_srl != $args->member_srl) unset($args->member_srl);
79
+			if ($member_info->member_srl != $args->member_srl) unset($args->member_srl);
80 80
 		}
81 81
 
82 82
 		// remove whitespace
83 83
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
84
-		foreach($checkInfos as $val)
84
+		foreach ($checkInfos as $val)
85 85
 		{
86
-			if(isset($args->{$val}))
86
+			if (isset($args->{$val}))
87 87
 			{
88 88
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
89 89
 			}
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 		$oMemberController = getController('member');
93 93
 		// Execute insert or update depending on the value of member_srl
94
-		if(!$args->member_srl)
94
+		if (!$args->member_srl)
95 95
 		{
96 96
 			$args->password = Context::get('password');
97 97
 			$output = $oMemberController->insertMember($args);
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 			$msg_code = 'success_updated';
104 104
 		}
105 105
 
106
-		if(!$output->toBool()) return $output;
106
+		if (!$output->toBool()) return $output;
107 107
 		// Save Signature
108 108
 		$signature = Context::get('signature');
109 109
 		$oMemberController->putSignature($args->member_srl, $signature);
@@ -112,13 +112,13 @@  discard block
 block discarded – undo
112 112
 		$this->setMessage($msg_code);
113 113
 
114 114
 		$profile_image = $_FILES['profile_image'];
115
-		if(is_uploaded_file($profile_image['tmp_name']))
115
+		if (is_uploaded_file($profile_image['tmp_name']))
116 116
 		{
117 117
 			$oMemberController->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
118 118
 		}
119 119
 
120 120
 		$image_mark = $_FILES['image_mark'];
121
-		if(is_uploaded_file($image_mark['tmp_name']))
121
+		if (is_uploaded_file($image_mark['tmp_name']))
122 122
 		{
123 123
 			$oMemberController->insertImageMark($args->member_srl, $image_mark['tmp_name']);
124 124
 		}
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
 
145 145
 		$oMemberController = getController('member');
146 146
 		$output = $oMemberController->deleteMember($member_srl);
147
-		if(!$output->toBool()) return $output;
147
+		if (!$output->toBool()) return $output;
148 148
 
149
-		$this->add('page',Context::get('page'));
149
+		$this->add('page', Context::get('page'));
150 150
 		$this->setMessage("success_deleted");
151 151
 	}
152 152
 
@@ -165,26 +165,26 @@  discard block
 block discarded – undo
165 165
 		);
166 166
 		
167 167
 		$oPassword = new Password();
168
-		if(!array_key_exists($args->password_hashing_algorithm, $oPassword->getSupportedAlgorithms()))
168
+		if (!array_key_exists($args->password_hashing_algorithm, $oPassword->getSupportedAlgorithms()))
169 169
 		{
170 170
 			$args->password_hashing_algorithm = 'md5';
171 171
 		}
172 172
 		
173 173
 		$args->password_hashing_work_factor = intval($args->password_hashing_work_factor, 10);
174
-		if($args->password_hashing_work_factor < 4)
174
+		if ($args->password_hashing_work_factor < 4)
175 175
 		{
176 176
 			$args->password_hashing_work_factor = 4;
177 177
 		}
178
-		if($args->password_hashing_work_factor > 16)
178
+		if ($args->password_hashing_work_factor > 16)
179 179
 		{
180 180
 			$args->password_hashing_work_factor = 16;
181 181
 		}
182
-		if($args->password_hashing_auto_upgrade != 'Y')
182
+		if ($args->password_hashing_auto_upgrade != 'Y')
183 183
 		{
184 184
 			$args->password_hashing_auto_upgrade = 'N';
185 185
 		}
186 186
 
187
-		if((!$args->webmaster_name || !$args->webmaster_email) && $args->enable_confirm == 'Y')
187
+		if ((!$args->webmaster_name || !$args->webmaster_email) && $args->enable_confirm == 'Y')
188 188
 		{
189 189
 			return new Object(-1, 'msg_mail_authorization');
190 190
 		}
@@ -219,20 +219,20 @@  discard block
 block discarded – undo
219 219
 		$usable_list = Context::get('usable_list');
220 220
 		$all_args = Context::getRequestVars();
221 221
 
222
-		$args->limit_day = (int)$args->limit_day;
223
-		if(!trim(strip_tags($args->agreement)))
222
+		$args->limit_day = (int) $args->limit_day;
223
+		if (!trim(strip_tags($args->agreement)))
224 224
 		{
225
-			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
225
+			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt';
226 226
 			FileHandler::removeFile($agreement_file);
227 227
 			$args->agreement = NULL;
228 228
 		}
229 229
 
230
-		if($args->redirect_url)
230
+		if ($args->redirect_url)
231 231
 		{
232 232
 			$oModuleModel = getModel('module');
233 233
 			$redirectModuleInfo = $oModuleModel->getModuleInfoByModuleSrl($args->redirect_url, array('mid'));
234 234
 
235
-			if(!$redirectModuleInfo)
235
+			if (!$redirectModuleInfo)
236 236
 			{
237 237
 				return new Object('-1', 'msg_exist_selected_module');
238 238
 			}
@@ -256,28 +256,28 @@  discard block
 block discarded – undo
256 256
 		$items = array('user_id', 'password', 'user_name', 'nick_name', 'email_address', 'find_account_question', 'homepage', 'blog', 'birthday', 'signature', 'profile_image', 'image_name', 'image_mark', 'profile_image_max_width', 'profile_image_max_height', 'image_name_max_width', 'image_name_max_height', 'image_mark_max_width', 'image_mark_max_height');
257 257
 		$mustRequireds = array('email_address', 'nick_name', 'password', 'find_account_question');
258 258
 		$extendItems = $oMemberModel->getJoinFormList();
259
-		foreach($list_order as $key)
259
+		foreach ($list_order as $key)
260 260
 		{
261 261
 			$signupItem = new stdClass();
262 262
 			$signupItem->isIdentifier = ($key == $all_args->identifier);
263 263
 			$signupItem->isDefaultForm = in_array($key, $items);
264 264
 
265 265
 			$signupItem->name = $key;
266
-			if(!in_array($key, $items)) $signupItem->title = $key;
266
+			if (!in_array($key, $items)) $signupItem->title = $key;
267 267
 			else $signupItem->title = $lang->{$key};
268 268
 			$signupItem->mustRequired = in_array($key, $mustRequireds);
269 269
 			$signupItem->imageType = (strpos($key, 'image') !== false);
270 270
 			$signupItem->required = ($all_args->{$key} == 'required') || $signupItem->mustRequired || $signupItem->isIdentifier;
271 271
 			$signupItem->isUse = in_array($key, $usable_list) || $signupItem->required;
272 272
 			$signupItem->isPublic = ($all_args->{'is_'.$key.'_public'} == 'Y' && $signupItem->isUse) ? 'Y' : 'N';
273
-			if($signupItem->imageType)
273
+			if ($signupItem->imageType)
274 274
 			{
275 275
 				$signupItem->max_width = $all_args->{$key.'_max_width'};
276 276
 				$signupItem->max_height = $all_args->{$key.'_max_height'};
277 277
 			}
278 278
 
279 279
 			// set extends form
280
-			if(!$signupItem->isDefaultForm)
280
+			if (!$signupItem->isDefaultForm)
281 281
 			{
282 282
 				$extendItem = $extendItems[$all_args->{$key.'_member_join_form_srl'}];
283 283
 				$signupItem->type = $extendItem->column_type;
@@ -286,13 +286,13 @@  discard block
 block discarded – undo
286 286
 				$signupItem->description = $extendItem->description;
287 287
 
288 288
 				// check usable value change, required/option
289
-				if($signupItem->isUse != ($extendItem->is_active == 'Y') || $signupItem->required != ($extendItem->required == 'Y'))
289
+				if ($signupItem->isUse != ($extendItem->is_active == 'Y') || $signupItem->required != ($extendItem->required == 'Y'))
290 290
 				{
291 291
 					unset($update_args);
292 292
 					$update_args = new stdClass;
293 293
 					$update_args->member_join_form_srl = $extendItem->member_join_form_srl;
294
-					$update_args->is_active = $signupItem->isUse?'Y':'N';
295
-					$update_args->required = $signupItem->required?'Y':'N';
294
+					$update_args->is_active = $signupItem->isUse ? 'Y' : 'N';
295
+					$update_args->required = $signupItem->required ? 'Y' : 'N';
296 296
 
297 297
 					$update_output = executeQuery('member.updateJoinForm', $update_args);
298 298
 				}
@@ -309,9 +309,9 @@  discard block
 block discarded – undo
309 309
 		$this->_createFindAccountByQuestion($args->identifier);
310 310
 
311 311
 		// check agreement value exist
312
-		if($args->agreement)
312
+		if ($args->agreement)
313 313
 		{
314
-			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
314
+			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt';
315 315
 			$output = FileHandler::writeFile($agreement_file, $args->agreement);
316 316
 
317 317
 			unset($args->agreement);
@@ -339,16 +339,16 @@  discard block
 block discarded – undo
339 339
 			'after_logout_url'
340 340
 		);
341 341
 
342
-		if(!$args->change_password_date)
342
+		if (!$args->change_password_date)
343 343
 		{
344 344
 			$args->change_password_date = 0;
345 345
 		}
346 346
 
347
-		if(!trim(strip_tags($args->after_login_url)))
347
+		if (!trim(strip_tags($args->after_login_url)))
348 348
 		{
349 349
 			$args->after_login_url = NULL;
350 350
 		}
351
-		if(!trim(strip_tags($args->after_logout_url)))
351
+		if (!trim(strip_tags($args->after_logout_url)))
352 352
 		{
353 353
 			$args->after_logout_url = NULL;
354 354
 		}
@@ -375,17 +375,17 @@  discard block
 block discarded – undo
375 375
 		);
376 376
 
377 377
 		$args->layout_srl = $args->layout_srl ? $args->layout_srl : NULL;
378
-		if(!$args->skin)
378
+		if (!$args->skin)
379 379
 		{
380 380
 			$args->skin = 'default';
381 381
 		}
382
-		if(!$args->colorset)
382
+		if (!$args->colorset)
383 383
 		{
384 384
 			$args->colorset = 'white';
385 385
 		}
386 386
 
387 387
 		$args->mlayout_srl = $args->mlayout_srl ? $args->mlayout_srl : NULL;
388
-		if(!$args->mskin)
388
+		if (!$args->mskin)
389 389
 		{
390 390
 			$args->mskin = 'default';
391 391
 		}
@@ -408,12 +408,12 @@  discard block
 block discarded – undo
408 408
 		$extendItems = $oMemberModel->getJoinFormList();
409 409
 
410 410
 		$items = array('user_id', 'password', 'user_name', 'nick_name', 'email_address', 'find_account_question', 'homepage', 'blog', 'birthday', 'signature', 'profile_image', 'image_name', 'image_mark');
411
-		$mustRequireds = array('email_address', 'nick_name','password', 'find_account_question');
411
+		$mustRequireds = array('email_address', 'nick_name', 'password', 'find_account_question');
412 412
 		$orgRequireds = array('email_address', 'password', 'find_account_question', 'user_id', 'nick_name', 'user_name');
413 413
 		$orgUse = array('email_address', 'password', 'find_account_question', 'user_id', 'nick_name', 'user_name', 'homepage', 'blog', 'birthday');
414 414
 		$list_order = array();
415 415
 
416
-		foreach($items as $key)
416
+		foreach ($items as $key)
417 417
 		{
418 418
 			unset($signupItem);
419 419
 			$signupItem = new stdClass;
@@ -425,23 +425,23 @@  discard block
 block discarded – undo
425 425
 			$signupItem->required = in_array($key, $orgRequireds);
426 426
 			$signupItem->isUse = ($config->{$key} == 'Y') || in_array($key, $orgUse);
427 427
 			$signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N';
428
-			if($key == 'find_account_question' || $key == 'password')
428
+			if ($key == 'find_account_question' || $key == 'password')
429 429
 			{
430 430
 				$signupItem->isPublic = 'N';
431 431
 			}
432 432
 			$signupItem->isIdentifier = ($key == $identifier);
433
-			if ($signupItem->imageType){
433
+			if ($signupItem->imageType) {
434 434
 				$signupItem->max_width = $config->{$key.'_max_width'};
435 435
 				$signupItem->max_height = $config->{$key.'_max_height'};
436 436
 			}
437
-			if($signupItem->isIdentifier)
437
+			if ($signupItem->isIdentifier)
438 438
 				array_unshift($list_order, $signupItem);
439 439
 			else
440 440
 				$list_order[] = $signupItem;
441 441
 		}
442
-		if(is_array($extendItems))
442
+		if (is_array($extendItems))
443 443
 		{
444
-			foreach($extendItems as $form_srl=>$item_info)
444
+			foreach ($extendItems as $form_srl=>$item_info)
445 445
 			{
446 446
 				unset($signupItem);
447 447
 				$signupItem = new stdClass;
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 				$signupItem->isUse = ($item_info->is_active == 'Y');
455 455
 				$signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N';
456 456
 				$signupItem->description = $item_info->description;
457
-				if($signupItem->imageType)
457
+				if ($signupItem->imageType)
458 458
 				{
459 459
 					$signupItem->max_width = $config->{$key.'_max_width'};
460 460
 					$signupItem->max_height = $config->{$key.'_max_height'};
@@ -472,13 +472,13 @@  discard block
 block discarded – undo
472 472
 	 * @param string $agreement
473 473
 	 * @return void
474 474
 	 */
475
-	function _createSignupRuleset($signupForm, $agreement = null){
475
+	function _createSignupRuleset($signupForm, $agreement = null) {
476 476
 		$xml_file = './files/ruleset/insertMember.xml';
477
-		$buff = '<?xml version="1.0" encoding="utf-8"?>' . PHP_EOL.
478
-			'<ruleset version="1.5.0">' . PHP_EOL.
479
-			'<customrules>' . PHP_EOL.
480
-			'</customrules>' . PHP_EOL.
481
-			'<fields>' . PHP_EOL . '%s' . PHP_EOL . '</fields>' . PHP_EOL.
477
+		$buff = '<?xml version="1.0" encoding="utf-8"?>'.PHP_EOL.
478
+			'<ruleset version="1.5.0">'.PHP_EOL.
479
+			'<customrules>'.PHP_EOL.
480
+			'</customrules>'.PHP_EOL.
481
+			'<fields>'.PHP_EOL.'%s'.PHP_EOL.'</fields>'.PHP_EOL.
482 482
 			'</ruleset>';
483 483
 
484 484
 		$fields = array();
@@ -487,41 +487,41 @@  discard block
 block discarded – undo
487 487
 		{
488 488
 			$fields[] = '<field name="accept_agreement"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /></field>';
489 489
 		}
490
-		foreach($signupForm as $formInfo)
490
+		foreach ($signupForm as $formInfo)
491 491
 		{
492
-			if($formInfo->required || $formInfo->mustRequired)
492
+			if ($formInfo->required || $formInfo->mustRequired)
493 493
 			{
494
-				if($formInfo->type == 'tel' || $formInfo->type == 'kr_zip')
494
+				if ($formInfo->type == 'tel' || $formInfo->type == 'kr_zip')
495 495
 				{
496 496
 					$fields[] = sprintf('<field name="%s[]" required="true" />', $formInfo->name);
497 497
 				}
498
-				else if($formInfo->name == 'password')
498
+				else if ($formInfo->name == 'password')
499 499
 				{
500 500
 					$fields[] = '<field name="password"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="length" value="4:60" /></field>';
501 501
 					$fields[] = '<field name="password2"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="equalto" value="password" /></field>';
502 502
 				}
503
-				else if($formInfo->name == 'find_account_question')
503
+				else if ($formInfo->name == 'find_account_question')
504 504
 				{
505 505
 					$fields[] = '<field name="find_account_question"><if test="$modify_find_account_answer" attr="required" value="true" /></field>';
506 506
 					$fields[] = '<field name="find_account_answer" length=":250"><if test="$modify_find_account_answer" attr="required" value="true" /></field>';
507 507
 				}
508
-				else if($formInfo->name == 'email_address')
508
+				else if ($formInfo->name == 'email_address')
509 509
 				{
510 510
 					$fields[] = sprintf('<field name="%s" required="true" rule="email"/>', $formInfo->name);
511 511
 				}
512
-				else if($formInfo->name == 'user_id')
512
+				else if ($formInfo->name == 'user_id')
513 513
 				{
514 514
 					$fields[] = sprintf('<field name="%s" required="true" rule="userid" length="3:20" />', $formInfo->name);
515 515
 				}
516
-				else if($formInfo->name == 'nick_name')
516
+				else if ($formInfo->name == 'nick_name')
517 517
 				{
518 518
 					$fields[] = sprintf('<field name="%s" required="true" length="2:20" />', $formInfo->name);
519 519
 				}
520
-				else if(strpos($formInfo->name, 'image') !== false)
520
+				else if (strpos($formInfo->name, 'image') !== false)
521 521
 				{
522 522
 					$fields[] = sprintf('<field name="%s"><if test="$act != \'procMemberAdminInsert\' &amp;&amp; $__%s_exist != \'true\'" attr="required" value="true" /></field>', $formInfo->name, $formInfo->name);
523 523
 				}
524
-				else if($formInfo->name == 'signature')
524
+				else if ($formInfo->name == 'signature')
525 525
 				{
526 526
 					$fields[] = '<field name="signature"><if test="$member_srl" attr="required" value="true" /></field>';
527 527
 				}
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 		FileHandler::writeFile($xml_file, $xml_buff);
537 537
 		unset($xml_buff);
538 538
 
539
-		$validator   = new Validator($xml_file);
539
+		$validator = new Validator($xml_file);
540 540
 		$validator->setCacheDir('files/cache');
541 541
 		$validator->getJsPath();
542 542
 	}
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
 		$xml_buff = sprintf($buff, implode('', $fields));
565 565
 		Filehandler::writeFile($xml_file, $xml_buff);
566 566
 
567
-		$validator   = new Validator($xml_file);
567
+		$validator = new Validator($xml_file);
568 568
 		$validator->setCacheDir('files/cache');
569 569
 		$validator->getJsPath();
570 570
 	}
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
 			'</ruleset>';
586 586
 
587 587
 		$fields = array();
588
-		if($identifier == 'user_id')
588
+		if ($identifier == 'user_id')
589 589
 			$fields[] = '<field name="user_id" required="true" rule="userid" />';
590 590
 
591 591
 		$fields[] = '<field name="email_address" required="true" rule="email" />';
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 		$xml_buff = sprintf($buff, implode('', $fields));
596 596
 		Filehandler::writeFile($xml_file, $xml_buff);
597 597
 
598
-		$validator   = new Validator($xml_file);
598
+		$validator = new Validator($xml_file);
599 599
 		$validator->setCacheDir('files/cache');
600 600
 		$validator->getJsPath();
601 601
 	}
@@ -606,12 +606,12 @@  discard block
 block discarded – undo
606 606
 	 */
607 607
 	function procMemberAdminInsertGroup()
608 608
 	{
609
-		$args = Context::gets('title','description','is_default','image_mark');
609
+		$args = Context::gets('title', 'description', 'is_default', 'image_mark');
610 610
 		$output = $this->insertGroup($args);
611
-		if(!$output->toBool()) return $output;
611
+		if (!$output->toBool()) return $output;
612 612
 
613
-		$this->add('group_srl','');
614
-		$this->add('page',Context::get('page'));
613
+		$this->add('group_srl', '');
614
+		$this->add('page', Context::get('page'));
615 615
 		$this->setMessage('success_registed');
616 616
 
617 617
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList');
@@ -626,13 +626,13 @@  discard block
 block discarded – undo
626 626
 	{
627 627
 		$group_srl = Context::get('group_srl');
628 628
 
629
-		$args = Context::gets('group_srl','title','description','is_default','image_mark');
629
+		$args = Context::gets('group_srl', 'title', 'description', 'is_default', 'image_mark');
630 630
 		$args->site_srl = 0;
631 631
 		$output = $this->updateGroup($args);
632
-		if(!$output->toBool()) return $output;
632
+		if (!$output->toBool()) return $output;
633 633
 
634
-		$this->add('group_srl','');
635
-		$this->add('page',Context::get('page'));
634
+		$this->add('group_srl', '');
635
+		$this->add('page', Context::get('page'));
636 636
 		$this->setMessage('success_updated');
637 637
 
638 638
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList');
@@ -648,10 +648,10 @@  discard block
 block discarded – undo
648 648
 		$group_srl = Context::get('group_srl');
649 649
 
650 650
 		$output = $this->deleteGroup($group_srl);
651
-		if(!$output->toBool()) return $output;
651
+		if (!$output->toBool()) return $output;
652 652
 
653
-		$this->add('group_srl','');
654
-		$this->add('page',Context::get('page'));
653
+		$this->add('group_srl', '');
654
+		$this->add('page', Context::get('page'));
655 655
 		$this->setMessage('success_deleted');
656 656
 
657 657
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList');
@@ -673,10 +673,10 @@  discard block
 block discarded – undo
673 673
 		$args->default_value = explode("\n", str_replace("\r", '', Context::get('default_value')));
674 674
 		$args->required = Context::get('required');
675 675
 		$args->is_active = (isset($args->required));
676
-		if(!in_array(strtoupper($args->required), array('Y','N')))$args->required = 'N';
676
+		if (!in_array(strtoupper($args->required), array('Y', 'N')))$args->required = 'N';
677 677
 		$args->description = Context::get('description') ? Context::get('description') : '';
678 678
 		// Default values
679
-		if(in_array($args->column_type, array('checkbox','select','radio')) && count($args->default_value))
679
+		if (in_array($args->column_type, array('checkbox', 'select', 'radio')) && count($args->default_value))
680 680
 		{
681 681
 			$args->default_value = serialize($args->default_value);
682 682
 		}
@@ -688,17 +688,17 @@  discard block
 block discarded – undo
688 688
 		// Check ID duplicated
689 689
 		$oMemberModel = getModel('member');
690 690
 		$config = $oMemberModel->getMemberConfig();
691
-		foreach($config->signupForm as $item)
691
+		foreach ($config->signupForm as $item)
692 692
 		{
693
-			if($item->name == $args->column_name)
693
+			if ($item->name == $args->column_name)
694 694
 			{
695
-				if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue;
696
-				return new Object(-1,'msg_exists_user_id');
695
+				if ($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue;
696
+				return new Object(-1, 'msg_exists_user_id');
697 697
 			}
698 698
 		}
699 699
 		// Fix if member_join_form_srl exists. Add if not exists.
700 700
 		$isInsert;
701
-		if(!$args->member_join_form_srl)
701
+		if (!$args->member_join_form_srl)
702 702
 		{
703 703
 			$isInsert = true;
704 704
 			$args->list_order = $args->member_join_form_srl = getNextSequence();
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 			$output = executeQuery('member.updateJoinForm', $args);
710 710
 		}
711 711
 
712
-		if(!$output->toBool()) return $output;
712
+		if (!$output->toBool()) return $output;
713 713
 
714 714
 		// memberConfig update
715 715
 		$signupItem = new stdClass();
@@ -726,15 +726,15 @@  discard block
 block discarded – undo
726 726
 		$config = $oMemberModel->getMemberConfig();
727 727
 		unset($config->agreement);
728 728
 
729
-		if($isInsert)
729
+		if ($isInsert)
730 730
 		{
731 731
 			$config->signupForm[] = $signupItem;
732 732
 		}
733 733
 		else
734 734
 		{
735
-			foreach($config->signupForm as $key=>$val)
735
+			foreach ($config->signupForm as $key=>$val)
736 736
 			{
737
-				if($val->member_join_form_srl == $signupItem->member_join_form_srl)
737
+				if ($val->member_join_form_srl == $signupItem->member_join_form_srl)
738 738
 				{
739 739
 					$config->signupForm[$key] = $signupItem;
740 740
 				}
@@ -762,9 +762,9 @@  discard block
 block discarded – undo
762 762
 		$config = $oMemberModel->getMemberConfig();
763 763
 		unset($config->agreement);
764 764
 
765
-		foreach($config->signupForm as $key=>$val)
765
+		foreach ($config->signupForm as $key=>$val)
766 766
 		{
767
-			if($val->member_join_form_srl == $member_join_form_srl)
767
+			if ($val->member_join_form_srl == $member_join_form_srl)
768 768
 			{
769 769
 				unset($config->signupForm[$key]);
770 770
 				break;
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
 		$member_join_form_srl = Context::get('member_join_form_srl');
785 785
 		$mode = Context::get('mode');
786 786
 
787
-		switch($mode)
787
+		switch ($mode)
788 788
 		{
789 789
 			case 'up' :
790 790
 				$output = $this->moveJoinFormUp($member_join_form_srl);
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
 			case 'update' :
802 802
 				break;
803 803
 		}
804
-		if(!$output->toBool()) return $output;
804
+		if (!$output->toBool()) return $output;
805 805
 
806 806
 		$this->setMessage($msg_code);
807 807
 	}
@@ -820,40 +820,40 @@  discard block
 block discarded – undo
820 820
 		$oDB->begin();
821 821
 
822 822
 		$oMemberController = getController('member');
823
-		foreach($members as $key=>$member_srl)
823
+		foreach ($members as $key=>$member_srl)
824 824
 		{
825 825
 			$args = new stdClass();
826 826
 			$args->member_srl = $member_srl;
827
-			switch($var->type)
827
+			switch ($var->type)
828 828
 			{
829 829
 				case 'modify':
830 830
 					{
831
-						if(count($groups) > 0)
831
+						if (count($groups) > 0)
832 832
 						{
833 833
 							$args->site_srl = 0;
834 834
 							// One of its members to delete all the group
835 835
 							$output = executeQuery('member.deleteMemberGroupMember', $args);
836
-							if(!$output->toBool())
836
+							if (!$output->toBool())
837 837
 							{
838 838
 								$oDB->rollback();
839 839
 								return $output;
840 840
 							}
841 841
 							// Enter one of the loop a
842
-							foreach($groups as $group_srl)
842
+							foreach ($groups as $group_srl)
843 843
 							{
844
-								$output = $oMemberController->addMemberToGroup($args->member_srl,$group_srl);
845
-								if(!$output->toBool())
844
+								$output = $oMemberController->addMemberToGroup($args->member_srl, $group_srl);
845
+								if (!$output->toBool())
846 846
 								{
847 847
 									$oDB->rollback();
848 848
 									return $output;
849 849
 								}
850 850
 							}
851 851
 						}
852
-						if($var->denied)
852
+						if ($var->denied)
853 853
 						{
854 854
 							$args->denied = $var->denied;
855 855
 							$output = executeQuery('member.updateMemberDeniedInfo', $args);
856
-							if(!$output->toBool())
856
+							if (!$output->toBool())
857 857
 							{
858 858
 								$oDB->rollback();
859 859
 								return $output;
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
 					{
867 867
 						$oMemberController->memberInfo = null;
868 868
 						$output = $oMemberController->deleteMember($member_srl);
869
-						if(!$output->toBool())
869
+						if (!$output->toBool())
870 870
 						{
871 871
 							$oDB->rollback();
872 872
 							return $output;
@@ -879,15 +879,15 @@  discard block
 block discarded – undo
879 879
 
880 880
 		$message = $var->message;
881 881
 		// Send a message
882
-		if($message)
882
+		if ($message)
883 883
 		{
884 884
 			$oCommunicationController = getController('communication');
885 885
 
886 886
 			$logged_info = Context::get('logged_info');
887
-			$title = cut_str($message,10,'...');
887
+			$title = cut_str($message, 10, '...');
888 888
 			$sender_member_srl = $logged_info->member_srl;
889 889
 
890
-			foreach($members as $member_srl)
890
+			foreach ($members as $member_srl)
891 891
 			{
892 892
 				$oCommunicationController->sendMessage($sender_member_srl, $member_srl, $title, $message, false);
893 893
 			}
@@ -904,14 +904,14 @@  discard block
 block discarded – undo
904 904
 	function procMemberAdminDeleteMembers()
905 905
 	{
906 906
 		$target_member_srls = Context::get('target_member_srls');
907
-		if(!$target_member_srls) return new Object(-1, 'msg_invalid_request');
907
+		if (!$target_member_srls) return new Object(-1, 'msg_invalid_request');
908 908
 		$member_srls = explode(',', $target_member_srls);
909 909
 		$oMemberController = getController('member');
910 910
 
911
-		foreach($member_srls as $member)
911
+		foreach ($member_srls as $member)
912 912
 		{
913 913
 			$output = $oMemberController->deleteMember($member);
914
-			if(!$output->toBool())
914
+			if (!$output->toBool())
915 915
 			{
916 916
 				$this->setMessage('failed_deleted');
917 917
 				return $output;
@@ -928,11 +928,11 @@  discard block
 block discarded – undo
928 928
 	function procMemberAdminUpdateMembersGroup()
929 929
 	{
930 930
 		$member_srl = Context::get('member_srl');
931
-		if(!$member_srl) return new Object(-1,'msg_invalid_request');
932
-		$member_srls = explode(',',$member_srl);
931
+		if (!$member_srl) return new Object(-1, 'msg_invalid_request');
932
+		$member_srls = explode(',', $member_srl);
933 933
 
934 934
 		$group_srl = Context::get('group_srls');
935
-		if(!is_array($group_srl)) $group_srls = explode('|@|', $group_srl);
935
+		if (!is_array($group_srl)) $group_srls = explode('|@|', $group_srl);
936 936
 		else $group_srls = $group_srl;
937 937
 
938 938
 		$oDB = &DB::getInstance();
@@ -941,7 +941,7 @@  discard block
 block discarded – undo
941 941
 		$args = new stdClass;
942 942
 		$args->member_srl = $member_srl;
943 943
 		$output = executeQuery('member.deleteMembersGroup', $args);
944
-		if(!$output->toBool())
944
+		if (!$output->toBool())
945 945
 		{
946 946
 			$oDB->rollback();
947 947
 			return $output;
@@ -949,21 +949,21 @@  discard block
 block discarded – undo
949 949
 		// Add to a selected group
950 950
 		$group_count = count($group_srls);
951 951
 		$member_count = count($member_srls);
952
-		for($j=0;$j<$group_count;$j++)
952
+		for ($j = 0; $j < $group_count; $j++)
953 953
 		{
954
-			$group_srl = (int)trim($group_srls[$j]);
955
-			if(!$group_srl) continue;
956
-			for($i=0;$i<$member_count;$i++)
954
+			$group_srl = (int) trim($group_srls[$j]);
955
+			if (!$group_srl) continue;
956
+			for ($i = 0; $i < $member_count; $i++)
957 957
 			{
958
-				$member_srl = (int)trim($member_srls[$i]);
959
-				if(!$member_srl) continue;
958
+				$member_srl = (int) trim($member_srls[$i]);
959
+				if (!$member_srl) continue;
960 960
 
961 961
 				$args = new stdClass;
962 962
 				$args->member_srl = $member_srl;
963 963
 				$args->group_srl = $group_srl;
964 964
 
965 965
 				$output = executeQuery('member.addMemberToGroup', $args);
966
-				if(!$output->toBool())
966
+				if (!$output->toBool())
967 967
 				{
968 968
 					$oDB->rollback();
969 969
 					return $output;
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
 
977 977
 		$this->setMessage('success_updated');
978 978
 
979
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
979
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
980 980
 		{
981 981
 			global $lang;
982 982
 			htmlHeader();
@@ -997,19 +997,19 @@  discard block
 block discarded – undo
997 997
 	{
998 998
 		$user_ids = Context::get('user_id');
999 999
 
1000
-		$user_ids = explode(',',$user_ids);
1000
+		$user_ids = explode(',', $user_ids);
1001 1001
 		$success_ids = array();
1002 1002
 
1003
-		foreach($user_ids as $val)
1003
+		foreach ($user_ids as $val)
1004 1004
 		{
1005 1005
 			$val = trim($val);
1006
-			if(!$val) continue;
1006
+			if (!$val) continue;
1007 1007
 
1008 1008
 			$output = $this->insertDeniedID($val, '');
1009
-			if($output->toBool()) $success_ids[] = $val;
1009
+			if ($output->toBool()) $success_ids[] = $val;
1010 1010
 		}
1011 1011
 
1012
-		$this->add('user_ids', implode(',',$success_ids));
1012
+		$this->add('user_ids', implode(',', $success_ids));
1013 1013
 
1014 1014
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminDeniedIDList');
1015 1015
 		$this->setRedirectUrl($returnUrl);
@@ -1026,10 +1026,10 @@  discard block
 block discarded – undo
1026 1026
 		$mode = Context::get('mode');
1027 1027
 		$mode = $mode ? $mode : 'insert';
1028 1028
 
1029
-		if($mode == 'delete')
1029
+		if ($mode == 'delete')
1030 1030
 		{
1031 1031
 			$output = $this->deleteDeniedNickName($nick_name);
1032
-			if(!$output->toBool())
1032
+			if (!$output->toBool())
1033 1033
 			{
1034 1034
 				return $output;
1035 1035
 			}
@@ -1038,19 +1038,19 @@  discard block
 block discarded – undo
1038 1038
 		}
1039 1039
 		else
1040 1040
 		{
1041
-			$nick_names = explode(',',$nick_name);
1041
+			$nick_names = explode(',', $nick_name);
1042 1042
 			$success_nick_names = array();
1043 1043
 
1044
-			foreach($nick_names as $val)
1044
+			foreach ($nick_names as $val)
1045 1045
 			{
1046 1046
 				$val = trim($val);
1047
-				if(!$val) continue;
1047
+				if (!$val) continue;
1048 1048
 
1049 1049
 				$output = $this->insertDeniedNickName($val, '');
1050
-				if($output->toBool()) $success_nick_names[] = $val;
1050
+				if ($output->toBool()) $success_nick_names[] = $val;
1051 1051
 			}
1052 1052
 
1053
-			$this->add('nick_names', implode(',',$success_nick_names));
1053
+			$this->add('nick_names', implode(',', $success_nick_names));
1054 1054
 		}
1055 1055
 	}
1056 1056
 
@@ -1063,16 +1063,16 @@  discard block
 block discarded – undo
1063 1063
 		$user_id = Context::get('user_id');
1064 1064
 		$mode = Context::get('mode');
1065 1065
 
1066
-		switch($mode)
1066
+		switch ($mode)
1067 1067
 		{
1068 1068
 			case 'delete' :
1069 1069
 				$output = $this->deleteDeniedID($user_id);
1070
-				if(!$output->toBool()) return $output;
1070
+				if (!$output->toBool()) return $output;
1071 1071
 				$msg_code = 'success_deleted';
1072 1072
 				break;
1073 1073
 		}
1074 1074
 
1075
-		$this->add('page',Context::get('page'));
1075
+		$this->add('page', Context::get('page'));
1076 1076
 		$this->setMessage($msg_code);
1077 1077
 	}
1078 1078
 
@@ -1119,24 +1119,24 @@  discard block
 block discarded – undo
1119 1119
 	 */
1120 1120
 	function insertGroup($args)
1121 1121
 	{
1122
-		if(!$args->site_srl) $args->site_srl = 0;
1122
+		if (!$args->site_srl) $args->site_srl = 0;
1123 1123
 		// Check the value of is_default.
1124
-		if($args->is_default != 'Y')
1124
+		if ($args->is_default != 'Y')
1125 1125
 		{
1126 1126
 			$args->is_default = 'N';
1127 1127
 		}
1128 1128
 		else
1129 1129
 		{
1130 1130
 			$output = executeQuery('member.updateGroupDefaultClear', $args);
1131
-			if(!$output->toBool()) return $output;
1131
+			if (!$output->toBool()) return $output;
1132 1132
 		}
1133 1133
 
1134
-		if(!isset($args->list_order) || $args->list_order=='')
1134
+		if (!isset($args->list_order) || $args->list_order == '')
1135 1135
 		{
1136 1136
 			$args->list_order = $args->group_srl;
1137 1137
 		}
1138 1138
 
1139
-		if(!$args->group_srl) $args->group_srl = getNextSequence();
1139
+		if (!$args->group_srl) $args->group_srl = getNextSequence();
1140 1140
 		$args->list_order = $args->group_srl;
1141 1141
 		$output = executeQuery('member.insertGroup', $args);
1142 1142
 		$this->_deleteMemberGroupCache($args->site_srl);
@@ -1151,17 +1151,17 @@  discard block
 block discarded – undo
1151 1151
 	 */
1152 1152
 	function updateGroup($args)
1153 1153
 	{
1154
-		if(!$args->site_srl) $args->site_srl = 0;
1154
+		if (!$args->site_srl) $args->site_srl = 0;
1155 1155
 		// Check the value of is_default.
1156
-		if(!$args->group_srl) return new Object(-1, 'lang->msg_not_founded');
1157
-		if($args->is_default!='Y')
1156
+		if (!$args->group_srl) return new Object(-1, 'lang->msg_not_founded');
1157
+		if ($args->is_default != 'Y')
1158 1158
 		{
1159 1159
 			$args->is_default = 'N';
1160 1160
 		}
1161 1161
 		else
1162 1162
 		{
1163 1163
 			$output = executeQuery('member.updateGroupDefaultClear', $args);
1164
-			if(!$output->toBool()) return $output;
1164
+			if (!$output->toBool()) return $output;
1165 1165
 		}
1166 1166
 
1167 1167
 		$output = executeQuery('member.updateGroup', $args);
@@ -1184,8 +1184,8 @@  discard block
 block discarded – undo
1184 1184
 		$columnList = array('group_srl', 'is_default');
1185 1185
 		$group_info = $oMemberModel->getGroup($group_srl, $columnList);
1186 1186
 
1187
-		if(!$group_info) return new Object(-1, 'lang->msg_not_founded');
1188
-		if($group_info->is_default == 'Y') return new Object(-1, 'msg_not_delete_default');
1187
+		if (!$group_info) return new Object(-1, 'lang->msg_not_founded');
1188
+		if ($group_info->is_default == 'Y') return new Object(-1, 'msg_not_delete_default');
1189 1189
 
1190 1190
 		// Get groups where is_default == 'Y'
1191 1191
 		$columnList = array('site_srl', 'group_srl');
@@ -1222,7 +1222,7 @@  discard block
 block discarded – undo
1222 1222
 		$defaultGroup = $oMemberModel->getDefaultGroup(0);
1223 1223
 		$defaultGroupSrl = $defaultGroup->group_srl;
1224 1224
 		$group_srls = $vars->group_srls;
1225
-		foreach($group_srls as $order=>$group_srl)
1225
+		foreach ($group_srls as $order=>$group_srl)
1226 1226
 		{
1227 1227
 			$isInsert = false;
1228 1228
 			$update_args = new stdClass();
@@ -1231,9 +1231,9 @@  discard block
 block discarded – undo
1231 1231
 			$update_args->image_mark = $vars->image_marks[$order];
1232 1232
 			$update_args->list_order = $order + 1;
1233 1233
 
1234
-			if(!$update_args->title) continue;
1234
+			if (!$update_args->title) continue;
1235 1235
 
1236
-			if(is_numeric($group_srl)) {
1236
+			if (is_numeric($group_srl)) {
1237 1237
 				$update_args->group_srl = $group_srl;
1238 1238
 				$output = $this->updateGroup($update_args);
1239 1239
 			}
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
 				$output = $this->insertGroup($update_args);
1243 1243
 			}
1244 1244
 
1245
-			if($vars->defaultGroup == $group_srl) {
1245
+			if ($vars->defaultGroup == $group_srl) {
1246 1246
 				$defaultGroupSrl = $update_args->group_srl;
1247 1247
 			}
1248 1248
 		}
@@ -1268,7 +1268,7 @@  discard block
 block discarded – undo
1268 1268
 	{
1269 1269
 		$vars = Context::getRequestVars();
1270 1270
 
1271
-		foreach($vars->group_srls as $key => $val)
1271
+		foreach ($vars->group_srls as $key => $val)
1272 1272
 		{
1273 1273
 			$args = new stdClass;
1274 1274
 			$args->group_srl = $val;
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
 	{
1290 1290
 		//remove from cache
1291 1291
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
1292
-		if($oCacheHandler->isSupport())
1292
+		if ($oCacheHandler->isSupport())
1293 1293
 		{
1294 1294
 			$oCacheHandler->invalidateGroupKey('member');
1295 1295
 		}
@@ -1306,7 +1306,7 @@  discard block
 block discarded – undo
1306 1306
 		$args = new stdClass();
1307 1307
 		$args->user_id = $user_id;
1308 1308
 		$args->description = $description;
1309
-		$args->list_order = -1*getNextSequence();
1309
+		$args->list_order = -1 * getNextSequence();
1310 1310
 
1311 1311
 		return executeQuery('member.insertDeniedID', $args);
1312 1312
 	}
@@ -1327,7 +1327,7 @@  discard block
 block discarded – undo
1327 1327
 	 */
1328 1328
 	function deleteDeniedID($user_id)
1329 1329
 	{
1330
-		if(!$user_id) unset($user_id);
1330
+		if (!$user_id) unset($user_id);
1331 1331
 
1332 1332
 		$args = new stdClass;
1333 1333
 		$args->user_id = $user_id;
@@ -1341,7 +1341,7 @@  discard block
 block discarded – undo
1341 1341
 	 */
1342 1342
 	function deleteDeniedNickName($nick_name)
1343 1343
 	{
1344
-		if(!$nick_name) unset($nick_name);
1344
+		if (!$nick_name) unset($nick_name);
1345 1345
 
1346 1346
 		$args = new stdClass;
1347 1347
 		$args->nick_name = $nick_name;
@@ -1380,16 +1380,16 @@  discard block
 block discarded – undo
1380 1380
 		// Get a list of all join forms
1381 1381
 		$join_form_list = $oMemberModel->getJoinFormList();
1382 1382
 		$join_form_srl_list = array_keys($join_form_list);
1383
-		if(count($join_form_srl_list)<2) return new Object();
1383
+		if (count($join_form_srl_list) < 2) return new Object();
1384 1384
 
1385 1385
 		$prev_member_join_form = NULL;
1386
-		foreach($join_form_list as $key => $val)
1386
+		foreach ($join_form_list as $key => $val)
1387 1387
 		{
1388
-			if($val->member_join_form_srl == $member_join_form_srl) break;
1388
+			if ($val->member_join_form_srl == $member_join_form_srl) break;
1389 1389
 			$prev_member_join_form = $val;
1390 1390
 		}
1391 1391
 		// Return if no previous join form exists
1392
-		if(!$prev_member_join_form) return new Object();
1392
+		if (!$prev_member_join_form) return new Object();
1393 1393
 		// Information of the join form
1394 1394
 		$cur_args = new stdClass;
1395 1395
 		$cur_args->member_join_form_srl = $member_join_form_srl;
@@ -1400,10 +1400,10 @@  discard block
 block discarded – undo
1400 1400
 		$prev_args->list_order = $list_order;
1401 1401
 		// Execute Query
1402 1402
 		$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
1403
-		if(!$output->toBool()) return $output;
1403
+		if (!$output->toBool()) return $output;
1404 1404
 
1405 1405
 		executeQuery('member.updateMemberJoinFormListorder', $prev_args);
1406
-		if(!$output->toBool()) return $output;
1406
+		if (!$output->toBool()) return $output;
1407 1407
 
1408 1408
 		return new Object();
1409 1409
 	}
@@ -1427,16 +1427,16 @@  discard block
 block discarded – undo
1427 1427
 		// Get information of all join forms
1428 1428
 		$join_form_list = $oMemberModel->getJoinFormList();
1429 1429
 		$join_form_srl_list = array_keys($join_form_list);
1430
-		if(count($join_form_srl_list)<2) return new Object();
1430
+		if (count($join_form_srl_list) < 2) return new Object();
1431 1431
 
1432
-		for($i=0;$i<count($join_form_srl_list);$i++)
1432
+		for ($i = 0; $i < count($join_form_srl_list); $i++)
1433 1433
 		{
1434
-			if($join_form_srl_list[$i]==$member_join_form_srl) break;
1434
+			if ($join_form_srl_list[$i] == $member_join_form_srl) break;
1435 1435
 		}
1436 1436
 
1437
-		$next_member_join_form_srl = $join_form_srl_list[$i+1];
1437
+		$next_member_join_form_srl = $join_form_srl_list[$i + 1];
1438 1438
 		// Return if no previous join form exists
1439
-		if(!$next_member_join_form_srl) return new Object();
1439
+		if (!$next_member_join_form_srl) return new Object();
1440 1440
 		$next_member_join_form = $join_form_list[$next_member_join_form_srl];
1441 1441
 		// Information of the join form
1442 1442
 		$cur_args = new stdClass;
@@ -1448,10 +1448,10 @@  discard block
 block discarded – undo
1448 1448
 		$next_args->list_order = $list_order;
1449 1449
 		// Execute Query
1450 1450
 		$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
1451
-		if(!$output->toBool()) return $output;
1451
+		if (!$output->toBool()) return $output;
1452 1452
 
1453 1453
 		$output = executeQuery('member.updateMemberJoinFormListorder', $next_args);
1454
-		if(!$output->toBool()) return $output;
1454
+		if (!$output->toBool()) return $output;
1455 1455
 
1456 1456
 		return new Object();
1457 1457
 	}
Please login to merge, or discard this patch.
Braces   +162 added lines, -86 removed lines patch added patch discarded remove patch
@@ -48,9 +48,11 @@  discard block
 block discarded – undo
48 48
 			$args->{$val} = Context::get($val);
49 49
 		}
50 50
 		$args->member_srl = Context::get('member_srl');
51
-		if(Context::get('reset_password'))
52
-			$args->password = Context::get('reset_password');
53
-		else unset($args->password);
51
+		if(Context::get('reset_password')) {
52
+					$args->password = Context::get('reset_password');
53
+		} else {
54
+			unset($args->password);
55
+		}
54 56
 
55 57
 		// Remove some unnecessary variables from all the vars
56 58
 		$all_args = Context::getRequestVars();
@@ -60,7 +62,9 @@  discard block
 block discarded – undo
60 62
 		unset($all_args->error_return_url);
61 63
 		unset($all_args->success_return_url);
62 64
 		unset($all_args->ruleset);
63
-		if(!isset($args->limit_date)) $args->limit_date = "";
65
+		if(!isset($args->limit_date)) {
66
+			$args->limit_date = "";
67
+		}
64 68
 		unset($all_args->password);
65 69
 		unset($all_args->password2);
66 70
 		unset($all_args->reset_password);
@@ -76,7 +80,9 @@  discard block
 block discarded – undo
76 80
 			$columnList = array('member_srl');
77 81
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl, 0, $columnList);
78 82
 			// If no original member exists, make a new one
79
-			if($member_info->member_srl != $args->member_srl) unset($args->member_srl);
83
+			if($member_info->member_srl != $args->member_srl) {
84
+				unset($args->member_srl);
85
+			}
80 86
 		}
81 87
 
82 88
 		// remove whitespace
@@ -96,14 +102,15 @@  discard block
 block discarded – undo
96 102
 			$args->password = Context::get('password');
97 103
 			$output = $oMemberController->insertMember($args);
98 104
 			$msg_code = 'success_registed';
99
-		}
100
-		else
105
+		} else
101 106
 		{
102 107
 			$output = $oMemberController->updateMember($args);
103 108
 			$msg_code = 'success_updated';
104 109
 		}
105 110
 
106
-		if(!$output->toBool()) return $output;
111
+		if(!$output->toBool()) {
112
+			return $output;
113
+		}
107 114
 		// Save Signature
108 115
 		$signature = Context::get('signature');
109 116
 		$oMemberController->putSignature($args->member_srl, $signature);
@@ -144,7 +151,9 @@  discard block
 block discarded – undo
144 151
 
145 152
 		$oMemberController = getController('member');
146 153
 		$output = $oMemberController->deleteMember($member_srl);
147
-		if(!$output->toBool()) return $output;
154
+		if(!$output->toBool()) {
155
+			return $output;
156
+		}
148 157
 
149 158
 		$this->add('page',Context::get('page'));
150 159
 		$this->setMessage("success_deleted");
@@ -263,8 +272,11 @@  discard block
 block discarded – undo
263 272
 			$signupItem->isDefaultForm = in_array($key, $items);
264 273
 
265 274
 			$signupItem->name = $key;
266
-			if(!in_array($key, $items)) $signupItem->title = $key;
267
-			else $signupItem->title = $lang->{$key};
275
+			if(!in_array($key, $items)) {
276
+				$signupItem->title = $key;
277
+			} else {
278
+				$signupItem->title = $lang->{$key};
279
+			}
268 280
 			$signupItem->mustRequired = in_array($key, $mustRequireds);
269 281
 			$signupItem->imageType = (strpos($key, 'image') !== false);
270 282
 			$signupItem->required = ($all_args->{$key} == 'required') || $signupItem->mustRequired || $signupItem->isIdentifier;
@@ -434,10 +446,11 @@  discard block
 block discarded – undo
434 446
 				$signupItem->max_width = $config->{$key.'_max_width'};
435 447
 				$signupItem->max_height = $config->{$key.'_max_height'};
436 448
 			}
437
-			if($signupItem->isIdentifier)
438
-				array_unshift($list_order, $signupItem);
439
-			else
440
-				$list_order[] = $signupItem;
449
+			if($signupItem->isIdentifier) {
450
+							array_unshift($list_order, $signupItem);
451
+			} else {
452
+							$list_order[] = $signupItem;
453
+			}
441 454
 		}
442 455
 		if(is_array($extendItems))
443 456
 		{
@@ -494,38 +507,30 @@  discard block
 block discarded – undo
494 507
 				if($formInfo->type == 'tel' || $formInfo->type == 'kr_zip')
495 508
 				{
496 509
 					$fields[] = sprintf('<field name="%s[]" required="true" />', $formInfo->name);
497
-				}
498
-				else if($formInfo->name == 'password')
510
+				} else if($formInfo->name == 'password')
499 511
 				{
500 512
 					$fields[] = '<field name="password"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="length" value="4:60" /></field>';
501 513
 					$fields[] = '<field name="password2"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="equalto" value="password" /></field>';
502
-				}
503
-				else if($formInfo->name == 'find_account_question')
514
+				} else if($formInfo->name == 'find_account_question')
504 515
 				{
505 516
 					$fields[] = '<field name="find_account_question"><if test="$modify_find_account_answer" attr="required" value="true" /></field>';
506 517
 					$fields[] = '<field name="find_account_answer" length=":250"><if test="$modify_find_account_answer" attr="required" value="true" /></field>';
507
-				}
508
-				else if($formInfo->name == 'email_address')
518
+				} else if($formInfo->name == 'email_address')
509 519
 				{
510 520
 					$fields[] = sprintf('<field name="%s" required="true" rule="email"/>', $formInfo->name);
511
-				}
512
-				else if($formInfo->name == 'user_id')
521
+				} else if($formInfo->name == 'user_id')
513 522
 				{
514 523
 					$fields[] = sprintf('<field name="%s" required="true" rule="userid" length="3:20" />', $formInfo->name);
515
-				}
516
-				else if($formInfo->name == 'nick_name')
524
+				} else if($formInfo->name == 'nick_name')
517 525
 				{
518 526
 					$fields[] = sprintf('<field name="%s" required="true" length="2:20" />', $formInfo->name);
519
-				}
520
-				else if(strpos($formInfo->name, 'image') !== false)
527
+				} else if(strpos($formInfo->name, 'image') !== false)
521 528
 				{
522 529
 					$fields[] = sprintf('<field name="%s"><if test="$act != \'procMemberAdminInsert\' &amp;&amp; $__%s_exist != \'true\'" attr="required" value="true" /></field>', $formInfo->name, $formInfo->name);
523
-				}
524
-				else if($formInfo->name == 'signature')
530
+				} else if($formInfo->name == 'signature')
525 531
 				{
526 532
 					$fields[] = '<field name="signature"><if test="$member_srl" attr="required" value="true" /></field>';
527
-				}
528
-				else
533
+				} else
529 534
 				{
530 535
 					$fields[] = sprintf('<field name="%s" required="true" />', $formInfo->name);
531 536
 				}
@@ -585,8 +590,9 @@  discard block
 block discarded – undo
585 590
 			'</ruleset>';
586 591
 
587 592
 		$fields = array();
588
-		if($identifier == 'user_id')
589
-			$fields[] = '<field name="user_id" required="true" rule="userid" />';
593
+		if($identifier == 'user_id') {
594
+					$fields[] = '<field name="user_id" required="true" rule="userid" />';
595
+		}
590 596
 
591 597
 		$fields[] = '<field name="email_address" required="true" rule="email" />';
592 598
 		$fields[] = '<field name="find_account_question" required="true" />';
@@ -608,7 +614,9 @@  discard block
 block discarded – undo
608 614
 	{
609 615
 		$args = Context::gets('title','description','is_default','image_mark');
610 616
 		$output = $this->insertGroup($args);
611
-		if(!$output->toBool()) return $output;
617
+		if(!$output->toBool()) {
618
+			return $output;
619
+		}
612 620
 
613 621
 		$this->add('group_srl','');
614 622
 		$this->add('page',Context::get('page'));
@@ -629,7 +637,9 @@  discard block
 block discarded – undo
629 637
 		$args = Context::gets('group_srl','title','description','is_default','image_mark');
630 638
 		$args->site_srl = 0;
631 639
 		$output = $this->updateGroup($args);
632
-		if(!$output->toBool()) return $output;
640
+		if(!$output->toBool()) {
641
+			return $output;
642
+		}
633 643
 
634 644
 		$this->add('group_srl','');
635 645
 		$this->add('page',Context::get('page'));
@@ -648,7 +658,9 @@  discard block
 block discarded – undo
648 658
 		$group_srl = Context::get('group_srl');
649 659
 
650 660
 		$output = $this->deleteGroup($group_srl);
651
-		if(!$output->toBool()) return $output;
661
+		if(!$output->toBool()) {
662
+			return $output;
663
+		}
652 664
 
653 665
 		$this->add('group_srl','');
654 666
 		$this->add('page',Context::get('page'));
@@ -673,14 +685,15 @@  discard block
 block discarded – undo
673 685
 		$args->default_value = explode("\n", str_replace("\r", '', Context::get('default_value')));
674 686
 		$args->required = Context::get('required');
675 687
 		$args->is_active = (isset($args->required));
676
-		if(!in_array(strtoupper($args->required), array('Y','N')))$args->required = 'N';
688
+		if(!in_array(strtoupper($args->required), array('Y','N'))) {
689
+			$args->required = 'N';
690
+		}
677 691
 		$args->description = Context::get('description') ? Context::get('description') : '';
678 692
 		// Default values
679 693
 		if(in_array($args->column_type, array('checkbox','select','radio')) && count($args->default_value))
680 694
 		{
681 695
 			$args->default_value = serialize($args->default_value);
682
-		}
683
-		else
696
+		} else
684 697
 		{
685 698
 			$args->default_value = '';
686 699
 		}
@@ -692,7 +705,9 @@  discard block
 block discarded – undo
692 705
 		{
693 706
 			if($item->name == $args->column_name)
694 707
 			{
695
-				if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue;
708
+				if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) {
709
+					continue;
710
+				}
696 711
 				return new Object(-1,'msg_exists_user_id');
697 712
 			}
698 713
 		}
@@ -703,13 +718,14 @@  discard block
 block discarded – undo
703 718
 			$isInsert = true;
704 719
 			$args->list_order = $args->member_join_form_srl = getNextSequence();
705 720
 			$output = executeQuery('member.insertJoinForm', $args);
706
-		}
707
-		else
721
+		} else
708 722
 		{
709 723
 			$output = executeQuery('member.updateJoinForm', $args);
710 724
 		}
711 725
 
712
-		if(!$output->toBool()) return $output;
726
+		if(!$output->toBool()) {
727
+			return $output;
728
+		}
713 729
 
714 730
 		// memberConfig update
715 731
 		$signupItem = new stdClass();
@@ -729,8 +745,7 @@  discard block
 block discarded – undo
729 745
 		if($isInsert)
730 746
 		{
731 747
 			$config->signupForm[] = $signupItem;
732
-		}
733
-		else
748
+		} else
734 749
 		{
735 750
 			foreach($config->signupForm as $key=>$val)
736 751
 			{
@@ -801,7 +816,9 @@  discard block
 block discarded – undo
801 816
 			case 'update' :
802 817
 				break;
803 818
 		}
804
-		if(!$output->toBool()) return $output;
819
+		if(!$output->toBool()) {
820
+			return $output;
821
+		}
805 822
 
806 823
 		$this->setMessage($msg_code);
807 824
 	}
@@ -904,7 +921,9 @@  discard block
 block discarded – undo
904 921
 	function procMemberAdminDeleteMembers()
905 922
 	{
906 923
 		$target_member_srls = Context::get('target_member_srls');
907
-		if(!$target_member_srls) return new Object(-1, 'msg_invalid_request');
924
+		if(!$target_member_srls) {
925
+			return new Object(-1, 'msg_invalid_request');
926
+		}
908 927
 		$member_srls = explode(',', $target_member_srls);
909 928
 		$oMemberController = getController('member');
910 929
 
@@ -928,12 +947,17 @@  discard block
 block discarded – undo
928 947
 	function procMemberAdminUpdateMembersGroup()
929 948
 	{
930 949
 		$member_srl = Context::get('member_srl');
931
-		if(!$member_srl) return new Object(-1,'msg_invalid_request');
950
+		if(!$member_srl) {
951
+			return new Object(-1,'msg_invalid_request');
952
+		}
932 953
 		$member_srls = explode(',',$member_srl);
933 954
 
934 955
 		$group_srl = Context::get('group_srls');
935
-		if(!is_array($group_srl)) $group_srls = explode('|@|', $group_srl);
936
-		else $group_srls = $group_srl;
956
+		if(!is_array($group_srl)) {
957
+			$group_srls = explode('|@|', $group_srl);
958
+		} else {
959
+			$group_srls = $group_srl;
960
+		}
937 961
 
938 962
 		$oDB = &DB::getInstance();
939 963
 		$oDB->begin();
@@ -952,11 +976,15 @@  discard block
 block discarded – undo
952 976
 		for($j=0;$j<$group_count;$j++)
953 977
 		{
954 978
 			$group_srl = (int)trim($group_srls[$j]);
955
-			if(!$group_srl) continue;
979
+			if(!$group_srl) {
980
+				continue;
981
+			}
956 982
 			for($i=0;$i<$member_count;$i++)
957 983
 			{
958 984
 				$member_srl = (int)trim($member_srls[$i]);
959
-				if(!$member_srl) continue;
985
+				if(!$member_srl) {
986
+					continue;
987
+				}
960 988
 
961 989
 				$args = new stdClass;
962 990
 				$args->member_srl = $member_srl;
@@ -1003,10 +1031,14 @@  discard block
 block discarded – undo
1003 1031
 		foreach($user_ids as $val)
1004 1032
 		{
1005 1033
 			$val = trim($val);
1006
-			if(!$val) continue;
1034
+			if(!$val) {
1035
+				continue;
1036
+			}
1007 1037
 
1008 1038
 			$output = $this->insertDeniedID($val, '');
1009
-			if($output->toBool()) $success_ids[] = $val;
1039
+			if($output->toBool()) {
1040
+				$success_ids[] = $val;
1041
+			}
1010 1042
 		}
1011 1043
 
1012 1044
 		$this->add('user_ids', implode(',',$success_ids));
@@ -1035,8 +1067,7 @@  discard block
 block discarded – undo
1035 1067
 			}
1036 1068
 			$msg_code = 'success_deleted';
1037 1069
 			$this->setMessage($msg_code);
1038
-		}
1039
-		else
1070
+		} else
1040 1071
 		{
1041 1072
 			$nick_names = explode(',',$nick_name);
1042 1073
 			$success_nick_names = array();
@@ -1044,10 +1075,14 @@  discard block
 block discarded – undo
1044 1075
 			foreach($nick_names as $val)
1045 1076
 			{
1046 1077
 				$val = trim($val);
1047
-				if(!$val) continue;
1078
+				if(!$val) {
1079
+					continue;
1080
+				}
1048 1081
 
1049 1082
 				$output = $this->insertDeniedNickName($val, '');
1050
-				if($output->toBool()) $success_nick_names[] = $val;
1083
+				if($output->toBool()) {
1084
+					$success_nick_names[] = $val;
1085
+				}
1051 1086
 			}
1052 1087
 
1053 1088
 			$this->add('nick_names', implode(',',$success_nick_names));
@@ -1067,7 +1102,9 @@  discard block
 block discarded – undo
1067 1102
 		{
1068 1103
 			case 'delete' :
1069 1104
 				$output = $this->deleteDeniedID($user_id);
1070
-				if(!$output->toBool()) return $output;
1105
+				if(!$output->toBool()) {
1106
+					return $output;
1107
+				}
1071 1108
 				$msg_code = 'success_deleted';
1072 1109
 				break;
1073 1110
 		}
@@ -1119,16 +1156,19 @@  discard block
 block discarded – undo
1119 1156
 	 */
1120 1157
 	function insertGroup($args)
1121 1158
 	{
1122
-		if(!$args->site_srl) $args->site_srl = 0;
1159
+		if(!$args->site_srl) {
1160
+			$args->site_srl = 0;
1161
+		}
1123 1162
 		// Check the value of is_default.
1124 1163
 		if($args->is_default != 'Y')
1125 1164
 		{
1126 1165
 			$args->is_default = 'N';
1127
-		}
1128
-		else
1166
+		} else
1129 1167
 		{
1130 1168
 			$output = executeQuery('member.updateGroupDefaultClear', $args);
1131
-			if(!$output->toBool()) return $output;
1169
+			if(!$output->toBool()) {
1170
+				return $output;
1171
+			}
1132 1172
 		}
1133 1173
 
1134 1174
 		if(!isset($args->list_order) || $args->list_order=='')
@@ -1136,7 +1176,9 @@  discard block
 block discarded – undo
1136 1176
 			$args->list_order = $args->group_srl;
1137 1177
 		}
1138 1178
 
1139
-		if(!$args->group_srl) $args->group_srl = getNextSequence();
1179
+		if(!$args->group_srl) {
1180
+			$args->group_srl = getNextSequence();
1181
+		}
1140 1182
 		$args->list_order = $args->group_srl;
1141 1183
 		$output = executeQuery('member.insertGroup', $args);
1142 1184
 		$this->_deleteMemberGroupCache($args->site_srl);
@@ -1151,17 +1193,22 @@  discard block
 block discarded – undo
1151 1193
 	 */
1152 1194
 	function updateGroup($args)
1153 1195
 	{
1154
-		if(!$args->site_srl) $args->site_srl = 0;
1196
+		if(!$args->site_srl) {
1197
+			$args->site_srl = 0;
1198
+		}
1155 1199
 		// Check the value of is_default.
1156
-		if(!$args->group_srl) return new Object(-1, 'lang->msg_not_founded');
1200
+		if(!$args->group_srl) {
1201
+			return new Object(-1, 'lang->msg_not_founded');
1202
+		}
1157 1203
 		if($args->is_default!='Y')
1158 1204
 		{
1159 1205
 			$args->is_default = 'N';
1160
-		}
1161
-		else
1206
+		} else
1162 1207
 		{
1163 1208
 			$output = executeQuery('member.updateGroupDefaultClear', $args);
1164
-			if(!$output->toBool()) return $output;
1209
+			if(!$output->toBool()) {
1210
+				return $output;
1211
+			}
1165 1212
 		}
1166 1213
 
1167 1214
 		$output = executeQuery('member.updateGroup', $args);
@@ -1184,8 +1231,12 @@  discard block
 block discarded – undo
1184 1231
 		$columnList = array('group_srl', 'is_default');
1185 1232
 		$group_info = $oMemberModel->getGroup($group_srl, $columnList);
1186 1233
 
1187
-		if(!$group_info) return new Object(-1, 'lang->msg_not_founded');
1188
-		if($group_info->is_default == 'Y') return new Object(-1, 'msg_not_delete_default');
1234
+		if(!$group_info) {
1235
+			return new Object(-1, 'lang->msg_not_founded');
1236
+		}
1237
+		if($group_info->is_default == 'Y') {
1238
+			return new Object(-1, 'msg_not_delete_default');
1239
+		}
1189 1240
 
1190 1241
 		// Get groups where is_default == 'Y'
1191 1242
 		$columnList = array('site_srl', 'group_srl');
@@ -1231,13 +1282,14 @@  discard block
 block discarded – undo
1231 1282
 			$update_args->image_mark = $vars->image_marks[$order];
1232 1283
 			$update_args->list_order = $order + 1;
1233 1284
 
1234
-			if(!$update_args->title) continue;
1285
+			if(!$update_args->title) {
1286
+				continue;
1287
+			}
1235 1288
 
1236 1289
 			if(is_numeric($group_srl)) {
1237 1290
 				$update_args->group_srl = $group_srl;
1238 1291
 				$output = $this->updateGroup($update_args);
1239
-			}
1240
-			else {
1292
+			} else {
1241 1293
 				$update_args->group_srl = getNextSequence();
1242 1294
 				$output = $this->insertGroup($update_args);
1243 1295
 			}
@@ -1327,7 +1379,9 @@  discard block
 block discarded – undo
1327 1379
 	 */
1328 1380
 	function deleteDeniedID($user_id)
1329 1381
 	{
1330
-		if(!$user_id) unset($user_id);
1382
+		if(!$user_id) {
1383
+			unset($user_id);
1384
+		}
1331 1385
 
1332 1386
 		$args = new stdClass;
1333 1387
 		$args->user_id = $user_id;
@@ -1341,7 +1395,9 @@  discard block
 block discarded – undo
1341 1395
 	 */
1342 1396
 	function deleteDeniedNickName($nick_name)
1343 1397
 	{
1344
-		if(!$nick_name) unset($nick_name);
1398
+		if(!$nick_name) {
1399
+			unset($nick_name);
1400
+		}
1345 1401
 
1346 1402
 		$args = new stdClass;
1347 1403
 		$args->nick_name = $nick_name;
@@ -1380,16 +1436,22 @@  discard block
 block discarded – undo
1380 1436
 		// Get a list of all join forms
1381 1437
 		$join_form_list = $oMemberModel->getJoinFormList();
1382 1438
 		$join_form_srl_list = array_keys($join_form_list);
1383
-		if(count($join_form_srl_list)<2) return new Object();
1439
+		if(count($join_form_srl_list)<2) {
1440
+			return new Object();
1441
+		}
1384 1442
 
1385 1443
 		$prev_member_join_form = NULL;
1386 1444
 		foreach($join_form_list as $key => $val)
1387 1445
 		{
1388
-			if($val->member_join_form_srl == $member_join_form_srl) break;
1446
+			if($val->member_join_form_srl == $member_join_form_srl) {
1447
+				break;
1448
+			}
1389 1449
 			$prev_member_join_form = $val;
1390 1450
 		}
1391 1451
 		// Return if no previous join form exists
1392
-		if(!$prev_member_join_form) return new Object();
1452
+		if(!$prev_member_join_form) {
1453
+			return new Object();
1454
+		}
1393 1455
 		// Information of the join form
1394 1456
 		$cur_args = new stdClass;
1395 1457
 		$cur_args->member_join_form_srl = $member_join_form_srl;
@@ -1400,10 +1462,14 @@  discard block
 block discarded – undo
1400 1462
 		$prev_args->list_order = $list_order;
1401 1463
 		// Execute Query
1402 1464
 		$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
1403
-		if(!$output->toBool()) return $output;
1465
+		if(!$output->toBool()) {
1466
+			return $output;
1467
+		}
1404 1468
 
1405 1469
 		executeQuery('member.updateMemberJoinFormListorder', $prev_args);
1406
-		if(!$output->toBool()) return $output;
1470
+		if(!$output->toBool()) {
1471
+			return $output;
1472
+		}
1407 1473
 
1408 1474
 		return new Object();
1409 1475
 	}
@@ -1427,16 +1493,22 @@  discard block
 block discarded – undo
1427 1493
 		// Get information of all join forms
1428 1494
 		$join_form_list = $oMemberModel->getJoinFormList();
1429 1495
 		$join_form_srl_list = array_keys($join_form_list);
1430
-		if(count($join_form_srl_list)<2) return new Object();
1496
+		if(count($join_form_srl_list)<2) {
1497
+			return new Object();
1498
+		}
1431 1499
 
1432 1500
 		for($i=0;$i<count($join_form_srl_list);$i++)
1433 1501
 		{
1434
-			if($join_form_srl_list[$i]==$member_join_form_srl) break;
1502
+			if($join_form_srl_list[$i]==$member_join_form_srl) {
1503
+				break;
1504
+			}
1435 1505
 		}
1436 1506
 
1437 1507
 		$next_member_join_form_srl = $join_form_srl_list[$i+1];
1438 1508
 		// Return if no previous join form exists
1439
-		if(!$next_member_join_form_srl) return new Object();
1509
+		if(!$next_member_join_form_srl) {
1510
+			return new Object();
1511
+		}
1440 1512
 		$next_member_join_form = $join_form_list[$next_member_join_form_srl];
1441 1513
 		// Information of the join form
1442 1514
 		$cur_args = new stdClass;
@@ -1448,10 +1520,14 @@  discard block
 block discarded – undo
1448 1520
 		$next_args->list_order = $list_order;
1449 1521
 		// Execute Query
1450 1522
 		$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
1451
-		if(!$output->toBool()) return $output;
1523
+		if(!$output->toBool()) {
1524
+			return $output;
1525
+		}
1452 1526
 
1453 1527
 		$output = executeQuery('member.updateMemberJoinFormListorder', $next_args);
1454
-		if(!$output->toBool()) return $output;
1528
+		if(!$output->toBool()) {
1529
+			return $output;
1530
+		}
1455 1531
 
1456 1532
 		return new Object();
1457 1533
 	}
Please login to merge, or discard this patch.
modules/communication/communication.class.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -29,17 +29,17 @@  discard block
 block discarded – undo
29 29
 		$oModuleModel = getModel('module');
30 30
 		$oModuleController = getController('module');
31 31
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
32
-		if($oModuleModel->needUpdate($version_update_id))
32
+		if ($oModuleModel->needUpdate($version_update_id))
33 33
 		{
34 34
 			$config = $oModuleModel->getModuleConfig('message');
35 35
 
36
-			if($config->skin)
36
+			if ($config->skin)
37 37
 			{
38 38
 				$config_parse = explode('.', $config->skin);
39
-				if(count($config_parse) > 1)
39
+				if (count($config_parse) > 1)
40 40
 				{
41 41
 					$template_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]);
42
-					if(is_dir($template_path))
42
+					if (is_dir($template_path))
43 43
 					{
44 44
 						return TRUE;
45 45
 					}
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 			$oModuleController->insertUpdatedLog($version_update_id);
50 50
 		}
51 51
 
52
-		if(!is_dir("./files/member_extra_info/new_message_flags"))
52
+		if (!is_dir("./files/member_extra_info/new_message_flags"))
53 53
 		{
54 54
 			return TRUE;
55 55
 		}
@@ -66,21 +66,21 @@  discard block
 block discarded – undo
66 66
 		$oModuleModel = getModel('module');
67 67
 		$oModuleController = getController('module');
68 68
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
69
-		if($oModuleModel->needUpdate($version_update_id))
69
+		if ($oModuleModel->needUpdate($version_update_id))
70 70
 		{
71 71
 			$config = $oModuleModel->getModuleConfig('message');
72
-			if(!is_object($config))
72
+			if (!is_object($config))
73 73
 			{
74 74
 				$config = new stdClass();
75 75
 			}
76 76
 
77
-			if($config->skin)
77
+			if ($config->skin)
78 78
 			{
79 79
 				$config_parse = explode('.', $config->skin);
80
-				if(count($config_parse) > 1)
80
+				if (count($config_parse) > 1)
81 81
 				{
82 82
 					$template_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]);
83
-					if(is_dir($template_path))
83
+					if (is_dir($template_path))
84 84
 					{
85 85
 						$config->skin = implode('|@|', $config_parse);
86 86
 						$oModuleController = getController('module');
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 			$oModuleController->insertUpdatedLog($version_update_id);
93 93
 		}
94 94
 
95
-		if(!is_dir("./files/member_extra_info/new_message_flags"))
95
+		if (!is_dir("./files/member_extra_info/new_message_flags"))
96 96
 		{
97 97
 			FileHandler::makeDir('./files/member_extra_info/new_message_flags');
98 98
 		}
Please login to merge, or discard this patch.
modules/document/document.class.php 2 patches
Spacing   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	 * Search option to use in admin page
18 18
 	 * @var array
19 19
 	 */
20
-	var $search_option = array('title','content','title_content','user_name',); // /< Search options
20
+	var $search_option = array('title', 'content', 'title_content', 'user_name',); // /< Search options
21 21
 	/**
22 22
 	 * Status list
23 23
 	 * @var array
@@ -34,22 +34,22 @@  discard block
 block discarded – undo
34 34
 		$oModuleController = getController('module');
35 35
 
36 36
 		$oDB = &DB::getInstance();
37
-		$oDB->addIndex("documents","idx_module_list_order", array("module_srl","list_order"));
38
-		$oDB->addIndex("documents","idx_module_update_order", array("module_srl","update_order"));
39
-		$oDB->addIndex("documents","idx_module_readed_count", array("module_srl","readed_count"));
40
-		$oDB->addIndex("documents","idx_module_voted_count", array("module_srl","voted_count"));
41
-		$oDB->addIndex("documents","idx_module_notice", array("module_srl","is_notice"));
42
-		$oDB->addIndex("documents","idx_module_document_srl", array("module_srl","document_srl"));
43
-		$oDB->addIndex("documents","idx_module_blamed_count", array("module_srl","blamed_count"));
44
-		$oDB->addIndex("document_aliases", "idx_module_title", array("module_srl","alias_title"), true);
45
-		$oDB->addIndex("document_extra_vars", "unique_extra_vars", array("module_srl","document_srl","var_idx","lang_code"), true);
37
+		$oDB->addIndex("documents", "idx_module_list_order", array("module_srl", "list_order"));
38
+		$oDB->addIndex("documents", "idx_module_update_order", array("module_srl", "update_order"));
39
+		$oDB->addIndex("documents", "idx_module_readed_count", array("module_srl", "readed_count"));
40
+		$oDB->addIndex("documents", "idx_module_voted_count", array("module_srl", "voted_count"));
41
+		$oDB->addIndex("documents", "idx_module_notice", array("module_srl", "is_notice"));
42
+		$oDB->addIndex("documents", "idx_module_document_srl", array("module_srl", "document_srl"));
43
+		$oDB->addIndex("documents", "idx_module_blamed_count", array("module_srl", "blamed_count"));
44
+		$oDB->addIndex("document_aliases", "idx_module_title", array("module_srl", "alias_title"), true);
45
+		$oDB->addIndex("document_extra_vars", "unique_extra_vars", array("module_srl", "document_srl", "var_idx", "lang_code"), true);
46 46
 		// 2007. 10. 17 Add a trigger to delete all posts together when the module is deleted
47 47
 		$oModuleController->insertTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after');
48 48
 
49 49
 		// 2009. 01. 29 Added a trigger for additional setup
50 50
 		$oModuleController->insertTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before');
51 51
 
52
-		if(!is_dir('./files/cache/tmp'))
52
+		if (!is_dir('./files/cache/tmp'))
53 53
 		{
54 54
 			FileHandler::makeDir('./files/cache/tmp');
55 55
 		}
@@ -67,71 +67,71 @@  discard block
 block discarded – undo
67 67
 		$oModuleModel = getModel('module');
68 68
 		$oModuleController = getController('module');
69 69
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
70
-		if($oModuleModel->needUpdate($version_update_id))
70
+		if ($oModuleModel->needUpdate($version_update_id))
71 71
 		{
72 72
 			// 2007. 7. 25: Add a column(notify_message) for notification
73
-			if(!$oDB->isColumnExists("documents","notify_message")) return true;
73
+			if (!$oDB->isColumnExists("documents", "notify_message")) return true;
74 74
 
75 75
 			// 2007. 8. 23: create a clustered index in the document table
76
-			if(!$oDB->isIndexExists("documents","idx_module_list_order")) return true;
77
-			if(!$oDB->isIndexExists("documents","idx_module_update_order")) return true;
78
-			if(!$oDB->isIndexExists("documents","idx_module_readed_count")) return true;
79
-			if(!$oDB->isIndexExists("documents","idx_module_voted_count")) return true;
76
+			if (!$oDB->isIndexExists("documents", "idx_module_list_order")) return true;
77
+			if (!$oDB->isIndexExists("documents", "idx_module_update_order")) return true;
78
+			if (!$oDB->isIndexExists("documents", "idx_module_readed_count")) return true;
79
+			if (!$oDB->isIndexExists("documents", "idx_module_voted_count")) return true;
80 80
 			// 2007. 10. 17 Add a trigger to delete all posts together when the module is deleted
81
-			if(!$oModuleModel->getTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after')) return true;
81
+			if (!$oModuleModel->getTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after')) return true;
82 82
 			// 2007. 10. 25 add parent_srl, expand to the document category
83
-			if(!$oDB->isColumnExists("document_categories","parent_srl")) return true;
84
-			if(!$oDB->isColumnExists("document_categories","expand")) return true;
85
-			if(!$oDB->isColumnExists("document_categories","group_srls")) return true;
83
+			if (!$oDB->isColumnExists("document_categories", "parent_srl")) return true;
84
+			if (!$oDB->isColumnExists("document_categories", "expand")) return true;
85
+			if (!$oDB->isColumnExists("document_categories", "group_srls")) return true;
86 86
 			// 2007. 11. 20 create a composite index on the columns(module_srl + is_notice)
87
-			if(!$oDB->isIndexExists("documents","idx_module_notice")) return true;
87
+			if (!$oDB->isIndexExists("documents", "idx_module_notice")) return true;
88 88
 			// 2008. 02. 18 create a composite index on the columns(module_srl + document_srl) (checked by Manian))
89
-			if(!$oDB->isIndexExists("documents","idx_module_document_srl")) return true;
89
+			if (!$oDB->isIndexExists("documents", "idx_module_document_srl")) return true;
90 90
 
91 91
 			// 2007. 12. 03: Add if the colume(extra_vars) doesn't exist
92
-			if(!$oDB->isColumnExists("documents","extra_vars")) return true;
92
+			if (!$oDB->isColumnExists("documents", "extra_vars")) return true;
93 93
 			// 2008. 04. 23 Add a column(blamed_count)
94
-			if(!$oDB->isColumnExists("documents", "blamed_count")) return true;
95
-			if(!$oDB->isIndexExists("documents","idx_module_blamed_count")) return true;
96
-			if(!$oDB->isColumnExists("document_voted_log", "point")) return true;
94
+			if (!$oDB->isColumnExists("documents", "blamed_count")) return true;
95
+			if (!$oDB->isIndexExists("documents", "idx_module_blamed_count")) return true;
96
+			if (!$oDB->isColumnExists("document_voted_log", "point")) return true;
97 97
 			// 2008-12-15 Add a column(color)
98
-			if(!$oDB->isColumnExists("document_categories", "color")) return true;
98
+			if (!$oDB->isColumnExists("document_categories", "color")) return true;
99 99
 
100 100
 			/**
101 101
 			 * 2009. 01. 29: Add a column(lang_code) if not exist in the document_extra_vars table
102 102
 			 */
103
-			if(!$oDB->isColumnExists("document_extra_vars","lang_code")) return true;
103
+			if (!$oDB->isColumnExists("document_extra_vars", "lang_code")) return true;
104 104
 
105
-			if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before')) return true;
105
+			if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before')) return true;
106 106
 			// 2009. 03. 09 Add a column(lang_code) to the documnets table
107
-			if(!$oDB->isColumnExists("documents","lang_code")) return true;
107
+			if (!$oDB->isColumnExists("documents", "lang_code")) return true;
108 108
 			// 2009. 03. 11 check the index in the document_extra_vars table
109
-			if(!$oDB->isIndexExists("document_extra_vars", "unique_extra_vars")) return true;
109
+			if (!$oDB->isIndexExists("document_extra_vars", "unique_extra_vars")) return true;
110 110
 
111 111
 			// 2009. 03. 19: Add a column(eid) if not exist in the table
112
-			if(!$oDB->isColumnExists("document_extra_keys","eid")) return true;
113
-			if(!$oDB->isColumnExists("document_extra_vars","eid")) return true;
112
+			if (!$oDB->isColumnExists("document_extra_keys", "eid")) return true;
113
+			if (!$oDB->isColumnExists("document_extra_vars", "eid")) return true;
114 114
 
115 115
 			// 2011. 03. 30 Cubrid index Check the index in the document_extra_vars table
116
-			if(!$oDB->isIndexExists("document_extra_vars", "idx_document_list_order")) return true;
116
+			if (!$oDB->isIndexExists("document_extra_vars", "idx_document_list_order")) return true;
117 117
 
118 118
 			//2011. 04. 07 adding description column to document categories
119
-			if(!$oDB->isColumnExists("document_categories","description")) return true;
119
+			if (!$oDB->isColumnExists("document_categories", "description")) return true;
120 120
 
121 121
 			//2011. 05. 23 adding status column to document
122
-			if(!$oDB->isColumnExists('documents', 'status')) return true;
122
+			if (!$oDB->isColumnExists('documents', 'status')) return true;
123 123
 
124 124
 			//2011. 06. 07 check comment status update
125
-			if($oDB->isColumnExists('documents', 'allow_comment') || $oDB->isColumnExists('documents', 'lock_comment')) return true;
125
+			if ($oDB->isColumnExists('documents', 'allow_comment') || $oDB->isColumnExists('documents', 'lock_comment')) return true;
126 126
 
127 127
 			// 2011. 10. 25 status index check
128
-			if(!$oDB->isIndexExists("documents", "idx_module_status")) return true;
128
+			if (!$oDB->isIndexExists("documents", "idx_module_status")) return true;
129 129
 
130 130
 			// 2012. 02. 27 Add a trigger to copy extra keys when the module is copied 
131
-			if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after')) return true;
131
+			if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after')) return true;
132 132
 
133 133
 			// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied 
134
-			if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after')) return true;
134
+			if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after')) return true;
135 135
 
136 136
 			$oModuleController->insertUpdatedLog($version_update_id);
137 137
 		}
@@ -149,101 +149,101 @@  discard block
 block discarded – undo
149 149
 		$oModuleModel = getModel('module');
150 150
 		$oModuleController = getController('module');
151 151
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
152
-		if($oModuleModel->needUpdate($version_update_id))
152
+		if ($oModuleModel->needUpdate($version_update_id))
153 153
 		{
154 154
 			// 2007. 7. 25: Add a column(notify_message) for notification
155
-			if(!$oDB->isColumnExists("documents","notify_message"))
155
+			if (!$oDB->isColumnExists("documents", "notify_message"))
156 156
 			{
157
-				$oDB->addColumn('documents',"notify_message","char",1);
157
+				$oDB->addColumn('documents', "notify_message", "char", 1);
158 158
 			}
159 159
 
160 160
 			// 2007. 8. 23: create a clustered index in the document table
161
-			if(!$oDB->isIndexExists("documents","idx_module_list_order"))
161
+			if (!$oDB->isIndexExists("documents", "idx_module_list_order"))
162 162
 			{
163
-				$oDB->addIndex("documents","idx_module_list_order", array("module_srl","list_order"));
163
+				$oDB->addIndex("documents", "idx_module_list_order", array("module_srl", "list_order"));
164 164
 			}
165 165
 
166
-			if(!$oDB->isIndexExists("documents","idx_module_update_order"))
166
+			if (!$oDB->isIndexExists("documents", "idx_module_update_order"))
167 167
 			{
168
-				$oDB->addIndex("documents","idx_module_update_order", array("module_srl","update_order"));
168
+				$oDB->addIndex("documents", "idx_module_update_order", array("module_srl", "update_order"));
169 169
 			}
170 170
 
171
-			if(!$oDB->isIndexExists("documents","idx_module_readed_count"))
171
+			if (!$oDB->isIndexExists("documents", "idx_module_readed_count"))
172 172
 			{
173
-				$oDB->addIndex("documents","idx_module_readed_count", array("module_srl","readed_count"));
173
+				$oDB->addIndex("documents", "idx_module_readed_count", array("module_srl", "readed_count"));
174 174
 			}
175 175
 
176
-			if(!$oDB->isIndexExists("documents","idx_module_voted_count"))
176
+			if (!$oDB->isIndexExists("documents", "idx_module_voted_count"))
177 177
 			{
178
-				$oDB->addIndex("documents","idx_module_voted_count", array("module_srl","voted_count"));
178
+				$oDB->addIndex("documents", "idx_module_voted_count", array("module_srl", "voted_count"));
179 179
 			}
180 180
 			// 2007. 10. 17 Add a trigger to delete all posts together when the module is deleted
181
-			if(!$oModuleModel->getTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after'))
181
+			if (!$oModuleModel->getTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after'))
182 182
 				$oModuleController->insertTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after');
183 183
 			// 2007. 10. 25 add columns(parent_srl, expand) 
184
-			if(!$oDB->isColumnExists("document_categories","parent_srl")) $oDB->addColumn('document_categories',"parent_srl","number",12,0);
185
-			if(!$oDB->isColumnExists("document_categories","expand")) $oDB->addColumn('document_categories',"expand","char",1,"N");
186
-			if(!$oDB->isColumnExists("document_categories","group_srls")) $oDB->addColumn('document_categories',"group_srls","text");
184
+			if (!$oDB->isColumnExists("document_categories", "parent_srl")) $oDB->addColumn('document_categories', "parent_srl", "number", 12, 0);
185
+			if (!$oDB->isColumnExists("document_categories", "expand")) $oDB->addColumn('document_categories', "expand", "char", 1, "N");
186
+			if (!$oDB->isColumnExists("document_categories", "group_srls")) $oDB->addColumn('document_categories', "group_srls", "text");
187 187
 			// 2007. 11. 20 create a composite index on the columns(module_srl + is_notice)
188
-			if(!$oDB->isIndexExists("documents","idx_module_notice")) $oDB->addIndex("documents","idx_module_notice", array("module_srl","is_notice"));
188
+			if (!$oDB->isIndexExists("documents", "idx_module_notice")) $oDB->addIndex("documents", "idx_module_notice", array("module_srl", "is_notice"));
189 189
 
190 190
 			// 2007. 12. 03: Add if the colume(extra_vars) doesn't exist
191
-			if(!$oDB->isColumnExists("documents","extra_vars")) $oDB->addColumn('documents','extra_vars','text');
191
+			if (!$oDB->isColumnExists("documents", "extra_vars")) $oDB->addColumn('documents', 'extra_vars', 'text');
192 192
 
193 193
 			// 2008. 02. 18 create a composite index on the columns(module_srl + document_srl) (checked by Manian))
194
-			if(!$oDB->isIndexExists("documents","idx_module_document_srl")) $oDB->addIndex("documents","idx_module_document_srl", array("module_srl","document_srl"));
194
+			if (!$oDB->isIndexExists("documents", "idx_module_document_srl")) $oDB->addIndex("documents", "idx_module_document_srl", array("module_srl", "document_srl"));
195 195
 			// 2008. 04. 23 Add a column(blamed count)
196
-			if(!$oDB->isColumnExists("documents", "blamed_count"))
196
+			if (!$oDB->isColumnExists("documents", "blamed_count"))
197 197
 			{
198 198
 				$oDB->addColumn('documents', 'blamed_count', 'number', 11, 0, true);
199 199
 				$oDB->addIndex('documents', 'idx_blamed_count', array('blamed_count'));
200 200
 			}
201 201
 
202
-			if(!$oDB->isIndexExists("documents","idx_module_blamed_count"))
202
+			if (!$oDB->isIndexExists("documents", "idx_module_blamed_count"))
203 203
 			{
204 204
 				$oDB->addIndex('documents', 'idx_module_blamed_count', array('module_srl', 'blamed_count'));
205 205
 			}
206 206
 
207
-			if(!$oDB->isColumnExists("document_voted_log", "point"))
207
+			if (!$oDB->isColumnExists("document_voted_log", "point"))
208 208
 				$oDB->addColumn('document_voted_log', 'point', 'number', 11, 0, true);
209 209
 
210 210
 
211
-			if(!$oDB->isColumnExists("document_categories","color")) $oDB->addColumn('document_categories',"color","char",7);
211
+			if (!$oDB->isColumnExists("document_categories", "color")) $oDB->addColumn('document_categories', "color", "char", 7);
212 212
 
213 213
 			// 2009. 01. 29: Add a column(lang_code) if not exist in the document_extra_vars table
214
-			if(!$oDB->isColumnExists("document_extra_vars","lang_code")) $oDB->addColumn('document_extra_vars',"lang_code","varchar",10);
214
+			if (!$oDB->isColumnExists("document_extra_vars", "lang_code")) $oDB->addColumn('document_extra_vars', "lang_code", "varchar", 10);
215 215
 
216 216
 			// 2009. 01. 29 Added a trigger for additional setup
217
-			if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before'))
217
+			if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before'))
218 218
 				$oModuleController->insertTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before');
219 219
 			// 2009. 03. 09 Add a column(lang_code) to the documnets table
220
-			if(!$oDB->isColumnExists("documents","lang_code"))
220
+			if (!$oDB->isColumnExists("documents", "lang_code"))
221 221
 			{
222 222
 				$db_info = Context::getDBInfo();
223
-				$oDB->addColumn('documents',"lang_code","varchar",10, $db_info->lang_code);
223
+				$oDB->addColumn('documents', "lang_code", "varchar", 10, $db_info->lang_code);
224 224
 				$obj->lang_code = $db_info->lang_type;
225 225
 				executeQuery('document.updateDocumentsLangCode', $obj);
226 226
 			}
227 227
 			// 2009. 03. 11 Check the index in the document_extra_vars table
228
-			if(!$oDB->isIndexExists("document_extra_vars", "unique_extra_vars"))
228
+			if (!$oDB->isIndexExists("document_extra_vars", "unique_extra_vars"))
229 229
 			{
230
-				$oDB->addIndex("document_extra_vars", "unique_extra_vars", array("module_srl","document_srl","var_idx","lang_code"), true);
230
+				$oDB->addIndex("document_extra_vars", "unique_extra_vars", array("module_srl", "document_srl", "var_idx", "lang_code"), true);
231 231
 			}
232 232
 
233
-			if($oDB->isIndexExists("document_extra_vars", "unique_module_vars"))
233
+			if ($oDB->isIndexExists("document_extra_vars", "unique_module_vars"))
234 234
 			{
235 235
 				$oDB->dropIndex("document_extra_vars", "unique_module_vars", true);
236 236
 			}
237 237
 
238 238
 			// 2009. 03. 19: Add a column(eid)
239 239
 			// 2009. 04. 12: Fixed the issue(#17922959) that changes another column values when adding eid column
240
-			if(!$oDB->isColumnExists("document_extra_keys","eid"))
240
+			if (!$oDB->isColumnExists("document_extra_keys", "eid"))
241 241
 			{
242
-				$oDB->addColumn("document_extra_keys","eid","varchar",40);
242
+				$oDB->addColumn("document_extra_keys", "eid", "varchar", 40);
243 243
 
244 244
 				$output = executeQuery('document.getGroupsExtraKeys', $obj);
245
-				if($output->toBool() && $output->data && count($output->data)) {
246
-					foreach($output->data as $extra_keys) {
245
+				if ($output->toBool() && $output->data && count($output->data)) {
246
+					foreach ($output->data as $extra_keys) {
247 247
 						$args->module_srl = $extra_keys->module_srl;
248 248
 						$args->var_idx = $extra_keys->idx;
249 249
 						$args->new_eid = "extra_vars".$extra_keys->idx;
@@ -252,14 +252,14 @@  discard block
 block discarded – undo
252 252
 				}
253 253
 			}
254 254
 
255
-			if(!$oDB->isColumnExists("document_extra_vars","eid"))
255
+			if (!$oDB->isColumnExists("document_extra_vars", "eid"))
256 256
 			{
257
-				$oDB->addColumn("document_extra_vars","eid","varchar",40);
257
+				$oDB->addColumn("document_extra_vars", "eid", "varchar", 40);
258 258
 				$obj->var_idx = '-1,-2';
259 259
 				$output = executeQuery('document.getGroupsExtraVars', $obj);
260
-				if($output->toBool() && $output->data && count($output->data))
260
+				if ($output->toBool() && $output->data && count($output->data))
261 261
 				{
262
-					foreach($output->data as $extra_vars)
262
+					foreach ($output->data as $extra_vars)
263 263
 					{
264 264
 						$args->module_srl = $extra_vars->module_srl;
265 265
 						$args->var_idx = $extra_vars->idx;
@@ -270,16 +270,16 @@  discard block
 block discarded – undo
270 270
 			}
271 271
 
272 272
 			// 2011. 03. 30 Cubrid index Check the index in the document_extra_vars table
273
-			if(!$oDB->isIndexExists("document_extra_vars", "idx_document_list_order"))
273
+			if (!$oDB->isIndexExists("document_extra_vars", "idx_document_list_order"))
274 274
 			{
275
-				$oDB->addIndex("document_extra_vars", "idx_document_list_order", array("document_srl","module_srl","var_idx"), false);
275
+				$oDB->addIndex("document_extra_vars", "idx_document_list_order", array("document_srl", "module_srl", "var_idx"), false);
276 276
 			}
277 277
 
278 278
 			//2011. 04. 07 adding description column to document categories
279
-			if(!$oDB->isColumnExists("document_categories","description")) $oDB->addColumn('document_categories',"description","varchar",200,0);
279
+			if (!$oDB->isColumnExists("document_categories", "description")) $oDB->addColumn('document_categories', "description", "varchar", 200, 0);
280 280
 
281 281
 			//2011. 05. 23 adding status column to document
282
-			if(!$oDB->isColumnExists('documents', 'status'))
282
+			if (!$oDB->isColumnExists('documents', 'status'))
283 283
 			{
284 284
 				$oDB->addColumn('documents', 'status', 'varchar', 20, 'PUBLIC');
285 285
 				$args->is_secret = 'Y';
@@ -287,11 +287,11 @@  discard block
 block discarded – undo
287 287
 			}
288 288
 
289 289
 			// 2011. 09. 08 drop column document is_secret
290
-			if($oDB->isColumnExists('documents', 'status') && $oDB->isColumnExists('documents', 'is_secret'))
290
+			if ($oDB->isColumnExists('documents', 'status') && $oDB->isColumnExists('documents', 'is_secret'))
291 291
 				$oDB->dropColumn('documents', 'is_secret');
292 292
 
293 293
 			//2011. 06. 07 merge column, allow_comment and lock_comment
294
-			if($oDB->isColumnExists('documents', 'allow_comment') || $oDB->isColumnExists('documents', 'lock_comment'))
294
+			if ($oDB->isColumnExists('documents', 'allow_comment') || $oDB->isColumnExists('documents', 'lock_comment'))
295 295
 			{
296 296
 				$oDB->addColumn('documents', 'comment_status', 'varchar', 20, 'ALLOW');
297 297
 
@@ -313,23 +313,23 @@  discard block
 block discarded – undo
313 313
 				$output = executeQuery('document.updateDocumentCommentStatus', $args);
314 314
 			}
315 315
 
316
-			if($oDB->isColumnExists('documents', 'allow_comment') && $oDB->isColumnExists('documents', 'comment_status'))
316
+			if ($oDB->isColumnExists('documents', 'allow_comment') && $oDB->isColumnExists('documents', 'comment_status'))
317 317
 				$oDB->dropColumn('documents', 'allow_comment');
318 318
 
319
-			if($oDB->isColumnExists('documents', 'lock_comment') && $oDB->isColumnExists('documents', 'comment_status'))
319
+			if ($oDB->isColumnExists('documents', 'lock_comment') && $oDB->isColumnExists('documents', 'comment_status'))
320 320
 				$oDB->dropColumn('documents', 'lock_comment');
321 321
 
322
-			if(!$oDB->isIndexExists("documents", "idx_module_status"))
323
-				$oDB->addIndex("documents", "idx_module_status", array("module_srl","status"));
322
+			if (!$oDB->isIndexExists("documents", "idx_module_status"))
323
+				$oDB->addIndex("documents", "idx_module_status", array("module_srl", "status"));
324 324
 
325 325
 			// 2012. 02. 27 Add a trigger to copy extra keys when the module is copied 
326
-			if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after'))
326
+			if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after'))
327 327
 			{
328 328
 				$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after');
329 329
 			}
330 330
 
331 331
 			// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied 
332
-			if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after'))
332
+			if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after'))
333 333
 			{
334 334
 				$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after');
335 335
 			}
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 			$oModuleController->insertUpdatedLog($version_update_id);
338 338
 		}
339 339
 
340
-		return new Object(0,'success_updated');
340
+		return new Object(0, 'success_updated');
341 341
 	}
342 342
 
343 343
 	/**
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 	 */
347 347
 	function recompileCache()
348 348
 	{
349
-		if(!is_dir('./files/cache/tmp'))
349
+		if (!is_dir('./files/cache/tmp'))
350 350
 		{
351 351
 			FileHandler::makeDir('./files/cache/tmp');
352 352
 		}
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 	 */
377 377
 	function getConfigStatus($key)
378 378
 	{
379
-		if(array_key_exists(strtolower($key), $this->statusList)) return $this->statusList[$key];
379
+		if (array_key_exists(strtolower($key), $this->statusList)) return $this->statusList[$key];
380 380
 		else $this->getDefaultStatus();
381 381
 	}
382 382
 }
Please login to merge, or discard this patch.
Braces   +140 added lines, -54 removed lines patch added patch discarded remove patch
@@ -70,68 +70,126 @@  discard block
 block discarded – undo
70 70
 		if($oModuleModel->needUpdate($version_update_id))
71 71
 		{
72 72
 			// 2007. 7. 25: Add a column(notify_message) for notification
73
-			if(!$oDB->isColumnExists("documents","notify_message")) return true;
73
+			if(!$oDB->isColumnExists("documents","notify_message")) {
74
+				return true;
75
+			}
74 76
 
75 77
 			// 2007. 8. 23: create a clustered index in the document table
76
-			if(!$oDB->isIndexExists("documents","idx_module_list_order")) return true;
77
-			if(!$oDB->isIndexExists("documents","idx_module_update_order")) return true;
78
-			if(!$oDB->isIndexExists("documents","idx_module_readed_count")) return true;
79
-			if(!$oDB->isIndexExists("documents","idx_module_voted_count")) return true;
78
+			if(!$oDB->isIndexExists("documents","idx_module_list_order")) {
79
+				return true;
80
+			}
81
+			if(!$oDB->isIndexExists("documents","idx_module_update_order")) {
82
+				return true;
83
+			}
84
+			if(!$oDB->isIndexExists("documents","idx_module_readed_count")) {
85
+				return true;
86
+			}
87
+			if(!$oDB->isIndexExists("documents","idx_module_voted_count")) {
88
+				return true;
89
+			}
80 90
 			// 2007. 10. 17 Add a trigger to delete all posts together when the module is deleted
81
-			if(!$oModuleModel->getTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after')) return true;
91
+			if(!$oModuleModel->getTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after')) {
92
+				return true;
93
+			}
82 94
 			// 2007. 10. 25 add parent_srl, expand to the document category
83
-			if(!$oDB->isColumnExists("document_categories","parent_srl")) return true;
84
-			if(!$oDB->isColumnExists("document_categories","expand")) return true;
85
-			if(!$oDB->isColumnExists("document_categories","group_srls")) return true;
95
+			if(!$oDB->isColumnExists("document_categories","parent_srl")) {
96
+				return true;
97
+			}
98
+			if(!$oDB->isColumnExists("document_categories","expand")) {
99
+				return true;
100
+			}
101
+			if(!$oDB->isColumnExists("document_categories","group_srls")) {
102
+				return true;
103
+			}
86 104
 			// 2007. 11. 20 create a composite index on the columns(module_srl + is_notice)
87
-			if(!$oDB->isIndexExists("documents","idx_module_notice")) return true;
105
+			if(!$oDB->isIndexExists("documents","idx_module_notice")) {
106
+				return true;
107
+			}
88 108
 			// 2008. 02. 18 create a composite index on the columns(module_srl + document_srl) (checked by Manian))
89
-			if(!$oDB->isIndexExists("documents","idx_module_document_srl")) return true;
109
+			if(!$oDB->isIndexExists("documents","idx_module_document_srl")) {
110
+				return true;
111
+			}
90 112
 
91 113
 			// 2007. 12. 03: Add if the colume(extra_vars) doesn't exist
92
-			if(!$oDB->isColumnExists("documents","extra_vars")) return true;
114
+			if(!$oDB->isColumnExists("documents","extra_vars")) {
115
+				return true;
116
+			}
93 117
 			// 2008. 04. 23 Add a column(blamed_count)
94
-			if(!$oDB->isColumnExists("documents", "blamed_count")) return true;
95
-			if(!$oDB->isIndexExists("documents","idx_module_blamed_count")) return true;
96
-			if(!$oDB->isColumnExists("document_voted_log", "point")) return true;
118
+			if(!$oDB->isColumnExists("documents", "blamed_count")) {
119
+				return true;
120
+			}
121
+			if(!$oDB->isIndexExists("documents","idx_module_blamed_count")) {
122
+				return true;
123
+			}
124
+			if(!$oDB->isColumnExists("document_voted_log", "point")) {
125
+				return true;
126
+			}
97 127
 			// 2008-12-15 Add a column(color)
98
-			if(!$oDB->isColumnExists("document_categories", "color")) return true;
128
+			if(!$oDB->isColumnExists("document_categories", "color")) {
129
+				return true;
130
+			}
99 131
 
100 132
 			/**
101 133
 			 * 2009. 01. 29: Add a column(lang_code) if not exist in the document_extra_vars table
102 134
 			 */
103
-			if(!$oDB->isColumnExists("document_extra_vars","lang_code")) return true;
135
+			if(!$oDB->isColumnExists("document_extra_vars","lang_code")) {
136
+				return true;
137
+			}
104 138
 
105
-			if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before')) return true;
139
+			if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before')) {
140
+				return true;
141
+			}
106 142
 			// 2009. 03. 09 Add a column(lang_code) to the documnets table
107
-			if(!$oDB->isColumnExists("documents","lang_code")) return true;
143
+			if(!$oDB->isColumnExists("documents","lang_code")) {
144
+				return true;
145
+			}
108 146
 			// 2009. 03. 11 check the index in the document_extra_vars table
109
-			if(!$oDB->isIndexExists("document_extra_vars", "unique_extra_vars")) return true;
147
+			if(!$oDB->isIndexExists("document_extra_vars", "unique_extra_vars")) {
148
+				return true;
149
+			}
110 150
 
111 151
 			// 2009. 03. 19: Add a column(eid) if not exist in the table
112
-			if(!$oDB->isColumnExists("document_extra_keys","eid")) return true;
113
-			if(!$oDB->isColumnExists("document_extra_vars","eid")) return true;
152
+			if(!$oDB->isColumnExists("document_extra_keys","eid")) {
153
+				return true;
154
+			}
155
+			if(!$oDB->isColumnExists("document_extra_vars","eid")) {
156
+				return true;
157
+			}
114 158
 
115 159
 			// 2011. 03. 30 Cubrid index Check the index in the document_extra_vars table
116
-			if(!$oDB->isIndexExists("document_extra_vars", "idx_document_list_order")) return true;
160
+			if(!$oDB->isIndexExists("document_extra_vars", "idx_document_list_order")) {
161
+				return true;
162
+			}
117 163
 
118 164
 			//2011. 04. 07 adding description column to document categories
119
-			if(!$oDB->isColumnExists("document_categories","description")) return true;
165
+			if(!$oDB->isColumnExists("document_categories","description")) {
166
+				return true;
167
+			}
120 168
 
121 169
 			//2011. 05. 23 adding status column to document
122
-			if(!$oDB->isColumnExists('documents', 'status')) return true;
170
+			if(!$oDB->isColumnExists('documents', 'status')) {
171
+				return true;
172
+			}
123 173
 
124 174
 			//2011. 06. 07 check comment status update
125
-			if($oDB->isColumnExists('documents', 'allow_comment') || $oDB->isColumnExists('documents', 'lock_comment')) return true;
175
+			if($oDB->isColumnExists('documents', 'allow_comment') || $oDB->isColumnExists('documents', 'lock_comment')) {
176
+				return true;
177
+			}
126 178
 
127 179
 			// 2011. 10. 25 status index check
128
-			if(!$oDB->isIndexExists("documents", "idx_module_status")) return true;
180
+			if(!$oDB->isIndexExists("documents", "idx_module_status")) {
181
+				return true;
182
+			}
129 183
 
130 184
 			// 2012. 02. 27 Add a trigger to copy extra keys when the module is copied 
131
-			if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after')) return true;
185
+			if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after')) {
186
+				return true;
187
+			}
132 188
 
133 189
 			// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied 
134
-			if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after')) return true;
190
+			if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after')) {
191
+				return true;
192
+			}
135 193
 
136 194
 			$oModuleController->insertUpdatedLog($version_update_id);
137 195
 		}
@@ -178,20 +236,33 @@  discard block
 block discarded – undo
178 236
 				$oDB->addIndex("documents","idx_module_voted_count", array("module_srl","voted_count"));
179 237
 			}
180 238
 			// 2007. 10. 17 Add a trigger to delete all posts together when the module is deleted
181
-			if(!$oModuleModel->getTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after'))
182
-				$oModuleController->insertTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after');
239
+			if(!$oModuleModel->getTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after')) {
240
+							$oModuleController->insertTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after');
241
+			}
183 242
 			// 2007. 10. 25 add columns(parent_srl, expand) 
184
-			if(!$oDB->isColumnExists("document_categories","parent_srl")) $oDB->addColumn('document_categories',"parent_srl","number",12,0);
185
-			if(!$oDB->isColumnExists("document_categories","expand")) $oDB->addColumn('document_categories',"expand","char",1,"N");
186
-			if(!$oDB->isColumnExists("document_categories","group_srls")) $oDB->addColumn('document_categories',"group_srls","text");
243
+			if(!$oDB->isColumnExists("document_categories","parent_srl")) {
244
+				$oDB->addColumn('document_categories',"parent_srl","number",12,0);
245
+			}
246
+			if(!$oDB->isColumnExists("document_categories","expand")) {
247
+				$oDB->addColumn('document_categories',"expand","char",1,"N");
248
+			}
249
+			if(!$oDB->isColumnExists("document_categories","group_srls")) {
250
+				$oDB->addColumn('document_categories',"group_srls","text");
251
+			}
187 252
 			// 2007. 11. 20 create a composite index on the columns(module_srl + is_notice)
188
-			if(!$oDB->isIndexExists("documents","idx_module_notice")) $oDB->addIndex("documents","idx_module_notice", array("module_srl","is_notice"));
253
+			if(!$oDB->isIndexExists("documents","idx_module_notice")) {
254
+				$oDB->addIndex("documents","idx_module_notice", array("module_srl","is_notice"));
255
+			}
189 256
 
190 257
 			// 2007. 12. 03: Add if the colume(extra_vars) doesn't exist
191
-			if(!$oDB->isColumnExists("documents","extra_vars")) $oDB->addColumn('documents','extra_vars','text');
258
+			if(!$oDB->isColumnExists("documents","extra_vars")) {
259
+				$oDB->addColumn('documents','extra_vars','text');
260
+			}
192 261
 
193 262
 			// 2008. 02. 18 create a composite index on the columns(module_srl + document_srl) (checked by Manian))
194
-			if(!$oDB->isIndexExists("documents","idx_module_document_srl")) $oDB->addIndex("documents","idx_module_document_srl", array("module_srl","document_srl"));
263
+			if(!$oDB->isIndexExists("documents","idx_module_document_srl")) {
264
+				$oDB->addIndex("documents","idx_module_document_srl", array("module_srl","document_srl"));
265
+			}
195 266
 			// 2008. 04. 23 Add a column(blamed count)
196 267
 			if(!$oDB->isColumnExists("documents", "blamed_count"))
197 268
 			{
@@ -204,18 +275,24 @@  discard block
 block discarded – undo
204 275
 				$oDB->addIndex('documents', 'idx_module_blamed_count', array('module_srl', 'blamed_count'));
205 276
 			}
206 277
 
207
-			if(!$oDB->isColumnExists("document_voted_log", "point"))
208
-				$oDB->addColumn('document_voted_log', 'point', 'number', 11, 0, true);
278
+			if(!$oDB->isColumnExists("document_voted_log", "point")) {
279
+							$oDB->addColumn('document_voted_log', 'point', 'number', 11, 0, true);
280
+			}
209 281
 
210 282
 
211
-			if(!$oDB->isColumnExists("document_categories","color")) $oDB->addColumn('document_categories',"color","char",7);
283
+			if(!$oDB->isColumnExists("document_categories","color")) {
284
+				$oDB->addColumn('document_categories',"color","char",7);
285
+			}
212 286
 
213 287
 			// 2009. 01. 29: Add a column(lang_code) if not exist in the document_extra_vars table
214
-			if(!$oDB->isColumnExists("document_extra_vars","lang_code")) $oDB->addColumn('document_extra_vars',"lang_code","varchar",10);
288
+			if(!$oDB->isColumnExists("document_extra_vars","lang_code")) {
289
+				$oDB->addColumn('document_extra_vars',"lang_code","varchar",10);
290
+			}
215 291
 
216 292
 			// 2009. 01. 29 Added a trigger for additional setup
217
-			if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before'))
218
-				$oModuleController->insertTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before');
293
+			if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before')) {
294
+							$oModuleController->insertTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before');
295
+			}
219 296
 			// 2009. 03. 09 Add a column(lang_code) to the documnets table
220 297
 			if(!$oDB->isColumnExists("documents","lang_code"))
221 298
 			{
@@ -276,7 +353,9 @@  discard block
 block discarded – undo
276 353
 			}
277 354
 
278 355
 			//2011. 04. 07 adding description column to document categories
279
-			if(!$oDB->isColumnExists("document_categories","description")) $oDB->addColumn('document_categories',"description","varchar",200,0);
356
+			if(!$oDB->isColumnExists("document_categories","description")) {
357
+				$oDB->addColumn('document_categories',"description","varchar",200,0);
358
+			}
280 359
 
281 360
 			//2011. 05. 23 adding status column to document
282 361
 			if(!$oDB->isColumnExists('documents', 'status'))
@@ -287,8 +366,9 @@  discard block
 block discarded – undo
287 366
 			}
288 367
 
289 368
 			// 2011. 09. 08 drop column document is_secret
290
-			if($oDB->isColumnExists('documents', 'status') && $oDB->isColumnExists('documents', 'is_secret'))
291
-				$oDB->dropColumn('documents', 'is_secret');
369
+			if($oDB->isColumnExists('documents', 'status') && $oDB->isColumnExists('documents', 'is_secret')) {
370
+							$oDB->dropColumn('documents', 'is_secret');
371
+			}
292 372
 
293 373
 			//2011. 06. 07 merge column, allow_comment and lock_comment
294 374
 			if($oDB->isColumnExists('documents', 'allow_comment') || $oDB->isColumnExists('documents', 'lock_comment'))
@@ -313,14 +393,17 @@  discard block
 block discarded – undo
313 393
 				$output = executeQuery('document.updateDocumentCommentStatus', $args);
314 394
 			}
315 395
 
316
-			if($oDB->isColumnExists('documents', 'allow_comment') && $oDB->isColumnExists('documents', 'comment_status'))
317
-				$oDB->dropColumn('documents', 'allow_comment');
396
+			if($oDB->isColumnExists('documents', 'allow_comment') && $oDB->isColumnExists('documents', 'comment_status')) {
397
+							$oDB->dropColumn('documents', 'allow_comment');
398
+			}
318 399
 
319
-			if($oDB->isColumnExists('documents', 'lock_comment') && $oDB->isColumnExists('documents', 'comment_status'))
320
-				$oDB->dropColumn('documents', 'lock_comment');
400
+			if($oDB->isColumnExists('documents', 'lock_comment') && $oDB->isColumnExists('documents', 'comment_status')) {
401
+							$oDB->dropColumn('documents', 'lock_comment');
402
+			}
321 403
 
322
-			if(!$oDB->isIndexExists("documents", "idx_module_status"))
323
-				$oDB->addIndex("documents", "idx_module_status", array("module_srl","status"));
404
+			if(!$oDB->isIndexExists("documents", "idx_module_status")) {
405
+							$oDB->addIndex("documents", "idx_module_status", array("module_srl","status"));
406
+			}
324 407
 
325 408
 			// 2012. 02. 27 Add a trigger to copy extra keys when the module is copied 
326 409
 			if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after'))
@@ -376,8 +459,11 @@  discard block
 block discarded – undo
376 459
 	 */
377 460
 	function getConfigStatus($key)
378 461
 	{
379
-		if(array_key_exists(strtolower($key), $this->statusList)) return $this->statusList[$key];
380
-		else $this->getDefaultStatus();
462
+		if(array_key_exists(strtolower($key), $this->statusList)) {
463
+			return $this->statusList[$key];
464
+		} else {
465
+			$this->getDefaultStatus();
466
+		}
381 467
 	}
382 468
 }
383 469
 /* End of file document.class.php */
Please login to merge, or discard this patch.
modules/board/board.class.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 class board extends ModuleObject
11 11
 {
12
-	var $search_option = array('title_content','title','content','comment','user_name','nick_name','user_id','tag'); ///< 검색 옵션
12
+	var $search_option = array('title_content', 'title', 'content', 'comment', 'user_name', 'nick_name', 'user_id', 'tag'); ///< 검색 옵션
13 13
 
14 14
 	var $order_target = array('list_order', 'update_order', 'regdate', 'voted_count', 'blamed_count', 'readed_count', 'comment_count', 'title', 'nick_name', 'user_name', 'user_id'); // 정렬 옵션
15 15
 
@@ -25,14 +25,14 @@  discard block
 block discarded – undo
25 25
 	 */
26 26
 	function board()
27 27
 	{
28
-		if(!Context::isInstalled()) return;
28
+		if (!Context::isInstalled()) return;
29 29
 
30
-		if(!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional')
30
+		if (!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional')
31 31
 		{
32 32
 			$ssl_actions = array('dispBoardWrite', 'dispBoardWriteComment', 'dispBoardReplyComment', 'dispBoardModifyComment', 'dispBoardDelete', 'dispBoardDeleteComment', 'procBoardInsertDocument', 'procBoardDeleteDocument', 'procBoardInsertComment', 'procBoardDeleteComment', 'procBoardVerificationPassword');
33 33
 			Context::addSSLActions($ssl_actions);
34 34
 		}
35
-		if(!Context::isExistsSSLAction('dispTempSavedList') && Context::getSslStatus() == 'optional')
35
+		if (!Context::isExistsSSLAction('dispTempSavedList') && Context::getSslStatus() == 'optional')
36 36
 		{
37 37
 			Context::addSSLAction('dispTempSavedList');
38 38
 		}
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 		$args = new stdClass;
55 55
 		$args->site_srl = 0;
56 56
 		$output = executeQuery('module.getSite', $args);
57
-		if(!$output->data->index_module_srl)
57
+		if (!$output->data->index_module_srl)
58 58
 		{
59 59
 			$args->mid = 'board';
60 60
 			$args->module = 'board';
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 			$args->site_srl = 0;
64 64
 			$output = $oModuleController->insertModule($args);
65 65
 
66
-			if($output->toBool())
66
+			if ($output->toBool())
67 67
 			{
68 68
 				$module_srl = $output->get('module_srl');
69 69
 
@@ -87,13 +87,13 @@  discard block
 block discarded – undo
87 87
 		$oModuleModel = getModel('module');
88 88
 		$oModuleController = getController('module');
89 89
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
90
-		if($oModuleModel->needUpdate($version_update_id))
90
+		if ($oModuleModel->needUpdate($version_update_id))
91 91
 		{
92 92
 			// 2007. 10. 17 get the member menu trigger
93
-			if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true;
93
+			if (!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true;
94 94
 
95 95
 			// 2011. 09. 20 when add new menu in sitemap, custom menu add
96
-			if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true;
96
+			if (!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true;
97 97
 
98 98
 			$oModuleController->insertUpdatedLog($version_update_id);
99 99
 		}
@@ -109,16 +109,16 @@  discard block
 block discarded – undo
109 109
 		$oModuleModel = getModel('module');
110 110
 		$oModuleController = getController('module');
111 111
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
112
-		if($oModuleModel->needUpdate($version_update_id))
112
+		if ($oModuleModel->needUpdate($version_update_id))
113 113
 		{
114 114
 			// 2007. 10. 17  check the member menu trigger, if it is not existed then insert
115
-			if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after'))
115
+			if (!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after'))
116 116
 			{
117 117
 				$oModuleController->insertTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after');
118 118
 			}
119 119
 
120 120
 			// 2011. 09. 20 when add new menu in sitemap, custom menu add
121
-			if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after'))
121
+			if (!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after'))
122 122
 			{
123 123
 				$oModuleController->insertTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after');
124 124
 			}
@@ -131,12 +131,12 @@  discard block
 block discarded – undo
131 131
 	function moduleUninstall()
132 132
 	{
133 133
 		$output = executeQueryArray("board.getAllBoard");
134
-		if(!$output->data) return new Object();
134
+		if (!$output->data) return new Object();
135 135
 		@set_time_limit(0);
136 136
 
137 137
 		$oModuleController = getController('module');
138 138
 
139
-		foreach($output->data as $board)
139
+		foreach ($output->data as $board)
140 140
 		{
141 141
 			$oModuleController->deleteModule($board->module_srl);
142 142
 		}
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,7 +25,9 @@  discard block
 block discarded – undo
25 25
 	 */
26 26
 	function board()
27 27
 	{
28
-		if(!Context::isInstalled()) return;
28
+		if(!Context::isInstalled()) {
29
+			return;
30
+		}
29 31
 
30 32
 		if(!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional')
31 33
 		{
@@ -90,10 +92,14 @@  discard block
 block discarded – undo
90 92
 		if($oModuleModel->needUpdate($version_update_id))
91 93
 		{
92 94
 			// 2007. 10. 17 get the member menu trigger
93
-			if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true;
95
+			if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) {
96
+				return true;
97
+			}
94 98
 
95 99
 			// 2011. 09. 20 when add new menu in sitemap, custom menu add
96
-			if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true;
100
+			if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) {
101
+				return true;
102
+			}
97 103
 
98 104
 			$oModuleController->insertUpdatedLog($version_update_id);
99 105
 		}
@@ -131,7 +137,9 @@  discard block
 block discarded – undo
131 137
 	function moduleUninstall()
132 138
 	{
133 139
 		$output = executeQueryArray("board.getAllBoard");
134
-		if(!$output->data) return new Object();
140
+		if(!$output->data) {
141
+			return new Object();
142
+		}
135 143
 		@set_time_limit(0);
136 144
 
137 145
 		$oModuleController = getController('module');
Please login to merge, or discard this patch.
modules/counter/counter.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -38,14 +38,14 @@  discard block
 block discarded – undo
38 38
 		$oModuleModel = getModel('module');
39 39
 		$oModuleController = getController('module');
40 40
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
41
-		if($oModuleModel->needUpdate($version_update_id))
41
+		if ($oModuleModel->needUpdate($version_update_id))
42 42
 		{
43
-			if(!$oDB->isColumnExists('counter_log', 'site_srl'))
43
+			if (!$oDB->isColumnExists('counter_log', 'site_srl'))
44 44
 			{
45 45
 				return TRUE;
46 46
 			}
47 47
 
48
-			if(!$oDB->isIndexExists('counter_log', 'idx_site_counter_log'))
48
+			if (!$oDB->isIndexExists('counter_log', 'idx_site_counter_log'))
49 49
 			{
50 50
 				return TRUE;
51 51
 			}
@@ -69,14 +69,14 @@  discard block
 block discarded – undo
69 69
 		$oModuleModel = getModel('module');
70 70
 		$oModuleController = getController('module');
71 71
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
72
-		if($oModuleModel->needUpdate($version_update_id))
72
+		if ($oModuleModel->needUpdate($version_update_id))
73 73
 		{
74
-			if(!$oDB->isColumnExists('counter_log', 'site_srl'))
74
+			if (!$oDB->isColumnExists('counter_log', 'site_srl'))
75 75
 			{
76 76
 				$oDB->addColumn('counter_log', 'site_srl', 'number', 11, 0, TRUE);
77 77
 			}
78 78
 
79
-			if(!$oDB->isIndexExists('counter_log', 'idx_site_counter_log'))
79
+			if (!$oDB->isIndexExists('counter_log', 'idx_site_counter_log'))
80 80
 			{
81 81
 				$oDB->addIndex('counter_log', 'idx_site_counter_log', array('site_srl', 'ipaddress'), FALSE);
82 82
 			}
Please login to merge, or discard this patch.
modules/page/page.class.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -26,13 +26,13 @@  discard block
 block discarded – undo
26 26
 		$oModuleModel = getModel('module');
27 27
 		$oModuleController = getController('module');
28 28
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
29
-		if($oModuleModel->needUpdate($version_update_id))
29
+		if ($oModuleModel->needUpdate($version_update_id))
30 30
 		{
31 31
 			$output = executeQuery('page.pageTypeOpageCheck');
32
-			if($output->toBool() && $output->data) return true;
32
+			if ($output->toBool() && $output->data) return true;
33 33
 
34 34
 			$output = executeQuery('page.pageTypeNullCheck');
35
-			if($output->toBool() && $output->data) return true;
35
+			if ($output->toBool() && $output->data) return true;
36 36
 
37 37
 			$oModuleController->insertUpdatedLog($version_update_id);
38 38
 		}
@@ -48,44 +48,44 @@  discard block
 block discarded – undo
48 48
 		$oModuleModel = getModel('module');
49 49
 		$oModuleController = getController('module');
50 50
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
51
-		if($oModuleModel->needUpdate($version_update_id))
51
+		if ($oModuleModel->needUpdate($version_update_id))
52 52
 		{
53 53
 			$args = new stdClass;
54 54
 			// opage module instance update
55 55
 			$output = executeQueryArray('page.pageTypeOpageCheck');
56
-			if($output->toBool() && count($output->data) > 0)
56
+			if ($output->toBool() && count($output->data) > 0)
57 57
 			{
58
-				foreach($output->data as $val)
58
+				foreach ($output->data as $val)
59 59
 				{
60 60
 					$args->module_srl = $val->module_srl;
61 61
 					$args->name = 'page_type';
62
-					$args->value= 'OUTSIDE';
62
+					$args->value = 'OUTSIDE';
63 63
 					$in_out = executeQuery('page.insertPageType', $args);
64 64
 				}
65 65
 				$output = executeQuery('page.updateAllOpage');
66
-				if(!$output->toBool()) return $output;
66
+				if (!$output->toBool()) return $output;
67 67
 			}
68 68
 
69 69
 			// old page module instance update
70 70
 			$output = executeQueryArray('page.pageTypeNullCheck');
71 71
 			$skin_update_srls = array();
72
-			if($output->toBool() && $output->data)
72
+			if ($output->toBool() && $output->data)
73 73
 			{
74
-				foreach($output->data as $val)
74
+				foreach ($output->data as $val)
75 75
 				{
76 76
 					$args->module_srl = $val->module_srl;
77 77
 					$args->name = 'page_type';
78
-					$args->value= 'WIDGET';
78
+					$args->value = 'WIDGET';
79 79
 					$in_out = executeQuery('page.insertPageType', $args);
80 80
 
81 81
 					$skin_update_srls[] = $val->module_srl;
82 82
 				}
83 83
 			}
84 84
 
85
-			if(count($skin_update_srls)>0)
85
+			if (count($skin_update_srls) > 0)
86 86
 			{
87 87
 				$skin_args = new stdClass;
88
-				$skin_args->module_srls = implode(',',$skin_update_srls);
88
+				$skin_args->module_srls = implode(',', $skin_update_srls);
89 89
 				$skin_args->is_skin_fix = "Y";
90 90
 				$ouput = executeQuery('page.updateSkinFix', $skin_args);
91 91
 			}
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 			$oModuleController->insertUpdatedLog($version_update_id);
94 94
 		}
95 95
 
96
-		return new Object(0,'success_updated');
96
+		return new Object(0, 'success_updated');
97 97
 	}
98 98
 
99 99
 	/**
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,10 +29,14 @@  discard block
 block discarded – undo
29 29
 		if($oModuleModel->needUpdate($version_update_id))
30 30
 		{
31 31
 			$output = executeQuery('page.pageTypeOpageCheck');
32
-			if($output->toBool() && $output->data) return true;
32
+			if($output->toBool() && $output->data) {
33
+				return true;
34
+			}
33 35
 
34 36
 			$output = executeQuery('page.pageTypeNullCheck');
35
-			if($output->toBool() && $output->data) return true;
37
+			if($output->toBool() && $output->data) {
38
+				return true;
39
+			}
36 40
 
37 41
 			$oModuleController->insertUpdatedLog($version_update_id);
38 42
 		}
@@ -63,7 +67,9 @@  discard block
 block discarded – undo
63 67
 					$in_out = executeQuery('page.insertPageType', $args);
64 68
 				}
65 69
 				$output = executeQuery('page.updateAllOpage');
66
-				if(!$output->toBool()) return $output;
70
+				if(!$output->toBool()) {
71
+					return $output;
72
+				}
67 73
 			}
68 74
 
69 75
 			// old page module instance update
Please login to merge, or discard this patch.
modules/module/module.class.php 2 patches
Spacing   +111 added lines, -111 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 		$oModuleController = getController('module');
17 17
 
18 18
 		$oDB = &DB::getInstance();
19
-		$oDB->addIndex("modules","idx_site_mid", array("site_srl","mid"), true);
20
-		$oDB->addIndex('sites','unique_domain',array('domain'),true);
19
+		$oDB->addIndex("modules", "idx_site_mid", array("site_srl", "mid"), true);
20
+		$oDB->addIndex('sites', 'unique_domain', array('domain'), true);
21 21
 		// Create a directory to use in the module module
22 22
 		FileHandler::makeDir('./files/cache/module_info');
23 23
 		FileHandler::makeDir('./files/cache/triggers');
@@ -27,21 +27,21 @@  discard block
 block discarded – undo
27 27
 		$args = new stdClass;
28 28
 		$args->site_srl = 0;
29 29
 		$output = $oDB->executeQuery('module.getSite', $args);
30
-		if(!$output->data || !$output->data->index_module_srl)
30
+		if (!$output->data || !$output->data->index_module_srl)
31 31
 		{
32 32
 			$db_info = Context::getDBInfo();
33 33
 			$domain = Context::getDefaultUrl();
34 34
 			$url_info = parse_url($domain);
35
-			$domain = $url_info['host'].( (!empty($url_info['port'])&&$url_info['port']!=80)?':'.$url_info['port']:'').$url_info['path'];
35
+			$domain = $url_info['host'].((!empty($url_info['port']) && $url_info['port'] != 80) ? ':'.$url_info['port'] : '').$url_info['path'];
36 36
 
37 37
 			$site_args = new stdClass;
38 38
 			$site_args->site_srl = 0;
39
-			$site_args->index_module_srl  = 0;
39
+			$site_args->index_module_srl = 0;
40 40
 			$site_args->domain = $domain;
41 41
 			$site_args->default_language = $db_info->lang_type;
42 42
 
43 43
 			$output = executeQuery('module.insertSite', $site_args);
44
-			if(!$output->toBool()) return $output;
44
+			if (!$output->toBool()) return $output;
45 45
 		}
46 46
 
47 47
 		return new Object();
@@ -56,66 +56,66 @@  discard block
 block discarded – undo
56 56
 		$oModuleModel = getModel('module');
57 57
 		$oModuleController = getController('module');
58 58
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
59
-		if($oModuleModel->needUpdate($version_update_id))
59
+		if ($oModuleModel->needUpdate($version_update_id))
60 60
 		{
61 61
 			// 2008. 10. 27 Add multi-index in the table, the module_part_config
62
-			if(!$oDB->isIndexExists("module_part_config","idx_module_part_config")) return true;
62
+			if (!$oDB->isIndexExists("module_part_config", "idx_module_part_config")) return true;
63 63
 			// 2008. 11. 13 Delete unique constraint on mid in modules. Add site_srl and then create unique index on site_srl and mid
64
-			if(!$oDB->isIndexExists('modules',"idx_site_mid")) return true;
64
+			if (!$oDB->isIndexExists('modules', "idx_site_mid")) return true;
65 65
 			// Move permissions/skin information of all modules to the table, grants.
66
-			if($oDB->isColumnExists('modules', 'grants')) return true;
66
+			if ($oDB->isColumnExists('modules', 'grants')) return true;
67 67
 			// Move permissions/skin information of all modules to the table, grants.
68
-			if(!$oDB->isColumnExists('sites', 'default_language')) return true;
68
+			if (!$oDB->isColumnExists('sites', 'default_language')) return true;
69 69
 			// Delete extra_vars* column
70
-			for($i=1;$i<=20;$i++)
70
+			for ($i = 1; $i <= 20; $i++)
71 71
 			{
72
-				if($oDB->isColumnExists("documents","extra_vars".$i)) return true;
72
+				if ($oDB->isColumnExists("documents", "extra_vars".$i)) return true;
73 73
 			}
74 74
 			// Insert site information to the table, sites
75 75
 			$args = new stdClass();
76 76
 			$args->site_srl = 0;
77 77
 			$output = $oDB->executeQuery('module.getSite', $args);
78
-			if(!$output->data) return true;
78
+			if (!$output->data) return true;
79 79
 
80 80
 			// If domain index is defined on the table, sites
81
-			if($oDB->isIndexExists('sites', 'idx_domain')) return true;
82
-			if(!$oDB->isIndexExists('sites','unique_domain')) return true;
81
+			if ($oDB->isIndexExists('sites', 'idx_domain')) return true;
82
+			if (!$oDB->isIndexExists('sites', 'unique_domain')) return true;
83 83
 
84
-			if(!$oDB->isColumnExists("modules", "use_mobile")) return true;
85
-			if(!$oDB->isColumnExists("modules", "mlayout_srl")) return true;
86
-			if(!$oDB->isColumnExists("modules", "mcontent")) return true;
87
-			if(!$oDB->isColumnExists("modules", "mskin")) return true;
84
+			if (!$oDB->isColumnExists("modules", "use_mobile")) return true;
85
+			if (!$oDB->isColumnExists("modules", "mlayout_srl")) return true;
86
+			if (!$oDB->isColumnExists("modules", "mcontent")) return true;
87
+			if (!$oDB->isColumnExists("modules", "mskin")) return true;
88 88
 
89 89
 			// check fix skin
90
-			if(!$oDB->isColumnExists("modules", "is_skin_fix")) return true;
90
+			if (!$oDB->isColumnExists("modules", "is_skin_fix")) return true;
91 91
 
92
-			if(!$oDB->isColumnExists("module_config", "site_srl")) return true;
92
+			if (!$oDB->isColumnExists("module_config", "site_srl")) return true;
93 93
 
94 94
 			$args->skin = '.';
95 95
 			$output = executeQueryArray('module.getModuleSkinDotList', $args);
96
-			if($output->data && count($output->data) > 0)
96
+			if ($output->data && count($output->data) > 0)
97 97
 			{
98
-				foreach($output->data as $item)
98
+				foreach ($output->data as $item)
99 99
 				{
100 100
 					$skin_path = explode('.', $item->skin);
101
-					if(count($skin_path) != 2) continue;
102
-					if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/modules/%s', $skin_path[0], $skin_path[1]))) return true;
101
+					if (count($skin_path) != 2) continue;
102
+					if (is_dir(sprintf(_XE_PATH_.'themes/%s/modules/%s', $skin_path[0], $skin_path[1]))) return true;
103 103
 				}
104 104
 			}
105 105
 
106 106
 			// XE 1.7
107 107
 
108 108
 			// check fix mskin
109
-			if(!$oDB->isColumnExists("modules", "is_mskin_fix")) return true;
109
+			if (!$oDB->isColumnExists("modules", "is_mskin_fix")) return true;
110 110
 
111 111
 			$oModuleModel = getModel('module');
112 112
 			$moduleConfig = $oModuleModel->getModuleConfig('module');
113
-			if(!$moduleConfig->isUpdateFixedValue) return true;
113
+			if (!$moduleConfig->isUpdateFixedValue) return true;
114 114
 
115 115
 			$oModuleController->insertUpdatedLog($version_update_id);
116 116
 		}
117 117
 
118
-		if(!is_dir('./files/ruleset')) return true;
118
+		if (!is_dir('./files/ruleset')) return true;
119 119
 
120 120
 		return false;
121 121
 	}
@@ -129,22 +129,22 @@  discard block
 block discarded – undo
129 129
 		$oModuleModel = getModel('module');
130 130
 		$oModuleController = getController('module');
131 131
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
132
-		if($oModuleModel->needUpdate($version_update_id))
132
+		if ($oModuleModel->needUpdate($version_update_id))
133 133
 		{
134 134
 			// 2008. 10. 27 module_part_config Add a multi-index to the table and check all information of module_configg
135
-			if(!$oDB->isIndexExists("module_part_config","idx_module_part_config"))
135
+			if (!$oDB->isIndexExists("module_part_config", "idx_module_part_config"))
136 136
 			{
137 137
 				$oModuleModel = getModel('module');
138 138
 				$oModuleController = getController('module');
139 139
 				$modules = $oModuleModel->getModuleList();
140
-				foreach($modules as $key => $module_info)
140
+				foreach ($modules as $key => $module_info)
141 141
 				{
142 142
 					$module = $module_info->module;
143
-					if(!in_array($module, array('point','trackback','layout','rss','file','comment','editor'))) continue;
143
+					if (!in_array($module, array('point', 'trackback', 'layout', 'rss', 'file', 'comment', 'editor'))) continue;
144 144
 					$config = $oModuleModel->getModuleConfig($module);
145 145
 
146 146
 					$module_config = null;
147
-					switch($module)
147
+					switch ($module)
148 148
 					{
149 149
 						case 'point' :
150 150
 							$module_config = $config->module_point;
@@ -157,21 +157,21 @@  discard block
 block discarded – undo
157 157
 						case 'editor' :
158 158
 							$module_config = $config->module_config;
159 159
 							unset($config->module_config);
160
-							if(is_array($module_config) && count($module_config))
160
+							if (is_array($module_config) && count($module_config))
161 161
 							{
162
-								foreach($module_config as $key => $val)
162
+								foreach ($module_config as $key => $val)
163 163
 								{
164
-									if(isset($module_config[$key]->module_srl)) unset($module_config[$key]->module_srl);
164
+									if (isset($module_config[$key]->module_srl)) unset($module_config[$key]->module_srl);
165 165
 								}
166 166
 							}
167 167
 							break;
168 168
 						case 'layout' :
169 169
 							$tmp = $config->header_script;
170
-							if(is_array($tmp) && count($tmp))
170
+							if (is_array($tmp) && count($tmp))
171 171
 							{
172
-								foreach($tmp as $k => $v)
172
+								foreach ($tmp as $k => $v)
173 173
 								{
174
-									if(!$v && !trim($v)) continue;
174
+									if (!$v && !trim($v)) continue;
175 175
 									$module_config[$k]->header_script = $v;
176 176
 								}
177 177
 							}
@@ -181,29 +181,29 @@  discard block
 block discarded – undo
181 181
 
182 182
 					$oModuleController->insertModuleConfig($module, $config);
183 183
 
184
-					if(is_array($module_config) && count($module_config))
184
+					if (is_array($module_config) && count($module_config))
185 185
 					{
186
-						foreach($module_config as $module_srl => $module_part_config)
186
+						foreach ($module_config as $module_srl => $module_part_config)
187 187
 						{
188
-							$oModuleController->insertModulePartConfig($module,$module_srl,$module_part_config);
188
+							$oModuleController->insertModulePartConfig($module, $module_srl, $module_part_config);
189 189
 						}
190 190
 					}
191 191
 				}
192
-				$oDB->addIndex("module_part_config","idx_module_part_config", array("module","module_srl"));
192
+				$oDB->addIndex("module_part_config", "idx_module_part_config", array("module", "module_srl"));
193 193
 			}
194 194
 			// 2008. 11. 13 drop index(unique_mid). Add a column and index on site_srl and mid columns
195
-			if(!$oDB->isIndexExists('modules',"idx_site_mid"))
195
+			if (!$oDB->isIndexExists('modules', "idx_site_mid"))
196 196
 			{
197
-				$oDB->dropIndex("modules","unique_mid",true);
198
-				$oDB->addColumn('modules','site_srl','number',11,0,true);
199
-				$oDB->addIndex("modules","idx_site_mid", array("site_srl","mid"),true);
197
+				$oDB->dropIndex("modules", "unique_mid", true);
198
+				$oDB->addColumn('modules', 'site_srl', 'number', 11, 0, true);
199
+				$oDB->addIndex("modules", "idx_site_mid", array("site_srl", "mid"), true);
200 200
 			}
201 201
 			// document extra vars
202
-			if(!$oDB->isTableExists('document_extra_vars')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_vars.xml');
202
+			if (!$oDB->isTableExists('document_extra_vars')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_vars.xml');
203 203
 
204
-			if(!$oDB->isTableExists('document_extra_keys')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_keys.xml');
204
+			if (!$oDB->isTableExists('document_extra_keys')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_keys.xml');
205 205
 			// Move permission, skin info, extection info, admin ID of all modules to the table, grants
206
-			if($oDB->isColumnExists('modules', 'grants'))
206
+			if ($oDB->isColumnExists('modules', 'grants'))
207 207
 			{
208 208
 				$oModuleController = getController('module');
209 209
 				$oDocumentController = getController('document');
@@ -211,26 +211,26 @@  discard block
 block discarded – undo
211 211
 				$lang_code = Context::getLangType();
212 212
 				// Get module_info of all modules
213 213
 				$output = executeQueryArray('module.getModuleInfos');
214
-				if(count($output->data))
214
+				if (count($output->data))
215 215
 				{
216
-					foreach($output->data as $module_info)
216
+					foreach ($output->data as $module_info)
217 217
 					{
218 218
 						// Separate information about permission granted to the module, extra vars, skin vars, super-admin's authority
219 219
 						$module_srl = trim($module_info->module_srl);
220 220
 						// grant an authority
221 221
 						$grants = unserialize($module_info->grants);
222
-						if($grants) $oModuleController->insertModuleGrants($module_srl, $grants);
222
+						if ($grants) $oModuleController->insertModuleGrants($module_srl, $grants);
223 223
 						// Insert skin vars
224 224
 						$skin_vars = unserialize($module_info->skin_vars);
225
-						if($skin_vars) $oModuleController->insertModuleSkinVars($module_srl, $skin_vars);
225
+						if ($skin_vars) $oModuleController->insertModuleSkinVars($module_srl, $skin_vars);
226 226
 						// Insert super admin's ID
227 227
 						$admin_id = trim($module_info->admin_id);
228
-						if($admin_id && $admin_id != 'Array')
228
+						if ($admin_id && $admin_id != 'Array')
229 229
 						{
230
-							$admin_ids = explode(',',$admin_id);
231
-							if(count($admin_id))
230
+							$admin_ids = explode(',', $admin_id);
231
+							if (count($admin_id))
232 232
 							{
233
-								foreach($admin_ids as $admin_id)
233
+								foreach ($admin_ids as $admin_id)
234 234
 								{
235 235
 									$oModuleController->insertAdminId($module_srl, $admin_id);
236 236
 								}
@@ -239,20 +239,20 @@  discard block
 block discarded – undo
239 239
 						// Save extra configurations for each module(column data which doesn't exist in the defaut modules)
240 240
 						$extra_vars = unserialize($module_info->extra_vars);
241 241
 						$document_extra_keys = null;
242
-						if($extra_vars->extra_vars && count($extra_vars->extra_vars))
242
+						if ($extra_vars->extra_vars && count($extra_vars->extra_vars))
243 243
 						{
244 244
 							$document_extra_keys = $extra_vars->extra_vars;
245 245
 							unset($extra_vars->extra_vars);
246 246
 						}
247
-						if($extra_vars) $oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
247
+						if ($extra_vars) $oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
248 248
 
249 249
 						/**
250 250
 						 * Move document extra vars(it should have conducted in the documents module however extra vars in modules table should be listed up in this module)
251 251
 						 */
252 252
 						// Insert extra vars if planet module is
253
-						if($module_info->module == 'planet')
253
+						if ($module_info->module == 'planet')
254 254
 						{
255
-							if(!$document_extra_keys || !is_array($document_extra_keys)) $document_extra_keys = array();
255
+							if (!$document_extra_keys || !is_array($document_extra_keys)) $document_extra_keys = array();
256 256
 							$planet_extra_keys->name = 'postscript';
257 257
 							$planet_extra_keys->type = 'text';
258 258
 							$planet_extra_keys->is_required = 'N';
@@ -262,9 +262,9 @@  discard block
 block discarded – undo
262 262
 							$document_extra_keys[20] = $planet_extra_keys;
263 263
 						}
264 264
 						// Register keys for document extra vars
265
-						if(count($document_extra_keys))
265
+						if (count($document_extra_keys))
266 266
 						{
267
-							foreach($document_extra_keys as $var_idx => $val)
267
+							foreach ($document_extra_keys as $var_idx => $val)
268 268
 							{
269 269
 								$oDocumentController->insertDocumentExtraKey($module_srl, $var_idx, $val->name, $val->type, $val->is_required, $val->search, $val->default, $val->desc, 'extra_vars'.$var_idx);
270 270
 							}
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 							$oDocumentModel = getModel('document');
273 273
 							$total_count = $oDocumentModel->getDocumentCount($module_srl);
274 274
 
275
-							if($total_count > 0)
275
+							if ($total_count > 0)
276 276
 							{
277 277
 								$per_page = 100;
278 278
 								$total_pages = (int) (($total_count - 1) / $per_page) + 1;
@@ -283,19 +283,19 @@  discard block
 block discarded – undo
283 283
 								$doc_args->sort_index = 'list_order';
284 284
 								$doc_args->order_type = 'asc';
285 285
 
286
-								for($doc_args->page = 1; $doc_args->page <= $total_pages; $doc_args->page++)
286
+								for ($doc_args->page = 1; $doc_args->page <= $total_pages; $doc_args->page++)
287 287
 								{
288 288
 									$output = executeQueryArray('document.getDocumentList', $doc_args);
289 289
 
290
-									if($output->toBool() && $output->data && count($output->data))
290
+									if ($output->toBool() && $output->data && count($output->data))
291 291
 									{
292 292
 										foreach ($output->data as $document)
293 293
 										{
294
-											if(!$document) continue;
294
+											if (!$document) continue;
295 295
 											foreach ($document as $key => $var)
296 296
 											{
297 297
 												if (strpos($key, 'extra_vars') !== 0 || !trim($var) || $var == 'N;') continue;
298
-												$var_idx = str_replace('extra_vars','',$key);
298
+												$var_idx = str_replace('extra_vars', '', $key);
299 299
 												$oDocumentController->insertDocumentExtraVar($module_srl, $document->document_srl, $var_idx, $var, 'extra_vars'.$var_idx, $lang_code);
300 300
 											}
301 301
 										}
@@ -311,96 +311,96 @@  discard block
 block discarded – undo
311 311
 						executeQuery('module.updateModule', $module_info);
312 312
 
313 313
 						$oCacheHandler = CacheHandler::getInstance('object', null, true);
314
-						if($oCacheHandler->isSupport())
314
+						if ($oCacheHandler->isSupport())
315 315
 						{
316 316
 							$oCacheHandler->invalidateGroupKey('site_and_module');
317 317
 						}
318 318
 					}
319 319
 				}
320 320
 				// Various column drop
321
-				$oDB->dropColumn('modules','grants');
322
-				$oDB->dropColumn('modules','admin_id');
323
-				$oDB->dropColumn('modules','skin_vars');
324
-				$oDB->dropColumn('modules','extra_vars');
321
+				$oDB->dropColumn('modules', 'grants');
322
+				$oDB->dropColumn('modules', 'admin_id');
323
+				$oDB->dropColumn('modules', 'skin_vars');
324
+				$oDB->dropColumn('modules', 'extra_vars');
325 325
 			}
326 326
 			// Rights of all modules/skins transferring the information into a table Update grants
327
-			if(!$oDB->isColumnExists('sites', 'default_language'))
327
+			if (!$oDB->isColumnExists('sites', 'default_language'))
328 328
 			{
329
-				$oDB->addColumn('sites','default_language','varchar',255,0,false);
329
+				$oDB->addColumn('sites', 'default_language', 'varchar', 255, 0, false);
330 330
 			}
331 331
 			// extra_vars * Remove Column
332
-			for($i=1;$i<=20;$i++)
332
+			for ($i = 1; $i <= 20; $i++)
333 333
 			{
334
-				if(!$oDB->isColumnExists("documents","extra_vars".$i)) continue;
335
-				$oDB->dropColumn('documents','extra_vars'.$i);
334
+				if (!$oDB->isColumnExists("documents", "extra_vars".$i)) continue;
335
+				$oDB->dropColumn('documents', 'extra_vars'.$i);
336 336
 			}
337 337
 
338 338
 			// Enter the main site information sites on the table
339 339
 			$args = new stdClass;
340 340
 			$args->site_srl = 0;
341 341
 			$output = $oDB->executeQuery('module.getSite', $args);
342
-			if(!$output->data)
342
+			if (!$output->data)
343 343
 			{
344 344
 				// Basic mid, language Wanted
345 345
 				$mid_output = $oDB->executeQuery('module.getDefaultMidInfo', $args);
346 346
 				$db_info = Context::getDBInfo();
347 347
 				$domain = Context::getDefaultUrl();
348 348
 				$url_info = parse_url($domain);
349
-				$domain = $url_info['host'].( (!empty($url_info['port'])&&$url_info['port']!=80)?':'.$url_info['port']:'').$url_info['path'];
349
+				$domain = $url_info['host'].((!empty($url_info['port']) && $url_info['port'] != 80) ? ':'.$url_info['port'] : '').$url_info['path'];
350 350
 				$site_args->site_srl = 0;
351
-				$site_args->index_module_srl  = $mid_output->data->module_srl;
351
+				$site_args->index_module_srl = $mid_output->data->module_srl;
352 352
 				$site_args->domain = $domain;
353 353
 				$site_args->default_language = $db_info->lang_type;
354 354
 
355 355
 				$output = executeQuery('module.insertSite', $site_args);
356
-				if(!$output->toBool()) return $output;
356
+				if (!$output->toBool()) return $output;
357 357
 			}
358 358
 
359
-			if($oDB->isIndexExists('sites','idx_domain'))
359
+			if ($oDB->isIndexExists('sites', 'idx_domain'))
360 360
 			{
361
-				$oDB->dropIndex('sites','idx_domain');
361
+				$oDB->dropIndex('sites', 'idx_domain');
362 362
 			}
363
-			if(!$oDB->isIndexExists('sites','unique_domain'))
363
+			if (!$oDB->isIndexExists('sites', 'unique_domain'))
364 364
 			{
365 365
 				$this->updateForUniqueSiteDomain();
366
-				$oDB->addIndex('sites','unique_domain',array('domain'),true);
366
+				$oDB->addIndex('sites', 'unique_domain', array('domain'), true);
367 367
 			}
368 368
 
369
-			if(!$oDB->isColumnExists("modules", "use_mobile"))
369
+			if (!$oDB->isColumnExists("modules", "use_mobile"))
370 370
 			{
371
-				$oDB->addColumn('modules','use_mobile','char',1,'N');
371
+				$oDB->addColumn('modules', 'use_mobile', 'char', 1, 'N');
372 372
 			}
373
-			if(!$oDB->isColumnExists("modules", "mlayout_srl"))
373
+			if (!$oDB->isColumnExists("modules", "mlayout_srl"))
374 374
 			{
375
-				$oDB->addColumn('modules','mlayout_srl','number',11, 0);
375
+				$oDB->addColumn('modules', 'mlayout_srl', 'number', 11, 0);
376 376
 			}
377
-			if(!$oDB->isColumnExists("modules", "mcontent"))
377
+			if (!$oDB->isColumnExists("modules", "mcontent"))
378 378
 			{
379
-				$oDB->addColumn('modules','mcontent','bigtext');
379
+				$oDB->addColumn('modules', 'mcontent', 'bigtext');
380 380
 			}
381
-			if(!$oDB->isColumnExists("modules", "mskin"))
381
+			if (!$oDB->isColumnExists("modules", "mskin"))
382 382
 			{
383
-				$oDB->addColumn('modules','mskin','varchar',250);
383
+				$oDB->addColumn('modules', 'mskin', 'varchar', 250);
384 384
 			}
385
-			if(!$oDB->isColumnExists("modules", "is_skin_fix"))
385
+			if (!$oDB->isColumnExists("modules", "is_skin_fix"))
386 386
 			{
387 387
 				$oDB->addColumn('modules', 'is_skin_fix', 'char', 1, 'N');
388 388
 				$output = executeQuery('module.updateSkinFixModules');
389 389
 			}
390
-			if(!$oDB->isColumnExists("module_config", "site_srl"))
390
+			if (!$oDB->isColumnExists("module_config", "site_srl"))
391 391
 			{
392 392
 				$oDB->addColumn('module_config', 'site_srl', 'number', 11, 0, true);
393 393
 			}
394 394
 
395 395
 			$args->skin = '.';
396 396
 			$output = executeQueryArray('module.getModuleSkinDotList', $args);
397
-			if($output->data && count($output->data) > 0)
397
+			if ($output->data && count($output->data) > 0)
398 398
 			{
399
-				foreach($output->data as $item)
399
+				foreach ($output->data as $item)
400 400
 				{
401 401
 					$skin_path = explode('.', $item->skin);
402
-					if(count($skin_path) != 2) continue;
403
-					if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/modules/%s', $skin_path[0], $skin_path[1])))
402
+					if (count($skin_path) != 2) continue;
403
+					if (is_dir(sprintf(_XE_PATH_.'themes/%s/modules/%s', $skin_path[0], $skin_path[1])))
404 404
 					{
405 405
 						unset($args);
406 406
 						$args->skin = $item->skin;
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 			}
412 412
 
413 413
 			// XE 1.7
414
-			if(!$oDB->isColumnExists("modules", "is_mskin_fix"))
414
+			if (!$oDB->isColumnExists("modules", "is_mskin_fix"))
415 415
 			{
416 416
 				$oDB->addColumn('modules', 'is_mskin_fix', 'char', 1, 'N');
417 417
 				$output = executeQuery('module.updateMobileSkinFixModules');
@@ -419,13 +419,13 @@  discard block
 block discarded – undo
419 419
 
420 420
 			$oModuleModel = getModel('module');
421 421
 			$moduleConfig = $oModuleModel->getModuleConfig('module');
422
-			if(!$moduleConfig->isUpdateFixedValue)
422
+			if (!$moduleConfig->isUpdateFixedValue)
423 423
 			{
424 424
 				$output = executeQuery('module.updateSkinFixModules');
425 425
 				$output = executeQuery('module.updateMobileSkinFixModules');
426 426
 
427 427
 				$oModuleController = getController('module');
428
-				if(!$moduleConfig) $moduleConfig = new stdClass;
428
+				if (!$moduleConfig) $moduleConfig = new stdClass;
429 429
 				$moduleConfig->isUpdateFixedValue = TRUE;
430 430
 				$output = $oModuleController->updateModuleConfig('module', $moduleConfig);
431 431
 			}
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 			$oModuleController->insertUpdatedLog($version_update_id);
434 434
 		}
435 435
 
436
-		if(!is_dir('./files/ruleset')) FileHandler::makeDir('./files/ruleset');
436
+		if (!is_dir('./files/ruleset')) FileHandler::makeDir('./files/ruleset');
437 437
 
438 438
 		return new Object(0, 'success_updated');
439 439
 	}
@@ -441,18 +441,18 @@  discard block
 block discarded – undo
441 441
 	function updateForUniqueSiteDomain()
442 442
 	{
443 443
 		$output = executeQueryArray("module.getNonuniqueDomains");
444
-		if(!$output->data) return;
445
-		foreach($output->data as $data)
444
+		if (!$output->data) return;
445
+		foreach ($output->data as $data)
446 446
 		{
447
-			if($data->count == 1) continue;
447
+			if ($data->count == 1) continue;
448 448
 			$domain = $data->domain;
449 449
 			$args = new stdClass;
450 450
 			$args->domain = $domain;
451 451
 			$output2 = executeQueryArray("module.getSiteByDomain", $args);
452 452
 			$bFirst = true;
453
-			foreach($output2->data as $site)
453
+			foreach ($output2->data as $site)
454 454
 			{
455
-				if($bFirst)
455
+				if ($bFirst)
456 456
 				{
457 457
 					$bFirst = false;
458 458
 					continue;
Please login to merge, or discard this patch.
Braces   +114 added lines, -38 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@  discard block
 block discarded – undo
41 41
 			$site_args->default_language = $db_info->lang_type;
42 42
 
43 43
 			$output = executeQuery('module.insertSite', $site_args);
44
-			if(!$output->toBool()) return $output;
44
+			if(!$output->toBool()) {
45
+				return $output;
46
+			}
45 47
 		}
46 48
 
47 49
 		return new Object();
@@ -59,37 +61,65 @@  discard block
 block discarded – undo
59 61
 		if($oModuleModel->needUpdate($version_update_id))
60 62
 		{
61 63
 			// 2008. 10. 27 Add multi-index in the table, the module_part_config
62
-			if(!$oDB->isIndexExists("module_part_config","idx_module_part_config")) return true;
64
+			if(!$oDB->isIndexExists("module_part_config","idx_module_part_config")) {
65
+				return true;
66
+			}
63 67
 			// 2008. 11. 13 Delete unique constraint on mid in modules. Add site_srl and then create unique index on site_srl and mid
64
-			if(!$oDB->isIndexExists('modules',"idx_site_mid")) return true;
68
+			if(!$oDB->isIndexExists('modules',"idx_site_mid")) {
69
+				return true;
70
+			}
65 71
 			// Move permissions/skin information of all modules to the table, grants.
66
-			if($oDB->isColumnExists('modules', 'grants')) return true;
72
+			if($oDB->isColumnExists('modules', 'grants')) {
73
+				return true;
74
+			}
67 75
 			// Move permissions/skin information of all modules to the table, grants.
68
-			if(!$oDB->isColumnExists('sites', 'default_language')) return true;
76
+			if(!$oDB->isColumnExists('sites', 'default_language')) {
77
+				return true;
78
+			}
69 79
 			// Delete extra_vars* column
70 80
 			for($i=1;$i<=20;$i++)
71 81
 			{
72
-				if($oDB->isColumnExists("documents","extra_vars".$i)) return true;
82
+				if($oDB->isColumnExists("documents","extra_vars".$i)) {
83
+					return true;
84
+				}
73 85
 			}
74 86
 			// Insert site information to the table, sites
75 87
 			$args = new stdClass();
76 88
 			$args->site_srl = 0;
77 89
 			$output = $oDB->executeQuery('module.getSite', $args);
78
-			if(!$output->data) return true;
90
+			if(!$output->data) {
91
+				return true;
92
+			}
79 93
 
80 94
 			// If domain index is defined on the table, sites
81
-			if($oDB->isIndexExists('sites', 'idx_domain')) return true;
82
-			if(!$oDB->isIndexExists('sites','unique_domain')) return true;
95
+			if($oDB->isIndexExists('sites', 'idx_domain')) {
96
+				return true;
97
+			}
98
+			if(!$oDB->isIndexExists('sites','unique_domain')) {
99
+				return true;
100
+			}
83 101
 
84
-			if(!$oDB->isColumnExists("modules", "use_mobile")) return true;
85
-			if(!$oDB->isColumnExists("modules", "mlayout_srl")) return true;
86
-			if(!$oDB->isColumnExists("modules", "mcontent")) return true;
87
-			if(!$oDB->isColumnExists("modules", "mskin")) return true;
102
+			if(!$oDB->isColumnExists("modules", "use_mobile")) {
103
+				return true;
104
+			}
105
+			if(!$oDB->isColumnExists("modules", "mlayout_srl")) {
106
+				return true;
107
+			}
108
+			if(!$oDB->isColumnExists("modules", "mcontent")) {
109
+				return true;
110
+			}
111
+			if(!$oDB->isColumnExists("modules", "mskin")) {
112
+				return true;
113
+			}
88 114
 
89 115
 			// check fix skin
90
-			if(!$oDB->isColumnExists("modules", "is_skin_fix")) return true;
116
+			if(!$oDB->isColumnExists("modules", "is_skin_fix")) {
117
+				return true;
118
+			}
91 119
 
92
-			if(!$oDB->isColumnExists("module_config", "site_srl")) return true;
120
+			if(!$oDB->isColumnExists("module_config", "site_srl")) {
121
+				return true;
122
+			}
93 123
 
94 124
 			$args->skin = '.';
95 125
 			$output = executeQueryArray('module.getModuleSkinDotList', $args);
@@ -98,24 +128,34 @@  discard block
 block discarded – undo
98 128
 				foreach($output->data as $item)
99 129
 				{
100 130
 					$skin_path = explode('.', $item->skin);
101
-					if(count($skin_path) != 2) continue;
102
-					if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/modules/%s', $skin_path[0], $skin_path[1]))) return true;
131
+					if(count($skin_path) != 2) {
132
+						continue;
133
+					}
134
+					if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/modules/%s', $skin_path[0], $skin_path[1]))) {
135
+						return true;
136
+					}
103 137
 				}
104 138
 			}
105 139
 
106 140
 			// XE 1.7
107 141
 
108 142
 			// check fix mskin
109
-			if(!$oDB->isColumnExists("modules", "is_mskin_fix")) return true;
143
+			if(!$oDB->isColumnExists("modules", "is_mskin_fix")) {
144
+				return true;
145
+			}
110 146
 
111 147
 			$oModuleModel = getModel('module');
112 148
 			$moduleConfig = $oModuleModel->getModuleConfig('module');
113
-			if(!$moduleConfig->isUpdateFixedValue) return true;
149
+			if(!$moduleConfig->isUpdateFixedValue) {
150
+				return true;
151
+			}
114 152
 
115 153
 			$oModuleController->insertUpdatedLog($version_update_id);
116 154
 		}
117 155
 
118
-		if(!is_dir('./files/ruleset')) return true;
156
+		if(!is_dir('./files/ruleset')) {
157
+			return true;
158
+		}
119 159
 
120 160
 		return false;
121 161
 	}
@@ -140,7 +180,9 @@  discard block
 block discarded – undo
140 180
 				foreach($modules as $key => $module_info)
141 181
 				{
142 182
 					$module = $module_info->module;
143
-					if(!in_array($module, array('point','trackback','layout','rss','file','comment','editor'))) continue;
183
+					if(!in_array($module, array('point','trackback','layout','rss','file','comment','editor'))) {
184
+						continue;
185
+					}
144 186
 					$config = $oModuleModel->getModuleConfig($module);
145 187
 
146 188
 					$module_config = null;
@@ -161,7 +203,9 @@  discard block
 block discarded – undo
161 203
 							{
162 204
 								foreach($module_config as $key => $val)
163 205
 								{
164
-									if(isset($module_config[$key]->module_srl)) unset($module_config[$key]->module_srl);
206
+									if(isset($module_config[$key]->module_srl)) {
207
+										unset($module_config[$key]->module_srl);
208
+									}
165 209
 								}
166 210
 							}
167 211
 							break;
@@ -171,7 +215,9 @@  discard block
 block discarded – undo
171 215
 							{
172 216
 								foreach($tmp as $k => $v)
173 217
 								{
174
-									if(!$v && !trim($v)) continue;
218
+									if(!$v && !trim($v)) {
219
+										continue;
220
+									}
175 221
 									$module_config[$k]->header_script = $v;
176 222
 								}
177 223
 							}
@@ -199,9 +245,13 @@  discard block
 block discarded – undo
199 245
 				$oDB->addIndex("modules","idx_site_mid", array("site_srl","mid"),true);
200 246
 			}
201 247
 			// document extra vars
202
-			if(!$oDB->isTableExists('document_extra_vars')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_vars.xml');
248
+			if(!$oDB->isTableExists('document_extra_vars')) {
249
+				$oDB->createTableByXmlFile('./modules/document/schemas/document_extra_vars.xml');
250
+			}
203 251
 
204
-			if(!$oDB->isTableExists('document_extra_keys')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_keys.xml');
252
+			if(!$oDB->isTableExists('document_extra_keys')) {
253
+				$oDB->createTableByXmlFile('./modules/document/schemas/document_extra_keys.xml');
254
+			}
205 255
 			// Move permission, skin info, extection info, admin ID of all modules to the table, grants
206 256
 			if($oDB->isColumnExists('modules', 'grants'))
207 257
 			{
@@ -219,10 +269,14 @@  discard block
 block discarded – undo
219 269
 						$module_srl = trim($module_info->module_srl);
220 270
 						// grant an authority
221 271
 						$grants = unserialize($module_info->grants);
222
-						if($grants) $oModuleController->insertModuleGrants($module_srl, $grants);
272
+						if($grants) {
273
+							$oModuleController->insertModuleGrants($module_srl, $grants);
274
+						}
223 275
 						// Insert skin vars
224 276
 						$skin_vars = unserialize($module_info->skin_vars);
225
-						if($skin_vars) $oModuleController->insertModuleSkinVars($module_srl, $skin_vars);
277
+						if($skin_vars) {
278
+							$oModuleController->insertModuleSkinVars($module_srl, $skin_vars);
279
+						}
226 280
 						// Insert super admin's ID
227 281
 						$admin_id = trim($module_info->admin_id);
228 282
 						if($admin_id && $admin_id != 'Array')
@@ -244,7 +298,9 @@  discard block
 block discarded – undo
244 298
 							$document_extra_keys = $extra_vars->extra_vars;
245 299
 							unset($extra_vars->extra_vars);
246 300
 						}
247
-						if($extra_vars) $oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
301
+						if($extra_vars) {
302
+							$oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
303
+						}
248 304
 
249 305
 						/**
250 306
 						 * Move document extra vars(it should have conducted in the documents module however extra vars in modules table should be listed up in this module)
@@ -252,7 +308,9 @@  discard block
 block discarded – undo
252 308
 						// Insert extra vars if planet module is
253 309
 						if($module_info->module == 'planet')
254 310
 						{
255
-							if(!$document_extra_keys || !is_array($document_extra_keys)) $document_extra_keys = array();
311
+							if(!$document_extra_keys || !is_array($document_extra_keys)) {
312
+								$document_extra_keys = array();
313
+							}
256 314
 							$planet_extra_keys->name = 'postscript';
257 315
 							$planet_extra_keys->type = 'text';
258 316
 							$planet_extra_keys->is_required = 'N';
@@ -291,10 +349,14 @@  discard block
 block discarded – undo
291 349
 									{
292 350
 										foreach ($output->data as $document)
293 351
 										{
294
-											if(!$document) continue;
352
+											if(!$document) {
353
+												continue;
354
+											}
295 355
 											foreach ($document as $key => $var)
296 356
 											{
297
-												if (strpos($key, 'extra_vars') !== 0 || !trim($var) || $var == 'N;') continue;
357
+												if (strpos($key, 'extra_vars') !== 0 || !trim($var) || $var == 'N;') {
358
+													continue;
359
+												}
298 360
 												$var_idx = str_replace('extra_vars','',$key);
299 361
 												$oDocumentController->insertDocumentExtraVar($module_srl, $document->document_srl, $var_idx, $var, 'extra_vars'.$var_idx, $lang_code);
300 362
 											}
@@ -331,7 +393,9 @@  discard block
 block discarded – undo
331 393
 			// extra_vars * Remove Column
332 394
 			for($i=1;$i<=20;$i++)
333 395
 			{
334
-				if(!$oDB->isColumnExists("documents","extra_vars".$i)) continue;
396
+				if(!$oDB->isColumnExists("documents","extra_vars".$i)) {
397
+					continue;
398
+				}
335 399
 				$oDB->dropColumn('documents','extra_vars'.$i);
336 400
 			}
337 401
 
@@ -353,7 +417,9 @@  discard block
 block discarded – undo
353 417
 				$site_args->default_language = $db_info->lang_type;
354 418
 
355 419
 				$output = executeQuery('module.insertSite', $site_args);
356
-				if(!$output->toBool()) return $output;
420
+				if(!$output->toBool()) {
421
+					return $output;
422
+				}
357 423
 			}
358 424
 
359 425
 			if($oDB->isIndexExists('sites','idx_domain'))
@@ -399,7 +465,9 @@  discard block
 block discarded – undo
399 465
 				foreach($output->data as $item)
400 466
 				{
401 467
 					$skin_path = explode('.', $item->skin);
402
-					if(count($skin_path) != 2) continue;
468
+					if(count($skin_path) != 2) {
469
+						continue;
470
+					}
403 471
 					if(is_dir(sprintf(_XE_PATH_ . 'themes/%s/modules/%s', $skin_path[0], $skin_path[1])))
404 472
 					{
405 473
 						unset($args);
@@ -425,7 +493,9 @@  discard block
 block discarded – undo
425 493
 				$output = executeQuery('module.updateMobileSkinFixModules');
426 494
 
427 495
 				$oModuleController = getController('module');
428
-				if(!$moduleConfig) $moduleConfig = new stdClass;
496
+				if(!$moduleConfig) {
497
+					$moduleConfig = new stdClass;
498
+				}
429 499
 				$moduleConfig->isUpdateFixedValue = TRUE;
430 500
 				$output = $oModuleController->updateModuleConfig('module', $moduleConfig);
431 501
 			}
@@ -433,7 +503,9 @@  discard block
 block discarded – undo
433 503
 			$oModuleController->insertUpdatedLog($version_update_id);
434 504
 		}
435 505
 
436
-		if(!is_dir('./files/ruleset')) FileHandler::makeDir('./files/ruleset');
506
+		if(!is_dir('./files/ruleset')) {
507
+			FileHandler::makeDir('./files/ruleset');
508
+		}
437 509
 
438 510
 		return new Object(0, 'success_updated');
439 511
 	}
@@ -441,10 +513,14 @@  discard block
 block discarded – undo
441 513
 	function updateForUniqueSiteDomain()
442 514
 	{
443 515
 		$output = executeQueryArray("module.getNonuniqueDomains");
444
-		if(!$output->data) return;
516
+		if(!$output->data) {
517
+			return;
518
+		}
445 519
 		foreach($output->data as $data)
446 520
 		{
447
-			if($data->count == 1) continue;
521
+			if($data->count == 1) {
522
+				continue;
523
+			}
448 524
 			$domain = $data->domain;
449 525
 			$args = new stdClass;
450 526
 			$args->domain = $domain;
Please login to merge, or discard this patch.