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 ( ac6023...1ac08b )
by gyeong-won
20s
created
classes/file/FileHandler.class.php 3 patches
Doc Comments   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 * @param string $target_dir Path of target dir
35 35
 	 * @param string $filter Regex to filter files. If file matches this regex, the file is not copied.
36 36
 	 * @param string $type If set as 'force'. Even if the file exists in target, the file is copied.
37
-	 * @return void
37
+	 * @return false|null
38 38
 	 */
39 39
 	function copyDir($source_dir, $target_dir, $filter = null, $type = null)
40 40
 	{
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 	 * This function creates directories recursively, which means that if ancestors of the target directory does not exist, they will be created too.
278 278
 	 *
279 279
 	 * @param string $path_string Path of target directory
280
-	 * @return bool TRUE if success. It might return nothing when ftp is used and connection to the ftp address failed.
280
+	 * @return boolean|null TRUE if success. It might return nothing when ftp is used and connection to the ftp address failed.
281 281
 	 */
282 282
 	function makeDir($path_string)
283 283
 	{
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 	 * @param string $url The address of the target file
668 668
 	 * @param string $target_filename The location to store
669 669
 	 * @param string $body HTTP request body
670
-	 * @param string $timeout Connection timeout
670
+	 * @param integer $timeout Connection timeout
671 671
 	 * @param string $method GET/POST
672 672
 	 * @param string $content_type Content type header of HTTP request
673 673
 	 * @param string[] $headers Headers key value array.
@@ -700,8 +700,8 @@  discard block
 block discarded – undo
700 700
 	 * Convert size in string into numeric value
701 701
 	 *
702 702
 	 * @see self::filesize()
703
-	 * @param $val Size in string (ex., 10, 10K, 10M, 10G )
704
-	 * @return int converted size
703
+	 * @param string $val Size in string (ex., 10, 10K, 10M, 10G )
704
+	 * @return double converted size
705 705
 	 */
706 706
 	function returnBytes($val)
707 707
 	{
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
 	 * @param string $target_type If $target_type is set (gif, jpg, png, bmp), result image will be saved as target type
753 753
 	 * @param string $thumbnail_type Thumbnail type(crop, ratio)
754 754
 	 * @param bool $thumbnail_transparent If $target_type is png, set background set transparent color
755
-	 * @return bool TRUE: success, FALSE: failed
755
+	 * @return null|boolean TRUE: success, FALSE: failed
756 756
 	 */
757 757
 	function createImageFile($source_file, $target_file, $resize_width = 0, $resize_height = 0, $target_type = '', $thumbnail_type = 'crop', $thumbnail_transparent = FALSE)
758 758
 	{
@@ -1082,7 +1082,7 @@  discard block
 block discarded – undo
1082 1082
 	 * Check file exists.
1083 1083
 	 *
1084 1084
 	 * @param string $filename Target file name
1085
-	 * @return bool Returns FALSE if the file does not exists, or Returns full path file(string).
1085
+	 * @return string|false Returns FALSE if the file does not exists, or Returns full path file(string).
1086 1086
 	 */
1087 1087
 	function exists($filename)
1088 1088
 	{
@@ -1093,8 +1093,8 @@  discard block
 block discarded – undo
1093 1093
 	/**
1094 1094
 	 * Check it is dir
1095 1095
 	 *
1096
-	 * @param string $dir Target dir path
1097
-	 * @return bool Returns FALSE if the dir is not dir, or Returns full path of dir(string).
1096
+	 * @param string $path
1097
+	 * @return string|false Returns FALSE if the dir is not dir, or Returns full path of dir(string).
1098 1098
 	 */
1099 1099
 	function isDir($path)
1100 1100
 	{
Please login to merge, or discard this patch.
Spacing   +141 added lines, -141 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
 	 */
18 18
 	function getRealPath($source)
19 19
 	{
20
-		if(strlen($source) >= 2 && substr_compare($source, './', 0, 2) === 0)
20
+		if (strlen($source) >= 2 && substr_compare($source, './', 0, 2) === 0)
21 21
 		{
22
-			return _XE_PATH_ . substr($source, 2);
22
+			return _XE_PATH_.substr($source, 2);
23 23
 		}
24 24
 
25 25
 		return $source;
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	{
41 41
 		$source_dir = self::getRealPath($source_dir);
42 42
 		$target_dir = self::getRealPath($target_dir);
43
-		if(!is_dir($source_dir))
43
+		if (!is_dir($source_dir))
44 44
 		{
45 45
 			return FALSE;
46 46
 		}
@@ -48,44 +48,44 @@  discard block
 block discarded – undo
48 48
 		// generate when no target exists
49 49
 		self::makeDir($target_dir);
50 50
 
51
-		if(substr($source_dir, -1) != DIRECTORY_SEPARATOR)
51
+		if (substr($source_dir, -1) != DIRECTORY_SEPARATOR)
52 52
 		{
53 53
 			$source_dir .= DIRECTORY_SEPARATOR;
54 54
 		}
55 55
 
56
-		if(substr($target_dir, -1) != DIRECTORY_SEPARATOR)
56
+		if (substr($target_dir, -1) != DIRECTORY_SEPARATOR)
57 57
 		{
58 58
 			$target_dir .= DIRECTORY_SEPARATOR;
59 59
 		}
60 60
 
61 61
 		$oDir = dir($source_dir);
62
-		while($file = $oDir->read())
62
+		while ($file = $oDir->read())
63 63
 		{
64
-			if($file{0} == '.')
64
+			if ($file{0} == '.')
65 65
 			{
66 66
 				continue;
67 67
 			}
68 68
 
69
-			if($filter && preg_match($filter, $file))
69
+			if ($filter && preg_match($filter, $file))
70 70
 			{
71 71
 				continue;
72 72
 			}
73 73
 
74
-			if(is_dir($source_dir . $file))
74
+			if (is_dir($source_dir.$file))
75 75
 			{
76
-				self::copyDir($source_dir . $file, $target_dir . $file, $type);
76
+				self::copyDir($source_dir.$file, $target_dir.$file, $type);
77 77
 			}
78 78
 			else
79 79
 			{
80
-				if($type == 'force')
80
+				if ($type == 'force')
81 81
 				{
82
-					@unlink($target_dir . $file);
82
+					@unlink($target_dir.$file);
83 83
 				}
84 84
 				else
85 85
 				{
86
-					if(!file_exists($target_dir . $file))
86
+					if (!file_exists($target_dir.$file))
87 87
 					{
88
-						@copy($source_dir . $file, $target_dir . $file);
88
+						@copy($source_dir.$file, $target_dir.$file);
89 89
 					}
90 90
 				}
91 91
 			}
@@ -110,12 +110,12 @@  discard block
 block discarded – undo
110 110
 
111 111
 		self::makeDir($target_dir);
112 112
 
113
-		if($force == 'Y')
113
+		if ($force == 'Y')
114 114
 		{
115
-			@unlink($target_dir . DIRECTORY_SEPARATOR . $target);
115
+			@unlink($target_dir.DIRECTORY_SEPARATOR.$target);
116 116
 		}
117 117
 
118
-		@copy($source, $target_dir . DIRECTORY_SEPARATOR . $target);
118
+		@copy($source, $target_dir.DIRECTORY_SEPARATOR.$target);
119 119
 	}
120 120
 
121 121
 	/**
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 */
127 127
 	function readFile($filename)
128 128
 	{
129
-		if(($filename = self::exists($filename)) === FALSE || filesize($filename) < 1)
129
+		if (($filename = self::exists($filename)) === FALSE || filesize($filename) < 1)
130 130
 		{
131 131
 			return;
132 132
 		}
@@ -149,12 +149,12 @@  discard block
 block discarded – undo
149 149
 		self::makeDir($pathinfo['dirname']);
150 150
 
151 151
 		$flags = 0;
152
-		if(strtolower($mode) == 'a')
152
+		if (strtolower($mode) == 'a')
153 153
 		{
154 154
 			$flags = FILE_APPEND;
155 155
 		}
156 156
 
157
-		@file_put_contents($filename, $buff, $flags|LOCK_EX);
157
+		@file_put_contents($filename, $buff, $flags | LOCK_EX);
158 158
 		@chmod($filename, 0644);
159 159
 		self::clearStatCache($filename);
160 160
 		self::invalidateOpcache($filename);
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 	 */
195 195
 	function moveFile($source, $target)
196 196
 	{
197
-		if(($source = self::exists($source)) !== FALSE)
197
+		if (($source = self::exists($source)) !== FALSE)
198 198
 		{
199 199
 			self::removeFile($target);
200 200
 			return self::rename($source, $target);
@@ -232,35 +232,35 @@  discard block
 block discarded – undo
232 232
 		$path = self::getRealPath($path);
233 233
 		$output = array();
234 234
 
235
-		if(substr($path, -1) != '/')
235
+		if (substr($path, -1) != '/')
236 236
 		{
237 237
 			$path .= '/';
238 238
 		}
239 239
 
240
-		if(!is_dir($path))
240
+		if (!is_dir($path))
241 241
 		{
242 242
 			return $output;
243 243
 		}
244 244
 
245 245
 		$files = scandir($path);
246
-		foreach($files as $file)
246
+		foreach ($files as $file)
247 247
 		{
248
-			if($file{0} == '.' || ($filter && !preg_match($filter, $file)))
248
+			if ($file{0} == '.' || ($filter && !preg_match($filter, $file)))
249 249
 			{
250 250
 				continue;
251 251
 			}
252 252
 
253
-			if($to_lower)
253
+			if ($to_lower)
254 254
 			{
255 255
 				$file = strtolower($file);
256 256
 			}
257 257
 
258
-			if($filter)
258
+			if ($filter)
259 259
 			{
260 260
 				$file = preg_replace($filter, '$1', $file);
261 261
 			}
262 262
 
263
-			if($concat_prefix)
263
+			if ($concat_prefix)
264 264
 			{
265 265
 				$file = sprintf('%s%s', str_replace(_XE_PATH_, '', $path), $file);
266 266
 			}
@@ -281,12 +281,12 @@  discard block
 block discarded – undo
281 281
 	 */
282 282
 	function makeDir($path_string)
283 283
 	{
284
-		if(self::exists($path_string) !== FALSE)
284
+		if (self::exists($path_string) !== FALSE)
285 285
 		{
286 286
 			return TRUE;
287 287
 		}
288 288
 
289
-		if(!ini_get('safe_mode'))
289
+		if (!ini_get('safe_mode'))
290 290
 		{
291 291
 			@mkdir($path_string, 0755, TRUE);
292 292
 			@chmod($path_string, 0755);
@@ -297,35 +297,35 @@  discard block
 block discarded – undo
297 297
 			static $oFtp = NULL;
298 298
 
299 299
 			$ftp_info = Context::getFTPInfo();
300
-			if($oFtp == NULL)
300
+			if ($oFtp == NULL)
301 301
 			{
302
-				if(!Context::isFTPRegisted())
302
+				if (!Context::isFTPRegisted())
303 303
 				{
304 304
 					return;
305 305
 				}
306 306
 
307
-				require_once(_XE_PATH_ . 'libs/ftp.class.php');
307
+				require_once(_XE_PATH_.'libs/ftp.class.php');
308 308
 				$oFtp = new ftp();
309
-				if(!$ftp_info->ftp_host)
309
+				if (!$ftp_info->ftp_host)
310 310
 				{
311 311
 					$ftp_info->ftp_host = "127.0.0.1";
312 312
 				}
313
-				if(!$ftp_info->ftp_port)
313
+				if (!$ftp_info->ftp_port)
314 314
 				{
315 315
 					$ftp_info->ftp_port = 21;
316 316
 				}
317
-				if(!$oFtp->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port))
317
+				if (!$oFtp->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port))
318 318
 				{
319 319
 					return;
320 320
 				}
321
-				if(!$oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password))
321
+				if (!$oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password))
322 322
 				{
323 323
 					$oFtp->ftp_quit();
324 324
 					return;
325 325
 				}
326 326
 			}
327 327
 
328
-			if(!($ftp_path = $ftp_info->ftp_root_path))
328
+			if (!($ftp_path = $ftp_info->ftp_root_path))
329 329
 			{
330 330
 				$ftp_path = DIRECTORY_SEPARATOR;
331 331
 			}
@@ -334,19 +334,19 @@  discard block
 block discarded – undo
334 334
 			$path_list = explode(DIRECTORY_SEPARATOR, $path_string);
335 335
 
336 336
 			$path = _XE_PATH_;
337
-			for($i = 0, $c = count($path_list); $i < $c; $i++)
337
+			for ($i = 0, $c = count($path_list); $i < $c; $i++)
338 338
 			{
339
-				if(!$path_list[$i])
339
+				if (!$path_list[$i])
340 340
 				{
341 341
 					continue;
342 342
 				}
343 343
 
344
-				$path .= $path_list[$i] . DIRECTORY_SEPARATOR;
345
-				$ftp_path .= $path_list[$i] . DIRECTORY_SEPARATOR;
346
-				if(!is_dir($path))
344
+				$path .= $path_list[$i].DIRECTORY_SEPARATOR;
345
+				$ftp_path .= $path_list[$i].DIRECTORY_SEPARATOR;
346
+				if (!is_dir($path))
347 347
 				{
348 348
 					$oFtp->ftp_mkdir($ftp_path);
349
-					$oFtp->ftp_site("CHMOD 777 " . $ftp_path);
349
+					$oFtp->ftp_site("CHMOD 777 ".$ftp_path);
350 350
 				}
351 351
 			}
352 352
 		}
@@ -362,23 +362,23 @@  discard block
 block discarded – undo
362 362
 	 */
363 363
 	function removeDir($path)
364 364
 	{
365
-		if(($path = self::isDir($path)) === FALSE)
365
+		if (($path = self::isDir($path)) === FALSE)
366 366
 		{
367 367
 			return;
368 368
 		}
369 369
 
370
-		if(self::isDir($path))
370
+		if (self::isDir($path))
371 371
 		{
372 372
 			$files = array_diff(scandir($path), array('..', '.'));
373 373
 
374
-			foreach($files as $file)
374
+			foreach ($files as $file)
375 375
 			{
376
-				if(($target = self::getRealPath($path . DIRECTORY_SEPARATOR . $file)) === FALSE)
376
+				if (($target = self::getRealPath($path.DIRECTORY_SEPARATOR.$file)) === FALSE)
377 377
 				{
378 378
 					continue;
379 379
 				}
380 380
 
381
-				if(is_dir($target))
381
+				if (is_dir($target))
382 382
 				{
383 383
 					self::removeDir($target);
384 384
 				}
@@ -403,22 +403,22 @@  discard block
 block discarded – undo
403 403
 	 */
404 404
 	function removeBlankDir($path)
405 405
 	{
406
-		if(($path = self::isDir($path)) === FALSE)
406
+		if (($path = self::isDir($path)) === FALSE)
407 407
 		{
408 408
 			return;
409 409
 		}
410 410
 
411 411
 		$files = array_diff(scandir($path), array('..', '.'));
412 412
 
413
-		if(count($files) < 1)
413
+		if (count($files) < 1)
414 414
 		{
415 415
 			rmdir($path);
416 416
 			return;
417 417
 		}
418 418
 
419
-		foreach($files as $file)
419
+		foreach ($files as $file)
420 420
 		{
421
-			if(($target = self::isDir($path . DIRECTORY_SEPARATOR . $file)) === FALSE)
421
+			if (($target = self::isDir($path.DIRECTORY_SEPARATOR.$file)) === FALSE)
422 422
 			{
423 423
 				continue;
424 424
 			}
@@ -437,23 +437,23 @@  discard block
 block discarded – undo
437 437
 	 */
438 438
 	function removeFilesInDir($path)
439 439
 	{
440
-		if(($path = self::getRealPath($path)) === FALSE)
440
+		if (($path = self::getRealPath($path)) === FALSE)
441 441
 		{
442 442
 			return;
443 443
 		}
444 444
 
445
-		if(is_dir($path))
445
+		if (is_dir($path))
446 446
 		{
447 447
 			$files = array_diff(scandir($path), array('..', '.'));
448 448
 
449
-			foreach($files as $file)
449
+			foreach ($files as $file)
450 450
 			{
451
-				if(($target = self::getRealPath($path . DIRECTORY_SEPARATOR . $file)) === FALSE)
451
+				if (($target = self::getRealPath($path.DIRECTORY_SEPARATOR.$file)) === FALSE)
452 452
 				{
453 453
 					continue;
454 454
 				}
455 455
 
456
-				if(is_dir($target))
456
+				if (is_dir($target))
457 457
 				{
458 458
 					self::removeFilesInDir($target);
459 459
 				}
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
 		}
466 466
 		else
467 467
 		{
468
-			if(self::exists($path)) unlink($path);
468
+			if (self::exists($path)) unlink($path);
469 469
 		}
470 470
 
471 471
 	}
@@ -479,22 +479,22 @@  discard block
 block discarded – undo
479 479
 	 */
480 480
 	function filesize($size)
481 481
 	{
482
-		if(!$size)
482
+		if (!$size)
483 483
 		{
484 484
 			return '0Byte';
485 485
 		}
486 486
 
487
-		if($size === 1)
487
+		if ($size === 1)
488 488
 		{
489 489
 			return '1Byte';
490 490
 		}
491 491
 
492
-		if($size < 1024)
492
+		if ($size < 1024)
493 493
 		{
494
-			return $size . 'Bytes';
494
+			return $size.'Bytes';
495 495
 		}
496 496
 
497
-		if($size >= 1024 && $size < 1024 * 1024)
497
+		if ($size >= 1024 && $size < 1024 * 1024)
498 498
 		{
499 499
 			return sprintf("%0.1fKB", $size / 1024);
500 500
 		}
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 	 */
520 520
 	function getRemoteResource($url, $body = null, $timeout = 3, $method = 'GET', $content_type = null, $headers = array(), $cookies = array(), $post_data = array(), $request_config = array())
521 521
 	{
522
-		require_once(_XE_PATH_ . 'libs/idna_convert/idna_convert.class.php');
522
+		require_once(_XE_PATH_.'libs/idna_convert/idna_convert.class.php');
523 523
 		$IDN = new idna_convert(array('idn_version' => 2008));
524 524
 		$url = $IDN->encode($url);
525 525
 
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 			require_once('HTTP/Request.php');
530 530
 
531 531
 			$parsed_url = parse_url(__PROXY_SERVER__);
532
-			if($parsed_url["host"] && $parsed_url["path"])
532
+			if ($parsed_url["host"] && $parsed_url["path"])
533 533
 			{
534 534
 				// Old style proxy server support (POST payload to proxy script)
535 535
 				$oRequest = new HTTP_Request(__PROXY_SERVER__);
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 				$oRequest = new HTTP_Request($url);
542 542
 
543 543
 				// New style proxy server support (Use HTTP_Request2 native config format)
544
-				if($parsed_url['host'])
544
+				if ($parsed_url['host'])
545 545
 				{
546 546
 					$request_config['proxy_host'] = $parsed_url['host'];
547 547
 					$request_config['proxy_port'] = $parsed_url['port'] ? $parsed_url['port'] : '';
@@ -550,13 +550,13 @@  discard block
 block discarded – undo
550 550
 					$request_config['proxy_type'] = $parsed_url['scheme'] ? $parsed_url['scheme'] : 'http';
551 551
 				}
552 552
 
553
-				if(count($request_config) && method_exists($oRequest, 'setConfig'))
553
+				if (count($request_config) && method_exists($oRequest, 'setConfig'))
554 554
 				{
555
-					foreach($request_config as $key=>$val)
555
+					foreach ($request_config as $key=>$val)
556 556
 					{
557
-						if($key === 'observers')
557
+						if ($key === 'observers')
558 558
 						{
559
-							foreach($val as $observer)
559
+							foreach ($val as $observer)
560 560
 							{
561 561
 								$oRequest->attach($observer);
562 562
 							}
@@ -567,58 +567,58 @@  discard block
 block discarded – undo
567 567
 						}
568 568
 					}
569 569
 				}
570
-				if(method_exists($oRequest, 'setConfig'))
570
+				if (method_exists($oRequest, 'setConfig'))
571 571
 				{
572
-					if(extension_loaded('curl'))
572
+					if (extension_loaded('curl'))
573 573
 					{
574 574
 						$oRequest->setConfig('adapter', 'curl');
575 575
 					}
576
-					elseif(version_compare(PHP_VERSION, '5.6', '<'))
576
+					elseif (version_compare(PHP_VERSION, '5.6', '<'))
577 577
 					{
578 578
 						$oRequest->setConfig('ssl_verify_host', false);
579 579
 					}
580
-					if(file_exists(_XE_PATH_ . 'libs/cacert/cacert.pem'))
580
+					if (file_exists(_XE_PATH_.'libs/cacert/cacert.pem'))
581 581
 					{
582
-						$oRequest->setConfig('ssl_cafile', _XE_PATH_ . 'libs/cacert/cacert.pem');
582
+						$oRequest->setConfig('ssl_cafile', _XE_PATH_.'libs/cacert/cacert.pem');
583 583
 					}
584 584
 				}
585 585
 
586
-				if(count($headers) > 0)
586
+				if (count($headers) > 0)
587 587
 				{
588
-					foreach($headers as $key => $val)
588
+					foreach ($headers as $key => $val)
589 589
 					{
590 590
 						$oRequest->addHeader($key, $val);
591 591
 					}
592 592
 				}
593 593
 				$host = parse_url($url, PHP_URL_HOST);
594
-				if($cookies[$host])
594
+				if ($cookies[$host])
595 595
 				{
596
-					foreach($cookies[$host] as $key => $val)
596
+					foreach ($cookies[$host] as $key => $val)
597 597
 					{
598 598
 						$oRequest->addCookie($key, $val);
599 599
 					}
600 600
 				}
601
-				if(count($post_data) > 0)
601
+				if (count($post_data) > 0)
602 602
 				{
603
-					foreach($post_data as $key => $val)
603
+					foreach ($post_data as $key => $val)
604 604
 					{
605 605
 						$oRequest->addPostData($key, $val);
606 606
 					}
607 607
 				}
608
-				if(!$content_type)
608
+				if (!$content_type)
609 609
 					$oRequest->addHeader('Content-Type', 'text/html');
610 610
 				else
611 611
 					$oRequest->addHeader('Content-Type', $content_type);
612 612
 				$oRequest->setMethod($method);
613
-				if($body)
613
+				if ($body)
614 614
 					$oRequest->setBody($body);
615 615
 			}
616 616
 			
617
-			if(method_exists($oRequest, 'setConfig'))
617
+			if (method_exists($oRequest, 'setConfig'))
618 618
 			{
619 619
 				$oRequest->setConfig('timeout', $timeout);
620 620
 			}
621
-			elseif(property_exists($oRequest, '_timeout'))
621
+			elseif (property_exists($oRequest, '_timeout'))
622 622
 			{
623 623
 				$oRequest->_timeout = $timeout;
624 624
 			}
@@ -628,25 +628,25 @@  discard block
 block discarded – undo
628 628
 			$code = $oRequest->getResponseCode();
629 629
 			$header = $oRequest->getResponseHeader();
630 630
 			$response = $oRequest->getResponseBody();
631
-			if($c = $oRequest->getResponseCookies())
631
+			if ($c = $oRequest->getResponseCookies())
632 632
 			{
633
-				foreach($c as $k => $v)
633
+				foreach ($c as $k => $v)
634 634
 				{
635 635
 					$cookies[$host][$v['name']] = $v['value'];
636 636
 				}
637 637
 			}
638 638
 
639
-			if($code > 300 && $code < 399 && $header['location'])
639
+			if ($code > 300 && $code < 399 && $header['location'])
640 640
 			{
641 641
 				return self::getRemoteResource($header['location'], $body, $timeout, $method, $content_type, $headers, $cookies, $post_data);
642 642
 			}
643 643
 
644
-			if($code != 200)
644
+			if ($code != 200)
645 645
 			{
646 646
 				return;
647 647
 			}
648 648
 
649
-			if(isset($request_config['store_body']) && !$request_config['store_body'])
649
+			if (isset($request_config['store_body']) && !$request_config['store_body'])
650 650
 			{
651 651
 				return TRUE;
652 652
 			}
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 				return $response;
656 656
 			}
657 657
 		}
658
-		catch(Exception $e)
658
+		catch (Exception $e)
659 659
 		{
660 660
 			return NULL;
661 661
 		}
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
 			self::clearStatCache($target_filename);
690 690
 			self::invalidateOpcache($target_filename);
691 691
 		}
692
-		catch(Exception $e)
692
+		catch (Exception $e)
693 693
 		{
694 694
 			return FALSE;
695 695
 		}
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
 	function returnBytes($val)
707 707
 	{
708 708
 		$unit = strtoupper(substr($val, -1));
709
-		$val = (float)$val;
709
+		$val = (float) $val;
710 710
 
711 711
 		switch ($unit)
712 712
 		{
@@ -729,13 +729,13 @@  discard block
 block discarded – undo
729 729
 		$K64 = 65536;
730 730
 		$TWEAKFACTOR = 2.0;
731 731
 		$channels = $imageInfo['channels'];
732
-		if(!$channels)
732
+		if (!$channels)
733 733
 		{
734 734
 			$channels = 6; //for png
735 735
 		}
736
-		$memoryNeeded = round(($imageInfo[0] * $imageInfo[1] * $imageInfo['bits'] * $channels / 8 + $K64 ) * $TWEAKFACTOR);
736
+		$memoryNeeded = round(($imageInfo[0] * $imageInfo[1] * $imageInfo['bits'] * $channels / 8 + $K64) * $TWEAKFACTOR);
737 737
 		$availableMemory = self::returnBytes(ini_get('memory_limit')) - memory_get_usage();
738
-		if($availableMemory < $memoryNeeded)
738
+		if ($availableMemory < $memoryNeeded)
739 739
 		{
740 740
 			return FALSE;
741 741
 		}
@@ -763,30 +763,30 @@  discard block
 block discarded – undo
763 763
 		}
764 764
 
765 765
 		$target_file = self::getRealPath($target_file);
766
-		if(!$resize_width)
766
+		if (!$resize_width)
767 767
 		{
768 768
 			$resize_width = 100;
769 769
 		}
770 770
 
771
-		if(!$resize_height)
771
+		if (!$resize_height)
772 772
 		{
773 773
 			$resize_height = $resize_width;
774 774
 		}
775 775
 
776 776
 		// retrieve source image's information
777 777
 		$imageInfo = getimagesize($source_file);
778
-		if(!self::checkMemoryLoadImage($imageInfo))
778
+		if (!self::checkMemoryLoadImage($imageInfo))
779 779
 		{
780 780
 			return FALSE;
781 781
 		}
782 782
 
783 783
 		list($width, $height, $type, $attrs) = $imageInfo;
784
-		if($width < 1 || $height < 1)
784
+		if ($width < 1 || $height < 1)
785 785
 		{
786 786
 			return;
787 787
 		}
788 788
 
789
-		switch($type)
789
+		switch ($type)
790 790
 		{
791 791
 			case '1' :
792 792
 				$type = 'gif';
@@ -804,7 +804,7 @@  discard block
 block discarded – undo
804 804
 				return;
805 805
 		}
806 806
 
807
-		if(!$target_type)
807
+		if (!$target_type)
808 808
 		{
809 809
 			$target_type = $type;
810 810
 		}
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
 		$height_per = ($resize_height > 0 && $height >= $resize_height) ? $resize_height / $height : 1;
816 816
 
817 817
 		$per = NULL;
818
-		if($thumbnail_type == 'ratio')
818
+		if ($thumbnail_type == 'ratio')
819 819
 		{
820 820
 			$per = ($width_per > $height_per) ? $height_per : $width_per;
821 821
 			$resize_width = $width * $per;
@@ -828,30 +828,30 @@  discard block
 block discarded – undo
828 828
 
829 829
 		// create temporary image with target size
830 830
 		$thumb = NULL;
831
-		if(function_exists('imagecreateTRUEcolor'))
831
+		if (function_exists('imagecreateTRUEcolor'))
832 832
 		{
833 833
 			$thumb = imagecreateTRUEcolor($resize_width, $resize_height);
834 834
 		}
835
-		else if(function_exists('imagecreate'))
835
+		else if (function_exists('imagecreate'))
836 836
 		{
837 837
 			$thumb = imagecreate($resize_width, $resize_height);
838 838
 		}
839 839
 
840
-		if(!$thumb)
840
+		if (!$thumb)
841 841
 		{
842 842
 			return FALSE;
843 843
 		}
844 844
 
845
-		if(function_exists('imagecolorallocatealpha') && $target_type == 'png' && $thumbnail_transparent)
845
+		if (function_exists('imagecolorallocatealpha') && $target_type == 'png' && $thumbnail_transparent)
846 846
 		{
847 847
 			imagefill($thumb, 0, 0, imagecolorallocatealpha($thumb, 0, 0, 0, 127));
848 848
 			
849
-			if(function_exists('imagesavealpha'))
849
+			if (function_exists('imagesavealpha'))
850 850
 			{
851 851
 				imagesavealpha($thumb, TRUE);
852 852
 			}
853 853
 
854
-			if(function_exists('imagealphablending'))
854
+			if (function_exists('imagealphablending'))
855 855
 			{
856 856
 				imagealphablending($thumb, TRUE);
857 857
 			}
@@ -863,37 +863,37 @@  discard block
 block discarded – undo
863 863
 
864 864
 		// create temporary image having original type
865 865
 		$source = NULL;
866
-		switch($type)
866
+		switch ($type)
867 867
 		{
868 868
 			case 'gif' :
869
-				if(function_exists('imagecreatefromgif'))
869
+				if (function_exists('imagecreatefromgif'))
870 870
 				{
871 871
 					$source = @imagecreatefromgif($source_file);
872 872
 				}
873 873
 				break;
874 874
 			case 'jpeg' :
875 875
 			case 'jpg' :
876
-				if(function_exists('imagecreatefromjpeg'))
876
+				if (function_exists('imagecreatefromjpeg'))
877 877
 				{
878 878
 					$source = @imagecreatefromjpeg($source_file);
879 879
 				}
880 880
 				break;
881 881
 			case 'png' :
882
-				if(function_exists('imagecreatefrompng'))
882
+				if (function_exists('imagecreatefrompng'))
883 883
 				{
884 884
 					$source = @imagecreatefrompng($source_file);
885 885
 				}
886 886
 				break;
887 887
 			case 'wbmp' :
888 888
 			case 'bmp' :
889
-				if(function_exists('imagecreatefromwbmp'))
889
+				if (function_exists('imagecreatefromwbmp'))
890 890
 				{
891 891
 					$source = @imagecreatefromwbmp($source_file);
892 892
 				}
893 893
 				break;
894 894
 		}
895 895
 
896
-		if(!$source)
896
+		if (!$source)
897 897
 		{
898 898
 			imagedestroy($thumb);
899 899
 			return FALSE;
@@ -905,13 +905,13 @@  discard block
 block discarded – undo
905 905
 
906 906
 		$x = 0;
907 907
 		$y = 0;
908
-		if($thumbnail_type == 'crop')
908
+		if ($thumbnail_type == 'crop')
909 909
 		{
910 910
 			$x = (int) ($resize_width / 2 - $new_width / 2);
911 911
 			$y = (int) ($resize_height / 2 - $new_height / 2);
912 912
 		}
913 913
 
914
-		if(function_exists('imagecopyresampled'))
914
+		if (function_exists('imagecopyresampled'))
915 915
 		{
916 916
 			imagecopyresampled($thumb, $source, $x, $y, 0, 0, $new_width, $new_height, $width, $height);
917 917
 		}
@@ -925,30 +925,30 @@  discard block
 block discarded – undo
925 925
 
926 926
 		// write into the file
927 927
 		$output = NULL;
928
-		switch($target_type)
928
+		switch ($target_type)
929 929
 		{
930 930
 			case 'gif' :
931
-				if(function_exists('imagegif'))
931
+				if (function_exists('imagegif'))
932 932
 				{
933 933
 					$output = imagegif($thumb, $target_file);
934 934
 				}
935 935
 				break;
936 936
 			case 'jpeg' :
937 937
 			case 'jpg' :
938
-				if(function_exists('imagejpeg'))
938
+				if (function_exists('imagejpeg'))
939 939
 				{
940 940
 					$output = imagejpeg($thumb, $target_file, 100);
941 941
 				}
942 942
 				break;
943 943
 			case 'png' :
944
-				if(function_exists('imagepng'))
944
+				if (function_exists('imagepng'))
945 945
 				{
946 946
 					$output = imagepng($thumb, $target_file, 9);
947 947
 				}
948 948
 				break;
949 949
 			case 'wbmp' :
950 950
 			case 'bmp' :
951
-				if(function_exists('imagewbmp'))
951
+				if (function_exists('imagewbmp'))
952 952
 				{
953 953
 					$output = imagewbmp($thumb, $target_file, 100);
954 954
 				}
@@ -958,7 +958,7 @@  discard block
 block discarded – undo
958 958
 		imagedestroy($thumb);
959 959
 		imagedestroy($source);
960 960
 
961
-		if(!$output)
961
+		if (!$output)
962 962
 		{
963 963
 			return FALSE;
964 964
 		}
@@ -976,12 +976,12 @@  discard block
 block discarded – undo
976 976
 	 */
977 977
 	function readIniFile($filename)
978 978
 	{
979
-		if(($filename = self::exists($filename)) === FALSE)
979
+		if (($filename = self::exists($filename)) === FALSE)
980 980
 		{
981 981
 			return FALSE;
982 982
 		}
983 983
 		$arr = parse_ini_file($filename, TRUE);
984
-		if(is_array($arr) && count($arr) > 0)
984
+		if (is_array($arr) && count($arr) > 0)
985 985
 		{
986 986
 			return $arr;
987 987
 		}
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
 	 */
1008 1008
 	function writeIniFile($filename, $arr)
1009 1009
 	{
1010
-		if(!is_array($arr) || count($arr) == 0)
1010
+		if (!is_array($arr) || count($arr) == 0)
1011 1011
 		{
1012 1012
 			return FALSE;
1013 1013
 		}
@@ -1024,19 +1024,19 @@  discard block
 block discarded – undo
1024 1024
 	function _makeIniBuff($arr)
1025 1025
 	{
1026 1026
 		$return = array();
1027
-		foreach($arr as $key => $val)
1027
+		foreach ($arr as $key => $val)
1028 1028
 		{
1029 1029
 			// section
1030
-			if(is_array($val))
1030
+			if (is_array($val))
1031 1031
 			{
1032 1032
 				$return[] = sprintf("[%s]", $key);
1033
-				foreach($val as $k => $v)
1033
+				foreach ($val as $k => $v)
1034 1034
 				{
1035 1035
 					$return[] = sprintf("%s=\"%s\"", $k, $v);
1036 1036
 				}
1037 1037
 				// value
1038 1038
 			}
1039
-			else if(is_object($val))
1039
+			else if (is_object($val))
1040 1040
 			{
1041 1041
 				continue;
1042 1042
 			}
@@ -1111,15 +1111,15 @@  discard block
 block discarded – undo
1111 1111
 	function isWritableDir($path)
1112 1112
 	{
1113 1113
 		$path = self::getRealPath($path);
1114
-		if(is_dir($path)==FALSE)
1114
+		if (is_dir($path) == FALSE)
1115 1115
 		{
1116 1116
 			return FALSE;
1117 1117
 		}
1118 1118
 
1119
-		$checkFile = $path . '/_CheckWritableDir';
1119
+		$checkFile = $path.'/_CheckWritableDir';
1120 1120
 
1121 1121
 		$fp = fopen($checkFile, 'w');
1122
-		if(!is_resource($fp))
1122
+		if (!is_resource($fp))
1123 1123
 		{
1124 1124
 			return FALSE;
1125 1125
 		}
@@ -1137,7 +1137,7 @@  discard block
 block discarded – undo
1137 1137
 	 **/
1138 1138
 	static public function clearStatCache($target, $include = false)
1139 1139
 	{
1140
-		if(is_array($target))
1140
+		if (is_array($target))
1141 1141
 		{
1142 1142
 			array_map('self::clearStatCache', $target);
1143 1143
 			return;
@@ -1145,7 +1145,7 @@  discard block
 block discarded – undo
1145 1145
 
1146 1146
 		$target = self::getRealPath($target);
1147 1147
 
1148
-		if($include && self::isDir($target))
1148
+		if ($include && self::isDir($target))
1149 1149
 		{
1150 1150
 			self::clearStatCache(self::readDir($target, '', false, true), $include);
1151 1151
 		}
@@ -1163,27 +1163,27 @@  discard block
 block discarded – undo
1163 1163
 	{
1164 1164
 		static $opcache = null;
1165 1165
 
1166
-		if($opcache === null)
1166
+		if ($opcache === null)
1167 1167
 		{
1168 1168
 			$opcache = (function_exists('opcache_get_status') && function_exists('opcache_invalidate'));
1169 1169
 		}
1170 1170
 
1171
-		if($opcache === false)
1171
+		if ($opcache === false)
1172 1172
 		{
1173 1173
 			return;
1174 1174
 		}
1175 1175
 
1176
-		if(is_array($target))
1176
+		if (is_array($target))
1177 1177
 		{
1178 1178
 			array_map('self::invalidateOpcache', $target);
1179 1179
 			return;
1180 1180
 		}
1181 1181
 
1182
-		if(substr($target, -4) === '.php')
1182
+		if (substr($target, -4) === '.php')
1183 1183
 		{
1184 1184
 			opcache_invalidate(self::getRealPath($target), $force);
1185 1185
 		}
1186
-		else if($path = self::isDir($target))
1186
+		else if ($path = self::isDir($target))
1187 1187
 		{
1188 1188
 			self::invalidateOpcache(self::readDir($path, '', false, true));
1189 1189
 		}
Please login to merge, or discard this patch.
Braces   +32 added lines, -49 removed lines patch added patch discarded remove patch
@@ -74,14 +74,12 @@  discard block
 block discarded – undo
74 74
 			if(is_dir($source_dir . $file))
75 75
 			{
76 76
 				self::copyDir($source_dir . $file, $target_dir . $file, $type);
77
-			}
78
-			else
77
+			} else
79 78
 			{
80 79
 				if($type == 'force')
81 80
 				{
82 81
 					@unlink($target_dir . $file);
83
-				}
84
-				else
82
+				} else
85 83
 				{
86 84
 					if(!file_exists($target_dir . $file))
87 85
 					{
@@ -381,15 +379,13 @@  discard block
 block discarded – undo
381 379
 				if(is_dir($target))
382 380
 				{
383 381
 					self::removeDir($target);
384
-				}
385
-				else
382
+				} else
386 383
 				{
387 384
 					unlink($target);
388 385
 				}
389 386
 			}
390 387
 			rmdir($path);
391
-		}
392
-		else
388
+		} else
393 389
 		{
394 390
 			unlink($path);
395 391
 		}
@@ -456,16 +452,16 @@  discard block
 block discarded – undo
456 452
 				if(is_dir($target))
457 453
 				{
458 454
 					self::removeFilesInDir($target);
459
-				}
460
-				else
455
+				} else
461 456
 				{
462 457
 					unlink($target);
463 458
 				}
464 459
 			}
465
-		}
466
-		else
460
+		} else
467 461
 		{
468
-			if(self::exists($path)) unlink($path);
462
+			if(self::exists($path)) {
463
+				unlink($path);
464
+			}
469 465
 		}
470 466
 
471 467
 	}
@@ -535,8 +531,7 @@  discard block
 block discarded – undo
535 531
 				$oRequest = new HTTP_Request(__PROXY_SERVER__);
536 532
 				$oRequest->setMethod('POST');
537 533
 				$oRequest->addPostData('arg', serialize(array('Destination' => $url, 'method' => $method, 'body' => $body, 'content_type' => $content_type, "headers" => $headers, "post_data" => $post_data)));
538
-			}
539
-			else
534
+			} else
540 535
 			{
541 536
 				$oRequest = new HTTP_Request($url);
542 537
 
@@ -560,8 +555,7 @@  discard block
 block discarded – undo
560 555
 							{
561 556
 								$oRequest->attach($observer);
562 557
 							}
563
-						}
564
-						else
558
+						} else
565 559
 						{
566 560
 							$oRequest->setConfig($key, $val);
567 561
 						}
@@ -572,8 +566,7 @@  discard block
 block discarded – undo
572 566
 					if(extension_loaded('curl'))
573 567
 					{
574 568
 						$oRequest->setConfig('adapter', 'curl');
575
-					}
576
-					elseif(version_compare(PHP_VERSION, '5.6', '<'))
569
+					} elseif(version_compare(PHP_VERSION, '5.6', '<'))
577 570
 					{
578 571
 						$oRequest->setConfig('ssl_verify_host', false);
579 572
 					}
@@ -605,20 +598,21 @@  discard block
 block discarded – undo
605 598
 						$oRequest->addPostData($key, $val);
606 599
 					}
607 600
 				}
608
-				if(!$content_type)
609
-					$oRequest->addHeader('Content-Type', 'text/html');
610
-				else
611
-					$oRequest->addHeader('Content-Type', $content_type);
601
+				if(!$content_type) {
602
+									$oRequest->addHeader('Content-Type', 'text/html');
603
+				} else {
604
+									$oRequest->addHeader('Content-Type', $content_type);
605
+				}
612 606
 				$oRequest->setMethod($method);
613
-				if($body)
614
-					$oRequest->setBody($body);
607
+				if($body) {
608
+									$oRequest->setBody($body);
609
+				}
615 610
 			}
616 611
 			
617 612
 			if(method_exists($oRequest, 'setConfig'))
618 613
 			{
619 614
 				$oRequest->setConfig('timeout', $timeout);
620
-			}
621
-			elseif(property_exists($oRequest, '_timeout'))
615
+			} elseif(property_exists($oRequest, '_timeout'))
622 616
 			{
623 617
 				$oRequest->_timeout = $timeout;
624 618
 			}
@@ -649,13 +643,11 @@  discard block
 block discarded – undo
649 643
 			if(isset($request_config['store_body']) && !$request_config['store_body'])
650 644
 			{
651 645
 				return TRUE;
652
-			}
653
-			else
646
+			} else
654 647
 			{
655 648
 				return $response;
656 649
 			}
657
-		}
658
-		catch(Exception $e)
650
+		} catch(Exception $e)
659 651
 		{
660 652
 			return NULL;
661 653
 		}
@@ -688,8 +680,7 @@  discard block
 block discarded – undo
688 680
 			$result = self::getRemoteResource($url, $body, $timeout, $method, $content_type, $headers, $cookies, $post_data, $request_config);
689 681
 			self::clearStatCache($target_filename);
690 682
 			self::invalidateOpcache($target_filename);
691
-		}
692
-		catch(Exception $e)
683
+		} catch(Exception $e)
693 684
 		{
694 685
 			return FALSE;
695 686
 		}
@@ -820,8 +811,7 @@  discard block
 block discarded – undo
820 811
 			$per = ($width_per > $height_per) ? $height_per : $width_per;
821 812
 			$resize_width = $width * $per;
822 813
 			$resize_height = $height * $per;
823
-		}
824
-		else
814
+		} else
825 815
 		{
826 816
 			$per = ($width_per < $height_per) ? $height_per : $width_per;
827 817
 		}
@@ -831,8 +821,7 @@  discard block
 block discarded – undo
831 821
 		if(function_exists('imagecreateTRUEcolor'))
832 822
 		{
833 823
 			$thumb = imagecreateTRUEcolor($resize_width, $resize_height);
834
-		}
835
-		else if(function_exists('imagecreate'))
824
+		} else if(function_exists('imagecreate'))
836 825
 		{
837 826
 			$thumb = imagecreate($resize_width, $resize_height);
838 827
 		}
@@ -855,8 +844,7 @@  discard block
 block discarded – undo
855 844
 			{
856 845
 				imagealphablending($thumb, TRUE);
857 846
 			}
858
-		}
859
-		else
847
+		} else
860 848
 		{
861 849
 			imagefilledrectangle($thumb, 0, 0, $resize_width - 1, $resize_height - 1, imagecolorallocate($thumb, 255, 255, 255));
862 850
 		}
@@ -914,8 +902,7 @@  discard block
 block discarded – undo
914 902
 		if(function_exists('imagecopyresampled'))
915 903
 		{
916 904
 			imagecopyresampled($thumb, $source, $x, $y, 0, 0, $new_width, $new_height, $width, $height);
917
-		}
918
-		else
905
+		} else
919 906
 		{
920 907
 			imagecopyresized($thumb, $source, $x, $y, 0, 0, $new_width, $new_height, $width, $height);
921 908
 		}
