GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 423fe8...f48289 )
by gyeong-won
15:56 queued 08:14
created
classes/display/HTMLDisplayHandler.php 2 patches
Braces   +11 added lines, -22 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@  discard block
 block discarded – undo
23 23
 			if($oModule->module_info->module == $oModule->module)
24 24
 			{
25 25
 				$skin = $oModule->origin_module_info->skin;
26
-			}
27
-			else
26
+			} else
28 27
 			{
29 28
 				$skin = $oModule->module_config->skin;
30 29
 			}
@@ -44,13 +43,11 @@  discard block
 block discarded – undo
44 43
 							$template_path = sprintf('%s/modules/%s/', $theme_path, $theme_skin[1]);
45 44
 						}
46 45
 					}
47
-				}
48
-				else
46
+				} else
49 47
 				{
50 48
 					$template_path = $oModule->getTemplatePath();
51 49
 				}
52
-			}
53
-			else
50
+			} else
54 51
 			{
55 52
 				$template_path = $oModule->getTemplatePath();
56 53
 			}
@@ -228,8 +225,7 @@  discard block
 block discarded – undo
228 225
 		{
229 226
 			$this->_loadMobileJSCSS();
230 227
 			$output = $oTemplate->compile('./common/tpl', 'mobile_layout');
231
-		}
232
-		else
228
+		} else
233 229
 		{
234 230
 			$this->_loadJSCSS();
235 231
 			$output = $oTemplate->compile('./common/tpl', 'common_layout');
@@ -405,13 +401,11 @@  discard block
 block discarded – undo
405 401
 			if(!__DISABLE_DEFAULT_CSS__)
406 402
 			{
407 403
 				$oContext->loadFile(array('./common/css/xe.css', '', '', -1000000), true);
408
-			}
409
-			else
404
+			} else
410 405
 			{
411 406
 				$oContext->unloadFile(array('./common/css/xe.css', '', '', -1000000), true);
412 407
 			}
413
-		}
414
-		else
408
+		} else
415 409
 		{
416 410
 			$oContext->loadFile(array('./common/js/jquery-1.x.min.js', 'head', 'lt IE 9', -111000), true);
417 411
 			$oContext->loadFile(array('./common/js/jquery.min.js', 'head', 'gte IE 9', -110000), true);
@@ -420,8 +414,7 @@  discard block
 block discarded – undo
420 414
 			if(!__DISABLE_DEFAULT_CSS__)
421 415
 			{
422 416
 				$oContext->loadFile(array('./common/css/xe.min.css', '', '', -1000000), true);
423
-			}
424
-			else
417
+			} else
425 418
 			{
426 419
 				$oContext->unloadFile(array('./common/css/xe.min.css', '', '', -1000000), true);
427 420
 			}
@@ -439,8 +432,7 @@  discard block
 block discarded – undo
439 432
 				$oContext->loadFile(array('./modules/admin/tpl/css/admin.bootstrap.css', '', '', 1), true);
440 433
 				$oContext->loadFile(array('./modules/admin/tpl/js/jquery.tmpl.js', '', '', 1), true);
441 434
 				$oContext->loadFile(array('./modules/admin/tpl/js/jquery.jstree.js', '', '', 1), true);
442
-			}
443
-			else
435
+			} else
444 436
 			{
445 437
 				$oContext->loadFile(array('./modules/admin/tpl/css/admin.min.css', '', '', 10), true);
446 438
 				$oContext->loadFile(array("./modules/admin/tpl/css/admin_{$lang_type}.css", '', '', 10), true);
@@ -476,14 +468,12 @@  discard block
 block discarded – undo
476 468
 			{
477 469
 				$oContext->loadFile(array('./common/css/xe.css', '', '', -1000000), true);
478 470
 				$oContext->loadFile(array('./common/css/mobile.css', '', '', -1000000), true);
479
-			}
480
-			else
471
+			} else
481 472
 			{
482 473
 				$oContext->unloadFile(array('./common/css/xe.css', '', '', -1000000), true);
483 474
 				$oContext->unloadFile(array('./common/css/mobile.css', '', '', -1000000), true);
484 475
 			}
