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 — develop ( d948ba...eebdf0 )
by gyeong-won
08:16
created
modules/member/member.controller.php 2 patches
Spacing   +461 added lines, -461 removed lines patch added patch discarded remove patch
@@ -34,25 +34,25 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	function procMemberLogin($user_id = null, $password = null, $keep_signed = null)
36 36
 	{
37
-		if(!$user_id && !$password && Context::getRequestMethod() == 'GET')
37
+		if (!$user_id && !$password && Context::getRequestMethod() == 'GET')
38 38
 		{
39 39
 			$this->setRedirectUrl(getNotEncodedUrl(''));
40 40
 			return new BaseObject(-1, 'null_user_id');
41 41
 		}
42 42
 
43 43
 		// Variables
44
-		if(!$user_id) $user_id = Context::get('user_id');
44
+		if (!$user_id) $user_id = Context::get('user_id');
45 45
 		$user_id = trim($user_id);
46 46
 
47
-		if(!$password) $password = Context::get('password');
47
+		if (!$password) $password = Context::get('password');
48 48
 		$password = trim($password);
49 49
 
50
-		if(!$keep_signed) $keep_signed = Context::get('keep_signed');
50
+		if (!$keep_signed) $keep_signed = Context::get('keep_signed');
51 51
 		// Return an error when id and password doesn't exist
52
-		if(!$user_id) return new BaseObject(-1,'null_user_id');
53
-		if(!$password) return new BaseObject(-1,'null_password');
52
+		if (!$user_id) return new BaseObject(-1, 'null_user_id');
53
+		if (!$password) return new BaseObject(-1, 'null_password');
54 54
 
55
-		$output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false);
55
+		$output = $this->doLogin($user_id, $password, $keep_signed == 'Y' ?true:false);
56 56
 		if (!$output->toBool()) return $output;
57 57
 
58 58
 		$oModuleModel = getModel('module');
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
 		$limit_date = $config->change_password_date;
63 63
 
64 64
 		// Check if change_password_date is set
65
-		if($limit_date > 0)
65
+		if ($limit_date > 0)
66 66
 		{
67 67
 			$oMemberModel = getModel('member');
68
-			if($this->memberInfo->change_password_date < date ('YmdHis', strtotime ('-' . $limit_date . ' day')))
68
+			if ($this->memberInfo->change_password_date < date('YmdHis', strtotime('-'.$limit_date.' day')))
69 69
 			{
70 70
 				$msg = sprintf(Context::getLang('msg_change_password_date'), $limit_date);
71
-				return $this->setRedirectUrl(getNotEncodedUrl('','vid',Context::get('vid'),'mid',Context::get('mid'),'act','dispMemberModifyPassword'), new BaseObject(-1, $msg));
71
+				return $this->setRedirectUrl(getNotEncodedUrl('', 'vid', Context::get('vid'), 'mid', Context::get('mid'), 'act', 'dispMemberModifyPassword'), new BaseObject(-1, $msg));
72 72
 			}
73 73
 		}
74 74
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		$args->member_srl = $this->memberInfo->member_srl;
78 78
 		executeQuery('member.deleteAuthMail', $args);
79 79
 
80
-		if(!$config->after_login_url)
80
+		if (!$config->after_login_url)
81 81
 		{
82 82
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
83 83
 		}
@@ -98,18 +98,18 @@  discard block
 block discarded – undo
98 98
 		// Call a trigger before log-out (before)
99 99
 		$logged_info = Context::get('logged_info');
100 100
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info);
101
-		if(!$trigger_output->toBool()) return $trigger_output;
101
+		if (!$trigger_output->toBool()) return $trigger_output;
102 102
 		// Destroy session information
103 103
 		$this->destroySessionInfo();
104 104
 		// Call a trigger after log-out (after)
105 105
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info);
106
-		if(!$trigger_output->toBool()) return $trigger_output;
106
+		if (!$trigger_output->toBool()) return $trigger_output;
107 107
 
108 108
 		$output = new BaseObject();
109 109
 
110 110
 		$oModuleModel = getModel('module');
111 111
 		$config = $oModuleModel->getModuleConfig('member');
112
-		if($config->after_logout_url)
112
+		if ($config->after_logout_url)
113 113
 			$output->redirect_url = $config->after_logout_url;
114 114
 
115 115
 		$this->_clearMemberCache($logged_info->member_srl);
@@ -127,18 +127,18 @@  discard block
 block discarded – undo
127 127
 		$oModuleModel = &getModel('module');
128 128
 
129 129
 		// Check login information
130
-		if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
130
+		if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
131 131
 		$logged_info = Context::get('logged_info');
132 132
 
133
-		$document_srl = (int)Context::get('document_srl');
134
-		if(!$document_srl) $document_srl = (int)Context::get('target_srl');
135
-		if(!$document_srl) return new BaseObject(-1,'msg_invalid_request');
133
+		$document_srl = (int) Context::get('document_srl');
134
+		if (!$document_srl) $document_srl = (int) Context::get('target_srl');
135
+		if (!$document_srl) return new BaseObject(-1, 'msg_invalid_request');
136 136
 
137 137
 		// Get document
138 138
 		$oDocumentModel = getModel('document');
139 139
 		$oDocument = $oDocumentModel->getDocument($document_srl);
140 140
 
141
-		if($oDocument->isSecret() && !$oDocument->isGranted())
141
+		if ($oDocument->isSecret() && !$oDocument->isGranted())
142 142
 		{
143 143
 			return new BaseObject(-1, 'msg_is_secret');
144 144
 		}
@@ -147,19 +147,19 @@  discard block
 block discarded – undo
147 147
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($oDocument->get('module_srl'));
148 148
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
149 149
 
150
-		if(!$grant->access)
150
+		if (!$grant->access)
151 151
 		{
152 152
 			return new BaseObject(-1, 'msg_not_permitted');
153 153
 		}
154 154
 
155 155
 		// 게시판 모듈에서 글 목록 보기 권한이 없으면 스크랩 제한
156
-		if($module_info->module === 'board' && isset($grant->list) && !$grant->list)
156
+		if ($module_info->module === 'board' && isset($grant->list) && !$grant->list)
157 157
 		{
158 158
 			return new BaseObject(-1, 'msg_not_permitted');
159 159
 		}
160 160
 
161 161
 		// 게시판 모듈에서 상담 기능 사용 시 권한이 없는 게시물(타인의 게시물) 스크랩 제한
162
-		if($module_info->module === 'board' &&
162
+		if ($module_info->module === 'board' &&
163 163
 			$module_info->consultation === 'Y' &&
164 164
 			isset($grant->consultation_read) &&
165 165
 			!$grant->consultation_read && !$oDocument->isGranted()
@@ -180,11 +180,11 @@  discard block
 block discarded – undo
180 180
 
181 181
 		// Check if already scrapped
182 182
 		$output = executeQuery('member.getScrapDocument', $args);
183
-		if($output->data->count) return new BaseObject(-1, 'msg_alreay_scrapped');
183
+		if ($output->data->count) return new BaseObject(-1, 'msg_alreay_scrapped');
184 184
 
185 185
 		// Insert
186 186
 		$output = executeQuery('member.addScrapDocument', $args);
187
-		if(!$output->toBool()) return $output;
187
+		if (!$output->toBool()) return $output;
188 188
 
189 189
 		$this->setError(-1);
190 190
 		$this->setMessage('success_registed');
@@ -198,11 +198,11 @@  discard block
 block discarded – undo
198 198
 	function procMemberDeleteScrap()
199 199
 	{
200 200
 		// Check login information
201
-		if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
201
+		if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
202 202
 		$logged_info = Context::get('logged_info');
203 203
 
204
-		$document_srl = (int)Context::get('document_srl');
205
-		if(!$document_srl) return new BaseObject(-1,'msg_invalid_request');
204
+		$document_srl = (int) Context::get('document_srl');
205
+		if (!$document_srl) return new BaseObject(-1, 'msg_invalid_request');
206 206
 		// Variables
207 207
 		$args = new stdClass;
208 208
 		$args->member_srl = $logged_info->member_srl;
@@ -228,23 +228,23 @@  discard block
 block discarded – undo
228 228
 	function procMemberDeleteSavedDocument()
229 229
 	{
230 230
 		// Check login information
231
-		if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
231
+		if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
232 232
 		$logged_info = Context::get('logged_info');
233 233
 
234
-		$document_srl = (int)Context::get('document_srl');
235
-		if(!$document_srl) return new BaseObject(-1,'msg_invalid_request');
234
+		$document_srl = (int) Context::get('document_srl');
235
+		if (!$document_srl) return new BaseObject(-1, 'msg_invalid_request');
236 236
 
237 237
 		$oDocumentModel = getModel('document');
238 238
 		$oDocument = $oDocumentModel->getDocument($document_srl);
239 239
 		if ($oDocument->get('member_srl') != $logged_info->member_srl)
240 240
 		{
241
-			return new BaseObject(-1,'msg_invalid_request');
241
+			return new BaseObject(-1, 'msg_invalid_request');
242 242
 		}
243 243
 
244 244
 		$configStatusList = $oDocumentModel->getStatusList();
245 245
 		if ($oDocument->get('status') != $configStatusList['temp'])
246 246
 		{
247
-			return new BaseObject(-1,'msg_invalid_request');
247
+			return new BaseObject(-1, 'msg_invalid_request');
248 248
 		}
249 249
 
250 250
 		$oDocumentController = getController('document');
@@ -260,37 +260,37 @@  discard block
 block discarded – undo
260 260
 	{
261 261
 		$name = Context::get('name');
262 262
 		$value = Context::get('value');
263
-		if(!$value) return;
263
+		if (!$value) return;
264 264
 
265 265
 		$oMemberModel = getModel('member');
266 266
 		// Check if logged-in
267 267
 		$logged_info = Context::get('logged_info');
268 268
 
269 269
 
270
-		switch($name)
270
+		switch ($name)
271 271
 		{
272 272
 			case 'user_id' :
273 273
 				// Check denied ID
274
-				if($oMemberModel->isDeniedID($value)) return new BaseObject(0,'denied_user_id');
274
+				if ($oMemberModel->isDeniedID($value)) return new BaseObject(0, 'denied_user_id');
275 275
 				// Check if duplicated
276 276
 				$member_srl = $oMemberModel->getMemberSrlByUserID($value);
277
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_user_id');
277
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new BaseObject(0, 'msg_exists_user_id');
278 278
 				break;
279 279
 			case 'nick_name' :
280 280
 				// Check denied ID
281
-				if($oMemberModel->isDeniedNickName($value))
281
+				if ($oMemberModel->isDeniedNickName($value))
282 282
 				{
283
-					return new BaseObject(0,'denied_nick_name');
283
+					return new BaseObject(0, 'denied_nick_name');
284 284
 				}
285 285
 				// Check if duplicated
286 286
 				$member_srl = $oMemberModel->getMemberSrlByNickName($value);
287
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_nick_name');
287
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new BaseObject(0, 'msg_exists_nick_name');
288 288
 
289 289
 				break;
290 290
 			case 'email_address' :
291 291
 				// Check if duplicated
292 292
 				$member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
293
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_email_address');
293
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new BaseObject(0, 'msg_exists_email_address');
294 294
 				break;
295 295
 		}
296 296
 	}
@@ -302,25 +302,25 @@  discard block
 block discarded – undo
302 302
 	 */
303 303
 	function procMemberInsert()
304 304
 	{
305
-		if (Context::getRequestMethod () == "GET") return new BaseObject(-1, "msg_invalid_request");
306
-		$oMemberModel = &getModel ('member');
305
+		if (Context::getRequestMethod() == "GET") return new BaseObject(-1, "msg_invalid_request");
306
+		$oMemberModel = &getModel('member');
307 307
 		$config = $oMemberModel->getMemberConfig();
308 308
 
309 309
 		// call a trigger (before)
310
-		$trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config);
311
-		if(!$trigger_output->toBool ()) return $trigger_output;
310
+		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'before', $config);
311
+		if (!$trigger_output->toBool()) return $trigger_output;
312 312
 		// Check if an administrator allows a membership
313
-		if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled');
313
+		if ($config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
314 314
 		// Check if the user accept the license terms (only if terms exist)
315
-		if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
315
+		if ($config->agreement && Context::get('accept_agreement') != 'Y') return $this->stop('msg_accept_agreement');
316 316
 
317 317
 		// Extract the necessary information in advance
318 318
 		$getVars = array();
319
-		if($config->signupForm)
319
+		if ($config->signupForm)
320 320
 		{
321
-			foreach($config->signupForm as $formInfo)
321
+			foreach ($config->signupForm as $formInfo)
322 322
 			{
323
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
323
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
324 324
 				{
325 325
 					$getVars[] = $formInfo->name;
326 326
 				}
@@ -328,22 +328,22 @@  discard block
 block discarded – undo
328 328
 		}
329 329
 
330 330
 		$args = new stdClass;
331
-		foreach($getVars as $val)
331
+		foreach ($getVars as $val)
332 332
 		{
333 333
 			$args->{$val} = Context::get($val);
334
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
334
+			if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
335 335
 		}
336 336
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
337
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
337
+		if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
338 338
 
339 339
 		$args->find_account_answer = Context::get('find_account_answer');
340 340
 		$args->allow_mailing = Context::get('allow_mailing');
341 341
 		$args->allow_message = Context::get('allow_message');
342 342
 
343
-		if($args->password1) $args->password = $args->password1;
343
+		if ($args->password1) $args->password = $args->password1;
344 344
 
345 345
 		// check password strength
346
-		if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
346
+		if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
347 347
 		{
348 348
 			$message = Context::getLang('about_password_strength');
349 349
 			return new BaseObject(-1, $message[$config->password_strength]);
@@ -369,58 +369,58 @@  discard block
 block discarded – undo
369 369
 		unset($all_args->secret_text);
370 370
 
371 371
 		// Set the user state as "denied" when using mail authentication
372
-		if($config->enable_confirm == 'Y') $args->denied = 'Y';
372
+		if ($config->enable_confirm == 'Y') $args->denied = 'Y';
373 373
 		// Add extra vars after excluding necessary information from all the requested arguments
374 374
 		$extra_vars = delObjectVars($all_args, $args);
375 375
 		$args->extra_vars = serialize($extra_vars);
376 376
 
377 377
 		// remove whitespace
378 378
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
379
-		foreach($checkInfos as $val)
379
+		foreach ($checkInfos as $val)
380 380
 		{
381
-			if(isset($args->{$val}))
381
+			if (isset($args->{$val}))
382 382
 			{
383 383
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
384 384
 			}
385 385
 		}
386 386
 		$output = $this->insertMember($args);
387
-		if(!$output->toBool()) return $output;
387
+		if (!$output->toBool()) return $output;
388 388
 
389 389
 		// insert ProfileImage, ImageName, ImageMark
390 390
 		$profile_image = $_FILES['profile_image'];
391
-		if(is_uploaded_file($profile_image['tmp_name']))
391
+		if (is_uploaded_file($profile_image['tmp_name']))
392 392
 		{
393 393
 			$this->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
394 394
 		}
395 395
 
396 396
 		$image_mark = $_FILES['image_mark'];
397
-		if(is_uploaded_file($image_mark['tmp_name']))
397
+		if (is_uploaded_file($image_mark['tmp_name']))
398 398
 		{
399 399
 			$this->insertImageMark($args->member_srl, $image_mark['tmp_name']);
400 400
 		}
401 401
 
402 402
 		$image_name = $_FILES['image_name'];
403
-		if(is_uploaded_file($image_name['tmp_name']))
403
+		if (is_uploaded_file($image_name['tmp_name']))
404 404
 		{
405 405
 			$this->insertImageName($args->member_srl, $image_name['tmp_name']);
406 406
 		}
407 407
 
408 408
 		// If a virtual site, join the site
409 409
 		$site_module_info = Context::get('site_module_info');
410
-		if($site_module_info->site_srl > 0)
410
+		if ($site_module_info->site_srl > 0)
411 411
 		{
412 412
 			$columnList = array('site_srl', 'group_srl');
413 413
 			$default_group = $oMemberModel->getDefaultGroup($site_module_info->site_srl, $columnList);
414
-			if($default_group->group_srl)
414
+			if ($default_group->group_srl)
415 415
 			{
416 416
 				$this->addMemberToGroup($args->member_srl, $default_group->group_srl, $site_module_info->site_srl);
417 417
 			}
418 418
 
419 419
 		}
420 420
 		// Log-in
421
-		if($config->enable_confirm != 'Y')
421
+		if ($config->enable_confirm != 'Y')
422 422
 		{
423
-			if($config->identifier == 'email_address')
423
+			if ($config->identifier == 'email_address')
424 424
 			{
425 425
 				$output = $this->doLogin($args->email_address);
426 426
 			}
@@ -428,8 +428,8 @@  discard block
 block discarded – undo
428 428
 			{
429 429
 				$output = $this->doLogin($args->user_id);
430 430
 			}
431
-			if(!$output->toBool()) {
432
-				if($output->error == -9)
431
+			if (!$output->toBool()) {
432
+				if ($output->error == -9)
433 433
 					$output->error = -11;
434 434
 				return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output);
435 435
 			}
@@ -437,8 +437,8 @@  discard block
 block discarded – undo
437 437
 
438 438
 		// Results
439 439
 		$this->add('member_srl', $args->member_srl);
440
-		if($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
441
-		if($config->enable_confirm == 'Y')
440
+		if ($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
441
+		if ($config->enable_confirm == 'Y')
442 442
 		{
443 443
 			$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
444 444
 			$this->setMessage($msg);
@@ -447,19 +447,19 @@  discard block
 block discarded – undo
447 447
 		else $this->setMessage('success_registed');
448 448
 		// Call a trigger (after)
449 449
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
450
-		if(!$trigger_output->toBool()) return $trigger_output;
450
+		if (!$trigger_output->toBool()) return $trigger_output;
451 451
 
452
-		if($config->redirect_url)
452
+		if ($config->redirect_url)
453 453
 		{
454 454
 			$returnUrl = $config->redirect_url;
455 455
 		}
456 456
 		else
457 457
 		{
458
-			if(Context::get('success_return_url'))
458
+			if (Context::get('success_return_url'))
459 459
 			{
460 460
 				$returnUrl = Context::get('success_return_url');
461 461
 			}
462
-			else if($_COOKIE['XE_REDIRECT_URL'])
462
+			else if ($_COOKIE['XE_REDIRECT_URL'])
463 463
 			{
464 464
 				$returnUrl = $_COOKIE['XE_REDIRECT_URL'];
465 465
 				savecookie('XE_REDIRECT_URL');
@@ -473,26 +473,26 @@  discard block
 block discarded – undo
473 473
 
474 474
 	function procMemberModifyInfoBefore()
475 475
 	{
476
-		if($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD')
476
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD')
477 477
 		{
478 478
 			return $this->stop('msg_invalid_request');
479 479
 		}
480 480
 
481
-		if(!Context::get('is_logged'))
481
+		if (!Context::get('is_logged'))
482 482
 		{
483 483
 			return $this->stop('msg_not_logged');
484 484
 		}
485 485
 
486 486
 		$password = Context::get('password');
487 487
 
488
-		if(!$password)
488
+		if (!$password)
489 489
 		{
490 490
 			return $this->stop('msg_invalid_request');
491 491
 		}
492 492
 
493 493
 		$oMemberModel = getModel('member');
494 494
 
495
-		if(!$this->memberInfo->password)
495
+		if (!$this->memberInfo->password)
496 496
 		{
497 497
 			// Get information of logged-in user
498 498
 			$logged_info = Context::get('logged_info');
@@ -503,14 +503,14 @@  discard block
 block discarded – undo
503 503
 			$this->memberInfo->password = $memberInfo->password;
504 504
 		}
505 505
 		// Verify the current password
506
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
506
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
507 507
 		{
508 508
 			return new BaseObject(-1, 'invalid_password');
509 509
 		}
510 510
 
511 511
 		$_SESSION['rechecked_password_step'] = 'VALIDATE_PASSWORD';
512 512
 
513
-		if(Context::get('success_return_url'))
513
+		if (Context::get('success_return_url'))
514 514
 		{
515 515
 			$redirectUrl = Context::get('success_return_url');
516 516
 		}
@@ -528,12 +528,12 @@  discard block
 block discarded – undo
528 528
 	 */
529 529
 	function procMemberModifyInfo()
530 530
 	{
531
-		if(!Context::get('is_logged'))
531
+		if (!Context::get('is_logged'))
532 532
 		{
533 533
 			return $this->stop('msg_not_logged');
534 534
 		}
535 535
 
536
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
536
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
537 537
 		{
538 538
 			return $this->stop('msg_invalid_request');
539 539
 		}
@@ -541,13 +541,13 @@  discard block
 block discarded – undo
541 541
 
542 542
 		// Extract the necessary information in advance
543 543
 		$oMemberModel = getModel('member');
544
-		$config = $oMemberModel->getMemberConfig ();
545
-		$getVars = array('find_account_answer','allow_mailing','allow_message');
546
-		if($config->signupForm)
544
+		$config = $oMemberModel->getMemberConfig();
545
+		$getVars = array('find_account_answer', 'allow_mailing', 'allow_message');
546
+		if ($config->signupForm)
547 547
 		{
548
-			foreach($config->signupForm as $formInfo)
548
+			foreach ($config->signupForm as $formInfo)
549 549
 			{
550
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
550
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
551 551
 				{
552 552
 					$getVars[] = $formInfo->name;
553 553
 				}
@@ -555,11 +555,11 @@  discard block
 block discarded – undo
555 555
 		}
556 556
 
557 557
 		$args = new stdClass;
558
-		foreach($getVars as $val)
558
+		foreach ($getVars as $val)
559 559
 		{
560 560
 			$args->{$val} = Context::get($val);
561
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
562
-			if($val == 'find_account_answer' && !Context::get($val)) {
561
+			if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
562
+			if ($val == 'find_account_answer' && !Context::get($val)) {
563 563
 				unset($args->{$val});
564 564
 			}
565 565
 		}
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
 		$logged_info = Context::get('logged_info');
569 569
 		$args->member_srl = $logged_info->member_srl;
570 570
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
571
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
571
+		if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
572 572
 
573 573
 		// Remove some unnecessary variables from all the vars
574 574
 		$all_args = Context::getRequestVars();
@@ -593,9 +593,9 @@  discard block
 block discarded – undo
593 593
 
594 594
 		// remove whitespace
595 595
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
596
-		foreach($checkInfos as $val)
596
+		foreach ($checkInfos as $val)
597 597
 		{
598
-			if(isset($args->{$val}))
598
+			if (isset($args->{$val}))
599 599
 			{
600 600
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
601 601
 			}
@@ -603,22 +603,22 @@  discard block
 block discarded – undo
603 603
 
604 604
 		// Execute insert or update depending on the value of member_srl
605 605
 		$output = $this->updateMember($args);
606
-		if(!$output->toBool()) return $output;
606
+		if (!$output->toBool()) return $output;
607 607
 
608 608
 		$profile_image = $_FILES['profile_image'];
609
-		if(is_uploaded_file($profile_image['tmp_name']))
609
+		if (is_uploaded_file($profile_image['tmp_name']))
610 610
 		{
611 611
 			$this->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
612 612
 		}
613 613
 
614 614
 		$image_mark = $_FILES['image_mark'];
615
-		if(is_uploaded_file($image_mark['tmp_name']))
615
+		if (is_uploaded_file($image_mark['tmp_name']))
616 616
 		{
617 617
 			$this->insertImageMark($args->member_srl, $image_mark['tmp_name']);
618 618
 		}
619 619
 
620 620
 		$image_name = $_FILES['image_name'];
621
-		if(is_uploaded_file($image_name['tmp_name']))
621
+		if (is_uploaded_file($image_name['tmp_name']))
622 622
 		{
623 623
 			$this->insertImageName($args->member_srl, $image_name['tmp_name']);
624 624
 		}
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
 
634 634
 		// Call a trigger after successfully log-in (after)
635 635
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo);
636
-		if(!$trigger_output->toBool()) return $trigger_output;
636
+		if (!$trigger_output->toBool()) return $trigger_output;
637 637
 
638 638
 		$this->setSessionInfo();
639 639
 		// Return result
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
 	 */
655 655
 	function procMemberModifyPassword()
656 656
 	{
657
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
657
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
658 658
 		// Extract the necessary information in advance
659 659
 		$current_password = trim(Context::get('current_password'));
660 660
 		$password = trim(Context::get('password1'));
@@ -668,17 +668,17 @@  discard block
 block discarded – undo
668 668
 
669 669
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
670 670
 		// Verify the cuttent password
671
-		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new BaseObject(-1, 'invalid_password');
671
+		if (!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new BaseObject(-1, 'invalid_password');
672 672
 
673 673
 		// Check if a new password is as same as the previous password
674
-		if($current_password == $password) return new BaseObject(-1, 'invalid_new_password');
674
+		if ($current_password == $password) return new BaseObject(-1, 'invalid_new_password');
675 675
 
676 676
 		// Execute insert or update depending on the value of member_srl
677 677
 		$args = new stdClass;
678 678
 		$args->member_srl = $member_srl;
679 679
 		$args->password = $password;
680 680
 		$output = $this->updateMemberPassword($args);
681
-		if(!$output->toBool()) return $output;
681
+		if (!$output->toBool()) return $output;
682 682
 
683 683
 		$this->add('member_srl', $args->member_srl);
684 684
 		$this->setMessage('success_updated');
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
 	 */
695 695
 	function procMemberLeave()
696 696
 	{
697
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
697
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
698 698
 		// Extract the necessary information in advance
699 699
 		$password = trim(Context::get('password'));
700 700
 		// Get information of logged-in user
@@ -703,17 +703,17 @@  discard block
 block discarded – undo
703 703
 		// Create a member model object
704 704
 		$oMemberModel = getModel('member');
705 705
 		// Get information of member_srl
706
-		if(!$this->memberInfo->password)
706
+		if (!$this->memberInfo->password)
707 707
 		{
708 708
 			$columnList = array('member_srl', 'password');
709 709
 			$memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
710 710
 			$this->memberInfo->password = $memberInfo->password;
711 711
 		}
712 712
 		// Verify the cuttent password
713
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new BaseObject(-1, 'invalid_password');
713
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new BaseObject(-1, 'invalid_password');
714 714
 
715 715
 		$output = $this->deleteMember($member_srl);
716
-		if(!$output->toBool()) return $output;
716
+		if (!$output->toBool()) return $output;
717 717
 		// Destroy all session information
718 718
 		$this->destroySessionInfo();
719 719
 		// Return success message
@@ -732,20 +732,20 @@  discard block
 block discarded – undo
732 732
 	{
733 733
 		// Check if the file is successfully uploaded
734 734
 		$file = $_FILES['profile_image'];
735
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
735
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
736 736
 		// Ignore if member_srl is invalid or doesn't exist.
737 737
 		$member_srl = Context::get('member_srl');
738
-		if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
738
+		if (!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
739 739
 
740 740
 		$logged_info = Context::get('logged_info');
741
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
741
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
742 742
 		// Return if member module is set not to use an image name or the user is not an administrator ;
743 743
 		$oMemberModel = getModel('member');
744 744
 		$config = $oMemberModel->getMemberConfig();
745
-		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
745
+		if ($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
746 746
 
747 747
 		$output = $this->insertProfileImage($member_srl, $file['tmp_name']);
748
-		if(!$output->toBool()) return $output;
748
+		if (!$output->toBool()) return $output;
749 749
 
750 750
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
751 751
 		$this->setRedirectUrl($returnUrl);
@@ -767,14 +767,14 @@  discard block
 block discarded – undo
767 767
 		$max_height = $config->profile_image_max_height;
768 768
 		$max_filesize = $config->profile_image_max_filesize;
769 769
 
770
-		Context::loadLang(_XE_PATH_ . 'modules/file/lang');
770
+		Context::loadLang(_XE_PATH_.'modules/file/lang');
771 771
 
772 772
 		// Get file information
773 773
 		FileHandler::clearStatCache($target_file);
774 774
 		list($width, $height, $type) = @getimagesize($target_file);
775
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
776
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
777
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
775
+		if (IMAGETYPE_PNG == $type) $ext = 'png';
776
+		elseif (IMAGETYPE_JPEG == $type) $ext = 'jpg';
777
+		elseif (IMAGETYPE_GIF == $type) $ext = 'gif';
778 778
 		else
779 779
 		{
780 780
 			return $this->stop('msg_not_uploaded_profile_image');
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
 		$target_filename = sprintf('%s%d.%s', $target_path, $member_srl, $ext);
787 787
 
788 788
 		// Convert if the image size is larger than a given size or if the format is not a gif
789
-		if(($width > $max_width || $height > $max_height ) && $type != 1)
789
+		if (($width > $max_width || $height > $max_height) && $type != 1)
790 790
 		{
791 791
 			$temp_filename = sprintf('files/cache/tmp/profile_image_%d.%s', $member_srl, $ext);
792 792
 			FileHandler::createImageFile($target_file, $temp_filename, $max_width, $max_height, $ext);
@@ -794,10 +794,10 @@  discard block
 block discarded – undo
794 794
 			// 파일 용량 제한
795 795
 			FileHandler::clearStatCache($temp_filename);
796 796
 			$filesize = filesize($temp_filename);
797
-			if($max_filesize && $filesize > ($max_filesize * 1024))
797
+			if ($max_filesize && $filesize > ($max_filesize * 1024))
798 798
 			{
799 799
 				FileHandler::removeFile($temp_filename);
800
-				return $this->stop(implode(' ' , array(
800
+				return $this->stop(implode(' ', array(
801 801
 					Context::getLang('msg_not_uploaded_profile_image'),
802 802
 					Context::getLang('msg_exceeds_limit_size')
803 803
 				)));
@@ -811,9 +811,9 @@  discard block
 block discarded – undo
811 811
 		{
812 812
 			// 파일 용량 제한
813 813
 			$filesize = filesize($target_file);
814
-			if($max_filesize && $filesize > ($max_filesize * 1024))
814
+			if ($max_filesize && $filesize > ($max_filesize * 1024))
815 815
 			{
816
-				return $this->stop(implode(' ' , array(
816
+				return $this->stop(implode(' ', array(
817 817
 					Context::getLang('msg_not_uploaded_profile_image'),
818 818
 					Context::getLang('msg_exceeds_limit_size')
819 819
 				)));
@@ -836,20 +836,20 @@  discard block
 block discarded – undo
836 836
 	{
837 837
 		// Check if the file is successfully uploaded
838 838
 		$file = $_FILES['image_name'];
839
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
839
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
840 840
 		// Ignore if member_srl is invalid or doesn't exist.
841 841
 		$member_srl = Context::get('member_srl');
842
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
842
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_name');
843 843
 
844 844
 		$logged_info = Context::get('logged_info');
845
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
845
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
846 846
 		// Return if member module is set not to use an image name or the user is not an administrator ;
847 847
 		$oMemberModel = getModel('member');
848 848
 		$config = $oMemberModel->getMemberConfig();
849
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
849
+		if ($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
850 850
 
851 851
 		$output = $this->insertImageName($member_srl, $file['tmp_name']);
852
-		if(!$output->toBool()) return $output;
852
+		if (!$output->toBool()) return $output;
853 853
 
854 854
 		// Page refresh
855 855
 		//$this->setRefreshPage();
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
 		$max_height = $config->image_name_max_height;
875 875
 		$max_filesize = $config->image_name_max_filesize;
876 876
 
877
-		Context::loadLang(_XE_PATH_ . 'modules/file/lang');
877
+		Context::loadLang(_XE_PATH_.'modules/file/lang');
878 878
 
879 879
 		// Get a target path to save
880 880
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
 		// Get file information
885 885
 		list($width, $height, $type) = @getimagesize($target_file);
886 886
 		// Convert if the image size is larger than a given size or if the format is not a gif
887
-		if($width > $max_width || $height > $max_height || $type!=1)
887
+		if ($width > $max_width || $height > $max_height || $type != 1)
888 888
 		{
889 889
 			$temp_filename = sprintf('files/cache/tmp/image_name_%d.gif', $member_srl, $ext);
890 890
 			FileHandler::createImageFile($target_file, $temp_filename, $max_width, $max_height, 'gif');
@@ -892,10 +892,10 @@  discard block
 block discarded – undo
892 892
 			// 파일 용량 제한
893 893
 			FileHandler::clearStatCache($temp_filename);
894 894
 			$filesize = filesize($temp_filename);
895
-			if($max_filesize && $filesize > ($max_filesize * 1024))
895
+			if ($max_filesize && $filesize > ($max_filesize * 1024))
896 896
 			{
897 897
 				FileHandler::removeFile($temp_filename);
898
-				return $this->stop(implode(' ' , array(
898
+				return $this->stop(implode(' ', array(
899 899
 					Context::getLang('msg_not_uploaded_image_name'),
900 900
 					Context::getLang('msg_exceeds_limit_size')
901 901
 				)));
@@ -909,9 +909,9 @@  discard block
 block discarded – undo
909 909
 		{
910 910
 			// 파일 용량 제한
911 911
 			$filesize = filesize($target_file);
912
-			if($max_filesize && $filesize > ($max_filesize * 1024))
912
+			if ($max_filesize && $filesize > ($max_filesize * 1024))
913 913
 			{
914
-				return $this->stop(implode(' ' , array(
914
+				return $this->stop(implode(' ', array(
915 915
 					Context::getLang('msg_not_uploaded_image_name'),
916 916
 					Context::getLang('msg_exceeds_limit_size')
917 917
 				)));
@@ -933,20 +933,20 @@  discard block
 block discarded – undo
933 933
 	function procMemberDeleteProfileImage($_memberSrl = 0)
934 934
 	{
935 935
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
936
-		if(!$member_srl)
936
+		if (!$member_srl)
937 937
 		{
938
-			return new BaseObject(0,'success');
938
+			return new BaseObject(0, 'success');
939 939
 		}
940 940
 
941 941
 		$logged_info = Context::get('logged_info');
942 942
 
943
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
943
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
944 944
 		{
945 945
 			$oMemberModel = getModel('member');
946 946
 			$profile_image = $oMemberModel->getProfileImage($member_srl);
947 947
 			FileHandler::removeFile($profile_image->file);
948 948
 		}
949
-		return new BaseObject(0,'success');
949
+		return new BaseObject(0, 'success');
950 950
 	}
951 951
 
952 952
 	/**
@@ -957,20 +957,20 @@  discard block
 block discarded – undo
957 957
 	function procMemberDeleteImageName($_memberSrl = 0)
958 958
 	{
959 959
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
960
-		if(!$member_srl)
960
+		if (!$member_srl)
961 961
 		{
962
-			return new BaseObject(0,'success');
962
+			return new BaseObject(0, 'success');
963 963
 		}
964 964
 
965 965
 		$logged_info = Context::get('logged_info');
966 966
 
967
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
967
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
968 968
 		{
969 969
 			$oMemberModel = getModel('member');
970 970
 			$image_name = $oMemberModel->getImageName($member_srl);
971 971
 			FileHandler::removeFile($image_name->file);
972 972
 		}
973
-		return new BaseObject(0,'success');
973
+		return new BaseObject(0, 'success');
974 974
 	}
975 975
 
976 976
 	/**
@@ -982,20 +982,20 @@  discard block
 block discarded – undo
982 982
 	{
983 983
 		// Check if the file is successfully uploaded
984 984
 		$file = $_FILES['image_mark'];
985
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
985
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
986 986
 		// Ignore if member_srl is invalid or doesn't exist.
987 987
 		$member_srl = Context::get('member_srl');
988
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
988
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
989 989
 
990 990
 		$logged_info = Context::get('logged_info');
991
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
991
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
992 992
 		// Membership in the images mark the module using the ban was set by an administrator or return;
993 993
 		$oMemberModel = getModel('member');
994 994
 		$config = $oMemberModel->getMemberConfig();
995
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
995
+		if ($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
996 996
 
997 997
 		$this->insertImageMark($member_srl, $file['tmp_name']);
998
-		if(!$output->toBool()) return $output;
998
+		if (!$output->toBool()) return $output;
999 999
 
1000 1000
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
1001 1001
 		$this->setRedirectUrl($returnUrl);
@@ -1017,7 +1017,7 @@  discard block
 block discarded – undo
1017 1017
 		$max_height = $config->image_mark_max_height;
1018 1018
 		$max_filesize = $config->image_mark_max_filesize;
1019 1019
 
1020
-		Context::loadLang(_XE_PATH_ . 'modules/file/lang');
1020
+		Context::loadLang(_XE_PATH_.'modules/file/lang');
1021 1021
 
1022 1022
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
1023 1023
 		FileHandler::makeDir($target_path);
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
 		// Get file information
1027 1027
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
1028 1028
 
1029
-		if($width > $max_width || $height > $max_height || $type!=1)
1029
+		if ($width > $max_width || $height > $max_height || $type != 1)
1030 1030
 		{
1031 1031
 			$temp_filename = sprintf('files/cache/tmp/image_mark_%d.gif', $member_srl);
1032 1032
 			FileHandler::createImageFile($target_file, $temp_filename, $max_width, $max_height, 'gif');
@@ -1034,10 +1034,10 @@  discard block
 block discarded – undo
1034 1034
 			// 파일 용량 제한
1035 1035
 			FileHandler::clearStatCache($temp_filename);
1036 1036
 			$filesize = filesize($temp_filename);
1037
-			if($max_filesize && $filesize > ($max_filesize * 1024))
1037
+			if ($max_filesize && $filesize > ($max_filesize * 1024))
1038 1038
 			{
1039 1039
 				FileHandler::removeFile($temp_filename);
1040
-				return $this->stop(implode(' ' , array(
1040
+				return $this->stop(implode(' ', array(
1041 1041
 					Context::getLang('msg_not_uploaded_group_image_mark'),
1042 1042
 					Context::getLang('msg_exceeds_limit_size')
1043 1043
 				)));
@@ -1050,10 +1050,10 @@  discard block
 block discarded – undo
1050 1050
 		else
1051 1051
 		{
1052 1052
 			$filesize = filesize($target_file);
1053
-			if($max_filesize && $filesize > ($max_filesize * 1024))
1053
+			if ($max_filesize && $filesize > ($max_filesize * 1024))
1054 1054
 			{
1055 1055
 				FileHandler::removeFile($target_file);
1056
-				return $this->stop(implode(' ' , array(
1056
+				return $this->stop(implode(' ', array(
1057 1057
 					Context::getLang('msg_not_uploaded_group_image_mark'),
1058 1058
 					Context::getLang('msg_exceeds_limit_size')
1059 1059
 				)));
@@ -1075,20 +1075,20 @@  discard block
 block discarded – undo
1075 1075
 	function procMemberDeleteImageMark($_memberSrl = 0)
1076 1076
 	{
1077 1077
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
1078
-		if(!$member_srl)
1078
+		if (!$member_srl)
1079 1079
 		{
1080
-			return new BaseObject(0,'success');
1080
+			return new BaseObject(0, 'success');
1081 1081
 		}
1082 1082
 
1083 1083
 		$logged_info = Context::get('logged_info');
1084 1084
 
1085
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
1085
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
1086 1086
 		{
1087 1087
 			$oMemberModel = getModel('member');
1088 1088
 			$image_mark = $oMemberModel->getImageMark($member_srl);
1089 1089
 			FileHandler::removeFile($image_mark->file);
1090 1090
 		}
1091
-		return new BaseObject(0,'success');
1091
+		return new BaseObject(0, 'success');
1092 1092
 	}
1093 1093
 
1094 1094
 	/**
@@ -1099,26 +1099,26 @@  discard block
 block discarded – undo
1099 1099
 	function procMemberFindAccount()
1100 1100
 	{
1101 1101
 		$email_address = Context::get('email_address');
1102
-		if(!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1102
+		if (!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1103 1103
 
1104 1104
 		$oMemberModel = getModel('member');
1105 1105
 		$oModuleModel = getModel('module');
1106 1106
 
1107 1107
 		// Check if a member having the same email address exists
1108 1108
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1109
-		if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1109
+		if (!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1110 1110
 
1111 1111
 		// Get information of the member
1112 1112
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
1113 1113
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1114 1114
 
1115 1115
 		// Check if possible to find member's ID and password
1116
-		if($member_info->denied == 'Y')
1116
+		if ($member_info->denied == 'Y')
1117 1117
 		{
1118 1118
 			$chk_args = new stdClass;
1119 1119
 			$chk_args->member_srl = $member_info->member_srl;
1120 1120
 			$output = executeQuery('member.chkAuthMail', $chk_args);
1121
-			if($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed');
1121
+			if ($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed');
1122 1122
 		}
1123 1123
 
1124 1124
 		// Insert data into the authentication DB
@@ -1131,19 +1131,19 @@  discard block
 block discarded – undo
1131 1131
 		$args->is_register = 'N';
1132 1132
 
1133 1133
 		$output = executeQuery('member.insertAuthMail', $args);
1134
-		if(!$output->toBool()) return $output;
1134
+		if (!$output->toBool()) return $output;
1135 1135
 		// Get content of the email to send a member
1136 1136
 		Context::set('auth_args', $args);
1137 1137
 
1138 1138
 		$member_config = $oModuleModel->getModuleConfig('member');
1139 1139
 		$memberInfo = array();
1140 1140
 		global $lang;
1141
-		if(is_array($member_config->signupForm))
1141
+		if (is_array($member_config->signupForm))
1142 1142
 		{
1143
-			$exceptForm=array('password', 'find_account_question');
1144
-			foreach($member_config->signupForm as $form)
1143
+			$exceptForm = array('password', 'find_account_question');
1144
+			foreach ($member_config->signupForm as $form)
1145 1145
 			{
1146
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1146
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1147 1147
 				{
1148 1148
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1149 1149
 				}
@@ -1158,15 +1158,15 @@  discard block
 block discarded – undo
1158 1158
 		}
1159 1159
 		Context::set('memberInfo', $memberInfo);
1160 1160
 
1161
-		if(!$member_config->skin) $member_config->skin = "default";
1162
-		if(!$member_config->colorset) $member_config->colorset = "white";
1161
+		if (!$member_config->skin) $member_config->skin = "default";
1162
+		if (!$member_config->colorset) $member_config->colorset = "white";
1163 1163
 
1164 1164
 		Context::set('member_config', $member_config);
1165 1165
 
1166 1166
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1167
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1167
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1168 1168
 
1169
-		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1169
+		$find_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1170 1170
 		Context::set('find_url', $find_url);
1171 1171
 
1172 1172
 		$oTemplate = &TemplateHandler::getInstance();
@@ -1176,19 +1176,19 @@  discard block
 block discarded – undo
1176 1176
 		$member_config = $oModuleModel->getModuleConfig('member');
1177 1177
 		// Send a mail
1178 1178
 		$oMail = new Mail();
1179
-		$oMail->setTitle( Context::getLang('msg_find_account_title') );
1179
+		$oMail->setTitle(Context::getLang('msg_find_account_title'));
1180 1180
 		$oMail->setContent($content);
1181
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1182
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1181
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1182
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1183 1183
 		$oMail->send();
1184 1184
 		// Return message
1185 1185
 		$msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address);
1186
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
1186
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
1187 1187
 		{
1188 1188
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberFindAccount');
1189 1189
 			$this->setRedirectUrl($returnUrl);
1190 1190
 		}
1191
-		return new BaseObject(0,$msg);
1191
+		return new BaseObject(0, $msg);
1192 1192
 	}
1193 1193
 
1194 1194
 	/**
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
 	function procMemberFindAccountByQuestion()
1200 1200
 	{
1201 1201
 		$oMemberModel = getModel('member');
1202
-		$oPassword =  new Password();
1202
+		$oPassword = new Password();
1203 1203
 		$config = $oMemberModel->getMemberConfig();
1204 1204
 
1205 1205
 		$email_address = Context::get('email_address');
@@ -1207,49 +1207,49 @@  discard block
 block discarded – undo
1207 1207
 		$find_account_question = trim(Context::get('find_account_question'));
1208 1208
 		$find_account_answer = trim(Context::get('find_account_answer'));
1209 1209
 
1210
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request');
1210
+		if (($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request');
1211 1211
 
1212 1212
 		$oModuleModel = getModel('module');
1213 1213
 		// Check if a member having the same email address exists
1214 1214
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1215
-		if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1215
+		if (!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1216 1216
 
1217 1217
 		// Get information of the member
1218 1218
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1219 1219
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1220 1220
 
1221 1221
 		// Display a message if no answer is entered
1222
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists');
1222
+		if (!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists');
1223 1223
 
1224 1224
 		// 답변 확인
1225 1225
 		$hashed = $oPassword->checkAlgorithm($member_info->find_account_answer);
1226 1226
 		$authed = true;
1227 1227
 		$member_info->find_account_question = trim($member_info->find_account_question);
1228
-		if($member_info->find_account_question != $find_account_question)
1228
+		if ($member_info->find_account_question != $find_account_question)
1229 1229
 		{
1230 1230
 			$authed = false;
1231 1231
 		}
1232
-		else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1232
+		else if ($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1233 1233
 		{
1234 1234
 			$authed = false;
1235 1235
 		}
1236
-		else if(!$hashed && $find_account_answer != $member_info->find_account_answer)
1236
+		else if (!$hashed && $find_account_answer != $member_info->find_account_answer)
1237 1237
 		{
1238 1238
 			$authed = false;
1239 1239
 		}
1240 1240
 
1241
-		if(!$authed)
1241
+		if (!$authed)
1242 1242
 		{
1243 1243
 			return new BaseObject(-1, 'msg_answer_not_matches');
1244 1244
 		}
1245 1245
 
1246 1246
 		// answer가 동일하고 hash 되지 않았으면 hash 값으로 저장
1247
-		if($authed && !$hashed)
1247
+		if ($authed && !$hashed)
1248 1248
 		{
1249 1249
 			$this->updateFindAccountAnswer($member_srl, $find_account_answer);
1250 1250
 		}
1251 1251
 
1252
-		if($config->identifier == 'email_address')
1252
+		if ($config->identifier == 'email_address')
1253 1253
 		{
1254 1254
 			$user_id = $email_address;
1255 1255
 		}
@@ -1262,11 +1262,11 @@  discard block
 block discarded – undo
1262 1262
 		$args->password = $temp_password;
1263 1263
 		$args->change_password_date = '1';
1264 1264
 		$output = $this->updateMemberPassword($args);
1265
-		if(!$output->toBool()) return $output;
1265
+		if (!$output->toBool()) return $output;
1266 1266
 
1267
-		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1267
+		$_SESSION['xe_temp_password_'.$user_id] = $temp_password;
1268 1268
 
1269
-		$this->add('user_id',$user_id);
1269
+		$this->add('user_id', $user_id);
1270 1270
 
1271 1271
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
1272 1272
 		$this->setRedirectUrl($returnUrl.'&user_id='.$user_id);
@@ -1286,7 +1286,7 @@  discard block
 block discarded – undo
1286 1286
 		$member_srl = Context::get('member_srl');
1287 1287
 		$auth_key = Context::get('auth_key');
1288 1288
 
1289
-		if(!$member_srl || !$auth_key)
1289
+		if (!$member_srl || !$auth_key)
1290 1290
 		{
1291 1291
 			return $this->stop('msg_invalid_request');
1292 1292
 		}
@@ -1297,9 +1297,9 @@  discard block
 block discarded – undo
1297 1297
 		$args->auth_key = $auth_key;
1298 1298
 		$output = executeQuery('member.getAuthMail', $args);
1299 1299
 
1300
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
1300
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
1301 1301
 		{
1302
-			if(strlen($output->data->auth_key) !== strlen($auth_key))
1302
+			if (strlen($output->data->auth_key) !== strlen($auth_key))
1303 1303
 			{
1304 1304
 				executeQuery('member.deleteAuthMail', $args);
1305 1305
 			}
@@ -1307,7 +1307,7 @@  discard block
 block discarded – undo
1307 1307
 			return $this->stop('msg_invalid_auth_key');
1308 1308
 		}
1309 1309
 
1310
-		if(ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1310
+		if (ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1311 1311
 		{
1312 1312
 			executeQuery('member.deleteAuthMail', $args);
1313 1313
 			return $this->stop('msg_invalid_auth_key');
@@ -1316,7 +1316,7 @@  discard block
 block discarded – undo
1316 1316
 		$args->password = $output->data->new_password;
1317 1317
 
1318 1318
 		// If credentials are correct, change the password to a new one
1319
-		if($output->data->is_register == 'Y')
1319
+		if ($output->data->is_register == 'Y')
1320 1320
 		{
1321 1321
 			$args->denied = 'N';
1322 1322
 		}
@@ -1329,13 +1329,13 @@  discard block
 block discarded – undo
1329 1329
 		$is_register = $output->data->is_register;
1330 1330
 
1331 1331
 		$output = executeQuery('member.updateMemberPassword', $args);
1332
-		if(!$output->toBool())
1332
+		if (!$output->toBool())
1333 1333
 		{
1334 1334
 			return $this->stop($output->getMessage());
1335 1335
 		}
1336 1336
 
1337 1337
 		// Remove all values having the member_srl from authentication table
1338
-		executeQuery('member.deleteAuthMail',$args);
1338
+		executeQuery('member.deleteAuthMail', $args);
1339 1339
 
1340 1340
 		$this->_clearMemberCache($args->member_srl);
1341 1341
 
@@ -1354,33 +1354,33 @@  discard block
 block discarded – undo
1354 1354
 	{
1355 1355
 		// Get an email_address
1356 1356
 		$email_address = Context::get('email_address');
1357
-		if(!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1357
+		if (!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1358 1358
 		// Log test by using email_address
1359 1359
 		$oMemberModel = getModel('member');
1360 1360
 
1361 1361
 		$args = new stdClass;
1362 1362
 		$args->email_address = $email_address;
1363 1363
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1364
-		if(!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member');
1364
+		if (!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member');
1365 1365
 
1366 1366
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1367 1367
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1368 1368
 
1369 1369
 		$oModuleModel = getModel('module');
1370 1370
 		$member_config = $oModuleModel->getModuleConfig('member');
1371
-		if(!$member_config->skin) $member_config->skin = "default";
1372
-		if(!$member_config->colorset) $member_config->colorset = "white";
1371
+		if (!$member_config->skin) $member_config->skin = "default";
1372
+		if (!$member_config->colorset) $member_config->colorset = "white";
1373 1373
 
1374 1374
 		// Check if a authentication mail has been sent previously
1375 1375
 		$chk_args = new stdClass;
1376 1376
 		$chk_args->member_srl = $member_info->member_srl;
1377 1377
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1378
-		if($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request');
1378
+		if ($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request');
1379 1379
 
1380 1380
 		$auth_args = new stdClass;
1381 1381
 		$auth_args->member_srl = $member_info->member_srl;
1382 1382
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1383
-		if(!$output->data || !$output->data[0]->auth_key)  return new BaseObject(-1, 'msg_invalid_request');
1383
+		if (!$output->data || !$output->data[0]->auth_key)  return new BaseObject(-1, 'msg_invalid_request');
1384 1384
 		$auth_info = $output->data[0];
1385 1385
 
1386 1386
 		// Update the regdate of authmail entry
@@ -1391,12 +1391,12 @@  discard block
 block discarded – undo
1391 1391
 
1392 1392
 		$memberInfo = array();
1393 1393
 		global $lang;
1394
-		if(is_array($member_config->signupForm))
1394
+		if (is_array($member_config->signupForm))
1395 1395
 		{
1396
-			$exceptForm=array('password', 'find_account_question');
1397
-			foreach($member_config->signupForm as $form)
1396
+			$exceptForm = array('password', 'find_account_question');
1397
+			foreach ($member_config->signupForm as $form)
1398 1398
 			{
1399
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1399
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1400 1400
 				{
1401 1401
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1402 1402
 				}
@@ -1415,19 +1415,19 @@  discard block
 block discarded – undo
1415 1415
 		Context::set('member_config', $member_config);
1416 1416
 
1417 1417
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1418
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1418
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1419 1419
 
1420
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1420
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_info->auth_key);
1421 1421
 		Context::set('auth_url', $auth_url);
1422 1422
 
1423 1423
 		$oTemplate = &TemplateHandler::getInstance();
1424 1424
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1425 1425
 		// Send a mail
1426 1426
 		$oMail = new Mail();
1427
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1427
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1428 1428
 		$oMail->setContent($content);
1429
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1430
-		$oMail->setReceiptor( $args->user_name, $args->email_address );
1429
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1430
+		$oMail->setReceiptor($args->user_name, $args->email_address);
1431 1431
 		$oMail->send();
1432 1432
 
1433 1433
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
@@ -1442,23 +1442,23 @@  discard block
 block discarded – undo
1442 1442
 		$memberInfo = $_SESSION['auth_member_info'];
1443 1443
 		unset($_SESSION['auth_member_info']);
1444 1444
 
1445
-		if(!$memberInfo)
1445
+		if (!$memberInfo)
1446 1446
 		{
1447 1447
 			return $this->stop('msg_invalid_request');
1448 1448
 		}
1449 1449
 
1450 1450
 		$newEmail = Context::get('email_address');
1451 1451
 
1452
-		if(!$newEmail)
1452
+		if (!$newEmail)
1453 1453
 		{
1454 1454
 			return $this->stop('msg_invalid_request');
1455 1455
 		}
1456 1456
 
1457 1457
 		$oMemberModel = getModel('member');
1458 1458
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
1459
-		if($member_srl)
1459
+		if ($member_srl)
1460 1460
 		{
1461
-			return new BaseObject(-1,'msg_exists_email_address');
1461
+			return new BaseObject(-1, 'msg_exists_email_address');
1462 1462
 		}
1463 1463
 
1464 1464
 		// remove all key by member_srl
@@ -1466,7 +1466,7 @@  discard block
 block discarded – undo
1466 1466
 		$args->member_srl = $memberInfo->member_srl;
1467 1467
 		$output = executeQuery('member.deleteAuthMail', $args);
1468 1468
 
1469
-		if(!$output->toBool())
1469
+		if (!$output->toBool())
1470 1470
 		{
1471 1471
 			return $output;
1472 1472
 		}
@@ -1476,7 +1476,7 @@  discard block
 block discarded – undo
1476 1476
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
1477 1477
 
1478 1478
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
1479
-		if(!$output->toBool())
1479
+		if (!$output->toBool())
1480 1480
 		{
1481 1481
 			return $this->stop($output->getMessage());
1482 1482
 		}
@@ -1493,7 +1493,7 @@  discard block
 block discarded – undo
1493 1493
 		$auth_args->is_register = 'Y';
1494 1494
 
1495 1495
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1496
-		if(!$output->toBool()) return $output;
1496
+		if (!$output->toBool()) return $output;
1497 1497
 
1498 1498
 		$memberInfo->email_address = $newEmail;
1499 1499
 
@@ -1517,12 +1517,12 @@  discard block
 block discarded – undo
1517 1517
 		$memberInfo = array();
1518 1518
 
1519 1519
 		global $lang;
1520
-		if(is_array($member_config->signupForm))
1520
+		if (is_array($member_config->signupForm))
1521 1521
 		{
1522
-			$exceptForm=array('password', 'find_account_question');
1523
-			foreach($member_config->signupForm as $form)
1522
+			$exceptForm = array('password', 'find_account_question');
1523
+			foreach ($member_config->signupForm as $form)
1524 1524
 			{
1525
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1525
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1526 1526
 				{
1527 1527
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1528 1528
 				}
@@ -1537,25 +1537,25 @@  discard block
 block discarded – undo
1537 1537
 		}
1538 1538
 		Context::set('memberInfo', $memberInfo);
1539 1539
 
1540
-		if(!$member_config->skin) $member_config->skin = "default";
1541
-		if(!$member_config->colorset) $member_config->colorset = "white";
1540
+		if (!$member_config->skin) $member_config->skin = "default";
1541
+		if (!$member_config->colorset) $member_config->colorset = "white";
1542 1542
 
1543 1543
 		Context::set('member_config', $member_config);
1544 1544
 
1545 1545
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1546
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1546
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1547 1547
 
1548
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1548
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
1549 1549
 		Context::set('auth_url', $auth_url);
1550 1550
 
1551 1551
 		$oTemplate = &TemplateHandler::getInstance();
1552 1552
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1553 1553
 		// Send a mail
1554 1554
 		$oMail = new Mail();
1555
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1555
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1556 1556
 		$oMail->setContent($content);
1557
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1558
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1557
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1558
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1559 1559
 		$oMail->send();
1560 1560
 	}
1561 1561
 
@@ -1568,7 +1568,7 @@  discard block
 block discarded – undo
1568 1568
 	{
1569 1569
 		$site_module_info = Context::get('site_module_info');
1570 1570
 		$logged_info = Context::get('logged_info');
1571
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request');
1571
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new BaseObject(-1, 'msg_invalid_request');
1572 1572
 
1573 1573
 		$oMemberModel = getModel('member');
1574 1574
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1587,13 +1587,13 @@  discard block
 block discarded – undo
1587 1587
 	{
1588 1588
 		$site_module_info = Context::get('site_module_info');
1589 1589
 		$logged_info = Context::get('logged_info');
1590
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request');
1590
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new BaseObject(-1, 'msg_invalid_request');
1591 1591
 
1592 1592
 		$args = new stdClass;
1593
-		$args->site_srl= $site_module_info->site_srl;
1593
+		$args->site_srl = $site_module_info->site_srl;
1594 1594
 		$args->member_srl = $logged_info->member_srl;
1595 1595
 		$output = executeQuery('member.deleteMembersGroup', $args);
1596
-		if(!$output->toBool()) return $output;
1596
+		if (!$output->toBool()) return $output;
1597 1597
 		$this->setMessage('success_deleted');
1598 1598
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1599 1599
 	}
@@ -1607,25 +1607,25 @@  discard block
 block discarded – undo
1607 1607
 	 */
1608 1608
 	function setMemberConfig($args)
1609 1609
 	{
1610
-		if(!$args->skin) $args->skin = "default";
1611
-		if(!$args->colorset) $args->colorset = "white";
1612
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1613
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1614
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1615
-		$args->enable_openid= 'N';
1616
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1617
-		if($args->image_name!='Y') $args->image_name = 'N';
1618
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1619
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1620
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1621
-		$args->limit_day = (int)$args->limit_day;
1610
+		if (!$args->skin) $args->skin = "default";
1611
+		if (!$args->colorset) $args->colorset = "white";
1612
+		if (!$args->editor_skin) $args->editor_skin = "ckeditor";
1613
+		if (!$args->editor_colorset) $args->editor_colorset = "moono";
1614
+		if ($args->enable_join != 'Y') $args->enable_join = 'N';
1615
+		$args->enable_openid = 'N';
1616
+		if ($args->profile_image != 'Y') $args->profile_image = 'N';
1617
+		if ($args->image_name != 'Y') $args->image_name = 'N';
1618
+		if ($args->image_mark != 'Y') $args->image_mark = 'N';
1619
+		if ($args->group_image_mark != 'Y') $args->group_image_mark = 'N';
1620
+		if (!trim(strip_tags($args->agreement))) $args->agreement = null;
1621
+		$args->limit_day = (int) $args->limit_day;
1622 1622
 
1623 1623
 		$agreement = trim($args->agreement);
1624 1624
 		unset($args->agreement);
1625 1625
 
1626 1626
 		$oModuleController = getController('module');
1627
-		$output = $oModuleController->insertModuleConfig('member',$args);
1628
-		if(!$output->toBool()) return $output;
1627
+		$output = $oModuleController->insertModuleConfig('member', $args);
1628
+		if (!$output->toBool()) return $output;
1629 1629
 
1630 1630
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1631 1631
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1646,11 +1646,11 @@  discard block
 block discarded – undo
1646 1646
 		$signature = trim(removeHackTag($signature));
1647 1647
 		$signature = preg_replace('/<(\/?)(embed|object|param)/is', '&lt;$1$2', $signature);
1648 1648
 
1649
-		$check_signature = trim(str_replace(array('&nbsp;',"\n","\r"), '', strip_tags($signature, '<img><object>')));
1649
+		$check_signature = trim(str_replace(array('&nbsp;', "\n", "\r"), '', strip_tags($signature, '<img><object>')));
1650 1650
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1651 1651
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1652 1652
 
1653
-		if(!$check_signature) return FileHandler::removeFile($filename);
1653
+		if (!$check_signature) return FileHandler::removeFile($filename);
1654 1654
 
1655 1655
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1656 1656
 		FileHandler::makeDir($path);
@@ -1679,15 +1679,15 @@  discard block
 block discarded – undo
1679 1679
 	 *
1680 1680
 	 * @return BaseObject
1681 1681
 	 */
1682
-	function addMemberToGroup($member_srl, $group_srl, $site_srl=0)
1682
+	function addMemberToGroup($member_srl, $group_srl, $site_srl = 0)
1683 1683
 	{
1684 1684
 		$args = new stdClass();
1685 1685
 		$args->member_srl = $member_srl;
1686 1686
 		$args->group_srl = $group_srl;
1687
-		if($site_srl) $args->site_srl = $site_srl;
1687
+		if ($site_srl) $args->site_srl = $site_srl;
1688 1688
 
1689 1689
 		// Add
1690
-		$output = executeQuery('member.addMemberToGroup',$args);
1690
+		$output = executeQuery('member.addMemberToGroup', $args);
1691 1691
 		$output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args);
1692 1692
 
1693 1693
 		$this->_clearMemberCache($member_srl, $site_srl);
@@ -1707,18 +1707,18 @@  discard block
 block discarded – undo
1707 1707
 	{
1708 1708
 		$obj = new stdClass;
1709 1709
 		$obj->site_srl = $args->site_srl;
1710
-		$obj->member_srl = implode(',',$args->member_srl);
1710
+		$obj->member_srl = implode(',', $args->member_srl);
1711 1711
 
1712 1712
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1713
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1713
+		if ($output->data) foreach ($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1714 1714
 
1715 1715
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1716
-		if(!$output->toBool()) return $output;
1716
+		if (!$output->toBool()) return $output;
1717 1717
 
1718 1718
 		$inserted_members = array();
1719
-		foreach($args->member_srl as $key => $val)
1719
+		foreach ($args->member_srl as $key => $val)
1720 1720
 		{
1721
-			if($inserted_members[$val]) continue;
1721
+			if ($inserted_members[$val]) continue;
1722 1722
 			$inserted_members[$val] = true;
1723 1723
 
1724 1724
 			unset($obj);
@@ -1728,7 +1728,7 @@  discard block
 block discarded – undo
1728 1728
 			$obj->site_srl = $args->site_srl;
1729 1729
 			$obj->regdate = $date[$obj->member_srl];
1730 1730
 			$output = executeQuery('member.addMemberToGroup', $obj);
1731
-			if(!$output->toBool()) return $output;
1731
+			if (!$output->toBool()) return $output;
1732 1732
 
1733 1733
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1734 1734
 		}
@@ -1750,7 +1750,7 @@  discard block
 block discarded – undo
1750 1750
 		// Get information of the key
1751 1751
 		$output = executeQuery('member.getAutologin', $args);
1752 1752
 		// If no information exists, delete a cookie
1753
-		if(!$output->toBool() || !$output->data)
1753
+		if (!$output->toBool() || !$output->data)
1754 1754
 		{
1755 1755
 			saveCookie('xeak');
1756 1756
 			return;
@@ -1762,7 +1762,7 @@  discard block
 block discarded – undo
1762 1762
 		$user_id = ($config->identifier == 'user_id') ? $output->data->user_id : $output->data->email_address;
1763 1763
 		$password = $output->data->password;
1764 1764
 
1765
-		if(!$user_id || !$password)
1765
+		if (!$user_id || !$password)
1766 1766
 		{
1767 1767
 			saveCookie('xeak');
1768 1768
 			return;
@@ -1774,7 +1774,7 @@  discard block
 block discarded – undo
1774 1774
 		$check_key = strtolower($user_id).$password.$_SERVER['HTTP_USER_AGENT'];
1775 1775
 		$check_key = substr(hash_hmac('sha256', $check_key, substr($args->autologin_key, 0, 32)), 0, 32);
1776 1776
 
1777
-		if($check_key === substr($args->autologin_key, 32))
1777
+		if ($check_key === substr($args->autologin_key, 32))
1778 1778
 		{
1779 1779
 			// Check change_password_date
1780 1780
 			$oModuleModel = getModel('module');
@@ -1782,12 +1782,12 @@  discard block
 block discarded – undo
1782 1782
 			$limit_date = $member_config->change_password_date;
1783 1783
 
1784 1784
 			// Check if change_password_date is set
1785
-			if($limit_date > 0)
1785
+			if ($limit_date > 0)
1786 1786
 			{
1787 1787
 				$oMemberModel = getModel('member');
1788 1788
 				$columnList = array('member_srl', 'change_password_date');
1789 1789
 
1790
-				if($config->identifier == 'user_id')
1790
+				if ($config->identifier == 'user_id')
1791 1791
 				{
1792 1792
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1793 1793
 				}
@@ -1796,7 +1796,7 @@  discard block
 block discarded – undo
1796 1796
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1797 1797
 				}
1798 1798
 
1799
-				if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){
1799
+				if ($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day'))) {
1800 1800
 					$do_auto_login = true;
1801 1801
 				}
1802 1802
 
@@ -1807,7 +1807,7 @@  discard block
 block discarded – undo
1807 1807
 			}
1808 1808
 		}
1809 1809
 
1810
-		if($do_auto_login)
1810
+		if ($do_auto_login)
1811 1811
 		{
1812 1812
 			$output = $this->doLogin($user_id);
1813 1813
 		}
@@ -1830,13 +1830,13 @@  discard block
 block discarded – undo
1830 1830
 	function doLogin($user_id, $password = '', $keep_signed = false)
1831 1831
 	{
1832 1832
 		$user_id = strtolower($user_id);
1833
-		if(!$user_id) return new BaseObject(-1, 'null_user_id');
1833
+		if (!$user_id) return new BaseObject(-1, 'null_user_id');
1834 1834
 		// Call a trigger before log-in (before)
1835 1835
 		$trigger_obj = new stdClass();
1836 1836
 		$trigger_obj->user_id = $user_id;
1837 1837
 		$trigger_obj->password = $password;
1838 1838
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1839
-		if(!$trigger_output->toBool()) return $trigger_output;
1839
+		if (!$trigger_output->toBool()) return $trigger_output;
1840 1840
 		// Create a member model object
1841 1841
 		$oMemberModel = getModel('member');
1842 1842
 
@@ -1846,12 +1846,12 @@  discard block
 block discarded – undo
1846 1846
 		$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1847 1847
 
1848 1848
 		// check identifier
1849
-		if($config->identifier == 'email_address')
1849
+		if ($config->identifier == 'email_address')
1850 1850
 		{
1851 1851
 			// Get user_id information
1852 1852
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1853 1853
 			// Set an invalid user if no value returned
1854
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1854
+			if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1855 1855
 
1856 1856
 		}
1857 1857
 		else
@@ -1859,24 +1859,24 @@  discard block
 block discarded – undo
1859 1859
 			// Get user_id information
1860 1860
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1861 1861
 			// Set an invalid user if no value returned
1862
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1862
+			if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1863 1863
 		}
1864 1864
 
1865 1865
 		$output = executeQuery('member.getLoginCountByIp', $args);
1866 1866
 		$errorCount = $output->data->count;
1867
-		if($errorCount >= $config->max_error_count)
1867
+		if ($errorCount >= $config->max_error_count)
1868 1868
 		{
1869 1869
 			$last_update = strtotime($output->data->last_update);
1870
-			$term = intval($_SERVER['REQUEST_TIME']-$last_update);
1871
-			if($term < $config->max_error_count_time)
1870
+			$term = intval($_SERVER['REQUEST_TIME'] - $last_update);
1871
+			if ($term < $config->max_error_count_time)
1872 1872
 			{
1873 1873
 				$term = $config->max_error_count_time - $term;
1874
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1875
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1876
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1877
-				else $term = intval($term/86400).Context::getLang('unit_day');
1874
+				if ($term < 60) $term = intval($term).Context::getLang('unit_sec');
1875
+				elseif (60 <= $term && $term < 3600) $term = intval($term / 60).Context::getLang('unit_min');
1876
+				elseif (3600 <= $term && $term < 86400) $term = intval($term / 3600).Context::getLang('unit_hour');
1877
+				else $term = intval($term / 86400).Context::getLang('unit_day');
1878 1878
 
1879
-				return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1879
+				return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'), $term));
1880 1880
 			}
1881 1881
 			else
1882 1882
 			{
@@ -1886,13 +1886,13 @@  discard block
 block discarded – undo
1886 1886
 		}
1887 1887
 
1888 1888
 		// Password Check
1889
-		if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1889
+		if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1890 1890
 		{
1891
-			return $this->recordMemberLoginError(-1, 'invalid_password',$this->memberInfo);
1891
+			return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo);
1892 1892
 		}
1893 1893
 
1894 1894
 		// If denied == 'Y', notify
1895
-		if($this->memberInfo->denied == 'Y')
1895
+		if ($this->memberInfo->denied == 'Y')
1896 1896
 		{
1897 1897
 			$args->member_srl = $this->memberInfo->member_srl;
1898 1898
 			$output = executeQuery('member.chkAuthMail', $args);
@@ -1900,12 +1900,12 @@  discard block
 block discarded – undo
1900 1900
 			{
1901 1901
 				$_SESSION['auth_member_srl'] = $this->memberInfo->member_srl;
1902 1902
 				$redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail');
1903
-				return $this->setRedirectUrl($redirectUrl, new BaseObject(-1,'msg_user_not_confirmed'));
1903
+				return $this->setRedirectUrl($redirectUrl, new BaseObject(-1, 'msg_user_not_confirmed'));
1904 1904
 			}
1905
-			return new BaseObject(-1,'msg_user_denied');
1905
+			return new BaseObject(-1, 'msg_user_denied');
1906 1906
 		}
1907 1907
 		// Notify if denied_date is less than the current time
1908
-		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new BaseObject(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
1908
+		if ($this->memberInfo->limit_date && substr($this->memberInfo->limit_date, 0, 8) >= date("Ymd")) return new BaseObject(-9, sprintf(Context::getLang('msg_user_limited'), zdate($this->memberInfo->limit_date, "Y-m-d")));
1909 1909
 		// Update the latest login time
1910 1910
 		$args->member_srl = $this->memberInfo->member_srl;
1911 1911
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1915,36 +1915,36 @@  discard block
 block discarded – undo
1915 1915
 
1916 1916
 		// Check if there is recoding table.
1917 1917
 		$oDB = &DB::getInstance();
1918
-		if($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1918
+		if ($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1919 1919
 		{
1920 1920
 			// check if there is login fail records.
1921 1921
 			$output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args);
1922
-			if($output->data && $output->data->content)
1922
+			if ($output->data && $output->data->content)
1923 1923
 			{
1924 1924
 				$title = Context::getLang('login_fail_report');
1925 1925
 				$message = '<ul>';
1926 1926
 				$content = unserialize($output->data->content);
1927
-				if(count($content) > $config->max_error_count)
1927
+				if (count($content) > $config->max_error_count)
1928 1928
 				{
1929
-					foreach($content as $val)
1929
+					foreach ($content as $val)
1930 1930
 					{
1931
-						$message .= '<li>'.Context::getLang('regdate').': '.date('Y-m-d h:i:sa',$val[2]).'<ul><li>'.Context::getLang('ipaddress').': '.$val[0].'</li><li>'.Context::getLang('message').': '.$val[1].'</li></ul></li>';
1931
+						$message .= '<li>'.Context::getLang('regdate').': '.date('Y-m-d h:i:sa', $val[2]).'<ul><li>'.Context::getLang('ipaddress').': '.$val[0].'</li><li>'.Context::getLang('message').': '.$val[1].'</li></ul></li>';
1932 1932
 					}
1933 1933
 					$message .= '</ul>';
1934
-					$content = sprintf(Context::getLang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa'));
1934
+					$content = sprintf(Context::getLang('login_fail_report_contents'), $message, date('Y-m-d h:i:sa'));
1935 1935
 
1936 1936
 					//send message
1937 1937
 					$oCommunicationController = getController('communication');
1938 1938
 					$oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true);
1939 1939
 
1940
-					if($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1940
+					if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1941 1941
 					{
1942 1942
 						$view_url = Context::getRequestUri();
1943
-						$content = sprintf("%s<hr /><p>From: <a href=\"%s\" target=\"_blank\">%s</a><br />To: %s(%s)</p>",$content, $view_url, $view_url, $this->memberInfo->nick_name, $this->memberInfo->email_id);
1943
+						$content = sprintf("%s<hr /><p>From: <a href=\"%s\" target=\"_blank\">%s</a><br />To: %s(%s)</p>", $content, $view_url, $view_url, $this->memberInfo->nick_name, $this->memberInfo->email_id);
1944 1944
 						$oMail = new Mail();
1945 1945
 						$oMail->setTitle($title);
1946 1946
 						$oMail->setContent($content);
1947
-						$oMail->setSender($config->webmaster_name?$config->webmaster_name:'webmaster', $config->webmaster_email);
1947
+						$oMail->setSender($config->webmaster_name ? $config->webmaster_name : 'webmaster', $config->webmaster_email);
1948 1948
 						$oMail->setReceiptor($this->memberInfo->email_id.'('.$this->memberInfo->nick_name.')', $this->memberInfo->email_address);
1949 1949
 						$oMail->send();
1950 1950
 					}
@@ -1954,9 +1954,9 @@  discard block
 block discarded – undo
1954 1954
 		}
1955 1955
 		// Call a trigger after successfully log-in (after)
1956 1956
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1957
-		if(!$trigger_output->toBool()) return $trigger_output;
1957
+		if (!$trigger_output->toBool()) return $trigger_output;
1958 1958
 		// When user checked to use auto-login
1959
-		if($keep_signed)
1959
+		if ($keep_signed)
1960 1960
 		{
1961 1961
 			// Key generate for auto login
1962 1962
 			$oPassword = new Password();
@@ -1968,12 +1968,12 @@  discard block
 block discarded – undo
1968 1968
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1969 1969
 			executeQuery('member.deleteAutologin', $autologin_args);
1970 1970
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1971
-			if($autologin_output->toBool()) saveCookie('xeak', $autologin_args->autologin_key, true, $_SERVER['REQUEST_TIME']+31536000);
1971
+			if ($autologin_output->toBool()) saveCookie('xeak', $autologin_args->autologin_key, true, $_SERVER['REQUEST_TIME'] + 31536000);
1972 1972
 		}
1973
-		if($this->memberInfo->is_admin == 'Y')
1973
+		if ($this->memberInfo->is_admin == 'Y')
1974 1974
 		{
1975 1975
 			$oMemberAdminModel = getAdminModel('member');
1976
-			if(!$oMemberAdminModel->getMemberAdminIPCheck())
1976
+			if (!$oMemberAdminModel->getMemberAdminIPCheck())
1977 1977
 			{
1978 1978
 				$_SESSION['denied_admin'] = 'Y';
1979 1979
 			}
@@ -1991,18 +1991,18 @@  discard block
 block discarded – undo
1991 1991
 	{
1992 1992
 		$oMemberModel = getModel('member');
1993 1993
 		// If your information came through the current session information to extract information from the users
1994
-		if(!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged() )
1994
+		if (!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged())
1995 1995
 		{
1996 1996
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']);
1997 1997
 			// If you do not destroy the session Profile
1998
-			if($this->memberInfo->member_srl != $_SESSION['member_srl'])
1998
+			if ($this->memberInfo->member_srl != $_SESSION['member_srl'])
1999 1999
 			{
2000 2000
 				$this->destroySessionInfo();
2001 2001
 				return;
2002 2002
 			}
2003 2003
 		}
2004 2004
 		// Stop using the session id is destroyed
2005
-		if($this->memberInfo->denied=='Y')
2005
+		if ($this->memberInfo->denied == 'Y')
2006 2006
 		{
2007 2007
 			$this->destroySessionInfo();
2008 2008
 			return;
@@ -2032,10 +2032,10 @@  discard block
 block discarded – undo
2032 2032
 		Context::set('logged_info', $this->memberInfo);
2033 2033
 
2034 2034
 		// Only the menu configuration of the user (such as an add-on to the menu can be changed)
2035
-		$this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info');
2036
-		$this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document');
2037
-		$this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document');
2038
-		$this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document');
2035
+		$this->addMemberMenu('dispMemberInfo', 'cmd_view_member_info');
2036
+		$this->addMemberMenu('dispMemberScrappedDocument', 'cmd_view_scrapped_document');
2037
+		$this->addMemberMenu('dispMemberSavedDocument', 'cmd_view_saved_document');
2038
+		$this->addMemberMenu('dispMemberOwnDocument', 'cmd_view_own_document');
2039 2039
 	}
2040 2040
 
2041 2041
 	/**
@@ -2057,7 +2057,7 @@  discard block
 block discarded – undo
2057 2057
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
2058 2058
 	{
2059 2059
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
2060
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
2060
+		if (!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
2061 2061
 
2062 2062
 		$obj = new stdClass;
2063 2063
 		$obj->url = $url;
@@ -2076,33 +2076,33 @@  discard block
 block discarded – undo
2076 2076
 	{
2077 2077
 		// Call a trigger (before)
2078 2078
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
2079
-		if(!$output->toBool()) return $output;
2079
+		if (!$output->toBool()) return $output;
2080 2080
 		// Terms and Conditions portion of the information set up by members reaffirmed
2081 2081
 		$oModuleModel = getModel('module');
2082 2082
 		$config = $oModuleModel->getModuleConfig('member');
2083 2083
 
2084 2084
 		$logged_info = Context::get('logged_info');
2085 2085
 		// If the date of the temporary restrictions limit further information on the date of
2086
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2086
+		if ($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME'] + $config->limit_day * 60 * 60 * 24);
2087 2087
 
2088 2088
 		$args->member_srl = getNextSequence();
2089 2089
 		$args->list_order = -1 * $args->member_srl;
2090 2090
 
2091 2091
 		// Execute insert or update depending on the value of member_srl
2092
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2092
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
2093 2093
 		// Enter the user's identity changed to lowercase
2094 2094
 		else $args->user_id = strtolower($args->user_id);
2095
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2096
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
2095
+		if (!$args->user_name) $args->user_name = $args->member_srl;
2096
+		if (!$args->nick_name) $args->nick_name = $args->member_srl;
2097 2097
 
2098 2098
 		// Control of essential parameters
2099
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2100
-		if($args->denied!='Y') $args->denied = 'N';
2101
-		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y';
2099
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
2100
+		if ($args->denied != 'Y') $args->denied = 'N';
2101
+		if (!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F')))) $args->allow_message = 'Y';
2102 2102
 
2103
-		if($logged_info->is_admin == 'Y')
2103
+		if ($logged_info->is_admin == 'Y')
2104 2104
 		{
2105
-			if($args->is_admin!='Y') $args->is_admin = 'N';
2105
+			if ($args->is_admin != 'Y') $args->is_admin = 'N';
2106 2106
 		}
2107 2107
 		else
2108 2108
 		{
@@ -2117,97 +2117,97 @@  discard block
 block discarded – undo
2117 2117
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2118 2118
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2119 2119
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2120
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2121
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
2120
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//i", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
2121
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//i", $args->blog)) $args->blog = 'http://'.$args->blog;
2122 2122
 
2123 2123
 		// Create a model object
2124 2124
 		$oMemberModel = getModel('member');
2125 2125
 
2126 2126
 		// Check password strength
2127
-		if($args->password && !$password_is_hashed)
2127
+		if ($args->password && !$password_is_hashed)
2128 2128
 		{
2129
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2129
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2130 2130
 			{
2131 2131
 				$message = Context::getLang('about_password_strength');
2132 2132
 				return new BaseObject(-1, $message[$config->password_strength]);
2133 2133
 			}
2134 2134
 			$args->password = $oMemberModel->hashPassword($args->password);
2135 2135
 		}
2136
-		elseif(!$args->password)
2136
+		elseif (!$args->password)
2137 2137
 		{
2138 2138
 			unset($args->password);
2139 2139
 		}
2140 2140
 
2141
-		if($args->find_account_answer && !$password_is_hashed)
2141
+		if ($args->find_account_answer && !$password_is_hashed)
2142 2142
 		{
2143 2143
 			$args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer);
2144 2144
 		}
2145
-		elseif(!$args->find_account_answer)
2145
+		elseif (!$args->find_account_answer)
2146 2146
 		{
2147 2147
 			unset($args->find_account_answer);
2148 2148
 		}
2149 2149
 
2150 2150
 		// Check if ID is prohibited
2151
-		if($oMemberModel->isDeniedID($args->user_id))
2151
+		if ($oMemberModel->isDeniedID($args->user_id))
2152 2152
 		{
2153
-			return new BaseObject(-1,'denied_user_id');
2153
+			return new BaseObject(-1, 'denied_user_id');
2154 2154
 		}
2155 2155
 
2156 2156
 		// Check if ID is duplicate
2157 2157
 		$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2158
-		if($member_srl)
2158
+		if ($member_srl)
2159 2159
 		{
2160
-			return new BaseObject(-1,'msg_exists_user_id');
2160
+			return new BaseObject(-1, 'msg_exists_user_id');
2161 2161
 		}
2162 2162
 
2163 2163
 		// Check if nickname is prohibited
2164
-		if($oMemberModel->isDeniedNickName($args->nick_name))
2164
+		if ($oMemberModel->isDeniedNickName($args->nick_name))
2165 2165
 		{
2166
-			return new BaseObject(-1,'denied_nick_name');
2166
+			return new BaseObject(-1, 'denied_nick_name');
2167 2167
 		}
2168 2168
 
2169 2169
 		// Check if nickname is duplicate
2170 2170
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
2171
-		if($member_srl)
2171
+		if ($member_srl)
2172 2172
 		{
2173
-			return new BaseObject(-1,'msg_exists_nick_name');
2173
+			return new BaseObject(-1, 'msg_exists_nick_name');
2174 2174
 		}
2175 2175
 
2176 2176
 		// Check if email address is duplicate
2177 2177
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2178
-		if($member_srl)
2178
+		if ($member_srl)
2179 2179
 		{
2180
-			return new BaseObject(-1,'msg_exists_email_address');
2180
+			return new BaseObject(-1, 'msg_exists_email_address');
2181 2181
 		}
2182 2182
 
2183 2183
 		// Insert data into the DB
2184 2184
 		$args->list_order = -1 * $args->member_srl;
2185 2185
 
2186
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2187
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2186
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
2187
+		if (!$args->user_name) $args->user_name = $args->member_srl;
2188 2188
 
2189 2189
 		$oDB = &DB::getInstance();
2190 2190
 		$oDB->begin();
2191 2191
 
2192 2192
 		$output = executeQuery('member.insertMember', $args);
2193
-		if(!$output->toBool())
2193
+		if (!$output->toBool())
2194 2194
 		{
2195 2195
 			$oDB->rollback();
2196 2196
 			return $output;
2197 2197
 		}
2198 2198
 
2199
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2199
+		if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2200 2200
 		else $group_srl_list = explode('|@|', $args->group_srl_list);
2201 2201
 		// If no value is entered the default group, the value of group registration
2202
-		if(!$args->group_srl_list)
2202
+		if (!$args->group_srl_list)
2203 2203
 		{
2204 2204
 			$columnList = array('site_srl', 'group_srl');
2205 2205
 			$default_group = $oMemberModel->getDefaultGroup(0, $columnList);
2206
-			if($default_group)
2206
+			if ($default_group)
2207 2207
 			{
2208 2208
 				// Add to the default group
2209
-				$output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl);
2210
-				if(!$output->toBool())
2209
+				$output = $this->addMemberToGroup($args->member_srl, $default_group->group_srl);
2210
+				if (!$output->toBool())
2211 2211
 				{
2212 2212
 					$oDB->rollback();
2213 2213
 					return $output;
@@ -2217,11 +2217,11 @@  discard block
 block discarded – undo
2217 2217
 		}
2218 2218
 		else
2219 2219
 		{
2220
-			for($i=0;$i<count($group_srl_list);$i++)
2220
+			for ($i = 0; $i < count($group_srl_list); $i++)
2221 2221
 			{
2222
-				$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2222
+				$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2223 2223
 
2224
-				if(!$output->toBool())
2224
+				if (!$output->toBool())
2225 2225
 				{
2226 2226
 					$oDB->rollback();
2227 2227
 					return $output;
@@ -2231,7 +2231,7 @@  discard block
 block discarded – undo
2231 2231
 
2232 2232
 		$member_config = $oModuleModel->getModuleConfig('member');
2233 2233
 		// When using email authentication mode (when you subscribed members denied a) certified mail sent
2234
-		if($args->denied == 'Y')
2234
+		if ($args->denied == 'Y')
2235 2235
 		{
2236 2236
 			// Insert data into the authentication DB
2237 2237
 			$oPassword = new Password();
@@ -2243,7 +2243,7 @@  discard block
 block discarded – undo
2243 2243
 			$auth_args->is_register = 'Y';
2244 2244
 
2245 2245
 			$output = executeQuery('member.insertAuthMail', $auth_args);
2246
-			if(!$output->toBool())
2246
+			if (!$output->toBool())
2247 2247
 			{
2248 2248
 				$oDB->rollback();
2249 2249
 				return $output;
@@ -2251,10 +2251,10 @@  discard block
 block discarded – undo
2251 2251
 			$this->_sendAuthMail($auth_args, $args);
2252 2252
 		}
2253 2253
 		// Call a trigger (after)
2254
-		if($output->toBool())
2254
+		if ($output->toBool())
2255 2255
 		{
2256 2256
 			$trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args);
2257
-			if(!$trigger_output->toBool())
2257
+			if (!$trigger_output->toBool())
2258 2258
 			{
2259 2259
 				$oDB->rollback();
2260 2260
 				return $trigger_output;
@@ -2276,41 +2276,41 @@  discard block
 block discarded – undo
2276 2276
 	{
2277 2277
 		// Call a trigger (before)
2278 2278
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2279
-		if(!$output->toBool()) return $output;
2279
+		if (!$output->toBool()) return $output;
2280 2280
 		// Create a model object
2281 2281
 		$oMemberModel = getModel('member');
2282 2282
 
2283 2283
 		$logged_info = Context::get('logged_info');
2284 2284
 		// Get what you want to modify the original information
2285
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2285
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2286 2286
 		// Control of essential parameters
2287
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2288
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2287
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
2288
+		if ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F'))) $args->allow_message = 'Y';
2289 2289
 
2290
-		if($logged_info->is_admin == 'Y')
2290
+		if ($logged_info->is_admin == 'Y')
2291 2291
 		{
2292
-			if($args->denied!='Y') $args->denied = 'N';
2293
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2292
+			if ($args->denied != 'Y') $args->denied = 'N';
2293
+			if ($args->is_admin != 'Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2294 2294
 		}
2295 2295
 		else
2296 2296
 		{
2297 2297
 			unset($args->is_admin);
2298
-			if($is_admin == false)
2298
+			if ($is_admin == false)
2299 2299
 				unset($args->denied);
2300
-			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2300
+			if ($logged_info->member_srl != $args->member_srl && $is_admin == false)
2301 2301
 			{
2302 2302
 				return $this->stop('msg_invalid_request');
2303 2303
 			}
2304 2304
 		}
2305 2305
 
2306 2306
 		// Sanitize user ID, username, nickname, homepage, blog
2307
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2307
+		if ($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2308 2308
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2309 2309
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2310 2310
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2311 2311
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2312
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2313
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2312
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//is", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
2313
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//is", $args->blog)) $args->blog = 'http://'.$args->blog;
2314 2314
 
2315 2315
 		// check member identifier form
2316 2316
 		$config = $oMemberModel->getMemberConfig();
@@ -2319,56 +2319,56 @@  discard block
 block discarded – undo
2319 2319
 		$orgMemberInfo = $output->data;
2320 2320
 
2321 2321
 		// Check if email address or user ID is duplicate
2322
-		if($config->identifier == 'email_address')
2322
+		if ($config->identifier == 'email_address')
2323 2323
 		{
2324 2324
 			$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2325
-			if($member_srl && $args->member_srl != $member_srl)
2325
+			if ($member_srl && $args->member_srl != $member_srl)
2326 2326
 			{
2327
-				return new BaseObject(-1,'msg_exists_email_address');
2327
+				return new BaseObject(-1, 'msg_exists_email_address');
2328 2328
 			}
2329 2329
 			$args->email_address = $orgMemberInfo->email_address;
2330 2330
 		}
2331 2331
 		else
2332 2332
 		{
2333 2333
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2334
-			if($member_srl && $args->member_srl != $member_srl)
2334
+			if ($member_srl && $args->member_srl != $member_srl)
2335 2335
 			{
2336
-				return new BaseObject(-1,'msg_exists_user_id');
2336
+				return new BaseObject(-1, 'msg_exists_user_id');
2337 2337
 			}
2338 2338
 
2339 2339
 			$args->user_id = $orgMemberInfo->user_id;
2340 2340
 		}
2341 2341
 
2342
-		if($logged_info->is_admin !== 'Y')
2342
+		if ($logged_info->is_admin !== 'Y')
2343 2343
 		{
2344 2344
 			// Check if ID is prohibited
2345
-			if($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2345
+			if ($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2346 2346
 			{
2347
-				return new BaseObject(-1,'denied_user_id');
2347
+				return new BaseObject(-1, 'denied_user_id');
2348 2348
 			}
2349 2349
 
2350 2350
 			// Check if nickname is prohibited
2351
-			if($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2351
+			if ($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2352 2352
 			{
2353 2353
 				return new BaseObject(-1, 'denied_nick_name');
2354 2354
 			}
2355 2355
 		}
2356 2356
 
2357 2357
 		// Check if ID is duplicate
2358
-		if($args->user_id)
2358
+		if ($args->user_id)
2359 2359
 		{
2360 2360
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2361
-			if($member_srl && $args->member_srl != $member_srl)
2361
+			if ($member_srl && $args->member_srl != $member_srl)
2362 2362
 			{
2363
-				return new BaseObject(-1,'msg_exists_user_id');
2363
+				return new BaseObject(-1, 'msg_exists_user_id');
2364 2364
 			}
2365 2365
 		}
2366 2366
 
2367 2367
 		// Check if nickname is duplicate
2368 2368
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
2369
- 		if($member_srl && $args->member_srl != $member_srl)
2369
+ 		if ($member_srl && $args->member_srl != $member_srl)
2370 2370
  		{
2371
- 			return new BaseObject(-1,'msg_exists_nick_name');
2371
+ 			return new BaseObject(-1, 'msg_exists_nick_name');
2372 2372
  		}
2373 2373
 
2374 2374
 		list($args->email_id, $args->email_host) = explode('@', $args->email_address);
@@ -2377,9 +2377,9 @@  discard block
 block discarded – undo
2377 2377
 		$oDB->begin();
2378 2378
 
2379 2379
 		// Check password strength
2380
-		if($args->password)
2380
+		if ($args->password)
2381 2381
 		{
2382
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2382
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2383 2383
 			{
2384 2384
 				$message = Context::getLang('about_password_strength');
2385 2385
 				return new BaseObject(-1, $message[$config->password_strength]);
@@ -2391,55 +2391,55 @@  discard block
 block discarded – undo
2391 2391
 			$args->password = $orgMemberInfo->password;
2392 2392
 		}
2393 2393
 
2394
-		if($args->find_account_answer) {
2394
+		if ($args->find_account_answer) {
2395 2395
 			$args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer);
2396 2396
 		}
2397 2397
 		else
2398 2398
 		{
2399
-			$oPassword =  new Password();
2399
+			$oPassword = new Password();
2400 2400
 			$hashed = $oPassword->checkAlgorithm($orgMemberInfo->find_account_answer);
2401 2401
 
2402
-			if($hashed) {
2402
+			if ($hashed) {
2403 2403
 				$args->find_account_answer = $orgMemberInfo->find_account_answer;
2404 2404
 			} else {
2405 2405
 				$args->find_account_answer = $oPassword->createHash($orgMemberInfo->find_account_answer);
2406 2406
 			}
2407 2407
 		}
2408 2408
 
2409
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2410
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2411
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2412
-		if(!$args->description) $args->description = $orgMemberInfo->description;
2413
-		if(!$args->birthday) $args->birthday = '';
2409
+		if (!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2410
+		if (!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2411
+		if (!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2412
+		if (!$args->description) $args->description = $orgMemberInfo->description;
2413
+		if (!$args->birthday) $args->birthday = '';
2414 2414
 
2415 2415
 		$output = executeQuery('member.updateMember', $args);
2416 2416
 
2417
-		if(!$output->toBool())
2417
+		if (!$output->toBool())
2418 2418
 		{
2419 2419
 			$oDB->rollback();
2420 2420
 			return $output;
2421 2421
 		}
2422 2422
 
2423
-		if($args->group_srl_list)
2423
+		if ($args->group_srl_list)
2424 2424
 		{
2425
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2425
+			if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2426 2426
 			else $group_srl_list = explode('|@|', $args->group_srl_list);
2427 2427
 			// If the group information, group information changes
2428
-			if(count($group_srl_list) > 0)
2428
+			if (count($group_srl_list) > 0)
2429 2429
 			{
2430 2430
 				$args->site_srl = 0;
2431 2431
 				// One of its members to delete all the group
2432 2432
 				$output = executeQuery('member.deleteMemberGroupMember', $args);
2433
-				if(!$output->toBool())
2433
+				if (!$output->toBool())
2434 2434
 				{
2435 2435
 					$oDB->rollback();
2436 2436
 					return $output;
2437 2437
 				}
2438 2438
 				// Enter one of the loop a
2439
-				for($i=0;$i<count($group_srl_list);$i++)
2439
+				for ($i = 0; $i < count($group_srl_list); $i++)
2440 2440
 				{
2441
-					$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2442
-					if(!$output->toBool())
2441
+					$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2442
+					if (!$output->toBool())
2443 2443
 					{
2444 2444
 						$oDB->rollback();
2445 2445
 						return $output;
@@ -2451,9 +2451,9 @@  discard block
 block discarded – undo
2451 2451
 			}
2452 2452
 		}
2453 2453
 		// Call a trigger (after)
2454
-		if($output->toBool()) {
2454
+		if ($output->toBool()) {
2455 2455
 			$trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args);
2456
-			if(!$trigger_output->toBool())
2456
+			if (!$trigger_output->toBool())
2457 2457
 			{
2458 2458
 				$oDB->rollback();
2459 2459
 				return $trigger_output;
@@ -2466,7 +2466,7 @@  discard block
 block discarded – undo
2466 2466
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2467 2467
 
2468 2468
 		// Save Session
2469
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2469
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2470 2470
 		$logged_info = Context::get('logged_info');
2471 2471
 
2472 2472
 		$output->add('member_srl', $args->member_srl);
@@ -2478,14 +2478,14 @@  discard block
 block discarded – undo
2478 2478
 	 */
2479 2479
 	function updateMemberPassword($args)
2480 2480
 	{
2481
-		if($args->password)
2481
+		if ($args->password)
2482 2482
 		{
2483 2483
 
2484 2484
 			// check password strength
2485 2485
 			$oMemberModel = getModel('member');
2486 2486
 			$config = $oMemberModel->getMemberConfig();
2487 2487
 
2488
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2488
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2489 2489
 			{
2490 2490
 				$message = Context::getLang('about_password_strength');
2491 2491
 				return new BaseObject(-1, $message[$config->password_strength]);
@@ -2493,13 +2493,13 @@  discard block
 block discarded – undo
2493 2493
 
2494 2494
 			$args->password = $oMemberModel->hashPassword($args->password);
2495 2495
 		}
2496
-		else if($args->hashed_password)
2496
+		else if ($args->hashed_password)
2497 2497
 		{
2498 2498
 			$args->password = $args->hashed_password;
2499 2499
 		}
2500 2500
 
2501 2501
 		$output = executeQuery('member.updateMemberPassword', $args);
2502
-		if($output->toBool())
2502
+		if ($output->toBool())
2503 2503
 		{
2504 2504
 			$result = executeQuery('member.updateChangePasswordDate', $args);
2505 2505
 		}
@@ -2511,7 +2511,7 @@  discard block
 block discarded – undo
2511 2511
 
2512 2512
 	function updateFindAccountAnswer($member_srl, $answer)
2513 2513
 	{
2514
-		$oPassword =  new Password();
2514
+		$oPassword = new Password();
2515 2515
 
2516 2516
 		$args = new stdClass();
2517 2517
 		$args->member_srl = $member_srl;
@@ -2528,18 +2528,18 @@  discard block
 block discarded – undo
2528 2528
 		$trigger_obj = new stdClass();
2529 2529
 		$trigger_obj->member_srl = $member_srl;
2530 2530
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2531
-		if(!$output->toBool()) return $output;
2531
+		if (!$output->toBool()) return $output;
2532 2532
 		// Create a model object
2533 2533
 		$oMemberModel = getModel('member');
2534 2534
 		// Bringing the user's information
2535
-		if(!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2535
+		if (!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2536 2536
 		{
2537 2537
 			$columnList = array('member_srl', 'is_admin');
2538 2538
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2539 2539
 		}
2540
-		if(!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member');
2540
+		if (!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member');
2541 2541
 		// If managers can not be deleted
2542
-		if($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin');
2542
+		if ($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin');
2543 2543
 
2544 2544
 		$oDB = &DB::getInstance();
2545 2545
 		$oDB->begin();
@@ -2548,7 +2548,7 @@  discard block
 block discarded – undo
2548 2548
 		$args->member_srl = $member_srl;
2549 2549
 		// Delete the entries in member_auth_mail
2550 2550
 		$output = executeQuery('member.deleteAuthMail', $args);
2551
-		if(!$output->toBool())
2551
+		if (!$output->toBool())
2552 2552
 		{
2553 2553
 			$oDB->rollback();
2554 2554
 			return $output;
@@ -2563,23 +2563,23 @@  discard block
 block discarded – undo
2563 2563
 		 */
2564 2564
 		// Delete the entries in member_group_member
2565 2565
 		$output = executeQuery('member.deleteMemberGroupMember', $args);
2566
-		if(!$output->toBool())
2566
+		if (!$output->toBool())
2567 2567
 		{
2568 2568
 			$oDB->rollback();
2569 2569
 			return $output;
2570 2570
 		}
2571 2571
 		// member removed from the table
2572 2572
 		$output = executeQuery('member.deleteMember', $args);
2573
-		if(!$output->toBool())
2573
+		if (!$output->toBool())
2574 2574
 		{
2575 2575
 			$oDB->rollback();
2576 2576
 			return $output;
2577 2577
 		}
2578 2578
 		// Call a trigger (after)
2579
-		if($output->toBool())
2579
+		if ($output->toBool())
2580 2580
 		{
2581 2581
 			$trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj);
2582
-			if(!$trigger_output->toBool())
2582
+			if (!$trigger_output->toBool())
2583 2583
 			{
2584 2584
 				$oDB->rollback();
2585 2585
 				return $trigger_output;
@@ -2603,12 +2603,12 @@  discard block
 block discarded – undo
2603 2603
 	 */
2604 2604
 	function destroySessionInfo()
2605 2605
 	{
2606
-		if(!$_SESSION || !is_array($_SESSION)) return;
2606
+		if (!$_SESSION || !is_array($_SESSION)) return;
2607 2607
 
2608 2608
 		$memberInfo = Context::get('logged_info');
2609 2609
 		$memberSrl = $memberInfo->member_srl;
2610 2610
 
2611
-		foreach($_SESSION as $key => $val)
2611
+		foreach ($_SESSION as $key => $val)
2612 2612
 		{
2613 2613
 			$_SESSION[$key] = '';
2614 2614
 		}
@@ -2619,7 +2619,7 @@  discard block
 block discarded – undo
2619 2619
 		saveCookie('xeak');
2620 2620
 		saveCookie('xe_logged', 'false');
2621 2621
 
2622
-		if($memberSrl || $_COOKIE['xeak'])
2622
+		if ($memberSrl || $_COOKIE['xeak'])
2623 2623
 		{
2624 2624
 			$args = new stdClass();
2625 2625
 			$args->member_srl = $memberSrl;
@@ -2635,22 +2635,22 @@  discard block
 block discarded – undo
2635 2635
 		$pointGroup = $pointModuleConfig->point_group;
2636 2636
 
2637 2637
 		$levelGroup = array();
2638
-		if(is_array($pointGroup) && count($pointGroup)>0)
2638
+		if (is_array($pointGroup) && count($pointGroup) > 0)
2639 2639
 		{
2640 2640
 			$levelGroup = array_flip($pointGroup);
2641 2641
 			ksort($levelGroup);
2642 2642
 		}
2643 2643
 		$maxLevel = 0;
2644 2644
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2645
-		if(count($resultGroup) > 0)
2645
+		if (count($resultGroup) > 0)
2646 2646
 			$maxLevel = max(array_flip($resultGroup));
2647 2647
 
2648
-		if($maxLevel > 0)
2648
+		if ($maxLevel > 0)
2649 2649
 		{
2650 2650
 			$oPointModel = getModel('point');
2651 2651
 			$originPoint = $oPointModel->getPoint($memberSrl);
2652 2652
 
2653
-			if($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2653
+			if ($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2654 2654
 			{
2655 2655
 				$oPointController = getController('point');
2656 2656
 				$oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel], 'update');
@@ -2660,18 +2660,18 @@  discard block
 block discarded – undo
2660 2660
 
2661 2661
 	function procMemberModifyEmailAddress()
2662 2662
 	{
2663
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2663
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
2664 2664
 
2665 2665
 		$member_info = Context::get('logged_info');
2666 2666
 		$newEmail = Context::get('email_address');
2667 2667
 
2668
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2668
+		if (!$newEmail) return $this->stop('msg_invalid_request');
2669 2669
 
2670 2670
 		$oMemberModel = getModel('member');
2671 2671
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2672
-		if($member_srl) return new BaseObject(-1,'msg_exists_email_address');
2672
+		if ($member_srl) return new BaseObject(-1, 'msg_exists_email_address');
2673 2673
 
2674
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2674
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2675 2675
 		{
2676 2676
 			return $this->stop('msg_invalid_request');
2677 2677
 		}
@@ -2687,7 +2687,7 @@  discard block
 block discarded – undo
2687 2687
 		$oDB = &DB::getInstance();
2688 2688
 		$oDB->begin();
2689 2689
 		$output = executeQuery('member.insertAuthMail', $auth_args);
2690
-		if(!$output->toBool())
2690
+		if (!$output->toBool())
2691 2691
 		{
2692 2692
 			$oDB->rollback();
2693 2693
 			return $output;
@@ -2697,7 +2697,7 @@  discard block
 block discarded – undo
2697 2697
 		$member_config = $oModuleModel->getModuleConfig('member');
2698 2698
 
2699 2699
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2700
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2700
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2701 2701
 
2702 2702
 		global $lang;
2703 2703
 
@@ -2709,17 +2709,17 @@  discard block
 block discarded – undo
2709 2709
 
2710 2710
 		Context::set('newEmail', $newEmail);
2711 2711
 
2712
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthEmailAddress','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
2712
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
2713 2713
 		Context::set('auth_url', $auth_url);
2714 2714
 
2715 2715
 		$oTemplate = &TemplateHandler::getInstance();
2716 2716
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_new_email');
2717 2717
 
2718 2718
 		$oMail = new Mail();
2719
-		$oMail->setTitle( Context::getLang('title_modify_email_address') );
2719
+		$oMail->setTitle(Context::getLang('title_modify_email_address'));
2720 2720
 		$oMail->setContent($content);
2721
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
2722
-		$oMail->setReceiptor( $member_info->nick_name, $newEmail );
2721
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
2722
+		$oMail->setReceiptor($member_info->nick_name, $newEmail);
2723 2723
 		$result = $oMail->send();
2724 2724
 
2725 2725
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail);
@@ -2733,16 +2733,16 @@  discard block
 block discarded – undo
2733 2733
 	{
2734 2734
 		$member_srl = Context::get('member_srl');
2735 2735
 		$auth_key = Context::get('auth_key');
2736
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2736
+		if (!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2737 2737
 
2738 2738
 		// Test logs for finding password by user_id and authkey
2739 2739
 		$args = new stdClass;
2740 2740
 		$args->member_srl = $member_srl;
2741 2741
 		$args->auth_key = $auth_key;
2742 2742
 		$output = executeQuery('member.getAuthMail', $args);
2743
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2743
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
2744 2744
 		{
2745
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2745
+			if (strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2746 2746
 			return $this->stop('msg_invalid_modify_email_auth_key');
2747 2747
 		}
2748 2748
 
@@ -2751,10 +2751,10 @@  discard block
 block discarded – undo
2751 2751
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2752 2752
 
2753 2753
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2754
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2754
+		if (!$output->toBool()) return $this->stop($output->getMessage());
2755 2755
 
2756 2756
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2757
-		executeQuery('member.deleteAuthChangeEmailAddress',$args);
2757
+		executeQuery('member.deleteAuthChangeEmailAddress', $args);
2758 2758
 
2759 2759
 		$this->_clearMemberCache($args->member_srl);
2760 2760
 
@@ -2772,7 +2772,7 @@  discard block
 block discarded – undo
2772 2772
 	**/
2773 2773
 	function triggerGetDocumentMenu(&$menu_list)
2774 2774
 	{
2775
-		if(!Context::get('is_logged')) return new BaseObject();
2775
+		if (!Context::get('is_logged')) return new BaseObject();
2776 2776
 
2777 2777
 		$logged_info = Context::get('logged_info');
2778 2778
 		$document_srl = Context::get('target_srl');
@@ -2783,12 +2783,12 @@  discard block
 block discarded – undo
2783 2783
 		$member_srl = $oDocument->get('member_srl');
2784 2784
 		$module_srl = $oDocument->get('module_srl');
2785 2785
 
2786
-		if(!$member_srl) return new BaseObject();
2787
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject();
2786
+		if (!$member_srl) return new BaseObject();
2787
+		if ($oDocumentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new BaseObject();
2788 2788
 
2789 2789
 		$oDocumentController = getController('document');
2790
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2791
-		$oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup');
2790
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2791
+		$oDocumentController->addDocumentPopupMenu($url, 'cmd_spammer', '', 'popup');
2792 2792
 
2793 2793
 		return new BaseObject();
2794 2794
 	}
@@ -2802,7 +2802,7 @@  discard block
 block discarded – undo
2802 2802
 	**/
2803 2803
 	function triggerGetCommentMenu(&$menu_list)
2804 2804
 	{
2805
-		if(!Context::get('is_logged')) return new BaseObject();
2805
+		if (!Context::get('is_logged')) return new BaseObject();
2806 2806
 
2807 2807
 		$logged_info = Context::get('logged_info');
2808 2808
 		$comment_srl = Context::get('target_srl');
@@ -2813,12 +2813,12 @@  discard block
 block discarded – undo
2813 2813
 		$module_srl = $oComment->get('module_srl');
2814 2814
 		$member_srl = $oComment->get('member_srl');
2815 2815
 
2816
-		if(!$member_srl) return new BaseObject();
2817
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject();
2816
+		if (!$member_srl) return new BaseObject();
2817
+		if ($oCommentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new BaseObject();
2818 2818
 
2819 2819
 		$oCommentController = getController('comment');
2820
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2821
-		$oCommentController->addCommentPopupMenu($url,'cmd_spammer','','popup');
2820
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2821
+		$oCommentController->addCommentPopupMenu($url, 'cmd_spammer', '', 'popup');
2822 2822
 
2823 2823
 		return new BaseObject();
2824 2824
 	}
@@ -2830,7 +2830,7 @@  discard block
 block discarded – undo
2830 2830
 	**/
2831 2831
 	function procMemberSpammerManage()
2832 2832
 	{
2833
-		if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
2833
+		if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_permitted');
2834 2834
 
2835 2835
 		$logged_info = Context::get('logged_info');
2836 2836
 		$member_srl = Context::get('member_srl');
@@ -2838,7 +2838,7 @@  discard block
 block discarded – undo
2838 2838
 		$cnt_loop = Context::get('cnt_loop');
2839 2839
 		$proc_type = Context::get('proc_type');
2840 2840
 		$isMoveToTrash = true;
2841
-		if($proc_type == "delete")
2841
+		if ($proc_type == "delete")
2842 2842
 			$isMoveToTrash = false;
2843 2843
 
2844 2844
 		// check grant
@@ -2847,7 +2847,7 @@  discard block
 block discarded – undo
2847 2847
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2848 2848
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2849 2849
 
2850
-		if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted');
2850
+		if (!$grant->manager) return new BaseObject(-1, 'msg_not_permitted');
2851 2851
 
2852 2852
 		$proc_msg = "";
2853 2853
 
@@ -2856,10 +2856,10 @@  discard block
 block discarded – undo
2856 2856
 
2857 2857
 		// delete or trash destination
2858 2858
 		// proc member
2859
-		if($cnt_loop == 1)
2859
+		if ($cnt_loop == 1)
2860 2860
 			$this->_spammerMember($member_srl);
2861 2861
 		// proc document and comment
2862
-		elseif($cnt_loop>1)
2862
+		elseif ($cnt_loop > 1)
2863 2863
 			$this->_spammerDocuments($member_srl, $isMoveToTrash);
2864 2864
 
2865 2865
 		// get destination count
@@ -2868,11 +2868,11 @@  discard block
 block discarded – undo
2868 2868
 
2869 2869
 		$total_count = Context::get('total_count');
2870 2870
 		$remain_count = $cnt_document + $cnt_comment;
2871
-		if($cnt_loop == 1) $total_count = $remain_count;
2871
+		if ($cnt_loop == 1) $total_count = $remain_count;
2872 2872
 
2873 2873
 		// get progress percent
2874
-		if($total_count > 0)
2875
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2874
+		if ($total_count > 0)
2875
+			$progress = intval((($total_count - $remain_count) / $total_count) * 100);
2876 2876
 		else
2877 2877
 			$progress = 100;
2878 2878
 
@@ -2896,7 +2896,7 @@  discard block
 block discarded – undo
2896 2896
 	**/
2897 2897
 	private function _spammerMember($member_srl) {
2898 2898
 		$logged_info = Context::get('logged_info');
2899
-		$spam_description = trim( Context::get('spam_description') );
2899
+		$spam_description = trim(Context::get('spam_description'));
2900 2900
 
2901 2901
 		$oMemberModel = getModel('member');
2902 2902
 		$columnList = array('member_srl', 'email_address', 'user_id', 'nick_name', 'description');
@@ -2915,10 +2915,10 @@  discard block
 block discarded – undo
2915 2915
 		$args->user_id = $member_info->user_id;
2916 2916
 		$args->nick_name = $member_info->nick_name;
2917 2917
 		$args->denied = "Y";
2918
-		$args->description = trim( $member_info->description );
2919
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
2918
+		$args->description = trim($member_info->description);
2919
+		if ($args->description != "") $args->description .= "\n"; // add new line
2920 2920
 
2921
-		$args->description .= Context::getLang('cmd_spammer') . "[" . date("Y-m-d H:i:s") . " from:" . $logged_info->user_id . " info:" . $spam_description . " docuemnts count:" . $total_count . "]";
2921
+		$args->description .= Context::getLang('cmd_spammer')."[".date("Y-m-d H:i:s")." from:".$logged_info->user_id." info:".$spam_description." docuemnts count:".$total_count."]";
2922 2922
 
2923 2923
 		$output = $this->updateMember($args, true);
2924 2924
 
@@ -2947,21 +2947,21 @@  discard block
 block discarded – undo
2947 2947
 		// 1. proc comment, 2. proc document
2948 2948
 		$cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl);
2949 2949
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
2950
-		if($cnt_comment > 0)
2950
+		if ($cnt_comment > 0)
2951 2951
 		{
2952 2952
 			$columnList = array();
2953 2953
 			$commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2954
-			if($commentList) {
2955
-				foreach($commentList as $v) {
2954
+			if ($commentList) {
2955
+				foreach ($commentList as $v) {
2956 2956
 					$oCommentController->deleteComment($v->comment_srl, true, $isMoveToTrash);
2957 2957
 				}
2958 2958
 			}
2959
-		} elseif($cnt_document > 0) {
2959
+		} elseif ($cnt_document > 0) {
2960 2960
 			$columnList = array();
2961 2961
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2962
-			if($documentList) {
2963
-				foreach($documentList as $v) {
2964
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2962
+			if ($documentList) {
2963
+				foreach ($documentList as $v) {
2964
+					if ($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2965 2965
 					else $oDocumentController->deleteDocument($v->document_srl);
2966 2966
 				}
2967 2967
 			}
@@ -2973,24 +2973,24 @@  discard block
 block discarded – undo
2973 2973
 	function _clearMemberCache($member_srl, $site_srl = 0)
2974 2974
 	{
2975 2975
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
2976
-		if($oCacheHandler->isSupport())
2976
+		if ($oCacheHandler->isSupport())
2977 2977
 		{
2978
-			$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_' . $site_srl;
2978
+			$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl;
2979 2979
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2980 2980
 			$oCacheHandler->delete($cache_key);
2981 2981
 
2982
-			if($site_srl !== 0)
2982
+			if ($site_srl !== 0)
2983 2983
 			{
2984
-				$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0';
2984
+				$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_0';
2985 2985
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2986 2986
 				$oCacheHandler->delete($cache_key);
2987 2987
 			}
2988 2988
 		}
2989 2989
 
2990 2990
 		$oCacheHandler = CacheHandler::getInstance('object');
2991
-		if($oCacheHandler->isSupport())
2991
+		if ($oCacheHandler->isSupport())
2992 2992
 		{
2993
-			$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
2993
+			$object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl;
2994 2994
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2995 2995
 			$oCacheHandler->delete($cache_key);
2996 2996
 		}
Please login to merge, or discard this patch.
Braces   +565 added lines, -248 removed lines patch added patch discarded remove patch
@@ -41,19 +41,31 @@  discard block
 block discarded – undo
41 41
 		}
42 42
 
43 43
 		// Variables
44
-		if(!$user_id) $user_id = Context::get('user_id');
44
+		if(!$user_id) {
45
+			$user_id = Context::get('user_id');
46
+		}
45 47
 		$user_id = trim($user_id);
46 48
 
47
-		if(!$password) $password = Context::get('password');
49
+		if(!$password) {
50
+			$password = Context::get('password');
51
+		}
48 52
 		$password = trim($password);
49 53
 
50
-		if(!$keep_signed) $keep_signed = Context::get('keep_signed');
54
+		if(!$keep_signed) {
55
+			$keep_signed = Context::get('keep_signed');
56
+		}
51 57
 		// Return an error when id and password doesn't exist
52
-		if(!$user_id) return new BaseObject(-1,'null_user_id');
53
-		if(!$password) return new BaseObject(-1,'null_password');
58
+		if(!$user_id) {
59
+			return new BaseObject(-1,'null_user_id');
60
+		}
61
+		if(!$password) {
62
+			return new BaseObject(-1,'null_password');
63
+		}
54 64
 
55 65
 		$output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false);
56
-		if (!$output->toBool()) return $output;
66
+		if (!$output->toBool()) {
67
+			return $output;
68
+		}
57 69
 
58 70
 		$oModuleModel = getModel('module');
59 71
 		$config = $oModuleModel->getModuleConfig('member');
@@ -80,8 +92,7 @@  discard block
 block discarded – undo
80 92
 		if(!$config->after_login_url)
81 93
 		{
82 94
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
83
-		}
84
-		else
95
+		} else
85 96
 		{
86 97
 			$returnUrl = $config->after_login_url;
87 98
 		}
@@ -98,19 +109,24 @@  discard block
 block discarded – undo
98 109
 		// Call a trigger before log-out (before)
99 110
 		$logged_info = Context::get('logged_info');
100 111
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info);
101
-		if(!$trigger_output->toBool()) return $trigger_output;
112
+		if(!$trigger_output->toBool()) {
113
+			return $trigger_output;
114
+		}
102 115
 		// Destroy session information
103 116
 		$this->destroySessionInfo();
104 117
 		// Call a trigger after log-out (after)
105 118
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info);
106
-		if(!$trigger_output->toBool()) return $trigger_output;
119
+		if(!$trigger_output->toBool()) {
120
+			return $trigger_output;
121
+		}
107 122
 
108 123
 		$output = new BaseObject();
109 124
 
110 125
 		$oModuleModel = getModel('module');
111 126
 		$config = $oModuleModel->getModuleConfig('member');
112
-		if($config->after_logout_url)
113
-			$output->redirect_url = $config->after_logout_url;
127
+		if($config->after_logout_url) {
128
+					$output->redirect_url = $config->after_logout_url;
129
+		}
114 130
 
115 131
 		$this->_clearMemberCache($logged_info->member_srl);
116 132
 
@@ -127,12 +143,18 @@  discard block
 block discarded – undo
127 143
 		$oModuleModel = &getModel('module');
128 144
 
129 145
 		// Check login information
130
-		if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
146
+		if(!Context::get('is_logged')) {
147
+			return new BaseObject(-1, 'msg_not_logged');
148
+		}
131 149
 		$logged_info = Context::get('logged_info');
132 150
 
133 151
 		$document_srl = (int)Context::get('document_srl');
134
-		if(!$document_srl) $document_srl = (int)Context::get('target_srl');
135
-		if(!$document_srl) return new BaseObject(-1,'msg_invalid_request');
152
+		if(!$document_srl) {
153
+			$document_srl = (int)Context::get('target_srl');
154
+		}
155
+		if(!$document_srl) {
156
+			return new BaseObject(-1,'msg_invalid_request');
157
+		}
136 158
 
137 159
 		// Get document
138 160
 		$oDocumentModel = getModel('document');
@@ -180,11 +202,15 @@  discard block
 block discarded – undo
180 202
 
181 203
 		// Check if already scrapped
182 204
 		$output = executeQuery('member.getScrapDocument', $args);
183
-		if($output->data->count) return new BaseObject(-1, 'msg_alreay_scrapped');
205
+		if($output->data->count) {
206
+			return new BaseObject(-1, 'msg_alreay_scrapped');
207
+		}
184 208
 
185 209
 		// Insert
186 210
 		$output = executeQuery('member.addScrapDocument', $args);
187
-		if(!$output->toBool()) return $output;
211
+		if(!$output->toBool()) {
212
+			return $output;
213
+		}
188 214
 
189 215
 		$this->setError(-1);
190 216
 		$this->setMessage('success_registed');
@@ -198,11 +224,15 @@  discard block
 block discarded – undo
198 224
 	function procMemberDeleteScrap()
199 225
 	{
200 226
 		// Check login information
201
-		if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
227
+		if(!Context::get('is_logged')) {
228
+			return new BaseObject(-1, 'msg_not_logged');
229
+		}
202 230
 		$logged_info = Context::get('logged_info');
203 231
 
204 232
 		$document_srl = (int)Context::get('document_srl');
205
-		if(!$document_srl) return new BaseObject(-1,'msg_invalid_request');
233
+		if(!$document_srl) {
234
+			return new BaseObject(-1,'msg_invalid_request');
235
+		}
206 236
 		// Variables
207 237
 		$args = new stdClass;
208 238
 		$args->member_srl = $logged_info->member_srl;
@@ -228,11 +258,15 @@  discard block
 block discarded – undo
228 258
 	function procMemberDeleteSavedDocument()
229 259
 	{
230 260
 		// Check login information
231
-		if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_logged');
261
+		if(!Context::get('is_logged')) {
262
+			return new BaseObject(-1, 'msg_not_logged');
263
+		}
232 264
 		$logged_info = Context::get('logged_info');
233 265
 
234 266
 		$document_srl = (int)Context::get('document_srl');
235
-		if(!$document_srl) return new BaseObject(-1,'msg_invalid_request');
267
+		if(!$document_srl) {
268
+			return new BaseObject(-1,'msg_invalid_request');
269
+		}
236 270
 
237 271
 		$oDocumentModel = getModel('document');
238 272
 		$oDocument = $oDocumentModel->getDocument($document_srl);
@@ -260,7 +294,9 @@  discard block
 block discarded – undo
260 294
 	{
261 295
 		$name = Context::get('name');
262 296
 		$value = Context::get('value');
263
-		if(!$value) return;
297
+		if(!$value) {
298
+			return;
299
+		}
264 300
 
265 301
 		$oMemberModel = getModel('member');
266 302
 		// Check if logged-in
@@ -271,10 +307,14 @@  discard block
 block discarded – undo
271 307
 		{
272 308
 			case 'user_id' :
273 309
 				// Check denied ID
274
-				if($oMemberModel->isDeniedID($value)) return new BaseObject(0,'denied_user_id');
310
+				if($oMemberModel->isDeniedID($value)) {
311
+					return new BaseObject(0,'denied_user_id');
312
+				}
275 313
 				// Check if duplicated
276 314
 				$member_srl = $oMemberModel->getMemberSrlByUserID($value);
277
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_user_id');
315
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
316
+					return new BaseObject(0,'msg_exists_user_id');
317
+				}
278 318
 				break;
279 319
 			case 'nick_name' :
280 320
 				// Check denied ID
@@ -284,13 +324,17 @@  discard block
 block discarded – undo
284 324
 				}
285 325
 				// Check if duplicated
286 326
 				$member_srl = $oMemberModel->getMemberSrlByNickName($value);
287
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_nick_name');
327
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
328
+					return new BaseObject(0,'msg_exists_nick_name');
329
+				}
288 330
 
289 331
 				break;
290 332
 			case 'email_address' :
291 333
 				// Check if duplicated
292 334
 				$member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
293
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new BaseObject(0,'msg_exists_email_address');
335
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
336
+					return new BaseObject(0,'msg_exists_email_address');
337
+				}
294 338
 				break;
295 339
 		}
296 340
 	}
@@ -302,17 +346,25 @@  discard block
 block discarded – undo
302 346
 	 */
303 347
 	function procMemberInsert()
304 348
 	{
305
-		if (Context::getRequestMethod () == "GET") return new BaseObject(-1, "msg_invalid_request");
349
+		if (Context::getRequestMethod () == "GET") {
350
+			return new BaseObject(-1, "msg_invalid_request");
351
+		}
306 352
 		$oMemberModel = &getModel ('member');
307 353
 		$config = $oMemberModel->getMemberConfig();
308 354
 
309 355
 		// call a trigger (before)
310 356
 		$trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config);
311
-		if(!$trigger_output->toBool ()) return $trigger_output;
357
+		if(!$trigger_output->toBool ()) {
358
+			return $trigger_output;
359
+		}
312 360
 		// Check if an administrator allows a membership
313
-		if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled');
361
+		if($config->enable_join != 'Y') {
362
+			return $this->stop ('msg_signup_disabled');
363
+		}
314 364
 		// Check if the user accept the license terms (only if terms exist)
315
-		if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
365
+		if($config->agreement && Context::get('accept_agreement')!='Y') {
366
+			return $this->stop('msg_accept_agreement');
367
+		}
316 368
 
317 369
 		// Extract the necessary information in advance
318 370
 		$getVars = array();
@@ -331,16 +383,22 @@  discard block
 block discarded – undo
331 383
 		foreach($getVars as $val)
332 384
 		{
333 385
 			$args->{$val} = Context::get($val);
334
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
386
+			if($val == 'birthday') {
387
+				$args->birthday_ui = Context::get('birthday_ui');
388
+			}
335 389
 		}
336 390
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
337
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
391
+		if(!$args->birthday && $args->birthday_ui) {
392
+			$args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
393
+		}
338 394
 
339 395
 		$args->find_account_answer = Context::get('find_account_answer');
340 396
 		$args->allow_mailing = Context::get('allow_mailing');
341 397
 		$args->allow_message = Context::get('allow_message');
342 398
 
343
-		if($args->password1) $args->password = $args->password1;
399
+		if($args->password1) {
400
+			$args->password = $args->password1;
401
+		}
344 402
 
345 403
 		// check password strength
346 404
 		if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
@@ -369,7 +427,9 @@  discard block
 block discarded – undo
369 427
 		unset($all_args->secret_text);
370 428
 
371 429
 		// Set the user state as "denied" when using mail authentication
372
-		if($config->enable_confirm == 'Y') $args->denied = 'Y';
430
+		if($config->enable_confirm == 'Y') {
431
+			$args->denied = 'Y';
432
+		}
373 433
 		// Add extra vars after excluding necessary information from all the requested arguments
374 434
 		$extra_vars = delObjectVars($all_args, $args);
375 435
 		$args->extra_vars = serialize($extra_vars);
@@ -384,7 +444,9 @@  discard block
 block discarded – undo
384 444
 			}
385 445
 		}
386 446
 		$output = $this->insertMember($args);
387
-		if(!$output->toBool()) return $output;
447
+		if(!$output->toBool()) {
448
+			return $output;
449
+		}
388 450
 
389 451
 		// insert ProfileImage, ImageName, ImageMark
390 452
 		$profile_image = $_FILES['profile_image'];
@@ -423,43 +485,46 @@  discard block
 block discarded – undo
423 485
 			if($config->identifier == 'email_address')
424 486
 			{
425 487
 				$output = $this->doLogin($args->email_address);
426
-			}
427
-			else
488
+			} else
428 489
 			{
429 490
 				$output = $this->doLogin($args->user_id);
430 491
 			}
431 492
 			if(!$output->toBool()) {
432
-				if($output->error == -9)
433
-					$output->error = -11;
493
+				if($output->error == -9) {
494
+									$output->error = -11;
495
+				}
434 496
 				return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output);
435 497
 			}
436 498
 		}
437 499
 
438 500
 		// Results
439 501
 		$this->add('member_srl', $args->member_srl);
440
-		if($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
502
+		if($config->redirect_url) {
503
+			$this->add('redirect_url', $config->redirect_url);
504
+		}
441 505
 		if($config->enable_confirm == 'Y')
442 506
 		{
443 507
 			$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
444 508
 			$this->setMessage($msg);
445 509
 			return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), new BaseObject(-12, $msg));
510
+		} else {
511
+			$this->setMessage('success_registed');
446 512
 		}
447
-		else $this->setMessage('success_registed');
448 513
 		// Call a trigger (after)
449 514
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
450
-		if(!$trigger_output->toBool()) return $trigger_output;
515
+		if(!$trigger_output->toBool()) {
516
+			return $trigger_output;
517
+		}
451 518
 
452 519
 		if($config->redirect_url)
453 520
 		{
454 521
 			$returnUrl = $config->redirect_url;
455
-		}
456
-		else
522
+		} else
457 523
 		{
458 524
 			if(Context::get('success_return_url'))
459 525
 			{
460 526
 				$returnUrl = Context::get('success_return_url');
461
-			}
462
-			else if($_COOKIE['XE_REDIRECT_URL'])
527
+			} else if($_COOKIE['XE_REDIRECT_URL'])
463 528
 			{
464 529
 				$returnUrl = $_COOKIE['XE_REDIRECT_URL'];
465 530
 				savecookie('XE_REDIRECT_URL');
@@ -513,8 +578,7 @@  discard block
 block discarded – undo
513 578
 		if(Context::get('success_return_url'))
514 579
 		{
515 580
 			$redirectUrl = Context::get('success_return_url');
516
-		}
517
-		else
581
+		} else
518 582
 		{
519 583
 			$redirectUrl = getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
520 584
 		}
@@ -558,7 +622,9 @@  discard block
 block discarded – undo
558 622
 		foreach($getVars as $val)
559 623
 		{
560 624
 			$args->{$val} = Context::get($val);
561
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
625
+			if($val == 'birthday') {
626
+				$args->birthday_ui = Context::get('birthday_ui');
627
+			}
562 628
 			if($val == 'find_account_answer' && !Context::get($val)) {
563 629
 				unset($args->{$val});
564 630
 			}
@@ -568,7 +634,9 @@  discard block
 block discarded – undo
568 634
 		$logged_info = Context::get('logged_info');
569 635
 		$args->member_srl = $logged_info->member_srl;
570 636
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
571
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
637
+		if(!$args->birthday && $args->birthday_ui) {
638
+			$args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
639
+		}
572 640
 
573 641
 		// Remove some unnecessary variables from all the vars
574 642
 		$all_args = Context::getRequestVars();
@@ -603,7 +671,9 @@  discard block
 block discarded – undo
603 671
 
604 672
 		// Execute insert or update depending on the value of member_srl
605 673
 		$output = $this->updateMember($args);
606
-		if(!$output->toBool()) return $output;
674
+		if(!$output->toBool()) {
675
+			return $output;
676
+		}
607 677
 
608 678
 		$profile_image = $_FILES['profile_image'];
609 679
 		if(is_uploaded_file($profile_image['tmp_name']))
@@ -633,7 +703,9 @@  discard block
 block discarded – undo
633 703
 
634 704
 		// Call a trigger after successfully log-in (after)
635 705
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo);
636
-		if(!$trigger_output->toBool()) return $trigger_output;
706
+		if(!$trigger_output->toBool()) {
707
+			return $trigger_output;
708
+		}
637 709
 
638 710
 		$this->setSessionInfo();
639 711
 		// Return result
@@ -654,7 +726,9 @@  discard block
 block discarded – undo
654 726
 	 */
655 727
 	function procMemberModifyPassword()
656 728
 	{
657
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
729
+		if(!Context::get('is_logged')) {
730
+			return $this->stop('msg_not_logged');
731
+		}
658 732
 		// Extract the necessary information in advance
659 733
 		$current_password = trim(Context::get('current_password'));
660 734
 		$password = trim(Context::get('password1'));
@@ -668,17 +742,23 @@  discard block
 block discarded – undo
668 742
 
669 743
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
670 744
 		// Verify the cuttent password
671
-		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new BaseObject(-1, 'invalid_password');
745
+		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) {
746
+			return new BaseObject(-1, 'invalid_password');
747
+		}
672 748
 
673 749
 		// Check if a new password is as same as the previous password
674
-		if($current_password == $password) return new BaseObject(-1, 'invalid_new_password');
750
+		if($current_password == $password) {
751
+			return new BaseObject(-1, 'invalid_new_password');
752
+		}
675 753
 
676 754
 		// Execute insert or update depending on the value of member_srl
677 755
 		$args = new stdClass;
678 756
 		$args->member_srl = $member_srl;
679 757
 		$args->password = $password;
680 758
 		$output = $this->updateMemberPassword($args);
681
-		if(!$output->toBool()) return $output;
759
+		if(!$output->toBool()) {
760
+			return $output;
761
+		}
682 762
 
683 763
 		$this->add('member_srl', $args->member_srl);
684 764
 		$this->setMessage('success_updated');
@@ -694,7 +774,9 @@  discard block
 block discarded – undo
694 774
 	 */
695 775
 	function procMemberLeave()
696 776
 	{
697
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
777
+		if(!Context::get('is_logged')) {
778
+			return $this->stop('msg_not_logged');
779
+		}
698 780
 		// Extract the necessary information in advance
699 781
 		$password = trim(Context::get('password'));
700 782
 		// Get information of logged-in user
@@ -710,10 +792,14 @@  discard block
 block discarded – undo
710 792
 			$this->memberInfo->password = $memberInfo->password;
711 793
 		}
712 794
 		// Verify the cuttent password
713
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new BaseObject(-1, 'invalid_password');
795
+		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) {
796
+			return new BaseObject(-1, 'invalid_password');
797
+		}
714 798
 
715 799
 		$output = $this->deleteMember($member_srl);
716
-		if(!$output->toBool()) return $output;
800
+		if(!$output->toBool()) {
801
+			return $output;
802
+		}
717 803
 		// Destroy all session information
718 804
 		$this->destroySessionInfo();
719 805
 		// Return success message
@@ -732,20 +818,30 @@  discard block
 block discarded – undo
732 818
 	{
733 819
 		// Check if the file is successfully uploaded
734 820
 		$file = $_FILES['profile_image'];
735
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
821
+		if(!is_uploaded_file($file['tmp_name'])) {
822
+			return $this->stop('msg_not_uploaded_profile_image');
823
+		}
736 824
 		// Ignore if member_srl is invalid or doesn't exist.
737 825
 		$member_srl = Context::get('member_srl');
738
-		if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
826
+		if(!$member_srl) {
827
+			return $this->stop('msg_not_uploaded_profile_image');
828
+		}
739 829
 
740 830
 		$logged_info = Context::get('logged_info');
741
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
831
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
832
+			return $this->stop('msg_not_uploaded_profile_image');
833
+		}
742 834
 		// Return if member module is set not to use an image name or the user is not an administrator ;
743 835
 		$oMemberModel = getModel('member');
744 836
 		$config = $oMemberModel->getMemberConfig();
745
-		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
837
+		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') {
838
+			return $this->stop('msg_not_uploaded_profile_image');
839
+		}
746 840
 
747 841
 		$output = $this->insertProfileImage($member_srl, $file['tmp_name']);
748
-		if(!$output->toBool()) return $output;
842
+		if(!$output->toBool()) {
843
+			return $output;
844
+		}
749 845
 
750 846
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
751 847
 		$this->setRedirectUrl($returnUrl);
@@ -772,10 +868,13 @@  discard block
 block discarded – undo
772 868
 		// Get file information
773 869
 		FileHandler::clearStatCache($target_file);
774 870
 		list($width, $height, $type) = @getimagesize($target_file);
775
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
776
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
777
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
778
-		else
871
+		if(IMAGETYPE_PNG == $type) {
872
+			$ext = 'png';
873
+		} elseif(IMAGETYPE_JPEG == $type) {
874
+			$ext = 'jpg';
875
+		} elseif(IMAGETYPE_GIF == $type) {
876
+			$ext = 'gif';
877
+		} else
779 878
 		{
780 879
 			return $this->stop('msg_not_uploaded_profile_image');
781 880
 		}
@@ -806,8 +905,7 @@  discard block
 block discarded – undo
806 905
 			FileHandler::removeFilesInDir($target_path);
807 906
 			FileHandler::moveFile($temp_filename, $target_filename);
808 907
 			FileHandler::clearStatCache($target_filename);
809
-		}
810
-		else
908
+		} else
811 909
 		{
812 910
 			// 파일 용량 제한
813 911
 			$filesize = filesize($target_file);
@@ -836,20 +934,30 @@  discard block
 block discarded – undo
836 934
 	{
837 935
 		// Check if the file is successfully uploaded
838 936
 		$file = $_FILES['image_name'];
839
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
937
+		if(!is_uploaded_file($file['tmp_name'])) {
938
+			return $this->stop('msg_not_uploaded_image_name');
939
+		}
840 940
 		// Ignore if member_srl is invalid or doesn't exist.
841 941
 		$member_srl = Context::get('member_srl');
842
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
942
+		if(!$member_srl) {
943
+			return $this->stop('msg_not_uploaded_image_name');
944
+		}
843 945
 
844 946
 		$logged_info = Context::get('logged_info');
845
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
947
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
948
+			return $this->stop('msg_not_uploaded_image_name');
949
+		}
846 950
 		// Return if member module is set not to use an image name or the user is not an administrator ;
847 951
 		$oMemberModel = getModel('member');
848 952
 		$config = $oMemberModel->getMemberConfig();
849
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
953
+		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') {
954
+			return $this->stop('msg_not_uploaded_image_name');
955
+		}
850 956
 
851 957
 		$output = $this->insertImageName($member_srl, $file['tmp_name']);
852
-		if(!$output->toBool()) return $output;
958
+		if(!$output->toBool()) {
959
+			return $output;
960
+		}
853 961
 
854 962
 		// Page refresh
855 963
 		//$this->setRefreshPage();
@@ -904,8 +1012,7 @@  discard block
 block discarded – undo
904 1012
 			FileHandler::removeFilesInDir($target_path);
905 1013
 			FileHandler::moveFile($temp_filename, $target_filename);
906 1014
 			FileHandler::clearStatCache($target_filename);
907
-		}
908
-		else
1015
+		} else
909 1016
 		{
910 1017
 			// 파일 용량 제한
911 1018
 			$filesize = filesize($target_file);
@@ -982,20 +1089,30 @@  discard block
 block discarded – undo
982 1089
 	{
983 1090
 		// Check if the file is successfully uploaded
984 1091
 		$file = $_FILES['image_mark'];
985
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
1092
+		if(!is_uploaded_file($file['tmp_name'])) {
1093
+			return $this->stop('msg_not_uploaded_image_mark');
1094
+		}
986 1095
 		// Ignore if member_srl is invalid or doesn't exist.
987 1096
 		$member_srl = Context::get('member_srl');
988
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
1097
+		if(!$member_srl) {
1098
+			return $this->stop('msg_not_uploaded_image_mark');
1099
+		}
989 1100
 
990 1101
 		$logged_info = Context::get('logged_info');
991
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
1102
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
1103
+			return $this->stop('msg_not_uploaded_image_mark');
1104
+		}
992 1105
 		// Membership in the images mark the module using the ban was set by an administrator or return;
993 1106
 		$oMemberModel = getModel('member');
994 1107
 		$config = $oMemberModel->getMemberConfig();
995
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
1108
+		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') {
1109
+			return $this->stop('msg_not_uploaded_image_mark');
1110
+		}
996 1111
 
997 1112
 		$this->insertImageMark($member_srl, $file['tmp_name']);
998
-		if(!$output->toBool()) return $output;
1113
+		if(!$output->toBool()) {
1114
+			return $output;
1115
+		}
999 1116
 
1000 1117
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
1001 1118
 		$this->setRedirectUrl($returnUrl);
@@ -1046,8 +1163,7 @@  discard block
 block discarded – undo
1046 1163
 			FileHandler::removeFilesInDir($target_path);
1047 1164
 			FileHandler::moveFile($temp_filename, $target_filename);
1048 1165
 			FileHandler::clearStatCache($target_filename);
1049
-		}
1050
-		else
1166
+		} else
1051 1167
 		{
1052 1168
 			$filesize = filesize($target_file);
1053 1169
 			if($max_filesize && $filesize > ($max_filesize * 1024))
@@ -1099,14 +1215,18 @@  discard block
 block discarded – undo
1099 1215
 	function procMemberFindAccount()
1100 1216
 	{
1101 1217
 		$email_address = Context::get('email_address');
1102
-		if(!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1218
+		if(!$email_address) {
1219
+			return new BaseObject(-1, 'msg_invalid_request');
1220
+		}
1103 1221
 
1104 1222
 		$oMemberModel = getModel('member');
1105 1223
 		$oModuleModel = getModel('module');
1106 1224
 
1107 1225
 		// Check if a member having the same email address exists
1108 1226
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1109
-		if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1227
+		if(!$member_srl) {
1228
+			return new BaseObject(-1, 'msg_email_not_exists');
1229
+		}
1110 1230
 
1111 1231
 		// Get information of the member
1112 1232
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
@@ -1118,7 +1238,9 @@  discard block
 block discarded – undo
1118 1238
 			$chk_args = new stdClass;
1119 1239
 			$chk_args->member_srl = $member_info->member_srl;
1120 1240
 			$output = executeQuery('member.chkAuthMail', $chk_args);
1121
-			if($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed');
1241
+			if($output->toBool() && $output->data->count != '0') {
1242
+				return new BaseObject(-1, 'msg_user_not_confirmed');
1243
+			}
1122 1244
 		}
1123 1245
 
1124 1246
 		// Insert data into the authentication DB
@@ -1131,7 +1253,9 @@  discard block
 block discarded – undo
1131 1253
 		$args->is_register = 'N';
1132 1254
 
1133 1255
 		$output = executeQuery('member.insertAuthMail', $args);
1134
-		if(!$output->toBool()) return $output;
1256
+		if(!$output->toBool()) {
1257
+			return $output;
1258
+		}
1135 1259
 		// Get content of the email to send a member
1136 1260
 		Context::set('auth_args', $args);
1137 1261
 
@@ -1148,8 +1272,7 @@  discard block
 block discarded – undo
1148 1272
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1149 1273
 				}
1150 1274
 			}
1151
-		}
1152
-		else
1275
+		} else
1153 1276
 		{
1154 1277
 			$memberInfo[$lang->user_id] = $args->user_id;
1155 1278
 			$memberInfo[$lang->user_name] = $args->user_name;
@@ -1158,13 +1281,19 @@  discard block
 block discarded – undo
1158 1281
 		}
1159 1282
 		Context::set('memberInfo', $memberInfo);
1160 1283
 
1161
-		if(!$member_config->skin) $member_config->skin = "default";
1162
-		if(!$member_config->colorset) $member_config->colorset = "white";
1284
+		if(!$member_config->skin) {
1285
+			$member_config->skin = "default";
1286
+		}
1287
+		if(!$member_config->colorset) {
1288
+			$member_config->colorset = "white";
1289
+		}
1163 1290
 
1164 1291
 		Context::set('member_config', $member_config);
1165 1292
 
1166 1293
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1167
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1294
+		if(!is_dir($tpl_path)) {
1295
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1296
+		}
1168 1297
 
1169 1298
 		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1170 1299
 		Context::set('find_url', $find_url);
@@ -1207,19 +1336,25 @@  discard block
 block discarded – undo
1207 1336
 		$find_account_question = trim(Context::get('find_account_question'));
1208 1337
 		$find_account_answer = trim(Context::get('find_account_answer'));
1209 1338
 
1210
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request');
1339
+		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) {
1340
+			return new BaseObject(-1, 'msg_invalid_request');
1341
+		}
1211 1342
 
1212 1343
 		$oModuleModel = getModel('module');
1213 1344
 		// Check if a member having the same email address exists
1214 1345
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1215
-		if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1346
+		if(!$member_srl) {
1347
+			return new BaseObject(-1, 'msg_email_not_exists');
1348
+		}
1216 1349
 
1217 1350
 		// Get information of the member
1218 1351
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1219 1352
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1220 1353
 
1221 1354
 		// Display a message if no answer is entered
1222
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists');
1355
+		if(!$member_info->find_account_question || !$member_info->find_account_answer) {
1356
+			return new BaseObject(-1, 'msg_question_not_exists');
1357
+		}
1223 1358
 
1224 1359
 		// 답변 확인
1225 1360
 		$hashed = $oPassword->checkAlgorithm($member_info->find_account_answer);
@@ -1228,12 +1363,10 @@  discard block
 block discarded – undo
1228 1363
 		if($member_info->find_account_question != $find_account_question)
1229 1364
 		{
1230 1365
 			$authed = false;
1231
-		}
1232
-		else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1366
+		} else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1233 1367
 		{
1234 1368
 			$authed = false;
1235
-		}
1236
-		else if(!$hashed && $find_account_answer != $member_info->find_account_answer)
1369
+		} else if(!$hashed && $find_account_answer != $member_info->find_account_answer)
1237 1370
 		{
1238 1371
 			$authed = false;
1239 1372
 		}
@@ -1262,7 +1395,9 @@  discard block
 block discarded – undo
1262 1395
 		$args->password = $temp_password;
1263 1396
 		$args->change_password_date = '1';
1264 1397
 		$output = $this->updateMemberPassword($args);
1265
-		if(!$output->toBool()) return $output;
1398
+		if(!$output->toBool()) {
1399
+			return $output;
1400
+		}
1266 1401
 
1267 1402
 		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1268 1403
 
@@ -1319,8 +1454,7 @@  discard block
 block discarded – undo
1319 1454
 		if($output->data->is_register == 'Y')
1320 1455
 		{
1321 1456
 			$args->denied = 'N';
1322
-		}
1323
-		else
1457
+		} else
1324 1458
 		{
1325 1459
 			$args->password = $oMemberModel->hashPassword($args->password);
1326 1460
 		}
@@ -1354,33 +1488,45 @@  discard block
 block discarded – undo
1354 1488
 	{
1355 1489
 		// Get an email_address
1356 1490
 		$email_address = Context::get('email_address');
1357
-		if(!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1491
+		if(!$email_address) {
1492
+			return new BaseObject(-1, 'msg_invalid_request');
1493
+		}
1358 1494
 		// Log test by using email_address
1359 1495
 		$oMemberModel = getModel('member');
1360 1496
 
1361 1497
 		$args = new stdClass;
1362 1498
 		$args->email_address = $email_address;
1363 1499
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1364
-		if(!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member');
1500
+		if(!$memberSrl) {
1501
+			return new BaseObject(-1, 'msg_not_exists_member');
1502
+		}
1365 1503
 
1366 1504
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1367 1505
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1368 1506
 
1369 1507
 		$oModuleModel = getModel('module');
1370 1508
 		$member_config = $oModuleModel->getModuleConfig('member');
1371
-		if(!$member_config->skin) $member_config->skin = "default";
1372
-		if(!$member_config->colorset) $member_config->colorset = "white";
1509
+		if(!$member_config->skin) {
1510
+			$member_config->skin = "default";
1511
+		}
1512
+		if(!$member_config->colorset) {
1513
+			$member_config->colorset = "white";
1514
+		}
1373 1515
 
1374 1516
 		// Check if a authentication mail has been sent previously
1375 1517
 		$chk_args = new stdClass;
1376 1518
 		$chk_args->member_srl = $member_info->member_srl;
1377 1519
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1378
-		if($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request');
1520
+		if($output->toBool() && $output->data->count == '0') {
1521
+			return new BaseObject(-1, 'msg_invalid_request');
1522
+		}
1379 1523
 
1380 1524
 		$auth_args = new stdClass;
1381 1525
 		$auth_args->member_srl = $member_info->member_srl;
1382 1526
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1383
-		if(!$output->data || !$output->data[0]->auth_key)  return new BaseObject(-1, 'msg_invalid_request');
1527
+		if(!$output->data || !$output->data[0]->auth_key) {
1528
+			return new BaseObject(-1, 'msg_invalid_request');
1529
+		}
1384 1530
 		$auth_info = $output->data[0];
1385 1531
 
1386 1532
 		// Update the regdate of authmail entry
@@ -1401,8 +1547,7 @@  discard block
 block discarded – undo
1401 1547
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1402 1548
 				}
1403 1549
 			}
1404
-		}
1405
-		else
1550
+		} else
1406 1551
 		{
1407 1552
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1408 1553
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1415,7 +1560,9 @@  discard block
 block discarded – undo
1415 1560
 		Context::set('member_config', $member_config);
1416 1561
 
1417 1562
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1418
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1563
+		if(!is_dir($tpl_path)) {
1564
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1565
+		}
1419 1566
 
1420 1567
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1421 1568
 		Context::set('auth_url', $auth_url);
@@ -1493,7 +1640,9 @@  discard block
 block discarded – undo
1493 1640
 		$auth_args->is_register = 'Y';
1494 1641
 
1495 1642
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1496
-		if(!$output->toBool()) return $output;
1643
+		if(!$output->toBool()) {
1644
+			return $output;
1645
+		}
1497 1646
 
1498 1647
 		$memberInfo->email_address = $newEmail;
1499 1648
 
@@ -1527,8 +1676,7 @@  discard block
 block discarded – undo
1527 1676
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1528 1677
 				}
1529 1678
 			}
1530
-		}
1531
-		else
1679
+		} else
1532 1680
 		{
1533 1681
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1534 1682
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1537,13 +1685,19 @@  discard block
 block discarded – undo
1537 1685
 		}
1538 1686
 		Context::set('memberInfo', $memberInfo);
1539 1687
 
1540
-		if(!$member_config->skin) $member_config->skin = "default";
1541
-		if(!$member_config->colorset) $member_config->colorset = "white";
1688
+		if(!$member_config->skin) {
1689
+			$member_config->skin = "default";
1690
+		}
1691
+		if(!$member_config->colorset) {
1692
+			$member_config->colorset = "white";
1693
+		}
1542 1694
 
1543 1695
 		Context::set('member_config', $member_config);
1544 1696
 
1545 1697
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1546
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1698
+		if(!is_dir($tpl_path)) {
1699
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1700
+		}
1547 1701
 
1548 1702
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1549 1703
 		Context::set('auth_url', $auth_url);
@@ -1568,7 +1722,9 @@  discard block
 block discarded – undo
1568 1722
 	{
1569 1723
 		$site_module_info = Context::get('site_module_info');
1570 1724
 		$logged_info = Context::get('logged_info');
1571
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request');
1725
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1726
+			return new BaseObject(-1,'msg_invalid_request');
1727
+		}
1572 1728
 
1573 1729
 		$oMemberModel = getModel('member');
1574 1730
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1587,13 +1743,17 @@  discard block
 block discarded – undo
1587 1743
 	{
1588 1744
 		$site_module_info = Context::get('site_module_info');
1589 1745
 		$logged_info = Context::get('logged_info');
1590
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request');
1746
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1747
+			return new BaseObject(-1,'msg_invalid_request');
1748
+		}
1591 1749
 
1592 1750
 		$args = new stdClass;
1593 1751
 		$args->site_srl= $site_module_info->site_srl;
1594 1752
 		$args->member_srl = $logged_info->member_srl;
1595 1753
 		$output = executeQuery('member.deleteMembersGroup', $args);
1596
-		if(!$output->toBool()) return $output;
1754
+		if(!$output->toBool()) {
1755
+			return $output;
1756
+		}
1597 1757
 		$this->setMessage('success_deleted');
1598 1758
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1599 1759
 	}
@@ -1607,17 +1767,37 @@  discard block
 block discarded – undo
1607 1767
 	 */
1608 1768
 	function setMemberConfig($args)
1609 1769
 	{
1610
-		if(!$args->skin) $args->skin = "default";
1611
-		if(!$args->colorset) $args->colorset = "white";
1612
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1613
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1614
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1770
+		if(!$args->skin) {
1771
+			$args->skin = "default";
1772
+		}
1773
+		if(!$args->colorset) {
1774
+			$args->colorset = "white";
1775
+		}
1776
+		if(!$args->editor_skin) {
1777
+			$args->editor_skin= "ckeditor";
1778
+		}
1779
+		if(!$args->editor_colorset) {
1780
+			$args->editor_colorset = "moono";
1781
+		}
1782
+		if($args->enable_join!='Y') {
1783
+			$args->enable_join = 'N';
1784
+		}
1615 1785
 		$args->enable_openid= 'N';
1616
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1617
-		if($args->image_name!='Y') $args->image_name = 'N';
1618
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1619
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1620
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1786
+		if($args->profile_image !='Y') {
1787
+			$args->profile_image = 'N';
1788
+		}
1789
+		if($args->image_name!='Y') {
1790
+			$args->image_name = 'N';
1791
+		}
1792
+		if($args->image_mark!='Y') {
1793
+			$args->image_mark = 'N';
1794
+		}
1795
+		if($args->group_image_mark!='Y') {
1796
+			$args->group_image_mark = 'N';
1797
+		}
1798
+		if(!trim(strip_tags($args->agreement))) {
1799
+			$args->agreement = null;
1800
+		}
1621 1801
 		$args->limit_day = (int)$args->limit_day;
1622 1802
 
1623 1803
 		$agreement = trim($args->agreement);
@@ -1625,7 +1805,9 @@  discard block
 block discarded – undo
1625 1805
 
1626 1806
 		$oModuleController = getController('module');
1627 1807
 		$output = $oModuleController->insertModuleConfig('member',$args);
1628
-		if(!$output->toBool()) return $output;
1808
+		if(!$output->toBool()) {
1809
+			return $output;
1810
+		}
1629 1811
 
1630 1812
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1631 1813
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1650,7 +1832,9 @@  discard block
 block discarded – undo
1650 1832
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1651 1833
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1652 1834
 
1653
-		if(!$check_signature) return FileHandler::removeFile($filename);
1835
+		if(!$check_signature) {
1836
+			return FileHandler::removeFile($filename);
1837
+		}
1654 1838
 
1655 1839
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1656 1840
 		FileHandler::makeDir($path);
@@ -1684,7 +1868,9 @@  discard block
 block discarded – undo
1684 1868
 		$args = new stdClass();
1685 1869
 		$args->member_srl = $member_srl;
1686 1870
 		$args->group_srl = $group_srl;
1687
-		if($site_srl) $args->site_srl = $site_srl;
1871
+		if($site_srl) {
1872
+			$args->site_srl = $site_srl;
1873
+		}
1688 1874
 
1689 1875
 		// Add
1690 1876
 		$output = executeQuery('member.addMemberToGroup',$args);
@@ -1710,15 +1896,21 @@  discard block
 block discarded – undo
1710 1896
 		$obj->member_srl = implode(',',$args->member_srl);
1711 1897
 
1712 1898
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1713
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1899
+		if($output->data) {
1900
+			foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1901
+		}
1714 1902
 
1715 1903
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1716
-		if(!$output->toBool()) return $output;
1904
+		if(!$output->toBool()) {
1905
+			return $output;
1906
+		}
1717 1907
 
1718 1908
 		$inserted_members = array();
1719 1909
 		foreach($args->member_srl as $key => $val)
1720 1910
 		{
1721
-			if($inserted_members[$val]) continue;
1911
+			if($inserted_members[$val]) {
1912
+				continue;
1913
+			}
1722 1914
 			$inserted_members[$val] = true;
1723 1915
 
1724 1916
 			unset($obj);
@@ -1728,7 +1920,9 @@  discard block
 block discarded – undo
1728 1920
 			$obj->site_srl = $args->site_srl;
1729 1921
 			$obj->regdate = $date[$obj->member_srl];
1730 1922
 			$output = executeQuery('member.addMemberToGroup', $obj);
1731
-			if(!$output->toBool()) return $output;
1923
+			if(!$output->toBool()) {
1924
+				return $output;
1925
+			}
1732 1926
 
1733 1927
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1734 1928
 		}
@@ -1790,8 +1984,7 @@  discard block
 block discarded – undo
1790 1984
 				if($config->identifier == 'user_id')
1791 1985
 				{
1792 1986
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1793
-				}
1794
-				else
1987
+				} else
1795 1988
 				{
1796 1989
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1797 1990
 				}
@@ -1800,8 +1993,7 @@  discard block
 block discarded – undo
1800 1993
 					$do_auto_login = true;
1801 1994
 				}
1802 1995
 
1803
-			}
1804
-			else
1996
+			} else
1805 1997
 			{
1806 1998
 				$do_auto_login = true;
1807 1999
 			}
@@ -1810,8 +2002,7 @@  discard block
 block discarded – undo
1810 2002
 		if($do_auto_login)
1811 2003
 		{
1812 2004
 			$output = $this->doLogin($user_id);
1813
-		}
1814
-		else
2005
+		} else
1815 2006
 		{
1816 2007
 			executeQuery('member.deleteAutologin', $args);
1817 2008
 			saveCookie('xeak');
@@ -1830,13 +2021,17 @@  discard block
 block discarded – undo
1830 2021
 	function doLogin($user_id, $password = '', $keep_signed = false)
1831 2022
 	{
1832 2023
 		$user_id = strtolower($user_id);
1833
-		if(!$user_id) return new BaseObject(-1, 'null_user_id');
2024
+		if(!$user_id) {
2025
+			return new BaseObject(-1, 'null_user_id');
2026
+		}
1834 2027
 		// Call a trigger before log-in (before)
1835 2028
 		$trigger_obj = new stdClass();
1836 2029
 		$trigger_obj->user_id = $user_id;
1837 2030
 		$trigger_obj->password = $password;
1838 2031
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1839
-		if(!$trigger_output->toBool()) return $trigger_output;
2032
+		if(!$trigger_output->toBool()) {
2033
+			return $trigger_output;
2034
+		}
1840 2035
 		// Create a member model object
1841 2036
 		$oMemberModel = getModel('member');
1842 2037
 
@@ -1851,15 +2046,18 @@  discard block
 block discarded – undo
1851 2046
 			// Get user_id information
1852 2047
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1853 2048
 			// Set an invalid user if no value returned
1854
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
2049
+			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) {
2050
+				return $this->recordLoginError(-1, 'invalid_email_address');
2051
+			}
1855 2052
 
1856
-		}
1857
-		else
2053
+		} else
1858 2054
 		{
1859 2055
 			// Get user_id information
1860 2056
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1861 2057
 			// Set an invalid user if no value returned
1862
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
2058
+			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) {
2059
+				return $this->recordLoginError(-1, 'invalid_user_id');
2060
+			}
1863 2061
 		}
1864 2062
 
1865 2063
 		$output = executeQuery('member.getLoginCountByIp', $args);
@@ -1871,14 +2069,18 @@  discard block
 block discarded – undo
1871 2069
 			if($term < $config->max_error_count_time)
1872 2070
 			{
1873 2071
 				$term = $config->max_error_count_time - $term;
1874
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1875
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1876
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1877
-				else $term = intval($term/86400).Context::getLang('unit_day');
2072
+				if($term < 60) {
2073
+					$term = intval($term).Context::getLang('unit_sec');
2074
+				} elseif(60 <= $term && $term < 3600) {
2075
+					$term = intval($term/60).Context::getLang('unit_min');
2076
+				} elseif(3600 <= $term && $term < 86400) {
2077
+					$term = intval($term/3600).Context::getLang('unit_hour');
2078
+				} else {
2079
+					$term = intval($term/86400).Context::getLang('unit_day');
2080
+				}
1878 2081
 
1879 2082
 				return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1880
-			}
1881
-			else
2083
+			} else
1882 2084
 			{
1883 2085
 				$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1884 2086
 				$output = executeQuery('member.deleteLoginCountByIp', $args);
@@ -1905,7 +2107,9 @@  discard block
 block discarded – undo
1905 2107
 			return new BaseObject(-1,'msg_user_denied');
1906 2108
 		}
1907 2109
 		// Notify if denied_date is less than the current time
1908
-		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new BaseObject(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
2110
+		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) {
2111
+			return new BaseObject(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
2112
+		}
1909 2113
 		// Update the latest login time
1910 2114
 		$args->member_srl = $this->memberInfo->member_srl;
1911 2115
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1954,7 +2158,9 @@  discard block
 block discarded – undo
1954 2158
 		}
1955 2159
 		// Call a trigger after successfully log-in (after)
1956 2160
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1957
-		if(!$trigger_output->toBool()) return $trigger_output;
2161
+		if(!$trigger_output->toBool()) {
2162
+			return $trigger_output;
2163
+		}
1958 2164
 		// When user checked to use auto-login
1959 2165
 		if($keep_signed)
1960 2166
 		{
@@ -1968,7 +2174,9 @@  discard block
 block discarded – undo
1968 2174
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1969 2175
 			executeQuery('member.deleteAutologin', $autologin_args);
1970 2176
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1971
-			if($autologin_output->toBool()) saveCookie('xeak', $autologin_args->autologin_key, true, $_SERVER['REQUEST_TIME']+31536000);
2177
+			if($autologin_output->toBool()) {
2178
+				saveCookie('xeak', $autologin_args->autologin_key, true, $_SERVER['REQUEST_TIME']+31536000);
2179
+			}
1972 2180
 		}
1973 2181
 		if($this->memberInfo->is_admin == 'Y')
1974 2182
 		{
@@ -2057,7 +2265,9 @@  discard block
 block discarded – undo
2057 2265
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
2058 2266
 	{
2059 2267
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
2060
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
2268
+		if(!is_array($member_popup_menu_list)) {
2269
+			$member_popup_menu_list = array();
2270
+		}
2061 2271
 
2062 2272
 		$obj = new stdClass;
2063 2273
 		$obj->url = $url;
@@ -2076,35 +2286,54 @@  discard block
 block discarded – undo
2076 2286
 	{
2077 2287
 		// Call a trigger (before)
2078 2288
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
2079
-		if(!$output->toBool()) return $output;
2289
+		if(!$output->toBool()) {
2290
+			return $output;
2291
+		}
2080 2292
 		// Terms and Conditions portion of the information set up by members reaffirmed
2081 2293
 		$oModuleModel = getModel('module');
2082 2294
 		$config = $oModuleModel->getModuleConfig('member');
2083 2295
 
2084 2296
 		$logged_info = Context::get('logged_info');
2085 2297
 		// If the date of the temporary restrictions limit further information on the date of
2086
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2298
+		if($config->limit_day) {
2299
+			$args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2300
+		}
2087 2301
 
2088 2302
 		$args->member_srl = getNextSequence();
2089 2303
 		$args->list_order = -1 * $args->member_srl;
2090 2304
 
2091 2305
 		// Execute insert or update depending on the value of member_srl
2092
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2306
+		if(!$args->user_id) {
2307
+			$args->user_id = 't'.$args->member_srl;
2308
+		}
2093 2309
 		// Enter the user's identity changed to lowercase
2094
-		else $args->user_id = strtolower($args->user_id);
2095
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2096
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
2310
+		else {
2311
+			$args->user_id = strtolower($args->user_id);
2312
+		}
2313
+		if(!$args->user_name) {
2314
+			$args->user_name = $args->member_srl;
2315
+		}
2316
+		if(!$args->nick_name) {
2317
+			$args->nick_name = $args->member_srl;
2318
+		}
2097 2319
 
2098 2320
 		// Control of essential parameters
2099
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2100
-		if($args->denied!='Y') $args->denied = 'N';
2101
-		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y';
2321
+		if($args->allow_mailing!='Y') {
2322
+			$args->allow_mailing = 'N';
2323
+		}
2324
+		if($args->denied!='Y') {
2325
+			$args->denied = 'N';
2326
+		}
2327
+		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) {
2328
+			$args->allow_message = 'Y';
2329
+		}
2102 2330
 
2103 2331
 		if($logged_info->is_admin == 'Y')
2104 2332
 		{
2105
-			if($args->is_admin!='Y') $args->is_admin = 'N';
2106
-		}
2107
-		else
2333
+			if($args->is_admin!='Y') {
2334
+				$args->is_admin = 'N';
2335
+			}
2336
+		} else
2108 2337
 		{
2109 2338
 			unset($args->is_admin);
2110 2339
 		}
@@ -2117,8 +2346,12 @@  discard block
 block discarded – undo
2117 2346
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2118 2347
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2119 2348
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2120
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2121
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
2349
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) {
2350
+			$args->homepage = 'http://'.$args->homepage;
2351
+		}
2352
+		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) {
2353
+			$args->blog = 'http://'.$args->blog;
2354
+		}
2122 2355
 
2123 2356
 		// Create a model object
2124 2357
 		$oMemberModel = getModel('member');
@@ -2132,8 +2365,7 @@  discard block
 block discarded – undo
2132 2365
 				return new BaseObject(-1, $message[$config->password_strength]);
2133 2366
 			}
2134 2367
 			$args->password = $oMemberModel->hashPassword($args->password);
2135
-		}
2136
-		elseif(!$args->password)
2368
+		} elseif(!$args->password)
2137 2369
 		{
2138 2370
 			unset($args->password);
2139 2371
 		}
@@ -2141,8 +2373,7 @@  discard block
 block discarded – undo
2141 2373
 		if($args->find_account_answer && !$password_is_hashed)
2142 2374
 		{
2143 2375
 			$args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer);
2144
-		}
2145
-		elseif(!$args->find_account_answer)
2376
+		} elseif(!$args->find_account_answer)
2146 2377
 		{
2147 2378
 			unset($args->find_account_answer);
2148 2379
 		}
@@ -2183,8 +2414,12 @@  discard block
 block discarded – undo
2183 2414
 		// Insert data into the DB
2184 2415
 		$args->list_order = -1 * $args->member_srl;
2185 2416
 
2186
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2187
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2417
+		if(!$args->user_id) {
2418
+			$args->user_id = 't'.$args->member_srl;
2419
+		}
2420
+		if(!$args->user_name) {
2421
+			$args->user_name = $args->member_srl;
2422
+		}
2188 2423
 
2189 2424
 		$oDB = &DB::getInstance();
2190 2425
 		$oDB->begin();
@@ -2196,8 +2431,11 @@  discard block
 block discarded – undo
2196 2431
 			return $output;
2197 2432
 		}
2198 2433
 
2199
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2200
-		else $group_srl_list = explode('|@|', $args->group_srl_list);
2434
+		if(is_array($args->group_srl_list)) {
2435
+			$group_srl_list = $args->group_srl_list;
2436
+		} else {
2437
+			$group_srl_list = explode('|@|', $args->group_srl_list);
2438
+		}
2201 2439
 		// If no value is entered the default group, the value of group registration
2202 2440
 		if(!$args->group_srl_list)
2203 2441
 		{
@@ -2214,8 +2452,7 @@  discard block
 block discarded – undo
2214 2452
 				}
2215 2453
 			}
2216 2454
 			// If the value is the value of the group entered the group registration
2217
-		}
2218
-		else
2455
+		} else
2219 2456
 		{
2220 2457
 			for($i=0;$i<count($group_srl_list);$i++)
2221 2458
 			{
@@ -2276,27 +2513,39 @@  discard block
 block discarded – undo
2276 2513
 	{
2277 2514
 		// Call a trigger (before)
2278 2515
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2279
-		if(!$output->toBool()) return $output;
2516
+		if(!$output->toBool()) {
2517
+			return $output;
2518
+		}
2280 2519
 		// Create a model object
2281 2520
 		$oMemberModel = getModel('member');
2282 2521
 
2283 2522
 		$logged_info = Context::get('logged_info');
2284 2523
 		// Get what you want to modify the original information
2285
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2524
+		if(!$this->memberInfo) {
2525
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2526
+		}
2286 2527
 		// Control of essential parameters
2287
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2288
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2528
+		if($args->allow_mailing!='Y') {
2529
+			$args->allow_mailing = 'N';
2530
+		}
2531
+		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) {
2532
+			$args->allow_message = 'Y';
2533
+		}
2289 2534
 
2290 2535
 		if($logged_info->is_admin == 'Y')
2291 2536
 		{
2292
-			if($args->denied!='Y') $args->denied = 'N';
2293
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2294
-		}
2295
-		else
2537
+			if($args->denied!='Y') {
2538
+				$args->denied = 'N';
2539
+			}
2540
+			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) {
2541
+				$args->is_admin = 'N';
2542
+			}
2543
+		} else
2296 2544
 		{
2297 2545
 			unset($args->is_admin);
2298
-			if($is_admin == false)
2299
-				unset($args->denied);
2546
+			if($is_admin == false) {
2547
+							unset($args->denied);
2548
+			}
2300 2549
 			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2301 2550
 			{
2302 2551
 				return $this->stop('msg_invalid_request');
@@ -2304,13 +2553,19 @@  discard block
 block discarded – undo
2304 2553
 		}
2305 2554
 
2306 2555
 		// Sanitize user ID, username, nickname, homepage, blog
2307
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2556
+		if($args->user_id) {
2557
+			$args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2558
+		}
2308 2559
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2309 2560
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2310 2561
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2311 2562
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2312
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2313
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2563
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) {
2564
+			$args->homepage = 'http://'.$args->homepage;
2565
+		}
2566
+		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) {
2567
+			$args->blog = 'http://'.$args->blog;
2568
+		}
2314 2569
 
2315 2570
 		// check member identifier form
2316 2571
 		$config = $oMemberModel->getMemberConfig();
@@ -2327,8 +2582,7 @@  discard block
 block discarded – undo
2327 2582
 				return new BaseObject(-1,'msg_exists_email_address');
2328 2583
 			}
2329 2584
 			$args->email_address = $orgMemberInfo->email_address;
2330
-		}
2331
-		else
2585
+		} else
2332 2586
 		{
2333 2587
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2334 2588
 			if($member_srl && $args->member_srl != $member_srl)
@@ -2385,16 +2639,14 @@  discard block
 block discarded – undo
2385 2639
 				return new BaseObject(-1, $message[$config->password_strength]);
2386 2640
 			}
2387 2641
 			$args->password = $oMemberModel->hashPassword($args->password);
2388
-		}
2389
-		else
2642
+		} else
2390 2643
 		{
2391 2644
 			$args->password = $orgMemberInfo->password;
2392 2645
 		}
2393 2646
 
2394 2647
 		if($args->find_account_answer) {
2395 2648
 			$args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer);
2396
-		}
2397
-		else
2649
+		} else
2398 2650
 		{
2399 2651
 			$oPassword =  new Password();
2400 2652
 			$hashed = $oPassword->checkAlgorithm($orgMemberInfo->find_account_answer);
@@ -2406,11 +2658,21 @@  discard block
 block discarded – undo
2406 2658
 			}
2407 2659
 		}
2408 2660
 
2409
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2410
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2411
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2412
-		if(!$args->description) $args->description = $orgMemberInfo->description;
2413
-		if(!$args->birthday) $args->birthday = '';
2661
+		if(!$args->user_name) {
2662
+			$args->user_name = $orgMemberInfo->user_name;
2663
+		}
2664
+		if(!$args->user_id) {
2665
+			$args->user_id = $orgMemberInfo->user_id;
2666
+		}
2667
+		if(!$args->nick_name) {
2668
+			$args->nick_name = $orgMemberInfo->nick_name;
2669
+		}
2670
+		if(!$args->description) {
2671
+			$args->description = $orgMemberInfo->description;
2672
+		}
2673
+		if(!$args->birthday) {
2674
+			$args->birthday = '';
2675
+		}
2414 2676
 
2415 2677
 		$output = executeQuery('member.updateMember', $args);
2416 2678
 
@@ -2422,8 +2684,11 @@  discard block
 block discarded – undo
2422 2684
 
2423 2685
 		if($args->group_srl_list)
2424 2686
 		{
2425
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2426
-			else $group_srl_list = explode('|@|', $args->group_srl_list);
2687
+			if(is_array($args->group_srl_list)) {
2688
+				$group_srl_list = $args->group_srl_list;
2689
+			} else {
2690
+				$group_srl_list = explode('|@|', $args->group_srl_list);
2691
+			}
2427 2692
 			// If the group information, group information changes
2428 2693
 			if(count($group_srl_list) > 0)
2429 2694
 			{
@@ -2466,7 +2731,9 @@  discard block
 block discarded – undo
2466 2731
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2467 2732
 
2468 2733
 		// Save Session
2469
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2734
+		if(!$this->memberInfo) {
2735
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2736
+		}
2470 2737
 		$logged_info = Context::get('logged_info');
2471 2738
 
2472 2739
 		$output->add('member_srl', $args->member_srl);
@@ -2492,8 +2759,7 @@  discard block
 block discarded – undo
2492 2759
 			}
2493 2760
 
2494 2761
 			$args->password = $oMemberModel->hashPassword($args->password);
2495
-		}
2496
-		else if($args->hashed_password)
2762
+		} else if($args->hashed_password)
2497 2763
 		{
2498 2764
 			$args->password = $args->hashed_password;
2499 2765
 		}
@@ -2528,7 +2794,9 @@  discard block
 block discarded – undo
2528 2794
 		$trigger_obj = new stdClass();
2529 2795
 		$trigger_obj->member_srl = $member_srl;
2530 2796
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2531
-		if(!$output->toBool()) return $output;
2797
+		if(!$output->toBool()) {
2798
+			return $output;
2799
+		}
2532 2800
 		// Create a model object
2533 2801
 		$oMemberModel = getModel('member');
2534 2802
 		// Bringing the user's information
@@ -2537,9 +2805,13 @@  discard block
 block discarded – undo
2537 2805
 			$columnList = array('member_srl', 'is_admin');
2538 2806
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2539 2807
 		}
2540
-		if(!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member');
2808
+		if(!$this->memberInfo) {
2809
+			return new BaseObject(-1, 'msg_not_exists_member');
2810
+		}
2541 2811
 		// If managers can not be deleted
2542
-		if($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin');
2812
+		if($this->memberInfo->is_admin == 'Y') {
2813
+			return new BaseObject(-1, 'msg_cannot_delete_admin');
2814
+		}
2543 2815
 
2544 2816
 		$oDB = &DB::getInstance();
2545 2817
 		$oDB->begin();
@@ -2603,7 +2875,9 @@  discard block
 block discarded – undo
2603 2875
 	 */
2604 2876
 	function destroySessionInfo()
2605 2877
 	{
2606
-		if(!$_SESSION || !is_array($_SESSION)) return;
2878
+		if(!$_SESSION || !is_array($_SESSION)) {
2879
+			return;
2880
+		}
2607 2881
 
2608 2882
 		$memberInfo = Context::get('logged_info');
2609 2883
 		$memberSrl = $memberInfo->member_srl;
@@ -2642,8 +2916,9 @@  discard block
 block discarded – undo
2642 2916
 		}
2643 2917
 		$maxLevel = 0;
2644 2918
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2645
-		if(count($resultGroup) > 0)
2646
-			$maxLevel = max(array_flip($resultGroup));
2919
+		if(count($resultGroup) > 0) {
2920
+					$maxLevel = max(array_flip($resultGroup));
2921
+		}
2647 2922
 
2648 2923
 		if($maxLevel > 0)
2649 2924
 		{
@@ -2660,16 +2935,22 @@  discard block
 block discarded – undo
2660 2935
 
2661 2936
 	function procMemberModifyEmailAddress()
2662 2937
 	{
2663
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2938
+		if(!Context::get('is_logged')) {
2939
+			return $this->stop('msg_not_logged');
2940
+		}
2664 2941
 
2665 2942
 		$member_info = Context::get('logged_info');
2666 2943
 		$newEmail = Context::get('email_address');
2667 2944
 
2668
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2945
+		if(!$newEmail) {
2946
+			return $this->stop('msg_invalid_request');
2947
+		}
2669 2948
 
2670 2949
 		$oMemberModel = getModel('member');
2671 2950
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2672
-		if($member_srl) return new BaseObject(-1,'msg_exists_email_address');
2951
+		if($member_srl) {
2952
+			return new BaseObject(-1,'msg_exists_email_address');
2953
+		}
2673 2954
 
2674 2955
 		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2675 2956
 		{
@@ -2697,7 +2978,9 @@  discard block
 block discarded – undo
2697 2978
 		$member_config = $oModuleModel->getModuleConfig('member');
2698 2979
 
2699 2980
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2700
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2981
+		if(!is_dir($tpl_path)) {
2982
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2983
+		}
2701 2984
 
2702 2985
 		global $lang;
2703 2986
 
@@ -2733,7 +3016,9 @@  discard block
 block discarded – undo
2733 3016
 	{
2734 3017
 		$member_srl = Context::get('member_srl');
2735 3018
 		$auth_key = Context::get('auth_key');
2736
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
3019
+		if(!$member_srl || !$auth_key) {
3020
+			return $this->stop('msg_invalid_request');
3021
+		}
2737 3022
 
2738 3023
 		// Test logs for finding password by user_id and authkey
2739 3024
 		$args = new stdClass;
@@ -2742,7 +3027,9 @@  discard block
 block discarded – undo
2742 3027
 		$output = executeQuery('member.getAuthMail', $args);
2743 3028
 		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2744 3029
 		{
2745
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
3030
+			if(strlen($output->data->auth_key) !== strlen($auth_key)) {
3031
+				executeQuery('member.deleteAuthChangeEmailAddress', $args);
3032
+			}
2746 3033
 			return $this->stop('msg_invalid_modify_email_auth_key');
2747 3034
 		}
2748 3035
 
@@ -2751,7 +3038,9 @@  discard block
 block discarded – undo
2751 3038
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2752 3039
 
2753 3040
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2754
-		if(!$output->toBool()) return $this->stop($output->getMessage());
3041
+		if(!$output->toBool()) {
3042
+			return $this->stop($output->getMessage());
3043
+		}
2755 3044
 
2756 3045
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2757 3046
 		executeQuery('member.deleteAuthChangeEmailAddress',$args);
@@ -2772,7 +3061,9 @@  discard block
 block discarded – undo
2772 3061
 	**/
2773 3062
 	function triggerGetDocumentMenu(&$menu_list)
2774 3063
 	{
2775
-		if(!Context::get('is_logged')) return new BaseObject();
3064
+		if(!Context::get('is_logged')) {
3065
+			return new BaseObject();
3066
+		}
2776 3067
 
2777 3068
 		$logged_info = Context::get('logged_info');
2778 3069
 		$document_srl = Context::get('target_srl');
@@ -2783,8 +3074,12 @@  discard block
 block discarded – undo
2783 3074
 		$member_srl = $oDocument->get('member_srl');
2784 3075
 		$module_srl = $oDocument->get('module_srl');
2785 3076
 
2786
-		if(!$member_srl) return new BaseObject();
2787
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject();
3077
+		if(!$member_srl) {
3078
+			return new BaseObject();
3079
+		}
3080
+		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
3081
+			return new BaseObject();
3082
+		}
2788 3083
 
2789 3084
 		$oDocumentController = getController('document');
2790 3085
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2802,7 +3097,9 @@  discard block
 block discarded – undo
2802 3097
 	**/
2803 3098
 	function triggerGetCommentMenu(&$menu_list)
2804 3099
 	{
2805
-		if(!Context::get('is_logged')) return new BaseObject();
3100
+		if(!Context::get('is_logged')) {
3101
+			return new BaseObject();
3102
+		}
2806 3103
 
2807 3104
 		$logged_info = Context::get('logged_info');
2808 3105
 		$comment_srl = Context::get('target_srl');
@@ -2813,8 +3110,12 @@  discard block
 block discarded – undo
2813 3110
 		$module_srl = $oComment->get('module_srl');
2814 3111
 		$member_srl = $oComment->get('member_srl');
2815 3112
 
2816
-		if(!$member_srl) return new BaseObject();
2817
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject();
3113
+		if(!$member_srl) {
3114
+			return new BaseObject();
3115
+		}
3116
+		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
3117
+			return new BaseObject();
3118
+		}
2818 3119
 
2819 3120
 		$oCommentController = getController('comment');
2820 3121
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2830,7 +3131,9 @@  discard block
 block discarded – undo
2830 3131
 	**/
2831 3132
 	function procMemberSpammerManage()
2832 3133
 	{
2833
-		if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
3134
+		if(!Context::get('is_logged')) {
3135
+			return new BaseObject(-1,'msg_not_permitted');
3136
+		}
2834 3137
 
2835 3138
 		$logged_info = Context::get('logged_info');
2836 3139
 		$member_srl = Context::get('member_srl');
@@ -2838,8 +3141,9 @@  discard block
 block discarded – undo
2838 3141
 		$cnt_loop = Context::get('cnt_loop');
2839 3142
 		$proc_type = Context::get('proc_type');
2840 3143
 		$isMoveToTrash = true;
2841
-		if($proc_type == "delete")
2842
-			$isMoveToTrash = false;
3144
+		if($proc_type == "delete") {
3145
+					$isMoveToTrash = false;
3146
+		}
2843 3147
 
2844 3148
 		// check grant
2845 3149
 		$oModuleModel = getModel('module');
@@ -2847,7 +3151,9 @@  discard block
 block discarded – undo
2847 3151
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2848 3152
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2849 3153
 
2850
-		if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted');
3154
+		if(!$grant->manager) {
3155
+			return new BaseObject(-1,'msg_not_permitted');
3156
+		}
2851 3157
 
2852 3158
 		$proc_msg = "";
2853 3159
 
@@ -2856,11 +3162,13 @@  discard block
 block discarded – undo
2856 3162
 
2857 3163
 		// delete or trash destination
2858 3164
 		// proc member
2859
-		if($cnt_loop == 1)
2860
-			$this->_spammerMember($member_srl);
3165
+		if($cnt_loop == 1) {
3166
+					$this->_spammerMember($member_srl);
3167
+		}
2861 3168
 		// proc document and comment
2862
-		elseif($cnt_loop>1)
2863
-			$this->_spammerDocuments($member_srl, $isMoveToTrash);
3169
+		elseif($cnt_loop>1) {
3170
+					$this->_spammerDocuments($member_srl, $isMoveToTrash);
3171
+		}
2864 3172
 
2865 3173
 		// get destination count
2866 3174
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
@@ -2868,13 +3176,16 @@  discard block
 block discarded – undo
2868 3176
 
2869 3177
 		$total_count = Context::get('total_count');
2870 3178
 		$remain_count = $cnt_document + $cnt_comment;
2871
-		if($cnt_loop == 1) $total_count = $remain_count;
3179
+		if($cnt_loop == 1) {
3180
+			$total_count = $remain_count;
3181
+		}
2872 3182
 
2873 3183
 		// get progress percent
2874
-		if($total_count > 0)
2875
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2876
-		else
2877
-			$progress = 100;
3184
+		if($total_count > 0) {
3185
+					$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
3186
+		} else {
3187
+					$progress = 100;
3188
+		}
2878 3189
 
2879 3190
 		$this->add('total_count', $total_count);
2880 3191
 		$this->add('remain_count', $remain_count);
@@ -2916,7 +3227,10 @@  discard block
 block discarded – undo
2916 3227
 		$args->nick_name = $member_info->nick_name;
2917 3228
 		$args->denied = "Y";
2918 3229
 		$args->description = trim( $member_info->description );
2919
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
3230
+		if( $args->description != "" ) {
3231
+			$args->description .= "\n";
3232
+		}
3233
+		// add new line
2920 3234
 
2921 3235
 		$args->description .= Context::getLang('cmd_spammer') . "[" . date("Y-m-d H:i:s") . " from:" . $logged_info->user_id . " info:" . $spam_description . " docuemnts count:" . $total_count . "]";
2922 3236
 
@@ -2961,8 +3275,11 @@  discard block
 block discarded – undo
2961 3275
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2962 3276
 			if($documentList) {
2963 3277
 				foreach($documentList as $v) {
2964
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2965
-					else $oDocumentController->deleteDocument($v->document_srl);
3278
+					if($isMoveToTrash) {
3279
+						$oDocumentController->moveDocumentToTrash($v);
3280
+					} else {
3281
+						$oDocumentController->deleteDocument($v->document_srl);
3282
+					}
2966 3283
 				}
2967 3284
 			}
2968 3285
 		}
Please login to merge, or discard this patch.
classes/context/Context.class.php 2 patches
Spacing   +311 added lines, -311 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 	function &getInstance()
163 163
 	{
164 164
 		static $theInstance = null;
165
-		if(!$theInstance)
165
+		if (!$theInstance)
166 166
 		{
167 167
 			$theInstance = new Context();
168 168
 		}
@@ -182,10 +182,10 @@  discard block
 block discarded – undo
182 182
 
183 183
 		// include ssl action cache file
184 184
 		$this->sslActionCacheFile = FileHandler::getRealPath($this->sslActionCacheFile);
185
-		if(is_readable($this->sslActionCacheFile))
185
+		if (is_readable($this->sslActionCacheFile))
186 186
 		{
187 187
 			require($this->sslActionCacheFile);
188
-			if(isset($sslActions))
188
+			if (isset($sslActions))
189 189
 			{
190 190
 				$this->ssl_actions = $sslActions;
191 191
 			}
@@ -201,12 +201,12 @@  discard block
 block discarded – undo
201 201
 	function init()
202 202
 	{
203 203
 		// fix missing HTTP_RAW_POST_DATA in PHP 5.6 and above
204
-		if(!isset($GLOBALS['HTTP_RAW_POST_DATA']) && version_compare(PHP_VERSION, '5.6.0', '>=') === TRUE)
204
+		if (!isset($GLOBALS['HTTP_RAW_POST_DATA']) && version_compare(PHP_VERSION, '5.6.0', '>=') === TRUE)
205 205
 		{
206 206
 			$GLOBALS['HTTP_RAW_POST_DATA'] = file_get_contents("php://input");
207 207
 			
208 208
 			// If content is not XML JSON, unset
209
-			if(!preg_match('/^[\<\{\[]/', $GLOBALS['HTTP_RAW_POST_DATA']) && strpos($_SERVER['CONTENT_TYPE'], 'json') === FALSE && strpos($_SERVER['HTTP_CONTENT_TYPE'], 'json') === FALSE)
209
+			if (!preg_match('/^[\<\{\[]/', $GLOBALS['HTTP_RAW_POST_DATA']) && strpos($_SERVER['CONTENT_TYPE'], 'json') === FALSE && strpos($_SERVER['HTTP_CONTENT_TYPE'], 'json') === FALSE)
210 210
 			{
211 211
 				unset($GLOBALS['HTTP_RAW_POST_DATA']);
212 212
 			}
@@ -228,11 +228,11 @@  discard block
 block discarded – undo
228 228
 		$this->_setUploadedArgument();
229 229
 
230 230
 		$this->loadDBInfo();
231
-		if($this->db_info->use_sitelock == 'Y')
231
+		if ($this->db_info->use_sitelock == 'Y')
232 232
 		{
233
-			if(is_array($this->db_info->sitelock_whitelist)) $whitelist = $this->db_info->sitelock_whitelist;
233
+			if (is_array($this->db_info->sitelock_whitelist)) $whitelist = $this->db_info->sitelock_whitelist;
234 234
 
235
-			if(!IpFilter::filter($whitelist))
235
+			if (!IpFilter::filter($whitelist))
236 236
 			{
237 237
 				$title = ($this->db_info->sitelock_title) ? $this->db_info->sitelock_title : 'Maintenance in progress...';
238 238
 				$message = $this->db_info->sitelock_message;
@@ -242,52 +242,52 @@  discard block
 block discarded – undo
242 242
 				define('_XE_SITELOCK_MESSAGE_', $message);
243 243
 
244 244
 				header("HTTP/1.1 403 Forbidden");
245
-				if(FileHandler::exists(_XE_PATH_ . 'common/tpl/sitelock.user.html'))
245
+				if (FileHandler::exists(_XE_PATH_.'common/tpl/sitelock.user.html'))
246 246
 				{
247
-					include _XE_PATH_ . 'common/tpl/sitelock.user.html';
247
+					include _XE_PATH_.'common/tpl/sitelock.user.html';
248 248
 				}
249 249
 				else
250 250
 				{
251
-					include _XE_PATH_ . 'common/tpl/sitelock.html';
251
+					include _XE_PATH_.'common/tpl/sitelock.html';
252 252
 				}
253 253
 				exit;
254 254
 			}
255 255
 		}
256 256
 
257 257
 		// If XE is installed, get virtual site information
258
-		if(self::isInstalled())
258
+		if (self::isInstalled())
259 259
 		{
260 260
 			$oModuleModel = getModel('module');
261 261
 			$site_module_info = $oModuleModel->getDefaultMid();
262 262
 
263
-			if(!isset($site_module_info))
263
+			if (!isset($site_module_info))
264 264
 			{
265 265
 				$site_module_info = new stdClass();
266 266
 			}
267 267
 
268 268
 			// if site_srl of site_module_info is 0 (default site), compare the domain to default_url of db_config
269
-			if($site_module_info->site_srl == 0 && $site_module_info->domain != $this->db_info->default_url)
269
+			if ($site_module_info->site_srl == 0 && $site_module_info->domain != $this->db_info->default_url)
270 270
 			{
271 271
 				$site_module_info->domain = $this->db_info->default_url;
272 272
 			}
273 273
 
274 274
 			$this->set('site_module_info', $site_module_info);
275
-			if($site_module_info->site_srl && isSiteID($site_module_info->domain))
275
+			if ($site_module_info->site_srl && isSiteID($site_module_info->domain))
276 276
 			{
277 277
 				$this->set('vid', $site_module_info->domain, TRUE);
278 278
 			}
279 279
 
280
-			if(!isset($this->db_info))
280
+			if (!isset($this->db_info))
281 281
 			{
282 282
 				$this->db_info = new stdClass();
283 283
 			}
284 284
 
285 285
 			$this->db_info->lang_type = $site_module_info->default_language;
286
-			if(!$this->db_info->lang_type)
286
+			if (!$this->db_info->lang_type)
287 287
 			{
288 288
 				$this->db_info->lang_type = 'en';
289 289
 			}
290
-			if(!$this->db_info->use_db_session)
290
+			if (!$this->db_info->use_db_session)
291 291
 			{
292 292
 				$this->db_info->use_db_session = 'N';
293 293
 			}
@@ -297,30 +297,30 @@  discard block
 block discarded – undo
297 297
 		$lang_supported = $this->loadLangSelected();
298 298
 
299 299
 		// Retrieve language type set in user's cookie
300
-		if($this->lang_type = $this->get('l'))
300
+		if ($this->lang_type = $this->get('l'))
301 301
 		{
302
-			if($_COOKIE['lang_type'] != $this->lang_type)
302
+			if ($_COOKIE['lang_type'] != $this->lang_type)
303 303
 			{
304 304
 				saveCookie('lang_type', $this->lang_type, false, $_SERVER['REQUEST_TIME'] + 3600 * 24 * 1000);
305 305
 			}
306 306
 		}
307
-		elseif($_COOKIE['lang_type'])
307
+		elseif ($_COOKIE['lang_type'])
308 308
 		{
309 309
 			$this->lang_type = $_COOKIE['lang_type'];
310 310
 		}
311 311
 
312 312
 		// If it's not exists, follow default language type set in db_info
313
-		if(!$this->lang_type)
313
+		if (!$this->lang_type)
314 314
 		{
315 315
 			$this->lang_type = $this->db_info->lang_type;
316 316
 		}
317 317
 
318 318
 		// if still lang_type has not been set or has not-supported type , set as English.
319
-		if(!$this->lang_type)
319
+		if (!$this->lang_type)
320 320
 		{
321 321
 			$this->lang_type = 'en';
322 322
 		}
323
-		if(is_array($lang_supported) && !isset($lang_supported[$this->lang_type]))
323
+		if (is_array($lang_supported) && !isset($lang_supported[$this->lang_type]))
324 324
 		{
325 325
 			$this->lang_type = 'en';
326 326
 		}
@@ -329,10 +329,10 @@  discard block
 block discarded – undo
329 329
 		$this->setLangType($this->lang_type);
330 330
 
331 331
 		// load module module's language file according to language setting
332
-		$this->loadLang(_XE_PATH_ . 'modules/module/lang');
332
+		$this->loadLang(_XE_PATH_.'modules/module/lang');
333 333
 
334 334
 		// set session handler
335
-		if(self::isInstalled() && $this->db_info->use_db_session == 'Y')
335
+		if (self::isInstalled() && $this->db_info->use_db_session == 'Y')
336 336
 		{
337 337
 			$oSessionModel = getModel('session');
338 338
 			$oSessionController = getController('session');
@@ -341,15 +341,15 @@  discard block
 block discarded – undo
341 341
 			);
342 342
 		}
343 343
 
344
-		if($sess = $_POST[session_name()]) session_id($sess);
344
+		if ($sess = $_POST[session_name()]) session_id($sess);
345 345
 		ini_set('session.cookie_httponly', true);
346 346
 		ini_set('session.cookie_secure', Context::getSslStatus() === 'always');
347 347
 		session_start();
348 348
 
349 349
 		// set authentication information in Context and session
350
-		if(self::isInstalled())
350
+		if (self::isInstalled())
351 351
 		{
352
-			if(!$_SESSION['csrf_token'])
352
+			if (!$_SESSION['csrf_token'])
353 353
 			{
354 354
 				$_SESSION['csrf_token'] = Password::createSecureSalt(40);
355 355
 			}
@@ -360,15 +360,15 @@  discard block
 block discarded – undo
360 360
 			$oMemberModel = getModel('member');
361 361
 			$oMemberController = getController('member');
362 362
 
363
-			if($oMemberController && $oMemberModel)
363
+			if ($oMemberController && $oMemberModel)
364 364
 			{
365 365
 				// if signed in, validate it.
366
-				if($oMemberModel->isLogged())
366
+				if ($oMemberModel->isLogged())
367 367
 				{
368 368
 					$oMemberController->setSessionInfo();
369 369
 				}
370 370
 				// check auto sign-in
371
-				elseif($_COOKIE['xeak'])
371
+				elseif ($_COOKIE['xeak'])
372 372
 				{
373 373
 					$oMemberController->doAutologin();
374 374
 				}
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 
381 381
 		// load common language file
382 382
 		$this->lang = &$GLOBALS['lang'];
383
-		$this->loadLang(_XE_PATH_ . 'common/lang/');
383
+		$this->loadLang(_XE_PATH_.'common/lang/');
384 384
 
385 385
 		// check if using rewrite module
386 386
 		$this->allow_rewrite = ($this->db_info->use_rewrite == 'Y' ? TRUE : FALSE);
@@ -388,28 +388,28 @@  discard block
 block discarded – undo
388 388
 		// set locations for javascript use
389 389
 		$url = array();
390 390
 		$current_url = self::getRequestUri();
391
-		if($_SERVER['REQUEST_METHOD'] == 'GET')
391
+		if ($_SERVER['REQUEST_METHOD'] == 'GET')
392 392
 		{
393
-			if($this->get_vars)
393
+			if ($this->get_vars)
394 394
 			{
395 395
 				$url = array();
396
-				foreach($this->get_vars as $key => $val)
396
+				foreach ($this->get_vars as $key => $val)
397 397
 				{
398
-					if(is_array($val) && count($val) > 0)
398
+					if (is_array($val) && count($val) > 0)
399 399
 					{
400
-						foreach($val as $k => $v)
400
+						foreach ($val as $k => $v)
401 401
 						{
402
-							$url[] = $key . '[' . $k . ']=' . urlencode($v);
402
+							$url[] = $key.'['.$k.']='.urlencode($v);
403 403
 						}
404 404
 					}
405
-					elseif($val)
405
+					elseif ($val)
406 406
 					{
407
-						$url[] = $key . '=' . urlencode($val);
407
+						$url[] = $key.'='.urlencode($val);
408 408
 					}
409 409
 				}
410 410
 
411 411
 				$current_url = self::getRequestUri();
412
-				if($url) $current_url .= '?' . join('&', $url);
412
+				if ($url) $current_url .= '?'.join('&', $url);
413 413
 			}
414 414
 			else
415 415
 			{
@@ -424,12 +424,12 @@  discard block
 block discarded – undo
424 424
 		$this->set('current_url', $current_url);
425 425
 		$this->set('request_uri', self::getRequestUri());
426 426
 
427
-		if(strpos($current_url, 'xn--') !== FALSE)
427
+		if (strpos($current_url, 'xn--') !== FALSE)
428 428
 		{
429 429
 			$this->set('current_url', self::decodeIdna($current_url));
430 430
 		}
431 431
 
432
-		if(strpos(self::getRequestUri(), 'xn--') !== FALSE)
432
+		if (strpos(self::getRequestUri(), 'xn--') !== FALSE)
433 433
 		{
434 434
 			$this->set('request_uri', self::decodeIdna(self::getRequestUri()));
435 435
 		}
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 	{
455 455
 		$self = self::getInstance();
456 456
 
457
-		if(!$self->isInstalled())
457
+		if (!$self->isInstalled())
458 458
 		{
459 459
 			return;
460 460
 		}
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
 		ob_end_clean();
465 465
 
466 466
 		// If master_db information does not exist, the config file needs to be updated
467
-		if(!isset($db_info->master_db))
467
+		if (!isset($db_info->master_db))
468 468
 		{
469 469
 			$db_info->master_db = array();
470 470
 			$db_info->master_db["db_type"] = $db_info->db_type;
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 			$db_info->master_db["db_table_prefix"] = $db_info->db_table_prefix;
483 483
 			unset($db_info->db_table_prefix);
484 484
 
485
-			if(isset($db_info->master_db["db_table_prefix"]) && substr_compare($db_info->master_db["db_table_prefix"], '_', -1) !== 0)
485
+			if (isset($db_info->master_db["db_table_prefix"]) && substr_compare($db_info->master_db["db_table_prefix"], '_', -1) !== 0)
486 486
 			{
487 487
 				$db_info->master_db["db_table_prefix"] .= '_';
488 488
 			}
@@ -494,33 +494,33 @@  discard block
 block discarded – undo
494 494
 			$oInstallController->makeConfigFile();
495 495
 		}
496 496
 
497
-		if(!$db_info->use_prepared_statements)
497
+		if (!$db_info->use_prepared_statements)
498 498
 		{
499 499
 			$db_info->use_prepared_statements = 'Y';
500 500
 		}
501 501
 
502
-		if(!$db_info->time_zone)
502
+		if (!$db_info->time_zone)
503 503
 			$db_info->time_zone = date('O');
504 504
 		$GLOBALS['_time_zone'] = $db_info->time_zone;
505 505
 
506
-		if($db_info->qmail_compatibility != 'Y')
506
+		if ($db_info->qmail_compatibility != 'Y')
507 507
 			$db_info->qmail_compatibility = 'N';
508 508
 		$GLOBALS['_qmail_compatibility'] = $db_info->qmail_compatibility;
509 509
 
510
-		if(!$db_info->use_db_session)
510
+		if (!$db_info->use_db_session)
511 511
 			$db_info->use_db_session = 'N';
512
-		if(!$db_info->use_ssl)
512
+		if (!$db_info->use_ssl)
513 513
 			$db_info->use_ssl = 'none';
514 514
 		$this->set('_use_ssl', $db_info->use_ssl);
515 515
 
516 516
 		$self->set('_http_port', ($db_info->http_port) ? $db_info->http_port : NULL);
517 517
 		$self->set('_https_port', ($db_info->https_port) ? $db_info->https_port : NULL);
518 518
 
519
-		if(!$db_info->sitelock_whitelist) {
519
+		if (!$db_info->sitelock_whitelist) {
520 520
 			$db_info->sitelock_whitelist = '127.0.0.1';
521 521
 		}
522 522
 
523
-		if(is_string($db_info->sitelock_whitelist)) {
523
+		if (is_string($db_info->sitelock_whitelist)) {
524 524
 			$db_info->sitelock_whitelist = explode(',', $db_info->sitelock_whitelist);
525 525
 		}
526 526
 
@@ -591,10 +591,10 @@  discard block
 block discarded – undo
591 591
 	function loadLangSupported()
592 592
 	{
593 593
 		static $lang_supported = null;
594
-		if(!$lang_supported)
594
+		if (!$lang_supported)
595 595
 		{
596
-			$langs = file(_XE_PATH_ . 'common/lang/lang.info');
597
-			foreach($langs as $val)
596
+			$langs = file(_XE_PATH_.'common/lang/lang.info');
597
+			foreach ($langs as $val)
598 598
 			{
599 599
 				list($lang_prefix, $lang_text) = explode(',', $val);
600 600
 				$lang_text = trim($lang_text);
@@ -612,17 +612,17 @@  discard block
 block discarded – undo
612 612
 	function loadLangSelected()
613 613
 	{
614 614
 		static $lang_selected = null;
615
-		if(!$lang_selected)
615
+		if (!$lang_selected)
616 616
 		{
617
-			$orig_lang_file = _XE_PATH_ . 'common/lang/lang.info';
618
-			$selected_lang_file = _XE_PATH_ . 'files/config/lang_selected.info';
619
-			if(!FileHandler::hasContent($selected_lang_file))
617
+			$orig_lang_file = _XE_PATH_.'common/lang/lang.info';
618
+			$selected_lang_file = _XE_PATH_.'files/config/lang_selected.info';
619
+			if (!FileHandler::hasContent($selected_lang_file))
620 620
 			{
621
-				$old_selected_lang_file = _XE_PATH_ . 'files/cache/lang_selected.info';
621
+				$old_selected_lang_file = _XE_PATH_.'files/cache/lang_selected.info';
622 622
 				FileHandler::moveFile($old_selected_lang_file, $selected_lang_file);
623 623
 			}
624 624
 
625
-			if(!FileHandler::hasContent($selected_lang_file))
625
+			if (!FileHandler::hasContent($selected_lang_file))
626 626
 			{
627 627
 				$buff = FileHandler::readFile($orig_lang_file);
628 628
 				FileHandler::writeFile($selected_lang_file, $buff);
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
 			else
632 632
 			{
633 633
 				$langs = file($selected_lang_file);
634
-				foreach($langs as $val)
634
+				foreach ($langs as $val)
635 635
 				{
636 636
 					list($lang_prefix, $lang_text) = explode(',', $val);
637 637
 					$lang_text = trim($lang_text);
@@ -650,56 +650,56 @@  discard block
 block discarded – undo
650 650
 	function checkSSO()
651 651
 	{
652 652
 		// pass if it's not GET request or XE is not yet installed
653
-		if($this->db_info->use_sso != 'Y' || isCrawler())
653
+		if ($this->db_info->use_sso != 'Y' || isCrawler())
654 654
 		{
655 655
 			return TRUE;
656 656
 		}
657 657
 		$checkActList = array('rss' => 1, 'atom' => 1);
658
-		if(self::getRequestMethod() != 'GET' || !self::isInstalled() || isset($checkActList[self::get('act')]))
658
+		if (self::getRequestMethod() != 'GET' || !self::isInstalled() || isset($checkActList[self::get('act')]))
659 659
 		{
660 660
 			return TRUE;
661 661
 		}
662 662
 
663 663
 		// pass if default URL is not set
664 664
 		$default_url = trim($this->db_info->default_url);
665
-		if(!$default_url)
665
+		if (!$default_url)
666 666
 		{
667 667
 			return TRUE;
668 668
 		}
669 669
 
670
-		if(substr_compare($default_url, '/', -1) !== 0)
670
+		if (substr_compare($default_url, '/', -1) !== 0)
671 671
 		{
672 672
 			$default_url .= '/';
673 673
 		}
674 674
 
675 675
 		// for sites recieving SSO valdiation
676
-		if($default_url == self::getRequestUri())
676
+		if ($default_url == self::getRequestUri())
677 677
 		{
678
-			if(self::get('url'))
678
+			if (self::get('url'))
679 679
 			{
680 680
 				$url = base64_decode(self::get('url'));
681 681
 				$url_info = parse_url($url);
682
-				if(!Password::checkSignature($url, self::get('sig')))
682
+				if (!Password::checkSignature($url, self::get('sig')))
683 683
 				{
684 684
 					echo self::get('lang')->msg_invalid_request;
685 685
 					return false;
686 686
 				}
687 687
 
688 688
 				$oModuleModel = getModel('module');
689
-				$domain = $url_info['host'] . $url_info['path'];
690
-				if(substr_compare($domain, '/', -1) === 0) $domain = substr($domain, 0, -1);
689
+				$domain = $url_info['host'].$url_info['path'];
690
+				if (substr_compare($domain, '/', -1) === 0) $domain = substr($domain, 0, -1);
691 691
 				$site_info = $oModuleModel->getSiteInfoByDomain($domain);
692 692
 
693
-				if($site_info->site_srl)
693
+				if ($site_info->site_srl)
694 694
 				{
695
-				$url_info['query'].= ($url_info['query'] ? '&' : '') . 'SSOID=' . urlencode(session_id()) . '&sig=' . urlencode(Password::createSignature(session_id()));
696
-				$redirect_url = sprintf('%s://%s%s%s?%s', $url_info['scheme'], $url_info['host'], $url_info['port'] ? ':' . $url_info['port'] : '', $url_info['path'], $url_info['query']);
695
+				$url_info['query'] .= ($url_info['query'] ? '&' : '').'SSOID='.urlencode(session_id()).'&sig='.urlencode(Password::createSignature(session_id()));
696
+				$redirect_url = sprintf('%s://%s%s%s?%s', $url_info['scheme'], $url_info['host'], $url_info['port'] ? ':'.$url_info['port'] : '', $url_info['path'], $url_info['query']);
697 697
 				}
698 698
 				else
699 699
 				{
700 700
 					$redirect_url = $url;
701 701
 				}
702
-				header('location:' . $redirect_url);
702
+				header('location:'.$redirect_url);
703 703
 
704 704
 				return FALSE;
705 705
 			}
@@ -708,9 +708,9 @@  discard block
 block discarded – undo
708 708
 		else
709 709
 		{
710 710
 			// result handling : set session_name()
711
-			if($session_name = self::get('SSOID'))
711
+			if ($session_name = self::get('SSOID'))
712 712
 			{
713
-				if(!Password::checkSignature($session_name, self::get('sig')))
713
+				if (!Password::checkSignature($session_name, self::get('sig')))
714 714
 				{
715 715
 					echo self::get('lang')->msg_invalid_request;
716 716
 					return false;
@@ -719,17 +719,17 @@  discard block
 block discarded – undo
719 719
 				saveCookie(session_name(), $session_name, true);
720 720
 
721 721
 				$url = preg_replace('/[\?\&]SSOID=.+$/', '', self::getRequestUrl());
722
-				header('location:' . $url);
722
+				header('location:'.$url);
723 723
 				return FALSE;
724 724
 				// send SSO request
725 725
 			}
726
-			else if(!self::get('SSOID') && $_COOKIE['sso'] != md5(self::getRequestUri()))
726
+			else if (!self::get('SSOID') && $_COOKIE['sso'] != md5(self::getRequestUri()))
727 727
 			{
728 728
 				saveCookie('sso', md5(self::getRequestUri()), true);
729 729
 				$origin_url = self::getRequestUrl();
730 730
 				$origin_sig = Password::createSignature($origin_url);
731 731
 				$url = sprintf("%s?url=%s&sig=%s", $default_url, urlencode(base64_encode($origin_url)), urlencode($origin_sig));
732
-				header('location:' . $url);
732
+				header('location:'.$url);
733 733
 				return FALSE;
734 734
 			}
735 735
 		}
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
 	{
757 757
 		$self = self::getInstance();
758 758
 
759
-		if(!$self->isFTPRegisted())
759
+		if (!$self->isFTPRegisted())
760 760
 		{
761 761
 			return null;
762 762
 		}
@@ -774,15 +774,15 @@  discard block
 block discarded – undo
774 774
 	 */
775 775
 	function addBrowserTitle($site_title)
776 776
 	{
777
-		if(!$site_title)
777
+		if (!$site_title)
778 778
 		{
779 779
 			return;
780 780
 		}
781 781
 		$self = self::getInstance();
782 782
 
783
-		if($self->site_title)
783
+		if ($self->site_title)
784 784
 		{
785
-			$self->site_title .= ' - ' . $site_title;
785
+			$self->site_title .= ' - '.$site_title;
786 786
 		}
787 787
 		else
788 788
 		{
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
 	 */
799 799
 	function setBrowserTitle($site_title)
800 800
 	{
801
-		if(!$site_title)
801
+		if (!$site_title)
802 802
 		{
803 803
 			return;
804 804
 		}
@@ -830,7 +830,7 @@  discard block
 block discarded – undo
830 830
 		$oModuleModel = getModel('module');
831 831
 		$moduleConfig = $oModuleModel->getModuleConfig('module');
832 832
 
833
-		if(isset($moduleConfig->siteTitle))
833
+		if (isset($moduleConfig->siteTitle))
834 834
 		{
835 835
 			return $moduleConfig->siteTitle;
836 836
 		}
@@ -857,30 +857,30 @@  discard block
 block discarded – undo
857 857
 		global $lang;
858 858
 
859 859
 		$self = self::getInstance();
860
-		if(!$self->lang_type)
860
+		if (!$self->lang_type)
861 861
 		{
862 862
 			return;
863 863
 		}
864
-		if(!is_object($lang))
864
+		if (!is_object($lang))
865 865
 		{
866 866
 			$lang = new stdClass;
867 867
 		}
868 868
 
869
-		if(!($filename = $self->_loadXmlLang($path)))
869
+		if (!($filename = $self->_loadXmlLang($path)))
870 870
 		{
871 871
 			$filename = $self->_loadPhpLang($path);
872 872
 		}
873 873
 
874
-		if(!is_array($self->loaded_lang_files))
874
+		if (!is_array($self->loaded_lang_files))
875 875
 		{
876 876
 			$self->loaded_lang_files = array();
877 877
 		}
878
-		if(in_array($filename, $self->loaded_lang_files))
878
+		if (in_array($filename, $self->loaded_lang_files))
879 879
 		{
880 880
 			return;
881 881
 		}
882 882
 
883
-		if($filename && is_readable($filename))
883
+		if ($filename && is_readable($filename))
884 884
 		{
885 885
 			$self->loaded_lang_files[] = $filename;
886 886
 			include($filename);
@@ -901,24 +901,24 @@  discard block
 block discarded – undo
901 901
 	{
902 902
 		global $lang;
903 903
 
904
-		if(!$path) return;
904
+		if (!$path) return;
905 905
 
906
-		$_path = 'eval://' . $path;
906
+		$_path = 'eval://'.$path;
907 907
 
908
-		if(in_array($_path, $this->loaded_lang_files))
908
+		if (in_array($_path, $this->loaded_lang_files))
909 909
 		{
910 910
 			return;
911 911
 		}
912 912
 
913
-		if(substr_compare($path, '/', -1) !== 0)
913
+		if (substr_compare($path, '/', -1) !== 0)
914 914
 		{
915 915
 			$path .= '/';
916 916
 		}
917 917
 
918
-		$oXmlLangParser = new XmlLangParser($path . 'lang.xml', $this->lang_type);
918
+		$oXmlLangParser = new XmlLangParser($path.'lang.xml', $this->lang_type);
919 919
 		$content = $oXmlLangParser->getCompileContent();
920 920
 
921
-		if($content)
921
+		if ($content)
922 922
 		{
923 923
 			$this->loaded_lang_files[] = $_path;
924 924
 			eval($content);
@@ -933,9 +933,9 @@  discard block
 block discarded – undo
933 933
 	 */
934 934
 	function _loadXmlLang($path)
935 935
 	{
936
-		if(!$path) return;
936
+		if (!$path) return;
937 937
 
938
-		$oXmlLangParser = new XmlLangParser($path . ((substr_compare($path, '/', -1) !== 0) ? '/' : '') . 'lang.xml', $this->lang_type);
938
+		$oXmlLangParser = new XmlLangParser($path.((substr_compare($path, '/', -1) !== 0) ? '/' : '').'lang.xml', $this->lang_type);
939 939
 		return $oXmlLangParser->compile();
940 940
 	}
941 941
 
@@ -947,22 +947,22 @@  discard block
 block discarded – undo
947 947
 	 */
948 948
 	function _loadPhpLang($path)
949 949
 	{
950
-		if(!$path) return;
950
+		if (!$path) return;
951 951
 
952
-		if(substr_compare($path, '/', -1) !== 0)
952
+		if (substr_compare($path, '/', -1) !== 0)
953 953
 		{
954 954
 			$path .= '/';
955 955
 		}
956
-		$path_tpl = $path . '%s.lang.php';
956
+		$path_tpl = $path.'%s.lang.php';
957 957
 		$file = sprintf($path_tpl, $this->lang_type);
958 958
 
959 959
 		$langs = array('ko', 'en'); // this will be configurable.
960
-		while(!is_readable($file) && $langs[0])
960
+		while (!is_readable($file) && $langs[0])
961 961
 		{
962 962
 			$file = sprintf($path_tpl, array_shift($langs));
963 963
 		}
964 964
 
965
-		if(!is_readable($file))
965
+		if (!is_readable($file))
966 966
 		{
967 967
 			return FALSE;
968 968
 		}
@@ -1004,11 +1004,11 @@  discard block
 block discarded – undo
1004 1004
 	 */
1005 1005
 	function getLang($code)
1006 1006
 	{
1007
-		if(!$code)
1007
+		if (!$code)
1008 1008
 		{
1009 1009
 			return;
1010 1010
 		}
1011
-		if($GLOBALS['lang']->{$code})
1011
+		if ($GLOBALS['lang']->{$code})
1012 1012
 		{
1013 1013
 			return $GLOBALS['lang']->{$code};
1014 1014
 		}
@@ -1024,7 +1024,7 @@  discard block
 block discarded – undo
1024 1024
 	 */
1025 1025
 	function setLang($code, $val)
1026 1026
 	{
1027
-		if(!isset($GLOBALS['lang']))
1027
+		if (!isset($GLOBALS['lang']))
1028 1028
 		{
1029 1029
 			$GLOBALS['lang'] = new stdClass();
1030 1030
 		}
@@ -1049,17 +1049,17 @@  discard block
 block discarded – undo
1049 1049
 
1050 1050
 		$obj = clone $source_obj;
1051 1051
 
1052
-		foreach($charset_list as $charset)
1052
+		foreach ($charset_list as $charset)
1053 1053
 		{
1054
-			array_walk($obj,'Context::checkConvertFlag',$charset);
1054
+			array_walk($obj, 'Context::checkConvertFlag', $charset);
1055 1055
 			$flag = self::checkConvertFlag($flag = TRUE);
1056
-			if($flag)
1056
+			if ($flag)
1057 1057
 			{
1058
-				if($charset == 'UTF-8')
1058
+				if ($charset == 'UTF-8')
1059 1059
 				{
1060 1060
 					return $obj;
1061 1061
 				}
1062
-				array_walk($obj,'Context::doConvertEncoding',$charset);
1062
+				array_walk($obj, 'Context::doConvertEncoding', $charset);
1063 1063
 				return $obj;
1064 1064
 			}
1065 1065
 		}
@@ -1078,11 +1078,11 @@  discard block
 block discarded – undo
1078 1078
 	function checkConvertFlag(&$val, $key = null, $charset = null)
1079 1079
 	{
1080 1080
 		static $flag = TRUE;
1081
-		if($charset)
1081
+		if ($charset)
1082 1082
 		{
1083
-			if(is_array($val))
1084
-				array_walk($val,'Context::checkConvertFlag',$charset);
1085
-			else if($val && iconv($charset,$charset,$val)!=$val) $flag = FALSE;
1083
+			if (is_array($val))
1084
+				array_walk($val, 'Context::checkConvertFlag', $charset);
1085
+			else if ($val && iconv($charset, $charset, $val) != $val) $flag = FALSE;
1086 1086
 			else $flag = FALSE;
1087 1087
 		}
1088 1088
 		else
@@ -1106,9 +1106,9 @@  discard block
 block discarded – undo
1106 1106
 	{
1107 1107
 		if (is_array($val))
1108 1108
 		{
1109
-			array_walk($val,'Context::doConvertEncoding',$charset);
1109
+			array_walk($val, 'Context::doConvertEncoding', $charset);
1110 1110
 		}
1111
-		else $val = iconv($charset,'UTF-8',$val);
1111
+		else $val = iconv($charset, 'UTF-8', $val);
1112 1112
 	}
1113 1113
 
1114 1114
 	/**
@@ -1119,7 +1119,7 @@  discard block
 block discarded – undo
1119 1119
 	 */
1120 1120
 	function convertEncodingStr($str)
1121 1121
 	{
1122
-        if(!$str) return null;
1122
+        if (!$str) return null;
1123 1123
 		$obj = new stdClass();
1124 1124
 		$obj->str = $str;
1125 1125
 		$obj = self::convertEncoding($obj);
@@ -1128,9 +1128,9 @@  discard block
 block discarded – undo
1128 1128
 
1129 1129
 	function decodeIdna($domain)
1130 1130
 	{
1131
-		if(strpos($domain, 'xn--') !== FALSE)
1131
+		if (strpos($domain, 'xn--') !== FALSE)
1132 1132
 		{
1133
-			require_once(_XE_PATH_ . 'libs/idna_convert/idna_convert.class.php');
1133
+			require_once(_XE_PATH_.'libs/idna_convert/idna_convert.class.php');
1134 1134
 			$IDN = new idna_convert(array('idn_version' => 2008));
1135 1135
 			$domain = $IDN->decode($domain);
1136 1136
 		}
@@ -1161,7 +1161,7 @@  discard block
 block discarded – undo
1161 1161
 	{
1162 1162
 		$self = self::getInstance();
1163 1163
 
1164
-		if($self->response_method)
1164
+		if ($self->response_method)
1165 1165
 		{
1166 1166
 			return $self->response_method;
1167 1167
 		}
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
 		$this->_recursiveCheckVar($_SERVER['HTTP_HOST']);
1202 1202
 
1203 1203
 		$pattern = "/[\,\"\'\{\}\[\]\(\);$]/";
1204
-		if(preg_match($pattern, $_SERVER['HTTP_HOST']))
1204
+		if (preg_match($pattern, $_SERVER['HTTP_HOST']))
1205 1205
 		{
1206 1206
 			$this->isSuccessInit = FALSE;
1207 1207
 		}
@@ -1214,30 +1214,30 @@  discard block
 block discarded – undo
1214 1214
 	 */
1215 1215
 	function _setRequestArgument()
1216 1216
 	{
1217
-		if(!count($_REQUEST))
1217
+		if (!count($_REQUEST))
1218 1218
 		{
1219 1219
 			return;
1220 1220
 		}
1221 1221
 
1222 1222
 		$requestMethod = $this->getRequestMethod();
1223
-		foreach($_REQUEST as $key => $val)
1223
+		foreach ($_REQUEST as $key => $val)
1224 1224
 		{
1225
-			if($val === '' || self::get($key))
1225
+			if ($val === '' || self::get($key))
1226 1226
 			{
1227 1227
 				continue;
1228 1228
 			}
1229 1229
 			$key = htmlentities($key);
1230 1230
 			$val = $this->_filterRequestVar($key, $val);
1231 1231
 
1232
-			if($requestMethod == 'GET' && isset($_GET[$key]))
1232
+			if ($requestMethod == 'GET' && isset($_GET[$key]))
1233 1233
 			{
1234 1234
 				$set_to_vars = TRUE;
1235 1235
 			}
1236
-			elseif($requestMethod == 'POST' && isset($_POST[$key]))
1236
+			elseif ($requestMethod == 'POST' && isset($_POST[$key]))
1237 1237
 			{
1238 1238
 				$set_to_vars = TRUE;
1239 1239
 			}
1240
-			elseif($requestMethod == 'JS_CALLBACK' && (isset($_GET[$key]) || isset($_POST[$key])))
1240
+			elseif ($requestMethod == 'JS_CALLBACK' && (isset($_GET[$key]) || isset($_POST[$key])))
1241 1241
 			{
1242 1242
 				$set_to_vars = TRUE;
1243 1243
 			}
@@ -1246,7 +1246,7 @@  discard block
 block discarded – undo
1246 1246
 				$set_to_vars = FALSE;
1247 1247
 			}
1248 1248
 
1249
-			if($set_to_vars)
1249
+			if ($set_to_vars)
1250 1250
 			{
1251 1251
 				$this->_recursiveCheckVar($val);
1252 1252
 			}
@@ -1257,20 +1257,20 @@  discard block
 block discarded – undo
1257 1257
 
1258 1258
 	function _recursiveCheckVar($val)
1259 1259
 	{
1260
-		if(is_string($val))
1260
+		if (is_string($val))
1261 1261
 		{
1262
-			foreach($this->patterns as $pattern)
1262
+			foreach ($this->patterns as $pattern)
1263 1263
 			{
1264
-				if(preg_match($pattern, $val))
1264
+				if (preg_match($pattern, $val))
1265 1265
 				{
1266 1266
 					$this->isSuccessInit = FALSE;
1267 1267
 					return;
1268 1268
 				}
1269 1269
 			}
1270 1270
 		}
1271
-		else if(is_array($val))
1271
+		else if (is_array($val))
1272 1272
 		{
1273
-			foreach($val as $val2)
1273
+			foreach ($val as $val2)
1274 1274
 			{
1275 1275
 				$this->_recursiveCheckVar($val2);
1276 1276
 			}
@@ -1284,7 +1284,7 @@  discard block
 block discarded – undo
1284 1284
 	 */
1285 1285
 	function _setJSONRequestArgument()
1286 1286
 	{
1287
-		if($this->getRequestMethod() != 'JSON')
1287
+		if ($this->getRequestMethod() != 'JSON')
1288 1288
 		{
1289 1289
 			return;
1290 1290
 		}
@@ -1292,7 +1292,7 @@  discard block
 block discarded – undo
1292 1292
 		$params = array();
1293 1293
 		parse_str($GLOBALS['HTTP_RAW_POST_DATA'], $params);
1294 1294
 
1295
-		foreach($params as $key => $val)
1295
+		foreach ($params as $key => $val)
1296 1296
 		{
1297 1297
 			$this->set($key, $this->_filterRequestVar($key, $val, 1), TRUE);
1298 1298
 		}
@@ -1305,13 +1305,13 @@  discard block
 block discarded – undo
1305 1305
 	 */
1306 1306
 	function _setXmlRpcArgument()
1307 1307
 	{
1308
-		if($this->getRequestMethod() != 'XMLRPC')
1308
+		if ($this->getRequestMethod() != 'XMLRPC')
1309 1309
 		{
1310 1310
 			return;
1311 1311
 		}
1312 1312
 
1313 1313
 		$xml = $GLOBALS['HTTP_RAW_POST_DATA'];
1314
-		if(Security::detectingXEE($xml))
1314
+		if (Security::detectingXEE($xml))
1315 1315
 		{
1316 1316
 			header("HTTP/1.0 400 Bad Request");
1317 1317
 			exit;
@@ -1323,12 +1323,12 @@  discard block
 block discarded – undo
1323 1323
 		$params = $xml_obj->methodcall->params;
1324 1324
 		unset($params->node_name, $params->attrs, $params->body);
1325 1325
 
1326
-		if(!count(get_object_vars($params)))
1326
+		if (!count(get_object_vars($params)))
1327 1327
 		{
1328 1328
 			return;
1329 1329
 		}
1330 1330
 
1331
-		foreach($params as $key => $val)
1331
+		foreach ($params as $key => $val)
1332 1332
 		{
1333 1333
 			$this->set($key, $this->_filterXmlVars($key, $val), TRUE);
1334 1334
 		}
@@ -1343,10 +1343,10 @@  discard block
 block discarded – undo
1343 1343
 	 */
1344 1344
 	function _filterXmlVars($key, $val)
1345 1345
 	{
1346
-		if(is_array($val))
1346
+		if (is_array($val))
1347 1347
 		{
1348 1348
 			$stack = array();
1349
-			foreach($val as $k => $v)
1349
+			foreach ($val as $k => $v)
1350 1350
 			{
1351 1351
 				$stack[$k] = $this->_filterXmlVars($k, $v);
1352 1352
 			}
@@ -1356,20 +1356,20 @@  discard block
 block discarded – undo
1356 1356
 
1357 1357
 		$body = $val->body;
1358 1358
 		unset($val->node_name, $val->attrs, $val->body);
1359
-		if(!count(get_object_vars($val)))
1359
+		if (!count(get_object_vars($val)))
1360 1360
 		{
1361 1361
 			return $this->_filterRequestVar($key, $body, 0);
1362 1362
 		}
1363 1363
 
1364 1364
 		$stack = new stdClass();
1365
-		foreach($val as $k => $v)
1365
+		foreach ($val as $k => $v)
1366 1366
 		{
1367 1367
 			$output = $this->_filterXmlVars($k, $v);
1368
-			if(is_object($v) && $v->attrs->type == 'array')
1368
+			if (is_object($v) && $v->attrs->type == 'array')
1369 1369
 			{
1370 1370
 				$output = array($output);
1371 1371
 			}
1372
-			if($k == 'value' && (is_array($v) || $v->attrs->type == 'array'))
1372
+			if ($k == 'value' && (is_array($v) || $v->attrs->type == 'array'))
1373 1373
 			{
1374 1374
 				return $output;
1375 1375
 			}
@@ -1377,7 +1377,7 @@  discard block
 block discarded – undo
1377 1377
 			$stack->{$k} = $output;
1378 1378
 		}
1379 1379
 
1380
-		if(!count(get_object_vars($stack)))
1380
+		if (!count(get_object_vars($stack)))
1381 1381
 		{
1382 1382
 			return NULL;
1383 1383
 		}
@@ -1396,32 +1396,32 @@  discard block
 block discarded – undo
1396 1396
 	 */
1397 1397
 	function _filterRequestVar($key, $val, $do_stripslashes = 1)
1398 1398
 	{
1399
-		if(!($isArray = is_array($val)))
1399
+		if (!($isArray = is_array($val)))
1400 1400
 		{
1401 1401
 			$val = array($val);
1402 1402
 		}
1403 1403
 
1404 1404
 		$result = array();
1405
-		foreach($val as $k => $v)
1405
+		foreach ($val as $k => $v)
1406 1406
 		{
1407 1407
 			$k = htmlentities($k);
1408
-			if($key === 'page' || $key === 'cpage' || substr_compare($key, 'srl', -3) === 0)
1408
+			if ($key === 'page' || $key === 'cpage' || substr_compare($key, 'srl', -3) === 0)
1409 1409
 			{
1410 1410
 				$result[$k] = !preg_match('/^[0-9,]+$/', $v) ? (int) $v : $v;
1411 1411
 			}
1412
-			elseif($key === 'mid' || $key === 'search_keyword')
1412
+			elseif ($key === 'mid' || $key === 'search_keyword')
1413 1413
 			{
1414 1414
 				$result[$k] = htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1415 1415
 			}
1416
-			elseif($key === 'vid')
1416
+			elseif ($key === 'vid')
1417 1417
 			{
1418 1418
 				$result[$k] = urlencode($v);
1419 1419
 			}
1420
-			elseif($key === 'xe_validator_id')
1420
+			elseif ($key === 'xe_validator_id')
1421 1421
 			{
1422 1422
 				$result[$k] = htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1423 1423
 			}
1424
-			elseif(stripos($key, 'XE_VALIDATOR', 0) === 0)
1424
+			elseif (stripos($key, 'XE_VALIDATOR', 0) === 0)
1425 1425
 			{
1426 1426
 				unset($result[$k]);
1427 1427
 			}
@@ -1429,7 +1429,7 @@  discard block
 block discarded – undo
1429 1429
 			{
1430 1430
 				$result[$k] = $v;
1431 1431
 
1432
-				if($do_stripslashes && version_compare(PHP_VERSION, '5.4.0', '<') && get_magic_quotes_gpc())
1432
+				if ($do_stripslashes && version_compare(PHP_VERSION, '5.4.0', '<') && get_magic_quotes_gpc())
1433 1433
 				{
1434 1434
 					if (is_array($result[$k]))
1435 1435
 					{
@@ -1441,7 +1441,7 @@  discard block
 block discarded – undo
1441 1441
 					}
1442 1442
 				}
1443 1443
 
1444
-				if(is_array($result[$k]))
1444
+				if (is_array($result[$k]))
1445 1445
 				{
1446 1446
 					array_walk_recursive($result[$k], function(&$val) { $val = trim($val); });
1447 1447
 				}
@@ -1473,17 +1473,17 @@  discard block
 block discarded – undo
1473 1473
 	 */
1474 1474
 	function _setUploadedArgument()
1475 1475
 	{
1476
-		if($_SERVER['REQUEST_METHOD'] != 'POST' || !$_FILES || (stripos($_SERVER['CONTENT_TYPE'], 'multipart/form-data') === FALSE && stripos($_SERVER['HTTP_CONTENT_TYPE'], 'multipart/form-data') === FALSE))
1476
+		if ($_SERVER['REQUEST_METHOD'] != 'POST' || !$_FILES || (stripos($_SERVER['CONTENT_TYPE'], 'multipart/form-data') === FALSE && stripos($_SERVER['HTTP_CONTENT_TYPE'], 'multipart/form-data') === FALSE))
1477 1477
 		{
1478 1478
 			return;
1479 1479
 		}
1480 1480
 
1481
-		foreach($_FILES as $key => $val)
1481
+		foreach ($_FILES as $key => $val)
1482 1482
 		{
1483 1483
 			$tmp_name = $val['tmp_name'];
1484
-			if(!is_array($tmp_name))
1484
+			if (!is_array($tmp_name))
1485 1485
 			{
1486
-				if(!$tmp_name || !is_uploaded_file($tmp_name))
1486
+				if (!$tmp_name || !is_uploaded_file($tmp_name))
1487 1487
 				{
1488 1488
 					continue;
1489 1489
 				}
@@ -1496,9 +1496,9 @@  discard block
 block discarded – undo
1496 1496
 				$files = array();
1497 1497
 				$count_files = count($tmp_name);
1498 1498
 
1499
-				for($i = 0; $i < $count_files; $i++)
1499
+				for ($i = 0; $i < $count_files; $i++)
1500 1500
 				{
1501
-					if($val['size'][$i] > 0)
1501
+					if ($val['size'][$i] > 0)
1502 1502
 					{
1503 1503
 						$file = array();
1504 1504
 						$file['name'] = $val['name'][$i];
@@ -1509,7 +1509,7 @@  discard block
 block discarded – undo
1509 1509
 						$files[] = $file;
1510 1510
 					}
1511 1511
 				}
1512
-				if($files) $this->set($key, $files, TRUE);
1512
+				if ($files) $this->set($key, $files, TRUE);
1513 1513
 			}
1514 1514
 		}
1515 1515
 	}
@@ -1531,16 +1531,16 @@  discard block
 block discarded – undo
1531 1531
 	function getRequestUrl()
1532 1532
 	{
1533 1533
 		static $url = null;
1534
-		if(is_null($url))
1534
+		if (is_null($url))
1535 1535
 		{
1536 1536
 			$url = self::getRequestUri();
1537
-			if(count($_GET) > 0)
1537
+			if (count($_GET) > 0)
1538 1538
 			{
1539
-				foreach($_GET as $key => $val)
1539
+				foreach ($_GET as $key => $val)
1540 1540
 				{
1541
-					$vars[] = $key . '=' . ($val ? urlencode(self::convertEncodingStr($val)) : '');
1541
+					$vars[] = $key.'='.($val ? urlencode(self::convertEncodingStr($val)) : '');
1542 1542
 				}
1543
-				$url .= '?' . join('&', $vars);
1543
+				$url .= '?'.join('&', $vars);
1544 1544
 			}
1545 1545
 		}
1546 1546
 		return $url;
@@ -1555,7 +1555,7 @@  discard block
 block discarded – undo
1555 1555
 		$self = self::getInstance();
1556 1556
 		$js_callback_func = isset($_GET['xe_js_callback']) ? $_GET['xe_js_callback'] : $_POST['xe_js_callback'];
1557 1557
 
1558
-		if(!preg_match('/^[a-z0-9\.]+$/i', $js_callback_func))
1558
+		if (!preg_match('/^[a-z0-9\.]+$/i', $js_callback_func))
1559 1559
 		{
1560 1560
 			unset($js_callback_func);
1561 1561
 			unset($_GET['xe_js_callback']);
@@ -1583,22 +1583,22 @@  discard block
 block discarded – undo
1583 1583
 		$self = self::getInstance();
1584 1584
 
1585 1585
 		// retrieve virtual site information
1586
-		if(is_null($site_module_info))
1586
+		if (is_null($site_module_info))
1587 1587
 		{
1588 1588
 			$site_module_info = self::get('site_module_info');
1589 1589
 		}
1590 1590
 
1591 1591
 		// If $domain is set, handle it (if $domain is vid type, remove $domain and handle with $vid)
1592
-		if($domain && isSiteID($domain))
1592
+		if ($domain && isSiteID($domain))
1593 1593
 		{
1594 1594
 			$vid = $domain;
1595 1595
 			$domain = '';
1596 1596
 		}
1597 1597
 
1598 1598
 		// If $domain, $vid are not set, use current site information
1599
-		if(!$domain && !$vid)
1599
+		if (!$domain && !$vid)
1600 1600
 		{
1601
-			if($site_module_info->domain && isSiteID($site_module_info->domain))
1601
+			if ($site_module_info->domain && isSiteID($site_module_info->domain))
1602 1602
 			{
1603 1603
 				$vid = $site_module_info->domain;
1604 1604
 			}
@@ -1609,21 +1609,21 @@  discard block
 block discarded – undo
1609 1609
 		}
1610 1610
 
1611 1611
 		// if $domain is set, compare current URL. If they are same, remove the domain, otherwise link to the domain.
1612
-		if($domain)
1612
+		if ($domain)
1613 1613
 		{
1614 1614
 			$domain_info = parse_url($domain);
1615
-			if(is_null($current_info))
1615
+			if (is_null($current_info))
1616 1616
 			{
1617
-				$current_info = parse_url(($_SERVER['HTTPS'] == 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . getScriptPath());
1617
+				$current_info = parse_url(($_SERVER['HTTPS'] == 'on' ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].getScriptPath());
1618 1618
 			}
1619
-			if($domain_info['host'] . $domain_info['path'] == $current_info['host'] . $current_info['path'])
1619
+			if ($domain_info['host'].$domain_info['path'] == $current_info['host'].$current_info['path'])
1620 1620
 			{
1621 1621
 				unset($domain);
1622 1622
 			}
1623 1623
 			else
1624 1624
 			{
1625 1625
 				$domain = preg_replace('/^(http|https):\/\//i', '', trim($domain));
1626
-				if(substr_compare($domain, '/', -1) !== 0)
1626
+				if (substr_compare($domain, '/', -1) !== 0)
1627 1627
 				{
1628 1628
 					$domain .= '/';
1629 1629
 				}
@@ -1633,41 +1633,41 @@  discard block
 block discarded – undo
1633 1633
 		$get_vars = array();
1634 1634
 
1635 1635
 		// If there is no GET variables or first argument is '' to reset variables
1636
-		if(!$self->get_vars || $args_list[0] == '')
1636
+		if (!$self->get_vars || $args_list[0] == '')
1637 1637
 		{
1638 1638
 			// rearrange args_list
1639
-			if(is_array($args_list) && $args_list[0] == '')
1639
+			if (is_array($args_list) && $args_list[0] == '')
1640 1640
 			{
1641 1641
 				array_shift($args_list);
1642 1642
 			}
1643 1643
 		}
1644
-		elseif($_SERVER['REQUEST_METHOD'] == 'GET')
1644
+		elseif ($_SERVER['REQUEST_METHOD'] == 'GET')
1645 1645
 		{
1646 1646
 			// Otherwise, make GET variables into array
1647 1647
 			$get_vars = get_object_vars($self->get_vars);
1648 1648
 		}
1649 1649
 		else
1650 1650
 		{
1651
-			if(!!$self->get_vars->module) $get_vars['module'] = $self->get_vars->module;
1652
-			if(!!$self->get_vars->mid) $get_vars['mid'] = $self->get_vars->mid;
1653
-			if(!!$self->get_vars->act) $get_vars['act'] = $self->get_vars->act;
1654
-			if(!!$self->get_vars->page) $get_vars['page'] = $self->get_vars->page;
1655
-			if(!!$self->get_vars->search_target) $get_vars['search_target'] = $self->get_vars->search_target;
1656
-			if(!!$self->get_vars->search_keyword) $get_vars['search_keyword'] = $self->get_vars->search_keyword;
1657
-			if($get_vars['act'] == 'IS')
1651
+			if (!!$self->get_vars->module) $get_vars['module'] = $self->get_vars->module;
1652
+			if (!!$self->get_vars->mid) $get_vars['mid'] = $self->get_vars->mid;
1653
+			if (!!$self->get_vars->act) $get_vars['act'] = $self->get_vars->act;
1654
+			if (!!$self->get_vars->page) $get_vars['page'] = $self->get_vars->page;
1655
+			if (!!$self->get_vars->search_target) $get_vars['search_target'] = $self->get_vars->search_target;
1656
+			if (!!$self->get_vars->search_keyword) $get_vars['search_keyword'] = $self->get_vars->search_keyword;
1657
+			if ($get_vars['act'] == 'IS')
1658 1658
 			{
1659
-				if(!!$self->get_vars->is_keyword) $get_vars['is_keyword'] = $self->get_vars->is_keyword;
1659
+				if (!!$self->get_vars->is_keyword) $get_vars['is_keyword'] = $self->get_vars->is_keyword;
1660 1660
 			}
1661 1661
 		}
1662 1662
 
1663 1663
 		// arrange args_list
1664
-		for($i = 0, $c = count($args_list); $i < $c; $i += 2)
1664
+		for ($i = 0, $c = count($args_list); $i < $c; $i += 2)
1665 1665
 		{
1666 1666
 			$key = $args_list[$i];
1667 1667
 			$val = trim($args_list[$i + 1]);
1668 1668
 
1669 1669
 			// If value is not set, remove the key
1670
-			if(!isset($val) || !strlen($val))
1670
+			if (!isset($val) || !strlen($val))
1671 1671
 			{
1672 1672
 				unset($get_vars[$key]);
1673 1673
 				continue;
@@ -1678,7 +1678,7 @@  discard block
 block discarded – undo
1678 1678
 
1679 1679
 		// remove vid, rnd
1680 1680
 		unset($get_vars['rnd']);
1681
-		if($vid)
1681
+		if ($vid)
1682 1682
 		{
1683 1683
 			$get_vars['vid'] = $vid;
1684 1684
 		}
@@ -1695,17 +1695,17 @@  discard block
 block discarded – undo
1695 1695
 			'dispDocumentAdminManageDocument' => 'dispDocumentManageDocument',
1696 1696
 			'dispModuleAdminSelectList' => 'dispModuleSelectList'
1697 1697
 		);
1698
-		if($act_alias[$act])
1698
+		if ($act_alias[$act])
1699 1699
 		{
1700 1700
 			$get_vars['act'] = $act_alias[$act];
1701 1701
 		}
1702 1702
 
1703 1703
 		// organize URL
1704 1704
 		$query = '';
1705
-		if(count($get_vars) > 0)
1705
+		if (count($get_vars) > 0)
1706 1706
 		{
1707 1707
 			// if using rewrite mod
1708
-			if($self->allow_rewrite)
1708
+			if ($self->allow_rewrite)
1709 1709
 			{
1710 1710
 				$var_keys = array_keys($get_vars);
1711 1711
 				sort($var_keys);
@@ -1725,8 +1725,8 @@  discard block
 block discarded – undo
1725 1725
 					'vid' => $vid,
1726 1726
 					'mid' => $mid,
1727 1727
 					'mid.vid' => "$vid/$mid",
1728
-					'entry.mid' => "$mid/entry/" . $get_vars['entry'],
1729
-					'entry.mid.vid' => "$vid/$mid/entry/" . $get_vars['entry'],
1728
+					'entry.mid' => "$mid/entry/".$get_vars['entry'],
1729
+					'entry.mid.vid' => "$vid/$mid/entry/".$get_vars['entry'],
1730 1730
 					'document_srl' => $srl,
1731 1731
 					'document_srl.mid' => "$mid/$srl",
1732 1732
 					'document_srl.vid' => "$vid/$srl",
@@ -1743,66 +1743,66 @@  discard block
 block discarded – undo
1743 1743
 				$query = $target_map[$target];
1744 1744
 			}
1745 1745
 
1746
-			if(!$query)
1746
+			if (!$query)
1747 1747
 			{
1748 1748
 				$queries = array();
1749
-				foreach($get_vars as $key => $val)
1749
+				foreach ($get_vars as $key => $val)
1750 1750
 				{
1751
-					if(is_array($val) && count($val) > 0)
1751
+					if (is_array($val) && count($val) > 0)
1752 1752
 					{
1753
-						foreach($val as $k => $v)
1753
+						foreach ($val as $k => $v)
1754 1754
 						{
1755
-							$queries[] = $key . '[' . $k . ']=' . urlencode($v);
1755
+							$queries[] = $key.'['.$k.']='.urlencode($v);
1756 1756
 						}
1757 1757
 					}
1758
-					elseif(!is_array($val))
1758
+					elseif (!is_array($val))
1759 1759
 					{
1760
-						$queries[] = $key . '=' . urlencode($val);
1760
+						$queries[] = $key.'='.urlencode($val);
1761 1761
 					}
1762 1762
 				}
1763
-				if(count($queries) > 0)
1763
+				if (count($queries) > 0)
1764 1764
 				{
1765
-					$query = 'index.php?' . join('&', $queries);
1765
+					$query = 'index.php?'.join('&', $queries);
1766 1766
 				}
1767 1767
 			}
1768 1768
 		}
1769 1769
 
1770 1770
 		// If using SSL always
1771 1771
 		$_use_ssl = $self->get('_use_ssl');
1772
-		if($_use_ssl == 'always')
1772
+		if ($_use_ssl == 'always')
1773 1773
 		{
1774
-			$query = $self->getRequestUri(ENFORCE_SSL, $domain) . $query;
1774
+			$query = $self->getRequestUri(ENFORCE_SSL, $domain).$query;
1775 1775
 			// optional SSL use
1776 1776
 		}
1777
-		elseif($_use_ssl == 'optional')
1777
+		elseif ($_use_ssl == 'optional')
1778 1778
 		{
1779 1779
 			$ssl_mode = (($self->get('module') === 'admin') || ($get_vars['module'] === 'admin') || (isset($get_vars['act']) && $self->isExistsSSLAction($get_vars['act']))) ? ENFORCE_SSL : RELEASE_SSL;
1780
-			$query = $self->getRequestUri($ssl_mode, $domain) . $query;
1780
+			$query = $self->getRequestUri($ssl_mode, $domain).$query;
1781 1781
 			// no SSL
1782 1782
 		}
1783 1783
 		else
1784 1784
 		{
1785 1785
 			// currently on SSL but target is not based on SSL
1786
-			if($_SERVER['HTTPS'] == 'on')
1786
+			if ($_SERVER['HTTPS'] == 'on')
1787 1787
 			{
1788
-				$query = $self->getRequestUri(ENFORCE_SSL, $domain) . $query;
1788
+				$query = $self->getRequestUri(ENFORCE_SSL, $domain).$query;
1789 1789
 			}
1790
-			else if($domain) // if $domain is set
1790
+			else if ($domain) // if $domain is set
1791 1791
 			{
1792
-				$query = $self->getRequestUri(FOLLOW_REQUEST_SSL, $domain) . $query;
1792
+				$query = $self->getRequestUri(FOLLOW_REQUEST_SSL, $domain).$query;
1793 1793
 			}
1794 1794
 			else
1795 1795
 			{
1796
-				$query = getScriptPath() . $query;
1796
+				$query = getScriptPath().$query;
1797 1797
 			}
1798 1798
 		}
1799 1799
 
1800
-		if(!$encode)
1800
+		if (!$encode)
1801 1801
 		{
1802 1802
 			return $query;
1803 1803
 		}
1804 1804
 
1805
-		if(!$autoEncode)
1805
+		if (!$autoEncode)
1806 1806
 		{
1807 1807
 			return htmlspecialchars($query, ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1808 1808
 		}
@@ -1811,16 +1811,16 @@  discard block
 block discarded – undo
1811 1811
 		$encode_queries = array();
1812 1812
 		$parsedUrl = parse_url($query);
1813 1813
 		parse_str($parsedUrl['query'], $output);
1814
-		foreach($output as $key => $value)
1814
+		foreach ($output as $key => $value)
1815 1815
 		{
1816
-			if(preg_match('/&([a-z]{2,}|#\d+);/', urldecode($value)))
1816
+			if (preg_match('/&([a-z]{2,}|#\d+);/', urldecode($value)))
1817 1817
 			{
1818 1818
 				$value = urlencode(htmlspecialchars_decode(urldecode($value)));
1819 1819
 			}
1820
-			$encode_queries[] = $key . '=' . $value;
1820
+			$encode_queries[] = $key.'='.$value;
1821 1821
 		}
1822 1822
 
1823
-		return htmlspecialchars($parsedUrl['path'] . '?' . join('&', $encode_queries), ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1823
+		return htmlspecialchars($parsedUrl['path'].'?'.join('&', $encode_queries), ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1824 1824
 	}
1825 1825
 
1826 1826
 	/**
@@ -1835,17 +1835,17 @@  discard block
 block discarded – undo
1835 1835
 		static $url = array();
1836 1836
 
1837 1837
 		// Check HTTP Request
1838
-		if(!isset($_SERVER['SERVER_PROTOCOL']))
1838
+		if (!isset($_SERVER['SERVER_PROTOCOL']))
1839 1839
 		{
1840 1840
 			return;
1841 1841
 		}
1842 1842
 
1843
-		if(self::get('_use_ssl') == 'always')
1843
+		if (self::get('_use_ssl') == 'always')
1844 1844
 		{
1845 1845
 			$ssl_mode = ENFORCE_SSL;
1846 1846
 		}
1847 1847
 
1848
-		if($domain)
1848
+		if ($domain)
1849 1849
 		{
1850 1850
 			$domain_key = md5($domain);
1851 1851
 		}
@@ -1854,14 +1854,14 @@  discard block
 block discarded – undo
1854 1854
 			$domain_key = 'default';
1855 1855
 		}
1856 1856
 
1857
-		if(isset($url[$ssl_mode][$domain_key]))
1857
+		if (isset($url[$ssl_mode][$domain_key]))
1858 1858
 		{
1859 1859
 			return $url[$ssl_mode][$domain_key];
1860 1860
 		}
1861 1861
 
1862 1862
 		$current_use_ssl = ($_SERVER['HTTPS'] == 'on');
1863 1863
 
1864
-		switch($ssl_mode)
1864
+		switch ($ssl_mode)
1865 1865
 		{
1866 1866
 			case FOLLOW_REQUEST_SSL: $use_ssl = $current_use_ssl;
1867 1867
 				break;
@@ -1871,34 +1871,34 @@  discard block
 block discarded – undo
1871 1871
 				break;
1872 1872
 		}
1873 1873
 
1874
-		if($domain)
1874
+		if ($domain)
1875 1875
 		{
1876 1876
 			$target_url = trim($domain);
1877
-			if(substr_compare($target_url, '/', -1) !== 0)
1877
+			if (substr_compare($target_url, '/', -1) !== 0)
1878 1878
 			{
1879
-				$target_url.= '/';
1879
+				$target_url .= '/';
1880 1880
 			}
1881 1881
 		}
1882 1882
 		else
1883 1883
 		{
1884
-			$target_url = $_SERVER['HTTP_HOST'] . getScriptPath();
1884
+			$target_url = $_SERVER['HTTP_HOST'].getScriptPath();
1885 1885
 		}
1886 1886
 
1887
-		$url_info = parse_url('http://' . $target_url);
1887
+		$url_info = parse_url('http://'.$target_url);
1888 1888
 
1889
-		if($current_use_ssl != $use_ssl)
1889
+		if ($current_use_ssl != $use_ssl)
1890 1890
 		{
1891 1891
 			unset($url_info['port']);
1892 1892
 		}
1893 1893
 
1894
-		if($use_ssl)
1894
+		if ($use_ssl)
1895 1895
 		{
1896 1896
 			$port = self::get('_https_port');
1897
-			if($port && $port != 443)
1897
+			if ($port && $port != 443)
1898 1898
 			{
1899 1899
 				$url_info['port'] = $port;
1900 1900
 			}
1901
-			elseif($url_info['port'] == 443)
1901
+			elseif ($url_info['port'] == 443)
1902 1902
 			{
1903 1903
 				unset($url_info['port']);
1904 1904
 			}
@@ -1906,17 +1906,17 @@  discard block
 block discarded – undo
1906 1906
 		else
1907 1907
 		{
1908 1908
 			$port = self::get('_http_port');
1909
-			if($port && $port != 80)
1909
+			if ($port && $port != 80)
1910 1910
 			{
1911 1911
 				$url_info['port'] = $port;
1912 1912
 			}
1913
-			elseif($url_info['port'] == 80)
1913
+			elseif ($url_info['port'] == 80)
1914 1914
 			{
1915 1915
 				unset($url_info['port']);
1916 1916
 			}
1917 1917
 		}
1918 1918
 
1919
-		$url[$ssl_mode][$domain_key] = sprintf('%s://%s%s%s', $use_ssl ? 'https' : $url_info['scheme'], $url_info['host'], $url_info['port'] && $url_info['port'] != 80 ? ':' . $url_info['port'] : '', $url_info['path']);
1919
+		$url[$ssl_mode][$domain_key] = sprintf('%s://%s%s%s', $use_ssl ? 'https' : $url_info['scheme'], $url_info['host'], $url_info['port'] && $url_info['port'] != 80 ? ':'.$url_info['port'] : '', $url_info['path']);
1920 1920
 
1921 1921
 		return $url[$ssl_mode][$domain_key];
1922 1922
 	}
@@ -1933,16 +1933,16 @@  discard block
 block discarded – undo
1933 1933
 	{
1934 1934
 		$self = self::getInstance();
1935 1935
 		$self->context->{$key} = $val;
1936
-		if($set_to_get_vars === FALSE)
1936
+		if ($set_to_get_vars === FALSE)
1937 1937
 		{
1938 1938
 			return;
1939 1939
 		}
1940
-		if($val === NULL || $val === '')
1940
+		if ($val === NULL || $val === '')
1941 1941
 		{
1942 1942
 			unset($self->get_vars->{$key});
1943 1943
 			return;
1944 1944
 		}
1945
-		if($set_to_get_vars || $self->get_vars->{$key})
1945
+		if ($set_to_get_vars || $self->get_vars->{$key})
1946 1946
 		{
1947 1947
 			$self->get_vars->{$key} = $val;
1948 1948
 		}
@@ -1958,7 +1958,7 @@  discard block
 block discarded – undo
1958 1958
 	{
1959 1959
 		$self = self::getInstance();
1960 1960
 
1961
-		if(!isset($self->context->{$key}))
1961
+		if (!isset($self->context->{$key}))
1962 1962
 		{
1963 1963
 			return null;
1964 1964
 		}
@@ -1973,7 +1973,7 @@  discard block
 block discarded – undo
1973 1973
 	function gets()
1974 1974
 	{
1975 1975
 		$num_args = func_num_args();
1976
-		if($num_args < 1)
1976
+		if ($num_args < 1)
1977 1977
 		{
1978 1978
 			return;
1979 1979
 		}
@@ -1981,7 +1981,7 @@  discard block
 block discarded – undo
1981 1981
 
1982 1982
 		$args_list = func_get_args();
1983 1983
 		$output = new stdClass();
1984
-		foreach($args_list as $v)
1984
+		foreach ($args_list as $v)
1985 1985
 		{
1986 1986
 			$output->{$v} = $self->get($v);
1987 1987
 		}
@@ -2007,7 +2007,7 @@  discard block
 block discarded – undo
2007 2007
 	function getRequestVars()
2008 2008
 	{
2009 2009
 		$self = self::getInstance();
2010
-		if($self->get_vars)
2010
+		if ($self->get_vars)
2011 2011
 		{
2012 2012
 			return clone($self->get_vars);
2013 2013
 		}
@@ -2024,13 +2024,13 @@  discard block
 block discarded – undo
2024 2024
 	{
2025 2025
 		$self = self::getInstance();
2026 2026
 
2027
-		if(!is_readable($self->sslActionCacheFile))
2027
+		if (!is_readable($self->sslActionCacheFile))
2028 2028
 		{
2029 2029
 			$buff = '<?php if(!defined("__XE__"))exit;';
2030 2030
 			FileHandler::writeFile($self->sslActionCacheFile, $buff);
2031 2031
 		}
2032 2032
 
2033
-		if(!isset($self->ssl_actions[$action]))
2033
+		if (!isset($self->ssl_actions[$action]))
2034 2034
 		{
2035 2035
 			$self->ssl_actions[$action] = 1;
2036 2036
 			$sslActionCacheString = sprintf('$sslActions[\'%s\'] = 1;', $action);
@@ -2048,16 +2048,16 @@  discard block
 block discarded – undo
2048 2048
 	{
2049 2049
 		$self = self::getInstance();
2050 2050
 
2051
-		if(!is_readable($self->sslActionCacheFile))
2051
+		if (!is_readable($self->sslActionCacheFile))
2052 2052
 		{
2053 2053
 			unset($self->ssl_actions);
2054 2054
 			$buff = '<?php if(!defined("__XE__"))exit;';
2055 2055
 			FileHandler::writeFile($self->sslActionCacheFile, $buff);
2056 2056
 		}
2057 2057
 
2058
-		foreach($action_array as $action)
2058
+		foreach ($action_array as $action)
2059 2059
 		{
2060
-			if(!isset($self->ssl_actions[$action]))
2060
+			if (!isset($self->ssl_actions[$action]))
2061 2061
 			{
2062 2062
 				$self->ssl_actions[$action] = 1;
2063 2063
 				$sslActionCacheString = sprintf('$sslActions[\'%s\'] = 1;', $action);
@@ -2076,7 +2076,7 @@  discard block
 block discarded – undo
2076 2076
 	{
2077 2077
 		$self = self::getInstance();
2078 2078
 
2079
-		if($self->isExistsSSLAction($action))
2079
+		if ($self->isExistsSSLAction($action))
2080 2080
 		{
2081 2081
 			$sslActionCacheString = sprintf('$sslActions[\'%s\'] = 1;', $action);
2082 2082
 			$buff = FileHandler::readFile($self->sslActionCacheFile);
@@ -2093,7 +2093,7 @@  discard block
 block discarded – undo
2093 2093
 	function getSSLActions()
2094 2094
 	{
2095 2095
 		$self = self::getInstance();
2096
-		if($self->getSslStatus() == 'optional')
2096
+		if ($self->getSslStatus() == 'optional')
2097 2097
 		{
2098 2098
 			return $self->ssl_actions;
2099 2099
 		}
@@ -2120,12 +2120,12 @@  discard block
 block discarded – undo
2120 2120
 	 */
2121 2121
 	function normalizeFilePath($file)
2122 2122
 	{
2123
-		if($file{0} != '/' && $file{0} != '.' && strpos($file, '://') === FALSE)
2123
+		if ($file{0} != '/' && $file{0} != '.' && strpos($file, '://') === FALSE)
2124 2124
 		{
2125
-			$file = './' . $file;
2125
+			$file = './'.$file;
2126 2126
 		}
2127 2127
 		$file = preg_replace('@/\./|(?<!:)\/\/@', '/', $file);
2128
-		while(strpos($file, '/../') !== FALSE)
2128
+		while (strpos($file, '/../') !== FALSE)
2129 2129
 		{
2130 2130
 			$file = preg_replace('/\/([^\/]+)\/\.\.\//s', '/', $file, 1);
2131 2131
 		}
@@ -2144,13 +2144,13 @@  discard block
 block discarded – undo
2144 2144
 	{
2145 2145
 		$file = self::normalizeFilePath($file);
2146 2146
 		$script_path = getScriptPath();
2147
-		if(strpos($file, './') === 0)
2147
+		if (strpos($file, './') === 0)
2148 2148
 		{
2149
-			$file = $script_path . substr($file, 2);
2149
+			$file = $script_path.substr($file, 2);
2150 2150
 		}
2151
-		elseif(strpos($file, '../') === 0)
2151
+		elseif (strpos($file, '../') === 0)
2152 2152
 		{
2153
-			$file = self::normalizeFilePath($script_path . $file);
2153
+			$file = self::normalizeFilePath($script_path.$file);
2154 2154
 		}
2155 2155
 
2156 2156
 		return $file;
@@ -2220,12 +2220,12 @@  discard block
 block discarded – undo
2220 2220
 	 */
2221 2221
 	function addJsFile($file, $optimized = FALSE, $targetie = '', $index = 0, $type = 'head', $isRuleset = FALSE, $autoPath = null)
2222 2222
 	{
2223
-		if($isRuleset)
2223
+		if ($isRuleset)
2224 2224
 		{
2225
-			if(strpos($file, '#') !== FALSE)
2225
+			if (strpos($file, '#') !== FALSE)
2226 2226
 			{
2227 2227
 				$file = str_replace('#', '', $file);
2228
-				if(!is_readable($file))
2228
+				if (!is_readable($file))
2229 2229
 				{
2230 2230
 					$file = $autoPath;
2231 2231
 				}
@@ -2290,9 +2290,9 @@  discard block
 block discarded – undo
2290 2290
 		ksort($files);
2291 2291
 		$files = array_values($files);
2292 2292
 		$filenames = array();
2293
-		for($i = 0, $c = count($files); $i < $c; ++$i)
2293
+		for ($i = 0, $c = count($files); $i < $c; ++$i)
2294 2294
 		{
2295
-			if(in_array($files[$i]['file'], $filenames))
2295
+			if (in_array($files[$i]['file'], $filenames))
2296 2296
 			{
2297 2297
 				unset($files[$i]);
2298 2298
 			}
@@ -2377,14 +2377,14 @@  discard block
 block discarded – undo
2377 2377
 	 */
2378 2378
 	function getJavascriptPluginInfo($pluginName)
2379 2379
 	{
2380
-		if($plugin_name == 'ui.datepicker')
2380
+		if ($plugin_name == 'ui.datepicker')
2381 2381
 		{
2382 2382
 			$plugin_name = 'ui';
2383 2383
 		}
2384 2384
 
2385
-		$plugin_path = './common/js/plugins/' . $pluginName . '/';
2386
-		$info_file = $plugin_path . 'plugin.load';
2387
-		if(!is_readable($info_file))
2385
+		$plugin_path = './common/js/plugins/'.$pluginName.'/';
2386
+		$info_file = $plugin_path.'plugin.load';
2387
+		if (!is_readable($info_file))
2388 2388
 		{
2389 2389
 			return;
2390 2390
 		}
@@ -2394,32 +2394,32 @@  discard block
 block discarded – undo
2394 2394
 		$result->jsList = array();
2395 2395
 		$result->cssList = array();
2396 2396
 
2397
-		foreach($list as $filename)
2397
+		foreach ($list as $filename)
2398 2398
 		{
2399 2399
 			$filename = trim($filename);
2400
-			if(!$filename)
2400
+			if (!$filename)
2401 2401
 			{
2402 2402
 				continue;
2403 2403
 			}
2404 2404
 
2405
-			if(strncasecmp('./', $filename, 2) === 0)
2405
+			if (strncasecmp('./', $filename, 2) === 0)
2406 2406
 			{
2407 2407
 				$filename = substr($filename, 2);
2408 2408
 			}
2409 2409
 
2410
-			if(substr_compare($filename, '.js', -3) === 0)
2410
+			if (substr_compare($filename, '.js', -3) === 0)
2411 2411
 			{
2412
-				$result->jsList[] = $plugin_path . $filename;
2412
+				$result->jsList[] = $plugin_path.$filename;
2413 2413
 			}
2414
-			elseif(substr_compare($filename, '.css', -4) === 0)
2414
+			elseif (substr_compare($filename, '.css', -4) === 0)
2415 2415
 			{
2416
-				$result->cssList[] = $plugin_path . $filename;
2416
+				$result->cssList[] = $plugin_path.$filename;
2417 2417
 			}
2418 2418
 		}
2419 2419
 
2420
-		if(is_dir($plugin_path . 'lang'))
2420
+		if (is_dir($plugin_path.'lang'))
2421 2421
 		{
2422
-			$result->langPath = $plugin_path . 'lang';
2422
+			$result->langPath = $plugin_path.'lang';
2423 2423
 		}
2424 2424
 
2425 2425
 		return $result;
@@ -2435,50 +2435,50 @@  discard block
 block discarded – undo
2435 2435
 		static $loaded_plugins = array();
2436 2436
 
2437 2437
 		$self = self::getInstance();
2438
-		if($plugin_name == 'ui.datepicker')
2438
+		if ($plugin_name == 'ui.datepicker')
2439 2439
 		{
2440 2440
 			$plugin_name = 'ui';
2441 2441
 		}
2442 2442
 
2443
-		if($loaded_plugins[$plugin_name])
2443
+		if ($loaded_plugins[$plugin_name])
2444 2444
 		{
2445 2445
 			return;
2446 2446
 		}
2447 2447
 		$loaded_plugins[$plugin_name] = TRUE;
2448 2448
 
2449
-		$plugin_path = './common/js/plugins/' . $plugin_name . '/';
2450
-		$info_file = $plugin_path . 'plugin.load';
2451
-		if(!is_readable($info_file))
2449
+		$plugin_path = './common/js/plugins/'.$plugin_name.'/';
2450
+		$info_file = $plugin_path.'plugin.load';
2451
+		if (!is_readable($info_file))
2452 2452
 		{
2453 2453
 			return;
2454 2454
 		}
2455 2455
 
2456 2456
 		$list = file($info_file);
2457
-		foreach($list as $filename)
2457
+		foreach ($list as $filename)
2458 2458
 		{
2459 2459
 			$filename = trim($filename);
2460
-			if(!$filename)
2460
+			if (!$filename)
2461 2461
 			{
2462 2462
 				continue;
2463 2463
 			}
2464 2464
 
2465
-			if(strncasecmp('./', $filename, 2) === 0)
2465
+			if (strncasecmp('./', $filename, 2) === 0)
2466 2466
 			{
2467 2467
 				$filename = substr($filename, 2);
2468 2468
 			}
2469
-			if(substr_compare($filename, '.js', -3) === 0)
2469
+			if (substr_compare($filename, '.js', -3) === 0)
2470 2470
 			{
2471
-				$self->loadFile(array($plugin_path . $filename, 'body', '', 0), TRUE);
2471
+				$self->loadFile(array($plugin_path.$filename, 'body', '', 0), TRUE);
2472 2472
 			}
2473
-			if(substr_compare($filename, '.css', -4) === 0)
2473
+			if (substr_compare($filename, '.css', -4) === 0)
2474 2474
 			{
2475
-				$self->loadFile(array($plugin_path . $filename, 'all', '', 0), TRUE);
2475
+				$self->loadFile(array($plugin_path.$filename, 'all', '', 0), TRUE);
2476 2476
 			}
2477 2477
 		}
2478 2478
 
2479
-		if(is_dir($plugin_path . 'lang'))
2479
+		if (is_dir($plugin_path.'lang'))
2480 2480
 		{
2481
-			$self->loadLang($plugin_path . 'lang');
2481
+			$self->loadLang($plugin_path.'lang');
2482 2482
 		}
2483 2483
 	}
2484 2484
 
@@ -2491,7 +2491,7 @@  discard block
 block discarded – undo
2491 2491
 	function addHtmlHeader($header)
2492 2492
 	{
2493 2493
 		$self = self::getInstance();
2494
-		$self->html_header .= "\n" . $header;
2494
+		$self->html_header .= "\n".$header;
2495 2495
 	}
2496 2496
 
2497 2497
 	function clearHtmlHeader()
@@ -2543,7 +2543,7 @@  discard block
 block discarded – undo
2543 2543
 	function addBodyHeader($header)
2544 2544
 	{
2545 2545
 		$self = self::getInstance();
2546
-		$self->body_header .= "\n" . $header;
2546
+		$self->body_header .= "\n".$header;
2547 2547
 	}
2548 2548
 
2549 2549
 	/**
@@ -2565,7 +2565,7 @@  discard block
 block discarded – undo
2565 2565
 	function addHtmlFooter($footer)
2566 2566
 	{
2567 2567
 		$self = self::getInstance();
2568
-		$self->html_footer .= ($self->Htmlfooter ? "\n" : '') . $footer;
2568
+		$self->html_footer .= ($self->Htmlfooter ? "\n" : '').$footer;
2569 2569
 	}
2570 2570
 
2571 2571
 	/**
@@ -2586,7 +2586,7 @@  discard block
 block discarded – undo
2586 2586
 	 */
2587 2587
 	function getConfigFile()
2588 2588
 	{
2589
-		return _XE_PATH_ . 'files/config/db.config.php';
2589
+		return _XE_PATH_.'files/config/db.config.php';
2590 2590
 	}
2591 2591
 
2592 2592
 	/**
@@ -2596,7 +2596,7 @@  discard block
 block discarded – undo
2596 2596
 	 */
2597 2597
 	function getFTPConfigFile()
2598 2598
 	{
2599
-		return _XE_PATH_ . 'files/config/ftp.config.php';
2599
+		return _XE_PATH_.'files/config/ftp.config.php';
2600 2600
 	}
2601 2601
 
2602 2602
 	/**
@@ -2648,14 +2648,14 @@  discard block
 block discarded – undo
2648 2648
 		$_path = explode('/', $path);
2649 2649
 		$_base = explode('/', $base_url);
2650 2650
 
2651
-		if(!$_base[count($_base) - 1])
2651
+		if (!$_base[count($_base) - 1])
2652 2652
 		{
2653 2653
 			array_pop($_base);
2654 2654
 		}
2655 2655
 
2656
-		foreach($_xe as $idx => $dir)
2656
+		foreach ($_xe as $idx => $dir)
2657 2657
 		{
2658
-			if($_path[0] != $dir)
2658
+			if ($_path[0] != $dir)
2659 2659
 			{
2660 2660
 				break;
2661 2661
 			}
@@ -2663,9 +2663,9 @@  discard block
 block discarded – undo
2663 2663
 		}
2664 2664
 
2665 2665
 		$idx = count($_xe) - $idx - 1;
2666
-		while($idx--)
2666
+		while ($idx--)
2667 2667
 		{
2668
-			if(count($_base) > 0)
2668
+			if (count($_base) > 0)
2669 2669
 			{
2670 2670
 				array_shift($_base);
2671 2671
 			}
@@ -2675,13 +2675,13 @@  discard block
 block discarded – undo
2675 2675
 			}
2676 2676
 		}
2677 2677
 
2678
-		if(count($_base) > 0)
2678
+		if (count($_base) > 0)
2679 2679
 		{
2680 2680
 			array_unshift($_path, join('/', $_base));
2681 2681
 		}
2682 2682
 
2683
-		$path = '/' . join('/', $_path);
2684
-		if(substr_compare($path, '/', -1) !== 0)
2683
+		$path = '/'.join('/', $_path);
2684
+		if (substr_compare($path, '/', -1) !== 0)
2685 2685
 		{
2686 2686
 			$path .= '/';
2687 2687
 		}
@@ -2696,13 +2696,13 @@  discard block
 block discarded – undo
2696 2696
 	{
2697 2697
 		$self = self::getInstance();
2698 2698
 
2699
-		if(!is_array($self->meta_tags))
2699
+		if (!is_array($self->meta_tags))
2700 2700
 		{
2701 2701
 			$self->meta_tags = array();
2702 2702
 		}
2703 2703
 
2704 2704
 		$ret = array();
2705
-		foreach($self->meta_tags as $key => $val)
2705
+		foreach ($self->meta_tags as $key => $val)
2706 2706
 		{
2707 2707
 			list($name, $is_http_equiv) = explode("\t", $key);
2708 2708
 			$ret[] = array('name' => $name, 'is_http_equiv' => $is_http_equiv, 'content' => $val);
@@ -2722,7 +2722,7 @@  discard block
 block discarded – undo
2722 2722
 	function addMetaTag($name, $content, $is_http_equiv = FALSE)
2723 2723
 	{
2724 2724
 		$self = self::getInstance();
2725
-		$self->meta_tags[$name . "\t" . ($is_http_equiv ? '1' : '0')] = $content;
2725
+		$self->meta_tags[$name."\t".($is_http_equiv ? '1' : '0')] = $content;
2726 2726
 	}
2727 2727
 
2728 2728
 }
Please login to merge, or discard this patch.
Braces   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -230,7 +230,9 @@  discard block
 block discarded – undo
230 230
 		$this->loadDBInfo();
231 231
 		if($this->db_info->use_sitelock == 'Y')
232 232
 		{
233
-			if(is_array($this->db_info->sitelock_whitelist)) $whitelist = $this->db_info->sitelock_whitelist;
233
+			if(is_array($this->db_info->sitelock_whitelist)) {
234
+				$whitelist = $this->db_info->sitelock_whitelist;
235
+			}
234 236
 
235 237
 			if(!IpFilter::filter($whitelist))
236 238
 			{
@@ -245,8 +247,7 @@  discard block
 block discarded – undo
245 247
 				if(FileHandler::exists(_XE_PATH_ . 'common/tpl/sitelock.user.html'))
246 248
 				{
247 249
 					include _XE_PATH_ . 'common/tpl/sitelock.user.html';
248
-				}
249
-				else
250
+				} else
250 251
 				{
251 252
 					include _XE_PATH_ . 'common/tpl/sitelock.html';
252 253
 				}
@@ -303,8 +304,7 @@  discard block
 block discarded – undo
303 304
 			{
304 305
 				saveCookie('lang_type', $this->lang_type, false, $_SERVER['REQUEST_TIME'] + 3600 * 24 * 1000);
305 306
 			}
306
-		}
307
-		elseif($_COOKIE['lang_type'])
307
+		} elseif($_COOKIE['lang_type'])
308 308
 		{
309 309
 			$this->lang_type = $_COOKIE['lang_type'];
310 310
 		}
@@ -341,7 +341,9 @@  discard block
 block discarded – undo
341 341
 			);
342 342
 		}
343 343
 
344
-		if($sess = $_POST[session_name()]) session_id($sess);
344
+		if($sess = $_POST[session_name()]) {
345
+			session_id($sess);
346
+		}
345 347
 		ini_set('session.cookie_httponly', true);
346 348
 		ini_set('session.cookie_secure', Context::getSslStatus() === 'always');
347 349
 		session_start();
@@ -401,22 +403,21 @@  discard block
 block discarded – undo
401 403
 						{
402 404
 							$url[] = $key . '[' . $k . ']=' . urlencode($v);
403 405
 						}
404
-					}
405
-					elseif($val)
406
+					} elseif($val)
406 407
 					{
407 408
 						$url[] = $key . '=' . urlencode($val);
408 409
 					}
409 410
 				}
410 411
 
411 412
 				$current_url = self::getRequestUri();
412
-				if($url) $current_url .= '?' . join('&', $url);
413
-			}
414
-			else
413
+				if($url) {
414
+					$current_url .= '?' . join('&', $url);
415
+				}
416
+			} else
415 417
 			{
416 418
 				$current_url = $this->getUrl();
417 419
 			}
418
-		}
419
-		else
420
+		} else
420 421
 		{
421 422
 			$current_url = self::getRequestUri();
422 423
 		}
@@ -499,18 +500,22 @@  discard block
 block discarded – undo
499 500
 			$db_info->use_prepared_statements = 'Y';
500 501
 		}
501 502
 
502
-		if(!$db_info->time_zone)
503
-			$db_info->time_zone = date('O');
503
+		if(!$db_info->time_zone) {
504
+					$db_info->time_zone = date('O');
505
+		}
504 506
 		$GLOBALS['_time_zone'] = $db_info->time_zone;
505 507
 
506
-		if($db_info->qmail_compatibility != 'Y')
507
-			$db_info->qmail_compatibility = 'N';
508
+		if($db_info->qmail_compatibility != 'Y') {
509
+					$db_info->qmail_compatibility = 'N';
510
+		}
508 511
 		$GLOBALS['_qmail_compatibility'] = $db_info->qmail_compatibility;
509 512
 
510
-		if(!$db_info->use_db_session)
511
-			$db_info->use_db_session = 'N';
512
-		if(!$db_info->use_ssl)
513
-			$db_info->use_ssl = 'none';
513
+		if(!$db_info->use_db_session) {
514
+					$db_info->use_db_session = 'N';
515
+		}
516
+		if(!$db_info->use_ssl) {
517
+					$db_info->use_ssl = 'none';
518
+		}
514 519
 		$this->set('_use_ssl', $db_info->use_ssl);
515 520
 
516 521
 		$self->set('_http_port', ($db_info->http_port) ? $db_info->http_port : NULL);
@@ -627,8 +632,7 @@  discard block
 block discarded – undo
627 632
 				$buff = FileHandler::readFile($orig_lang_file);
628 633
 				FileHandler::writeFile($selected_lang_file, $buff);
629 634
 				$lang_selected = self::loadLangSupported();
630
-			}
631
-			else
635
+			} else
632 636
 			{
633 637
 				$langs = file($selected_lang_file);
634 638
 				foreach($langs as $val)
@@ -687,15 +691,16 @@  discard block
 block discarded – undo
687 691
 
688 692
 				$oModuleModel = getModel('module');
689 693
 				$domain = $url_info['host'] . $url_info['path'];
690
-				if(substr_compare($domain, '/', -1) === 0) $domain = substr($domain, 0, -1);
694
+				if(substr_compare($domain, '/', -1) === 0) {
695
+					$domain = substr($domain, 0, -1);
696
+				}
691 697
 				$site_info = $oModuleModel->getSiteInfoByDomain($domain);
692 698
 
693 699
 				if($site_info->site_srl)
694 700
 				{
695 701
 				$url_info['query'].= ($url_info['query'] ? '&' : '') . 'SSOID=' . urlencode(session_id()) . '&sig=' . urlencode(Password::createSignature(session_id()));
696 702
 				$redirect_url = sprintf('%s://%s%s%s?%s', $url_info['scheme'], $url_info['host'], $url_info['port'] ? ':' . $url_info['port'] : '', $url_info['path'], $url_info['query']);
697
-				}
698
-				else
703
+				} else
699 704
 				{
700 705
 					$redirect_url = $url;
701 706
 				}
@@ -704,8 +709,7 @@  discard block
 block discarded – undo
704 709
 				return FALSE;
705 710
 			}
706 711
 			// for sites requesting SSO validation
707
-		}
708
-		else
712
+		} else
709 713
 		{
710 714
 			// result handling : set session_name()
711 715
 			if($session_name = self::get('SSOID'))
@@ -722,8 +726,7 @@  discard block
 block discarded – undo
722 726
 				header('location:' . $url);
723 727
 				return FALSE;
724 728
 				// send SSO request
725
-			}
726
-			else if(!self::get('SSOID') && $_COOKIE['sso'] != md5(self::getRequestUri()))
729
+			} else if(!self::get('SSOID') && $_COOKIE['sso'] != md5(self::getRequestUri()))
727 730
 			{
728 731
 				saveCookie('sso', md5(self::getRequestUri()), true);
729 732
 				$origin_url = self::getRequestUrl();
@@ -783,8 +786,7 @@  discard block
 block discarded – undo
783 786
 		if($self->site_title)
784 787
 		{
785 788
 			$self->site_title .= ' - ' . $site_title;
786
-		}
787
-		else
789
+		} else
788 790
 		{
789 791
 			$self->site_title = $site_title;
790 792
 		}
@@ -884,8 +886,7 @@  discard block
 block discarded – undo
884 886
 		{
885 887
 			$self->loaded_lang_files[] = $filename;
886 888
 			include($filename);
887
-		}
888
-		else
889
+		} else
889 890
 		{
890 891
 			$self->_evalxmlLang($path);
891 892
 		}
@@ -901,7 +902,9 @@  discard block
 block discarded – undo
901 902
 	{
902 903
 		global $lang;
903 904
 
904
-		if(!$path) return;
905
+		if(!$path) {
906
+			return;
907
+		}
905 908
 
906 909
 		$_path = 'eval://' . $path;
907 910
 
@@ -933,7 +936,9 @@  discard block
 block discarded – undo
933 936
 	 */
934 937
 	function _loadXmlLang($path)
935 938
 	{
936
-		if(!$path) return;
939
+		if(!$path) {
940
+			return;
941
+		}
937 942
 
938 943
 		$oXmlLangParser = new XmlLangParser($path . ((substr_compare($path, '/', -1) !== 0) ? '/' : '') . 'lang.xml', $this->lang_type);
939 944
 		return $oXmlLangParser->compile();
@@ -947,7 +952,9 @@  discard block
 block discarded – undo
947 952
 	 */
948 953
 	function _loadPhpLang($path)
949 954
 	{
950
-		if(!$path) return;
955
+		if(!$path) {
956
+			return;
957
+		}
951 958
 
952 959
 		if(substr_compare($path, '/', -1) !== 0)
953 960
 		{
@@ -1080,12 +1087,14 @@  discard block
 block discarded – undo
1080 1087
 		static $flag = TRUE;
1081 1088
 		if($charset)
1082 1089
 		{
1083
-			if(is_array($val))
1084
-				array_walk($val,'Context::checkConvertFlag',$charset);
1085
-			else if($val && iconv($charset,$charset,$val)!=$val) $flag = FALSE;
1086
-			else $flag = FALSE;
1087
-		}
1088
-		else
1090
+			if(is_array($val)) {
1091
+							array_walk($val,'Context::checkConvertFlag',$charset);
1092
+			} else if($val && iconv($charset,$charset,$val)!=$val) {
1093
+				$flag = FALSE;
1094
+			} else {
1095
+				$flag = FALSE;
1096
+			}
1097
+		} else
1089 1098
 		{
1090 1099
 			$return = $flag;
1091 1100
 			$flag = TRUE;
@@ -1107,8 +1116,9 @@  discard block
 block discarded – undo
1107 1116
 		if (is_array($val))
1108 1117
 		{
1109 1118
 			array_walk($val,'Context::doConvertEncoding',$charset);
1119
+		} else {
1120
+			$val = iconv($charset,'UTF-8',$val);
1110 1121
 		}
1111
-		else $val = iconv($charset,'UTF-8',$val);
1112 1122
 	}
1113 1123
 
1114 1124
 	/**
@@ -1119,7 +1129,9 @@  discard block
 block discarded – undo
1119 1129
 	 */
1120 1130
 	function convertEncodingStr($str)
1121 1131
 	{
1122
-        if(!$str) return null;
1132
+        if(!$str) {
1133
+        	return null;
1134
+        }
1123 1135
 		$obj = new stdClass();
1124 1136
 		$obj->str = $str;
1125 1137
 		$obj = self::convertEncoding($obj);
@@ -1232,16 +1244,13 @@  discard block
 block discarded – undo
1232 1244
 			if($requestMethod == 'GET' && isset($_GET[$key]))
1233 1245
 			{
1234 1246
 				$set_to_vars = TRUE;
1235
-			}
1236
-			elseif($requestMethod == 'POST' && isset($_POST[$key]))
1247
+			} elseif($requestMethod == 'POST' && isset($_POST[$key]))
1237 1248
 			{
1238 1249
 				$set_to_vars = TRUE;
1239
-			}
1240
-			elseif($requestMethod == 'JS_CALLBACK' && (isset($_GET[$key]) || isset($_POST[$key])))
1250
+			} elseif($requestMethod == 'JS_CALLBACK' && (isset($_GET[$key]) || isset($_POST[$key])))
1241 1251
 			{
1242 1252
 				$set_to_vars = TRUE;
1243
-			}
1244
-			else
1253
+			} else
1245 1254
 			{
1246 1255
 				$set_to_vars = FALSE;
1247 1256
 			}
@@ -1267,8 +1276,7 @@  discard block
 block discarded – undo
1267 1276
 					return;
1268 1277
 				}
1269 1278
 			}
1270
-		}
1271
-		else if(is_array($val))
1279
+		} else if(is_array($val))
1272 1280
 		{
1273 1281
 			foreach($val as $val2)
1274 1282
 			{
@@ -1408,24 +1416,19 @@  discard block
 block discarded – undo
1408 1416
 			if($key === 'page' || $key === 'cpage' || substr_compare($key, 'srl', -3) === 0)
1409 1417
 			{
1410 1418
 				$result[$k] = !preg_match('/^[0-9,]+$/', $v) ? (int) $v : $v;
1411
-			}
1412
-			elseif($key === 'mid' || $key === 'search_keyword')
1419
+			} elseif($key === 'mid' || $key === 'search_keyword')
1413 1420
 			{
1414 1421
 				$result[$k] = htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1415
-			}
1416
-			elseif($key === 'vid')
1422
+			} elseif($key === 'vid')
1417 1423
 			{
1418 1424
 				$result[$k] = urlencode($v);
1419
-			}
1420
-			elseif($key === 'xe_validator_id')
1425
+			} elseif($key === 'xe_validator_id')
1421 1426
 			{
1422 1427
 				$result[$k] = htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1423
-			}
1424
-			elseif(stripos($key, 'XE_VALIDATOR', 0) === 0)
1428
+			} elseif(stripos($key, 'XE_VALIDATOR', 0) === 0)
1425 1429
 			{
1426 1430
 				unset($result[$k]);
1427
-			}
1428
-			else
1431
+			} else
1429 1432
 			{
1430 1433
 				$result[$k] = $v;
1431 1434
 
@@ -1434,8 +1437,7 @@  discard block
 block discarded – undo
1434 1437
 					if (is_array($result[$k]))
1435 1438
 					{
1436 1439
 						array_walk_recursive($result[$k], function(&$val) { $val = stripslashes($val); });
1437
-					}
1438
-					else
1440
+					} else
1439 1441
 					{
1440 1442
 						$result[$k] = stripslashes($result[$k]);
1441 1443
 					}
@@ -1444,8 +1446,7 @@  discard block
 block discarded – undo
1444 1446
 				if(is_array($result[$k]))
1445 1447
 				{
1446 1448
 					array_walk_recursive($result[$k], function(&$val) { $val = trim($val); });
1447
-				}
1448
-				else
1449
+				} else
1449 1450
 				{
1450 1451
 					$result[$k] = trim($result[$k]);
1451 1452
 				}
@@ -1490,8 +1491,7 @@  discard block
 block discarded – undo
1490 1491
 				$val['name'] = htmlspecialchars($val['name'], ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
1491 1492
 				$this->set($key, $val, TRUE);
1492 1493
 				$this->is_uploaded = TRUE;
1493
-			}
1494
-			else
1494
+			} else
1495 1495
 			{
1496 1496
 				$files = array();
1497 1497
 				$count_files = count($tmp_name);
@@ -1509,7 +1509,9 @@  discard block
 block discarded – undo
1509 1509
 						$files[] = $file;
1510 1510
 					}
1511 1511
 				}
1512
-				if($files) $this->set($key, $files, TRUE);
1512
+				if($files) {
1513
+					$this->set($key, $files, TRUE);
1514
+				}
1513 1515
 			}
1514 1516
 		}
1515 1517
 	}
@@ -1601,8 +1603,7 @@  discard block
 block discarded – undo
1601 1603
 			if($site_module_info->domain && isSiteID($site_module_info->domain))
1602 1604
 			{
1603 1605
 				$vid = $site_module_info->domain;
1604
-			}
1605
-			else
1606
+			} else
1606 1607
 			{
1607 1608
 				$domain = $site_module_info->domain;
1608 1609
 			}
@@ -1619,8 +1620,7 @@  discard block
 block discarded – undo
1619 1620
 			if($domain_info['host'] . $domain_info['path'] == $current_info['host'] . $current_info['path'])
1620 1621
 			{
1621 1622
 				unset($domain);
1622
-			}
1623
-			else
1623
+			} else
1624 1624
 			{
1625 1625
 				$domain = preg_replace('/^(http|https):\/\//i', '', trim($domain));
1626 1626
 				if(substr_compare($domain, '/', -1) !== 0)
@@ -1640,23 +1640,35 @@  discard block
 block discarded – undo
1640 1640
 			{
1641 1641
 				array_shift($args_list);
1642 1642
 			}
1643
-		}
1644
-		elseif($_SERVER['REQUEST_METHOD'] == 'GET')
1643
+		} elseif($_SERVER['REQUEST_METHOD'] == 'GET')
1645 1644
 		{
1646 1645
 			// Otherwise, make GET variables into array
1647 1646
 			$get_vars = get_object_vars($self->get_vars);
1648
-		}
1649
-		else
1647
+		} else
1650 1648
 		{
1651
-			if(!!$self->get_vars->module) $get_vars['module'] = $self->get_vars->module;
1652
-			if(!!$self->get_vars->mid) $get_vars['mid'] = $self->get_vars->mid;
1653
-			if(!!$self->get_vars->act) $get_vars['act'] = $self->get_vars->act;
1654
-			if(!!$self->get_vars->page) $get_vars['page'] = $self->get_vars->page;
1655
-			if(!!$self->get_vars->search_target) $get_vars['search_target'] = $self->get_vars->search_target;
1656
-			if(!!$self->get_vars->search_keyword) $get_vars['search_keyword'] = $self->get_vars->search_keyword;
1649
+			if(!!$self->get_vars->module) {
1650
+				$get_vars['module'] = $self->get_vars->module;
1651
+			}
1652
+			if(!!$self->get_vars->mid) {
1653
+				$get_vars['mid'] = $self->get_vars->mid;
1654
+			}
1655
+			if(!!$self->get_vars->act) {
1656
+				$get_vars['act'] = $self->get_vars->act;
1657
+			}
1658
+			if(!!$self->get_vars->page) {
1659
+				$get_vars['page'] = $self->get_vars->page;
1660
+			}
1661
+			if(!!$self->get_vars->search_target) {
1662
+				$get_vars['search_target'] = $self->get_vars->search_target;
1663
+			}
1664
+			if(!!$self->get_vars->search_keyword) {
1665
+				$get_vars['search_keyword'] = $self->get_vars->search_keyword;
1666
+			}
1657 1667
 			if($get_vars['act'] == 'IS')
1658 1668
 			{
1659
-				if(!!$self->get_vars->is_keyword) $get_vars['is_keyword'] = $self->get_vars->is_keyword;
1669
+				if(!!$self->get_vars->is_keyword) {
1670
+					$get_vars['is_keyword'] = $self->get_vars->is_keyword;
1671
+				}
1660 1672
 			}
1661 1673
 		}
1662 1674
 
@@ -1681,8 +1693,7 @@  discard block
 block discarded – undo
1681 1693
 		if($vid)
1682 1694
 		{
1683 1695
 			$get_vars['vid'] = $vid;
1684
-		}
1685
-		else
1696
+		} else
1686 1697
 		{
1687 1698
 			unset($get_vars['vid']);
1688 1699
 		}
@@ -1754,8 +1765,7 @@  discard block
 block discarded – undo
1754 1765
 						{
1755 1766
 							$queries[] = $key . '[' . $k . ']=' . urlencode($v);
1756 1767
 						}
1757
-					}
1758
-					elseif(!is_array($val))
1768
+					} elseif(!is_array($val))
1759 1769
 					{
1760 1770
 						$queries[] = $key . '=' . urlencode($val);
1761 1771
 					}
@@ -1773,25 +1783,23 @@  discard block
 block discarded – undo
1773 1783
 		{
1774 1784
 			$query = $self->getRequestUri(ENFORCE_SSL, $domain) . $query;
1775 1785
 			// optional SSL use
1776
-		}
1777
-		elseif($_use_ssl == 'optional')
1786
+		} elseif($_use_ssl == 'optional')
1778 1787
 		{
1779 1788
 			$ssl_mode = (($self->get('module') === 'admin') || ($get_vars['module'] === 'admin') || (isset($get_vars['act']) && $self->isExistsSSLAction($get_vars['act']))) ? ENFORCE_SSL : RELEASE_SSL;
1780 1789
 			$query = $self->getRequestUri($ssl_mode, $domain) . $query;
1781 1790
 			// no SSL
1782
-		}
1783
-		else
1791
+		} else
1784 1792
 		{
1785 1793
 			// currently on SSL but target is not based on SSL
1786 1794
 			if($_SERVER['HTTPS'] == 'on')
1787 1795
 			{
1788 1796
 				$query = $self->getRequestUri(ENFORCE_SSL, $domain) . $query;
1789
-			}
1790
-			else if($domain) // if $domain is set
1797
+			} else if($domain) {
1798
+				// if $domain is set
1791 1799
 			{
1792 1800
 				$query = $self->getRequestUri(FOLLOW_REQUEST_SSL, $domain) . $query;
1793 1801
 			}
1794
-			else
1802
+			} else
1795 1803
 			{
1796 1804
 				$query = getScriptPath() . $query;
1797 1805
 			}
@@ -1848,8 +1856,7 @@  discard block
 block discarded – undo
1848 1856
 		if($domain)
1849 1857
 		{
1850 1858
 			$domain_key = md5($domain);
1851
-		}
1852
-		else
1859
+		} else
1853 1860
 		{
1854 1861
 			$domain_key = 'default';
1855 1862
 		}
@@ -1878,8 +1885,7 @@  discard block
 block discarded – undo
1878 1885
 			{
1879 1886
 				$target_url.= '/';
1880 1887
 			}
1881
-		}
1882
-		else
1888
+		} else
1883 1889
 		{
1884 1890
 			$target_url = $_SERVER['HTTP_HOST'] . getScriptPath();
1885 1891
 		}
@@ -1897,20 +1903,17 @@  discard block
 block discarded – undo
1897 1903
 			if($port && $port != 443)
1898 1904
 			{
1899 1905
 				$url_info['port'] = $port;
1900
-			}
1901
-			elseif($url_info['port'] == 443)
1906
+			} elseif($url_info['port'] == 443)
1902 1907
 			{
1903 1908
 				unset($url_info['port']);
1904 1909
 			}
1905
-		}
1906
-		else
1910
+		} else
1907 1911
 		{
1908 1912
 			$port = self::get('_http_port');
1909 1913
 			if($port && $port != 80)
1910 1914
 			{
1911 1915
 				$url_info['port'] = $port;
1912
-			}
1913
-			elseif($url_info['port'] == 80)
1916
+			} elseif($url_info['port'] == 80)
1914 1917
 			{
1915 1918
 				unset($url_info['port']);
1916 1919
 			}
@@ -2147,8 +2150,7 @@  discard block
 block discarded – undo
2147 2150
 		if(strpos($file, './') === 0)
2148 2151
 		{
2149 2152
 			$file = $script_path . substr($file, 2);
2150
-		}
2151
-		elseif(strpos($file, '../') === 0)
2153
+		} elseif(strpos($file, '../') === 0)
2152 2154
 		{
2153 2155
 			$file = self::normalizeFilePath($script_path . $file);
2154 2156
 		}
@@ -2410,8 +2412,7 @@  discard block
 block discarded – undo
2410 2412
 			if(substr_compare($filename, '.js', -3) === 0)
2411 2413
 			{
2412 2414
 				$result->jsList[] = $plugin_path . $filename;
2413
-			}
2414
-			elseif(substr_compare($filename, '.css', -4) === 0)
2415
+			} elseif(substr_compare($filename, '.css', -4) === 0)
2415 2416
 			{
2416 2417
 				$result->cssList[] = $plugin_path . $filename;
2417 2418
 			}
@@ -2668,8 +2669,7 @@  discard block
 block discarded – undo
2668 2669
 			if(count($_base) > 0)
2669 2670
 			{
2670 2671
 				array_shift($_base);
2671
-			}
2672
-			else
2672
+			} else
2673 2673
 			{
2674 2674
 				array_unshift($_base, '..');
2675 2675
 			}
Please login to merge, or discard this patch.
classes/mobile/Mobile.class.php 2 patches
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	function &getInstance()
24 24
 	{
25 25
 		static $theInstance;
26
-		if(!isset($theInstance))
26
+		if (!isset($theInstance))
27 27
 		{
28 28
 			$theInstance = new Mobile();
29 29
 		}
@@ -48,11 +48,11 @@  discard block
 block discarded – undo
48 48
 	 */
49 49
 	function _isFromMobilePhone()
50 50
 	{
51
-		if($this->ismobile !== NULL)
51
+		if ($this->ismobile !== NULL)
52 52
 		{
53 53
 			return $this->ismobile;
54 54
 		}
55
-		if(Mobile::isMobileEnabled() === false || Context::get('full_browse') || $_COOKIE["FullBrowse"])
55
+		if (Mobile::isMobileEnabled() === false || Context::get('full_browse') || $_COOKIE["FullBrowse"])
56 56
 		{
57 57
 			return ($this->ismobile = false);
58 58
 		}
@@ -63,22 +63,22 @@  discard block
 block discarded – undo
63 63
 		$this->ismobile = FALSE;
64 64
 
65 65
 		$m = Context::get('m');
66
-		if(strlen($m) == 1)
66
+		if (strlen($m) == 1)
67 67
 		{
68
-			if($m == "1")
68
+			if ($m == "1")
69 69
 			{
70 70
 				$this->ismobile = TRUE;
71 71
 			}
72
-			elseif($m == "0")
72
+			elseif ($m == "0")
73 73
 			{
74 74
 				$this->ismobile = FALSE;
75 75
 			}
76 76
 		}
77
-		elseif(isset($_COOKIE['mobile']))
77
+		elseif (isset($_COOKIE['mobile']))
78 78
 		{
79
-			if($_COOKIE['user-agent'] == md5($_SERVER['HTTP_USER_AGENT']))
79
+			if ($_COOKIE['user-agent'] == md5($_SERVER['HTTP_USER_AGENT']))
80 80
 			{
81
-				if($_COOKIE['mobile'] == 'true')
81
+				if ($_COOKIE['mobile'] == 'true')
82 82
 				{
83 83
 					$this->ismobile = TRUE;
84 84
 				}
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 				$this->ismobile = FALSE;
93 93
 				saveCookie("mobile", FALSE);
94 94
 				saveCookie("user-agent", FALSE);
95
-				if(!$this->isMobilePadCheckByAgent() && $this->isMobileCheckByAgent())
95
+				if (!$this->isMobilePadCheckByAgent() && $this->isMobileCheckByAgent())
96 96
 				{
97 97
 					$this->ismobile = TRUE;
98 98
 				}
@@ -100,36 +100,36 @@  discard block
 block discarded – undo
100 100
 		}
101 101
 		else
102 102
 		{
103
-			if($this->isMobilePadCheckByAgent())
103
+			if ($this->isMobilePadCheckByAgent())
104 104
 			{
105 105
 				$this->ismobile = FALSE;
106 106
 			}
107 107
 			else
108 108
 			{
109
-				if($this->isMobileCheckByAgent())
109
+				if ($this->isMobileCheckByAgent())
110 110
 				{
111 111
 					$this->ismobile = TRUE;
112 112
 				}
113 113
 			}
114 114
 		}
115 115
 
116
-		if($this->ismobile !== NULL)
116
+		if ($this->ismobile !== NULL)
117 117
 		{
118
-			if($this->ismobile == TRUE)
118
+			if ($this->ismobile == TRUE)
119 119
 			{
120
-				if($_COOKIE['mobile'] != 'true')
120
+				if ($_COOKIE['mobile'] != 'true')
121 121
 				{
122 122
 					$_COOKIE['mobile'] = 'true';
123 123
 					saveCookie("mobile", 'true');
124 124
 				}
125 125
 			}
126
-			elseif($_COOKIE['mobile'] != 'false')
126
+			elseif ($_COOKIE['mobile'] != 'false')
127 127
 			{
128 128
 				$_COOKIE['mobile'] = 'false';
129 129
 				saveCookie("mobile", 'false');
130 130
 			}
131 131
 
132
-			if($_COOKIE['user-agent'] != md5($_SERVER['HTTP_USER_AGENT']))
132
+			if ($_COOKIE['user-agent'] != md5($_SERVER['HTTP_USER_AGENT']))
133 133
 			{
134 134
 				saveCookie("user-agent", md5($_SERVER['HTTP_USER_AGENT']));
135 135
 			}
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	function isMobileCheckByAgent()
147 147
 	{
148 148
 		static $UACheck;
149
-		if(isset($UACheck))
149
+		if (isset($UACheck))
150 150
 		{
151 151
 			return $UACheck;
152 152
 		}
@@ -154,15 +154,15 @@  discard block
 block discarded – undo
154 154
 		$oMobile = Mobile::getInstance();
155 155
 		$mobileAgent = array('iPod', 'iPhone', 'Android', 'BlackBerry', 'SymbianOS', 'Bada', 'Tizen', 'Kindle', 'Wii', 'SCH-', 'SPH-', 'CANU-', 'Windows Phone', 'Windows CE', 'POLARIS', 'Palm', 'Dorothy Browser', 'Mobile', 'Opera Mobi', 'Opera Mini', 'Minimo', 'AvantGo', 'NetFront', 'Nokia', 'LGPlayer', 'SonyEricsson', 'HTC');
156 156
 
157
-		if($oMobile->isMobilePadCheckByAgent())
157
+		if ($oMobile->isMobilePadCheckByAgent())
158 158
 		{
159 159
 			$UACheck = TRUE;
160 160
 			return TRUE;
161 161
 		}
162 162
 
163
-		foreach($mobileAgent as $agent)
163
+		foreach ($mobileAgent as $agent)
164 164
 		{
165
-			if(stripos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE)
165
+			if (stripos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE)
166 166
 			{
167 167
 				$UACheck = TRUE;
168 168
 				return TRUE;
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 	function isMobilePadCheckByAgent()
181 181
 	{
182 182
 		static $UACheck;
183
-		if(isset($UACheck))
183
+		if (isset($UACheck))
184 184
 		{
185 185
 			return $UACheck;
186 186
 		}
@@ -190,21 +190,21 @@  discard block
 block discarded – undo
190 190
 		// $exceptionAgent[0] contains exception agents for all exceptions.
191 191
 		$exceptionAgent = array(0 => array('Opera Mini', 'Opera Mobi'), 'Android' => 'Mobile');
192 192
 
193
-		foreach($padAgent as $agent)
193
+		foreach ($padAgent as $agent)
194 194
 		{
195
-			if(strpos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE)
195
+			if (strpos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE)
196 196
 			{
197
-				if(!isset($exceptionAgent[$agent]))
197
+				if (!isset($exceptionAgent[$agent]))
198 198
 				{
199 199
 					$UACheck = TRUE;
200 200
 					return TRUE;
201 201
 				}
202
-				elseif(strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE)
202
+				elseif (strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE)
203 203
 				{
204 204
 					// If the agent is the Android, that can be either tablet and mobile phone.
205
-					foreach($exceptionAgent[0] as $val)
205
+					foreach ($exceptionAgent[0] as $val)
206 206
 					{
207
-						if(strpos($_SERVER['HTTP_USER_AGENT'], $val) !== FALSE)
207
+						if (strpos($_SERVER['HTTP_USER_AGENT'], $val) !== FALSE)
208 208
 						{
209 209
 							$UACheck = FALSE;
210 210
 							return FALSE;
Please login to merge, or discard this patch.
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -68,26 +68,22 @@  discard block
 block discarded – undo
68 68
 			if($m == "1")
69 69
 			{
70 70
 				$this->ismobile = TRUE;
71
-			}
72
-			elseif($m == "0")
71
+			} elseif($m == "0")
73 72
 			{
74 73
 				$this->ismobile = FALSE;
75 74
 			}
76
-		}
77
-		elseif(isset($_COOKIE['mobile']))
75
+		} elseif(isset($_COOKIE['mobile']))
78 76
 		{
79 77
 			if($_COOKIE['user-agent'] == md5($_SERVER['HTTP_USER_AGENT']))
80 78
 			{
81 79
 				if($_COOKIE['mobile'] == 'true')
82 80
 				{
83 81
 					$this->ismobile = TRUE;
84
-				}
85
-				else
82
+				} else
86 83
 				{
87 84
 					$this->ismobile = FALSE;
88 85
 				}
89
-			}
90
-			else
86
+			} else
91 87
 			{
92 88
 				$this->ismobile = FALSE;
93 89
 				saveCookie("mobile", FALSE);
@@ -97,14 +93,12 @@  discard block
 block discarded – undo
97 93
 					$this->ismobile = TRUE;
98 94
 				}
99 95
 			}
100
-		}
101
-		else
96
+		} else
102 97
 		{
103 98
 			if($this->isMobilePadCheckByAgent())
104 99
 			{
105 100
 				$this->ismobile = FALSE;
106
-			}
107
-			else
101
+			} else
108 102
 			{
109 103
 				if($this->isMobileCheckByAgent())
110 104
 				{
@@ -122,8 +116,7 @@  discard block
 block discarded – undo
122 116
 					$_COOKIE['mobile'] = 'true';
123 117
 					saveCookie("mobile", 'true');
124 118
 				}
125
-			}
126
-			elseif($_COOKIE['mobile'] != 'false')
119
+			} elseif($_COOKIE['mobile'] != 'false')
127 120
 			{
128 121
 				$_COOKIE['mobile'] = 'false';
129 122
 				saveCookie("mobile", 'false');
@@ -198,8 +191,7 @@  discard block
 block discarded – undo
198 191
 				{
199 192
 					$UACheck = TRUE;
200 193
 					return TRUE;
201
-				}
202
-				elseif(strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE)
194
+				} elseif(strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE)
203 195
 				{
204 196
 					// If the agent is the Android, that can be either tablet and mobile phone.
205 197
 					foreach($exceptionAgent[0] as $val)
Please login to merge, or discard this patch.
config/func.inc.php 1 patch
Spacing   +184 added lines, -184 removed lines patch added patch discarded remove patch
@@ -6,13 +6,13 @@  discard block
 block discarded – undo
6 6
  *
7 7
  * @author NAVER ([email protected])
8 8
  */
9
-if(!defined('__XE__'))
9
+if (!defined('__XE__'))
10 10
 {
11 11
 	exit();
12 12
 }
13 13
 
14 14
 // define an empty function to avoid errors when iconv function doesn't exist
15
-if(!function_exists('iconv'))
15
+if (!function_exists('iconv'))
16 16
 {
17 17
 	eval('
18 18
 		function iconv($in_charset, $out_charset, $str)
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 {
221 221
 	$oDB = DB::getInstance();
222 222
 	$output = $oDB->executeQuery($query_id, $args, $arg_columns);
223
-	if(!is_array($output->data) && count($output->data) > 0)
223
+	if (!is_array($output->data) && count($output->data) > 0)
224 224
 	{
225 225
 		$output->data = array($output->data);
226 226
 	}
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 function setUserSequence($seq)
251 251
 {
252 252
 	$arr_seq = array();
253
-	if(isset($_SESSION['seq']))
253
+	if (isset($_SESSION['seq']))
254 254
 	{
255 255
 		$arr_seq = $_SESSION['seq'];
256 256
 	}
@@ -266,11 +266,11 @@  discard block
 block discarded – undo
266 266
  */
267 267
 function checkUserSequence($seq)
268 268
 {
269
-	if(!isset($_SESSION['seq']))
269
+	if (!isset($_SESSION['seq']))
270 270
 	{
271 271
 		return false;
272 272
 	}
273
-	if(!in_array($seq, $_SESSION['seq']))
273
+	if (!in_array($seq, $_SESSION['seq']))
274 274
 	{
275 275
 		return false;
276 276
 	}
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 	$num_args = func_num_args();
297 297
 	$args_list = func_get_args();
298 298
 
299
-	if($num_args)
299
+	if ($num_args)
300 300
 		$url = Context::getUrl($num_args, $args_list);
301 301
 	else
302 302
 		$url = Context::getRequestUri();
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 	$num_args = func_num_args();
316 316
 	$args_list = func_get_args();
317 317
 
318
-	if($num_args)
318
+	if ($num_args)
319 319
 	{
320 320
 		$url = Context::getUrl($num_args, $args_list, NULL, FALSE);
321 321
 	}
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 	$num_args = func_num_args();
339 339
 	$args_list = func_get_args();
340 340
 
341
-	if($num_args)
341
+	if ($num_args)
342 342
 	{
343 343
 		$url = Context::getUrl($num_args, $args_list, NULL, TRUE, TRUE);
344 344
 	}
@@ -360,16 +360,16 @@  discard block
 block discarded – undo
360 360
 	$num_args = func_num_args();
361 361
 	$args_list = func_get_args();
362 362
 	$request_uri = Context::getRequestUri();
363
-	if(!$num_args)
363
+	if (!$num_args)
364 364
 	{
365 365
 		return $request_uri;
366 366
 	}
367 367
 
368 368
 	$url = Context::getUrl($num_args, $args_list);
369
-	if(strncasecmp('http', $url, 4) !== 0)
369
+	if (strncasecmp('http', $url, 4) !== 0)
370 370
 	{
371 371
 		preg_match('/^(http|https):\/\/([^\/]+)\//', $request_uri, $match);
372
-		return substr($match[0], 0, -1) . $url;
372
+		return substr($match[0], 0, -1).$url;
373 373
 	}
374 374
 	return $url;
375 375
 }
@@ -384,17 +384,17 @@  discard block
 block discarded – undo
384 384
 	$num_args = func_num_args();
385 385
 	$args_list = func_get_args();
386 386
 	$request_uri = Context::getRequestUri();
387
-	if(!$num_args)
387
+	if (!$num_args)
388 388
 	{
389 389
 		return $request_uri;
390 390
 	}
391 391
 
392 392
 	$url = Context::getUrl($num_args, $args_list, NULL, FALSE);
393
-	if(strncasecmp('http', $url, 4) !== 0)
393
+	if (strncasecmp('http', $url, 4) !== 0)
394 394
 	{
395 395
 		preg_match('/^(http|https):\/\/([^\/]+)\//', $request_uri, $match);
396 396
 		$url = Context::getUrl($num_args, $args_list, NULL, FALSE);
397
-		return substr($match[0], 0, -1) . $url;
397
+		return substr($match[0], 0, -1).$url;
398 398
 	}
399 399
 	return $url;
400 400
 }
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 	$num_args = func_num_args();
411 411
 	$args_list = func_get_args();
412 412
 
413
-	if(!$num_args)
413
+	if (!$num_args)
414 414
 	{
415 415
 		return Context::getRequestUri();
416 416
 	}
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 	$num_args = func_num_args();
433 433
 	$args_list = func_get_args();
434 434
 
435
-	if(!$num_args)
435
+	if (!$num_args)
436 436
 	{
437 437
 		return Context::getRequestUri();
438 438
 	}
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 	$args_list = func_get_args();
455 455
 
456 456
 	$request_uri = Context::getRequestUri();
457
-	if(!$num_args)
457
+	if (!$num_args)
458 458
 	{
459 459
 		return $request_uri;
460 460
 	}
@@ -463,10 +463,10 @@  discard block
 block discarded – undo
463 463
 	$num_args = count($args_list);
464 464
 
465 465
 	$url = Context::getUrl($num_args, $args_list, $domain);
466
-	if(strncasecmp('http', $url, 4) !== 0)
466
+	if (strncasecmp('http', $url, 4) !== 0)
467 467
 	{
468 468
 		preg_match('/^(http|https):\/\/([^\/]+)\//', $request_uri, $match);
469
-		return substr($match[0], 0, -1) . $url;
469
+		return substr($match[0], 0, -1).$url;
470 470
 	}
471 471
 	return $url;
472 472
 }
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 function getCurrentPageUrl()
480 480
 {
481 481
 	$protocol = $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://';
482
-	$url = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
482
+	$url = $protocol.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
483 483
 	return htmlspecialchars($url, ENT_COMPAT, 'UTF-8', FALSE);
484 484
 }
485 485
 
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 	$path = '/';
512 512
 	$domain = '';
513 513
 
514
-	if($secure === null)
514
+	if ($secure === null)
515 515
 	{
516 516
 		$secure = (Context::getSslStatus() === 'always') ? true : false;
517 517
 	}
@@ -530,12 +530,12 @@  discard block
 block discarded – undo
530 530
  */
531 531
 function cut_str($string, $cut_size = 0, $tail = '...')
532 532
 {
533
-	if($cut_size < 1 || !$string)
533
+	if ($cut_size < 1 || !$string)
534 534
 	{
535 535
 		return $string;
536 536
 	}
537 537
 
538
-	if($GLOBALS['use_mb_strimwidth'] || function_exists('mb_strimwidth'))
538
+	if ($GLOBALS['use_mb_strimwidth'] || function_exists('mb_strimwidth'))
539 539
 	{
540 540
 		$GLOBALS['use_mb_strimwidth'] = TRUE;
541 541
 		return mb_strimwidth($string, 0, $cut_size + 4, $tail, 'utf-8');
@@ -549,16 +549,16 @@  discard block
 block discarded – undo
549 549
 	$char_count = 0;
550 550
 
551 551
 	$idx = 0;
552
-	while($idx < $string_length && $char_count < $cut_size && $char_width <= $max_width)
552
+	while ($idx < $string_length && $char_count < $cut_size && $char_width <= $max_width)
553 553
 	{
554 554
 		$c = ord(substr($string, $idx, 1));
555 555
 		$char_count++;
556
-		if($c < 128)
556
+		if ($c < 128)
557 557
 		{
558 558
 			$char_width += (int) $chars[$c - 32];
559 559
 			$idx++;
560 560
 		}
561
-		else if(191 < $c && $c < 224)
561
+		else if (191 < $c && $c < 224)
562 562
 		{
563 563
 			$char_width += $chars[4];
564 564
 			$idx += 2;
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 	}
572 572
 
573 573
 	$output = substr($string, 0, $idx);
574
-	if(strlen($output) < $string_length)
574
+	if (strlen($output) < $string_length)
575 575
 	{
576 576
 		$output .= $tail;
577 577
 	}
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 function zgap()
588 588
 {
589 589
 	$time_zone = $GLOBALS['_time_zone'];
590
-	if($time_zone < 0)
590
+	if ($time_zone < 0)
591 591
 	{
592 592
 		$to = -1;
593 593
 	}
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
 	$t_min = substr($time_zone, 3, 2) * $to;
601 601
 
602 602
 	$server_time_zone = date("O");
603
-	if($server_time_zone < 0)
603
+	if ($server_time_zone < 0)
604 604
 	{
605 605
 		$so = -1;
606 606
 	}
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
  */
628 628
 function ztime($str)
629 629
 {
630
-	if(!$str)
630
+	if (!$str)
631 631
 	{
632 632
 		return;
633 633
 	}
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
 	$year = (int) substr($str, 0, 4);
639 639
 	$month = (int) substr($str, 4, 2);
640 640
 	$day = (int) substr($str, 6, 2);
641
-	if(strlen($str) <= 8)
641
+	if (strlen($str) <= 8)
642 642
 	{
643 643
 		$gap = 0;
644 644
 	}
@@ -662,19 +662,19 @@  discard block
 block discarded – undo
662 662
 	$gap = $_SERVER['REQUEST_TIME'] + zgap() - ztime($date);
663 663
 
664 664
 	$lang_time_gap = Context::getLang('time_gap');
665
-	if($gap < 60)
665
+	if ($gap < 60)
666 666
 	{
667 667
 		$buff = sprintf($lang_time_gap['min'], (int) ($gap / 60) + 1);
668 668
 	}
669
-	elseif($gap < 60 * 60)
669
+	elseif ($gap < 60 * 60)
670 670
 	{
671 671
 		$buff = sprintf($lang_time_gap['mins'], (int) ($gap / 60) + 1);
672 672
 	}
673
-	elseif($gap < 60 * 60 * 2)
673
+	elseif ($gap < 60 * 60 * 2)
674 674
 	{
675 675
 		$buff = sprintf($lang_time_gap['hour'], (int) ($gap / 60 / 60) + 1);
676 676
 	}
677
-	elseif($gap < 60 * 60 * 24)
677
+	elseif ($gap < 60 * 60 * 24)
678 678
 	{
679 679
 		$buff = sprintf($lang_time_gap['hours'], (int) ($gap / 60 / 60) + 1);
680 680
 	}
@@ -711,40 +711,40 @@  discard block
 block discarded – undo
711 711
 function zdate($str, $format = 'Y-m-d H:i:s', $conversion = TRUE)
712 712
 {
713 713
 	// return null if no target time is specified
714
-	if(!$str)
714
+	if (!$str)
715 715
 	{
716 716
 		return;
717 717
 	}
718 718
 	// convert the date format according to the language
719
-	if($conversion == TRUE)
719
+	if ($conversion == TRUE)
720 720
 	{
721
-		switch(Context::getLangType())
721
+		switch (Context::getLangType())
722 722
 		{
723 723
 			case 'en' :
724 724
 			case 'es' :
725
-				if($format == 'Y-m-d')
725
+				if ($format == 'Y-m-d')
726 726
 				{
727 727
 					$format = 'M d, Y';
728 728
 				}
729
-				elseif($format == 'Y-m-d H:i:s')
729
+				elseif ($format == 'Y-m-d H:i:s')
730 730
 				{
731 731
 					$format = 'M d, Y H:i:s';
732 732
 				}
733
-				elseif($format == 'Y-m-d H:i')
733
+				elseif ($format == 'Y-m-d H:i')
734 734
 				{
735 735
 					$format = 'M d, Y H:i';
736 736
 				}
737 737
 				break;
738 738
 			case 'vi' :
739
-				if($format == 'Y-m-d')
739
+				if ($format == 'Y-m-d')
740 740
 				{
741 741
 					$format = 'd-m-Y';
742 742
 				}
743
-				elseif($format == 'Y-m-d H:i:s')
743
+				elseif ($format == 'Y-m-d H:i:s')
744 744
 				{
745 745
 					$format = 'H:i:s d-m-Y';
746 746
 				}
747
-				elseif($format == 'Y-m-d H:i')
747
+				elseif ($format == 'Y-m-d H:i')
748 748
 				{
749 749
 					$format = 'H:i d-m-Y';
750 750
 				}
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
 	}
754 754
 
755 755
 	// If year value is less than 1970, handle it separately.
756
-	if((int) substr($str, 0, 4) < 1970)
756
+	if ((int) substr($str, 0, 4) < 1970)
757 757
 	{
758 758
 		$hour = (int) substr($str, 8, 2);
759 759
 		$min = (int) substr($str, 10, 2);
@@ -803,9 +803,9 @@  discard block
 block discarded – undo
803 803
 function getEncodeEmailAddress($email)
804 804
 {
805 805
 	$return = '';
806
-	for($i = 0, $c = strlen($email); $i < $c; $i++)
806
+	for ($i = 0, $c = strlen($email); $i < $c; $i++)
807 807
 	{
808
-		$return .= '&#' . (rand(0, 1) == 0 ? ord($email[$i]) : 'X' . dechex(ord($email[$i]))) . ';';
808
+		$return .= '&#'.(rand(0, 1) == 0 ? ord($email[$i]) : 'X'.dechex(ord($email[$i]))).';';
809 809
 	}
810 810
 	return $return;
811 811
 }
@@ -825,25 +825,25 @@  discard block
 block discarded – undo
825 825
 {
826 826
 	static $debug_file;
827 827
 
828
-	if(!(__DEBUG__ & 1))
828
+	if (!(__DEBUG__ & 1))
829 829
 	{
830 830
 		return;
831 831
 	}
832 832
 
833 833
 	static $firephp;
834 834
 	$bt = debug_backtrace();
835
-	if(is_array($bt))
835
+	if (is_array($bt))
836 836
 	{
837 837
 		$bt_debug_print = array_shift($bt);
838 838
 		$bt_called_function = array_shift($bt);
839 839
 	}
840 840
 	$file_name = str_replace(_XE_PATH_, '', $bt_debug_print['file']);
841 841
 	$line_num = $bt_debug_print['line'];
842
-	$function = $bt_called_function['class'] . $bt_called_function['type'] . $bt_called_function['function'];
842
+	$function = $bt_called_function['class'].$bt_called_function['type'].$bt_called_function['function'];
843 843
 
844
-	if(__DEBUG_OUTPUT__ == 2 && version_compare(PHP_VERSION, '6.0.0') === -1)
844
+	if (__DEBUG_OUTPUT__ == 2 && version_compare(PHP_VERSION, '6.0.0') === -1)
845 845
 	{
846
-		if(!isset($firephp))
846
+		if (!isset($firephp))
847 847
 		{
848 848
 			$firephp = FirePHP::getInstance(TRUE);
849 849
 		}
@@ -852,16 +852,16 @@  discard block
 block discarded – undo
852 852
 		$label = sprintf('[%s:%d] %s() (Memory usage: current=%s, peak=%s)', $file_name, $line_num, $function, FileHandler::filesize(memory_get_usage()), FileHandler::filesize(memory_get_peak_usage()));
853 853
 
854 854
 		// Check a FirePHP option
855
-		if($display_option === 'TABLE')
855
+		if ($display_option === 'TABLE')
856 856
 		{
857 857
 			$label = $display_option;
858 858
 		}
859
-		if($display_option === 'ERROR')
859
+		if ($display_option === 'ERROR')
860 860
 		{
861 861
 			$type = $display_option;
862 862
 		}
863 863
 		// Check if the IP specified by __DEBUG_PROTECT__ option is same as the access IP.
864
-		if(__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR'])
864
+		if (__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR'])
865 865
 		{
866 866
 			$debug_output = 'The IP address is not allowed. Change the value of __DEBUG_PROTECT_IP__ into your IP address in config/config.user.inc.php or config/config.inc.php';
867 867
 			$label = NULL;
@@ -871,52 +871,52 @@  discard block
 block discarded – undo
871 871
 	}
872 872
 	else
873 873
 	{
874
-		if(__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR'])
874
+		if (__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR'])
875 875
 		{
876 876
 			return;
877 877
 		}
878 878
 
879 879
 		$print = array();
880
-		if(!$debug_file)
880
+		if (!$debug_file)
881 881
 		{
882
-			$debug_file = _XE_PATH_ . 'files/' . $file;
882
+			$debug_file = _XE_PATH_.'files/'.$file;
883 883
 		}
884
-		if(!file_exists($debug_file)) $print[] = '<?php exit() ?>';
884
+		if (!file_exists($debug_file)) $print[] = '<?php exit() ?>';
885 885
 
886
-		if($display_option === TRUE || $display_option === 'ERROR')
886
+		if ($display_option === TRUE || $display_option === 'ERROR')
887 887
 		{
888
-			$print[] = sprintf("[%s %s:%d] %s() - mem(%s)", date('Y-m-d H:i:s'), $file_name, $line_num, $function, FileHandler::filesize(memory_get_usage()));;
888
+			$print[] = sprintf("[%s %s:%d] %s() - mem(%s)", date('Y-m-d H:i:s'), $file_name, $line_num, $function, FileHandler::filesize(memory_get_usage())); ;
889 889
 			$print[] = str_repeat('=', 80);
890 890
 		}
891 891
 		$type = gettype($debug_output);
892
-		if(!in_array($type, array('array', 'object', 'resource')))
892
+		if (!in_array($type, array('array', 'object', 'resource')))
893 893
 		{
894
-			if($display_option === 'ERROR')
894
+			if ($display_option === 'ERROR')
895 895
 			{
896
-				$print[] = 'ERROR : ' . var_export($debug_output, TRUE);
896
+				$print[] = 'ERROR : '.var_export($debug_output, TRUE);
897 897
 			}
898 898
 			else
899 899
 			{
900
-				$print[] = 'DEBUG : ' . $type . '(' . var_export($debug_output, TRUE) . ')';
900
+				$print[] = 'DEBUG : '.$type.'('.var_export($debug_output, TRUE).')';
901 901
 			}
902 902
 		}
903 903
 		else
904 904
 		{
905
-			$print[] = 'DEBUG : ' . trim(preg_replace('/\r?\n/', "\n" . '        ', print_r($debug_output, true)));
905
+			$print[] = 'DEBUG : '.trim(preg_replace('/\r?\n/', "\n".'        ', print_r($debug_output, true)));
906 906
 		}
907 907
 		$backtrace_args = defined('\DEBUG_BACKTRACE_IGNORE_ARGS') ? \DEBUG_BACKTRACE_IGNORE_ARGS : 0;
908 908
 		$backtrace = debug_backtrace($backtrace_args);
909 909
 
910
-		if(count($backtrace) > 1 && $backtrace[1]['function'] === 'debugPrint' && !$backtrace[1]['class'])
910
+		if (count($backtrace) > 1 && $backtrace[1]['function'] === 'debugPrint' && !$backtrace[1]['class'])
911 911
 		{
912 912
 			array_shift($backtrace);
913 913
 		}
914
-		foreach($backtrace as $val)
914
+		foreach ($backtrace as $val)
915 915
 		{
916
-			$print[] = '        - ' . $val['file'] . ' : ' . $val['line'];
916
+			$print[] = '        - '.$val['file'].' : '.$val['line'];
917 917
 		}
918 918
 		$print[] = PHP_EOL;
919
-		@file_put_contents($debug_file, implode(PHP_EOL, $print), FILE_APPEND|LOCK_EX);
919
+		@file_put_contents($debug_file, implode(PHP_EOL, $print), FILE_APPEND | LOCK_EX);
920 920
 	}
921 921
 }
922 922
 
@@ -927,7 +927,7 @@  discard block
 block discarded – undo
927 927
  */
928 928
 function writeSlowlog($type, $elapsed_time, $obj)
929 929
 {
930
-	if(!__LOG_SLOW_TRIGGER__ && !__LOG_SLOW_ADDON__ && !__LOG_SLOW_WIDGET__ && !__LOG_SLOW_QUERY__) return;
930
+	if (!__LOG_SLOW_TRIGGER__ && !__LOG_SLOW_ADDON__ && !__LOG_SLOW_WIDGET__ && !__LOG_SLOW_QUERY__) return;
931 931
 
932 932
 	static $log_filename = array(
933 933
 		'query' => 'files/_slowlog_query.php',
@@ -937,47 +937,47 @@  discard block
 block discarded – undo
937 937
 	);
938 938
 	$write_file = true;
939 939
 
940
-	$log_file = _XE_PATH_ . $log_filename[$type];
940
+	$log_file = _XE_PATH_.$log_filename[$type];
941 941
 
942 942
 	$buff = array();
943 943
 	$buff[] = '<?php exit(); ?>';
944 944
 	$buff[] = date('c');
945 945
 
946
-	if($type == 'trigger' && __LOG_SLOW_TRIGGER__ > 0 && $elapsed_time > __LOG_SLOW_TRIGGER__)
946
+	if ($type == 'trigger' && __LOG_SLOW_TRIGGER__ > 0 && $elapsed_time > __LOG_SLOW_TRIGGER__)
947 947
 	{
948
-		$buff[] = "\tCaller : " . $obj->caller;
949
-		$buff[] = "\tCalled : " . $obj->called;
948
+		$buff[] = "\tCaller : ".$obj->caller;
949
+		$buff[] = "\tCalled : ".$obj->called;
950 950
 	}
951
-	else if($type == 'addon' && __LOG_SLOW_ADDON__ > 0 && $elapsed_time > __LOG_SLOW_ADDON__)
951
+	else if ($type == 'addon' && __LOG_SLOW_ADDON__ > 0 && $elapsed_time > __LOG_SLOW_ADDON__)
952 952
 	{
953
-		$buff[] = "\tAddon : " . $obj->called;
954
-		$buff[] = "\tCalled position : " . $obj->caller;
953
+		$buff[] = "\tAddon : ".$obj->called;
954
+		$buff[] = "\tCalled position : ".$obj->caller;
955 955
 	}
956
-	else if($type == 'widget' && __LOG_SLOW_WIDGET__ > 0 && $elapsed_time > __LOG_SLOW_WIDGET__)
956
+	else if ($type == 'widget' && __LOG_SLOW_WIDGET__ > 0 && $elapsed_time > __LOG_SLOW_WIDGET__)
957 957
 	{
958
-		$buff[] = "\tWidget : " . $obj->called;
958
+		$buff[] = "\tWidget : ".$obj->called;
959 959
 	}
960
-	else if($type == 'query' && __LOG_SLOW_QUERY__ > 0 && $elapsed_time > __LOG_SLOW_QUERY__)
960
+	else if ($type == 'query' && __LOG_SLOW_QUERY__ > 0 && $elapsed_time > __LOG_SLOW_QUERY__)
961 961
 	{
962 962
 
963 963
 		$buff[] = $obj->query;
964
-		$buff[] = "\tQuery ID   : " . $obj->query_id;
965
-		$buff[] = "\tCaller     : " . $obj->caller;
966
-		$buff[] = "\tConnection : " . $obj->connection;
964
+		$buff[] = "\tQuery ID   : ".$obj->query_id;
965
+		$buff[] = "\tCaller     : ".$obj->caller;
966
+		$buff[] = "\tConnection : ".$obj->connection;
967 967
 	}
968 968
 	else
969 969
 	{
970 970
 		$write_file = false;
971 971
 	}
972 972
 
973
-	if($write_file)
973
+	if ($write_file)
974 974
 	{
975 975
 		$buff[] = sprintf("\t%0.6f sec", $elapsed_time);
976
-		$buff[] = PHP_EOL . PHP_EOL;
976
+		$buff[] = PHP_EOL.PHP_EOL;
977 977
 		file_put_contents($log_file, implode(PHP_EOL, $buff), FILE_APPEND);
978 978
 	}
979 979
 
980
-	if($type != 'query')
980
+	if ($type != 'query')
981 981
 	{
982 982
 		$trigger_args = $obj;
983 983
 		$trigger_args->_log_type = $type;
@@ -1017,11 +1017,11 @@  discard block
 block discarded – undo
1017 1017
  */
1018 1018
 function delObjectVars($target_obj, $del_obj)
1019 1019
 {
1020
-	if(!is_object($target_obj))
1020
+	if (!is_object($target_obj))
1021 1021
 	{
1022 1022
 		return;
1023 1023
 	}
1024
-	if(!is_object($del_obj))
1024
+	if (!is_object($del_obj))
1025 1025
 	{
1026 1026
 		return;
1027 1027
 	}
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
 
1032 1032
 	$target = array_keys($target_vars);
1033 1033
 	$del = array_keys($del_vars);
1034
-	if(!count($target) || !count($del))
1034
+	if (!count($target) || !count($del))
1035 1035
 	{
1036 1036
 		return $target_obj;
1037 1037
 	}
@@ -1039,10 +1039,10 @@  discard block
 block discarded – undo
1039 1039
 	$return_obj = new stdClass();
1040 1040
 
1041 1041
 	$target_count = count($target);
1042
-	for($i = 0; $i < $target_count; $i++)
1042
+	for ($i = 0; $i < $target_count; $i++)
1043 1043
 	{
1044 1044
 		$target_key = $target[$i];
1045
-		if(!in_array($target_key, $del))
1045
+		if (!in_array($target_key, $del))
1046 1046
 		{
1047 1047
 			$return_obj->{$target_key} = $target_obj->{$target_key};
1048 1048
 		}
@@ -1055,10 +1055,10 @@  discard block
 block discarded – undo
1055 1055
 {
1056 1056
 	$del_vars = array('error_return_url', 'success_return_url', 'ruleset', 'xe_validator_id');
1057 1057
 
1058
-	foreach($del_vars as $var)
1058
+	foreach ($del_vars as $var)
1059 1059
 	{
1060
-		if(is_array($vars)) unset($vars[$var]);
1061
-		else if(is_object($vars)) unset($vars->$var);
1060
+		if (is_array($vars)) unset($vars[$var]);
1061
+		else if (is_object($vars)) unset($vars->$var);
1062 1062
 	}
1063 1063
 
1064 1064
 	return $vars;
@@ -1075,12 +1075,12 @@  discard block
 block discarded – undo
1075 1075
  */
1076 1076
 function handleError($errno, $errstr, $file, $line)
1077 1077
 {
1078
-	if(!__DEBUG__)
1078
+	if (!__DEBUG__)
1079 1079
 	{
1080 1080
 		return;
1081 1081
 	}
1082 1082
 	$errors = array(E_USER_ERROR, E_ERROR, E_PARSE);
1083
-	if(!in_array($errno, $errors))
1083
+	if (!in_array($errno, $errors))
1084 1084
 	{
1085 1085
 		return;
1086 1086
 	}
@@ -1100,8 +1100,8 @@  discard block
 block discarded – undo
1100 1100
 function getNumberingPath($no, $size = 3)
1101 1101
 {
1102 1102
 	$mod = pow(10, $size);
1103
-	$output = sprintf('%0' . $size . 'd/', $no % $mod);
1104
-	if($no >= $mod)
1103
+	$output = sprintf('%0'.$size.'d/', $no % $mod);
1104
+	if ($no >= $mod)
1105 1105
 	{
1106 1106
 		$output .= getNumberingPath((int) $no / $mod, $size);
1107 1107
 	}
@@ -1121,7 +1121,7 @@  discard block
 block discarded – undo
1121 1121
 
1122 1122
 function purifierHtml(&$content)
1123 1123
 {
1124
-	require_once(_XE_PATH_ . 'classes/security/Purifier.class.php');
1124
+	require_once(_XE_PATH_.'classes/security/Purifier.class.php');
1125 1125
 	$oPurifier = Purifier::getInstance();
1126 1126
 	$oPurifier->purify($content);
1127 1127
 }
@@ -1134,7 +1134,7 @@  discard block
 block discarded – undo
1134 1134
  */
1135 1135
 function removeHackTag($content)
1136 1136
 {
1137
-	require_once(_XE_PATH_ . 'classes/security/EmbedFilter.class.php');
1137
+	require_once(_XE_PATH_.'classes/security/EmbedFilter.class.php');
1138 1138
 	$oEmbedFilter = EmbedFilter::getInstance();
1139 1139
 	$oEmbedFilter->check($content);
1140 1140
 
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
  */
1177 1177
 function checkUploadedFile($file)
1178 1178
 {
1179
-	require_once(_XE_PATH_ . 'classes/security/UploadFileFilter.class.php');
1179
+	require_once(_XE_PATH_.'classes/security/UploadFileFilter.class.php');
1180 1180
 	return UploadFileFilter::check($file);
1181 1181
 }
1182 1182
 
@@ -1190,13 +1190,13 @@  discard block
 block discarded – undo
1190 1190
 {
1191 1191
 	$content = preg_replace('@<(/?)xmp.*?>@i', '<\1xmp>', $content);
1192 1192
 
1193
-	if(($start_xmp = strrpos($content, '<xmp>')) !== FALSE)
1193
+	if (($start_xmp = strrpos($content, '<xmp>')) !== FALSE)
1194 1194
 	{
1195
-		if(($close_xmp = strrpos($content, '</xmp>')) === FALSE)
1195
+		if (($close_xmp = strrpos($content, '</xmp>')) === FALSE)
1196 1196
 		{
1197 1197
 			$content .= '</xmp>';
1198 1198
 		}
1199
-		else if($close_xmp < $start_xmp)
1199
+		else if ($close_xmp < $start_xmp)
1200 1200
 		{
1201 1201
 			$content .= '</xmp>';
1202 1202
 		}
@@ -1216,33 +1216,33 @@  discard block
 block discarded – undo
1216 1216
 	$tag = strtolower($match[2]);
1217 1217
 
1218 1218
 	// xmp tag ?뺣━
1219
-	if($tag == 'xmp')
1219
+	if ($tag == 'xmp')
1220 1220
 	{
1221 1221
 		return "<{$match[1]}xmp>";
1222 1222
 	}
1223
-	if($match[1])
1223
+	if ($match[1])
1224 1224
 	{
1225 1225
 		return $match[0];
1226 1226
 	}
1227
-	if($match[4])
1227
+	if ($match[4])
1228 1228
 	{
1229
-		$match[4] = ' ' . $match[4];
1229
+		$match[4] = ' '.$match[4];
1230 1230
 	}
1231 1231
 
1232 1232
 	$attrs = array();
1233
-	if(preg_match_all('/([\w:-]+)\s*=(?:\s*(["\']))?(?(2)(.*?)\2|([^ ]+))/s', $match[3], $m))
1233
+	if (preg_match_all('/([\w:-]+)\s*=(?:\s*(["\']))?(?(2)(.*?)\2|([^ ]+))/s', $match[3], $m))
1234 1234
 	{
1235
-		foreach($m[1] as $idx => $name)
1235
+		foreach ($m[1] as $idx => $name)
1236 1236
 		{
1237
-			if(strlen($name) >= 2 && substr_compare($name, 'on', 0, 2) === 0)
1237
+			if (strlen($name) >= 2 && substr_compare($name, 'on', 0, 2) === 0)
1238 1238
 			{
1239 1239
 				continue;
1240 1240
 			}
1241 1241
 
1242
-			$val = preg_replace_callback('/&#(?:x([a-fA-F0-9]+)|0*(\d+));/', function($n) {return chr($n[1] ? ('0x00' . $n[1]) : ($n[2] + 0)); }, $m[3][$idx] . $m[4][$idx]);
1242
+			$val = preg_replace_callback('/&#(?:x([a-fA-F0-9]+)|0*(\d+));/', function($n) {return chr($n[1] ? ('0x00'.$n[1]) : ($n[2] + 0)); }, $m[3][$idx].$m[4][$idx]);
1243 1243
 			$val = preg_replace('/^\s+|[\t\n\r]+/', '', $val);
1244 1244
 
1245
-			if(preg_match('/^[a-z]+script:/i', $val))
1245
+			if (preg_match('/^[a-z]+script:/i', $val))
1246 1246
 			{
1247 1247
 				continue;
1248 1248
 			}
@@ -1253,60 +1253,60 @@  discard block
 block discarded – undo
1253 1253
 
1254 1254
 	$filter_arrts = array('style', 'src', 'href');
1255 1255
 
1256
-	if($tag === 'object') array_push($filter_arrts, 'data');
1257
-	if($tag === 'param') array_push($filter_arrts, 'value');
1256
+	if ($tag === 'object') array_push($filter_arrts, 'data');
1257
+	if ($tag === 'param') array_push($filter_arrts, 'value');
1258 1258
 
1259
-	foreach($filter_arrts as $attr)
1259
+	foreach ($filter_arrts as $attr)
1260 1260
 	{
1261
-		if(!isset($attrs[$attr])) continue;
1261
+		if (!isset($attrs[$attr])) continue;
1262 1262
 
1263 1263
 		$attr_value = rawurldecode($attrs[$attr]);
1264 1264
 		$attr_value = htmlspecialchars_decode($attr_value, ENT_COMPAT);
1265 1265
 		$attr_value = preg_replace('/\s+|[\t\n\r]+/', '', $attr_value);
1266
-		if(preg_match('@(\?|&|;)(act=(\w+))@i', $attr_value, $m) && $m[3] !== 'procFileDownload')
1266
+		if (preg_match('@(\?|&|;)(act=(\w+))@i', $attr_value, $m) && $m[3] !== 'procFileDownload')
1267 1267
 		{
1268 1268
 			unset($attrs[$attr]);
1269 1269
 		}
1270 1270
 	}
1271 1271
 
1272
-	if(isset($attrs['style']) && preg_match('@(?:/\*|\*/|\n|:\s*expression\s*\()@i', $attrs['style']))
1272
+	if (isset($attrs['style']) && preg_match('@(?:/\*|\*/|\n|:\s*expression\s*\()@i', $attrs['style']))
1273 1273
 	{
1274 1274
 		unset($attrs['style']);
1275 1275
 	}
1276 1276
 
1277 1277
 	$attr = array();
1278
-	foreach($attrs as $name => $val)
1278
+	foreach ($attrs as $name => $val)
1279 1279
 	{
1280
-		if($tag == 'object' || $tag == 'embed' || $tag == 'a')
1280
+		if ($tag == 'object' || $tag == 'embed' || $tag == 'a')
1281 1281
 		{
1282 1282
 			$attribute = strtolower(trim($name));
1283
-			if($attribute == 'data' || $attribute == 'src' || $attribute == 'href')
1283
+			if ($attribute == 'data' || $attribute == 'src' || $attribute == 'href')
1284 1284
 			{
1285
-				if(stripos($val, 'data:') === 0)
1285
+				if (stripos($val, 'data:') === 0)
1286 1286
 				{
1287 1287
 					continue;
1288 1288
 				}
1289 1289
 			}
1290 1290
 		}
1291 1291
 
1292
-		if($tag == 'img')
1292
+		if ($tag == 'img')
1293 1293
 		{
1294 1294
 			$attribute = strtolower(trim($name));
1295
-			if(stripos($val, 'data:') === 0)
1295
+			if (stripos($val, 'data:') === 0)
1296 1296
 			{
1297 1297
 				continue;
1298 1298
 			}
1299 1299
 		}
1300 1300
 		$val = str_replace('"', '&quot;', $val);
1301
-		$attr[] = $name . "=\"{$val}\"";
1301
+		$attr[] = $name."=\"{$val}\"";
1302 1302
 	}
1303
-	$attr = count($attr) ? ' ' . implode(' ', $attr) : '';
1303
+	$attr = count($attr) ? ' '.implode(' ', $attr) : '';
1304 1304
 
1305 1305
 	return "<{$match[1]}{$tag}{$attr}{$match[4]}>";
1306 1306
 }
1307 1307
 
1308 1308
 // convert hexa value to RGB
1309
-if(!function_exists('hexrgb'))
1309
+if (!function_exists('hexrgb'))
1310 1310
 {
1311 1311
 
1312 1312
 	/**
@@ -1342,9 +1342,9 @@  discard block
 block discarded – undo
1342 1342
 
1343 1343
 	settype($password, "string");
1344 1344
 
1345
-	for($i = 0; $i < strlen($password); $i++)
1345
+	for ($i = 0; $i < strlen($password); $i++)
1346 1346
 	{
1347
-		if($password[$i] == ' ' || $password[$i] == '\t')
1347
+		if ($password[$i] == ' ' || $password[$i] == '\t')
1348 1348
 		{
1349 1349
 			continue;
1350 1350
 		}
@@ -1356,11 +1356,11 @@  discard block
 block discarded – undo
1356 1356
 	$result1 = sprintf("%08lx", $nr & ((1 << 31) - 1));
1357 1357
 	$result2 = sprintf("%08lx", $nr2 & ((1 << 31) - 1));
1358 1358
 
1359
-	if($result1 == '80000000')
1359
+	if ($result1 == '80000000')
1360 1360
 	{
1361 1361
 		$nr += 0x80000000;
1362 1362
 	}
1363
-	if($result2 == '80000000')
1363
+	if ($result2 == '80000000')
1364 1364
 	{
1365 1365
 		$nr2 += 0x80000000;
1366 1366
 	}
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
 function getScriptPath()
1377 1377
 {
1378 1378
 	static $url = NULL;
1379
-	if($url == NULL)
1379
+	if ($url == NULL)
1380 1380
 	{
1381 1381
 		$script_path = filter_var($_SERVER['SCRIPT_NAME'], FILTER_SANITIZE_STRING);
1382 1382
 		$url = str_ireplace('/tools/', '/', preg_replace('/index.php.*/i', '', str_replace('\\', '/', $script_path)));
@@ -1407,14 +1407,14 @@  discard block
 block discarded – undo
1407 1407
 	$decodedStr = '';
1408 1408
 	$pos = 0;
1409 1409
 	$len = strlen($source);
1410
-	while($pos < $len)
1410
+	while ($pos < $len)
1411 1411
 	{
1412 1412
 		$charAt = substr($source, $pos, 1);
1413
-		if($charAt == '%')
1413
+		if ($charAt == '%')
1414 1414
 		{
1415 1415
 			$pos++;
1416 1416
 			$charAt = substr($source, $pos, 1);
1417
-			if($charAt == 'u')
1417
+			if ($charAt == 'u')
1418 1418
 			{
1419 1419
 				// we got a unicode character
1420 1420
 				$pos++;
@@ -1448,21 +1448,21 @@  discard block
 block discarded – undo
1448 1448
  */
1449 1449
 function _code2utf($num)
1450 1450
 {
1451
-	if($num < 128)
1451
+	if ($num < 128)
1452 1452
 	{
1453 1453
 		return chr($num);
1454 1454
 	}
1455
-	if($num < 2048)
1455
+	if ($num < 2048)
1456 1456
 	{
1457
-		return chr(($num >> 6) + 192) . chr(($num & 63) + 128);
1457
+		return chr(($num >> 6) + 192).chr(($num & 63) + 128);
1458 1458
 	}
1459
-	if($num < 65536)
1459
+	if ($num < 65536)
1460 1460
 	{
1461
-		return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
1461
+		return chr(($num >> 12) + 224).chr((($num >> 6) & 63) + 128).chr(($num & 63) + 128);
1462 1462
 	}
1463
-	if($num < 2097152)
1463
+	if ($num < 2097152)
1464 1464
 	{
1465
-		return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
1465
+		return chr(($num >> 18) + 240).chr((($num >> 12) & 63) + 128).chr((($num >> 6) & 63) + 128).chr(($num & 63) + 128);
1466 1466
 	}
1467 1467
 	return '';
1468 1468
 }
@@ -1477,7 +1477,7 @@  discard block
 block discarded – undo
1477 1477
  */
1478 1478
 function detectUTF8($string, $return_convert = FALSE, $urldecode = TRUE)
1479 1479
 {
1480
-	if($urldecode)
1480
+	if ($urldecode)
1481 1481
 	{
1482 1482
 		$string = urldecode($string);
1483 1483
 	}
@@ -1485,12 +1485,12 @@  discard block
 block discarded – undo
1485 1485
 	$sample = iconv('utf-8', 'utf-8', $string);
1486 1486
 	$is_utf8 = (md5($sample) === md5($string));
1487 1487
 
1488
-	if(!$urldecode)
1488
+	if (!$urldecode)
1489 1489
 	{
1490 1490
 		$string = urldecode($string);
1491 1491
 	}
1492 1492
 
1493
-	if($return_convert)
1493
+	if ($return_convert)
1494 1494
 	{
1495 1495
 		return ($is_utf8) ? $string : iconv('euc-kr', 'utf-8', $string);
1496 1496
 	}
@@ -1506,7 +1506,7 @@  discard block
 block discarded – undo
1506 1506
  */
1507 1507
 function json_encode2($data)
1508 1508
 {
1509
-	switch(gettype($data))
1509
+	switch (gettype($data))
1510 1510
 	{
1511 1511
 		case 'boolean':
1512 1512
 			return $data ? 'true' : 'false';
@@ -1514,15 +1514,15 @@  discard block
 block discarded – undo
1514 1514
 		case 'double':
1515 1515
 			return $data;
1516 1516
 		case 'string':
1517
-			return '"' . strtr($data, array('\\' => '\\\\', '"' => '\\"')) . '"';
1517
+			return '"'.strtr($data, array('\\' => '\\\\', '"' => '\\"')).'"';
1518 1518
 		case 'object':
1519 1519
 			$data = get_object_vars($data);
1520 1520
 		case 'array':
1521 1521
 			$rel = FALSE; // relative array?
1522 1522
 			$key = array_keys($data);
1523
-			foreach($key as $v)
1523
+			foreach ($key as $v)
1524 1524
 			{
1525
-				if(!is_int($v))
1525
+				if (!is_int($v))
1526 1526
 				{
1527 1527
 					$rel = TRUE;
1528 1528
 					break;
@@ -1530,12 +1530,12 @@  discard block
 block discarded – undo
1530 1530
 			}
1531 1531
 
1532 1532
 			$arr = array();
1533
-			foreach($data as $k => $v)
1533
+			foreach ($data as $k => $v)
1534 1534
 			{
1535
-				$arr[] = ($rel ? '"' . strtr($k, array('\\' => '\\\\', '"' => '\\"')) . '":' : '') . json_encode2($v);
1535
+				$arr[] = ($rel ? '"'.strtr($k, array('\\' => '\\\\', '"' => '\\"')).'":' : '').json_encode2($v);
1536 1536
 			}
1537 1537
 
1538
-			return $rel ? '{' . join(',', $arr) . '}' : '[' . join(',', $arr) . ']';
1538
+			return $rel ? '{'.join(',', $arr).'}' : '['.join(',', $arr).']';
1539 1539
 		default:
1540 1540
 			return '""';
1541 1541
 	}
@@ -1549,7 +1549,7 @@  discard block
 block discarded – undo
1549 1549
  */
1550 1550
 function isCrawler($agent = NULL)
1551 1551
 {
1552
-	if(!$agent)
1552
+	if (!$agent)
1553 1553
 	{
1554 1554
 		$agent = $_SERVER['HTTP_USER_AGENT'];
1555 1555
 	}
@@ -1559,9 +1559,9 @@  discard block
 block discarded – undo
1559 1559
 		/*'211.245.21.110-211.245.21.119' mixsh is closed */
1560 1560
 	);
1561 1561
 
1562
-	foreach($check_agent as $str)
1562
+	foreach ($check_agent as $str)
1563 1563
 	{
1564
-		if(stristr($agent, $str) != FALSE)
1564
+		if (stristr($agent, $str) != FALSE)
1565 1565
 		{
1566 1566
 			return TRUE;
1567 1567
 		}
@@ -1579,7 +1579,7 @@  discard block
 block discarded – undo
1579 1579
  */
1580 1580
 function stripEmbedTagForAdmin(&$content, $writer_member_srl)
1581 1581
 {
1582
-	if(!Context::get('is_logged'))
1582
+	if (!Context::get('is_logged'))
1583 1583
 	{
1584 1584
 		return;
1585 1585
 	}
@@ -1587,18 +1587,18 @@  discard block
 block discarded – undo
1587 1587
 	$oModuleModel = getModel('module');
1588 1588
 	$logged_info = Context::get('logged_info');
1589 1589
 
1590
-	if($writer_member_srl != $logged_info->member_srl && ($logged_info->is_admin == "Y" || $oModuleModel->isSiteAdmin($logged_info)))
1590
+	if ($writer_member_srl != $logged_info->member_srl && ($logged_info->is_admin == "Y" || $oModuleModel->isSiteAdmin($logged_info)))
1591 1591
 	{
1592
-		if($writer_member_srl)
1592
+		if ($writer_member_srl)
1593 1593
 		{
1594 1594
 			$oMemberModel = getModel('member');
1595 1595
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($writer_member_srl);
1596
-			if($member_info->is_admin == "Y")
1596
+			if ($member_info->is_admin == "Y")
1597 1597
 			{
1598 1598
 				return;
1599 1599
 			}
1600 1600
 		}
1601
-		$security_msg = "<div style='border: 1px solid #DDD; background: #FAFAFA; text-align:center; margin: 1em 0;'><p style='margin: 1em;'>" . Context::getLang('security_warning_embed') . "</p></div>";
1601
+		$security_msg = "<div style='border: 1px solid #DDD; background: #FAFAFA; text-align:center; margin: 1em 0;'><p style='margin: 1em;'>".Context::getLang('security_warning_embed')."</p></div>";
1602 1602
 		$content = preg_replace('/<object[^>]+>(.*?<\/object>)?/is', $security_msg, $content);
1603 1603
 		$content = preg_replace('/<embed[^>]+>(\s*<\/embed>)?/is', $security_msg, $content);
1604 1604
 		$content = preg_replace('/<img[^>]+editor_component="multimedia_link"[^>]*>(\s*<\/img>)?/is', $security_msg, $content);
@@ -1615,18 +1615,18 @@  discard block
 block discarded – undo
1615 1615
 function requirePear()
1616 1616
 {
1617 1617
 	static $required = false;
1618
-	if($required)
1618
+	if ($required)
1619 1619
 	{
1620 1620
 		return;
1621 1621
 	}
1622 1622
 
1623
-	if(version_compare(PHP_VERSION, "5.3.0") < 0)
1623
+	if (version_compare(PHP_VERSION, "5.3.0") < 0)
1624 1624
 	{
1625
-		set_include_path(_XE_PATH_ . "libs/PEAR" . PATH_SEPARATOR . get_include_path());
1625
+		set_include_path(_XE_PATH_."libs/PEAR".PATH_SEPARATOR.get_include_path());
1626 1626
 	}
1627 1627
 	else
1628 1628
 	{
1629
-		set_include_path(_XE_PATH_ . "libs/PEAR.1.9.5" . PATH_SEPARATOR . get_include_path());
1629
+		set_include_path(_XE_PATH_."libs/PEAR.1.9.5".PATH_SEPARATOR.get_include_path());
1630 1630
 	}
1631 1631
 
1632 1632
 	$required = true;
@@ -1634,7 +1634,7 @@  discard block
 block discarded – undo
1634 1634
 
1635 1635
 function checkCSRF()
1636 1636
 {
1637
-	if($_SERVER['REQUEST_METHOD'] != 'POST')
1637
+	if ($_SERVER['REQUEST_METHOD'] != 'POST')
1638 1638
 	{
1639 1639
 		return FALSE;
1640 1640
 	}
@@ -1642,7 +1642,7 @@  discard block
 block discarded – undo
1642 1642
 	$csrf_token = ($_SERVER['HTTP_X_CSRF_TOKEN']) ? $_SERVER['HTTP_X_CSRF_TOKEN'] : $_POST['_token'];
1643 1643
 
1644 1644
 	// Token
1645
-	if(!$csrf_token || $_SESSION['csrf_token'] !== $csrf_token)
1645
+	if (!$csrf_token || $_SESSION['csrf_token'] !== $csrf_token)
1646 1646
 	{
1647 1647
 		header("HTTP/1.1 403 Forbidden");
1648 1648
 		return FALSE;
@@ -1651,9 +1651,9 @@  discard block
 block discarded – undo
1651 1651
 	$default_url = Context::getDefaultUrl();
1652 1652
 	$referer = $_SERVER["HTTP_REFERER"];
1653 1653
 
1654
-	if(strpos($default_url, 'xn--') !== FALSE && strpos($referer, 'xn--') === FALSE)
1654
+	if (strpos($default_url, 'xn--') !== FALSE && strpos($referer, 'xn--') === FALSE)
1655 1655
 	{
1656
-		require_once(_XE_PATH_ . 'libs/idna_convert/idna_convert.class.php');
1656
+		require_once(_XE_PATH_.'libs/idna_convert/idna_convert.class.php');
1657 1657
 		$IDN = new idna_convert(array('idn_version' => 2008));
1658 1658
 		$referer = $IDN->encode($referer);
1659 1659
 	}
@@ -1664,9 +1664,9 @@  discard block
 block discarded – undo
1664 1664
 	$oModuleModel = getModel('module');
1665 1665
 	$siteModuleInfo = $oModuleModel->getDefaultMid();
1666 1666
 
1667
-	if($siteModuleInfo->site_srl == 0)
1667
+	if ($siteModuleInfo->site_srl == 0)
1668 1668
 	{
1669
-		if($default_url['host'] !== $referer['host'])
1669
+		if ($default_url['host'] !== $referer['host'])
1670 1670
 		{
1671 1671
 			return FALSE;
1672 1672
 		}
@@ -1674,7 +1674,7 @@  discard block
 block discarded – undo
1674 1674
 	else
1675 1675
 	{
1676 1676
 		$virtualSiteInfo = $oModuleModel->getSiteInfo($siteModuleInfo->site_srl);
1677
-		if(strtolower($virtualSiteInfo->domain) != strtolower(Context::get('vid')) && !strstr(strtolower($virtualSiteInfo->domain), strtolower($referer['host'])))
1677
+		if (strtolower($virtualSiteInfo->domain) != strtolower(Context::get('vid')) && !strstr(strtolower($virtualSiteInfo->domain), strtolower($referer['host'])))
1678 1678
 		{
1679 1679
 			return FALSE;
1680 1680
 		}
@@ -1690,15 +1690,15 @@  discard block
 block discarded – undo
1690 1690
  */
1691 1691
 function recurciveExposureCheck(&$menu)
1692 1692
 {
1693
-	if(is_array($menu))
1693
+	if (is_array($menu))
1694 1694
 	{
1695
-		foreach($menu AS $key=>$value)
1695
+		foreach ($menu AS $key=>$value)
1696 1696
 		{
1697
-			if(!$value['isShow'])
1697
+			if (!$value['isShow'])
1698 1698
 			{
1699 1699
 				unset($menu[$key]);
1700 1700
 			}
1701
-			if(is_array($value['list']) && count($value['list']) > 0)
1701
+			if (is_array($value['list']) && count($value['list']) > 0)
1702 1702
 			{
1703 1703
 				recurciveExposureCheck($menu[$key]['list']);
1704 1704
 			}
@@ -1708,14 +1708,14 @@  discard block
 block discarded – undo
1708 1708
 
1709 1709
 function changeValueInUrl($key, $requestKey, $dbKey, $urlName = 'success_return_url')
1710 1710
 {
1711
-	if($requestKey != $dbKey)
1711
+	if ($requestKey != $dbKey)
1712 1712
 	{
1713 1713
 		$arrayUrl = parse_url(Context::get('success_return_url'));
1714
-		if($arrayUrl['query'])
1714
+		if ($arrayUrl['query'])
1715 1715
 		{
1716 1716
 			parse_str($arrayUrl['query'], $parsedStr);
1717 1717
 
1718
-			if(isset($parsedStr[$key]))
1718
+			if (isset($parsedStr[$key]))
1719 1719
 			{
1720 1720
 				$parsedStr[$key] = $requestKey;
1721 1721
 				$successReturnUrl .= $arrayUrl['path'].'?'.http_build_query($parsedStr);
@@ -1758,14 +1758,14 @@  discard block
 block discarded – undo
1758 1758
  */
1759 1759
 function alertScript($msg)
1760 1760
 {
1761
-	if(!$msg)
1761
+	if (!$msg)
1762 1762
 	{
1763 1763
 		return;
1764 1764
 	}
1765 1765
 
1766 1766
 	echo '<script type="text/javascript">
1767 1767
 //<![CDATA[
1768
-alert("' . $msg . '");
1768
+alert("' . $msg.'");
1769 1769
 //]]>
1770 1770
 </script>';
1771 1771
 }
@@ -1796,7 +1796,7 @@  discard block
 block discarded – undo
1796 1796
 
1797 1797
 	echo '<script type="text/javascript">
1798 1798
 //<![CDATA[
1799
-' . $reloadScript . '
1799
+' . $reloadScript.'
1800 1800
 //]]>
1801 1801
 </script>';
1802 1802
 }
Please login to merge, or discard this patch.