@@ -984,8 +971,7 @@  discard block
 block discarded – undo
984 971
 		if(is_array($arr) && count($arr) > 0)
985 972
 		{
986 973
 			return $arr;
987
-		}
988
-		else
974
+		} else
989 975
 		{
990 976
 			return array();
991 977
 		}
@@ -1035,12 +1021,10 @@  discard block
 block discarded – undo
1035 1021
 					$return[] = sprintf("%s=\"%s\"", $k, $v);
1036 1022
 				}
1037 1023
 				// value
1038
-			}
1039
-			else if(is_object($val))
1024
+			} else if(is_object($val))
1040 1025
 			{
1041 1026
 				continue;
1042
-			}
1043
-			else
1027
+			} else
1044 1028
 			{
1045 1029
 				$return[] = sprintf("%s=\"%s\"", $key, $val);
1046 1030
 			}
@@ -1182,8 +1166,7 @@  discard block
 block discarded – undo
1182 1166
 		if(substr($target, -4) === '.php')
1183 1167
 		{
1184 1168
 			opcache_invalidate(self::getRealPath($target), $force);
1185
-		}
1186
-		else if($path = self::isDir($target))
1169
+		} else if($path = self::isDir($target))
1187 1170
 		{
1188 1171
 			self::invalidateOpcache(self::readDir($path, '', false, true));
1189 1172
 		}