485
-		}
486
-		else
476
+		} else
487 477
 		{
488 478
 			$oContext->loadFile(array('./common/js/jquery.min.js', 'head', '', -110000), true);
489 479
 			$oContext->loadFile(array('./common/js/x.min.js', 'head', '', -100000), true);
@@ -492,8 +482,7 @@  discard block
 block discarded – undo
492 482
 			{
493 483
 				$oContext->loadFile(array('./common/css/xe.min.css', '', '', -1000000), true);
494 484
 				$oContext->loadFile(array('./common/css/mobile.min.css', '', '', -1000000), true);
495
-			}
496
-			else
485
+			} else
497 486
 			{
498 487
 				$oContext->unloadFile(array('./common/css/xe.min.css', '', '', -1000000), true);
499 488
 				$oContext->unloadFile(array('./common/css/mobile.min.css', '', '', -1000000), true);
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
 
20 20
 		$template_path = $oModule->getTemplatePath();
21 21
 
22
-		if(!is_dir($template_path))
22
+		if (!is_dir($template_path))
23 23
 		{
24
-			if($oModule->module_info->module == $oModule->module)
24
+			if ($oModule->module_info->module == $oModule->module)
25 25
 			{
26 26
 				$skin = $oModule->origin_module_info->skin;
27 27
 			}
@@ -30,17 +30,17 @@  discard block
 block discarded – undo
30 30
 				$skin = $oModule->module_config->skin;
31 31
 			}
32 32
 
33
-			if(Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') === false)
33
+			if (Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') === false)
34 34
 			{
35
-				if($skin && is_string($skin))
35
+				if ($skin && is_string($skin))
36 36
 				{
37 37
 					$theme_skin = explode('|@|', $skin);
38 38
 					$template_path = $oModule->getTemplatePath();
39
-					if(count($theme_skin) == 2)
39
+					if (count($theme_skin) == 2)
40 40
 					{
41 41
 						$theme_path = sprintf('./themes/%s', $theme_skin[0]);
42 42
 						// FIXME $theme_path $theme_path $theme_path ??
43
-						if(substr($theme_path, 0, strlen($theme_path)) != $theme_path)
43
+						if (substr($theme_path, 0, strlen($theme_path)) != $theme_path)
44 44
 						{
45 45
 							$template_path = sprintf('%s/modules/%s/', $theme_path, $theme_skin[1]);
46 46
 						}
@@ -61,16 +61,16 @@  discard block
 block discarded – undo
61 61
 		$output = $oTemplate->compile($template_path, $tpl_file);
62 62
 
63 63
 		// add .x div for adminitration pages
64
-		if(Context::getResponseMethod() == 'HTML')
64
+		if (Context::getResponseMethod() == 'HTML')
65 65
 		{
66
-			if(Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') > 0 && Context::get('act') != 'dispPageAdminContentModify' && Context::get('act') != 'dispPageAdminMobileContentModify')
66
+			if (Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') > 0 && Context::get('act') != 'dispPageAdminContentModify' && Context::get('act') != 'dispPageAdminMobileContentModify')
67 67
 			{
68
-				$output = '<div class="x">' . $output . '</div>';
68
+				$output = '<div class="x">'.$output.'</div>';
69 69
 			}
70 70
 
71
-			if(Context::get('layout') != 'none')
71
+			if (Context::get('layout') != 'none')
72 72
 			{
73
-				if(__DEBUG__ == 3)
73
+				if (__DEBUG__ == 3)
74 74
 				{
75 75
 					$start = getMicroTime();
76 76
 				}
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
 				$layout_srl = $layout_info->layout_srl;
89 89
 
90 90
 				// compile if connected to the layout
91
-				if($layout_srl > 0)
91
+				if ($layout_srl > 0)
92 92
 				{
93 93
 
94 94
 					// handle separately if the layout is faceoff
95
-					if($layout_info && $layout_info->type == 'faceoff')
95
+					if ($layout_info && $layout_info->type == 'faceoff')
96 96
 					{
97 97
 						$oLayoutModel->doActivateFaceOff($layout_info);
98 98
 						Context::set('layout_info', $layout_info);
@@ -101,16 +101,16 @@  discard block
 block discarded – undo
101 101
 					// search if the changes CSS exists in the admin layout edit window
102 102
 					$edited_layout_css = $oLayoutModel->getUserLayoutCss($layout_srl);
103 103
 
104
-					if(FileHandler::exists($edited_layout_css))
104
+					if (FileHandler::exists($edited_layout_css))
105 105
 					{
106 106
 						Context::loadFile(array($edited_layout_css, 'all', '', 100));
107 107
 					}
108 108
 				}
109
-				if(!$layout_path)
109
+				if (!$layout_path)
110 110
 				{
111 111
 					$layout_path = './common/tpl';
112 112
 				}
113
-				if(!$layout_file)
113
+				if (!$layout_file)
114 114
 				{
115 115
 					$layout_file = 'default_layout';
116 116
 				}
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
 				// if popup_layout, remove admin bar.
120 120
 				$realLayoutPath = FileHandler::getRealPath($layout_path);
121
-				if(substr_compare($realLayoutPath, '/', -1) !== 0)
121
+				if (substr_compare($realLayoutPath, '/', -1) !== 0)
122 122
 				{
123 123
 					$realLayoutPath .= '/';
124 124
 				}
@@ -126,12 +126,12 @@  discard block
 block discarded – undo
126 126
 				$pathInfo = pathinfo($layout_file);
127 127
 				$onlyLayoutFile = $pathInfo['filename'];
128 128
 
129
-				if(__DEBUG__ == 3)
129
+				if (__DEBUG__ == 3)
130 130
 				{
131 131
 					$GLOBALS['__layout_compile_elapsed__'] = getMicroTime() - $start;
132 132
 				}
133 133
 
134
-				if(stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE && (Context::get('_use_ssl') == 'optional' || Context::get('_use_ssl') == 'always'))
134
+				if (stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE && (Context::get('_use_ssl') == 'optional' || Context::get('_use_ssl') == 'always'))
135 135
 				{
136 136
 					Context::addHtmlFooter('<iframe id="xeTmpIframe" name="xeTmpIframe" style="width:1px;height:1px;position:absolute;top:-2px;left:-2px;"></iframe>');
137 137
 				}
@@ -147,12 +147,12 @@  discard block
 block discarded – undo
147 147
 	 */
148 148
 	function prepareToPrint(&$output)
149 149
 	{
150
-		if(Context::getResponseMethod() != 'HTML')
150
+		if (Context::getResponseMethod() != 'HTML')
151 151
 		{
152 152
 			return;
153 153
 		}
154 154
 
155
-		if(__DEBUG__ == 3)
155
+		if (__DEBUG__ == 3)
156 156
 		{
157 157
 			$start = getMicroTime();
158 158
 		}
@@ -170,20 +170,20 @@  discard block
 block discarded – undo
170 170
 		$output = preg_replace_callback('/<!--(#)?Meta:([a-z0-9\_\-\/\.\@\:]+)-->/is', array($this, '_transMeta'), $output);
171 171
 
172 172
 		// handles a relative path generated by using the rewrite module
173
-		if(Context::isAllowRewrite())
173
+		if (Context::isAllowRewrite())
174 174
 		{
175 175
 			$url = parse_url(Context::getRequestUri());
176 176
 			$real_path = $url['path'];
177 177
 
178 178
 			$pattern = '/src=("|\'){1}(\.\/)?(files\/attach|files\/cache|files\/faceOff|files\/member_extra_info|modules|common|widgets|widgetstyle|layouts|addons)\/([^"\']+)\.(jpg|jpeg|png|gif)("|\'){1}/s';
179
-			$output = preg_replace($pattern, 'src=$1' . $real_path . '$3/$4.$5$6', $output);
179
+			$output = preg_replace($pattern, 'src=$1'.$real_path.'$3/$4.$5$6', $output);
180 180
 
181 181
 			$pattern = '/href=("|\'){1}(\?[^"\']+)/s';
182
-			$output = preg_replace($pattern, 'href=$1' . $real_path . '$2', $output);
182
+			$output = preg_replace($pattern, 'href=$1'.$real_path.'$2', $output);
183 183
 
184
-			if(Context::get('vid'))
184
+			if (Context::get('vid'))
185 185
 			{
186
-				$pattern = '/\/' . Context::get('vid') . '\?([^=]+)=/is';
186
+				$pattern = '/\/'.Context::get('vid').'\?([^=]+)=/is';
187 187
 				$output = preg_replace($pattern, '/?$1=', $output);
188 188
 			}
189 189
 		}
@@ -191,18 +191,18 @@  discard block
 block discarded – undo
191 191
 		// prevent the 2nd request due to url(none) of the background-image
192 192
 		$output = preg_replace('/url\((["\']?)none(["\']?)\)/is', 'none', $output);
193 193
 
194
-		if(is_array(Context::get('INPUT_ERROR')))
194
+		if (is_array(Context::get('INPUT_ERROR')))
195 195
 		{
196 196
 			$INPUT_ERROR = Context::get('INPUT_ERROR');
197 197
 			$keys = array_keys($INPUT_ERROR);
198
-			$keys = '(' . implode('|', $keys) . ')';
198
+			$keys = '('.implode('|', $keys).')';
199 199
 
200
-			$output = preg_replace_callback('@(<input)([^>]*?)\sname="' . $keys . '"([^>]*?)/?>@is', array(&$this, '_preserveValue'), $output);
201
-			$output = preg_replace_callback('@<select[^>]*\sname="' . $keys . '".+</select>@isU', array(&$this, '_preserveSelectValue'), $output);
202
-			$output = preg_replace_callback('@<textarea[^>]*\sname="' . $keys . '".+</textarea>@isU', array(&$this, '_preserveTextAreaValue'), $output);
200
+			$output = preg_replace_callback('@(<input)([^>]*?)\sname="'.$keys.'"([^>]*?)/?>@is', array(&$this, '_preserveValue'), $output);
201
+			$output = preg_replace_callback('@<select[^>]*\sname="'.$keys.'".+</select>@isU', array(&$this, '_preserveSelectValue'), $output);
202
+			$output = preg_replace_callback('@<textarea[^>]*\sname="'.$keys.'".+</textarea>@isU', array(&$this, '_preserveTextAreaValue'), $output);
203 203
 		}
204 204
 
205
-		if(__DEBUG__ == 3)
205
+		if (__DEBUG__ == 3)
206 206
 		{
207 207
 			$GLOBALS['__trans_content_elapsed__'] = getMicroTime() - $start;
208 208
 		}
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 		// convert the final layout
221 221
 		Context::set('content', $output);
222 222
 		$oTemplate = TemplateHandler::getInstance();
223
-		if(Mobile::isFromMobilePhone())
223
+		if (Mobile::isFromMobilePhone())
224 224
 		{
225 225
 			$this->_loadMobileJSCSS();
226 226
 			$output = $oTemplate->compile('./common/tpl', 'mobile_layout');
@@ -245,16 +245,16 @@  discard block
 block discarded – undo
245 245
 	{
246 246
 		$INPUT_ERROR = Context::get('INPUT_ERROR');
247 247
 
248
-		$str = $match[1] . $match[2] . ' name="' . $match[3] . '"' . $match[4];
248
+		$str = $match[1].$match[2].' name="'.$match[3].'"'.$match[4];
249 249
 
250 250
 		// get type
251 251
 		$type = 'text';
252
-		if(preg_match('/\stype="([a-z]+)"/i', $str, $m))
252
+		if (preg_match('/\stype="([a-z]+)"/i', $str, $m))
253 253
 		{
254 254
 			$type = strtolower($m[1]);
255 255
 		}
256 256
 
257
-		switch($type)
257
+		switch ($type)
258 258
 		{
259 259
 			case 'text':
260 260
 			case 'hidden':
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 			case 'number':
273 273
 			case 'range':
274 274
 			case 'color':
275
-				$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str) . ' value="' . htmlspecialchars($INPUT_ERROR[$match[3]], ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '"';
275
+				$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str).' value="'.htmlspecialchars($INPUT_ERROR[$match[3]], ENT_COMPAT | ENT_HTML401, 'UTF-8', false).'"';
276 276
 				break;
277 277
 			case 'password':
278 278
 				$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str);
@@ -280,14 +280,14 @@  discard block
 block discarded – undo
280 280
 			case 'radio':
281 281
 			case 'checkbox':
282 282
 				$str = preg_replace('@\schecked(="[^"]*?")?@', ' ', $str);
283
-				if(@preg_match('@\s(?i:value)="' . $INPUT_ERROR[$match[3]] . '"@', $str))
283
+				if (@preg_match('@\s(?i:value)="'.$INPUT_ERROR[$match[3]].'"@', $str))
284 284
 				{
285 285
 					$str .= ' checked="checked"';
286 286
 				}
287 287
 				break;
288 288
 		}
289 289
 
290
-		return $str . ' />';
290
+		return $str.' />';
291 291
 	}
292 292
 
293 293
 	/**
@@ -304,14 +304,14 @@  discard block
 block discarded – undo
304 304
 		preg_match_all('@<option[^>]*\svalue="([^"]*)".+</option>@isU', $matches[0], $m);
305 305
 
306 306
 		$key = array_search($INPUT_ERROR[$matches[1]], $m[1]);
307
-		if($key === FALSE)
307
+		if ($key === FALSE)
308 308
 		{
309 309
 			return $matches[0];
310 310
 		}
311 311
 
312 312
 		$m[0][$key] = preg_replace('@(\svalue=".*?")@is', '$1 selected="selected"', $m[0][$key]);
313 313
 
314
-		return $mm[0] . implode('', $m[0]) . '</select>';
314
+		return $mm[0].implode('', $m[0]).'</select>';
315 315
 	}
316 316
 
317 317
 	/**
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 	{
324 324
 		$INPUT_ERROR = Context::get('INPUT_ERROR');
325 325
 		preg_match('@<textarea.*?>@is', $matches[0], $mm);
326
-		return $mm[0] . $INPUT_ERROR[$matches[1]] . '</textarea>';
326
+		return $mm[0].$INPUT_ERROR[$matches[1]].'</textarea>';
327 327
 	}
328 328
 
329 329
 	/**
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 	 */
335 335
 	function _moveStyleToHeader($matches)
336 336
 	{
337
-		if(isset($matches[1]) && stristr($matches[1], 'scoped'))
337
+		if (isset($matches[1]) && stristr($matches[1], 'scoped'))
338 338
 		{
339 339
 			return $matches[0];
340 340
 		}
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
 	 */
371 371
 	function _transMeta($matches)
372 372
 	{
373
-		if($matches[1])
373
+		if ($matches[1])
374 374
 		{
375 375
 			return '';
376 376
 		}
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 		$lang_type = Context::getLangType();
388 388
 
389 389
 		// add common JS/CSS files
390
-		if(__DEBUG__ || !__XE_VERSION_STABLE__)
390
+		if (__DEBUG__ || !__XE_VERSION_STABLE__)
391 391
 		{
392 392
 			$oContext->loadFile(array('./common/js/jquery-1.x.js', 'head', 'lt IE 9', -111000), true);
393 393
 			$oContext->loadFile(array('./common/js/jquery.js', 'head', 'gte IE 9', -110000), true);
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 			$oContext->loadFile(array('./common/js/xml2json.js', 'head', '', -100000), true);
399 399
 			$oContext->loadFile(array('./common/js/xml_handler.js', 'head', '', -100000), true);
400 400
 			$oContext->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -100000), true);
401
-			if(!__DISABLE_DEFAULT_CSS__)
401
+			if (!__DISABLE_DEFAULT_CSS__)
402 402
 			{
403 403
 				$oContext->loadFile(array('./common/css/xe.css', '', '', -1000000), true);
404 404
 			}
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 			$oContext->loadFile(array('./common/js/jquery.min.js', 'head', 'gte IE 9', -110000), true);
414 414
 			$oContext->loadFile(array('./common/js/x.min.js', 'head', '', -100000), true);
415 415
 			$oContext->loadFile(array('./common/js/xe.min.js', 'head', '', -100000), true);
416
-			if(!__DISABLE_DEFAULT_CSS__)
416
+			if (!__DISABLE_DEFAULT_CSS__)
417 417
 			{
418 418
 				$oContext->loadFile(array('./common/css/xe.min.css', '', '', -1000000), true);
419 419
 			}
@@ -424,9 +424,9 @@  discard block
 block discarded – undo
424 424
 		}
425 425
 
426 426
 		// for admin page, add admin css
427
-		if(Context::get('module') == 'admin' || strpos(Context::get('act'), 'Admin') > 0)
427
+		if (Context::get('module') == 'admin' || strpos(Context::get('act'), 'Admin') > 0)
428 428
 		{
429
-			if(__DEBUG__ || !__XE_VERSION_STABLE__)
429
+			if (__DEBUG__ || !__XE_VERSION_STABLE__)
430 430
 			{
431 431
 				$oContext->loadFile(array('./modules/admin/tpl/css/admin.css', '', '', 10), true);
432 432
 				$oContext->loadFile(array("./modules/admin/tpl/css/admin_{$lang_type}.css", '', '', 10), true);
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
 		$lang_type = Context::getLangType();
459 459
 
460 460
 		// add common JS/CSS files
461
-		if(__DEBUG__ || !__XE_VERSION_STABLE__)
461
+		if (__DEBUG__ || !__XE_VERSION_STABLE__)
462 462
 		{
463 463
 			$oContext->loadFile(array('./common/js/jquery.js', 'head', '', -110000), true);
464 464
 			$oContext->loadFile(array('./common/js/modernizr.js', 'head', '', -100000), true);
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 			$oContext->loadFile(array('./common/js/xml2json.js', 'head', '', -100000), true);
469 469
 			$oContext->loadFile(array('./common/js/xml_handler.js', 'head', '', -100000), true);
470 470
 			$oContext->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -100000), true);
471
-			if(!__DISABLE_DEFAULT_CSS__)
471
+			if (!__DISABLE_DEFAULT_CSS__)
472 472
 			{
473 473
 				$oContext->loadFile(array('./common/css/xe.css', '', '', -1000000), true);
474 474
 				$oContext->loadFile(array('./common/css/mobile.css', '', '', -1000000), true);
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
 			$oContext->loadFile(array('./common/js/jquery.min.js', 'head', '', -110000), true);
485 485
 			$oContext->loadFile(array('./common/js/x.min.js', 'head', '', -100000), true);
486 486
 			$oContext->loadFile(array('./common/js/xe.min.js', 'head', '', -100000), true);
487
-			if(!__DISABLE_DEFAULT_CSS__)
487
+			if (!__DISABLE_DEFAULT_CSS__)
488 488
 			{
489 489
 				$oContext->loadFile(array('./common/css/xe.min.css', '', '', -1000000), true);
490 490
 				$oContext->loadFile(array('./common/css/mobile.min.css', '', '', -1000000), true);
Please login to merge, or discard this patch.
config/config.inc.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  * @file   config/config.inc.php
8 8
  * @author NAVER ([email protected])
9 9
  */
10
-if(version_compare(PHP_VERSION, '5.4.0', '<'))
10
+if (version_compare(PHP_VERSION, '5.4.0', '<'))
11 11
 {
12 12
 	@error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING);
13 13
 }
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 	@error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING ^ E_STRICT);
17 17
 }
18 18
 
19
-if(!defined('__XE__'))
19
+if (!defined('__XE__'))
20 20
 {
21 21
 	exit();
22 22
 }
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
 ini_set('session.use_only_cookies', 0);
54 54
 
55 55
 
56
-if(file_exists(_XE_PATH_ . 'config/package.inc.php'))
56
+if (file_exists(_XE_PATH_.'config/package.inc.php'))
57 57
 {
58
-	require _XE_PATH_ . 'config/package.inc.php';
58
+	require _XE_PATH_.'config/package.inc.php';
59 59
 }
60 60
 else
61 61
 {
@@ -97,12 +97,12 @@  discard block
 block discarded – undo
97 97
  * define('__ENABLE_PHPUNIT_TEST__', 0);
98 98
  * define('__PROXY_SERVER__', 'http://domain:port/path');
99 99
  */
100
-if(file_exists(_XE_PATH_ . 'config/config.user.inc.php'))
100
+if (file_exists(_XE_PATH_.'config/config.user.inc.php'))
101 101
 {
102
-	require _XE_PATH_ . 'config/config.user.inc.php';
102
+	require _XE_PATH_.'config/config.user.inc.php';
103 103
 }
104 104
 
105
-if(!defined('__DEBUG__'))
105
+if (!defined('__DEBUG__'))
106 106
 {
107 107
 	/**
108 108
 	 * output debug message(bit value)
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	define('__DEBUG__', 0);
118 118
 }
119 119
 
120
-if(!defined('__DEBUG_OUTPUT__'))
120
+if (!defined('__DEBUG_OUTPUT__'))
121 121
 {
122 122
 	/**
123 123
 	 * output location of debug message
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	define('__DEBUG_OUTPUT__', 0);
132 132
 }
133 133
 
134
-if(!defined('__DEBUG_PROTECT__'))
134
+if (!defined('__DEBUG_PROTECT__'))
135 135
 {
136 136
 	/**
137 137
 	 * output comments of the firePHP console and browser
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 	define('__DEBUG_PROTECT__', 1);
145 145
 }
146 146
 
147
-if(!defined('__DEBUG_PROTECT_IP__'))
147
+if (!defined('__DEBUG_PROTECT_IP__'))
148 148
 {
149 149
 	/**
150 150
 	 * Set a ip address to allow debug
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	define('__DEBUG_PROTECT_IP__', '127.0.0.1');
153 153
 }
154 154
 
155
-if(!defined('__DEBUG_DB_OUTPUT__'))
155
+if (!defined('__DEBUG_DB_OUTPUT__'))
156 156
 {
157 157
 	/**
158 158
 	 * DB error message definition
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	define('__DEBUG_DB_OUTPUT__', 0);
166 166
 }
167 167
 
168
-if(!defined('__LOG_SLOW_QUERY__'))
168
+if (!defined('__LOG_SLOW_QUERY__'))
169 169
 {
170 170
 	/**
171 171
 	 * Query log for only timeout query among DB queries
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	define('__LOG_SLOW_QUERY__', 0);
180 180
 }
181 181
 
182
-if(!defined('__LOG_SLOW_TRIGGER__'))
182
+if (!defined('__LOG_SLOW_TRIGGER__'))
183 183
 {
184 184
 	/**
185 185
 	 * Trigger excute time log
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 	define('__LOG_SLOW_TRIGGER__', 0);
194 194
 }
195 195
 
196
-if(!defined('__LOG_SLOW_ADDON__'))
196
+if (!defined('__LOG_SLOW_ADDON__'))
197 197
 {
198 198
 	/**
199 199
 	 * Addon excute time log
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	define('__LOG_SLOW_ADDON__', 0);
208 208
 }
209 209
 
210
-if(!defined('__LOG_SLOW_WIDGET__'))
210
+if (!defined('__LOG_SLOW_WIDGET__'))
211 211
 {
212 212
 	/**
213 213
 	 * Widget excute time log
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	define('__LOG_SLOW_WIDGET__', 0);
222 222
 }
223 223
 
224
-if(!defined('__DEBUG_QUERY__'))
224
+if (!defined('__DEBUG_QUERY__'))
225 225
 {
226 226
 	/**
227 227
 	 * Leave DB query information
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 	define('__DEBUG_QUERY__', 0);
235 235
 }
236 236
 
237
-if(!defined('__OB_GZHANDLER_ENABLE__'))
237
+if (!defined('__OB_GZHANDLER_ENABLE__'))
238 238
 {
239 239
 	/**
240 240
 	 * option to enable/disable a compression feature using ob_gzhandler
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 	define('__OB_GZHANDLER_ENABLE__', 1);
249 249
 }
250 250
 
251
-if(!defined('__ENABLE_PHPUNIT_TEST__'))
251
+if (!defined('__ENABLE_PHPUNIT_TEST__'))
252 252
 {
253 253
 	/**
254 254
 	 * decide to use/not use the php unit test (Path/tests/index.php)
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 	define('__ENABLE_PHPUNIT_TEST__', 0);
262 262
 }
263 263
 
264
-if(!defined('__PROXY_SERVER__'))
264
+if (!defined('__PROXY_SERVER__'))
265 265
 {
266 266
 	/**
267 267
 	 * __PROXY_SERVER__ has server information to request to the external through the target server
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 	define('__PROXY_SERVER__', NULL);
271 271
 }
272 272
 
273
-if(!defined('__ERROR_LOG__'))
273
+if (!defined('__ERROR_LOG__'))
274 274
 {
275 275
 	/**
276 276
 	 * __ERROR_LOG__ 는 PHP의 에러로그를 출력하는 기능입니다. 개발시 워닝에러이상의 에러부터 잡기 시작합니다.
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 	define('__ERROR_LOG__', 0);
282 282
 }
283 283
 
284
-if(!defined('__DISABLE_DEFAULT_CSS__'))
284
+if (!defined('__DISABLE_DEFAULT_CSS__'))
285 285
 {
286 286
 	/**
287 287
 	 * XE의 기본 CSS 스타일을 로드하지 않도록 합니다.
@@ -297,25 +297,25 @@  discard block
 block discarded – undo
297 297
 }
298 298
 
299 299
 // Require specific files when using Firebug console output
300
-if((__DEBUG_OUTPUT__ == 2) && version_compare(PHP_VERSION, '6.0.0') === -1)
300
+if ((__DEBUG_OUTPUT__ == 2) && version_compare(PHP_VERSION, '6.0.0') === -1)
301 301
 {
302
-	require _XE_PATH_ . 'libs/FirePHPCore/FirePHP.class.php';
302
+	require _XE_PATH_.'libs/FirePHPCore/FirePHP.class.php';
303 303
 }
304 304
 
305 305
 // Set Timezone as server time
306
-if(version_compare(PHP_VERSION, '5.3.0') >= 0)
306
+if (version_compare(PHP_VERSION, '5.3.0') >= 0)
307 307
 {
308 308
 	date_default_timezone_set(@date_default_timezone_get());
309 309
 }
310 310
 
311 311
 // Require a function-defined-file for simple use
312
-require(_XE_PATH_ . 'config/func.inc.php');
312
+require(_XE_PATH_.'config/func.inc.php');
313 313
 
314
-if(__DEBUG__) {
314
+if (__DEBUG__) {
315 315
 	define('__StartTime__', getMicroTime());
316 316
 }
317 317
 
318
-if(__DEBUG__) {
318
+if (__DEBUG__) {
319 319
 	$GLOBALS['__elapsed_class_load__'] = 0;
320 320
 }
321 321
 
@@ -418,38 +418,38 @@  discard block
 block discarded – undo
418 418
 
419 419
 function __xe_autoload($class_name)
420 420
 {
421
-	if(__DEBUG__) {
421
+	if (__DEBUG__) {
422 422
 		$time_at = getMicroTime();
423 423
 	}
424 424
 
425
-	if(isset($GLOBALS['__xe_autoload_file_map'][strtolower($class_name)]))
425
+	if (isset($GLOBALS['__xe_autoload_file_map'][strtolower($class_name)]))
426 426
 	{
427
-		require _XE_PATH_ . $GLOBALS['__xe_autoload_file_map'][strtolower($class_name)];
427
+		require _XE_PATH_.$GLOBALS['__xe_autoload_file_map'][strtolower($class_name)];
428 428
 	}
429
-	elseif(preg_match('/^([a-zA-Z0-9_]+?)(Admin)?(View|Controller|Model|Api|Wap|Mobile)?$/', $class_name, $matches))
429
+	elseif (preg_match('/^([a-zA-Z0-9_]+?)(Admin)?(View|Controller|Model|Api|Wap|Mobile)?$/', $class_name, $matches))
430 430
 	{
431 431
 		$candidate_filename = array();
432
-		$candidate_filename[] = 'modules/' . $matches[1] . '/' . $matches[1];
433
-		if(isset($matches[2]) && $matches[2]) $candidate_filename[] = 'admin';
432
+		$candidate_filename[] = 'modules/'.$matches[1].'/'.$matches[1];
433
+		if (isset($matches[2]) && $matches[2]) $candidate_filename[] = 'admin';
434 434
 		$candidate_filename[] = (isset($matches[3]) && $matches[3]) ? strtolower($matches[3]) : 'class';
435 435
 		$candidate_filename[] = 'php';
436 436
 
437 437
 		$candidate_filename = implode('.', $candidate_filename);
438 438
 
439
-		if(file_exists(_XE_PATH_ . $candidate_filename))
439
+		if (file_exists(_XE_PATH_.$candidate_filename))
440 440
 		{
441
-			require _XE_PATH_ . $candidate_filename;
441
+			require _XE_PATH_.$candidate_filename;
442 442
 		}
443 443
 	}
444 444
 
445
-	if(__DEBUG__) {
445
+	if (__DEBUG__) {
446 446
 		$GLOBALS['__elapsed_class_load__'] += getMicroTime() - $time_at;
447 447
 	}
448 448
 }
449 449
 spl_autoload_register('__xe_autoload');
450 450
 
451
-if(file_exists(_XE_PATH_  . '/vendor/autoload.php')) {
452
-	require _XE_PATH_  . '/vendor/autoload.php';
451
+if (file_exists(_XE_PATH_.'/vendor/autoload.php')) {
452
+	require _XE_PATH_.'/vendor/autoload.php';
453 453
 }
454 454
 /* End of file config.inc.php */
455 455
 /* Location: ./config/config.inc.php */
Please login to merge, or discard this patch.
modules/editor/editor.view.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
 		$component = Context::get('component');
28 28
 
29 29
 		$site_module_info = Context::get('site_module_info');
30
-		$site_srl = (int)$site_module_info->site_srl;
30
+		$site_srl = (int) $site_module_info->site_srl;
31 31
 		// Get compoenet object
32 32
 		$oEditorModel = getModel('editor');
33 33
 		$oComponent = &$oEditorModel->getComponentObject($component, $editor_sequence, $site_srl);
34
-		if(!$oComponent->toBool())
34
+		if (!$oComponent->toBool())
35 35
 		{
36 36
 			Context::set('message', sprintf(Context::getLang('msg_component_is_not_founded'), $component));
37 37
 			$this->setTemplatePath($this->module_path.'tpl');
@@ -58,12 +58,12 @@  discard block
 block discarded – undo
58 58
 		$component_name = Context::get('component_name');
59 59
 
60 60
 		$site_module_info = Context::get('site_module_info');
61
-		$site_srl = (int)$site_module_info->site_srl;
61
+		$site_srl = (int) $site_module_info->site_srl;
62 62
 
63 63
 		$oEditorModel = getModel('editor');
64 64
 		$component = $oEditorModel->getComponent($component_name, $site_srl);
65 65
 
66
-		if(!$component->component_name) {
66
+		if (!$component->component_name) {
67 67
 			$this->stop('msg_invalid_request');
68 68
 			return;
69 69
 		}
@@ -83,12 +83,12 @@  discard block
 block discarded – undo
83 83
 		$current_module_srl = Context::get('module_srl');
84 84
 		$current_module_srls = Context::get('module_srls');
85 85
 
86
-		if(!$current_module_srl && !$current_module_srls)
86
+		if (!$current_module_srl && !$current_module_srls)
87 87
 		{
88 88
 			// Get information of the current module
89 89
 			$current_module_info = Context::get('current_module_info');
90 90
 			$current_module_srl = $current_module_info->module_srl;
91
-			if(!$current_module_srl) return new Object();
91
+			if (!$current_module_srl) return new Object();
92 92
 		}
93 93
 		// Get editors settings
94 94
 		$oEditorModel = getModel('editor');
@@ -101,17 +101,17 @@  discard block
 block discarded – undo
101 101
 		$editor_skin_list = FileHandler::readDir(_XE_PATH_.'modules/editor/skins');
102 102
 		Context::set('editor_skin_list', $editor_skin_list);
103 103
 
104
-		$skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->editor_skin);
104
+		$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $editor_config->editor_skin);
105 105
 		Context::set('editor_colorset_list', $skin_info->colorset);
106
-		$skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->comment_editor_skin);
106
+		$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $editor_config->comment_editor_skin);
107 107
 		Context::set('editor_comment_colorset_list', $skin_info->colorset);
108 108
 
109 109
 		$contents = FileHandler::readDir(_XE_PATH_.'modules/editor/styles');
110 110
 		$content_style_list = array();
111
-		for($i=0,$c=count($contents);$i<$c;$i++)
111
+		for ($i = 0, $c = count($contents); $i < $c; $i++)
112 112
 		{
113 113
 			$style = $contents[$i];
114
-			$info = $oModuleModel->loadSkinInfo($this->module_path,$style,'styles');
114
+			$info = $oModuleModel->loadSkinInfo($this->module_path, $style, 'styles');
115 115
 			$content_style_list[$style] = new stdClass();
116 116
 			$content_style_list[$style]->title = $info->title;
117 117
 		}			
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	{
149 149
 		$skin = Context::get('skin');
150 150
 		$oModuleModel = getModel('module');
151
-		$skin_info = $oModuleModel->loadSkinInfo($this->module_path,$skin);
151
+		$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin);
152 152
 		$colorset = $skin_info->colorset;
153 153
 		Context::set('colorset', $colorset);
154 154
 	}
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 
161 161
 		$mode = Context::get('mode');
162 162
 
163
-		if($mode != 'main')
163
+		if ($mode != 'main')
164 164
 		{
165 165
 			$option_com = new stdClass();
166 166
 			$option_com->allow_fileupload = false;
Please login to merge, or discard this patch.
modules/editor/editor.model.php 2 patches
Spacing   +140 added lines, -140 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	 */
24 24
 	function getEditorConfig($module_srl = null)
25 25
 	{
26
-		if(!$GLOBALS['__editor_module_config__'][$module_srl] && $module_srl)
26
+		if (!$GLOBALS['__editor_module_config__'][$module_srl] && $module_srl)
27 27
 		{
28 28
 			// Get trackback settings of the selected module
29 29
 			$oModuleModel = getModel('module');
@@ -34,55 +34,55 @@  discard block
 block discarded – undo
34 34
 		$oModuleModel = getModel('module');
35 35
 		$editor_default_config = $oModuleModel->getModuleConfig('editor');
36 36
 
37
-		if(!is_object($editor_config)) $editor_config = new stdClass();
37
+		if (!is_object($editor_config)) $editor_config = new stdClass();
38 38
 
39
-		if($editor_config->enable_autosave != 'N') $editor_config->enable_autosave = 'Y';
40
-		if(!is_array($editor_config->enable_html_grant)) $editor_config->enable_html_grant = array();
41
-		if(!is_array($editor_config->enable_comment_html_grant)) $editor_config->enable_comment_html_grant = array();
42
-		if(!is_array($editor_config->upload_file_grant)) $editor_config->upload_file_grant = array();
43
-		if(!is_array($editor_config->comment_upload_file_grant)) $editor_config->comment_upload_file_grant = array();
44
-		if(!is_array($editor_config->enable_default_component_grant)) $editor_config->enable_default_component_grant = array();
45
-		if(!is_array($editor_config->enable_comment_default_component_grant)) $editor_config->enable_comment_default_component_grant = array();
46
-		if(!is_array($editor_config->enable_component_grant)) $editor_config->enable_component_grant = array();
47
-		if(!is_array($editor_config->enable_comment_component_grant)) $editor_config->enable_comment_component_grant= array();
39
+		if ($editor_config->enable_autosave != 'N') $editor_config->enable_autosave = 'Y';
40
+		if (!is_array($editor_config->enable_html_grant)) $editor_config->enable_html_grant = array();
41
+		if (!is_array($editor_config->enable_comment_html_grant)) $editor_config->enable_comment_html_grant = array();
42
+		if (!is_array($editor_config->upload_file_grant)) $editor_config->upload_file_grant = array();
43
+		if (!is_array($editor_config->comment_upload_file_grant)) $editor_config->comment_upload_file_grant = array();
44
+		if (!is_array($editor_config->enable_default_component_grant)) $editor_config->enable_default_component_grant = array();
45
+		if (!is_array($editor_config->enable_comment_default_component_grant)) $editor_config->enable_comment_default_component_grant = array();
46
+		if (!is_array($editor_config->enable_component_grant)) $editor_config->enable_component_grant = array();
47
+		if (!is_array($editor_config->enable_comment_component_grant)) $editor_config->enable_comment_component_grant = array();
48 48
 
49
-		if(!$editor_config->editor_height)
49
+		if (!$editor_config->editor_height)
50 50
 		{
51 51
 			$editor_config->editor_height = ($editor_default_config->editor_height) ? $editor_default_config->editor_height : 500;
52 52
 		}
53
-		if(!$editor_config->comment_editor_height)
53
+		if (!$editor_config->comment_editor_height)
54 54
 		{
55 55
 			$editor_config->comment_editor_height = ($editor_default_config->comment_editor_height) ? $editor_default_config->comment_editor_height : 120;
56 56
 		}
57
-		if(!$editor_config->editor_skin)
57
+		if (!$editor_config->editor_skin)
58 58
 		{
59 59
 			$editor_config->editor_skin = ($editor_default_config->editor_skin) ? $editor_default_config->editor_skin : 'ckeditor';
60 60
 		}
61
-		if(!$editor_config->comment_editor_skin)
61
+		if (!$editor_config->comment_editor_skin)
62 62
 		{
63 63
 			$editor_config->comment_editor_skin = ($editor_default_config->comment_editor_skin) ? $editor_default_config->comment_editor_skin : 'ckeditor';
64 64
 		}
65
-		if(!$editor_config->content_style)
65
+		if (!$editor_config->content_style)
66 66
 		{
67 67
 			$editor_config->content_style = ($editor_default_config->content_style) ? $editor_default_config->content_style : 'ckeditor_light';
68 68
 		}
69
-		if(!$editor_config->content_font && $editor_default_config->content_font)
69
+		if (!$editor_config->content_font && $editor_default_config->content_font)
70 70
 		{
71 71
 			$editor_config->content_font = $editor_default_config->content_font;
72 72
 		}
73
-		if(!$editor_config->content_font_size && $editor_default_config->content_font_size)
73
+		if (!$editor_config->content_font_size && $editor_default_config->content_font_size)
74 74
 		{
75 75
 			$editor_config->content_font_size = $editor_default_config->content_font_size;
76 76
 		}
77
-		if(!$editor_config->sel_editor_colorset && $editor_default_config->sel_editor_colorset)
77
+		if (!$editor_config->sel_editor_colorset && $editor_default_config->sel_editor_colorset)
78 78
 		{
79 79
 			$editor_config->sel_editor_colorset = $editor_default_config->sel_editor_colorset;
80 80
 		}
81
-		if(!$editor_config->sel_comment_editor_colorset && $editor_default_config->sel_comment_editor_colorset)
81
+		if (!$editor_config->sel_comment_editor_colorset && $editor_default_config->sel_comment_editor_colorset)
82 82
 		{
83 83
 			$editor_config->sel_comment_editor_colorset = $editor_default_config->sel_comment_editor_colorset;
84 84
 		}
85
-		if(!$editor_config->comment_content_style && $editor_default_config->comment_content_style)
85
+		if (!$editor_config->comment_content_style && $editor_default_config->comment_content_style)
86 86
 		{
87 87
 			$editor_config->comment_content_style = $editor_default_config->comment_content_style;
88 88
 		}
@@ -92,25 +92,25 @@  discard block
 block discarded – undo
92 92
 
93 93
 	function loadDrComponents()
94 94
 	{
95
-		$drComponentPath = _XE_PATH_ . 'modules/editor/skins/dreditor/drcomponents/';
95
+		$drComponentPath = _XE_PATH_.'modules/editor/skins/dreditor/drcomponents/';
96 96
 		$drComponentList = FileHandler::readDir($drComponentPath);
97 97
 
98 98
 		$oTemplate = &TemplateHandler::getInstance();
99 99
 
100 100
 		$drComponentInfo = array();
101
-		if($drComponentList)
101
+		if ($drComponentList)
102 102
 		{
103
-			foreach($drComponentList as $i => $drComponent)
103
+			foreach ($drComponentList as $i => $drComponent)
104 104
 			{
105 105
 				unset($obj);
106 106
 				$obj = $this->getDrComponentXmlInfo($drComponent);
107
-				Context::loadLang(sprintf('%s%s/lang/',$drComponentPath,$drComponent));
108
-				$path = sprintf('%s%s/tpl/',$drComponentPath,$drComponent);
109
-				$obj->html = $oTemplate->compile($path,$drComponent);
107
+				Context::loadLang(sprintf('%s%s/lang/', $drComponentPath, $drComponent));
108
+				$path = sprintf('%s%s/tpl/', $drComponentPath, $drComponent);
109
+				$obj->html = $oTemplate->compile($path, $drComponent);
110 110
 				$drComponentInfo[$drComponent] = $obj;
111 111
 			}
112 112
 		}
113
-		Context::set('drComponentList',$drComponentInfo);
113
+		Context::set('drComponentList', $drComponentInfo);
114 114
 	}
115 115
 
116 116
 	function getDrComponentXmlInfo($drComponentName)
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 		$xml_file = sprintf('%sinfo.xml', $component_path);
123 123
 		$cache_file = sprintf('./files/cache/editor/dr_%s.%s.php', $drComponentName, $lang_type);
124 124
 		// Return information after including it after cached xml file exists
125
-		if(file_exists($cache_file) && file_exists($xml_file) && filemtime($cache_file) > filemtime($xml_file))
125
+		if (file_exists($cache_file) && file_exists($xml_file) && filemtime($cache_file) > filemtime($xml_file))
126 126
 		{
127 127
 			include($cache_file);
128 128
 			return $xml_info;
@@ -151,10 +151,10 @@  discard block
 block discarded – undo
151 151
 		$buff .= sprintf('$xml_info->license_link = "%s";', $component_info->license_link);
152 152
 
153 153
 		// Author information
154
-		if(!is_array($xml_doc->component->author)) $author_list[] = $xml_doc->component->author;
154
+		if (!is_array($xml_doc->component->author)) $author_list[] = $xml_doc->component->author;
155 155
 		else $author_list = $xml_doc->component->author;
156 156
 
157
-		for($i=0; $i < count($author_list); $i++)
157
+		for ($i = 0; $i < count($author_list); $i++)
158 158
 		{
159 159
 			$buff .= sprintf('$xml_info->author['.$i.']->name = "%s";', $author_list[$i]->name->body);
160 160
 			$buff .= sprintf('$xml_info->author['.$i.']->email_address = "%s";', $author_list[$i]->attrs->email_address);
@@ -163,10 +163,10 @@  discard block
 block discarded – undo
163 163
 
164 164
 		// List extra variables (text type only in the editor component)
165 165
 		$extra_vars = $xml_doc->component->extra_vars->var;
166
-		if($extra_vars)
166
+		if ($extra_vars)
167 167
 		{
168
-			if(!is_array($extra_vars)) $extra_vars = array($extra_vars);
169
-			foreach($extra_vars as $key => $val)
168
+			if (!is_array($extra_vars)) $extra_vars = array($extra_vars);
169
+			foreach ($extra_vars as $key => $val)
170 170
 			{
171 171
 				unset($obj);
172 172
 				$key = $val->attrs->name;
@@ -198,47 +198,47 @@  discard block
 block discarded – undo
198 198
 		 * Editor's default options
199 199
 		 */
200 200
 		// Option setting to allow file upload
201
-		if($upload_target_srl)
201
+		if ($upload_target_srl)
202 202
 		{
203 203
 			$option->editor_sequence = $upload_target_srl;
204 204
 		}
205
-		if(!$option->allow_fileupload) $allow_fileupload = false;
205
+		if (!$option->allow_fileupload) $allow_fileupload = false;
206 206
 		else $allow_fileupload = true;
207 207
 		// content_style setting
208
-		if(!$option->content_style) $option->content_style = 'ckeditor_light';
208
+		if (!$option->content_style) $option->content_style = 'ckeditor_light';
209 209
 		Context::set('content_style', $option->content_style);
210
-		Context::set('content_style_path', $this->module_path . 'styles/' . $option->content_style);
210
+		Context::set('content_style_path', $this->module_path.'styles/'.$option->content_style);
211 211
 		// Default font setting
212 212
 		Context::set('content_font', addslashes($option->content_font));
213 213
 		Context::set('content_font_size', $option->content_font_size);
214 214
 
215 215
 		// Option setting to allow auto-save
216
-		if(!$option->enable_autosave) $enable_autosave = false;
217
-		elseif(Context::get($option->primary_key_name)) $enable_autosave = false;
216
+		if (!$option->enable_autosave) $enable_autosave = false;
217
+		elseif (Context::get($option->primary_key_name)) $enable_autosave = false;
218 218
 		else $enable_autosave = true;
219 219
 		// Option setting to allow the default editor component
220
-		if(!$option->enable_default_component) $enable_default_component = false;
220
+		if (!$option->enable_default_component) $enable_default_component = false;
221 221
 		else $enable_default_component = true;
222 222
 		// Option setting to allow other extended components
223
-		if(!$option->enable_component) $enable_component = false;
223
+		if (!$option->enable_component) $enable_component = false;
224 224
 		else $enable_component = true;
225 225
 		// Setting for html-mode
226
-		if($option->disable_html) $html_mode = false;
226
+		if ($option->disable_html) $html_mode = false;
227 227
 		else $html_mode = true;
228 228
 		// Set Height
229
-		if(!$option->height) $editor_height = 300;
229
+		if (!$option->height) $editor_height = 300;
230 230
 		else $editor_height = $option->height;
231 231
 		// Skin Setting
232 232
 		$skin = $option->skin;
233
-		if(!$skin) $skin = 'ckeditor';
233
+		if (!$skin) $skin = 'ckeditor';
234 234
 
235 235
 		$colorset = $option->colorset;
236
-		if(!$colorset) $colorset = 'moono';
236
+		if (!$colorset) $colorset = 'moono';
237 237
 		Context::set('colorset', $colorset);
238 238
 		Context::set('skin', $skin);
239 239
 		Context::set('module_type', $option->module_type);
240 240
 
241
-		if($skin=='dreditor')
241
+		if ($skin == 'dreditor')
242 242
 		{
243 243
 			$this->loadDrComponents();
244 244
 		}
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 		/**
247 247
 		 * Check the automatic backup feature (do not use if the post is edited)
248 248
 		 */
249
-		if($enable_autosave)
249
+		if ($enable_autosave)
250 250
 		{
251 251
 			// Extract auto-saved data
252 252
 			$saved_doc = $this->getSavedDoc($upload_target_srl);
@@ -258,26 +258,26 @@  discard block
 block discarded – undo
258 258
 		/**
259 259
 		 * Extract editor's unique number (in order to display multiple editors on a single page)
260 260
 		 */
261
-		if($option->editor_sequence) $editor_sequence = $option->editor_sequence;
261
+		if ($option->editor_sequence) $editor_sequence = $option->editor_sequence;
262 262
 		else
263 263
 		{
264
-			if(!$_SESSION['_editor_sequence_']) $_SESSION['_editor_sequence_'] = 1;
265
-			$editor_sequence = $_SESSION['_editor_sequence_'] ++;
264
+			if (!$_SESSION['_editor_sequence_']) $_SESSION['_editor_sequence_'] = 1;
265
+			$editor_sequence = $_SESSION['_editor_sequence_']++;
266 266
 		}
267 267
 
268 268
 		/**
269 269
 		 * Upload setting by using configuration of the file module internally
270 270
 		 */
271 271
 		$files_count = 0;
272
-		if($allow_fileupload)
272
+		if ($allow_fileupload)
273 273
 		{
274 274
 			$oFileModel = getModel('file');
275 275
 			// Get upload configuration to set on SWFUploader
276 276
 			$file_config = $oFileModel->getUploadConfig();
277
-			$file_config->allowed_attach_size = $file_config->allowed_attach_size*1024*1024;
278
-			$file_config->allowed_filesize = $file_config->allowed_filesize*1024*1024;
277
+			$file_config->allowed_attach_size = $file_config->allowed_attach_size * 1024 * 1024;
278
+			$file_config->allowed_filesize = $file_config->allowed_filesize * 1024 * 1024;
279 279
 
280
-			Context::set('file_config',$file_config);
280
+			Context::set('file_config', $file_config);
281 281
 			// Configure upload status such as file size
282 282
 			$upload_status = $oFileModel->getUploadStatus();
283 283
 			Context::set('upload_status', $upload_status);
@@ -285,9 +285,9 @@  discard block
 block discarded – undo
285 285
 			$oFileController = getController('file');
286 286
 			$oFileController->setUploadInfo($editor_sequence, $upload_target_srl);
287 287
 			// Check if the file already exists
288
-			if($upload_target_srl) $files_count = $oFileModel->getFilesCount($upload_target_srl);
288
+			if ($upload_target_srl) $files_count = $oFileModel->getFilesCount($upload_target_srl);
289 289
 		}
290
-		Context::set('files_count', (int)$files_count);
290
+		Context::set('files_count', (int) $files_count);
291 291
 
292 292
 		Context::set('allow_fileupload', $allow_fileupload);
293 293
 		// Set editor_sequence value
@@ -304,10 +304,10 @@  discard block
 block discarded – undo
304 304
 		 * Check editor component
305 305
 		 */
306 306
 		$site_module_info = Context::get('site_module_info');
307
-		$site_srl = (int)$site_module_info->site_srl;
308
-		if($enable_component)
307
+		$site_srl = (int) $site_module_info->site_srl;
308
+		if ($enable_component)
309 309
 		{
310
-			if(!Context::get('component_list'))
310
+			if (!Context::get('component_list'))
311 311
 			{
312 312
 				$component_list = $this->getComponentList(true, $site_srl);
313 313
 				Context::set('component_list', $component_list);
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 		$tpl_path = sprintf('%sskins/%s/', $this->module_path, $skin);
335 335
 		$tpl_file = 'editor.html';
336 336
 
337
-		if(!file_exists($tpl_path.$tpl_file))
337
+		if (!file_exists($tpl_path.$tpl_file))
338 338
 		{
339 339
 			$skin = 'ckeditor';
340 340
 			$tpl_path = sprintf('%sskins/%s/', $this->module_path, $skin);
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 		$config->module_type = $type;
365 365
 
366 366
 		// Configurations listed according to a type
367
-		if($type == 'document')
367
+		if ($type == 'document')
368 368
 		{
369 369
 			$config->editor_skin = $editor_config->editor_skin;
370 370
 			$config->content_style = $editor_config->content_style;
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 			$config->enable_autosave = 'N';
394 394
 		}
395 395
 		// Check a group_list of the currently logged-in user for permission check
396
-		if(Context::get('is_logged'))
396
+		if (Context::get('is_logged'))
397 397
 		{
398 398
 			$logged_info = Context::get('logged_info');
399 399
 			$group_list = $logged_info->group_list;
@@ -412,12 +412,12 @@  discard block
 block discarded – undo
412 412
 		$option->colorset = $config->sel_editor_colorset;
413 413
 		// Permission check for file upload
414 414
 		$option->allow_fileupload = false;
415
-		if($logged_info->is_admin=='Y') $option->allow_fileupload = true;
416
-		elseif(count($config->upload_file_grant))
415
+		if ($logged_info->is_admin == 'Y') $option->allow_fileupload = true;
416
+		elseif (count($config->upload_file_grant))
417 417
 		{
418
-			foreach($group_list as $group_srl => $group_info)
418
+			foreach ($group_list as $group_srl => $group_info)
419 419
 			{
420
-				if(in_array($group_srl, $config->upload_file_grant))
420
+				if (in_array($group_srl, $config->upload_file_grant))
421 421
 				{
422 422
 					$option->allow_fileupload = true;
423 423
 					break;
@@ -427,12 +427,12 @@  discard block
 block discarded – undo
427 427
 		else $option->allow_fileupload = true;
428 428
 		// Permission check for using default components
429 429
 		$option->enable_default_component = false;
430
-		if($logged_info->is_admin=='Y') $option->enable_default_component = true;
431
-		elseif(count($config->enable_default_component_grant))
430
+		if ($logged_info->is_admin == 'Y') $option->enable_default_component = true;
431
+		elseif (count($config->enable_default_component_grant))
432 432
 		{
433
-			foreach($group_list as $group_srl => $group_info)
433
+			foreach ($group_list as $group_srl => $group_info)
434 434
 			{
435
-				if(in_array($group_srl, $config->enable_default_component_grant))
435
+				if (in_array($group_srl, $config->enable_default_component_grant))
436 436
 				{
437 437
 					$option->enable_default_component = true;
438 438
 					break;
@@ -442,12 +442,12 @@  discard block
 block discarded – undo
442 442
 		else $option->enable_default_component = true;
443 443
 		// Permisshion check for using extended components
444 444
 		$option->enable_component = false;
445
-		if($logged_info->is_admin=='Y') $option->enable_component = true;
446
-		elseif(count($config->enable_component_grant))
445
+		if ($logged_info->is_admin == 'Y') $option->enable_component = true;
446
+		elseif (count($config->enable_component_grant))
447 447
 		{
448
-			foreach($group_list as $group_srl => $group_info)
448
+			foreach ($group_list as $group_srl => $group_info)
449 449
 			{
450
-				if(in_array($group_srl, $config->enable_component_grant))
450
+				if (in_array($group_srl, $config->enable_component_grant))
451 451
 				{
452 452
 					$option->enable_component = true;
453 453
 					break;
@@ -457,12 +457,12 @@  discard block
 block discarded – undo
457 457
 		else $option->enable_component = true;
458 458
 		// HTML editing privileges
459 459
 		$enable_html = false;
460
-		if($logged_info->is_admin=='Y') $enable_html = true;
461
-		elseif(count($config->enable_html_grant))
460
+		if ($logged_info->is_admin == 'Y') $enable_html = true;
461
+		elseif (count($config->enable_html_grant))
462 462
 		{
463
-			foreach($group_list as $group_srl => $group_info)
463
+			foreach ($group_list as $group_srl => $group_info)
464 464
 			{
465
-				if(in_array($group_srl, $config->enable_html_grant))
465
+				if (in_array($group_srl, $config->enable_html_grant))
466 466
 				{
467 467
 					$enable_html = true;
468 468
 					break;
@@ -471,12 +471,12 @@  discard block
 block discarded – undo
471 471
 		}
472 472
 		else $enable_html = true;
473 473
 
474
-		if($enable_html) $option->disable_html = false;
474
+		if ($enable_html) $option->disable_html = false;
475 475
 		else $option->disable_html = true;
476 476
 		// Set Height
477 477
 		$option->height = $config->editor_height;
478 478
 		// Set an option for Auto-save
479
-		$option->enable_autosave = $config->enable_autosave=='Y'?true:false;
479
+		$option->enable_autosave = $config->enable_autosave == 'Y' ? true : false;
480 480
 		// Other settings
481 481
 		$option->primary_key_name = $primary_key_name;
482 482
 		$option->content_key_name = $content_key_name;
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 	{
492 492
 		$auto_save_args = new stdClass();
493 493
 		// Find a document by using member_srl for logged-in user and ipaddress for non-logged user
494
-		if(Context::get('is_logged'))
494
+		if (Context::get('is_logged'))
495 495
 		{
496 496
 			$logged_info = Context::get('logged_info');
497 497
 			$auto_save_args->member_srl = $logged_info->member_srl;
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 		}
503 503
 		$auto_save_args->module_srl = Context::get('module_srl');
504 504
 		// Get the current module if module_srl doesn't exist
505
-		if(!$auto_save_args->module_srl)
505
+		if (!$auto_save_args->module_srl)
506 506
 		{
507 507
 			$current_module_info = Context::get('current_module_info');
508 508
 			$auto_save_args->module_srl = $current_module_info->module_srl;
@@ -511,20 +511,20 @@  discard block
 block discarded – undo
511 511
 		$output = executeQuery('editor.getSavedDocument', $auto_save_args);
512 512
 		$saved_doc = $output->data;
513 513
 		// Return null if no result is auto-saved
514
-		if(!$saved_doc) return;
514
+		if (!$saved_doc) return;
515 515
 		// Check if the auto-saved document already exists
516 516
 		$oDocumentModel = getModel('document');
517 517
 		$oSaved = $oDocumentModel->getDocument($saved_doc->document_srl);
518
-		if($oSaved->isExists()) return;
518
+		if ($oSaved->isExists()) return;
519 519
 		// Move all the files if the auto-saved data contains document_srl and file
520 520
 		// Then set document_srl to editor_sequence
521
-		if($saved_doc->document_srl && $upload_target_srl && !Context::get('document_srl'))
521
+		if ($saved_doc->document_srl && $upload_target_srl && !Context::get('document_srl'))
522 522
 		{
523 523
 			$saved_doc->module_srl = $auto_save_args->module_srl;
524 524
 			$oFileController = getController('file');
525 525
 			$oFileController->moveFile($saved_doc->document_srl, $saved_doc->module_srl, $upload_target_srl);
526 526
 		}
527
-		else if($upload_target_srl) $saved_doc->document_srl = $upload_target_srl;
527
+		else if ($upload_target_srl) $saved_doc->document_srl = $upload_target_srl;
528 528
 		// Change auto-saved data
529 529
 		$oEditorController = getController('editor');
530 530
 		$oEditorController->deleteSavedDoc(false);
@@ -540,18 +540,18 @@  discard block
 block discarded – undo
540 540
 	 */
541 541
 	function getComponentObject($component, $editor_sequence = 0, $site_srl = 0)
542 542
 	{
543
-		if(!preg_match('/^[a-zA-Z0-9_-]+$/',$component) || !preg_match('/^[0-9]+$/', $editor_sequence . $site_srl)) return;
543
+		if (!preg_match('/^[a-zA-Z0-9_-]+$/', $component) || !preg_match('/^[0-9]+$/', $editor_sequence.$site_srl)) return;
544 544
 
545
-		if(!$this->loaded_component_list[$component][$editor_sequence])
545
+		if (!$this->loaded_component_list[$component][$editor_sequence])
546 546
 		{
547 547
 			// Create an object of the component and execute
548 548
 			$class_path = sprintf('%scomponents/%s/', $this->module_path, $component);
549 549
 			$class_file = sprintf('%s%s.class.php', $class_path, $component);
550
-			if(!file_exists($class_file)) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
550
+			if (!file_exists($class_file)) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
551 551
 			// Create an object after loading the class file
552 552
 			require_once($class_file);
553 553
 			$oComponent = new $component($editor_sequence, $class_path);
554
-			if(!$oComponent) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
554
+			if (!$oComponent) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
555 555
 			// Add configuration information
556 556
 			$component_info = $this->getComponent($component, $site_srl);
557 557
 			$oComponent->setInfo($component_info);
@@ -572,14 +572,14 @@  discard block
 block discarded – undo
572 572
 	/**
573 573
 	 * @brief Return the cache file name of editor component list
574 574
 	 */
575
-	function getCacheFile($filter_enabled= true, $site_srl = 0)
575
+	function getCacheFile($filter_enabled = true, $site_srl = 0)
576 576
 	{
577 577
 		$lang = Context::getLangType();
578 578
 		$cache_path = _XE_PATH_.'files/cache/editor/cache/';
579 579
 		FileHandler::makeDir($cache_path);
580
-		$cache_file = $cache_path.'component_list.' . $lang .'.';
581
-		if($filter_enabled) $cache_file .= 'filter.';
582
-		if($site_srl) $cache_file .= $site_srl.'.';
580
+		$cache_file = $cache_path.'component_list.'.$lang.'.';
581
+		if ($filter_enabled) $cache_file .= 'filter.';
582
+		if ($site_srl) $cache_file .= $site_srl.'.';
583 583
 		$cache_file .= 'php';
584 584
 		return $cache_file;
585 585
 	}
@@ -587,19 +587,19 @@  discard block
 block discarded – undo
587 587
 	/**
588 588
 	 * @brief Return a component list (DB Information included)
589 589
 	 */
590
-	function getComponentList($filter_enabled = true, $site_srl=0, $from_db=false)
590
+	function getComponentList($filter_enabled = true, $site_srl = 0, $from_db = false)
591 591
 	{
592 592
 		$cache_file = $this->getCacheFile(false, $site_srl);
593
-		if($from_db || !file_exists($cache_file))
593
+		if ($from_db || !file_exists($cache_file))
594 594
 		{
595 595
 			$oEditorController = getController('editor');
596 596
 			$oEditorController->makeCache(false, $site_srl);
597 597
 		}
598 598
 
599
-		if(!file_exists($cache_file)) return;
599
+		if (!file_exists($cache_file)) return;
600 600
 		include($cache_file);
601 601
 		$logged_info = Context::get('logged_info');
602
-		if($logged_info && is_array($logged_info->group_list))
602
+		if ($logged_info && is_array($logged_info->group_list))
603 603
 		{
604 604
 			$group_list = array_keys($logged_info->group_list);
605 605
 		}
@@ -608,45 +608,45 @@  discard block
 block discarded – undo
608 608
 			$group_list = array();
609 609
 		}
610 610
 
611
-		if(count($component_list))
611
+		if (count($component_list))
612 612
 		{
613
-			foreach($component_list as $key => $val)
613
+			foreach ($component_list as $key => $val)
614 614
 			{
615
-				if(!trim($key)) continue;
616
-				if(!is_dir(_XE_PATH_.'modules/editor/components/'.$key))
615
+				if (!trim($key)) continue;
616
+				if (!is_dir(_XE_PATH_.'modules/editor/components/'.$key))
617 617
 				{
618 618
 					FileHandler::removeFile($cache_file);
619 619
 					return $this->getComponentList($filter_enabled, $site_srl);
620 620
 				}
621
-				if(!$filter_enabled) continue;
622
-				if($val->enabled == "N")
621
+				if (!$filter_enabled) continue;
622
+				if ($val->enabled == "N")
623 623
 				{
624 624
 					unset($component_list->{$key});
625 625
 					continue;
626 626
 				}
627
-				if($logged_info->is_admin == "Y" || $logged_info->is_site_admin == "Y") continue;
628
-				if($val->target_group)
627
+				if ($logged_info->is_admin == "Y" || $logged_info->is_site_admin == "Y") continue;
628
+				if ($val->target_group)
629 629
 				{
630
-					if(!$logged_info)
630
+					if (!$logged_info)
631 631
 					{
632 632
 						$val->enabled = "N";
633 633
 					}
634 634
 					else
635 635
 					{
636 636
 						$is_granted = false;
637
-						foreach($group_list as $group_srl)
637
+						foreach ($group_list as $group_srl)
638 638
 						{
639
-							if(in_array($group_srl, $val->target_group)) $is_granted = true;
639
+							if (in_array($group_srl, $val->target_group)) $is_granted = true;
640 640
 						}
641
-						if(!$is_granted) $val->enabled = "N";
641
+						if (!$is_granted) $val->enabled = "N";
642 642
 					}
643 643
 				}
644
-				if($val->enabled != "N" && $val->mid_list)
644
+				if ($val->enabled != "N" && $val->mid_list)
645 645
 				{
646 646
 					$mid = Context::get('mid');
647
-					if(!in_array($mid, $val->mid_list)) $val->enabled = "N";
647
+					if (!in_array($mid, $val->mid_list)) $val->enabled = "N";
648 648
 				}
649
-				if($val->enabled == "N")
649
+				if ($val->enabled == "N")
650 650
 				{
651 651
 					unset($component_list->{$key});
652 652
 					continue;
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
 		$args = new stdClass();
665 665
 		$args->component_name = $component_name;
666 666
 
667
-		if($site_srl)
667
+		if ($site_srl)
668 668
 		{
669 669
 			$args->site_srl = $site_srl;
670 670
 			$output = executeQuery('editor.getSiteComponent', $args);
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
 		}
676 676
 		$component = $output->data;
677 677
 
678
-		if(!$output->data) return false;
678
+		if (!$output->data) return false;
679 679
 
680 680
 		$component_name = $component->component_name;
681 681
 
@@ -687,25 +687,25 @@  discard block
 block discarded – undo
687 687
 
688 688
 		$xml_info->mid_list = array();
689 689
 
690
-		if($component->extra_vars)
690
+		if ($component->extra_vars)
691 691
 		{
692 692
 			$extra_vars = unserialize($component->extra_vars);
693 693
 
694
-			if($extra_vars->target_group)
694
+			if ($extra_vars->target_group)
695 695
 			{
696 696
 				$xml_info->target_group = $extra_vars->target_group;
697 697
 				unset($extra_vars->target_group);
698 698
 			}
699 699
 
700
-			if($extra_vars->mid_list)
700
+			if ($extra_vars->mid_list)
701 701
 			{
702 702
 				$xml_info->mid_list = $extra_vars->mid_list;
703 703
 				unset($extra_vars->mid_list);
704 704
 			}
705 705
 
706
-			if($xml_info->extra_vars)
706
+			if ($xml_info->extra_vars)
707 707
 			{
708
-				foreach($xml_info->extra_vars as $key => $val)
708
+				foreach ($xml_info->extra_vars as $key => $val)
709 709
 				{
710 710
 					$xml_info->extra_vars->{$key}->value = $extra_vars->{$key};
711 711
 				}
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
 		$cache_file = sprintf('./files/cache/editor/%s.%s.php', $component, $lang_type);
730 730
 
731 731
 		// Include and return xml file information if cached file exists
732
-		if(file_exists($cache_file) && file_exists($xml_file) && filemtime($cache_file) > filemtime($xml_file))
732
+		if (file_exists($cache_file) && file_exists($xml_file) && filemtime($cache_file) > filemtime($xml_file))
733 733
 		{
734 734
 			include($cache_file);
735 735
 
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
 		$component_info->component_name = $component;
747 747
 		$component_info->title = $xml_doc->component->title->body;
748 748
 
749
-		if($xml_doc->component->version)
749
+		if ($xml_doc->component->version)
750 750
 		{
751 751
 			$component_info->description = str_replace('\n', "\n", $xml_doc->component->description->body);
752 752
 			$component_info->version = $xml_doc->component->version->body;
@@ -772,10 +772,10 @@  discard block
 block discarded – undo
772 772
 
773 773
 		// Author information
774 774
 		$author_list = array();
775
-		if(!is_array($xml_doc->component->author)) $author_list[] = $xml_doc->component->author;
775
+		if (!is_array($xml_doc->component->author)) $author_list[] = $xml_doc->component->author;
776 776
 		else $author_list = $xml_doc->component->author;
777 777
 
778
-		for($i = 0; $i < count($author_list); $i++)
778
+		for ($i = 0; $i < count($author_list); $i++)
779 779
 		{
780 780
 			$author = new stdClass;
781 781
 			$author->name = $author_list[$i]->name->body;
@@ -786,39 +786,39 @@  discard block
 block discarded – undo
786 786
 
787 787
 		// List extra variables (text type only for editor component)
788 788
 		$extra_vars = $xml_doc->component->extra_vars;
789
-		if($extra_vars)
789
+		if ($extra_vars)
790 790
 		{
791 791
 			$extra_var_groups = $extra_vars->group;
792
-			if(!$extra_var_groups)
792
+			if (!$extra_var_groups)
793 793
 			{
794 794
 				$extra_var_groups = $extra_vars;
795 795
 			}
796
-			if(!is_array($extra_var_groups))
796
+			if (!is_array($extra_var_groups))
797 797
 			{
798 798
 				$extra_var_groups = array($extra_var_groups);
799 799
 			}
800 800
 
801
-			foreach($extra_var_groups as $group)
801
+			foreach ($extra_var_groups as $group)
802 802
 			{
803 803
 				$extra_vars = $group->var;
804
-				if(!is_array($group->var))
804
+				if (!is_array($group->var))
805 805
 				{
806 806
 					$extra_vars = array($group->var);
807 807
 				}
808 808
 
809
-				foreach($extra_vars as $key => $val)
809
+				foreach ($extra_vars as $key => $val)
810 810
 				{
811
-					if(!$val)
811
+					if (!$val)
812 812
 					{
813 813
 						continue;
814 814
 					}
815 815
 
816 816
 					$obj = new stdClass();
817
-					if(!$val->attrs)
817
+					if (!$val->attrs)
818 818
 					{
819 819
 						$val->attrs = new stdClass();
820 820
 					}
821
-					if(!$val->attrs->type)
821
+					if (!$val->attrs->type)
822 822
 					{
823 823
 						$val->attrs->type = 'text';
824 824
 					}
@@ -828,26 +828,26 @@  discard block
 block discarded – undo
828 828
 					$obj->title = $val->title->body;
829 829
 					$obj->type = $val->attrs->type;
830 830
 					$obj->description = $val->description->body;
831
-					if($obj->name)
831
+					if ($obj->name)
832 832
 					{
833 833
 						$obj->value = $extra_vals->{$obj->name};
834 834
 					}
835
-					if(strpos($obj->value, '|@|') != FALSE)
835
+					if (strpos($obj->value, '|@|') != FALSE)
836 836
 					{
837 837
 						$obj->value = explode('|@|', $obj->value);
838 838
 					}
839
-					if($obj->type == 'mid_list' && !is_array($obj->value))
839
+					if ($obj->type == 'mid_list' && !is_array($obj->value))
840 840
 					{
841 841
 						$obj->value = array($obj->value);
842 842
 					}
843 843
 
844 844
 					// 'Select'type obtained from the option list.
845
-					if($val->options && !is_array($val->options))
845
+					if ($val->options && !is_array($val->options))
846 846
 					{
847 847
 						$val->options = array($val->options);
848 848
 					}
849 849
 
850
-					for($i = 0, $c = count($val->options); $i < $c; $i++)
850
+					for ($i = 0, $c = count($val->options); $i < $c; $i++)
851 851
 					{
852 852
 						$obj->options[$i] = new stdClass();
853 853
 						$obj->options[$i]->title = $val->options[$i]->title->body;
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
 
862 862
 		$buff = array();
863 863
 		$buff[] = '<?php if(!defined(\'__XE__\')) exit();';
864
-		$buff[] = '$xml_info = ' . var_export($component_info, TRUE) . ';';
864
+		$buff[] = '$xml_info = '.var_export($component_info, TRUE).';';
865 865
 		$buff = str_replace('stdClass::__set_state', '(object)', implode(PHP_EOL, $buff));
866 866
 
867 867
 		FileHandler::writeFile($cache_file, $buff, 'w');
Please login to merge, or discard this patch.
Braces   +173 added lines, -80 removed lines patch added patch discarded remove patch
@@ -34,17 +34,37 @@  discard block
 block discarded – undo
34 34
 		$oModuleModel = getModel('module');
35 35
 		$editor_default_config = $oModuleModel->getModuleConfig('editor');
36 36
 
37
-		if(!is_object($editor_config)) $editor_config = new stdClass();
38
-
39
-		if($editor_config->enable_autosave != 'N') $editor_config->enable_autosave = 'Y';
40
-		if(!is_array($editor_config->enable_html_grant)) $editor_config->enable_html_grant = array();
41
-		if(!is_array($editor_config->enable_comment_html_grant)) $editor_config->enable_comment_html_grant = array();
42
-		if(!is_array($editor_config->upload_file_grant)) $editor_config->upload_file_grant = array();
43
-		if(!is_array($editor_config->comment_upload_file_grant)) $editor_config->comment_upload_file_grant = array();
44
-		if(!is_array($editor_config->enable_default_component_grant)) $editor_config->enable_default_component_grant = array();
45
-		if(!is_array($editor_config->enable_comment_default_component_grant)) $editor_config->enable_comment_default_component_grant = array();
46
-		if(!is_array($editor_config->enable_component_grant)) $editor_config->enable_component_grant = array();
47
-		if(!is_array($editor_config->enable_comment_component_grant)) $editor_config->enable_comment_component_grant= array();
37
+		if(!is_object($editor_config)) {
38
+			$editor_config = new stdClass();
39
+		}
40
+
41
+		if($editor_config->enable_autosave != 'N') {
42
+			$editor_config->enable_autosave = 'Y';
43
+		}
44
+		if(!is_array($editor_config->enable_html_grant)) {
45
+			$editor_config->enable_html_grant = array();
46
+		}
47
+		if(!is_array($editor_config->enable_comment_html_grant)) {
48
+			$editor_config->enable_comment_html_grant = array();
49
+		}
50
+		if(!is_array($editor_config->upload_file_grant)) {
51
+			$editor_config->upload_file_grant = array();
52
+		}
53
+		if(!is_array($editor_config->comment_upload_file_grant)) {
54
+			$editor_config->comment_upload_file_grant = array();
55
+		}
56
+		if(!is_array($editor_config->enable_default_component_grant)) {
57
+			$editor_config->enable_default_component_grant = array();
58
+		}
59
+		if(!is_array($editor_config->enable_comment_default_component_grant)) {
60
+			$editor_config->enable_comment_default_component_grant = array();
61
+		}
62
+		if(!is_array($editor_config->enable_component_grant)) {
63
+			$editor_config->enable_component_grant = array();
64
+		}
65
+		if(!is_array($editor_config->enable_comment_component_grant)) {
66
+			$editor_config->enable_comment_component_grant= array();
67
+		}
48 68
 
49 69
 		if(!$editor_config->editor_height)
50 70
 		{
@@ -151,8 +171,11 @@  discard block
 block discarded – undo
151 171
 		$buff .= sprintf('$xml_info->license_link = "%s";', $component_info->license_link);
152 172
 
153 173
 		// Author information
154
-		if(!is_array($xml_doc->component->author)) $author_list[] = $xml_doc->component->author;
155
-		else $author_list = $xml_doc->component->author;
174
+		if(!is_array($xml_doc->component->author)) {
175
+			$author_list[] = $xml_doc->component->author;
176
+		} else {
177
+			$author_list = $xml_doc->component->author;
178
+		}
156 179
 
157 180
 		for($i=0; $i < count($author_list); $i++)
158 181
 		{
@@ -165,7 +188,9 @@  discard block
 block discarded – undo
165 188
 		$extra_vars = $xml_doc->component->extra_vars->var;
166 189
 		if($extra_vars)
167 190
 		{
168
-			if(!is_array($extra_vars)) $extra_vars = array($extra_vars);
191
+			if(!is_array($extra_vars)) {
192
+				$extra_vars = array($extra_vars);
193
+			}
169 194
 			foreach($extra_vars as $key => $val)
170 195
 			{
171 196
 				unset($obj);
@@ -202,10 +227,15 @@  discard block
 block discarded – undo
202 227
 		{
203 228
 			$option->editor_sequence = $upload_target_srl;
204 229
 		}
205
-		if(!$option->allow_fileupload) $allow_fileupload = false;
206
-		else $allow_fileupload = true;
230
+		if(!$option->allow_fileupload) {
231
+			$allow_fileupload = false;
232
+		} else {
233
+			$allow_fileupload = true;
234
+		}
207 235
 		// content_style setting
208
-		if(!$option->content_style) $option->content_style = 'ckeditor_light';
236
+		if(!$option->content_style) {
237
+			$option->content_style = 'ckeditor_light';
238
+		}
209 239
 		Context::set('content_style', $option->content_style);
210 240
 		Context::set('content_style_path', $this->module_path . 'styles/' . $option->content_style);
211 241
 		// Default font setting
@@ -213,27 +243,47 @@  discard block
 block discarded – undo
213 243
 		Context::set('content_font_size', $option->content_font_size);
214 244
 
215 245
 		// Option setting to allow auto-save
216
-		if(!$option->enable_autosave) $enable_autosave = false;
217
-		elseif(Context::get($option->primary_key_name)) $enable_autosave = false;
218
-		else $enable_autosave = true;
246
+		if(!$option->enable_autosave) {
247
+			$enable_autosave = false;
248
+		} elseif(Context::get($option->primary_key_name)) {
249
+			$enable_autosave = false;
250
+		} else {
251
+			$enable_autosave = true;
252
+		}
219 253
 		// Option setting to allow the default editor component
220
-		if(!$option->enable_default_component) $enable_default_component = false;
221
-		else $enable_default_component = true;
254
+		if(!$option->enable_default_component) {
255
+			$enable_default_component = false;
256
+		} else {
257
+			$enable_default_component = true;
258
+		}
222 259
 		// Option setting to allow other extended components
223
-		if(!$option->enable_component) $enable_component = false;
224
-		else $enable_component = true;
260
+		if(!$option->enable_component) {
261
+			$enable_component = false;
262
+		} else {
263
+			$enable_component = true;
264
+		}
225 265
 		// Setting for html-mode
226
-		if($option->disable_html) $html_mode = false;
227
-		else $html_mode = true;
266
+		if($option->disable_html) {
267
+			$html_mode = false;
268
+		} else {
269
+			$html_mode = true;
270
+		}
228 271
 		// Set Height
229
-		if(!$option->height) $editor_height = 300;
230
-		else $editor_height = $option->height;
272
+		if(!$option->height) {
273
+			$editor_height = 300;
274
+		} else {
275
+			$editor_height = $option->height;
276
+		}
231 277
 		// Skin Setting
232 278
 		$skin = $option->skin;
233
-		if(!$skin) $skin = 'ckeditor';
279
+		if(!$skin) {
280
+			$skin = 'ckeditor';
281
+		}
234 282
 
235 283
 		$colorset = $option->colorset;
236
-		if(!$colorset) $colorset = 'moono';
284
+		if(!$colorset) {
285
+			$colorset = 'moono';
286
+		}
237 287
 		Context::set('colorset', $colorset);
238 288
 		Context::set('skin', $skin);
239 289
 		Context::set('module_type', $option->module_type);
@@ -258,10 +308,13 @@  discard block
 block discarded – undo
258 308
 		/**
259 309
 		 * Extract editor's unique number (in order to display multiple editors on a single page)
260 310
 		 */
261
-		if($option->editor_sequence) $editor_sequence = $option->editor_sequence;
262
-		else
311
+		if($option->editor_sequence) {
312
+			$editor_sequence = $option->editor_sequence;
313
+		} else
263 314
 		{
264
-			if(!$_SESSION['_editor_sequence_']) $_SESSION['_editor_sequence_'] = 1;
315
+			if(!$_SESSION['_editor_sequence_']) {
316
+				$_SESSION['_editor_sequence_'] = 1;
317
+			}
265 318
 			$editor_sequence = $_SESSION['_editor_sequence_'] ++;
266 319
 		}
267 320
 
@@ -285,7 +338,9 @@  discard block
 block discarded – undo
285 338
 			$oFileController = getController('file');
286 339
 			$oFileController->setUploadInfo($editor_sequence, $upload_target_srl);
287 340
 			// Check if the file already exists
288
-			if($upload_target_srl) $files_count = $oFileModel->getFilesCount($upload_target_srl);
341
+			if($upload_target_srl) {
342
+				$files_count = $oFileModel->getFilesCount($upload_target_srl);
343
+			}
289 344
 		}
290 345
 		Context::set('files_count', (int)$files_count);
291 346
 
@@ -377,8 +432,7 @@  discard block
 block discarded – undo
377 432
 			$config->enable_html_grant = $editor_config->enable_html_grant;
378 433
 			$config->editor_height = $editor_config->editor_height;
379 434
 			$config->enable_autosave = $editor_config->enable_autosave;
380
-		}
381
-		else
435
+		} else
382 436
 		{
383 437
 			$config->editor_skin = $editor_config->comment_editor_skin;
384 438
 			$config->content_style = $editor_config->comment_content_style;
@@ -397,8 +451,7 @@  discard block
 block discarded – undo
397 451
 		{
398 452
 			$logged_info = Context::get('logged_info');
399 453
 			$group_list = $logged_info->group_list;
400
-		}
401
-		else
454
+		} else
402 455
 		{
403 456
 			$group_list = array();
404 457
 		}
@@ -412,8 +465,9 @@  discard block
 block discarded – undo
412 465
 		$option->colorset = $config->sel_editor_colorset;
413 466
 		// Permission check for file upload
414 467
 		$option->allow_fileupload = false;
415
-		if($logged_info->is_admin=='Y') $option->allow_fileupload = true;
416
-		elseif(count($config->upload_file_grant))
468
+		if($logged_info->is_admin=='Y') {
469
+			$option->allow_fileupload = true;
470
+		} elseif(count($config->upload_file_grant))
417 471
 		{
418 472
 			foreach($group_list as $group_srl => $group_info)
419 473
 			{
@@ -423,12 +477,14 @@  discard block
 block discarded – undo
423 477
 					break;
424 478
 				}
425 479
 			}
480
+		} else {
481
+			$option->allow_fileupload = true;
426 482
 		}
427
-		else $option->allow_fileupload = true;
428 483
 		// Permission check for using default components
429 484
 		$option->enable_default_component = false;
430
-		if($logged_info->is_admin=='Y') $option->enable_default_component = true;
431
-		elseif(count($config->enable_default_component_grant))
485
+		if($logged_info->is_admin=='Y') {
486
+			$option->enable_default_component = true;
487
+		} elseif(count($config->enable_default_component_grant))
432 488
 		{
433 489
 			foreach($group_list as $group_srl => $group_info)
434 490
 			{
@@ -438,12 +494,14 @@  discard block
 block discarded – undo
438 494
 					break;
439 495
 				}
440 496
 			}
497
+		} else {
498
+			$option->enable_default_component = true;
441 499
 		}
442
-		else $option->enable_default_component = true;
443 500
 		// Permisshion check for using extended components
444 501
 		$option->enable_component = false;
445
-		if($logged_info->is_admin=='Y') $option->enable_component = true;
446
-		elseif(count($config->enable_component_grant))
502
+		if($logged_info->is_admin=='Y') {
503
+			$option->enable_component = true;
504
+		} elseif(count($config->enable_component_grant))
447 505
 		{
448 506
 			foreach($group_list as $group_srl => $group_info)
449 507
 			{
@@ -453,12 +511,14 @@  discard block
 block discarded – undo
453 511
 					break;
454 512
 				}
455 513
 			}
514
+		} else {
515
+			$option->enable_component = true;
456 516
 		}
457
-		else $option->enable_component = true;
458 517
 		// HTML editing privileges
459 518
 		$enable_html = false;
460
-		if($logged_info->is_admin=='Y') $enable_html = true;
461
-		elseif(count($config->enable_html_grant))
519
+		if($logged_info->is_admin=='Y') {
520
+			$enable_html = true;
521
+		} elseif(count($config->enable_html_grant))
462 522
 		{
463 523
 			foreach($group_list as $group_srl => $group_info)
464 524
 			{
@@ -468,11 +528,15 @@  discard block
 block discarded – undo
468 528
 					break;
469 529
 				}
470 530
 			}
531
+		} else {
532
+			$enable_html = true;
471 533
 		}
472
-		else $enable_html = true;
473 534
 
474
-		if($enable_html) $option->disable_html = false;
475
-		else $option->disable_html = true;
535
+		if($enable_html) {
536
+			$option->disable_html = false;
537
+		} else {
538
+			$option->disable_html = true;
539
+		}
476 540
 		// Set Height
477 541
 		$option->height = $config->editor_height;
478 542
 		// Set an option for Auto-save
@@ -495,8 +559,7 @@  discard block
 block discarded – undo
495 559
 		{
496 560
 			$logged_info = Context::get('logged_info');
497 561
 			$auto_save_args->member_srl = $logged_info->member_srl;
498
-		}
499
-		else
562
+		} else
500 563
 		{
501 564
 			$auto_save_args->ipaddress = $_SERVER['REMOTE_ADDR'];
502 565
 		}
@@ -511,11 +574,15 @@  discard block
 block discarded – undo
511 574
 		$output = executeQuery('editor.getSavedDocument', $auto_save_args);
512 575
 		$saved_doc = $output->data;
513 576
 		// Return null if no result is auto-saved
514
-		if(!$saved_doc) return;
577
+		if(!$saved_doc) {
578
+			return;
579
+		}
515 580
 		// Check if the auto-saved document already exists
516 581
 		$oDocumentModel = getModel('document');
517 582
 		$oSaved = $oDocumentModel->getDocument($saved_doc->document_srl);
518
-		if($oSaved->isExists()) return;
583
+		if($oSaved->isExists()) {
584
+			return;
585
+		}
519 586
 		// Move all the files if the auto-saved data contains document_srl and file
520 587
 		// Then set document_srl to editor_sequence
521 588
 		if($saved_doc->document_srl && $upload_target_srl && !Context::get('document_srl'))
@@ -523,8 +590,9 @@  discard block
 block discarded – undo
523 590
 			$saved_doc->module_srl = $auto_save_args->module_srl;
524 591
 			$oFileController = getController('file');
525 592
 			$oFileController->moveFile($saved_doc->document_srl, $saved_doc->module_srl, $upload_target_srl);
593
+		} else if($upload_target_srl) {
594
+			$saved_doc->document_srl = $upload_target_srl;
526 595
 		}
527
-		else if($upload_target_srl) $saved_doc->document_srl = $upload_target_srl;
528 596
 		// Change auto-saved data
529 597
 		$oEditorController = getController('editor');
530 598
 		$oEditorController->deleteSavedDoc(false);
@@ -540,18 +608,24 @@  discard block
 block discarded – undo
540 608
 	 */
541 609
 	function getComponentObject($component, $editor_sequence = 0, $site_srl = 0)
542 610
 	{
543
-		if(!preg_match('/^[a-zA-Z0-9_-]+$/',$component) || !preg_match('/^[0-9]+$/', $editor_sequence . $site_srl)) return;
611
+		if(!preg_match('/^[a-zA-Z0-9_-]+$/',$component) || !preg_match('/^[0-9]+$/', $editor_sequence . $site_srl)) {
612
+			return;
613
+		}
544 614
 
545 615
 		if(!$this->loaded_component_list[$component][$editor_sequence])
546 616
 		{
547 617
 			// Create an object of the component and execute
548 618
 			$class_path = sprintf('%scomponents/%s/', $this->module_path, $component);
549 619
 			$class_file = sprintf('%s%s.class.php', $class_path, $component);
550
-			if(!file_exists($class_file)) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
620
+			if(!file_exists($class_file)) {
621
+				return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
622
+			}
551 623
 			// Create an object after loading the class file
552 624
 			require_once($class_file);
553 625
 			$oComponent = new $component($editor_sequence, $class_path);
554
-			if(!$oComponent) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
626
+			if(!$oComponent) {
627
+				return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
628
+			}
555 629
 			// Add configuration information
556 630
 			$component_info = $this->getComponent($component, $site_srl);
557 631
 			$oComponent->setInfo($component_info);
@@ -578,8 +652,12 @@  discard block
 block discarded – undo
578 652
 		$cache_path = _XE_PATH_.'files/cache/editor/cache/';
579 653
 		FileHandler::makeDir($cache_path);
580 654
 		$cache_file = $cache_path.'component_list.' . $lang .'.';
581
-		if($filter_enabled) $cache_file .= 'filter.';
582
-		if($site_srl) $cache_file .= $site_srl.'.';
655
+		if($filter_enabled) {
656
+			$cache_file .= 'filter.';
657
+		}
658
+		if($site_srl) {
659
+			$cache_file .= $site_srl.'.';
660
+		}
583 661
 		$cache_file .= 'php';
584 662
 		return $cache_file;
585 663
 	}
@@ -596,14 +674,15 @@  discard block
 block discarded – undo
596 674
 			$oEditorController->makeCache(false, $site_srl);
597 675
 		}
598 676
 
599
-		if(!file_exists($cache_file)) return;
677
+		if(!file_exists($cache_file)) {
678
+			return;
679
+		}
600 680
 		include($cache_file);
601 681
 		$logged_info = Context::get('logged_info');
602 682
 		if($logged_info && is_array($logged_info->group_list))
603 683
 		{
604 684
 			$group_list = array_keys($logged_info->group_list);
605
-		}
606
-		else
685
+		} else
607 686
 		{
608 687
 			$group_list = array();
609 688
 		}
@@ -612,39 +691,50 @@  discard block
 block discarded – undo
612 691
 		{
613 692
 			foreach($component_list as $key => $val)
614 693
 			{
615
-				if(!trim($key)) continue;
694
+				if(!trim($key)) {
695
+					continue;
696
+				}
616 697
 				if(!is_dir(_XE_PATH_.'modules/editor/components/'.$key))
617 698
 				{
618 699
 					FileHandler::removeFile($cache_file);
619 700
 					return $this->getComponentList($filter_enabled, $site_srl);
620 701
 				}
621
-				if(!$filter_enabled) continue;
702
+				if(!$filter_enabled) {
703
+					continue;
704
+				}
622 705
 				if($val->enabled == "N")
623 706
 				{
624 707
 					unset($component_list->{$key});
625 708
 					continue;
626 709
 				}
627
-				if($logged_info->is_admin == "Y" || $logged_info->is_site_admin == "Y") continue;
710
+				if($logged_info->is_admin == "Y" || $logged_info->is_site_admin == "Y") {
711
+					continue;
712
+				}
628 713
 				if($val->target_group)
629 714
 				{
630 715
 					if(!$logged_info)
631 716
 					{
632 717
 						$val->enabled = "N";
633
-					}
634
-					else
718
+					} else
635 719
 					{
636 720
 						$is_granted = false;
637 721
 						foreach($group_list as $group_srl)
638 722
 						{
639
-							if(in_array($group_srl, $val->target_group)) $is_granted = true;
723
+							if(in_array($group_srl, $val->target_group)) {
724
+								$is_granted = true;
725
+							}
726
+						}
727
+						if(!$is_granted) {
728
+							$val->enabled = "N";
640 729
 						}
641
-						if(!$is_granted) $val->enabled = "N";
642 730
 					}
643 731
 				}
644 732
 				if($val->enabled != "N" && $val->mid_list)
645 733
 				{
646 734
 					$mid = Context::get('mid');
647
-					if(!in_array($mid, $val->mid_list)) $val->enabled = "N";
735
+					if(!in_array($mid, $val->mid_list)) {
736
+						$val->enabled = "N";
737
+					}
648 738
 				}
649 739
 				if($val->enabled == "N")
650 740
 				{
@@ -668,14 +758,15 @@  discard block
 block discarded – undo
668 758
 		{
669 759
 			$args->site_srl = $site_srl;
670 760
 			$output = executeQuery('editor.getSiteComponent', $args);
671
-		}
672
-		else
761
+		} else
673 762
 		{
674 763
 			$output = executeQuery('editor.getComponent', $args);
675 764
 		}
676 765
 		$component = $output->data;
677 766
 
678
-		if(!$output->data) return false;
767
+		if(!$output->data) {
768
+			return false;
769
+		}
679 770
 
680 771
 		$component_name = $component->component_name;
681 772
 
@@ -754,8 +845,7 @@  discard block
 block discarded – undo
754 845
 			$component_info->homepage = $xml_doc->component->link->body;
755 846
 			$component_info->license = $xml_doc->component->license->body;
756 847
 			$component_info->license_link = $xml_doc->component->license->attrs->link;
757
-		}
758
-		else
848
+		} else
759 849
 		{
760 850
 			sscanf($xml_doc->component->author->attrs->date, '%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d);
761 851
 			$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
@@ -772,8 +862,11 @@  discard block
 block discarded – undo
772 862
 
773 863
 		// Author information
774 864
 		$author_list = array();
775
-		if(!is_array($xml_doc->component->author)) $author_list[] = $xml_doc->component->author;
776
-		else $author_list = $xml_doc->component->author;
865
+		if(!is_array($xml_doc->component->author)) {
866
+			$author_list[] = $xml_doc->component->author;
867
+		} else {
868
+			$author_list = $xml_doc->component->author;
869
+		}
777 870
 
778 871
 		for($i = 0; $i < count($author_list); $i++)
779 872
 		{
Please login to merge, or discard this patch.
modules/editor/editor.admin.view.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -22,59 +22,59 @@  discard block
 block discarded – undo
22 22
 	{
23 23
 		$component_count = 0;
24 24
 		$site_module_info = Context::get('site_module_info');
25
-		$site_srl = (int)$site_module_info->site_srl;
25
+		$site_srl = (int) $site_module_info->site_srl;
26 26
 
27 27
 		// Get a type of component
28 28
 		$oEditorModel = getModel('editor');
29 29
 		$oModuleModel = getModel('module');
30 30
 		$editor_config = $oModuleModel->getModuleConfig('editor');
31 31
 
32
-		if(!$editor_config)
32
+		if (!$editor_config)
33 33
 		{
34 34
 			$editor_config = new stdClass();
35 35
 		}
36 36
 
37 37
 		//editor_config init
38
-		if(!$editor_config->editor_height) $editor_config->editor_height = 300;
39
-		if(!$editor_config->comment_editor_height) $editor_config->comment_editor_height = 100;
40
-		if(!$editor_config->editor_skin) $editor_config->editor_skin = 'ckeditor';
41
-		if(!$editor_config->comment_editor_skin) $editor_config->comment_editor_skin = 'ckeditor';
42
-		if(!$editor_config->sel_editor_colorset) $editor_config->sel_editor_colorset= 'moono';
43
-		if(!$editor_config->sel_comment_editor_colorset) $editor_config->sel_comment_editor_colorset= 'moono';
38
+		if (!$editor_config->editor_height) $editor_config->editor_height = 300;
39
+		if (!$editor_config->comment_editor_height) $editor_config->comment_editor_height = 100;
40
+		if (!$editor_config->editor_skin) $editor_config->editor_skin = 'ckeditor';
41
+		if (!$editor_config->comment_editor_skin) $editor_config->comment_editor_skin = 'ckeditor';
42
+		if (!$editor_config->sel_editor_colorset) $editor_config->sel_editor_colorset = 'moono';
43
+		if (!$editor_config->sel_comment_editor_colorset) $editor_config->sel_comment_editor_colorset = 'moono';
44 44
 
45 45
 		$component_list = $oEditorModel->getComponentList(false, $site_srl, true);
46 46
 		$editor_skin_list = FileHandler::readDir(_XE_PATH_.'modules/editor/skins');
47 47
 
48
-		$skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->editor_skin);
48
+		$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $editor_config->editor_skin);
49 49
 
50 50
 		$contents = FileHandler::readDir(_XE_PATH_.'modules/editor/styles');
51 51
 		$content_style_list = array();
52
-		for($i=0,$c=count($contents);$i<$c;$i++)
52
+		for ($i = 0, $c = count($contents); $i < $c; $i++)
53 53
 		{
54 54
 			$style = $contents[$i];
55
-			$info = $oModuleModel->loadSkinInfo($this->module_path,$style,'styles');
55
+			$info = $oModuleModel->loadSkinInfo($this->module_path, $style, 'styles');
56 56
 			$content_style_list[$style] = new stdClass();
57 57
 			$content_style_list[$style]->title = $info->title;
58 58
 		}
59 59
 
60 60
 		// Get install info, update info, count
61 61
 		$oAutoinstallModel = getModel('autoinstall');
62
-		foreach($component_list as $component_name => $xml_info)
62
+		foreach ($component_list as $component_name => $xml_info)
63 63
 		{
64 64
 			$component_count++;
65 65
 			$xml_info->path = './modules/editor/components/'.$xml_info->component_name;
66 66
 			$xml_info->delete_url = $oAutoinstallModel->getRemoveUrlByPath($xml_info->path);
67 67
 			$xml_info->package_srl = $oAutoinstallModel->getPackageSrlByPath($xml_info->path);
68
-			if($xml_info->package_srl) $targetpackages[$xml_info->package_srl] = 0;
68
+			if ($xml_info->package_srl) $targetpackages[$xml_info->package_srl] = 0;
69 69
 		}
70 70
 
71
-		if(is_array($targetpackages))	$packages = $oAutoinstallModel->getInstalledPackages(array_keys($targetpackages));
71
+		if (is_array($targetpackages))	$packages = $oAutoinstallModel->getInstalledPackages(array_keys($targetpackages));
72 72
 
73
-		foreach($component_list as $component_name => $xml_info)
73
+		foreach ($component_list as $component_name => $xml_info)
74 74
 		{
75
-			if($packages[$xml_info->package_srl])	$xml_info->need_update = $packages[$xml_info->package_srl]->need_update;
75
+			if ($packages[$xml_info->package_srl])	$xml_info->need_update = $packages[$xml_info->package_srl]->need_update;
76 76
 		}
77
-		$editor_config_default = array( "editor_height" => "300", "comment_editor_height" => "100","content_font_size"=>"13");
77
+		$editor_config_default = array("editor_height" => "300", "comment_editor_height" => "100", "content_font_size"=>"13");
78 78
 
79 79
 		//editor preview
80 80
 		$config = $oEditorModel->getEditorConfig();
@@ -138,14 +138,14 @@  discard block
 block discarded – undo
138 138
 	function dispEditorAdminSetupComponent()
139 139
 	{
140 140
 		$site_module_info = Context::get('site_module_info');
141
-		$site_srl = (int)$site_module_info->site_srl;
141
+		$site_srl = (int) $site_module_info->site_srl;
142 142
 
143 143
 		$component_name = Context::get('component_name');
144 144
 		// Get information of the editor component
145 145
 		$oEditorModel = getModel('editor');
146
-		$component = $oEditorModel->getComponent($component_name,$site_srl);
146
+		$component = $oEditorModel->getComponent($component_name, $site_srl);
147 147
 
148
-		if(!$component->component_name) {
148
+		if (!$component->component_name) {
149 149
 			$this->stop('msg_invalid_request');
150 150
 			return;
151 151
 		}
@@ -158,20 +158,20 @@  discard block
 block discarded – undo
158 158
 		// Get a mid list
159 159
 		$oModuleModel = getModel('module');
160 160
 
161
-		$args =new stdClass();
161
+		$args = new stdClass();
162 162
 		$args->site_srl = $site_srl;
163 163
 		$columnList = array('module_srl', 'mid', 'module_category_srl', 'browser_title');
164 164
 		$mid_list = $oModuleModel->getMidList($args, $columnList);
165 165
 		// Combination of module_category and module
166
-		if(!$args->site_srl)
166
+		if (!$args->site_srl)
167 167
 		{
168 168
 			// Get a list of module category
169 169
 			$module_categories = $oModuleModel->getModuleCategories();
170 170
 
171
-			if(!is_array($mid_list)) $mid_list = array($mid_list);
172
-			foreach($mid_list as $module_srl => $module)
171
+			if (!is_array($mid_list)) $mid_list = array($mid_list);
172
+			foreach ($mid_list as $module_srl => $module)
173 173
 			{
174
-				if($module) $module_categories[$module->module_category_srl]->list[$module_srl] = $module; 
174
+				if ($module) $module_categories[$module->module_category_srl]->list[$module_srl] = $module; 
175 175
 			}
176 176
 		}
177 177
 		else
@@ -179,13 +179,13 @@  discard block
 block discarded – undo
179 179
 			$module_categories[0]->list = $mid_list;
180 180
 		}
181 181
 
182
-		Context::set('mid_list',$module_categories);
182
+		Context::set('mid_list', $module_categories);
183 183
 
184 184
 		//Security
185 185
 		$security = new Security();
186 186
 		$security->encodeHTML('group_list..title');
187 187
 		$security->encodeHTML('component...', 'component_name');
188
-		$security->encodeHTML('mid_list..title','mid_list..list..browser_title');
188
+		$security->encodeHTML('mid_list..title', 'mid_list..list..browser_title');
189 189
 
190 190
 		$this->setTemplatePath($this->module_path.'tpl');
191 191
 		$this->setTemplateFile('setup_component');
Please login to merge, or discard this patch.
modules/member/member.controller.php 3 patches
Doc Comments   +24 added lines, -13 removed lines patch added patch discarded remove patch
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 	/**
224 224
 	 * Delete the post
225 225
 	 *
226
-	 * @return void|Object (void : success, Object : fail)
226
+	 * @return Object|null (void : success, Object : fail)
227 227
 	 */
228 228
 	function procMemberDeleteSavedDocument()
229 229
 	{
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 	/**
255 255
 	 * Check values when member joining
256 256
 	 *
257
-	 * @return void|Object (void : success, Object : fail)
257
+	 * @return null|Object (void : success, Object : fail)
258 258
 	 */
259 259
 	function procMemberCheckValue()
260 260
 	{
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
 	/**
727 727
 	 * Add a profile image
728 728
 	 *
729
-	 * @return void|Object (void : success, Object : fail)
729
+	 * @return ModuleObject|null (void : success, Object : fail)
730 730
 	 */
731 731
 	function procMemberInsertProfileImage()
732 732
 	{
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
 	/**
806 806
 	 * Add an image name
807 807
 	 *
808
-	 * @return void|Object (void : success, Object : fail)
808
+	 * @return ModuleObject|null (void : success, Object : fail)
809 809
 	 */
810 810
 	function procMemberInsertImageName()
811 811
 	{
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
 	/**
891 891
 	 * Delete Image name
892 892
 	 *
893
-	 * @return void
893
+	 * @return Object
894 894
 	 */
895 895
 	function procMemberDeleteImageName($_memberSrl = 0)
896 896
 	{
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
 	/**
915 915
 	 * Add an image to mark
916 916
 	 *
917
-	 * @return void|Object (void : success, Object : fail)
917
+	 * @return ModuleObject|null (void : success, Object : fail)
918 918
 	 */
919 919
 	function procMemberInsertImageMark()
920 920
 	{
@@ -1181,7 +1181,7 @@  discard block
 block discarded – undo
1181 1181
 	 * Execute finding ID/Passoword
1182 1182
 	 * When clicking the link in the verification email, a method is called to change the old password and to authenticate it
1183 1183
 	 *
1184
-	 * @return void|Object (void : success, Object : fail)
1184
+	 * @return ModuleObject|null (void : success, Object : fail)
1185 1185
 	 */
1186 1186
 	function procMemberAuthAccount()
1187 1187
 	{
@@ -1253,7 +1253,7 @@  discard block
 block discarded – undo
1253 1253
 	/**
1254 1254
 	 * Request to re-send the authentication mail
1255 1255
 	 *
1256
-	 * @return void|Object (void : success, Object : fail)
1256
+	 * @return Object|null (void : success, Object : fail)
1257 1257
 	 */
1258 1258
 	function procMemberResendAuthMail()
1259 1259
 	{
@@ -1412,6 +1412,9 @@  discard block
 block discarded – undo
1412 1412
 		$this->setRedirectUrl($returnUrl);
1413 1413
 	}
1414 1414
 
1415
+	/**
1416
+	 * @param stdClass $auth_args
1417
+	 */
1415 1418
 	function _sendAuthMail($auth_args, $member_info)
1416 1419
 	{
1417 1420
 		$oMemberModel = getModel('member');
@@ -1467,7 +1470,7 @@  discard block
 block discarded – undo
1467 1470
 	/**
1468 1471
 	 * Join a virtual site
1469 1472
 	 *
1470
-	 * @return void|Object (void : success, Object : fail)
1473
+	 * @return Object|null (void : success, Object : fail)
1471 1474
 	 */
1472 1475
 	function procMemberSiteSignUp()
1473 1476
 	{
@@ -1544,7 +1547,7 @@  discard block
 block discarded – undo
1544 1547
 	 * @param int $member_srl
1545 1548
 	 * @param string $signature
1546 1549
 	 *
1547
-	 * @return void
1550
+	 * @return boolean|null
1548 1551
 	 */
1549 1552
 	function putSignature($member_srl, $signature)
1550 1553
 	{
@@ -1946,6 +1949,8 @@  discard block
 block discarded – undo
1946 1949
 	/**
1947 1950
 	 * Logged method for providing a personalized menu
1948 1951
 	 * Login information is used in the output widget, or personalized page
1952
+	 * @param string $act
1953
+	 * @param string $str
1949 1954
 	 */
1950 1955
 	function addMemberMenu($act, $str)
1951 1956
 	{
@@ -1976,6 +1981,7 @@  discard block
 block discarded – undo
1976 1981
 
1977 1982
 	/**
1978 1983
 	 * Add users to the member table
1984
+	 * @param stdClass $args
1979 1985
 	 */
1980 1986
 	function insertMember(&$args, $password_is_hashed = false)
1981 1987
 	{
@@ -2176,6 +2182,7 @@  discard block
 block discarded – undo
2176 2182
 	 * Modify member information
2177 2183
 	 *
2178 2184
 	 * @param bool $is_admin , modified 2013-11-22
2185
+	 * @param stdClass $args
2179 2186
 	 */
2180 2187
 	function updateMember($args, $is_admin = FALSE)
2181 2188
 	{
@@ -2380,6 +2387,7 @@  discard block
 block discarded – undo
2380 2387
 
2381 2388
 	/**
2382 2389
 	 * Modify member password
2390
+	 * @param stdClass $args
2383 2391
 	 */
2384 2392
 	function updateMemberPassword($args)
2385 2393
 	{
@@ -2414,6 +2422,9 @@  discard block
 block discarded – undo
2414 2422
 		return $output;
2415 2423
 	}
2416 2424
 
2425
+	/**
2426
+	 * @param string $answer
2427
+	 */
2417 2428
 	function updateFindAccountAnswer($member_srl, $answer)
2418 2429
 	{
2419 2430
 		$oPassword =  new Password();
@@ -2673,7 +2684,7 @@  discard block
 block discarded – undo
2673 2684
 	 *
2674 2685
 	 * @param array &$menu_list
2675 2686
 	 *
2676
-	 * @return object
2687
+	 * @return Object
2677 2688
 	**/
2678 2689
 	function triggerGetDocumentMenu(&$menu_list)
2679 2690
 	{
@@ -2703,7 +2714,7 @@  discard block
 block discarded – undo
2703 2714
 	 *
2704 2715
 	 * @param array &$menu_list
2705 2716
 	 *
2706
-	 * @return object
2717
+	 * @return Object
2707 2718
 	**/
2708 2719
 	function triggerGetCommentMenu(&$menu_list)
2709 2720
 	{
@@ -2731,7 +2742,7 @@  discard block
 block discarded – undo
2731 2742
 	/**
2732 2743
 	 * Spammer manage. Denied user login. And delete or trash all documents. Response Ajax string
2733 2744
 	 *
2734
-	 * @return object
2745
+	 * @return Object
2735 2746
 	**/
2736 2747
 	function procMemberSpammerManage()
2737 2748
 	{
Please login to merge, or discard this patch.
Spacing   +458 added lines, -458 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 Object(-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 Object(-1,'null_user_id');
53
-		if(!$password) return new Object(-1,'null_password');
52
+		if (!$user_id) return new Object(-1, 'null_user_id');
53
+		if (!$password) return new Object(-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 Object(-1, $msg));
71
+				return $this->setRedirectUrl(getNotEncodedUrl('', 'vid', Context::get('vid'), 'mid', Context::get('mid'), 'act', 'dispMemberModifyPassword'), new Object(-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 Object();
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 Object(-1, 'msg_not_logged');
130
+		if (!Context::get('is_logged')) return new Object(-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 Object(-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 Object(-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 Object(-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 Object(-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 Object(-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 Object(-1, 'msg_alreay_scrapped');
183
+		if ($output->data->count) return new Object(-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 Object(-1, 'msg_not_logged');
201
+		if (!Context::get('is_logged')) return new Object(-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 Object(-1,'msg_invalid_request');
204
+		$document_srl = (int) Context::get('document_srl');
205
+		if (!$document_srl) return new Object(-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 Object(-1, 'msg_not_logged');
231
+		if (!Context::get('is_logged')) return new Object(-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 Object(-1,'msg_invalid_request');
234
+		$document_srl = (int) Context::get('document_srl');
235
+		if (!$document_srl) return new Object(-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 Object(-1,'msg_invalid_request');
241
+			return new Object(-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 Object(-1,'msg_invalid_request');
247
+			return new Object(-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 Object(0,'denied_user_id');
274
+				if ($oMemberModel->isDeniedID($value)) return new Object(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 Object(0,'msg_exists_user_id');
277
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(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 Object(0,'denied_nick_name');
283
+					return new Object(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 Object(0,'msg_exists_nick_name');
287
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(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 Object(0,'msg_exists_email_address');
293
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(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 Object (-1, "msg_invalid_request");
306
-		$oMemberModel = &getModel ('member');
305
+		if (Context::getRequestMethod() == "GET") return new Object(-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 Object(-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
 				setcookie("XE_REDIRECT_URL", '', 1);
@@ -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 Object(-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 Object(-1, 'invalid_password');
671
+		if (!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-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 Object(-1, 'invalid_new_password');
674
+		if ($current_password == $password) return new Object(-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 Object(-1, 'invalid_password');
713
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-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,17 +732,17 @@  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
 		$oModuleModel = getModel('module');
744 744
 		$config = $oModuleModel->getModuleConfig('member');
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
 		$this->insertProfileImage($member_srl, $file['tmp_name']);
748 748
 		// Page refresh
@@ -764,25 +764,25 @@  discard block
 block discarded – undo
764 764
 	{
765 765
 
766 766
 		// Check uploaded file
767
-		if(!checkUploadedFile($target_file)) return;
767
+		if (!checkUploadedFile($target_file)) return;
768 768
 
769 769
 		$oMemberModel = getModel('member');
770 770
 		$config = $oMemberModel->getMemberConfig();
771 771
 
772 772
 		// Get an image size
773 773
 		$max_width = $config->profile_image_max_width;
774
-		if(!$max_width) $max_width = "90";
774
+		if (!$max_width) $max_width = "90";
775 775
 		$max_height = $config->profile_image_max_height;
776
-		if(!$max_height) $max_height = "90";
776
+		if (!$max_height) $max_height = "90";
777 777
 		// Get a target path to save
778 778
 		$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
779 779
 		FileHandler::makeDir($target_path);
780 780
 
781 781
 		// Get file information
782 782
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
783
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
784
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
785
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
783
+		if (IMAGETYPE_PNG == $type) $ext = 'png';
784
+		elseif (IMAGETYPE_JPEG == $type) $ext = 'jpg';
785
+		elseif (IMAGETYPE_GIF == $type) $ext = 'gif';
786 786
 		else
787 787
 		{
788 788
 			return;
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 
793 793
 		$target_filename = sprintf('%s%d.%s', $target_path, $member_srl, $ext);
794 794
 		// Convert if the image size is larger than a given size or if the format is not a gif
795
-		if(($width > $max_width || $height > $max_height ) && $type != 1)
795
+		if (($width > $max_width || $height > $max_height) && $type != 1)
796 796
 		{
797 797
 			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
798 798
 		}
@@ -811,17 +811,17 @@  discard block
 block discarded – undo
811 811
 	{
812 812
 		// Check if the file is successfully uploaded
813 813
 		$file = $_FILES['image_name'];
814
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
814
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
815 815
 		// Ignore if member_srl is invalid or doesn't exist.
816 816
 		$member_srl = Context::get('member_srl');
817
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
817
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_name');
818 818
 
819 819
 		$logged_info = Context::get('logged_info');
820
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
820
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
821 821
 		// Return if member module is set not to use an image name or the user is not an administrator ;
822 822
 		$oModuleModel = getModel('module');
823 823
 		$config = $oModuleModel->getModuleConfig('member');
824
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
824
+		if ($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
825 825
 
826 826
 		$this->insertImageName($member_srl, $file['tmp_name']);
827 827
 		// Page refresh
@@ -842,15 +842,15 @@  discard block
 block discarded – undo
842 842
 	function insertImageName($member_srl, $target_file)
843 843
 	{
844 844
 		// Check uploaded file
845
-		if(!checkUploadedFile($target_file)) return;
845
+		if (!checkUploadedFile($target_file)) return;
846 846
 
847 847
 		$oModuleModel = getModel('module');
848 848
 		$config = $oModuleModel->getModuleConfig('member');
849 849
 		// Get an image size
850 850
 		$max_width = $config->image_name_max_width;
851
-		if(!$max_width) $max_width = "90";
851
+		if (!$max_width) $max_width = "90";
852 852
 		$max_height = $config->image_name_max_height;
853
-		if(!$max_height) $max_height = "20";
853
+		if (!$max_height) $max_height = "20";
854 854
 		// Get a target path to save
855 855
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
856 856
 		FileHandler::makeDir($target_path);
@@ -859,7 +859,7 @@  discard block
 block discarded – undo
859 859
 		// Get file information
860 860
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
861 861
 		// Convert if the image size is larger than a given size or if the format is not a gif
862
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
862
+		if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
863 863
 		else @copy($target_file, $target_filename);
864 864
 	}
865 865
 
@@ -871,20 +871,20 @@  discard block
 block discarded – undo
871 871
 	function procMemberDeleteProfileImage($_memberSrl = 0)
872 872
 	{
873 873
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
874
-		if(!$member_srl)
874
+		if (!$member_srl)
875 875
 		{
876
-			return new Object(0,'success');
876
+			return new Object(0, 'success');
877 877
 		}
878 878
 
879 879
 		$logged_info = Context::get('logged_info');
880 880
 
881
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
881
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
882 882
 		{
883 883
 			$oMemberModel = getModel('member');
884 884
 			$profile_image = $oMemberModel->getProfileImage($member_srl);
885 885
 			FileHandler::removeFile($profile_image->file);
886 886
 		}
887
-		return new Object(0,'success');
887
+		return new Object(0, 'success');
888 888
 	}
889 889
 
890 890
 	/**
@@ -895,20 +895,20 @@  discard block
 block discarded – undo
895 895
 	function procMemberDeleteImageName($_memberSrl = 0)
896 896
 	{
897 897
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
898
-		if(!$member_srl)
898
+		if (!$member_srl)
899 899
 		{
900
-			return new Object(0,'success');
900
+			return new Object(0, 'success');
901 901
 		}
902 902
 
903 903
 		$logged_info = Context::get('logged_info');
904 904
 
905
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
905
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
906 906
 		{
907 907
 			$oMemberModel = getModel('member');
908 908
 			$image_name = $oMemberModel->getImageName($member_srl);
909 909
 			FileHandler::removeFile($image_name->file);
910 910
 		}
911
-		return new Object(0,'success');
911
+		return new Object(0, 'success');
912 912
 	}
913 913
 
914 914
 	/**
@@ -920,17 +920,17 @@  discard block
 block discarded – undo
920 920
 	{
921 921
 		// Check if the file is successfully uploaded
922 922
 		$file = $_FILES['image_mark'];
923
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
923
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
924 924
 		// Ignore if member_srl is invalid or doesn't exist.
925 925
 		$member_srl = Context::get('member_srl');
926
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
926
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
927 927
 
928 928
 		$logged_info = Context::get('logged_info');
929
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
929
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
930 930
 		// Membership in the images mark the module using the ban was set by an administrator or return;
931 931
 		$oModuleModel = getModel('module');
932 932
 		$config = $oModuleModel->getModuleConfig('member');
933
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
933
+		if ($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
934 934
 
935 935
 		$this->insertImageMark($member_srl, $file['tmp_name']);
936 936
 		// Page refresh
@@ -951,15 +951,15 @@  discard block
 block discarded – undo
951 951
 	function insertImageMark($member_srl, $target_file)
952 952
 	{
953 953
 		// Check uploaded file
954
-		if(!checkUploadedFile($target_file)) return;
954
+		if (!checkUploadedFile($target_file)) return;
955 955
 
956 956
 		$oModuleModel = getModel('module');
957 957
 		$config = $oModuleModel->getModuleConfig('member');
958 958
 		// Get an image size
959 959
 		$max_width = $config->image_mark_max_width;
960
-		if(!$max_width) $max_width = "20";
960
+		if (!$max_width) $max_width = "20";
961 961
 		$max_height = $config->image_mark_max_height;
962
-		if(!$max_height) $max_height = "20";
962
+		if (!$max_height) $max_height = "20";
963 963
 
964 964
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
965 965
 		FileHandler::makeDir($target_path);
@@ -968,7 +968,7 @@  discard block
 block discarded – undo
968 968
 		// Get file information
969 969
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
970 970
 
971
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
971
+		if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
972 972
 		else @copy($target_file, $target_filename);
973 973
 	}
974 974
 
@@ -980,20 +980,20 @@  discard block
 block discarded – undo
980 980
 	function procMemberDeleteImageMark($_memberSrl = 0)
981 981
 	{
982 982
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
983
-		if(!$member_srl)
983
+		if (!$member_srl)
984 984
 		{
985
-			return new Object(0,'success');
985
+			return new Object(0, 'success');
986 986
 		}
987 987
 
988 988
 		$logged_info = Context::get('logged_info');
989 989
 
990
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
990
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
991 991
 		{
992 992
 			$oMemberModel = getModel('member');
993 993
 			$image_mark = $oMemberModel->getImageMark($member_srl);
994 994
 			FileHandler::removeFile($image_mark->file);
995 995
 		}
996
-		return new Object(0,'success');
996
+		return new Object(0, 'success');
997 997
 	}
998 998
 
999 999
 	/**
@@ -1004,26 +1004,26 @@  discard block
 block discarded – undo
1004 1004
 	function procMemberFindAccount()
1005 1005
 	{
1006 1006
 		$email_address = Context::get('email_address');
1007
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1007
+		if (!$email_address) return new Object(-1, 'msg_invalid_request');
1008 1008
 
1009 1009
 		$oMemberModel = getModel('member');
1010 1010
 		$oModuleModel = getModel('module');
1011 1011
 
1012 1012
 		// Check if a member having the same email address exists
1013 1013
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1014
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1014
+		if (!$member_srl) return new Object(-1, 'msg_email_not_exists');
1015 1015
 
1016 1016
 		// Get information of the member
1017 1017
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
1018 1018
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1019 1019
 
1020 1020
 		// Check if possible to find member's ID and password
1021
-		if($member_info->denied == 'Y')
1021
+		if ($member_info->denied == 'Y')
1022 1022
 		{
1023 1023
 			$chk_args = new stdClass;
1024 1024
 			$chk_args->member_srl = $member_info->member_srl;
1025 1025
 			$output = executeQuery('member.chkAuthMail', $chk_args);
1026
-			if($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
1026
+			if ($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
1027 1027
 		}
1028 1028
 
1029 1029
 		// Insert data into the authentication DB
@@ -1036,19 +1036,19 @@  discard block
 block discarded – undo
1036 1036
 		$args->is_register = 'N';
1037 1037
 
1038 1038
 		$output = executeQuery('member.insertAuthMail', $args);
1039
-		if(!$output->toBool()) return $output;
1039
+		if (!$output->toBool()) return $output;
1040 1040
 		// Get content of the email to send a member
1041 1041
 		Context::set('auth_args', $args);
1042 1042
 
1043 1043
 		$member_config = $oModuleModel->getModuleConfig('member');
1044 1044
 		$memberInfo = array();
1045 1045
 		global $lang;
1046
-		if(is_array($member_config->signupForm))
1046
+		if (is_array($member_config->signupForm))
1047 1047
 		{
1048
-			$exceptForm=array('password', 'find_account_question');
1049
-			foreach($member_config->signupForm as $form)
1048
+			$exceptForm = array('password', 'find_account_question');
1049
+			foreach ($member_config->signupForm as $form)
1050 1050
 			{
1051
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1051
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1052 1052
 				{
1053 1053
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1054 1054
 				}
@@ -1063,15 +1063,15 @@  discard block
 block discarded – undo
1063 1063
 		}
1064 1064
 		Context::set('memberInfo', $memberInfo);
1065 1065
 
1066
-		if(!$member_config->skin) $member_config->skin = "default";
1067
-		if(!$member_config->colorset) $member_config->colorset = "white";
1066
+		if (!$member_config->skin) $member_config->skin = "default";
1067
+		if (!$member_config->colorset) $member_config->colorset = "white";
1068 1068
 
1069 1069
 		Context::set('member_config', $member_config);
1070 1070
 
1071 1071
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1072
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1072
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1073 1073
 
1074
-		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1074
+		$find_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1075 1075
 		Context::set('find_url', $find_url);
1076 1076
 
1077 1077
 		$oTemplate = &TemplateHandler::getInstance();
@@ -1081,19 +1081,19 @@  discard block
 block discarded – undo
1081 1081
 		$member_config = $oModuleModel->getModuleConfig('member');
1082 1082
 		// Send a mail
1083 1083
 		$oMail = new Mail();
1084
-		$oMail->setTitle( Context::getLang('msg_find_account_title') );
1084
+		$oMail->setTitle(Context::getLang('msg_find_account_title'));
1085 1085
 		$oMail->setContent($content);
1086
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1087
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1086
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1087
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1088 1088
 		$oMail->send();
1089 1089
 		// Return message
1090 1090
 		$msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address);
1091
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
1091
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
1092 1092
 		{
1093 1093
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberFindAccount');
1094 1094
 			$this->setRedirectUrl($returnUrl);
1095 1095
 		}
1096
-		return new Object(0,$msg);
1096
+		return new Object(0, $msg);
1097 1097
 	}
1098 1098
 
1099 1099
 	/**
@@ -1104,7 +1104,7 @@  discard block
 block discarded – undo
1104 1104
 	function procMemberFindAccountByQuestion()
1105 1105
 	{
1106 1106
 		$oMemberModel = getModel('member');
1107
-		$oPassword =  new Password();
1107
+		$oPassword = new Password();
1108 1108
 		$config = $oMemberModel->getMemberConfig();
1109 1109
 
1110 1110
 		$email_address = Context::get('email_address');
@@ -1112,49 +1112,49 @@  discard block
 block discarded – undo
1112 1112
 		$find_account_question = trim(Context::get('find_account_question'));
1113 1113
 		$find_account_answer = trim(Context::get('find_account_answer'));
1114 1114
 
1115
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1115
+		if (($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1116 1116
 
1117 1117
 		$oModuleModel = getModel('module');
1118 1118
 		// Check if a member having the same email address exists
1119 1119
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1120
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1120
+		if (!$member_srl) return new Object(-1, 'msg_email_not_exists');
1121 1121
 
1122 1122
 		// Get information of the member
1123 1123
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1124 1124
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1125 1125
 
1126 1126
 		// Display a message if no answer is entered
1127
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1127
+		if (!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1128 1128
 
1129 1129
 		// 답변 확인
1130 1130
 		$hashed = $oPassword->checkAlgorithm($member_info->find_account_answer);
1131 1131
 		$authed = true;
1132 1132
 		$member_info->find_account_question = trim($member_info->find_account_question);
1133
-		if($member_info->find_account_question != $find_account_question)
1133
+		if ($member_info->find_account_question != $find_account_question)
1134 1134
 		{
1135 1135
 			$authed = false;
1136 1136
 		}
1137
-		else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1137
+		else if ($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1138 1138
 		{
1139 1139
 			$authed = false;
1140 1140
 		}
1141
-		else if(!$hashed && $find_account_answer != $member_info->find_account_answer)
1141
+		else if (!$hashed && $find_account_answer != $member_info->find_account_answer)
1142 1142
 		{
1143 1143
 			$authed = false;
1144 1144
 		}
1145 1145
 
1146
-		if(!$authed)
1146
+		if (!$authed)
1147 1147
 		{
1148 1148
 			return new Object(-1, 'msg_answer_not_matches');
1149 1149
 		}
1150 1150
 
1151 1151
 		// answer가 동일하고 hash 되지 않았으면 hash 값으로 저장
1152
-		if($authed && !$hashed)
1152
+		if ($authed && !$hashed)
1153 1153
 		{
1154 1154
 			$this->updateFindAccountAnswer($member_srl, $find_account_answer);
1155 1155
 		}
1156 1156
 
1157
-		if($config->identifier == 'email_address')
1157
+		if ($config->identifier == 'email_address')
1158 1158
 		{
1159 1159
 			$user_id = $email_address;
1160 1160
 		}
@@ -1167,11 +1167,11 @@  discard block
 block discarded – undo
1167 1167
 		$args->password = $temp_password;
1168 1168
 		$args->change_password_date = '1';
1169 1169
 		$output = $this->updateMemberPassword($args);
1170
-		if(!$output->toBool()) return $output;
1170
+		if (!$output->toBool()) return $output;
1171 1171
 
1172
-		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1172
+		$_SESSION['xe_temp_password_'.$user_id] = $temp_password;
1173 1173
 
1174
-		$this->add('user_id',$user_id);
1174
+		$this->add('user_id', $user_id);
1175 1175
 
1176 1176
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
1177 1177
 		$this->setRedirectUrl($returnUrl.'&user_id='.$user_id);
@@ -1191,7 +1191,7 @@  discard block
 block discarded – undo
1191 1191
 		$member_srl = Context::get('member_srl');
1192 1192
 		$auth_key = Context::get('auth_key');
1193 1193
 
1194
-		if(!$member_srl || !$auth_key)
1194
+		if (!$member_srl || !$auth_key)
1195 1195
 		{
1196 1196
 			return $this->stop('msg_invalid_request');
1197 1197
 		}
@@ -1202,9 +1202,9 @@  discard block
 block discarded – undo
1202 1202
 		$args->auth_key = $auth_key;
1203 1203
 		$output = executeQuery('member.getAuthMail', $args);
1204 1204
 
1205
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
1205
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
1206 1206
 		{
1207
-			if(strlen($output->data->auth_key) !== strlen($auth_key))
1207
+			if (strlen($output->data->auth_key) !== strlen($auth_key))
1208 1208
 			{
1209 1209
 				executeQuery('member.deleteAuthMail', $args);
1210 1210
 			}
@@ -1212,7 +1212,7 @@  discard block
 block discarded – undo
1212 1212
 			return $this->stop('msg_invalid_auth_key');
1213 1213
 		}
1214 1214
 
1215
-		if(ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1215
+		if (ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1216 1216
 		{
1217 1217
 			executeQuery('member.deleteAuthMail', $args);
1218 1218
 			return $this->stop('msg_invalid_auth_key');
@@ -1221,7 +1221,7 @@  discard block
 block discarded – undo
1221 1221
 		$args->password = $output->data->new_password;
1222 1222
 
1223 1223
 		// If credentials are correct, change the password to a new one
1224
-		if($output->data->is_register == 'Y')
1224
+		if ($output->data->is_register == 'Y')
1225 1225
 		{
1226 1226
 			$args->denied = 'N';
1227 1227
 		}
@@ -1234,13 +1234,13 @@  discard block
 block discarded – undo
1234 1234
 		$is_register = $output->data->is_register;
1235 1235
 
1236 1236
 		$output = executeQuery('member.updateMemberPassword', $args);
1237
-		if(!$output->toBool())
1237
+		if (!$output->toBool())
1238 1238
 		{
1239 1239
 			return $this->stop($output->getMessage());
1240 1240
 		}
1241 1241
 
1242 1242
 		// Remove all values having the member_srl from authentication table
1243
-		executeQuery('member.deleteAuthMail',$args);
1243
+		executeQuery('member.deleteAuthMail', $args);
1244 1244
 
1245 1245
 		$this->_clearMemberCache($args->member_srl);
1246 1246
 
@@ -1259,33 +1259,33 @@  discard block
 block discarded – undo
1259 1259
 	{
1260 1260
 		// Get an email_address
1261 1261
 		$email_address = Context::get('email_address');
1262
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1262
+		if (!$email_address) return new Object(-1, 'msg_invalid_request');
1263 1263
 		// Log test by using email_address
1264 1264
 		$oMemberModel = getModel('member');
1265 1265
 
1266 1266
 		$args = new stdClass;
1267 1267
 		$args->email_address = $email_address;
1268 1268
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1269
-		if(!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1269
+		if (!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1270 1270
 
1271 1271
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1272 1272
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1273 1273
 
1274 1274
 		$oModuleModel = getModel('module');
1275 1275
 		$member_config = $oModuleModel->getModuleConfig('member');
1276
-		if(!$member_config->skin) $member_config->skin = "default";
1277
-		if(!$member_config->colorset) $member_config->colorset = "white";
1276
+		if (!$member_config->skin) $member_config->skin = "default";
1277
+		if (!$member_config->colorset) $member_config->colorset = "white";
1278 1278
 
1279 1279
 		// Check if a authentication mail has been sent previously
1280 1280
 		$chk_args = new stdClass;
1281 1281
 		$chk_args->member_srl = $member_info->member_srl;
1282 1282
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1283
-		if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1283
+		if ($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1284 1284
 
1285 1285
 		$auth_args = new stdClass;
1286 1286
 		$auth_args->member_srl = $member_info->member_srl;
1287 1287
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1288
-		if(!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1288
+		if (!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1289 1289
 		$auth_info = $output->data[0];
1290 1290
 
1291 1291
 		// Update the regdate of authmail entry
@@ -1296,12 +1296,12 @@  discard block
 block discarded – undo
1296 1296
 
1297 1297
 		$memberInfo = array();
1298 1298
 		global $lang;
1299
-		if(is_array($member_config->signupForm))
1299
+		if (is_array($member_config->signupForm))
1300 1300
 		{
1301
-			$exceptForm=array('password', 'find_account_question');
1302
-			foreach($member_config->signupForm as $form)
1301
+			$exceptForm = array('password', 'find_account_question');
1302
+			foreach ($member_config->signupForm as $form)
1303 1303
 			{
1304
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1304
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1305 1305
 				{
1306 1306
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1307 1307
 				}
@@ -1320,19 +1320,19 @@  discard block
 block discarded – undo
1320 1320
 		Context::set('member_config', $member_config);
1321 1321
 
1322 1322
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1323
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1323
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1324 1324
 
1325
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1325
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_info->auth_key);
1326 1326
 		Context::set('auth_url', $auth_url);
1327 1327
 
1328 1328
 		$oTemplate = &TemplateHandler::getInstance();
1329 1329
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1330 1330
 		// Send a mail
1331 1331
 		$oMail = new Mail();
1332
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1332
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1333 1333
 		$oMail->setContent($content);
1334
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1335
-		$oMail->setReceiptor( $args->user_name, $args->email_address );
1334
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1335
+		$oMail->setReceiptor($args->user_name, $args->email_address);
1336 1336
 		$oMail->send();
1337 1337
 
1338 1338
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
@@ -1347,23 +1347,23 @@  discard block
 block discarded – undo
1347 1347
 		$memberInfo = $_SESSION['auth_member_info'];
1348 1348
 		unset($_SESSION['auth_member_info']);
1349 1349
 
1350
-		if(!$memberInfo)
1350
+		if (!$memberInfo)
1351 1351
 		{
1352 1352
 			return $this->stop('msg_invalid_request');
1353 1353
 		}
1354 1354
 
1355 1355
 		$newEmail = Context::get('email_address');
1356 1356
 
1357
-		if(!$newEmail)
1357
+		if (!$newEmail)
1358 1358
 		{
1359 1359
 			return $this->stop('msg_invalid_request');
1360 1360
 		}
1361 1361
 
1362 1362
 		$oMemberModel = getModel('member');
1363 1363
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
1364
-		if($member_srl)
1364
+		if ($member_srl)
1365 1365
 		{
1366
-			return new Object(-1,'msg_exists_email_address');
1366
+			return new Object(-1, 'msg_exists_email_address');
1367 1367
 		}
1368 1368
 
1369 1369
 		// remove all key by member_srl
@@ -1371,7 +1371,7 @@  discard block
 block discarded – undo
1371 1371
 		$args->member_srl = $memberInfo->member_srl;
1372 1372
 		$output = executeQuery('member.deleteAuthMail', $args);
1373 1373
 
1374
-		if(!$output->toBool())
1374
+		if (!$output->toBool())
1375 1375
 		{
1376 1376
 			return $output;
1377 1377
 		}
@@ -1381,7 +1381,7 @@  discard block
 block discarded – undo
1381 1381
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
1382 1382
 
1383 1383
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
1384
-		if(!$output->toBool())
1384
+		if (!$output->toBool())
1385 1385
 		{
1386 1386
 			return $this->stop($output->getMessage());
1387 1387
 		}
@@ -1398,7 +1398,7 @@  discard block
 block discarded – undo
1398 1398
 		$auth_args->is_register = 'Y';
1399 1399
 
1400 1400
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1401
-		if(!$output->toBool()) return $output;
1401
+		if (!$output->toBool()) return $output;
1402 1402
 
1403 1403
 		$memberInfo->email_address = $newEmail;
1404 1404
 
@@ -1422,12 +1422,12 @@  discard block
 block discarded – undo
1422 1422
 		$memberInfo = array();
1423 1423
 
1424 1424
 		global $lang;
1425
-		if(is_array($member_config->signupForm))
1425
+		if (is_array($member_config->signupForm))
1426 1426
 		{
1427
-			$exceptForm=array('password', 'find_account_question');
1428
-			foreach($member_config->signupForm as $form)
1427
+			$exceptForm = array('password', 'find_account_question');
1428
+			foreach ($member_config->signupForm as $form)
1429 1429
 			{
1430
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1430
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1431 1431
 				{
1432 1432
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1433 1433
 				}
@@ -1442,25 +1442,25 @@  discard block
 block discarded – undo
1442 1442
 		}
1443 1443
 		Context::set('memberInfo', $memberInfo);
1444 1444
 
1445
-		if(!$member_config->skin) $member_config->skin = "default";
1446
-		if(!$member_config->colorset) $member_config->colorset = "white";
1445
+		if (!$member_config->skin) $member_config->skin = "default";
1446
+		if (!$member_config->colorset) $member_config->colorset = "white";
1447 1447
 
1448 1448
 		Context::set('member_config', $member_config);
1449 1449
 
1450 1450
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1451
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1451
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1452 1452
 
1453
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1453
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
1454 1454
 		Context::set('auth_url', $auth_url);
1455 1455
 
1456 1456
 		$oTemplate = &TemplateHandler::getInstance();
1457 1457
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1458 1458
 		// Send a mail
1459 1459
 		$oMail = new Mail();
1460
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1460
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1461 1461
 		$oMail->setContent($content);
1462
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1463
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1462
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1463
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1464 1464
 		$oMail->send();
1465 1465
 	}
1466 1466
 
@@ -1473,7 +1473,7 @@  discard block
 block discarded – undo
1473 1473
 	{
1474 1474
 		$site_module_info = Context::get('site_module_info');
1475 1475
 		$logged_info = Context::get('logged_info');
1476
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1476
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new Object(-1, 'msg_invalid_request');
1477 1477
 
1478 1478
 		$oMemberModel = getModel('member');
1479 1479
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1492,13 +1492,13 @@  discard block
 block discarded – undo
1492 1492
 	{
1493 1493
 		$site_module_info = Context::get('site_module_info');
1494 1494
 		$logged_info = Context::get('logged_info');
1495
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1495
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new Object(-1, 'msg_invalid_request');
1496 1496
 
1497 1497
 		$args = new stdClass;
1498
-		$args->site_srl= $site_module_info->site_srl;
1498
+		$args->site_srl = $site_module_info->site_srl;
1499 1499
 		$args->member_srl = $logged_info->member_srl;
1500 1500
 		$output = executeQuery('member.deleteMembersGroup', $args);
1501
-		if(!$output->toBool()) return $output;
1501
+		if (!$output->toBool()) return $output;
1502 1502
 		$this->setMessage('success_deleted');
1503 1503
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1504 1504
 	}
@@ -1512,25 +1512,25 @@  discard block
 block discarded – undo
1512 1512
 	 */
1513 1513
 	function setMemberConfig($args)
1514 1514
 	{
1515
-		if(!$args->skin) $args->skin = "default";
1516
-		if(!$args->colorset) $args->colorset = "white";
1517
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1518
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1519
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1520
-		$args->enable_openid= 'N';
1521
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1522
-		if($args->image_name!='Y') $args->image_name = 'N';
1523
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1524
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1525
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1526
-		$args->limit_day = (int)$args->limit_day;
1515
+		if (!$args->skin) $args->skin = "default";
1516
+		if (!$args->colorset) $args->colorset = "white";
1517
+		if (!$args->editor_skin) $args->editor_skin = "ckeditor";
1518
+		if (!$args->editor_colorset) $args->editor_colorset = "moono";
1519
+		if ($args->enable_join != 'Y') $args->enable_join = 'N';
1520
+		$args->enable_openid = 'N';
1521
+		if ($args->profile_image != 'Y') $args->profile_image = 'N';
1522
+		if ($args->image_name != 'Y') $args->image_name = 'N';
1523
+		if ($args->image_mark != 'Y') $args->image_mark = 'N';
1524
+		if ($args->group_image_mark != 'Y') $args->group_image_mark = 'N';
1525
+		if (!trim(strip_tags($args->agreement))) $args->agreement = null;
1526
+		$args->limit_day = (int) $args->limit_day;
1527 1527
 
1528 1528
 		$agreement = trim($args->agreement);
1529 1529
 		unset($args->agreement);
1530 1530
 
1531 1531
 		$oModuleController = getController('module');
1532
-		$output = $oModuleController->insertModuleConfig('member',$args);
1533
-		if(!$output->toBool()) return $output;
1532
+		$output = $oModuleController->insertModuleConfig('member', $args);
1533
+		if (!$output->toBool()) return $output;
1534 1534
 
1535 1535
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1536 1536
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1551,11 +1551,11 @@  discard block
 block discarded – undo
1551 1551
 		$signature = trim(removeHackTag($signature));
1552 1552
 		$signature = preg_replace('/<(\/?)(embed|object|param)/is', '&lt;$1$2', $signature);
1553 1553
 
1554
-		$check_signature = trim(str_replace(array('&nbsp;',"\n","\r"), '', strip_tags($signature, '<img><object>')));
1554
+		$check_signature = trim(str_replace(array('&nbsp;', "\n", "\r"), '', strip_tags($signature, '<img><object>')));
1555 1555
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1556 1556
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1557 1557
 
1558
-		if(!$check_signature) return FileHandler::removeFile($filename);
1558
+		if (!$check_signature) return FileHandler::removeFile($filename);
1559 1559
 
1560 1560
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1561 1561
 		FileHandler::makeDir($path);
@@ -1584,15 +1584,15 @@  discard block
 block discarded – undo
1584 1584
 	 *
1585 1585
 	 * @return Object
1586 1586
 	 */
1587
-	function addMemberToGroup($member_srl, $group_srl, $site_srl=0)
1587
+	function addMemberToGroup($member_srl, $group_srl, $site_srl = 0)
1588 1588
 	{
1589 1589
 		$args = new stdClass();
1590 1590
 		$args->member_srl = $member_srl;
1591 1591
 		$args->group_srl = $group_srl;
1592
-		if($site_srl) $args->site_srl = $site_srl;
1592
+		if ($site_srl) $args->site_srl = $site_srl;
1593 1593
 
1594 1594
 		// Add
1595
-		$output = executeQuery('member.addMemberToGroup',$args);
1595
+		$output = executeQuery('member.addMemberToGroup', $args);
1596 1596
 		$output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args);
1597 1597
 
1598 1598
 		$this->_clearMemberCache($member_srl, $site_srl);
@@ -1612,18 +1612,18 @@  discard block
 block discarded – undo
1612 1612
 	{
1613 1613
 		$obj = new stdClass;
1614 1614
 		$obj->site_srl = $args->site_srl;
1615
-		$obj->member_srl = implode(',',$args->member_srl);
1615
+		$obj->member_srl = implode(',', $args->member_srl);
1616 1616
 
1617 1617
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1618
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1618
+		if ($output->data) foreach ($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1619 1619
 
1620 1620
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1621
-		if(!$output->toBool()) return $output;
1621
+		if (!$output->toBool()) return $output;
1622 1622
 
1623 1623
 		$inserted_members = array();
1624
-		foreach($args->member_srl as $key => $val)
1624
+		foreach ($args->member_srl as $key => $val)
1625 1625
 		{
1626
-			if($inserted_members[$val]) continue;
1626
+			if ($inserted_members[$val]) continue;
1627 1627
 			$inserted_members[$val] = true;
1628 1628
 
1629 1629
 			unset($obj);
@@ -1633,7 +1633,7 @@  discard block
 block discarded – undo
1633 1633
 			$obj->site_srl = $args->site_srl;
1634 1634
 			$obj->regdate = $date[$obj->member_srl];
1635 1635
 			$output = executeQuery('member.addMemberToGroup', $obj);
1636
-			if(!$output->toBool()) return $output;
1636
+			if (!$output->toBool()) return $output;
1637 1637
 
1638 1638
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1639 1639
 		}
@@ -1655,9 +1655,9 @@  discard block
 block discarded – undo
1655 1655
 		// Get information of the key
1656 1656
 		$output = executeQuery('member.getAutologin', $args);
1657 1657
 		// If no information exists, delete a cookie
1658
-		if(!$output->toBool() || !$output->data)
1658
+		if (!$output->toBool() || !$output->data)
1659 1659
 		{
1660
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
1660
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365);
1661 1661
 			return;
1662 1662
 		}
1663 1663
 
@@ -1667,9 +1667,9 @@  discard block
 block discarded – undo
1667 1667
 		$user_id = ($config->identifier == 'user_id') ? $output->data->user_id : $output->data->email_address;
1668 1668
 		$password = $output->data->password;
1669 1669
 
1670
-		if(!$user_id || !$password)
1670
+		if (!$user_id || !$password)
1671 1671
 		{
1672
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
1672
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365);
1673 1673
 			return;
1674 1674
 		}
1675 1675
 
@@ -1679,7 +1679,7 @@  discard block
 block discarded – undo
1679 1679
 		$check_key = strtolower($user_id).$password.$_SERVER['HTTP_USER_AGENT'];
1680 1680
 		$check_key = substr(hash_hmac('sha256', $check_key, substr($args->autologin_key, 0, 32)), 0, 32);
1681 1681
 
1682
-		if($check_key === substr($args->autologin_key, 32))
1682
+		if ($check_key === substr($args->autologin_key, 32))
1683 1683
 		{
1684 1684
 			// Check change_password_date
1685 1685
 			$oModuleModel = getModel('module');
@@ -1687,12 +1687,12 @@  discard block
 block discarded – undo
1687 1687
 			$limit_date = $member_config->change_password_date;
1688 1688
 
1689 1689
 			// Check if change_password_date is set
1690
-			if($limit_date > 0)
1690
+			if ($limit_date > 0)
1691 1691
 			{
1692 1692
 				$oMemberModel = getModel('member');
1693 1693
 				$columnList = array('member_srl', 'change_password_date');
1694 1694
 
1695
-				if($config->identifier == 'user_id')
1695
+				if ($config->identifier == 'user_id')
1696 1696
 				{
1697 1697
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1698 1698
 				}
@@ -1701,7 +1701,7 @@  discard block
 block discarded – undo
1701 1701
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1702 1702
 				}
1703 1703
 
1704
-				if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){
1704
+				if ($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day'))) {
1705 1705
 					$do_auto_login = true;
1706 1706
 				}
1707 1707
 
@@ -1712,14 +1712,14 @@  discard block
 block discarded – undo
1712 1712
 			}
1713 1713
 		}
1714 1714
 
1715
-		if($do_auto_login)
1715
+		if ($do_auto_login)
1716 1716
 		{
1717 1717
 			$output = $this->doLogin($user_id);
1718 1718
 		}
1719 1719
 		else
1720 1720
 		{
1721 1721
 			executeQuery('member.deleteAutologin', $args);
1722
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
1722
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365);
1723 1723
 		}
1724 1724
 	}
1725 1725
 
@@ -1735,13 +1735,13 @@  discard block
 block discarded – undo
1735 1735
 	function doLogin($user_id, $password = '', $keep_signed = false)
1736 1736
 	{
1737 1737
 		$user_id = strtolower($user_id);
1738
-		if(!$user_id) return new Object(-1, 'null_user_id');
1738
+		if (!$user_id) return new Object(-1, 'null_user_id');
1739 1739
 		// Call a trigger before log-in (before)
1740 1740
 		$trigger_obj = new stdClass();
1741 1741
 		$trigger_obj->user_id = $user_id;
1742 1742
 		$trigger_obj->password = $password;
1743 1743
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1744
-		if(!$trigger_output->toBool()) return $trigger_output;
1744
+		if (!$trigger_output->toBool()) return $trigger_output;
1745 1745
 		// Create a member model object
1746 1746
 		$oMemberModel = getModel('member');
1747 1747
 
@@ -1751,12 +1751,12 @@  discard block
 block discarded – undo
1751 1751
 		$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1752 1752
 
1753 1753
 		// check identifier
1754
-		if($config->identifier == 'email_address')
1754
+		if ($config->identifier == 'email_address')
1755 1755
 		{
1756 1756
 			// Get user_id information
1757 1757
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1758 1758
 			// Set an invalid user if no value returned
1759
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1759
+			if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1760 1760
 
1761 1761
 		}
1762 1762
 		else
@@ -1764,24 +1764,24 @@  discard block
 block discarded – undo
1764 1764
 			// Get user_id information
1765 1765
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1766 1766
 			// Set an invalid user if no value returned
1767
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1767
+			if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1768 1768
 		}
1769 1769
 
1770 1770
 		$output = executeQuery('member.getLoginCountByIp', $args);
1771 1771
 		$errorCount = $output->data->count;
1772
-		if($errorCount >= $config->max_error_count)
1772
+		if ($errorCount >= $config->max_error_count)
1773 1773
 		{
1774 1774
 			$last_update = strtotime($output->data->last_update);
1775
-			$term = intval($_SERVER['REQUEST_TIME']-$last_update);
1776
-			if($term < $config->max_error_count_time)
1775
+			$term = intval($_SERVER['REQUEST_TIME'] - $last_update);
1776
+			if ($term < $config->max_error_count_time)
1777 1777
 			{
1778 1778
 				$term = $config->max_error_count_time - $term;
1779
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1780
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1781
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1782
-				else $term = intval($term/86400).Context::getLang('unit_day');
1779
+				if ($term < 60) $term = intval($term).Context::getLang('unit_sec');
1780
+				elseif (60 <= $term && $term < 3600) $term = intval($term / 60).Context::getLang('unit_min');
1781
+				elseif (3600 <= $term && $term < 86400) $term = intval($term / 3600).Context::getLang('unit_hour');
1782
+				else $term = intval($term / 86400).Context::getLang('unit_day');
1783 1783
 
1784
-				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1784
+				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'), $term));
1785 1785
 			}
1786 1786
 			else
1787 1787
 			{
@@ -1791,13 +1791,13 @@  discard block
 block discarded – undo
1791 1791
 		}
1792 1792
 
1793 1793
 		// Password Check
1794
-		if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1794
+		if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1795 1795
 		{
1796
-			return $this->recordMemberLoginError(-1, 'invalid_password',$this->memberInfo);
1796
+			return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo);
1797 1797
 		}
1798 1798
 
1799 1799
 		// If denied == 'Y', notify
1800
-		if($this->memberInfo->denied == 'Y')
1800
+		if ($this->memberInfo->denied == 'Y')
1801 1801
 		{
1802 1802
 			$args->member_srl = $this->memberInfo->member_srl;
1803 1803
 			$output = executeQuery('member.chkAuthMail', $args);
@@ -1805,12 +1805,12 @@  discard block
 block discarded – undo
1805 1805
 			{
1806 1806
 				$_SESSION['auth_member_srl'] = $this->memberInfo->member_srl;
1807 1807
 				$redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail');
1808
-				return $this->setRedirectUrl($redirectUrl, new Object(-1,'msg_user_not_confirmed'));
1808
+				return $this->setRedirectUrl($redirectUrl, new Object(-1, 'msg_user_not_confirmed'));
1809 1809
 			}
1810
-			return new Object(-1,'msg_user_denied');
1810
+			return new Object(-1, 'msg_user_denied');
1811 1811
 		}
1812 1812
 		// Notify if denied_date is less than the current time
1813
-		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
1813
+		if ($this->memberInfo->limit_date && substr($this->memberInfo->limit_date, 0, 8) >= date("Ymd")) return new Object(-9, sprintf(Context::getLang('msg_user_limited'), zdate($this->memberInfo->limit_date, "Y-m-d")));
1814 1814
 		// Update the latest login time
1815 1815
 		$args->member_srl = $this->memberInfo->member_srl;
1816 1816
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1820,36 +1820,36 @@  discard block
 block discarded – undo
1820 1820
 
1821 1821
 		// Check if there is recoding table.
1822 1822
 		$oDB = &DB::getInstance();
1823
-		if($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1823
+		if ($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1824 1824
 		{
1825 1825
 			// check if there is login fail records.
1826 1826
 			$output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args);
1827
-			if($output->data && $output->data->content)
1827
+			if ($output->data && $output->data->content)
1828 1828
 			{
1829 1829
 				$title = Context::getLang('login_fail_report');
1830 1830
 				$message = '<ul>';
1831 1831
 				$content = unserialize($output->data->content);
1832
-				if(count($content) > $config->max_error_count)
1832
+				if (count($content) > $config->max_error_count)
1833 1833
 				{
1834
-					foreach($content as $val)
1834
+					foreach ($content as $val)
1835 1835
 					{
1836
-						$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>';
1836
+						$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>';
1837 1837
 					}
1838 1838
 					$message .= '</ul>';
1839
-					$content = sprintf(Context::getLang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa'));
1839
+					$content = sprintf(Context::getLang('login_fail_report_contents'), $message, date('Y-m-d h:i:sa'));
1840 1840
 
1841 1841
 					//send message
1842 1842
 					$oCommunicationController = getController('communication');
1843 1843
 					$oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true);
1844 1844
 
1845
-					if($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1845
+					if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1846 1846
 					{
1847 1847
 						$view_url = Context::getRequestUri();
1848
-						$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);
1848
+						$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);
1849 1849
 						$oMail = new Mail();
1850 1850
 						$oMail->setTitle($title);
1851 1851
 						$oMail->setContent($content);
1852
-						$oMail->setSender($config->webmaster_name?$config->webmaster_name:'webmaster', $config->webmaster_email);
1852
+						$oMail->setSender($config->webmaster_name ? $config->webmaster_name : 'webmaster', $config->webmaster_email);
1853 1853
 						$oMail->setReceiptor($this->memberInfo->email_id.'('.$this->memberInfo->nick_name.')', $this->memberInfo->email_address);
1854 1854
 						$oMail->send();
1855 1855
 					}
@@ -1859,9 +1859,9 @@  discard block
 block discarded – undo
1859 1859
 		}
1860 1860
 		// Call a trigger after successfully log-in (after)
1861 1861
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1862
-		if(!$trigger_output->toBool()) return $trigger_output;
1862
+		if (!$trigger_output->toBool()) return $trigger_output;
1863 1863
 		// When user checked to use auto-login
1864
-		if($keep_signed)
1864
+		if ($keep_signed)
1865 1865
 		{
1866 1866
 			// Key generate for auto login
1867 1867
 			$oPassword = new Password();
@@ -1873,12 +1873,12 @@  discard block
 block discarded – undo
1873 1873
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1874 1874
 			executeQuery('member.deleteAutologin', $autologin_args);
1875 1875
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1876
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000);
1876
+			if ($autologin_output->toBool()) setCookie('xeak', $autologin_args->autologin_key, $_SERVER['REQUEST_TIME'] + 31536000);
1877 1877
 		}
1878
-		if($this->memberInfo->is_admin == 'Y')
1878
+		if ($this->memberInfo->is_admin == 'Y')
1879 1879
 		{
1880 1880
 			$oMemberAdminModel = getAdminModel('member');
1881
-			if(!$oMemberAdminModel->getMemberAdminIPCheck())
1881
+			if (!$oMemberAdminModel->getMemberAdminIPCheck())
1882 1882
 			{
1883 1883
 				$_SESSION['denied_admin'] = 'Y';
1884 1884
 			}
@@ -1896,18 +1896,18 @@  discard block
 block discarded – undo
1896 1896
 	{
1897 1897
 		$oMemberModel = getModel('member');
1898 1898
 		// If your information came through the current session information to extract information from the users
1899
-		if(!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged() )
1899
+		if (!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged())
1900 1900
 		{
1901 1901
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']);
1902 1902
 			// If you do not destroy the session Profile
1903
-			if($this->memberInfo->member_srl != $_SESSION['member_srl'])
1903
+			if ($this->memberInfo->member_srl != $_SESSION['member_srl'])
1904 1904
 			{
1905 1905
 				$this->destroySessionInfo();
1906 1906
 				return;
1907 1907
 			}
1908 1908
 		}
1909 1909
 		// Stop using the session id is destroyed
1910
-		if($this->memberInfo->denied=='Y')
1910
+		if ($this->memberInfo->denied == 'Y')
1911 1911
 		{
1912 1912
 			$this->destroySessionInfo();
1913 1913
 			return;
@@ -1937,10 +1937,10 @@  discard block
 block discarded – undo
1937 1937
 		Context::set('logged_info', $this->memberInfo);
1938 1938
 
1939 1939
 		// Only the menu configuration of the user (such as an add-on to the menu can be changed)
1940
-		$this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info');
1941
-		$this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document');
1942
-		$this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document');
1943
-		$this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document');
1940
+		$this->addMemberMenu('dispMemberInfo', 'cmd_view_member_info');
1941
+		$this->addMemberMenu('dispMemberScrappedDocument', 'cmd_view_scrapped_document');
1942
+		$this->addMemberMenu('dispMemberSavedDocument', 'cmd_view_saved_document');
1943
+		$this->addMemberMenu('dispMemberOwnDocument', 'cmd_view_own_document');
1944 1944
 	}
1945 1945
 
1946 1946
 	/**
@@ -1962,7 +1962,7 @@  discard block
 block discarded – undo
1962 1962
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
1963 1963
 	{
1964 1964
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
1965
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
1965
+		if (!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
1966 1966
 
1967 1967
 		$obj = new stdClass;
1968 1968
 		$obj->url = $url;
@@ -1981,33 +1981,33 @@  discard block
 block discarded – undo
1981 1981
 	{
1982 1982
 		// Call a trigger (before)
1983 1983
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
1984
-		if(!$output->toBool()) return $output;
1984
+		if (!$output->toBool()) return $output;
1985 1985
 		// Terms and Conditions portion of the information set up by members reaffirmed
1986 1986
 		$oModuleModel = getModel('module');
1987 1987
 		$config = $oModuleModel->getModuleConfig('member');
1988 1988
 
1989 1989
 		$logged_info = Context::get('logged_info');
1990 1990
 		// If the date of the temporary restrictions limit further information on the date of
1991
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
1991
+		if ($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME'] + $config->limit_day * 60 * 60 * 24);
1992 1992
 
1993 1993
 		$args->member_srl = getNextSequence();
1994 1994
 		$args->list_order = -1 * $args->member_srl;
1995 1995
 
1996 1996
 		// Execute insert or update depending on the value of member_srl
1997
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
1997
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
1998 1998
 		// Enter the user's identity changed to lowercase
1999 1999
 		else $args->user_id = strtolower($args->user_id);
2000
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2001
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
2000
+		if (!$args->user_name) $args->user_name = $args->member_srl;
2001
+		if (!$args->nick_name) $args->nick_name = $args->member_srl;
2002 2002
 
2003 2003
 		// Control of essential parameters
2004
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2005
-		if($args->denied!='Y') $args->denied = 'N';
2006
-		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y';
2004
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
2005
+		if ($args->denied != 'Y') $args->denied = 'N';
2006
+		if (!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F')))) $args->allow_message = 'Y';
2007 2007
 
2008
-		if($logged_info->is_admin == 'Y')
2008
+		if ($logged_info->is_admin == 'Y')
2009 2009
 		{
2010
-			if($args->is_admin!='Y') $args->is_admin = 'N';
2010
+			if ($args->is_admin != 'Y') $args->is_admin = 'N';
2011 2011
 		}
2012 2012
 		else
2013 2013
 		{
@@ -2022,97 +2022,97 @@  discard block
 block discarded – undo
2022 2022
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2023 2023
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2024 2024
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2025
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2026
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
2025
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//i", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
2026
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//i", $args->blog)) $args->blog = 'http://'.$args->blog;
2027 2027
 
2028 2028
 		// Create a model object
2029 2029
 		$oMemberModel = getModel('member');
2030 2030
 
2031 2031
 		// Check password strength
2032
-		if($args->password && !$password_is_hashed)
2032
+		if ($args->password && !$password_is_hashed)
2033 2033
 		{
2034
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2034
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2035 2035
 			{
2036 2036
 				$message = Context::getLang('about_password_strength');
2037 2037
 				return new Object(-1, $message[$config->password_strength]);
2038 2038
 			}
2039 2039
 			$args->password = $oMemberModel->hashPassword($args->password);
2040 2040
 		}
2041
-		elseif(!$args->password)
2041
+		elseif (!$args->password)
2042 2042
 		{
2043 2043
 			unset($args->password);
2044 2044
 		}
2045 2045
 
2046
-		if($args->find_account_answer && !$password_is_hashed)
2046
+		if ($args->find_account_answer && !$password_is_hashed)
2047 2047
 		{
2048 2048
 			$args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer);
2049 2049
 		}
2050
-		elseif(!$args->find_account_answer)
2050
+		elseif (!$args->find_account_answer)
2051 2051
 		{
2052 2052
 			unset($args->find_account_answer);
2053 2053
 		}
2054 2054
 
2055 2055
 		// Check if ID is prohibited
2056
-		if($oMemberModel->isDeniedID($args->user_id))
2056
+		if ($oMemberModel->isDeniedID($args->user_id))
2057 2057
 		{
2058
-			return new Object(-1,'denied_user_id');
2058
+			return new Object(-1, 'denied_user_id');
2059 2059
 		}
2060 2060
 
2061 2061
 		// Check if ID is duplicate
2062 2062
 		$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2063
-		if($member_srl)
2063
+		if ($member_srl)
2064 2064
 		{
2065
-			return new Object(-1,'msg_exists_user_id');
2065
+			return new Object(-1, 'msg_exists_user_id');
2066 2066
 		}
2067 2067
 
2068 2068
 		// Check if nickname is prohibited
2069
-		if($oMemberModel->isDeniedNickName($args->nick_name))
2069
+		if ($oMemberModel->isDeniedNickName($args->nick_name))
2070 2070
 		{
2071
-			return new Object(-1,'denied_nick_name');
2071
+			return new Object(-1, 'denied_nick_name');
2072 2072
 		}
2073 2073
 
2074 2074
 		// Check if nickname is duplicate
2075 2075
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
2076
-		if($member_srl)
2076
+		if ($member_srl)
2077 2077
 		{
2078
-			return new Object(-1,'msg_exists_nick_name');
2078
+			return new Object(-1, 'msg_exists_nick_name');
2079 2079
 		}
2080 2080
 
2081 2081
 		// Check if email address is duplicate
2082 2082
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2083
-		if($member_srl)
2083
+		if ($member_srl)
2084 2084
 		{
2085
-			return new Object(-1,'msg_exists_email_address');
2085
+			return new Object(-1, 'msg_exists_email_address');
2086 2086
 		}
2087 2087
 
2088 2088
 		// Insert data into the DB
2089 2089
 		$args->list_order = -1 * $args->member_srl;
2090 2090
 
2091
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2092
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2091
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
2092
+		if (!$args->user_name) $args->user_name = $args->member_srl;
2093 2093
 
2094 2094
 		$oDB = &DB::getInstance();
2095 2095
 		$oDB->begin();
2096 2096
 
2097 2097
 		$output = executeQuery('member.insertMember', $args);
2098
-		if(!$output->toBool())
2098
+		if (!$output->toBool())
2099 2099
 		{
2100 2100
 			$oDB->rollback();
2101 2101
 			return $output;
2102 2102
 		}
2103 2103
 
2104
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2104
+		if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2105 2105
 		else $group_srl_list = explode('|@|', $args->group_srl_list);
2106 2106
 		// If no value is entered the default group, the value of group registration
2107
-		if(!$args->group_srl_list)
2107
+		if (!$args->group_srl_list)
2108 2108
 		{
2109 2109
 			$columnList = array('site_srl', 'group_srl');
2110 2110
 			$default_group = $oMemberModel->getDefaultGroup(0, $columnList);
2111
-			if($default_group)
2111
+			if ($default_group)
2112 2112
 			{
2113 2113
 				// Add to the default group
2114
-				$output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl);
2115
-				if(!$output->toBool())
2114
+				$output = $this->addMemberToGroup($args->member_srl, $default_group->group_srl);
2115
+				if (!$output->toBool())
2116 2116
 				{
2117 2117
 					$oDB->rollback();
2118 2118
 					return $output;
@@ -2122,11 +2122,11 @@  discard block
 block discarded – undo
2122 2122
 		}
2123 2123
 		else
2124 2124
 		{
2125
-			for($i=0;$i<count($group_srl_list);$i++)
2125
+			for ($i = 0; $i < count($group_srl_list); $i++)
2126 2126
 			{
2127
-				$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2127
+				$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2128 2128
 
2129
-				if(!$output->toBool())
2129
+				if (!$output->toBool())
2130 2130
 				{
2131 2131
 					$oDB->rollback();
2132 2132
 					return $output;
@@ -2136,7 +2136,7 @@  discard block
 block discarded – undo
2136 2136
 
2137 2137
 		$member_config = $oModuleModel->getModuleConfig('member');
2138 2138
 		// When using email authentication mode (when you subscribed members denied a) certified mail sent
2139
-		if($args->denied == 'Y')
2139
+		if ($args->denied == 'Y')
2140 2140
 		{
2141 2141
 			// Insert data into the authentication DB
2142 2142
 			$oPassword = new Password();
@@ -2148,7 +2148,7 @@  discard block
 block discarded – undo
2148 2148
 			$auth_args->is_register = 'Y';
2149 2149
 
2150 2150
 			$output = executeQuery('member.insertAuthMail', $auth_args);
2151
-			if(!$output->toBool())
2151
+			if (!$output->toBool())
2152 2152
 			{
2153 2153
 				$oDB->rollback();
2154 2154
 				return $output;
@@ -2156,10 +2156,10 @@  discard block
 block discarded – undo
2156 2156
 			$this->_sendAuthMail($auth_args, $args);
2157 2157
 		}
2158 2158
 		// Call a trigger (after)
2159
-		if($output->toBool())
2159
+		if ($output->toBool())
2160 2160
 		{
2161 2161
 			$trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args);
2162
-			if(!$trigger_output->toBool())
2162
+			if (!$trigger_output->toBool())
2163 2163
 			{
2164 2164
 				$oDB->rollback();
2165 2165
 				return $trigger_output;
@@ -2181,41 +2181,41 @@  discard block
 block discarded – undo
2181 2181
 	{
2182 2182
 		// Call a trigger (before)
2183 2183
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2184
-		if(!$output->toBool()) return $output;
2184
+		if (!$output->toBool()) return $output;
2185 2185
 		// Create a model object
2186 2186
 		$oMemberModel = getModel('member');
2187 2187
 
2188 2188
 		$logged_info = Context::get('logged_info');
2189 2189
 		// Get what you want to modify the original information
2190
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2190
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2191 2191
 		// Control of essential parameters
2192
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2193
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2192
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
2193
+		if ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F'))) $args->allow_message = 'Y';
2194 2194
 
2195
-		if($logged_info->is_admin == 'Y')
2195
+		if ($logged_info->is_admin == 'Y')
2196 2196
 		{
2197
-			if($args->denied!='Y') $args->denied = 'N';
2198
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2197
+			if ($args->denied != 'Y') $args->denied = 'N';
2198
+			if ($args->is_admin != 'Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2199 2199
 		}
2200 2200
 		else
2201 2201
 		{
2202 2202
 			unset($args->is_admin);
2203
-			if($is_admin == false)
2203
+			if ($is_admin == false)
2204 2204
 				unset($args->denied);
2205
-			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2205
+			if ($logged_info->member_srl != $args->member_srl && $is_admin == false)
2206 2206
 			{
2207 2207
 				return $this->stop('msg_invalid_request');
2208 2208
 			}
2209 2209
 		}
2210 2210
 
2211 2211
 		// Sanitize user ID, username, nickname, homepage, blog
2212
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2212
+		if ($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2213 2213
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2214 2214
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2215 2215
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2216 2216
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2217
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2218
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2217
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//is", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
2218
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//is", $args->blog)) $args->blog = 'http://'.$args->blog;
2219 2219
 
2220 2220
 		// check member identifier form
2221 2221
 		$config = $oMemberModel->getMemberConfig();
@@ -2224,56 +2224,56 @@  discard block
 block discarded – undo
2224 2224
 		$orgMemberInfo = $output->data;
2225 2225
 
2226 2226
 		// Check if email address or user ID is duplicate
2227
-		if($config->identifier == 'email_address')
2227
+		if ($config->identifier == 'email_address')
2228 2228
 		{
2229 2229
 			$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2230
-			if($member_srl && $args->member_srl != $member_srl)
2230
+			if ($member_srl && $args->member_srl != $member_srl)
2231 2231
 			{
2232
-				return new Object(-1,'msg_exists_email_address');
2232
+				return new Object(-1, 'msg_exists_email_address');
2233 2233
 			}
2234 2234
 			$args->email_address = $orgMemberInfo->email_address;
2235 2235
 		}
2236 2236
 		else
2237 2237
 		{
2238 2238
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2239
-			if($member_srl && $args->member_srl != $member_srl)
2239
+			if ($member_srl && $args->member_srl != $member_srl)
2240 2240
 			{
2241
-				return new Object(-1,'msg_exists_user_id');
2241
+				return new Object(-1, 'msg_exists_user_id');
2242 2242
 			}
2243 2243
 
2244 2244
 			$args->user_id = $orgMemberInfo->user_id;
2245 2245
 		}
2246 2246
 
2247
-		if($logged_info->is_admin !== 'Y')
2247
+		if ($logged_info->is_admin !== 'Y')
2248 2248
 		{
2249 2249
 			// Check if ID is prohibited
2250
-			if($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2250
+			if ($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2251 2251
 			{
2252
-				return new Object(-1,'denied_user_id');
2252
+				return new Object(-1, 'denied_user_id');
2253 2253
 			}
2254 2254
 
2255 2255
 			// Check if nickname is prohibited
2256
-			if($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2256
+			if ($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2257 2257
 			{
2258 2258
 				return new Object(-1, 'denied_nick_name');
2259 2259
 			}
2260 2260
 		}
2261 2261
 
2262 2262
 		// Check if ID is duplicate
2263
-		if($args->user_id)
2263
+		if ($args->user_id)
2264 2264
 		{
2265 2265
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2266
-			if($member_srl && $args->member_srl != $member_srl)
2266
+			if ($member_srl && $args->member_srl != $member_srl)
2267 2267
 			{
2268
-				return new Object(-1,'msg_exists_user_id');
2268
+				return new Object(-1, 'msg_exists_user_id');
2269 2269
 			}
2270 2270
 		}
2271 2271
 
2272 2272
 		// Check if nickname is duplicate
2273 2273
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
2274
- 		if($member_srl && $args->member_srl != $member_srl)
2274
+ 		if ($member_srl && $args->member_srl != $member_srl)
2275 2275
  		{
2276
- 			return new Object(-1,'msg_exists_nick_name');
2276
+ 			return new Object(-1, 'msg_exists_nick_name');
2277 2277
  		}
2278 2278
 
2279 2279
 		list($args->email_id, $args->email_host) = explode('@', $args->email_address);
@@ -2282,9 +2282,9 @@  discard block
 block discarded – undo
2282 2282
 		$oDB->begin();
2283 2283
 
2284 2284
 		// Check password strength
2285
-		if($args->password)
2285
+		if ($args->password)
2286 2286
 		{
2287
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2287
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2288 2288
 			{
2289 2289
 				$message = Context::getLang('about_password_strength');
2290 2290
 				return new Object(-1, $message[$config->password_strength]);
@@ -2296,55 +2296,55 @@  discard block
 block discarded – undo
2296 2296
 			$args->password = $orgMemberInfo->password;
2297 2297
 		}
2298 2298
 
2299
-		if($args->find_account_answer) {
2299
+		if ($args->find_account_answer) {
2300 2300
 			$args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer);
2301 2301
 		}
2302 2302
 		else
2303 2303
 		{
2304
-			$oPassword =  new Password();
2304
+			$oPassword = new Password();
2305 2305
 			$hashed = $oPassword->checkAlgorithm($orgMemberInfo->find_account_answer);
2306 2306
 
2307
-			if($hashed) {
2307
+			if ($hashed) {
2308 2308
 				$args->find_account_answer = $orgMemberInfo->find_account_answer;
2309 2309
 			} else {
2310 2310
 				$args->find_account_answer = $oPassword->createHash($orgMemberInfo->find_account_answer);
2311 2311
 			}
2312 2312
 		}
2313 2313
 
2314
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2315
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2316
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2317
-		if(!$args->description) $args->description = $orgMemberInfo->description;
2318
-		if(!$args->birthday) $args->birthday = '';
2314
+		if (!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2315
+		if (!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2316
+		if (!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2317
+		if (!$args->description) $args->description = $orgMemberInfo->description;
2318
+		if (!$args->birthday) $args->birthday = '';
2319 2319
 
2320 2320
 		$output = executeQuery('member.updateMember', $args);
2321 2321
 
2322
-		if(!$output->toBool())
2322
+		if (!$output->toBool())
2323 2323
 		{
2324 2324
 			$oDB->rollback();
2325 2325
 			return $output;
2326 2326
 		}
2327 2327
 
2328
-		if($args->group_srl_list)
2328
+		if ($args->group_srl_list)
2329 2329
 		{
2330
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2330
+			if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2331 2331
 			else $group_srl_list = explode('|@|', $args->group_srl_list);
2332 2332
 			// If the group information, group information changes
2333
-			if(count($group_srl_list) > 0)
2333
+			if (count($group_srl_list) > 0)
2334 2334
 			{
2335 2335
 				$args->site_srl = 0;
2336 2336
 				// One of its members to delete all the group
2337 2337
 				$output = executeQuery('member.deleteMemberGroupMember', $args);
2338
-				if(!$output->toBool())
2338
+				if (!$output->toBool())
2339 2339
 				{
2340 2340
 					$oDB->rollback();
2341 2341
 					return $output;
2342 2342
 				}
2343 2343
 				// Enter one of the loop a
2344
-				for($i=0;$i<count($group_srl_list);$i++)
2344
+				for ($i = 0; $i < count($group_srl_list); $i++)
2345 2345
 				{
2346
-					$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2347
-					if(!$output->toBool())
2346
+					$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2347
+					if (!$output->toBool())
2348 2348
 					{
2349 2349
 						$oDB->rollback();
2350 2350
 						return $output;
@@ -2356,9 +2356,9 @@  discard block
 block discarded – undo
2356 2356
 			}
2357 2357
 		}
2358 2358
 		// Call a trigger (after)
2359
-		if($output->toBool()) {
2359
+		if ($output->toBool()) {
2360 2360
 			$trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args);
2361
-			if(!$trigger_output->toBool())
2361
+			if (!$trigger_output->toBool())
2362 2362
 			{
2363 2363
 				$oDB->rollback();
2364 2364
 				return $trigger_output;
@@ -2371,7 +2371,7 @@  discard block
 block discarded – undo
2371 2371
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2372 2372
 
2373 2373
 		// Save Session
2374
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2374
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2375 2375
 		$logged_info = Context::get('logged_info');
2376 2376
 
2377 2377
 		$output->add('member_srl', $args->member_srl);
@@ -2383,14 +2383,14 @@  discard block
 block discarded – undo
2383 2383
 	 */
2384 2384
 	function updateMemberPassword($args)
2385 2385
 	{
2386
-		if($args->password)
2386
+		if ($args->password)
2387 2387
 		{
2388 2388
 
2389 2389
 			// check password strength
2390 2390
 			$oMemberModel = getModel('member');
2391 2391
 			$config = $oMemberModel->getMemberConfig();
2392 2392
 
2393
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2393
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2394 2394
 			{
2395 2395
 				$message = Context::getLang('about_password_strength');
2396 2396
 				return new Object(-1, $message[$config->password_strength]);
@@ -2398,13 +2398,13 @@  discard block
 block discarded – undo
2398 2398
 
2399 2399
 			$args->password = $oMemberModel->hashPassword($args->password);
2400 2400
 		}
2401
-		else if($args->hashed_password)
2401
+		else if ($args->hashed_password)
2402 2402
 		{
2403 2403
 			$args->password = $args->hashed_password;
2404 2404
 		}
2405 2405
 
2406 2406
 		$output = executeQuery('member.updateMemberPassword', $args);
2407
-		if($output->toBool())
2407
+		if ($output->toBool())
2408 2408
 		{
2409 2409
 			$result = executeQuery('member.updateChangePasswordDate', $args);
2410 2410
 		}
@@ -2416,7 +2416,7 @@  discard block
 block discarded – undo
2416 2416
 
2417 2417
 	function updateFindAccountAnswer($member_srl, $answer)
2418 2418
 	{
2419
-		$oPassword =  new Password();
2419
+		$oPassword = new Password();
2420 2420
 
2421 2421
 		$args = new stdClass();
2422 2422
 		$args->member_srl = $member_srl;
@@ -2433,18 +2433,18 @@  discard block
 block discarded – undo
2433 2433
 		$trigger_obj = new stdClass();
2434 2434
 		$trigger_obj->member_srl = $member_srl;
2435 2435
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2436
-		if(!$output->toBool()) return $output;
2436
+		if (!$output->toBool()) return $output;
2437 2437
 		// Create a model object
2438 2438
 		$oMemberModel = getModel('member');
2439 2439
 		// Bringing the user's information
2440
-		if(!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2440
+		if (!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2441 2441
 		{
2442 2442
 			$columnList = array('member_srl', 'is_admin');
2443 2443
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2444 2444
 		}
2445
-		if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2445
+		if (!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2446 2446
 		// If managers can not be deleted
2447
-		if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2447
+		if ($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2448 2448
 
2449 2449
 		$oDB = &DB::getInstance();
2450 2450
 		$oDB->begin();
@@ -2453,7 +2453,7 @@  discard block
 block discarded – undo
2453 2453
 		$args->member_srl = $member_srl;
2454 2454
 		// Delete the entries in member_auth_mail
2455 2455
 		$output = executeQuery('member.deleteAuthMail', $args);
2456
-		if(!$output->toBool())
2456
+		if (!$output->toBool())
2457 2457
 		{
2458 2458
 			$oDB->rollback();
2459 2459
 			return $output;
@@ -2468,23 +2468,23 @@  discard block
 block discarded – undo
2468 2468
 		 */
2469 2469
 		// Delete the entries in member_group_member
2470 2470
 		$output = executeQuery('member.deleteMemberGroupMember', $args);
2471
-		if(!$output->toBool())
2471
+		if (!$output->toBool())
2472 2472
 		{
2473 2473
 			$oDB->rollback();
2474 2474
 			return $output;
2475 2475
 		}
2476 2476
 		// member removed from the table
2477 2477
 		$output = executeQuery('member.deleteMember', $args);
2478
-		if(!$output->toBool())
2478
+		if (!$output->toBool())
2479 2479
 		{
2480 2480
 			$oDB->rollback();
2481 2481
 			return $output;
2482 2482
 		}
2483 2483
 		// Call a trigger (after)
2484
-		if($output->toBool())
2484
+		if ($output->toBool())
2485 2485
 		{
2486 2486
 			$trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj);
2487
-			if(!$trigger_output->toBool())
2487
+			if (!$trigger_output->toBool())
2488 2488
 			{
2489 2489
 				$oDB->rollback();
2490 2490
 				return $trigger_output;
@@ -2508,23 +2508,23 @@  discard block
 block discarded – undo
2508 2508
 	 */
2509 2509
 	function destroySessionInfo()
2510 2510
 	{
2511
-		if(!$_SESSION || !is_array($_SESSION)) return;
2511
+		if (!$_SESSION || !is_array($_SESSION)) return;
2512 2512
 
2513 2513
 		$memberInfo = Context::get('logged_info');
2514 2514
 		$memberSrl = $memberInfo->member_srl;
2515 2515
 
2516
-		foreach($_SESSION as $key => $val)
2516
+		foreach ($_SESSION as $key => $val)
2517 2517
 		{
2518 2518
 			$_SESSION[$key] = '';
2519 2519
 		}
2520 2520
 
2521 2521
 		session_destroy();
2522
-		setcookie(session_name(), '', $_SERVER['REQUEST_TIME']-42000);
2523
-		setcookie('sso','',$_SERVER['REQUEST_TIME']-42000);
2524
-		setcookie('xeak','',$_SERVER['REQUEST_TIME']-42000);
2522
+		setcookie(session_name(), '', $_SERVER['REQUEST_TIME'] - 42000);
2523
+		setcookie('sso', '', $_SERVER['REQUEST_TIME'] - 42000);
2524
+		setcookie('xeak', '', $_SERVER['REQUEST_TIME'] - 42000);
2525 2525
 		setcookie('xe_logged', 'false', $_SERVER['REQUEST_TIME'] - 42000);
2526 2526
 
2527
-		if($memberSrl || $_COOKIE['xeak'])
2527
+		if ($memberSrl || $_COOKIE['xeak'])
2528 2528
 		{
2529 2529
 			$args = new stdClass();
2530 2530
 			$args->member_srl = $memberSrl;
@@ -2540,22 +2540,22 @@  discard block
 block discarded – undo
2540 2540
 		$pointGroup = $pointModuleConfig->point_group;
2541 2541
 
2542 2542
 		$levelGroup = array();
2543
-		if(is_array($pointGroup) && count($pointGroup)>0)
2543
+		if (is_array($pointGroup) && count($pointGroup) > 0)
2544 2544
 		{
2545 2545
 			$levelGroup = array_flip($pointGroup);
2546 2546
 			ksort($levelGroup);
2547 2547
 		}
2548 2548
 		$maxLevel = 0;
2549 2549
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2550
-		if(count($resultGroup) > 0)
2550
+		if (count($resultGroup) > 0)
2551 2551
 			$maxLevel = max(array_flip($resultGroup));
2552 2552
 
2553
-		if($maxLevel > 0)
2553
+		if ($maxLevel > 0)
2554 2554
 		{
2555 2555
 			$oPointModel = getModel('point');
2556 2556
 			$originPoint = $oPointModel->getPoint($memberSrl);
2557 2557
 
2558
-			if($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2558
+			if ($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2559 2559
 			{
2560 2560
 				$oPointController = getController('point');
2561 2561
 				$oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel], 'update');
@@ -2565,18 +2565,18 @@  discard block
 block discarded – undo
2565 2565
 
2566 2566
 	function procMemberModifyEmailAddress()
2567 2567
 	{
2568
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2568
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
2569 2569
 
2570 2570
 		$member_info = Context::get('logged_info');
2571 2571
 		$newEmail = Context::get('email_address');
2572 2572
 
2573
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2573
+		if (!$newEmail) return $this->stop('msg_invalid_request');
2574 2574
 
2575 2575
 		$oMemberModel = getModel('member');
2576 2576
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2577
-		if($member_srl) return new Object(-1,'msg_exists_email_address');
2577
+		if ($member_srl) return new Object(-1, 'msg_exists_email_address');
2578 2578
 
2579
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2579
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2580 2580
 		{
2581 2581
 			return $this->stop('msg_invalid_request');
2582 2582
 		}
@@ -2592,7 +2592,7 @@  discard block
 block discarded – undo
2592 2592
 		$oDB = &DB::getInstance();
2593 2593
 		$oDB->begin();
2594 2594
 		$output = executeQuery('member.insertAuthMail', $auth_args);
2595
-		if(!$output->toBool())
2595
+		if (!$output->toBool())
2596 2596
 		{
2597 2597
 			$oDB->rollback();
2598 2598
 			return $output;
@@ -2602,7 +2602,7 @@  discard block
 block discarded – undo
2602 2602
 		$member_config = $oModuleModel->getModuleConfig('member');
2603 2603
 
2604 2604
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2605
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2605
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2606 2606
 
2607 2607
 		global $lang;
2608 2608
 
@@ -2614,17 +2614,17 @@  discard block
 block discarded – undo
2614 2614
 
2615 2615
 		Context::set('newEmail', $newEmail);
2616 2616
 
2617
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthEmailAddress','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
2617
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
2618 2618
 		Context::set('auth_url', $auth_url);
2619 2619
 
2620 2620
 		$oTemplate = &TemplateHandler::getInstance();
2621 2621
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_new_email');
2622 2622
 
2623 2623
 		$oMail = new Mail();
2624
-		$oMail->setTitle( Context::getLang('title_modify_email_address') );
2624
+		$oMail->setTitle(Context::getLang('title_modify_email_address'));
2625 2625
 		$oMail->setContent($content);
2626
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
2627
-		$oMail->setReceiptor( $member_info->nick_name, $newEmail );
2626
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
2627
+		$oMail->setReceiptor($member_info->nick_name, $newEmail);
2628 2628
 		$result = $oMail->send();
2629 2629
 
2630 2630
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail);
@@ -2638,16 +2638,16 @@  discard block
 block discarded – undo
2638 2638
 	{
2639 2639
 		$member_srl = Context::get('member_srl');
2640 2640
 		$auth_key = Context::get('auth_key');
2641
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2641
+		if (!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2642 2642
 
2643 2643
 		// Test logs for finding password by user_id and authkey
2644 2644
 		$args = new stdClass;
2645 2645
 		$args->member_srl = $member_srl;
2646 2646
 		$args->auth_key = $auth_key;
2647 2647
 		$output = executeQuery('member.getAuthMail', $args);
2648
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2648
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
2649 2649
 		{
2650
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2650
+			if (strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2651 2651
 			return $this->stop('msg_invalid_modify_email_auth_key');
2652 2652
 		}
2653 2653
 
@@ -2656,10 +2656,10 @@  discard block
 block discarded – undo
2656 2656
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2657 2657
 
2658 2658
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2659
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2659
+		if (!$output->toBool()) return $this->stop($output->getMessage());
2660 2660
 
2661 2661
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2662
-		executeQuery('member.deleteAuthChangeEmailAddress',$args);
2662
+		executeQuery('member.deleteAuthChangeEmailAddress', $args);
2663 2663
 
2664 2664
 		$this->_clearMemberCache($args->member_srl);
2665 2665
 
@@ -2677,7 +2677,7 @@  discard block
 block discarded – undo
2677 2677
 	**/
2678 2678
 	function triggerGetDocumentMenu(&$menu_list)
2679 2679
 	{
2680
-		if(!Context::get('is_logged')) return new Object();
2680
+		if (!Context::get('is_logged')) return new Object();
2681 2681
 
2682 2682
 		$logged_info = Context::get('logged_info');
2683 2683
 		$document_srl = Context::get('target_srl');
@@ -2688,12 +2688,12 @@  discard block
 block discarded – undo
2688 2688
 		$member_srl = $oDocument->get('member_srl');
2689 2689
 		$module_srl = $oDocument->get('module_srl');
2690 2690
 
2691
-		if(!$member_srl) return new Object();
2692
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2691
+		if (!$member_srl) return new Object();
2692
+		if ($oDocumentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object();
2693 2693
 
2694 2694
 		$oDocumentController = getController('document');
2695
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2696
-		$oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup');
2695
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2696
+		$oDocumentController->addDocumentPopupMenu($url, 'cmd_spammer', '', 'popup');
2697 2697
 
2698 2698
 		return new Object();
2699 2699
 	}
@@ -2707,7 +2707,7 @@  discard block
 block discarded – undo
2707 2707
 	**/
2708 2708
 	function triggerGetCommentMenu(&$menu_list)
2709 2709
 	{
2710
-		if(!Context::get('is_logged')) return new Object();
2710
+		if (!Context::get('is_logged')) return new Object();
2711 2711
 
2712 2712
 		$logged_info = Context::get('logged_info');
2713 2713
 		$comment_srl = Context::get('target_srl');
@@ -2718,12 +2718,12 @@  discard block
 block discarded – undo
2718 2718
 		$module_srl = $oComment->get('module_srl');
2719 2719
 		$member_srl = $oComment->get('member_srl');
2720 2720
 
2721
-		if(!$member_srl) return new Object();
2722
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2721
+		if (!$member_srl) return new Object();
2722
+		if ($oCommentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object();
2723 2723
 
2724 2724
 		$oCommentController = getController('comment');
2725
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2726
-		$oCommentController->addCommentPopupMenu($url,'cmd_spammer','','popup');
2725
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2726
+		$oCommentController->addCommentPopupMenu($url, 'cmd_spammer', '', 'popup');
2727 2727
 
2728 2728
 		return new Object();
2729 2729
 	}
@@ -2735,7 +2735,7 @@  discard block
 block discarded – undo
2735 2735
 	**/
2736 2736
 	function procMemberSpammerManage()
2737 2737
 	{
2738
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
2738
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
2739 2739
 
2740 2740
 		$logged_info = Context::get('logged_info');
2741 2741
 		$member_srl = Context::get('member_srl');
@@ -2743,7 +2743,7 @@  discard block
 block discarded – undo
2743 2743
 		$cnt_loop = Context::get('cnt_loop');
2744 2744
 		$proc_type = Context::get('proc_type');
2745 2745
 		$isMoveToTrash = true;
2746
-		if($proc_type == "delete")
2746
+		if ($proc_type == "delete")
2747 2747
 			$isMoveToTrash = false;
2748 2748
 
2749 2749
 		// check grant
@@ -2752,7 +2752,7 @@  discard block
 block discarded – undo
2752 2752
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2753 2753
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2754 2754
 
2755
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
2755
+		if (!$grant->manager) return new Object(-1, 'msg_not_permitted');
2756 2756
 
2757 2757
 		$proc_msg = "";
2758 2758
 
@@ -2761,10 +2761,10 @@  discard block
 block discarded – undo
2761 2761
 
2762 2762
 		// delete or trash destination
2763 2763
 		// proc member
2764
-		if($cnt_loop == 1)
2764
+		if ($cnt_loop == 1)
2765 2765
 			$this->_spammerMember($member_srl);
2766 2766
 		// proc document and comment
2767
-		elseif($cnt_loop>1)
2767
+		elseif ($cnt_loop > 1)
2768 2768
 			$this->_spammerDocuments($member_srl, $isMoveToTrash);
2769 2769
 
2770 2770
 		// get destination count
@@ -2773,11 +2773,11 @@  discard block
 block discarded – undo
2773 2773
 
2774 2774
 		$total_count = Context::get('total_count');
2775 2775
 		$remain_count = $cnt_document + $cnt_comment;
2776
-		if($cnt_loop == 1) $total_count = $remain_count;
2776
+		if ($cnt_loop == 1) $total_count = $remain_count;
2777 2777
 
2778 2778
 		// get progress percent
2779
-		if($total_count > 0)
2780
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2779
+		if ($total_count > 0)
2780
+			$progress = intval((($total_count - $remain_count) / $total_count) * 100);
2781 2781
 		else
2782 2782
 			$progress = 100;
2783 2783
 
@@ -2801,7 +2801,7 @@  discard block
 block discarded – undo
2801 2801
 	**/
2802 2802
 	private function _spammerMember($member_srl) {
2803 2803
 		$logged_info = Context::get('logged_info');
2804
-		$spam_description = trim( Context::get('spam_description') );
2804
+		$spam_description = trim(Context::get('spam_description'));
2805 2805
 
2806 2806
 		$oMemberModel = getModel('member');
2807 2807
 		$columnList = array('member_srl', 'email_address', 'user_id', 'nick_name', 'description');
@@ -2820,10 +2820,10 @@  discard block
 block discarded – undo
2820 2820
 		$args->user_id = $member_info->user_id;
2821 2821
 		$args->nick_name = $member_info->nick_name;
2822 2822
 		$args->denied = "Y";
2823
-		$args->description = trim( $member_info->description );
2824
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
2823
+		$args->description = trim($member_info->description);
2824
+		if ($args->description != "") $args->description .= "\n"; // add new line
2825 2825
 
2826
-		$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 . "]";
2826
+		$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."]";
2827 2827
 
2828 2828
 		$output = $this->updateMember($args, true);
2829 2829
 
@@ -2852,21 +2852,21 @@  discard block
 block discarded – undo
2852 2852
 		// 1. proc comment, 2. proc document
2853 2853
 		$cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl);
2854 2854
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
2855
-		if($cnt_comment > 0)
2855
+		if ($cnt_comment > 0)
2856 2856
 		{
2857 2857
 			$columnList = array();
2858 2858
 			$commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2859
-			if($commentList) {
2860
-				foreach($commentList as $v) {
2859
+			if ($commentList) {
2860
+				foreach ($commentList as $v) {
2861 2861
 					$oCommentController->deleteComment($v->comment_srl, true, $isMoveToTrash);
2862 2862
 				}
2863 2863
 			}
2864
-		} elseif($cnt_document > 0) {
2864
+		} elseif ($cnt_document > 0) {
2865 2865
 			$columnList = array();
2866 2866
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2867
-			if($documentList) {
2868
-				foreach($documentList as $v) {
2869
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2867
+			if ($documentList) {
2868
+				foreach ($documentList as $v) {
2869
+					if ($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2870 2870
 					else $oDocumentController->deleteDocument($v->document_srl);
2871 2871
 				}
2872 2872
 			}
@@ -2878,24 +2878,24 @@  discard block
 block discarded – undo
2878 2878
 	function _clearMemberCache($member_srl, $site_srl = 0)
2879 2879
 	{
2880 2880
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
2881
-		if($oCacheHandler->isSupport())
2881
+		if ($oCacheHandler->isSupport())
2882 2882
 		{
2883
-			$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_' . $site_srl;
2883
+			$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl;
2884 2884
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2885 2885
 			$oCacheHandler->delete($cache_key);
2886 2886
 
2887
-			if($site_srl !== 0)
2887
+			if ($site_srl !== 0)
2888 2888
 			{
2889
-				$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0';
2889
+				$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_0';
2890 2890
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2891 2891
 				$oCacheHandler->delete($cache_key);
2892 2892
 			}
2893 2893
 		}
2894 2894
 
2895 2895
 		$oCacheHandler = CacheHandler::getInstance('object');
2896
-		if($oCacheHandler->isSupport())
2896
+		if ($oCacheHandler->isSupport())
2897 2897
 		{
2898
-			$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
2898
+			$object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl;
2899 2899
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2900 2900
 			$oCacheHandler->delete($cache_key);
2901 2901
 		}
Please login to merge, or discard this patch.
Braces   +591 added lines, -254 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 Object(-1,'null_user_id');
53
-		if(!$password) return new Object(-1,'null_password');
58
+		if(!$user_id) {
59
+			return new Object(-1,'null_user_id');
60
+		}
61
+		if(!$password) {
62
+			return new Object(-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 Object();
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 Object(-1, 'msg_not_logged');
146
+		if(!Context::get('is_logged')) {
147
+			return new Object(-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 Object(-1,'msg_invalid_request');
152
+		if(!$document_srl) {
153
+			$document_srl = (int)Context::get('target_srl');
154
+		}
155
+		if(!$document_srl) {
156
+			return new Object(-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 Object(-1, 'msg_alreay_scrapped');
205
+		if($output->data->count) {
206
+			return new Object(-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 Object(-1, 'msg_not_logged');
227
+		if(!Context::get('is_logged')) {
228
+			return new Object(-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 Object(-1,'msg_invalid_request');
233
+		if(!$document_srl) {
234
+			return new Object(-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 Object(-1, 'msg_not_logged');
261
+		if(!Context::get('is_logged')) {
262
+			return new Object(-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 Object(-1,'msg_invalid_request');
267
+		if(!$document_srl) {
268
+			return new Object(-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 Object(0,'denied_user_id');
310
+				if($oMemberModel->isDeniedID($value)) {
311
+					return new Object(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 Object(0,'msg_exists_user_id');
315
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
316
+					return new Object(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 Object(0,'msg_exists_nick_name');
327
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
328
+					return new Object(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 Object(0,'msg_exists_email_address');
335
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
336
+					return new Object(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 Object (-1, "msg_invalid_request");
349
+		if (Context::getRequestMethod () == "GET") {
350
+			return new Object (-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 Object(-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
 				setcookie("XE_REDIRECT_URL", '', 1);
@@ -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 Object(-1, 'invalid_password');
745
+		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) {
746
+			return new Object(-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 Object(-1, 'invalid_new_password');
750
+		if($current_password == $password) {
751
+			return new Object(-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 Object(-1, 'invalid_password');
795
+		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) {
796
+			return new Object(-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,17 +818,25 @@  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
 		$oModuleModel = getModel('module');
744 836
 		$config = $oModuleModel->getModuleConfig('member');
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
 		$this->insertProfileImage($member_srl, $file['tmp_name']);
748 842
 		// Page refresh
@@ -764,26 +858,35 @@  discard block
 block discarded – undo
764 858
 	{
765 859
 
766 860
 		// Check uploaded file
767
-		if(!checkUploadedFile($target_file)) return;
861
+		if(!checkUploadedFile($target_file)) {
862
+			return;
863
+		}
768 864
 
769 865
 		$oMemberModel = getModel('member');
770 866
 		$config = $oMemberModel->getMemberConfig();
771 867
 
772 868
 		// Get an image size
773 869
 		$max_width = $config->profile_image_max_width;
774
-		if(!$max_width) $max_width = "90";
870
+		if(!$max_width) {
871
+			$max_width = "90";
872
+		}
775 873
 		$max_height = $config->profile_image_max_height;
776
-		if(!$max_height) $max_height = "90";
874
+		if(!$max_height) {
875
+			$max_height = "90";
876
+		}
777 877
 		// Get a target path to save
778 878
 		$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
779 879
 		FileHandler::makeDir($target_path);
780 880
 
781 881
 		// Get file information
782 882
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
783
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
784
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
785
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
786
-		else
883
+		if(IMAGETYPE_PNG == $type) {
884
+			$ext = 'png';
885
+		} elseif(IMAGETYPE_JPEG == $type) {
886
+			$ext = 'jpg';
887
+		} elseif(IMAGETYPE_GIF == $type) {
888
+			$ext = 'gif';
889
+		} else
787 890
 		{
788 891
 			return;
789 892
 		}
@@ -795,8 +898,7 @@  discard block
 block discarded – undo
795 898
 		if(($width > $max_width || $height > $max_height ) && $type != 1)
796 899
 		{
797 900
 			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
798
-		}
799
-		else
901
+		} else
800 902
 		{
801 903
 			@copy($target_file, $target_filename);
802 904
 		}
@@ -811,17 +913,25 @@  discard block
 block discarded – undo
811 913
 	{
812 914
 		// Check if the file is successfully uploaded
813 915
 		$file = $_FILES['image_name'];
814
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
916
+		if(!is_uploaded_file($file['tmp_name'])) {
917
+			return $this->stop('msg_not_uploaded_image_name');
918
+		}
815 919
 		// Ignore if member_srl is invalid or doesn't exist.
816 920
 		$member_srl = Context::get('member_srl');
817
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
921
+		if(!$member_srl) {
922
+			return $this->stop('msg_not_uploaded_image_name');
923
+		}
818 924
 
819 925
 		$logged_info = Context::get('logged_info');
820
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
926
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
927
+			return $this->stop('msg_not_uploaded_image_name');
928
+		}
821 929
 		// Return if member module is set not to use an image name or the user is not an administrator ;
822 930
 		$oModuleModel = getModel('module');
823 931
 		$config = $oModuleModel->getModuleConfig('member');
824
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
932
+		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') {
933
+			return $this->stop('msg_not_uploaded_image_name');
934
+		}
825 935
 
826 936
 		$this->insertImageName($member_srl, $file['tmp_name']);
827 937
 		// Page refresh
@@ -842,15 +952,21 @@  discard block
 block discarded – undo
842 952
 	function insertImageName($member_srl, $target_file)
843 953
 	{
844 954
 		// Check uploaded file
845
-		if(!checkUploadedFile($target_file)) return;
955
+		if(!checkUploadedFile($target_file)) {
956
+			return;
957
+		}
846 958
 
847 959
 		$oModuleModel = getModel('module');
848 960
 		$config = $oModuleModel->getModuleConfig('member');
849 961
 		// Get an image size
850 962
 		$max_width = $config->image_name_max_width;
851
-		if(!$max_width) $max_width = "90";
963
+		if(!$max_width) {
964
+			$max_width = "90";
965
+		}
852 966
 		$max_height = $config->image_name_max_height;
853
-		if(!$max_height) $max_height = "20";
967
+		if(!$max_height) {
968
+			$max_height = "20";
969
+		}
854 970
 		// Get a target path to save
855 971
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
856 972
 		FileHandler::makeDir($target_path);
@@ -859,8 +975,11 @@  discard block
 block discarded – undo
859 975
 		// Get file information
860 976
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
861 977
 		// Convert if the image size is larger than a given size or if the format is not a gif
862
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
863
-		else @copy($target_file, $target_filename);
978
+		if($width > $max_width || $height > $max_height || $type!=1) {
979
+			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
980
+		} else {
981
+			@copy($target_file, $target_filename);
982
+		}
864 983
 	}
865 984
 
866 985
 	/**
@@ -920,17 +1039,25 @@  discard block
 block discarded – undo
920 1039
 	{
921 1040
 		// Check if the file is successfully uploaded
922 1041
 		$file = $_FILES['image_mark'];
923
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
1042
+		if(!is_uploaded_file($file['tmp_name'])) {
1043
+			return $this->stop('msg_not_uploaded_image_mark');
1044
+		}
924 1045
 		// Ignore if member_srl is invalid or doesn't exist.
925 1046
 		$member_srl = Context::get('member_srl');
926
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
1047
+		if(!$member_srl) {
1048
+			return $this->stop('msg_not_uploaded_image_mark');
1049
+		}
927 1050
 
928 1051
 		$logged_info = Context::get('logged_info');
929
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
1052
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
1053
+			return $this->stop('msg_not_uploaded_image_mark');
1054
+		}
930 1055
 		// Membership in the images mark the module using the ban was set by an administrator or return;
931 1056
 		$oModuleModel = getModel('module');
932 1057
 		$config = $oModuleModel->getModuleConfig('member');
933
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
1058
+		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') {
1059
+			return $this->stop('msg_not_uploaded_image_mark');
1060
+		}
934 1061
 
935 1062
 		$this->insertImageMark($member_srl, $file['tmp_name']);
936 1063
 		// Page refresh
@@ -951,15 +1078,21 @@  discard block
 block discarded – undo
951 1078
 	function insertImageMark($member_srl, $target_file)
952 1079
 	{
953 1080
 		// Check uploaded file
954
-		if(!checkUploadedFile($target_file)) return;
1081
+		if(!checkUploadedFile($target_file)) {
1082
+			return;
1083
+		}
955 1084
 
956 1085
 		$oModuleModel = getModel('module');
957 1086
 		$config = $oModuleModel->getModuleConfig('member');
958 1087
 		// Get an image size
959 1088
 		$max_width = $config->image_mark_max_width;
960
-		if(!$max_width) $max_width = "20";
1089
+		if(!$max_width) {
1090
+			$max_width = "20";
1091
+		}
961 1092
 		$max_height = $config->image_mark_max_height;
962
-		if(!$max_height) $max_height = "20";
1093
+		if(!$max_height) {
1094
+			$max_height = "20";
1095
+		}
963 1096
 
964 1097
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
965 1098
 		FileHandler::makeDir($target_path);
@@ -968,8 +1101,11 @@  discard block
 block discarded – undo
968 1101
 		// Get file information
969 1102
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
970 1103
 
971
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
972
-		else @copy($target_file, $target_filename);
1104
+		if($width > $max_width || $height > $max_height || $type!=1) {
1105
+			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
1106
+		} else {
1107
+			@copy($target_file, $target_filename);
1108
+		}
973 1109
 	}
974 1110
 
975 1111
 	/**
@@ -1004,14 +1140,18 @@  discard block
 block discarded – undo
1004 1140
 	function procMemberFindAccount()
1005 1141
 	{
1006 1142
 		$email_address = Context::get('email_address');
1007
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1143
+		if(!$email_address) {
1144
+			return new Object(-1, 'msg_invalid_request');
1145
+		}
1008 1146
 
1009 1147
 		$oMemberModel = getModel('member');
1010 1148
 		$oModuleModel = getModel('module');
1011 1149
 
1012 1150
 		// Check if a member having the same email address exists
1013 1151
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1014
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1152
+		if(!$member_srl) {
1153
+			return new Object(-1, 'msg_email_not_exists');
1154
+		}
1015 1155
 
1016 1156
 		// Get information of the member
1017 1157
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
@@ -1023,7 +1163,9 @@  discard block
 block discarded – undo
1023 1163
 			$chk_args = new stdClass;
1024 1164
 			$chk_args->member_srl = $member_info->member_srl;
1025 1165
 			$output = executeQuery('member.chkAuthMail', $chk_args);
1026
-			if($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
1166
+			if($output->toBool() && $output->data->count != '0') {
1167
+				return new Object(-1, 'msg_user_not_confirmed');
1168
+			}
1027 1169
 		}
1028 1170
 
1029 1171
 		// Insert data into the authentication DB
@@ -1036,7 +1178,9 @@  discard block
 block discarded – undo
1036 1178
 		$args->is_register = 'N';
1037 1179
 
1038 1180
 		$output = executeQuery('member.insertAuthMail', $args);
1039
-		if(!$output->toBool()) return $output;
1181
+		if(!$output->toBool()) {
1182
+			return $output;
1183
+		}
1040 1184
 		// Get content of the email to send a member
1041 1185
 		Context::set('auth_args', $args);
1042 1186
 
@@ -1053,8 +1197,7 @@  discard block
 block discarded – undo
1053 1197
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1054 1198
 				}
1055 1199
 			}
1056
-		}
1057
-		else
1200
+		} else
1058 1201
 		{
1059 1202
 			$memberInfo[$lang->user_id] = $args->user_id;
1060 1203
 			$memberInfo[$lang->user_name] = $args->user_name;
@@ -1063,13 +1206,19 @@  discard block
 block discarded – undo
1063 1206
 		}
1064 1207
 		Context::set('memberInfo', $memberInfo);
1065 1208
 
1066
-		if(!$member_config->skin) $member_config->skin = "default";
1067
-		if(!$member_config->colorset) $member_config->colorset = "white";
1209
+		if(!$member_config->skin) {
1210
+			$member_config->skin = "default";
1211
+		}
1212
+		if(!$member_config->colorset) {
1213
+			$member_config->colorset = "white";
1214
+		}
1068 1215
 
1069 1216
 		Context::set('member_config', $member_config);
1070 1217
 
1071 1218
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1072
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1219
+		if(!is_dir($tpl_path)) {
1220
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1221
+		}
1073 1222
 
1074 1223
 		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1075 1224
 		Context::set('find_url', $find_url);
@@ -1112,19 +1261,25 @@  discard block
 block discarded – undo
1112 1261
 		$find_account_question = trim(Context::get('find_account_question'));
1113 1262
 		$find_account_answer = trim(Context::get('find_account_answer'));
1114 1263
 
1115
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1264
+		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) {
1265
+			return new Object(-1, 'msg_invalid_request');
1266
+		}
1116 1267
 
1117 1268
 		$oModuleModel = getModel('module');
1118 1269
 		// Check if a member having the same email address exists
1119 1270
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1120
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1271
+		if(!$member_srl) {
1272
+			return new Object(-1, 'msg_email_not_exists');
1273
+		}
1121 1274
 
1122 1275
 		// Get information of the member
1123 1276
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1124 1277
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1125 1278
 
1126 1279
 		// Display a message if no answer is entered
1127
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1280
+		if(!$member_info->find_account_question || !$member_info->find_account_answer) {
1281
+			return new Object(-1, 'msg_question_not_exists');
1282
+		}
1128 1283
 
1129 1284
 		// 답변 확인
1130 1285
 		$hashed = $oPassword->checkAlgorithm($member_info->find_account_answer);
@@ -1133,12 +1288,10 @@  discard block
 block discarded – undo
1133 1288
 		if($member_info->find_account_question != $find_account_question)
1134 1289
 		{
1135 1290
 			$authed = false;
1136
-		}
1137
-		else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1291
+		} else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1138 1292
 		{
1139 1293
 			$authed = false;
1140
-		}
1141
-		else if(!$hashed && $find_account_answer != $member_info->find_account_answer)
1294
+		} else if(!$hashed && $find_account_answer != $member_info->find_account_answer)
1142 1295
 		{
1143 1296
 			$authed = false;
1144 1297
 		}
@@ -1167,7 +1320,9 @@  discard block
 block discarded – undo
1167 1320
 		$args->password = $temp_password;
1168 1321
 		$args->change_password_date = '1';
1169 1322
 		$output = $this->updateMemberPassword($args);
1170
-		if(!$output->toBool()) return $output;
1323
+		if(!$output->toBool()) {
1324
+			return $output;
1325
+		}
1171 1326
 
1172 1327
 		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1173 1328
 
@@ -1224,8 +1379,7 @@  discard block
 block discarded – undo
1224 1379
 		if($output->data->is_register == 'Y')
1225 1380
 		{
1226 1381
 			$args->denied = 'N';
1227
-		}
1228
-		else
1382
+		} else
1229 1383
 		{
1230 1384
 			$args->password = $oMemberModel->hashPassword($args->password);
1231 1385
 		}
@@ -1259,33 +1413,45 @@  discard block
 block discarded – undo
1259 1413
 	{
1260 1414
 		// Get an email_address
1261 1415
 		$email_address = Context::get('email_address');
1262
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1416
+		if(!$email_address) {
1417
+			return new Object(-1, 'msg_invalid_request');
1418
+		}
1263 1419
 		// Log test by using email_address
1264 1420
 		$oMemberModel = getModel('member');
1265 1421
 
1266 1422
 		$args = new stdClass;
1267 1423
 		$args->email_address = $email_address;
1268 1424
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1269
-		if(!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1425
+		if(!$memberSrl) {
1426
+			return new Object(-1, 'msg_not_exists_member');
1427
+		}
1270 1428
 
1271 1429
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1272 1430
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1273 1431
 
1274 1432
 		$oModuleModel = getModel('module');
1275 1433
 		$member_config = $oModuleModel->getModuleConfig('member');
1276
-		if(!$member_config->skin) $member_config->skin = "default";
1277
-		if(!$member_config->colorset) $member_config->colorset = "white";
1434
+		if(!$member_config->skin) {
1435
+			$member_config->skin = "default";
1436
+		}
1437
+		if(!$member_config->colorset) {
1438
+			$member_config->colorset = "white";
1439
+		}
1278 1440
 
1279 1441
 		// Check if a authentication mail has been sent previously
1280 1442
 		$chk_args = new stdClass;
1281 1443
 		$chk_args->member_srl = $member_info->member_srl;
1282 1444
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1283
-		if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1445
+		if($output->toBool() && $output->data->count == '0') {
1446
+			return new Object(-1, 'msg_invalid_request');
1447
+		}
1284 1448
 
1285 1449
 		$auth_args = new stdClass;
1286 1450
 		$auth_args->member_srl = $member_info->member_srl;
1287 1451
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1288
-		if(!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1452
+		if(!$output->data || !$output->data[0]->auth_key) {
1453
+			return new Object(-1, 'msg_invalid_request');
1454
+		}
1289 1455
 		$auth_info = $output->data[0];
1290 1456
 
1291 1457
 		// Update the regdate of authmail entry
@@ -1306,8 +1472,7 @@  discard block
 block discarded – undo
1306 1472
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1307 1473
 				}
1308 1474
 			}
1309
-		}
1310
-		else
1475
+		} else
1311 1476
 		{
1312 1477
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1313 1478
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1320,7 +1485,9 @@  discard block
 block discarded – undo
1320 1485
 		Context::set('member_config', $member_config);
1321 1486
 
1322 1487
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1323
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1488
+		if(!is_dir($tpl_path)) {
1489
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1490
+		}
1324 1491
 
1325 1492
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1326 1493
 		Context::set('auth_url', $auth_url);
@@ -1398,7 +1565,9 @@  discard block
 block discarded – undo
1398 1565
 		$auth_args->is_register = 'Y';
1399 1566
 
1400 1567
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1401
-		if(!$output->toBool()) return $output;
1568
+		if(!$output->toBool()) {
1569
+			return $output;
1570
+		}
1402 1571
 
1403 1572
 		$memberInfo->email_address = $newEmail;
1404 1573
 
@@ -1432,8 +1601,7 @@  discard block
 block discarded – undo
1432 1601
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1433 1602
 				}
1434 1603
 			}
1435
-		}
1436
-		else
1604
+		} else
1437 1605
 		{
1438 1606
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1439 1607
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1442,13 +1610,19 @@  discard block
 block discarded – undo
1442 1610
 		}
1443 1611
 		Context::set('memberInfo', $memberInfo);
1444 1612
 
1445
-		if(!$member_config->skin) $member_config->skin = "default";
1446
-		if(!$member_config->colorset) $member_config->colorset = "white";
1613
+		if(!$member_config->skin) {
1614
+			$member_config->skin = "default";
1615
+		}
1616
+		if(!$member_config->colorset) {
1617
+			$member_config->colorset = "white";
1618
+		}
1447 1619
 
1448 1620
 		Context::set('member_config', $member_config);
1449 1621
 
1450 1622
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1451
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1623
+		if(!is_dir($tpl_path)) {
1624
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1625
+		}
1452 1626
 
1453 1627
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1454 1628
 		Context::set('auth_url', $auth_url);
@@ -1473,7 +1647,9 @@  discard block
 block discarded – undo
1473 1647
 	{
1474 1648
 		$site_module_info = Context::get('site_module_info');
1475 1649
 		$logged_info = Context::get('logged_info');
1476
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1650
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1651
+			return new Object(-1,'msg_invalid_request');
1652
+		}
1477 1653
 
1478 1654
 		$oMemberModel = getModel('member');
1479 1655
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1492,13 +1668,17 @@  discard block
 block discarded – undo
1492 1668
 	{
1493 1669
 		$site_module_info = Context::get('site_module_info');
1494 1670
 		$logged_info = Context::get('logged_info');
1495
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1671
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1672
+			return new Object(-1,'msg_invalid_request');
1673
+		}
1496 1674
 
1497 1675
 		$args = new stdClass;
1498 1676
 		$args->site_srl= $site_module_info->site_srl;
1499 1677
 		$args->member_srl = $logged_info->member_srl;
1500 1678
 		$output = executeQuery('member.deleteMembersGroup', $args);
1501
-		if(!$output->toBool()) return $output;
1679
+		if(!$output->toBool()) {
1680
+			return $output;
1681
+		}
1502 1682
 		$this->setMessage('success_deleted');
1503 1683
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1504 1684
 	}
@@ -1512,17 +1692,37 @@  discard block
 block discarded – undo
1512 1692
 	 */
1513 1693
 	function setMemberConfig($args)
1514 1694
 	{
1515
-		if(!$args->skin) $args->skin = "default";
1516
-		if(!$args->colorset) $args->colorset = "white";
1517
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1518
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1519
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1695
+		if(!$args->skin) {
1696
+			$args->skin = "default";
1697
+		}
1698
+		if(!$args->colorset) {
1699
+			$args->colorset = "white";
1700
+		}
1701
+		if(!$args->editor_skin) {
1702
+			$args->editor_skin= "ckeditor";
1703
+		}
1704
+		if(!$args->editor_colorset) {
1705
+			$args->editor_colorset = "moono";
1706
+		}
1707
+		if($args->enable_join!='Y') {
1708
+			$args->enable_join = 'N';
1709
+		}
1520 1710
 		$args->enable_openid= 'N';
1521
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1522
-		if($args->image_name!='Y') $args->image_name = 'N';
1523
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1524
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1525
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1711
+		if($args->profile_image !='Y') {
1712
+			$args->profile_image = 'N';
1713
+		}
1714
+		if($args->image_name!='Y') {
1715
+			$args->image_name = 'N';
1716
+		}
1717
+		if($args->image_mark!='Y') {
1718
+			$args->image_mark = 'N';
1719
+		}
1720
+		if($args->group_image_mark!='Y') {
1721
+			$args->group_image_mark = 'N';
1722
+		}
1723
+		if(!trim(strip_tags($args->agreement))) {
1724
+			$args->agreement = null;
1725
+		}
1526 1726
 		$args->limit_day = (int)$args->limit_day;
1527 1727
 
1528 1728
 		$agreement = trim($args->agreement);
@@ -1530,7 +1730,9 @@  discard block
 block discarded – undo
1530 1730
 
1531 1731
 		$oModuleController = getController('module');
1532 1732
 		$output = $oModuleController->insertModuleConfig('member',$args);
1533
-		if(!$output->toBool()) return $output;
1733
+		if(!$output->toBool()) {
1734
+			return $output;
1735
+		}
1534 1736
 
1535 1737
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1536 1738
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1555,7 +1757,9 @@  discard block
 block discarded – undo
1555 1757
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1556 1758
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1557 1759
 
1558
-		if(!$check_signature) return FileHandler::removeFile($filename);
1760
+		if(!$check_signature) {
1761
+			return FileHandler::removeFile($filename);
1762
+		}
1559 1763
 
1560 1764
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1561 1765
 		FileHandler::makeDir($path);
@@ -1589,7 +1793,9 @@  discard block
 block discarded – undo
1589 1793
 		$args = new stdClass();
1590 1794
 		$args->member_srl = $member_srl;
1591 1795
 		$args->group_srl = $group_srl;
1592
-		if($site_srl) $args->site_srl = $site_srl;
1796
+		if($site_srl) {
1797
+			$args->site_srl = $site_srl;
1798
+		}
1593 1799
 
1594 1800
 		// Add
1595 1801
 		$output = executeQuery('member.addMemberToGroup',$args);
@@ -1615,15 +1821,21 @@  discard block
 block discarded – undo
1615 1821
 		$obj->member_srl = implode(',',$args->member_srl);
1616 1822
 
1617 1823
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1618
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1824
+		if($output->data) {
1825
+			foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1826
+		}
1619 1827
 
1620 1828
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1621
-		if(!$output->toBool()) return $output;
1829
+		if(!$output->toBool()) {
1830
+			return $output;
1831
+		}
1622 1832
 
1623 1833
 		$inserted_members = array();
1624 1834
 		foreach($args->member_srl as $key => $val)
1625 1835
 		{
1626
-			if($inserted_members[$val]) continue;
1836
+			if($inserted_members[$val]) {
1837
+				continue;
1838
+			}
1627 1839
 			$inserted_members[$val] = true;
1628 1840
 
1629 1841
 			unset($obj);
@@ -1633,7 +1845,9 @@  discard block
 block discarded – undo
1633 1845
 			$obj->site_srl = $args->site_srl;
1634 1846
 			$obj->regdate = $date[$obj->member_srl];
1635 1847
 			$output = executeQuery('member.addMemberToGroup', $obj);
1636
-			if(!$output->toBool()) return $output;
1848
+			if(!$output->toBool()) {
1849
+				return $output;
1850
+			}
1637 1851
 
1638 1852
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1639 1853
 		}
@@ -1695,8 +1909,7 @@  discard block
 block discarded – undo
1695 1909
 				if($config->identifier == 'user_id')
1696 1910
 				{
1697 1911
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1698
-				}
1699
-				else
1912
+				} else
1700 1913
 				{
1701 1914
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1702 1915
 				}
@@ -1705,8 +1918,7 @@  discard block
 block discarded – undo
1705 1918
 					$do_auto_login = true;
1706 1919
 				}
1707 1920
 
1708
-			}
1709
-			else
1921
+			} else
1710 1922
 			{
1711 1923
 				$do_auto_login = true;
1712 1924
 			}
@@ -1715,8 +1927,7 @@  discard block
 block discarded – undo
1715 1927
 		if($do_auto_login)
1716 1928
 		{
1717 1929
 			$output = $this->doLogin($user_id);
1718
-		}
1719
-		else
1930
+		} else
1720 1931
 		{
1721 1932
 			executeQuery('member.deleteAutologin', $args);
1722 1933
 			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
@@ -1735,13 +1946,17 @@  discard block
 block discarded – undo
1735 1946
 	function doLogin($user_id, $password = '', $keep_signed = false)
1736 1947
 	{
1737 1948
 		$user_id = strtolower($user_id);
1738
-		if(!$user_id) return new Object(-1, 'null_user_id');
1949
+		if(!$user_id) {
1950
+			return new Object(-1, 'null_user_id');
1951
+		}
1739 1952
 		// Call a trigger before log-in (before)
1740 1953
 		$trigger_obj = new stdClass();
1741 1954
 		$trigger_obj->user_id = $user_id;
1742 1955
 		$trigger_obj->password = $password;
1743 1956
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1744
-		if(!$trigger_output->toBool()) return $trigger_output;
1957
+		if(!$trigger_output->toBool()) {
1958
+			return $trigger_output;
1959
+		}
1745 1960
 		// Create a member model object
1746 1961
 		$oMemberModel = getModel('member');
1747 1962
 
@@ -1756,15 +1971,18 @@  discard block
 block discarded – undo
1756 1971
 			// Get user_id information
1757 1972
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1758 1973
 			// Set an invalid user if no value returned
1759
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1974
+			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) {
1975
+				return $this->recordLoginError(-1, 'invalid_email_address');
1976
+			}
1760 1977
 
1761
-		}
1762
-		else
1978
+		} else
1763 1979
 		{
1764 1980
 			// Get user_id information
1765 1981
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1766 1982
 			// Set an invalid user if no value returned
1767
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1983
+			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) {
1984
+				return $this->recordLoginError(-1, 'invalid_user_id');
1985
+			}
1768 1986
 		}
1769 1987
 
1770 1988
 		$output = executeQuery('member.getLoginCountByIp', $args);
@@ -1776,14 +1994,18 @@  discard block
 block discarded – undo
1776 1994
 			if($term < $config->max_error_count_time)
1777 1995
 			{
1778 1996
 				$term = $config->max_error_count_time - $term;
1779
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1780
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1781
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1782
-				else $term = intval($term/86400).Context::getLang('unit_day');
1997
+				if($term < 60) {
1998
+					$term = intval($term).Context::getLang('unit_sec');
1999
+				} elseif(60 <= $term && $term < 3600) {
2000
+					$term = intval($term/60).Context::getLang('unit_min');
2001
+				} elseif(3600 <= $term && $term < 86400) {
2002
+					$term = intval($term/3600).Context::getLang('unit_hour');
2003
+				} else {
2004
+					$term = intval($term/86400).Context::getLang('unit_day');
2005
+				}
1783 2006
 
1784 2007
 				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1785
-			}
1786
-			else
2008
+			} else
1787 2009
 			{
1788 2010
 				$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1789 2011
 				$output = executeQuery('member.deleteLoginCountByIp', $args);
@@ -1810,7 +2032,9 @@  discard block
 block discarded – undo
1810 2032
 			return new Object(-1,'msg_user_denied');
1811 2033
 		}
1812 2034
 		// Notify if denied_date is less than the current time
1813
-		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
2035
+		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) {
2036
+			return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
2037
+		}
1814 2038
 		// Update the latest login time
1815 2039
 		$args->member_srl = $this->memberInfo->member_srl;
1816 2040
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1859,7 +2083,9 @@  discard block
 block discarded – undo
1859 2083
 		}
1860 2084
 		// Call a trigger after successfully log-in (after)
1861 2085
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1862
-		if(!$trigger_output->toBool()) return $trigger_output;
2086
+		if(!$trigger_output->toBool()) {
2087
+			return $trigger_output;
2088
+		}
1863 2089
 		// When user checked to use auto-login
1864 2090
 		if($keep_signed)
1865 2091
 		{
@@ -1873,7 +2099,9 @@  discard block
 block discarded – undo
1873 2099
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1874 2100
 			executeQuery('member.deleteAutologin', $autologin_args);
1875 2101
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1876
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000);
2102
+			if($autologin_output->toBool()) {
2103
+				setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000);
2104
+			}
1877 2105
 		}
1878 2106
 		if($this->memberInfo->is_admin == 'Y')
1879 2107
 		{
@@ -1962,7 +2190,9 @@  discard block
 block discarded – undo
1962 2190
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
1963 2191
 	{
1964 2192
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
1965
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
2193
+		if(!is_array($member_popup_menu_list)) {
2194
+			$member_popup_menu_list = array();
2195
+		}
1966 2196
 
1967 2197
 		$obj = new stdClass;
1968 2198
 		$obj->url = $url;
@@ -1981,35 +2211,54 @@  discard block
 block discarded – undo
1981 2211
 	{
1982 2212
 		// Call a trigger (before)
1983 2213
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
1984
-		if(!$output->toBool()) return $output;
2214
+		if(!$output->toBool()) {
2215
+			return $output;
2216
+		}
1985 2217
 		// Terms and Conditions portion of the information set up by members reaffirmed
1986 2218
 		$oModuleModel = getModel('module');
1987 2219
 		$config = $oModuleModel->getModuleConfig('member');
1988 2220
 
1989 2221
 		$logged_info = Context::get('logged_info');
1990 2222
 		// If the date of the temporary restrictions limit further information on the date of
1991
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2223
+		if($config->limit_day) {
2224
+			$args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2225
+		}
1992 2226
 
1993 2227
 		$args->member_srl = getNextSequence();
1994 2228
 		$args->list_order = -1 * $args->member_srl;
1995 2229
 
1996 2230
 		// Execute insert or update depending on the value of member_srl
1997
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2231
+		if(!$args->user_id) {
2232
+			$args->user_id = 't'.$args->member_srl;
2233
+		}
1998 2234
 		// Enter the user's identity changed to lowercase
1999
-		else $args->user_id = strtolower($args->user_id);
2000
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2001
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
2235
+		else {
2236
+			$args->user_id = strtolower($args->user_id);
2237
+		}
2238
+		if(!$args->user_name) {
2239
+			$args->user_name = $args->member_srl;
2240
+		}
2241
+		if(!$args->nick_name) {
2242
+			$args->nick_name = $args->member_srl;
2243
+		}
2002 2244
 
2003 2245
 		// Control of essential parameters
2004
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2005
-		if($args->denied!='Y') $args->denied = 'N';
2006
-		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y';
2246
+		if($args->allow_mailing!='Y') {
2247
+			$args->allow_mailing = 'N';
2248
+		}
2249
+		if($args->denied!='Y') {
2250
+			$args->denied = 'N';
2251
+		}
2252
+		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) {
2253
+			$args->allow_message = 'Y';
2254
+		}
2007 2255
 
2008 2256
 		if($logged_info->is_admin == 'Y')
2009 2257
 		{
2010
-			if($args->is_admin!='Y') $args->is_admin = 'N';
2011
-		}
2012
-		else
2258
+			if($args->is_admin!='Y') {
2259
+				$args->is_admin = 'N';
2260
+			}
2261
+		} else
2013 2262
 		{
2014 2263
 			unset($args->is_admin);
2015 2264
 		}
@@ -2022,8 +2271,12 @@  discard block
 block discarded – undo
2022 2271
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2023 2272
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2024 2273
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2025
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2026
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
2274
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) {
2275
+			$args->homepage = 'http://'.$args->homepage;
2276
+		}
2277
+		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) {
2278
+			$args->blog = 'http://'.$args->blog;
2279
+		}
2027 2280
 
2028 2281
 		// Create a model object
2029 2282
 		$oMemberModel = getModel('member');
@@ -2037,8 +2290,7 @@  discard block
 block discarded – undo
2037 2290
 				return new Object(-1, $message[$config->password_strength]);
2038 2291
 			}
2039 2292
 			$args->password = $oMemberModel->hashPassword($args->password);
2040
-		}
2041
-		elseif(!$args->password)
2293
+		} elseif(!$args->password)
2042 2294
 		{
2043 2295
 			unset($args->password);
2044 2296
 		}
@@ -2046,8 +2298,7 @@  discard block
 block discarded – undo
2046 2298
 		if($args->find_account_answer && !$password_is_hashed)
2047 2299
 		{
2048 2300
 			$args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer);
2049
-		}
2050
-		elseif(!$args->find_account_answer)
2301
+		} elseif(!$args->find_account_answer)
2051 2302
 		{
2052 2303
 			unset($args->find_account_answer);
2053 2304
 		}
@@ -2088,8 +2339,12 @@  discard block
 block discarded – undo
2088 2339
 		// Insert data into the DB
2089 2340
 		$args->list_order = -1 * $args->member_srl;
2090 2341
 
2091
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2092
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2342
+		if(!$args->user_id) {
2343
+			$args->user_id = 't'.$args->member_srl;
2344
+		}
2345
+		if(!$args->user_name) {
2346
+			$args->user_name = $args->member_srl;
2347
+		}
2093 2348
 
2094 2349
 		$oDB = &DB::getInstance();
2095 2350
 		$oDB->begin();
@@ -2101,8 +2356,11 @@  discard block
 block discarded – undo
2101 2356
 			return $output;
2102 2357
 		}
2103 2358
 
2104
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2105
-		else $group_srl_list = explode('|@|', $args->group_srl_list);
2359
+		if(is_array($args->group_srl_list)) {
2360
+			$group_srl_list = $args->group_srl_list;
2361
+		} else {
2362
+			$group_srl_list = explode('|@|', $args->group_srl_list);
2363
+		}
2106 2364
 		// If no value is entered the default group, the value of group registration
2107 2365
 		if(!$args->group_srl_list)
2108 2366
 		{
@@ -2119,8 +2377,7 @@  discard block
 block discarded – undo
2119 2377
 				}
2120 2378
 			}
2121 2379
 			// If the value is the value of the group entered the group registration
2122
-		}
2123
-		else
2380
+		} else
2124 2381
 		{
2125 2382
 			for($i=0;$i<count($group_srl_list);$i++)
2126 2383
 			{
@@ -2181,27 +2438,39 @@  discard block
 block discarded – undo
2181 2438
 	{
2182 2439
 		// Call a trigger (before)
2183 2440
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2184
-		if(!$output->toBool()) return $output;
2441
+		if(!$output->toBool()) {
2442
+			return $output;
2443
+		}
2185 2444
 		// Create a model object
2186 2445
 		$oMemberModel = getModel('member');
2187 2446
 
2188 2447
 		$logged_info = Context::get('logged_info');
2189 2448
 		// Get what you want to modify the original information
2190
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2449
+		if(!$this->memberInfo) {
2450
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2451
+		}
2191 2452
 		// Control of essential parameters
2192
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2193
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2453
+		if($args->allow_mailing!='Y') {
2454
+			$args->allow_mailing = 'N';
2455
+		}
2456
+		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) {
2457
+			$args->allow_message = 'Y';
2458
+		}
2194 2459
 
2195 2460
 		if($logged_info->is_admin == 'Y')
2196 2461
 		{
2197
-			if($args->denied!='Y') $args->denied = 'N';
2198
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2199
-		}
2200
-		else
2462
+			if($args->denied!='Y') {
2463
+				$args->denied = 'N';
2464
+			}
2465
+			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) {
2466
+				$args->is_admin = 'N';
2467
+			}
2468
+		} else
2201 2469
 		{
2202 2470
 			unset($args->is_admin);
2203
-			if($is_admin == false)
2204
-				unset($args->denied);
2471
+			if($is_admin == false) {
2472
+							unset($args->denied);
2473
+			}
2205 2474
 			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2206 2475
 			{
2207 2476
 				return $this->stop('msg_invalid_request');
@@ -2209,13 +2478,19 @@  discard block
 block discarded – undo
2209 2478
 		}
2210 2479
 
2211 2480
 		// Sanitize user ID, username, nickname, homepage, blog
2212
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2481
+		if($args->user_id) {
2482
+			$args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2483
+		}
2213 2484
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2214 2485
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2215 2486
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2216 2487
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2217
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2218
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2488
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) {
2489
+			$args->homepage = 'http://'.$args->homepage;
2490
+		}
2491
+		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) {
2492
+			$args->blog = 'http://'.$args->blog;
2493
+		}
2219 2494
 
2220 2495
 		// check member identifier form
2221 2496
 		$config = $oMemberModel->getMemberConfig();
@@ -2232,8 +2507,7 @@  discard block
 block discarded – undo
2232 2507
 				return new Object(-1,'msg_exists_email_address');
2233 2508
 			}
2234 2509
 			$args->email_address = $orgMemberInfo->email_address;
2235
-		}
2236
-		else
2510
+		} else
2237 2511
 		{
2238 2512
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2239 2513
 			if($member_srl && $args->member_srl != $member_srl)
@@ -2290,16 +2564,14 @@  discard block
 block discarded – undo
2290 2564
 				return new Object(-1, $message[$config->password_strength]);
2291 2565
 			}
2292 2566
 			$args->password = $oMemberModel->hashPassword($args->password);
2293
-		}
2294
-		else
2567
+		} else
2295 2568
 		{
2296 2569
 			$args->password = $orgMemberInfo->password;
2297 2570
 		}
2298 2571
 
2299 2572
 		if($args->find_account_answer) {
2300 2573
 			$args->find_account_answer = $oMemberModel->hashPassword($args->find_account_answer);
2301
-		}
2302
-		else
2574
+		} else
2303 2575
 		{
2304 2576
 			$oPassword =  new Password();
2305 2577
 			$hashed = $oPassword->checkAlgorithm($orgMemberInfo->find_account_answer);
@@ -2311,11 +2583,21 @@  discard block
 block discarded – undo
2311 2583
 			}
2312 2584
 		}
2313 2585
 
2314
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2315
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2316
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2317
-		if(!$args->description) $args->description = $orgMemberInfo->description;
2318
-		if(!$args->birthday) $args->birthday = '';
2586
+		if(!$args->user_name) {
2587
+			$args->user_name = $orgMemberInfo->user_name;
2588
+		}
2589
+		if(!$args->user_id) {
2590
+			$args->user_id = $orgMemberInfo->user_id;
2591
+		}
2592
+		if(!$args->nick_name) {
2593
+			$args->nick_name = $orgMemberInfo->nick_name;
2594
+		}
2595
+		if(!$args->description) {
2596
+			$args->description = $orgMemberInfo->description;
2597
+		}
2598
+		if(!$args->birthday) {
2599
+			$args->birthday = '';
2600
+		}
2319 2601
 
2320 2602
 		$output = executeQuery('member.updateMember', $args);
2321 2603
 
@@ -2327,8 +2609,11 @@  discard block
 block discarded – undo
2327 2609
 
2328 2610
 		if($args->group_srl_list)
2329 2611
 		{
2330
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2331
-			else $group_srl_list = explode('|@|', $args->group_srl_list);
2612
+			if(is_array($args->group_srl_list)) {
2613
+				$group_srl_list = $args->group_srl_list;
2614
+			} else {
2615
+				$group_srl_list = explode('|@|', $args->group_srl_list);
2616
+			}
2332 2617
 			// If the group information, group information changes
2333 2618
 			if(count($group_srl_list) > 0)
2334 2619
 			{
@@ -2371,7 +2656,9 @@  discard block
 block discarded – undo
2371 2656
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2372 2657
 
2373 2658
 		// Save Session
2374
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2659
+		if(!$this->memberInfo) {
2660
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2661
+		}
2375 2662
 		$logged_info = Context::get('logged_info');
2376 2663
 
2377 2664
 		$output->add('member_srl', $args->member_srl);
@@ -2397,8 +2684,7 @@  discard block
 block discarded – undo
2397 2684
 			}
2398 2685
 
2399 2686
 			$args->password = $oMemberModel->hashPassword($args->password);
2400
-		}
2401
-		else if($args->hashed_password)
2687
+		} else if($args->hashed_password)
2402 2688
 		{
2403 2689
 			$args->password = $args->hashed_password;
2404 2690
 		}
@@ -2433,7 +2719,9 @@  discard block
 block discarded – undo
2433 2719
 		$trigger_obj = new stdClass();
2434 2720
 		$trigger_obj->member_srl = $member_srl;
2435 2721
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2436
-		if(!$output->toBool()) return $output;
2722
+		if(!$output->toBool()) {
2723
+			return $output;
2724
+		}
2437 2725
 		// Create a model object
2438 2726
 		$oMemberModel = getModel('member');
2439 2727
 		// Bringing the user's information
@@ -2442,9 +2730,13 @@  discard block
 block discarded – undo
2442 2730
 			$columnList = array('member_srl', 'is_admin');
2443 2731
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2444 2732
 		}
2445
-		if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2733
+		if(!$this->memberInfo) {
2734
+			return new Object(-1, 'msg_not_exists_member');
2735
+		}
2446 2736
 		// If managers can not be deleted
2447
-		if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2737
+		if($this->memberInfo->is_admin == 'Y') {
2738
+			return new Object(-1, 'msg_cannot_delete_admin');
2739
+		}
2448 2740
 
2449 2741
 		$oDB = &DB::getInstance();
2450 2742
 		$oDB->begin();
@@ -2508,7 +2800,9 @@  discard block
 block discarded – undo
2508 2800
 	 */
2509 2801
 	function destroySessionInfo()
2510 2802
 	{
2511
-		if(!$_SESSION || !is_array($_SESSION)) return;
2803
+		if(!$_SESSION || !is_array($_SESSION)) {
2804
+			return;
2805
+		}
2512 2806
 
2513 2807
 		$memberInfo = Context::get('logged_info');
2514 2808
 		$memberSrl = $memberInfo->member_srl;
@@ -2547,8 +2841,9 @@  discard block
 block discarded – undo
2547 2841
 		}
2548 2842
 		$maxLevel = 0;
2549 2843
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2550
-		if(count($resultGroup) > 0)
2551
-			$maxLevel = max(array_flip($resultGroup));
2844
+		if(count($resultGroup) > 0) {
2845
+					$maxLevel = max(array_flip($resultGroup));
2846
+		}
2552 2847
 
2553 2848
 		if($maxLevel > 0)
2554 2849
 		{
@@ -2565,16 +2860,22 @@  discard block
 block discarded – undo
2565 2860
 
2566 2861
 	function procMemberModifyEmailAddress()
2567 2862
 	{
2568
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2863
+		if(!Context::get('is_logged')) {
2864
+			return $this->stop('msg_not_logged');
2865
+		}
2569 2866
 
2570 2867
 		$member_info = Context::get('logged_info');
2571 2868
 		$newEmail = Context::get('email_address');
2572 2869
 
2573
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2870
+		if(!$newEmail) {
2871
+			return $this->stop('msg_invalid_request');
2872
+		}
2574 2873
 
2575 2874
 		$oMemberModel = getModel('member');
2576 2875
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2577
-		if($member_srl) return new Object(-1,'msg_exists_email_address');
2876
+		if($member_srl) {
2877
+			return new Object(-1,'msg_exists_email_address');
2878
+		}
2578 2879
 
2579 2880
 		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2580 2881
 		{
@@ -2602,7 +2903,9 @@  discard block
 block discarded – undo
2602 2903
 		$member_config = $oModuleModel->getModuleConfig('member');
2603 2904
 
2604 2905
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2605
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2906
+		if(!is_dir($tpl_path)) {
2907
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2908
+		}
2606 2909
 
2607 2910
 		global $lang;
2608 2911
 
@@ -2638,7 +2941,9 @@  discard block
 block discarded – undo
2638 2941
 	{
2639 2942
 		$member_srl = Context::get('member_srl');
2640 2943
 		$auth_key = Context::get('auth_key');
2641
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2944
+		if(!$member_srl || !$auth_key) {
2945
+			return $this->stop('msg_invalid_request');
2946
+		}
2642 2947
 
2643 2948
 		// Test logs for finding password by user_id and authkey
2644 2949
 		$args = new stdClass;
@@ -2647,7 +2952,9 @@  discard block
 block discarded – undo
2647 2952
 		$output = executeQuery('member.getAuthMail', $args);
2648 2953
 		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2649 2954
 		{
2650
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2955
+			if(strlen($output->data->auth_key) !== strlen($auth_key)) {
2956
+				executeQuery('member.deleteAuthChangeEmailAddress', $args);
2957
+			}
2651 2958
 			return $this->stop('msg_invalid_modify_email_auth_key');
2652 2959
 		}
2653 2960
 
@@ -2656,7 +2963,9 @@  discard block
 block discarded – undo
2656 2963
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2657 2964
 
2658 2965
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2659
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2966
+		if(!$output->toBool()) {
2967
+			return $this->stop($output->getMessage());
2968
+		}
2660 2969
 
2661 2970
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2662 2971
 		executeQuery('member.deleteAuthChangeEmailAddress',$args);
@@ -2677,7 +2986,9 @@  discard block
 block discarded – undo
2677 2986
 	**/
2678 2987
 	function triggerGetDocumentMenu(&$menu_list)
2679 2988
 	{
2680
-		if(!Context::get('is_logged')) return new Object();
2989
+		if(!Context::get('is_logged')) {
2990
+			return new Object();
2991
+		}
2681 2992
 
2682 2993
 		$logged_info = Context::get('logged_info');
2683 2994
 		$document_srl = Context::get('target_srl');
@@ -2688,8 +2999,12 @@  discard block
 block discarded – undo
2688 2999
 		$member_srl = $oDocument->get('member_srl');
2689 3000
 		$module_srl = $oDocument->get('module_srl');
2690 3001
 
2691
-		if(!$member_srl) return new Object();
2692
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
3002
+		if(!$member_srl) {
3003
+			return new Object();
3004
+		}
3005
+		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
3006
+			return new Object();
3007
+		}
2693 3008
 
2694 3009
 		$oDocumentController = getController('document');
2695 3010
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2707,7 +3022,9 @@  discard block
 block discarded – undo
2707 3022
 	**/
2708 3023
 	function triggerGetCommentMenu(&$menu_list)
2709 3024
 	{
2710
-		if(!Context::get('is_logged')) return new Object();
3025
+		if(!Context::get('is_logged')) {
3026
+			return new Object();
3027
+		}
2711 3028
 
2712 3029
 		$logged_info = Context::get('logged_info');
2713 3030
 		$comment_srl = Context::get('target_srl');
@@ -2718,8 +3035,12 @@  discard block
 block discarded – undo
2718 3035
 		$module_srl = $oComment->get('module_srl');
2719 3036
 		$member_srl = $oComment->get('member_srl');
2720 3037
 
2721
-		if(!$member_srl) return new Object();
2722
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
3038
+		if(!$member_srl) {
3039
+			return new Object();
3040
+		}
3041
+		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
3042
+			return new Object();
3043
+		}
2723 3044
 
2724 3045
 		$oCommentController = getController('comment');
2725 3046
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2735,7 +3056,9 @@  discard block
 block discarded – undo
2735 3056
 	**/
2736 3057
 	function procMemberSpammerManage()
2737 3058
 	{
2738
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
3059
+		if(!Context::get('is_logged')) {
3060
+			return new Object(-1,'msg_not_permitted');
3061
+		}
2739 3062
 
2740 3063
 		$logged_info = Context::get('logged_info');
2741 3064
 		$member_srl = Context::get('member_srl');
@@ -2743,8 +3066,9 @@  discard block
 block discarded – undo
2743 3066
 		$cnt_loop = Context::get('cnt_loop');
2744 3067
 		$proc_type = Context::get('proc_type');
2745 3068
 		$isMoveToTrash = true;
2746
-		if($proc_type == "delete")
2747
-			$isMoveToTrash = false;
3069
+		if($proc_type == "delete") {
3070
+					$isMoveToTrash = false;
3071
+		}
2748 3072
 
2749 3073
 		// check grant
2750 3074
 		$oModuleModel = getModel('module');
@@ -2752,7 +3076,9 @@  discard block
 block discarded – undo
2752 3076
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2753 3077
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2754 3078
 
2755
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
3079
+		if(!$grant->manager) {
3080
+			return new Object(-1,'msg_not_permitted');
3081
+		}
2756 3082
 
2757 3083
 		$proc_msg = "";
2758 3084
 
@@ -2761,11 +3087,13 @@  discard block
 block discarded – undo
2761 3087
 
2762 3088
 		// delete or trash destination
2763 3089
 		// proc member
2764
-		if($cnt_loop == 1)
2765
-			$this->_spammerMember($member_srl);
3090
+		if($cnt_loop == 1) {
3091
+					$this->_spammerMember($member_srl);
3092
+		}
2766 3093
 		// proc document and comment
2767
-		elseif($cnt_loop>1)
2768
-			$this->_spammerDocuments($member_srl, $isMoveToTrash);
3094
+		elseif($cnt_loop>1) {
3095
+					$this->_spammerDocuments($member_srl, $isMoveToTrash);
3096
+		}
2769 3097
 
2770 3098
 		// get destination count
2771 3099
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
@@ -2773,13 +3101,16 @@  discard block
 block discarded – undo
2773 3101
 
2774 3102
 		$total_count = Context::get('total_count');
2775 3103
 		$remain_count = $cnt_document + $cnt_comment;
2776
-		if($cnt_loop == 1) $total_count = $remain_count;
3104
+		if($cnt_loop == 1) {
3105
+			$total_count = $remain_count;
3106
+		}
2777 3107
 
2778 3108
 		// get progress percent
2779
-		if($total_count > 0)
2780
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2781
-		else
2782
-			$progress = 100;
3109
+		if($total_count > 0) {
3110
+					$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
3111
+		} else {
3112
+					$progress = 100;
3113
+		}
2783 3114
 
2784 3115
 		$this->add('total_count', $total_count);
2785 3116
 		$this->add('remain_count', $remain_count);
@@ -2821,7 +3152,10 @@  discard block
 block discarded – undo
2821 3152
 		$args->nick_name = $member_info->nick_name;
2822 3153
 		$args->denied = "Y";
2823 3154
 		$args->description = trim( $member_info->description );
2824
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
3155
+		if( $args->description != "" ) {
3156
+			$args->description .= "\n";
3157
+		}
3158
+		// add new line
2825 3159
 
2826 3160
 		$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 . "]";
2827 3161
 
@@ -2866,8 +3200,11 @@  discard block
 block discarded – undo
2866 3200
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2867 3201
 			if($documentList) {
2868 3202
 				foreach($documentList as $v) {
2869
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2870
-					else $oDocumentController->deleteDocument($v->document_srl);
3203
+					if($isMoveToTrash) {
3204
+						$oDocumentController->moveDocumentToTrash($v);
3205
+					} else {
3206
+						$oDocumentController->deleteDocument($v->document_srl);
3207
+					}
2871 3208
 				}
2872 3209
 			}
2873 3210
 		}
Please login to merge, or discard this patch.
classes/frontendfile/FrontEndFileHandler.class.php 2 patches
Braces   +15 added lines, -20 removed lines patch added patch discarded remove patch
@@ -108,15 +108,13 @@  discard block
 block discarded – undo
108 108
 			$mapIndex = &$this->cssMapIndex;
109 109
 
110 110
 			$this->_arrangeCssIndex($pathInfo['dirname'], $file);
111
-		}
112
-		else if($file->fileExtension == 'js')
111
+		} else if($file->fileExtension == 'js')
113 112
 		{
114 113
 			if($args[1] == 'body')
115 114
 			{
116 115
 				$map = &$this->jsBodyMap;
117 116
 				$mapIndex = &$this->jsBodyMapIndex;
118
-			}
119
-			else
117
+			} else
120 118
 			{
121 119
 				$map = &$this->jsHeadMap;
122 120
 				$mapIndex = &$this->jsHeadMapIndex;
@@ -174,8 +172,7 @@  discard block
 block discarded – undo
174 172
 				{
175 173
 					$file->fileName = $minifiedFileName;
176 174
 				}
177
-			}
178
-			else
175
+			} else
179 176
 			{
180 177
 				// Remove .min
181 178
 				if(file_exists(implode('/', array($file->fileRealPath, $file->keyName))))
@@ -195,8 +192,7 @@  discard block
 block discarded – undo
195 192
 				$file->media = 'all';
196 193
 			}
197 194
 			$file->key = $file->filePath . $file->keyName . "\t" . $file->targetIe . "\t" . $file->media;
198
-		}
199
-		else if($file->fileExtension == 'js')
195
+		} else if($file->fileExtension == 'js')
200 196
 		{
201 197
 			$file->key = $file->filePath . $file->keyName . "\t" . $file->targetIe;
202 198
 		}
@@ -223,8 +219,7 @@  discard block
 block discarded – undo
223 219
 				$index = $this->cssMapIndex[$file->key];
224 220
 				unset($this->cssMap[$index][$file->key], $this->cssMapIndex[$file->key]);
225 221
 			}
226
-		}
227
-		else
222
+		} else
228 223
 		{
229 224
 			if(isset($this->jsHeadMapIndex[$file->key]))
230 225
 			{
@@ -286,7 +281,9 @@  discard block
 block discarded – undo
286 281
 				}
287 282
 				if($file->query)
288 283
 				{
289
-					if($query) $query .= '&';
284
+					if($query) {
285
+						$query .= '&';
286
+					}
290 287
 					$query .= $file->query;
291 288
 				}
292 289
 				$query = ($query) ? '?' . $query : '';
@@ -315,8 +312,7 @@  discard block
 block discarded – undo
315 312
 		{
316 313
 			$map = &$this->jsHeadMap;
317 314
 			$mapIndex = &$this->jsHeadMapIndex;
318
-		}
319
-		else
315
+		} else
320 316
 		{
321 317
 			$map = &$this->jsBodyMap;
322 318
 			$mapIndex = &$this->jsBodyMapIndex;
@@ -336,7 +332,9 @@  discard block
 block discarded – undo
336 332
 				}
337 333
 				if($file->query)
338 334
 				{
339
-					if($query) $query .= '&';
335
+					if($query) {
336
+						$query .= '&';
337
+					}
340 338
 					$query .= $file->query;
341 339
 				}
342 340
 				$query = ($query) ? '?' . $query : '';
@@ -375,8 +373,7 @@  discard block
 block discarded – undo
375 373
 		if(strpos($path, '://') === FALSE && $path{0} != '/' && $path{0} != '.')
376 374
 		{
377 375
 			$path = './' . $path;
378
-		}
379
-		elseif(!strncmp($path, '//', 2))
376
+		} elseif(!strncmp($path, '//', 2))
380 377
 		{
381 378
 			return preg_replace('#^//+#', '//', $path);
382 379
 		}
@@ -407,13 +404,11 @@  discard block
 block discarded – undo
407 404
 			if($script_path == '/' || $script_path == '\\')
408 405
 			{
409 406
 				$path = '/' . substr($path, 2);
410
-			}
411
-			else
407
+			} else
412 408
 			{
413 409
 				$path = $script_path . substr($path, 2);
414 410
 			}
415
-		}
416
-		else if(strpos($file, '../') === 0)
411
+		} else if(strpos($file, '../') === 0)
417 412
 		{
418 413
 			$path = $this->_normalizeFilePath($script_path . $path);
419 414
 		}
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	 */
55 55
 	function isSsl()
56 56
 	{
57
-		if(!is_null(self::$isSSL))
57
+		if (!is_null(self::$isSSL))
58 58
 		{
59 59
 			return self::$isSSL;
60 60
 		}
@@ -88,30 +88,30 @@  discard block
 block discarded – undo
88 88
 	 * */
89 89
 	function loadFile($args)
90 90
 	{
91
-		if(!is_array($args))
91
+		if (!is_array($args))
92 92
 		{
93 93
 			$args = array($args);
94 94
 		}
95 95
 		$file = $this->getFileInfo($args[0], $args[2], $args[1]);
96 96
 
97 97
 		$availableExtension = array('css' => 1, 'js' => 1);
98
-		if(!isset($availableExtension[$file->fileExtension]))
98
+		if (!isset($availableExtension[$file->fileExtension]))
99 99
 		{
100 100
 			return;
101 101
 		}
102 102
 
103 103
 		$file->index = (int) $args[3];
104 104
 
105
-		if($file->fileExtension == 'css')
105
+		if ($file->fileExtension == 'css')
106 106
 		{
107 107
 			$map = &$this->cssMap;
108 108
 			$mapIndex = &$this->cssMapIndex;
109 109
 
110 110
 			$this->_arrangeCssIndex($pathInfo['dirname'], $file);
111 111
 		}
112
-		else if($file->fileExtension == 'js')
112
+		else if ($file->fileExtension == 'js')
113 113
 		{
114
-			if($args[1] == 'body')
114
+			if ($args[1] == 'body')
115 115
 			{
116 116
 				$map = &$this->jsBodyMap;
117 117
 				$mapIndex = &$this->jsBodyMapIndex;
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 		}
125 125
 
126 126
 		(is_null($file->index)) ? $file->index = 0 : $file->index = $file->index;
127
-		if(!isset($mapIndex[$file->key]) || $mapIndex[$file->key] > $file->index)
127
+		if (!isset($mapIndex[$file->key]) || $mapIndex[$file->key] > $file->index)
128 128
 		{
129 129
 			$this->unloadFile($args[0], $args[2], $args[1]);
130 130
 			$map[$file->index][$file->key] = $file;
@@ -144,14 +144,14 @@  discard block
 block discarded – undo
144 144
 	{
145 145
 		static $existsInfo = array();
146 146
 
147
-		if(isset($existsInfo[$existsKey]))
147
+		if (isset($existsInfo[$existsKey]))
148 148
 		{
149 149
 			return $existsInfo[$existsKey];
150 150
 		}
151 151
 
152 152
 		$fileName = preg_replace('/(?:[\/]{3,})(.*)/', '//$1', $fileName);
153 153
 		$url_info = parse_url($fileName);
154
-		$pathInfo = pathinfo(str_replace('?' . $url_info['query'], '', $fileName));
154
+		$pathInfo = pathinfo(str_replace('?'.$url_info['query'], '', $fileName));
155 155
 
156 156
 		$file = new stdClass();
157 157
 		$file->fileName = basename($url_info['path']);
@@ -164,14 +164,14 @@  discard block
 block discarded – undo
164 164
 		$file->keyName = implode('.', array($file->fileNameNoExt, $file->fileExtension));
165 165
 		$file->cdnPath = $this->_normalizeFilePath($pathInfo['dirname']);
166 166
 
167
-		if(!$file->external)
167
+		if (!$file->external)
168 168
 		{
169
-			if(!__DEBUG__ && __XE_VERSION_STABLE__)
169
+			if (!__DEBUG__ && __XE_VERSION_STABLE__)
170 170
 			{
171 171
 				// if no debug mode, load minifed file
172 172
 				$minifiedFileName = implode('.', array($file->fileNameNoExt, 'min', $file->fileExtension));
173 173
 				$minifiedRealPath = implode('/', array($file->fileRealPath, $minifiedFileName));
174
-				if(file_exists($minifiedRealPath))
174
+				if (file_exists($minifiedRealPath))
175 175
 				{
176 176
 					$file->fileName = $minifiedFileName;
177 177
 				}
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 			else
180 180
 			{
181 181
 				// Remove .min
182
-				if(file_exists(implode('/', array($file->fileRealPath, $file->keyName))))
182
+				if (file_exists(implode('/', array($file->fileRealPath, $file->keyName))))
183 183
 				{
184 184
 					$file->fileName = $file->keyName;
185 185
 				}
@@ -188,18 +188,18 @@  discard block
 block discarded – undo
188 188
 
189 189
 		$file->targetIe = $targetIe;
190 190
 
191
-		if($file->fileExtension == 'css')
191
+		if ($file->fileExtension == 'css')
192 192
 		{
193 193
 			$file->media = $media;
194
-			if(!$file->media)
194
+			if (!$file->media)
195 195
 			{
196 196
 				$file->media = 'all';
197 197
 			}
198
-			$file->key = $file->filePath . $file->keyName . "\t" . $file->targetIe . "\t" . $file->media;
198
+			$file->key = $file->filePath.$file->keyName."\t".$file->targetIe."\t".$file->media;
199 199
 		}
200
-		else if($file->fileExtension == 'js')
200
+		else if ($file->fileExtension == 'js')
201 201
 		{
202
-			$file->key = $file->filePath . $file->keyName . "\t" . $file->targetIe;
202
+			$file->key = $file->filePath.$file->keyName."\t".$file->targetIe;
203 203
 		}
204 204
 
205 205
 		return $file;
@@ -217,9 +217,9 @@  discard block
 block discarded – undo
217 217
 	{
218 218
 		$file = $this->getFileInfo($fileName, $targetIe, $media);
219 219
 
220
-		if($file->fileExtension == 'css')
220
+		if ($file->fileExtension == 'css')
221 221
 		{
222
-			if(isset($this->cssMapIndex[$file->key]))
222
+			if (isset($this->cssMapIndex[$file->key]))
223 223
 			{
224 224
 				$index = $this->cssMapIndex[$file->key];
225 225
 				unset($this->cssMap[$index][$file->key], $this->cssMapIndex[$file->key]);
@@ -227,12 +227,12 @@  discard block
 block discarded – undo
227 227
 		}
228 228
 		else
229 229
 		{
230
-			if(isset($this->jsHeadMapIndex[$file->key]))
230
+			if (isset($this->jsHeadMapIndex[$file->key]))
231 231
 			{
232 232
 				$index = $this->jsHeadMapIndex[$file->key];
233 233
 				unset($this->jsHeadMap[$index][$file->key], $this->jsHeadMapIndex[$file->key]);
234 234
 			}
235
-			if(isset($this->jsBodyMapIndex[$file->key]))
235
+			if (isset($this->jsBodyMapIndex[$file->key]))
236 236
 			{
237 237
 				$index = $this->jsBodyMapIndex[$file->key];
238 238
 				unset($this->jsBodyMap[$index][$file->key], $this->jsBodyMapIndex[$file->key]);
@@ -248,13 +248,13 @@  discard block
 block discarded – undo
248 248
 	 */
249 249
 	function unloadAllFiles($type = 'all')
250 250
 	{
251
-		if($type == 'css' || $type == 'all')
251
+		if ($type == 'css' || $type == 'all')
252 252
 		{
253 253
 			$this->cssMap = array();
254 254
 			$this->cssMapIndex = array();
255 255
 		}
256 256
 
257
-		if($type == 'js' || $type == 'all')
257
+		if ($type == 'js' || $type == 'all')
258 258
 		{
259 259
 			$this->jsHeadMap = array();
260 260
 			$this->jsBodyMap = array();
@@ -276,23 +276,23 @@  discard block
 block discarded – undo
276 276
 		$this->_sortMap($map, $mapIndex);
277 277
 
278 278
 		$result = array();
279
-		foreach($map as $indexedMap)
279
+		foreach ($map as $indexedMap)
280 280
 		{
281
-			foreach($indexedMap as $file)
281
+			foreach ($indexedMap as $file)
282 282
 			{
283 283
 				$query = '';
284
-				if(!$file->external && is_readable($file->cdnPath . '/' . $file->fileName))
284
+				if (!$file->external && is_readable($file->cdnPath.'/'.$file->fileName))
285 285
 				{
286
-					$query = date('YmdHis', filemtime($file->cdnPath . '/' . $file->fileName));
286
+					$query = date('YmdHis', filemtime($file->cdnPath.'/'.$file->fileName));
287 287
 				}
288
-				if($file->query)
288
+				if ($file->query)
289 289
 				{
290
-					if($query) $query .= '&';
290
+					if ($query) $query .= '&';
291 291
 					$query .= $file->query;
292 292
 				}
293
-				$query = ($query) ? '?' . $query : '';
293
+				$query = ($query) ? '?'.$query : '';
294 294
 
295
-				$fullFilePath = $file->filePath . '/' . $file->fileName . $query;
295
+				$fullFilePath = $file->filePath.'/'.$file->fileName.$query;
296 296
 				$result[] = array(
297 297
 					'file' => $fullFilePath,
298 298
 					'media' => $file->media,
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 	 */
313 313
 	function getJsFileList($type = 'head')
314 314
 	{
315
-		if($type == 'head')
315
+		if ($type == 'head')
316 316
 		{
317 317
 			$map = &$this->jsHeadMap;
318 318
 			$mapIndex = &$this->jsHeadMapIndex;
@@ -326,23 +326,23 @@  discard block
 block discarded – undo
326 326
 		$this->_sortMap($map, $mapIndex);
327 327
 
328 328
 		$result = array();
329
-		foreach($map as $indexedMap)
329
+		foreach ($map as $indexedMap)
330 330
 		{
331
-			foreach($indexedMap as $file)
331
+			foreach ($indexedMap as $file)
332 332
 			{
333 333
 				$query = '';
334
-				if(!$file->external && is_readable($file->cdnPath . '/' . $file->fileName))
334
+				if (!$file->external && is_readable($file->cdnPath.'/'.$file->fileName))
335 335
 				{
336
-					$query = date('YmdHis', filemtime($file->cdnPath . '/' . $file->fileName));
336
+					$query = date('YmdHis', filemtime($file->cdnPath.'/'.$file->fileName));
337 337
 				}
338
-				if($file->query)
338
+				if ($file->query)
339 339
 				{
340
-					if($query) $query .= '&';
340
+					if ($query) $query .= '&';
341 341
 					$query .= $file->query;
342 342
 				}
343
-				$query = ($query) ? '?' . $query : '';
343
+				$query = ($query) ? '?'.$query : '';
344 344
 
345
-				$fullFilePath = $file->filePath . '/' . $file->fileName . $query;
345
+				$fullFilePath = $file->filePath.'/'.$file->fileName.$query;
346 346
 				$result[] = array(
347 347
 					'file' => $fullFilePath,
348 348
 					'targetie' => $file->targetIe
@@ -373,18 +373,18 @@  discard block
 block discarded – undo
373 373
 	 */
374 374
 	function _normalizeFilePath($path)
375 375
 	{
376
-		if(strpos($path, '://') === FALSE && $path{0} != '/' && $path{0} != '.')
376
+		if (strpos($path, '://') === FALSE && $path{0} != '/' && $path{0} != '.')
377 377
 		{
378
-			$path = './' . $path;
378
+			$path = './'.$path;
379 379
 		}
380
-		elseif(!strncmp($path, '//', 2))
380
+		elseif (!strncmp($path, '//', 2))
381 381
 		{
382 382
 			return preg_replace('#^//+#', '//', $path);
383 383
 		}
384 384
 
385 385
 		$path = preg_replace('@/\./|(?<!:)\/\/@', '/', $path);
386 386
 
387
-		while(strpos($path, '/../'))
387
+		while (strpos($path, '/../'))
388 388
 		{
389 389
 			$path = preg_replace('/\/([^\/]+)\/\.\.\//s', '/', $path, 1);
390 390
 		}
@@ -403,20 +403,20 @@  discard block
 block discarded – undo
403 403
 		$path = $this->_normalizeFilePath($path);
404 404
 		$script_path = getScriptPath();
405 405
 
406
-		if(strpos($path, './') === 0)
406
+		if (strpos($path, './') === 0)
407 407
 		{
408
-			if($script_path == '/' || $script_path == '\\')
408
+			if ($script_path == '/' || $script_path == '\\')
409 409
 			{
410
-				$path = '/' . substr($path, 2);
410
+				$path = '/'.substr($path, 2);
411 411
 			}
412 412
 			else
413 413
 			{
414
-				$path = $script_path . substr($path, 2);
414
+				$path = $script_path.substr($path, 2);
415 415
 			}
416 416
 		}
417
-		else if(strpos($file, '../') === 0)
417
+		else if (strpos($file, '../') === 0)
418 418
 		{
419
-			$path = $this->_normalizeFilePath($script_path . $path);
419
+			$path = $this->_normalizeFilePath($script_path.$path);
420 420
 		}
421 421
 
422 422
 		return $path;
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 	 */
432 432
 	function _arrangeCssIndex($dirName, &$file)
433 433
 	{
434
-		if($file->index !== 0)
434
+		if ($file->index !== 0)
435 435
 		{
436 436
 			return;
437 437
 		}
Please login to merge, or discard this patch.
modules/widget/widget.class.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
 		$oModuleModel = getModel('module');
31 31
 		$oModuleController = getController('module');
32 32
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
33
-		if($oModuleModel->needUpdate($version_update_id))
33
+		if ($oModuleModel->needUpdate($version_update_id))
34 34
 		{
35 35
 			// widget compile display.after trigger for further (04/14/2009)
36
-			if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) return true;
36
+			if (!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) return true;
37 37
 
38 38
 			$oModuleController->insertUpdatedLog($version_update_id);
39 39
 		}
@@ -49,10 +49,10 @@  discard block
 block discarded – undo
49 49
 		$oModuleModel = getModel('module');
50 50
 		$oModuleController = getController('module');
51 51
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
52
-		if($oModuleModel->needUpdate($version_update_id))
52
+		if ($oModuleModel->needUpdate($version_update_id))
53 53
 		{
54 54
 			// widget compile display.after trigger for further (04/14/2009)
55
-			if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before'))
55
+			if (!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before'))
56 56
 			{
57 57
 				$oModuleController->insertTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before');
58 58
 			}
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@
 block discarded – undo
33 33
 		if($oModuleModel->needUpdate($version_update_id))
34 34
 		{
35 35
 			// widget compile display.after trigger for further (04/14/2009)
36
-			if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) return true;
36
+			if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) {
37
+				return true;
38
+			}
37 39
 
38 40
 			$oModuleController->insertUpdatedLog($version_update_id);
39 41
 		}
Please login to merge, or discard this patch.
modules/message/message.class.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,17 +23,17 @@  discard block
 block discarded – undo
23 23
 		$oModuleModel = getModel('module');
24 24
 		$oModuleController = getController('module');
25 25
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
26
-		if($oModuleModel->needUpdate($version_update_id))
26
+		if ($oModuleModel->needUpdate($version_update_id))
27 27
 		{
28 28
 			$config = $oModuleModel->getModuleConfig('message');
29 29
 
30
-			if($config->skin)
30
+			if ($config->skin)
31 31
 			{
32 32
 				$config_parse = explode('.', $config->skin);
33 33
 				if (count($config_parse) > 1)
34 34
 				{
35 35
 					$template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
36
-					if(is_dir($template_path)) return true;
36
+					if (is_dir($template_path)) return true;
37 37
 				}
38 38
 			}
39 39
 
@@ -51,17 +51,17 @@  discard block
 block discarded – undo
51 51
 		$oModuleModel = getModel('module');
52 52
 		$oModuleController = getController('module');
53 53
 		$version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated'));
54
-		if($oModuleModel->needUpdate($version_update_id))
54
+		if ($oModuleModel->needUpdate($version_update_id))
55 55
 		{
56 56
 			$config = $oModuleModel->getModuleConfig('message');
57 57
 
58
-			if($config->skin)
58
+			if ($config->skin)
59 59
 			{
60 60
 				$config_parse = explode('.', $config->skin);
61 61
 				if (count($config_parse) > 1)
62 62
 				{
63 63
 					$template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
64
-					if(is_dir($template_path))
64
+					if (is_dir($template_path))
65 65
 					{
66 66
 						$config->skin = implode('|@|', $config_parse);
67 67
 						$oModuleController = getController('module');
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@
 block discarded – undo
33 33
 				if (count($config_parse) > 1)
34 34
 				{
35 35
 					$template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
36
-					if(is_dir($template_path)) return true;
36
+					if(is_dir($template_path)) {
37
+						return true;
38
+					}
37 39
 				}
38 40
 			}
39 41
 
Please login to merge, or discard this patch.