Please login to merge, or discard this patch.
modules/member/member.controller.php 2 patches
Spacing   +463 added lines, -463 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);
@@ -766,20 +766,20 @@  discard block
 block discarded – undo
766 766
 		$max_width = $config->profile_image_max_width;
767 767
 		$max_height = $config->profile_image_max_height;
768 768
 		$max_filesize = $config->profile_image_max_filesize;
769
-		foreach($config->signupForm as $val)
769
+		foreach ($config->signupForm as $val)
770 770
 		{
771
-			if($val->name == "profile_image")
771
+			if ($val->name == "profile_image")
772 772
 				$allow_transparent = $val->allow_transparent_thumbnail == 'Y';
773 773
 		}
774 774
 
775
-		Context::loadLang(_XE_PATH_ . 'modules/file/lang');
775
+		Context::loadLang(_XE_PATH_.'modules/file/lang');
776 776
 
777 777
 		// Get file information
778 778
 		FileHandler::clearStatCache($target_file);
779 779
 		list($width, $height, $type) = @getimagesize($target_file);
780
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
781
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
782
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
780
+		if (IMAGETYPE_PNG == $type) $ext = 'png';
781
+		elseif (IMAGETYPE_JPEG == $type) $ext = 'jpg';
782
+		elseif (IMAGETYPE_GIF == $type) $ext = 'gif';
783 783
 		else
784 784
 		{
785 785
 			return $this->stop('msg_not_uploaded_profile_image');
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 		$target_filename = sprintf('%s%d.%s', $target_path, $member_srl, $ext);
792 792
 
793 793
 		// Convert if the image size is larger than a given size or if the format is not a gif
794
-		if(($width > $max_width || $height > $max_height ) && $type != 1)
794
+		if (($width > $max_width || $height > $max_height) && $type != 1)
795 795
 		{
796 796
 			$temp_filename = sprintf('files/cache/tmp/profile_image_%d.%s', $member_srl, $ext);
797 797
 			FileHandler::createImageFile($target_file, $temp_filename, $max_width, $max_height, $ext, 'crop', $allow_transparent);
@@ -799,10 +799,10 @@  discard block
 block discarded – undo
799 799
 			// 파일 용량 제한
800 800
 			FileHandler::clearStatCache($temp_filename);
801 801
 			$filesize = filesize($temp_filename);
802
-			if($max_filesize && $filesize > ($max_filesize * 1024))
802
+			if ($max_filesize && $filesize > ($max_filesize * 1024))
803 803
 			{
804 804
 				FileHandler::removeFile($temp_filename);
805
-				return $this->stop(implode(' ' , array(
805
+				return $this->stop(implode(' ', array(
806 806
 					Context::getLang('msg_not_uploaded_profile_image'),
807 807
 					Context::getLang('msg_exceeds_limit_size')
808 808
 				)));
@@ -816,9 +816,9 @@  discard block
 block discarded – undo
816 816
 		{
817 817
 			// 파일 용량 제한
818 818
 			$filesize = filesize($target_file);
819
-			if($max_filesize && $filesize > ($max_filesize * 1024))
819
+			if ($max_filesize && $filesize > ($max_filesize * 1024))
820 820
 			{
821
-				return $this->stop(implode(' ' , array(
821
+				return $this->stop(implode(' ', array(
822 822
 					Context::getLang('msg_not_uploaded_profile_image'),
823 823
 					Context::getLang('msg_exceeds_limit_size')
824 824
 				)));
@@ -841,20 +841,20 @@  discard block
 block discarded – undo
841 841
 	{
842 842
 		// Check if the file is successfully uploaded
843 843
 		$file = $_FILES['image_name'];
844
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
844
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
845 845
 		// Ignore if member_srl is invalid or doesn't exist.
846 846
 		$member_srl = Context::get('member_srl');
847
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
847
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_name');
848 848
 
849 849
 		$logged_info = Context::get('logged_info');
850
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
850
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
851 851
 		// Return if member module is set not to use an image name or the user is not an administrator ;
852 852
 		$oMemberModel = getModel('member');
853 853
 		$config = $oMemberModel->getMemberConfig();
854
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
854
+		if ($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
855 855
 
856 856
 		$output = $this->insertImageName($member_srl, $file['tmp_name']);
857
-		if(!$output->toBool()) return $output;
857
+		if (!$output->toBool()) return $output;
858 858
 
859 859
 		// Page refresh
860 860
 		//$this->setRefreshPage();
@@ -879,7 +879,7 @@  discard block
 block discarded – undo
879 879
 		$max_height = $config->image_name_max_height;
880 880
 		$max_filesize = $config->image_name_max_filesize;
881 881
 
882
-		Context::loadLang(_XE_PATH_ . 'modules/file/lang');
882
+		Context::loadLang(_XE_PATH_.'modules/file/lang');
883 883
 
884 884
 		// Get a target path to save
885 885
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
@@ -889,7 +889,7 @@  discard block
 block discarded – undo
889 889
 		// Get file information
890 890
 		list($width, $height, $type) = @getimagesize($target_file);
891 891
 		// Convert if the image size is larger than a given size or if the format is not a gif
892
-		if($width > $max_width || $height > $max_height || $type!=1)
892
+		if ($width > $max_width || $height > $max_height || $type != 1)
893 893
 		{
894 894
 			$temp_filename = sprintf('files/cache/tmp/image_name_%d.gif', $member_srl, $ext);
895 895
 			FileHandler::createImageFile($target_file, $temp_filename, $max_width, $max_height, 'gif');
@@ -897,10 +897,10 @@  discard block
 block discarded – undo
897 897
 			// 파일 용량 제한
898 898
 			FileHandler::clearStatCache($temp_filename);
899 899
 			$filesize = filesize($temp_filename);
900
-			if($max_filesize && $filesize > ($max_filesize * 1024))
900
+			if ($max_filesize && $filesize > ($max_filesize * 1024))
901 901
 			{
902 902
 				FileHandler::removeFile($temp_filename);
903
-				return $this->stop(implode(' ' , array(
903
+				return $this->stop(implode(' ', array(
904 904
 					Context::getLang('msg_not_uploaded_image_name'),
905 905
 					Context::getLang('msg_exceeds_limit_size')
906 906
 				)));
@@ -914,9 +914,9 @@  discard block
 block discarded – undo
914 914
 		{
915 915
 			// 파일 용량 제한
916 916
 			$filesize = filesize($target_file);
917
-			if($max_filesize && $filesize > ($max_filesize * 1024))
917
+			if ($max_filesize && $filesize > ($max_filesize * 1024))
918 918
 			{
919
-				return $this->stop(implode(' ' , array(
919
+				return $this->stop(implode(' ', array(
920 920
 					Context::getLang('msg_not_uploaded_image_name'),
921 921
 					Context::getLang('msg_exceeds_limit_size')
922 922
 				)));
@@ -938,20 +938,20 @@  discard block
 block discarded – undo
938 938
 	function procMemberDeleteProfileImage($_memberSrl = 0)
939 939
 	{
940 940
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
941
-		if(!$member_srl)
941
+		if (!$member_srl)
942 942
 		{
943
-			return new BaseObject(0,'success');
943
+			return new BaseObject(0, 'success');
944 944
 		}
945 945
 
946 946
 		$logged_info = Context::get('logged_info');
947 947
 
948
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
948
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
949 949
 		{
950 950
 			$oMemberModel = getModel('member');
951 951
 			$profile_image = $oMemberModel->getProfileImage($member_srl);
952 952
 			FileHandler::removeFile($profile_image->file);
953 953
 		}
954
-		return new BaseObject(0,'success');
954
+		return new BaseObject(0, 'success');
955 955
 	}
956 956
 
957 957
 	/**
@@ -962,20 +962,20 @@  discard block
 block discarded – undo
962 962
 	function procMemberDeleteImageName($_memberSrl = 0)
963 963
 	{
964 964
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
965
-		if(!$member_srl)
965
+		if (!$member_srl)
966 966
 		{
967
-			return new BaseObject(0,'success');
967
+			return new BaseObject(0, 'success');
968 968
 		}
969 969
 
970 970
 		$logged_info = Context::get('logged_info');
971 971
 
972
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
972
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
973 973
 		{
974 974
 			$oMemberModel = getModel('member');
975 975
 			$image_name = $oMemberModel->getImageName($member_srl);
976 976
 			FileHandler::removeFile($image_name->file);
977 977
 		}
978
-		return new BaseObject(0,'success');
978
+		return new BaseObject(0, 'success');
979 979
 	}
980 980
 
981 981
 	/**
@@ -987,20 +987,20 @@  discard block
 block discarded – undo
987 987
 	{
988 988
 		// Check if the file is successfully uploaded
989 989
 		$file = $_FILES['image_mark'];
990
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
990
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
991 991
 		// Ignore if member_srl is invalid or doesn't exist.
992 992
 		$member_srl = Context::get('member_srl');
993
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
993
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
994 994
 
995 995
 		$logged_info = Context::get('logged_info');
996
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
996
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
997 997
 		// Membership in the images mark the module using the ban was set by an administrator or return;
998 998
 		$oMemberModel = getModel('member');
999 999
 		$config = $oMemberModel->getMemberConfig();
1000
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
1000
+		if ($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
1001 1001
 
1002 1002
 		$this->insertImageMark($member_srl, $file['tmp_name']);
1003
-		if(!$output->toBool()) return $output;
1003
+		if (!$output->toBool()) return $output;
1004 1004
 
1005 1005
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
1006 1006
 		$this->setRedirectUrl($returnUrl);
@@ -1022,7 +1022,7 @@  discard block
 block discarded – undo
1022 1022
 		$max_height = $config->image_mark_max_height;
1023 1023
 		$max_filesize = $config->image_mark_max_filesize;
1024 1024
 
1025
-		Context::loadLang(_XE_PATH_ . 'modules/file/lang');
1025
+		Context::loadLang(_XE_PATH_.'modules/file/lang');
1026 1026
 
1027 1027
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
1028 1028
 		FileHandler::makeDir($target_path);
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
 		// Get file information
1032 1032
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
1033 1033
 
1034
-		if($width > $max_width || $height > $max_height || $type!=1)
1034
+		if ($width > $max_width || $height > $max_height || $type != 1)
1035 1035
 		{
1036 1036
 			$temp_filename = sprintf('files/cache/tmp/image_mark_%d.gif', $member_srl);
1037 1037
 			FileHandler::createImageFile($target_file, $temp_filename, $max_width, $max_height, 'gif');
@@ -1039,10 +1039,10 @@  discard block
 block discarded – undo
1039 1039
 			// 파일 용량 제한
1040 1040
 			FileHandler::clearStatCache($temp_filename);
1041 1041
 			$filesize = filesize($temp_filename);
1042
-			if($max_filesize && $filesize > ($max_filesize * 1024))
1042
+			if ($max_filesize && $filesize > ($max_filesize * 1024))
1043 1043
 			{
1044 1044
 				FileHandler::removeFile($temp_filename);
1045
-				return $this->stop(implode(' ' , array(
1045
+				return $this->stop(implode(' ', array(
1046 1046
 					Context::getLang('msg_not_uploaded_group_image_mark'),
1047 1047
 					Context::getLang('msg_exceeds_limit_size')
1048 1048
 				)));
@@ -1055,10 +1055,10 @@  discard block
 block discarded – undo
1055 1055
 		else
1056 1056
 		{
1057 1057
 			$filesize = filesize($target_file);
1058
-			if($max_filesize && $filesize > ($max_filesize * 1024))
1058
+			if ($max_filesize && $filesize > ($max_filesize * 1024))
1059 1059
 			{
1060 1060
 				FileHandler::removeFile($target_file);
1061
-				return $this->stop(implode(' ' , array(
1061
+				return $this->stop(implode(' ', array(
1062 1062
 					Context::getLang('msg_not_uploaded_group_image_mark'),
1063 1063
 					Context::getLang('msg_exceeds_limit_size')
1064 1064
 				)));
@@ -1080,20 +1080,20 @@  discard block
 block discarded – undo
1080 1080
 	function procMemberDeleteImageMark($_memberSrl = 0)
1081 1081
 	{
1082 1082
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
1083
-		if(!$member_srl)
1083
+		if (!$member_srl)
1084 1084
 		{
1085
-			return new BaseObject(0,'success');
1085
+			return new BaseObject(0, 'success');
1086 1086
 		}
1087 1087
 
1088 1088
 		$logged_info = Context::get('logged_info');
1089 1089
 
1090
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
1090
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
1091 1091
 		{
1092 1092
 			$oMemberModel = getModel('member');
1093 1093
 			$image_mark = $oMemberModel->getImageMark($member_srl);
1094 1094
 			FileHandler::removeFile($image_mark->file);
1095 1095
 		}
1096
-		return new BaseObject(0,'success');
1096
+		return new BaseObject(0, 'success');
1097 1097
 	}
1098 1098
 
1099 1099
 	/**
@@ -1104,26 +1104,26 @@  discard block
 block discarded – undo
1104 1104
 	function procMemberFindAccount()
1105 1105
 	{
1106 1106
 		$email_address = Context::get('email_address');
1107
-		if(!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1107
+		if (!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1108 1108
 
1109 1109
 		$oMemberModel = getModel('member');
1110 1110
 		$oModuleModel = getModel('module');
1111 1111
 
1112 1112
 		// Check if a member having the same email address exists
1113 1113
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1114
-		if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1114
+		if (!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1115 1115
 
1116 1116
 		// Get information of the member
1117 1117
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
1118 1118
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1119 1119
 
1120 1120
 		// Check if possible to find member's ID and password
1121
-		if($member_info->denied == 'Y')
1121
+		if ($member_info->denied == 'Y')
1122 1122
 		{
1123 1123
 			$chk_args = new stdClass;
1124 1124
 			$chk_args->member_srl = $member_info->member_srl;
1125 1125
 			$output = executeQuery('member.chkAuthMail', $chk_args);
1126
-			if($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed');
1126
+			if ($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed');
1127 1127
 		}
1128 1128
 
1129 1129
 		// Insert data into the authentication DB
@@ -1136,19 +1136,19 @@  discard block
 block discarded – undo
1136 1136
 		$args->is_register = 'N';
1137 1137
 
1138 1138
 		$output = executeQuery('member.insertAuthMail', $args);
1139
-		if(!$output->toBool()) return $output;
1139
+		if (!$output->toBool()) return $output;
1140 1140
 		// Get content of the email to send a member
1141 1141
 		Context::set('auth_args', $args);
1142 1142
 
1143 1143
 		$member_config = $oModuleModel->getModuleConfig('member');
1144 1144
 		$memberInfo = array();
1145 1145
 		global $lang;
1146
-		if(is_array($member_config->signupForm))
1146
+		if (is_array($member_config->signupForm))
1147 1147
 		{
1148
-			$exceptForm=array('password', 'find_account_question');
1149
-			foreach($member_config->signupForm as $form)
1148
+			$exceptForm = array('password', 'find_account_question');
1149
+			foreach ($member_config->signupForm as $form)
1150 1150
 			{
1151
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1151
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1152 1152
 				{
1153 1153
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1154 1154
 				}
@@ -1163,15 +1163,15 @@  discard block
 block discarded – undo
1163 1163
 		}
1164 1164
 		Context::set('memberInfo', $memberInfo);
1165 1165
 
1166
-		if(!$member_config->skin) $member_config->skin = "default";
1167
-		if(!$member_config->colorset) $member_config->colorset = "white";
1166
+		if (!$member_config->skin) $member_config->skin = "default";
1167
+		if (!$member_config->colorset) $member_config->colorset = "white";
1168 1168
 
1169 1169
 		Context::set('member_config', $member_config);
1170 1170
 
1171 1171
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1172
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1172
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1173 1173
 
1174
-		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1174
+		$find_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1175 1175
 		Context::set('find_url', $find_url);
1176 1176
 
1177 1177
 		$oTemplate = &TemplateHandler::getInstance();
@@ -1181,19 +1181,19 @@  discard block
 block discarded – undo
1181 1181
 		$member_config = $oModuleModel->getModuleConfig('member');
1182 1182
 		// Send a mail
1183 1183
 		$oMail = new Mail();
1184
-		$oMail->setTitle( Context::getLang('msg_find_account_title') );
1184
+		$oMail->setTitle(Context::getLang('msg_find_account_title'));
1185 1185
 		$oMail->setContent($content);
1186
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1187
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1186
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1187
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1188 1188
 		$oMail->send();
1189 1189
 		// Return message
1190 1190
 		$msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address);
1191
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
1191
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
1192 1192
 		{
1193 1193
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberFindAccount');
1194 1194
 			$this->setRedirectUrl($returnUrl);
1195 1195
 		}
1196
-		return new BaseObject(0,$msg);
1196
+		return new BaseObject(0, $msg);
1197 1197
 	}
1198 1198
 
1199 1199
 	/**
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
 	function procMemberFindAccountByQuestion()
1205 1205
 	{
1206 1206
 		$oMemberModel = getModel('member');
1207
-		$oPassword =  new Password();
1207
+		$oPassword = new Password();
1208 1208
 		$config = $oMemberModel->getMemberConfig();
1209 1209
 
1210 1210
 		$email_address = Context::get('email_address');
@@ -1212,49 +1212,49 @@  discard block
 block discarded – undo
1212 1212
 		$find_account_question = trim(Context::get('find_account_question'));
1213 1213
 		$find_account_answer = trim(Context::get('find_account_answer'));
1214 1214
 
1215
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request');
1215
+		if (($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request');
1216 1216
 
1217 1217
 		$oModuleModel = getModel('module');
1218 1218
 		// Check if a member having the same email address exists
1219 1219
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1220
-		if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1220
+		if (!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1221 1221
 
1222 1222
 		// Get information of the member
1223 1223
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1224 1224
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1225 1225
 
1226 1226
 		// Display a message if no answer is entered
1227
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists');
1227
+		if (!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists');
1228 1228
 
1229 1229
 		// 답변 확인
1230 1230
 		$hashed = $oPassword->checkAlgorithm($member_info->find_account_answer);
1231 1231
 		$authed = true;
1232 1232
 		$member_info->find_account_question = trim($member_info->find_account_question);
1233
-		if($member_info->find_account_question != $find_account_question)
1233
+		if ($member_info->find_account_question != $find_account_question)
1234 1234
 		{
1235 1235
 			$authed = false;
1236 1236
 		}
1237
-		else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1237
+		else if ($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1238 1238
 		{
1239 1239
 			$authed = false;
1240 1240
 		}
1241
-		else if(!$hashed && $find_account_answer != $member_info->find_account_answer)
1241
+		else if (!$hashed && $find_account_answer != $member_info->find_account_answer)
1242 1242
 		{
1243 1243
 			$authed = false;
1244 1244
 		}
1245 1245
 
1246
-		if(!$authed)
1246
+		if (!$authed)
1247 1247
 		{
1248 1248
 			return new BaseObject(-1, 'msg_answer_not_matches');
1249 1249
 		}
1250 1250
 
1251 1251
 		// answer가 동일하고 hash 되지 않았으면 hash 값으로 저장
1252
-		if($authed && !$hashed)
1252
+		if ($authed && !$hashed)
1253 1253
 		{
1254 1254
 			$this->updateFindAccountAnswer($member_srl, $find_account_answer);
1255 1255
 		}
1256 1256
 
1257
-		if($config->identifier == 'email_address')
1257
+		if ($config->identifier == 'email_address')
1258 1258
 		{
1259 1259
 			$user_id = $email_address;
1260 1260
 		}
@@ -1267,11 +1267,11 @@  discard block
 block discarded – undo
1267 1267
 		$args->password = $temp_password;
1268 1268
 		$args->change_password_date = '1';
1269 1269
 		$output = $this->updateMemberPassword($args);
1270
-		if(!$output->toBool()) return $output;
1270
+		if (!$output->toBool()) return $output;
1271 1271
 
1272
-		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1272
+		$_SESSION['xe_temp_password_'.$user_id] = $temp_password;
1273 1273
 
1274
-		$this->add('user_id',$user_id);
1274
+		$this->add('user_id', $user_id);
1275 1275
 
1276 1276
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
1277 1277
 		$this->setRedirectUrl($returnUrl.'&user_id='.$user_id);
@@ -1291,7 +1291,7 @@  discard block
 block discarded – undo
1291 1291
 		$member_srl = Context::get('member_srl');
1292 1292
 		$auth_key = Context::get('auth_key');
1293 1293
 
1294
-		if(!$member_srl || !$auth_key)
1294
+		if (!$member_srl || !$auth_key)
1295 1295
 		{
1296 1296
 			return $this->stop('msg_invalid_request');
1297 1297
 		}
@@ -1302,9 +1302,9 @@  discard block
 block discarded – undo
1302 1302
 		$args->auth_key = $auth_key;
1303 1303
 		$output = executeQuery('member.getAuthMail', $args);
1304 1304
 
1305
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
1305
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
1306 1306
 		{
1307
-			if(strlen($output->data->auth_key) !== strlen($auth_key))
1307
+			if (strlen($output->data->auth_key) !== strlen($auth_key))
1308 1308
 			{
1309 1309
 				executeQuery('member.deleteAuthMail', $args);
1310 1310
 			}
@@ -1312,7 +1312,7 @@  discard block
 block discarded – undo
1312 1312
 			return $this->stop('msg_invalid_auth_key');
1313 1313
 		}
1314 1314
 
1315
-		if(ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1315
+		if (ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1316 1316
 		{
1317 1317
 			executeQuery('member.deleteAuthMail', $args);
1318 1318
 			return $this->stop('msg_invalid_auth_key');
@@ -1321,7 +1321,7 @@  discard block
 block discarded – undo
1321 1321
 		$args->password = $output->data->new_password;
1322 1322
 
1323 1323
 		// If credentials are correct, change the password to a new one
1324
-		if($output->data->is_register == 'Y')
1324
+		if ($output->data->is_register == 'Y')
1325 1325
 		{
1326 1326
 			$args->denied = 'N';
1327 1327
 		}
@@ -1334,13 +1334,13 @@  discard block
 block discarded – undo
1334 1334
 		$is_register = $output->data->is_register;
1335 1335
 
1336 1336
 		$output = executeQuery('member.updateMemberPassword', $args);
1337
-		if(!$output->toBool())
1337
+		if (!$output->toBool())
1338 1338
 		{
1339 1339
 			return $this->stop($output->getMessage());
1340 1340
 		}
1341 1341
 
1342 1342
 		// Remove all values having the member_srl from authentication table
1343
-		executeQuery('member.deleteAuthMail',$args);
1343
+		executeQuery('member.deleteAuthMail', $args);
1344 1344
 
1345 1345
 		$this->_clearMemberCache($args->member_srl);
1346 1346
 
@@ -1359,33 +1359,33 @@  discard block
 block discarded – undo
1359 1359
 	{
1360 1360
 		// Get an email_address
1361 1361
 		$email_address = Context::get('email_address');
1362
-		if(!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1362
+		if (!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1363 1363
 		// Log test by using email_address
1364 1364
 		$oMemberModel = getModel('member');
1365 1365
 
1366 1366
 		$args = new stdClass;
1367 1367
 		$args->email_address = $email_address;
1368 1368
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1369
-		if(!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member');
1369
+		if (!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member');
1370 1370
 
1371 1371
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1372 1372
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1373 1373
 
1374 1374
 		$oModuleModel = getModel('module');
1375 1375
 		$member_config = $oModuleModel->getModuleConfig('member');
1376
-		if(!$member_config->skin) $member_config->skin = "default";
1377
-		if(!$member_config->colorset) $member_config->colorset = "white";
1376
+		if (!$member_config->skin) $member_config->skin = "default";
1377
+		if (!$member_config->colorset) $member_config->colorset = "white";
1378 1378
 
1379 1379
 		// Check if a authentication mail has been sent previously
1380 1380
 		$chk_args = new stdClass;
1381 1381
 		$chk_args->member_srl = $member_info->member_srl;
1382 1382
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1383
-		if($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request');
1383
+		if ($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request');
1384 1384
 
1385 1385
 		$auth_args = new stdClass;
1386 1386
 		$auth_args->member_srl = $member_info->member_srl;
1387 1387
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1388
-		if(!$output->data || !$output->data[0]->auth_key)  return new BaseObject(-1, 'msg_invalid_request');
1388
+		if (!$output->data || !$output->data[0]->auth_key)  return new BaseObject(-1, 'msg_invalid_request');
1389 1389
 		$auth_info = $output->data[0];
1390 1390
 
1391 1391
 		// Update the regdate of authmail entry
@@ -1396,12 +1396,12 @@  discard block
 block discarded – undo
1396 1396
 
1397 1397
 		$memberInfo = array();
1398 1398
 		global $lang;
1399
-		if(is_array($member_config->signupForm))
1399
+		if (is_array($member_config->signupForm))
1400 1400
 		{
1401
-			$exceptForm=array('password', 'find_account_question');
1402
-			foreach($member_config->signupForm as $form)
1401
+			$exceptForm = array('password', 'find_account_question');
1402
+			foreach ($member_config->signupForm as $form)
1403 1403
 			{
1404
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1404
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1405 1405
 				{
1406 1406
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1407 1407
 				}
@@ -1420,19 +1420,19 @@  discard block
 block discarded – undo
1420 1420
 		Context::set('member_config', $member_config);
1421 1421
 
1422 1422
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1423
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1423
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1424 1424
 
1425
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1425
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_info->auth_key);
1426 1426
 		Context::set('auth_url', $auth_url);
1427 1427
 
1428 1428
 		$oTemplate = &TemplateHandler::getInstance();
1429 1429
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1430 1430
 		// Send a mail
1431 1431
 		$oMail = new Mail();
1432
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1432
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1433 1433
 		$oMail->setContent($content);
1434
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1435
-		$oMail->setReceiptor( $args->user_name, $args->email_address );
1434
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1435
+		$oMail->setReceiptor($args->user_name, $args->email_address);
1436 1436
 		$oMail->send();
1437 1437
 
1438 1438
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
@@ -1447,23 +1447,23 @@  discard block
 block discarded – undo
1447 1447
 		$memberInfo = $_SESSION['auth_member_info'];
1448 1448
 		unset($_SESSION['auth_member_info']);
1449 1449
 
1450
-		if(!$memberInfo)
1450
+		if (!$memberInfo)
1451 1451
 		{
1452 1452
 			return $this->stop('msg_invalid_request');
1453 1453
 		}
1454 1454
 
1455 1455
 		$newEmail = Context::get('email_address');
1456 1456
 
1457
-		if(!$newEmail)
1457
+		if (!$newEmail)
1458 1458
 		{
1459 1459
 			return $this->stop('msg_invalid_request');
1460 1460
 		}
1461 1461
 
1462 1462
 		$oMemberModel = getModel('member');
1463 1463
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
1464
-		if($member_srl)
1464
+		if ($member_srl)
1465 1465
 		{
1466
-			return new BaseObject(-1,'msg_exists_email_address');
1466
+			return new BaseObject(-1, 'msg_exists_email_address');
1467 1467
 		}
1468 1468
 
1469 1469
 		// remove all key by member_srl
@@ -1471,7 +1471,7 @@  discard block
 block discarded – undo
1471 1471
 		$args->member_srl = $memberInfo->member_srl;
1472 1472
 		$output = executeQuery('member.deleteAuthMail', $args);
1473 1473
 
1474
-		if(!$output->toBool())
1474
+		if (!$output->toBool())
1475 1475
 		{
1476 1476
 			return $output;
1477 1477
 		}
@@ -1481,7 +1481,7 @@  discard block
 block discarded – undo
1481 1481
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
1482 1482
 
1483 1483
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
1484
-		if(!$output->toBool())
1484
+		if (!$output->toBool())
1485 1485
 		{
1486 1486
 			return $this->stop($output->getMessage());
1487 1487
 		}
@@ -1498,7 +1498,7 @@  discard block
 block discarded – undo
1498 1498
 		$auth_args->is_register = 'Y';
1499 1499
 
1500 1500
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1501
-		if(!$output->toBool()) return $output;
1501
+		if (!$output->toBool()) return $output;
1502 1502
 
1503 1503
 		$memberInfo->email_address = $newEmail;
1504 1504
 
@@ -1522,12 +1522,12 @@  discard block
 block discarded – undo
1522 1522
 		$memberInfo = array();
1523 1523
 
1524 1524
 		global $lang;
1525
-		if(is_array($member_config->signupForm))
1525
+		if (is_array($member_config->signupForm))
1526 1526
 		{
1527
-			$exceptForm=array('password', 'find_account_question');
1528
-			foreach($member_config->signupForm as $form)
1527
+			$exceptForm = array('password', 'find_account_question');
1528
+			foreach ($member_config->signupForm as $form)
1529 1529
 			{
1530
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1530
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1531 1531
 				{
1532 1532
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1533 1533
 				}
@@ -1542,25 +1542,25 @@  discard block
 block discarded – undo
1542 1542
 		}
1543 1543
 		Context::set('memberInfo', $memberInfo);
1544 1544
 
1545
-		if(!$member_config->skin) $member_config->skin = "default";
1546
-		if(!$member_config->colorset) $member_config->colorset = "white";
1545
+		if (!$member_config->skin) $member_config->skin = "default";
1546
+		if (!$member_config->colorset) $member_config->colorset = "white";
1547 1547
 
1548 1548
 		Context::set('member_config', $member_config);
1549 1549
 
1550 1550
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1551
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1551
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1552 1552
 
1553
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1553
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
1554 1554
 		Context::set('auth_url', $auth_url);
1555 1555
 
1556 1556
 		$oTemplate = &TemplateHandler::getInstance();
1557 1557
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1558 1558
 		// Send a mail
1559 1559
 		$oMail = new Mail();
1560
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1560
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1561 1561
 		$oMail->setContent($content);
1562
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1563
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1562
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1563
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1564 1564
 		$oMail->send();
1565 1565
 	}
1566 1566
 
@@ -1573,7 +1573,7 @@  discard block
 block discarded – undo
1573 1573
 	{
1574 1574
 		$site_module_info = Context::get('site_module_info');
1575 1575
 		$logged_info = Context::get('logged_info');
1576
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request');
1576
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new BaseObject(-1, 'msg_invalid_request');
1577 1577
 
1578 1578
 		$oMemberModel = getModel('member');
1579 1579
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1592,13 +1592,13 @@  discard block
 block discarded – undo
1592 1592
 	{
1593 1593
 		$site_module_info = Context::get('site_module_info');
1594 1594
 		$logged_info = Context::get('logged_info');
1595
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request');
1595
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new BaseObject(-1, 'msg_invalid_request');
1596 1596
 
1597 1597
 		$args = new stdClass;
1598
-		$args->site_srl= $site_module_info->site_srl;
1598
+		$args->site_srl = $site_module_info->site_srl;
1599 1599
 		$args->member_srl = $logged_info->member_srl;
1600 1600
 		$output = executeQuery('member.deleteMembersGroup', $args);
1601
-		if(!$output->toBool()) return $output;
1601
+		if (!$output->toBool()) return $output;
1602 1602
 		$this->setMessage('success_deleted');
1603 1603
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1604 1604
 	}
@@ -1612,25 +1612,25 @@  discard block
 block discarded – undo
1612 1612
 	 */
1613 1613
 	function setMemberConfig($args)
1614 1614
 	{
1615
-		if(!$args->skin) $args->skin = "default";
1616
-		if(!$args->colorset) $args->colorset = "white";
1617
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1618
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1619
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1620
-		$args->enable_openid= 'N';
1621
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1622
-		if($args->image_name!='Y') $args->image_name = 'N';
1623
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1624
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1625
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1626
-		$args->limit_day = (int)$args->limit_day;
1615
+		if (!$args->skin) $args->skin = "default";
1616
+		if (!$args->colorset) $args->colorset = "white";
1617
+		if (!$args->editor_skin) $args->editor_skin = "ckeditor";
1618
+		if (!$args->editor_colorset) $args->editor_colorset = "moono";
1619
+		if ($args->enable_join != 'Y') $args->enable_join = 'N';
1620
+		$args->enable_openid = 'N';
1621
+		if ($args->profile_image != 'Y') $args->profile_image = 'N';
1622
+		if ($args->image_name != 'Y') $args->image_name = 'N';
1623
+		if ($args->image_mark != 'Y') $args->image_mark = 'N';
1624
+		if ($args->group_image_mark != 'Y') $args->group_image_mark = 'N';
1625
+		if (!trim(strip_tags($args->agreement))) $args->agreement = null;
1626
+		$args->limit_day = (int) $args->limit_day;
1627 1627
 
1628 1628
 		$agreement = trim($args->agreement);
1629 1629
 		unset($args->agreement);
1630 1630
 
1631 1631
 		$oModuleController = getController('module');
1632
-		$output = $oModuleController->insertModuleConfig('member',$args);
1633
-		if(!$output->toBool()) return $output;
1632
+		$output = $oModuleController->insertModuleConfig('member', $args);
1633
+		if (!$output->toBool()) return $output;
1634 1634
 
1635 1635
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1636 1636
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1651,11 +1651,11 @@  discard block
 block discarded – undo
1651 1651
 		$signature = trim(removeHackTag($signature));
1652 1652
 		$signature = preg_replace('/<(\/?)(embed|object|param)/is', '&lt;$1$2', $signature);
1653 1653
 
1654
-		$check_signature = trim(str_replace(array('&nbsp;',"\n","\r"), '', strip_tags($signature, '<img><object>')));
1654
+		$check_signature = trim(str_replace(array('&nbsp;', "\n", "\r"), '', strip_tags($signature, '<img><object>')));
1655 1655
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1656 1656
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1657 1657
 
1658
-		if(!$check_signature) return FileHandler::removeFile($filename);
1658
+		if (!$check_signature) return FileHandler::removeFile($filename);
1659 1659
 
1660 1660
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1661 1661
 		FileHandler::makeDir($path);
@@ -1684,15 +1684,15 @@  discard block
 block discarded – undo
1684 1684
 	 *
1685 1685
 	 * @return BaseObject
1686 1686
 	 */
1687
-	function addMemberToGroup($member_srl, $group_srl, $site_srl=0)
1687
+	function addMemberToGroup($member_srl, $group_srl, $site_srl = 0)
1688 1688
 	{
1689 1689
 		$args = new stdClass();
1690 1690
 		$args->member_srl = $member_srl;
1691 1691
 		$args->group_srl = $group_srl;
1692
-		if($site_srl) $args->site_srl = $site_srl;
1692
+		if ($site_srl) $args->site_srl = $site_srl;
1693 1693
 
1694 1694
 		// Add
1695
-		$output = executeQuery('member.addMemberToGroup',$args);
1695
+		$output = executeQuery('member.addMemberToGroup', $args);
1696 1696
 		$output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args);
1697 1697
 
1698 1698
 		$this->_clearMemberCache($member_srl, $site_srl);
@@ -1712,18 +1712,18 @@  discard block
 block discarded – undo
1712 1712
 	{
1713 1713
 		$obj = new stdClass;
1714 1714
 		$obj->site_srl = $args->site_srl;
1715
-		$obj->member_srl = implode(',',$args->member_srl);
1715
+		$obj->member_srl = implode(',', $args->member_srl);
1716 1716
 
1717 1717
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1718
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1718
+		if ($output->data) foreach ($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1719 1719
 
1720 1720
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1721
-		if(!$output->toBool()) return $output;
1721
+		if (!$output->toBool()) return $output;
1722 1722
 
1723 1723
 		$inserted_members = array();
1724
-		foreach($args->member_srl as $key => $val)
1724
+		foreach ($args->member_srl as $key => $val)
1725 1725
 		{
1726
-			if($inserted_members[$val]) continue;
1726
+			if ($inserted_members[$val]) continue;
1727 1727
 			$inserted_members[$val] = true;
1728 1728
 
1729 1729
 			unset($obj);
@@ -1733,7 +1733,7 @@  discard block
 block discarded – undo
1733 1733
 			$obj->site_srl = $args->site_srl;
1734 1734
 			$obj->regdate = $date[$obj->member_srl];
1735 1735
 			$output = executeQuery('member.addMemberToGroup', $obj);
1736
-			if(!$output->toBool()) return $output;
1736
+			if (!$output->toBool()) return $output;
1737 1737
 
1738 1738
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1739 1739
 		}
@@ -1755,7 +1755,7 @@  discard block
 block discarded – undo
1755 1755
 		// Get information of the key
1756 1756
 		$output = executeQuery('member.getAutologin', $args);
1757 1757
 		// If no information exists, delete a cookie
1758
-		if(!$output->toBool() || !$output->data)
1758
+		if (!$output->toBool() || !$output->data)
1759 1759
 		{
1760 1760
 			saveCookie('xeak');
1761 1761
 			return;
@@ -1767,7 +1767,7 @@  discard block
 block discarded – undo
1767 1767
 		$user_id = ($config->identifier == 'user_id') ? $output->data->user_id : $output->data->email_address;
1768 1768
 		$password = $output->data->password;
1769 1769
 
1770
-		if(!$user_id || !$password)
1770
+		if (!$user_id || !$password)
1771 1771
 		{
1772 1772
 			saveCookie('xeak');
1773 1773
 			return;
@@ -1779,7 +1779,7 @@  discard block
 block discarded – undo
1779 1779
 		$check_key = strtolower($user_id).$password.$_SERVER['HTTP_USER_AGENT'];
1780 1780
 		$check_key = substr(hash_hmac('sha256', $check_key, substr($args->autologin_key, 0, 32)), 0, 32);
1781 1781
 
1782
-		if($check_key === substr($args->autologin_key, 32))
1782
+		if ($check_key === substr($args->autologin_key, 32))
1783 1783
 		{
1784 1784
 			// Check change_password_date
1785 1785
 			$oModuleModel = getModel('module');
@@ -1787,12 +1787,12 @@  discard block
 block discarded – undo
1787 1787
 			$limit_date = $member_config->change_password_date;
1788 1788
 
1789 1789
 			// Check if change_password_date is set
1790
-			if($limit_date > 0)
1790
+			if ($limit_date > 0)
1791 1791
 			{
1792 1792
 				$oMemberModel = getModel('member');
1793 1793
 				$columnList = array('member_srl', 'change_password_date');
1794 1794
 
1795
-				if($config->identifier == 'user_id')
1795
+				if ($config->identifier == 'user_id')
1796 1796
 				{
1797 1797
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1798 1798
 				}
@@ -1801,7 +1801,7 @@  discard block
 block discarded – undo
1801 1801
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1802 1802
 				}
1803 1803
 
1804
-				if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){
1804
+				if ($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day'))) {
1805 1805
 					$do_auto_login = true;
1806 1806
 				}
1807 1807
 
@@ -1812,7 +1812,7 @@  discard block
 block discarded – undo
1812 1812
 			}
1813 1813
 		}
1814 1814
 
1815
-		if($do_auto_login)
1815
+		if ($do_auto_login)
1816 1816
 		{
1817 1817
 			$output = $this->doLogin($user_id);
1818 1818
 		}
@@ -1835,13 +1835,13 @@  discard block
 block discarded – undo
1835 1835
 	function doLogin($user_id, $password = '', $keep_signed = false)
1836 1836
 	{
1837 1837
 		$user_id = strtolower($user_id);
1838
-		if(!$user_id) return new BaseObject(-1, 'null_user_id');
1838
+		if (!$user_id) return new BaseObject(-1, 'null_user_id');
1839 1839
 		// Call a trigger before log-in (before)
1840 1840
 		$trigger_obj = new stdClass();
1841 1841
 		$trigger_obj->user_id = $user_id;
1842 1842
 		$trigger_obj->password = $password;
1843 1843
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1844
-		if(!$trigger_output->toBool()) return $trigger_output;
1844
+		if (!$trigger_output->toBool()) return $trigger_output;
1845 1845
 		// Create a member model object
1846 1846
 		$oMemberModel = getModel('member');
1847 1847
 
@@ -1851,12 +1851,12 @@  discard block
 block discarded – undo
1851 1851
 		$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1852 1852
 
1853 1853
 		// check identifier
1854
-		if($config->identifier == 'email_address')
1854
+		if ($config->identifier == 'email_address')
1855 1855
 		{
1856 1856
 			// Get user_id information
1857 1857
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1858 1858
 			// Set an invalid user if no value returned
1859
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1859
+			if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1860 1860
 
1861 1861
 		}
1862 1862
 		else
@@ -1864,24 +1864,24 @@  discard block
 block discarded – undo
1864 1864
 			// Get user_id information
1865 1865
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1866 1866
 			// Set an invalid user if no value returned
1867
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1867
+			if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1868 1868
 		}
1869 1869
 
1870 1870
 		$output = executeQuery('member.getLoginCountByIp', $args);
1871 1871
 		$errorCount = $output->data->count;
1872
-		if($errorCount >= $config->max_error_count)
1872
+		if ($errorCount >= $config->max_error_count)
1873 1873
 		{
1874 1874
 			$last_update = strtotime($output->data->last_update);
1875
-			$term = intval($_SERVER['REQUEST_TIME']-$last_update);
1876
-			if($term < $config->max_error_count_time)
1875
+			$term = intval($_SERVER['REQUEST_TIME'] - $last_update);
1876
+			if ($term < $config->max_error_count_time)
1877 1877
 			{
1878 1878
 				$term = $config->max_error_count_time - $term;
1879
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1880
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1881
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1882
-				else $term = intval($term/86400).Context::getLang('unit_day');
1879
+				if ($term < 60) $term = intval($term).Context::getLang('unit_sec');
1880
+				elseif (60 <= $term && $term < 3600) $term = intval($term / 60).Context::getLang('unit_min');
1881
+				elseif (3600 <= $term && $term < 86400) $term = intval($term / 3600).Context::getLang('unit_hour');
1882
+				else $term = intval($term / 86400).Context::getLang('unit_day');
1883 1883
 
1884
-				return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1884
+				return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'), $term));
1885 1885
 			}
1886 1886
 			else
1887 1887
 			{
@@ -1891,13 +1891,13 @@  discard block
 block discarded – undo
1891 1891
 		}
1892 1892
 
1893 1893
 		// Password Check
1894
-		if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1894
+		if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1895 1895
 		{
1896
-			return $this->recordMemberLoginError(-1, 'invalid_password',$this->memberInfo);
1896
+			return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo);
1897 1897
 		}
1898 1898
 
1899 1899
 		// If denied == 'Y', notify
1900
-		if($this->memberInfo->denied == 'Y')
1900
+		if ($this->memberInfo->denied == 'Y')
1901 1901
 		{
1902 1902
 			$args->member_srl = $this->memberInfo->member_srl;
1903 1903
 			$output = executeQuery('member.chkAuthMail', $args);
@@ -1905,12 +1905,12 @@  discard block
 block discarded – undo
1905 1905
 			{
1906 1906
 				$_SESSION['auth_member_srl'] = $this->memberInfo->member_srl;
1907 1907
 				$redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail');
1908
-				return $this->setRedirectUrl($redirectUrl, new BaseObject(-1,'msg_user_not_confirmed'));
1908
+				return $this->setRedirectUrl($redirectUrl, new BaseObject(-1, 'msg_user_not_confirmed'));
1909 1909
 			}
1910
-			return new BaseObject(-1,'msg_user_denied');
1910
+			return new BaseObject(-1, 'msg_user_denied');
1911 1911
 		}
1912 1912
 		// Notify if denied_date is less than the current time
1913
-		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")));
1913
+		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")));
1914 1914
 		// Update the latest login time
1915 1915
 		$args->member_srl = $this->memberInfo->member_srl;
1916 1916
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1920,36 +1920,36 @@  discard block
 block discarded – undo
1920 1920
 
1921 1921
 		// Check if there is recoding table.
1922 1922
 		$oDB = &DB::getInstance();
1923
-		if($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1923
+		if ($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1924 1924
 		{
1925 1925
 			// check if there is login fail records.
1926 1926
 			$output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args);
1927
-			if($output->data && $output->data->content)
1927
+			if ($output->data && $output->data->content)
1928 1928
 			{
1929 1929
 				$title = Context::getLang('login_fail_report');
1930 1930
 				$message = '<ul>';
1931 1931
 				$content = unserialize($output->data->content);
1932
-				if(count($content) > $config->max_error_count)
1932
+				if (count($content) > $config->max_error_count)
1933 1933
 				{
1934
-					foreach($content as $val)
1934
+					foreach ($content as $val)
1935 1935
 					{
1936
-						$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>';
1936
+						$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>';
1937 1937
 					}
1938 1938
 					$message .= '</ul>';
1939
-					$content = sprintf(Context::getLang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa'));
1939
+					$content = sprintf(Context::getLang('login_fail_report_contents'), $message, date('Y-m-d h:i:sa'));
1940 1940
 
1941 1941
 					//send message
1942 1942
 					$oCommunicationController = getController('communication');
1943 1943
 					$oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true);
1944 1944
 
1945
-					if($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1945
+					if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1946 1946
 					{
1947 1947
 						$view_url = Context::getRequestUri();
1948
-						$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);
1948
+						$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);
1949 1949
 						$oMail = new Mail();
1950 1950
 						$oMail->setTitle($title);
1951 1951
 						$oMail->setContent($content);
1952
-						$oMail->setSender($config->webmaster_name?$config->webmaster_name:'webmaster', $config->webmaster_email);
1952
+						$oMail->setSender($config->webmaster_name ? $config->webmaster_name : 'webmaster', $config->webmaster_email);
1953 1953
 						$oMail->setReceiptor($this->memberInfo->email_id.'('.$this->memberInfo->nick_name.')', $this->memberInfo->email_address);
1954 1954
 						$oMail->send();
1955 1955
 					}
@@ -1959,9 +1959,9 @@  discard block
 block discarded – undo
1959 1959
 		}
1960 1960
 		// Call a trigger after successfully log-in (after)
1961 1961
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1962
-		if(!$trigger_output->toBool()) return $trigger_output;
1962
+		if (!$trigger_output->toBool()) return $trigger_output;
1963 1963
 		// When user checked to use auto-login
1964
-		if($keep_signed)
1964
+		if ($keep_signed)
1965 1965
 		{
1966 1966
 			// Key generate for auto login
1967 1967
 			$oPassword = new Password();
@@ -1973,12 +1973,12 @@  discard block
 block discarded – undo
1973 1973
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1974 1974
 			executeQuery('member.deleteAutologin', $autologin_args);
1975 1975
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1976
-			if($autologin_output->toBool()) saveCookie('xeak', $autologin_args->autologin_key, true, $_SERVER['REQUEST_TIME']+31536000);
1976
+			if ($autologin_output->toBool()) saveCookie('xeak', $autologin_args->autologin_key, true, $_SERVER['REQUEST_TIME'] + 31536000);
1977 1977
 		}
1978
-		if($this->memberInfo->is_admin == 'Y')
1978
+		if ($this->memberInfo->is_admin == 'Y')
1979 1979
 		{
1980 1980
 			$oMemberAdminModel = getAdminModel('member');
1981
-			if(!$oMemberAdminModel->getMemberAdminIPCheck())
1981
+			if (!$oMemberAdminModel->getMemberAdminIPCheck())
1982 1982
 			{
1983 1983
 				$_SESSION['denied_admin'] = 'Y';
1984 1984
 			}
@@ -1996,18 +1996,18 @@  discard block
 block discarded – undo
1996 1996
 	{
1997 1997
 		$oMemberModel = getModel('member');
1998 1998
 		// If your information came through the current session information to extract information from the users
1999
-		if(!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged() )
1999
+		if (!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged())
2000 2000
 		{
2001 2001
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']);
2002 2002
 			// If you do not destroy the session Profile
2003
-			if($this->memberInfo->member_srl != $_SESSION['member_srl'])
2003
+			if ($this->memberInfo->member_srl != $_SESSION['member_srl'])
2004 2004
 			{
2005 2005
 				$this->destroySessionInfo();
2006 2006
 				return;
2007 2007
 			}
2008 2008
 		}
2009 2009
 		// Stop using the session id is destroyed
2010
-		if($this->memberInfo->denied=='Y')
2010
+		if ($this->memberInfo->denied == 'Y')
2011 2011
 		{
2012 2012
 			$this->destroySessionInfo();
2013 2013
 			return;
@@ -2037,10 +2037,10 @@  discard block
 block discarded – undo
2037 2037
 		Context::set('logged_info', $this->memberInfo);
2038 2038
 
2039 2039
 		// Only the menu configuration of the user (such as an add-on to the menu can be changed)
2040
-		$this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info');
2041
-		$this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document');
2042
-		$this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document');
2043
-		$this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document');
2040
+		$this->addMemberMenu('dispMemberInfo', 'cmd_view_member_info');
2041
+		$this->addMemberMenu('dispMemberScrappedDocument', 'cmd_view_scrapped_document');
2042
+		$this->addMemberMenu('dispMemberSavedDocument', 'cmd_view_saved_document');
2043
+		$this->addMemberMenu('dispMemberOwnDocument', 'cmd_view_own_document');
2044 2044
 	}
2045 2045
 
2046 2046
 	/**
@@ -2062,7 +2062,7 @@  discard block
 block discarded – undo
2062 2062
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
2063 2063
 	{
2064 2064
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
2065
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
2065
+		if (!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
2066 2066
 
2067 2067
 		$obj = new stdClass;
2068 2068
 		$obj->url = $url;
@@ -2081,33 +2081,33 @@  discard block
 block discarded – undo
2081 2081
 	{
2082 2082
 		// Call a trigger (before)
2083 2083
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
2084
-		if(!$output->toBool()) return $output;
2084
+		if (!$output->toBool()) return $output;
2085 2085
 		// Terms and Conditions portion of the information set up by members reaffirmed
2086 2086
 		$oModuleModel = getModel('module');
2087 2087
 		$config = $oModuleModel->getModuleConfig('member');
2088 2088
 
2089 2089
 		$logged_info = Context::get('logged_info');
2090 2090
 		// If the date of the temporary restrictions limit further information on the date of
2091
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2091
+		if ($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME'] + $config->limit_day * 60 * 60 * 24);
2092 2092
 
2093 2093
 		$args->member_srl = getNextSequence();
2094 2094
 		$args->list_order = -1 * $args->member_srl;
2095 2095
 
2096 2096
 		// Execute insert or update depending on the value of member_srl
2097
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2097
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
2098 2098
 		// Enter the user's identity changed to lowercase
2099 2099
 		else $args->user_id = strtolower($args->user_id);
2100
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2101
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
2100
+		if (!$args->user_name) $args->user_name = $args->member_srl;
2101
+		if (!$args->nick_name) $args->nick_name = $args->member_srl;
2102 2102
 
2103 2103
 		// Control of essential parameters
2104
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2105
-		if($args->denied!='Y') $args->denied = 'N';
2106
-		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y';
2104
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
2105
+		if ($args->denied != 'Y') $args->denied = 'N';
2106
+		if (!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F')))) $args->allow_message = 'Y';
2107 2107
 
2108
-		if($logged_info->is_admin == 'Y')
2108
+		if ($logged_info->is_admin == 'Y')
2109 2109
 		{
2110
-			if($args->is_admin!='Y') $args->is_admin = 'N';
2110
+			if ($args->is_admin != 'Y') $args->is_admin = 'N';
2111 2111
 		}
2112 2112
 		else
2113 2113
 		{
@@ -2122,97 +2122,97 @@  discard block
 block discarded – undo
2122 2122
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2123 2123
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2124 2124
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2125
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2126
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
2125
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//i", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
2126
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//i", $args->blog)) $args->blog = 'http://'.$args->blog;
2127 2127
 
2128 2128
 		// Create a model object
2129 2129
 		$oMemberModel = getModel('member');
2130 2130
 
2131 2131
 		// Check password strength
2132
-		if($args->password && !$password_is_hashed)
2132
+		if ($args->password && !$password_is_hashed)
2133 2133
 		{
2134
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2134
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2135 2135
 			{
2136 2136
 				$message = Context::getLang('about_password_strength');
2137 2137
 				return new BaseObject(-1, $message[$config->password_strength]);
2138 2138
 			}
2139 2139
 			$args->password = $oMemberModel->hashPassword($args->password);
2140 2140
 		}
2141
-		elseif(!$args->password)
2141
+		elseif (!$args->password)
2142 2142
 		{
2143 2143
 			unset($args->password);
2144 2144
 		}
2145 2145
 
2146
-		if($args->find_account_answer && !$password_is_hashed)
2146
+		if ($args->find_account_answer && !$password_is_hashed)
2147 2147
 		{
2148 2148
 			$args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer);
2149 2149
 		}
2150
-		elseif(!$args->find_account_answer)
2150
+		elseif (!$args->find_account_answer)
2151 2151
 		{
2152 2152
 			unset($args->find_account_answer);
2153 2153
 		}
2154 2154
 
2155 2155
 		// Check if ID is prohibited
2156
-		if($oMemberModel->isDeniedID($args->user_id))
2156
+		if ($oMemberModel->isDeniedID($args->user_id))
2157 2157
 		{
2158
-			return new BaseObject(-1,'denied_user_id');
2158
+			return new BaseObject(-1, 'denied_user_id');
2159 2159
 		}
2160 2160
 
2161 2161
 		// Check if ID is duplicate
2162 2162
 		$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2163
-		if($member_srl)
2163
+		if ($member_srl)
2164 2164
 		{
2165
-			return new BaseObject(-1,'msg_exists_user_id');
2165
+			return new BaseObject(-1, 'msg_exists_user_id');
2166 2166
 		}
2167 2167
 
2168 2168
 		// Check if nickname is prohibited
2169
-		if($oMemberModel->isDeniedNickName($args->nick_name))
2169
+		if ($oMemberModel->isDeniedNickName($args->nick_name))
2170 2170
 		{
2171
-			return new BaseObject(-1,'denied_nick_name');
2171
+			return new BaseObject(-1, 'denied_nick_name');
2172 2172
 		}
2173 2173
 
2174 2174
 		// Check if nickname is duplicate
2175 2175
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
2176
-		if($member_srl)
2176
+		if ($member_srl)
2177 2177
 		{
2178
-			return new BaseObject(-1,'msg_exists_nick_name');
2178
+			return new BaseObject(-1, 'msg_exists_nick_name');
2179 2179
 		}
2180 2180
 
2181 2181
 		// Check if email address is duplicate
2182 2182
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2183
-		if($member_srl)
2183
+		if ($member_srl)
2184 2184
 		{
2185
-			return new BaseObject(-1,'msg_exists_email_address');
2185
+			return new BaseObject(-1, 'msg_exists_email_address');
2186 2186
 		}
2187 2187
 
2188 2188
 		// Insert data into the DB
2189 2189
 		$args->list_order = -1 * $args->member_srl;
2190 2190
 
2191
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2192
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2191
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
2192
+		if (!$args->user_name) $args->user_name = $args->member_srl;
2193 2193
 
2194 2194
 		$oDB = &DB::getInstance();
2195 2195
 		$oDB->begin();
2196 2196
 
2197 2197
 		$output = executeQuery('member.insertMember', $args);
2198
-		if(!$output->toBool())
2198
+		if (!$output->toBool())
2199 2199
 		{
2200 2200
 			$oDB->rollback();
2201 2201
 			return $output;
2202 2202
 		}
2203 2203
 
2204
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2204
+		if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2205 2205
 		else $group_srl_list = explode('|@|', $args->group_srl_list);
2206 2206
 		// If no value is entered the default group, the value of group registration
2207
-		if(!$args->group_srl_list)
2207
+		if (!$args->group_srl_list)
2208 2208
 		{
2209 2209
 			$columnList = array('site_srl', 'group_srl');
2210 2210
 			$default_group = $oMemberModel->getDefaultGroup(0, $columnList);
2211
-			if($default_group)
2211
+			if ($default_group)
2212 2212
 			{
2213 2213
 				// Add to the default group
2214
-				$output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl);
2215
-				if(!$output->toBool())
2214
+				$output = $this->addMemberToGroup($args->member_srl, $default_group->group_srl);
2215
+				if (!$output->toBool())
2216 2216
 				{
2217 2217
 					$oDB->rollback();
2218 2218
 					return $output;
@@ -2222,11 +2222,11 @@  discard block
 block discarded – undo
2222 2222
 		}
2223 2223
 		else
2224 2224
 		{
2225
-			for($i=0;$i<count($group_srl_list);$i++)
2225
+			for ($i = 0; $i < count($group_srl_list); $i++)
2226 2226
 			{
2227
-				$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2227
+				$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2228 2228
 
2229
-				if(!$output->toBool())
2229
+				if (!$output->toBool())
2230 2230
 				{
2231 2231
 					$oDB->rollback();
2232 2232
 					return $output;
@@ -2236,7 +2236,7 @@  discard block
 block discarded – undo
2236 2236
 
2237 2237
 		$member_config = $oModuleModel->getModuleConfig('member');
2238 2238
 		// When using email authentication mode (when you subscribed members denied a) certified mail sent
2239
-		if($args->denied == 'Y')
2239
+		if ($args->denied == 'Y')
2240 2240
 		{
2241 2241
 			// Insert data into the authentication DB
2242 2242
 			$oPassword = new Password();
@@ -2248,7 +2248,7 @@  discard block
 block discarded – undo
2248 2248
 			$auth_args->is_register = 'Y';
2249 2249
 
2250 2250
 			$output = executeQuery('member.insertAuthMail', $auth_args);
2251
-			if(!$output->toBool())
2251
+			if (!$output->toBool())
2252 2252
 			{
2253 2253
 				$oDB->rollback();
2254 2254
 				return $output;
@@ -2256,10 +2256,10 @@  discard block
 block discarded – undo
2256 2256
 			$this->_sendAuthMail($auth_args, $args);
2257 2257
 		}
2258 2258
 		// Call a trigger (after)
2259
-		if($output->toBool())
2259
+		if ($output->toBool())
2260 2260
 		{
2261 2261
 			$trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args);
2262
-			if(!$trigger_output->toBool())
2262
+			if (!$trigger_output->toBool())
2263 2263
 			{
2264 2264
 				$oDB->rollback();
2265 2265
 				return $trigger_output;
@@ -2281,41 +2281,41 @@  discard block
 block discarded – undo
2281 2281
 	{
2282 2282
 		// Call a trigger (before)
2283 2283
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2284
-		if(!$output->toBool()) return $output;
2284
+		if (!$output->toBool()) return $output;
2285 2285
 		// Create a model object
2286 2286
 		$oMemberModel = getModel('member');
2287 2287
 
2288 2288
 		$logged_info = Context::get('logged_info');
2289 2289
 		// Get what you want to modify the original information
2290
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2290
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2291 2291
 		// Control of essential parameters
2292
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2293
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2292
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
2293
+		if ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F'))) $args->allow_message = 'Y';
2294 2294
 
2295
-		if($logged_info->is_admin == 'Y')
2295
+		if ($logged_info->is_admin == 'Y')
2296 2296
 		{
2297
-			if($args->denied!='Y') $args->denied = 'N';
2298
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2297
+			if ($args->denied != 'Y') $args->denied = 'N';
2298
+			if ($args->is_admin != 'Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2299 2299
 		}
2300 2300
 		else
2301 2301
 		{
2302 2302
 			unset($args->is_admin);
2303
-			if($is_admin == false)
2303
+			if ($is_admin == false)
2304 2304
 				unset($args->denied);
2305
-			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2305
+			if ($logged_info->member_srl != $args->member_srl && $is_admin == false)
2306 2306
 			{
2307 2307
 				return $this->stop('msg_invalid_request');
2308 2308
 			}
2309 2309
 		}
2310 2310
 
2311 2311
 		// Sanitize user ID, username, nickname, homepage, blog
2312
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2312
+		if ($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2313 2313
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2314 2314
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2315 2315
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2316 2316
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2317
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2318
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2317
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//is", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
2318
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//is", $args->blog)) $args->blog = 'http://'.$args->blog;
2319 2319
 
2320 2320
 		// check member identifier form
2321 2321
 		$config = $oMemberModel->getMemberConfig();
@@ -2324,56 +2324,56 @@  discard block
 block discarded – undo
2324 2324
 		$orgMemberInfo = $output->data;
2325 2325
 
2326 2326
 		// Check if email address or user ID is duplicate
2327
-		if($config->identifier == 'email_address')
2327
+		if ($config->identifier == 'email_address')
2328 2328
 		{
2329 2329
 			$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2330
-			if($member_srl && $args->member_srl != $member_srl)
2330
+			if ($member_srl && $args->member_srl != $member_srl)
2331 2331
 			{
2332
-				return new BaseObject(-1,'msg_exists_email_address');
2332
+				return new BaseObject(-1, 'msg_exists_email_address');
2333 2333
 			}
2334 2334
 			$args->email_address = $orgMemberInfo->email_address;
2335 2335
 		}
2336 2336
 		else
2337 2337
 		{
2338 2338
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2339
-			if($member_srl && $args->member_srl != $member_srl)
2339
+			if ($member_srl && $args->member_srl != $member_srl)
2340 2340
 			{
2341
-				return new BaseObject(-1,'msg_exists_user_id');
2341
+				return new BaseObject(-1, 'msg_exists_user_id');
2342 2342
 			}
2343 2343
 
2344 2344
 			$args->user_id = $orgMemberInfo->user_id;
2345 2345
 		}
2346 2346
 
2347
-		if($logged_info->is_admin !== 'Y')
2347
+		if ($logged_info->is_admin !== 'Y')
2348 2348
 		{
2349 2349
 			// Check if ID is prohibited
2350
-			if($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2350
+			if ($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2351 2351
 			{
2352
-				return new BaseObject(-1,'denied_user_id');
2352
+				return new BaseObject(-1, 'denied_user_id');
2353 2353
 			}
2354 2354
 
2355 2355
 			// Check if nickname is prohibited
2356
-			if($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2356
+			if ($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2357 2357
 			{
2358 2358
 				return new BaseObject(-1, 'denied_nick_name');
2359 2359
 			}
2360 2360
 		}
2361 2361
 
2362 2362
 		// Check if ID is duplicate
2363
-		if($args->user_id)
2363
+		if ($args->user_id)
2364 2364
 		{
2365 2365
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2366
-			if($member_srl && $args->member_srl != $member_srl)
2366
+			if ($member_srl && $args->member_srl != $member_srl)
2367 2367
 			{
2368
-				return new BaseObject(-1,'msg_exists_user_id');
2368
+				return new BaseObject(-1, 'msg_exists_user_id');
2369 2369
 			}
2370 2370
 		}
2371 2371
 
2372 2372
 		// Check if nickname is duplicate
2373 2373
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
2374
- 		if($member_srl && $args->member_srl != $member_srl)
2374
+ 		if ($member_srl && $args->member_srl != $member_srl)
2375 2375
  		{
2376
- 			return new BaseObject(-1,'msg_exists_nick_name');
2376
+ 			return new BaseObject(-1, 'msg_exists_nick_name');
2377 2377
  		}
2378 2378
 
2379 2379
 		list($args->email_id, $args->email_host) = explode('@', $args->email_address);
@@ -2382,9 +2382,9 @@  discard block
 block discarded – undo
2382 2382
 		$oDB->begin();
2383 2383
 
2384 2384
 		// Check password strength
2385
-		if($args->password)
2385
+		if ($args->password)
2386 2386
 		{
2387
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2387
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2388 2388
 			{
2389 2389
 				$message = Context::getLang('about_password_strength');
2390 2390
 				return new BaseObject(-1, $message[$config->password_strength]);
@@ -2396,55 +2396,55 @@  discard block
 block discarded – undo
2396 2396
 			$args->password = $orgMemberInfo->password;
2397 2397
 		}
2398 2398
 
2399
-		if($args->find_account_answer) {
2399
+		if ($args->find_account_answer) {
2400 2400
 			$args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer);
2401 2401
 		}
2402 2402
 		else
2403 2403
 		{
2404
-			$oPassword =  new Password();
2404
+			$oPassword = new Password();
2405 2405
 			$hashed = $oPassword->checkAlgorithm($orgMemberInfo->find_account_answer);
2406 2406
 
2407
-			if($hashed) {
2407
+			if ($hashed) {
2408 2408
 				$args->find_account_answer = $orgMemberInfo->find_account_answer;
2409 2409
 			} else {
2410 2410
 				$args->find_account_answer = $oPassword->createHash($orgMemberInfo->find_account_answer);
2411 2411
 			}
2412 2412
 		}
2413 2413
 
2414
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2415
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2416
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2417
-		if(!$args->description) $args->description = $orgMemberInfo->description;
2418
-		if(!$args->birthday) $args->birthday = '';
2414
+		if (!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2415
+		if (!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2416
+		if (!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2417
+		if (!$args->description) $args->description = $orgMemberInfo->description;
2418
+		if (!$args->birthday) $args->birthday = '';
2419 2419
 
2420 2420
 		$output = executeQuery('member.updateMember', $args);
2421 2421
 
2422
-		if(!$output->toBool())
2422
+		if (!$output->toBool())
2423 2423
 		{
2424 2424
 			$oDB->rollback();
2425 2425
 			return $output;
2426 2426
 		}
2427 2427
 
2428
-		if($args->group_srl_list)
2428
+		if ($args->group_srl_list)
2429 2429
 		{
2430
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2430
+			if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2431 2431
 			else $group_srl_list = explode('|@|', $args->group_srl_list);
2432 2432
 			// If the group information, group information changes
2433
-			if(count($group_srl_list) > 0)
2433
+			if (count($group_srl_list) > 0)
2434 2434
 			{
2435 2435
 				$args->site_srl = 0;
2436 2436
 				// One of its members to delete all the group
2437 2437
 				$output = executeQuery('member.deleteMemberGroupMember', $args);
2438
-				if(!$output->toBool())
2438
+				if (!$output->toBool())
2439 2439
 				{
2440 2440
 					$oDB->rollback();
2441 2441
 					return $output;
2442 2442
 				}
2443 2443
 				// Enter one of the loop a
2444
-				for($i=0;$i<count($group_srl_list);$i++)
2444
+				for ($i = 0; $i < count($group_srl_list); $i++)
2445 2445
 				{
2446
-					$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2447
-					if(!$output->toBool())
2446
+					$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2447
+					if (!$output->toBool())
2448 2448
 					{
2449 2449
 						$oDB->rollback();
2450 2450
 						return $output;
@@ -2456,9 +2456,9 @@  discard block
 block discarded – undo
2456 2456
 			}
2457 2457
 		}
2458 2458
 		// Call a trigger (after)
2459
-		if($output->toBool()) {
2459
+		if ($output->toBool()) {
2460 2460
 			$trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args);
2461
-			if(!$trigger_output->toBool())
2461
+			if (!$trigger_output->toBool())
2462 2462
 			{
2463 2463
 				$oDB->rollback();
2464 2464
 				return $trigger_output;
@@ -2471,7 +2471,7 @@  discard block
 block discarded – undo
2471 2471
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2472 2472
 
2473 2473
 		// Save Session
2474
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2474
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2475 2475
 		$logged_info = Context::get('logged_info');
2476 2476
 
2477 2477
 		$output->add('member_srl', $args->member_srl);
@@ -2483,14 +2483,14 @@  discard block
 block discarded – undo
2483 2483
 	 */
2484 2484
 	function updateMemberPassword($args)
2485 2485
 	{
2486
-		if($args->password)
2486
+		if ($args->password)
2487 2487
 		{
2488 2488
 
2489 2489
 			// check password strength
2490 2490
 			$oMemberModel = getModel('member');
2491 2491
 			$config = $oMemberModel->getMemberConfig();
2492 2492
 
2493
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2493
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2494 2494
 			{
2495 2495
 				$message = Context::getLang('about_password_strength');
2496 2496
 				return new BaseObject(-1, $message[$config->password_strength]);
@@ -2498,13 +2498,13 @@  discard block
 block discarded – undo
2498 2498
 
2499 2499
 			$args->password = $oMemberModel->hashPassword($args->password);
2500 2500
 		}
2501
-		else if($args->hashed_password)
2501
+		else if ($args->hashed_password)
2502 2502
 		{
2503 2503
 			$args->password = $args->hashed_password;
2504 2504
 		}
2505 2505
 
2506 2506
 		$output = executeQuery('member.updateMemberPassword', $args);
2507
-		if($output->toBool())
2507
+		if ($output->toBool())
2508 2508
 		{
2509 2509
 			$result = executeQuery('member.updateChangePasswordDate', $args);
2510 2510
 		}
@@ -2516,7 +2516,7 @@  discard block
 block discarded – undo
2516 2516
 
2517 2517
 	function updateFindAccountAnswer($member_srl, $answer)
2518 2518
 	{
2519
-		$oPassword =  new Password();
2519
+		$oPassword = new Password();
2520 2520
 
2521 2521
 		$args = new stdClass();
2522 2522
 		$args->member_srl = $member_srl;
@@ -2533,18 +2533,18 @@  discard block
 block discarded – undo
2533 2533
 		$trigger_obj = new stdClass();
2534 2534
 		$trigger_obj->member_srl = $member_srl;
2535 2535
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2536
-		if(!$output->toBool()) return $output;
2536
+		if (!$output->toBool()) return $output;
2537 2537
 		// Create a model object
2538 2538
 		$oMemberModel = getModel('member');
2539 2539
 		// Bringing the user's information
2540
-		if(!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2540
+		if (!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2541 2541
 		{
2542 2542
 			$columnList = array('member_srl', 'is_admin');
2543 2543
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2544 2544
 		}
2545
-		if(!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member');
2545
+		if (!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member');
2546 2546
 		// If managers can not be deleted
2547
-		if($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin');
2547
+		if ($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin');
2548 2548
 
2549 2549
 		$oDB = &DB::getInstance();
2550 2550
 		$oDB->begin();
@@ -2553,7 +2553,7 @@  discard block
 block discarded – undo
2553 2553
 		$args->member_srl = $member_srl;
2554 2554
 		// Delete the entries in member_auth_mail
2555 2555
 		$output = executeQuery('member.deleteAuthMail', $args);
2556
-		if(!$output->toBool())
2556
+		if (!$output->toBool())
2557 2557
 		{
2558 2558
 			$oDB->rollback();
2559 2559
 			return $output;
@@ -2568,23 +2568,23 @@  discard block
 block discarded – undo
2568 2568
 		 */
2569 2569
 		// Delete the entries in member_group_member
2570 2570
 		$output = executeQuery('member.deleteMemberGroupMember', $args);
2571
-		if(!$output->toBool())
2571
+		if (!$output->toBool())
2572 2572
 		{
2573 2573
 			$oDB->rollback();
2574 2574
 			return $output;
2575 2575
 		}
2576 2576
 		// member removed from the table
2577 2577
 		$output = executeQuery('member.deleteMember', $args);
2578
-		if(!$output->toBool())
2578
+		if (!$output->toBool())
2579 2579
 		{
2580 2580
 			$oDB->rollback();
2581 2581
 			return $output;
2582 2582
 		}
2583 2583
 		// Call a trigger (after)
2584
-		if($output->toBool())
2584
+		if ($output->toBool())
2585 2585
 		{
2586 2586
 			$trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj);
2587
-			if(!$trigger_output->toBool())
2587
+			if (!$trigger_output->toBool())
2588 2588
 			{
2589 2589
 				$oDB->rollback();
2590 2590
 				return $trigger_output;
@@ -2608,12 +2608,12 @@  discard block
 block discarded – undo
2608 2608
 	 */
2609 2609
 	function destroySessionInfo()
2610 2610
 	{
2611
-		if(!$_SESSION || !is_array($_SESSION)) return;
2611
+		if (!$_SESSION || !is_array($_SESSION)) return;
2612 2612
 
2613 2613
 		$memberInfo = Context::get('logged_info');
2614 2614
 		$memberSrl = $memberInfo->member_srl;
2615 2615
 
2616
-		foreach($_SESSION as $key => $val)
2616
+		foreach ($_SESSION as $key => $val)
2617 2617
 		{
2618 2618
 			$_SESSION[$key] = '';
2619 2619
 		}
@@ -2624,7 +2624,7 @@  discard block
 block discarded – undo
2624 2624
 		saveCookie('xeak');
2625 2625
 		saveCookie('xe_logged', 'false');
2626 2626
 
2627
-		if($memberSrl || $_COOKIE['xeak'])
2627
+		if ($memberSrl || $_COOKIE['xeak'])
2628 2628
 		{
2629 2629
 			$args = new stdClass();
2630 2630
 			$args->member_srl = $memberSrl;
@@ -2640,22 +2640,22 @@  discard block
 block discarded – undo
2640 2640
 		$pointGroup = $pointModuleConfig->point_group;
2641 2641
 
2642 2642
 		$levelGroup = array();
2643
-		if(is_array($pointGroup) && count($pointGroup)>0)
2643
+		if (is_array($pointGroup) && count($pointGroup) > 0)
2644 2644
 		{
2645 2645
 			$levelGroup = array_flip($pointGroup);
2646 2646
 			ksort($levelGroup);
2647 2647
 		}
2648 2648
 		$maxLevel = 0;
2649 2649
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2650
-		if(count($resultGroup) > 0)
2650
+		if (count($resultGroup) > 0)
2651 2651
 			$maxLevel = max(array_flip($resultGroup));
2652 2652
 
2653
-		if($maxLevel > 0)
2653
+		if ($maxLevel > 0)
2654 2654
 		{
2655 2655
 			$oPointModel = getModel('point');
2656 2656
 			$originPoint = $oPointModel->getPoint($memberSrl);
2657 2657
 
2658
-			if($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2658
+			if ($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2659 2659
 			{
2660 2660
 				$oPointController = getController('point');
2661 2661
 				$oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel], 'update');
@@ -2665,18 +2665,18 @@  discard block
 block discarded – undo
2665 2665
 
2666 2666
 	function procMemberModifyEmailAddress()
2667 2667
 	{
2668
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2668
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
2669 2669
 
2670 2670
 		$member_info = Context::get('logged_info');
2671 2671
 		$newEmail = Context::get('email_address');
2672 2672
 
2673
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2673
+		if (!$newEmail) return $this->stop('msg_invalid_request');
2674 2674
 
2675 2675
 		$oMemberModel = getModel('member');
2676 2676
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2677
-		if($member_srl) return new BaseObject(-1,'msg_exists_email_address');
2677
+		if ($member_srl) return new BaseObject(-1, 'msg_exists_email_address');
2678 2678
 
2679
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2679
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2680 2680
 		{
2681 2681
 			return $this->stop('msg_invalid_request');
2682 2682
 		}
@@ -2692,7 +2692,7 @@  discard block
 block discarded – undo
2692 2692
 		$oDB = &DB::getInstance();
2693 2693
 		$oDB->begin();
2694 2694
 		$output = executeQuery('member.insertAuthMail', $auth_args);
2695
-		if(!$output->toBool())
2695
+		if (!$output->toBool())
2696 2696
 		{
2697 2697
 			$oDB->rollback();
2698 2698
 			return $output;
@@ -2702,7 +2702,7 @@  discard block
 block discarded – undo
2702 2702
 		$member_config = $oModuleModel->getModuleConfig('member');
2703 2703
 
2704 2704
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2705
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2705
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2706 2706
 
2707 2707
 		global $lang;
2708 2708
 
@@ -2714,17 +2714,17 @@  discard block
 block discarded – undo
2714 2714
 
2715 2715
 		Context::set('newEmail', $newEmail);
2716 2716
 
2717
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthEmailAddress','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
2717
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
2718 2718
 		Context::set('auth_url', $auth_url);
2719 2719
 
2720 2720
 		$oTemplate = &TemplateHandler::getInstance();
2721 2721
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_new_email');
2722 2722
 
2723 2723
 		$oMail = new Mail();
2724
-		$oMail->setTitle( Context::getLang('title_modify_email_address') );
2724
+		$oMail->setTitle(Context::getLang('title_modify_email_address'));
2725 2725
 		$oMail->setContent($content);
2726
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
2727
-		$oMail->setReceiptor( $member_info->nick_name, $newEmail );
2726
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
2727
+		$oMail->setReceiptor($member_info->nick_name, $newEmail);
2728 2728
 		$result = $oMail->send();
2729 2729
 
2730 2730
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail);
@@ -2738,16 +2738,16 @@  discard block
 block discarded – undo
2738 2738
 	{
2739 2739
 		$member_srl = Context::get('member_srl');
2740 2740
 		$auth_key = Context::get('auth_key');
2741
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2741
+		if (!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2742 2742
 
2743 2743
 		// Test logs for finding password by user_id and authkey
2744 2744
 		$args = new stdClass;
2745 2745
 		$args->member_srl = $member_srl;
2746 2746
 		$args->auth_key = $auth_key;
2747 2747
 		$output = executeQuery('member.getAuthMail', $args);
2748
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2748
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
2749 2749
 		{
2750
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2750
+			if (strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2751 2751
 			return $this->stop('msg_invalid_modify_email_auth_key');
2752 2752
 		}
2753 2753
 
@@ -2756,10 +2756,10 @@  discard block
 block discarded – undo
2756 2756
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2757 2757
 
2758 2758
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2759
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2759
+		if (!$output->toBool()) return $this->stop($output->getMessage());
2760 2760
 
2761 2761
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2762
-		executeQuery('member.deleteAuthChangeEmailAddress',$args);
2762
+		executeQuery('member.deleteAuthChangeEmailAddress', $args);
2763 2763
 
2764 2764
 		$this->_clearMemberCache($args->member_srl);
2765 2765
 
@@ -2777,7 +2777,7 @@  discard block
 block discarded – undo
2777 2777
 	**/
2778 2778
 	function triggerGetDocumentMenu(&$menu_list)
2779 2779
 	{
2780
-		if(!Context::get('is_logged')) return new BaseObject();
2780
+		if (!Context::get('is_logged')) return new BaseObject();
2781 2781
 
2782 2782
 		$logged_info = Context::get('logged_info');
2783 2783
 		$document_srl = Context::get('target_srl');
@@ -2788,12 +2788,12 @@  discard block
 block discarded – undo
2788 2788
 		$member_srl = $oDocument->get('member_srl');
2789 2789
 		$module_srl = $oDocument->get('module_srl');
2790 2790
 
2791
-		if(!$member_srl) return new BaseObject();
2792
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject();
2791
+		if (!$member_srl) return new BaseObject();
2792
+		if ($oDocumentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new BaseObject();
2793 2793
 
2794 2794
 		$oDocumentController = getController('document');
2795
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2796
-		$oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup');
2795
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2796
+		$oDocumentController->addDocumentPopupMenu($url, 'cmd_spammer', '', 'popup');
2797 2797
 
2798 2798
 		return new BaseObject();
2799 2799
 	}
@@ -2807,7 +2807,7 @@  discard block
 block discarded – undo
2807 2807
 	**/
2808 2808
 	function triggerGetCommentMenu(&$menu_list)
2809 2809
 	{
2810
-		if(!Context::get('is_logged')) return new BaseObject();
2810
+		if (!Context::get('is_logged')) return new BaseObject();
2811 2811
 
2812 2812
 		$logged_info = Context::get('logged_info');
2813 2813
 		$comment_srl = Context::get('target_srl');
@@ -2818,12 +2818,12 @@  discard block
 block discarded – undo
2818 2818
 		$module_srl = $oComment->get('module_srl');
2819 2819
 		$member_srl = $oComment->get('member_srl');
2820 2820
 
2821
-		if(!$member_srl) return new BaseObject();
2822
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject();
2821
+		if (!$member_srl) return new BaseObject();
2822
+		if ($oCommentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new BaseObject();
2823 2823
 
2824 2824
 		$oCommentController = getController('comment');
2825
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2826
-		$oCommentController->addCommentPopupMenu($url,'cmd_spammer','','popup');
2825
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2826
+		$oCommentController->addCommentPopupMenu($url, 'cmd_spammer', '', 'popup');
2827 2827
 
2828 2828
 		return new BaseObject();
2829 2829
 	}
@@ -2835,7 +2835,7 @@  discard block
 block discarded – undo
2835 2835
 	**/
2836 2836
 	function procMemberSpammerManage()
2837 2837
 	{
2838
-		if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
2838
+		if (!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_permitted');
2839 2839
 
2840 2840
 		$logged_info = Context::get('logged_info');
2841 2841
 		$member_srl = Context::get('member_srl');
@@ -2843,7 +2843,7 @@  discard block
 block discarded – undo
2843 2843
 		$cnt_loop = Context::get('cnt_loop');
2844 2844
 		$proc_type = Context::get('proc_type');
2845 2845
 		$isMoveToTrash = true;
2846
-		if($proc_type == "delete")
2846
+		if ($proc_type == "delete")
2847 2847
 			$isMoveToTrash = false;
2848 2848
 
2849 2849
 		// check grant
@@ -2852,7 +2852,7 @@  discard block
 block discarded – undo
2852 2852
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2853 2853
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2854 2854
 
2855
-		if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted');
2855
+		if (!$grant->manager) return new BaseObject(-1, 'msg_not_permitted');
2856 2856
 
2857 2857
 		$proc_msg = "";
2858 2858
 
@@ -2861,10 +2861,10 @@  discard block
 block discarded – undo
2861 2861
 
2862 2862
 		// delete or trash destination
2863 2863
 		// proc member
2864
-		if($cnt_loop == 1)
2864
+		if ($cnt_loop == 1)
2865 2865
 			$this->_spammerMember($member_srl);
2866 2866
 		// proc document and comment
2867
-		elseif($cnt_loop>1)
2867
+		elseif ($cnt_loop > 1)
2868 2868
 			$this->_spammerDocuments($member_srl, $isMoveToTrash);
2869 2869
 
2870 2870
 		// get destination count
@@ -2873,11 +2873,11 @@  discard block
 block discarded – undo
2873 2873
 
2874 2874
 		$total_count = Context::get('total_count');
2875 2875
 		$remain_count = $cnt_document + $cnt_comment;
2876
-		if($cnt_loop == 1) $total_count = $remain_count;
2876
+		if ($cnt_loop == 1) $total_count = $remain_count;
2877 2877
 
2878 2878
 		// get progress percent
2879
-		if($total_count > 0)
2880
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2879
+		if ($total_count > 0)
2880
+			$progress = intval((($total_count - $remain_count) / $total_count) * 100);
2881 2881
 		else
2882 2882
 			$progress = 100;
2883 2883
 
@@ -2901,7 +2901,7 @@  discard block
 block discarded – undo
2901 2901
 	**/
2902 2902
 	private function _spammerMember($member_srl) {
2903 2903
 		$logged_info = Context::get('logged_info');
2904
-		$spam_description = trim( Context::get('spam_description') );
2904
+		$spam_description = trim(Context::get('spam_description'));
2905 2905
 
2906 2906
 		$oMemberModel = getModel('member');
2907 2907
 		$columnList = array('member_srl', 'email_address', 'user_id', 'nick_name', 'description');
@@ -2920,10 +2920,10 @@  discard block
 block discarded – undo
2920 2920
 		$args->user_id = $member_info->user_id;
2921 2921
 		$args->nick_name = $member_info->nick_name;
2922 2922
 		$args->denied = "Y";
2923
-		$args->description = trim( $member_info->description );
2924
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
2923
+		$args->description = trim($member_info->description);
2924
+		if ($args->description != "") $args->description .= "\n"; // add new line
2925 2925
 
2926
-		$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 . "]";
2926
+		$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."]";
2927 2927
 
2928 2928
 		$output = $this->updateMember($args, true);
2929 2929
 
@@ -2952,21 +2952,21 @@  discard block
 block discarded – undo
2952 2952
 		// 1. proc comment, 2. proc document
2953 2953
 		$cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl);
2954 2954
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
2955
-		if($cnt_comment > 0)
2955
+		if ($cnt_comment > 0)
2956 2956
 		{
2957 2957
 			$columnList = array();
2958 2958
 			$commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2959
-			if($commentList) {
2960
-				foreach($commentList as $v) {
2959
+			if ($commentList) {
2960
+				foreach ($commentList as $v) {
2961 2961
 					$oCommentController->deleteComment($v->comment_srl, true, $isMoveToTrash);
2962 2962
 				}
2963 2963
 			}
2964
-		} elseif($cnt_document > 0) {
2964
+		} elseif ($cnt_document > 0) {
2965 2965
 			$columnList = array();
2966 2966
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2967
-			if($documentList) {
2968
-				foreach($documentList as $v) {
2969
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2967
+			if ($documentList) {
2968
+				foreach ($documentList as $v) {
2969
+					if ($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2970 2970
 					else $oDocumentController->deleteDocument($v->document_srl);
2971 2971
 				}
2972 2972
 			}
@@ -2978,24 +2978,24 @@  discard block
 block discarded – undo
2978 2978
 	function _clearMemberCache($member_srl, $site_srl = 0)
2979 2979
 	{
2980 2980
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
2981
-		if($oCacheHandler->isSupport())
2981
+		if ($oCacheHandler->isSupport())
2982 2982
 		{
2983
-			$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_' . $site_srl;
2983
+			$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl;
2984 2984
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2985 2985
 			$oCacheHandler->delete($cache_key);
2986 2986
 
2987
-			if($site_srl !== 0)
2987
+			if ($site_srl !== 0)
2988 2988
 			{
2989
-				$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0';
2989
+				$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_0';
2990 2990
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2991 2991
 				$oCacheHandler->delete($cache_key);
2992 2992
 			}
2993 2993
 		}
2994 2994
 
2995 2995
 		$oCacheHandler = CacheHandler::getInstance('object');
2996
-		if($oCacheHandler->isSupport())
2996
+		if ($oCacheHandler->isSupport())
2997 2997
 		{
2998
-			$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
2998
+			$object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl;
2999 2999
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
3000 3000
 			$oCacheHandler->delete($cache_key);
3001 3001
 		}
Please login to merge, or discard this patch.
Braces   +568 added lines, -250 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);
@@ -768,8 +864,9 @@  discard block
 block discarded – undo
768 864
 		$max_filesize = $config->profile_image_max_filesize;
769 865
 		foreach($config->signupForm as $val)
770 866
 		{
771
-			if($val->name == "profile_image")
772
-				$allow_transparent = $val->allow_transparent_thumbnail == 'Y';
867
+			if($val->name == "profile_image") {
868
+							$allow_transparent = $val->allow_transparent_thumbnail == 'Y';
869
+			}
773 870
 		}
774 871
 
775 872
 		Context::loadLang(_XE_PATH_ . 'modules/file/lang');
@@ -777,10 +874,13 @@  discard block
 block discarded – undo
777 874
 		// Get file information
778 875
 		FileHandler::clearStatCache($target_file);
779 876
 		list($width, $height, $type) = @getimagesize($target_file);
780
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
781
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
782
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
783
-		else
877
+		if(IMAGETYPE_PNG == $type) {
878
+			$ext = 'png';
879
+		} elseif(IMAGETYPE_JPEG == $type) {
880
+			$ext = 'jpg';
881
+		} elseif(IMAGETYPE_GIF == $type) {
882
+			$ext = 'gif';
883
+		} else
784 884
 		{
785 885
 			return $this->stop('msg_not_uploaded_profile_image');
786 886
 		}
@@ -811,8 +911,7 @@  discard block
 block discarded – undo
811 911
 			FileHandler::removeFilesInDir($target_path);
812 912
 			FileHandler::moveFile($temp_filename, $target_filename);
813 913
 			FileHandler::clearStatCache($target_filename);
814
-		}
815
-		else
914
+		} else
816 915
 		{
817 916
 			// 파일 용량 제한
818 917
 			$filesize = filesize($target_file);
@@ -841,20 +940,30 @@  discard block
 block discarded – undo
841 940
 	{
842 941
 		// Check if the file is successfully uploaded
843 942
 		$file = $_FILES['image_name'];
844
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
943
+		if(!is_uploaded_file($file['tmp_name'])) {
944
+			return $this->stop('msg_not_uploaded_image_name');
945
+		}
845 946
 		// Ignore if member_srl is invalid or doesn't exist.
846 947
 		$member_srl = Context::get('member_srl');
847
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
948
+		if(!$member_srl) {
949
+			return $this->stop('msg_not_uploaded_image_name');
950
+		}
848 951
 
849 952
 		$logged_info = Context::get('logged_info');
850
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
953
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
954
+			return $this->stop('msg_not_uploaded_image_name');
955
+		}
851 956
 		// Return if member module is set not to use an image name or the user is not an administrator ;
852 957
 		$oMemberModel = getModel('member');
853 958
 		$config = $oMemberModel->getMemberConfig();
854
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
959
+		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') {
960
+			return $this->stop('msg_not_uploaded_image_name');
961
+		}
855 962
 
856 963
 		$output = $this->insertImageName($member_srl, $file['tmp_name']);
857
-		if(!$output->toBool()) return $output;
964
+		if(!$output->toBool()) {
965
+			return $output;
966
+		}
858 967
 
859 968
 		// Page refresh
860 969
 		//$this->setRefreshPage();
@@ -909,8 +1018,7 @@  discard block
 block discarded – undo
909 1018
 			FileHandler::removeFilesInDir($target_path);
910 1019
 			FileHandler::moveFile($temp_filename, $target_filename);
911 1020
 			FileHandler::clearStatCache($target_filename);
912
-		}
913
-		else
1021
+		} else
914 1022
 		{
915 1023
 			// 파일 용량 제한
916 1024
 			$filesize = filesize($target_file);
@@ -987,20 +1095,30 @@  discard block
 block discarded – undo
987 1095
 	{
988 1096
 		// Check if the file is successfully uploaded
989 1097
 		$file = $_FILES['image_mark'];
990
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
1098
+		if(!is_uploaded_file($file['tmp_name'])) {
1099
+			return $this->stop('msg_not_uploaded_image_mark');
1100
+		}
991 1101
 		// Ignore if member_srl is invalid or doesn't exist.
992 1102
 		$member_srl = Context::get('member_srl');
993
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
1103
+		if(!$member_srl) {
1104
+			return $this->stop('msg_not_uploaded_image_mark');
1105
+		}
994 1106
 
995 1107
 		$logged_info = Context::get('logged_info');
996
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
1108
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
1109
+			return $this->stop('msg_not_uploaded_image_mark');
1110
+		}
997 1111
 		// Membership in the images mark the module using the ban was set by an administrator or return;
998 1112
 		$oMemberModel = getModel('member');
999 1113
 		$config = $oMemberModel->getMemberConfig();
1000
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
1114
+		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') {
1115
+			return $this->stop('msg_not_uploaded_image_mark');
1116
+		}
1001 1117
 
1002 1118
 		$this->insertImageMark($member_srl, $file['tmp_name']);
1003
-		if(!$output->toBool()) return $output;
1119
+		if(!$output->toBool()) {
1120
+			return $output;
1121
+		}
1004 1122
 
1005 1123
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
1006 1124
 		$this->setRedirectUrl($returnUrl);
@@ -1051,8 +1169,7 @@  discard block
 block discarded – undo
1051 1169
 			FileHandler::removeFilesInDir($target_path);
1052 1170
 			FileHandler::moveFile($temp_filename, $target_filename);
1053 1171
 			FileHandler::clearStatCache($target_filename);
1054
-		}
1055
-		else
1172
+		} else
1056 1173
 		{
1057 1174
 			$filesize = filesize($target_file);
1058 1175
 			if($max_filesize && $filesize > ($max_filesize * 1024))
@@ -1104,14 +1221,18 @@  discard block
 block discarded – undo
1104 1221
 	function procMemberFindAccount()
1105 1222
 	{
1106 1223
 		$email_address = Context::get('email_address');
1107
-		if(!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1224
+		if(!$email_address) {
1225
+			return new BaseObject(-1, 'msg_invalid_request');
1226
+		}
1108 1227
 
1109 1228
 		$oMemberModel = getModel('member');
1110 1229
 		$oModuleModel = getModel('module');
1111 1230
 
1112 1231
 		// Check if a member having the same email address exists
1113 1232
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1114
-		if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1233
+		if(!$member_srl) {
1234
+			return new BaseObject(-1, 'msg_email_not_exists');
1235
+		}
1115 1236
 
1116 1237
 		// Get information of the member
1117 1238
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
@@ -1123,7 +1244,9 @@  discard block
 block discarded – undo
1123 1244
 			$chk_args = new stdClass;
1124 1245
 			$chk_args->member_srl = $member_info->member_srl;
1125 1246
 			$output = executeQuery('member.chkAuthMail', $chk_args);
1126
-			if($output->toBool() && $output->data->count != '0') return new BaseObject(-1, 'msg_user_not_confirmed');
1247
+			if($output->toBool() && $output->data->count != '0') {
1248
+				return new BaseObject(-1, 'msg_user_not_confirmed');
1249
+			}
1127 1250
 		}
1128 1251
 
1129 1252
 		// Insert data into the authentication DB
@@ -1136,7 +1259,9 @@  discard block
 block discarded – undo
1136 1259
 		$args->is_register = 'N';
1137 1260
 
1138 1261
 		$output = executeQuery('member.insertAuthMail', $args);
1139
-		if(!$output->toBool()) return $output;
1262
+		if(!$output->toBool()) {
1263
+			return $output;
1264
+		}
1140 1265
 		// Get content of the email to send a member
1141 1266
 		Context::set('auth_args', $args);
1142 1267
 
@@ -1153,8 +1278,7 @@  discard block
 block discarded – undo
1153 1278
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1154 1279
 				}
1155 1280
 			}
1156
-		}
1157
-		else
1281
+		} else
1158 1282
 		{
1159 1283
 			$memberInfo[$lang->user_id] = $args->user_id;
1160 1284
 			$memberInfo[$lang->user_name] = $args->user_name;
@@ -1163,13 +1287,19 @@  discard block
 block discarded – undo
1163 1287
 		}
1164 1288
 		Context::set('memberInfo', $memberInfo);
1165 1289
 
1166
-		if(!$member_config->skin) $member_config->skin = "default";
1167
-		if(!$member_config->colorset) $member_config->colorset = "white";
1290
+		if(!$member_config->skin) {
1291
+			$member_config->skin = "default";
1292
+		}
1293
+		if(!$member_config->colorset) {
1294
+			$member_config->colorset = "white";
1295
+		}
1168 1296
 
1169 1297
 		Context::set('member_config', $member_config);
1170 1298
 
1171 1299
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1172
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1300
+		if(!is_dir($tpl_path)) {
1301
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1302
+		}
1173 1303
 
1174 1304
 		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1175 1305
 		Context::set('find_url', $find_url);
@@ -1212,19 +1342,25 @@  discard block
 block discarded – undo
1212 1342
 		$find_account_question = trim(Context::get('find_account_question'));
1213 1343
 		$find_account_answer = trim(Context::get('find_account_answer'));
1214 1344
 
1215
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new BaseObject(-1, 'msg_invalid_request');
1345
+		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) {
1346
+			return new BaseObject(-1, 'msg_invalid_request');
1347
+		}
1216 1348
 
1217 1349
 		$oModuleModel = getModel('module');
1218 1350
 		// Check if a member having the same email address exists
1219 1351
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1220
-		if(!$member_srl) return new BaseObject(-1, 'msg_email_not_exists');
1352
+		if(!$member_srl) {
1353
+			return new BaseObject(-1, 'msg_email_not_exists');
1354
+		}
1221 1355
 
1222 1356
 		// Get information of the member
1223 1357
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1224 1358
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1225 1359
 
1226 1360
 		// Display a message if no answer is entered
1227
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new BaseObject(-1, 'msg_question_not_exists');
1361
+		if(!$member_info->find_account_question || !$member_info->find_account_answer) {
1362
+			return new BaseObject(-1, 'msg_question_not_exists');
1363
+		}
1228 1364
 
1229 1365
 		// 답변 확인
1230 1366
 		$hashed = $oPassword->checkAlgorithm($member_info->find_account_answer);
@@ -1233,12 +1369,10 @@  discard block
 block discarded – undo
1233 1369
 		if($member_info->find_account_question != $find_account_question)
1234 1370
 		{
1235 1371
 			$authed = false;
1236
-		}
1237
-		else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1372
+		} else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1238 1373
 		{
1239 1374
 			$authed = false;
1240
-		}
1241
-		else if(!$hashed && $find_account_answer != $member_info->find_account_answer)
1375
+		} else if(!$hashed && $find_account_answer != $member_info->find_account_answer)
1242 1376
 		{
1243 1377
 			$authed = false;
1244 1378
 		}
@@ -1267,7 +1401,9 @@  discard block
 block discarded – undo
1267 1401
 		$args->password = $temp_password;
1268 1402
 		$args->change_password_date = '1';
1269 1403
 		$output = $this->updateMemberPassword($args);
1270
-		if(!$output->toBool()) return $output;
1404
+		if(!$output->toBool()) {
1405
+			return $output;
1406
+		}
1271 1407
 
1272 1408
 		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1273 1409
 
@@ -1324,8 +1460,7 @@  discard block
 block discarded – undo
1324 1460
 		if($output->data->is_register == 'Y')
1325 1461
 		{
1326 1462
 			$args->denied = 'N';
1327
-		}
1328
-		else
1463
+		} else
1329 1464
 		{
1330 1465
 			$args->password = $oMemberModel->hashPassword($args->password);
1331 1466
 		}
@@ -1359,33 +1494,45 @@  discard block
 block discarded – undo
1359 1494
 	{
1360 1495
 		// Get an email_address
1361 1496
 		$email_address = Context::get('email_address');
1362
-		if(!$email_address) return new BaseObject(-1, 'msg_invalid_request');
1497
+		if(!$email_address) {
1498
+			return new BaseObject(-1, 'msg_invalid_request');
1499
+		}
1363 1500
 		// Log test by using email_address
1364 1501
 		$oMemberModel = getModel('member');
1365 1502
 
1366 1503
 		$args = new stdClass;
1367 1504
 		$args->email_address = $email_address;
1368 1505
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1369
-		if(!$memberSrl) return new BaseObject(-1, 'msg_not_exists_member');
1506
+		if(!$memberSrl) {
1507
+			return new BaseObject(-1, 'msg_not_exists_member');
1508
+		}
1370 1509
 
1371 1510
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1372 1511
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1373 1512
 
1374 1513
 		$oModuleModel = getModel('module');
1375 1514
 		$member_config = $oModuleModel->getModuleConfig('member');
1376
-		if(!$member_config->skin) $member_config->skin = "default";
1377
-		if(!$member_config->colorset) $member_config->colorset = "white";
1515
+		if(!$member_config->skin) {
1516
+			$member_config->skin = "default";
1517
+		}
1518
+		if(!$member_config->colorset) {
1519
+			$member_config->colorset = "white";
1520
+		}
1378 1521
 
1379 1522
 		// Check if a authentication mail has been sent previously
1380 1523
 		$chk_args = new stdClass;
1381 1524
 		$chk_args->member_srl = $member_info->member_srl;
1382 1525
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1383
-		if($output->toBool() && $output->data->count == '0') return new BaseObject(-1, 'msg_invalid_request');
1526
+		if($output->toBool() && $output->data->count == '0') {
1527
+			return new BaseObject(-1, 'msg_invalid_request');
1528
+		}
1384 1529
 
1385 1530
 		$auth_args = new stdClass;
1386 1531
 		$auth_args->member_srl = $member_info->member_srl;
1387 1532
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1388
-		if(!$output->data || !$output->data[0]->auth_key)  return new BaseObject(-1, 'msg_invalid_request');
1533
+		if(!$output->data || !$output->data[0]->auth_key) {
1534
+			return new BaseObject(-1, 'msg_invalid_request');
1535
+		}
1389 1536
 		$auth_info = $output->data[0];
1390 1537
 
1391 1538
 		// Update the regdate of authmail entry
@@ -1406,8 +1553,7 @@  discard block
 block discarded – undo
1406 1553
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1407 1554
 				}
1408 1555
 			}
1409
-		}
1410
-		else
1556
+		} else
1411 1557
 		{
1412 1558
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1413 1559
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1420,7 +1566,9 @@  discard block
 block discarded – undo
1420 1566
 		Context::set('member_config', $member_config);
1421 1567
 
1422 1568
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1423
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1569
+		if(!is_dir($tpl_path)) {
1570
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1571
+		}
1424 1572
 
1425 1573
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1426 1574
 		Context::set('auth_url', $auth_url);
@@ -1498,7 +1646,9 @@  discard block
 block discarded – undo
1498 1646
 		$auth_args->is_register = 'Y';
1499 1647
 
1500 1648
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1501
-		if(!$output->toBool()) return $output;
1649
+		if(!$output->toBool()) {
1650
+			return $output;
1651
+		}
1502 1652
 
1503 1653
 		$memberInfo->email_address = $newEmail;
1504 1654
 
@@ -1532,8 +1682,7 @@  discard block
 block discarded – undo
1532 1682
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1533 1683
 				}
1534 1684
 			}
1535
-		}
1536
-		else
1685
+		} else
1537 1686
 		{
1538 1687
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1539 1688
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1542,13 +1691,19 @@  discard block
 block discarded – undo
1542 1691
 		}
1543 1692
 		Context::set('memberInfo', $memberInfo);
1544 1693
 
1545
-		if(!$member_config->skin) $member_config->skin = "default";
1546
-		if(!$member_config->colorset) $member_config->colorset = "white";
1694
+		if(!$member_config->skin) {
1695
+			$member_config->skin = "default";
1696
+		}
1697
+		if(!$member_config->colorset) {
1698
+			$member_config->colorset = "white";
1699
+		}
1547 1700
 
1548 1701
 		Context::set('member_config', $member_config);
1549 1702
 
1550 1703
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1551
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1704
+		if(!is_dir($tpl_path)) {
1705
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1706
+		}
1552 1707
 
1553 1708
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1554 1709
 		Context::set('auth_url', $auth_url);
@@ -1573,7 +1728,9 @@  discard block
 block discarded – undo
1573 1728
 	{
1574 1729
 		$site_module_info = Context::get('site_module_info');
1575 1730
 		$logged_info = Context::get('logged_info');
1576
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request');
1731
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1732
+			return new BaseObject(-1,'msg_invalid_request');
1733
+		}
1577 1734
 
1578 1735
 		$oMemberModel = getModel('member');
1579 1736
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1592,13 +1749,17 @@  discard block
 block discarded – undo
1592 1749
 	{
1593 1750
 		$site_module_info = Context::get('site_module_info');
1594 1751
 		$logged_info = Context::get('logged_info');
1595
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new BaseObject(-1,'msg_invalid_request');
1752
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1753
+			return new BaseObject(-1,'msg_invalid_request');
1754
+		}
1596 1755
 
1597 1756
 		$args = new stdClass;
1598 1757
 		$args->site_srl= $site_module_info->site_srl;
1599 1758
 		$args->member_srl = $logged_info->member_srl;
1600 1759
 		$output = executeQuery('member.deleteMembersGroup', $args);
1601
-		if(!$output->toBool()) return $output;
1760
+		if(!$output->toBool()) {
1761
+			return $output;
1762
+		}
1602 1763
 		$this->setMessage('success_deleted');
1603 1764
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1604 1765
 	}
@@ -1612,17 +1773,37 @@  discard block
 block discarded – undo
1612 1773
 	 */
1613 1774
 	function setMemberConfig($args)
1614 1775
 	{
1615
-		if(!$args->skin) $args->skin = "default";
1616
-		if(!$args->colorset) $args->colorset = "white";
1617
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1618
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1619
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1776
+		if(!$args->skin) {
1777
+			$args->skin = "default";
1778
+		}
1779
+		if(!$args->colorset) {
1780
+			$args->colorset = "white";
1781
+		}
1782
+		if(!$args->editor_skin) {
1783
+			$args->editor_skin= "ckeditor";
1784
+		}
1785
+		if(!$args->editor_colorset) {
1786
+			$args->editor_colorset = "moono";
1787
+		}
1788
+		if($args->enable_join!='Y') {
1789
+			$args->enable_join = 'N';
1790
+		}
1620 1791
 		$args->enable_openid= 'N';
1621
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1622
-		if($args->image_name!='Y') $args->image_name = 'N';
1623
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1624
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1625
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1792
+		if($args->profile_image !='Y') {
1793
+			$args->profile_image = 'N';
1794
+		}
1795
+		if($args->image_name!='Y') {
1796
+			$args->image_name = 'N';
1797
+		}
1798
+		if($args->image_mark!='Y') {
1799
+			$args->image_mark = 'N';
1800
+		}
1801
+		if($args->group_image_mark!='Y') {
1802
+			$args->group_image_mark = 'N';
1803
+		}
1804
+		if(!trim(strip_tags($args->agreement))) {
1805
+			$args->agreement = null;
1806
+		}
1626 1807
 		$args->limit_day = (int)$args->limit_day;
1627 1808
 
1628 1809
 		$agreement = trim($args->agreement);
@@ -1630,7 +1811,9 @@  discard block
 block discarded – undo
1630 1811
 
1631 1812
 		$oModuleController = getController('module');
1632 1813
 		$output = $oModuleController->insertModuleConfig('member',$args);
1633
-		if(!$output->toBool()) return $output;
1814
+		if(!$output->toBool()) {
1815
+			return $output;
1816
+		}
1634 1817
 
1635 1818
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1636 1819
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1655,7 +1838,9 @@  discard block
 block discarded – undo
1655 1838
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1656 1839
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1657 1840
 
1658
-		if(!$check_signature) return FileHandler::removeFile($filename);
1841
+		if(!$check_signature) {
1842
+			return FileHandler::removeFile($filename);
1843
+		}
1659 1844
 
1660 1845
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1661 1846
 		FileHandler::makeDir($path);
@@ -1689,7 +1874,9 @@  discard block
 block discarded – undo
1689 1874
 		$args = new stdClass();
1690 1875
 		$args->member_srl = $member_srl;
1691 1876
 		$args->group_srl = $group_srl;
1692
-		if($site_srl) $args->site_srl = $site_srl;
1877
+		if($site_srl) {
1878
+			$args->site_srl = $site_srl;
1879
+		}
1693 1880
 
1694 1881
 		// Add
1695 1882
 		$output = executeQuery('member.addMemberToGroup',$args);
@@ -1715,15 +1902,21 @@  discard block
 block discarded – undo
1715 1902
 		$obj->member_srl = implode(',',$args->member_srl);
1716 1903
 
1717 1904
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1718
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1905
+		if($output->data) {
1906
+			foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1907
+		}
1719 1908
 
1720 1909
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1721
-		if(!$output->toBool()) return $output;
1910
+		if(!$output->toBool()) {
1911
+			return $output;
1912
+		}
1722 1913
 
1723 1914
 		$inserted_members = array();
1724 1915
 		foreach($args->member_srl as $key => $val)
1725 1916
 		{
1726
-			if($inserted_members[$val]) continue;
1917
+			if($inserted_members[$val]) {
1918
+				continue;
1919
+			}
1727 1920
 			$inserted_members[$val] = true;
1728 1921
 
1729 1922
 			unset($obj);
@@ -1733,7 +1926,9 @@  discard block
 block discarded – undo
1733 1926
 			$obj->site_srl = $args->site_srl;
1734 1927
 			$obj->regdate = $date[$obj->member_srl];
1735 1928
 			$output = executeQuery('member.addMemberToGroup', $obj);
1736
-			if(!$output->toBool()) return $output;
1929
+			if(!$output->toBool()) {
1930
+				return $output;
1931
+			}
1737 1932
 
1738 1933
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1739 1934
 		}
@@ -1795,8 +1990,7 @@  discard block
 block discarded – undo
1795 1990
 				if($config->identifier == 'user_id')
1796 1991
 				{
1797 1992
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1798
-				}
1799
-				else
1993
+				} else
1800 1994
 				{
1801 1995
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1802 1996
 				}
@@ -1805,8 +1999,7 @@  discard block
 block discarded – undo
1805 1999
 					$do_auto_login = true;
1806 2000
 				}
1807 2001
 
1808
-			}
1809
-			else
2002
+			} else
1810 2003
 			{
1811 2004
 				$do_auto_login = true;
1812 2005
 			}
@@ -1815,8 +2008,7 @@  discard block
 block discarded – undo
1815 2008
 		if($do_auto_login)
1816 2009
 		{
1817 2010
 			$output = $this->doLogin($user_id);
1818
-		}
1819
-		else
2011
+		} else
1820 2012
 		{
1821 2013
 			executeQuery('member.deleteAutologin', $args);
1822 2014
 			saveCookie('xeak');
@@ -1835,13 +2027,17 @@  discard block
 block discarded – undo
1835 2027
 	function doLogin($user_id, $password = '', $keep_signed = false)
1836 2028
 	{
1837 2029
 		$user_id = strtolower($user_id);
1838
-		if(!$user_id) return new BaseObject(-1, 'null_user_id');
2030
+		if(!$user_id) {
2031
+			return new BaseObject(-1, 'null_user_id');
2032
+		}
1839 2033
 		// Call a trigger before log-in (before)
1840 2034
 		$trigger_obj = new stdClass();
1841 2035
 		$trigger_obj->user_id = $user_id;
1842 2036
 		$trigger_obj->password = $password;
1843 2037
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1844
-		if(!$trigger_output->toBool()) return $trigger_output;
2038
+		if(!$trigger_output->toBool()) {
2039
+			return $trigger_output;
2040
+		}
1845 2041
 		// Create a member model object
1846 2042
 		$oMemberModel = getModel('member');
1847 2043
 
@@ -1856,15 +2052,18 @@  discard block
 block discarded – undo
1856 2052
 			// Get user_id information
1857 2053
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1858 2054
 			// Set an invalid user if no value returned
1859
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
2055
+			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) {
2056
+				return $this->recordLoginError(-1, 'invalid_email_address');
2057
+			}
1860 2058
 
1861
-		}
1862
-		else
2059
+		} else
1863 2060
 		{
1864 2061
 			// Get user_id information
1865 2062
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1866 2063
 			// Set an invalid user if no value returned
1867
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
2064
+			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) {
2065
+				return $this->recordLoginError(-1, 'invalid_user_id');
2066
+			}
1868 2067
 		}
1869 2068
 
1870 2069
 		$output = executeQuery('member.getLoginCountByIp', $args);
@@ -1876,14 +2075,18 @@  discard block
 block discarded – undo
1876 2075
 			if($term < $config->max_error_count_time)
1877 2076
 			{
1878 2077
 				$term = $config->max_error_count_time - $term;
1879
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1880
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1881
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1882
-				else $term = intval($term/86400).Context::getLang('unit_day');
2078
+				if($term < 60) {
2079
+					$term = intval($term).Context::getLang('unit_sec');
2080
+				} elseif(60 <= $term && $term < 3600) {
2081
+					$term = intval($term/60).Context::getLang('unit_min');
2082
+				} elseif(3600 <= $term && $term < 86400) {
2083
+					$term = intval($term/3600).Context::getLang('unit_hour');
2084
+				} else {
2085
+					$term = intval($term/86400).Context::getLang('unit_day');
2086
+				}
1883 2087
 
1884 2088
 				return new BaseObject(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1885
-			}
1886
-			else
2089
+			} else
1887 2090
 			{
1888 2091
 				$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1889 2092
 				$output = executeQuery('member.deleteLoginCountByIp', $args);
@@ -1910,7 +2113,9 @@  discard block
 block discarded – undo
1910 2113
 			return new BaseObject(-1,'msg_user_denied');
1911 2114
 		}
1912 2115
 		// Notify if denied_date is less than the current time
1913
-		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")));
2116
+		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) {
2117
+			return new BaseObject(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
2118
+		}
1914 2119
 		// Update the latest login time
1915 2120
 		$args->member_srl = $this->memberInfo->member_srl;
1916 2121
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1959,7 +2164,9 @@  discard block
 block discarded – undo
1959 2164
 		}
1960 2165
 		// Call a trigger after successfully log-in (after)
1961 2166
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1962
-		if(!$trigger_output->toBool()) return $trigger_output;
2167
+		if(!$trigger_output->toBool()) {
2168
+			return $trigger_output;
2169
+		}
1963 2170
 		// When user checked to use auto-login
1964 2171
 		if($keep_signed)
1965 2172
 		{
@@ -1973,7 +2180,9 @@  discard block
 block discarded – undo
1973 2180
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1974 2181
 			executeQuery('member.deleteAutologin', $autologin_args);
1975 2182
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1976
-			if($autologin_output->toBool()) saveCookie('xeak', $autologin_args->autologin_key, true, $_SERVER['REQUEST_TIME']+31536000);
2183
+			if($autologin_output->toBool()) {
2184
+				saveCookie('xeak', $autologin_args->autologin_key, true, $_SERVER['REQUEST_TIME']+31536000);
2185
+			}
1977 2186
 		}
1978 2187
 		if($this->memberInfo->is_admin == 'Y')
1979 2188
 		{
@@ -2062,7 +2271,9 @@  discard block
 block discarded – undo
2062 2271
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
2063 2272
 	{
2064 2273
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
2065
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
2274
+		if(!is_array($member_popup_menu_list)) {
2275
+			$member_popup_menu_list = array();
2276
+		}
2066 2277
 
2067 2278
 		$obj = new stdClass;
2068 2279
 		$obj->url = $url;
@@ -2081,35 +2292,54 @@  discard block
 block discarded – undo
2081 2292
 	{
2082 2293
 		// Call a trigger (before)
2083 2294
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
2084
-		if(!$output->toBool()) return $output;
2295
+		if(!$output->toBool()) {
2296
+			return $output;
2297
+		}
2085 2298
 		// Terms and Conditions portion of the information set up by members reaffirmed
2086 2299
 		$oModuleModel = getModel('module');
2087 2300
 		$config = $oModuleModel->getModuleConfig('member');
2088 2301
 
2089 2302
 		$logged_info = Context::get('logged_info');
2090 2303
 		// If the date of the temporary restrictions limit further information on the date of
2091
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2304
+		if($config->limit_day) {
2305
+			$args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2306
+		}
2092 2307
 
2093 2308
 		$args->member_srl = getNextSequence();
2094 2309
 		$args->list_order = -1 * $args->member_srl;
2095 2310
 
2096 2311
 		// Execute insert or update depending on the value of member_srl
2097
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2312
+		if(!$args->user_id) {
2313
+			$args->user_id = 't'.$args->member_srl;
2314
+		}
2098 2315
 		// Enter the user's identity changed to lowercase
2099
-		else $args->user_id = strtolower($args->user_id);
2100
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2101
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
2316
+		else {
2317
+			$args->user_id = strtolower($args->user_id);
2318
+		}
2319
+		if(!$args->user_name) {
2320
+			$args->user_name = $args->member_srl;
2321
+		}
2322
+		if(!$args->nick_name) {
2323
+			$args->nick_name = $args->member_srl;
2324
+		}
2102 2325
 
2103 2326
 		// Control of essential parameters
2104
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2105
-		if($args->denied!='Y') $args->denied = 'N';
2106
-		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y';
2327
+		if($args->allow_mailing!='Y') {
2328
+			$args->allow_mailing = 'N';
2329
+		}
2330
+		if($args->denied!='Y') {
2331
+			$args->denied = 'N';
2332
+		}
2333
+		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) {
2334
+			$args->allow_message = 'Y';
2335
+		}
2107 2336
 
2108 2337
 		if($logged_info->is_admin == 'Y')
2109 2338
 		{
2110
-			if($args->is_admin!='Y') $args->is_admin = 'N';
2111
-		}
2112
-		else
2339
+			if($args->is_admin!='Y') {
2340
+				$args->is_admin = 'N';
2341
+			}
2342
+		} else
2113 2343
 		{
2114 2344
 			unset($args->is_admin);
2115 2345
 		}
@@ -2122,8 +2352,12 @@  discard block
 block discarded – undo
2122 2352
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2123 2353
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2124 2354
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2125
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2126
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
2355
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) {
2356
+			$args->homepage = 'http://'.$args->homepage;
2357
+		}
2358
+		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) {
2359
+			$args->blog = 'http://'.$args->blog;
2360
+		}
2127 2361
 
2128 2362
 		// Create a model object
2129 2363
 		$oMemberModel = getModel('member');
@@ -2137,8 +2371,7 @@  discard block
 block discarded – undo
2137 2371
 				return new BaseObject(-1, $message[$config->password_strength]);
2138 2372
 			}
2139 2373
 			$args->password = $oMemberModel->hashPassword($args->password);
2140
-		}
2141
-		elseif(!$args->password)
2374
+		} elseif(!$args->password)
2142 2375
 		{
2143 2376
 			unset($args->password);
2144 2377
 		}
@@ -2146,8 +2379,7 @@  discard block
 block discarded – undo
2146 2379
 		if($args->find_account_answer && !$password_is_hashed)
2147 2380
 		{
2148 2381
 			$args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer);
2149
-		}
2150
-		elseif(!$args->find_account_answer)
2382
+		} elseif(!$args->find_account_answer)
2151 2383
 		{
2152 2384
 			unset($args->find_account_answer);
2153 2385
 		}
@@ -2188,8 +2420,12 @@  discard block
 block discarded – undo
2188 2420
 		// Insert data into the DB
2189 2421
 		$args->list_order = -1 * $args->member_srl;
2190 2422
 
2191
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2192
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2423
+		if(!$args->user_id) {
2424
+			$args->user_id = 't'.$args->member_srl;
2425
+		}
2426
+		if(!$args->user_name) {
2427
+			$args->user_name = $args->member_srl;
2428
+		}
2193 2429
 
2194 2430
 		$oDB = &DB::getInstance();
2195 2431
 		$oDB->begin();
@@ -2201,8 +2437,11 @@  discard block
 block discarded – undo
2201 2437
 			return $output;
2202 2438
 		}
2203 2439
 
2204
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2205
-		else $group_srl_list = explode('|@|', $args->group_srl_list);
2440
+		if(is_array($args->group_srl_list)) {
2441
+			$group_srl_list = $args->group_srl_list;
2442
+		} else {
2443
+			$group_srl_list = explode('|@|', $args->group_srl_list);
2444
+		}
2206 2445
 		// If no value is entered the default group, the value of group registration
2207 2446
 		if(!$args->group_srl_list)
2208 2447
 		{
@@ -2219,8 +2458,7 @@  discard block
 block discarded – undo
2219 2458
 				}
2220 2459
 			}
2221 2460
 			// If the value is the value of the group entered the group registration
2222
-		}
2223
-		else
2461
+		} else
2224 2462
 		{
2225 2463
 			for($i=0;$i<count($group_srl_list);$i++)
2226 2464
 			{
@@ -2281,27 +2519,39 @@  discard block
 block discarded – undo
2281 2519
 	{
2282 2520
 		// Call a trigger (before)
2283 2521
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2284
-		if(!$output->toBool()) return $output;
2522
+		if(!$output->toBool()) {
2523
+			return $output;
2524
+		}
2285 2525
 		// Create a model object
2286 2526
 		$oMemberModel = getModel('member');
2287 2527
 
2288 2528
 		$logged_info = Context::get('logged_info');
2289 2529
 		// Get what you want to modify the original information
2290
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2530
+		if(!$this->memberInfo) {
2531
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2532
+		}
2291 2533
 		// Control of essential parameters
2292
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2293
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2534
+		if($args->allow_mailing!='Y') {
2535
+			$args->allow_mailing = 'N';
2536
+		}
2537
+		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) {
2538
+			$args->allow_message = 'Y';
2539
+		}
2294 2540
 
2295 2541
 		if($logged_info->is_admin == 'Y')
2296 2542
 		{
2297
-			if($args->denied!='Y') $args->denied = 'N';
2298
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2299
-		}
2300
-		else
2543
+			if($args->denied!='Y') {
2544
+				$args->denied = 'N';
2545
+			}
2546
+			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) {
2547
+				$args->is_admin = 'N';
2548
+			}
2549
+		} else
2301 2550
 		{
2302 2551
 			unset($args->is_admin);
2303
-			if($is_admin == false)
2304
-				unset($args->denied);
2552
+			if($is_admin == false) {
2553
+							unset($args->denied);
2554
+			}
2305 2555
 			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2306 2556
 			{
2307 2557
 				return $this->stop('msg_invalid_request');
@@ -2309,13 +2559,19 @@  discard block
 block discarded – undo
2309 2559
 		}
2310 2560
 
2311 2561
 		// Sanitize user ID, username, nickname, homepage, blog
2312
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2562
+		if($args->user_id) {
2563
+			$args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2564
+		}
2313 2565
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2314 2566
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2315 2567
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2316 2568
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2317
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2318
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2569
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) {
2570
+			$args->homepage = 'http://'.$args->homepage;
2571
+		}
2572
+		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) {
2573
+			$args->blog = 'http://'.$args->blog;
2574
+		}
2319 2575
 
2320 2576
 		// check member identifier form
2321 2577
 		$config = $oMemberModel->getMemberConfig();
@@ -2332,8 +2588,7 @@  discard block
 block discarded – undo
2332 2588
 				return new BaseObject(-1,'msg_exists_email_address');
2333 2589
 			}
2334 2590
 			$args->email_address = $orgMemberInfo->email_address;
2335
-		}
2336
-		else
2591
+		} else
2337 2592
 		{
2338 2593
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2339 2594
 			if($member_srl && $args->member_srl != $member_srl)
@@ -2390,16 +2645,14 @@  discard block
 block discarded – undo
2390 2645
 				return new BaseObject(-1, $message[$config->password_strength]);
2391 2646
 			}
2392 2647
 			$args->password = $oMemberModel->hashPassword($args->password);
2393
-		}
2394
-		else
2648
+		} else
2395 2649
 		{
2396 2650
 			$args->password = $orgMemberInfo->password;
2397 2651
 		}
2398 2652
 
2399 2653
 		if($args->find_account_answer) {
2400 2654
 			$args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer);
2401
-		}
2402
-		else
2655
+		} else
2403 2656
 		{
2404 2657
 			$oPassword =  new Password();
2405 2658
 			$hashed = $oPassword->checkAlgorithm($orgMemberInfo->find_account_answer);
@@ -2411,11 +2664,21 @@  discard block
 block discarded – undo
2411 2664
 			}
2412 2665
 		}
2413 2666
 
2414
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2415
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2416
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2417
-		if(!$args->description) $args->description = $orgMemberInfo->description;
2418
-		if(!$args->birthday) $args->birthday = '';
2667
+		if(!$args->user_name) {
2668
+			$args->user_name = $orgMemberInfo->user_name;
2669
+		}
2670
+		if(!$args->user_id) {
2671
+			$args->user_id = $orgMemberInfo->user_id;
2672
+		}
2673
+		if(!$args->nick_name) {
2674
+			$args->nick_name = $orgMemberInfo->nick_name;
2675
+		}
2676
+		if(!$args->description) {
2677
+			$args->description = $orgMemberInfo->description;
2678
+		}
2679
+		if(!$args->birthday) {
2680
+			$args->birthday = '';
2681
+		}
2419 2682
 
2420 2683
 		$output = executeQuery('member.updateMember', $args);
2421 2684
 
@@ -2427,8 +2690,11 @@  discard block
 block discarded – undo
2427 2690
 
2428 2691
 		if($args->group_srl_list)
2429 2692
 		{
2430
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2431
-			else $group_srl_list = explode('|@|', $args->group_srl_list);
2693
+			if(is_array($args->group_srl_list)) {
2694
+				$group_srl_list = $args->group_srl_list;
2695
+			} else {
2696
+				$group_srl_list = explode('|@|', $args->group_srl_list);
2697
+			}
2432 2698
 			// If the group information, group information changes
2433 2699
 			if(count($group_srl_list) > 0)
2434 2700
 			{
@@ -2471,7 +2737,9 @@  discard block
 block discarded – undo
2471 2737
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2472 2738
 
2473 2739
 		// Save Session
2474
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2740
+		if(!$this->memberInfo) {
2741
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2742
+		}
2475 2743
 		$logged_info = Context::get('logged_info');
2476 2744
 
2477 2745
 		$output->add('member_srl', $args->member_srl);
@@ -2497,8 +2765,7 @@  discard block
 block discarded – undo
2497 2765
 			}
2498 2766
 
2499 2767
 			$args->password = $oMemberModel->hashPassword($args->password);
2500
-		}
2501
-		else if($args->hashed_password)
2768
+		} else if($args->hashed_password)
2502 2769
 		{
2503 2770
 			$args->password = $args->hashed_password;
2504 2771
 		}
@@ -2533,7 +2800,9 @@  discard block
 block discarded – undo
2533 2800
 		$trigger_obj = new stdClass();
2534 2801
 		$trigger_obj->member_srl = $member_srl;
2535 2802
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2536
-		if(!$output->toBool()) return $output;
2803
+		if(!$output->toBool()) {
2804
+			return $output;
2805
+		}
2537 2806
 		// Create a model object
2538 2807
 		$oMemberModel = getModel('member');
2539 2808
 		// Bringing the user's information
@@ -2542,9 +2811,13 @@  discard block
 block discarded – undo
2542 2811
 			$columnList = array('member_srl', 'is_admin');
2543 2812
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2544 2813
 		}
2545
-		if(!$this->memberInfo) return new BaseObject(-1, 'msg_not_exists_member');
2814
+		if(!$this->memberInfo) {
2815
+			return new BaseObject(-1, 'msg_not_exists_member');
2816
+		}
2546 2817
 		// If managers can not be deleted
2547
-		if($this->memberInfo->is_admin == 'Y') return new BaseObject(-1, 'msg_cannot_delete_admin');
2818
+		if($this->memberInfo->is_admin == 'Y') {
2819
+			return new BaseObject(-1, 'msg_cannot_delete_admin');
2820
+		}
2548 2821
 
2549 2822
 		$oDB = &DB::getInstance();
2550 2823
 		$oDB->begin();
@@ -2608,7 +2881,9 @@  discard block
 block discarded – undo
2608 2881
 	 */
2609 2882
 	function destroySessionInfo()
2610 2883
 	{
2611
-		if(!$_SESSION || !is_array($_SESSION)) return;
2884
+		if(!$_SESSION || !is_array($_SESSION)) {
2885
+			return;
2886
+		}
2612 2887
 
2613 2888
 		$memberInfo = Context::get('logged_info');
2614 2889
 		$memberSrl = $memberInfo->member_srl;
@@ -2647,8 +2922,9 @@  discard block
 block discarded – undo
2647 2922
 		}
2648 2923
 		$maxLevel = 0;
2649 2924
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2650
-		if(count($resultGroup) > 0)
2651
-			$maxLevel = max(array_flip($resultGroup));
2925
+		if(count($resultGroup) > 0) {
2926
+					$maxLevel = max(array_flip($resultGroup));
2927
+		}
2652 2928
 
2653 2929
 		if($maxLevel > 0)
2654 2930
 		{
@@ -2665,16 +2941,22 @@  discard block
 block discarded – undo
2665 2941
 
2666 2942
 	function procMemberModifyEmailAddress()
2667 2943
 	{
2668
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2944
+		if(!Context::get('is_logged')) {
2945
+			return $this->stop('msg_not_logged');
2946
+		}
2669 2947
 
2670 2948
 		$member_info = Context::get('logged_info');
2671 2949
 		$newEmail = Context::get('email_address');
2672 2950
 
2673
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2951
+		if(!$newEmail) {
2952
+			return $this->stop('msg_invalid_request');
2953
+		}
2674 2954
 
2675 2955
 		$oMemberModel = getModel('member');
2676 2956
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2677
-		if($member_srl) return new BaseObject(-1,'msg_exists_email_address');
2957
+		if($member_srl) {
2958
+			return new BaseObject(-1,'msg_exists_email_address');
2959
+		}
2678 2960
 
2679 2961
 		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2680 2962
 		{
@@ -2702,7 +2984,9 @@  discard block
 block discarded – undo
2702 2984
 		$member_config = $oModuleModel->getModuleConfig('member');
2703 2985
 
2704 2986
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2705
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2987
+		if(!is_dir($tpl_path)) {
2988
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2989
+		}
2706 2990
 
2707 2991
 		global $lang;
2708 2992
 
@@ -2738,7 +3022,9 @@  discard block
 block discarded – undo
2738 3022
 	{
2739 3023
 		$member_srl = Context::get('member_srl');
2740 3024
 		$auth_key = Context::get('auth_key');
2741
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
3025
+		if(!$member_srl || !$auth_key) {
3026
+			return $this->stop('msg_invalid_request');
3027
+		}
2742 3028
 
2743 3029
 		// Test logs for finding password by user_id and authkey
2744 3030
 		$args = new stdClass;
@@ -2747,7 +3033,9 @@  discard block
 block discarded – undo
2747 3033
 		$output = executeQuery('member.getAuthMail', $args);
2748 3034
 		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2749 3035
 		{
2750
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
3036
+			if(strlen($output->data->auth_key) !== strlen($auth_key)) {
3037
+				executeQuery('member.deleteAuthChangeEmailAddress', $args);
3038
+			}
2751 3039
 			return $this->stop('msg_invalid_modify_email_auth_key');
2752 3040
 		}
2753 3041
 
@@ -2756,7 +3044,9 @@  discard block
 block discarded – undo
2756 3044
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2757 3045
 
2758 3046
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2759
-		if(!$output->toBool()) return $this->stop($output->getMessage());
3047
+		if(!$output->toBool()) {
3048
+			return $this->stop($output->getMessage());
3049
+		}
2760 3050
 
2761 3051
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2762 3052
 		executeQuery('member.deleteAuthChangeEmailAddress',$args);
@@ -2777,7 +3067,9 @@  discard block
 block discarded – undo
2777 3067
 	**/
2778 3068
 	function triggerGetDocumentMenu(&$menu_list)
2779 3069
 	{
2780
-		if(!Context::get('is_logged')) return new BaseObject();
3070
+		if(!Context::get('is_logged')) {
3071
+			return new BaseObject();
3072
+		}
2781 3073
 
2782 3074
 		$logged_info = Context::get('logged_info');
2783 3075
 		$document_srl = Context::get('target_srl');
@@ -2788,8 +3080,12 @@  discard block
 block discarded – undo
2788 3080
 		$member_srl = $oDocument->get('member_srl');
2789 3081
 		$module_srl = $oDocument->get('module_srl');
2790 3082
 
2791
-		if(!$member_srl) return new BaseObject();
2792
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject();
3083
+		if(!$member_srl) {
3084
+			return new BaseObject();
3085
+		}
3086
+		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
3087
+			return new BaseObject();
3088
+		}
2793 3089
 
2794 3090
 		$oDocumentController = getController('document');
2795 3091
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2807,7 +3103,9 @@  discard block
 block discarded – undo
2807 3103
 	**/
2808 3104
 	function triggerGetCommentMenu(&$menu_list)
2809 3105
 	{
2810
-		if(!Context::get('is_logged')) return new BaseObject();
3106
+		if(!Context::get('is_logged')) {
3107
+			return new BaseObject();
3108
+		}
2811 3109
 
2812 3110
 		$logged_info = Context::get('logged_info');
2813 3111
 		$comment_srl = Context::get('target_srl');
@@ -2818,8 +3116,12 @@  discard block
 block discarded – undo
2818 3116
 		$module_srl = $oComment->get('module_srl');
2819 3117
 		$member_srl = $oComment->get('member_srl');
2820 3118
 
2821
-		if(!$member_srl) return new BaseObject();
2822
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new BaseObject();
3119
+		if(!$member_srl) {
3120
+			return new BaseObject();
3121
+		}
3122
+		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
3123
+			return new BaseObject();
3124
+		}
2823 3125
 
2824 3126
 		$oCommentController = getController('comment');
2825 3127
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2835,7 +3137,9 @@  discard block
 block discarded – undo
2835 3137
 	**/
2836 3138
 	function procMemberSpammerManage()
2837 3139
 	{
2838
-		if(!Context::get('is_logged')) return new BaseObject(-1,'msg_not_permitted');
3140
+		if(!Context::get('is_logged')) {
3141
+			return new BaseObject(-1,'msg_not_permitted');
3142
+		}
2839 3143
 
2840 3144
 		$logged_info = Context::get('logged_info');
2841 3145
 		$member_srl = Context::get('member_srl');
@@ -2843,8 +3147,9 @@  discard block
 block discarded – undo
2843 3147
 		$cnt_loop = Context::get('cnt_loop');
2844 3148
 		$proc_type = Context::get('proc_type');
2845 3149
 		$isMoveToTrash = true;
2846
-		if($proc_type == "delete")
2847
-			$isMoveToTrash = false;
3150
+		if($proc_type == "delete") {
3151
+					$isMoveToTrash = false;
3152
+		}
2848 3153
 
2849 3154
 		// check grant
2850 3155
 		$oModuleModel = getModel('module');
@@ -2852,7 +3157,9 @@  discard block
 block discarded – undo
2852 3157
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2853 3158
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2854 3159
 
2855
-		if(!$grant->manager) return new BaseObject(-1,'msg_not_permitted');
3160
+		if(!$grant->manager) {
3161
+			return new BaseObject(-1,'msg_not_permitted');
3162
+		}
2856 3163
 
2857 3164
 		$proc_msg = "";
2858 3165
 
@@ -2861,11 +3168,13 @@  discard block
 block discarded – undo
2861 3168
 
2862 3169
 		// delete or trash destination
2863 3170
 		// proc member
2864
-		if($cnt_loop == 1)
2865
-			$this->_spammerMember($member_srl);
3171
+		if($cnt_loop == 1) {
3172
+					$this->_spammerMember($member_srl);
3173
+		}
2866 3174
 		// proc document and comment
2867
-		elseif($cnt_loop>1)
2868
-			$this->_spammerDocuments($member_srl, $isMoveToTrash);
3175
+		elseif($cnt_loop>1) {
3176
+					$this->_spammerDocuments($member_srl, $isMoveToTrash);
3177
+		}
2869 3178
 
2870 3179
 		// get destination count
2871 3180
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
@@ -2873,13 +3182,16 @@  discard block
 block discarded – undo
2873 3182
 
2874 3183
 		$total_count = Context::get('total_count');
2875 3184
 		$remain_count = $cnt_document + $cnt_comment;
2876
-		if($cnt_loop == 1) $total_count = $remain_count;
3185
+		if($cnt_loop == 1) {
3186
+			$total_count = $remain_count;
3187
+		}
2877 3188
 
2878 3189
 		// get progress percent
2879
-		if($total_count > 0)
2880
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2881
-		else
2882
-			$progress = 100;
3190
+		if($total_count > 0) {
3191
+					$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
3192
+		} else {
3193
+					$progress = 100;
3194
+		}
2883 3195
 
2884 3196
 		$this->add('total_count', $total_count);
2885 3197
 		$this->add('remain_count', $remain_count);
@@ -2921,7 +3233,10 @@  discard block
 block discarded – undo
2921 3233
 		$args->nick_name = $member_info->nick_name;
2922 3234
 		$args->denied = "Y";
2923 3235
 		$args->description = trim( $member_info->description );
2924
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
3236
+		if( $args->description != "" ) {
3237
+			$args->description .= "\n";
3238
+		}
3239
+		// add new line
2925 3240
 
2926 3241
 		$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 . "]";
2927 3242
 
@@ -2966,8 +3281,11 @@  discard block
 block discarded – undo
2966 3281
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2967 3282
 			if($documentList) {
2968 3283
 				foreach($documentList as $v) {
2969
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2970
-					else $oDocumentController->deleteDocument($v->document_srl);
3284
+					if($isMoveToTrash) {
3285
+						$oDocumentController->moveDocumentToTrash($v);
3286
+					} else {
3287
+						$oDocumentController->deleteDocument($v->document_srl);
3288
+					}
2971 3289
 				}
2972 3290
 			}
2973 3291
 		}
Please login to merge, or discard this patch.