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 ( b2f2f5...375c2b )
by gyeong-won
07:44
created
modules/layout/layout.view.php 3 patches
Doc Comments   +7 added lines, -1 removed lines patch added patch discarded remove patch
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 
313 313
 	/**
314 314
 	 * Preview a layout
315
-	 * @return void|Object (void : success, Object : fail)
315
+	 * @return Object|null (void : success, Object : fail)
316 316
 	 */
317 317
 	function dispLayoutPreview()
318 318
 	{
@@ -376,6 +376,9 @@  discard block
 block discarded – undo
376 376
 		$this->setTemplateFile('layout_preview');
377 377
 	}
378 378
 
379
+	/**
380
+	 * @return string
381
+	 */
379 382
 	private function getRealLayoutFile($layoutSrl)
380 383
 	{
381 384
 		$oLayoutModel = getModel('layout');
@@ -392,6 +395,9 @@  discard block
 block discarded – undo
392 395
 
393 396
 	}
394 397
 
398
+	/**
399
+	 * @return string
400
+	 */
395 401
 	private function getRealLayoutCSS($layoutSrl)
396 402
 	{
397 403
 		$oLayoutModel = getModel('layout');
Please login to merge, or discard this patch.
Braces   +26 added lines, -22 removed lines patch added patch discarded remove patch
@@ -25,7 +25,9 @@  discard block
 block discarded – undo
25 25
 		// Get the layout information
26 26
 		$oLayoutModel = getModel('layout');
27 27
 		$layout_info = $oLayoutModel->getLayoutInfo(Context::get('selected_layout'));
28
-		if(!$layout_info) exit();
28
+		if(!$layout_info) {
29
+			exit();
30
+		}
29 31
 		Context::set('layout_info', $layout_info);
30 32
 		// Set the layout to be pop-up
31 33
 		$this->setLayoutFile('popup_layout');
@@ -89,8 +91,7 @@  discard block
 block discarded – undo
89 91
 				{
90 92
 					$templatePath = _XE_PATH_ . 'modules/page/m.skins/' . $skin;
91 93
 					$templateFile = 'mobile';
92
-				}
93
-				else
94
+				} else
94 95
 				{
95 96
 					$templatePath = _XE_PATH_ . 'modules/page/skins/' . $skin;
96 97
 					$templateFile = 'content';
@@ -119,8 +120,7 @@  discard block
 block discarded – undo
119 120
 					if($skinType == 'M')
120 121
 					{
121 122
 						$layoutSrl = $designInfo->mlayout_srl;
122
-					}
123
-					else
123
+					} else
124 124
 					{
125 125
 						$layoutSrl = $designInfo->layout_srl;
126 126
 					}
@@ -172,8 +172,7 @@  discard block
 block discarded – undo
172 172
 									$menu->xml_file = str_replace('.xml.php', $homeMenuSrl . '.xml.php', $menu->xml_file);
173 173
 									$menu->php_file = str_replace('.php', $homeMenuSrl . '.php', $menu->php_file);
174 174
 									$layoutInfo->menu->{$menu_id}->menu_srl = $homeMenuSrl;
175
-								}
176
-								else
175
+								} else
177 176
 								{
178 177
 									$menu->xml_file = str_replace($menu->menu_srl, $homeMenuSrl, $menu->xml_file);
179 178
 									$menu->php_file = str_replace($menu->menu_srl, $homeMenuSrl, $menu->php_file);
@@ -192,8 +191,7 @@  discard block
 block discarded – undo
192 191
 					Context::set('layout_info', $layoutInfo);
193 192
 				}
194 193
 			}
195
-		}
196
-		catch(Exception $e)
194
+		} catch(Exception $e)
197 195
 		{
198 196
 			$content = '<div class="message error"><p id="preview_error">' . $e->getMessage() . '</p></div>';
199 197
 			Context::set('content', $content);
@@ -217,8 +215,7 @@  discard block
 block discarded – undo
217 215
 			$oModuleModel = getModel('module');
218 216
 			$part_config = $oModuleModel->getModulePartConfig('layout', $layoutSrl);
219 217
 			Context::addHtmlHeader($part_config->header_script);
220
-		}
221
-		else
218
+		} else
222 219
 		{
223 220
 			$layout_path = './common/tpl';
224 221
 			$layout_file = 'default_layout';
@@ -290,8 +287,7 @@  discard block
 block discarded – undo
290 287
 		{
291 288
 			Mobile::setMobile(TRUE);
292 289
 			$oModuleHandler->module_info->mskin = $skin;
293
-		}
294
-		else
290
+		} else
295 291
 		{
296 292
 			Mobile::setMobile(FALSE);
297 293
 			$oModuleHandler->module_info->skin = $skin;
@@ -319,19 +315,27 @@  discard block
 block discarded – undo
319 315
 		// admin check
320 316
 		// this act is admin view but in normal view because do not load admin css/js files
321 317
 		$logged_info = Context::get('logged_info');
322
-		if($logged_info->is_admin != 'Y') return $this->stop('msg_invalid_request');
318
+		if($logged_info->is_admin != 'Y') {
319
+			return $this->stop('msg_invalid_request');
320
+		}
323 321
 
324 322
 		$layout_srl = Context::get('layout_srl');
325 323
 		$code = Context::get('code');
326 324
 
327 325
 		$code_css = Context::get('code_css');
328
-		if(!$layout_srl || !$code) return new Object(-1, 'msg_invalid_request');
326
+		if(!$layout_srl || !$code) {
327
+			return new Object(-1, 'msg_invalid_request');
328
+		}
329 329
 		// Get the layout information
330 330
 		$oLayoutModel = getModel('layout');
331 331
 		$layout_info = $oLayoutModel->getLayout($layout_srl);
332
-		if(!$layout_info) return new Object(-1, 'msg_invalid_request');
332
+		if(!$layout_info) {
333
+			return new Object(-1, 'msg_invalid_request');
334
+		}
333 335
 		// Separately handle the layout if its type is faceoff
334
-		if($layout_info && $layout_info->type == 'faceoff') $oLayoutModel->doActivateFaceOff($layout_info);
336
+		if($layout_info && $layout_info->type == 'faceoff') {
337
+			$oLayoutModel->doActivateFaceOff($layout_info);
338
+		}
335 339
 		// Apply CSS directly
336 340
 		Context::addHtmlHeader("<style type=\"text/css\" charset=\"UTF-8\">".$code_css."</style>");
337 341
 		// Set names and values of extra_vars to $layout_info
@@ -348,7 +352,9 @@  discard block
 block discarded – undo
348 352
 			foreach($layout_info->menu as $menu_id => $menu)
349 353
 			{
350 354
 				$menu->php_file = FileHandler::getRealPath($menu->php_file);
351
-				if(FileHandler::exists($menu->php_file)) include($menu->php_file);
355
+				if(FileHandler::exists($menu->php_file)) {
356
+					include($menu->php_file);
357
+				}
352 358
 
353 359
 				Context::set($menu_id, $menu);
354 360
 			}
@@ -384,8 +390,7 @@  discard block
 block discarded – undo
384 390
 		if(file_exists($layoutFile))
385 391
 		{
386 392
 			return $layoutFile;
387
-		}
388
-		else
393
+		} else
389 394
 		{
390 395
 			return ''; 
391 396
 		}
@@ -400,8 +405,7 @@  discard block
 block discarded – undo
400 405
 		if(file_exists($cssFile))
401 406
 		{
402 407
 			return $cssFile;
403
-		}
404
-		else
408
+		} else
405 409
 		{
406 410
 			return ''; 
407 411
 		}
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 		// Get the layout information
26 26
 		$oLayoutModel = getModel('layout');
27 27
 		$layout_info = $oLayoutModel->getLayoutInfo(Context::get('selected_layout'));
28
-		if(!$layout_info) exit();
28
+		if (!$layout_info) exit();
29 29
 		Context::set('layout_info', $layout_info);
30 30
 		// Set the layout to be pop-up
31 31
 		$this->setLayoutFile('popup_layout');
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
 			// admin check
54 54
 			// this act is admin view but in normal view because do not load admin css/js files
55 55
 			$logged_info = Context::get('logged_info');
56
-			if($logged_info->is_admin != 'Y')
56
+			if ($logged_info->is_admin != 'Y')
57 57
 			{
58 58
 				throw new Exception(Context::getLang('msg_invalid_request'));
59 59
 			}
60 60
 
61 61
 			// if module is 'ARTiCLE' and from site design setting, make content directly
62
-			if($module == 'ARTICLE' && !$mid)
62
+			if ($module == 'ARTICLE' && !$mid)
63 63
 			{
64 64
 				$oDocumentModel = getModel('document');
65 65
 				$oDocument = $oDocumentModel->getDocument(0, true);
@@ -67,12 +67,12 @@  discard block
 block discarded – undo
67 67
 				$t = Context::getLang('article_preview_title');
68 68
 
69 69
 				$c = '';
70
-				for($i = 0; $i < 4; $i++)
70
+				for ($i = 0; $i < 4; $i++)
71 71
 				{
72 72
 					$c .= '<p>';
73
-					for($j = 0; $j < 20; $j++)
73
+					for ($j = 0; $j < 20; $j++)
74 74
 					{
75
-						$c .= Context::getLang('article_preview_content') . ' ';
75
+						$c .= Context::getLang('article_preview_content').' ';
76 76
 					}
77 77
 					$c .= '</p>';
78 78
 				}
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
 
88 88
 				if ($skinType == 'M')
89 89
 				{
90
-					$templatePath = _XE_PATH_ . 'modules/page/m.skins/' . $skin;
90
+					$templatePath = _XE_PATH_.'modules/page/m.skins/'.$skin;
91 91
 					$templateFile = 'mobile';
92 92
 				}
93 93
 				else
94 94
 				{
95
-					$templatePath = _XE_PATH_ . 'modules/page/skins/' . $skin;
95
+					$templatePath = _XE_PATH_.'modules/page/skins/'.$skin;
96 96
 					$templateFile = 'content';
97 97
 				}
98 98
 
@@ -108,15 +108,15 @@  discard block
 block discarded – undo
108 108
 			Context::set('content', $content);
109 109
 
110 110
 			// find layout
111
-			if($layoutSrl)
111
+			if ($layoutSrl)
112 112
 			{
113
-				if($layoutSrl == -1)
113
+				if ($layoutSrl == -1)
114 114
 				{
115 115
 					$site_srl = ($oModule) ? $oModule->module_info->site_srl : 0;
116
-					$designInfoFile = sprintf(_XE_PATH_ . 'files/site_design/design_%s.php', $site_srl);
116
+					$designInfoFile = sprintf(_XE_PATH_.'files/site_design/design_%s.php', $site_srl);
117 117
 					include($designInfoFile);
118 118
 
119
-					if($skinType == 'M')
119
+					if ($skinType == 'M')
120 120
 					{
121 121
 						$layoutSrl = $designInfo->mlayout_srl;
122 122
 					}
@@ -130,21 +130,21 @@  discard block
 block discarded – undo
130 130
 				$layoutInfo = $oLayoutModel->getLayout($layoutSrl);
131 131
 
132 132
 				// If there is no layout, pass it.
133
-				if($layoutInfo)
133
+				if ($layoutInfo)
134 134
 				{
135 135
 					// Adhoc...
136 136
 
137 137
 					// Input extra_vars into $layout_info
138
-					if($layoutInfo->extra_var_count)
138
+					if ($layoutInfo->extra_var_count)
139 139
 					{
140 140
 
141
-						foreach($layoutInfo->extra_var as $var_id => $val)
141
+						foreach ($layoutInfo->extra_var as $var_id => $val)
142 142
 						{
143
-							if($val->type == 'image')
143
+							if ($val->type == 'image')
144 144
 							{
145
-								if(strncmp('./files/attach/images/', $val->value, 22) === 0)
145
+								if (strncmp('./files/attach/images/', $val->value, 22) === 0)
146 146
 								{
147
-									$val->value = Context::getRequestUri() . substr($val->value, 2);
147
+									$val->value = Context::getRequestUri().substr($val->value, 2);
148 148
 								}
149 149
 							}
150 150
 							$layoutInfo->{$var_id} = $val->value;
@@ -152,25 +152,25 @@  discard block
 block discarded – undo
152 152
 					}
153 153
 
154 154
 					// Set menus into context
155
-					if($layoutInfo->menu_count)
155
+					if ($layoutInfo->menu_count)
156 156
 					{
157
-						foreach($layoutInfo->menu as $menu_id => $menu)
157
+						foreach ($layoutInfo->menu as $menu_id => $menu)
158 158
 						{
159 159
 							// set default menu set(included home menu)
160
-							if(!$menu->menu_srl || $menu->menu_srl == -1)
160
+							if (!$menu->menu_srl || $menu->menu_srl == -1)
161 161
 							{
162 162
 								$oMenuAdminController = getAdminController('menu');
163 163
 								$homeMenuCacheFile = $oMenuAdminController->getHomeMenuCacheFile();
164 164
 
165
-								if(file_exists($homeMenuCacheFile))
165
+								if (file_exists($homeMenuCacheFile))
166 166
 								{
167 167
 									include($homeMenuCacheFile);
168 168
 								}
169 169
 
170
-								if(!$menu->menu_srl)
170
+								if (!$menu->menu_srl)
171 171
 								{
172
-									$menu->xml_file = str_replace('.xml.php', $homeMenuSrl . '.xml.php', $menu->xml_file);
173
-									$menu->php_file = str_replace('.php', $homeMenuSrl . '.php', $menu->php_file);
172
+									$menu->xml_file = str_replace('.xml.php', $homeMenuSrl.'.xml.php', $menu->xml_file);
173
+									$menu->php_file = str_replace('.php', $homeMenuSrl.'.php', $menu->php_file);
174 174
 									$layoutInfo->menu->{$menu_id}->menu_srl = $homeMenuSrl;
175 175
 								}
176 176
 								else
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 							}
182 182
 
183 183
 							$menu->php_file = FileHandler::getRealPath($menu->php_file);
184
-							if(FileHandler::exists($menu->php_file))
184
+							if (FileHandler::exists($menu->php_file))
185 185
 							{
186 186
 								include($menu->php_file);
187 187
 							}
@@ -193,9 +193,9 @@  discard block
 block discarded – undo
193 193
 				}
194 194
 			}
195 195
 		}
196
-		catch(Exception $e)
196
+		catch (Exception $e)
197 197
 		{
198
-			$content = '<div class="message error"><p id="preview_error">' . $e->getMessage() . '</p></div>';
198
+			$content = '<div class="message error"><p id="preview_error">'.$e->getMessage().'</p></div>';
199 199
 			Context::set('content', $content);
200 200
 			$layoutSrl = 0;
201 201
 		}
@@ -204,12 +204,12 @@  discard block
 block discarded – undo
204 204
 		$oTemplate = TemplateHandler::getInstance();
205 205
 		Context::clearHtmlHeader();
206 206
 
207
-		if($layoutInfo)
207
+		if ($layoutInfo)
208 208
 		{
209 209
 			$layout_path = $layoutInfo->path;
210 210
 			$editLayoutTPL = $this->getRealLayoutFile($layoutSrl);
211 211
 			$editLayoutCSS = $this->getRealLayoutCSS($layoutSrl);
212
-			if($editLayoutCSS != '')
212
+			if ($editLayoutCSS != '')
213 213
 			{
214 214
 				Context::addCSSFile($editLayoutCSS);
215 215
 			}
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 		}
226 226
 
227 227
 		$layout_tpl = $oTemplate->compile($layout_path, $layout_file, $editLayoutTPL);
228
-		Context::set('layout','none');
228
+		Context::set('layout', 'none');
229 229
 
230 230
 		// Convert widgets and others
231 231
 		$oContext = Context::getInstance();
@@ -246,18 +246,18 @@  discard block
 block discarded – undo
246 246
 	private function procRealModule($module, $mid, $skin, $skinType)
247 247
 	{
248 248
 		// if form site design and preview module, find target module
249
-		if($module && !$mid)
249
+		if ($module && !$mid)
250 250
 		{
251 251
 			$args = new stdClass();
252 252
 			$args->module = $module;
253 253
 			$output = executeQuery('layout.getOneModuleInstanceByModuleName', $args);
254
-			if(!$output->toBool())
254
+			if (!$output->toBool())
255 255
 			{
256 256
 				throw new Exception($output->getMessage());
257 257
 			}
258 258
 
259 259
 			// if there is no module instance, error...
260
-			if(!$output->data)
260
+			if (!$output->data)
261 261
 			{
262 262
 				throw new Exception(Context::getLang('msg_unabled_preview'));
263 263
 			}
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 		}
267 267
 
268 268
 		// if form site design and preview layout, find start module
269
-		elseif(!$module && !$mid)
269
+		elseif (!$module && !$mid)
270 270
 		{
271 271
 			$oModuleModel = getModel('module');
272 272
 			$columnList = array('modules.mid', 'sites.index_module_srl');
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 		$oModuleHandler->module_info->is_skin_fix = 'Y';
287 287
 		$oModuleHandler->module_info->is_mskin_fix = 'Y';
288 288
 
289
-		if($skinType == 'M')
289
+		if ($skinType == 'M')
290 290
 		{
291 291
 			Mobile::setMobile(TRUE);
292 292
 			$oModuleHandler->module_info->mskin = $skin;
@@ -299,13 +299,13 @@  discard block
 block discarded – undo
299 299
 
300 300
 		// Proc module
301 301
 		$oModule = $oModuleHandler->procModule();
302
-		if(!$oModule->toBool())
302
+		if (!$oModule->toBool())
303 303
 		{
304 304
 			throw new Exception(Context::getLang('not_support_layout_preview'));
305 305
 		}
306 306
 
307 307
 		// get module html
308
-		require_once(_XE_PATH_ . "classes/display/HTMLDisplayHandler.php");
308
+		require_once(_XE_PATH_."classes/display/HTMLDisplayHandler.php");
309 309
 		$handler = new HTMLDisplayHandler();
310 310
 		return $handler->toDoc($oModule);
311 311
 	}
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 	 */
317 317
 	function dispLayoutPreview()
318 318
 	{
319
-		if(!checkCSRF())
319
+		if (!checkCSRF())
320 320
 		{
321 321
 			$this->stop('msg_invalid_request');
322 322
 			return new Object(-1, 'msg_invalid_request');
@@ -325,36 +325,36 @@  discard block
 block discarded – undo
325 325
 		// admin check
326 326
 		// this act is admin view but in normal view because do not load admin css/js files
327 327
 		$logged_info = Context::get('logged_info');
328
-		if($logged_info->is_admin != 'Y') return $this->stop('msg_invalid_request');
328
+		if ($logged_info->is_admin != 'Y') return $this->stop('msg_invalid_request');
329 329
 
330 330
 		$layout_srl = Context::get('layout_srl');
331 331
 		$code = Context::get('code');
332 332
 
333 333
 		$code_css = Context::get('code_css');
334
-		if(!$layout_srl || !$code) return new Object(-1, 'msg_invalid_request');
334
+		if (!$layout_srl || !$code) return new Object(-1, 'msg_invalid_request');
335 335
 		// Get the layout information
336 336
 		$oLayoutModel = getModel('layout');
337 337
 		$layout_info = $oLayoutModel->getLayout($layout_srl);
338
-		if(!$layout_info) return new Object(-1, 'msg_invalid_request');
338
+		if (!$layout_info) return new Object(-1, 'msg_invalid_request');
339 339
 		// Separately handle the layout if its type is faceoff
340
-		if($layout_info && $layout_info->type == 'faceoff') $oLayoutModel->doActivateFaceOff($layout_info);
340
+		if ($layout_info && $layout_info->type == 'faceoff') $oLayoutModel->doActivateFaceOff($layout_info);
341 341
 		// Apply CSS directly
342 342
 		Context::addHtmlHeader("<style type=\"text/css\" charset=\"UTF-8\">".$code_css."</style>");
343 343
 		// Set names and values of extra_vars to $layout_info
344
-		if($layout_info->extra_var_count)
344
+		if ($layout_info->extra_var_count)
345 345
 		{
346
-			foreach($layout_info->extra_var as $var_id => $val)
346
+			foreach ($layout_info->extra_var as $var_id => $val)
347 347
 			{
348 348
 				$layout_info->{$var_id} = $val->value;
349 349
 			}
350 350
 		}
351 351
 		// menu in layout information becomes an argument for Context:: set
352
-		if($layout_info->menu_count)
352
+		if ($layout_info->menu_count)
353 353
 		{
354
-			foreach($layout_info->menu as $menu_id => $menu)
354
+			foreach ($layout_info->menu as $menu_id => $menu)
355 355
 			{
356 356
 				$menu->php_file = FileHandler::getRealPath($menu->php_file);
357
-				if(FileHandler::exists($menu->php_file)) include($menu->php_file);
357
+				if (FileHandler::exists($menu->php_file)) include($menu->php_file);
358 358
 
359 359
 				Context::set($menu_id, $menu);
360 360
 			}
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 		Context::set('layout_info', $layout_info);
364 364
 		Context::set('content', Context::getLang('layout_preview_content'));
365 365
 		// Temporary save the codes
366
-		$edited_layout_file = _XE_PATH_ . 'files/cache/layout/tmp.tpl';
366
+		$edited_layout_file = _XE_PATH_.'files/cache/layout/tmp.tpl';
367 367
 		FileHandler::writeFile($edited_layout_file, $code);
368 368
 
369 369
 		// Compile
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 		$layout_file = 'layout';
374 374
 
375 375
 		$layout_tpl = $oTemplate->compile($layout_path, $layout_file, $edited_layout_file);
376
-		Context::set('layout','none');
376
+		Context::set('layout', 'none');
377 377
 		// Convert widgets and others
378 378
 		$oContext = &Context::getInstance();
379 379
 		Context::set('layout_tpl', $layout_tpl);
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 		$oLayoutModel = getModel('layout');
388 388
 		$layoutFile = $oLayoutModel->getUserLayoutHtml($layoutSrl);
389 389
 
390
-		if(file_exists($layoutFile))
390
+		if (file_exists($layoutFile))
391 391
 		{
392 392
 			return $layoutFile;
393 393
 		}
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 		$oLayoutModel = getModel('layout');
404 404
 		$cssFile = $oLayoutModel->getUserLayoutCss($layoutSrl);
405 405
 
406
-		if(file_exists($cssFile))
406
+		if (file_exists($cssFile))
407 407
 		{
408 408
 			return $cssFile;
409 409
 		}
Please login to merge, or discard this patch.
modules/member/member.admin.controller.php 4 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1114,7 +1114,7 @@  discard block
 block discarded – undo
1114 1114
 
1115 1115
 	/**
1116 1116
 	 * Insert a group
1117
-	 * @param object $args
1117
+	 * @param null|stdClass $args
1118 1118
 	 * @return Object
1119 1119
 	 */
1120 1120
 	function insertGroup($args)
@@ -1311,6 +1311,9 @@  discard block
 block discarded – undo
1311 1311
 		return executeQuery('member.insertDeniedID', $args);
1312 1312
 	}
1313 1313
 
1314
+	/**
1315
+	 * @param string $nick_name
1316
+	 */
1314 1317
 	function insertDeniedNickName($nick_name, $description = '')
1315 1318
 	{
1316 1319
 		$args = new stdClass();
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1284,7 +1284,7 @@
 block discarded – undo
1284 1284
 	/**
1285 1285
 	 * Delete cached group data
1286 1286
 	 * @return void
1287
-	*/
1287
+	 */
1288 1288
 	function _deleteMemberGroupCache($site_srl = 0)
1289 1289
 	{
1290 1290
 		//remove from cache
Please login to merge, or discard this patch.
Spacing   +175 added lines, -175 removed lines patch added patch discarded remove patch
@@ -24,31 +24,31 @@  discard block
 block discarded – undo
24 24
 		// if(Context::getRequestMethod() == "GET") return new Object(-1, "msg_invalid_request");
25 25
 		// Extract the necessary information in advance
26 26
 		$logged_info = Context::get('logged_info');
27
-		if($logged_info->is_admin != 'Y' || !checkCSRF())
27
+		if ($logged_info->is_admin != 'Y' || !checkCSRF())
28 28
 		{
29 29
 			return new Object(-1, 'msg_invalid_request');
30 30
 		}
31 31
 
32
-		$args = Context::gets('member_srl','email_address','find_account_answer', 'allow_mailing','allow_message','denied','is_admin','description','group_srl_list','limit_date');
33
-		$oMemberModel = &getModel ('member');
34
-		$config = $oMemberModel->getMemberConfig ();
32
+		$args = Context::gets('member_srl', 'email_address', 'find_account_answer', 'allow_mailing', 'allow_message', 'denied', 'is_admin', 'description', 'group_srl_list', 'limit_date');
33
+		$oMemberModel = &getModel('member');
34
+		$config = $oMemberModel->getMemberConfig();
35 35
 		$getVars = array();
36
-		if($config->signupForm)
36
+		if ($config->signupForm)
37 37
 		{
38
-			foreach($config->signupForm as $formInfo)
38
+			foreach ($config->signupForm as $formInfo)
39 39
 			{
40
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
40
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
41 41
 				{
42 42
 					$getVars[] = $formInfo->name;
43 43
 				}
44 44
 			}
45 45
 		}
46
-		foreach($getVars as $val)
46
+		foreach ($getVars as $val)
47 47
 		{
48 48
 			$args->{$val} = Context::get($val);
49 49
 		}
50 50
 		$args->member_srl = Context::get('member_srl');
51
-		if(Context::get('reset_password'))
51
+		if (Context::get('reset_password'))
52 52
 			$args->password = Context::get('reset_password');
53 53
 		else unset($args->password);
54 54
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 		unset($all_args->error_return_url);
61 61
 		unset($all_args->success_return_url);
62 62
 		unset($all_args->ruleset);
63
-		if(!isset($args->limit_date)) $args->limit_date = "";
63
+		if (!isset($args->limit_date)) $args->limit_date = "";
64 64
 		unset($all_args->password);
65 65
 		unset($all_args->password2);
66 66
 		unset($all_args->reset_password);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 		$extra_vars = delObjectVars($all_args, $args);
69 69
 		$args->extra_vars = serialize($extra_vars);
70 70
 		// Check if an original member exists having the member_srl
71
-		if($args->member_srl)
71
+		if ($args->member_srl)
72 72
 		{
73 73
 			// Create a member model object
74 74
 			$oMemberModel = getModel('member');
@@ -76,14 +76,14 @@  discard block
 block discarded – undo
76 76
 			$columnList = array('member_srl');
77 77
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl, 0, $columnList);
78 78
 			// If no original member exists, make a new one
79
-			if($member_info->member_srl != $args->member_srl) unset($args->member_srl);
79
+			if ($member_info->member_srl != $args->member_srl) unset($args->member_srl);
80 80
 		}
81 81
 
82 82
 		// remove whitespace
83 83
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
84
-		foreach($checkInfos as $val)
84
+		foreach ($checkInfos as $val)
85 85
 		{
86
-			if(isset($args->{$val}))
86
+			if (isset($args->{$val}))
87 87
 			{
88 88
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
89 89
 			}
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 		$oMemberController = getController('member');
93 93
 		// Execute insert or update depending on the value of member_srl
94
-		if(!$args->member_srl)
94
+		if (!$args->member_srl)
95 95
 		{
96 96
 			$args->password = Context::get('password');
97 97
 			$output = $oMemberController->insertMember($args);
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 			$msg_code = 'success_updated';
104 104
 		}
105 105
 
106
-		if(!$output->toBool()) return $output;
106
+		if (!$output->toBool()) return $output;
107 107
 		// Save Signature
108 108
 		$signature = Context::get('signature');
109 109
 		$oMemberController->putSignature($args->member_srl, $signature);
@@ -112,13 +112,13 @@  discard block
 block discarded – undo
112 112
 		$this->setMessage($msg_code);
113 113
 
114 114
 		$profile_image = $_FILES['profile_image'];
115
-		if(is_uploaded_file($profile_image['tmp_name']))
115
+		if (is_uploaded_file($profile_image['tmp_name']))
116 116
 		{
117 117
 			$oMemberController->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
118 118
 		}
119 119
 
120 120
 		$image_mark = $_FILES['image_mark'];
121
-		if(is_uploaded_file($image_mark['tmp_name']))
121
+		if (is_uploaded_file($image_mark['tmp_name']))
122 122
 		{
123 123
 			$oMemberController->insertImageMark($args->member_srl, $image_mark['tmp_name']);
124 124
 		}
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
 
145 145
 		$oMemberController = getController('member');
146 146
 		$output = $oMemberController->deleteMember($member_srl);
147
-		if(!$output->toBool()) return $output;
147
+		if (!$output->toBool()) return $output;
148 148
 
149
-		$this->add('page',Context::get('page'));
149
+		$this->add('page', Context::get('page'));
150 150
 		$this->setMessage("success_deleted");
151 151
 	}
152 152
 
@@ -165,26 +165,26 @@  discard block
 block discarded – undo
165 165
 		);
166 166
 		
167 167
 		$oPassword = new Password();
168
-		if(!array_key_exists($args->password_hashing_algorithm, $oPassword->getSupportedAlgorithms()))
168
+		if (!array_key_exists($args->password_hashing_algorithm, $oPassword->getSupportedAlgorithms()))
169 169
 		{
170 170
 			$args->password_hashing_algorithm = 'md5';
171 171
 		}
172 172
 		
173 173
 		$args->password_hashing_work_factor = intval($args->password_hashing_work_factor, 10);
174
-		if($args->password_hashing_work_factor < 4)
174
+		if ($args->password_hashing_work_factor < 4)
175 175
 		{
176 176
 			$args->password_hashing_work_factor = 4;
177 177
 		}
178
-		if($args->password_hashing_work_factor > 16)
178
+		if ($args->password_hashing_work_factor > 16)
179 179
 		{
180 180
 			$args->password_hashing_work_factor = 16;
181 181
 		}
182
-		if($args->password_hashing_auto_upgrade != 'Y')
182
+		if ($args->password_hashing_auto_upgrade != 'Y')
183 183
 		{
184 184
 			$args->password_hashing_auto_upgrade = 'N';
185 185
 		}
186 186
 
187
-		if((!$args->webmaster_name || !$args->webmaster_email) && $args->enable_confirm == 'Y')
187
+		if ((!$args->webmaster_name || !$args->webmaster_email) && $args->enable_confirm == 'Y')
188 188
 		{
189 189
 			return new Object(-1, 'msg_mail_authorization');
190 190
 		}
@@ -219,20 +219,20 @@  discard block
 block discarded – undo
219 219
 		$usable_list = Context::get('usable_list');
220 220
 		$all_args = Context::getRequestVars();
221 221
 
222
-		$args->limit_day = (int)$args->limit_day;
223
-		if(!trim(strip_tags($args->agreement)))
222
+		$args->limit_day = (int) $args->limit_day;
223
+		if (!trim(strip_tags($args->agreement)))
224 224
 		{
225
-			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
225
+			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt';
226 226
 			FileHandler::removeFile($agreement_file);
227 227
 			$args->agreement = NULL;
228 228
 		}
229 229
 
230
-		if($args->redirect_url)
230
+		if ($args->redirect_url)
231 231
 		{
232 232
 			$oModuleModel = getModel('module');
233 233
 			$redirectModuleInfo = $oModuleModel->getModuleInfoByModuleSrl($args->redirect_url, array('mid'));
234 234
 
235
-			if(!$redirectModuleInfo)
235
+			if (!$redirectModuleInfo)
236 236
 			{
237 237
 				return new Object('-1', 'msg_exist_selected_module');
238 238
 			}
@@ -256,28 +256,28 @@  discard block
 block discarded – undo
256 256
 		$items = array('user_id', 'password', 'user_name', 'nick_name', 'email_address', 'find_account_question', 'homepage', 'blog', 'birthday', 'signature', 'profile_image', 'image_name', 'image_mark', 'profile_image_max_width', 'profile_image_max_height', 'image_name_max_width', 'image_name_max_height', 'image_mark_max_width', 'image_mark_max_height');
257 257
 		$mustRequireds = array('email_address', 'nick_name', 'password', 'find_account_question');
258 258
 		$extendItems = $oMemberModel->getJoinFormList();
259
-		foreach($list_order as $key)
259
+		foreach ($list_order as $key)
260 260
 		{
261 261
 			$signupItem = new stdClass();
262 262
 			$signupItem->isIdentifier = ($key == $all_args->identifier);
263 263
 			$signupItem->isDefaultForm = in_array($key, $items);
264 264
 
265 265
 			$signupItem->name = $key;
266
-			if(!in_array($key, $items)) $signupItem->title = $key;
266
+			if (!in_array($key, $items)) $signupItem->title = $key;
267 267
 			else $signupItem->title = $lang->{$key};
268 268
 			$signupItem->mustRequired = in_array($key, $mustRequireds);
269 269
 			$signupItem->imageType = (strpos($key, 'image') !== false);
270 270
 			$signupItem->required = ($all_args->{$key} == 'required') || $signupItem->mustRequired || $signupItem->isIdentifier;
271 271
 			$signupItem->isUse = in_array($key, $usable_list) || $signupItem->required;
272 272
 			$signupItem->isPublic = ($all_args->{'is_'.$key.'_public'} == 'Y' && $signupItem->isUse) ? 'Y' : 'N';
273
-			if($signupItem->imageType)
273
+			if ($signupItem->imageType)
274 274
 			{
275 275
 				$signupItem->max_width = $all_args->{$key.'_max_width'};
276 276
 				$signupItem->max_height = $all_args->{$key.'_max_height'};
277 277
 			}
278 278
 
279 279
 			// set extends form
280
-			if(!$signupItem->isDefaultForm)
280
+			if (!$signupItem->isDefaultForm)
281 281
 			{
282 282
 				$extendItem = $extendItems[$all_args->{$key.'_member_join_form_srl'}];
283 283
 				$signupItem->type = $extendItem->column_type;
@@ -286,13 +286,13 @@  discard block
 block discarded – undo
286 286
 				$signupItem->description = $extendItem->description;
287 287
 
288 288
 				// check usable value change, required/option
289
-				if($signupItem->isUse != ($extendItem->is_active == 'Y') || $signupItem->required != ($extendItem->required == 'Y'))
289
+				if ($signupItem->isUse != ($extendItem->is_active == 'Y') || $signupItem->required != ($extendItem->required == 'Y'))
290 290
 				{
291 291
 					unset($update_args);
292 292
 					$update_args = new stdClass;
293 293
 					$update_args->member_join_form_srl = $extendItem->member_join_form_srl;
294
-					$update_args->is_active = $signupItem->isUse?'Y':'N';
295
-					$update_args->required = $signupItem->required?'Y':'N';
294
+					$update_args->is_active = $signupItem->isUse ? 'Y' : 'N';
295
+					$update_args->required = $signupItem->required ? 'Y' : 'N';
296 296
 
297 297
 					$update_output = executeQuery('member.updateJoinForm', $update_args);
298 298
 				}
@@ -309,9 +309,9 @@  discard block
 block discarded – undo
309 309
 		$this->_createFindAccountByQuestion($args->identifier);
310 310
 
311 311
 		// check agreement value exist
312
-		if($args->agreement)
312
+		if ($args->agreement)
313 313
 		{
314
-			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
314
+			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt';
315 315
 			$output = FileHandler::writeFile($agreement_file, $args->agreement);
316 316
 
317 317
 			unset($args->agreement);
@@ -339,16 +339,16 @@  discard block
 block discarded – undo
339 339
 			'after_logout_url'
340 340
 		);
341 341
 
342
-		if(!$args->change_password_date)
342
+		if (!$args->change_password_date)
343 343
 		{
344 344
 			$args->change_password_date = 0;
345 345
 		}
346 346
 
347
-		if(!trim(strip_tags($args->after_login_url)))
347
+		if (!trim(strip_tags($args->after_login_url)))
348 348
 		{
349 349
 			$args->after_login_url = NULL;
350 350
 		}
351
-		if(!trim(strip_tags($args->after_logout_url)))
351
+		if (!trim(strip_tags($args->after_logout_url)))
352 352
 		{
353 353
 			$args->after_logout_url = NULL;
354 354
 		}
@@ -375,17 +375,17 @@  discard block
 block discarded – undo
375 375
 		);
376 376
 
377 377
 		$args->layout_srl = $args->layout_srl ? $args->layout_srl : NULL;
378
-		if(!$args->skin)
378
+		if (!$args->skin)
379 379
 		{
380 380
 			$args->skin = 'default';
381 381
 		}
382
-		if(!$args->colorset)
382
+		if (!$args->colorset)
383 383
 		{
384 384
 			$args->colorset = 'white';
385 385
 		}
386 386
 
387 387
 		$args->mlayout_srl = $args->mlayout_srl ? $args->mlayout_srl : NULL;
388
-		if(!$args->mskin)
388
+		if (!$args->mskin)
389 389
 		{
390 390
 			$args->mskin = 'default';
391 391
 		}
@@ -408,12 +408,12 @@  discard block
 block discarded – undo
408 408
 		$extendItems = $oMemberModel->getJoinFormList();
409 409
 
410 410
 		$items = array('user_id', 'password', 'user_name', 'nick_name', 'email_address', 'find_account_question', 'homepage', 'blog', 'birthday', 'signature', 'profile_image', 'image_name', 'image_mark');
411
-		$mustRequireds = array('email_address', 'nick_name','password', 'find_account_question');
411
+		$mustRequireds = array('email_address', 'nick_name', 'password', 'find_account_question');
412 412
 		$orgRequireds = array('email_address', 'password', 'find_account_question', 'user_id', 'nick_name', 'user_name');
413 413
 		$orgUse = array('email_address', 'password', 'find_account_question', 'user_id', 'nick_name', 'user_name', 'homepage', 'blog', 'birthday');
414 414
 		$list_order = array();
415 415
 
416
-		foreach($items as $key)
416
+		foreach ($items as $key)
417 417
 		{
418 418
 			unset($signupItem);
419 419
 			$signupItem = new stdClass;
@@ -425,23 +425,23 @@  discard block
 block discarded – undo
425 425
 			$signupItem->required = in_array($key, $orgRequireds);
426 426
 			$signupItem->isUse = ($config->{$key} == 'Y') || in_array($key, $orgUse);
427 427
 			$signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N';
428
-			if($key == 'find_account_question' || $key == 'password')
428
+			if ($key == 'find_account_question' || $key == 'password')
429 429
 			{
430 430
 				$signupItem->isPublic = 'N';
431 431
 			}
432 432
 			$signupItem->isIdentifier = ($key == $identifier);
433
-			if ($signupItem->imageType){
433
+			if ($signupItem->imageType) {
434 434
 				$signupItem->max_width = $config->{$key.'_max_width'};
435 435
 				$signupItem->max_height = $config->{$key.'_max_height'};
436 436
 			}
437
-			if($signupItem->isIdentifier)
437
+			if ($signupItem->isIdentifier)
438 438
 				array_unshift($list_order, $signupItem);
439 439
 			else
440 440
 				$list_order[] = $signupItem;
441 441
 		}
442
-		if(is_array($extendItems))
442
+		if (is_array($extendItems))
443 443
 		{
444
-			foreach($extendItems as $form_srl=>$item_info)
444
+			foreach ($extendItems as $form_srl=>$item_info)
445 445
 			{
446 446
 				unset($signupItem);
447 447
 				$signupItem = new stdClass;
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 				$signupItem->isUse = ($item_info->is_active == 'Y');
455 455
 				$signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N';
456 456
 				$signupItem->description = $item_info->description;
457
-				if($signupItem->imageType)
457
+				if ($signupItem->imageType)
458 458
 				{
459 459
 					$signupItem->max_width = $config->{$key.'_max_width'};
460 460
 					$signupItem->max_height = $config->{$key.'_max_height'};
@@ -472,13 +472,13 @@  discard block
 block discarded – undo
472 472
 	 * @param string $agreement
473 473
 	 * @return void
474 474
 	 */
475
-	function _createSignupRuleset($signupForm, $agreement = null){
475
+	function _createSignupRuleset($signupForm, $agreement = null) {
476 476
 		$xml_file = './files/ruleset/insertMember.xml';
477
-		$buff = '<?xml version="1.0" encoding="utf-8"?>' . PHP_EOL.
478
-			'<ruleset version="1.5.0">' . PHP_EOL.
479
-			'<customrules>' . PHP_EOL.
480
-			'</customrules>' . PHP_EOL.
481
-			'<fields>' . PHP_EOL . '%s' . PHP_EOL . '</fields>' . PHP_EOL.
477
+		$buff = '<?xml version="1.0" encoding="utf-8"?>'.PHP_EOL.
478
+			'<ruleset version="1.5.0">'.PHP_EOL.
479
+			'<customrules>'.PHP_EOL.
480
+			'</customrules>'.PHP_EOL.
481
+			'<fields>'.PHP_EOL.'%s'.PHP_EOL.'</fields>'.PHP_EOL.
482 482
 			'</ruleset>';
483 483
 
484 484
 		$fields = array();
@@ -487,41 +487,41 @@  discard block
 block discarded – undo
487 487
 		{
488 488
 			$fields[] = '<field name="accept_agreement"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /></field>';
489 489
 		}
490
-		foreach($signupForm as $formInfo)
490
+		foreach ($signupForm as $formInfo)
491 491
 		{
492
-			if($formInfo->required || $formInfo->mustRequired)
492
+			if ($formInfo->required || $formInfo->mustRequired)
493 493
 			{
494
-				if($formInfo->type == 'tel' || $formInfo->type == 'kr_zip')
494
+				if ($formInfo->type == 'tel' || $formInfo->type == 'kr_zip')
495 495
 				{
496 496
 					$fields[] = sprintf('<field name="%s[]" required="true" />', $formInfo->name);
497 497
 				}
498
-				else if($formInfo->name == 'password')
498
+				else if ($formInfo->name == 'password')
499 499
 				{
500 500
 					$fields[] = '<field name="password"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="length" value="4:60" /></field>';
501 501
 					$fields[] = '<field name="password2"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="equalto" value="password" /></field>';
502 502
 				}
503
-				else if($formInfo->name == 'find_account_question')
503
+				else if ($formInfo->name == 'find_account_question')
504 504
 				{
505 505
 					$fields[] = '<field name="find_account_question" required="true" />';
506 506
 					$fields[] = '<field name="find_account_answer" required="true" length=":250" />';
507 507
 				}
508
-				else if($formInfo->name == 'email_address')
508
+				else if ($formInfo->name == 'email_address')
509 509
 				{
510 510
 					$fields[] = sprintf('<field name="%s" required="true" rule="email"/>', $formInfo->name);
511 511
 				}
512
-				else if($formInfo->name == 'user_id')
512
+				else if ($formInfo->name == 'user_id')
513 513
 				{
514 514
 					$fields[] = sprintf('<field name="%s" required="true" rule="userid" length="3:20" />', $formInfo->name);
515 515
 				}
516
-				else if($formInfo->name == 'nick_name')
516
+				else if ($formInfo->name == 'nick_name')
517 517
 				{
518 518
 					$fields[] = sprintf('<field name="%s" required="true" length="2:20" />', $formInfo->name);
519 519
 				}
520
-				else if(strpos($formInfo->name, 'image') !== false)
520
+				else if (strpos($formInfo->name, 'image') !== false)
521 521
 				{
522 522
 					$fields[] = sprintf('<field name="%s"><if test="$act != \'procMemberAdminInsert\' &amp;&amp; $__%s_exist != \'true\'" attr="required" value="true" /></field>', $formInfo->name, $formInfo->name);
523 523
 				}
524
-				else if($formInfo->name == 'signature')
524
+				else if ($formInfo->name == 'signature')
525 525
 				{
526 526
 					$fields[] = '<field name="signature"><if test="$member_srl" attr="required" value="true" /></field>';
527 527
 				}
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 		FileHandler::writeFile($xml_file, $xml_buff);
537 537
 		unset($xml_buff);
538 538
 
539
-		$validator   = new Validator($xml_file);
539
+		$validator = new Validator($xml_file);
540 540
 		$validator->setCacheDir('files/cache');
541 541
 		$validator->getJsPath();
542 542
 	}
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
 		$xml_buff = sprintf($buff, implode('', $fields));
565 565
 		Filehandler::writeFile($xml_file, $xml_buff);
566 566
 
567
-		$validator   = new Validator($xml_file);
567
+		$validator = new Validator($xml_file);
568 568
 		$validator->setCacheDir('files/cache');
569 569
 		$validator->getJsPath();
570 570
 	}
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
 			'</ruleset>';
586 586
 
587 587
 		$fields = array();
588
-		if($identifier == 'user_id')
588
+		if ($identifier == 'user_id')
589 589
 			$fields[] = '<field name="user_id" required="true" rule="userid" />';
590 590
 
591 591
 		$fields[] = '<field name="email_address" required="true" rule="email" />';
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 		$xml_buff = sprintf($buff, implode('', $fields));
596 596
 		Filehandler::writeFile($xml_file, $xml_buff);
597 597
 
598
-		$validator   = new Validator($xml_file);
598
+		$validator = new Validator($xml_file);
599 599
 		$validator->setCacheDir('files/cache');
600 600
 		$validator->getJsPath();
601 601
 	}
@@ -606,12 +606,12 @@  discard block
 block discarded – undo
606 606
 	 */
607 607
 	function procMemberAdminInsertGroup()
608 608
 	{
609
-		$args = Context::gets('title','description','is_default','image_mark');
609
+		$args = Context::gets('title', 'description', 'is_default', 'image_mark');
610 610
 		$output = $this->insertGroup($args);
611
-		if(!$output->toBool()) return $output;
611
+		if (!$output->toBool()) return $output;
612 612
 
613
-		$this->add('group_srl','');
614
-		$this->add('page',Context::get('page'));
613
+		$this->add('group_srl', '');
614
+		$this->add('page', Context::get('page'));
615 615
 		$this->setMessage('success_registed');
616 616
 
617 617
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList');
@@ -626,13 +626,13 @@  discard block
 block discarded – undo
626 626
 	{
627 627
 		$group_srl = Context::get('group_srl');
628 628
 
629
-		$args = Context::gets('group_srl','title','description','is_default','image_mark');
629
+		$args = Context::gets('group_srl', 'title', 'description', 'is_default', 'image_mark');
630 630
 		$args->site_srl = 0;
631 631
 		$output = $this->updateGroup($args);
632
-		if(!$output->toBool()) return $output;
632
+		if (!$output->toBool()) return $output;
633 633
 
634
-		$this->add('group_srl','');
635
-		$this->add('page',Context::get('page'));
634
+		$this->add('group_srl', '');
635
+		$this->add('page', Context::get('page'));
636 636
 		$this->setMessage('success_updated');
637 637
 
638 638
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList');
@@ -648,10 +648,10 @@  discard block
 block discarded – undo
648 648
 		$group_srl = Context::get('group_srl');
649 649
 
650 650
 		$output = $this->deleteGroup($group_srl);
651
-		if(!$output->toBool()) return $output;
651
+		if (!$output->toBool()) return $output;
652 652
 
653
-		$this->add('group_srl','');
654
-		$this->add('page',Context::get('page'));
653
+		$this->add('group_srl', '');
654
+		$this->add('page', Context::get('page'));
655 655
 		$this->setMessage('success_deleted');
656 656
 
657 657
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList');
@@ -673,10 +673,10 @@  discard block
 block discarded – undo
673 673
 		$args->default_value = explode("\n", str_replace("\r", '', Context::get('default_value')));
674 674
 		$args->required = Context::get('required');
675 675
 		$args->is_active = (isset($args->required));
676
-		if(!in_array(strtoupper($args->required), array('Y','N')))$args->required = 'N';
676
+		if (!in_array(strtoupper($args->required), array('Y', 'N')))$args->required = 'N';
677 677
 		$args->description = Context::get('description') ? Context::get('description') : '';
678 678
 		// Default values
679
-		if(in_array($args->column_type, array('checkbox','select','radio')) && count($args->default_value))
679
+		if (in_array($args->column_type, array('checkbox', 'select', 'radio')) && count($args->default_value))
680 680
 		{
681 681
 			$args->default_value = serialize($args->default_value);
682 682
 		}
@@ -688,17 +688,17 @@  discard block
 block discarded – undo
688 688
 		// Check ID duplicated
689 689
 		$oMemberModel = getModel('member');
690 690
 		$config = $oMemberModel->getMemberConfig();
691
-		foreach($config->signupForm as $item)
691
+		foreach ($config->signupForm as $item)
692 692
 		{
693
-			if($item->name == $args->column_name)
693
+			if ($item->name == $args->column_name)
694 694
 			{
695
-				if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue;
696
-				return new Object(-1,'msg_exists_user_id');
695
+				if ($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue;
696
+				return new Object(-1, 'msg_exists_user_id');
697 697
 			}
698 698
 		}
699 699
 		// Fix if member_join_form_srl exists. Add if not exists.
700 700
 		$isInsert;
701
-		if(!$args->member_join_form_srl)
701
+		if (!$args->member_join_form_srl)
702 702
 		{
703 703
 			$isInsert = true;
704 704
 			$args->list_order = $args->member_join_form_srl = getNextSequence();
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 			$output = executeQuery('member.updateJoinForm', $args);
710 710
 		}
711 711
 
712
-		if(!$output->toBool()) return $output;
712
+		if (!$output->toBool()) return $output;
713 713
 
714 714
 		// memberConfig update
715 715
 		$signupItem = new stdClass();
@@ -726,15 +726,15 @@  discard block
 block discarded – undo
726 726
 		$config = $oMemberModel->getMemberConfig();
727 727
 		unset($config->agreement);
728 728
 
729
-		if($isInsert)
729
+		if ($isInsert)
730 730
 		{
731 731
 			$config->signupForm[] = $signupItem;
732 732
 		}
733 733
 		else
734 734
 		{
735
-			foreach($config->signupForm as $key=>$val)
735
+			foreach ($config->signupForm as $key=>$val)
736 736
 			{
737
-				if($val->member_join_form_srl == $signupItem->member_join_form_srl)
737
+				if ($val->member_join_form_srl == $signupItem->member_join_form_srl)
738 738
 				{
739 739
 					$config->signupForm[$key] = $signupItem;
740 740
 				}
@@ -762,9 +762,9 @@  discard block
 block discarded – undo
762 762
 		$config = $oMemberModel->getMemberConfig();
763 763
 		unset($config->agreement);
764 764
 
765
-		foreach($config->signupForm as $key=>$val)
765
+		foreach ($config->signupForm as $key=>$val)
766 766
 		{
767
-			if($val->member_join_form_srl == $member_join_form_srl)
767
+			if ($val->member_join_form_srl == $member_join_form_srl)
768 768
 			{
769 769
 				unset($config->signupForm[$key]);
770 770
 				break;
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
 		$member_join_form_srl = Context::get('member_join_form_srl');
785 785
 		$mode = Context::get('mode');
786 786
 
787
-		switch($mode)
787
+		switch ($mode)
788 788
 		{
789 789
 			case 'up' :
790 790
 				$output = $this->moveJoinFormUp($member_join_form_srl);
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
 			case 'update' :
802 802
 				break;
803 803
 		}
804
-		if(!$output->toBool()) return $output;
804
+		if (!$output->toBool()) return $output;
805 805
 
806 806
 		$this->setMessage($msg_code);
807 807
 	}
@@ -820,40 +820,40 @@  discard block
 block discarded – undo
820 820
 		$oDB->begin();
821 821
 
822 822
 		$oMemberController = getController('member');
823
-		foreach($members as $key=>$member_srl)
823
+		foreach ($members as $key=>$member_srl)
824 824
 		{
825 825
 			$args = new stdClass();
826 826
 			$args->member_srl = $member_srl;
827
-			switch($var->type)
827
+			switch ($var->type)
828 828
 			{
829 829
 				case 'modify':
830 830
 					{
831
-						if(count($groups) > 0)
831
+						if (count($groups) > 0)
832 832
 						{
833 833
 							$args->site_srl = 0;
834 834
 							// One of its members to delete all the group
835 835
 							$output = executeQuery('member.deleteMemberGroupMember', $args);
836
-							if(!$output->toBool())
836
+							if (!$output->toBool())
837 837
 							{
838 838
 								$oDB->rollback();
839 839
 								return $output;
840 840
 							}
841 841
 							// Enter one of the loop a
842
-							foreach($groups as $group_srl)
842
+							foreach ($groups as $group_srl)
843 843
 							{
844
-								$output = $oMemberController->addMemberToGroup($args->member_srl,$group_srl);
845
-								if(!$output->toBool())
844
+								$output = $oMemberController->addMemberToGroup($args->member_srl, $group_srl);
845
+								if (!$output->toBool())
846 846
 								{
847 847
 									$oDB->rollback();
848 848
 									return $output;
849 849
 								}
850 850
 							}
851 851
 						}
852
-						if($var->denied)
852
+						if ($var->denied)
853 853
 						{
854 854
 							$args->denied = $var->denied;
855 855
 							$output = executeQuery('member.updateMemberDeniedInfo', $args);
856
-							if(!$output->toBool())
856
+							if (!$output->toBool())
857 857
 							{
858 858
 								$oDB->rollback();
859 859
 								return $output;
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
 					{
867 867
 						$oMemberController->memberInfo = null;
868 868
 						$output = $oMemberController->deleteMember($member_srl);
869
-						if(!$output->toBool())
869
+						if (!$output->toBool())
870 870
 						{
871 871
 							$oDB->rollback();
872 872
 							return $output;
@@ -879,15 +879,15 @@  discard block
 block discarded – undo
879 879
 
880 880
 		$message = $var->message;
881 881
 		// Send a message
882
-		if($message)
882
+		if ($message)
883 883
 		{
884 884
 			$oCommunicationController = getController('communication');
885 885
 
886 886
 			$logged_info = Context::get('logged_info');
887
-			$title = cut_str($message,10,'...');
887
+			$title = cut_str($message, 10, '...');
888 888
 			$sender_member_srl = $logged_info->member_srl;
889 889
 
890
-			foreach($members as $member_srl)
890
+			foreach ($members as $member_srl)
891 891
 			{
892 892
 				$oCommunicationController->sendMessage($sender_member_srl, $member_srl, $title, $message, false);
893 893
 			}
@@ -904,14 +904,14 @@  discard block
 block discarded – undo
904 904
 	function procMemberAdminDeleteMembers()
905 905
 	{
906 906
 		$target_member_srls = Context::get('target_member_srls');
907
-		if(!$target_member_srls) return new Object(-1, 'msg_invalid_request');
907
+		if (!$target_member_srls) return new Object(-1, 'msg_invalid_request');
908 908
 		$member_srls = explode(',', $target_member_srls);
909 909
 		$oMemberController = getController('member');
910 910
 
911
-		foreach($member_srls as $member)
911
+		foreach ($member_srls as $member)
912 912
 		{
913 913
 			$output = $oMemberController->deleteMember($member);
914
-			if(!$output->toBool())
914
+			if (!$output->toBool())
915 915
 			{
916 916
 				$this->setMessage('failed_deleted');
917 917
 				return $output;
@@ -928,11 +928,11 @@  discard block
 block discarded – undo
928 928
 	function procMemberAdminUpdateMembersGroup()
929 929
 	{
930 930
 		$member_srl = Context::get('member_srl');
931
-		if(!$member_srl) return new Object(-1,'msg_invalid_request');
932
-		$member_srls = explode(',',$member_srl);
931
+		if (!$member_srl) return new Object(-1, 'msg_invalid_request');
932
+		$member_srls = explode(',', $member_srl);
933 933
 
934 934
 		$group_srl = Context::get('group_srls');
935
-		if(!is_array($group_srl)) $group_srls = explode('|@|', $group_srl);
935
+		if (!is_array($group_srl)) $group_srls = explode('|@|', $group_srl);
936 936
 		else $group_srls = $group_srl;
937 937
 
938 938
 		$oDB = &DB::getInstance();
@@ -941,7 +941,7 @@  discard block
 block discarded – undo
941 941
 		$args = new stdClass;
942 942
 		$args->member_srl = $member_srl;
943 943
 		$output = executeQuery('member.deleteMembersGroup', $args);
944
-		if(!$output->toBool())
944
+		if (!$output->toBool())
945 945
 		{
946 946
 			$oDB->rollback();
947 947
 			return $output;
@@ -949,21 +949,21 @@  discard block
 block discarded – undo
949 949
 		// Add to a selected group
950 950
 		$group_count = count($group_srls);
951 951
 		$member_count = count($member_srls);
952
-		for($j=0;$j<$group_count;$j++)
952
+		for ($j = 0; $j < $group_count; $j++)
953 953
 		{
954
-			$group_srl = (int)trim($group_srls[$j]);
955
-			if(!$group_srl) continue;
956
-			for($i=0;$i<$member_count;$i++)
954
+			$group_srl = (int) trim($group_srls[$j]);
955
+			if (!$group_srl) continue;
956
+			for ($i = 0; $i < $member_count; $i++)
957 957
 			{
958
-				$member_srl = (int)trim($member_srls[$i]);
959
-				if(!$member_srl) continue;
958
+				$member_srl = (int) trim($member_srls[$i]);
959
+				if (!$member_srl) continue;
960 960
 
961 961
 				$args = new stdClass;
962 962
 				$args->member_srl = $member_srl;
963 963
 				$args->group_srl = $group_srl;
964 964
 
965 965
 				$output = executeQuery('member.addMemberToGroup', $args);
966
-				if(!$output->toBool())
966
+				if (!$output->toBool())
967 967
 				{
968 968
 					$oDB->rollback();
969 969
 					return $output;
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
 
977 977
 		$this->setMessage('success_updated');
978 978
 
979
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
979
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
980 980
 		{
981 981
 			global $lang;
982 982
 			htmlHeader();
@@ -997,19 +997,19 @@  discard block
 block discarded – undo
997 997
 	{
998 998
 		$user_ids = Context::get('user_id');
999 999
 
1000
-		$user_ids = explode(',',$user_ids);
1000
+		$user_ids = explode(',', $user_ids);
1001 1001
 		$success_ids = array();
1002 1002
 
1003
-		foreach($user_ids as $val)
1003
+		foreach ($user_ids as $val)
1004 1004
 		{
1005 1005
 			$val = trim($val);
1006
-			if(!$val) continue;
1006
+			if (!$val) continue;
1007 1007
 
1008 1008
 			$output = $this->insertDeniedID($val, '');
1009
-			if($output->toBool()) $success_ids[] = $val;
1009
+			if ($output->toBool()) $success_ids[] = $val;
1010 1010
 		}
1011 1011
 
1012
-		$this->add('user_ids', implode(',',$success_ids));
1012
+		$this->add('user_ids', implode(',', $success_ids));
1013 1013
 
1014 1014
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminDeniedIDList');
1015 1015
 		$this->setRedirectUrl($returnUrl);
@@ -1026,10 +1026,10 @@  discard block
 block discarded – undo
1026 1026
 		$mode = Context::get('mode');
1027 1027
 		$mode = $mode ? $mode : 'insert';
1028 1028
 
1029
-		if($mode == 'delete')
1029
+		if ($mode == 'delete')
1030 1030
 		{
1031 1031
 			$output = $this->deleteDeniedNickName($nick_name);
1032
-			if(!$output->toBool())
1032
+			if (!$output->toBool())
1033 1033
 			{
1034 1034
 				return $output;
1035 1035
 			}
@@ -1038,19 +1038,19 @@  discard block
 block discarded – undo
1038 1038
 		}
1039 1039
 		else
1040 1040
 		{
1041
-			$nick_names = explode(',',$nick_name);
1041
+			$nick_names = explode(',', $nick_name);
1042 1042
 			$success_nick_names = array();
1043 1043
 
1044
-			foreach($nick_names as $val)
1044
+			foreach ($nick_names as $val)
1045 1045
 			{
1046 1046
 				$val = trim($val);
1047
-				if(!$val) continue;
1047
+				if (!$val) continue;
1048 1048
 
1049 1049
 				$output = $this->insertDeniedNickName($val, '');
1050
-				if($output->toBool()) $success_nick_names[] = $val;
1050
+				if ($output->toBool()) $success_nick_names[] = $val;
1051 1051
 			}
1052 1052
 
1053
-			$this->add('nick_names', implode(',',$success_nick_names));
1053
+			$this->add('nick_names', implode(',', $success_nick_names));
1054 1054
 		}
1055 1055
 	}
1056 1056
 
@@ -1063,16 +1063,16 @@  discard block
 block discarded – undo
1063 1063
 		$user_id = Context::get('user_id');
1064 1064
 		$mode = Context::get('mode');
1065 1065
 
1066
-		switch($mode)
1066
+		switch ($mode)
1067 1067
 		{
1068 1068
 			case 'delete' :
1069 1069
 				$output = $this->deleteDeniedID($user_id);
1070
-				if(!$output->toBool()) return $output;
1070
+				if (!$output->toBool()) return $output;
1071 1071
 				$msg_code = 'success_deleted';
1072 1072
 				break;
1073 1073
 		}
1074 1074
 
1075
-		$this->add('page',Context::get('page'));
1075
+		$this->add('page', Context::get('page'));
1076 1076
 		$this->setMessage($msg_code);
1077 1077
 	}
1078 1078
 
@@ -1119,24 +1119,24 @@  discard block
 block discarded – undo
1119 1119
 	 */
1120 1120
 	function insertGroup($args)
1121 1121
 	{
1122
-		if(!$args->site_srl) $args->site_srl = 0;
1122
+		if (!$args->site_srl) $args->site_srl = 0;
1123 1123
 		// Check the value of is_default.
1124
-		if($args->is_default != 'Y')
1124
+		if ($args->is_default != 'Y')
1125 1125
 		{
1126 1126
 			$args->is_default = 'N';
1127 1127
 		}
1128 1128
 		else
1129 1129
 		{
1130 1130
 			$output = executeQuery('member.updateGroupDefaultClear', $args);
1131
-			if(!$output->toBool()) return $output;
1131
+			if (!$output->toBool()) return $output;
1132 1132
 		}
1133 1133
 
1134
-		if(!isset($args->list_order) || $args->list_order=='')
1134
+		if (!isset($args->list_order) || $args->list_order == '')
1135 1135
 		{
1136 1136
 			$args->list_order = $args->group_srl;
1137 1137
 		}
1138 1138
 
1139
-		if(!$args->group_srl) $args->group_srl = getNextSequence();
1139
+		if (!$args->group_srl) $args->group_srl = getNextSequence();
1140 1140
 		$args->list_order = $args->group_srl;
1141 1141
 		$output = executeQuery('member.insertGroup', $args);
1142 1142
 		$this->_deleteMemberGroupCache($args->site_srl);
@@ -1151,17 +1151,17 @@  discard block
 block discarded – undo
1151 1151
 	 */
1152 1152
 	function updateGroup($args)
1153 1153
 	{
1154
-		if(!$args->site_srl) $args->site_srl = 0;
1154
+		if (!$args->site_srl) $args->site_srl = 0;
1155 1155
 		// Check the value of is_default.
1156
-		if(!$args->group_srl) return new Object(-1, 'lang->msg_not_founded');
1157
-		if($args->is_default!='Y')
1156
+		if (!$args->group_srl) return new Object(-1, 'lang->msg_not_founded');
1157
+		if ($args->is_default != 'Y')
1158 1158
 		{
1159 1159
 			$args->is_default = 'N';
1160 1160
 		}
1161 1161
 		else
1162 1162
 		{
1163 1163
 			$output = executeQuery('member.updateGroupDefaultClear', $args);
1164
-			if(!$output->toBool()) return $output;
1164
+			if (!$output->toBool()) return $output;
1165 1165
 		}
1166 1166
 
1167 1167
 		$output = executeQuery('member.updateGroup', $args);
@@ -1184,8 +1184,8 @@  discard block
 block discarded – undo
1184 1184
 		$columnList = array('group_srl', 'is_default');
1185 1185
 		$group_info = $oMemberModel->getGroup($group_srl, $columnList);
1186 1186
 
1187
-		if(!$group_info) return new Object(-1, 'lang->msg_not_founded');
1188
-		if($group_info->is_default == 'Y') return new Object(-1, 'msg_not_delete_default');
1187
+		if (!$group_info) return new Object(-1, 'lang->msg_not_founded');
1188
+		if ($group_info->is_default == 'Y') return new Object(-1, 'msg_not_delete_default');
1189 1189
 
1190 1190
 		// Get groups where is_default == 'Y'
1191 1191
 		$columnList = array('site_srl', 'group_srl');
@@ -1222,7 +1222,7 @@  discard block
 block discarded – undo
1222 1222
 		$defaultGroup = $oMemberModel->getDefaultGroup(0);
1223 1223
 		$defaultGroupSrl = $defaultGroup->group_srl;
1224 1224
 		$group_srls = $vars->group_srls;
1225
-		foreach($group_srls as $order=>$group_srl)
1225
+		foreach ($group_srls as $order=>$group_srl)
1226 1226
 		{
1227 1227
 			$isInsert = false;
1228 1228
 			$update_args = new stdClass();
@@ -1231,9 +1231,9 @@  discard block
 block discarded – undo
1231 1231
 			$update_args->image_mark = $vars->image_marks[$order];
1232 1232
 			$update_args->list_order = $order + 1;
1233 1233
 
1234
-			if(!$update_args->title) continue;
1234
+			if (!$update_args->title) continue;
1235 1235
 
1236
-			if(is_numeric($group_srl)) {
1236
+			if (is_numeric($group_srl)) {
1237 1237
 				$update_args->group_srl = $group_srl;
1238 1238
 				$output = $this->updateGroup($update_args);
1239 1239
 			}
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
 				$output = $this->insertGroup($update_args);
1243 1243
 			}
1244 1244
 
1245
-			if($vars->defaultGroup == $group_srl) {
1245
+			if ($vars->defaultGroup == $group_srl) {
1246 1246
 				$defaultGroupSrl = $update_args->group_srl;
1247 1247
 			}
1248 1248
 		}
@@ -1268,7 +1268,7 @@  discard block
 block discarded – undo
1268 1268
 	{
1269 1269
 		$vars = Context::getRequestVars();
1270 1270
 
1271
-		foreach($vars->group_srls as $key => $val)
1271
+		foreach ($vars->group_srls as $key => $val)
1272 1272
 		{
1273 1273
 			$args = new stdClass;
1274 1274
 			$args->group_srl = $val;
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
 	{
1290 1290
 		//remove from cache
1291 1291
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
1292
-		if($oCacheHandler->isSupport())
1292
+		if ($oCacheHandler->isSupport())
1293 1293
 		{
1294 1294
 			$oCacheHandler->invalidateGroupKey('member');
1295 1295
 		}
@@ -1306,7 +1306,7 @@  discard block
 block discarded – undo
1306 1306
 		$args = new stdClass();
1307 1307
 		$args->user_id = $user_id;
1308 1308
 		$args->description = $description;
1309
-		$args->list_order = -1*getNextSequence();
1309
+		$args->list_order = -1 * getNextSequence();
1310 1310
 
1311 1311
 		return executeQuery('member.insertDeniedID', $args);
1312 1312
 	}
@@ -1327,7 +1327,7 @@  discard block
 block discarded – undo
1327 1327
 	 */
1328 1328
 	function deleteDeniedID($user_id)
1329 1329
 	{
1330
-		if(!$user_id) unset($user_id);
1330
+		if (!$user_id) unset($user_id);
1331 1331
 
1332 1332
 		$args = new stdClass;
1333 1333
 		$args->user_id = $user_id;
@@ -1341,7 +1341,7 @@  discard block
 block discarded – undo
1341 1341
 	 */
1342 1342
 	function deleteDeniedNickName($nick_name)
1343 1343
 	{
1344
-		if(!$nick_name) unset($nick_name);
1344
+		if (!$nick_name) unset($nick_name);
1345 1345
 
1346 1346
 		$args = new stdClass;
1347 1347
 		$args->nick_name = $nick_name;
@@ -1380,16 +1380,16 @@  discard block
 block discarded – undo
1380 1380
 		// Get a list of all join forms
1381 1381
 		$join_form_list = $oMemberModel->getJoinFormList();
1382 1382
 		$join_form_srl_list = array_keys($join_form_list);
1383
-		if(count($join_form_srl_list)<2) return new Object();
1383
+		if (count($join_form_srl_list) < 2) return new Object();
1384 1384
 
1385 1385
 		$prev_member_join_form = NULL;
1386
-		foreach($join_form_list as $key => $val)
1386
+		foreach ($join_form_list as $key => $val)
1387 1387
 		{
1388
-			if($val->member_join_form_srl == $member_join_form_srl) break;
1388
+			if ($val->member_join_form_srl == $member_join_form_srl) break;
1389 1389
 			$prev_member_join_form = $val;
1390 1390
 		}
1391 1391
 		// Return if no previous join form exists
1392
-		if(!$prev_member_join_form) return new Object();
1392
+		if (!$prev_member_join_form) return new Object();
1393 1393
 		// Information of the join form
1394 1394
 		$cur_args = new stdClass;
1395 1395
 		$cur_args->member_join_form_srl = $member_join_form_srl;
@@ -1400,10 +1400,10 @@  discard block
 block discarded – undo
1400 1400
 		$prev_args->list_order = $list_order;
1401 1401
 		// Execute Query
1402 1402
 		$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
1403
-		if(!$output->toBool()) return $output;
1403
+		if (!$output->toBool()) return $output;
1404 1404
 
1405 1405
 		executeQuery('member.updateMemberJoinFormListorder', $prev_args);
1406
-		if(!$output->toBool()) return $output;
1406
+		if (!$output->toBool()) return $output;
1407 1407
 
1408 1408
 		return new Object();
1409 1409
 	}
@@ -1427,16 +1427,16 @@  discard block
 block discarded – undo
1427 1427
 		// Get information of all join forms
1428 1428
 		$join_form_list = $oMemberModel->getJoinFormList();
1429 1429
 		$join_form_srl_list = array_keys($join_form_list);
1430
-		if(count($join_form_srl_list)<2) return new Object();
1430
+		if (count($join_form_srl_list) < 2) return new Object();
1431 1431
 
1432
-		for($i=0;$i<count($join_form_srl_list);$i++)
1432
+		for ($i = 0; $i < count($join_form_srl_list); $i++)
1433 1433
 		{
1434
-			if($join_form_srl_list[$i]==$member_join_form_srl) break;
1434
+			if ($join_form_srl_list[$i] == $member_join_form_srl) break;
1435 1435
 		}
1436 1436
 
1437
-		$next_member_join_form_srl = $join_form_srl_list[$i+1];
1437
+		$next_member_join_form_srl = $join_form_srl_list[$i + 1];
1438 1438
 		// Return if no previous join form exists
1439
-		if(!$next_member_join_form_srl) return new Object();
1439
+		if (!$next_member_join_form_srl) return new Object();
1440 1440
 		$next_member_join_form = $join_form_list[$next_member_join_form_srl];
1441 1441
 		// Information of the join form
1442 1442
 		$cur_args = new stdClass;
@@ -1448,10 +1448,10 @@  discard block
 block discarded – undo
1448 1448
 		$next_args->list_order = $list_order;
1449 1449
 		// Execute Query
1450 1450
 		$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
1451
-		if(!$output->toBool()) return $output;
1451
+		if (!$output->toBool()) return $output;
1452 1452
 
1453 1453
 		$output = executeQuery('member.updateMemberJoinFormListorder', $next_args);
1454
-		if(!$output->toBool()) return $output;
1454
+		if (!$output->toBool()) return $output;
1455 1455
 
1456 1456
 		return new Object();
1457 1457
 	}
Please login to merge, or discard this patch.
Braces   +162 added lines, -86 removed lines patch added patch discarded remove patch
@@ -48,9 +48,11 @@  discard block
 block discarded – undo
48 48
 			$args->{$val} = Context::get($val);
49 49
 		}
50 50
 		$args->member_srl = Context::get('member_srl');
51
-		if(Context::get('reset_password'))
52
-			$args->password = Context::get('reset_password');
53
-		else unset($args->password);
51
+		if(Context::get('reset_password')) {
52
+					$args->password = Context::get('reset_password');
53
+		} else {
54
+			unset($args->password);
55
+		}
54 56
 
55 57
 		// Remove some unnecessary variables from all the vars
56 58
 		$all_args = Context::getRequestVars();
@@ -60,7 +62,9 @@  discard block
 block discarded – undo
60 62
 		unset($all_args->error_return_url);
61 63
 		unset($all_args->success_return_url);
62 64
 		unset($all_args->ruleset);
63
-		if(!isset($args->limit_date)) $args->limit_date = "";
65
+		if(!isset($args->limit_date)) {
66
+			$args->limit_date = "";
67
+		}
64 68
 		unset($all_args->password);
65 69
 		unset($all_args->password2);
66 70
 		unset($all_args->reset_password);
@@ -76,7 +80,9 @@  discard block
 block discarded – undo
76 80
 			$columnList = array('member_srl');
77 81
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl, 0, $columnList);
78 82
 			// If no original member exists, make a new one
79
-			if($member_info->member_srl != $args->member_srl) unset($args->member_srl);
83
+			if($member_info->member_srl != $args->member_srl) {
84
+				unset($args->member_srl);
85
+			}
80 86
 		}
81 87
 
82 88
 		// remove whitespace
@@ -96,14 +102,15 @@  discard block
 block discarded – undo
96 102
 			$args->password = Context::get('password');
97 103
 			$output = $oMemberController->insertMember($args);
98 104
 			$msg_code = 'success_registed';
99
-		}
100
-		else
105
+		} else
101 106
 		{
102 107
 			$output = $oMemberController->updateMember($args);
103 108
 			$msg_code = 'success_updated';
104 109
 		}
105 110
 
106
-		if(!$output->toBool()) return $output;
111
+		if(!$output->toBool()) {
112
+			return $output;
113
+		}
107 114
 		// Save Signature
108 115
 		$signature = Context::get('signature');
109 116
 		$oMemberController->putSignature($args->member_srl, $signature);
@@ -144,7 +151,9 @@  discard block
 block discarded – undo
144 151
 
145 152
 		$oMemberController = getController('member');
146 153
 		$output = $oMemberController->deleteMember($member_srl);
147
-		if(!$output->toBool()) return $output;
154
+		if(!$output->toBool()) {
155
+			return $output;
156
+		}
148 157
 
149 158
 		$this->add('page',Context::get('page'));
150 159
 		$this->setMessage("success_deleted");
@@ -263,8 +272,11 @@  discard block
 block discarded – undo
263 272
 			$signupItem->isDefaultForm = in_array($key, $items);
264 273
 
265 274
 			$signupItem->name = $key;
266
-			if(!in_array($key, $items)) $signupItem->title = $key;
267
-			else $signupItem->title = $lang->{$key};
275
+			if(!in_array($key, $items)) {
276
+				$signupItem->title = $key;
277
+			} else {
278
+				$signupItem->title = $lang->{$key};
279
+			}
268 280
 			$signupItem->mustRequired = in_array($key, $mustRequireds);
269 281
 			$signupItem->imageType = (strpos($key, 'image') !== false);
270 282
 			$signupItem->required = ($all_args->{$key} == 'required') || $signupItem->mustRequired || $signupItem->isIdentifier;
@@ -434,10 +446,11 @@  discard block
 block discarded – undo
434 446
 				$signupItem->max_width = $config->{$key.'_max_width'};
435 447
 				$signupItem->max_height = $config->{$key.'_max_height'};
436 448
 			}
437
-			if($signupItem->isIdentifier)
438
-				array_unshift($list_order, $signupItem);
439
-			else
440
-				$list_order[] = $signupItem;
449
+			if($signupItem->isIdentifier) {
450
+							array_unshift($list_order, $signupItem);
451
+			} else {
452
+							$list_order[] = $signupItem;
453
+			}
441 454
 		}
442 455
 		if(is_array($extendItems))
443 456
 		{
@@ -494,38 +507,30 @@  discard block
 block discarded – undo
494 507
 				if($formInfo->type == 'tel' || $formInfo->type == 'kr_zip')
495 508
 				{
496 509
 					$fields[] = sprintf('<field name="%s[]" required="true" />', $formInfo->name);
497
-				}
498
-				else if($formInfo->name == 'password')
510
+				} else if($formInfo->name == 'password')
499 511
 				{
500 512
 					$fields[] = '<field name="password"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="length" value="4:60" /></field>';
501 513
 					$fields[] = '<field name="password2"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="equalto" value="password" /></field>';
502
-				}
503
-				else if($formInfo->name == 'find_account_question')
514
+				} else if($formInfo->name == 'find_account_question')
504 515
 				{
505 516
 					$fields[] = '<field name="find_account_question" required="true" />';
506 517
 					$fields[] = '<field name="find_account_answer" required="true" length=":250" />';
507
-				}
508
-				else if($formInfo->name == 'email_address')
518
+				} else if($formInfo->name == 'email_address')
509 519
 				{
510 520
 					$fields[] = sprintf('<field name="%s" required="true" rule="email"/>', $formInfo->name);
511
-				}
512
-				else if($formInfo->name == 'user_id')
521
+				} else if($formInfo->name == 'user_id')
513 522
 				{
514 523
 					$fields[] = sprintf('<field name="%s" required="true" rule="userid" length="3:20" />', $formInfo->name);
515
-				}
516
-				else if($formInfo->name == 'nick_name')
524
+				} else if($formInfo->name == 'nick_name')
517 525
 				{
518 526
 					$fields[] = sprintf('<field name="%s" required="true" length="2:20" />', $formInfo->name);
519
-				}
520
-				else if(strpos($formInfo->name, 'image') !== false)
527
+				} else if(strpos($formInfo->name, 'image') !== false)
521 528
 				{
522 529
 					$fields[] = sprintf('<field name="%s"><if test="$act != \'procMemberAdminInsert\' &amp;&amp; $__%s_exist != \'true\'" attr="required" value="true" /></field>', $formInfo->name, $formInfo->name);
523
-				}
524
-				else if($formInfo->name == 'signature')
530
+				} else if($formInfo->name == 'signature')
525 531
 				{
526 532
 					$fields[] = '<field name="signature"><if test="$member_srl" attr="required" value="true" /></field>';
527
-				}
528
-				else
533
+				} else
529 534
 				{
530 535
 					$fields[] = sprintf('<field name="%s" required="true" />', $formInfo->name);
531 536
 				}
@@ -585,8 +590,9 @@  discard block
 block discarded – undo
585 590
 			'</ruleset>';
586 591
 
587 592
 		$fields = array();
588
-		if($identifier == 'user_id')
589
-			$fields[] = '<field name="user_id" required="true" rule="userid" />';
593
+		if($identifier == 'user_id') {
594
+					$fields[] = '<field name="user_id" required="true" rule="userid" />';
595
+		}
590 596
 
591 597
 		$fields[] = '<field name="email_address" required="true" rule="email" />';
592 598
 		$fields[] = '<field name="find_account_question" required="true" />';
@@ -608,7 +614,9 @@  discard block
 block discarded – undo
608 614
 	{
609 615
 		$args = Context::gets('title','description','is_default','image_mark');
610 616
 		$output = $this->insertGroup($args);
611
-		if(!$output->toBool()) return $output;
617
+		if(!$output->toBool()) {
618
+			return $output;
619
+		}
612 620
 
613 621
 		$this->add('group_srl','');
614 622
 		$this->add('page',Context::get('page'));
@@ -629,7 +637,9 @@  discard block
 block discarded – undo
629 637
 		$args = Context::gets('group_srl','title','description','is_default','image_mark');
630 638
 		$args->site_srl = 0;
631 639
 		$output = $this->updateGroup($args);
632
-		if(!$output->toBool()) return $output;
640
+		if(!$output->toBool()) {
641
+			return $output;
642
+		}
633 643
 
634 644
 		$this->add('group_srl','');
635 645
 		$this->add('page',Context::get('page'));
@@ -648,7 +658,9 @@  discard block
 block discarded – undo
648 658
 		$group_srl = Context::get('group_srl');
649 659
 
650 660
 		$output = $this->deleteGroup($group_srl);
651
-		if(!$output->toBool()) return $output;
661
+		if(!$output->toBool()) {
662
+			return $output;
663
+		}
652 664
 
653 665
 		$this->add('group_srl','');
654 666
 		$this->add('page',Context::get('page'));
@@ -673,14 +685,15 @@  discard block
 block discarded – undo
673 685
 		$args->default_value = explode("\n", str_replace("\r", '', Context::get('default_value')));
674 686
 		$args->required = Context::get('required');
675 687
 		$args->is_active = (isset($args->required));
676
-		if(!in_array(strtoupper($args->required), array('Y','N')))$args->required = 'N';
688
+		if(!in_array(strtoupper($args->required), array('Y','N'))) {
689
+			$args->required = 'N';
690
+		}
677 691
 		$args->description = Context::get('description') ? Context::get('description') : '';
678 692
 		// Default values
679 693
 		if(in_array($args->column_type, array('checkbox','select','radio')) && count($args->default_value))
680 694
 		{
681 695
 			$args->default_value = serialize($args->default_value);
682
-		}
683
-		else
696
+		} else
684 697
 		{
685 698
 			$args->default_value = '';
686 699
 		}
@@ -692,7 +705,9 @@  discard block
 block discarded – undo
692 705
 		{
693 706
 			if($item->name == $args->column_name)
694 707
 			{
695
-				if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue;
708
+				if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) {
709
+					continue;
710
+				}
696 711
 				return new Object(-1,'msg_exists_user_id');
697 712
 			}
698 713
 		}
@@ -703,13 +718,14 @@  discard block
 block discarded – undo
703 718
 			$isInsert = true;
704 719
 			$args->list_order = $args->member_join_form_srl = getNextSequence();
705 720
 			$output = executeQuery('member.insertJoinForm', $args);
706
-		}
707
-		else
721
+		} else
708 722
 		{
709 723
 			$output = executeQuery('member.updateJoinForm', $args);
710 724
 		}
711 725
 
712
-		if(!$output->toBool()) return $output;
726
+		if(!$output->toBool()) {
727
+			return $output;
728
+		}
713 729
 
714 730
 		// memberConfig update
715 731
 		$signupItem = new stdClass();
@@ -729,8 +745,7 @@  discard block
 block discarded – undo
729 745
 		if($isInsert)
730 746
 		{
731 747
 			$config->signupForm[] = $signupItem;
732
-		}
733
-		else
748
+		} else
734 749
 		{
735 750
 			foreach($config->signupForm as $key=>$val)
736 751
 			{
@@ -801,7 +816,9 @@  discard block
 block discarded – undo
801 816
 			case 'update' :
802 817
 				break;
803 818
 		}
804
-		if(!$output->toBool()) return $output;
819
+		if(!$output->toBool()) {
820
+			return $output;
821
+		}
805 822
 
806 823
 		$this->setMessage($msg_code);
807 824
 	}
@@ -904,7 +921,9 @@  discard block
 block discarded – undo
904 921
 	function procMemberAdminDeleteMembers()
905 922
 	{
906 923
 		$target_member_srls = Context::get('target_member_srls');
907
-		if(!$target_member_srls) return new Object(-1, 'msg_invalid_request');
924
+		if(!$target_member_srls) {
925
+			return new Object(-1, 'msg_invalid_request');
926
+		}
908 927
 		$member_srls = explode(',', $target_member_srls);
909 928
 		$oMemberController = getController('member');
910 929
 
@@ -928,12 +947,17 @@  discard block
 block discarded – undo
928 947
 	function procMemberAdminUpdateMembersGroup()
929 948
 	{
930 949
 		$member_srl = Context::get('member_srl');
931
-		if(!$member_srl) return new Object(-1,'msg_invalid_request');
950
+		if(!$member_srl) {
951
+			return new Object(-1,'msg_invalid_request');
952
+		}
932 953
 		$member_srls = explode(',',$member_srl);
933 954
 
934 955
 		$group_srl = Context::get('group_srls');
935
-		if(!is_array($group_srl)) $group_srls = explode('|@|', $group_srl);
936
-		else $group_srls = $group_srl;
956
+		if(!is_array($group_srl)) {
957
+			$group_srls = explode('|@|', $group_srl);
958
+		} else {
959
+			$group_srls = $group_srl;
960
+		}
937 961
 
938 962
 		$oDB = &DB::getInstance();
939 963
 		$oDB->begin();
@@ -952,11 +976,15 @@  discard block
 block discarded – undo
952 976
 		for($j=0;$j<$group_count;$j++)
953 977
 		{
954 978
 			$group_srl = (int)trim($group_srls[$j]);
955
-			if(!$group_srl) continue;
979
+			if(!$group_srl) {
980
+				continue;
981
+			}
956 982
 			for($i=0;$i<$member_count;$i++)
957 983
 			{
958 984
 				$member_srl = (int)trim($member_srls[$i]);
959
-				if(!$member_srl) continue;
985
+				if(!$member_srl) {
986
+					continue;
987
+				}
960 988
 
961 989
 				$args = new stdClass;
962 990
 				$args->member_srl = $member_srl;
@@ -1003,10 +1031,14 @@  discard block
 block discarded – undo
1003 1031
 		foreach($user_ids as $val)
1004 1032
 		{
1005 1033
 			$val = trim($val);
1006
-			if(!$val) continue;
1034
+			if(!$val) {
1035
+				continue;
1036
+			}
1007 1037
 
1008 1038
 			$output = $this->insertDeniedID($val, '');
1009
-			if($output->toBool()) $success_ids[] = $val;
1039
+			if($output->toBool()) {
1040
+				$success_ids[] = $val;
1041
+			}
1010 1042
 		}
1011 1043
 
1012 1044
 		$this->add('user_ids', implode(',',$success_ids));
@@ -1035,8 +1067,7 @@  discard block
 block discarded – undo
1035 1067
 			}
1036 1068
 			$msg_code = 'success_deleted';
1037 1069
 			$this->setMessage($msg_code);
1038
-		}
1039
-		else
1070
+		} else
1040 1071
 		{
1041 1072
 			$nick_names = explode(',',$nick_name);
1042 1073
 			$success_nick_names = array();
@@ -1044,10 +1075,14 @@  discard block
 block discarded – undo
1044 1075
 			foreach($nick_names as $val)
1045 1076
 			{
1046 1077
 				$val = trim($val);
1047
-				if(!$val) continue;
1078
+				if(!$val) {
1079
+					continue;
1080
+				}
1048 1081
 
1049 1082
 				$output = $this->insertDeniedNickName($val, '');
1050
-				if($output->toBool()) $success_nick_names[] = $val;
1083
+				if($output->toBool()) {
1084
+					$success_nick_names[] = $val;
1085
+				}
1051 1086
 			}
1052 1087
 
1053 1088
 			$this->add('nick_names', implode(',',$success_nick_names));
@@ -1067,7 +1102,9 @@  discard block
 block discarded – undo
1067 1102
 		{
1068 1103
 			case 'delete' :
1069 1104
 				$output = $this->deleteDeniedID($user_id);
1070
-				if(!$output->toBool()) return $output;
1105
+				if(!$output->toBool()) {
1106
+					return $output;
1107
+				}
1071 1108
 				$msg_code = 'success_deleted';
1072 1109
 				break;
1073 1110
 		}
@@ -1119,16 +1156,19 @@  discard block
 block discarded – undo
1119 1156
 	 */
1120 1157
 	function insertGroup($args)
1121 1158
 	{
1122
-		if(!$args->site_srl) $args->site_srl = 0;
1159
+		if(!$args->site_srl) {
1160
+			$args->site_srl = 0;
1161
+		}
1123 1162
 		// Check the value of is_default.
1124 1163
 		if($args->is_default != 'Y')
1125 1164
 		{
1126 1165
 			$args->is_default = 'N';
1127
-		}
1128
-		else
1166
+		} else
1129 1167
 		{
1130 1168
 			$output = executeQuery('member.updateGroupDefaultClear', $args);
1131
-			if(!$output->toBool()) return $output;
1169
+			if(!$output->toBool()) {
1170
+				return $output;
1171
+			}
1132 1172
 		}
1133 1173
 
1134 1174
 		if(!isset($args->list_order) || $args->list_order=='')
@@ -1136,7 +1176,9 @@  discard block
 block discarded – undo
1136 1176
 			$args->list_order = $args->group_srl;
1137 1177
 		}
1138 1178
 
1139
-		if(!$args->group_srl) $args->group_srl = getNextSequence();
1179
+		if(!$args->group_srl) {
1180
+			$args->group_srl = getNextSequence();
1181
+		}
1140 1182
 		$args->list_order = $args->group_srl;
1141 1183
 		$output = executeQuery('member.insertGroup', $args);
1142 1184
 		$this->_deleteMemberGroupCache($args->site_srl);
@@ -1151,17 +1193,22 @@  discard block
 block discarded – undo
1151 1193
 	 */
1152 1194
 	function updateGroup($args)
1153 1195
 	{
1154
-		if(!$args->site_srl) $args->site_srl = 0;
1196
+		if(!$args->site_srl) {
1197
+			$args->site_srl = 0;
1198
+		}
1155 1199
 		// Check the value of is_default.
1156
-		if(!$args->group_srl) return new Object(-1, 'lang->msg_not_founded');
1200
+		if(!$args->group_srl) {
1201
+			return new Object(-1, 'lang->msg_not_founded');
1202
+		}
1157 1203
 		if($args->is_default!='Y')
1158 1204
 		{
1159 1205
 			$args->is_default = 'N';
1160
-		}
1161
-		else
1206
+		} else
1162 1207
 		{
1163 1208
 			$output = executeQuery('member.updateGroupDefaultClear', $args);
1164
-			if(!$output->toBool()) return $output;
1209
+			if(!$output->toBool()) {
1210
+				return $output;
1211
+			}
1165 1212
 		}
1166 1213
 
1167 1214
 		$output = executeQuery('member.updateGroup', $args);
@@ -1184,8 +1231,12 @@  discard block
 block discarded – undo
1184 1231
 		$columnList = array('group_srl', 'is_default');
1185 1232
 		$group_info = $oMemberModel->getGroup($group_srl, $columnList);
1186 1233
 
1187
-		if(!$group_info) return new Object(-1, 'lang->msg_not_founded');
1188
-		if($group_info->is_default == 'Y') return new Object(-1, 'msg_not_delete_default');
1234
+		if(!$group_info) {
1235
+			return new Object(-1, 'lang->msg_not_founded');
1236
+		}
1237
+		if($group_info->is_default == 'Y') {
1238
+			return new Object(-1, 'msg_not_delete_default');
1239
+		}
1189 1240
 
1190 1241
 		// Get groups where is_default == 'Y'
1191 1242
 		$columnList = array('site_srl', 'group_srl');
@@ -1231,13 +1282,14 @@  discard block
 block discarded – undo
1231 1282
 			$update_args->image_mark = $vars->image_marks[$order];
1232 1283
 			$update_args->list_order = $order + 1;
1233 1284
 
1234
-			if(!$update_args->title) continue;
1285
+			if(!$update_args->title) {
1286
+				continue;
1287
+			}
1235 1288
 
1236 1289
 			if(is_numeric($group_srl)) {
1237 1290
 				$update_args->group_srl = $group_srl;
1238 1291
 				$output = $this->updateGroup($update_args);
1239
-			}
1240
-			else {
1292
+			} else {
1241 1293
 				$update_args->group_srl = getNextSequence();
1242 1294
 				$output = $this->insertGroup($update_args);
1243 1295
 			}
@@ -1327,7 +1379,9 @@  discard block
 block discarded – undo
1327 1379
 	 */
1328 1380
 	function deleteDeniedID($user_id)
1329 1381
 	{
1330
-		if(!$user_id) unset($user_id);
1382
+		if(!$user_id) {
1383
+			unset($user_id);
1384
+		}
1331 1385
 
1332 1386
 		$args = new stdClass;
1333 1387
 		$args->user_id = $user_id;
@@ -1341,7 +1395,9 @@  discard block
 block discarded – undo
1341 1395
 	 */
1342 1396
 	function deleteDeniedNickName($nick_name)
1343 1397
 	{
1344
-		if(!$nick_name) unset($nick_name);
1398
+		if(!$nick_name) {
1399
+			unset($nick_name);
1400
+		}
1345 1401
 
1346 1402
 		$args = new stdClass;
1347 1403
 		$args->nick_name = $nick_name;
@@ -1380,16 +1436,22 @@  discard block
 block discarded – undo
1380 1436
 		// Get a list of all join forms
1381 1437
 		$join_form_list = $oMemberModel->getJoinFormList();
1382 1438
 		$join_form_srl_list = array_keys($join_form_list);
1383
-		if(count($join_form_srl_list)<2) return new Object();
1439
+		if(count($join_form_srl_list)<2) {
1440
+			return new Object();
1441
+		}
1384 1442
 
1385 1443
 		$prev_member_join_form = NULL;
1386 1444
 		foreach($join_form_list as $key => $val)
1387 1445
 		{
1388
-			if($val->member_join_form_srl == $member_join_form_srl) break;
1446
+			if($val->member_join_form_srl == $member_join_form_srl) {
1447
+				break;
1448
+			}
1389 1449
 			$prev_member_join_form = $val;
1390 1450
 		}
1391 1451
 		// Return if no previous join form exists
1392
-		if(!$prev_member_join_form) return new Object();
1452
+		if(!$prev_member_join_form) {
1453
+			return new Object();
1454
+		}
1393 1455
 		// Information of the join form
1394 1456
 		$cur_args = new stdClass;
1395 1457
 		$cur_args->member_join_form_srl = $member_join_form_srl;
@@ -1400,10 +1462,14 @@  discard block
 block discarded – undo
1400 1462
 		$prev_args->list_order = $list_order;
1401 1463
 		// Execute Query
1402 1464
 		$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
1403
-		if(!$output->toBool()) return $output;
1465
+		if(!$output->toBool()) {
1466
+			return $output;
1467
+		}
1404 1468
 
1405 1469
 		executeQuery('member.updateMemberJoinFormListorder', $prev_args);
1406
-		if(!$output->toBool()) return $output;
1470
+		if(!$output->toBool()) {
1471
+			return $output;
1472
+		}
1407 1473
 
1408 1474
 		return new Object();
1409 1475
 	}
@@ -1427,16 +1493,22 @@  discard block
 block discarded – undo
1427 1493
 		// Get information of all join forms
1428 1494
 		$join_form_list = $oMemberModel->getJoinFormList();
1429 1495
 		$join_form_srl_list = array_keys($join_form_list);
1430
-		if(count($join_form_srl_list)<2) return new Object();
1496
+		if(count($join_form_srl_list)<2) {
1497
+			return new Object();
1498
+		}
1431 1499
 
1432 1500
 		for($i=0;$i<count($join_form_srl_list);$i++)
1433 1501
 		{
1434
-			if($join_form_srl_list[$i]==$member_join_form_srl) break;
1502
+			if($join_form_srl_list[$i]==$member_join_form_srl) {
1503
+				break;
1504
+			}
1435 1505
 		}
1436 1506
 
1437 1507
 		$next_member_join_form_srl = $join_form_srl_list[$i+1];
1438 1508
 		// Return if no previous join form exists
1439
-		if(!$next_member_join_form_srl) return new Object();
1509
+		if(!$next_member_join_form_srl) {
1510
+			return new Object();
1511
+		}
1440 1512
 		$next_member_join_form = $join_form_list[$next_member_join_form_srl];
1441 1513
 		// Information of the join form
1442 1514
 		$cur_args = new stdClass;
@@ -1448,10 +1520,14 @@  discard block
 block discarded – undo
1448 1520
 		$next_args->list_order = $list_order;
1449 1521
 		// Execute Query
1450 1522
 		$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
1451
-		if(!$output->toBool()) return $output;
1523
+		if(!$output->toBool()) {
1524
+			return $output;
1525
+		}
1452 1526
 
1453 1527
 		$output = executeQuery('member.updateMemberJoinFormListorder', $next_args);
1454
-		if(!$output->toBool()) return $output;
1528
+		if(!$output->toBool()) {
1529
+			return $output;
1530
+		}
1455 1531
 
1456 1532
 		return new Object();
1457 1533
 	}
Please login to merge, or discard this patch.
modules/member/member.admin.view.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -380,10 +380,10 @@
 block discarded – undo
380 380
 	/**
381 381
 	 * Get tags by the member info type 
382 382
 	 *
383
-	 * @param object $memberInfo
383
+	 * @param string $memberInfo
384 384
 	 * @param boolean $isAdmin (true : admin, false : not admin)
385 385
 	 *
386
-	 * @return array
386
+	 * @return string
387 387
 	 */
388 388
 	function _getMemberInputTag($memberInfo, $isAdmin = false)
389 389
 	{
Please login to merge, or discard this patch.
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -43,16 +43,16 @@  discard block
 block discarded – undo
43 43
 
44 44
 		// if member_srl exists, set memberInfo
45 45
 		$member_srl = Context::get('member_srl');
46
-		if($member_srl) 
46
+		if ($member_srl) 
47 47
 		{
48 48
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
49
-			if(!$this->memberInfo)
49
+			if (!$this->memberInfo)
50 50
 			{
51
-				Context::set('member_srl','');
51
+				Context::set('member_srl', '');
52 52
 			}
53 53
 			else
54 54
 			{
55
-				Context::set('member_info',$this->memberInfo);
55
+				Context::set('member_info', $this->memberInfo);
56 56
 			}
57 57
 		}
58 58
 
@@ -79,30 +79,30 @@  discard block
 block discarded – undo
79 79
 
80 80
 		$filter = Context::get('filter_type');
81 81
 		global $lang;
82
-		switch($filter)
82
+		switch ($filter)
83 83
 		{
84
-			case 'super_admin' : Context::set('filter_type_title', $lang->cmd_show_super_admin_member);break;
85
-			case 'site_admin' : Context::set('filter_type_title', $lang->cmd_show_site_admin_member);break;
86
-			default : Context::set('filter_type_title', $lang->cmd_show_all_member);break;
84
+			case 'super_admin' : Context::set('filter_type_title', $lang->cmd_show_super_admin_member); break;
85
+			case 'site_admin' : Context::set('filter_type_title', $lang->cmd_show_site_admin_member); break;
86
+			default : Context::set('filter_type_title', $lang->cmd_show_all_member); break;
87 87
 		}
88 88
 		// retrieve list of groups for each member
89
-		if($output->data)
89
+		if ($output->data)
90 90
 		{
91
-			foreach($output->data as $key => $member)
91
+			foreach ($output->data as $key => $member)
92 92
 			{
93
-				$output->data[$key]->group_list = $oMemberModel->getMemberGroups($member->member_srl,0);
93
+				$output->data[$key]->group_list = $oMemberModel->getMemberGroups($member->member_srl, 0);
94 94
 			}
95 95
 		}
96 96
 		$config = $this->memberConfig;
97 97
 		$memberIdentifiers = array('user_id'=>'user_id', 'user_name'=>'user_name', 'nick_name'=>'nick_name');
98 98
 		$usedIdentifiers = array();	
99 99
 
100
-		if(is_array($config->signupForm))
100
+		if (is_array($config->signupForm))
101 101
 		{
102
-			foreach($config->signupForm as $signupItem)
102
+			foreach ($config->signupForm as $signupItem)
103 103
 			{
104
-				if(!count($memberIdentifiers)) break;
105
-				if(in_array($signupItem->name, $memberIdentifiers) && ($signupItem->required || $signupItem->isUse))
104
+				if (!count($memberIdentifiers)) break;
105
+				if (in_array($signupItem->name, $memberIdentifiers) && ($signupItem->required || $signupItem->isUse))
106 106
 				{
107 107
 					unset($memberIdentifiers[$signupItem->name]);
108 108
 					$usedIdentifiers[$signupItem->name] = $lang->{$signupItem->name};
@@ -139,14 +139,14 @@  discard block
 block discarded – undo
139 139
 	{
140 140
 		$config = $this->memberConfig;
141 141
 
142
-		if($config->redirect_url)
142
+		if ($config->redirect_url)
143 143
 		{
144 144
 			$mid = str_ireplace(Context::getDefaultUrl(), '', $config->redirect_url);
145 145
 
146 146
 			$siteModuleInfo = Context::get('site_module_info');
147 147
 
148 148
 			$oModuleModel = getModel('module');
149
-			$moduleInfo = $oModuleModel->getModuleInfoByMid($mid, (int)$siteModuleInfo->site_srl);
149
+			$moduleInfo = $oModuleModel->getModuleInfoByMid($mid, (int) $siteModuleInfo->site_srl);
150 150
 
151 151
 			$config->redirect_url = $moduleInfo->module_srl;
152 152
 			Context::set('config', $config);
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
 		Context::set('editor', $editor);
172 172
 
173 173
 		$signupForm = $config->signupForm;
174
-		foreach($signupForm as $val)
174
+		foreach ($signupForm as $val)
175 175
 		{
176
-			if($val->name == 'user_id')
176
+			if ($val->name == 'user_id')
177 177
 			{
178 178
 				$userIdInfo = $val;
179 179
 				break;
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 		}
182 182
 
183 183
 		$oSecurity = new Security();
184
-		if($userIdInfo->isUse)
184
+		if ($userIdInfo->isUse)
185 185
 		{
186 186
 			// get denied ID list
187 187
 			Context::set('useUserID', 1);
@@ -271,16 +271,16 @@  discard block
 block discarded – undo
271 271
 		Context::set('editor', $editor);
272 272
 
273 273
 		$signupForm = $config->signupForm;
274
-		foreach($signupForm as $val)
274
+		foreach ($signupForm as $val)
275 275
 		{
276
-			if($val->name == 'user_id')
276
+			if ($val->name == 'user_id')
277 277
 			{
278 278
 				$userIdInfo = $val;
279 279
 				break;
280 280
 			}
281 281
 		}
282 282
 
283
-		if($userIdInfo->isUse)
283
+		if ($userIdInfo->isUse)
284 284
 		{
285 285
 			// get denied ID list
286 286
 			Context::set('useUserID', 1);
@@ -341,14 +341,14 @@  discard block
 block discarded – undo
341 341
 		$oMemberModel = getModel('member');
342 342
 
343 343
 		$memberInfo = Context::get('member_info');
344
-		if(isset($memberInfo))
344
+		if (isset($memberInfo))
345 345
 		{
346 346
 			$memberInfo->signature = $oMemberModel->getSignature($this->memberInfo->member_srl);
347 347
 		}
348 348
 		Context::set('member_info', $memberInfo);
349 349
 
350 350
 		// get an editor for the signature
351
-		if($memberInfo->member_srl)
351
+		if ($memberInfo->member_srl)
352 352
 		{
353 353
 			$oEditorModel = getModel('editor');
354 354
 			$option = new stdClass();
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 		}
399 399
 
400 400
 		$member_config = $this->memberConfig;
401
-		if(!$this->memberConfig)
401
+		if (!$this->memberConfig)
402 402
 		{
403 403
 			$member_config = $this->memberConfig = $oMemberModel->getMemberConfig();
404 404
 		}
@@ -406,16 +406,16 @@  discard block
 block discarded – undo
406 406
 		$formTags = array();
407 407
 		global $lang;
408 408
 
409
-		foreach($member_config->signupForm as $no=>$formInfo)
409
+		foreach ($member_config->signupForm as $no=>$formInfo)
410 410
 		{
411
-			if(!$formInfo->isUse)continue;
412
-			if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue;
411
+			if (!$formInfo->isUse)continue;
412
+			if ($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue;
413 413
 			$formTag = new stdClass();
414 414
 			$inputTag = '';
415 415
 			$formTag->title = ($formInfo->isDefaultForm) ? $lang->{$formInfo->name} : $formInfo->title;
416
-			if($isAdmin)
416
+			if ($isAdmin)
417 417
 			{
418
-				if($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
418
+				if ($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
419 419
 			}
420 420
 			else
421 421
 			{
@@ -423,28 +423,28 @@  discard block
 block discarded – undo
423 423
 			}
424 424
 			$formTag->name = $formInfo->name;
425 425
 
426
-			if($formInfo->isDefaultForm)
426
+			if ($formInfo->isDefaultForm)
427 427
 			{
428
-				if($formInfo->imageType)
428
+				if ($formInfo->imageType)
429 429
 				{
430 430
 					$formTag->type = 'image';
431
-					if($formInfo->name == 'profile_image')
431
+					if ($formInfo->name == 'profile_image')
432 432
 					{
433 433
 						$target = $memberInfo['profile_image'];
434 434
 						$functionName = 'doDeleteProfileImage';
435 435
 					}
436
-					else if($formInfo->name == 'image_name')
436
+					else if ($formInfo->name == 'image_name')
437 437
 					{
438 438
 						$target = $memberInfo['image_name'];
439 439
 						$functionName = 'doDeleteImageName';
440 440
 					}
441
-					else if($formInfo->name == 'image_mark')
441
+					else if ($formInfo->name == 'image_mark')
442 442
 					{
443 443
 						$target = $memberInfo['image_mark'];
444 444
 						$functionName = 'doDeleteImageMark';
445 445
 					}
446 446
 
447
-					if($target->src)
447
+					if ($target->src)
448 448
 					{
449 449
 						$inputTag = sprintf('<input type="hidden" name="__%s_exist" value="true" /><span id="%s"><img src="%s" alt="%s" /> <button type="button" onclick="%s(%d);return false;">%s</button></span>',
450 450
 							$formInfo->name,
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 						$lang->{$formInfo->name.'_max_height'},
468 468
 						$member_config->{$formInfo->name.'_max_height'});
469 469
 					}//end imageType
470
-					else if($formInfo->name == 'birthday')
470
+					else if ($formInfo->name == 'birthday')
471 471
 					{
472 472
 						$formTag->type = 'date';
473 473
 						$inputTag = sprintf('<input type="hidden" name="birthday" id="date_birthday" value="%s" /><input type="text" placeholder="YYYY-MM-DD" name="birthday_ui" class="inputDate" id="birthday" value="%s" readonly="readonly" /> <input type="button" value="%s" class="btn dateRemover" />',
@@ -475,14 +475,14 @@  discard block
 block discarded – undo
475 475
 							zdate($memberInfo['birthday'], 'Y-m-d', false),
476 476
 							$lang->cmd_delete);
477 477
 					}
478
-					else if($formInfo->name == 'find_account_question')
478
+					else if ($formInfo->name == 'find_account_question')
479 479
 					{
480 480
 						$formTag->type = 'select';
481 481
 						$inputTag = '<select name="find_account_question" id="find_account_question" style="display:block;margin:0 0 8px 0">%s</select>';
482 482
 						$optionTag = array();
483
-						foreach($lang->find_account_question_items as $key=>$val)
483
+						foreach ($lang->find_account_question_items as $key=>$val)
484 484
 						{
485
-							if($key == $memberInfo['find_account_question']) $selected = 'selected="selected"';
485
+							if ($key == $memberInfo['find_account_question']) $selected = 'selected="selected"';
486 486
 							else $selected = '';
487 487
 							$optionTag[] = sprintf('<option value="%s" %s >%s</option>',
488 488
 								$key,
@@ -492,17 +492,17 @@  discard block
 block discarded – undo
492 492
 						$inputTag = sprintf($inputTag, implode('', $optionTag));
493 493
 						$inputTag .= '<input type="text" name="find_account_answer" id="find_account_answer" title="'.Context::getLang('find_account_answer').'" value="'.$memberInfo['find_account_answer'].'" />';
494 494
 					}
495
-					else if($formInfo->name == 'email_address')
495
+					else if ($formInfo->name == 'email_address')
496 496
 					{
497 497
 						$formTag->type = 'email';
498 498
 						$inputTag = '<input type="email" name="email_address" id="email_address" value="'.$memberInfo['email_address'].'" />';
499 499
 					}
500
-					else if($formInfo->name == 'homepage')
500
+					else if ($formInfo->name == 'homepage')
501 501
 					{
502 502
 						$formTag->type = 'url';
503 503
 						$inputTag = '<input type="url" name="homepage" id="homepage" value="'.$memberInfo['homepage'].'" />';
504 504
 					}
505
-					else if($formInfo->name == 'blog')
505
+					else if ($formInfo->name == 'blog')
506 506
 					{
507 507
 						$formTag->type = 'url';
508 508
 						$inputTag = '<input type="url" name="blog" id="blog" value="'.$memberInfo['blog'].'" />';
@@ -523,92 +523,92 @@  discard block
 block discarded – undo
523 523
 					$extentionReplace = array();
524 524
 
525 525
 					$formTag->type = $extendForm->column_type;
526
-					if($extendForm->column_type == 'text')
526
+					if ($extendForm->column_type == 'text')
527 527
 					{
528 528
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
529 529
 					}
530
-					else if($extendForm->column_type == 'homepage')
530
+					else if ($extendForm->column_type == 'homepage')
531 531
 					{
532 532
 						$template = '<input type="url" name="%column_name%" id="%column_name%" value="%value%" />';
533 533
 					}
534
-					else if($extendForm->column_type == 'email_address')
534
+					else if ($extendForm->column_type == 'email_address')
535 535
 					{
536 536
 						$template = '<input type="email" name="%column_name%" id="%column_name%" value="%value%" />';
537 537
 					}
538
-					else if($extendForm->column_type == 'tel')
538
+					else if ($extendForm->column_type == 'tel')
539 539
 					{
540 540
 						$extentionReplace = array('tel_0' => $extendForm->value[0],
541 541
 							'tel_1' => $extendForm->value[1],
542 542
 							'tel_2' => $extendForm->value[2]);
543 543
 						$template = '<input type="tel" name="%column_name%[]" id="%column_name%" value="%tel_0%" size="4" maxlength="4" style="width:30px" title="First Number" /> - <input type="tel" name="%column_name%[]" value="%tel_1%" size="4" maxlength="4" style="width:35px" title="Second Number" /> - <input type="tel" name="%column_name%[]" value="%tel_2%" size="4" maxlength="4" style="width:35px" title="Third Number" />';
544 544
 					}
545
-					else if($extendForm->column_type == 'textarea')
545
+					else if ($extendForm->column_type == 'textarea')
546 546
 					{
547 547
 						$template = '<textarea name="%column_name%" id="%column_name%" rows="4" cols="42">%value%</textarea>';
548 548
 					}
549
-					else if($extendForm->column_type == 'checkbox')
549
+					else if ($extendForm->column_type == 'checkbox')
550 550
 					{
551 551
 						$template = '';
552
-						if($extendForm->default_value)
552
+						if ($extendForm->default_value)
553 553
 						{
554 554
 							$template = '<div style="padding-top:5px">%s</div>';
555 555
 							$__i = 0;
556 556
 							$optionTag = array();
557
-							foreach($extendForm->default_value as $v)
557
+							foreach ($extendForm->default_value as $v)
558 558
 							{
559 559
 								$checked = '';
560
-								if(is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"';
560
+								if (is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"';
561 561
 								$optionTag[] = '<label for="%column_name%'.$__i.'"><input type="checkbox" id="%column_name%'.$__i.'" name="%column_name%[]" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
562 562
 								$__i++;
563 563
 							}
564 564
 							$template = sprintf($template, implode('', $optionTag));
565 565
 						}
566 566
 					}
567
-					else if($extendForm->column_type == 'radio')
567
+					else if ($extendForm->column_type == 'radio')
568 568
 					{
569 569
 						$template = '';
570
-						if($extendForm->default_value)
570
+						if ($extendForm->default_value)
571 571
 						{
572 572
 							$template = '<div style="padding-top:5px">%s</div>';
573 573
 							$optionTag = array();
574
-							foreach($extendForm->default_value as $v)
574
+							foreach ($extendForm->default_value as $v)
575 575
 							{
576
-								if($extendForm->value == $v)$checked = 'checked="checked"';
576
+								if ($extendForm->value == $v)$checked = 'checked="checked"';
577 577
 								else $checked = '';
578 578
 								$optionTag[] = '<label><input type="radio" name="%column_name%" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
579 579
 							}
580 580
 							$template = sprintf($template, implode('', $optionTag));
581 581
 						}
582 582
 					}
583
-					else if($extendForm->column_type == 'select')
583
+					else if ($extendForm->column_type == 'select')
584 584
 					{
585 585
 						$template = '<select name="'.$formInfo->name.'" id="'.$formInfo->name.'">%s</select>';
586 586
 						$optionTag = array();
587 587
 						$optionTag[] = sprintf('<option value="">%s</option>', $lang->cmd_select);
588
-						if($extendForm->default_value)
588
+						if ($extendForm->default_value)
589 589
 						{
590
-							foreach($extendForm->default_value as $v)
590
+							foreach ($extendForm->default_value as $v)
591 591
 							{
592
-								if($v == $extendForm->value) $selected = 'selected="selected"';
592
+								if ($v == $extendForm->value) $selected = 'selected="selected"';
593 593
 								else $selected = '';
594 594
 								$optionTag[] = sprintf('<option value="%s" %s >%s</option>', $v, $selected, $v);
595 595
 							}
596 596
 						}
597 597
 						$template = sprintf($template, implode('', $optionTag));
598 598
 					}
599
-					else if($extendForm->column_type == 'kr_zip')
599
+					else if ($extendForm->column_type == 'kr_zip')
600 600
 					{
601 601
 						$krzipModel = getModel('krzip');
602
-						if($krzipModel && method_exists($krzipModel , 'getKrzipCodeSearchHtml' ))
602
+						if ($krzipModel && method_exists($krzipModel, 'getKrzipCodeSearchHtml'))
603 603
 						{
604 604
 							$template = $krzipModel->getKrzipCodeSearchHtml($extendForm->column_name, $extendForm->value);
605 605
 						}
606 606
 					}
607
-					else if($extendForm->column_type == 'jp_zip')
607
+					else if ($extendForm->column_type == 'jp_zip')
608 608
 					{
609 609
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
610 610
 					}
611
-					else if($extendForm->column_type == 'date')
611
+					else if ($extendForm->column_type == 'date')
612 612
 					{
613 613
 						$extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete);
614 614
 						$template = '<input type="hidden" name="%column_name%" id="date_%column_name%" value="%value%" /><input type="text" placeholder="YYYY-MM-DD" class="inputDate" value="%date%" readonly="readonly" /> <input type="button" value="%cmd_delete%" class="btn dateRemover" />';
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
 					$replace = array_merge($extentionReplace, $replace);
618 618
 					$inputTag = preg_replace_callback('@%(\w+)%@', function($n) use($replace) { return $replace[$n[1]]; }, $template);
619 619
 
620
-					if($extendForm->description)
620
+					if ($extendForm->description)
621 621
 						$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
622 622
 				}
623 623
 				$formTag->inputTag = $inputTag;
@@ -648,12 +648,12 @@  discard block
 block discarded – undo
648 648
 	function dispMemberAdminInsertJoinForm() {
649 649
 		// Get the value of join_form
650 650
 		$member_join_form_srl = Context::get('member_join_form_srl');
651
-		if($member_join_form_srl)
651
+		if ($member_join_form_srl)
652 652
 		{
653 653
 			$oMemberModel = getModel('member');
654 654
 			$join_form = $oMemberModel->getJoinForm($member_join_form_srl);
655 655
 
656
-			if(!$join_form) Context::set('member_join_form_srl','',true);
656
+			if (!$join_form) Context::set('member_join_form_srl', '', true);
657 657
 			else
658 658
 			{
659 659
 				Context::set('join_form', $join_form);
Please login to merge, or discard this patch.
Braces   +62 added lines, -57 removed lines patch added patch discarded remove patch
@@ -49,8 +49,7 @@  discard block
 block discarded – undo
49 49
 			if(!$this->memberInfo)
50 50
 			{
51 51
 				Context::set('member_srl','');
52
-			}
53
-			else
52
+			} else
54 53
 			{
55 54
 				Context::set('member_info',$this->memberInfo);
56 55
 			}
@@ -101,7 +100,9 @@  discard block
 block discarded – undo
101 100
 		{
102 101
 			foreach($config->signupForm as $signupItem)
103 102
 			{
104
-				if(!count($memberIdentifiers)) break;
103
+				if(!count($memberIdentifiers)) {
104
+					break;
105
+				}
105 106
 				if(in_array($signupItem->name, $memberIdentifiers) && ($signupItem->required || $signupItem->isUse))
106 107
 				{
107 108
 					unset($memberIdentifiers[$signupItem->name]);
@@ -316,7 +317,9 @@  discard block
 block discarded – undo
316 317
 		$extendForm = $oMemberModel->getCombineJoinForm($this->memberInfo);
317 318
 		Context::set('extend_form_list', $extendForm);
318 319
 		$memberInfo = get_object_vars(Context::get('member_info'));
319
-		if (!is_array($memberInfo['group_list'])) $memberInfo['group_list'] = array();
320
+		if (!is_array($memberInfo['group_list'])) {
321
+			$memberInfo['group_list'] = array();
322
+		}
320 323
 		Context::set('memberInfo', $memberInfo);
321 324
 
322 325
 		$disableColumns = array('password', 'find_account_question');
@@ -412,18 +415,25 @@  discard block
 block discarded – undo
412 415
 
413 416
 		foreach($member_config->signupForm as $no=>$formInfo)
414 417
 		{
415
-			if(!$formInfo->isUse)continue;
416
-			if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue;
418
+			if(!$formInfo->isUse) {
419
+				continue;
420
+			}
421
+			if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') {
422
+				continue;
423
+			}
417 424
 			$formTag = new stdClass();
418 425
 			$inputTag = '';
419 426
 			$formTag->title = ($formInfo->isDefaultForm) ? $lang->{$formInfo->name} : $formInfo->title;
420 427
 			if($isAdmin)
421 428
 			{
422
-				if($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
423
-			}
424
-			else
429
+				if($formInfo->mustRequired) {
430
+					$formTag->title = '<em style="color:red">*</em> '.$formTag->title;
431
+				}
432
+			} else
425 433
 			{
426
-				if ($formInfo->required && $formInfo->name != 'password') $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
434
+				if ($formInfo->required && $formInfo->name != 'password') {
435
+					$formTag->title = '<em style="color:red">*</em> '.$formTag->title;
436
+				}
427 437
 			}
428 438
 			$formTag->name = $formInfo->name;
429 439
 
@@ -436,13 +446,11 @@  discard block
 block discarded – undo
436 446
 					{
437 447
 						$target = $memberInfo['profile_image'];
438 448
 						$functionName = 'doDeleteProfileImage';
439
-					}
440
-					else if($formInfo->name == 'image_name')
449
+					} else if($formInfo->name == 'image_name')
441 450
 					{
442 451
 						$target = $memberInfo['image_name'];
443 452
 						$functionName = 'doDeleteImageName';
444
-					}
445
-					else if($formInfo->name == 'image_mark')
453
+					} else if($formInfo->name == 'image_mark')
446 454
 					{
447 455
 						$target = $memberInfo['image_mark'];
448 456
 						$functionName = 'doDeleteImageMark';
@@ -458,8 +466,7 @@  discard block
 block discarded – undo
458 466
 							$functionName,
459 467
 							$memberInfo['member_srl'],
460 468
 							$lang->cmd_delete);
461
-					}
462
-					else
469
+					} else
463 470
 					{
464 471
 						$inputTag = sprintf('<input type="hidden" name="__%s_exist" value="false" />', $formInfo->name);
465 472
 					}
@@ -478,16 +485,18 @@  discard block
 block discarded – undo
478 485
 							$memberInfo['birthday'],
479 486
 							zdate($memberInfo['birthday'], 'Y-m-d', false),
480 487
 							$lang->cmd_delete);
481
-					}
482
-					else if($formInfo->name == 'find_account_question')
488
+					} else if($formInfo->name == 'find_account_question')
483 489
 					{
484 490
 						$formTag->type = 'select';
485 491
 						$inputTag = '<select name="find_account_question" id="find_account_question" style="display:block;margin:0 0 8px 0">%s</select>';
486 492
 						$optionTag = array();
487 493
 						foreach($lang->find_account_question_items as $key=>$val)
488 494
 						{
489
-							if($key == $memberInfo['find_account_question']) $selected = 'selected="selected"';
490
-							else $selected = '';
495
+							if($key == $memberInfo['find_account_question']) {
496
+								$selected = 'selected="selected"';
497
+							} else {
498
+								$selected = '';
499
+							}
491 500
 							$optionTag[] = sprintf('<option value="%s" %s >%s</option>',
492 501
 								$key,
493 502
 								$selected,
@@ -495,23 +504,19 @@  discard block
 block discarded – undo
495 504
 						}
496 505
 						$inputTag = sprintf($inputTag, implode('', $optionTag));
497 506
 						$inputTag .= '<input type="text" name="find_account_answer" id="find_account_answer" title="'.Context::getLang('find_account_answer').'" value="'.$memberInfo['find_account_answer'].'" />';
498
-					}
499
-					else if($formInfo->name == 'email_address')
507
+					} else if($formInfo->name == 'email_address')
500 508
 					{
501 509
 						$formTag->type = 'email';
502 510
 						$inputTag = '<input type="email" name="email_address" id="email_address" value="'.$memberInfo['email_address'].'" />';
503
-					}
504
-					else if($formInfo->name == 'homepage')
511
+					} else if($formInfo->name == 'homepage')
505 512
 					{
506 513
 						$formTag->type = 'url';
507 514
 						$inputTag = '<input type="url" name="homepage" id="homepage" value="'.$memberInfo['homepage'].'" />';
508
-					}
509
-					else if($formInfo->name == 'blog')
515
+					} else if($formInfo->name == 'blog')
510 516
 					{
511 517
 						$formTag->type = 'url';
512 518
 						$inputTag = '<input type="url" name="blog" id="blog" value="'.$memberInfo['blog'].'" />';
513
-					}
514
-					else
519
+					} else
515 520
 					{
516 521
 						$formTag->type = 'text';
517 522
 						$inputTag = sprintf('<input type="text" name="%s" id="%s" value="%s" />',
@@ -530,27 +535,22 @@  discard block
 block discarded – undo
530 535
 					if($extendForm->column_type == 'text')
531 536
 					{
532 537
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
533
-					}
534
-					else if($extendForm->column_type == 'homepage')
538
+					} else if($extendForm->column_type == 'homepage')
535 539
 					{
536 540
 						$template = '<input type="url" name="%column_name%" id="%column_name%" value="%value%" />';
537
-					}
538
-					else if($extendForm->column_type == 'email_address')
541
+					} else if($extendForm->column_type == 'email_address')
539 542
 					{
540 543
 						$template = '<input type="email" name="%column_name%" id="%column_name%" value="%value%" />';
541
-					}
542
-					else if($extendForm->column_type == 'tel')
544
+					} else if($extendForm->column_type == 'tel')
543 545
 					{
544 546
 						$extentionReplace = array('tel_0' => $extendForm->value[0],
545 547
 							'tel_1' => $extendForm->value[1],
546 548
 							'tel_2' => $extendForm->value[2]);
547 549
 						$template = '<input type="tel" name="%column_name%[]" id="%column_name%" value="%tel_0%" size="4" maxlength="4" style="width:30px" title="First Number" /> - <input type="tel" name="%column_name%[]" value="%tel_1%" size="4" maxlength="4" style="width:35px" title="Second Number" /> - <input type="tel" name="%column_name%[]" value="%tel_2%" size="4" maxlength="4" style="width:35px" title="Third Number" />';
548
-					}
549
-					else if($extendForm->column_type == 'textarea')
550
+					} else if($extendForm->column_type == 'textarea')
550 551
 					{
551 552
 						$template = '<textarea name="%column_name%" id="%column_name%" rows="4" cols="42">%value%</textarea>';
552
-					}
553
-					else if($extendForm->column_type == 'checkbox')
553
+					} else if($extendForm->column_type == 'checkbox')
554 554
 					{
555 555
 						$template = '';
556 556
 						if($extendForm->default_value)
@@ -561,14 +561,15 @@  discard block
 block discarded – undo
561 561
 							foreach($extendForm->default_value as $v)
562 562
 							{
563 563
 								$checked = '';
564
-								if(is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"';
564
+								if(is_array($extendForm->value) && in_array($v, $extendForm->value)) {
565
+									$checked = 'checked="checked"';
566
+								}
565 567
 								$optionTag[] = '<label for="%column_name%'.$__i.'"><input type="checkbox" id="%column_name%'.$__i.'" name="%column_name%[]" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
566 568
 								$__i++;
567 569
 							}
568 570
 							$template = sprintf($template, implode('', $optionTag));
569 571
 						}
570
-					}
571
-					else if($extendForm->column_type == 'radio')
572
+					} else if($extendForm->column_type == 'radio')
572 573
 					{
573 574
 						$template = '';
574 575
 						if($extendForm->default_value)
@@ -577,14 +578,16 @@  discard block
 block discarded – undo
577 578
 							$optionTag = array();
578 579
 							foreach($extendForm->default_value as $v)
579 580
 							{
580
-								if($extendForm->value == $v)$checked = 'checked="checked"';
581
-								else $checked = '';
581
+								if($extendForm->value == $v) {
582
+									$checked = 'checked="checked"';
583
+								} else {
584
+									$checked = '';
585
+								}
582 586
 								$optionTag[] = '<label><input type="radio" name="%column_name%" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
583 587
 							}
584 588
 							$template = sprintf($template, implode('', $optionTag));
585 589
 						}
586
-					}
587
-					else if($extendForm->column_type == 'select')
590
+					} else if($extendForm->column_type == 'select')
588 591
 					{
589 592
 						$template = '<select name="'.$formInfo->name.'" id="'.$formInfo->name.'">%s</select>';
590 593
 						$optionTag = array();
@@ -593,26 +596,26 @@  discard block
 block discarded – undo
593 596
 						{
594 597
 							foreach($extendForm->default_value as $v)
595 598
 							{
596
-								if($v == $extendForm->value) $selected = 'selected="selected"';
597
-								else $selected = '';
599
+								if($v == $extendForm->value) {
600
+									$selected = 'selected="selected"';
601
+								} else {
602
+									$selected = '';
603
+								}
598 604
 								$optionTag[] = sprintf('<option value="%s" %s >%s</option>', $v, $selected, $v);
599 605
 							}
600 606
 						}
601 607
 						$template = sprintf($template, implode('', $optionTag));
602
-					}
603
-					else if($extendForm->column_type == 'kr_zip')
608
+					} else if($extendForm->column_type == 'kr_zip')
604 609
 					{
605 610
 						$krzipModel = getModel('krzip');
606 611
 						if($krzipModel && method_exists($krzipModel , 'getKrzipCodeSearchHtml' ))
607 612
 						{
608 613
 							$template = $krzipModel->getKrzipCodeSearchHtml($extendForm->column_name, $extendForm->value);
609 614
 						}
610
-					}
611
-					else if($extendForm->column_type == 'jp_zip')
615
+					} else if($extendForm->column_type == 'jp_zip')
612 616
 					{
613 617
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
614
-					}
615
-					else if($extendForm->column_type == 'date')
618
+					} else if($extendForm->column_type == 'date')
616 619
 					{
617 620
 						$extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete);
618 621
 						$template = '<input type="hidden" name="%column_name%" id="date_%column_name%" value="%value%" /><input type="text" placeholder="YYYY-MM-DD" class="inputDate" value="%date%" readonly="readonly" /> <input type="button" value="%cmd_delete%" class="btn dateRemover" />';
@@ -621,8 +624,9 @@  discard block
 block discarded – undo
621 624
 					$replace = array_merge($extentionReplace, $replace);
622 625
 					$inputTag = preg_replace_callback('@%(\w+)%@', function($n) use($replace) { return $replace[$n[1]]; }, $template);
623 626
 
624
-					if($extendForm->description)
625
-						$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
627
+					if($extendForm->description) {
628
+											$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
629
+					}
626 630
 				}
627 631
 				$formTag->inputTag = $inputTag;
628 632
 				$formTags[] = $formTag;
@@ -657,8 +661,9 @@  discard block
 block discarded – undo
657 661
 			$oMemberModel = getModel('member');
658 662
 			$join_form = $oMemberModel->getJoinForm($member_join_form_srl);
659 663
 
660
-			if(!$join_form) Context::set('member_join_form_srl','',true);
661
-			else
664
+			if(!$join_form) {
665
+				Context::set('member_join_form_srl','',true);
666
+			} else
662 667
 			{
663 668
 				Context::set('join_form', $join_form);
664 669
 				$security = new Security();
Please login to merge, or discard this patch.
modules/member/member.api.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	/**
25 25
 	 * Arrange Contents
26 26
 	 *
27
-	 * @param array $content_list
27
+	 * @param string $content_list
28 28
 	 *
29 29
 	 * @return array
30 30
 	 */
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	/**
42 42
 	 * Arrange Contents
43 43
 	 *
44
-	 * @param array $content_list
44
+	 * @param array $content
45 45
 	 *
46 46
 	 * @return array
47 47
 	 */
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
 	function dispSavedDocumentList(&$oModule)
18 18
 	{
19 19
 		$document_list = $this->arrangeContentList(Context::get('document_list'));
20
-		$oModule->add('document_list',$document_list);
21
-		$oModule->add('page_navigation',Context::get('page_navigation'));
20
+		$oModule->add('document_list', $document_list);
21
+		$oModule->add('page_navigation', Context::get('page_navigation'));
22 22
 	}
23 23
 
24 24
 	/**
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
 	function arrangeContentList($content_list)
32 32
 	{
33 33
 		$output = array();
34
-		if(count($content_list))
34
+		if (count($content_list))
35 35
 		{
36
-			foreach($content_list as $key => $val) $output[] = $this->arrangeContent($val);
36
+			foreach ($content_list as $key => $val) $output[] = $this->arrangeContent($val);
37 37
 		}
38 38
 		return $output;
39 39
 	}
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 	function arrangeContent($content)
49 49
 	{
50 50
 		$output = null;
51
-		if($content)
51
+		if ($content)
52 52
 		{
53
-			$output= $content->gets('document_srl','category_srl','nick_name','user_id','user_name','title','content','tags','voted_count','blamed_count','comment_count','regdate','last_update','extra_vars','status');
53
+			$output = $content->gets('document_srl', 'category_srl', 'nick_name', 'user_id', 'user_name', 'title', 'content', 'tags', 'voted_count', 'blamed_count', 'comment_count', 'regdate', 'last_update', 'extra_vars', 'status');
54 54
 		}
55 55
 		return $output;
56 56
 	}
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
 		$output = array();
34 34
 		if(count($content_list))
35 35
 		{
36
-			foreach($content_list as $key => $val) $output[] = $this->arrangeContent($val);
36
+			foreach($content_list as $key => $val) {
37
+				$output[] = $this->arrangeContent($val);
38
+			}
37 39
 		}
38 40
 		return $output;
39 41
 	}
Please login to merge, or discard this patch.
modules/member/member.controller.php 4 patches
Doc Comments   +21 added lines, -13 removed lines patch added patch discarded remove patch
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	/**
188 188
 	 * Delete the post
189 189
 	 *
190
-	 * @return void|Object (void : success, Object : fail)
190
+	 * @return Object|null (void : success, Object : fail)
191 191
 	 */
192 192
 	function procMemberDeleteSavedDocument()
193 193
 	{
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	/**
206 206
 	 * Check values when member joining
207 207
 	 *
208
-	 * @return void|Object (void : success, Object : fail)
208
+	 * @return null|Object (void : success, Object : fail)
209 209
 	 */
210 210
 	function procMemberCheckValue()
211 211
 	{
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 	/**
673 673
 	 * Add a profile image
674 674
 	 *
675
-	 * @return void|Object (void : success, Object : fail)
675
+	 * @return ModuleObject|null (void : success, Object : fail)
676 676
 	 */
677 677
 	function procMemberInsertProfileImage()
678 678
 	{
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 	/**
752 752
 	 * Add an image name
753 753
 	 *
754
-	 * @return void|Object (void : success, Object : fail)
754
+	 * @return ModuleObject|null (void : success, Object : fail)
755 755
 	 */
756 756
 	function procMemberInsertImageName()
757 757
 	{
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
 	/**
837 837
 	 * Delete Image name
838 838
 	 *
839
-	 * @return void
839
+	 * @return Object
840 840
 	 */
841 841
 	function procMemberDeleteImageName($_memberSrl = 0)
842 842
 	{
@@ -860,7 +860,7 @@  discard block
 block discarded – undo
860 860
 	/**
861 861
 	 * Add an image to mark
862 862
 	 *
863
-	 * @return void|Object (void : success, Object : fail)
863
+	 * @return ModuleObject|null (void : success, Object : fail)
864 864
 	 */
865 865
 	function procMemberInsertImageMark()
866 866
 	{
@@ -1100,7 +1100,7 @@  discard block
 block discarded – undo
1100 1100
 	 * Execute finding ID/Passoword
1101 1101
 	 * When clicking the link in the verification email, a method is called to change the old password and to authenticate it
1102 1102
 	 *
1103
-	 * @return void|Object (void : success, Object : fail)
1103
+	 * @return ModuleObject|null (void : success, Object : fail)
1104 1104
 	 */
1105 1105
 	function procMemberAuthAccount()
1106 1106
 	{
@@ -1172,7 +1172,7 @@  discard block
 block discarded – undo
1172 1172
 	/**
1173 1173
 	 * Request to re-send the authentication mail
1174 1174
 	 *
1175
-	 * @return void|Object (void : success, Object : fail)
1175
+	 * @return Object|null (void : success, Object : fail)
1176 1176
 	 */
1177 1177
 	function procMemberResendAuthMail()
1178 1178
 	{
@@ -1331,6 +1331,9 @@  discard block
 block discarded – undo
1331 1331
 		$this->setRedirectUrl($returnUrl);
1332 1332
 	}
1333 1333
 
1334
+	/**
1335
+	 * @param stdClass $auth_args
1336
+	 */
1334 1337
 	function _sendAuthMail($auth_args, $member_info)
1335 1338
 	{
1336 1339
 		$oMemberModel = getModel('member');
@@ -1386,7 +1389,7 @@  discard block
 block discarded – undo
1386 1389
 	/**
1387 1390
 	 * Join a virtual site
1388 1391
 	 *
1389
-	 * @return void|Object (void : success, Object : fail)
1392
+	 * @return Object|null (void : success, Object : fail)
1390 1393
 	 */
1391 1394
 	function procMemberSiteSignUp()
1392 1395
 	{
@@ -1463,7 +1466,7 @@  discard block
 block discarded – undo
1463 1466
 	 * @param int $member_srl
1464 1467
 	 * @param string $signature
1465 1468
 	 *
1466
-	 * @return void
1469
+	 * @return boolean|null
1467 1470
 	 */
1468 1471
 	function putSignature($member_srl, $signature)
1469 1472
 	{
@@ -1865,6 +1868,8 @@  discard block
 block discarded – undo
1865 1868
 	/**
1866 1869
 	 * Logged method for providing a personalized menu
1867 1870
 	 * Login information is used in the output widget, or personalized page
1871
+	 * @param string $act
1872
+	 * @param string $str
1868 1873
 	 */
1869 1874
 	function addMemberMenu($act, $str)
1870 1875
 	{
@@ -1895,6 +1900,7 @@  discard block
 block discarded – undo
1895 1900
 
1896 1901
 	/**
1897 1902
 	 * Add users to the member table
1903
+	 * @param stdClass $args
1898 1904
 	 */
1899 1905
 	function insertMember(&$args, $password_is_hashed = false)
1900 1906
 	{
@@ -2086,6 +2092,7 @@  discard block
 block discarded – undo
2086 2092
 	 * Modify member information
2087 2093
 	 *
2088 2094
 	 * @param bool $is_admin , modified 2013-11-22
2095
+	 * @param stdClass $args
2089 2096
 	 */
2090 2097
 	function updateMember($args, $is_admin = FALSE)
2091 2098
 	{
@@ -2272,6 +2279,7 @@  discard block
 block discarded – undo
2272 2279
 
2273 2280
 	/**
2274 2281
 	 * Modify member password
2282
+	 * @param stdClass $args
2275 2283
 	 */
2276 2284
 	function updateMemberPassword($args)
2277 2285
 	{
@@ -2555,7 +2563,7 @@  discard block
 block discarded – undo
2555 2563
 	 *
2556 2564
 	 * @param array &$menu_list
2557 2565
 	 *
2558
-	 * @return object
2566
+	 * @return Object
2559 2567
 	**/
2560 2568
 	function triggerGetDocumentMenu(&$menu_list)
2561 2569
 	{
@@ -2585,7 +2593,7 @@  discard block
 block discarded – undo
2585 2593
 	 *
2586 2594
 	 * @param array &$menu_list
2587 2595
 	 *
2588
-	 * @return object
2596
+	 * @return Object
2589 2597
 	**/
2590 2598
 	function triggerGetCommentMenu(&$menu_list)
2591 2599
 	{
@@ -2613,7 +2621,7 @@  discard block
 block discarded – undo
2613 2621
 	/**
2614 2622
 	 * Spammer manage. Denied user login. And delete or trash all documents. Response Ajax string
2615 2623
 	 *
2616
-	 * @return object
2624
+	 * @return Object
2617 2625
 	**/
2618 2626
 	function procMemberSpammerManage()
2619 2627
 	{
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -2556,7 +2556,7 @@  discard block
 block discarded – undo
2556 2556
 	 * @param array &$menu_list
2557 2557
 	 *
2558 2558
 	 * @return object
2559
-	**/
2559
+	 **/
2560 2560
 	function triggerGetDocumentMenu(&$menu_list)
2561 2561
 	{
2562 2562
 		if(!Context::get('is_logged')) return new Object();
@@ -2586,7 +2586,7 @@  discard block
 block discarded – undo
2586 2586
 	 * @param array &$menu_list
2587 2587
 	 *
2588 2588
 	 * @return object
2589
-	**/
2589
+	 **/
2590 2590
 	function triggerGetCommentMenu(&$menu_list)
2591 2591
 	{
2592 2592
 		if(!Context::get('is_logged')) return new Object();
@@ -2614,7 +2614,7 @@  discard block
 block discarded – undo
2614 2614
 	 * Spammer manage. Denied user login. And delete or trash all documents. Response Ajax string
2615 2615
 	 *
2616 2616
 	 * @return object
2617
-	**/
2617
+	 **/
2618 2618
 	function procMemberSpammerManage()
2619 2619
 	{
2620 2620
 		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
@@ -2680,7 +2680,7 @@  discard block
 block discarded – undo
2680 2680
 	 * @param int $member_srl
2681 2681
 	 *
2682 2682
 	 * @return object
2683
-	**/
2683
+	 **/
2684 2684
 	private function _spammerMember($member_srl) {
2685 2685
 		$logged_info = Context::get('logged_info');
2686 2686
 		$spam_description = trim( Context::get('spam_description') );
@@ -2721,7 +2721,7 @@  discard block
 block discarded – undo
2721 2721
 	 * @param bool $isMoveToTrash
2722 2722
 	 *
2723 2723
 	 * @return object
2724
-	**/
2724
+	 **/
2725 2725
 	private function _spammerDocuments($member_srl, $isMoveToTrash) {
2726 2726
 		$oDocumentController = getController('document');
2727 2727
 		$oDocumentModel = getModel('document');
Please login to merge, or discard this patch.
Spacing   +443 added lines, -443 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);
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
 	function procMemberScrapDocument()
126 126
 	{
127 127
 		// Check login information
128
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
128
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
129 129
 		$logged_info = Context::get('logged_info');
130 130
 
131
-		$document_srl = (int)Context::get('document_srl');
132
-		if(!$document_srl) $document_srl = (int)Context::get('target_srl');
133
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
131
+		$document_srl = (int) Context::get('document_srl');
132
+		if (!$document_srl) $document_srl = (int) Context::get('target_srl');
133
+		if (!$document_srl) return new Object(-1, 'msg_invalid_request');
134 134
 		// Get document
135 135
 		$oDocumentModel = getModel('document');
136 136
 		$oDocument = $oDocumentModel->getDocument($document_srl);
@@ -145,10 +145,10 @@  discard block
 block discarded – undo
145 145
 		$args->title = $oDocument->get('title');
146 146
 		// Check if already scrapped
147 147
 		$output = executeQuery('member.getScrapDocument', $args);
148
-		if($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
148
+		if ($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
149 149
 		// Insert
150 150
 		$output = executeQuery('member.addScrapDocument', $args);
151
-		if(!$output->toBool()) return $output;
151
+		if (!$output->toBool()) return $output;
152 152
 
153 153
 		$this->setError(-1);
154 154
 		$this->setMessage('success_registed');
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
 	function procMemberDeleteScrap()
163 163
 	{
164 164
 		// Check login information
165
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
165
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
166 166
 		$logged_info = Context::get('logged_info');
167 167
 
168
-		$document_srl = (int)Context::get('document_srl');
169
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
168
+		$document_srl = (int) Context::get('document_srl');
169
+		if (!$document_srl) return new Object(-1, 'msg_invalid_request');
170 170
 		// Variables
171 171
 		$args = new stdClass;
172 172
 		$args->member_srl = $logged_info->member_srl;
@@ -192,23 +192,23 @@  discard block
 block discarded – undo
192 192
 	function procMemberDeleteSavedDocument()
193 193
 	{
194 194
 		// Check login information
195
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
195
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
196 196
 		$logged_info = Context::get('logged_info');
197 197
 
198
-		$document_srl = (int)Context::get('document_srl');
199
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
198
+		$document_srl = (int) Context::get('document_srl');
199
+		if (!$document_srl) return new Object(-1, 'msg_invalid_request');
200 200
 
201 201
 		$oDocumentModel = getModel('document');
202 202
 		$oDocument = $oDocumentModel->getDocument($document_srl);
203 203
 		if ($oDocument->get('member_srl') != $logged_info->member_srl)
204 204
 		{
205
-			return new Object(-1,'msg_invalid_request');
205
+			return new Object(-1, 'msg_invalid_request');
206 206
 		}
207 207
 
208 208
 		$configStatusList = $oDocumentModel->getStatusList();
209 209
 		if ($oDocument->get('status') != $configStatusList['temp'])
210 210
 		{
211
-			return new Object(-1,'msg_invalid_request');
211
+			return new Object(-1, 'msg_invalid_request');
212 212
 		}
213 213
 
214 214
 		$oDocumentController = getController('document');
@@ -224,37 +224,37 @@  discard block
 block discarded – undo
224 224
 	{
225 225
 		$name = Context::get('name');
226 226
 		$value = Context::get('value');
227
-		if(!$value) return;
227
+		if (!$value) return;
228 228
 
229 229
 		$oMemberModel = getModel('member');
230 230
 		// Check if logged-in
231 231
 		$logged_info = Context::get('logged_info');
232 232
 
233 233
 
234
-		switch($name)
234
+		switch ($name)
235 235
 		{
236 236
 			case 'user_id' :
237 237
 				// Check denied ID
238
-				if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id');
238
+				if ($oMemberModel->isDeniedID($value)) return new Object(0, 'denied_user_id');
239 239
 				// Check if duplicated
240 240
 				$member_srl = $oMemberModel->getMemberSrlByUserID($value);
241
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_user_id');
241
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_user_id');
242 242
 				break;
243 243
 			case 'nick_name' :
244 244
 				// Check denied ID
245
-				if($oMemberModel->isDeniedNickName($value))
245
+				if ($oMemberModel->isDeniedNickName($value))
246 246
 				{
247
-					return new Object(0,'denied_nick_name');
247
+					return new Object(0, 'denied_nick_name');
248 248
 				}
249 249
 				// Check if duplicated
250 250
 				$member_srl = $oMemberModel->getMemberSrlByNickName($value);
251
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name');
251
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_nick_name');
252 252
 
253 253
 				break;
254 254
 			case 'email_address' :
255 255
 				// Check if duplicated
256 256
 				$member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
257
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address');
257
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_email_address');
258 258
 				break;
259 259
 		}
260 260
 	}
@@ -266,25 +266,25 @@  discard block
 block discarded – undo
266 266
 	 */
267 267
 	function procMemberInsert()
268 268
 	{
269
-		if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request");
270
-		$oMemberModel = &getModel ('member');
269
+		if (Context::getRequestMethod() == "GET") return new Object(-1, "msg_invalid_request");
270
+		$oMemberModel = &getModel('member');
271 271
 		$config = $oMemberModel->getMemberConfig();
272 272
 
273 273
 		// call a trigger (before)
274
-		$trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config);
275
-		if(!$trigger_output->toBool ()) return $trigger_output;
274
+		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'before', $config);
275
+		if (!$trigger_output->toBool()) return $trigger_output;
276 276
 		// Check if an administrator allows a membership
277
-		if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled');
277
+		if ($config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
278 278
 		// Check if the user accept the license terms (only if terms exist)
279
-		if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
279
+		if ($config->agreement && Context::get('accept_agreement') != 'Y') return $this->stop('msg_accept_agreement');
280 280
 
281 281
 		// Extract the necessary information in advance
282 282
 		$getVars = array();
283
-		if($config->signupForm)
283
+		if ($config->signupForm)
284 284
 		{
285
-			foreach($config->signupForm as $formInfo)
285
+			foreach ($config->signupForm as $formInfo)
286 286
 			{
287
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
287
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
288 288
 				{
289 289
 					$getVars[] = $formInfo->name;
290 290
 				}
@@ -292,22 +292,22 @@  discard block
 block discarded – undo
292 292
 		}
293 293
 
294 294
 		$args = new stdClass;
295
-		foreach($getVars as $val)
295
+		foreach ($getVars as $val)
296 296
 		{
297 297
 			$args->{$val} = Context::get($val);
298
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
298
+			if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
299 299
 		}
300 300
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
301
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
301
+		if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
302 302
 
303 303
 		$args->find_account_answer = Context::get('find_account_answer');
304 304
 		$args->allow_mailing = Context::get('allow_mailing');
305 305
 		$args->allow_message = Context::get('allow_message');
306 306
 
307
-		if($args->password1) $args->password = $args->password1;
307
+		if ($args->password1) $args->password = $args->password1;
308 308
 
309 309
 		// check password strength
310
-		if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
310
+		if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
311 311
 		{
312 312
 			$message = Context::getLang('about_password_strength');
313 313
 			return new Object(-1, $message[$config->password_strength]);
@@ -333,58 +333,58 @@  discard block
 block discarded – undo
333 333
 		unset($all_args->secret_text);
334 334
 
335 335
 		// Set the user state as "denied" when using mail authentication
336
-		if($config->enable_confirm == 'Y') $args->denied = 'Y';
336
+		if ($config->enable_confirm == 'Y') $args->denied = 'Y';
337 337
 		// Add extra vars after excluding necessary information from all the requested arguments
338 338
 		$extra_vars = delObjectVars($all_args, $args);
339 339
 		$args->extra_vars = serialize($extra_vars);
340 340
 
341 341
 		// remove whitespace
342 342
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
343
-		foreach($checkInfos as $val)
343
+		foreach ($checkInfos as $val)
344 344
 		{
345
-			if(isset($args->{$val}))
345
+			if (isset($args->{$val}))
346 346
 			{
347 347
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
348 348
 			}
349 349
 		}
350 350
 		$output = $this->insertMember($args);
351
-		if(!$output->toBool()) return $output;
351
+		if (!$output->toBool()) return $output;
352 352
 
353 353
 		// insert ProfileImage, ImageName, ImageMark
354 354
 		$profile_image = $_FILES['profile_image'];
355
-		if(is_uploaded_file($profile_image['tmp_name']))
355
+		if (is_uploaded_file($profile_image['tmp_name']))
356 356
 		{
357 357
 			$this->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
358 358
 		}
359 359
 
360 360
 		$image_mark = $_FILES['image_mark'];
361
-		if(is_uploaded_file($image_mark['tmp_name']))
361
+		if (is_uploaded_file($image_mark['tmp_name']))
362 362
 		{
363 363
 			$this->insertImageMark($args->member_srl, $image_mark['tmp_name']);
364 364
 		}
365 365
 
366 366
 		$image_name = $_FILES['image_name'];
367
-		if(is_uploaded_file($image_name['tmp_name']))
367
+		if (is_uploaded_file($image_name['tmp_name']))
368 368
 		{
369 369
 			$this->insertImageName($args->member_srl, $image_name['tmp_name']);
370 370
 		}
371 371
 
372 372
 		// If a virtual site, join the site
373 373
 		$site_module_info = Context::get('site_module_info');
374
-		if($site_module_info->site_srl > 0)
374
+		if ($site_module_info->site_srl > 0)
375 375
 		{
376 376
 			$columnList = array('site_srl', 'group_srl');
377 377
 			$default_group = $oMemberModel->getDefaultGroup($site_module_info->site_srl, $columnList);
378
-			if($default_group->group_srl)
378
+			if ($default_group->group_srl)
379 379
 			{
380 380
 				$this->addMemberToGroup($args->member_srl, $default_group->group_srl, $site_module_info->site_srl);
381 381
 			}
382 382
 
383 383
 		}
384 384
 		// Log-in
385
-		if($config->enable_confirm != 'Y')
385
+		if ($config->enable_confirm != 'Y')
386 386
 		{
387
-			if($config->identifier == 'email_address')
387
+			if ($config->identifier == 'email_address')
388 388
 			{
389 389
 				$output = $this->doLogin($args->email_address);
390 390
 			}
@@ -392,8 +392,8 @@  discard block
 block discarded – undo
392 392
 			{
393 393
 				$output = $this->doLogin($args->user_id);
394 394
 			}
395
-			if(!$output->toBool()) {
396
-				if($output->error == -9)
395
+			if (!$output->toBool()) {
396
+				if ($output->error == -9)
397 397
 					$output->error = -11;
398 398
 				return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output);
399 399
 			}
@@ -401,8 +401,8 @@  discard block
 block discarded – undo
401 401
 
402 402
 		// Results
403 403
 		$this->add('member_srl', $args->member_srl);
404
-		if($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
405
-		if($config->enable_confirm == 'Y')
404
+		if ($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
405
+		if ($config->enable_confirm == 'Y')
406 406
 		{
407 407
 			$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
408 408
 			$this->setMessage($msg);
@@ -411,19 +411,19 @@  discard block
 block discarded – undo
411 411
 		else $this->setMessage('success_registed');
412 412
 		// Call a trigger (after)
413 413
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
414
-		if(!$trigger_output->toBool()) return $trigger_output;
414
+		if (!$trigger_output->toBool()) return $trigger_output;
415 415
 
416
-		if($config->redirect_url)
416
+		if ($config->redirect_url)
417 417
 		{
418 418
 			$returnUrl = $config->redirect_url;
419 419
 		}
420 420
 		else
421 421
 		{
422
-			if(Context::get('success_return_url'))
422
+			if (Context::get('success_return_url'))
423 423
 			{
424 424
 				$returnUrl = Context::get('success_return_url');
425 425
 			}
426
-			else if($_COOKIE['XE_REDIRECT_URL'])
426
+			else if ($_COOKIE['XE_REDIRECT_URL'])
427 427
 			{
428 428
 				$returnUrl = $_COOKIE['XE_REDIRECT_URL'];
429 429
 				setcookie("XE_REDIRECT_URL", '', 1);
@@ -437,26 +437,26 @@  discard block
 block discarded – undo
437 437
 
438 438
 	function procMemberModifyInfoBefore()
439 439
 	{
440
-		if($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD')
440
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD')
441 441
 		{
442 442
 			return $this->stop('msg_invalid_request');
443 443
 		}
444 444
 
445
-		if(!Context::get('is_logged'))
445
+		if (!Context::get('is_logged'))
446 446
 		{
447 447
 			return $this->stop('msg_not_logged');
448 448
 		}
449 449
 
450 450
 		$password = Context::get('password');
451 451
 
452
-		if(!$password)
452
+		if (!$password)
453 453
 		{
454 454
 			return $this->stop('msg_invalid_request');
455 455
 		}
456 456
 
457 457
 		$oMemberModel = getModel('member');
458 458
 
459
-		if(!$this->memberInfo->password)
459
+		if (!$this->memberInfo->password)
460 460
 		{
461 461
 			// Get information of logged-in user
462 462
 			$logged_info = Context::get('logged_info');
@@ -467,14 +467,14 @@  discard block
 block discarded – undo
467 467
 			$this->memberInfo->password = $memberInfo->password;
468 468
 		}
469 469
 		// Verify the current password
470
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
470
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
471 471
 		{
472 472
 			return new Object(-1, 'invalid_password');
473 473
 		}
474 474
 
475 475
 		$_SESSION['rechecked_password_step'] = 'VALIDATE_PASSWORD';
476 476
 
477
-		if(Context::get('success_return_url'))
477
+		if (Context::get('success_return_url'))
478 478
 		{
479 479
 			$redirectUrl = Context::get('success_return_url');
480 480
 		}
@@ -492,12 +492,12 @@  discard block
 block discarded – undo
492 492
 	 */
493 493
 	function procMemberModifyInfo()
494 494
 	{
495
-		if(!Context::get('is_logged'))
495
+		if (!Context::get('is_logged'))
496 496
 		{
497 497
 			return $this->stop('msg_not_logged');
498 498
 		}
499 499
 
500
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
500
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
501 501
 		{
502 502
 			return $this->stop('msg_invalid_request');
503 503
 		}
@@ -505,13 +505,13 @@  discard block
 block discarded – undo
505 505
 
506 506
 		// Extract the necessary information in advance
507 507
 		$oMemberModel = getModel('member');
508
-		$config = $oMemberModel->getMemberConfig ();
509
-		$getVars = array('find_account_answer','allow_mailing','allow_message');
510
-		if($config->signupForm)
508
+		$config = $oMemberModel->getMemberConfig();
509
+		$getVars = array('find_account_answer', 'allow_mailing', 'allow_message');
510
+		if ($config->signupForm)
511 511
 		{
512
-			foreach($config->signupForm as $formInfo)
512
+			foreach ($config->signupForm as $formInfo)
513 513
 			{
514
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
514
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
515 515
 				{
516 516
 					$getVars[] = $formInfo->name;
517 517
 				}
@@ -519,16 +519,16 @@  discard block
 block discarded – undo
519 519
 		}
520 520
 
521 521
 		$args = new stdClass;
522
-		foreach($getVars as $val)
522
+		foreach ($getVars as $val)
523 523
 		{
524 524
 			$args->{$val} = Context::get($val);
525
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
525
+			if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
526 526
 		}
527 527
 		// Login Information
528 528
 		$logged_info = Context::get('logged_info');
529 529
 		$args->member_srl = $logged_info->member_srl;
530 530
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
531
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
531
+		if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
532 532
 		// Remove some unnecessary variables from all the vars
533 533
 		$all_args = Context::getRequestVars();
534 534
 		unset($all_args->module);
@@ -552,9 +552,9 @@  discard block
 block discarded – undo
552 552
 
553 553
 		// remove whitespace
554 554
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
555
-		foreach($checkInfos as $val)
555
+		foreach ($checkInfos as $val)
556 556
 		{
557
-			if(isset($args->{$val}))
557
+			if (isset($args->{$val}))
558 558
 			{
559 559
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
560 560
 			}
@@ -562,22 +562,22 @@  discard block
 block discarded – undo
562 562
 
563 563
 		// Execute insert or update depending on the value of member_srl
564 564
 		$output = $this->updateMember($args);
565
-		if(!$output->toBool()) return $output;
565
+		if (!$output->toBool()) return $output;
566 566
 
567 567
 		$profile_image = $_FILES['profile_image'];
568
-		if(is_uploaded_file($profile_image['tmp_name']))
568
+		if (is_uploaded_file($profile_image['tmp_name']))
569 569
 		{
570 570
 			$this->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
571 571
 		}
572 572
 
573 573
 		$image_mark = $_FILES['image_mark'];
574
-		if(is_uploaded_file($image_mark['tmp_name']))
574
+		if (is_uploaded_file($image_mark['tmp_name']))
575 575
 		{
576 576
 			$this->insertImageMark($args->member_srl, $image_mark['tmp_name']);
577 577
 		}
578 578
 
579 579
 		$image_name = $_FILES['image_name'];
580
-		if(is_uploaded_file($image_name['tmp_name']))
580
+		if (is_uploaded_file($image_name['tmp_name']))
581 581
 		{
582 582
 			$this->insertImageName($args->member_srl, $image_name['tmp_name']);
583 583
 		}
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 
593 593
 		// Call a trigger after successfully log-in (after)
594 594
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo);
595
-		if(!$trigger_output->toBool()) return $trigger_output;
595
+		if (!$trigger_output->toBool()) return $trigger_output;
596 596
 
597 597
 		$this->setSessionInfo();
598 598
 		// Return result
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
 	 */
614 614
 	function procMemberModifyPassword()
615 615
 	{
616
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
616
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
617 617
 		// Extract the necessary information in advance
618 618
 		$current_password = trim(Context::get('current_password'));
619 619
 		$password = trim(Context::get('password1'));
@@ -627,17 +627,17 @@  discard block
 block discarded – undo
627 627
 
628 628
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
629 629
 		// Verify the cuttent password
630
-		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
630
+		if (!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
631 631
 
632 632
 		// Check if a new password is as same as the previous password
633
-		if($current_password == $password) return new Object(-1, 'invalid_new_password');
633
+		if ($current_password == $password) return new Object(-1, 'invalid_new_password');
634 634
 
635 635
 		// Execute insert or update depending on the value of member_srl
636 636
 		$args = new stdClass;
637 637
 		$args->member_srl = $member_srl;
638 638
 		$args->password = $password;
639 639
 		$output = $this->updateMemberPassword($args);
640
-		if(!$output->toBool()) return $output;
640
+		if (!$output->toBool()) return $output;
641 641
 
642 642
 		$this->add('member_srl', $args->member_srl);
643 643
 		$this->setMessage('success_updated');
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
 	 */
654 654
 	function procMemberLeave()
655 655
 	{
656
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
656
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
657 657
 		// Extract the necessary information in advance
658 658
 		$password = trim(Context::get('password'));
659 659
 		// Get information of logged-in user
@@ -662,17 +662,17 @@  discard block
 block discarded – undo
662 662
 		// Create a member model object
663 663
 		$oMemberModel = getModel('member');
664 664
 		// Get information of member_srl
665
-		if(!$this->memberInfo->password)
665
+		if (!$this->memberInfo->password)
666 666
 		{
667 667
 			$columnList = array('member_srl', 'password');
668 668
 			$memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
669 669
 			$this->memberInfo->password = $memberInfo->password;
670 670
 		}
671 671
 		// Verify the cuttent password
672
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
672
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
673 673
 
674 674
 		$output = $this->deleteMember($member_srl);
675
-		if(!$output->toBool()) return $output;
675
+		if (!$output->toBool()) return $output;
676 676
 		// Destroy all session information
677 677
 		$this->destroySessionInfo();
678 678
 		// Return success message
@@ -691,17 +691,17 @@  discard block
 block discarded – undo
691 691
 	{
692 692
 		// Check if the file is successfully uploaded
693 693
 		$file = $_FILES['profile_image'];
694
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
694
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
695 695
 		// Ignore if member_srl is invalid or doesn't exist.
696 696
 		$member_srl = Context::get('member_srl');
697
-		if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
697
+		if (!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
698 698
 
699 699
 		$logged_info = Context::get('logged_info');
700
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
700
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
701 701
 		// Return if member module is set not to use an image name or the user is not an administrator ;
702 702
 		$oModuleModel = getModel('module');
703 703
 		$config = $oModuleModel->getModuleConfig('member');
704
-		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
704
+		if ($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
705 705
 
706 706
 		$this->insertProfileImage($member_srl, $file['tmp_name']);
707 707
 		// Page refresh
@@ -723,25 +723,25 @@  discard block
 block discarded – undo
723 723
 	{
724 724
 
725 725
 		// Check uploaded file
726
-		if(!checkUploadedFile($target_file)) return;
726
+		if (!checkUploadedFile($target_file)) return;
727 727
 
728 728
 		$oMemberModel = getModel('member');
729 729
 		$config = $oMemberModel->getMemberConfig();
730 730
 
731 731
 		// Get an image size
732 732
 		$max_width = $config->profile_image_max_width;
733
-		if(!$max_width) $max_width = "90";
733
+		if (!$max_width) $max_width = "90";
734 734
 		$max_height = $config->profile_image_max_height;
735
-		if(!$max_height) $max_height = "90";
735
+		if (!$max_height) $max_height = "90";
736 736
 		// Get a target path to save
737 737
 		$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
738 738
 		FileHandler::makeDir($target_path);
739 739
 
740 740
 		// Get file information
741 741
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
742
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
743
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
744
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
742
+		if (IMAGETYPE_PNG == $type) $ext = 'png';
743
+		elseif (IMAGETYPE_JPEG == $type) $ext = 'jpg';
744
+		elseif (IMAGETYPE_GIF == $type) $ext = 'gif';
745 745
 		else
746 746
 		{
747 747
 			return;
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 
752 752
 		$target_filename = sprintf('%s%d.%s', $target_path, $member_srl, $ext);
753 753
 		// Convert if the image size is larger than a given size or if the format is not a gif
754
-		if(($width > $max_width || $height > $max_height ) && $type != 1)
754
+		if (($width > $max_width || $height > $max_height) && $type != 1)
755 755
 		{
756 756
 			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
757 757
 		}
@@ -770,17 +770,17 @@  discard block
 block discarded – undo
770 770
 	{
771 771
 		// Check if the file is successfully uploaded
772 772
 		$file = $_FILES['image_name'];
773
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
773
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
774 774
 		// Ignore if member_srl is invalid or doesn't exist.
775 775
 		$member_srl = Context::get('member_srl');
776
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
776
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_name');
777 777
 
778 778
 		$logged_info = Context::get('logged_info');
779
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
779
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
780 780
 		// Return if member module is set not to use an image name or the user is not an administrator ;
781 781
 		$oModuleModel = getModel('module');
782 782
 		$config = $oModuleModel->getModuleConfig('member');
783
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
783
+		if ($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
784 784
 
785 785
 		$this->insertImageName($member_srl, $file['tmp_name']);
786 786
 		// Page refresh
@@ -801,15 +801,15 @@  discard block
 block discarded – undo
801 801
 	function insertImageName($member_srl, $target_file)
802 802
 	{
803 803
 		// Check uploaded file
804
-		if(!checkUploadedFile($target_file)) return;
804
+		if (!checkUploadedFile($target_file)) return;
805 805
 
806 806
 		$oModuleModel = getModel('module');
807 807
 		$config = $oModuleModel->getModuleConfig('member');
808 808
 		// Get an image size
809 809
 		$max_width = $config->image_name_max_width;
810
-		if(!$max_width) $max_width = "90";
810
+		if (!$max_width) $max_width = "90";
811 811
 		$max_height = $config->image_name_max_height;
812
-		if(!$max_height) $max_height = "20";
812
+		if (!$max_height) $max_height = "20";
813 813
 		// Get a target path to save
814 814
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
815 815
 		FileHandler::makeDir($target_path);
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
 		// Get file information
819 819
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
820 820
 		// Convert if the image size is larger than a given size or if the format is not a gif
821
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
821
+		if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
822 822
 		else @copy($target_file, $target_filename);
823 823
 	}
824 824
 
@@ -830,20 +830,20 @@  discard block
 block discarded – undo
830 830
 	function procMemberDeleteProfileImage($_memberSrl = 0)
831 831
 	{
832 832
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
833
-		if(!$member_srl)
833
+		if (!$member_srl)
834 834
 		{
835
-			return new Object(0,'success');
835
+			return new Object(0, 'success');
836 836
 		}
837 837
 
838 838
 		$logged_info = Context::get('logged_info');
839 839
 
840
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
840
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
841 841
 		{
842 842
 			$oMemberModel = getModel('member');
843 843
 			$profile_image = $oMemberModel->getProfileImage($member_srl);
844 844
 			FileHandler::removeFile($profile_image->file);
845 845
 		}
846
-		return new Object(0,'success');
846
+		return new Object(0, 'success');
847 847
 	}
848 848
 
849 849
 	/**
@@ -854,20 +854,20 @@  discard block
 block discarded – undo
854 854
 	function procMemberDeleteImageName($_memberSrl = 0)
855 855
 	{
856 856
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
857
-		if(!$member_srl)
857
+		if (!$member_srl)
858 858
 		{
859
-			return new Object(0,'success');
859
+			return new Object(0, 'success');
860 860
 		}
861 861
 
862 862
 		$logged_info = Context::get('logged_info');
863 863
 
864
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
864
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
865 865
 		{
866 866
 			$oMemberModel = getModel('member');
867 867
 			$image_name = $oMemberModel->getImageName($member_srl);
868 868
 			FileHandler::removeFile($image_name->file);
869 869
 		}
870
-		return new Object(0,'success');
870
+		return new Object(0, 'success');
871 871
 	}
872 872
 
873 873
 	/**
@@ -879,17 +879,17 @@  discard block
 block discarded – undo
879 879
 	{
880 880
 		// Check if the file is successfully uploaded
881 881
 		$file = $_FILES['image_mark'];
882
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
882
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
883 883
 		// Ignore if member_srl is invalid or doesn't exist.
884 884
 		$member_srl = Context::get('member_srl');
885
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
885
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
886 886
 
887 887
 		$logged_info = Context::get('logged_info');
888
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
888
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
889 889
 		// Membership in the images mark the module using the ban was set by an administrator or return;
890 890
 		$oModuleModel = getModel('module');
891 891
 		$config = $oModuleModel->getModuleConfig('member');
892
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
892
+		if ($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
893 893
 
894 894
 		$this->insertImageMark($member_srl, $file['tmp_name']);
895 895
 		// Page refresh
@@ -910,15 +910,15 @@  discard block
 block discarded – undo
910 910
 	function insertImageMark($member_srl, $target_file)
911 911
 	{
912 912
 		// Check uploaded file
913
-		if(!checkUploadedFile($target_file)) return;
913
+		if (!checkUploadedFile($target_file)) return;
914 914
 
915 915
 		$oModuleModel = getModel('module');
916 916
 		$config = $oModuleModel->getModuleConfig('member');
917 917
 		// Get an image size
918 918
 		$max_width = $config->image_mark_max_width;
919
-		if(!$max_width) $max_width = "20";
919
+		if (!$max_width) $max_width = "20";
920 920
 		$max_height = $config->image_mark_max_height;
921
-		if(!$max_height) $max_height = "20";
921
+		if (!$max_height) $max_height = "20";
922 922
 
923 923
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
924 924
 		FileHandler::makeDir($target_path);
@@ -927,7 +927,7 @@  discard block
 block discarded – undo
927 927
 		// Get file information
928 928
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
929 929
 
930
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
930
+		if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
931 931
 		else @copy($target_file, $target_filename);
932 932
 	}
933 933
 
@@ -939,20 +939,20 @@  discard block
 block discarded – undo
939 939
 	function procMemberDeleteImageMark($_memberSrl = 0)
940 940
 	{
941 941
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
942
-		if(!$member_srl)
942
+		if (!$member_srl)
943 943
 		{
944
-			return new Object(0,'success');
944
+			return new Object(0, 'success');
945 945
 		}
946 946
 
947 947
 		$logged_info = Context::get('logged_info');
948 948
 
949
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
949
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
950 950
 		{
951 951
 			$oMemberModel = getModel('member');
952 952
 			$image_mark = $oMemberModel->getImageMark($member_srl);
953 953
 			FileHandler::removeFile($image_mark->file);
954 954
 		}
955
-		return new Object(0,'success');
955
+		return new Object(0, 'success');
956 956
 	}
957 957
 
958 958
 	/**
@@ -963,26 +963,26 @@  discard block
 block discarded – undo
963 963
 	function procMemberFindAccount()
964 964
 	{
965 965
 		$email_address = Context::get('email_address');
966
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
966
+		if (!$email_address) return new Object(-1, 'msg_invalid_request');
967 967
 
968 968
 		$oMemberModel = getModel('member');
969 969
 		$oModuleModel = getModel('module');
970 970
 
971 971
 		// Check if a member having the same email address exists
972 972
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
973
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
973
+		if (!$member_srl) return new Object(-1, 'msg_email_not_exists');
974 974
 
975 975
 		// Get information of the member
976 976
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
977 977
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
978 978
 
979 979
 		// Check if possible to find member's ID and password
980
-		if($member_info->denied == 'Y')
980
+		if ($member_info->denied == 'Y')
981 981
 		{
982 982
 			$chk_args = new stdClass;
983 983
 			$chk_args->member_srl = $member_info->member_srl;
984 984
 			$output = executeQuery('member.chkAuthMail', $chk_args);
985
-			if($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
985
+			if ($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
986 986
 		}
987 987
 
988 988
 		// Insert data into the authentication DB
@@ -995,19 +995,19 @@  discard block
 block discarded – undo
995 995
 		$args->is_register = 'N';
996 996
 
997 997
 		$output = executeQuery('member.insertAuthMail', $args);
998
-		if(!$output->toBool()) return $output;
998
+		if (!$output->toBool()) return $output;
999 999
 		// Get content of the email to send a member
1000 1000
 		Context::set('auth_args', $args);
1001 1001
 
1002 1002
 		$member_config = $oModuleModel->getModuleConfig('member');
1003 1003
 		$memberInfo = array();
1004 1004
 		global $lang;
1005
-		if(is_array($member_config->signupForm))
1005
+		if (is_array($member_config->signupForm))
1006 1006
 		{
1007
-			$exceptForm=array('password', 'find_account_question');
1008
-			foreach($member_config->signupForm as $form)
1007
+			$exceptForm = array('password', 'find_account_question');
1008
+			foreach ($member_config->signupForm as $form)
1009 1009
 			{
1010
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1010
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1011 1011
 				{
1012 1012
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1013 1013
 				}
@@ -1022,15 +1022,15 @@  discard block
 block discarded – undo
1022 1022
 		}
1023 1023
 		Context::set('memberInfo', $memberInfo);
1024 1024
 
1025
-		if(!$member_config->skin) $member_config->skin = "default";
1026
-		if(!$member_config->colorset) $member_config->colorset = "white";
1025
+		if (!$member_config->skin) $member_config->skin = "default";
1026
+		if (!$member_config->colorset) $member_config->colorset = "white";
1027 1027
 
1028 1028
 		Context::set('member_config', $member_config);
1029 1029
 
1030 1030
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1031
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1031
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1032 1032
 
1033
-		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1033
+		$find_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1034 1034
 		Context::set('find_url', $find_url);
1035 1035
 
1036 1036
 		$oTemplate = &TemplateHandler::getInstance();
@@ -1040,19 +1040,19 @@  discard block
 block discarded – undo
1040 1040
 		$member_config = $oModuleModel->getModuleConfig('member');
1041 1041
 		// Send a mail
1042 1042
 		$oMail = new Mail();
1043
-		$oMail->setTitle( Context::getLang('msg_find_account_title') );
1043
+		$oMail->setTitle(Context::getLang('msg_find_account_title'));
1044 1044
 		$oMail->setContent($content);
1045
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1046
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1045
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1046
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1047 1047
 		$oMail->send();
1048 1048
 		// Return message
1049 1049
 		$msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address);
1050
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
1050
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
1051 1051
 		{
1052 1052
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberFindAccount');
1053 1053
 			$this->setRedirectUrl($returnUrl);
1054 1054
 		}
1055
-		return new Object(0,$msg);
1055
+		return new Object(0, $msg);
1056 1056
 	}
1057 1057
 
1058 1058
 	/**
@@ -1070,28 +1070,28 @@  discard block
 block discarded – undo
1070 1070
 		$find_account_question = trim(Context::get('find_account_question'));
1071 1071
 		$find_account_answer = trim(Context::get('find_account_answer'));
1072 1072
 
1073
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1073
+		if (($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1074 1074
 
1075 1075
 		$oModuleModel = getModel('module');
1076 1076
 		// Check if a member having the same email address exists
1077 1077
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1078
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1078
+		if (!$member_srl) return new Object(-1, 'msg_email_not_exists');
1079 1079
 		// Get information of the member
1080 1080
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1081 1081
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1082 1082
 
1083 1083
 		// Display a message if no answer is entered
1084
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1084
+		if (!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1085 1085
 
1086
-		if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) return new Object(-1, 'msg_answer_not_matches');
1086
+		if (trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) return new Object(-1, 'msg_answer_not_matches');
1087 1087
 
1088
-		if($config->identifier == 'email_address')
1088
+		if ($config->identifier == 'email_address')
1089 1089
 		{
1090 1090
 			$user_id = $email_address;
1091 1091
 		}
1092 1092
 
1093 1093
 		// Update to a temporary password and set change_password_date to 1
1094
-		$oPassword =  new Password();
1094
+		$oPassword = new Password();
1095 1095
 		$temp_password = $oPassword->createTemporaryPassword(8);
1096 1096
 
1097 1097
 		$args = new stdClass();
@@ -1099,11 +1099,11 @@  discard block
 block discarded – undo
1099 1099
 		$args->password = $temp_password;
1100 1100
 		$args->change_password_date = '1';
1101 1101
 		$output = $this->updateMemberPassword($args);
1102
-		if(!$output->toBool()) return $output;
1102
+		if (!$output->toBool()) return $output;
1103 1103
 
1104
-		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1104
+		$_SESSION['xe_temp_password_'.$user_id] = $temp_password;
1105 1105
 
1106
-		$this->add('user_id',$user_id);
1106
+		$this->add('user_id', $user_id);
1107 1107
 
1108 1108
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
1109 1109
 		$this->setRedirectUrl($returnUrl.'&user_id='.$user_id);
@@ -1123,7 +1123,7 @@  discard block
 block discarded – undo
1123 1123
 		$member_srl = Context::get('member_srl');
1124 1124
 		$auth_key = Context::get('auth_key');
1125 1125
 
1126
-		if(!$member_srl || !$auth_key)
1126
+		if (!$member_srl || !$auth_key)
1127 1127
 		{
1128 1128
 			return $this->stop('msg_invalid_request');
1129 1129
 		}
@@ -1134,9 +1134,9 @@  discard block
 block discarded – undo
1134 1134
 		$args->auth_key = $auth_key;
1135 1135
 		$output = executeQuery('member.getAuthMail', $args);
1136 1136
 
1137
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
1137
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
1138 1138
 		{
1139
-			if(strlen($output->data->auth_key) !== strlen($auth_key))
1139
+			if (strlen($output->data->auth_key) !== strlen($auth_key))
1140 1140
 			{
1141 1141
 				executeQuery('member.deleteAuthMail', $args);
1142 1142
 			}
@@ -1144,7 +1144,7 @@  discard block
 block discarded – undo
1144 1144
 			return $this->stop('msg_invalid_auth_key');
1145 1145
 		}
1146 1146
 
1147
-		if(ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1147
+		if (ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1148 1148
 		{
1149 1149
 			executeQuery('member.deleteAuthMail', $args);
1150 1150
 			return $this->stop('msg_invalid_auth_key');
@@ -1153,7 +1153,7 @@  discard block
 block discarded – undo
1153 1153
 		$args->password = $output->data->new_password;
1154 1154
 
1155 1155
 		// If credentials are correct, change the password to a new one
1156
-		if($output->data->is_register == 'Y')
1156
+		if ($output->data->is_register == 'Y')
1157 1157
 		{
1158 1158
 			$args->denied = 'N';
1159 1159
 		}
@@ -1166,13 +1166,13 @@  discard block
 block discarded – undo
1166 1166
 		$is_register = $output->data->is_register;
1167 1167
 
1168 1168
 		$output = executeQuery('member.updateMemberPassword', $args);
1169
-		if(!$output->toBool())
1169
+		if (!$output->toBool())
1170 1170
 		{
1171 1171
 			return $this->stop($output->getMessage());
1172 1172
 		}
1173 1173
 
1174 1174
 		// Remove all values having the member_srl from authentication table
1175
-		executeQuery('member.deleteAuthMail',$args);
1175
+		executeQuery('member.deleteAuthMail', $args);
1176 1176
 
1177 1177
 		$this->_clearMemberCache($args->member_srl);
1178 1178
 
@@ -1191,33 +1191,33 @@  discard block
 block discarded – undo
1191 1191
 	{
1192 1192
 		// Get an email_address
1193 1193
 		$email_address = Context::get('email_address');
1194
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1194
+		if (!$email_address) return new Object(-1, 'msg_invalid_request');
1195 1195
 		// Log test by using email_address
1196 1196
 		$oMemberModel = getModel('member');
1197 1197
 
1198 1198
 		$args = new stdClass;
1199 1199
 		$args->email_address = $email_address;
1200 1200
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1201
-		if(!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1201
+		if (!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1202 1202
 
1203 1203
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1204 1204
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1205 1205
 
1206 1206
 		$oModuleModel = getModel('module');
1207 1207
 		$member_config = $oModuleModel->getModuleConfig('member');
1208
-		if(!$member_config->skin) $member_config->skin = "default";
1209
-		if(!$member_config->colorset) $member_config->colorset = "white";
1208
+		if (!$member_config->skin) $member_config->skin = "default";
1209
+		if (!$member_config->colorset) $member_config->colorset = "white";
1210 1210
 
1211 1211
 		// Check if a authentication mail has been sent previously
1212 1212
 		$chk_args = new stdClass;
1213 1213
 		$chk_args->member_srl = $member_info->member_srl;
1214 1214
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1215
-		if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1215
+		if ($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1216 1216
 
1217 1217
 		$auth_args = new stdClass;
1218 1218
 		$auth_args->member_srl = $member_info->member_srl;
1219 1219
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1220
-		if(!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1220
+		if (!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1221 1221
 		$auth_info = $output->data[0];
1222 1222
 
1223 1223
 		// Update the regdate of authmail entry
@@ -1228,12 +1228,12 @@  discard block
 block discarded – undo
1228 1228
 
1229 1229
 		$memberInfo = array();
1230 1230
 		global $lang;
1231
-		if(is_array($member_config->signupForm))
1231
+		if (is_array($member_config->signupForm))
1232 1232
 		{
1233
-			$exceptForm=array('password', 'find_account_question');
1234
-			foreach($member_config->signupForm as $form)
1233
+			$exceptForm = array('password', 'find_account_question');
1234
+			foreach ($member_config->signupForm as $form)
1235 1235
 			{
1236
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1236
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1237 1237
 				{
1238 1238
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1239 1239
 				}
@@ -1252,19 +1252,19 @@  discard block
 block discarded – undo
1252 1252
 		Context::set('member_config', $member_config);
1253 1253
 
1254 1254
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1255
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1255
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1256 1256
 
1257
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1257
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_info->auth_key);
1258 1258
 		Context::set('auth_url', $auth_url);
1259 1259
 
1260 1260
 		$oTemplate = &TemplateHandler::getInstance();
1261 1261
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1262 1262
 		// Send a mail
1263 1263
 		$oMail = new Mail();
1264
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1264
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1265 1265
 		$oMail->setContent($content);
1266
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1267
-		$oMail->setReceiptor( $args->user_name, $args->email_address );
1266
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1267
+		$oMail->setReceiptor($args->user_name, $args->email_address);
1268 1268
 		$oMail->send();
1269 1269
 
1270 1270
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
@@ -1279,23 +1279,23 @@  discard block
 block discarded – undo
1279 1279
 		$memberInfo = $_SESSION['auth_member_info'];
1280 1280
 		unset($_SESSION['auth_member_info']);
1281 1281
 
1282
-		if(!$memberInfo)
1282
+		if (!$memberInfo)
1283 1283
 		{
1284 1284
 			return $this->stop('msg_invalid_request');
1285 1285
 		}
1286 1286
 
1287 1287
 		$newEmail = Context::get('email_address');
1288 1288
 
1289
-		if(!$newEmail)
1289
+		if (!$newEmail)
1290 1290
 		{
1291 1291
 			return $this->stop('msg_invalid_request');
1292 1292
 		}
1293 1293
 
1294 1294
 		$oMemberModel = getModel('member');
1295 1295
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
1296
-		if($member_srl)
1296
+		if ($member_srl)
1297 1297
 		{
1298
-			return new Object(-1,'msg_exists_email_address');
1298
+			return new Object(-1, 'msg_exists_email_address');
1299 1299
 		}
1300 1300
 
1301 1301
 		// remove all key by member_srl
@@ -1303,7 +1303,7 @@  discard block
 block discarded – undo
1303 1303
 		$args->member_srl = $memberInfo->member_srl;
1304 1304
 		$output = executeQuery('member.deleteAuthMail', $args);
1305 1305
 
1306
-		if(!$output->toBool())
1306
+		if (!$output->toBool())
1307 1307
 		{
1308 1308
 			return $output;
1309 1309
 		}
@@ -1313,7 +1313,7 @@  discard block
 block discarded – undo
1313 1313
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
1314 1314
 
1315 1315
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
1316
-		if(!$output->toBool())
1316
+		if (!$output->toBool())
1317 1317
 		{
1318 1318
 			return $this->stop($output->getMessage());
1319 1319
 		}
@@ -1330,7 +1330,7 @@  discard block
 block discarded – undo
1330 1330
 		$auth_args->is_register = 'Y';
1331 1331
 
1332 1332
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1333
-		if(!$output->toBool()) return $output;
1333
+		if (!$output->toBool()) return $output;
1334 1334
 
1335 1335
 		$memberInfo->email_address = $newEmail;
1336 1336
 
@@ -1354,12 +1354,12 @@  discard block
 block discarded – undo
1354 1354
 		$memberInfo = array();
1355 1355
 
1356 1356
 		global $lang;
1357
-		if(is_array($member_config->signupForm))
1357
+		if (is_array($member_config->signupForm))
1358 1358
 		{
1359
-			$exceptForm=array('password', 'find_account_question');
1360
-			foreach($member_config->signupForm as $form)
1359
+			$exceptForm = array('password', 'find_account_question');
1360
+			foreach ($member_config->signupForm as $form)
1361 1361
 			{
1362
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1362
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1363 1363
 				{
1364 1364
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1365 1365
 				}
@@ -1374,25 +1374,25 @@  discard block
 block discarded – undo
1374 1374
 		}
1375 1375
 		Context::set('memberInfo', $memberInfo);
1376 1376
 
1377
-		if(!$member_config->skin) $member_config->skin = "default";
1378
-		if(!$member_config->colorset) $member_config->colorset = "white";
1377
+		if (!$member_config->skin) $member_config->skin = "default";
1378
+		if (!$member_config->colorset) $member_config->colorset = "white";
1379 1379
 
1380 1380
 		Context::set('member_config', $member_config);
1381 1381
 
1382 1382
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1383
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1383
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1384 1384
 
1385
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1385
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
1386 1386
 		Context::set('auth_url', $auth_url);
1387 1387
 
1388 1388
 		$oTemplate = &TemplateHandler::getInstance();
1389 1389
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1390 1390
 		// Send a mail
1391 1391
 		$oMail = new Mail();
1392
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1392
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1393 1393
 		$oMail->setContent($content);
1394
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1395
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1394
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1395
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1396 1396
 		$oMail->send();
1397 1397
 	}
1398 1398
 
@@ -1405,7 +1405,7 @@  discard block
 block discarded – undo
1405 1405
 	{
1406 1406
 		$site_module_info = Context::get('site_module_info');
1407 1407
 		$logged_info = Context::get('logged_info');
1408
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1408
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new Object(-1, 'msg_invalid_request');
1409 1409
 
1410 1410
 		$oMemberModel = getModel('member');
1411 1411
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1424,13 +1424,13 @@  discard block
 block discarded – undo
1424 1424
 	{
1425 1425
 		$site_module_info = Context::get('site_module_info');
1426 1426
 		$logged_info = Context::get('logged_info');
1427
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1427
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new Object(-1, 'msg_invalid_request');
1428 1428
 
1429 1429
 		$args = new stdClass;
1430
-		$args->site_srl= $site_module_info->site_srl;
1430
+		$args->site_srl = $site_module_info->site_srl;
1431 1431
 		$args->member_srl = $logged_info->member_srl;
1432 1432
 		$output = executeQuery('member.deleteMembersGroup', $args);
1433
-		if(!$output->toBool()) return $output;
1433
+		if (!$output->toBool()) return $output;
1434 1434
 		$this->setMessage('success_deleted');
1435 1435
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1436 1436
 	}
@@ -1444,25 +1444,25 @@  discard block
 block discarded – undo
1444 1444
 	 */
1445 1445
 	function setMemberConfig($args)
1446 1446
 	{
1447
-		if(!$args->skin) $args->skin = "default";
1448
-		if(!$args->colorset) $args->colorset = "white";
1449
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1450
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1451
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1452
-		$args->enable_openid= 'N';
1453
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1454
-		if($args->image_name!='Y') $args->image_name = 'N';
1455
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1456
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1457
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1458
-		$args->limit_day = (int)$args->limit_day;
1447
+		if (!$args->skin) $args->skin = "default";
1448
+		if (!$args->colorset) $args->colorset = "white";
1449
+		if (!$args->editor_skin) $args->editor_skin = "ckeditor";
1450
+		if (!$args->editor_colorset) $args->editor_colorset = "moono";
1451
+		if ($args->enable_join != 'Y') $args->enable_join = 'N';
1452
+		$args->enable_openid = 'N';
1453
+		if ($args->profile_image != 'Y') $args->profile_image = 'N';
1454
+		if ($args->image_name != 'Y') $args->image_name = 'N';
1455
+		if ($args->image_mark != 'Y') $args->image_mark = 'N';
1456
+		if ($args->group_image_mark != 'Y') $args->group_image_mark = 'N';
1457
+		if (!trim(strip_tags($args->agreement))) $args->agreement = null;
1458
+		$args->limit_day = (int) $args->limit_day;
1459 1459
 
1460 1460
 		$agreement = trim($args->agreement);
1461 1461
 		unset($args->agreement);
1462 1462
 
1463 1463
 		$oModuleController = getController('module');
1464
-		$output = $oModuleController->insertModuleConfig('member',$args);
1465
-		if(!$output->toBool()) return $output;
1464
+		$output = $oModuleController->insertModuleConfig('member', $args);
1465
+		if (!$output->toBool()) return $output;
1466 1466
 
1467 1467
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1468 1468
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1483,11 +1483,11 @@  discard block
 block discarded – undo
1483 1483
 		$signature = trim(removeHackTag($signature));
1484 1484
 		$signature = preg_replace('/<(\/?)(embed|object|param)/is', '&lt;$1$2', $signature);
1485 1485
 
1486
-		$check_signature = trim(str_replace(array('&nbsp;',"\n","\r"), '', strip_tags($signature, '<img><object>')));
1486
+		$check_signature = trim(str_replace(array('&nbsp;', "\n", "\r"), '', strip_tags($signature, '<img><object>')));
1487 1487
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1488 1488
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1489 1489
 
1490
-		if(!$check_signature) return FileHandler::removeFile($filename);
1490
+		if (!$check_signature) return FileHandler::removeFile($filename);
1491 1491
 
1492 1492
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1493 1493
 		FileHandler::makeDir($path);
@@ -1516,15 +1516,15 @@  discard block
 block discarded – undo
1516 1516
 	 *
1517 1517
 	 * @return Object
1518 1518
 	 */
1519
-	function addMemberToGroup($member_srl, $group_srl, $site_srl=0)
1519
+	function addMemberToGroup($member_srl, $group_srl, $site_srl = 0)
1520 1520
 	{
1521 1521
 		$args = new stdClass();
1522 1522
 		$args->member_srl = $member_srl;
1523 1523
 		$args->group_srl = $group_srl;
1524
-		if($site_srl) $args->site_srl = $site_srl;
1524
+		if ($site_srl) $args->site_srl = $site_srl;
1525 1525
 
1526 1526
 		// Add
1527
-		$output = executeQuery('member.addMemberToGroup',$args);
1527
+		$output = executeQuery('member.addMemberToGroup', $args);
1528 1528
 		$output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args);
1529 1529
 
1530 1530
 		$this->_clearMemberCache($member_srl, $site_srl);
@@ -1544,18 +1544,18 @@  discard block
 block discarded – undo
1544 1544
 	{
1545 1545
 		$obj = new stdClass;
1546 1546
 		$obj->site_srl = $args->site_srl;
1547
-		$obj->member_srl = implode(',',$args->member_srl);
1547
+		$obj->member_srl = implode(',', $args->member_srl);
1548 1548
 
1549 1549
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1550
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1550
+		if ($output->data) foreach ($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1551 1551
 
1552 1552
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1553
-		if(!$output->toBool()) return $output;
1553
+		if (!$output->toBool()) return $output;
1554 1554
 
1555 1555
 		$inserted_members = array();
1556
-		foreach($args->member_srl as $key => $val)
1556
+		foreach ($args->member_srl as $key => $val)
1557 1557
 		{
1558
-			if($inserted_members[$val]) continue;
1558
+			if ($inserted_members[$val]) continue;
1559 1559
 			$inserted_members[$val] = true;
1560 1560
 
1561 1561
 			unset($obj);
@@ -1565,7 +1565,7 @@  discard block
 block discarded – undo
1565 1565
 			$obj->site_srl = $args->site_srl;
1566 1566
 			$obj->regdate = $date[$obj->member_srl];
1567 1567
 			$output = executeQuery('member.addMemberToGroup', $obj);
1568
-			if(!$output->toBool()) return $output;
1568
+			if (!$output->toBool()) return $output;
1569 1569
 
1570 1570
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1571 1571
 		}
@@ -1587,9 +1587,9 @@  discard block
 block discarded – undo
1587 1587
 		// Get information of the key
1588 1588
 		$output = executeQuery('member.getAutologin', $args);
1589 1589
 		// If no information exists, delete a cookie
1590
-		if(!$output->toBool() || !$output->data)
1590
+		if (!$output->toBool() || !$output->data)
1591 1591
 		{
1592
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
1592
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365);
1593 1593
 			return;
1594 1594
 		}
1595 1595
 
@@ -1599,9 +1599,9 @@  discard block
 block discarded – undo
1599 1599
 		$user_id = ($config->identifier == 'user_id') ? $output->data->user_id : $output->data->email_address;
1600 1600
 		$password = $output->data->password;
1601 1601
 
1602
-		if(!$user_id || !$password)
1602
+		if (!$user_id || !$password)
1603 1603
 		{
1604
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
1604
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365);
1605 1605
 			return;
1606 1606
 		}
1607 1607
 
@@ -1611,7 +1611,7 @@  discard block
 block discarded – undo
1611 1611
 		$check_key = strtolower($user_id).$password.$_SERVER['HTTP_USER_AGENT'];
1612 1612
 		$check_key = substr(hash_hmac('sha256', $check_key, substr($args->autologin_key, 0, 32)), 0, 32);
1613 1613
 
1614
-		if($check_key === substr($args->autologin_key, 32))
1614
+		if ($check_key === substr($args->autologin_key, 32))
1615 1615
 		{
1616 1616
 			// Check change_password_date
1617 1617
 			$oModuleModel = getModel('module');
@@ -1619,12 +1619,12 @@  discard block
 block discarded – undo
1619 1619
 			$limit_date = $member_config->change_password_date;
1620 1620
 
1621 1621
 			// Check if change_password_date is set
1622
-			if($limit_date > 0)
1622
+			if ($limit_date > 0)
1623 1623
 			{
1624 1624
 				$oMemberModel = getModel('member');
1625 1625
 				$columnList = array('member_srl', 'change_password_date');
1626 1626
 
1627
-				if($config->identifier == 'user_id')
1627
+				if ($config->identifier == 'user_id')
1628 1628
 				{
1629 1629
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1630 1630
 				}
@@ -1633,7 +1633,7 @@  discard block
 block discarded – undo
1633 1633
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1634 1634
 				}
1635 1635
 
1636
-				if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){
1636
+				if ($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day'))) {
1637 1637
 					$do_auto_login = true;
1638 1638
 				}
1639 1639
 
@@ -1644,14 +1644,14 @@  discard block
 block discarded – undo
1644 1644
 			}
1645 1645
 		}
1646 1646
 
1647
-		if($do_auto_login)
1647
+		if ($do_auto_login)
1648 1648
 		{
1649 1649
 			$output = $this->doLogin($user_id);
1650 1650
 		}
1651 1651
 		else
1652 1652
 		{
1653 1653
 			executeQuery('member.deleteAutologin', $args);
1654
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
1654
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365);
1655 1655
 		}
1656 1656
 	}
1657 1657
 
@@ -1667,13 +1667,13 @@  discard block
 block discarded – undo
1667 1667
 	function doLogin($user_id, $password = '', $keep_signed = false)
1668 1668
 	{
1669 1669
 		$user_id = strtolower($user_id);
1670
-		if(!$user_id) return new Object(-1, 'null_user_id');
1670
+		if (!$user_id) return new Object(-1, 'null_user_id');
1671 1671
 		// Call a trigger before log-in (before)
1672 1672
 		$trigger_obj = new stdClass();
1673 1673
 		$trigger_obj->user_id = $user_id;
1674 1674
 		$trigger_obj->password = $password;
1675 1675
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1676
-		if(!$trigger_output->toBool()) return $trigger_output;
1676
+		if (!$trigger_output->toBool()) return $trigger_output;
1677 1677
 		// Create a member model object
1678 1678
 		$oMemberModel = getModel('member');
1679 1679
 
@@ -1683,12 +1683,12 @@  discard block
 block discarded – undo
1683 1683
 		$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1684 1684
 
1685 1685
 		// check identifier
1686
-		if($config->identifier == 'email_address')
1686
+		if ($config->identifier == 'email_address')
1687 1687
 		{
1688 1688
 			// Get user_id information
1689 1689
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1690 1690
 			// Set an invalid user if no value returned
1691
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1691
+			if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1692 1692
 
1693 1693
 		}
1694 1694
 		else
@@ -1696,24 +1696,24 @@  discard block
 block discarded – undo
1696 1696
 			// Get user_id information
1697 1697
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1698 1698
 			// Set an invalid user if no value returned
1699
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1699
+			if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1700 1700
 		}
1701 1701
 
1702 1702
 		$output = executeQuery('member.getLoginCountByIp', $args);
1703 1703
 		$errorCount = $output->data->count;
1704
-		if($errorCount >= $config->max_error_count)
1704
+		if ($errorCount >= $config->max_error_count)
1705 1705
 		{
1706 1706
 			$last_update = strtotime($output->data->last_update);
1707
-			$term = intval($_SERVER['REQUEST_TIME']-$last_update);
1708
-			if($term < $config->max_error_count_time)
1707
+			$term = intval($_SERVER['REQUEST_TIME'] - $last_update);
1708
+			if ($term < $config->max_error_count_time)
1709 1709
 			{
1710 1710
 				$term = $config->max_error_count_time - $term;
1711
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1712
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1713
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1714
-				else $term = intval($term/86400).Context::getLang('unit_day');
1711
+				if ($term < 60) $term = intval($term).Context::getLang('unit_sec');
1712
+				elseif (60 <= $term && $term < 3600) $term = intval($term / 60).Context::getLang('unit_min');
1713
+				elseif (3600 <= $term && $term < 86400) $term = intval($term / 3600).Context::getLang('unit_hour');
1714
+				else $term = intval($term / 86400).Context::getLang('unit_day');
1715 1715
 
1716
-				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1716
+				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'), $term));
1717 1717
 			}
1718 1718
 			else
1719 1719
 			{
@@ -1723,13 +1723,13 @@  discard block
 block discarded – undo
1723 1723
 		}
1724 1724
 
1725 1725
 		// Password Check
1726
-		if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1726
+		if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1727 1727
 		{
1728
-			return $this->recordMemberLoginError(-1, 'invalid_password',$this->memberInfo);
1728
+			return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo);
1729 1729
 		}
1730 1730
 
1731 1731
 		// If denied == 'Y', notify
1732
-		if($this->memberInfo->denied == 'Y')
1732
+		if ($this->memberInfo->denied == 'Y')
1733 1733
 		{
1734 1734
 			$args->member_srl = $this->memberInfo->member_srl;
1735 1735
 			$output = executeQuery('member.chkAuthMail', $args);
@@ -1737,12 +1737,12 @@  discard block
 block discarded – undo
1737 1737
 			{
1738 1738
 				$_SESSION['auth_member_srl'] = $this->memberInfo->member_srl;
1739 1739
 				$redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail');
1740
-				return $this->setRedirectUrl($redirectUrl, new Object(-1,'msg_user_not_confirmed'));
1740
+				return $this->setRedirectUrl($redirectUrl, new Object(-1, 'msg_user_not_confirmed'));
1741 1741
 			}
1742
-			return new Object(-1,'msg_user_denied');
1742
+			return new Object(-1, 'msg_user_denied');
1743 1743
 		}
1744 1744
 		// Notify if denied_date is less than the current time
1745
-		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")));
1745
+		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")));
1746 1746
 		// Update the latest login time
1747 1747
 		$args->member_srl = $this->memberInfo->member_srl;
1748 1748
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1752,36 +1752,36 @@  discard block
 block discarded – undo
1752 1752
 
1753 1753
 		// Check if there is recoding table.
1754 1754
 		$oDB = &DB::getInstance();
1755
-		if($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1755
+		if ($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1756 1756
 		{
1757 1757
 			// check if there is login fail records.
1758 1758
 			$output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args);
1759
-			if($output->data && $output->data->content)
1759
+			if ($output->data && $output->data->content)
1760 1760
 			{
1761 1761
 				$title = Context::getLang('login_fail_report');
1762 1762
 				$message = '<ul>';
1763 1763
 				$content = unserialize($output->data->content);
1764
-				if(count($content) > $config->max_error_count)
1764
+				if (count($content) > $config->max_error_count)
1765 1765
 				{
1766
-					foreach($content as $val)
1766
+					foreach ($content as $val)
1767 1767
 					{
1768
-						$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>';
1768
+						$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>';
1769 1769
 					}
1770 1770
 					$message .= '</ul>';
1771
-					$content = sprintf(Context::getLang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa'));
1771
+					$content = sprintf(Context::getLang('login_fail_report_contents'), $message, date('Y-m-d h:i:sa'));
1772 1772
 
1773 1773
 					//send message
1774 1774
 					$oCommunicationController = getController('communication');
1775 1775
 					$oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true);
1776 1776
 
1777
-					if($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1777
+					if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1778 1778
 					{
1779 1779
 						$view_url = Context::getRequestUri();
1780
-						$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);
1780
+						$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);
1781 1781
 						$oMail = new Mail();
1782 1782
 						$oMail->setTitle($title);
1783 1783
 						$oMail->setContent($content);
1784
-						$oMail->setSender($config->webmaster_name?$config->webmaster_name:'webmaster', $config->webmaster_email);
1784
+						$oMail->setSender($config->webmaster_name ? $config->webmaster_name : 'webmaster', $config->webmaster_email);
1785 1785
 						$oMail->setReceiptor($this->memberInfo->email_id.'('.$this->memberInfo->nick_name.')', $this->memberInfo->email_address);
1786 1786
 						$oMail->send();
1787 1787
 					}
@@ -1791,9 +1791,9 @@  discard block
 block discarded – undo
1791 1791
 		}
1792 1792
 		// Call a trigger after successfully log-in (after)
1793 1793
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1794
-		if(!$trigger_output->toBool()) return $trigger_output;
1794
+		if (!$trigger_output->toBool()) return $trigger_output;
1795 1795
 		// When user checked to use auto-login
1796
-		if($keep_signed)
1796
+		if ($keep_signed)
1797 1797
 		{
1798 1798
 			// Key generate for auto login
1799 1799
 			$oPassword = new Password();
@@ -1805,12 +1805,12 @@  discard block
 block discarded – undo
1805 1805
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1806 1806
 			executeQuery('member.deleteAutologin', $autologin_args);
1807 1807
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1808
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000);
1808
+			if ($autologin_output->toBool()) setCookie('xeak', $autologin_args->autologin_key, $_SERVER['REQUEST_TIME'] + 31536000);
1809 1809
 		}
1810
-		if($this->memberInfo->is_admin == 'Y')
1810
+		if ($this->memberInfo->is_admin == 'Y')
1811 1811
 		{
1812 1812
 			$oMemberAdminModel = getAdminModel('member');
1813
-			if(!$oMemberAdminModel->getMemberAdminIPCheck())
1813
+			if (!$oMemberAdminModel->getMemberAdminIPCheck())
1814 1814
 			{
1815 1815
 				$_SESSION['denied_admin'] = 'Y';
1816 1816
 			}
@@ -1828,18 +1828,18 @@  discard block
 block discarded – undo
1828 1828
 	{
1829 1829
 		$oMemberModel = getModel('member');
1830 1830
 		// If your information came through the current session information to extract information from the users
1831
-		if(!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged() )
1831
+		if (!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged())
1832 1832
 		{
1833 1833
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']);
1834 1834
 			// If you do not destroy the session Profile
1835
-			if($this->memberInfo->member_srl != $_SESSION['member_srl'])
1835
+			if ($this->memberInfo->member_srl != $_SESSION['member_srl'])
1836 1836
 			{
1837 1837
 				$this->destroySessionInfo();
1838 1838
 				return;
1839 1839
 			}
1840 1840
 		}
1841 1841
 		// Stop using the session id is destroyed
1842
-		if($this->memberInfo->denied=='Y')
1842
+		if ($this->memberInfo->denied == 'Y')
1843 1843
 		{
1844 1844
 			$this->destroySessionInfo();
1845 1845
 			return;
@@ -1869,10 +1869,10 @@  discard block
 block discarded – undo
1869 1869
 		Context::set('logged_info', $this->memberInfo);
1870 1870
 
1871 1871
 		// Only the menu configuration of the user (such as an add-on to the menu can be changed)
1872
-		$this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info');
1873
-		$this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document');
1874
-		$this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document');
1875
-		$this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document');
1872
+		$this->addMemberMenu('dispMemberInfo', 'cmd_view_member_info');
1873
+		$this->addMemberMenu('dispMemberScrappedDocument', 'cmd_view_scrapped_document');
1874
+		$this->addMemberMenu('dispMemberSavedDocument', 'cmd_view_saved_document');
1875
+		$this->addMemberMenu('dispMemberOwnDocument', 'cmd_view_own_document');
1876 1876
 	}
1877 1877
 
1878 1878
 	/**
@@ -1894,7 +1894,7 @@  discard block
 block discarded – undo
1894 1894
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
1895 1895
 	{
1896 1896
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
1897
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
1897
+		if (!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
1898 1898
 
1899 1899
 		$obj = new stdClass;
1900 1900
 		$obj->url = $url;
@@ -1913,33 +1913,33 @@  discard block
 block discarded – undo
1913 1913
 	{
1914 1914
 		// Call a trigger (before)
1915 1915
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
1916
-		if(!$output->toBool()) return $output;
1916
+		if (!$output->toBool()) return $output;
1917 1917
 		// Terms and Conditions portion of the information set up by members reaffirmed
1918 1918
 		$oModuleModel = getModel('module');
1919 1919
 		$config = $oModuleModel->getModuleConfig('member');
1920 1920
 
1921 1921
 		$logged_info = Context::get('logged_info');
1922 1922
 		// If the date of the temporary restrictions limit further information on the date of
1923
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
1923
+		if ($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME'] + $config->limit_day * 60 * 60 * 24);
1924 1924
 
1925 1925
 		$args->member_srl = getNextSequence();
1926 1926
 		$args->list_order = -1 * $args->member_srl;
1927 1927
 
1928 1928
 		// Execute insert or update depending on the value of member_srl
1929
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
1929
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
1930 1930
 		// Enter the user's identity changed to lowercase
1931 1931
 		else $args->user_id = strtolower($args->user_id);
1932
-		if(!$args->user_name) $args->user_name = $args->member_srl;
1933
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
1932
+		if (!$args->user_name) $args->user_name = $args->member_srl;
1933
+		if (!$args->nick_name) $args->nick_name = $args->member_srl;
1934 1934
 
1935 1935
 		// Control of essential parameters
1936
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
1937
-		if($args->denied!='Y') $args->denied = 'N';
1938
-		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y';
1936
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
1937
+		if ($args->denied != 'Y') $args->denied = 'N';
1938
+		if (!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F')))) $args->allow_message = 'Y';
1939 1939
 
1940
-		if($logged_info->is_admin == 'Y')
1940
+		if ($logged_info->is_admin == 'Y')
1941 1941
 		{
1942
-			if($args->is_admin!='Y') $args->is_admin = 'N';
1942
+			if ($args->is_admin != 'Y') $args->is_admin = 'N';
1943 1943
 		}
1944 1944
 		else
1945 1945
 		{
@@ -1954,88 +1954,88 @@  discard block
 block discarded – undo
1954 1954
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1955 1955
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1956 1956
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1957
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
1958
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
1957
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//i", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
1958
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//i", $args->blog)) $args->blog = 'http://'.$args->blog;
1959 1959
 
1960 1960
 		// Create a model object
1961 1961
 		$oMemberModel = getModel('member');
1962 1962
 
1963 1963
 		// Check password strength
1964
-		if($args->password && !$password_is_hashed)
1964
+		if ($args->password && !$password_is_hashed)
1965 1965
 		{
1966
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
1966
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
1967 1967
 			{
1968 1968
 				$message = Context::getLang('about_password_strength');
1969 1969
 				return new Object(-1, $message[$config->password_strength]);
1970 1970
 			}
1971 1971
 			$args->password = $oMemberModel->hashPassword($args->password);
1972 1972
 		}
1973
-		elseif(!$args->password)
1973
+		elseif (!$args->password)
1974 1974
 		{
1975 1975
 			unset($args->password);
1976 1976
 		}
1977 1977
 
1978 1978
 		// Check if ID is prohibited
1979
-		if($oMemberModel->isDeniedID($args->user_id))
1979
+		if ($oMemberModel->isDeniedID($args->user_id))
1980 1980
 		{
1981
-			return new Object(-1,'denied_user_id');
1981
+			return new Object(-1, 'denied_user_id');
1982 1982
 		}
1983 1983
 
1984 1984
 		// Check if ID is duplicate
1985 1985
 		$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
1986
-		if($member_srl)
1986
+		if ($member_srl)
1987 1987
 		{
1988
-			return new Object(-1,'msg_exists_user_id');
1988
+			return new Object(-1, 'msg_exists_user_id');
1989 1989
 		}
1990 1990
 
1991 1991
 		// Check if nickname is prohibited
1992
-		if($oMemberModel->isDeniedNickName($args->nick_name))
1992
+		if ($oMemberModel->isDeniedNickName($args->nick_name))
1993 1993
 		{
1994
-			return new Object(-1,'denied_nick_name');
1994
+			return new Object(-1, 'denied_nick_name');
1995 1995
 		}
1996 1996
 
1997 1997
 		// Check if nickname is duplicate
1998 1998
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
1999
-		if($member_srl)
1999
+		if ($member_srl)
2000 2000
 		{
2001
-			return new Object(-1,'msg_exists_nick_name');
2001
+			return new Object(-1, 'msg_exists_nick_name');
2002 2002
 		}
2003 2003
 
2004 2004
 		// Check if email address is duplicate
2005 2005
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2006
-		if($member_srl)
2006
+		if ($member_srl)
2007 2007
 		{
2008
-			return new Object(-1,'msg_exists_email_address');
2008
+			return new Object(-1, 'msg_exists_email_address');
2009 2009
 		}
2010 2010
 
2011 2011
 		// Insert data into the DB
2012 2012
 		$args->list_order = -1 * $args->member_srl;
2013 2013
 
2014
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2015
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2014
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
2015
+		if (!$args->user_name) $args->user_name = $args->member_srl;
2016 2016
 
2017 2017
 		$oDB = &DB::getInstance();
2018 2018
 		$oDB->begin();
2019 2019
 
2020 2020
 		$output = executeQuery('member.insertMember', $args);
2021
-		if(!$output->toBool())
2021
+		if (!$output->toBool())
2022 2022
 		{
2023 2023
 			$oDB->rollback();
2024 2024
 			return $output;
2025 2025
 		}
2026 2026
 
2027
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2027
+		if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2028 2028
 		else $group_srl_list = explode('|@|', $args->group_srl_list);
2029 2029
 		// If no value is entered the default group, the value of group registration
2030
-		if(!$args->group_srl_list)
2030
+		if (!$args->group_srl_list)
2031 2031
 		{
2032 2032
 			$columnList = array('site_srl', 'group_srl');
2033 2033
 			$default_group = $oMemberModel->getDefaultGroup(0, $columnList);
2034
-			if($default_group)
2034
+			if ($default_group)
2035 2035
 			{
2036 2036
 				// Add to the default group
2037
-				$output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl);
2038
-				if(!$output->toBool())
2037
+				$output = $this->addMemberToGroup($args->member_srl, $default_group->group_srl);
2038
+				if (!$output->toBool())
2039 2039
 				{
2040 2040
 					$oDB->rollback();
2041 2041
 					return $output;
@@ -2045,11 +2045,11 @@  discard block
 block discarded – undo
2045 2045
 		}
2046 2046
 		else
2047 2047
 		{
2048
-			for($i=0;$i<count($group_srl_list);$i++)
2048
+			for ($i = 0; $i < count($group_srl_list); $i++)
2049 2049
 			{
2050
-				$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2050
+				$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2051 2051
 
2052
-				if(!$output->toBool())
2052
+				if (!$output->toBool())
2053 2053
 				{
2054 2054
 					$oDB->rollback();
2055 2055
 					return $output;
@@ -2059,7 +2059,7 @@  discard block
 block discarded – undo
2059 2059
 
2060 2060
 		$member_config = $oModuleModel->getModuleConfig('member');
2061 2061
 		// When using email authentication mode (when you subscribed members denied a) certified mail sent
2062
-		if($args->denied == 'Y')
2062
+		if ($args->denied == 'Y')
2063 2063
 		{
2064 2064
 			// Insert data into the authentication DB
2065 2065
 			$oPassword = new Password();
@@ -2071,7 +2071,7 @@  discard block
 block discarded – undo
2071 2071
 			$auth_args->is_register = 'Y';
2072 2072
 
2073 2073
 			$output = executeQuery('member.insertAuthMail', $auth_args);
2074
-			if(!$output->toBool())
2074
+			if (!$output->toBool())
2075 2075
 			{
2076 2076
 				$oDB->rollback();
2077 2077
 				return $output;
@@ -2079,10 +2079,10 @@  discard block
 block discarded – undo
2079 2079
 			$this->_sendAuthMail($auth_args, $args);
2080 2080
 		}
2081 2081
 		// Call a trigger (after)
2082
-		if($output->toBool())
2082
+		if ($output->toBool())
2083 2083
 		{
2084 2084
 			$trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args);
2085
-			if(!$trigger_output->toBool())
2085
+			if (!$trigger_output->toBool())
2086 2086
 			{
2087 2087
 				$oDB->rollback();
2088 2088
 				return $trigger_output;
@@ -2104,41 +2104,41 @@  discard block
 block discarded – undo
2104 2104
 	{
2105 2105
 		// Call a trigger (before)
2106 2106
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2107
-		if(!$output->toBool()) return $output;
2107
+		if (!$output->toBool()) return $output;
2108 2108
 		// Create a model object
2109 2109
 		$oMemberModel = getModel('member');
2110 2110
 
2111 2111
 		$logged_info = Context::get('logged_info');
2112 2112
 		// Get what you want to modify the original information
2113
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2113
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2114 2114
 		// Control of essential parameters
2115
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2116
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2115
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
2116
+		if ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F'))) $args->allow_message = 'Y';
2117 2117
 
2118
-		if($logged_info->is_admin == 'Y')
2118
+		if ($logged_info->is_admin == 'Y')
2119 2119
 		{
2120
-			if($args->denied!='Y') $args->denied = 'N';
2121
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2120
+			if ($args->denied != 'Y') $args->denied = 'N';
2121
+			if ($args->is_admin != 'Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2122 2122
 		}
2123 2123
 		else
2124 2124
 		{
2125 2125
 			unset($args->is_admin);
2126
-			if($is_admin == false)
2126
+			if ($is_admin == false)
2127 2127
 				unset($args->denied);
2128
-			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2128
+			if ($logged_info->member_srl != $args->member_srl && $is_admin == false)
2129 2129
 			{
2130 2130
 				return $this->stop('msg_invalid_request');
2131 2131
 			}
2132 2132
 		}
2133 2133
 
2134 2134
 		// Sanitize user ID, username, nickname, homepage, blog
2135
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2135
+		if ($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2136 2136
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2137 2137
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2138 2138
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2139 2139
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2140
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2141
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2140
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//is", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
2141
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//is", $args->blog)) $args->blog = 'http://'.$args->blog;
2142 2142
 
2143 2143
 		// check member identifier form
2144 2144
 		$config = $oMemberModel->getMemberConfig();
@@ -2147,56 +2147,56 @@  discard block
 block discarded – undo
2147 2147
 		$orgMemberInfo = $output->data;
2148 2148
 
2149 2149
 		// Check if email address or user ID is duplicate
2150
-		if($config->identifier == 'email_address')
2150
+		if ($config->identifier == 'email_address')
2151 2151
 		{
2152 2152
 			$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2153
-			if($member_srl && $args->member_srl != $member_srl)
2153
+			if ($member_srl && $args->member_srl != $member_srl)
2154 2154
 			{
2155
-				return new Object(-1,'msg_exists_email_address');
2155
+				return new Object(-1, 'msg_exists_email_address');
2156 2156
 			}
2157 2157
 			$args->email_address = $orgMemberInfo->email_address;
2158 2158
 		}
2159 2159
 		else
2160 2160
 		{
2161 2161
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2162
-			if($member_srl && $args->member_srl != $member_srl)
2162
+			if ($member_srl && $args->member_srl != $member_srl)
2163 2163
 			{
2164
-				return new Object(-1,'msg_exists_user_id');
2164
+				return new Object(-1, 'msg_exists_user_id');
2165 2165
 			}
2166 2166
 
2167 2167
 			$args->user_id = $orgMemberInfo->user_id;
2168 2168
 		}
2169 2169
 
2170
-		if($logged_info->is_admin !== 'Y')
2170
+		if ($logged_info->is_admin !== 'Y')
2171 2171
 		{
2172 2172
 			// Check if ID is prohibited
2173
-			if($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2173
+			if ($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2174 2174
 			{
2175
-				return new Object(-1,'denied_user_id');
2175
+				return new Object(-1, 'denied_user_id');
2176 2176
 			}
2177 2177
 
2178 2178
 			// Check if nickname is prohibited
2179
-			if($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2179
+			if ($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2180 2180
 			{
2181 2181
 				return new Object(-1, 'denied_nick_name');
2182 2182
 			}
2183 2183
 		}
2184 2184
 
2185 2185
 		// Check if ID is duplicate
2186
-		if($args->user_id)
2186
+		if ($args->user_id)
2187 2187
 		{
2188 2188
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2189
-			if($member_srl && $args->member_srl != $member_srl)
2189
+			if ($member_srl && $args->member_srl != $member_srl)
2190 2190
 			{
2191
-				return new Object(-1,'msg_exists_user_id');
2191
+				return new Object(-1, 'msg_exists_user_id');
2192 2192
 			}
2193 2193
 		}
2194 2194
 
2195 2195
 		// Check if nickname is duplicate
2196 2196
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
2197
- 		if($member_srl && $args->member_srl != $member_srl)
2197
+ 		if ($member_srl && $args->member_srl != $member_srl)
2198 2198
  		{
2199
- 			return new Object(-1,'msg_exists_nick_name');
2199
+ 			return new Object(-1, 'msg_exists_nick_name');
2200 2200
  		}
2201 2201
 
2202 2202
 		list($args->email_id, $args->email_host) = explode('@', $args->email_address);
@@ -2205,9 +2205,9 @@  discard block
 block discarded – undo
2205 2205
 		$oDB->begin();
2206 2206
 
2207 2207
 		// Check password strength
2208
-		if($args->password)
2208
+		if ($args->password)
2209 2209
 		{
2210
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2210
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2211 2211
 			{
2212 2212
 				$message = Context::getLang('about_password_strength');
2213 2213
 				return new Object(-1, $message[$config->password_strength]);
@@ -2219,40 +2219,40 @@  discard block
 block discarded – undo
2219 2219
 			$args->password = $orgMemberInfo->password;
2220 2220
 		}
2221 2221
 
2222
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2223
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2224
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2225
-		if(!$args->description) $args->description = $orgMemberInfo->description;
2226
-		if(!$args->birthday) $args->birthday = '';
2222
+		if (!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2223
+		if (!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2224
+		if (!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2225
+		if (!$args->description) $args->description = $orgMemberInfo->description;
2226
+		if (!$args->birthday) $args->birthday = '';
2227 2227
 
2228 2228
 		$output = executeQuery('member.updateMember', $args);
2229 2229
 
2230
-		if(!$output->toBool())
2230
+		if (!$output->toBool())
2231 2231
 		{
2232 2232
 			$oDB->rollback();
2233 2233
 			return $output;
2234 2234
 		}
2235 2235
 
2236
-		if($args->group_srl_list)
2236
+		if ($args->group_srl_list)
2237 2237
 		{
2238
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2238
+			if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2239 2239
 			else $group_srl_list = explode('|@|', $args->group_srl_list);
2240 2240
 			// If the group information, group information changes
2241
-			if(count($group_srl_list) > 0)
2241
+			if (count($group_srl_list) > 0)
2242 2242
 			{
2243 2243
 				$args->site_srl = 0;
2244 2244
 				// One of its members to delete all the group
2245 2245
 				$output = executeQuery('member.deleteMemberGroupMember', $args);
2246
-				if(!$output->toBool())
2246
+				if (!$output->toBool())
2247 2247
 				{
2248 2248
 					$oDB->rollback();
2249 2249
 					return $output;
2250 2250
 				}
2251 2251
 				// Enter one of the loop a
2252
-				for($i=0;$i<count($group_srl_list);$i++)
2252
+				for ($i = 0; $i < count($group_srl_list); $i++)
2253 2253
 				{
2254
-					$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2255
-					if(!$output->toBool())
2254
+					$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2255
+					if (!$output->toBool())
2256 2256
 					{
2257 2257
 						$oDB->rollback();
2258 2258
 						return $output;
@@ -2264,9 +2264,9 @@  discard block
 block discarded – undo
2264 2264
 			}
2265 2265
 		}
2266 2266
 		// Call a trigger (after)
2267
-		if($output->toBool()) {
2267
+		if ($output->toBool()) {
2268 2268
 			$trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args);
2269
-			if(!$trigger_output->toBool())
2269
+			if (!$trigger_output->toBool())
2270 2270
 			{
2271 2271
 				$oDB->rollback();
2272 2272
 				return $trigger_output;
@@ -2279,7 +2279,7 @@  discard block
 block discarded – undo
2279 2279
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2280 2280
 
2281 2281
 		// Save Session
2282
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2282
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2283 2283
 		$logged_info = Context::get('logged_info');
2284 2284
 
2285 2285
 		$output->add('member_srl', $args->member_srl);
@@ -2291,14 +2291,14 @@  discard block
 block discarded – undo
2291 2291
 	 */
2292 2292
 	function updateMemberPassword($args)
2293 2293
 	{
2294
-		if($args->password)
2294
+		if ($args->password)
2295 2295
 		{
2296 2296
 
2297 2297
 			// check password strength
2298 2298
 			$oMemberModel = getModel('member');
2299 2299
 			$config = $oMemberModel->getMemberConfig();
2300 2300
 
2301
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2301
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2302 2302
 			{
2303 2303
 				$message = Context::getLang('about_password_strength');
2304 2304
 				return new Object(-1, $message[$config->password_strength]);
@@ -2306,13 +2306,13 @@  discard block
 block discarded – undo
2306 2306
 
2307 2307
 			$args->password = $oMemberModel->hashPassword($args->password);
2308 2308
 		}
2309
-		else if($args->hashed_password)
2309
+		else if ($args->hashed_password)
2310 2310
 		{
2311 2311
 			$args->password = $args->hashed_password;
2312 2312
 		}
2313 2313
 
2314 2314
 		$output = executeQuery('member.updateMemberPassword', $args);
2315
-		if($output->toBool())
2315
+		if ($output->toBool())
2316 2316
 		{
2317 2317
 			$result = executeQuery('member.updateChangePasswordDate', $args);
2318 2318
 		}
@@ -2331,18 +2331,18 @@  discard block
 block discarded – undo
2331 2331
 		$trigger_obj = new stdClass();
2332 2332
 		$trigger_obj->member_srl = $member_srl;
2333 2333
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2334
-		if(!$output->toBool()) return $output;
2334
+		if (!$output->toBool()) return $output;
2335 2335
 		// Create a model object
2336 2336
 		$oMemberModel = getModel('member');
2337 2337
 		// Bringing the user's information
2338
-		if(!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2338
+		if (!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2339 2339
 		{
2340 2340
 			$columnList = array('member_srl', 'is_admin');
2341 2341
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2342 2342
 		}
2343
-		if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2343
+		if (!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2344 2344
 		// If managers can not be deleted
2345
-		if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2345
+		if ($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2346 2346
 
2347 2347
 		$oDB = &DB::getInstance();
2348 2348
 		$oDB->begin();
@@ -2351,7 +2351,7 @@  discard block
 block discarded – undo
2351 2351
 		$args->member_srl = $member_srl;
2352 2352
 		// Delete the entries in member_auth_mail
2353 2353
 		$output = executeQuery('member.deleteAuthMail', $args);
2354
-		if(!$output->toBool())
2354
+		if (!$output->toBool())
2355 2355
 		{
2356 2356
 			$oDB->rollback();
2357 2357
 			return $output;
@@ -2366,23 +2366,23 @@  discard block
 block discarded – undo
2366 2366
 		 */
2367 2367
 		// Delete the entries in member_group_member
2368 2368
 		$output = executeQuery('member.deleteMemberGroupMember', $args);
2369
-		if(!$output->toBool())
2369
+		if (!$output->toBool())
2370 2370
 		{
2371 2371
 			$oDB->rollback();
2372 2372
 			return $output;
2373 2373
 		}
2374 2374
 		// member removed from the table
2375 2375
 		$output = executeQuery('member.deleteMember', $args);
2376
-		if(!$output->toBool())
2376
+		if (!$output->toBool())
2377 2377
 		{
2378 2378
 			$oDB->rollback();
2379 2379
 			return $output;
2380 2380
 		}
2381 2381
 		// Call a trigger (after)
2382
-		if($output->toBool())
2382
+		if ($output->toBool())
2383 2383
 		{
2384 2384
 			$trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj);
2385
-			if(!$trigger_output->toBool())
2385
+			if (!$trigger_output->toBool())
2386 2386
 			{
2387 2387
 				$oDB->rollback();
2388 2388
 				return $trigger_output;
@@ -2406,23 +2406,23 @@  discard block
 block discarded – undo
2406 2406
 	 */
2407 2407
 	function destroySessionInfo()
2408 2408
 	{
2409
-		if(!$_SESSION || !is_array($_SESSION)) return;
2409
+		if (!$_SESSION || !is_array($_SESSION)) return;
2410 2410
 
2411 2411
 		$memberInfo = Context::get('logged_info');
2412 2412
 		$memberSrl = $memberInfo->member_srl;
2413 2413
 
2414
-		foreach($_SESSION as $key => $val)
2414
+		foreach ($_SESSION as $key => $val)
2415 2415
 		{
2416 2416
 			$_SESSION[$key] = '';
2417 2417
 		}
2418 2418
 
2419 2419
 		session_destroy();
2420
-		setcookie(session_name(), '', $_SERVER['REQUEST_TIME']-42000);
2421
-		setcookie('sso','',$_SERVER['REQUEST_TIME']-42000);
2422
-		setcookie('xeak','',$_SERVER['REQUEST_TIME']-42000);
2420
+		setcookie(session_name(), '', $_SERVER['REQUEST_TIME'] - 42000);
2421
+		setcookie('sso', '', $_SERVER['REQUEST_TIME'] - 42000);
2422
+		setcookie('xeak', '', $_SERVER['REQUEST_TIME'] - 42000);
2423 2423
 		setcookie('xe_logged', 'false', $_SERVER['REQUEST_TIME'] - 42000);
2424 2424
 
2425
-		if($memberSrl || $_COOKIE['xeak'])
2425
+		if ($memberSrl || $_COOKIE['xeak'])
2426 2426
 		{
2427 2427
 			$args = new stdClass();
2428 2428
 			$args->member_srl = $memberSrl;
@@ -2438,22 +2438,22 @@  discard block
 block discarded – undo
2438 2438
 		$pointGroup = $pointModuleConfig->point_group;
2439 2439
 
2440 2440
 		$levelGroup = array();
2441
-		if(is_array($pointGroup) && count($pointGroup)>0)
2441
+		if (is_array($pointGroup) && count($pointGroup) > 0)
2442 2442
 		{
2443 2443
 			$levelGroup = array_flip($pointGroup);
2444 2444
 			ksort($levelGroup);
2445 2445
 		}
2446 2446
 		$maxLevel = 0;
2447 2447
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2448
-		if(count($resultGroup) > 0)
2448
+		if (count($resultGroup) > 0)
2449 2449
 			$maxLevel = max(array_flip($resultGroup));
2450 2450
 
2451
-		if($maxLevel > 0)
2451
+		if ($maxLevel > 0)
2452 2452
 		{
2453 2453
 			$oPointModel = getModel('point');
2454 2454
 			$originPoint = $oPointModel->getPoint($memberSrl);
2455 2455
 
2456
-			if($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2456
+			if ($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2457 2457
 			{
2458 2458
 				$oPointController = getController('point');
2459 2459
 				$oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel], 'update');
@@ -2463,18 +2463,18 @@  discard block
 block discarded – undo
2463 2463
 
2464 2464
 	function procMemberModifyEmailAddress()
2465 2465
 	{
2466
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2466
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
2467 2467
 
2468 2468
 		$member_info = Context::get('logged_info');
2469 2469
 		$newEmail = Context::get('email_address');
2470 2470
 
2471
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2471
+		if (!$newEmail) return $this->stop('msg_invalid_request');
2472 2472
 
2473 2473
 		$oMemberModel = getModel('member');
2474 2474
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2475
-		if($member_srl) return new Object(-1,'msg_exists_email_address');
2475
+		if ($member_srl) return new Object(-1, 'msg_exists_email_address');
2476 2476
 
2477
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2477
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2478 2478
 		{
2479 2479
 			return $this->stop('msg_invalid_request');
2480 2480
 		}
@@ -2490,7 +2490,7 @@  discard block
 block discarded – undo
2490 2490
 		$oDB = &DB::getInstance();
2491 2491
 		$oDB->begin();
2492 2492
 		$output = executeQuery('member.insertAuthMail', $auth_args);
2493
-		if(!$output->toBool())
2493
+		if (!$output->toBool())
2494 2494
 		{
2495 2495
 			$oDB->rollback();
2496 2496
 			return $output;
@@ -2500,7 +2500,7 @@  discard block
 block discarded – undo
2500 2500
 		$member_config = $oModuleModel->getModuleConfig('member');
2501 2501
 
2502 2502
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2503
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2503
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2504 2504
 
2505 2505
 		global $lang;
2506 2506
 
@@ -2512,17 +2512,17 @@  discard block
 block discarded – undo
2512 2512
 
2513 2513
 		Context::set('newEmail', $newEmail);
2514 2514
 
2515
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthEmailAddress','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
2515
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
2516 2516
 		Context::set('auth_url', $auth_url);
2517 2517
 
2518 2518
 		$oTemplate = &TemplateHandler::getInstance();
2519 2519
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_new_email');
2520 2520
 
2521 2521
 		$oMail = new Mail();
2522
-		$oMail->setTitle( Context::getLang('title_modify_email_address') );
2522
+		$oMail->setTitle(Context::getLang('title_modify_email_address'));
2523 2523
 		$oMail->setContent($content);
2524
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
2525
-		$oMail->setReceiptor( $member_info->nick_name, $newEmail );
2524
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
2525
+		$oMail->setReceiptor($member_info->nick_name, $newEmail);
2526 2526
 		$result = $oMail->send();
2527 2527
 
2528 2528
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail);
@@ -2536,16 +2536,16 @@  discard block
 block discarded – undo
2536 2536
 	{
2537 2537
 		$member_srl = Context::get('member_srl');
2538 2538
 		$auth_key = Context::get('auth_key');
2539
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2539
+		if (!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2540 2540
 
2541 2541
 		// Test logs for finding password by user_id and authkey
2542 2542
 		$args = new stdClass;
2543 2543
 		$args->member_srl = $member_srl;
2544 2544
 		$args->auth_key = $auth_key;
2545 2545
 		$output = executeQuery('member.getAuthMail', $args);
2546
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2546
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
2547 2547
 		{
2548
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2548
+			if (strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2549 2549
 			return $this->stop('msg_invalid_modify_email_auth_key');
2550 2550
 		}
2551 2551
 
@@ -2554,10 +2554,10 @@  discard block
 block discarded – undo
2554 2554
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2555 2555
 
2556 2556
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2557
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2557
+		if (!$output->toBool()) return $this->stop($output->getMessage());
2558 2558
 
2559 2559
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2560
-		executeQuery('member.deleteAuthChangeEmailAddress',$args);
2560
+		executeQuery('member.deleteAuthChangeEmailAddress', $args);
2561 2561
 
2562 2562
 		$this->_clearMemberCache($args->member_srl);
2563 2563
 
@@ -2575,7 +2575,7 @@  discard block
 block discarded – undo
2575 2575
 	**/
2576 2576
 	function triggerGetDocumentMenu(&$menu_list)
2577 2577
 	{
2578
-		if(!Context::get('is_logged')) return new Object();
2578
+		if (!Context::get('is_logged')) return new Object();
2579 2579
 
2580 2580
 		$logged_info = Context::get('logged_info');
2581 2581
 		$document_srl = Context::get('target_srl');
@@ -2586,12 +2586,12 @@  discard block
 block discarded – undo
2586 2586
 		$member_srl = $oDocument->get('member_srl');
2587 2587
 		$module_srl = $oDocument->get('module_srl');
2588 2588
 
2589
-		if(!$member_srl) return new Object();
2590
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2589
+		if (!$member_srl) return new Object();
2590
+		if ($oDocumentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object();
2591 2591
 
2592 2592
 		$oDocumentController = getController('document');
2593
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2594
-		$oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup');
2593
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2594
+		$oDocumentController->addDocumentPopupMenu($url, 'cmd_spammer', '', 'popup');
2595 2595
 
2596 2596
 		return new Object();
2597 2597
 	}
@@ -2605,7 +2605,7 @@  discard block
 block discarded – undo
2605 2605
 	**/
2606 2606
 	function triggerGetCommentMenu(&$menu_list)
2607 2607
 	{
2608
-		if(!Context::get('is_logged')) return new Object();
2608
+		if (!Context::get('is_logged')) return new Object();
2609 2609
 
2610 2610
 		$logged_info = Context::get('logged_info');
2611 2611
 		$comment_srl = Context::get('target_srl');
@@ -2616,12 +2616,12 @@  discard block
 block discarded – undo
2616 2616
 		$module_srl = $oComment->get('module_srl');
2617 2617
 		$member_srl = $oComment->get('member_srl');
2618 2618
 
2619
-		if(!$member_srl) return new Object();
2620
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2619
+		if (!$member_srl) return new Object();
2620
+		if ($oCommentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object();
2621 2621
 
2622 2622
 		$oCommentController = getController('comment');
2623
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2624
-		$oCommentController->addCommentPopupMenu($url,'cmd_spammer','','popup');
2623
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2624
+		$oCommentController->addCommentPopupMenu($url, 'cmd_spammer', '', 'popup');
2625 2625
 
2626 2626
 		return new Object();
2627 2627
 	}
@@ -2633,7 +2633,7 @@  discard block
 block discarded – undo
2633 2633
 	**/
2634 2634
 	function procMemberSpammerManage()
2635 2635
 	{
2636
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
2636
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
2637 2637
 
2638 2638
 		$logged_info = Context::get('logged_info');
2639 2639
 		$member_srl = Context::get('member_srl');
@@ -2641,7 +2641,7 @@  discard block
 block discarded – undo
2641 2641
 		$cnt_loop = Context::get('cnt_loop');
2642 2642
 		$proc_type = Context::get('proc_type');
2643 2643
 		$isMoveToTrash = true;
2644
-		if($proc_type == "delete")
2644
+		if ($proc_type == "delete")
2645 2645
 			$isMoveToTrash = false;
2646 2646
 
2647 2647
 		// check grant
@@ -2650,7 +2650,7 @@  discard block
 block discarded – undo
2650 2650
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2651 2651
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2652 2652
 
2653
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
2653
+		if (!$grant->manager) return new Object(-1, 'msg_not_permitted');
2654 2654
 
2655 2655
 		$proc_msg = "";
2656 2656
 
@@ -2659,10 +2659,10 @@  discard block
 block discarded – undo
2659 2659
 
2660 2660
 		// delete or trash destination
2661 2661
 		// proc member
2662
-		if($cnt_loop == 1)
2662
+		if ($cnt_loop == 1)
2663 2663
 			$this->_spammerMember($member_srl);
2664 2664
 		// proc document and comment
2665
-		elseif($cnt_loop>1)
2665
+		elseif ($cnt_loop > 1)
2666 2666
 			$this->_spammerDocuments($member_srl, $isMoveToTrash);
2667 2667
 
2668 2668
 		// get destination count
@@ -2671,11 +2671,11 @@  discard block
 block discarded – undo
2671 2671
 
2672 2672
 		$total_count = Context::get('total_count');
2673 2673
 		$remain_count = $cnt_document + $cnt_comment;
2674
-		if($cnt_loop == 1) $total_count = $remain_count;
2674
+		if ($cnt_loop == 1) $total_count = $remain_count;
2675 2675
 
2676 2676
 		// get progress percent
2677
-		if($total_count > 0)
2678
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2677
+		if ($total_count > 0)
2678
+			$progress = intval((($total_count - $remain_count) / $total_count) * 100);
2679 2679
 		else
2680 2680
 			$progress = 100;
2681 2681
 
@@ -2699,7 +2699,7 @@  discard block
 block discarded – undo
2699 2699
 	**/
2700 2700
 	private function _spammerMember($member_srl) {
2701 2701
 		$logged_info = Context::get('logged_info');
2702
-		$spam_description = trim( Context::get('spam_description') );
2702
+		$spam_description = trim(Context::get('spam_description'));
2703 2703
 
2704 2704
 		$oMemberModel = getModel('member');
2705 2705
 		$columnList = array('member_srl', 'email_address', 'user_id', 'nick_name', 'description');
@@ -2718,10 +2718,10 @@  discard block
 block discarded – undo
2718 2718
 		$args->user_id = $member_info->user_id;
2719 2719
 		$args->nick_name = $member_info->nick_name;
2720 2720
 		$args->denied = "Y";
2721
-		$args->description = trim( $member_info->description );
2722
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
2721
+		$args->description = trim($member_info->description);
2722
+		if ($args->description != "") $args->description .= "\n"; // add new line
2723 2723
 
2724
-		$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 . "]";
2724
+		$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."]";
2725 2725
 
2726 2726
 		$output = $this->updateMember($args, true);
2727 2727
 
@@ -2750,21 +2750,21 @@  discard block
 block discarded – undo
2750 2750
 		// 1. proc comment, 2. proc document
2751 2751
 		$cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl);
2752 2752
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
2753
-		if($cnt_comment > 0)
2753
+		if ($cnt_comment > 0)
2754 2754
 		{
2755 2755
 			$columnList = array();
2756 2756
 			$commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2757
-			if($commentList) {
2758
-				foreach($commentList as $v) {
2757
+			if ($commentList) {
2758
+				foreach ($commentList as $v) {
2759 2759
 					$oCommentController->deleteComment($v->comment_srl, true, $isMoveToTrash);
2760 2760
 				}
2761 2761
 			}
2762
-		} elseif($cnt_document > 0) {
2762
+		} elseif ($cnt_document > 0) {
2763 2763
 			$columnList = array();
2764 2764
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2765
-			if($documentList) {
2766
-				foreach($documentList as $v) {
2767
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2765
+			if ($documentList) {
2766
+				foreach ($documentList as $v) {
2767
+					if ($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2768 2768
 					else $oDocumentController->deleteDocument($v->document_srl);
2769 2769
 				}
2770 2770
 			}
@@ -2776,24 +2776,24 @@  discard block
 block discarded – undo
2776 2776
 	function _clearMemberCache($member_srl, $site_srl = 0)
2777 2777
 	{
2778 2778
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
2779
-		if($oCacheHandler->isSupport())
2779
+		if ($oCacheHandler->isSupport())
2780 2780
 		{
2781
-			$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_' . $site_srl;
2781
+			$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl;
2782 2782
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2783 2783
 			$oCacheHandler->delete($cache_key);
2784 2784
 
2785
-			if($site_srl !== 0)
2785
+			if ($site_srl !== 0)
2786 2786
 			{
2787
-				$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0';
2787
+				$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_0';
2788 2788
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2789 2789
 				$oCacheHandler->delete($cache_key);
2790 2790
 			}
2791 2791
 		}
2792 2792
 
2793 2793
 		$oCacheHandler = CacheHandler::getInstance('object');
2794
-		if($oCacheHandler->isSupport())
2794
+		if ($oCacheHandler->isSupport())
2795 2795
 		{
2796
-			$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
2796
+			$object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl;
2797 2797
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2798 2798
 			$oCacheHandler->delete($cache_key);
2799 2799
 		}
Please login to merge, or discard this patch.
Braces   +590 added lines, -247 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
 
@@ -125,12 +141,18 @@  discard block
 block discarded – undo
125 141
 	function procMemberScrapDocument()
126 142
 	{
127 143
 		// Check login information
128
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
144
+		if(!Context::get('is_logged')) {
145
+			return new Object(-1, 'msg_not_logged');
146
+		}
129 147
 		$logged_info = Context::get('logged_info');
130 148
 
131 149
 		$document_srl = (int)Context::get('document_srl');
132
-		if(!$document_srl) $document_srl = (int)Context::get('target_srl');
133
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
150
+		if(!$document_srl) {
151
+			$document_srl = (int)Context::get('target_srl');
152
+		}
153
+		if(!$document_srl) {
154
+			return new Object(-1,'msg_invalid_request');
155
+		}
134 156
 		// Get document
135 157
 		$oDocumentModel = getModel('document');
136 158
 		$oDocument = $oDocumentModel->getDocument($document_srl);
@@ -145,10 +167,14 @@  discard block
 block discarded – undo
145 167
 		$args->title = $oDocument->get('title');
146 168
 		// Check if already scrapped
147 169
 		$output = executeQuery('member.getScrapDocument', $args);
148
-		if($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
170
+		if($output->data->count) {
171
+			return new Object(-1, 'msg_alreay_scrapped');
172
+		}
149 173
 		// Insert
150 174
 		$output = executeQuery('member.addScrapDocument', $args);
151
-		if(!$output->toBool()) return $output;
175
+		if(!$output->toBool()) {
176
+			return $output;
177
+		}
152 178
 
153 179
 		$this->setError(-1);
154 180
 		$this->setMessage('success_registed');
@@ -162,11 +188,15 @@  discard block
 block discarded – undo
162 188
 	function procMemberDeleteScrap()
163 189
 	{
164 190
 		// Check login information
165
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
191
+		if(!Context::get('is_logged')) {
192
+			return new Object(-1, 'msg_not_logged');
193
+		}
166 194
 		$logged_info = Context::get('logged_info');
167 195
 
168 196
 		$document_srl = (int)Context::get('document_srl');
169
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
197
+		if(!$document_srl) {
198
+			return new Object(-1,'msg_invalid_request');
199
+		}
170 200
 		// Variables
171 201
 		$args = new stdClass;
172 202
 		$args->member_srl = $logged_info->member_srl;
@@ -192,11 +222,15 @@  discard block
 block discarded – undo
192 222
 	function procMemberDeleteSavedDocument()
193 223
 	{
194 224
 		// Check login information
195
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
225
+		if(!Context::get('is_logged')) {
226
+			return new Object(-1, 'msg_not_logged');
227
+		}
196 228
 		$logged_info = Context::get('logged_info');
197 229
 
198 230
 		$document_srl = (int)Context::get('document_srl');
199
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
231
+		if(!$document_srl) {
232
+			return new Object(-1,'msg_invalid_request');
233
+		}
200 234
 
201 235
 		$oDocumentModel = getModel('document');
202 236
 		$oDocument = $oDocumentModel->getDocument($document_srl);
@@ -224,7 +258,9 @@  discard block
 block discarded – undo
224 258
 	{
225 259
 		$name = Context::get('name');
226 260
 		$value = Context::get('value');
227
-		if(!$value) return;
261
+		if(!$value) {
262
+			return;
263
+		}
228 264
 
229 265
 		$oMemberModel = getModel('member');
230 266
 		// Check if logged-in
@@ -235,10 +271,14 @@  discard block
 block discarded – undo
235 271
 		{
236 272
 			case 'user_id' :
237 273
 				// Check denied ID
238
-				if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id');
274
+				if($oMemberModel->isDeniedID($value)) {
275
+					return new Object(0,'denied_user_id');
276
+				}
239 277
 				// Check if duplicated
240 278
 				$member_srl = $oMemberModel->getMemberSrlByUserID($value);
241
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_user_id');
279
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
280
+					return new Object(0,'msg_exists_user_id');
281
+				}
242 282
 				break;
243 283
 			case 'nick_name' :
244 284
 				// Check denied ID
@@ -248,13 +288,17 @@  discard block
 block discarded – undo
248 288
 				}
249 289
 				// Check if duplicated
250 290
 				$member_srl = $oMemberModel->getMemberSrlByNickName($value);
251
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name');
291
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
292
+					return new Object(0,'msg_exists_nick_name');
293
+				}
252 294
 
253 295
 				break;
254 296
 			case 'email_address' :
255 297
 				// Check if duplicated
256 298
 				$member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
257
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address');
299
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
300
+					return new Object(0,'msg_exists_email_address');
301
+				}
258 302
 				break;
259 303
 		}
260 304
 	}
@@ -266,17 +310,25 @@  discard block
 block discarded – undo
266 310
 	 */
267 311
 	function procMemberInsert()
268 312
 	{
269
-		if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request");
313
+		if (Context::getRequestMethod () == "GET") {
314
+			return new Object (-1, "msg_invalid_request");
315
+		}
270 316
 		$oMemberModel = &getModel ('member');
271 317
 		$config = $oMemberModel->getMemberConfig();
272 318
 
273 319
 		// call a trigger (before)
274 320
 		$trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config);
275
-		if(!$trigger_output->toBool ()) return $trigger_output;
321
+		if(!$trigger_output->toBool ()) {
322
+			return $trigger_output;
323
+		}
276 324
 		// Check if an administrator allows a membership
277
-		if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled');
325
+		if($config->enable_join != 'Y') {
326
+			return $this->stop ('msg_signup_disabled');
327
+		}
278 328
 		// Check if the user accept the license terms (only if terms exist)
279
-		if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
329
+		if($config->agreement && Context::get('accept_agreement')!='Y') {
330
+			return $this->stop('msg_accept_agreement');
331
+		}
280 332
 
281 333
 		// Extract the necessary information in advance
282 334
 		$getVars = array();
@@ -295,16 +347,22 @@  discard block
 block discarded – undo
295 347
 		foreach($getVars as $val)
296 348
 		{
297 349
 			$args->{$val} = Context::get($val);
298
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
350
+			if($val == 'birthday') {
351
+				$args->birthday_ui = Context::get('birthday_ui');
352
+			}
299 353
 		}
300 354
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
301
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
355
+		if(!$args->birthday && $args->birthday_ui) {
356
+			$args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
357
+		}
302 358
 
303 359
 		$args->find_account_answer = Context::get('find_account_answer');
304 360
 		$args->allow_mailing = Context::get('allow_mailing');
305 361
 		$args->allow_message = Context::get('allow_message');
306 362
 
307
-		if($args->password1) $args->password = $args->password1;
363
+		if($args->password1) {
364
+			$args->password = $args->password1;
365
+		}
308 366
 
309 367
 		// check password strength
310 368
 		if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
@@ -333,7 +391,9 @@  discard block
 block discarded – undo
333 391
 		unset($all_args->secret_text);
334 392
 
335 393
 		// Set the user state as "denied" when using mail authentication
336
-		if($config->enable_confirm == 'Y') $args->denied = 'Y';
394
+		if($config->enable_confirm == 'Y') {
395
+			$args->denied = 'Y';
396
+		}
337 397
 		// Add extra vars after excluding necessary information from all the requested arguments
338 398
 		$extra_vars = delObjectVars($all_args, $args);
339 399
 		$args->extra_vars = serialize($extra_vars);
@@ -348,7 +408,9 @@  discard block
 block discarded – undo
348 408
 			}
349 409
 		}
350 410
 		$output = $this->insertMember($args);
351
-		if(!$output->toBool()) return $output;
411
+		if(!$output->toBool()) {
412
+			return $output;
413
+		}
352 414
 
353 415
 		// insert ProfileImage, ImageName, ImageMark
354 416
 		$profile_image = $_FILES['profile_image'];
@@ -387,43 +449,46 @@  discard block
 block discarded – undo
387 449
 			if($config->identifier == 'email_address')
388 450
 			{
389 451
 				$output = $this->doLogin($args->email_address);
390
-			}
391
-			else
452
+			} else
392 453
 			{
393 454
 				$output = $this->doLogin($args->user_id);
394 455
 			}
395 456
 			if(!$output->toBool()) {
396
-				if($output->error == -9)
397
-					$output->error = -11;
457
+				if($output->error == -9) {
458
+									$output->error = -11;
459
+				}
398 460
 				return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output);
399 461
 			}
400 462
 		}
401 463
 
402 464
 		// Results
403 465
 		$this->add('member_srl', $args->member_srl);
404
-		if($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
466
+		if($config->redirect_url) {
467
+			$this->add('redirect_url', $config->redirect_url);
468
+		}
405 469
 		if($config->enable_confirm == 'Y')
406 470
 		{
407 471
 			$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
408 472
 			$this->setMessage($msg);
409 473
 			return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), new Object(-12, $msg));
474
+		} else {
475
+			$this->setMessage('success_registed');
410 476
 		}
411
-		else $this->setMessage('success_registed');
412 477
 		// Call a trigger (after)
413 478
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
414
-		if(!$trigger_output->toBool()) return $trigger_output;
479
+		if(!$trigger_output->toBool()) {
480
+			return $trigger_output;
481
+		}
415 482
 
416 483
 		if($config->redirect_url)
417 484
 		{
418 485
 			$returnUrl = $config->redirect_url;
419
-		}
420
-		else
486
+		} else
421 487
 		{
422 488
 			if(Context::get('success_return_url'))
423 489
 			{
424 490
 				$returnUrl = Context::get('success_return_url');
425
-			}
426
-			else if($_COOKIE['XE_REDIRECT_URL'])
491
+			} else if($_COOKIE['XE_REDIRECT_URL'])
427 492
 			{
428 493
 				$returnUrl = $_COOKIE['XE_REDIRECT_URL'];
429 494
 				setcookie("XE_REDIRECT_URL", '', 1);
@@ -477,8 +542,7 @@  discard block
 block discarded – undo
477 542
 		if(Context::get('success_return_url'))
478 543
 		{
479 544
 			$redirectUrl = Context::get('success_return_url');
480
-		}
481
-		else
545
+		} else
482 546
 		{
483 547
 			$redirectUrl = getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
484 548
 		}
@@ -522,13 +586,17 @@  discard block
 block discarded – undo
522 586
 		foreach($getVars as $val)
523 587
 		{
524 588
 			$args->{$val} = Context::get($val);
525
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
589
+			if($val == 'birthday') {
590
+				$args->birthday_ui = Context::get('birthday_ui');
591
+			}
526 592
 		}
527 593
 		// Login Information
528 594
 		$logged_info = Context::get('logged_info');
529 595
 		$args->member_srl = $logged_info->member_srl;
530 596
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
531
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
597
+		if(!$args->birthday && $args->birthday_ui) {
598
+			$args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
599
+		}
532 600
 		// Remove some unnecessary variables from all the vars
533 601
 		$all_args = Context::getRequestVars();
534 602
 		unset($all_args->module);
@@ -562,7 +630,9 @@  discard block
 block discarded – undo
562 630
 
563 631
 		// Execute insert or update depending on the value of member_srl
564 632
 		$output = $this->updateMember($args);
565
-		if(!$output->toBool()) return $output;
633
+		if(!$output->toBool()) {
634
+			return $output;
635
+		}
566 636
 
567 637
 		$profile_image = $_FILES['profile_image'];
568 638
 		if(is_uploaded_file($profile_image['tmp_name']))
@@ -592,7 +662,9 @@  discard block
 block discarded – undo
592 662
 
593 663
 		// Call a trigger after successfully log-in (after)
594 664
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo);
595
-		if(!$trigger_output->toBool()) return $trigger_output;
665
+		if(!$trigger_output->toBool()) {
666
+			return $trigger_output;
667
+		}
596 668
 
597 669
 		$this->setSessionInfo();
598 670
 		// Return result
@@ -613,7 +685,9 @@  discard block
 block discarded – undo
613 685
 	 */
614 686
 	function procMemberModifyPassword()
615 687
 	{
616
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
688
+		if(!Context::get('is_logged')) {
689
+			return $this->stop('msg_not_logged');
690
+		}
617 691
 		// Extract the necessary information in advance
618 692
 		$current_password = trim(Context::get('current_password'));
619 693
 		$password = trim(Context::get('password1'));
@@ -627,17 +701,23 @@  discard block
 block discarded – undo
627 701
 
628 702
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
629 703
 		// Verify the cuttent password
630
-		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
704
+		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) {
705
+			return new Object(-1, 'invalid_password');
706
+		}
631 707
 
632 708
 		// Check if a new password is as same as the previous password
633
-		if($current_password == $password) return new Object(-1, 'invalid_new_password');
709
+		if($current_password == $password) {
710
+			return new Object(-1, 'invalid_new_password');
711
+		}
634 712
 
635 713
 		// Execute insert or update depending on the value of member_srl
636 714
 		$args = new stdClass;
637 715
 		$args->member_srl = $member_srl;
638 716
 		$args->password = $password;
639 717
 		$output = $this->updateMemberPassword($args);
640
-		if(!$output->toBool()) return $output;
718
+		if(!$output->toBool()) {
719
+			return $output;
720
+		}
641 721
 
642 722
 		$this->add('member_srl', $args->member_srl);
643 723
 		$this->setMessage('success_updated');
@@ -653,7 +733,9 @@  discard block
 block discarded – undo
653 733
 	 */
654 734
 	function procMemberLeave()
655 735
 	{
656
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
736
+		if(!Context::get('is_logged')) {
737
+			return $this->stop('msg_not_logged');
738
+		}
657 739
 		// Extract the necessary information in advance
658 740
 		$password = trim(Context::get('password'));
659 741
 		// Get information of logged-in user
@@ -669,10 +751,14 @@  discard block
 block discarded – undo
669 751
 			$this->memberInfo->password = $memberInfo->password;
670 752
 		}
671 753
 		// Verify the cuttent password
672
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
754
+		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) {
755
+			return new Object(-1, 'invalid_password');
756
+		}
673 757
 
674 758
 		$output = $this->deleteMember($member_srl);
675
-		if(!$output->toBool()) return $output;
759
+		if(!$output->toBool()) {
760
+			return $output;
761
+		}
676 762
 		// Destroy all session information
677 763
 		$this->destroySessionInfo();
678 764
 		// Return success message
@@ -691,17 +777,25 @@  discard block
 block discarded – undo
691 777
 	{
692 778
 		// Check if the file is successfully uploaded
693 779
 		$file = $_FILES['profile_image'];
694
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
780
+		if(!is_uploaded_file($file['tmp_name'])) {
781
+			return $this->stop('msg_not_uploaded_profile_image');
782
+		}
695 783
 		// Ignore if member_srl is invalid or doesn't exist.
696 784
 		$member_srl = Context::get('member_srl');
697
-		if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
785
+		if(!$member_srl) {
786
+			return $this->stop('msg_not_uploaded_profile_image');
787
+		}
698 788
 
699 789
 		$logged_info = Context::get('logged_info');
700
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
790
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
791
+			return $this->stop('msg_not_uploaded_profile_image');
792
+		}
701 793
 		// Return if member module is set not to use an image name or the user is not an administrator ;
702 794
 		$oModuleModel = getModel('module');
703 795
 		$config = $oModuleModel->getModuleConfig('member');
704
-		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
796
+		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') {
797
+			return $this->stop('msg_not_uploaded_profile_image');
798
+		}
705 799
 
706 800
 		$this->insertProfileImage($member_srl, $file['tmp_name']);
707 801
 		// Page refresh
@@ -723,26 +817,35 @@  discard block
 block discarded – undo
723 817
 	{
724 818
 
725 819
 		// Check uploaded file
726
-		if(!checkUploadedFile($target_file)) return;
820
+		if(!checkUploadedFile($target_file)) {
821
+			return;
822
+		}
727 823
 
728 824
 		$oMemberModel = getModel('member');
729 825
 		$config = $oMemberModel->getMemberConfig();
730 826
 
731 827
 		// Get an image size
732 828
 		$max_width = $config->profile_image_max_width;
733
-		if(!$max_width) $max_width = "90";
829
+		if(!$max_width) {
830
+			$max_width = "90";
831
+		}
734 832
 		$max_height = $config->profile_image_max_height;
735
-		if(!$max_height) $max_height = "90";
833
+		if(!$max_height) {
834
+			$max_height = "90";
835
+		}
736 836
 		// Get a target path to save
737 837
 		$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
738 838
 		FileHandler::makeDir($target_path);
739 839
 
740 840
 		// Get file information
741 841
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
742
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
743
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
744
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
745
-		else
842
+		if(IMAGETYPE_PNG == $type) {
843
+			$ext = 'png';
844
+		} elseif(IMAGETYPE_JPEG == $type) {
845
+			$ext = 'jpg';
846
+		} elseif(IMAGETYPE_GIF == $type) {
847
+			$ext = 'gif';
848
+		} else
746 849
 		{
747 850
 			return;
748 851
 		}
@@ -754,8 +857,7 @@  discard block
 block discarded – undo
754 857
 		if(($width > $max_width || $height > $max_height ) && $type != 1)
755 858
 		{
756 859
 			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
757
-		}
758
-		else
860
+		} else
759 861
 		{
760 862
 			@copy($target_file, $target_filename);
761 863
 		}
@@ -770,17 +872,25 @@  discard block
 block discarded – undo
770 872
 	{
771 873
 		// Check if the file is successfully uploaded
772 874
 		$file = $_FILES['image_name'];
773
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
875
+		if(!is_uploaded_file($file['tmp_name'])) {
876
+			return $this->stop('msg_not_uploaded_image_name');
877
+		}
774 878
 		// Ignore if member_srl is invalid or doesn't exist.
775 879
 		$member_srl = Context::get('member_srl');
776
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
880
+		if(!$member_srl) {
881
+			return $this->stop('msg_not_uploaded_image_name');
882
+		}
777 883
 
778 884
 		$logged_info = Context::get('logged_info');
779
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
885
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
886
+			return $this->stop('msg_not_uploaded_image_name');
887
+		}
780 888
 		// Return if member module is set not to use an image name or the user is not an administrator ;
781 889
 		$oModuleModel = getModel('module');
782 890
 		$config = $oModuleModel->getModuleConfig('member');
783
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
891
+		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') {
892
+			return $this->stop('msg_not_uploaded_image_name');
893
+		}
784 894
 
785 895
 		$this->insertImageName($member_srl, $file['tmp_name']);
786 896
 		// Page refresh
@@ -801,15 +911,21 @@  discard block
 block discarded – undo
801 911
 	function insertImageName($member_srl, $target_file)
802 912
 	{
803 913
 		// Check uploaded file
804
-		if(!checkUploadedFile($target_file)) return;
914
+		if(!checkUploadedFile($target_file)) {
915
+			return;
916
+		}
805 917
 
806 918
 		$oModuleModel = getModel('module');
807 919
 		$config = $oModuleModel->getModuleConfig('member');
808 920
 		// Get an image size
809 921
 		$max_width = $config->image_name_max_width;
810
-		if(!$max_width) $max_width = "90";
922
+		if(!$max_width) {
923
+			$max_width = "90";
924
+		}
811 925
 		$max_height = $config->image_name_max_height;
812
-		if(!$max_height) $max_height = "20";
926
+		if(!$max_height) {
927
+			$max_height = "20";
928
+		}
813 929
 		// Get a target path to save
814 930
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
815 931
 		FileHandler::makeDir($target_path);
@@ -818,8 +934,11 @@  discard block
 block discarded – undo
818 934
 		// Get file information
819 935
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
820 936
 		// Convert if the image size is larger than a given size or if the format is not a gif
821
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
822
-		else @copy($target_file, $target_filename);
937
+		if($width > $max_width || $height > $max_height || $type!=1) {
938
+			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
939
+		} else {
940
+			@copy($target_file, $target_filename);
941
+		}
823 942
 	}
824 943
 
825 944
 	/**
@@ -879,17 +998,25 @@  discard block
 block discarded – undo
879 998
 	{
880 999
 		// Check if the file is successfully uploaded
881 1000
 		$file = $_FILES['image_mark'];
882
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
1001
+		if(!is_uploaded_file($file['tmp_name'])) {
1002
+			return $this->stop('msg_not_uploaded_image_mark');
1003
+		}
883 1004
 		// Ignore if member_srl is invalid or doesn't exist.
884 1005
 		$member_srl = Context::get('member_srl');
885
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
1006
+		if(!$member_srl) {
1007
+			return $this->stop('msg_not_uploaded_image_mark');
1008
+		}
886 1009
 
887 1010
 		$logged_info = Context::get('logged_info');
888
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
1011
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
1012
+			return $this->stop('msg_not_uploaded_image_mark');
1013
+		}
889 1014
 		// Membership in the images mark the module using the ban was set by an administrator or return;
890 1015
 		$oModuleModel = getModel('module');
891 1016
 		$config = $oModuleModel->getModuleConfig('member');
892
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
1017
+		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') {
1018
+			return $this->stop('msg_not_uploaded_image_mark');
1019
+		}
893 1020
 
894 1021
 		$this->insertImageMark($member_srl, $file['tmp_name']);
895 1022
 		// Page refresh
@@ -910,15 +1037,21 @@  discard block
 block discarded – undo
910 1037
 	function insertImageMark($member_srl, $target_file)
911 1038
 	{
912 1039
 		// Check uploaded file
913
-		if(!checkUploadedFile($target_file)) return;
1040
+		if(!checkUploadedFile($target_file)) {
1041
+			return;
1042
+		}
914 1043
 
915 1044
 		$oModuleModel = getModel('module');
916 1045
 		$config = $oModuleModel->getModuleConfig('member');
917 1046
 		// Get an image size
918 1047
 		$max_width = $config->image_mark_max_width;
919
-		if(!$max_width) $max_width = "20";
1048
+		if(!$max_width) {
1049
+			$max_width = "20";
1050
+		}
920 1051
 		$max_height = $config->image_mark_max_height;
921
-		if(!$max_height) $max_height = "20";
1052
+		if(!$max_height) {
1053
+			$max_height = "20";
1054
+		}
922 1055
 
923 1056
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
924 1057
 		FileHandler::makeDir($target_path);
@@ -927,8 +1060,11 @@  discard block
 block discarded – undo
927 1060
 		// Get file information
928 1061
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
929 1062
 
930
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
931
-		else @copy($target_file, $target_filename);
1063
+		if($width > $max_width || $height > $max_height || $type!=1) {
1064
+			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
1065
+		} else {
1066
+			@copy($target_file, $target_filename);
1067
+		}
932 1068
 	}
933 1069
 
934 1070
 	/**
@@ -963,14 +1099,18 @@  discard block
 block discarded – undo
963 1099
 	function procMemberFindAccount()
964 1100
 	{
965 1101
 		$email_address = Context::get('email_address');
966
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1102
+		if(!$email_address) {
1103
+			return new Object(-1, 'msg_invalid_request');
1104
+		}
967 1105
 
968 1106
 		$oMemberModel = getModel('member');
969 1107
 		$oModuleModel = getModel('module');
970 1108
 
971 1109
 		// Check if a member having the same email address exists
972 1110
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
973
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1111
+		if(!$member_srl) {
1112
+			return new Object(-1, 'msg_email_not_exists');
1113
+		}
974 1114
 
975 1115
 		// Get information of the member
976 1116
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
@@ -982,7 +1122,9 @@  discard block
 block discarded – undo
982 1122
 			$chk_args = new stdClass;
983 1123
 			$chk_args->member_srl = $member_info->member_srl;
984 1124
 			$output = executeQuery('member.chkAuthMail', $chk_args);
985
-			if($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
1125
+			if($output->toBool() && $output->data->count != '0') {
1126
+				return new Object(-1, 'msg_user_not_confirmed');
1127
+			}
986 1128
 		}
987 1129
 
988 1130
 		// Insert data into the authentication DB
@@ -995,7 +1137,9 @@  discard block
 block discarded – undo
995 1137
 		$args->is_register = 'N';
996 1138
 
997 1139
 		$output = executeQuery('member.insertAuthMail', $args);
998
-		if(!$output->toBool()) return $output;
1140
+		if(!$output->toBool()) {
1141
+			return $output;
1142
+		}
999 1143
 		// Get content of the email to send a member
1000 1144
 		Context::set('auth_args', $args);
1001 1145
 
@@ -1012,8 +1156,7 @@  discard block
 block discarded – undo
1012 1156
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1013 1157
 				}
1014 1158
 			}
1015
-		}
1016
-		else
1159
+		} else
1017 1160
 		{
1018 1161
 			$memberInfo[$lang->user_id] = $args->user_id;
1019 1162
 			$memberInfo[$lang->user_name] = $args->user_name;
@@ -1022,13 +1165,19 @@  discard block
 block discarded – undo
1022 1165
 		}
1023 1166
 		Context::set('memberInfo', $memberInfo);
1024 1167
 
1025
-		if(!$member_config->skin) $member_config->skin = "default";
1026
-		if(!$member_config->colorset) $member_config->colorset = "white";
1168
+		if(!$member_config->skin) {
1169
+			$member_config->skin = "default";
1170
+		}
1171
+		if(!$member_config->colorset) {
1172
+			$member_config->colorset = "white";
1173
+		}
1027 1174
 
1028 1175
 		Context::set('member_config', $member_config);
1029 1176
 
1030 1177
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1031
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1178
+		if(!is_dir($tpl_path)) {
1179
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1180
+		}
1032 1181
 
1033 1182
 		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1034 1183
 		Context::set('find_url', $find_url);
@@ -1070,20 +1219,28 @@  discard block
 block discarded – undo
1070 1219
 		$find_account_question = trim(Context::get('find_account_question'));
1071 1220
 		$find_account_answer = trim(Context::get('find_account_answer'));
1072 1221
 
1073
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1222
+		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) {
1223
+			return new Object(-1, 'msg_invalid_request');
1224
+		}
1074 1225
 
1075 1226
 		$oModuleModel = getModel('module');
1076 1227
 		// Check if a member having the same email address exists
1077 1228
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1078
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1229
+		if(!$member_srl) {
1230
+			return new Object(-1, 'msg_email_not_exists');
1231
+		}
1079 1232
 		// Get information of the member
1080 1233
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1081 1234
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1082 1235
 
1083 1236
 		// Display a message if no answer is entered
1084
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1237
+		if(!$member_info->find_account_question || !$member_info->find_account_answer) {
1238
+			return new Object(-1, 'msg_question_not_exists');
1239
+		}
1085 1240
 
1086
-		if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) return new Object(-1, 'msg_answer_not_matches');
1241
+		if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) {
1242
+			return new Object(-1, 'msg_answer_not_matches');
1243
+		}
1087 1244
 
1088 1245
 		if($config->identifier == 'email_address')
1089 1246
 		{
@@ -1099,7 +1256,9 @@  discard block
 block discarded – undo
1099 1256
 		$args->password = $temp_password;
1100 1257
 		$args->change_password_date = '1';
1101 1258
 		$output = $this->updateMemberPassword($args);
1102
-		if(!$output->toBool()) return $output;
1259
+		if(!$output->toBool()) {
1260
+			return $output;
1261
+		}
1103 1262
 
1104 1263
 		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1105 1264
 
@@ -1156,8 +1315,7 @@  discard block
 block discarded – undo
1156 1315
 		if($output->data->is_register == 'Y')
1157 1316
 		{
1158 1317
 			$args->denied = 'N';
1159
-		}
1160
-		else
1318
+		} else
1161 1319
 		{
1162 1320
 			$args->password = $oMemberModel->hashPassword($args->password);
1163 1321
 		}
@@ -1191,33 +1349,45 @@  discard block
 block discarded – undo
1191 1349
 	{
1192 1350
 		// Get an email_address
1193 1351
 		$email_address = Context::get('email_address');
1194
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1352
+		if(!$email_address) {
1353
+			return new Object(-1, 'msg_invalid_request');
1354
+		}
1195 1355
 		// Log test by using email_address
1196 1356
 		$oMemberModel = getModel('member');
1197 1357
 
1198 1358
 		$args = new stdClass;
1199 1359
 		$args->email_address = $email_address;
1200 1360
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1201
-		if(!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1361
+		if(!$memberSrl) {
1362
+			return new Object(-1, 'msg_not_exists_member');
1363
+		}
1202 1364
 
1203 1365
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1204 1366
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1205 1367
 
1206 1368
 		$oModuleModel = getModel('module');
1207 1369
 		$member_config = $oModuleModel->getModuleConfig('member');
1208
-		if(!$member_config->skin) $member_config->skin = "default";
1209
-		if(!$member_config->colorset) $member_config->colorset = "white";
1370
+		if(!$member_config->skin) {
1371
+			$member_config->skin = "default";
1372
+		}
1373
+		if(!$member_config->colorset) {
1374
+			$member_config->colorset = "white";
1375
+		}
1210 1376
 
1211 1377
 		// Check if a authentication mail has been sent previously
1212 1378
 		$chk_args = new stdClass;
1213 1379
 		$chk_args->member_srl = $member_info->member_srl;
1214 1380
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1215
-		if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1381
+		if($output->toBool() && $output->data->count == '0') {
1382
+			return new Object(-1, 'msg_invalid_request');
1383
+		}
1216 1384
 
1217 1385
 		$auth_args = new stdClass;
1218 1386
 		$auth_args->member_srl = $member_info->member_srl;
1219 1387
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1220
-		if(!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1388
+		if(!$output->data || !$output->data[0]->auth_key) {
1389
+			return new Object(-1, 'msg_invalid_request');
1390
+		}
1221 1391
 		$auth_info = $output->data[0];
1222 1392
 
1223 1393
 		// Update the regdate of authmail entry
@@ -1238,8 +1408,7 @@  discard block
 block discarded – undo
1238 1408
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1239 1409
 				}
1240 1410
 			}
1241
-		}
1242
-		else
1411
+		} else
1243 1412
 		{
1244 1413
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1245 1414
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1252,7 +1421,9 @@  discard block
 block discarded – undo
1252 1421
 		Context::set('member_config', $member_config);
1253 1422
 
1254 1423
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1255
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1424
+		if(!is_dir($tpl_path)) {
1425
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1426
+		}
1256 1427
 
1257 1428
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1258 1429
 		Context::set('auth_url', $auth_url);
@@ -1330,7 +1501,9 @@  discard block
 block discarded – undo
1330 1501
 		$auth_args->is_register = 'Y';
1331 1502
 
1332 1503
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1333
-		if(!$output->toBool()) return $output;
1504
+		if(!$output->toBool()) {
1505
+			return $output;
1506
+		}
1334 1507
 
1335 1508
 		$memberInfo->email_address = $newEmail;
1336 1509
 
@@ -1364,8 +1537,7 @@  discard block
 block discarded – undo
1364 1537
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1365 1538
 				}
1366 1539
 			}
1367
-		}
1368
-		else
1540
+		} else
1369 1541
 		{
1370 1542
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1371 1543
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1374,13 +1546,19 @@  discard block
 block discarded – undo
1374 1546
 		}
1375 1547
 		Context::set('memberInfo', $memberInfo);
1376 1548
 
1377
-		if(!$member_config->skin) $member_config->skin = "default";
1378
-		if(!$member_config->colorset) $member_config->colorset = "white";
1549
+		if(!$member_config->skin) {
1550
+			$member_config->skin = "default";
1551
+		}
1552
+		if(!$member_config->colorset) {
1553
+			$member_config->colorset = "white";
1554
+		}
1379 1555
 
1380 1556
 		Context::set('member_config', $member_config);
1381 1557
 
1382 1558
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1383
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1559
+		if(!is_dir($tpl_path)) {
1560
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1561
+		}
1384 1562
 
1385 1563
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1386 1564
 		Context::set('auth_url', $auth_url);
@@ -1405,7 +1583,9 @@  discard block
 block discarded – undo
1405 1583
 	{
1406 1584
 		$site_module_info = Context::get('site_module_info');
1407 1585
 		$logged_info = Context::get('logged_info');
1408
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1586
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1587
+			return new Object(-1,'msg_invalid_request');
1588
+		}
1409 1589
 
1410 1590
 		$oMemberModel = getModel('member');
1411 1591
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1424,13 +1604,17 @@  discard block
 block discarded – undo
1424 1604
 	{
1425 1605
 		$site_module_info = Context::get('site_module_info');
1426 1606
 		$logged_info = Context::get('logged_info');
1427
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1607
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1608
+			return new Object(-1,'msg_invalid_request');
1609
+		}
1428 1610
 
1429 1611
 		$args = new stdClass;
1430 1612
 		$args->site_srl= $site_module_info->site_srl;
1431 1613
 		$args->member_srl = $logged_info->member_srl;
1432 1614
 		$output = executeQuery('member.deleteMembersGroup', $args);
1433
-		if(!$output->toBool()) return $output;
1615
+		if(!$output->toBool()) {
1616
+			return $output;
1617
+		}
1434 1618
 		$this->setMessage('success_deleted');
1435 1619
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1436 1620
 	}
@@ -1444,17 +1628,37 @@  discard block
 block discarded – undo
1444 1628
 	 */
1445 1629
 	function setMemberConfig($args)
1446 1630
 	{
1447
-		if(!$args->skin) $args->skin = "default";
1448
-		if(!$args->colorset) $args->colorset = "white";
1449
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1450
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1451
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1631
+		if(!$args->skin) {
1632
+			$args->skin = "default";
1633
+		}
1634
+		if(!$args->colorset) {
1635
+			$args->colorset = "white";
1636
+		}
1637
+		if(!$args->editor_skin) {
1638
+			$args->editor_skin= "ckeditor";
1639
+		}
1640
+		if(!$args->editor_colorset) {
1641
+			$args->editor_colorset = "moono";
1642
+		}
1643
+		if($args->enable_join!='Y') {
1644
+			$args->enable_join = 'N';
1645
+		}
1452 1646
 		$args->enable_openid= 'N';
1453
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1454
-		if($args->image_name!='Y') $args->image_name = 'N';
1455
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1456
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1457
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1647
+		if($args->profile_image !='Y') {
1648
+			$args->profile_image = 'N';
1649
+		}
1650
+		if($args->image_name!='Y') {
1651
+			$args->image_name = 'N';
1652
+		}
1653
+		if($args->image_mark!='Y') {
1654
+			$args->image_mark = 'N';
1655
+		}
1656
+		if($args->group_image_mark!='Y') {
1657
+			$args->group_image_mark = 'N';
1658
+		}
1659
+		if(!trim(strip_tags($args->agreement))) {
1660
+			$args->agreement = null;
1661
+		}
1458 1662
 		$args->limit_day = (int)$args->limit_day;
1459 1663
 
1460 1664
 		$agreement = trim($args->agreement);
@@ -1462,7 +1666,9 @@  discard block
 block discarded – undo
1462 1666
 
1463 1667
 		$oModuleController = getController('module');
1464 1668
 		$output = $oModuleController->insertModuleConfig('member',$args);
1465
-		if(!$output->toBool()) return $output;
1669
+		if(!$output->toBool()) {
1670
+			return $output;
1671
+		}
1466 1672
 
1467 1673
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1468 1674
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1487,7 +1693,9 @@  discard block
 block discarded – undo
1487 1693
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1488 1694
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1489 1695
 
1490
-		if(!$check_signature) return FileHandler::removeFile($filename);
1696
+		if(!$check_signature) {
1697
+			return FileHandler::removeFile($filename);
1698
+		}
1491 1699
 
1492 1700
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1493 1701
 		FileHandler::makeDir($path);
@@ -1521,7 +1729,9 @@  discard block
 block discarded – undo
1521 1729
 		$args = new stdClass();
1522 1730
 		$args->member_srl = $member_srl;
1523 1731
 		$args->group_srl = $group_srl;
1524
-		if($site_srl) $args->site_srl = $site_srl;
1732
+		if($site_srl) {
1733
+			$args->site_srl = $site_srl;
1734
+		}
1525 1735
 
1526 1736
 		// Add
1527 1737
 		$output = executeQuery('member.addMemberToGroup',$args);
@@ -1547,15 +1757,21 @@  discard block
 block discarded – undo
1547 1757
 		$obj->member_srl = implode(',',$args->member_srl);
1548 1758
 
1549 1759
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1550
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1760
+		if($output->data) {
1761
+			foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1762
+		}
1551 1763
 
1552 1764
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1553
-		if(!$output->toBool()) return $output;
1765
+		if(!$output->toBool()) {
1766
+			return $output;
1767
+		}
1554 1768
 
1555 1769
 		$inserted_members = array();
1556 1770
 		foreach($args->member_srl as $key => $val)
1557 1771
 		{
1558
-			if($inserted_members[$val]) continue;
1772
+			if($inserted_members[$val]) {
1773
+				continue;
1774
+			}
1559 1775
 			$inserted_members[$val] = true;
1560 1776
 
1561 1777
 			unset($obj);
@@ -1565,7 +1781,9 @@  discard block
 block discarded – undo
1565 1781
 			$obj->site_srl = $args->site_srl;
1566 1782
 			$obj->regdate = $date[$obj->member_srl];
1567 1783
 			$output = executeQuery('member.addMemberToGroup', $obj);
1568
-			if(!$output->toBool()) return $output;
1784
+			if(!$output->toBool()) {
1785
+				return $output;
1786
+			}
1569 1787
 
1570 1788
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1571 1789
 		}
@@ -1627,8 +1845,7 @@  discard block
 block discarded – undo
1627 1845
 				if($config->identifier == 'user_id')
1628 1846
 				{
1629 1847
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1630
-				}
1631
-				else
1848
+				} else
1632 1849
 				{
1633 1850
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1634 1851
 				}
@@ -1637,8 +1854,7 @@  discard block
 block discarded – undo
1637 1854
 					$do_auto_login = true;
1638 1855
 				}
1639 1856
 
1640
-			}
1641
-			else
1857
+			} else
1642 1858
 			{
1643 1859
 				$do_auto_login = true;
1644 1860
 			}
@@ -1647,8 +1863,7 @@  discard block
 block discarded – undo
1647 1863
 		if($do_auto_login)
1648 1864
 		{
1649 1865
 			$output = $this->doLogin($user_id);
1650
-		}
1651
-		else
1866
+		} else
1652 1867
 		{
1653 1868
 			executeQuery('member.deleteAutologin', $args);
1654 1869
 			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
@@ -1667,13 +1882,17 @@  discard block
 block discarded – undo
1667 1882
 	function doLogin($user_id, $password = '', $keep_signed = false)
1668 1883
 	{
1669 1884
 		$user_id = strtolower($user_id);
1670
-		if(!$user_id) return new Object(-1, 'null_user_id');
1885
+		if(!$user_id) {
1886
+			return new Object(-1, 'null_user_id');
1887
+		}
1671 1888
 		// Call a trigger before log-in (before)
1672 1889
 		$trigger_obj = new stdClass();
1673 1890
 		$trigger_obj->user_id = $user_id;
1674 1891
 		$trigger_obj->password = $password;
1675 1892
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1676
-		if(!$trigger_output->toBool()) return $trigger_output;
1893
+		if(!$trigger_output->toBool()) {
1894
+			return $trigger_output;
1895
+		}
1677 1896
 		// Create a member model object
1678 1897
 		$oMemberModel = getModel('member');
1679 1898
 
@@ -1688,15 +1907,18 @@  discard block
 block discarded – undo
1688 1907
 			// Get user_id information
1689 1908
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1690 1909
 			// Set an invalid user if no value returned
1691
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1910
+			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) {
1911
+				return $this->recordLoginError(-1, 'invalid_email_address');
1912
+			}
1692 1913
 
1693
-		}
1694
-		else
1914
+		} else
1695 1915
 		{
1696 1916
 			// Get user_id information
1697 1917
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1698 1918
 			// Set an invalid user if no value returned
1699
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1919
+			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) {
1920
+				return $this->recordLoginError(-1, 'invalid_user_id');
1921
+			}
1700 1922
 		}
1701 1923
 
1702 1924
 		$output = executeQuery('member.getLoginCountByIp', $args);
@@ -1708,14 +1930,18 @@  discard block
 block discarded – undo
1708 1930
 			if($term < $config->max_error_count_time)
1709 1931
 			{
1710 1932
 				$term = $config->max_error_count_time - $term;
1711
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1712
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1713
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1714
-				else $term = intval($term/86400).Context::getLang('unit_day');
1933
+				if($term < 60) {
1934
+					$term = intval($term).Context::getLang('unit_sec');
1935
+				} elseif(60 <= $term && $term < 3600) {
1936
+					$term = intval($term/60).Context::getLang('unit_min');
1937
+				} elseif(3600 <= $term && $term < 86400) {
1938
+					$term = intval($term/3600).Context::getLang('unit_hour');
1939
+				} else {
1940
+					$term = intval($term/86400).Context::getLang('unit_day');
1941
+				}
1715 1942
 
1716 1943
 				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1717
-			}
1718
-			else
1944
+			} else
1719 1945
 			{
1720 1946
 				$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1721 1947
 				$output = executeQuery('member.deleteLoginCountByIp', $args);
@@ -1742,7 +1968,9 @@  discard block
 block discarded – undo
1742 1968
 			return new Object(-1,'msg_user_denied');
1743 1969
 		}
1744 1970
 		// Notify if denied_date is less than the current time
1745
-		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")));
1971
+		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) {
1972
+			return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
1973
+		}
1746 1974
 		// Update the latest login time
1747 1975
 		$args->member_srl = $this->memberInfo->member_srl;
1748 1976
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1791,7 +2019,9 @@  discard block
 block discarded – undo
1791 2019
 		}
1792 2020
 		// Call a trigger after successfully log-in (after)
1793 2021
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1794
-		if(!$trigger_output->toBool()) return $trigger_output;
2022
+		if(!$trigger_output->toBool()) {
2023
+			return $trigger_output;
2024
+		}
1795 2025
 		// When user checked to use auto-login
1796 2026
 		if($keep_signed)
1797 2027
 		{
@@ -1805,7 +2035,9 @@  discard block
 block discarded – undo
1805 2035
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1806 2036
 			executeQuery('member.deleteAutologin', $autologin_args);
1807 2037
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1808
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000);
2038
+			if($autologin_output->toBool()) {
2039
+				setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000);
2040
+			}
1809 2041
 		}
1810 2042
 		if($this->memberInfo->is_admin == 'Y')
1811 2043
 		{
@@ -1894,7 +2126,9 @@  discard block
 block discarded – undo
1894 2126
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
1895 2127
 	{
1896 2128
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
1897
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
2129
+		if(!is_array($member_popup_menu_list)) {
2130
+			$member_popup_menu_list = array();
2131
+		}
1898 2132
 
1899 2133
 		$obj = new stdClass;
1900 2134
 		$obj->url = $url;
@@ -1913,35 +2147,54 @@  discard block
 block discarded – undo
1913 2147
 	{
1914 2148
 		// Call a trigger (before)
1915 2149
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
1916
-		if(!$output->toBool()) return $output;
2150
+		if(!$output->toBool()) {
2151
+			return $output;
2152
+		}
1917 2153
 		// Terms and Conditions portion of the information set up by members reaffirmed
1918 2154
 		$oModuleModel = getModel('module');
1919 2155
 		$config = $oModuleModel->getModuleConfig('member');
1920 2156
 
1921 2157
 		$logged_info = Context::get('logged_info');
1922 2158
 		// If the date of the temporary restrictions limit further information on the date of
1923
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2159
+		if($config->limit_day) {
2160
+			$args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2161
+		}
1924 2162
 
1925 2163
 		$args->member_srl = getNextSequence();
1926 2164
 		$args->list_order = -1 * $args->member_srl;
1927 2165
 
1928 2166
 		// Execute insert or update depending on the value of member_srl
1929
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2167
+		if(!$args->user_id) {
2168
+			$args->user_id = 't'.$args->member_srl;
2169
+		}
1930 2170
 		// Enter the user's identity changed to lowercase
1931
-		else $args->user_id = strtolower($args->user_id);
1932
-		if(!$args->user_name) $args->user_name = $args->member_srl;
1933
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
2171
+		else {
2172
+			$args->user_id = strtolower($args->user_id);
2173
+		}
2174
+		if(!$args->user_name) {
2175
+			$args->user_name = $args->member_srl;
2176
+		}
2177
+		if(!$args->nick_name) {
2178
+			$args->nick_name = $args->member_srl;
2179
+		}
1934 2180
 
1935 2181
 		// Control of essential parameters
1936
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
1937
-		if($args->denied!='Y') $args->denied = 'N';
1938
-		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y';
2182
+		if($args->allow_mailing!='Y') {
2183
+			$args->allow_mailing = 'N';
2184
+		}
2185
+		if($args->denied!='Y') {
2186
+			$args->denied = 'N';
2187
+		}
2188
+		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) {
2189
+			$args->allow_message = 'Y';
2190
+		}
1939 2191
 
1940 2192
 		if($logged_info->is_admin == 'Y')
1941 2193
 		{
1942
-			if($args->is_admin!='Y') $args->is_admin = 'N';
1943
-		}
1944
-		else
2194
+			if($args->is_admin!='Y') {
2195
+				$args->is_admin = 'N';
2196
+			}
2197
+		} else
1945 2198
 		{
1946 2199
 			unset($args->is_admin);
1947 2200
 		}
@@ -1954,8 +2207,12 @@  discard block
 block discarded – undo
1954 2207
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1955 2208
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1956 2209
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1957
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
1958
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
2210
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) {
2211
+			$args->homepage = 'http://'.$args->homepage;
2212
+		}
2213
+		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) {
2214
+			$args->blog = 'http://'.$args->blog;
2215
+		}
1959 2216
 
1960 2217
 		// Create a model object
1961 2218
 		$oMemberModel = getModel('member');
@@ -1969,8 +2226,7 @@  discard block
 block discarded – undo
1969 2226
 				return new Object(-1, $message[$config->password_strength]);
1970 2227
 			}
1971 2228
 			$args->password = $oMemberModel->hashPassword($args->password);
1972
-		}
1973
-		elseif(!$args->password)
2229
+		} elseif(!$args->password)
1974 2230
 		{
1975 2231
 			unset($args->password);
1976 2232
 		}
@@ -2011,8 +2267,12 @@  discard block
 block discarded – undo
2011 2267
 		// Insert data into the DB
2012 2268
 		$args->list_order = -1 * $args->member_srl;
2013 2269
 
2014
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2015
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2270
+		if(!$args->user_id) {
2271
+			$args->user_id = 't'.$args->member_srl;
2272
+		}
2273
+		if(!$args->user_name) {
2274
+			$args->user_name = $args->member_srl;
2275
+		}
2016 2276
 
2017 2277
 		$oDB = &DB::getInstance();
2018 2278
 		$oDB->begin();
@@ -2024,8 +2284,11 @@  discard block
 block discarded – undo
2024 2284
 			return $output;
2025 2285
 		}
2026 2286
 
2027
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2028
-		else $group_srl_list = explode('|@|', $args->group_srl_list);
2287
+		if(is_array($args->group_srl_list)) {
2288
+			$group_srl_list = $args->group_srl_list;
2289
+		} else {
2290
+			$group_srl_list = explode('|@|', $args->group_srl_list);
2291
+		}
2029 2292
 		// If no value is entered the default group, the value of group registration
2030 2293
 		if(!$args->group_srl_list)
2031 2294
 		{
@@ -2042,8 +2305,7 @@  discard block
 block discarded – undo
2042 2305
 				}
2043 2306
 			}
2044 2307
 			// If the value is the value of the group entered the group registration
2045
-		}
2046
-		else
2308
+		} else
2047 2309
 		{
2048 2310
 			for($i=0;$i<count($group_srl_list);$i++)
2049 2311
 			{
@@ -2104,27 +2366,39 @@  discard block
 block discarded – undo
2104 2366
 	{
2105 2367
 		// Call a trigger (before)
2106 2368
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2107
-		if(!$output->toBool()) return $output;
2369
+		if(!$output->toBool()) {
2370
+			return $output;
2371
+		}
2108 2372
 		// Create a model object
2109 2373
 		$oMemberModel = getModel('member');
2110 2374
 
2111 2375
 		$logged_info = Context::get('logged_info');
2112 2376
 		// Get what you want to modify the original information
2113
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2377
+		if(!$this->memberInfo) {
2378
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2379
+		}
2114 2380
 		// Control of essential parameters
2115
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2116
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2381
+		if($args->allow_mailing!='Y') {
2382
+			$args->allow_mailing = 'N';
2383
+		}
2384
+		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) {
2385
+			$args->allow_message = 'Y';
2386
+		}
2117 2387
 
2118 2388
 		if($logged_info->is_admin == 'Y')
2119 2389
 		{
2120
-			if($args->denied!='Y') $args->denied = 'N';
2121
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2122
-		}
2123
-		else
2390
+			if($args->denied!='Y') {
2391
+				$args->denied = 'N';
2392
+			}
2393
+			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) {
2394
+				$args->is_admin = 'N';
2395
+			}
2396
+		} else
2124 2397
 		{
2125 2398
 			unset($args->is_admin);
2126
-			if($is_admin == false)
2127
-				unset($args->denied);
2399
+			if($is_admin == false) {
2400
+							unset($args->denied);
2401
+			}
2128 2402
 			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2129 2403
 			{
2130 2404
 				return $this->stop('msg_invalid_request');
@@ -2132,13 +2406,19 @@  discard block
 block discarded – undo
2132 2406
 		}
2133 2407
 
2134 2408
 		// Sanitize user ID, username, nickname, homepage, blog
2135
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2409
+		if($args->user_id) {
2410
+			$args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2411
+		}
2136 2412
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2137 2413
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2138 2414
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2139 2415
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2140
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2141
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2416
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) {
2417
+			$args->homepage = 'http://'.$args->homepage;
2418
+		}
2419
+		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) {
2420
+			$args->blog = 'http://'.$args->blog;
2421
+		}
2142 2422
 
2143 2423
 		// check member identifier form
2144 2424
 		$config = $oMemberModel->getMemberConfig();
@@ -2155,8 +2435,7 @@  discard block
 block discarded – undo
2155 2435
 				return new Object(-1,'msg_exists_email_address');
2156 2436
 			}
2157 2437
 			$args->email_address = $orgMemberInfo->email_address;
2158
-		}
2159
-		else
2438
+		} else
2160 2439
 		{
2161 2440
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2162 2441
 			if($member_srl && $args->member_srl != $member_srl)
@@ -2213,17 +2492,26 @@  discard block
 block discarded – undo
2213 2492
 				return new Object(-1, $message[$config->password_strength]);
2214 2493
 			}
2215 2494
 			$args->password = $oMemberModel->hashPassword($args->password);
2216
-		}
2217
-		else
2495
+		} else
2218 2496
 		{
2219 2497
 			$args->password = $orgMemberInfo->password;
2220 2498
 		}
2221 2499
 
2222
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2223
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2224
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2225
-		if(!$args->description) $args->description = $orgMemberInfo->description;
2226
-		if(!$args->birthday) $args->birthday = '';
2500
+		if(!$args->user_name) {
2501
+			$args->user_name = $orgMemberInfo->user_name;
2502
+		}
2503
+		if(!$args->user_id) {
2504
+			$args->user_id = $orgMemberInfo->user_id;
2505
+		}
2506
+		if(!$args->nick_name) {
2507
+			$args->nick_name = $orgMemberInfo->nick_name;
2508
+		}
2509
+		if(!$args->description) {
2510
+			$args->description = $orgMemberInfo->description;
2511
+		}
2512
+		if(!$args->birthday) {
2513
+			$args->birthday = '';
2514
+		}
2227 2515
 
2228 2516
 		$output = executeQuery('member.updateMember', $args);
2229 2517
 
@@ -2235,8 +2523,11 @@  discard block
 block discarded – undo
2235 2523
 
2236 2524
 		if($args->group_srl_list)
2237 2525
 		{
2238
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2239
-			else $group_srl_list = explode('|@|', $args->group_srl_list);
2526
+			if(is_array($args->group_srl_list)) {
2527
+				$group_srl_list = $args->group_srl_list;
2528
+			} else {
2529
+				$group_srl_list = explode('|@|', $args->group_srl_list);
2530
+			}
2240 2531
 			// If the group information, group information changes
2241 2532
 			if(count($group_srl_list) > 0)
2242 2533
 			{
@@ -2279,7 +2570,9 @@  discard block
 block discarded – undo
2279 2570
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2280 2571
 
2281 2572
 		// Save Session
2282
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2573
+		if(!$this->memberInfo) {
2574
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2575
+		}
2283 2576
 		$logged_info = Context::get('logged_info');
2284 2577
 
2285 2578
 		$output->add('member_srl', $args->member_srl);
@@ -2305,8 +2598,7 @@  discard block
 block discarded – undo
2305 2598
 			}
2306 2599
 
2307 2600
 			$args->password = $oMemberModel->hashPassword($args->password);
2308
-		}
2309
-		else if($args->hashed_password)
2601
+		} else if($args->hashed_password)
2310 2602
 		{
2311 2603
 			$args->password = $args->hashed_password;
2312 2604
 		}
@@ -2331,7 +2623,9 @@  discard block
 block discarded – undo
2331 2623
 		$trigger_obj = new stdClass();
2332 2624
 		$trigger_obj->member_srl = $member_srl;
2333 2625
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2334
-		if(!$output->toBool()) return $output;
2626
+		if(!$output->toBool()) {
2627
+			return $output;
2628
+		}
2335 2629
 		// Create a model object
2336 2630
 		$oMemberModel = getModel('member');
2337 2631
 		// Bringing the user's information
@@ -2340,9 +2634,13 @@  discard block
 block discarded – undo
2340 2634
 			$columnList = array('member_srl', 'is_admin');
2341 2635
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2342 2636
 		}
2343
-		if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2637
+		if(!$this->memberInfo) {
2638
+			return new Object(-1, 'msg_not_exists_member');
2639
+		}
2344 2640
 		// If managers can not be deleted
2345
-		if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2641
+		if($this->memberInfo->is_admin == 'Y') {
2642
+			return new Object(-1, 'msg_cannot_delete_admin');
2643
+		}
2346 2644
 
2347 2645
 		$oDB = &DB::getInstance();
2348 2646
 		$oDB->begin();
@@ -2406,7 +2704,9 @@  discard block
 block discarded – undo
2406 2704
 	 */
2407 2705
 	function destroySessionInfo()
2408 2706
 	{
2409
-		if(!$_SESSION || !is_array($_SESSION)) return;
2707
+		if(!$_SESSION || !is_array($_SESSION)) {
2708
+			return;
2709
+		}
2410 2710
 
2411 2711
 		$memberInfo = Context::get('logged_info');
2412 2712
 		$memberSrl = $memberInfo->member_srl;
@@ -2445,8 +2745,9 @@  discard block
 block discarded – undo
2445 2745
 		}
2446 2746
 		$maxLevel = 0;
2447 2747
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2448
-		if(count($resultGroup) > 0)
2449
-			$maxLevel = max(array_flip($resultGroup));
2748
+		if(count($resultGroup) > 0) {
2749
+					$maxLevel = max(array_flip($resultGroup));
2750
+		}
2450 2751
 
2451 2752
 		if($maxLevel > 0)
2452 2753
 		{
@@ -2463,16 +2764,22 @@  discard block
 block discarded – undo
2463 2764
 
2464 2765
 	function procMemberModifyEmailAddress()
2465 2766
 	{
2466
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2767
+		if(!Context::get('is_logged')) {
2768
+			return $this->stop('msg_not_logged');
2769
+		}
2467 2770
 
2468 2771
 		$member_info = Context::get('logged_info');
2469 2772
 		$newEmail = Context::get('email_address');
2470 2773
 
2471
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2774
+		if(!$newEmail) {
2775
+			return $this->stop('msg_invalid_request');
2776
+		}
2472 2777
 
2473 2778
 		$oMemberModel = getModel('member');
2474 2779
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2475
-		if($member_srl) return new Object(-1,'msg_exists_email_address');
2780
+		if($member_srl) {
2781
+			return new Object(-1,'msg_exists_email_address');
2782
+		}
2476 2783
 
2477 2784
 		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2478 2785
 		{
@@ -2500,7 +2807,9 @@  discard block
 block discarded – undo
2500 2807
 		$member_config = $oModuleModel->getModuleConfig('member');
2501 2808
 
2502 2809
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2503
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2810
+		if(!is_dir($tpl_path)) {
2811
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2812
+		}
2504 2813
 
2505 2814
 		global $lang;
2506 2815
 
@@ -2536,7 +2845,9 @@  discard block
 block discarded – undo
2536 2845
 	{
2537 2846
 		$member_srl = Context::get('member_srl');
2538 2847
 		$auth_key = Context::get('auth_key');
2539
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2848
+		if(!$member_srl || !$auth_key) {
2849
+			return $this->stop('msg_invalid_request');
2850
+		}
2540 2851
 
2541 2852
 		// Test logs for finding password by user_id and authkey
2542 2853
 		$args = new stdClass;
@@ -2545,7 +2856,9 @@  discard block
 block discarded – undo
2545 2856
 		$output = executeQuery('member.getAuthMail', $args);
2546 2857
 		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2547 2858
 		{
2548
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2859
+			if(strlen($output->data->auth_key) !== strlen($auth_key)) {
2860
+				executeQuery('member.deleteAuthChangeEmailAddress', $args);
2861
+			}
2549 2862
 			return $this->stop('msg_invalid_modify_email_auth_key');
2550 2863
 		}
2551 2864
 
@@ -2554,7 +2867,9 @@  discard block
 block discarded – undo
2554 2867
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2555 2868
 
2556 2869
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2557
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2870
+		if(!$output->toBool()) {
2871
+			return $this->stop($output->getMessage());
2872
+		}
2558 2873
 
2559 2874
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2560 2875
 		executeQuery('member.deleteAuthChangeEmailAddress',$args);
@@ -2575,7 +2890,9 @@  discard block
 block discarded – undo
2575 2890
 	**/
2576 2891
 	function triggerGetDocumentMenu(&$menu_list)
2577 2892
 	{
2578
-		if(!Context::get('is_logged')) return new Object();
2893
+		if(!Context::get('is_logged')) {
2894
+			return new Object();
2895
+		}
2579 2896
 
2580 2897
 		$logged_info = Context::get('logged_info');
2581 2898
 		$document_srl = Context::get('target_srl');
@@ -2586,8 +2903,12 @@  discard block
 block discarded – undo
2586 2903
 		$member_srl = $oDocument->get('member_srl');
2587 2904
 		$module_srl = $oDocument->get('module_srl');
2588 2905
 
2589
-		if(!$member_srl) return new Object();
2590
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2906
+		if(!$member_srl) {
2907
+			return new Object();
2908
+		}
2909
+		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
2910
+			return new Object();
2911
+		}
2591 2912
 
2592 2913
 		$oDocumentController = getController('document');
2593 2914
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2605,7 +2926,9 @@  discard block
 block discarded – undo
2605 2926
 	**/
2606 2927
 	function triggerGetCommentMenu(&$menu_list)
2607 2928
 	{
2608
-		if(!Context::get('is_logged')) return new Object();
2929
+		if(!Context::get('is_logged')) {
2930
+			return new Object();
2931
+		}
2609 2932
 
2610 2933
 		$logged_info = Context::get('logged_info');
2611 2934
 		$comment_srl = Context::get('target_srl');
@@ -2616,8 +2939,12 @@  discard block
 block discarded – undo
2616 2939
 		$module_srl = $oComment->get('module_srl');
2617 2940
 		$member_srl = $oComment->get('member_srl');
2618 2941
 
2619
-		if(!$member_srl) return new Object();
2620
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2942
+		if(!$member_srl) {
2943
+			return new Object();
2944
+		}
2945
+		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
2946
+			return new Object();
2947
+		}
2621 2948
 
2622 2949
 		$oCommentController = getController('comment');
2623 2950
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2633,7 +2960,9 @@  discard block
 block discarded – undo
2633 2960
 	**/
2634 2961
 	function procMemberSpammerManage()
2635 2962
 	{
2636
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
2963
+		if(!Context::get('is_logged')) {
2964
+			return new Object(-1,'msg_not_permitted');
2965
+		}
2637 2966
 
2638 2967
 		$logged_info = Context::get('logged_info');
2639 2968
 		$member_srl = Context::get('member_srl');
@@ -2641,8 +2970,9 @@  discard block
 block discarded – undo
2641 2970
 		$cnt_loop = Context::get('cnt_loop');
2642 2971
 		$proc_type = Context::get('proc_type');
2643 2972
 		$isMoveToTrash = true;
2644
-		if($proc_type == "delete")
2645
-			$isMoveToTrash = false;
2973
+		if($proc_type == "delete") {
2974
+					$isMoveToTrash = false;
2975
+		}
2646 2976
 
2647 2977
 		// check grant
2648 2978
 		$oModuleModel = getModel('module');
@@ -2650,7 +2980,9 @@  discard block
 block discarded – undo
2650 2980
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2651 2981
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2652 2982
 
2653
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
2983
+		if(!$grant->manager) {
2984
+			return new Object(-1,'msg_not_permitted');
2985
+		}
2654 2986
 
2655 2987
 		$proc_msg = "";
2656 2988
 
@@ -2659,11 +2991,13 @@  discard block
 block discarded – undo
2659 2991
 
2660 2992
 		// delete or trash destination
2661 2993
 		// proc member
2662
-		if($cnt_loop == 1)
2663
-			$this->_spammerMember($member_srl);
2994
+		if($cnt_loop == 1) {
2995
+					$this->_spammerMember($member_srl);
2996
+		}
2664 2997
 		// proc document and comment
2665
-		elseif($cnt_loop>1)
2666
-			$this->_spammerDocuments($member_srl, $isMoveToTrash);
2998
+		elseif($cnt_loop>1) {
2999
+					$this->_spammerDocuments($member_srl, $isMoveToTrash);
3000
+		}
2667 3001
 
2668 3002
 		// get destination count
2669 3003
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
@@ -2671,13 +3005,16 @@  discard block
 block discarded – undo
2671 3005
 
2672 3006
 		$total_count = Context::get('total_count');
2673 3007
 		$remain_count = $cnt_document + $cnt_comment;
2674
-		if($cnt_loop == 1) $total_count = $remain_count;
3008
+		if($cnt_loop == 1) {
3009
+			$total_count = $remain_count;
3010
+		}
2675 3011
 
2676 3012
 		// get progress percent
2677
-		if($total_count > 0)
2678
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2679
-		else
2680
-			$progress = 100;
3013
+		if($total_count > 0) {
3014
+					$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
3015
+		} else {
3016
+					$progress = 100;
3017
+		}
2681 3018
 
2682 3019
 		$this->add('total_count', $total_count);
2683 3020
 		$this->add('remain_count', $remain_count);
@@ -2719,7 +3056,10 @@  discard block
 block discarded – undo
2719 3056
 		$args->nick_name = $member_info->nick_name;
2720 3057
 		$args->denied = "Y";
2721 3058
 		$args->description = trim( $member_info->description );
2722
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
3059
+		if( $args->description != "" ) {
3060
+			$args->description .= "\n";
3061
+		}
3062
+		// add new line
2723 3063
 
2724 3064
 		$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 . "]";
2725 3065
 
@@ -2764,8 +3104,11 @@  discard block
 block discarded – undo
2764 3104
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2765 3105
 			if($documentList) {
2766 3106
 				foreach($documentList as $v) {
2767
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2768
-					else $oDocumentController->deleteDocument($v->document_srl);
3107
+					if($isMoveToTrash) {
3108
+						$oDocumentController->moveDocumentToTrash($v);
3109
+					} else {
3110
+						$oDocumentController->deleteDocument($v->document_srl);
3111
+					}
2769 3112
 				}
2770 3113
 			}
2771 3114
 		}
Please login to merge, or discard this patch.
modules/member/member.model.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -297,6 +297,7 @@
 block discarded – undo
297 297
 
298 298
 	/**
299 299
 	 * @brief Return member information with member_srl
300
+	 * @param string $member_srl
300 301
 	 */
301 302
 	function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array())
302 303
 	{
Please login to merge, or discard this patch.
Spacing   +175 added lines, -175 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	{
27 27
 		static $member_config;
28 28
 
29
-		if($member_config)
29
+		if ($member_config)
30 30
 		{
31 31
 			return $member_config;
32 32
 		}
@@ -35,42 +35,42 @@  discard block
 block discarded – undo
35 35
 		$oModuleModel = getModel('module');
36 36
 		$config = $oModuleModel->getModuleConfig('member');
37 37
 
38
-		if(!$config->signupForm || !is_array($config->signupForm))
38
+		if (!$config->signupForm || !is_array($config->signupForm))
39 39
 		{
40 40
 			$oMemberAdminController = getAdminController('member');
41 41
 			$identifier = ($config->identifier) ? $config->identifier : 'email_address';
42 42
 			$config->signupForm = $oMemberAdminController->createSignupForm($identifier);
43 43
 		}
44 44
 		//for multi language
45
-		foreach($config->signupForm AS $key=>$value)
45
+		foreach ($config->signupForm AS $key=>$value)
46 46
 		{
47 47
 			$config->signupForm[$key]->title = ($value->isDefaultForm) ? Context::getLang($value->name) : $value->title;
48
-			if($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y';
49
-			if($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N';
48
+			if ($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y';
49
+			if ($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N';
50 50
 		}
51 51
 
52 52
 		// Get terms of user
53 53
 		$config->agreement = memberModel::_getAgreement();
54 54
 
55
-		if(!$config->webmaster_name) $config->webmaster_name = 'webmaster';
56
-		if(!$config->image_name_max_width) $config->image_name_max_width = 90;
57
-		if(!$config->image_name_max_height) $config->image_name_max_height = 20;
58
-		if(!$config->image_mark_max_width) $config->image_mark_max_width = 20;
59
-		if(!$config->image_mark_max_height) $config->image_mark_max_height = 20;
60
-		if(!$config->profile_image_max_width) $config->profile_image_max_width = 90;
61
-		if(!$config->profile_image_max_height) $config->profile_image_max_height = 90;
62
-		if(!$config->skin) $config->skin = 'default';
63
-		if(!$config->colorset) $config->colorset = 'white';
64
-		if(!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor';
65
-		if(!$config->group_image_mark) $config->group_image_mark = "N";
55
+		if (!$config->webmaster_name) $config->webmaster_name = 'webmaster';
56
+		if (!$config->image_name_max_width) $config->image_name_max_width = 90;
57
+		if (!$config->image_name_max_height) $config->image_name_max_height = 20;
58
+		if (!$config->image_mark_max_width) $config->image_mark_max_width = 20;
59
+		if (!$config->image_mark_max_height) $config->image_mark_max_height = 20;
60
+		if (!$config->profile_image_max_width) $config->profile_image_max_width = 90;
61
+		if (!$config->profile_image_max_height) $config->profile_image_max_height = 90;
62
+		if (!$config->skin) $config->skin = 'default';
63
+		if (!$config->colorset) $config->colorset = 'white';
64
+		if (!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor';
65
+		if (!$config->group_image_mark) $config->group_image_mark = "N";
66 66
 
67
-		if(!$config->identifier) $config->identifier = 'user_id';
67
+		if (!$config->identifier) $config->identifier = 'user_id';
68 68
 
69
-		if(!$config->max_error_count) $config->max_error_count = 10;
70
-		if(!$config->max_error_count_time) $config->max_error_count_time = 300;
69
+		if (!$config->max_error_count) $config->max_error_count = 10;
70
+		if (!$config->max_error_count_time) $config->max_error_count_time = 300;
71 71
 
72
-		if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor';
73
-		if(!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono';
72
+		if (!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor';
73
+		if (!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono';
74 74
 
75 75
 		$member_config = $config;
76 76
 
@@ -79,24 +79,24 @@  discard block
 block discarded – undo
79 79
 
80 80
 	function _getAgreement()
81 81
 	{
82
-		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
83
-		if(is_readable($agreement_file))
82
+		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt';
83
+		if (is_readable($agreement_file))
84 84
 		{
85 85
 			return FileHandler::readFile($agreement_file);
86 86
 		}
87 87
 
88 88
 		$db_info = Context::getDBInfo();
89
-		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . $db_info->lang_type . '.txt';
90
-		if(is_readable($agreement_file))
89
+		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.$db_info->lang_type.'.txt';
90
+		if (is_readable($agreement_file))
91 91
 		{
92 92
 			return FileHandler::readFile($agreement_file);
93 93
 		}
94 94
 
95 95
 		$lang_selected = Context::loadLangSelected();
96
-		foreach($lang_selected as $key => $val)
96
+		foreach ($lang_selected as $key => $val)
97 97
 		{
98
-			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . $key . '.txt';
99
-			if(is_readable($agreement_file))
98
+			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.$key.'.txt';
99
+			if (is_readable($agreement_file))
100 100
 			{
101 101
 				return FileHandler::readFile($agreement_file);
102 102
 			}
@@ -116,12 +116,12 @@  discard block
 block discarded – undo
116 116
 		$logged_info = Context::get('logged_info');
117 117
 		$act = Context::get('cur_act');
118 118
 		// When click user's own nickname
119
-		if($member_srl == $logged_info->member_srl) $member_info = $logged_info;
119
+		if ($member_srl == $logged_info->member_srl) $member_info = $logged_info;
120 120
 		// When click other's nickname
121 121
 		else $member_info = $this->getMemberInfoByMemberSrl($member_srl);
122 122
 
123 123
 		$member_srl = $member_info->member_srl;
124
-		if(!$member_srl) return;
124
+		if (!$member_srl) return;
125 125
 		// List variables
126 126
 		$user_id = $member_info->user_id;
127 127
 		$user_name = $member_info->user_name;
@@ -130,18 +130,18 @@  discard block
 block discarded – undo
130 130
 
131 131
 		$oMemberController = getController('member');
132 132
 		// Display member information (Don't display to non-logged user)
133
-		if($logged_info->member_srl)
133
+		if ($logged_info->member_srl)
134 134
 		{
135
-			$url = getUrl('','mid',$mid,'act','dispMemberInfo','member_srl',$member_srl);
136
-			$oMemberController->addMemberPopupMenu($url,'cmd_view_member_info',$icon_path,'self');
135
+			$url = getUrl('', 'mid', $mid, 'act', 'dispMemberInfo', 'member_srl', $member_srl);
136
+			$oMemberController->addMemberPopupMenu($url, 'cmd_view_member_info', $icon_path, 'self');
137 137
 		}
138 138
 		// When click other's nickname
139
-		if($member_srl != $logged_info->member_srl && $logged_info->member_srl)
139
+		if ($member_srl != $logged_info->member_srl && $logged_info->member_srl)
140 140
 		{
141 141
 			// Get email config
142
-			foreach($this->module_config->signupForm as $field)
142
+			foreach ($this->module_config->signupForm as $field)
143 143
 			{
144
-				if($field->name == 'email_address')
144
+				if ($field->name == 'email_address')
145 145
 				{
146 146
 					$email_config = $field;
147 147
 					break;
@@ -149,36 +149,36 @@  discard block
 block discarded – undo
149 149
 			}
150 150
 
151 151
 			// Send an email only if email address is public
152
-			if(($logged_info->is_admin == 'Y' || $email_config->isPublic == 'Y') && $member_info->email_address)
152
+			if (($logged_info->is_admin == 'Y' || $email_config->isPublic == 'Y') && $member_info->email_address)
153 153
 			{
154 154
 				$url = 'mailto:'.htmlspecialchars($member_info->email_address, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
155
-				$oMemberController->addMemberPopupMenu($url,'cmd_send_email',$icon_path);
155
+				$oMemberController->addMemberPopupMenu($url, 'cmd_send_email', $icon_path);
156 156
 			}
157 157
 		}
158 158
 		// View homepage info
159
-		if($member_info->homepage)
159
+		if ($member_info->homepage)
160 160
 			$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'homepage', '', 'blank');
161 161
 		// View blog info
162
-		if($member_info->blog)
162
+		if ($member_info->blog)
163 163
 			$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'blog', '', 'blank');
164 164
 		// Call a trigger (after)
165 165
 		ModuleHandler::triggerCall('member.getMemberMenu', 'after', $null);
166 166
 		// Display a menu for editting member info to a top administrator
167
-		if($logged_info->is_admin == 'Y')
167
+		if ($logged_info->is_admin == 'Y')
168 168
 		{
169
-			$url = getUrl('','module','admin','act','dispMemberAdminInsert','member_srl',$member_srl);
170
-			$oMemberController->addMemberPopupMenu($url,'cmd_manage_member_info',$icon_path,'MemberModifyInfo');
169
+			$url = getUrl('', 'module', 'admin', 'act', 'dispMemberAdminInsert', 'member_srl', $member_srl);
170
+			$oMemberController->addMemberPopupMenu($url, 'cmd_manage_member_info', $icon_path, 'MemberModifyInfo');
171 171
 
172
-			$url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','member_srl','search_keyword',$member_srl);
173
-			$oMemberController->addMemberPopupMenu($url,'cmd_trace_document',$icon_path,'TraceMemberDocument');
172
+			$url = getUrl('', 'module', 'admin', 'act', 'dispDocumentAdminList', 'search_target', 'member_srl', 'search_keyword', $member_srl);
173
+			$oMemberController->addMemberPopupMenu($url, 'cmd_trace_document', $icon_path, 'TraceMemberDocument');
174 174
 
175
-			$url = getUrl('','module','admin','act','dispCommentAdminList','search_target','member_srl','search_keyword',$member_srl);
176
-			$oMemberController->addMemberPopupMenu($url,'cmd_trace_comment',$icon_path,'TraceMemberComment');
175
+			$url = getUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'member_srl', 'search_keyword', $member_srl);
176
+			$oMemberController->addMemberPopupMenu($url, 'cmd_trace_comment', $icon_path, 'TraceMemberComment');
177 177
 		}
178 178
 		// Change a language of pop-up menu
179 179
 		$menus = Context::get('member_popup_menu_list');
180 180
 		$menus_count = count($menus);
181
-		for($i=0;$i<$menus_count;$i++)
181
+		for ($i = 0; $i < $menus_count; $i++)
182 182
 		{
183 183
 			$menus[$i]->str = Context::getLang($menus[$i]->str);
184 184
 		}
@@ -190,16 +190,16 @@  discard block
 block discarded – undo
190 190
 	 * @brief Check if logged-in
191 191
 	 */
192 192
 	function isLogged() {
193
-		if($_SESSION['is_logged'])
193
+		if ($_SESSION['is_logged'])
194 194
 		{
195
-			if(Mobile::isFromMobilePhone())
195
+			if (Mobile::isFromMobilePhone())
196 196
 			{
197 197
 				return true;
198 198
 			}
199
-			elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
199
+			elseif (filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
200 200
 			{
201 201
 				// IPv6: require same /48
202
-				if(strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0)
202
+				if (strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0)
203 203
 				{
204 204
 					return true;
205 205
 				}
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 			else
208 208
 			{
209 209
 				// IPv4: require same /24
210
-				if(ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8)
210
+				if (ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8)
211 211
 				{
212 212
 					return true;
213 213
 				}
@@ -224,23 +224,23 @@  discard block
 block discarded – undo
224 224
 	function getLoggedInfo()
225 225
 	{
226 226
 		// Return session info if session info is requested and the user is logged-in
227
-		if($this->isLogged())
227
+		if ($this->isLogged())
228 228
 		{
229 229
 			$logged_info = Context::get('logged_info');
230 230
 			// Admin/Group list defined depending on site_module_info
231 231
 			$site_module_info = Context::get('site_module_info');
232
-			if($site_module_info->site_srl)
232
+			if ($site_module_info->site_srl)
233 233
 			{
234 234
 				$logged_info->group_list = $this->getMemberGroups($logged_info->member_srl, $site_module_info->site_srl);
235 235
 				// Add is_site_admin bool variable into logged_info if site_administrator is
236 236
 				$oModuleModel = getModel('module');
237
-				if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true;
237
+				if ($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true;
238 238
 				else $logged_info->is_site_admin = false;
239 239
 			}
240 240
 			else
241 241
 			{
242 242
 				// Register a default group if the site doesn't have a member group
243
-				if(count($logged_info->group_list) === 0)
243
+				if (count($logged_info->group_list) === 0)
244 244
 				{
245 245
 					$default_group = $this->getDefaultGroup(0);
246 246
 					$oMemberController = getController('member');
@@ -263,13 +263,13 @@  discard block
 block discarded – undo
263 263
 	 */
264 264
 	function getMemberInfoByUserID($user_id, $columnList = array())
265 265
 	{
266
-		if(!$user_id) return;
266
+		if (!$user_id) return;
267 267
 
268 268
 		$args = new stdClass;
269 269
 		$args->user_id = $user_id;
270 270
 		$output = executeQuery('member.getMemberInfo', $args);
271
-		if(!$output->toBool()) return $output;
272
-		if(!$output->data) return;
271
+		if (!$output->toBool()) return $output;
272
+		if (!$output->data) return;
273 273
 
274 274
 		$member_info = $this->arrangeMemberInfo($output->data);
275 275
 
@@ -281,12 +281,12 @@  discard block
 block discarded – undo
281 281
 	 */
282 282
 	function getMemberInfoByEmailAddress($email_address)
283 283
 	{
284
-		if(!$email_address) return;
284
+		if (!$email_address) return;
285 285
 
286 286
 		$args = new stdClass();
287 287
 		
288
-		$db_info = Context::getDBInfo ();
289
-		if($db_info->master_db['db_type'] == "cubrid")
288
+		$db_info = Context::getDBInfo();
289
+		if ($db_info->master_db['db_type'] == "cubrid")
290 290
 		{
291 291
 			$args->email_address = strtolower($email_address);
292 292
 			$output = executeQuery('member.getMemberInfoByEmailAddressForCubrid', $args);
@@ -297,8 +297,8 @@  discard block
 block discarded – undo
297 297
 			$output = executeQuery('member.getMemberInfoByEmailAddress', $args);
298 298
 		}
299 299
 		
300
-		if(!$output->toBool()) return $output;
301
-		if(!$output->data) return;
300
+		if (!$output->toBool()) return $output;
301
+		if (!$output->data) return;
302 302
 
303 303
 		$member_info = $this->arrangeMemberInfo($output->data);
304 304
 		return $member_info;
@@ -309,36 +309,36 @@  discard block
 block discarded – undo
309 309
 	 */
310 310
 	function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array())
311 311
 	{
312
-		if(!$member_srl) return;
312
+		if (!$member_srl) return;
313 313
 
314 314
 		//columnList size zero... get full member info
315
-		if(!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0)
315
+		if (!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0)
316 316
 		{
317 317
 			$GLOBALS['__member_info__'][$member_srl] = false;
318 318
 
319 319
 			$oCacheHandler = CacheHandler::getInstance('object');
320
-			if($oCacheHandler->isSupport())
320
+			if ($oCacheHandler->isSupport())
321 321
 			{
322 322
 				$columnList = array();
323
-				$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
323
+				$object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl;
324 324
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
325 325
 				$GLOBALS['__member_info__'][$member_srl] = $oCacheHandler->get($cache_key);
326 326
 			}
327 327
 
328
-			if($GLOBALS['__member_info__'][$member_srl] === false)
328
+			if ($GLOBALS['__member_info__'][$member_srl] === false)
329 329
 			{
330 330
 				$args = new stdClass();
331 331
 				$args->member_srl = $member_srl;
332 332
 				$output = executeQuery('member.getMemberInfoByMemberSrl', $args, $columnList);
333
-				if(!$output->data) 
333
+				if (!$output->data) 
334 334
 				{
335
-					if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass);
335
+					if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass);
336 336
 					return;
337 337
 				}
338 338
 				$this->arrangeMemberInfo($output->data, $site_srl);
339 339
 
340 340
 				//insert in cache
341
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]);
341
+				if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]);
342 342
 			}
343 343
 		}
344 344
 
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 	 */
351 351
 	function arrangeMemberInfo($info, $site_srl = 0)
352 352
 	{
353
-		if(!$GLOBALS['__member_info__'][$info->member_srl])
353
+		if (!$GLOBALS['__member_info__'][$info->member_srl])
354 354
 		{
355 355
 			$oModuleModel = getModel('module');
356 356
 			$config = $oModuleModel->getModuleConfig('member');
@@ -359,25 +359,25 @@  discard block
 block discarded – undo
359 359
 			$info->profile_image = $this->getProfileImage($info->member_srl);
360 360
 			$info->image_name = $this->getImageName($info->member_srl);
361 361
 			$info->image_mark = $this->getImageMark($info->member_srl);
362
-			if($config->group_image_mark=='Y')
362
+			if ($config->group_image_mark == 'Y')
363 363
 			{
364
-				$info->group_mark = $this->getGroupImageMark($info->member_srl,$site_srl);
364
+				$info->group_mark = $this->getGroupImageMark($info->member_srl, $site_srl);
365 365
 			}
366 366
 			$info->signature = $this->getSignature($info->member_srl);
367 367
 			$info->group_list = $this->getMemberGroups($info->member_srl, $site_srl);
368 368
 
369 369
 			$extra_vars = unserialize($info->extra_vars);
370 370
 			unset($info->extra_vars);
371
-			if($extra_vars)
371
+			if ($extra_vars)
372 372
 			{
373
-				foreach($extra_vars as $key => $val)
373
+				foreach ($extra_vars as $key => $val)
374 374
 				{
375
-					if(!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val);
376
-					if(!$info->{$key}) $info->{$key} = $val;
375
+					if (!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val);
376
+					if (!$info->{$key}) $info->{$key} = $val;
377 377
 				}
378 378
 			}
379 379
 
380
-			if(strlen($info->find_account_answer) == 32 && preg_match('/[a-zA-Z0-9]+/', $info->find_account_answer))
380
+			if (strlen($info->find_account_answer) == 32 && preg_match('/[a-zA-Z0-9]+/', $info->find_account_answer))
381 381
 			{
382 382
 				$info->find_account_answer = null;
383 383
 			}
@@ -389,13 +389,13 @@  discard block
 block discarded – undo
389 389
 			$info->homepage = strip_tags($info->homepage);
390 390
 			$info->blog = strip_tags($info->blog);
391 391
 
392
-			if($extra_vars)
392
+			if ($extra_vars)
393 393
 			{
394
-				foreach($extra_vars as $key => $val)
394
+				foreach ($extra_vars as $key => $val)
395 395
 				{
396
-					if(is_array($val))
396
+					if (is_array($val))
397 397
 					{
398
-						$oSecurity->encodeHTML($key . '.');
398
+						$oSecurity->encodeHTML($key.'.');
399 399
 					}
400 400
 					else
401 401
 					{
@@ -406,12 +406,12 @@  discard block
 block discarded – undo
406 406
 
407 407
 			// Check format.
408 408
 			$oValidator = new Validator();
409
-			if(!$oValidator->applyRule('url', $info->homepage))
409
+			if (!$oValidator->applyRule('url', $info->homepage))
410 410
 			{
411 411
 				$info->homepage = '';
412 412
 			}
413 413
 
414
-			if(!$oValidator->applyRule('url', $info->blog))
414
+			if (!$oValidator->applyRule('url', $info->blog))
415 415
 			{
416 416
 				$info->blog = '';
417 417
 			}
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 	 */
461 461
 	function getLoggedMemberSrl()
462 462
 	{
463
-		if(!$this->isLogged()) return;
463
+		if (!$this->isLogged()) return;
464 464
 		return $_SESSION['member_srl'];
465 465
 	}
466 466
 
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 	 */
470 470
 	function getLoggedUserID()
471 471
 	{
472
-		if(!$this->isLogged()) return;
472
+		if (!$this->isLogged()) return;
473 473
 		$logged_info = Context::get('logged_info');
474 474
 		return $logged_info->user_id;
475 475
 	}
@@ -484,16 +484,16 @@  discard block
 block discarded – undo
484 484
 		// cache controll
485 485
 		$group_list = false;
486 486
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
487
-		if($oCacheHandler->isSupport())
487
+		if ($oCacheHandler->isSupport())
488 488
 		{
489
-			$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_'.$site_srl;
489
+			$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl;
490 490
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
491 491
 			$group_list = $oCacheHandler->get($cache_key);
492 492
 		}
493 493
 
494
-		if(!$member_groups[$member_srl][$site_srl] || $force_reload)
494
+		if (!$member_groups[$member_srl][$site_srl] || $force_reload)
495 495
 		{
496
-			if($group_list === false)
496
+			if ($group_list === false)
497 497
 			{
498 498
 				$args = new stdClass();
499 499
 				$args->member_srl = $member_srl;
@@ -501,11 +501,11 @@  discard block
 block discarded – undo
501 501
 				$output = executeQueryArray('member.getMemberGroups', $args);
502 502
 				$group_list = $output->data;
503 503
 				//insert in cache
504
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
504
+				if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
505 505
 			}
506
-			if(!$group_list) return array();
506
+			if (!$group_list) return array();
507 507
 
508
-			foreach($group_list as $group)
508
+			foreach ($group_list as $group)
509 509
 			{
510 510
 				$result[$group->group_srl] = $group->title;
511 511
 			}
@@ -519,14 +519,14 @@  discard block
 block discarded – undo
519 519
 	 */
520 520
 	function getMembersGroups($member_srls, $site_srl = 0)
521 521
 	{
522
-		$args->member_srls = implode(',',$member_srls);
522
+		$args->member_srls = implode(',', $member_srls);
523 523
 		$args->site_srl = $site_srl;
524 524
 		$args->sort_index = 'list_order';
525 525
 		$output = executeQueryArray('member.getMembersGroups', $args);
526
-		if(!$output->data) return array();
526
+		if (!$output->data) return array();
527 527
 
528 528
 		$result = array();
529
-		foreach($output->data as $key=>$val)
529
+		foreach ($output->data as $key=>$val)
530 530
 		{
531 531
 			$result[$val->member_srl][] = $val->title;
532 532
 		}
@@ -540,21 +540,21 @@  discard block
 block discarded – undo
540 540
 	{
541 541
 		$default_group = false;
542 542
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
543
-		if($oCacheHandler->isSupport())
543
+		if ($oCacheHandler->isSupport())
544 544
 		{
545 545
 			$columnList = array();
546
-			$object_key = 'default_group_' . $site_srl;
546
+			$object_key = 'default_group_'.$site_srl;
547 547
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
548 548
 			$default_group = $oCacheHandler->get($cache_key);
549 549
 		}
550 550
 
551
-		if($default_group === false)
551
+		if ($default_group === false)
552 552
 		{
553 553
 			$args = new stdClass();
554 554
 			$args->site_srl = $site_srl;
555 555
 			$output = executeQuery('member.getDefaultGroup', $args, $columnList);
556 556
 			$default_group = $output->data;
557
-			if($oCacheHandler->isSupport())
557
+			if ($oCacheHandler->isSupport())
558 558
 			{
559 559
 				$oCacheHandler->put($cache_key, $default_group);
560 560
 			}
@@ -588,25 +588,25 @@  discard block
 block discarded – undo
588 588
 	 */
589 589
 	function getGroups($site_srl = 0)
590 590
 	{
591
-		if(!$GLOBALS['__group_info__'][$site_srl])
591
+		if (!$GLOBALS['__group_info__'][$site_srl])
592 592
 		{
593 593
 			$result = array();
594 594
 
595
-			if(!isset($site_srl))
595
+			if (!isset($site_srl))
596 596
 			{
597 597
 				$site_srl = 0;
598 598
 			}
599 599
 
600 600
 			$group_list = false;
601 601
 			$oCacheHandler = CacheHandler::getInstance('object', null, true);
602
-			if($oCacheHandler->isSupport())
602
+			if ($oCacheHandler->isSupport())
603 603
 			{
604 604
 				$object_key = 'member_groups:site_'.$site_srl;
605 605
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
606 606
 				$group_list = $oCacheHandler->get($cache_key);
607 607
 			}
608 608
 
609
-			if($group_list === false)
609
+			if ($group_list === false)
610 610
 			{
611 611
 				$args = new stdClass();
612 612
 				$args->site_srl = $site_srl;
@@ -615,16 +615,16 @@  discard block
 block discarded – undo
615 615
 				$output = executeQueryArray('member.getGroups', $args);
616 616
 				$group_list = $output->data;
617 617
 				//insert in cache
618
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
618
+				if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
619 619
 			}
620 620
 
621
-			if(!$group_list)
621
+			if (!$group_list)
622 622
 			{
623 623
 				return array();
624 624
 			}
625 625
 
626 626
 
627
-			foreach($group_list as $val)
627
+			foreach ($group_list as $val)
628 628
 			{
629 629
 				$result[$val->group_srl] = $val;
630 630
 			}
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 		// Set to ignore if a super administrator.
656 656
 		$logged_info = Context::get('logged_info');
657 657
 
658
-		if(!$this->join_form_list)
658
+		if (!$this->join_form_list)
659 659
 		{
660 660
 			// Argument setting to sort list_order column
661 661
 			$args = new stdClass();
@@ -663,11 +663,11 @@  discard block
 block discarded – undo
663 663
 			$output = executeQuery('member.getJoinFormList', $args);
664 664
 			// NULL if output data deosn't exist
665 665
 			$join_form_list = $output->data;
666
-			if(!$join_form_list) return NULL;
666
+			if (!$join_form_list) return NULL;
667 667
 			// Need to unserialize because serialized array is inserted into DB in case of default_value
668
-			if(!is_array($join_form_list)) $join_form_list = array($join_form_list);
668
+			if (!is_array($join_form_list)) $join_form_list = array($join_form_list);
669 669
 			$join_form_count = count($join_form_list);
670
-			for($i=0;$i<$join_form_count;$i++)
670
+			for ($i = 0; $i < $join_form_count; $i++)
671 671
 			{
672 672
 				$join_form_list[$i]->column_name = strtolower($join_form_list[$i]->column_name);
673 673
 
@@ -679,10 +679,10 @@  discard block
 block discarded – undo
679 679
 				// Add language variable
680 680
 				$lang->extend_vars[$column_name] = $column_title;
681 681
 				// unserialize if the data type if checkbox, select and so on
682
-				if(in_array($column_type, array('checkbox','select','radio')))
682
+				if (in_array($column_type, array('checkbox', 'select', 'radio')))
683 683
 				{
684 684
 					$join_form_list[$i]->default_value = unserialize($default_value);
685
-					if(!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = '';
685
+					if (!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = '';
686 686
 				}
687 687
 				else
688 688
 				{
@@ -694,16 +694,16 @@  discard block
 block discarded – undo
694 694
 			$this->join_form_list = $list;
695 695
 		}
696 696
 		// Get object style if the filter_response is true
697
-		if($filter_response && count($this->join_form_list))
697
+		if ($filter_response && count($this->join_form_list))
698 698
 		{
699
-			foreach($this->join_form_list as $key => $val)
699
+			foreach ($this->join_form_list as $key => $val)
700 700
 			{
701
-				if($val->is_active != 'Y') continue;
701
+				if ($val->is_active != 'Y') continue;
702 702
 				unset($obj);
703 703
 				$obj->type = $val->column_type;
704 704
 				$obj->name = $val->column_name;
705 705
 				$obj->lang = $val->column_title;
706
-				if($logged_info->is_admin != 'Y') $obj->required = $val->required=='Y'?true:false;
706
+				if ($logged_info->is_admin != 'Y') $obj->required = $val->required == 'Y' ? true : false;
707 707
 				else $obj->required = false;
708 708
 				$filter_output[] = $obj;
709 709
 
@@ -730,15 +730,15 @@  discard block
 block discarded – undo
730 730
 		$args->sort_index = "list_order";
731 731
 		$output = executeQueryArray('member.getJoinFormList', $args);
732 732
 
733
-		if(!$output->toBool())
733
+		if (!$output->toBool())
734 734
 		{
735 735
 			return array();
736 736
 		}
737 737
 
738 738
 		$joinFormList = array();
739
-		foreach($output->data as $val)
739
+		foreach ($output->data as $val)
740 740
 		{
741
-			if($val->is_active != 'Y')
741
+			if ($val->is_active != 'Y')
742 742
 			{
743 743
 				continue;
744 744
 			}
@@ -755,20 +755,20 @@  discard block
 block discarded – undo
755 755
 	function getCombineJoinForm($member_info)
756 756
 	{
757 757
 		$extend_form_list = $this->getJoinFormlist();
758
-		if(!$extend_form_list) return;
758
+		if (!$extend_form_list) return;
759 759
 		// Member info is open only to an administrator and him/herself when is_private is true.
760 760
 		$logged_info = Context::get('logged_info');
761 761
 
762
-		foreach($extend_form_list as $srl => $item)
762
+		foreach ($extend_form_list as $srl => $item)
763 763
 		{
764 764
 			$column_name = $item->column_name;
765 765
 			$value = $member_info->{$column_name};
766 766
 
767 767
 			// Change values depening on the type of extend form
768
-			switch($item->column_type)
768
+			switch ($item->column_type)
769 769
 			{
770 770
 				case 'checkbox' :
771
-					if($value && !is_array($value)) $value = array($value);
771
+					if ($value && !is_array($value)) $value = array($value);
772 772
 					break;
773 773
 				case 'text' :
774 774
 				case 'homepage' :
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
 
783 783
 			$extend_form_list[$srl]->value = $value;
784 784
 
785
-			if($member_info->{'open_'.$column_name}=='Y') $extend_form_list[$srl]->is_opened = true;
785
+			if ($member_info->{'open_'.$column_name} == 'Y') $extend_form_list[$srl]->is_opened = true;
786 786
 			else $extend_form_list[$srl]->is_opened = false;
787 787
 		}
788 788
 		return $extend_form_list;
@@ -796,12 +796,12 @@  discard block
 block discarded – undo
796 796
 		$args->member_join_form_srl = $member_join_form_srl;
797 797
 		$output = executeQuery('member.getJoinForm', $args);
798 798
 		$join_form = $output->data;
799
-		if(!$join_form) return NULL;
799
+		if (!$join_form) return NULL;
800 800
 
801 801
 		$column_type = $join_form->column_type;
802 802
 		$default_value = $join_form->default_value;
803 803
 
804
-		if(in_array($column_type, array('checkbox','select','radio')))
804
+		if (in_array($column_type, array('checkbox', 'select', 'radio')))
805 805
 		{
806 806
 			$join_form->default_value = unserialize($default_value);
807 807
 		}
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
 	 */
819 819
 	function getDeniedIDList()
820 820
 	{
821
-		if(!$this->denied_id_list)
821
+		if (!$this->denied_id_list)
822 822
 		{
823 823
 			$args->sort_index = "list_order";
824 824
 			$args->page = Context::get('page');
@@ -834,14 +834,14 @@  discard block
 block discarded – undo
834 834
 	function getDeniedIDs()
835 835
 	{
836 836
 		$output = executeQueryArray('member.getDeniedIDs');
837
-		if(!$output->toBool()) return array();
837
+		if (!$output->toBool()) return array();
838 838
 		return $output->data;
839 839
 	}
840 840
 
841 841
 	function getDeniedNickNames()
842 842
 	{
843 843
 		$output = executeQueryArray('member.getDeniedNickNames');
844
-		if(!$output->toBool())
844
+		if (!$output->toBool())
845 845
 		{
846 846
 			return array();
847 847
 		}
@@ -857,7 +857,7 @@  discard block
 block discarded – undo
857 857
 		$args = new stdClass();
858 858
 		$args->user_id = $user_id;
859 859
 		$output = executeQuery('member.chkDeniedID', $args);
860
-		if($output->data->count) return true;
860
+		if ($output->data->count) return true;
861 861
 		return false;
862 862
 	}
863 863
 
@@ -869,8 +869,8 @@  discard block
 block discarded – undo
869 869
 		$args = new stdClass();
870 870
 		$args->nick_name = $nickName;
871 871
 		$output = executeQuery('member.chkDeniedNickName', $args);
872
-		if($output->data->count) return true;
873
-		if(!$output->toBool())
872
+		if ($output->data->count) return true;
873
+		if (!$output->toBool())
874 874
 		{
875 875
 			return true;
876 876
 		}
@@ -881,20 +881,20 @@  discard block
 block discarded – undo
881 881
 	 */
882 882
 	function getProfileImage($member_srl)
883 883
 	{
884
-		if(!isset($GLOBALS['__member_info__']['profile_image'][$member_srl]))
884
+		if (!isset($GLOBALS['__member_info__']['profile_image'][$member_srl]))
885 885
 		{
886 886
 			$GLOBALS['__member_info__']['profile_image'][$member_srl] = null;
887
-			$exts = array('gif','jpg','png');
888
-			for($i=0;$i<3;$i++)
887
+			$exts = array('gif', 'jpg', 'png');
888
+			for ($i = 0; $i < 3; $i++)
889 889
 			{
890 890
 				$image_name_file = sprintf('files/member_extra_info/profile_image/%s%d.%s', getNumberingPath($member_srl), $member_srl, $exts[$i]);
891
-				if(file_exists($image_name_file))
891
+				if (file_exists($image_name_file))
892 892
 				{
893 893
 					list($width, $height, $type, $attrs) = getimagesize($image_name_file);
894 894
 					$info = new stdClass();
895 895
 					$info->width = $width;
896 896
 					$info->height = $height;
897
-					$info->src = Context::getRequestUri().$image_name_file . '?' . date('YmdHis', filemtime($image_name_file));
897
+					$info->src = Context::getRequestUri().$image_name_file.'?'.date('YmdHis', filemtime($image_name_file));
898 898
 					$info->file = './'.$image_name_file;
899 899
 					$GLOBALS['__member_info__']['profile_image'][$member_srl] = $info;
900 900
 					break;
@@ -910,16 +910,16 @@  discard block
 block discarded – undo
910 910
 	 */
911 911
 	function getImageName($member_srl)
912 912
 	{
913
-		if(!isset($GLOBALS['__member_info__']['image_name'][$member_srl]))
913
+		if (!isset($GLOBALS['__member_info__']['image_name'][$member_srl]))
914 914
 		{
915 915
 			$image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl);
916
-			if(file_exists($image_name_file))
916
+			if (file_exists($image_name_file))
917 917
 			{
918 918
 				list($width, $height, $type, $attrs) = getimagesize($image_name_file);
919 919
 				$info = new stdClass;
920 920
 				$info->width = $width;
921 921
 				$info->height = $height;
922
-				$info->src = Context::getRequestUri().$image_name_file. '?' . date('YmdHis', filemtime($image_name_file));
922
+				$info->src = Context::getRequestUri().$image_name_file.'?'.date('YmdHis', filemtime($image_name_file));
923 923
 				$info->file = './'.$image_name_file;
924 924
 				$GLOBALS['__member_info__']['image_name'][$member_srl] = $info;
925 925
 			}
@@ -933,15 +933,15 @@  discard block
 block discarded – undo
933 933
 	 */
934 934
 	function getImageMark($member_srl)
935 935
 	{
936
-		if(!isset($GLOBALS['__member_info__']['image_mark'][$member_srl]))
936
+		if (!isset($GLOBALS['__member_info__']['image_mark'][$member_srl]))
937 937
 		{
938 938
 			$image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl);
939
-			if(file_exists($image_mark_file))
939
+			if (file_exists($image_mark_file))
940 940
 			{
941 941
 				list($width, $height, $type, $attrs) = getimagesize($image_mark_file);
942 942
 				$info->width = $width;
943 943
 				$info->height = $height;
944
-				$info->src = Context::getRequestUri().$image_mark_file . '?' . date('YmdHis', filemtime($image_mark_file));
944
+				$info->src = Context::getRequestUri().$image_mark_file.'?'.date('YmdHis', filemtime($image_mark_file));
945 945
 				$info->file = './'.$image_mark_file;
946 946
 				$GLOBALS['__member_info__']['image_mark'][$member_srl] = $info;
947 947
 			}
@@ -955,27 +955,27 @@  discard block
 block discarded – undo
955 955
 	/**
956 956
 	 * @brief Get the image mark of the group
957 957
 	 */
958
-	function getGroupImageMark($member_srl,$site_srl=0)
958
+	function getGroupImageMark($member_srl, $site_srl = 0)
959 959
 	{
960
-		if(!isset($GLOBALS['__member_info__']['group_image_mark'][$member_srl]))
960
+		if (!isset($GLOBALS['__member_info__']['group_image_mark'][$member_srl]))
961 961
 		{
962 962
 			$oModuleModel = getModel('module');
963 963
 			$config = $oModuleModel->getModuleConfig('member');
964
-			if($config->group_image_mark!='Y')
964
+			if ($config->group_image_mark != 'Y')
965 965
 			{
966 966
 				return null;
967 967
 			}
968
-			$member_group = $this->getMemberGroups($member_srl,$site_srl);
968
+			$member_group = $this->getMemberGroups($member_srl, $site_srl);
969 969
 			$groups_info = $this->getGroups($site_srl);
970
-			if(count($member_group) > 0 && is_array($member_group))
970
+			if (count($member_group) > 0 && is_array($member_group))
971 971
 			{
972 972
 				$memberGroups = array_keys($member_group);
973 973
 
974
-				foreach($groups_info as $group_srl=>$group_info)
974
+				foreach ($groups_info as $group_srl=>$group_info)
975 975
 				{
976
-					if(in_array($group_srl, $memberGroups))
976
+					if (in_array($group_srl, $memberGroups))
977 977
 					{
978
-						if($group_info->image_mark)
978
+						if ($group_info->image_mark)
979 979
 						{
980 980
 							$info = new stdClass();
981 981
 							$info->title = $group_info->title;
@@ -999,10 +999,10 @@  discard block
 block discarded – undo
999 999
 	 */
1000 1000
 	function getSignature($member_srl)
1001 1001
 	{
1002
-		if(!isset($GLOBALS['__member_info__']['signature'][$member_srl]))
1002
+		if (!isset($GLOBALS['__member_info__']['signature'][$member_srl]))
1003 1003
 		{
1004 1004
 			$filename = sprintf('files/member_extra_info/signature/%s%d.signature.php', getNumberingPath($member_srl), $member_srl);
1005
-			if(file_exists($filename))
1005
+			if (file_exists($filename))
1006 1006
 			{
1007 1007
 				$buff = FileHandler::readFile($filename);
1008 1008
 				$signature = preg_replace('/<\?.*?\?>/', '', $buff);
@@ -1020,10 +1020,10 @@  discard block
 block discarded – undo
1020 1020
 	 * @param int $member_srl Set this to member_srl when comparing a member's password (optional)
1021 1021
 	 * @return bool
1022 1022
 	 */
1023
-	function isValidPassword($hashed_password, $password_text, $member_srl=null)
1023
+	function isValidPassword($hashed_password, $password_text, $member_srl = null)
1024 1024
 	{
1025 1025
 		// False if no password in entered
1026
-		if(!$password_text)
1026
+		if (!$password_text)
1027 1027
 		{
1028 1028
 			return false;
1029 1029
 		}
@@ -1032,31 +1032,31 @@  discard block
 block discarded – undo
1032 1032
 		$oPassword = new Password();
1033 1033
 		$current_algorithm = $oPassword->checkAlgorithm($hashed_password);
1034 1034
 		$match = $oPassword->checkPassword($password_text, $hashed_password, $current_algorithm);
1035
-		if(!$match)
1035
+		if (!$match)
1036 1036
 		{
1037 1037
 			return false;
1038 1038
 		}
1039 1039
 		
1040 1040
 		// Update the encryption method if necessary
1041 1041
 		$config = $this->getMemberConfig();
1042
-		if($member_srl > 0 && $config->password_hashing_auto_upgrade != 'N')
1042
+		if ($member_srl > 0 && $config->password_hashing_auto_upgrade != 'N')
1043 1043
 		{
1044 1044
 			$need_upgrade = false;
1045 1045
 			
1046
-			if(!$need_upgrade)
1046
+			if (!$need_upgrade)
1047 1047
 			{
1048 1048
 				$required_algorithm = $oPassword->getCurrentlySelectedAlgorithm();
1049
-				if($required_algorithm !== $current_algorithm) $need_upgrade = true;
1049
+				if ($required_algorithm !== $current_algorithm) $need_upgrade = true;
1050 1050
 			}
1051 1051
 			
1052
-			if(!$need_upgrade)
1052
+			if (!$need_upgrade)
1053 1053
 			{
1054 1054
 				$required_work_factor = $oPassword->getWorkFactor();
1055 1055
 				$current_work_factor = $oPassword->checkWorkFactor($hashed_password);
1056
-				if($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true;
1056
+				if ($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true;
1057 1057
 			}
1058 1058
 			
1059
-			if($need_upgrade === true)
1059
+			if ($need_upgrade === true)
1060 1060
 			{
1061 1061
 				$args = new stdClass();
1062 1062
 				$args->member_srl = $member_srl;
@@ -1084,27 +1084,27 @@  discard block
 block discarded – undo
1084 1084
 	function checkPasswordStrength($password, $strength)
1085 1085
 	{
1086 1086
 		$logged_info = Context::get('logged_info');
1087
-		if($logged_info->is_admin == 'Y') return true;
1087
+		if ($logged_info->is_admin == 'Y') return true;
1088 1088
 		
1089
-		if($strength == NULL)
1089
+		if ($strength == NULL)
1090 1090
 		{
1091 1091
 			$config = $this->getMemberConfig();
1092
-			$strength = $config->password_strength?$config->password_strength:'normal';
1092
+			$strength = $config->password_strength ? $config->password_strength : 'normal';
1093 1093
 		}
1094 1094
 		
1095 1095
 		$length = strlen($password);
1096 1096
 		
1097 1097
 		switch ($strength) {
1098 1098
 			case 'high':
1099
-				if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false;
1099
+				if ($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false;
1100 1100
 				/* no break */
1101 1101
 				
1102 1102
 			case 'normal':
1103
-				if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false;
1103
+				if ($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false;
1104 1104
 				break;
1105 1105
 				
1106 1106
 			case 'low':
1107
-				if($length < 4) return false;
1107
+				if ($length < 4) return false;
1108 1108
 				break; 
1109 1109
 		}
1110 1110
 		
@@ -1115,11 +1115,11 @@  discard block
 block discarded – undo
1115 1115
 	{
1116 1116
 		$groupSrl = 0;
1117 1117
 		$output = $this->getGroups($site_srl);
1118
-		if(is_array($output))
1118
+		if (is_array($output))
1119 1119
 		{
1120
-			foreach($output AS $key=>$value)
1120
+			foreach ($output AS $key=>$value)
1121 1121
 			{
1122
-				if($value->is_admin == 'Y')
1122
+				if ($value->is_admin == 'Y')
1123 1123
 				{
1124 1124
 					$groupSrl = $value->group_srl;
1125 1125
 					break;
Please login to merge, or discard this patch.
Braces   +202 added lines, -83 removed lines patch added patch discarded remove patch
@@ -45,32 +45,68 @@  discard block
 block discarded – undo
45 45
 		foreach($config->signupForm AS $key=>$value)
46 46
 		{
47 47
 			$config->signupForm[$key]->title = ($value->isDefaultForm) ? Context::getLang($value->name) : $value->title;
48
-			if($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y';
49
-			if($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N';
48
+			if($config->signupForm[$key]->isPublic != 'N') {
49
+				$config->signupForm[$key]->isPublic = 'Y';
50
+			}
51
+			if($value->name == 'find_account_question') {
52
+				$config->signupForm[$key]->isPublic = 'N';
53
+			}
50 54
 		}
51 55
 
52 56
 		// Get terms of user
53 57
 		$config->agreement = memberModel::_getAgreement();
54 58
 
55
-		if(!$config->webmaster_name) $config->webmaster_name = 'webmaster';
56
-		if(!$config->image_name_max_width) $config->image_name_max_width = 90;
57
-		if(!$config->image_name_max_height) $config->image_name_max_height = 20;
58
-		if(!$config->image_mark_max_width) $config->image_mark_max_width = 20;
59
-		if(!$config->image_mark_max_height) $config->image_mark_max_height = 20;
60
-		if(!$config->profile_image_max_width) $config->profile_image_max_width = 90;
61
-		if(!$config->profile_image_max_height) $config->profile_image_max_height = 90;
62
-		if(!$config->skin) $config->skin = 'default';
63
-		if(!$config->colorset) $config->colorset = 'white';
64
-		if(!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor';
65
-		if(!$config->group_image_mark) $config->group_image_mark = "N";
59
+		if(!$config->webmaster_name) {
60
+			$config->webmaster_name = 'webmaster';
61
+		}
62
+		if(!$config->image_name_max_width) {
63
+			$config->image_name_max_width = 90;
64
+		}
65
+		if(!$config->image_name_max_height) {
66
+			$config->image_name_max_height = 20;
67
+		}
68
+		if(!$config->image_mark_max_width) {
69
+			$config->image_mark_max_width = 20;
70
+		}
71
+		if(!$config->image_mark_max_height) {
72
+			$config->image_mark_max_height = 20;
73
+		}
74
+		if(!$config->profile_image_max_width) {
75
+			$config->profile_image_max_width = 90;
76
+		}
77
+		if(!$config->profile_image_max_height) {
78
+			$config->profile_image_max_height = 90;
79
+		}
80
+		if(!$config->skin) {
81
+			$config->skin = 'default';
82
+		}
83
+		if(!$config->colorset) {
84
+			$config->colorset = 'white';
85
+		}
86
+		if(!$config->editor_skin || $config->editor_skin == 'default') {
87
+			$config->editor_skin = 'ckeditor';
88
+		}
89
+		if(!$config->group_image_mark) {
90
+			$config->group_image_mark = "N";
91
+		}
66 92
 
67
-		if(!$config->identifier) $config->identifier = 'user_id';
93
+		if(!$config->identifier) {
94
+			$config->identifier = 'user_id';
95
+		}
68 96
 
69
-		if(!$config->max_error_count) $config->max_error_count = 10;
70
-		if(!$config->max_error_count_time) $config->max_error_count_time = 300;
97
+		if(!$config->max_error_count) {
98
+			$config->max_error_count = 10;
99
+		}
100
+		if(!$config->max_error_count_time) {
101
+			$config->max_error_count_time = 300;
102
+		}
71 103
 
72
-		if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor';
73
-		if(!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono';
104
+		if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') {
105
+			$config->signature_editor_skin = 'ckeditor';
106
+		}
107
+		if(!$config->sel_editor_colorset) {
108
+			$config->sel_editor_colorset = 'moono';
109
+		}
74 110
 
75 111
 		$member_config = $config;
76 112
 
@@ -116,12 +152,18 @@  discard block
 block discarded – undo
116 152
 		$logged_info = Context::get('logged_info');
117 153
 		$act = Context::get('cur_act');
118 154
 		// When click user's own nickname
119
-		if($member_srl == $logged_info->member_srl) $member_info = $logged_info;
155
+		if($member_srl == $logged_info->member_srl) {
156
+			$member_info = $logged_info;
157
+		}
120 158
 		// When click other's nickname
121
-		else $member_info = $this->getMemberInfoByMemberSrl($member_srl);
159
+		else {
160
+			$member_info = $this->getMemberInfoByMemberSrl($member_srl);
161
+		}
122 162
 
123 163
 		$member_srl = $member_info->member_srl;
124
-		if(!$member_srl) return;
164
+		if(!$member_srl) {
165
+			return;
166
+		}
125 167
 		// List variables
126 168
 		$user_id = $member_info->user_id;
127 169
 		$user_name = $member_info->user_name;
@@ -156,11 +198,13 @@  discard block
 block discarded – undo
156 198
 			}
157 199
 		}
158 200
 		// View homepage info
159
-		if($member_info->homepage)
160
-			$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'homepage', '', 'blank');
201
+		if($member_info->homepage) {
202
+					$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'homepage', '', 'blank');
203
+		}
161 204
 		// View blog info
162
-		if($member_info->blog)
163
-			$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'blog', '', 'blank');
205
+		if($member_info->blog) {
206
+					$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'blog', '', 'blank');
207
+		}
164 208
 		// Call a trigger (after)
165 209
 		ModuleHandler::triggerCall('member.getMemberMenu', 'after', $null);
166 210
 		// Display a menu for editting member info to a top administrator
@@ -195,16 +239,14 @@  discard block
 block discarded – undo
195 239
 			if(Mobile::isFromMobilePhone())
196 240
 			{
197 241
 				return true;
198
-			}
199
-			elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
242
+			} elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
200 243
 			{
201 244
 				// IPv6: require same /48
202 245
 				if(strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0)
203 246
 				{
204 247
 					return true;
205 248
 				}
206
-			}
207
-			else
249
+			} else
208 250
 			{
209 251
 				// IPv4: require same /24
210 252
 				if(ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8)
@@ -234,10 +276,12 @@  discard block
 block discarded – undo
234 276
 				$logged_info->group_list = $this->getMemberGroups($logged_info->member_srl, $site_module_info->site_srl);
235 277
 				// Add is_site_admin bool variable into logged_info if site_administrator is
236 278
 				$oModuleModel = getModel('module');
237
-				if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true;
238
-				else $logged_info->is_site_admin = false;
239
-			}
240
-			else
279
+				if($oModuleModel->isSiteAdmin($logged_info)) {
280
+					$logged_info->is_site_admin = true;
281
+				} else {
282
+					$logged_info->is_site_admin = false;
283
+				}
284
+			} else
241 285
 			{
242 286
 				// Register a default group if the site doesn't have a member group
243 287
 				if(count($logged_info->group_list) === 0)
@@ -263,13 +307,19 @@  discard block
 block discarded – undo
263 307
 	 */
264 308
 	function getMemberInfoByUserID($user_id, $columnList = array())
265 309
 	{
266
-		if(!$user_id) return;
310
+		if(!$user_id) {
311
+			return;
312
+		}
267 313
 
268 314
 		$args = new stdClass;
269 315
 		$args->user_id = $user_id;
270 316
 		$output = executeQuery('member.getMemberInfo', $args);
271
-		if(!$output->toBool()) return $output;
272
-		if(!$output->data) return;
317
+		if(!$output->toBool()) {
318
+			return $output;
319
+		}
320
+		if(!$output->data) {
321
+			return;
322
+		}
273 323
 
274 324
 		$member_info = $this->arrangeMemberInfo($output->data);
275 325
 
@@ -281,7 +331,9 @@  discard block
 block discarded – undo
281 331
 	 */
282 332
 	function getMemberInfoByEmailAddress($email_address)
283 333
 	{
284
-		if(!$email_address) return;
334
+		if(!$email_address) {
335
+			return;
336
+		}
285 337
 
286 338
 		$args = new stdClass();
287 339
 		
@@ -290,15 +342,18 @@  discard block
 block discarded – undo
290 342
 		{
291 343
 			$args->email_address = strtolower($email_address);
292 344
 			$output = executeQuery('member.getMemberInfoByEmailAddressForCubrid', $args);
293
-		}
294
-		else
345
+		} else
295 346
 		{
296 347
 			$args->email_address = $email_address;
297 348
 			$output = executeQuery('member.getMemberInfoByEmailAddress', $args);
298 349
 		}
299 350
 		
300
-		if(!$output->toBool()) return $output;
301
-		if(!$output->data) return;
351
+		if(!$output->toBool()) {
352
+			return $output;
353
+		}
354
+		if(!$output->data) {
355
+			return;
356
+		}
302 357
 
303 358
 		$member_info = $this->arrangeMemberInfo($output->data);
304 359
 		return $member_info;
@@ -309,7 +364,9 @@  discard block
 block discarded – undo
309 364
 	 */
310 365
 	function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array())
311 366
 	{
312
-		if(!$member_srl) return;
367
+		if(!$member_srl) {
368
+			return;
369
+		}
313 370
 
314 371
 		//columnList size zero... get full member info
315 372
 		if(!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0)
@@ -332,13 +389,17 @@  discard block
 block discarded – undo
332 389
 				$output = executeQuery('member.getMemberInfoByMemberSrl', $args, $columnList);
333 390
 				if(!$output->data) 
334 391
 				{
335
-					if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass);
392
+					if($oCacheHandler->isSupport()) {
393
+						$oCacheHandler->put($cache_key, new stdClass);
394
+					}
336 395
 					return;
337 396
 				}
338 397
 				$this->arrangeMemberInfo($output->data, $site_srl);
339 398
 
340 399
 				//insert in cache
341
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]);
400
+				if($oCacheHandler->isSupport()) {
401
+					$oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]);
402
+				}
342 403
 			}
343 404
 		}
344 405
 
@@ -372,8 +433,12 @@  discard block
 block discarded – undo
372 433
 			{
373 434
 				foreach($extra_vars as $key => $val)
374 435
 				{
375
-					if(!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val);
376
-					if(!$info->{$key}) $info->{$key} = $val;
436
+					if(!is_array($val) && strpos($val, '|@|') !== FALSE) {
437
+						$val = explode('|@|', $val);
438
+					}
439
+					if(!$info->{$key}) {
440
+						$info->{$key} = $val;
441
+					}
377 442
 				}
378 443
 			}
379 444
 
@@ -396,8 +461,7 @@  discard block
 block discarded – undo
396 461
 					if(is_array($val))
397 462
 					{
398 463
 						$oSecurity->encodeHTML($key . '.');
399
-					}
400
-					else
464
+					} else
401 465
 					{
402 466
 						$oSecurity->encodeHTML($key);
403 467
 					}
@@ -460,7 +524,9 @@  discard block
 block discarded – undo
460 524
 	 */
461 525
 	function getLoggedMemberSrl()
462 526
 	{
463
-		if(!$this->isLogged()) return;
527
+		if(!$this->isLogged()) {
528
+			return;
529
+		}
464 530
 		return $_SESSION['member_srl'];
465 531
 	}
466 532
 
@@ -469,7 +535,9 @@  discard block
 block discarded – undo
469 535
 	 */
470 536
 	function getLoggedUserID()
471 537
 	{
472
-		if(!$this->isLogged()) return;
538
+		if(!$this->isLogged()) {
539
+			return;
540
+		}
473 541
 		$logged_info = Context::get('logged_info');
474 542
 		return $logged_info->user_id;
475 543
 	}
@@ -501,9 +569,13 @@  discard block
 block discarded – undo
501 569
 				$output = executeQueryArray('member.getMemberGroups', $args);
502 570
 				$group_list = $output->data;
503 571
 				//insert in cache
504
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
572
+				if($oCacheHandler->isSupport()) {
573
+					$oCacheHandler->put($cache_key, $group_list);
574
+				}
575
+			}
576
+			if(!$group_list) {
577
+				return array();
505 578
 			}
506
-			if(!$group_list) return array();
507 579
 
508 580
 			foreach($group_list as $group)
509 581
 			{
@@ -523,7 +595,9 @@  discard block
 block discarded – undo
523 595
 		$args->site_srl = $site_srl;
524 596
 		$args->sort_index = 'list_order';
525 597
 		$output = executeQueryArray('member.getMembersGroups', $args);
526
-		if(!$output->data) return array();
598
+		if(!$output->data) {
599
+			return array();
600
+		}
527 601
 
528 602
 		$result = array();
529 603
 		foreach($output->data as $key=>$val)
@@ -615,7 +689,9 @@  discard block
 block discarded – undo
615 689
 				$output = executeQueryArray('member.getGroups', $args);
616 690
 				$group_list = $output->data;
617 691
 				//insert in cache
618
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
692
+				if($oCacheHandler->isSupport()) {
693
+					$oCacheHandler->put($cache_key, $group_list);
694
+				}
619 695
 			}
620 696
 
621 697
 			if(!$group_list)
@@ -663,9 +739,13 @@  discard block
 block discarded – undo
663 739
 			$output = executeQuery('member.getJoinFormList', $args);
664 740
 			// NULL if output data deosn't exist
665 741
 			$join_form_list = $output->data;
666
-			if(!$join_form_list) return NULL;
742
+			if(!$join_form_list) {
743
+				return NULL;
744
+			}
667 745
 			// Need to unserialize because serialized array is inserted into DB in case of default_value
668
-			if(!is_array($join_form_list)) $join_form_list = array($join_form_list);
746
+			if(!is_array($join_form_list)) {
747
+				$join_form_list = array($join_form_list);
748
+			}
669 749
 			$join_form_count = count($join_form_list);
670 750
 			for($i=0;$i<$join_form_count;$i++)
671 751
 			{
@@ -682,9 +762,10 @@  discard block
 block discarded – undo
682 762
 				if(in_array($column_type, array('checkbox','select','radio')))
683 763
 				{
684 764
 					$join_form_list[$i]->default_value = unserialize($default_value);
685
-					if(!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = '';
686
-				}
687
-				else
765
+					if(!$join_form_list[$i]->default_value[0]) {
766
+						$join_form_list[$i]->default_value = '';
767
+					}
768
+				} else
688 769
 				{
689 770
 					$join_form_list[$i]->default_value = '';
690 771
 				}
@@ -698,13 +779,18 @@  discard block
 block discarded – undo
698 779
 		{
699 780
 			foreach($this->join_form_list as $key => $val)
700 781
 			{
701
-				if($val->is_active != 'Y') continue;
782
+				if($val->is_active != 'Y') {
783
+					continue;
784
+				}
702 785
 				unset($obj);
703 786
 				$obj->type = $val->column_type;
704 787
 				$obj->name = $val->column_name;
705 788
 				$obj->lang = $val->column_title;
706
-				if($logged_info->is_admin != 'Y') $obj->required = $val->required=='Y'?true:false;
707
-				else $obj->required = false;
789
+				if($logged_info->is_admin != 'Y') {
790
+					$obj->required = $val->required=='Y'?true:false;
791
+				} else {
792
+					$obj->required = false;
793
+				}
708 794
 				$filter_output[] = $obj;
709 795
 
710 796
 				unset($open_obj);
@@ -755,7 +841,9 @@  discard block
 block discarded – undo
755 841
 	function getCombineJoinForm($member_info)
756 842
 	{
757 843
 		$extend_form_list = $this->getJoinFormlist();
758
-		if(!$extend_form_list) return;
844
+		if(!$extend_form_list) {
845
+			return;
846
+		}
759 847
 		// Member info is open only to an administrator and him/herself when is_private is true.
760 848
 		$logged_info = Context::get('logged_info');
761 849
 
@@ -768,7 +856,9 @@  discard block
 block discarded – undo
768 856
 			switch($item->column_type)
769 857
 			{
770 858
 				case 'checkbox' :
771
-					if($value && !is_array($value)) $value = array($value);
859
+					if($value && !is_array($value)) {
860
+						$value = array($value);
861
+					}
772 862
 					break;
773 863
 				case 'text' :
774 864
 				case 'homepage' :
@@ -782,8 +872,11 @@  discard block
 block discarded – undo
782 872
 
783 873
 			$extend_form_list[$srl]->value = $value;
784 874
 
785
-			if($member_info->{'open_'.$column_name}=='Y') $extend_form_list[$srl]->is_opened = true;
786
-			else $extend_form_list[$srl]->is_opened = false;
875
+			if($member_info->{'open_'.$column_name}=='Y') {
876
+				$extend_form_list[$srl]->is_opened = true;
877
+			} else {
878
+				$extend_form_list[$srl]->is_opened = false;
879
+			}
787 880
 		}
788 881
 		return $extend_form_list;
789 882
 	}
@@ -796,7 +889,9 @@  discard block
 block discarded – undo
796 889
 		$args->member_join_form_srl = $member_join_form_srl;
797 890
 		$output = executeQuery('member.getJoinForm', $args);
798 891
 		$join_form = $output->data;
799
-		if(!$join_form) return NULL;
892
+		if(!$join_form) {
893
+			return NULL;
894
+		}
800 895
 
801 896
 		$column_type = $join_form->column_type;
802 897
 		$default_value = $join_form->default_value;
@@ -804,8 +899,7 @@  discard block
 block discarded – undo
804 899
 		if(in_array($column_type, array('checkbox','select','radio')))
805 900
 		{
806 901
 			$join_form->default_value = unserialize($default_value);
807
-		}
808
-		else
902
+		} else
809 903
 		{
810 904
 			$join_form->default_value = '';
811 905
 		}
@@ -834,7 +928,9 @@  discard block
 block discarded – undo
834 928
 	function getDeniedIDs()
835 929
 	{
836 930
 		$output = executeQueryArray('member.getDeniedIDs');
837
-		if(!$output->toBool()) return array();
931
+		if(!$output->toBool()) {
932
+			return array();
933
+		}
838 934
 		return $output->data;
839 935
 	}
840 936
 
@@ -857,7 +953,9 @@  discard block
 block discarded – undo
857 953
 		$args = new stdClass();
858 954
 		$args->user_id = $user_id;
859 955
 		$output = executeQuery('member.chkDeniedID', $args);
860
-		if($output->data->count) return true;
956
+		if($output->data->count) {
957
+			return true;
958
+		}
861 959
 		return false;
862 960
 	}
863 961
 
@@ -869,7 +967,9 @@  discard block
 block discarded – undo
869 967
 		$args = new stdClass();
870 968
 		$args->nick_name = $nickName;
871 969
 		$output = executeQuery('member.chkDeniedNickName', $args);
872
-		if($output->data->count) return true;
970
+		if($output->data->count) {
971
+			return true;
972
+		}
873 973
 		if(!$output->toBool())
874 974
 		{
875 975
 			return true;
@@ -922,8 +1022,9 @@  discard block
 block discarded – undo
922 1022
 				$info->src = Context::getRequestUri().$image_name_file. '?' . date('YmdHis', filemtime($image_name_file));
923 1023
 				$info->file = './'.$image_name_file;
924 1024
 				$GLOBALS['__member_info__']['image_name'][$member_srl] = $info;
1025
+			} else {
1026
+				$GLOBALS['__member_info__']['image_name'][$member_srl] = null;
925 1027
 			}
926
-			else $GLOBALS['__member_info__']['image_name'][$member_srl] = null;
927 1028
 		}
928 1029
 		return $GLOBALS['__member_info__']['image_name'][$member_srl];
929 1030
 	}
@@ -944,8 +1045,9 @@  discard block
 block discarded – undo
944 1045
 				$info->src = Context::getRequestUri().$image_mark_file . '?' . date('YmdHis', filemtime($image_mark_file));
945 1046
 				$info->file = './'.$image_mark_file;
946 1047
 				$GLOBALS['__member_info__']['image_mark'][$member_srl] = $info;
1048
+			} else {
1049
+				$GLOBALS['__member_info__']['image_mark'][$member_srl] = null;
947 1050
 			}
948
-			else $GLOBALS['__member_info__']['image_mark'][$member_srl] = null;
949 1051
 		}
950 1052
 
951 1053
 		return $GLOBALS['__member_info__']['image_mark'][$member_srl];
@@ -987,9 +1089,13 @@  discard block
 block discarded – undo
987 1089
 					}
988 1090
 				}
989 1091
 			}
990
-			if (!$info) $GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N';
1092
+			if (!$info) {
1093
+				$GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N';
1094
+			}
1095
+		}
1096
+		if ($GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N') {
1097
+			return null;
991 1098
 		}
992
-		if ($GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N') return null;
993 1099
 
994 1100
 		return $GLOBALS['__member_info__']['group_image_mark'][$member_srl];
995 1101
 	}
@@ -1007,8 +1113,9 @@  discard block
 block discarded – undo
1007 1113
 				$buff = FileHandler::readFile($filename);
1008 1114
 				$signature = preg_replace('/<\?.*?\?>/', '', $buff);
1009 1115
 				$GLOBALS['__member_info__']['signature'][$member_srl] = $signature;
1116
+			} else {
1117
+				$GLOBALS['__member_info__']['signature'][$member_srl] = null;
1010 1118
 			}
1011
-			else $GLOBALS['__member_info__']['signature'][$member_srl] = null;
1012 1119
 		}
1013 1120
 		return $GLOBALS['__member_info__']['signature'][$member_srl];
1014 1121
 	}
@@ -1046,14 +1153,18 @@  discard block
 block discarded – undo
1046 1153
 			if(!$need_upgrade)
1047 1154
 			{
1048 1155
 				$required_algorithm = $oPassword->getCurrentlySelectedAlgorithm();
1049
-				if($required_algorithm !== $current_algorithm) $need_upgrade = true;
1156
+				if($required_algorithm !== $current_algorithm) {
1157
+					$need_upgrade = true;
1158
+				}
1050 1159
 			}
1051 1160
 			
1052 1161
 			if(!$need_upgrade)
1053 1162
 			{
1054 1163
 				$required_work_factor = $oPassword->getWorkFactor();
1055 1164
 				$current_work_factor = $oPassword->checkWorkFactor($hashed_password);
1056
-				if($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true;
1165
+				if($current_work_factor !== false && $required_work_factor > $current_work_factor) {
1166
+					$need_upgrade = true;
1167
+				}
1057 1168
 			}
1058 1169
 			
1059 1170
 			if($need_upgrade === true)
@@ -1084,7 +1195,9 @@  discard block
 block discarded – undo
1084 1195
 	function checkPasswordStrength($password, $strength)
1085 1196
 	{
1086 1197
 		$logged_info = Context::get('logged_info');
1087
-		if($logged_info->is_admin == 'Y') return true;
1198
+		if($logged_info->is_admin == 'Y') {
1199
+			return true;
1200
+		}
1088 1201
 		
1089 1202
 		if($strength == NULL)
1090 1203
 		{
@@ -1096,15 +1209,21 @@  discard block
 block discarded – undo
1096 1209
 		
1097 1210
 		switch ($strength) {
1098 1211
 			case 'high':
1099
-				if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false;
1212
+				if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) {
1213
+					return false;
1214
+				}
1100 1215
 				/* no break */
1101 1216
 				
1102 1217
 			case 'normal':
1103
-				if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false;
1218
+				if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) {
1219
+					return false;
1220
+				}
1104 1221
 				break;
1105 1222
 				
1106 1223
 			case 'low':
1107
-				if($length < 4) return false;
1224
+				if($length < 4) {
1225
+					return false;
1226
+				}
1108 1227
 				break; 
1109 1228
 		}
1110 1229
 		
Please login to merge, or discard this patch.
modules/member/member.view.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -634,7 +634,7 @@
 block discarded – undo
634 634
 	/**
635 635
 	 * Spammer manage popup
636 636
 	 * 
637
-	 * @return void
637
+	 * @return Object|null
638 638
 	**/
639 639
 	function dispMemberSpammer()
640 640
 	{
Please login to merge, or discard this patch.
Braces   +77 added lines, -58 removed lines patch added patch discarded remove patch
@@ -29,16 +29,14 @@  discard block
 block discarded – undo
29 29
 		{
30 30
 			$skin = 'default';
31 31
 			$template_path = sprintf('%sskins/%s', $this->module_path, $skin);
32
-		}
33
-		else
32
+		} else
34 33
 		{
35 34
 			//check theme
36 35
 			$config_parse = explode('|@|', $skin);
37 36
 			if (count($config_parse) > 1)
38 37
 			{
39 38
 				$template_path = sprintf('./themes/%s/modules/member/', $config_parse[0]);
40
-			}
41
-			else
39
+			} else
42 40
 			{
43 41
 				$template_path = sprintf('%sskins/%s', $this->module_path, $skin);
44 42
 			}
@@ -63,14 +61,15 @@  discard block
 block discarded – undo
63 61
 		$oMemberModel = getModel('member');
64 62
 		$logged_info = Context::get('logged_info');
65 63
 		// Don't display member info to non-logged user
66
-		if(!$logged_info->member_srl) return $this->stop('msg_not_permitted');
64
+		if(!$logged_info->member_srl) {
65
+			return $this->stop('msg_not_permitted');
66
+		}
67 67
 
68 68
 		$member_srl = Context::get('member_srl');
69 69
 		if(!$member_srl && Context::get('is_logged'))
70 70
 		{
71 71
 			$member_srl = $logged_info->member_srl;
72
-		}
73
-		elseif(!$member_srl)
72
+		} elseif(!$member_srl)
74 73
 		{
75 74
 			return $this->dispMemberSignUpForm();
76 75
 		}
@@ -89,7 +88,9 @@  discard block
 block discarded – undo
89 88
 			$member_info->email_address = substr_replace($member_info->email_address, $replaceStr, $start);
90 89
 		}
91 90
 
92
-		if(!$member_info->member_srl) return $this->dispMemberSignUpForm();
91
+		if(!$member_info->member_srl) {
92
+			return $this->dispMemberSignUpForm();
93
+		}
93 94
 
94 95
 		Context::set('memberInfo', get_object_vars($member_info));
95 96
 
@@ -135,43 +136,35 @@  discard block
 block discarded – undo
135 136
 				{
136 137
 					$target = $memberInfo->profile_image;
137 138
 					$item->value = '<img src="'.$target->src.'" />';
138
-				}
139
-				elseif($formInfo->name == 'image_name' && $memberInfo->image_name)
139
+				} elseif($formInfo->name == 'image_name' && $memberInfo->image_name)
140 140
 				{
141 141
 					$target = $memberInfo->image_name;
142 142
 					$item->value = '<img src="'.$target->src.'" />';
143
-				}
144
-				elseif($formInfo->name == 'image_mark' && $memberInfo->image_mark)
143
+				} elseif($formInfo->name == 'image_mark' && $memberInfo->image_mark)
145 144
 				{
146 145
 					$target = $memberInfo->image_mark;
147 146
 					$item->value = '<img src="'.$target->src.'" />';
148
-				}
149
-				elseif($formInfo->name == 'birthday' && $memberInfo->birthday)
147
+				} elseif($formInfo->name == 'birthday' && $memberInfo->birthday)
150 148
 				{
151 149
 					$item->value = zdate($item->value, 'Y-m-d');
152 150
 				}
153
-			}
154
-			else
151
+			} else
155 152
 			{
156 153
 				$item->title = $extendFormInfo[$formInfo->member_join_form_srl]->column_title;
157 154
 				$orgValue = $extendFormInfo[$formInfo->member_join_form_srl]->value;
158 155
 				if($formInfo->type=='tel' && is_array($orgValue))
159 156
 				{
160 157
 					$item->value = implode('-', $orgValue);
161
-				}
162
-				elseif($formInfo->type=='kr_zip' && is_array($orgValue))
158
+				} elseif($formInfo->type=='kr_zip' && is_array($orgValue))
163 159
 				{
164 160
 					$item->value = implode(' ', $orgValue);
165
-				}
166
-				elseif($formInfo->type=='checkbox' && is_array($orgValue))
161
+				} elseif($formInfo->type=='checkbox' && is_array($orgValue))
167 162
 				{
168 163
 					$item->value = implode(", ",$orgValue);
169
-				}
170
-				elseif($formInfo->type=='date')
164
+				} elseif($formInfo->type=='date')
171 165
 				{
172 166
 					$item->value = zdate($orgValue, "Y-m-d");
173
-				}
174
-				else
167
+				} else
175 168
 				{
176 169
 					$item->value = nl2br($orgValue);
177 170
 				}
@@ -198,12 +191,18 @@  discard block
 block discarded – undo
198 191
 
199 192
 		$oMemberModel = getModel('member');
200 193
 		// Get the member information if logged-in
201
-		if($oMemberModel->isLogged()) return $this->stop('msg_already_logged');
194
+		if($oMemberModel->isLogged()) {
195
+			return $this->stop('msg_already_logged');
196
+		}
202 197
 		// call a trigger (before) 
203 198
 		$trigger_output = ModuleHandler::triggerCall('member.dispMemberSignUpForm', 'before', $member_config);
204
-		if(!$trigger_output->toBool()) return $trigger_output;
199
+		if(!$trigger_output->toBool()) {
200
+			return $trigger_output;
201
+		}
205 202
 		// Error appears if the member is not allowed to join
206
-		if($member_config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
203
+		if($member_config->enable_join != 'Y') {
204
+			return $this->stop('msg_signup_disabled');
205
+		}
207 206
 
208 207
 		$oMemberAdminView = getAdminView('member');
209 208
 		$formTags = $oMemberAdminView->_getMemberInputTag($member_info);
@@ -244,8 +243,7 @@  discard block
 block discarded – undo
244 243
 		{
245 244
 			Context::set('identifierTitle', Context::getLang('email_address'));
246 245
 			Context::set('identifierValue', $logged_info->email_address); 
247
-		}
248
-		else
246
+		} else
249 247
 		{
250 248
 			Context::set('identifierTitle', Context::getLang('user_id'));
251 249
 			Context::set('identifierValue', $logged_info->user_id);
@@ -271,7 +269,9 @@  discard block
 block discarded – undo
271 269
 
272 270
 		$oMemberModel = getModel('member');
273 271
 		// A message appears if the user is not logged-in
274
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
272
+		if(!$oMemberModel->isLogged()) {
273
+			return $this->stop('msg_not_logged');
274
+		}
275 275
 
276 276
 		$logged_info = Context::get('logged_info');
277 277
 		$member_srl = $logged_info->member_srl;
@@ -330,7 +330,9 @@  discard block
 block discarded – undo
330 330
 	{
331 331
 		$oMemberModel = getModel('member');
332 332
 		// A message appears if the user is not logged-in
333
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
333
+		if(!$oMemberModel->isLogged()) {
334
+			return $this->stop('msg_not_logged');
335
+		}
334 336
 
335 337
 		$logged_info = Context::get('logged_info');
336 338
 		$member_srl = $logged_info->member_srl;
@@ -357,7 +359,9 @@  discard block
 block discarded – undo
357 359
 	{
358 360
 		$oMemberModel = getModel('member');
359 361
 		// A message appears if the user is not logged-in
360
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
362
+		if(!$oMemberModel->isLogged()) {
363
+			return $this->stop('msg_not_logged');
364
+		}
361 365
 
362 366
 		$logged_info = Context::get('logged_info');
363 367
 		$args = new stdClass();
@@ -381,7 +385,9 @@  discard block
 block discarded – undo
381 385
 	{
382 386
 		$oMemberModel = getModel('member');
383 387
 		// A message appears if the user is not logged-in
384
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
388
+		if(!$oMemberModel->isLogged()) {
389
+			return $this->stop('msg_not_logged');
390
+		}
385 391
 		// Get the saved document(module_srl is set to member_srl instead)
386 392
 		$logged_info = Context::get('logged_info');
387 393
 		$args = new stdClass();
@@ -420,13 +426,15 @@  discard block
 block discarded – undo
420 426
 
421 427
 		$XE_VALIDATOR_MESSAGE = Context::get('XE_VALIDATOR_MESSAGE');
422 428
 		$XE_VALIDATOR_ERROR = Context::get('XE_VALIDATOR_ERROR');
423
-		if($XE_VALIDATOR_ERROR == -11)
424
-			Context::set('XE_VALIDATOR_MESSAGE', $XE_VALIDATOR_MESSAGE . $config->limit_day_description);
429
+		if($XE_VALIDATOR_ERROR == -11) {
430
+					Context::set('XE_VALIDATOR_MESSAGE', $XE_VALIDATOR_MESSAGE . $config->limit_day_description);
431
+		}
425 432
 
426
-		if($XE_VALIDATOR_ERROR < -10 && $XE_VALIDATOR_ERROR > -21)
427
-			Context::set('referer_url', getUrl('')); 
428
-		else
429
-			Context::set('referer_url', htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
433
+		if($XE_VALIDATOR_ERROR < -10 && $XE_VALIDATOR_ERROR > -21) {
434
+					Context::set('referer_url', getUrl(''));
435
+		} else {
436
+					Context::set('referer_url', htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
437
+		}
430 438
 
431 439
 		// Set a template file
432 440
 		$this->setTemplateFile('login_form');
@@ -439,7 +447,9 @@  discard block
 block discarded – undo
439 447
 	{
440 448
 		$oMemberModel = getModel('member');
441 449
 		// A message appears if the user is not logged-in
442
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
450
+		if(!$oMemberModel->isLogged()) {
451
+			return $this->stop('msg_not_logged');
452
+		}
443 453
 
444 454
 		$memberConfig = $this->member_config;
445 455
 
@@ -454,8 +464,7 @@  discard block
 block discarded – undo
454 464
 		{
455 465
 			Context::set('identifier', 'user_id');
456 466
 			Context::set('formValue', $member_info->user_id);
457
-		}
458
-		else
467
+		} else
459 468
 		{
460 469
 			Context::set('identifier', 'email_address');
461 470
 			Context::set('formValue', $member_info->email_address);
@@ -471,7 +480,9 @@  discard block
 block discarded – undo
471 480
 	{
472 481
 		$oMemberModel = getModel('member');
473 482
 		// A message appears if the user is not logged-in
474
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
483
+		if(!$oMemberModel->isLogged()) {
484
+			return $this->stop('msg_not_logged');
485
+		}
475 486
 
476 487
 		$memberConfig = $this->member_config;
477 488
 
@@ -485,8 +496,7 @@  discard block
 block discarded – undo
485 496
 		{
486 497
 			Context::set('identifier', 'user_id');
487 498
 			Context::set('formValue', $member_info->user_id);
488
-		}
489
-		else
499
+		} else
490 500
 		{
491 501
 			Context::set('identifier', 'email_address');
492 502
 			Context::set('formValue', $member_info->email_address);
@@ -502,10 +512,11 @@  discard block
 block discarded – undo
502 512
 	{
503 513
 		$oMemberController = getController('member');
504 514
 		$output = $oMemberController->procMemberLogout();
505
-		if(!$output->redirect_url)
506
-			$this->setRedirectUrl(getNotEncodedUrl('act', ''));
507
-		else
508
-			$this->setRedirectUrl($output->redirect_url);
515
+		if(!$output->redirect_url) {
516
+					$this->setRedirectUrl(getNotEncodedUrl('act', ''));
517
+		} else {
518
+					$this->setRedirectUrl($output->redirect_url);
519
+		}
509 520
 
510 521
 		return;
511 522
 	}
@@ -524,7 +535,9 @@  discard block
 block discarded – undo
524 535
 	 */
525 536
 	function dispMemberFindAccount()
526 537
 	{
527
-		if(Context::get('is_logged')) return $this->stop('already_logged');
538
+		if(Context::get('is_logged')) {
539
+			return $this->stop('already_logged');
540
+		}
528 541
 
529 542
 		$config = $this->member_config;
530 543
 
@@ -538,13 +551,17 @@  discard block
 block discarded – undo
538 551
 	 */
539 552
 	function dispMemberGetTempPassword()
540 553
 	{
541
-		if(Context::get('is_logged')) return $this->stop('already_logged');
554
+		if(Context::get('is_logged')) {
555
+			return $this->stop('already_logged');
556
+		}
542 557
 
543 558
 		$user_id = Context::get('user_id');
544 559
 		$temp_password = $_SESSION['xe_temp_password_'.$user_id];
545 560
 		unset($_SESSION['xe_temp_password_'.$user_id]);
546 561
 
547
-		if(!$user_id||!$temp_password) return new Object(-1,'msg_invaild_request');
562
+		if(!$user_id||!$temp_password) {
563
+			return new Object(-1,'msg_invaild_request');
564
+		}
548 565
 
549 566
 		Context::set('temp_password', $temp_password);
550 567
 
@@ -572,8 +589,7 @@  discard block
 block discarded – undo
572 589
 			$_SESSION['auth_member_info'] = $memberInfo;
573 590
 			Context::set('memberInfo', $memberInfo);
574 591
 			$this->setTemplateFile('reset_mail');
575
-		}
576
-		else
592
+		} else
577 593
 		{
578 594
 			$this->setTemplateFile('resend_auth_mail');
579 595
 		}
@@ -615,8 +631,7 @@  discard block
 block discarded – undo
615 631
 			if($val->column_type == 'kr_zip' || $val->column_type == 'tel')
616 632
 			{
617 633
 				$js_code[] = sprintf('validator.cast("ADD_MESSAGE", ["%s[]","%s"]);', $val->column_name, $title);
618
-			}
619
-			else
634
+			} else
620 635
 			{
621 636
 				$js_code[] = sprintf('validator.cast("ADD_MESSAGE", ["%s","%s"]);', $val->column_name, $title);
622 637
 			}
@@ -638,7 +653,9 @@  discard block
 block discarded – undo
638 653
 	**/
639 654
 	function dispMemberSpammer()
640 655
 	{
641
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
656
+		if(!Context::get('is_logged')) {
657
+			return new Object(-1,'msg_not_permitted');
658
+		}
642 659
 
643 660
 		$member_srl = Context::get('member_srl');
644 661
 		$module_srl = Context::get('module_srl');
@@ -649,7 +666,9 @@  discard block
 block discarded – undo
649 666
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
650 667
 		$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
651 668
 
652
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
669
+		if(!$grant->manager) {
670
+			return new Object(-1,'msg_not_permitted');
671
+		}
653 672
 
654 673
 		$oMemberModel = getModel('member');
655 674
 
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -635,7 +635,7 @@
 block discarded – undo
635 635
 	 * Spammer manage popup
636 636
 	 * 
637 637
 	 * @return void
638
-	**/
638
+	 **/
639 639
 	function dispMemberSpammer()
640 640
 	{
641 641
 		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 		$skin = $this->member_config->skin;
27 27
 		// Set the template path
28
-		if(!$skin)
28
+		if (!$skin)
29 29
 		{
30 30
 			$skin = 'default';
31 31
 			$template_path = sprintf('%sskins/%s', $this->module_path, $skin);
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
 		$oLayoutModel = getModel('layout');
50 50
 		$layout_info = $oLayoutModel->getLayout($this->member_config->layout_srl);
51
-		if($layout_info)
51
+		if ($layout_info)
52 52
 		{
53 53
 			$this->module_info->layout_srl = $this->member_config->layout_srl;
54 54
 			$this->setLayoutPath($layout_info->path);
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
 		$oMemberModel = getModel('member');
64 64
 		$logged_info = Context::get('logged_info');
65 65
 		// Don't display member info to non-logged user
66
-		if(!$logged_info->member_srl) return $this->stop('msg_not_permitted');
66
+		if (!$logged_info->member_srl) return $this->stop('msg_not_permitted');
67 67
 
68 68
 		$member_srl = Context::get('member_srl');
69
-		if(!$member_srl && Context::get('is_logged'))
69
+		if (!$member_srl && Context::get('is_logged'))
70 70
 		{
71 71
 			$member_srl = $logged_info->member_srl;
72 72
 		}
73
-		elseif(!$member_srl)
73
+		elseif (!$member_srl)
74 74
 		{
75 75
 			return $this->dispMemberSignUpForm();
76 76
 		}
@@ -82,14 +82,14 @@  discard block
 block discarded – undo
82 82
 		unset($member_info->email_id);
83 83
 		unset($member_info->email_host);
84 84
 
85
-		if($logged_info->is_admin != 'Y' && ($member_info->member_srl != $logged_info->member_srl))
85
+		if ($logged_info->is_admin != 'Y' && ($member_info->member_srl != $logged_info->member_srl))
86 86
 		{
87
-			$start = strpos($member_info->email_address, '@')+1;
87
+			$start = strpos($member_info->email_address, '@') + 1;
88 88
 			$replaceStr = str_repeat('*', (strlen($member_info->email_address) - $start));
89 89
 			$member_info->email_address = substr_replace($member_info->email_address, $replaceStr, $start);
90 90
 		}
91 91
 
92
-		if(!$member_info->member_srl) return $this->dispMemberSignUpForm();
92
+		if (!$member_info->member_srl) return $this->dispMemberSignUpForm();
93 93
 
94 94
 		Context::set('memberInfo', get_object_vars($member_info));
95 95
 
@@ -107,46 +107,46 @@  discard block
 block discarded – undo
107 107
 	{
108 108
 		$logged_info = Context::get('logged_info');
109 109
 		$displayDatas = array();
110
-		foreach($memberConfig->signupForm as $no=>$formInfo)
110
+		foreach ($memberConfig->signupForm as $no=>$formInfo)
111 111
 		{
112
-			if(!$formInfo->isUse)
112
+			if (!$formInfo->isUse)
113 113
 			{
114 114
 				continue;
115 115
 			}
116 116
 
117
-			if($formInfo->name == 'password' || $formInfo->name == 'find_account_question')
117
+			if ($formInfo->name == 'password' || $formInfo->name == 'find_account_question')
118 118
 			{
119 119
 				continue;
120 120
 			}
121 121
 
122
-			if($logged_info->is_admin != 'Y' && $memberInfo->member_srl != $logged_info->member_srl && $formInfo->isPublic != 'Y')
122
+			if ($logged_info->is_admin != 'Y' && $memberInfo->member_srl != $logged_info->member_srl && $formInfo->isPublic != 'Y')
123 123
 			{
124 124
 				continue;
125 125
 			}
126 126
 
127 127
 			$item = $formInfo;
128 128
 
129
-			if($formInfo->isDefaultForm)
129
+			if ($formInfo->isDefaultForm)
130 130
 			{
131 131
 				$item->title = Context::getLang($formInfo->name);
132 132
 				$item->value = $memberInfo->{$formInfo->name};
133 133
 
134
-				if($formInfo->name == 'profile_image' && $memberInfo->profile_image)
134
+				if ($formInfo->name == 'profile_image' && $memberInfo->profile_image)
135 135
 				{
136 136
 					$target = $memberInfo->profile_image;
137 137
 					$item->value = '<img src="'.$target->src.'" />';
138 138
 				}
139
-				elseif($formInfo->name == 'image_name' && $memberInfo->image_name)
139
+				elseif ($formInfo->name == 'image_name' && $memberInfo->image_name)
140 140
 				{
141 141
 					$target = $memberInfo->image_name;
142 142
 					$item->value = '<img src="'.$target->src.'" />';
143 143
 				}
144
-				elseif($formInfo->name == 'image_mark' && $memberInfo->image_mark)
144
+				elseif ($formInfo->name == 'image_mark' && $memberInfo->image_mark)
145 145
 				{
146 146
 					$target = $memberInfo->image_mark;
147 147
 					$item->value = '<img src="'.$target->src.'" />';
148 148
 				}
149
-				elseif($formInfo->name == 'birthday' && $memberInfo->birthday)
149
+				elseif ($formInfo->name == 'birthday' && $memberInfo->birthday)
150 150
 				{
151 151
 					$item->value = zdate($item->value, 'Y-m-d');
152 152
 				}
@@ -155,19 +155,19 @@  discard block
 block discarded – undo
155 155
 			{
156 156
 				$item->title = $extendFormInfo[$formInfo->member_join_form_srl]->column_title;
157 157
 				$orgValue = $extendFormInfo[$formInfo->member_join_form_srl]->value;
158
-				if($formInfo->type=='tel' && is_array($orgValue))
158
+				if ($formInfo->type == 'tel' && is_array($orgValue))
159 159
 				{
160 160
 					$item->value = implode('-', $orgValue);
161 161
 				}
162
-				elseif($formInfo->type=='kr_zip' && is_array($orgValue))
162
+				elseif ($formInfo->type == 'kr_zip' && is_array($orgValue))
163 163
 				{
164 164
 					$item->value = implode(' ', $orgValue);
165 165
 				}
166
-				elseif($formInfo->type=='checkbox' && is_array($orgValue))
166
+				elseif ($formInfo->type == 'checkbox' && is_array($orgValue))
167 167
 				{
168
-					$item->value = implode(", ",$orgValue);
168
+					$item->value = implode(", ", $orgValue);
169 169
 				}
170
-				elseif($formInfo->type=='date')
170
+				elseif ($formInfo->type == 'date')
171 171
 				{
172 172
 					$item->value = zdate($orgValue, "Y-m-d");
173 173
 				}
@@ -198,12 +198,12 @@  discard block
 block discarded – undo
198 198
 
199 199
 		$oMemberModel = getModel('member');
200 200
 		// Get the member information if logged-in
201
-		if($oMemberModel->isLogged()) return $this->stop('msg_already_logged');
201
+		if ($oMemberModel->isLogged()) return $this->stop('msg_already_logged');
202 202
 		// call a trigger (before) 
203 203
 		$trigger_output = ModuleHandler::triggerCall('member.dispMemberSignUpForm', 'before', $member_config);
204
-		if(!$trigger_output->toBool()) return $trigger_output;
204
+		if (!$trigger_output->toBool()) return $trigger_output;
205 205
 		// Error appears if the member is not allowed to join
206
-		if($member_config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
206
+		if ($member_config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
207 207
 
208 208
 		$oMemberAdminView = getAdminView('member');
209 209
 		$formTags = $oMemberAdminView->_getMemberInputTag($member_info);
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 	{
227 227
 		$logged_info = Context::get('logged_info');
228 228
 		$oMemberModel = getModel('member');
229
-		if(!$oMemberModel->isLogged() || empty($logged_info))
229
+		if (!$oMemberModel->isLogged() || empty($logged_info))
230 230
 		{
231 231
 			return $this->stop('msg_not_logged');
232 232
 		}
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 		$_SESSION['rechecked_password_step'] = 'INPUT_PASSWORD';
235 235
 
236 236
 		$templateFile = $this->getTemplatePath().'rechecked_password.html';
237
-		if(!is_readable($templateFile))
237
+		if (!is_readable($templateFile))
238 238
 		{
239 239
 			$templatePath = sprintf('%sskins/default', $this->module_path);
240 240
 			$this->setTemplatePath($templatePath);
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 	 */
260 260
 	function dispMemberModifyInfo() 
261 261
 	{
262
-		if($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA')
262
+		if ($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA')
263 263
 		{
264 264
 			$this->dispMemberModifyInfoBefore();
265 265
 			return;
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 
272 272
 		$oMemberModel = getModel('member');
273 273
 		// A message appears if the user is not logged-in
274
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
274
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
275 275
 
276 276
 		$logged_info = Context::get('logged_info');
277 277
 		$member_srl = $logged_info->member_srl;
@@ -279,13 +279,13 @@  discard block
 block discarded – undo
279 279
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address', 'find_account_answer', 'homepage', 'blog', 'birthday', 'allow_mailing');
280 280
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
281 281
 		$member_info->signature = $oMemberModel->getSignature($member_srl);
282
-		Context::set('member_info',$member_info);
282
+		Context::set('member_info', $member_info);
283 283
 
284 284
 		// Get a list of extend join form
285 285
 		Context::set('extend_form_list', $oMemberModel->getCombineJoinForm($member_info));
286 286
 
287 287
 		// Editor of the module set for signing by calling getEditor
288
-		if($member_info->member_srl)
288
+		if ($member_info->member_srl)
289 289
 		{
290 290
 			$oEditorModel = getModel('editor');
291 291
 			$option = new stdClass();
@@ -330,15 +330,15 @@  discard block
 block discarded – undo
330 330
 	{
331 331
 		$oMemberModel = getModel('member');
332 332
 		// A message appears if the user is not logged-in
333
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
333
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
334 334
 
335 335
 		$logged_info = Context::get('logged_info');
336 336
 		$member_srl = $logged_info->member_srl;
337 337
 
338 338
 		$module_srl = Context::get('module_srl');
339
-		Context::set('module_srl',Context::get('selected_module_srl'));
340
-		Context::set('search_target','member_srl');
341
-		Context::set('search_keyword',$member_srl);
339
+		Context::set('module_srl', Context::get('selected_module_srl'));
340
+		Context::set('search_target', 'member_srl');
341
+		Context::set('search_keyword', $member_srl);
342 342
 
343 343
 		$oDocumentAdminView = getAdminView('document');
344 344
 		$oDocumentAdminView->dispDocumentAdminList();
@@ -357,12 +357,12 @@  discard block
 block discarded – undo
357 357
 	{
358 358
 		$oMemberModel = getModel('member');
359 359
 		// A message appears if the user is not logged-in
360
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
360
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
361 361
 
362 362
 		$logged_info = Context::get('logged_info');
363 363
 		$args = new stdClass();
364 364
 		$args->member_srl = $logged_info->member_srl;
365
-		$args->page = (int)Context::get('page');
365
+		$args->page = (int) Context::get('page');
366 366
 
367 367
 		$output = executeQuery('member.getScrapDocumentList', $args);
368 368
 		Context::set('total_count', $output->total_count);
@@ -381,12 +381,12 @@  discard block
 block discarded – undo
381 381
 	{
382 382
 		$oMemberModel = getModel('member');
383 383
 		// A message appears if the user is not logged-in
384
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
384
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
385 385
 		// Get the saved document(module_srl is set to member_srl instead)
386 386
 		$logged_info = Context::get('logged_info');
387 387
 		$args = new stdClass();
388 388
 		$args->member_srl = $logged_info->member_srl;
389
-		$args->page = (int)Context::get('page');
389
+		$args->page = (int) Context::get('page');
390 390
 		$args->statusList = array('TEMP');
391 391
 
392 392
 		$oDocumentModel = getModel('document');
@@ -405,9 +405,9 @@  discard block
 block discarded – undo
405 405
 	 */
406 406
 	function dispMemberLoginForm()
407 407
 	{
408
-		if(Context::get('is_logged'))
408
+		if (Context::get('is_logged'))
409 409
 		{
410
-			Context::set('redirect_url', getNotEncodedUrl('act',''));
410
+			Context::set('redirect_url', getNotEncodedUrl('act', ''));
411 411
 			$this->setTemplatePath($this->module_path.'tpl');
412 412
 			$this->setTemplateFile('redirect.html');
413 413
 			return;
@@ -420,10 +420,10 @@  discard block
 block discarded – undo
420 420
 
421 421
 		$XE_VALIDATOR_MESSAGE = Context::get('XE_VALIDATOR_MESSAGE');
422 422
 		$XE_VALIDATOR_ERROR = Context::get('XE_VALIDATOR_ERROR');
423
-		if($XE_VALIDATOR_ERROR == -11)
424
-			Context::set('XE_VALIDATOR_MESSAGE', $XE_VALIDATOR_MESSAGE . $config->limit_day_description);
423
+		if ($XE_VALIDATOR_ERROR == -11)
424
+			Context::set('XE_VALIDATOR_MESSAGE', $XE_VALIDATOR_MESSAGE.$config->limit_day_description);
425 425
 
426
-		if($XE_VALIDATOR_ERROR < -10 && $XE_VALIDATOR_ERROR > -21)
426
+		if ($XE_VALIDATOR_ERROR < -10 && $XE_VALIDATOR_ERROR > -21)
427 427
 			Context::set('referer_url', getUrl('')); 
428 428
 		else
429 429
 			Context::set('referer_url', htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 	{
440 440
 		$oMemberModel = getModel('member');
441 441
 		// A message appears if the user is not logged-in
442
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
442
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
443 443
 
444 444
 		$memberConfig = $this->member_config;
445 445
 
@@ -448,9 +448,9 @@  discard block
 block discarded – undo
448 448
 
449 449
 		$columnList = array('member_srl', 'user_id');
450 450
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
451
-		Context::set('member_info',$member_info);
451
+		Context::set('member_info', $member_info);
452 452
 
453
-		if($memberConfig->identifier == 'user_id')
453
+		if ($memberConfig->identifier == 'user_id')
454 454
 		{
455 455
 			Context::set('identifier', 'user_id');
456 456
 			Context::set('formValue', $member_info->user_id);
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 	{
472 472
 		$oMemberModel = getModel('member');
473 473
 		// A message appears if the user is not logged-in
474
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
474
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
475 475
 
476 476
 		$memberConfig = $this->member_config;
477 477
 
@@ -479,9 +479,9 @@  discard block
 block discarded – undo
479 479
 		$member_srl = $logged_info->member_srl;
480 480
 
481 481
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
482
-		Context::set('member_info',$member_info);
482
+		Context::set('member_info', $member_info);
483 483
 
484
-		if($memberConfig->identifier == 'user_id')
484
+		if ($memberConfig->identifier == 'user_id')
485 485
 		{
486 486
 			Context::set('identifier', 'user_id');
487 487
 			Context::set('formValue', $member_info->user_id);
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 	{
503 503
 		$oMemberController = getController('member');
504 504
 		$output = $oMemberController->procMemberLogout();
505
-		if(!$output->redirect_url)
505
+		if (!$output->redirect_url)
506 506
 			$this->setRedirectUrl(getNotEncodedUrl('act', ''));
507 507
 		else
508 508
 			$this->setRedirectUrl($output->redirect_url);
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 	 */
525 525
 	function dispMemberFindAccount()
526 526
 	{
527
-		if(Context::get('is_logged')) return $this->stop('already_logged');
527
+		if (Context::get('is_logged')) return $this->stop('already_logged');
528 528
 
529 529
 		$config = $this->member_config;
530 530
 
@@ -538,13 +538,13 @@  discard block
 block discarded – undo
538 538
 	 */
539 539
 	function dispMemberGetTempPassword()
540 540
 	{
541
-		if(Context::get('is_logged')) return $this->stop('already_logged');
541
+		if (Context::get('is_logged')) return $this->stop('already_logged');
542 542
 
543 543
 		$user_id = Context::get('user_id');
544 544
 		$temp_password = $_SESSION['xe_temp_password_'.$user_id];
545 545
 		unset($_SESSION['xe_temp_password_'.$user_id]);
546 546
 
547
-		if(!$user_id||!$temp_password) return new Object(-1,'msg_invaild_request');
547
+		if (!$user_id || !$temp_password) return new Object(-1, 'msg_invaild_request');
548 548
 
549 549
 		Context::set('temp_password', $temp_password);
550 550
 
@@ -559,12 +559,12 @@  discard block
 block discarded – undo
559 559
 		$authMemberSrl = $_SESSION['auth_member_srl'];
560 560
 		unset($_SESSION['auth_member_srl']);
561 561
 
562
-		if(Context::get('is_logged')) 
562
+		if (Context::get('is_logged')) 
563 563
 		{
564 564
 			return $this->stop('already_logged');
565 565
 		}
566 566
 
567
-		if($authMemberSrl)
567
+		if ($authMemberSrl)
568 568
 		{
569 569
 			$oMemberModel = getModel('member');
570 570
 			$memberInfo = $oMemberModel->getMemberInfoByMemberSrl($authMemberSrl);
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
 
582 582
 	function dispMemberModifyEmailAddress()
583 583
 	{
584
-		if($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA')
584
+		if ($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA')
585 585
 		{
586 586
 			Context::set('success_return_url', getUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyEmailAddress'));
587 587
 			$this->dispMemberModifyInfoBefore();
@@ -609,10 +609,10 @@  discard block
 block discarded – undo
609 609
 		$js_code[] = 'if(!validator) return false;';
610 610
 
611 611
 		$errorLang = array();
612
-		foreach($extraList as $val) 
612
+		foreach ($extraList as $val) 
613 613
 		{
614 614
 			$title = str_ireplace(array('<script', '</script'), array('<scr"+"ipt', '</scr"+"ipt'), addslashes($val->column_title));
615
-			if($val->column_type == 'kr_zip' || $val->column_type == 'tel')
615
+			if ($val->column_type == 'kr_zip' || $val->column_type == 'tel')
616 616
 			{
617 617
 				$js_code[] = sprintf('validator.cast("ADD_MESSAGE", ["%s[]","%s"]);', $val->column_name, $title);
618 618
 			}
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
 	**/
639 639
 	function dispMemberSpammer()
640 640
 	{
641
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
641
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
642 642
 
643 643
 		$member_srl = Context::get('member_srl');
644 644
 		$module_srl = Context::get('module_srl');
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
650 650
 		$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
651 651
 
652
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
652
+		if (!$grant->manager) return new Object(-1, 'msg_not_permitted');
653 653
 
654 654
 		$oMemberModel = getModel('member');
655 655
 
Please login to merge, or discard this patch.
modules/menu/menu.admin.controller.php 3 patches
Doc Comments   +23 added lines, -3 removed lines patch added patch discarded remove patch
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 
246 246
 	/**
247 247
 	 * Delete menu process method
248
-	 * @return void|Object
248
+	 * @return Object|null
249 249
 	 */
250 250
 	function procMenuAdminDelete()
251 251
 	{
@@ -304,6 +304,7 @@  discard block
 block discarded – undo
304 304
 	/**
305 305
 	 * Delete menu
306 306
 	 * Delete menu_item and xml cache files
307
+	 * @param string $menu_srl
307 308
 	 * @return Object
308 309
 	 */
309 310
 	function deleteMenu($menu_srl)
@@ -380,6 +381,7 @@  discard block
 block discarded – undo
380 381
 
381 382
 	/**
382 383
 	 * Add an item to the menu, simple version
384
+	 * @param stdClass $request
383 385
 	 * @return void
384 386
 	 */
385 387
 	public function procMenuAdminInsertItem($request = NULL)
@@ -519,6 +521,9 @@  discard block
 block discarded – undo
519 521
 		$this->setMessage('success_registed', 'info');
520 522
 	}
521 523
 
524
+	/**
525
+	 * @param boolean $isProc
526
+	 */
522 527
 	private function _insertMenu(&$request, $isProc)
523 528
 	{
524 529
 		$oDB = DB::getInstance();
@@ -584,6 +589,7 @@  discard block
 block discarded – undo
584 589
 	 * insert module by men create value
585 590
 	 * @request value of client request
586 591
 	 * @args value for menu create
592
+	 * @param stdClass $args
587 593
 	 * @return bool result of create module
588 594
 	 */
589 595
 	private function _insertModule(&$request, &$args)
@@ -641,7 +647,7 @@  discard block
 block discarded – undo
641 647
 
642 648
 	/**
643 649
 	 * Update an item to the menu, simple version
644
-	 * @return void
650
+	 * @return Object|null
645 651
 	 */
646 652
 	public function procMenuAdminUpdateItem()
647 653
 	{
@@ -842,6 +848,7 @@  discard block
 block discarded – undo
842 848
 	/**
843 849
 	 * Delete menu item ( Only include BO )
844 850
 	 * @args menu_srl, menu_item_srl, is_force
851
+	 * @param stdClass $args
845 852
 	 * @return void|Object
846 853
 	 */
847 854
 	public function deleteItem($args)
@@ -990,6 +997,9 @@  discard block
 block discarded – undo
990 997
 		return new Object(0, 'success');
991 998
 	}
992 999
 
1000
+	/**
1001
+	 * @param DB $oDB
1002
+	 */
993 1003
 	private function _recursiveDeleteMenuItem(&$oDB, &$menuInfo, $node)
994 1004
 	{
995 1005
 		$output = $this->_deleteMenuItem($oDB, $menuInfo, $node);
@@ -1009,7 +1019,7 @@  discard block
 block discarded – undo
1009 1019
 
1010 1020
 	/**
1011 1021
 	 * Move menu items
1012
-	 * @return void
1022
+	 * @return Object|null
1013 1023
 	 */
1014 1024
 	function procMenuAdminMoveItem()
1015 1025
 	{
@@ -1174,6 +1184,9 @@  discard block
 block discarded – undo
1174 1184
 		}
1175 1185
 	}
1176 1186
 
1187
+	/**
1188
+	 * @param string $parentSrl
1189
+	 */
1177 1190
 	private function _copyMenu($menuSrl, $parentSrl, &$originMenu)
1178 1191
 	{
1179 1192
 		$oMenuAdminModel = getAdminModel('menu');
@@ -2182,6 +2195,7 @@  discard block
 block discarded – undo
2182 2195
 	/**
2183 2196
 	 * When copy a menu, button copied also.
2184 2197
 	 * @param $args menuItemInfo with button values
2198
+	 * @param string $insertedMenuItemSrl
2185 2199
 	 */
2186 2200
 	private function _copyButton($insertedMenuItemSrl, $insertedMenuSrl, &$menuItemInfo)
2187 2201
 	{
@@ -2222,6 +2236,9 @@  discard block
 block discarded – undo
2222 2236
 		return $copied_info;
2223 2237
 	}
2224 2238
 
2239
+	/**
2240
+	 * @param string $mode
2241
+	 */
2225 2242
 	private function _changeMenuItemSrlInButtonPath($buttonPath, $menuSrl, $menuItemSrl, $mode)
2226 2243
 	{
2227 2244
 		$path = sprintf('./files/attach/menu_button/%d/', $menuSrl);
@@ -2231,6 +2248,9 @@  discard block
 block discarded – undo
2231 2248
 		return sprintf('%s%d.%s.%s.%s', $path, $menuItemSrl,$date,'menu_'.$mode.'_btn', $ext);
2232 2249
 	}
2233 2250
 
2251
+	/**
2252
+	 * @param integer $menuSrl
2253
+	 */
2234 2254
 	public function makeHomemenuCacheFile($menuSrl)
2235 2255
 	{
2236 2256
 		$cacheBuff .= sprintf('<?php if(!defined("__XE__")) exit();');
Please login to merge, or discard this patch.
Spacing   +298 added lines, -298 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	}
57 57
 
58 58
 	function __construct() {
59
-		$this->homeMenuCacheFile = _XE_PATH_ . $this->homeMenuCacheFile;
59
+		$this->homeMenuCacheFile = _XE_PATH_.$this->homeMenuCacheFile;
60 60
 	}
61 61
 
62 62
 	/**
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 		// List variables
69 69
 		$site_module_info = Context::get('site_module_info');
70 70
 
71
-		$output = $this->addMenu(Context::get('title'), (int)$site_module_info->site_srl);
72
-		if(!$output->toBool()) return $output;
71
+		$output = $this->addMenu(Context::get('title'), (int) $site_module_info->site_srl);
72
+		if (!$output->toBool()) return $output;
73 73
 
74 74
 		$this->add('menu_srl', $output->get('menuSrl'));
75 75
 		$this->setMessage('success_registed');
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		$args->listorder = $args->menu_srl * -1;
96 96
 
97 97
 		$output = executeQuery('menu.insertMenu', $args);
98
-		if(!$output->toBool())
98
+		if (!$output->toBool())
99 99
 		{
100 100
 			return $output;
101 101
 		}
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
 		$unlinked_modules = false;
110 110
 		$args = new stdClass;
111 111
 		$args->site_srl = 0;
112
-		$output = executeQueryArray('module.getNotLinkedModuleBySiteSrl',$args);
113
-		if($output->toBool() && $output->data && count($output->data) > 0)
112
+		$output = executeQueryArray('module.getNotLinkedModuleBySiteSrl', $args);
113
+		if ($output->toBool() && $output->data && count($output->data) > 0)
114 114
 		{
115 115
 			$unlinked_modules = $output->data;
116 116
 		}
117 117
 
118
-		if($unlinked_modules)
118
+		if ($unlinked_modules)
119 119
 		{
120 120
 			$unlinked_menu_srl = $this->getUnlinkedMenu();
121 121
 			$output = $this->updateLinkModule($unlinked_modules, $unlinked_menu_srl);
@@ -129,21 +129,21 @@  discard block
 block discarded – undo
129 129
 		$oModuleModel = getModel('module');
130 130
 		$moduleConfig = $oModuleModel->getModuleConfig('menu');
131 131
 
132
-		if($moduleConfig->unlinked_menu_srl)
132
+		if ($moduleConfig->unlinked_menu_srl)
133 133
 		{
134 134
 			$menuArgs = new stdClass;
135 135
 			$menuArgs->menu_srl = $moduleConfig->unlinked_menu_srl;
136 136
 			$menuOutput = executeQuery('menu.getMenu', $menuArgs);
137
-			if(!$menuOutput->data)
137
+			if (!$menuOutput->data)
138 138
 			{
139 139
 				unset($moduleConfig->unlinked_menu_srl);
140 140
 			}
141 141
 		}
142 142
 
143
-		if(!$moduleConfig->unlinked_menu_srl)
143
+		if (!$moduleConfig->unlinked_menu_srl)
144 144
 		{
145 145
 			$output = $this->addMenu('unlinked', 0);
146
-			if($output->toBool())
146
+			if ($output->toBool())
147 147
 			{
148 148
 				$moduleConfig->unlinked_menu_srl = $output->get('menuSrl');
149 149
 				$oModuleController = getController('module');
@@ -168,12 +168,12 @@  discard block
 block discarded – undo
168 168
 	 */
169 169
 	function updateLinkModule($moduleInfos, $menuSrl)
170 170
 	{
171
-		if(!$moduleInfos || !is_array($moduleInfos) || count($moduleInfos) == 0 || $menuSrl == 0)
171
+		if (!$moduleInfos || !is_array($moduleInfos) || count($moduleInfos) == 0 || $menuSrl == 0)
172 172
 		{
173 173
 			return new Object(-1, 'msg_invalid_request');
174 174
 		}
175 175
 
176
-		foreach($moduleInfos as $moduleInfo)
176
+		foreach ($moduleInfos as $moduleInfo)
177 177
 		{
178 178
 			// search menu.
179 179
 			$args = new stdClass;
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
 			$output = executeQuery('menu.getMenuItemByUrl', $args);
185 185
 
186
-			if($output->toBool() && $output->data)
186
+			if ($output->toBool() && $output->data)
187 187
 			{
188 188
 				$moduleInfo->menu_srl = $output->data->menu_srl;
189 189
 			}
@@ -194,10 +194,10 @@  discard block
 block discarded – undo
194 194
 				$item_args->url = $moduleInfo->mid;
195 195
 				$item_args->name = $moduleInfo->mid;
196 196
 				$item_args->menu_item_srl = getNextSequence();
197
-				$item_args->listorder = -1*$item_args->menu_item_srl;
197
+				$item_args->listorder = -1 * $item_args->menu_item_srl;
198 198
 
199 199
 				$output = executeQuery('menu.insertMenuItem', $item_args);
200
-				if(!$output->toBool())
200
+				if (!$output->toBool())
201 201
 				{
202 202
 					return $output;
203 203
 				}
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 		}
211 211
 
212 212
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
213
-		if($oCacheHandler->isSupport())
213
+		if ($oCacheHandler->isSupport())
214 214
 		{
215 215
 			$oCacheHandler->invalidateGroupKey('site_and_module');
216 216
 		}
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 		$args->menu_srl = Context::get('menu_srl');
236 236
 
237 237
 		$output = executeQuery('menu.updateMenu', $args);
238
-		if(!$output->toBool()) return $output;
238
+		if (!$output->toBool()) return $output;
239 239
 
240 240
 		$this->setMessage('success_registed');
241 241
 
@@ -255,14 +255,14 @@  discard block
 block discarded – undo
255 255
 		$menuInfo = $oMenuAdminModel->getMenu($menu_srl);
256 256
 
257 257
 		$oAdmin = getClass('admin');
258
-		if($menuInfo->title == $oAdmin->getAdminMenuName())
258
+		if ($menuInfo->title == $oAdmin->getAdminMenuName())
259 259
 			return new Object(-1, 'msg_adminmenu_cannot_delete');
260 260
 
261 261
 		// get menu properies with child menu
262 262
 		$phpFile = sprintf("./files/cache/menu/%s.php", $menu_srl);
263 263
 		$originMenu = NULL;
264 264
 
265
-		if(is_readable(FileHandler::getRealPath($phpFile)))
265
+		if (is_readable(FileHandler::getRealPath($phpFile)))
266 266
 		{
267 267
 			include(FileHandler::getRealPath($phpFile));
268 268
 		}
@@ -273,25 +273,25 @@  discard block
 block discarded – undo
273 273
 
274 274
 		$isStartmenuInclude = false;
275 275
 
276
-		if(is_array($menu->list))
276
+		if (is_array($menu->list))
277 277
 		{
278
-			foreach($menu->list AS $key=>$value)
278
+			foreach ($menu->list AS $key=>$value)
279 279
 			{
280 280
 				$originMenu = $value;
281 281
 				$this->_checkHomeMenuInOriginMenu($originMenu, $siteInfo->mid, $isStartmenuInclude);
282 282
 
283
-				if($isStartmenuInclude)
283
+				if ($isStartmenuInclude)
284 284
 					break;
285 285
 			}
286 286
 		}
287 287
 
288
-		if($isStartmenuInclude)
288
+		if ($isStartmenuInclude)
289 289
 		{
290 290
 			return new Object(-1, 'msg_cannot_delete_homemenu');
291 291
 		}
292 292
 
293 293
 		$output = $this->deleteMenu($menu_srl);
294
-		if(!$output->toBool())
294
+		if (!$output->toBool())
295 295
 		{
296 296
 			return new Object(-1, $output->message);
297 297
 		}
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 
320 320
 		// Delete modules
321 321
 		$output = executeQueryArray('menu.getMenuItems', $args);
322
-		if(!$output->toBool())
322
+		if (!$output->toBool())
323 323
 		{
324 324
 			return $output;
325 325
 		}
@@ -327,15 +327,15 @@  discard block
 block discarded – undo
327 327
 		$oModuleController = getController('module');
328 328
 		$oModuleModel = getModel('module');
329 329
 
330
-		foreach($output->data as $itemInfo)
330
+		foreach ($output->data as $itemInfo)
331 331
 		{
332
-			if($itemInfo->is_shortcut != 'Y' && strncasecmp('http', $itemInfo->url, 4) !== 0)
332
+			if ($itemInfo->is_shortcut != 'Y' && strncasecmp('http', $itemInfo->url, 4) !== 0)
333 333
 			{
334 334
 				$moduleInfo = $oModuleModel->getModuleInfoByMid($itemInfo->url, $menuInfo->site_srl);
335
-				if($moduleInfo->module_srl)
335
+				if ($moduleInfo->module_srl)
336 336
 				{
337 337
 					$output = $oModuleController->onlyDeleteModule($moduleInfo->module_srl);
338
-					if(!$output->toBool())
338
+					if (!$output->toBool())
339 339
 					{
340 340
 						$oDB->rollback();
341 341
 						return $output;
@@ -346,27 +346,27 @@  discard block
 block discarded – undo
346 346
 
347 347
 		// Delete menu items
348 348
 		$output = executeQuery("menu.deleteMenuItems", $args);
349
-		if(!$output->toBool())
349
+		if (!$output->toBool())
350 350
 		{
351 351
 			$oDB->rollback();
352 352
 			return $output;
353 353
 		}
354 354
 		// Delete the menu
355 355
 		$output = executeQuery("menu.deleteMenu", $args);
356
-		if(!$output->toBool())
356
+		if (!$output->toBool())
357 357
 		{
358 358
 			$oDB->rollback();
359 359
 			return $output;
360 360
 		}
361 361
 
362 362
 		// Delete cache files
363
-		$cache_list = FileHandler::readDir("./files/cache/menu","",false,true);
364
-		if(count($cache_list))
363
+		$cache_list = FileHandler::readDir("./files/cache/menu", "", false, true);
364
+		if (count($cache_list))
365 365
 		{
366
-			foreach($cache_list as $cache_file)
366
+			foreach ($cache_list as $cache_file)
367 367
 			{
368 368
 				$pos = strpos($cache_file, $menu_srl.'.');
369
-				if($pos>0)FileHandler::removeFile($cache_file);
369
+				if ($pos > 0)FileHandler::removeFile($cache_file);
370 370
 			}
371 371
 		}
372 372
 		// Delete images of menu buttons
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 
376 376
 		$oDB->commit();
377 377
 
378
-		return new Object(0,'success_deleted');
378
+		return new Object(0, 'success_deleted');
379 379
 	}
380 380
 
381 381
 	/**
@@ -385,24 +385,24 @@  discard block
 block discarded – undo
385 385
 	public function procMenuAdminInsertItem($request = NULL)
386 386
 	{
387 387
 		$isProc = false;
388
-		if(!$request)
388
+		if (!$request)
389 389
 		{
390 390
 			$isProc = true;
391 391
 			$request = Context::getRequestVars();
392 392
 		}
393 393
 
394
-		if(!$request->parent_srl || !$request->menu_name)
394
+		if (!$request->parent_srl || !$request->menu_name)
395 395
 		{
396 396
 			return new Object(-1, 'msg_invalid_request');
397 397
 		}
398 398
 
399 399
 		$this->_setMenuSrl($request->parent_srl, $request->menu_srl);
400
-		if(!$request->menu_srl)
400
+		if (!$request->menu_srl)
401 401
 		{
402 402
 			return new Object(-1, 'msg_invalid_request');
403 403
 		}
404 404
 
405
-		if($request->is_shortcut == 'Y')
405
+		if ($request->is_shortcut == 'Y')
406 406
 		{
407 407
 			$result = $this->_insertShortcut($request);
408 408
 		}
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 			$result = $this->_insertMenu($request, $isProc);
412 412
 		}
413 413
 
414
-		if($result->error < 0)
414
+		if ($result->error < 0)
415 415
 		{
416 416
 			return new Object($result->error, $result->message);
417 417
 		}
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 		// recreate menu cache file
420 420
 		$this->makeXmlFile($request->menu_srl);
421 421
 
422
-		if(!$isProc)
422
+		if (!$isProc)
423 423
 		{
424 424
 			return $this->get('menu_item_srl');
425 425
 		}
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 		$oMenuAdminModel = getAdminModel('menu');
432 432
 		$itemInfo = $oMenuAdminModel->getMenuItemInfo($parent_srl);
433 433
 		// parent_srl is parent menu item's srl
434
-		if($itemInfo->menu_srl)
434
+		if ($itemInfo->menu_srl)
435 435
 		{
436 436
 			$menu_srl = $itemInfo->menu_srl;
437 437
 		}
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 		else
440 440
 		{
441 441
 			$output = $oMenuAdminModel->getMenu($parent_srl);
442
-			if($output->menu_srl == $parent_srl)
442
+			if ($output->menu_srl == $parent_srl)
443 443
 			{
444 444
 				$menu_srl = $output->menu_srl;
445 445
 				$parent_srl = 0;
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 		$oDB->begin();
454 454
 
455 455
 		// type is url
456
-		if(strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
456
+		if (strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
457 457
 		{
458 458
 			// set menu variable
459 459
 			$args = new stdClass();
@@ -465,27 +465,27 @@  discard block
 block discarded – undo
465 465
 			$args->is_shortcut = $request->is_shortcut;
466 466
 			$args->url = $request->shortcut_target;
467 467
 
468
-			if(!$args->open_window) $args->open_window = 'N';
469
-			if(!$args->expand) $args->expand = 'N';
470
-			if(!$args->is_shortcut) $args->is_shortcut = 'Y';
468
+			if (!$args->open_window) $args->open_window = 'N';
469
+			if (!$args->expand) $args->expand = 'N';
470
+			if (!$args->is_shortcut) $args->is_shortcut = 'Y';
471 471
 
472
-			if($request->menu_name_key) $args->name = $request->menu_name_key;
472
+			if ($request->menu_name_key) $args->name = $request->menu_name_key;
473 473
 			else $args->name = $request->menu_name;
474 474
 		}
475 475
 		// type is module short cut
476
-		else if(is_numeric($request->shortcut_target))
476
+		else if (is_numeric($request->shortcut_target))
477 477
 		{
478 478
 			// Get original information
479 479
 			$oMenuAdminModel = getAdminModel('menu');
480 480
 			$itemInfo = $oMenuAdminModel->getMenuItemInfo($request->shortcut_target);
481
-			if(!$itemInfo->menu_item_srl)
481
+			if (!$itemInfo->menu_item_srl)
482 482
 			{
483 483
 				return new Object(-1, 'msg_invalid_request');
484 484
 			}
485 485
 			unset($itemInfo->normal_btn, $itemInfo->hover_btn, $itemInfo->active_btn);
486 486
 
487 487
 			$args = $itemInfo;
488
-			if(count($args->group_srls) == 0)
488
+			if (count($args->group_srls) == 0)
489 489
 			{
490 490
 				unset($args->group_srls);
491 491
 			}
@@ -505,13 +505,13 @@  discard block
 block discarded – undo
505 505
 			$args->url = '#';
506 506
 		}
507 507
 
508
-		if($request->menu_desc) $args->desc = $request->menu_desc;
508
+		if ($request->menu_desc) $args->desc = $request->menu_desc;
509 509
 		else $args->desc = '';
510 510
 
511 511
 		$args->menu_item_srl = getNextSequence();
512
-		$args->listorder = -1*$args->menu_item_srl;
512
+		$args->listorder = -1 * $args->menu_item_srl;
513 513
 		$output = executeQuery('menu.insertMenuItem', $args);
514
-		if(!$output->toBool()) return $output;
514
+		if (!$output->toBool()) return $output;
515 515
 
516 516
 		$oDB->commit();
517 517
 
@@ -533,46 +533,46 @@  discard block
 block discarded – undo
533 533
 		$args->expand = $request->menu_expand;
534 534
 		$args->is_shortcut = $request->is_shortcut;
535 535
 
536
-		if(!$args->open_window) $args->open_window = 'N';
537
-		if(!$args->expand) $args->expand = 'N';
538
-		if(!$args->is_shortcut) $args->is_shortcut = 'N';
536
+		if (!$args->open_window) $args->open_window = 'N';
537
+		if (!$args->expand) $args->expand = 'N';
538
+		if (!$args->is_shortcut) $args->is_shortcut = 'N';
539 539
 
540
-		if($request->menu_name_key) $args->name = $request->menu_name_key;
540
+		if ($request->menu_name_key) $args->name = $request->menu_name_key;
541 541
 		else $args->name = $request->menu_name;
542 542
 
543
-		if($request->menu_desc) $args->desc = $request->menu_desc;
543
+		if ($request->menu_desc) $args->desc = $request->menu_desc;
544 544
 		else $args->desc = '';
545 545
 
546
-		if($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
546
+		if ($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
547 547
 		{
548 548
 			return new Object(-1, 'msg_invalid_request');
549 549
 		}
550 550
 
551 551
 		// when menu copy, module already copied
552
-		if($isProc)
552
+		if ($isProc)
553 553
 		{
554 554
 			$result = $this->_insertModule($request, $args);
555
-			if(!$result->toBool())
555
+			if (!$result->toBool())
556 556
 			{
557 557
 				return new Object(-1, $result->message);
558 558
 			}
559 559
 		}
560 560
 
561 561
 		// if setting button variables, set argument button variables for db insert. but not upload in this method
562
-		if($request->normal_btn) $args->normal_btn = $request->normal_btn;
563
-		if($request->hover_btn) $args->hover_btn = $request->hover_btn;
564
-		if($request->active_btn) $args->active_btn = $request->active_btn;
562
+		if ($request->normal_btn) $args->normal_btn = $request->normal_btn;
563
+		if ($request->hover_btn) $args->hover_btn = $request->hover_btn;
564
+		if ($request->active_btn) $args->active_btn = $request->active_btn;
565 565
 
566
-		if(!$request->module_id)
566
+		if (!$request->module_id)
567 567
 		{
568 568
 			return new Object(-1, 'msg_invalid_request');
569 569
 		}
570 570
 
571 571
 		$args->url = $request->module_id;
572 572
 		$args->menu_item_srl = getNextSequence();
573
-		$args->listorder = -1*$args->menu_item_srl;
573
+		$args->listorder = -1 * $args->menu_item_srl;
574 574
 		$output = executeQuery('menu.insertMenuItem', $args);
575
-		if(!$output->toBool()) return $output;
575
+		if (!$output->toBool()) return $output;
576 576
 
577 577
 		$oDB->commit();
578 578
 
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
 
605 605
 		//module create
606 606
 		$site_module_info = Context::get('site_module_info');
607
-		$cmArgs->site_srl = (int)$site_module_info->site_srl;
607
+		$cmArgs->site_srl = (int) $site_module_info->site_srl;
608 608
 		$cmArgs->browser_title = $args->name;
609 609
 		$cmArgs->menu_srl = $request->menu_srl;
610 610
 		$cmArgs->layout_srl = -1;
@@ -612,13 +612,13 @@  discard block
 block discarded – undo
612 612
 		$cmArgs->is_skin_fix = 'N';
613 613
 		$cmArgs->is_mskin_fix = 'N';
614 614
 
615
-		if(Mobile::isMobileEnabled() === true)
615
+		if (Mobile::isMobileEnabled() === true)
616 616
 		{
617 617
 			$cmArgs->use_mobile = 'Y';
618 618
 		}
619 619
 
620 620
 		// if mid is empty, auto create mid
621
-		if(!$request->module_id)
621
+		if (!$request->module_id)
622 622
 		{
623 623
 			$randomMid = $this->_makeRandomMid();
624 624
 			$request->module_id = $cmArgs->module.'_'.$randomMid;
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
 		// check already created module instance
629 629
 		$oModuleModel = getModel('module');
630 630
 		$output = $oModuleModel->getModuleInfoByMid($request->module_id);
631
-		if($output->module_srl)
631
+		if ($output->module_srl)
632 632
 		{
633 633
 			return new Object(-1, 'msg_module_name_exists');
634 634
 		}
@@ -647,14 +647,14 @@  discard block
 block discarded – undo
647 647
 	{
648 648
 		$request = Context::getRequestVars();
649 649
 
650
-		if(!$request->menu_item_srl || !$request->menu_name)
650
+		if (!$request->menu_item_srl || !$request->menu_name)
651 651
 		{
652 652
 			return new Object(-1, 'msg_invalid_request');
653 653
 		}
654 654
 
655 655
 		// variables set
656
-		if($request->menu_open_window != "Y") $request->menu_open_window = "N";
657
-		if($request->menu_expand != "Y") $request->menu_expand = "N";
656
+		if ($request->menu_open_window != "Y") $request->menu_open_window = "N";
657
+		if ($request->menu_expand != "Y") $request->menu_expand = "N";
658 658
 
659 659
 		// Get original information
660 660
 		$oMenuAdminModel = getAdminModel('menu');
@@ -662,19 +662,19 @@  discard block
 block discarded – undo
662 662
 		$args = $itemInfo;
663 663
 
664 664
 		// if menu type is module, check exists module and update
665
-		if($itemInfo->is_shortcut == 'Y')
665
+		if ($itemInfo->is_shortcut == 'Y')
666 666
 		{
667 667
 			// type is url
668
-			if(strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
668
+			if (strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
669 669
 			{
670 670
 				$args->url = $request->shortcut_target;
671 671
 			}
672 672
 			// type is module short cut
673
-			else if(is_numeric($request->shortcut_target))
673
+			else if (is_numeric($request->shortcut_target))
674 674
 			{
675 675
 				// Get new original information
676 676
 				$newItemInfo = $oMenuAdminModel->getMenuItemInfo($request->shortcut_target);
677
-				if(!$newItemInfo->menu_item_srl)
677
+				if (!$newItemInfo->menu_item_srl)
678 678
 				{
679 679
 					return new Object(-1, 'msg_invalid_request');
680 680
 				}
@@ -691,10 +691,10 @@  discard block
 block discarded – undo
691 691
 		{
692 692
 			// check already created module instance
693 693
 			$oModuleModel = getModel('module');
694
-			if($request->module_id != $itemInfo->url)
694
+			if ($request->module_id != $itemInfo->url)
695 695
 			{
696 696
 				$output = $oModuleModel->getModuleInfoByMid($request->module_id);
697
-				if($output->module_srl)
697
+				if ($output->module_srl)
698 698
 				{
699 699
 					return new Object(-1, 'msg_module_name_exists');
700 700
 				}
@@ -702,13 +702,13 @@  discard block
 block discarded – undo
702 702
 
703 703
 			// if not exist module, return error
704 704
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($itemInfo->url);
705
-			if(!$moduleInfo)
705
+			if (!$moduleInfo)
706 706
 			{
707 707
 				return new Object(-1, 'msg_invalid_request');
708 708
 			}
709 709
 
710 710
 			$moduleInfo->mid = $request->module_id;
711
-			if($request->browser_title)
711
+			if ($request->browser_title)
712 712
 			{
713 713
 				$moduleInfo->browser_title = $request->browser_title;
714 714
 			}
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 			$args->url = $request->module_id;
718 718
 		}
719 719
 
720
-		if($request->menu_name_key)
720
+		if ($request->menu_name_key)
721 721
 		{
722 722
 			$args->name = $request->menu_name_key;
723 723
 		}
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
 			$args->name = $request->menu_name;
727 727
 		}
728 728
 
729
-		if($request->menu_desc) $args->desc = $request->menu_desc;
729
+		if ($request->menu_desc) $args->desc = $request->menu_desc;
730 730
 		else $args->desc = '';
731 731
 
732 732
 		unset($args->group_srls);
@@ -754,38 +754,38 @@  discard block
 block discarded – undo
754 754
 
755 755
 		$btnOutput = $this->_uploadButton($args);
756 756
 
757
-		if($btnOutput['normal_btn'])
757
+		if ($btnOutput['normal_btn'])
758 758
 		{
759 759
 			$this->add('normal_btn', $btnOutput['normal_btn']);
760 760
 			$item_info->normal_btn = $btnOutput['normal_btn'];
761 761
 		}
762
-		if($btnOutput['hover_btn'])
762
+		if ($btnOutput['hover_btn'])
763 763
 		{
764 764
 			$this->add('hover_btn', $btnOutput['hover_btn']);
765 765
 			$item_info->hover_btn = $btnOutput['hover_btn'];
766 766
 		}
767
-		if($btnOutput['active_btn'])
767
+		if ($btnOutput['active_btn'])
768 768
 		{
769 769
 			$this->add('active_btn', $btnOutput['active_btn']);
770 770
 			$item_info->active_btn = $btnOutput['active_btn'];
771 771
 		}
772 772
 
773 773
 		// group_srls check
774
-		if(count($item_info->group_srls) == 0)
774
+		if (count($item_info->group_srls) == 0)
775 775
 		{
776 776
 			unset($item_info->group_srls);
777 777
 		}
778 778
 
779 779
 		// Button delete check
780
-		if(!$btnOutput['normal_btn'] && $args->isNormalDelete == 'Y')
780
+		if (!$btnOutput['normal_btn'] && $args->isNormalDelete == 'Y')
781 781
 		{
782 782
 			$item_info->normal_btn = '';
783 783
 		}
784
-		if(!$btnOutput['hover_btn'] && $args->isHoverDelete == 'Y')
784
+		if (!$btnOutput['hover_btn'] && $args->isHoverDelete == 'Y')
785 785
 		{
786 786
 			$item_info->hover_btn = '';
787 787
 		}
788
-		if(!$btnOutput['active_btn'] && $args->isActiveDelete == 'Y')
788
+		if (!$btnOutput['active_btn'] && $args->isActiveDelete == 'Y')
789 789
 		{
790 790
 			$item_info->active_btn = '';
791 791
 		}
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
 		$args->is_force = Context::get('is_force');
826 826
 
827 827
 		$returnObj = $this->deleteItem($args);
828
-		if(is_object($returnObj))
828
+		if (is_object($returnObj))
829 829
 		{
830 830
 			$this->setError($returnObj->error);
831 831
 			$this->setMessage($returnObj->message);
@@ -854,11 +854,11 @@  discard block
 block discarded – undo
854 854
 		$args->menu_srl = $itemInfo->menu_srl;
855 855
 
856 856
 		// Display an error that the category cannot be deleted if it has a child node	603
857
-		if($args->is_force != 'Y')
857
+		if ($args->is_force != 'Y')
858 858
 		{
859 859
 			$output = executeQuery('menu.getChildMenuCount', $args);
860
-			if(!$output->toBool()) return $output;
861
-			if($output->data->count > 0)
860
+			if (!$output->toBool()) return $output;
861
+			if ($output->data->count > 0)
862 862
 			{
863 863
 				return new Object(-1001, 'msg_cannot_delete_for_child');
864 864
 			}
@@ -870,22 +870,22 @@  discard block
 block discarded – undo
870 870
 
871 871
 		// check admin menu delete
872 872
 		$oAdmin = getClass('admin');
873
-		if($menu_title == $oAdmin->getAdminMenuName() && $itemInfo->parent_srl == 0)
873
+		if ($menu_title == $oAdmin->getAdminMenuName() && $itemInfo->parent_srl == 0)
874 874
 		{
875 875
 			return $this->stop('msg_cannot_delete_for_admin_topmenu');
876 876
 		}
877 877
 
878
-		if($itemInfo->parent_srl) $parent_srl = $itemInfo->parent_srl;
878
+		if ($itemInfo->parent_srl) $parent_srl = $itemInfo->parent_srl;
879 879
 
880 880
 		// get menu properies with child menu
881 881
 		$phpFile = sprintf("./files/cache/menu/%s.php", $args->menu_srl);
882 882
 		$originMenu = NULL;
883 883
 
884
-		if(is_readable(FileHandler::getRealPath($phpFile)))
884
+		if (is_readable(FileHandler::getRealPath($phpFile)))
885 885
 		{
886 886
 			include(FileHandler::getRealPath($phpFile));
887 887
 
888
-			if(is_array($menu->list))
888
+			if (is_array($menu->list))
889 889
 			{
890 890
 				$this->_searchMenu($menu->list, $args->menu_item_srl, $originMenu);
891 891
 			}
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
 		$siteInfo = $oModuleModel->getSiteInfo($menuInfo->site_srl);
896 896
 		$isStartmenuInclude = false;
897 897
 		$this->_checkHomeMenuInOriginMenu($originMenu, $siteInfo->mid, $isStartmenuInclude);
898
-		if($isStartmenuInclude)
898
+		if ($isStartmenuInclude)
899 899
 		{
900 900
 			return new Object(-1, 'msg_cannot_delete_homemenu');
901 901
 		}
@@ -919,14 +919,14 @@  discard block
 block discarded – undo
919 919
 
920 920
 	private function _checkHomeMenuInOriginMenu($originMenu, $startMid, &$isStartmenuInclude)
921 921
 	{
922
-		if($originMenu['is_shortcut'] != 'Y' && $originMenu['url'] == $startMid)
922
+		if ($originMenu['is_shortcut'] != 'Y' && $originMenu['url'] == $startMid)
923 923
 		{
924 924
 			$isStartmenuInclude = true;
925 925
 		}
926 926
 
927
-		if(!$isStartmenuInclude && is_array($originMenu['list']))
927
+		if (!$isStartmenuInclude && is_array($originMenu['list']))
928 928
 		{
929
-			foreach($originMenu['list'] AS $key=>$value)
929
+			foreach ($originMenu['list'] AS $key=>$value)
930 930
 			{
931 931
 				$this->_checkHomeMenuInOriginMenu($value, $startMid, $isStartmenuInclude);
932 932
 			}
@@ -940,7 +940,7 @@  discard block
 block discarded – undo
940 940
 		$args->menu_srl = $menuSrl;
941 941
 		$args->menu_item_srl = $node['node_srl'];
942 942
 		$output = executeQuery("menu.deleteMenuItem", $args);
943
-		if(!$output->toBool())
943
+		if (!$output->toBool())
944 944
 		{
945 945
 			$oDB->rollback();
946 946
 			return $output;
@@ -949,12 +949,12 @@  discard block
 block discarded – undo
949 949
 		// Update the xml file and get its location
950 950
 		$xml_file = $this->makeXmlFile($args->menu_srl);
951 951
 		// Delete all of image buttons
952
-		if($node['normal_btn']) FileHandler::removeFile($node['normal_btn']);
953
-		if($node['hover_btn']) FileHandler::removeFile($node['hover_btn']);
954
-		if($node['active_btn']) FileHandler::removeFile($node['active_btn']);
952
+		if ($node['normal_btn']) FileHandler::removeFile($node['normal_btn']);
953
+		if ($node['hover_btn']) FileHandler::removeFile($node['hover_btn']);
954
+		if ($node['active_btn']) FileHandler::removeFile($node['active_btn']);
955 955
 
956 956
 		// Delete module
957
-		if($node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
957
+		if ($node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
958 958
 		{
959 959
 			$oModuleController = getController('module');
960 960
 			$oModuleModel = getModel('module');
@@ -964,12 +964,12 @@  discard block
 block discarded – undo
964 964
 			$args->site_srl = $menuInfo->site_srl;
965 965
 			$args->is_shortcut = 'Y';
966 966
 			$output = executeQuery('menu.getMenuItemByUrl', $args);
967
-			if($output->data->menu_item_srl)
967
+			if ($output->data->menu_item_srl)
968 968
 			{
969 969
 				$output->data->url = '';
970 970
 				$referenceItem = $output->data;
971 971
 				$output = $this->_updateMenuItem($referenceItem);
972
-				if(!$output->toBool())
972
+				if (!$output->toBool())
973 973
 				{
974 974
 					$oDB->rollback();
975 975
 					return $output;
@@ -977,10 +977,10 @@  discard block
 block discarded – undo
977 977
 			}
978 978
 
979 979
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($node['url'], $menuInfo->site_srl);
980
-			if($moduleInfo->module_srl)
980
+			if ($moduleInfo->module_srl)
981 981
 			{
982 982
 				$output = $oModuleController->onlyDeleteModule($moduleInfo->module_srl);
983
-				if(!$output->toBool())
983
+				if (!$output->toBool())
984 984
 				{
985 985
 					$oDB->rollback();
986 986
 					return $output;
@@ -993,14 +993,14 @@  discard block
 block discarded – undo
993 993
 	private function _recursiveDeleteMenuItem(&$oDB, &$menuInfo, $node)
994 994
 	{
995 995
 		$output = $this->_deleteMenuItem($oDB, $menuInfo, $node);
996
-		if(!$output->toBool())
996
+		if (!$output->toBool())
997 997
 		{
998 998
 			return new Object(-1, $output->message);
999 999
 		}
1000 1000
 
1001
-		if(is_array($node['list']))
1001
+		if (is_array($node['list']))
1002 1002
 		{
1003
-			foreach($node['list'] AS $key=>$value)
1003
+			foreach ($node['list'] AS $key=>$value)
1004 1004
 			{
1005 1005
 				$this->_recursiveDeleteMenuItem($oDB, $menuInfo, $value);
1006 1006
 			}
@@ -1013,31 +1013,31 @@  discard block
 block discarded – undo
1013 1013
 	 */
1014 1014
 	function procMenuAdminMoveItem()
1015 1015
 	{
1016
-		$mode = Context::get('mode');	//move
1017
-		$parent_srl = Context::get('parent_srl');	// Parent menu item serial number
1018
-		$source_srl = Context::get('source_srl');	// Same hierarchy's menu item serial number
1019
-		$target_srl = Context::get('target_srl');	// Self menu item serial number
1016
+		$mode = Context::get('mode'); //move
1017
+		$parent_srl = Context::get('parent_srl'); // Parent menu item serial number
1018
+		$source_srl = Context::get('source_srl'); // Same hierarchy's menu item serial number
1019
+		$target_srl = Context::get('target_srl'); // Self menu item serial number
1020 1020
 
1021
-		if(!$mode || !$parent_srl || !$target_srl) return new Object(-1,'msg_invalid_request');
1021
+		if (!$mode || !$parent_srl || !$target_srl) return new Object(-1, 'msg_invalid_request');
1022 1022
 
1023 1023
 		$oMenuAdminModel = getAdminModel('menu');
1024 1024
 
1025 1025
 		// get original menu item info for cache file recreate
1026 1026
 		$originalItemInfo = $oMenuAdminModel->getMenuItemInfo($target_srl);
1027
-		if(!$originalItemInfo->menu_item_srl)
1027
+		if (!$originalItemInfo->menu_item_srl)
1028 1028
 		{
1029 1029
 			return new Object(-1, 'msg_empty_menu_item');
1030 1030
 		}
1031 1031
 
1032 1032
 		// get menu properies with child menu
1033
-		$phpFile = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $originalItemInfo->menu_srl);
1033
+		$phpFile = sprintf(_XE_PATH_."files/cache/menu/%s.php", $originalItemInfo->menu_srl);
1034 1034
 		$originMenu = NULL;
1035 1035
 
1036
-		if(is_readable(FileHandler::getRealPath($phpFile)))
1036
+		if (is_readable(FileHandler::getRealPath($phpFile)))
1037 1037
 		{
1038 1038
 			include(FileHandler::getRealPath($phpFile));
1039 1039
 
1040
-			if(is_array($menu->list))
1040
+			if (is_array($menu->list))
1041 1041
 			{
1042 1042
 				$this->_searchMenu($menu->list, $originalItemInfo->menu_item_srl, $originMenu);
1043 1043
 			}
@@ -1046,7 +1046,7 @@  discard block
 block discarded – undo
1046 1046
 		// get target menu info for move
1047 1047
 		$targetMenuItemInfo = $oMenuAdminModel->getMenuItemInfo($parent_srl);
1048 1048
 		// if move in same sitemap
1049
-		if($targetMenuItemInfo->menu_item_srl)
1049
+		if ($targetMenuItemInfo->menu_item_srl)
1050 1050
 		{
1051 1051
 			$menu_srl = $targetMenuItemInfo->menu_srl;
1052 1052
 		}
@@ -1058,20 +1058,20 @@  discard block
 block discarded – undo
1058 1058
 			$parent_srl = 0;
1059 1059
 		}
1060 1060
 
1061
-		if(!$this->homeModuleMid)
1061
+		if (!$this->homeModuleMid)
1062 1062
 		{
1063 1063
 			$oModuleModel = getModel('module');
1064 1064
 			$oMenuAdminController = getAdminController('menu');
1065 1065
 			$columnList = array('modules.mid',);
1066 1066
 			$output = $oModuleModel->getSiteInfo(0, $columnList);
1067
-			if($output->mid)
1067
+			if ($output->mid)
1068 1068
 			{
1069 1069
 				$this->homeModuleMid = $output->mid;
1070 1070
 			}
1071 1071
 		}
1072 1072
 
1073 1073
 		$this->moveMenuItem($menu_srl, $parent_srl, $source_srl, $target_srl, $mode, $originMenu['is_shortcut'], $originMenu['url']);
1074
-		if(count($originMenu['list']) > 0)
1074
+		if (count($originMenu['list']) > 0)
1075 1075
 		{
1076 1076
 			$this->_recursiveUpdateMenuItem($originMenu['list'], $menu_srl);
1077 1077
 		}
@@ -1085,9 +1085,9 @@  discard block
 block discarded – undo
1085 1085
 
1086 1086
 	private function _recursiveUpdateMenuItem($node, $menu_srl)
1087 1087
 	{
1088
-		if(is_array($node))
1088
+		if (is_array($node))
1089 1089
 		{
1090
-			foreach($node AS $key=>$node)
1090
+			foreach ($node AS $key=>$node)
1091 1091
 			{
1092 1092
 				$args = new stdClass();
1093 1093
 				$args->menu_srl = $menu_srl;
@@ -1095,11 +1095,11 @@  discard block
 block discarded – undo
1095 1095
 				$output = $this->_updateMenuItem($args);
1096 1096
 
1097 1097
 				//module's menu_srl move also
1098
-				if($node['is_shortcut'] == 'N' && !empty($node['url']))
1098
+				if ($node['is_shortcut'] == 'N' && !empty($node['url']))
1099 1099
 				{
1100 1100
 					$oModuleModel = getModel('module');
1101 1101
 					$moduleInfo = $oModuleModel->getModuleInfoByMid($node['url']);
1102
-					if($menu_srl != $moduleInfo->menu_srl)
1102
+					if ($menu_srl != $moduleInfo->menu_srl)
1103 1103
 					{
1104 1104
 						$moduleInfo->menu_srl = $menu_srl;
1105 1105
 						$oModuleController = getController('module');
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
 					}
1108 1108
 				}
1109 1109
 
1110
-				if(count($node['list']) > 0)
1110
+				if (count($node['list']) > 0)
1111 1111
 				{
1112 1112
 					$this->_recursiveUpdateMenuItem($node['list'], $menu_srl);
1113 1113
 				}
@@ -1129,21 +1129,21 @@  discard block
 block discarded – undo
1129 1129
 		$menuSrl = $itemInfo->menu_srl;
1130 1130
 
1131 1131
 		// get menu properies with child menu
1132
-		$phpFile = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menuSrl);
1132
+		$phpFile = sprintf(_XE_PATH_."files/cache/menu/%s.php", $menuSrl);
1133 1133
 		$originMenu = NULL;
1134 1134
 
1135
-		if(is_readable(FileHandler::getRealPath($phpFile)))
1135
+		if (is_readable(FileHandler::getRealPath($phpFile)))
1136 1136
 		{
1137 1137
 			include(FileHandler::getRealPath($phpFile));
1138 1138
 
1139
-			if(is_array($menu->list))
1139
+			if (is_array($menu->list))
1140 1140
 			{
1141 1141
 				$this->_searchMenu($menu->list, $menuItemSrl, $originMenu);
1142 1142
 			}
1143 1143
 		}
1144 1144
 
1145 1145
 		// copy the menu item with recursively
1146
-		if(is_array($originMenu))
1146
+		if (is_array($originMenu))
1147 1147
 		{
1148 1148
 			$this->_copyMenu($menuSrl, $parentSrl, $originMenu);
1149 1149
 		}
@@ -1159,15 +1159,15 @@  discard block
 block discarded – undo
1159 1159
 	 */
1160 1160
 	private function _searchMenu(&$menuList, $menuItemSrl, &$originMenu)
1161 1161
 	{
1162
-		if(array_key_exists($menuItemSrl, $menuList))
1162
+		if (array_key_exists($menuItemSrl, $menuList))
1163 1163
 		{
1164 1164
 			$originMenu = $menuList[$menuItemSrl];
1165 1165
 			return;
1166 1166
 		}
1167 1167
 
1168
-		foreach($menuList AS $key=>$value)
1168
+		foreach ($menuList AS $key=>$value)
1169 1169
 		{
1170
-			if(count($value['list']) > 0)
1170
+			if (count($value['list']) > 0)
1171 1171
 			{
1172 1172
 				$this->_searchMenu($value['list'], $menuItemSrl, $originMenu);
1173 1173
 			}
@@ -1182,7 +1182,7 @@  discard block
 block discarded – undo
1182 1182
 		// default argument setting
1183 1183
 		$args = new stdClass();
1184 1184
 		$args->menu_srl = $menuSrl;
1185
-		if($parentSrl == 0) $args->parent_srl = $menuSrl;
1185
+		if ($parentSrl == 0) $args->parent_srl = $menuSrl;
1186 1186
 		else $args->parent_srl = $parentSrl;
1187 1187
 		$args->menu_name_key = $originMenu['text'];
1188 1188
 		$args->menu_name = $originMenu['text'];
@@ -1195,7 +1195,7 @@  discard block
 block discarded – undo
1195 1195
 
1196 1196
 		$isModuleCopySuccess = false;
1197 1197
 		// if menu have a reference of module instance
1198
-		if($menuItemInfo->is_shortcut == 'N' && strncasecmp('http', $originMenu['url'], 4) !== 0 )
1198
+		if ($menuItemInfo->is_shortcut == 'N' && strncasecmp('http', $originMenu['url'], 4) !== 0)
1199 1199
 		{
1200 1200
 			$oModuleModel = getModel('module');
1201 1201
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($originMenu['url']);
@@ -1215,22 +1215,22 @@  discard block
 block discarded – undo
1215 1215
 
1216 1216
 			$args->module_srl = $copiedModuleSrl;
1217 1217
 
1218
-			if($copiedModuleSrl)
1218
+			if ($copiedModuleSrl)
1219 1219
 			{
1220 1220
 				$isModuleCopySuccess = true;
1221 1221
 			}
1222 1222
 		}
1223 1223
 		// if menu type is shortcut
1224
-		else if($menuItemInfo->is_shortcut == 'Y')
1224
+		else if ($menuItemInfo->is_shortcut == 'Y')
1225 1225
 		{
1226 1226
 			$args->shortcut_target = $originMenu['url'];
1227 1227
 			$isModuleCopySuccess = true;
1228 1228
 		}
1229 1229
 
1230
-		if($isModuleCopySuccess)
1230
+		if ($isModuleCopySuccess)
1231 1231
 		{
1232 1232
 			// if have a group permission
1233
-			if($menuItemInfo->group_srls)
1233
+			if ($menuItemInfo->group_srls)
1234 1234
 			{
1235 1235
 				$args->group_srls = $menuItemInfo->group_srls;
1236 1236
 			}
@@ -1244,12 +1244,12 @@  discard block
 block discarded – undo
1244 1244
 
1245 1245
 			// if have a button, copy a button image also
1246 1246
 			$insertedMenuItemSrl = $this->get('menu_item_srl');
1247
-			if($menuItemInfo->normal_btn || $menuItemInfo->hover_btn || $menuItemInfo->active_btn)
1247
+			if ($menuItemInfo->normal_btn || $menuItemInfo->hover_btn || $menuItemInfo->active_btn)
1248 1248
 			{
1249 1249
 				// copy & upate
1250 1250
 				$update_item_info = $oMenuAdminModel->getMenuItemInfo($insertedMenuItemSrl);
1251
-				$copied_info = $this->_copyButton($insertedMenuItemSrl,$update_item_info->menu_srl, $menuItemInfo);
1252
-				if(count($update_item_info->group_srls) == 0)
1251
+				$copied_info = $this->_copyButton($insertedMenuItemSrl, $update_item_info->menu_srl, $menuItemInfo);
1252
+				if (count($update_item_info->group_srls) == 0)
1253 1253
 				{
1254 1254
 					unset($update_item_info->group_srls);
1255 1255
 				}
@@ -1263,7 +1263,7 @@  discard block
 block discarded – undo
1263 1263
 
1264 1264
 		// if have a child menu, copy child menu also
1265 1265
 		$childMenu = array_shift($originMenu['list']);
1266
-		if(count($childMenu) > 0)
1266
+		if (count($childMenu) > 0)
1267 1267
 		{
1268 1268
 			$this->_copyMenu($menuSrl, $insertedMenuItemSrl, $childMenu);
1269 1269
 		}
@@ -1273,10 +1273,10 @@  discard block
 block discarded – undo
1273 1273
 	{
1274 1274
 		$time = $_SERVER['REQUEST_TIME'];
1275 1275
 		$randomString = "";
1276
-		for($i=0;$i<4;$i++)
1276
+		for ($i = 0; $i < 4; $i++)
1277 1277
 		{
1278 1278
 			$case = rand(0, 1);
1279
-			if($case) $doc = rand(65, 90);
1279
+			if ($case) $doc = rand(65, 90);
1280 1280
 			else $doc = rand(97, 122);
1281 1281
 
1282 1282
 			$randomString .= chr($doc);
@@ -1300,32 +1300,32 @@  discard block
 block discarded – undo
1300 1300
 		// menu name update
1301 1301
 		$args->menu_srl = $this->menuSrl;
1302 1302
 		$output = executeQuery('menu.updateMenu', $args);
1303
-		if(!$output->toBool()) return $output;
1303
+		if (!$output->toBool()) return $output;
1304 1304
 
1305 1305
 		$this->map = array();
1306
-		if(is_array($parentKeyList))
1306
+		if (is_array($parentKeyList))
1307 1307
 		{
1308
-			foreach($parentKeyList as $no=>$srl)
1308
+			foreach ($parentKeyList as $no=>$srl)
1309 1309
 			{
1310
-				if($srl === 0) continue;
1311
-				if(!is_array($this->map[$srl]))$this->map[$srl] = array();
1310
+				if ($srl === 0) continue;
1311
+				if (!is_array($this->map[$srl]))$this->map[$srl] = array();
1312 1312
 				$this->map[$srl][] = $no;
1313 1313
 			}
1314 1314
 		}
1315 1315
 
1316 1316
 		$result = array();
1317
-		if(is_array($this->itemKeyList))
1317
+		if (is_array($this->itemKeyList))
1318 1318
 		{
1319
-			foreach($this->itemKeyList as $srl)
1319
+			foreach ($this->itemKeyList as $srl)
1320 1320
 			{
1321
-				if(!$this->checked[$srl])
1321
+				if (!$this->checked[$srl])
1322 1322
 				{
1323 1323
 					$target = new stdClass();
1324 1324
 					$this->checked[$srl] = 1;
1325 1325
 					$target->node = $srl;
1326
-					$target->child= array();
1326
+					$target->child = array();
1327 1327
 
1328
-					while(count($this->map[$srl]))
1328
+					while (count($this->map[$srl]))
1329 1329
 					{
1330 1330
 						$this->_setParent($srl, array_shift($this->map[$srl]), $target);
1331 1331
 					}
@@ -1334,13 +1334,13 @@  discard block
 block discarded – undo
1334 1334
 			}
1335 1335
 		}
1336 1336
 
1337
-		if(is_array($result))
1337
+		if (is_array($result))
1338 1338
 		{
1339 1339
 			$i = 0;
1340
-			foreach($result AS $key=>$node)
1340
+			foreach ($result AS $key=>$node)
1341 1341
 			{
1342
-				$this->moveMenuItem($this->menuSrl, 0, $i, $node->node, 'move');	//move parent node
1343
-				$this->_recursiveMoveMenuItem($node);	//move child node
1342
+				$this->moveMenuItem($this->menuSrl, 0, $i, $node->node, 'move'); //move parent node
1343
+				$this->_recursiveMoveMenuItem($node); //move child node
1344 1344
 				$i = $node->node;
1345 1345
 			}
1346 1346
 		}
@@ -1369,7 +1369,7 @@  discard block
 block discarded – undo
1369 1369
 		$child_node->child = array();
1370 1370
 		$target->child[] = $child_node;
1371 1371
 
1372
-		while(count($this->map[$child_srl]))
1372
+		while (count($this->map[$child_srl]))
1373 1373
 		{
1374 1374
 			$this->_setParent($child_srl, array_shift($this->map[$child_srl]), $child_node);
1375 1375
 		}
@@ -1384,7 +1384,7 @@  discard block
 block discarded – undo
1384 1384
 	function _recursiveMoveMenuItem($result)
1385 1385
 	{
1386 1386
 		$i = 0;
1387
-		while(count($result->child))
1387
+		while (count($result->child))
1388 1388
 		{
1389 1389
 			unset($node);
1390 1390
 			$node = array_shift($result->child);
@@ -1404,48 +1404,48 @@  discard block
 block discarded – undo
1404 1404
 	 * @param string $mode 'move' or 'insert'
1405 1405
 	 * @return void
1406 1406
 	 */
1407
-	function moveMenuItem($menu_srl, $parent_srl, $source_srl, $target_srl, $mode, $isShortcut='Y', $url=NULL)
1407
+	function moveMenuItem($menu_srl, $parent_srl, $source_srl, $target_srl, $mode, $isShortcut = 'Y', $url = NULL)
1408 1408
 	{
1409 1409
 		// Get the original menus
1410 1410
 		$oMenuAdminModel = getAdminModel('menu');
1411 1411
 
1412 1412
 		$target_item = $oMenuAdminModel->getMenuItemInfo($target_srl);
1413
-		if($target_item->menu_item_srl != $target_srl) return new Object(-1,'msg_invalid_request');
1413
+		if ($target_item->menu_item_srl != $target_srl) return new Object(-1, 'msg_invalid_request');
1414 1414
 		// Move the menu location(change the order menu appears)
1415
-		if($mode == 'move')
1415
+		if ($mode == 'move')
1416 1416
 		{
1417 1417
 			$args = new stdClass();
1418 1418
 			$args->parent_srl = $parent_srl;
1419 1419
 			$args->menu_srl = $menu_srl;
1420 1420
 
1421
-			if($source_srl)
1421
+			if ($source_srl)
1422 1422
 			{
1423 1423
 				$source_item = $oMenuAdminModel->getMenuItemInfo($source_srl);
1424
-				if($source_item->menu_item_srl != $source_srl) return new Object(-1,'msg_invalid_request');
1425
-				$args->listorder = $source_item->listorder-1;
1424
+				if ($source_item->menu_item_srl != $source_srl) return new Object(-1, 'msg_invalid_request');
1425
+				$args->listorder = $source_item->listorder - 1;
1426 1426
 			}
1427 1427
 			else
1428 1428
 			{
1429 1429
 				$output = executeQuery('menu.getMaxListorder', $args);
1430
-				if(!$output->toBool()) return $output;
1431
-				$args->listorder = (int)$output->data->listorder;
1432
-				if(!$args->listorder) $args->listorder= 0;
1430
+				if (!$output->toBool()) return $output;
1431
+				$args->listorder = (int) $output->data->listorder;
1432
+				if (!$args->listorder) $args->listorder = 0;
1433 1433
 			}
1434 1434
 			$args->parent_srl = $parent_srl;
1435 1435
 			$output = executeQuery('menu.updateMenuItemListorder', $args);
1436
-			if(!$output->toBool()) return $output;
1436
+			if (!$output->toBool()) return $output;
1437 1437
 
1438 1438
 			$args->parent_srl = $parent_srl;
1439 1439
 			$args->menu_item_srl = $target_srl;
1440 1440
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1441
-			if(!$output->toBool()) return $output;
1441
+			if (!$output->toBool()) return $output;
1442 1442
 
1443 1443
 			//module's menu_srl move also
1444
-			if($isShortcut == 'N' && !empty($url))
1444
+			if ($isShortcut == 'N' && !empty($url))
1445 1445
 			{
1446 1446
 				$oModuleModel = getModel('module');
1447 1447
 				$moduleInfo = $oModuleModel->getModuleInfoByMid($url);
1448
-				if($menu_srl != $moduleInfo->menu_srl)
1448
+				if ($menu_srl != $moduleInfo->menu_srl)
1449 1449
 				{
1450 1450
 					$moduleInfo->menu_srl = $menu_srl;
1451 1451
 					$oModuleController = getController('module');
@@ -1453,13 +1453,13 @@  discard block
 block discarded – undo
1453 1453
 				}
1454 1454
 
1455 1455
 				// change home menu cache file
1456
-				if($url == $this->homeModuleMid)
1456
+				if ($url == $this->homeModuleMid)
1457 1457
 				{
1458
-					if(file_exists($this->homeMenuCacheFile))
1458
+					if (file_exists($this->homeMenuCacheFile))
1459 1459
 					{
1460 1460
 						include($this->homeMenuCacheFile);
1461 1461
 					}
1462
-					if(!$homeMenuSrl || $homeMenuSrl != $menu_srl)
1462
+					if (!$homeMenuSrl || $homeMenuSrl != $menu_srl)
1463 1463
 					{
1464 1464
 						$this->makeHomemenuCacheFile($menu_srl);
1465 1465
 					}
@@ -1467,13 +1467,13 @@  discard block
 block discarded – undo
1467 1467
 			}
1468 1468
 			// Add a child
1469 1469
 		}
1470
-		elseif($mode == 'insert')
1470
+		elseif ($mode == 'insert')
1471 1471
 		{
1472 1472
 			$args->menu_item_srl = $target_srl;
1473 1473
 			$args->parent_srl = $parent_srl;
1474
-			$args->listorder = -1*getNextSequence();
1474
+			$args->listorder = -1 * getNextSequence();
1475 1475
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1476
-			if(!$output->toBool()) return $output;
1476
+			if (!$output->toBool()) return $output;
1477 1477
 		}
1478 1478
 
1479 1479
 		$xml_file = $this->makeXmlFile($menu_srl);
@@ -1498,8 +1498,8 @@  discard block
 block discarded – undo
1498 1498
 		// Re-generate the xml file
1499 1499
 		$xml_file = $this->makeXmlFile($menu_srl);
1500 1500
 		// Set return value
1501
-		$this->add('menu_title',$menu_title);
1502
-		$this->add('xml_file',$xml_file);
1501
+		$this->add('menu_title', $menu_title);
1502
+		$this->add('xml_file', $xml_file);
1503 1503
 	}
1504 1504
 
1505 1505
 	/**
@@ -1513,12 +1513,12 @@  discard block
 block discarded – undo
1513 1513
 		$target = Context::get('target');
1514 1514
 		$target_file = Context::get($target);
1515 1515
 		// Error occurs when the target is neither a uploaded file nor a valid file
1516
-		if(!$menu_srl || !$menu_item_srl)
1516
+		if (!$menu_srl || !$menu_item_srl)
1517 1517
 		{
1518 1518
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1519 1519
 
1520 1520
 		}
1521
-		else if(!$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)$/i',$target_file['name'])  || !checkUploadedFile($target_file['tmp_name']))
1521
+		else if (!$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)$/i', $target_file['name']) || !checkUploadedFile($target_file['tmp_name']))
1522 1522
 		{
1523 1523
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1524 1524
 		}
@@ -1526,13 +1526,13 @@  discard block
 block discarded – undo
1526 1526
 		// Move the file to a specific director if the uploaded file meets requirement
1527 1527
 		else
1528 1528
 		{
1529
-			$tmp_arr = explode('.',$target_file['name']);
1530
-			$ext = $tmp_arr[count($tmp_arr)-1];
1529
+			$tmp_arr = explode('.', $target_file['name']);
1530
+			$ext = $tmp_arr[count($tmp_arr) - 1];
1531 1531
 
1532 1532
 			$path = sprintf('./files/attach/menu_button/%d/', $menu_srl);
1533 1533
 			$filename = sprintf('%s%d.%s.%s', $path, $menu_item_srl, $target, $ext);
1534 1534
 
1535
-			if(!is_dir($path)) FileHandler::makeDir($path);
1535
+			if (!is_dir($path)) FileHandler::makeDir($path);
1536 1536
 
1537 1537
 			move_uploaded_file($target_file['tmp_name'], $filename);
1538 1538
 			Context::set('filename', $filename);
@@ -1565,14 +1565,14 @@  discard block
 block discarded – undo
1565 1565
 	{
1566 1566
 		$oModuleModel = getModel('module');
1567 1567
 		$installed_module_list = $oModuleModel->getModulesXmlInfo();
1568
-		if(is_array($installed_module_list))
1568
+		if (is_array($installed_module_list))
1569 1569
 		{
1570 1570
 			$currentLang = Context::getLangType();
1571 1571
 			$menuList = array();
1572
-			foreach($installed_module_list AS $key=>$value)
1572
+			foreach ($installed_module_list AS $key=>$value)
1573 1573
 			{
1574 1574
 				$info = $oModuleModel->getModuleActionXml($value->module);
1575
-				if($info->menu) $menuList[$value->module] = $info->menu;
1575
+				if ($info->menu) $menuList[$value->module] = $info->menu;
1576 1576
 				unset($info->menu);
1577 1577
 			}
1578 1578
 		}
@@ -1604,8 +1604,8 @@  discard block
 block discarded – undo
1604 1604
 		$info = $oModuleModel->getModuleActionXml($moduleName);
1605 1605
 
1606 1606
 		$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->menu->{$menuName}->index);
1607
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1608
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');
1607
+		if (empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1608
+		if (empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');
1609 1609
 		$dbInfo = Context::getDBInfo();
1610 1610
 
1611 1611
 		$args = new stdClass();
@@ -1614,7 +1614,7 @@  discard block
 block discarded – undo
1614 1614
 		$args->menu_srl = $requestArgs->menu_srl;
1615 1615
 		$args->name = sprintf('{$lang->menu_gnb_sub[\'%s\']}', $menuName);
1616 1616
 		//if now page is https...
1617
-		if(strpos($url, 'https') !== false)
1617
+		if (strpos($url, 'https') !== false)
1618 1618
 		{
1619 1619
 			$args->url = str_replace('https'.substr($dbInfo->default_url, 4), '', $url);
1620 1620
 		}
@@ -1628,23 +1628,23 @@  discard block
 block discarded – undo
1628 1628
 		$args->hover_btn = '';
1629 1629
 		$args->active_btn = '';
1630 1630
 		$args->group_srls = implode(',', array_keys($groupSrlList));
1631
-		$args->listorder = -1*$args->menu_item_srl;
1631
+		$args->listorder = -1 * $args->menu_item_srl;
1632 1632
 
1633 1633
 		// Check if already exists
1634 1634
 		$oMenuModel = getAdminModel('menu');
1635 1635
 		$item_info = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
1636 1636
 		// Update if exists
1637
-		if($item_info->menu_item_srl == $args->menu_item_srl)
1637
+		if ($item_info->menu_item_srl == $args->menu_item_srl)
1638 1638
 		{
1639 1639
 			$output = $this->_updateMenuItem($args);
1640
-			if(!$output->toBool()) return $output;
1640
+			if (!$output->toBool()) return $output;
1641 1641
 		}
1642 1642
 		// Insert if not exist
1643 1643
 		else
1644 1644
 		{
1645
-			$args->listorder = -1*$args->menu_item_srl;
1645
+			$args->listorder = -1 * $args->menu_item_srl;
1646 1646
 			$output = executeQuery('menu.insertMenuItem', $args);
1647
-			if(!$output->toBool()) return $output;
1647
+			if (!$output->toBool()) return $output;
1648 1648
 		}
1649 1649
 		// Get information of the menu
1650 1650
 		$menu_info = $oMenuModel->getMenu($args->menu_srl);
@@ -1672,23 +1672,23 @@  discard block
 block discarded – undo
1672 1672
 
1673 1673
 		// Menu Exposure update
1674 1674
 		// if exposure target is only login user...
1675
-		if(!$exposure)
1675
+		if (!$exposure)
1676 1676
 		{
1677 1677
 			$args->group_srls = '';
1678 1678
 		}
1679 1679
 		else
1680 1680
 		{
1681 1681
 			$exposure = explode(',', $exposure);
1682
-			if(in_array($exposure, array('-1','-3')))
1682
+			if (in_array($exposure, array('-1', '-3')))
1683 1683
 			{
1684 1684
 				$args->group_srls = $exposure;
1685 1685
 			}
1686 1686
 
1687
-			if($exposure) $args->group_srls = implode(',', $exposure);
1687
+			if ($exposure) $args->group_srls = implode(',', $exposure);
1688 1688
 		}
1689 1689
 
1690 1690
 		$output = $this->_updateMenuItem($args);
1691
-		if(!$output->toBool())
1691
+		if (!$output->toBool())
1692 1692
 		{
1693 1693
 			return $output;
1694 1694
 		}
@@ -1704,7 +1704,7 @@  discard block
 block discarded – undo
1704 1704
 		$xml_info = $oModuleModel->getModuleActionXML($moduleInfo->module);
1705 1705
 
1706 1706
 		$grantList = $xml_info->grant;
1707
-		if(!$grantList) $grantList = new stdClass;
1707
+		if (!$grantList) $grantList = new stdClass;
1708 1708
 
1709 1709
 		$grantList->access = new stdClass();
1710 1710
 		$grantList->access->default = 'guest';
@@ -1712,9 +1712,9 @@  discard block
 block discarded – undo
1712 1712
 		$grantList->manager->default = 'manager';
1713 1713
 
1714 1714
 		$grant = new stdClass;
1715
-		foreach($grantList AS $grantName=>$grantInfo)
1715
+		foreach ($grantList AS $grantName=>$grantInfo)
1716 1716
 		{
1717
-			if(!$htPerm[$grantName])
1717
+			if (!$htPerm[$grantName])
1718 1718
 			{
1719 1719
 				continue;
1720 1720
 			}
@@ -1722,7 +1722,7 @@  discard block
 block discarded – undo
1722 1722
 			$htPerm[$grantName] = explode(',', $htPerm[$grantName]);
1723 1723
 
1724 1724
 			// users in a particular group
1725
-			if(is_array($htPerm[$grantName]))
1725
+			if (is_array($htPerm[$grantName]))
1726 1726
 			{
1727 1727
 				$grant->{$grantName} = $htPerm[$grantName];
1728 1728
 				continue;
@@ -1736,7 +1736,7 @@  discard block
 block discarded – undo
1736 1736
 			$grant->{$group_srls} = array();
1737 1737
 		}
1738 1738
 
1739
-		if(count($grant))
1739
+		if (count($grant))
1740 1740
 		{
1741 1741
 			$oModuleController = getController('module');
1742 1742
 			$oModuleController->insertModuleGrants($moduleInfo->module_srl, $grant);
@@ -1754,15 +1754,15 @@  discard block
 block discarded – undo
1754 1754
 	function makeXmlFile($menu_srl)
1755 1755
 	{
1756 1756
 		// Return if there is no information when creating the xml file
1757
-		if(!$menu_srl) return;
1757
+		if (!$menu_srl) return;
1758 1758
 		// Get menu informaton
1759 1759
 		$args = new stdClass();
1760 1760
 		$args->menu_srl = $menu_srl;
1761 1761
 		$output = executeQuery('menu.getMenu', $args);
1762
-		if(!$output->toBool() || !$output->data) return $output;
1763
-		$site_srl = (int)$output->data->site_srl;
1762
+		if (!$output->toBool() || !$output->data) return $output;
1763
+		$site_srl = (int) $output->data->site_srl;
1764 1764
 
1765
-		if($site_srl)
1765
+		if ($site_srl)
1766 1766
 		{
1767 1767
 			$oModuleModel = getModel('module');
1768 1768
 			$columnList = array('sites.domain');
@@ -1773,13 +1773,13 @@  discard block
 block discarded – undo
1773 1773
 		$args->menu_srl = $menu_srl;
1774 1774
 		$args->sort_index = 'listorder';
1775 1775
 		$output = executeQuery('menu.getMenuItems', $args);
1776
-		if(!$output->toBool()) return;
1776
+		if (!$output->toBool()) return;
1777 1777
 		// Specify the name of the cache file
1778
-		$xml_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.xml.php", $menu_srl);
1779
-		$php_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menu_srl);
1778
+		$xml_file = sprintf(_XE_PATH_."files/cache/menu/%s.xml.php", $menu_srl);
1779
+		$php_file = sprintf(_XE_PATH_."files/cache/menu/%s.php", $menu_srl);
1780 1780
 		// If no data found, generate an XML file without node data
1781 1781
 		$list = $output->data;
1782
-		if(!$list)
1782
+		if (!$list)
1783 1783
 		{
1784 1784
 			$xml_buff = "<root />";
1785 1785
 			FileHandler::writeFile($xml_file, $xml_buff);
@@ -1787,10 +1787,10 @@  discard block
 block discarded – undo
1787 1787
 			return $xml_file;
1788 1788
 		}
1789 1789
 		// Change to an array if only a single data is obtained
1790
-		if(!is_array($list)) $list = array($list);
1790
+		if (!is_array($list)) $list = array($list);
1791 1791
 		// Create a tree for loop
1792 1792
 		$list_count = count($list);
1793
-		for($i=0;$i<$list_count;$i++)
1793
+		for ($i = 0; $i < $list_count; $i++)
1794 1794
 		{
1795 1795
 			$node = $list[$i];
1796 1796
 			$menu_item_srl = $node->menu_item_srl;
@@ -1846,7 +1846,7 @@  discard block
 block discarded – undo
1846 1846
 		$php_buff = sprintf(
1847 1847
 			'<?php '.
1848 1848
 			'if(!defined("__XE__")) exit(); '.
1849
-			'$menu = new stdClass();' .
1849
+			'$menu = new stdClass();'.
1850 1850
 			'%s; '.
1851 1851
 			'%s; '.
1852 1852
 			'$menu->list = array(%s); '.
@@ -1875,26 +1875,26 @@  discard block
 block discarded – undo
1875 1875
 	 */
1876 1876
 	function getXmlTree($source_node, $tree, $site_srl, $domain)
1877 1877
 	{
1878
-		if(!$source_node) return;
1878
+		if (!$source_node) return;
1879 1879
 
1880 1880
 		$oMenuAdminModel = getAdminModel('menu');
1881 1881
 
1882
-		foreach($source_node as $menu_item_srl => $node)
1882
+		foreach ($source_node as $menu_item_srl => $node)
1883 1883
 		{
1884 1884
 			$child_buff = "";
1885 1885
 			// Get data of the child nodes
1886
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
1886
+			if ($menu_item_srl && $tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
1887 1887
 			// List variables
1888 1888
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1889
-			foreach($names as $key => $val)
1889
+			foreach ($names as $key => $val)
1890 1890
 			{
1891
-				$name_arr_str .= sprintf('"%s"=>\'%s\',',$key, str_replace(array('\\', '\''), array('\\\\', '\\\''), $val));
1891
+				$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\', '\''), array('\\\\', '\\\''), $val));
1892 1892
 			}
1893 1893
 			$name_str = sprintf('$_names = array(%s); print $_names[$lang_type];', $name_arr_str);
1894 1894
 
1895
-			$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
1896
-			$desc = str_replace(array('&','"',"'"),array('&amp;','&quot;','\\\''),$node->desc);
1897
-			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url))
1895
+			$url = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->url);
1896
+			$desc = str_replace(array('&', '"', "'"), array('&amp;', '&quot;', '\\\''), $node->desc);
1897
+			if (preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url))
1898 1898
 			{
1899 1899
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
1900 1900
 			}
@@ -1904,21 +1904,21 @@  discard block
 block discarded – undo
1904 1904
 			$expand = $node->expand;
1905 1905
 
1906 1906
 			$normal_btn = $node->normal_btn;
1907
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
1907
+			if ($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $normal_btn);
1908 1908
 			else $normal_btn = '';
1909 1909
 			$hover_btn = $node->hover_btn;
1910
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
1910
+			if ($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $hover_btn);
1911 1911
 			else $hover_btn = '';
1912 1912
 			$active_btn = $node->active_btn;
1913
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
1913
+			if ($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $active_btn);
1914 1914
 			else $active_btn = '';
1915 1915
 
1916 1916
 			$group_srls = $node->group_srls;
1917 1917
 
1918
-			if($normal_btn)
1918
+			if ($normal_btn)
1919 1919
 			{
1920
-				if($hover_btn) $hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn); else $hover_str = '';
1921
-				if($active_btn) $active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn); else $active_str = '';
1920
+				if ($hover_btn) $hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn); else $hover_str = '';
1921
+				if ($active_btn) $active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn); else $active_str = '';
1922 1922
 				$link = sprintf('&lt;img src=&quot;%s&quot; onmouseout=&quot;this.src=\'%s\'&quot; alt=&quot;<?php print htmlspecialchars($_names[$lang_type], ENT_COMPAT | ENT_HTML401, \'UTF-8\', false) ?>&quot; %s %s /&gt;', $normal_btn, $normal_btn, $hover_str, $active_str);
1923 1923
 			}
1924 1924
 			else
@@ -1926,7 +1926,7 @@  discard block
 block discarded – undo
1926 1926
 				$link = '<?php print $_names[$lang_type]; ?>';
1927 1927
 			}
1928 1928
 			// If the value of node->group_srls exists
1929
-			if($group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged&&%s))',$group_srls,$group_srls == -1?1:0);
1929
+			if ($group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged&&%s))', $group_srls, $group_srls == -1 ? 1 : 0);
1930 1930
 			else $group_check_code = "true";
1931 1931
 			$attribute = sprintf(
1932 1932
 				'node_srl="%s" parent_srl="%s" menu_name_key=\'%s\' text="<?php if(%s) { %s }?>" url="<?php print(%s?"%s":"")?>" href="<?php print(%s?%s:"")?>" is_shortcut="%s" desc="%s" open_window="%s" expand="%s" normal_btn="%s" hover_btn="%s" active_btn="%s" link="<?php if(%s) {?>%s<?php }?>"',
@@ -1950,8 +1950,8 @@  discard block
 block discarded – undo
1950 1950
 				$link
1951 1951
 			);
1952 1952
 
1953
-			if($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
1954
-			else $buff .=  sprintf('<node %s />', $attribute);
1953
+			if ($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
1954
+			else $buff .= sprintf('<node %s />', $attribute);
1955 1955
 		}
1956 1956
 		return $buff;
1957 1957
 	}
@@ -1970,84 +1970,84 @@  discard block
 block discarded – undo
1970 1970
 	function getPhpCacheCode($source_node, $tree, $site_srl, $domain)
1971 1971
 	{
1972 1972
 		$output = array("buff"=>"", "url_list"=>array());
1973
-		if(!$source_node) return $output;
1973
+		if (!$source_node) return $output;
1974 1974
 
1975 1975
 		$oMenuAdminModel = getAdminModel('menu');
1976 1976
 
1977
-		foreach($source_node as $menu_item_srl => $node)
1977
+		foreach ($source_node as $menu_item_srl => $node)
1978 1978
 		{
1979 1979
 			// Get data from child nodes if exist.
1980
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
1980
+			if ($menu_item_srl && $tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
1981 1981
 			else $child_output = array("buff"=>"", "url_list"=>array());
1982 1982
 
1983 1983
 			// List variables
1984 1984
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1985 1985
 			unset($name_arr_str);
1986
-			foreach($names as $key => $val)
1986
+			foreach ($names as $key => $val)
1987 1987
 			{
1988
-				if(preg_match('/\{\$lang->menu_gnb(?:_sub)?\[\'([a-zA-Z_]+)\'\]\}/', $val) === 1)
1988
+				if (preg_match('/\{\$lang->menu_gnb(?:_sub)?\[\'([a-zA-Z_]+)\'\]\}/', $val) === 1)
1989 1989
 				{
1990 1990
 					$name_arr_str .= sprintf('"%s"=>"%s",', $key, $val);
1991 1991
 				}
1992 1992
 				else
1993 1993
 				{
1994
-					$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\','\''), array('\\\\','\\\''), removeHackTag($val)));
1994
+					$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\', '\''), array('\\\\', '\\\''), removeHackTag($val)));
1995 1995
 				}
1996 1996
 			}
1997 1997
 			$name_str = sprintf('$_menu_names[%d] = array(%s); %s', $node->menu_item_srl, $name_arr_str, $child_output['name']);
1998 1998
 
1999 1999
 			// If url value is not empty in the current node, put the value into an array url_list
2000
-			if($node->url) $child_output['url_list'][] = $node->url;
2000
+			if ($node->url) $child_output['url_list'][] = $node->url;
2001 2001
 			$output['url_list'] = array_merge($output['url_list'], $child_output['url_list']);
2002 2002
 			// If node->group_srls value exists
2003
-			if($node->group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged && %s))',$node->group_srls,$node->group_srls == -1?1:0);
2003
+			if ($node->group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged && %s))', $node->group_srls, $node->group_srls == -1 ? 1 : 0);
2004 2004
 			else $group_check_code = "true";
2005 2005
 
2006 2006
 			// List variables
2007
-			$href = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->href);
2008
-			$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
2009
-			$desc = str_replace(array('&','"',"'"),array('&amp;','&quot;','\\\''),$node->desc);
2010
-			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
2007
+			$href = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->href);
2008
+			$url = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->url);
2009
+			$desc = str_replace(array('&', '"', "'"), array('&amp;', '&quot;', '\\\''), $node->desc);
2010
+			if (preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
2011 2011
 			{
2012 2012
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
2013 2013
 			}
2014 2014
 			else $href = sprintf('"%s"', $url);
2015 2015
 			$is_shortcut = $node->is_shortcut;
2016 2016
 			$open_window = $node->open_window;
2017
-			$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->normal_btn);
2018
-			$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->hover_btn);
2019
-			$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->active_btn);
2017
+			$normal_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->normal_btn);
2018
+			$hover_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->hover_btn);
2019
+			$active_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->active_btn);
2020 2020
 
2021
-			foreach($child_output['url_list'] as $key =>$val)
2021
+			foreach ($child_output['url_list'] as $key =>$val)
2022 2022
 			{
2023 2023
 				$child_output['url_list'][$key] = addslashes($val);
2024 2024
 			}
2025 2025
 
2026
-			$selected = '"'.implode('","',$child_output['url_list']).'"';
2026
+			$selected = '"'.implode('","', $child_output['url_list']).'"';
2027 2027
 			$child_buff = $child_output['buff'];
2028 2028
 			$expand = $node->expand;
2029 2029
 
2030 2030
 			$normal_btn = $node->normal_btn;
2031
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2031
+			if ($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $normal_btn);
2032 2032
 			else $normal_btn = '';
2033 2033
 
2034 2034
 			$hover_btn = $node->hover_btn;
2035
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2035
+			if ($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $hover_btn);
2036 2036
 			else $hover_btn = '';
2037 2037
 
2038 2038
 			$active_btn = $node->active_btn;
2039
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2039
+			if ($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $active_btn);
2040 2040
 			else $active_btn = '';
2041 2041
 
2042 2042
 
2043 2043
 			$group_srls = $node->group_srls;
2044 2044
 
2045
-			if($normal_btn)
2045
+			if ($normal_btn)
2046 2046
 			{
2047
-				if($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2048
-				if($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2047
+				if ($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2048
+				if ($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2049 2049
 				$link = sprintf('"<img src=\"%s\" onmouseout=\"this.src=\'%s\'\" alt=\"".$_menu_names[%d][$lang_type]."\" %s %s />"', $normal_btn, $normal_btn, $node->menu_item_srl, $hover_str, $active_str);
2050
-				if($active_btn) $link_active = sprintf('"<img src=\"%s\" onmouseout=\"this.src=\'%s\'\" alt=\"".$_menu_names[%d][$lang_type]."\" %s />"', $active_btn, $active_btn, $node->menu_item_srl, $hover_str);
2050
+				if ($active_btn) $link_active = sprintf('"<img src=\"%s\" onmouseout=\"this.src=\'%s\'\" alt=\"".$_menu_names[%d][$lang_type]."\" %s />"', $active_btn, $active_btn, $node->menu_item_srl, $hover_str);
2051 2051
 				else $link_active = $link;
2052 2052
 			}
2053 2053
 			else
@@ -2085,7 +2085,7 @@  discard block
 block discarded – undo
2085 2085
 			);
2086 2086
 
2087 2087
 			// Generate buff data
2088
-			$output['buff'] .=  sprintf('%s=>array(%s),', $node->menu_item_srl, $attribute);
2088
+			$output['buff'] .= sprintf('%s=>array(%s),', $node->menu_item_srl, $attribute);
2089 2089
 			$output['name'] .= $name_str;
2090 2090
 		}
2091 2091
 		return $output;
@@ -2099,19 +2099,19 @@  discard block
 block discarded – undo
2099 2099
 	 */
2100 2100
 	function updateMenuLayout($layout_srl, $menu_srl_list)
2101 2101
 	{
2102
-		if(!count($menu_srl_list)) return;
2102
+		if (!count($menu_srl_list)) return;
2103 2103
 		// Delete the value of menu_srls
2104
-		$args->menu_srls = implode(',',$menu_srl_list);
2104
+		$args->menu_srls = implode(',', $menu_srl_list);
2105 2105
 		$output = executeQuery('menu.deleteMenuLayout', $args);
2106
-		if(!$output->toBool()) return $output;
2106
+		if (!$output->toBool()) return $output;
2107 2107
 
2108 2108
 		$args->layout_srl = $layout_srl;
2109 2109
 		// Mapping menu_srls, layout_srl
2110
-		for($i=0;$i<count($menu_srl_list);$i++)
2110
+		for ($i = 0; $i < count($menu_srl_list); $i++)
2111 2111
 		{
2112 2112
 			$args->menu_srl = $menu_srl_list[$i];
2113 2113
 			$output = executeQuery('menu.insertMenuLayout', $args);
2114
-			if(!$output->toBool()) return $output;
2114
+			if (!$output->toBool()) return $output;
2115 2115
 		}
2116 2116
 	}
2117 2117
 
@@ -2124,47 +2124,47 @@  discard block
 block discarded – undo
2124 2124
 	{
2125 2125
 		// path setting
2126 2126
 		$path = sprintf('./files/attach/menu_button/%d/', $args->menu_srl);
2127
-		if($args->menu_normal_btn || $args->menu_hover_btn || $args->menu_active_btn && !is_dir($path))
2127
+		if ($args->menu_normal_btn || $args->menu_hover_btn || $args->menu_active_btn && !is_dir($path))
2128 2128
 		{
2129 2129
 			FileHandler::makeDir($path);
2130 2130
 		}
2131 2131
 
2132
-		if($args->isNormalDelete == 'Y' || $args->isHoverDelete == 'Y' || $args->isActiveDelete == 'Y')
2132
+		if ($args->isNormalDelete == 'Y' || $args->isHoverDelete == 'Y' || $args->isActiveDelete == 'Y')
2133 2133
 		{
2134 2134
 			$oMenuModel = getAdminModel('menu');
2135 2135
 			$itemInfo = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
2136 2136
 
2137
-			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2138
-			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2139
-			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2137
+			if ($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2138
+			if ($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2139
+			if ($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2140 2140
 		}
2141 2141
 
2142 2142
 		$returnArray = array();
2143 2143
 		$date = date('YmdHis');
2144 2144
 		// normal button
2145
-		if($args->menu_normal_btn)
2145
+		if ($args->menu_normal_btn)
2146 2146
 		{
2147
-			$tmp_arr = explode('.',$args->menu_normal_btn['name']);
2148
-			$ext = $tmp_arr[count($tmp_arr)-1];
2147
+			$tmp_arr = explode('.', $args->menu_normal_btn['name']);
2148
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2149 2149
 
2150 2150
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_normal_btn', $ext);
2151 2151
 
2152
-			if(checkUploadedFile($args->menu_normal_btn['tmp_name']))
2152
+			if (checkUploadedFile($args->menu_normal_btn['tmp_name']))
2153 2153
 			{
2154
-				move_uploaded_file ( $args->menu_normal_btn ['tmp_name'], $filename );
2154
+				move_uploaded_file($args->menu_normal_btn ['tmp_name'], $filename);
2155 2155
 				$returnArray ['normal_btn'] = $filename;
2156 2156
 			}
2157 2157
 		}
2158 2158
 
2159 2159
 		// hover button
2160
-		if($args->menu_hover_btn)
2160
+		if ($args->menu_hover_btn)
2161 2161
 		{
2162
-			$tmp_arr = explode('.',$args->menu_hover_btn['name']);
2163
-			$ext = $tmp_arr[count($tmp_arr)-1];
2162
+			$tmp_arr = explode('.', $args->menu_hover_btn['name']);
2163
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2164 2164
 
2165 2165
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_hover_btn', $ext);
2166 2166
 
2167
-			if(checkUploadedFile($args->menu_hover_btn['tmp_name']))
2167
+			if (checkUploadedFile($args->menu_hover_btn['tmp_name']))
2168 2168
 			{
2169 2169
 				move_uploaded_file($args->menu_hover_btn['tmp_name'], $filename);
2170 2170
 				$returnArray['hover_btn'] = $filename;
@@ -2172,14 +2172,14 @@  discard block
 block discarded – undo
2172 2172
 		}
2173 2173
 
2174 2174
 		// active button
2175
-		if($args->menu_active_btn)
2175
+		if ($args->menu_active_btn)
2176 2176
 		{
2177
-			$tmp_arr = explode('.',$args->menu_active_btn['name']);
2178
-			$ext = $tmp_arr[count($tmp_arr)-1];
2177
+			$tmp_arr = explode('.', $args->menu_active_btn['name']);
2178
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2179 2179
 
2180 2180
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_active_btn', $ext);
2181 2181
 
2182
-			if(checkUploadedFile($args->menu_active_btn['tmp_name']))
2182
+			if (checkUploadedFile($args->menu_active_btn['tmp_name']))
2183 2183
 			{
2184 2184
 				move_uploaded_file($args->menu_active_btn['tmp_name'], $filename);
2185 2185
 				$returnArray['active_btn'] = $filename;
@@ -2201,7 +2201,7 @@  discard block
 block discarded – undo
2201 2201
 			"active_btn"=>"",
2202 2202
 		);
2203 2203
 		//normal_btn
2204
-		if($menuItemInfo->normal_btn)
2204
+		if ($menuItemInfo->normal_btn)
2205 2205
 		{
2206 2206
 			$originFile = FileHandler::getRealPath($menuItemInfo->normal_btn);
2207 2207
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->normal_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'normal');
@@ -2211,7 +2211,7 @@  discard block
 block discarded – undo
2211 2211
 		}
2212 2212
 
2213 2213
 		//hover_btn
2214
-		if($menuItemInfo->hover_btn)
2214
+		if ($menuItemInfo->hover_btn)
2215 2215
 		{
2216 2216
 			$originFile = FileHandler::getRealPath($menuItemInfo->hover_btn);
2217 2217
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->hover_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'hover');
@@ -2221,7 +2221,7 @@  discard block
 block discarded – undo
2221 2221
 		}
2222 2222
 
2223 2223
 		//active_btn
2224
-		if($menuItemInfo->active_btn)
2224
+		if ($menuItemInfo->active_btn)
2225 2225
 		{
2226 2226
 			$originFile = FileHandler::getRealPath($menuItemInfo->active_btn);
2227 2227
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->active_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'active');
@@ -2236,9 +2236,9 @@  discard block
 block discarded – undo
2236 2236
 	{
2237 2237
 		$path = sprintf('./files/attach/menu_button/%d/', $menuSrl);
2238 2238
 		$tmp_arr = explode('.', $buttonPath);
2239
-		$ext = $tmp_arr[count($tmp_arr)-1];
2239
+		$ext = $tmp_arr[count($tmp_arr) - 1];
2240 2240
 		$date = date("YmdHis");
2241
-		return sprintf('%s%d.%s.%s.%s', $path, $menuItemSrl,$date,'menu_'.$mode.'_btn', $ext);
2241
+		return sprintf('%s%d.%s.%s.%s', $path, $menuItemSrl, $date, 'menu_'.$mode.'_btn', $ext);
2242 2242
 	}
2243 2243
 
2244 2244
 	public function makeHomemenuCacheFile($menuSrl)
Please login to merge, or discard this patch.
Braces   +297 added lines, -130 removed lines patch added patch discarded remove patch
@@ -69,7 +69,9 @@  discard block
 block discarded – undo
69 69
 		$site_module_info = Context::get('site_module_info');
70 70
 
71 71
 		$output = $this->addMenu(Context::get('title'), (int)$site_module_info->site_srl);
72
-		if(!$output->toBool()) return $output;
72
+		if(!$output->toBool()) {
73
+			return $output;
74
+		}
73 75
 
74 76
 		$this->add('menu_srl', $output->get('menuSrl'));
75 77
 		$this->setMessage('success_registed');
@@ -148,8 +150,7 @@  discard block
 block discarded – undo
148 150
 				$moduleConfig->unlinked_menu_srl = $output->get('menuSrl');
149 151
 				$oModuleController = getController('module');
150 152
 				$oModuleController->updateModuleConfig('menu', $moduleConfig);
151
-			}
152
-			else
153
+			} else
153 154
 			{
154 155
 				return false;
155 156
 			}
@@ -186,8 +187,7 @@  discard block
 block discarded – undo
186 187
 			if($output->toBool() && $output->data)
187 188
 			{
188 189
 				$moduleInfo->menu_srl = $output->data->menu_srl;
189
-			}
190
-			else
190
+			} else
191 191
 			{
192 192
 				// create menu item.
193 193
 				$item_args->menu_srl = $menuSrl;
@@ -235,7 +235,9 @@  discard block
 block discarded – undo
235 235
 		$args->menu_srl = Context::get('menu_srl');
236 236
 
237 237
 		$output = executeQuery('menu.updateMenu', $args);
238
-		if(!$output->toBool()) return $output;
238
+		if(!$output->toBool()) {
239
+			return $output;
240
+		}
239 241
 
240 242
 		$this->setMessage('success_registed');
241 243
 
@@ -255,8 +257,9 @@  discard block
 block discarded – undo
255 257
 		$menuInfo = $oMenuAdminModel->getMenu($menu_srl);
256 258
 
257 259
 		$oAdmin = getClass('admin');
258
-		if($menuInfo->title == $oAdmin->getAdminMenuName())
259
-			return new Object(-1, 'msg_adminmenu_cannot_delete');
260
+		if($menuInfo->title == $oAdmin->getAdminMenuName()) {
261
+					return new Object(-1, 'msg_adminmenu_cannot_delete');
262
+		}
260 263
 
261 264
 		// get menu properies with child menu
262 265
 		$phpFile = sprintf("./files/cache/menu/%s.php", $menu_srl);
@@ -280,8 +283,9 @@  discard block
 block discarded – undo
280 283
 				$originMenu = $value;
281 284
 				$this->_checkHomeMenuInOriginMenu($originMenu, $siteInfo->mid, $isStartmenuInclude);
282 285
 
283
-				if($isStartmenuInclude)
284
-					break;
286
+				if($isStartmenuInclude) {
287
+									break;
288
+				}
285 289
 			}
286 290
 		}
287 291
 
@@ -366,7 +370,9 @@  discard block
 block discarded – undo
366 370
 			foreach($cache_list as $cache_file)
367 371
 			{
368 372
 				$pos = strpos($cache_file, $menu_srl.'.');
369
-				if($pos>0)FileHandler::removeFile($cache_file);
373
+				if($pos>0) {
374
+					FileHandler::removeFile($cache_file);
375
+				}
370 376
 			}
371 377
 		}
372 378
 		// Delete images of menu buttons
@@ -405,8 +411,7 @@  discard block
 block discarded – undo
405 411
 		if($request->is_shortcut == 'Y')
406 412
 		{
407 413
 			$result = $this->_insertShortcut($request);
408
-		}
409
-		else
414
+		} else
410 415
 		{
411 416
 			$result = $this->_insertMenu($request, $isProc);
412 417
 		}
@@ -465,12 +470,21 @@  discard block
 block discarded – undo
465 470
 			$args->is_shortcut = $request->is_shortcut;
466 471
 			$args->url = $request->shortcut_target;
467 472
 
468
-			if(!$args->open_window) $args->open_window = 'N';
469
-			if(!$args->expand) $args->expand = 'N';
470
-			if(!$args->is_shortcut) $args->is_shortcut = 'Y';
473
+			if(!$args->open_window) {
474
+				$args->open_window = 'N';
475
+			}
476
+			if(!$args->expand) {
477
+				$args->expand = 'N';
478
+			}
479
+			if(!$args->is_shortcut) {
480
+				$args->is_shortcut = 'Y';
481
+			}
471 482
 
472
-			if($request->menu_name_key) $args->name = $request->menu_name_key;
473
-			else $args->name = $request->menu_name;
483
+			if($request->menu_name_key) {
484
+				$args->name = $request->menu_name_key;
485
+			} else {
486
+				$args->name = $request->menu_name;
487
+			}
474 488
 		}
475 489
 		// type is module short cut
476 490
 		else if(is_numeric($request->shortcut_target))
@@ -505,13 +519,18 @@  discard block
 block discarded – undo
505 519
 			$args->url = '#';
506 520
 		}
507 521
 
508
-		if($request->menu_desc) $args->desc = $request->menu_desc;
509
-		else $args->desc = '';
522
+		if($request->menu_desc) {
523
+			$args->desc = $request->menu_desc;
524
+		} else {
525
+			$args->desc = '';
526
+		}
510 527
 
511 528
 		$args->menu_item_srl = getNextSequence();
512 529
 		$args->listorder = -1*$args->menu_item_srl;
513 530
 		$output = executeQuery('menu.insertMenuItem', $args);
514
-		if(!$output->toBool()) return $output;
531
+		if(!$output->toBool()) {
532
+			return $output;
533
+		}
515 534
 
516 535
 		$oDB->commit();
517 536
 
@@ -533,15 +552,27 @@  discard block
 block discarded – undo
533 552
 		$args->expand = $request->menu_expand;
534 553
 		$args->is_shortcut = $request->is_shortcut;
535 554
 
536
-		if(!$args->open_window) $args->open_window = 'N';
537
-		if(!$args->expand) $args->expand = 'N';
538
-		if(!$args->is_shortcut) $args->is_shortcut = 'N';
555
+		if(!$args->open_window) {
556
+			$args->open_window = 'N';
557
+		}
558
+		if(!$args->expand) {
559
+			$args->expand = 'N';
560
+		}
561
+		if(!$args->is_shortcut) {
562
+			$args->is_shortcut = 'N';
563
+		}
539 564
 
540
-		if($request->menu_name_key) $args->name = $request->menu_name_key;
541
-		else $args->name = $request->menu_name;
565
+		if($request->menu_name_key) {
566
+			$args->name = $request->menu_name_key;
567
+		} else {
568
+			$args->name = $request->menu_name;
569
+		}
542 570
 
543
-		if($request->menu_desc) $args->desc = $request->menu_desc;
544
-		else $args->desc = '';
571
+		if($request->menu_desc) {
572
+			$args->desc = $request->menu_desc;
573
+		} else {
574
+			$args->desc = '';
575
+		}
545 576
 
546 577
 		if($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
547 578
 		{
@@ -559,9 +590,15 @@  discard block
 block discarded – undo
559 590
 		}
560 591
 
561 592
 		// if setting button variables, set argument button variables for db insert. but not upload in this method
562
-		if($request->normal_btn) $args->normal_btn = $request->normal_btn;
563
-		if($request->hover_btn) $args->hover_btn = $request->hover_btn;
564
-		if($request->active_btn) $args->active_btn = $request->active_btn;
593
+		if($request->normal_btn) {
594
+			$args->normal_btn = $request->normal_btn;
595
+		}
596
+		if($request->hover_btn) {
597
+			$args->hover_btn = $request->hover_btn;
598
+		}
599
+		if($request->active_btn) {
600
+			$args->active_btn = $request->active_btn;
601
+		}
565 602
 
566 603
 		if(!$request->module_id)
567 604
 		{
@@ -572,7 +609,9 @@  discard block
 block discarded – undo
572 609
 		$args->menu_item_srl = getNextSequence();
573 610
 		$args->listorder = -1*$args->menu_item_srl;
574 611
 		$output = executeQuery('menu.insertMenuItem', $args);
575
-		if(!$output->toBool()) return $output;
612
+		if(!$output->toBool()) {
613
+			return $output;
614
+		}
576 615
 
577 616
 		$oDB->commit();
578 617
 
@@ -653,8 +692,12 @@  discard block
 block discarded – undo
653 692
 		}
654 693
 
655 694
 		// variables set
656
-		if($request->menu_open_window != "Y") $request->menu_open_window = "N";
657
-		if($request->menu_expand != "Y") $request->menu_expand = "N";
695
+		if($request->menu_open_window != "Y") {
696
+			$request->menu_open_window = "N";
697
+		}
698
+		if($request->menu_expand != "Y") {
699
+			$request->menu_expand = "N";
700
+		}
658 701
 
659 702
 		// Get original information
660 703
 		$oMenuAdminModel = getAdminModel('menu');
@@ -681,13 +724,11 @@  discard block
 block discarded – undo
681 724
 
682 725
 				$args->url = $newItemInfo->url;
683 726
 				$args->is_shortcut = 'Y';
684
-			}
685
-			else
727
+			} else
686 728
 			{
687 729
 				$args->url = '#';
688 730
 			}
689
-		}
690
-		else
731
+		} else
691 732
 		{
692 733
 			// check already created module instance
693 734
 			$oModuleModel = getModel('module');
@@ -720,14 +761,16 @@  discard block
 block discarded – undo
720 761
 		if($request->menu_name_key)
721 762
 		{
722 763
 			$args->name = $request->menu_name_key;
723
-		}
724
-		else
764
+		} else
725 765
 		{
726 766
 			$args->name = $request->menu_name;
727 767
 		}
728 768
 
729
-		if($request->menu_desc) $args->desc = $request->menu_desc;
730
-		else $args->desc = '';
769
+		if($request->menu_desc) {
770
+			$args->desc = $request->menu_desc;
771
+		} else {
772
+			$args->desc = '';
773
+		}
731 774
 
732 775
 		unset($args->group_srls);
733 776
 		$args->open_window = $request->menu_open_window;
@@ -829,8 +872,7 @@  discard block
 block discarded – undo
829 872
 		{
830 873
 			$this->setError($returnObj->error);
831 874
 			$this->setMessage($returnObj->message);
832
-		}
833
-		else
875
+		} else
834 876
 		{
835 877
 			$this->setMessage('success_deleted');
836 878
 		}
@@ -857,7 +899,9 @@  discard block
 block discarded – undo
857 899
 		if($args->is_force != 'Y')
858 900
 		{
859 901
 			$output = executeQuery('menu.getChildMenuCount', $args);
860
-			if(!$output->toBool()) return $output;
902
+			if(!$output->toBool()) {
903
+				return $output;
904
+			}
861 905
 			if($output->data->count > 0)
862 906
 			{
863 907
 				return new Object(-1001, 'msg_cannot_delete_for_child');
@@ -875,7 +919,9 @@  discard block
 block discarded – undo
875 919
 			return $this->stop('msg_cannot_delete_for_admin_topmenu');
876 920
 		}
877 921
 
878
-		if($itemInfo->parent_srl) $parent_srl = $itemInfo->parent_srl;
922
+		if($itemInfo->parent_srl) {
923
+			$parent_srl = $itemInfo->parent_srl;
924
+		}
879 925
 
880 926
 		// get menu properies with child menu
881 927
 		$phpFile = sprintf("./files/cache/menu/%s.php", $args->menu_srl);
@@ -949,9 +995,15 @@  discard block
 block discarded – undo
949 995
 		// Update the xml file and get its location
950 996
 		$xml_file = $this->makeXmlFile($args->menu_srl);
951 997
 		// Delete all of image buttons
952
-		if($node['normal_btn']) FileHandler::removeFile($node['normal_btn']);
953
-		if($node['hover_btn']) FileHandler::removeFile($node['hover_btn']);
954
-		if($node['active_btn']) FileHandler::removeFile($node['active_btn']);
998
+		if($node['normal_btn']) {
999
+			FileHandler::removeFile($node['normal_btn']);
1000
+		}
1001
+		if($node['hover_btn']) {
1002
+			FileHandler::removeFile($node['hover_btn']);
1003
+		}
1004
+		if($node['active_btn']) {
1005
+			FileHandler::removeFile($node['active_btn']);
1006
+		}
955 1007
 
956 1008
 		// Delete module
957 1009
 		if($node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
@@ -1018,7 +1070,9 @@  discard block
 block discarded – undo
1018 1070
 		$source_srl = Context::get('source_srl');	// Same hierarchy's menu item serial number
1019 1071
 		$target_srl = Context::get('target_srl');	// Self menu item serial number
1020 1072
 
1021
-		if(!$mode || !$parent_srl || !$target_srl) return new Object(-1,'msg_invalid_request');
1073
+		if(!$mode || !$parent_srl || !$target_srl) {
1074
+			return new Object(-1,'msg_invalid_request');
1075
+		}
1022 1076
 
1023 1077
 		$oMenuAdminModel = getAdminModel('menu');
1024 1078
 
@@ -1182,8 +1236,11 @@  discard block
 block discarded – undo
1182 1236
 		// default argument setting
1183 1237
 		$args = new stdClass();
1184 1238
 		$args->menu_srl = $menuSrl;
1185
-		if($parentSrl == 0) $args->parent_srl = $menuSrl;
1186
-		else $args->parent_srl = $parentSrl;
1239
+		if($parentSrl == 0) {
1240
+			$args->parent_srl = $menuSrl;
1241
+		} else {
1242
+			$args->parent_srl = $parentSrl;
1243
+		}
1187 1244
 		$args->menu_name_key = $originMenu['text'];
1188 1245
 		$args->menu_name = $originMenu['text'];
1189 1246
 		$args->menu_open_window = $originMenu['open_window'];
@@ -1276,8 +1333,11 @@  discard block
 block discarded – undo
1276 1333
 		for($i=0;$i<4;$i++)
1277 1334
 		{
1278 1335
 			$case = rand(0, 1);
1279
-			if($case) $doc = rand(65, 90);
1280
-			else $doc = rand(97, 122);
1336
+			if($case) {
1337
+				$doc = rand(65, 90);
1338
+			} else {
1339
+				$doc = rand(97, 122);
1340
+			}
1281 1341
 
1282 1342
 			$randomString .= chr($doc);
1283 1343
 		}
@@ -1300,15 +1360,21 @@  discard block
 block discarded – undo
1300 1360
 		// menu name update
1301 1361
 		$args->menu_srl = $this->menuSrl;
1302 1362
 		$output = executeQuery('menu.updateMenu', $args);
1303
-		if(!$output->toBool()) return $output;
1363
+		if(!$output->toBool()) {
1364
+			return $output;
1365
+		}
1304 1366
 
1305 1367
 		$this->map = array();
1306 1368
 		if(is_array($parentKeyList))
1307 1369
 		{
1308 1370
 			foreach($parentKeyList as $no=>$srl)
1309 1371
 			{
1310
-				if($srl === 0) continue;
1311
-				if(!is_array($this->map[$srl]))$this->map[$srl] = array();
1372
+				if($srl === 0) {
1373
+					continue;
1374
+				}
1375
+				if(!is_array($this->map[$srl])) {
1376
+					$this->map[$srl] = array();
1377
+				}
1312 1378
 				$this->map[$srl][] = $no;
1313 1379
 			}
1314 1380
 		}
@@ -1410,7 +1476,9 @@  discard block
 block discarded – undo
1410 1476
 		$oMenuAdminModel = getAdminModel('menu');
1411 1477
 
1412 1478
 		$target_item = $oMenuAdminModel->getMenuItemInfo($target_srl);
1413
-		if($target_item->menu_item_srl != $target_srl) return new Object(-1,'msg_invalid_request');
1479
+		if($target_item->menu_item_srl != $target_srl) {
1480
+			return new Object(-1,'msg_invalid_request');
1481
+		}
1414 1482
 		// Move the menu location(change the order menu appears)
1415 1483
 		if($mode == 'move')
1416 1484
 		{
@@ -1421,24 +1489,33 @@  discard block
 block discarded – undo
1421 1489
 			if($source_srl)
1422 1490
 			{
1423 1491
 				$source_item = $oMenuAdminModel->getMenuItemInfo($source_srl);
1424
-				if($source_item->menu_item_srl != $source_srl) return new Object(-1,'msg_invalid_request');
1492
+				if($source_item->menu_item_srl != $source_srl) {
1493
+					return new Object(-1,'msg_invalid_request');
1494
+				}
1425 1495
 				$args->listorder = $source_item->listorder-1;
1426
-			}
1427
-			else
1496
+			} else
1428 1497
 			{
1429 1498
 				$output = executeQuery('menu.getMaxListorder', $args);
1430
-				if(!$output->toBool()) return $output;
1499
+				if(!$output->toBool()) {
1500
+					return $output;
1501
+				}
1431 1502
 				$args->listorder = (int)$output->data->listorder;
1432
-				if(!$args->listorder) $args->listorder= 0;
1503
+				if(!$args->listorder) {
1504
+					$args->listorder= 0;
1505
+				}
1433 1506
 			}
1434 1507
 			$args->parent_srl = $parent_srl;
1435 1508
 			$output = executeQuery('menu.updateMenuItemListorder', $args);
1436
-			if(!$output->toBool()) return $output;
1509
+			if(!$output->toBool()) {
1510
+				return $output;
1511
+			}
1437 1512
 
1438 1513
 			$args->parent_srl = $parent_srl;
1439 1514
 			$args->menu_item_srl = $target_srl;
1440 1515
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1441
-			if(!$output->toBool()) return $output;
1516
+			if(!$output->toBool()) {
1517
+				return $output;
1518
+			}
1442 1519
 
1443 1520
 			//module's menu_srl move also
1444 1521
 			if($isShortcut == 'N' && !empty($url))
@@ -1466,14 +1543,15 @@  discard block
 block discarded – undo
1466 1543
 				}
1467 1544
 			}
1468 1545
 			// Add a child
1469
-		}
1470
-		elseif($mode == 'insert')
1546
+		} elseif($mode == 'insert')
1471 1547
 		{
1472 1548
 			$args->menu_item_srl = $target_srl;
1473 1549
 			$args->parent_srl = $parent_srl;
1474 1550
 			$args->listorder = -1*getNextSequence();
1475 1551
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1476
-			if(!$output->toBool()) return $output;
1552
+			if(!$output->toBool()) {
1553
+				return $output;
1554
+			}
1477 1555
 		}
1478 1556
 
1479 1557
 		$xml_file = $this->makeXmlFile($menu_srl);
@@ -1517,8 +1595,7 @@  discard block
 block discarded – undo
1517 1595
 		{
1518 1596
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1519 1597
 
1520
-		}
1521
-		else if(!$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)$/i',$target_file['name'])  || !checkUploadedFile($target_file['tmp_name']))
1598
+		} else if(!$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)$/i',$target_file['name'])  || !checkUploadedFile($target_file['tmp_name']))
1522 1599
 		{
1523 1600
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1524 1601
 		}
@@ -1532,7 +1609,9 @@  discard block
 block discarded – undo
1532 1609
 			$path = sprintf('./files/attach/menu_button/%d/', $menu_srl);
1533 1610
 			$filename = sprintf('%s%d.%s.%s', $path, $menu_item_srl, $target, $ext);
1534 1611
 
1535
-			if(!is_dir($path)) FileHandler::makeDir($path);
1612
+			if(!is_dir($path)) {
1613
+				FileHandler::makeDir($path);
1614
+			}
1536 1615
 
1537 1616
 			move_uploaded_file($target_file['tmp_name'], $filename);
1538 1617
 			Context::set('filename', $filename);
@@ -1572,7 +1651,9 @@  discard block
 block discarded – undo
1572 1651
 			foreach($installed_module_list AS $key=>$value)
1573 1652
 			{
1574 1653
 				$info = $oModuleModel->getModuleActionXml($value->module);
1575
-				if($info->menu) $menuList[$value->module] = $info->menu;
1654
+				if($info->menu) {
1655
+					$menuList[$value->module] = $info->menu;
1656
+				}
1576 1657
 				unset($info->menu);
1577 1658
 			}
1578 1659
 		}
@@ -1604,8 +1685,12 @@  discard block
 block discarded – undo
1604 1685
 		$info = $oModuleModel->getModuleActionXml($moduleName);
1605 1686
 
1606 1687
 		$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->menu->{$menuName}->index);
1607
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1608
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');
1688
+		if(empty($url)) {
1689
+			$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1690
+		}
1691
+		if(empty($url)) {
1692
+			$url = getNotEncodedFullUrl('', 'module', 'admin');
1693
+		}
1609 1694
 		$dbInfo = Context::getDBInfo();
1610 1695
 
1611 1696
 		$args = new stdClass();
@@ -1617,8 +1702,7 @@  discard block
 block discarded – undo
1617 1702
 		if(strpos($url, 'https') !== false)
1618 1703
 		{
1619 1704
 			$args->url = str_replace('https'.substr($dbInfo->default_url, 4), '', $url);
1620
-		}
1621
-		else
1705
+		} else
1622 1706
 		{
1623 1707
 			$args->url = str_replace($dbInfo->default_url, '', $url);
1624 1708
 		}
@@ -1637,14 +1721,18 @@  discard block
 block discarded – undo
1637 1721
 		if($item_info->menu_item_srl == $args->menu_item_srl)
1638 1722
 		{
1639 1723
 			$output = $this->_updateMenuItem($args);
1640
-			if(!$output->toBool()) return $output;
1724
+			if(!$output->toBool()) {
1725
+				return $output;
1726
+			}
1641 1727
 		}
1642 1728
 		// Insert if not exist
1643 1729
 		else
1644 1730
 		{
1645 1731
 			$args->listorder = -1*$args->menu_item_srl;
1646 1732
 			$output = executeQuery('menu.insertMenuItem', $args);
1647
-			if(!$output->toBool()) return $output;
1733
+			if(!$output->toBool()) {
1734
+				return $output;
1735
+			}
1648 1736
 		}
1649 1737
 		// Get information of the menu
1650 1738
 		$menu_info = $oMenuModel->getMenu($args->menu_srl);
@@ -1675,8 +1763,7 @@  discard block
 block discarded – undo
1675 1763
 		if(!$exposure)
1676 1764
 		{
1677 1765
 			$args->group_srls = '';
1678
-		}
1679
-		else
1766
+		} else
1680 1767
 		{
1681 1768
 			$exposure = explode(',', $exposure);
1682 1769
 			if(in_array($exposure, array('-1','-3')))
@@ -1684,7 +1771,9 @@  discard block
 block discarded – undo
1684 1771
 				$args->group_srls = $exposure;
1685 1772
 			}
1686 1773
 
1687
-			if($exposure) $args->group_srls = implode(',', $exposure);
1774
+			if($exposure) {
1775
+				$args->group_srls = implode(',', $exposure);
1776
+			}
1688 1777
 		}
1689 1778
 
1690 1779
 		$output = $this->_updateMenuItem($args);
@@ -1704,7 +1793,9 @@  discard block
 block discarded – undo
1704 1793
 		$xml_info = $oModuleModel->getModuleActionXML($moduleInfo->module);
1705 1794
 
1706 1795
 		$grantList = $xml_info->grant;
1707
-		if(!$grantList) $grantList = new stdClass;
1796
+		if(!$grantList) {
1797
+			$grantList = new stdClass;
1798
+		}
1708 1799
 
1709 1800
 		$grantList->access = new stdClass();
1710 1801
 		$grantList->access->default = 'guest';
@@ -1754,12 +1845,16 @@  discard block
 block discarded – undo
1754 1845
 	function makeXmlFile($menu_srl)
1755 1846
 	{
1756 1847
 		// Return if there is no information when creating the xml file
1757
-		if(!$menu_srl) return;
1848
+		if(!$menu_srl) {
1849
+			return;
1850
+		}
1758 1851
 		// Get menu informaton
1759 1852
 		$args = new stdClass();
1760 1853
 		$args->menu_srl = $menu_srl;
1761 1854
 		$output = executeQuery('menu.getMenu', $args);
1762
-		if(!$output->toBool() || !$output->data) return $output;
1855
+		if(!$output->toBool() || !$output->data) {
1856
+			return $output;
1857
+		}
1763 1858
 		$site_srl = (int)$output->data->site_srl;
1764 1859
 
1765 1860
 		if($site_srl)
@@ -1773,7 +1868,9 @@  discard block
 block discarded – undo
1773 1868
 		$args->menu_srl = $menu_srl;
1774 1869
 		$args->sort_index = 'listorder';
1775 1870
 		$output = executeQuery('menu.getMenuItems', $args);
1776
-		if(!$output->toBool()) return;
1871
+		if(!$output->toBool()) {
1872
+			return;
1873
+		}
1777 1874
 		// Specify the name of the cache file
1778 1875
 		$xml_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.xml.php", $menu_srl);
1779 1876
 		$php_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menu_srl);
@@ -1787,7 +1884,9 @@  discard block
 block discarded – undo
1787 1884
 			return $xml_file;
1788 1885
 		}
1789 1886
 		// Change to an array if only a single data is obtained
1790
-		if(!is_array($list)) $list = array($list);
1887
+		if(!is_array($list)) {
1888
+			$list = array($list);
1889
+		}
1791 1890
 		// Create a tree for loop
1792 1891
 		$list_count = count($list);
1793 1892
 		for($i=0;$i<$list_count;$i++)
@@ -1875,7 +1974,9 @@  discard block
 block discarded – undo
1875 1974
 	 */
1876 1975
 	function getXmlTree($source_node, $tree, $site_srl, $domain)
1877 1976
 	{
1878
-		if(!$source_node) return;
1977
+		if(!$source_node) {
1978
+			return;
1979
+		}
1879 1980
 
1880 1981
 		$oMenuAdminModel = getAdminModel('menu');
1881 1982
 
@@ -1883,7 +1984,9 @@  discard block
 block discarded – undo
1883 1984
 		{
1884 1985
 			$child_buff = "";
1885 1986
 			// Get data of the child nodes
1886
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
1987
+			if($menu_item_srl&&$tree[$menu_item_srl]) {
1988
+				$child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
1989
+			}
1887 1990
 			// List variables
1888 1991
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1889 1992
 			foreach($names as $key => $val)
@@ -1897,37 +2000,57 @@  discard block
 block discarded – undo
1897 2000
 			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url))
1898 2001
 			{
1899 2002
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
2003
+			} else {
2004
+				$href = sprintf('"%s"', $url);
1900 2005
 			}
1901
-			else $href = sprintf('"%s"', $url);
1902 2006
 			$is_shortcut = $node->is_shortcut;
1903 2007
 			$open_window = $node->open_window;
1904 2008
 			$expand = $node->expand;
1905 2009
 
1906 2010
 			$normal_btn = $node->normal_btn;
1907
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
1908
-			else $normal_btn = '';
2011
+			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) {
2012
+				$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2013
+			} else {
2014
+				$normal_btn = '';
2015
+			}
1909 2016
 			$hover_btn = $node->hover_btn;
1910
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
1911
-			else $hover_btn = '';
2017
+			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) {
2018
+				$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2019
+			} else {
2020
+				$hover_btn = '';
2021
+			}
1912 2022
 			$active_btn = $node->active_btn;
1913
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
1914
-			else $active_btn = '';
2023
+			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) {
2024
+				$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2025
+			} else {
2026
+				$active_btn = '';
2027
+			}
1915 2028
 
1916 2029
 			$group_srls = $node->group_srls;
1917 2030
 
1918 2031
 			if($normal_btn)
1919 2032
 			{
1920
-				if($hover_btn) $hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn); else $hover_str = '';
1921
-				if($active_btn) $active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn); else $active_str = '';
2033
+				if($hover_btn) {
2034
+					$hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn);
2035
+				} else {
2036
+					$hover_str = '';
2037
+				}
2038
+				if($active_btn) {
2039
+					$active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn);
2040
+				} else {
2041
+					$active_str = '';
2042
+				}
1922 2043
 				$link = sprintf('&lt;img src=&quot;%s&quot; onmouseout=&quot;this.src=\'%s\'&quot; alt=&quot;<?php print htmlspecialchars($_names[$lang_type], ENT_COMPAT | ENT_HTML401, \'UTF-8\', false) ?>&quot; %s %s /&gt;', $normal_btn, $normal_btn, $hover_str, $active_str);
1923
-			}
1924
-			else
2044
+			} else
1925 2045
 			{
1926 2046
 				$link = '<?php print $_names[$lang_type]; ?>';
1927 2047
 			}
1928 2048
 			// If the value of node->group_srls exists
1929
-			if($group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged&&%s))',$group_srls,$group_srls == -1?1:0);
1930
-			else $group_check_code = "true";
2049
+			if($group_srls) {
2050
+				$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged&&%s))',$group_srls,$group_srls == -1?1:0);
2051
+			} else {
2052
+				$group_check_code = "true";
2053
+			}
1931 2054
 			$attribute = sprintf(
1932 2055
 				'node_srl="%s" parent_srl="%s" menu_name_key=\'%s\' text="<?php if(%s) { %s }?>" url="<?php print(%s?"%s":"")?>" href="<?php print(%s?%s:"")?>" is_shortcut="%s" desc="%s" open_window="%s" expand="%s" normal_btn="%s" hover_btn="%s" active_btn="%s" link="<?php if(%s) {?>%s<?php }?>"',
1933 2056
 				$menu_item_srl,
@@ -1950,8 +2073,11 @@  discard block
 block discarded – undo
1950 2073
 				$link
1951 2074
 			);
1952 2075
 
1953
-			if($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
1954
-			else $buff .=  sprintf('<node %s />', $attribute);
2076
+			if($child_buff) {
2077
+				$buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
2078
+			} else {
2079
+				$buff .=  sprintf('<node %s />', $attribute);
2080
+			}
1955 2081
 		}
1956 2082
 		return $buff;
1957 2083
 	}
@@ -1970,15 +2096,20 @@  discard block
 block discarded – undo
1970 2096
 	function getPhpCacheCode($source_node, $tree, $site_srl, $domain)
1971 2097
 	{
1972 2098
 		$output = array("buff"=>"", "url_list"=>array());
1973
-		if(!$source_node) return $output;
2099
+		if(!$source_node) {
2100
+			return $output;
2101
+		}
1974 2102
 
1975 2103
 		$oMenuAdminModel = getAdminModel('menu');
1976 2104
 
1977 2105
 		foreach($source_node as $menu_item_srl => $node)
1978 2106
 		{
1979 2107
 			// Get data from child nodes if exist.
1980
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
1981
-			else $child_output = array("buff"=>"", "url_list"=>array());
2108
+			if($menu_item_srl&&$tree[$menu_item_srl]) {
2109
+				$child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
2110
+			} else {
2111
+				$child_output = array("buff"=>"", "url_list"=>array());
2112
+			}
1982 2113
 
1983 2114
 			// List variables
1984 2115
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
@@ -1988,8 +2119,7 @@  discard block
 block discarded – undo
1988 2119
 				if(preg_match('/\{\$lang->menu_gnb(?:_sub)?\[\'([a-zA-Z_]+)\'\]\}/', $val) === 1)
1989 2120
 				{
1990 2121
 					$name_arr_str .= sprintf('"%s"=>"%s",', $key, $val);
1991
-				}
1992
-				else
2122
+				} else
1993 2123
 				{
1994 2124
 					$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\','\''), array('\\\\','\\\''), removeHackTag($val)));
1995 2125
 				}
@@ -1997,11 +2127,16 @@  discard block
 block discarded – undo
1997 2127
 			$name_str = sprintf('$_menu_names[%d] = array(%s); %s', $node->menu_item_srl, $name_arr_str, $child_output['name']);
1998 2128
 
1999 2129
 			// If url value is not empty in the current node, put the value into an array url_list
2000
-			if($node->url) $child_output['url_list'][] = $node->url;
2130
+			if($node->url) {
2131
+				$child_output['url_list'][] = $node->url;
2132
+			}
2001 2133
 			$output['url_list'] = array_merge($output['url_list'], $child_output['url_list']);
2002 2134
 			// If node->group_srls value exists
2003
-			if($node->group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged && %s))',$node->group_srls,$node->group_srls == -1?1:0);
2004
-			else $group_check_code = "true";
2135
+			if($node->group_srls) {
2136
+				$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged && %s))',$node->group_srls,$node->group_srls == -1?1:0);
2137
+			} else {
2138
+				$group_check_code = "true";
2139
+			}
2005 2140
 
2006 2141
 			// List variables
2007 2142
 			$href = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->href);
@@ -2010,8 +2145,9 @@  discard block
 block discarded – undo
2010 2145
 			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
2011 2146
 			{
2012 2147
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
2148
+			} else {
2149
+				$href = sprintf('"%s"', $url);
2013 2150
 			}
2014
-			else $href = sprintf('"%s"', $url);
2015 2151
 			$is_shortcut = $node->is_shortcut;
2016 2152
 			$open_window = $node->open_window;
2017 2153
 			$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->normal_btn);
@@ -2028,29 +2164,48 @@  discard block
 block discarded – undo
2028 2164
 			$expand = $node->expand;
2029 2165
 
2030 2166
 			$normal_btn = $node->normal_btn;
2031
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2032
-			else $normal_btn = '';
2167
+			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) {
2168
+				$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2169
+			} else {
2170
+				$normal_btn = '';
2171
+			}
2033 2172
 
2034 2173
 			$hover_btn = $node->hover_btn;
2035
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2036
-			else $hover_btn = '';
2174
+			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) {
2175
+				$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2176
+			} else {
2177
+				$hover_btn = '';
2178
+			}
2037 2179
 
2038 2180
 			$active_btn = $node->active_btn;
2039
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2040
-			else $active_btn = '';
2181
+			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) {
2182
+				$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2183
+			} else {
2184
+				$active_btn = '';
2185
+			}
2041 2186
 
2042 2187
 
2043 2188
 			$group_srls = $node->group_srls;
2044 2189
 
2045 2190
 			if($normal_btn)
2046 2191
 			{
2047
-				if($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2048
-				if($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2192
+				if($hover_btn) {
2193
+					$hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn);
2194
+				} else {
2195
+					$hover_str = '';
2196
+				}
2197
+				if($active_btn) {
2198
+					$active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn);
2199
+				} else {
2200
+					$active_str = '';
2201
+				}
2049 2202
 				$link = sprintf('"<img src=\"%s\" onmouseout=\"this.src=\'%s\'\" alt=\"".$_menu_names[%d][$lang_type]."\" %s %s />"', $normal_btn, $normal_btn, $node->menu_item_srl, $hover_str, $active_str);
2050
-				if($active_btn) $link_active = sprintf('"<img src=\"%s\" onmouseout=\"this.src=\'%s\'\" alt=\"".$_menu_names[%d][$lang_type]."\" %s />"', $active_btn, $active_btn, $node->menu_item_srl, $hover_str);
2051
-				else $link_active = $link;
2052
-			}
2053
-			else
2203
+				if($active_btn) {
2204
+					$link_active = sprintf('"<img src=\"%s\" onmouseout=\"this.src=\'%s\'\" alt=\"".$_menu_names[%d][$lang_type]."\" %s />"', $active_btn, $active_btn, $node->menu_item_srl, $hover_str);
2205
+				} else {
2206
+					$link_active = $link;
2207
+				}
2208
+			} else
2054 2209
 			{
2055 2210
 				$link_active = $link = sprintf('$_menu_names[%d][$lang_type]', $node->menu_item_srl);
2056 2211
 			}
@@ -2099,11 +2254,15 @@  discard block
 block discarded – undo
2099 2254
 	 */
2100 2255
 	function updateMenuLayout($layout_srl, $menu_srl_list)
2101 2256
 	{
2102
-		if(!count($menu_srl_list)) return;
2257
+		if(!count($menu_srl_list)) {
2258
+			return;
2259
+		}
2103 2260
 		// Delete the value of menu_srls
2104 2261
 		$args->menu_srls = implode(',',$menu_srl_list);
2105 2262
 		$output = executeQuery('menu.deleteMenuLayout', $args);
2106
-		if(!$output->toBool()) return $output;
2263
+		if(!$output->toBool()) {
2264
+			return $output;
2265
+		}
2107 2266
 
2108 2267
 		$args->layout_srl = $layout_srl;
2109 2268
 		// Mapping menu_srls, layout_srl
@@ -2111,7 +2270,9 @@  discard block
 block discarded – undo
2111 2270
 		{
2112 2271
 			$args->menu_srl = $menu_srl_list[$i];
2113 2272
 			$output = executeQuery('menu.insertMenuLayout', $args);
2114
-			if(!$output->toBool()) return $output;
2273
+			if(!$output->toBool()) {
2274
+				return $output;
2275
+			}
2115 2276
 		}
2116 2277
 	}
2117 2278
 
@@ -2134,9 +2295,15 @@  discard block
 block discarded – undo
2134 2295
 			$oMenuModel = getAdminModel('menu');
2135 2296
 			$itemInfo = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
2136 2297
 
2137
-			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2138
-			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2139
-			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2298
+			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) {
2299
+				FileHandler::removeFile($itemInfo->normal_btn);
2300
+			}
2301
+			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) {
2302
+				FileHandler::removeFile($itemInfo->hover_btn);
2303
+			}
2304
+			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) {
2305
+				FileHandler::removeFile($itemInfo->active_btn);
2306
+			}
2140 2307
 		}
2141 2308
 
2142 2309
 		$returnArray = array();
Please login to merge, or discard this patch.
modules/menu/menu.admin.model.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -579,7 +579,7 @@
 block discarded – undo
579 579
 
580 580
 	/**
581 581
 	 * Get module's detail setup contents
582
-	 * @return void
582
+	 * @return Object|null
583 583
 	 */
584 584
 	public function getMenuAdminDetailSetup()
585 585
 	{
Please login to merge, or discard this patch.
Braces   +72 added lines, -45 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@  discard block
 block discarded – undo
41 41
 		// document.getDocumentList query execution
42 42
 		$output = executeQuery('menu.getMenuList', $args);
43 43
 		// Return if no result or an error occurs
44
-		if(!$output->toBool()||!count($output->data)) return $output;
44
+		if(!$output->toBool()||!count($output->data)) {
45
+			return $output;
46
+		}
45 47
 
46 48
 		return $output;
47 49
 	}
@@ -63,7 +65,9 @@  discard block
 block discarded – undo
63 65
 		$args->site_srl = $site_srl ;
64 66
 		$args->menu_srl = $menu_srl;
65 67
 		$output = executeQueryArray('menu.getMenus', $args);
66
-		if(!$output->data) return;
68
+		if(!$output->data) {
69
+			return;
70
+		}
67 71
 		$menus = $output->data;
68 72
 		return $menus;
69 73
 	}
@@ -80,7 +84,9 @@  discard block
 block discarded – undo
80 84
 		$args = new stdClass();
81 85
 		$args->menu_srl = $menu_srl;
82 86
 		$output = executeQuery('menu.getMenu', $args);
83
-		if(!$output->data) return;
87
+		if(!$output->data) {
88
+			return;
89
+		}
84 90
 
85 91
 		$menu_info = $output->data;
86 92
 		$menu_info->xml_file = sprintf('./files/cache/menu/%s.xml.php',$menu_srl);
@@ -105,10 +111,15 @@  discard block
 block discarded – undo
105 111
 		$args->title = $title;
106 112
 		$args->site_srl = $site_srl;
107 113
 		$output = executeQuery('menu.getMenuByTitle', $args);
108
-		if(!$output->data) return;
114
+		if(!$output->data) {
115
+			return;
116
+		}
109 117
 
110
-		if(is_array($output->data)) $menu_info = $output->data[0];
111
-		else $menu_info = $output->data;
118
+		if(is_array($output->data)) {
119
+			$menu_info = $output->data[0];
120
+		} else {
121
+			$menu_info = $output->data;
122
+		}
112 123
 
113 124
 		if($menu_info->menu_srl)
114 125
 		{
@@ -152,15 +163,20 @@  discard block
 block discarded – undo
152 163
 		$output = executeQuery('menu.getMenuItem', $args);
153 164
 		$node = $output->data;
154 165
 		settype($node,'object');
155
-		if($node->group_srls) $node->group_srls = explode(',',$node->group_srls);
156
-		else $node->group_srls = array();
166
+		if($node->group_srls) {
167
+			$node->group_srls = explode(',',$node->group_srls);
168
+		} else {
169
+			$node->group_srls = array();
170
+		}
157 171
 
158 172
 		$tmp_name = unserialize($node->name);
159 173
 		if($tmp_name && count($tmp_name))
160 174
 		{
161 175
 			$selected_lang = array();
162 176
 			$rand_name = $tmp_name[Context::getLangType()];
163
-			if(!$rand_name) $rand_name = array_shift($tmp_name);
177
+			if(!$rand_name) {
178
+				$rand_name = array_shift($tmp_name);
179
+			}
164 180
 			$node->name = $rand_name;
165 181
 		}
166 182
 		return $node;
@@ -178,13 +194,13 @@  discard block
 block discarded – undo
178 194
 		if(!$menuItem->url)
179 195
 		{
180 196
 			$menuItem->moduleType = null;
181
-		}
182
-		else if(strncasecmp('http', $menuItem->url, 4) !== 0)
197
+		} else if(strncasecmp('http', $menuItem->url, 4) !== 0)
183 198
 		{
184 199
 			$oModuleModel = getModel('module');
185 200
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($menuItem->url, 0);
186
-			if(!$moduleInfo) $menuItem->moduleType = 'url';
187
-			else
201
+			if(!$moduleInfo) {
202
+				$menuItem->moduleType = 'url';
203
+			} else
188 204
 			{
189 205
 				if($moduleInfo->mid == $menuItem->url)
190 206
 				{
@@ -193,8 +209,9 @@  discard block
 block discarded – undo
193 209
 					$menuItem->layoutSrl = $moduleInfo->layout_srl;
194 210
 				}
195 211
 			}
212
+		} else {
213
+			$menuItem->moduleType = 'url';
196 214
 		}
197
-		else $menuItem->moduleType = 'url';
198 215
 
199 216
 		// grant setting
200 217
 		if(is_array($menuItem->group_srls) && count($menuItem->group_srls) > 0)
@@ -202,12 +219,10 @@  discard block
 block discarded – undo
202 219
 			if($menuItem->group_srls[0] == -1)
203 220
 			{
204 221
 				$menuItem->grant = 'member';
205
-			}
206
-			else if($menuItem->group_srls[0] == -3)
222
+			} else if($menuItem->group_srls[0] == -3)
207 223
 			{
208 224
 				$menuItem->grant = 'manager';
209
-			}
210
-			else
225
+			} else
211 226
 			{
212 227
 				$menuItem->grant = 'group';
213 228
 			}
@@ -228,11 +243,15 @@  discard block
 block discarded – undo
228 243
 				{
229 244
 					$tmp = $oModuleAdminModel->getLangCode(0, $value->title);
230 245
 					$groupList[$value->group_srl]->title = $tmp[Context::getLangType()];
246
+				} else {
247
+					$groupList[$value->group_srl]->title = $value->title;
231 248
 				}
232
-				else $groupList[$value->group_srl]->title = $value->title;
233 249
 
234
-				if(in_array($key, $menuItem->group_srls)) $groupList[$value->group_srl]->isChecked = true;
235
-				else $groupList[$value->group_srl]->isChecked = false;
250
+				if(in_array($key, $menuItem->group_srls)) {
251
+					$groupList[$value->group_srl]->isChecked = true;
252
+				} else {
253
+					$groupList[$value->group_srl]->isChecked = false;
254
+				}
236 255
 			}
237 256
 		}
238 257
 		$menuItem->groupList = $groupList;
@@ -305,11 +324,12 @@  discard block
 block discarded – undo
305 324
 			$item_info->parent_srl = $parent_srl;
306 325
 			$item_info->parent_menu_name = $parent_info->name;
307 326
 			// In case of modifying the existing menu or addting a new menu to the root
308
-		}
309
-		else
327
+		} else
310 328
 		{
311 329
 			// Get information of the menu if menu_item_srl exists
312
-			if($menu_item_srl) $item_info = $this->getMenuItemInfo($menu_item_srl);
330
+			if($menu_item_srl) {
331
+				$item_info = $this->getMenuItemInfo($menu_item_srl);
332
+			}
313 333
 			// Get only menu_item_srl if no values found, considering it as adding a new menu
314 334
 			if(!$item_info->menu_item_srl)
315 335
 			{
@@ -349,7 +369,9 @@  discard block
 block discarded – undo
349 369
 		foreach($_allModules as $module_name)
350 370
 		{
351 371
 			$module = $oModuleModel->getModuleInfoXml($module_name);
352
-			if(!isset($module)) continue;
372
+			if(!isset($module)) {
373
+				continue;
374
+			}
353 375
 			$defaultSkin = $oModuleModel->getModuleDefaultSkin($module_name, 'P');
354 376
 			$defaultMobileSkin = $oModuleModel->getModuleDefaultSkin($module_name, 'M');
355 377
 			$skinInfo = $oModuleModel->loadSkinInfo(ModuleHandler::getModulePath($module_name), $defaultSkin);
@@ -379,8 +401,7 @@  discard block
 block discarded – undo
379 401
 				$oModuleInfo->title = $pageTypeName['OUTSIDE'];
380 402
 				$oModuleInfo->no_skin = 'Y';
381 403
 				$allModules['OUTSIDE'] = $oModuleInfo;
382
-			}
383
-			else
404
+			} else
384 405
 			{
385 406
 				$allModules[$module_name] = $module;
386 407
 			}
@@ -414,7 +435,9 @@  discard block
 block discarded – undo
414 435
 
415 436
 		// after trigger
416 437
 		$output = ModuleHandler::triggerCall('menu.getModuleListInSitemap', 'after', $moduleList);
417
-		if(!$output->toBool()) return $output;
438
+		if(!$output->toBool()) {
439
+			return $output;
440
+		}
418 441
 
419 442
 		$localModuleList = array_unique($moduleList);
420 443
 
@@ -425,7 +448,9 @@  discard block
 block discarded – undo
425 448
 		$remoteModuleList = array();
426 449
 		foreach($remotePackageList as $package)
427 450
 		{
428
-			if(strpos($package->path, './modules/') !== 0) continue;
451
+			if(strpos($package->path, './modules/') !== 0) {
452
+				continue;
453
+			}
429 454
 
430 455
 			$pathInfo = explode('/', $package->path);
431 456
 			$remoteModuleList[] = $pathInfo[2];
@@ -464,8 +489,7 @@  discard block
 block discarded – undo
464 489
 					$oModuleInfo->title = $pageTypeName['OUTSIDE'];
465 490
 					$oModuleInfo->no_skin = 'Y';
466 491
 					$moduleInfoList['OUTSIDE'] = $oModuleInfo;
467
-				}
468
-				else
492
+				} else
469 493
 				{
470 494
 					$moduleInfoList[$value] = $moduleInfo;
471 495
 				}
@@ -497,8 +521,11 @@  discard block
 block discarded – undo
497 521
 			$isMenuFixed = false;
498 522
 			$output = $this->getMenu($menuSrl);
499 523
 			$php_file = sprintf(_XE_PATH_ . 'files/cache/menu/%s.php',$output->menu_srl);
500
-			if(file_exists($php_file)) include($php_file);
501
-			else $oMenuAdminController->makeXmlFile($menuSrl);
524
+			if(file_exists($php_file)) {
525
+				include($php_file);
526
+			} else {
527
+				$oMenuAdminController->makeXmlFile($menuSrl);
528
+			}
502 529
 
503 530
 			if(count($menu->list)>0)
504 531
 			{
@@ -518,8 +545,7 @@  discard block
 block discarded – undo
518 545
 			$menuItems->title = $output->title;
519 546
 			$menuItems->menuItems = $menu;
520 547
 			$menuList[] = $menuItems;
521
-		}
522
-		else
548
+		} else
523 549
 		{
524 550
 			$menuListFromDB = $this->getMenus($siteSrl);
525 551
 			if(is_array($menuListFromDB))
@@ -527,8 +553,9 @@  discard block
 block discarded – undo
527 553
 				$oAdmin = getClass('admin');
528 554
 				foreach($menuListFromDB AS $key=>$value)
529 555
 				{
530
-					if($value->title == $oAdmin->getAdminMenuName()) unset($output[$key]);
531
-					else
556
+					if($value->title == $oAdmin->getAdminMenuName()) {
557
+						unset($output[$key]);
558
+					} else
532 559
 					{
533 560
 						unset($menu);
534 561
 						unset($menuItems);
@@ -564,8 +591,7 @@  discard block
 block discarded – undo
564 591
 						if($value->menu_srl == $this->menuSrlWithinHome)
565 592
 						{
566 593
 							$menuList[-1] = $menuItems;
567
-						}
568
-						else
594
+						} else
569 595
 						{
570 596
 							$menuList[] = $menuItems;
571 597
 						}
@@ -639,8 +665,11 @@  discard block
 block discarded – undo
639 665
 			$args = new stdClass;
640 666
 			$args->menu_item_srl = $menu['node_srl'];
641 667
 			$args->is_shortcut = 'Y';
642
-			if($menu['menu_name_key']) $args->name = $menu['menu_name_key'];
643
-			else $args->name = $menu['menu_name'];
668
+			if($menu['menu_name_key']) {
669
+				$args->name = $menu['menu_name_key'];
670
+			} else {
671
+				$args->name = $menu['menu_name'];
672
+			}
644 673
 			$output = executeQuery('menu.updateMenuItem', $args);
645 674
 
646 675
 			$isMenuFixed = true;
@@ -661,8 +690,7 @@  discard block
 block discarded – undo
661 690
 				if($midInfo->page_type)
662 691
 				{
663 692
 					$menu['module_type'] = $midInfo->page_type;
664
-				}
665
-				else
693
+				} else
666 694
 				{
667 695
 					$menu['module_type'] = $midInfo->module;
668 696
 				}
@@ -671,8 +699,7 @@  discard block
 block discarded – undo
671 699
 			if($moduleInfo->setup_index_act)
672 700
 			{
673 701
 				$menu['setup_index_act'] = $moduleInfo->setup_index_act;
674
-			}
675
-			else if($moduleInfo->default_index_act)
702
+			} else if($moduleInfo->default_index_act)
676 703
 			{
677 704
 				$menu['setup_index_act'] = $moduleInfo->default_index_act;
678 705
 			}
Please login to merge, or discard this patch.
Spacing   +90 added lines, -90 removed lines patch added patch discarded remove patch
@@ -27,21 +27,21 @@  discard block
 block discarded – undo
27 27
 	 */
28 28
 	function getMenuList($obj)
29 29
 	{
30
-		if(!$obj->site_srl)
30
+		if (!$obj->site_srl)
31 31
 		{
32 32
 			$site_module_info = Context::get('site_module_info');
33
-			$obj->site_srl = (int)$site_module_info->site_srl;
33
+			$obj->site_srl = (int) $site_module_info->site_srl;
34 34
 		}
35 35
 		$args = new stdClass;
36 36
 		$args->site_srl = $obj->site_srl;
37 37
 		$args->sort_index = $obj->sort_index;
38
-		$args->page = $obj->page?$obj->page:1;
39
-		$args->list_count = $obj->list_count?$obj->list_count:20;
40
-		$args->page_count = $obj->page_count?$obj->page_count:10;
38
+		$args->page = $obj->page ? $obj->page : 1;
39
+		$args->list_count = $obj->list_count ? $obj->list_count : 20;
40
+		$args->page_count = $obj->page_count ? $obj->page_count : 10;
41 41
 		// document.getDocumentList query execution
42 42
 		$output = executeQuery('menu.getMenuList', $args);
43 43
 		// Return if no result or an error occurs
44
-		if(!$output->toBool()||!count($output->data)) return $output;
44
+		if (!$output->toBool() || !count($output->data)) return $output;
45 45
 
46 46
 		return $output;
47 47
 	}
@@ -53,17 +53,17 @@  discard block
 block discarded – undo
53 53
 	 */
54 54
 	function getMenus($site_srl = null)
55 55
 	{
56
-		if(!isset($site_srl))
56
+		if (!isset($site_srl))
57 57
 		{
58 58
 			$site_module_info = Context::get('site_module_info');
59
-			$site_srl = (int)$site_module_info->site_srl;
59
+			$site_srl = (int) $site_module_info->site_srl;
60 60
 		}
61 61
 		// Get information from the DB
62 62
 		$args = new stdClass();
63
-		$args->site_srl = $site_srl ;
63
+		$args->site_srl = $site_srl;
64 64
 		$args->menu_srl = $menu_srl;
65 65
 		$output = executeQueryArray('menu.getMenus', $args);
66
-		if(!$output->data) return;
66
+		if (!$output->data) return;
67 67
 		$menus = $output->data;
68 68
 		return $menus;
69 69
 	}
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
 		$args = new stdClass();
81 81
 		$args->menu_srl = $menu_srl;
82 82
 		$output = executeQuery('menu.getMenu', $args);
83
-		if(!$output->data) return;
83
+		if (!$output->data) return;
84 84
 
85 85
 		$menu_info = $output->data;
86
-		$menu_info->xml_file = sprintf('./files/cache/menu/%s.xml.php',$menu_srl);
87
-		$menu_info->php_file = sprintf('./files/cache/menu/%s.php',$menu_srl);
86
+		$menu_info->xml_file = sprintf('./files/cache/menu/%s.xml.php', $menu_srl);
87
+		$menu_info->php_file = sprintf('./files/cache/menu/%s.php', $menu_srl);
88 88
 		return $menu_info;
89 89
 	}
90 90
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	function getMenuByTitle($title, $site_srl = 0)
98 98
 	{
99 99
 		// Get information from the DB
100
-		if(!is_array($title))
100
+		if (!is_array($title))
101 101
 		{
102 102
 			$title = array($title);
103 103
 		}
@@ -105,15 +105,15 @@  discard block
 block discarded – undo
105 105
 		$args->title = $title;
106 106
 		$args->site_srl = $site_srl;
107 107
 		$output = executeQuery('menu.getMenuByTitle', $args);
108
-		if(!$output->data) return;
108
+		if (!$output->data) return;
109 109
 
110
-		if(is_array($output->data)) $menu_info = $output->data[0];
110
+		if (is_array($output->data)) $menu_info = $output->data[0];
111 111
 		else $menu_info = $output->data;
112 112
 
113
-		if($menu_info->menu_srl)
113
+		if ($menu_info->menu_srl)
114 114
 		{
115
-			$menu_info->xml_file = sprintf('./files/cache/menu/%s.xml.php',$menu_info->menu_srl);
116
-			$menu_info->php_file = sprintf('./files/cache/menu/%s.php',$menu_info->menu_srl);
115
+			$menu_info->xml_file = sprintf('./files/cache/menu/%s.xml.php', $menu_info->menu_srl);
116
+			$menu_info->php_file = sprintf('./files/cache/menu/%s.php', $menu_info->menu_srl);
117 117
 		}
118 118
 		return $menu_info;
119 119
 	}
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 		$args = new stdClass();
131 131
 		$args->title = $title;
132 132
 		$output = executeQueryArray('menu.getMenuByTitle', $args);
133
-		if(!$output->data)
133
+		if (!$output->data)
134 134
 		{
135 135
 			return array();
136 136
 		}
@@ -151,16 +151,16 @@  discard block
 block discarded – undo
151 151
 		$args->menu_item_srl = $menu_item_srl;
152 152
 		$output = executeQuery('menu.getMenuItem', $args);
153 153
 		$node = $output->data;
154
-		settype($node,'object');
155
-		if($node->group_srls) $node->group_srls = explode(',',$node->group_srls);
154
+		settype($node, 'object');
155
+		if ($node->group_srls) $node->group_srls = explode(',', $node->group_srls);
156 156
 		else $node->group_srls = array();
157 157
 
158 158
 		$tmp_name = unserialize($node->name);
159
-		if($tmp_name && count($tmp_name))
159
+		if ($tmp_name && count($tmp_name))
160 160
 		{
161 161
 			$selected_lang = array();
162 162
 			$rand_name = $tmp_name[Context::getLangType()];
163
-			if(!$rand_name) $rand_name = array_shift($tmp_name);
163
+			if (!$rand_name) $rand_name = array_shift($tmp_name);
164 164
 			$node->name = $rand_name;
165 165
 		}
166 166
 		return $node;
@@ -175,18 +175,18 @@  discard block
 block discarded – undo
175 175
 		$menuItemSrl = Context::get('menu_item_srl');
176 176
 		$menuItem = $this->getMenuItemInfo($menuItemSrl);
177 177
 
178
-		if(!$menuItem->url)
178
+		if (!$menuItem->url)
179 179
 		{
180 180
 			$menuItem->moduleType = null;
181 181
 		}
182
-		else if(strncasecmp('http', $menuItem->url, 4) !== 0)
182
+		else if (strncasecmp('http', $menuItem->url, 4) !== 0)
183 183
 		{
184 184
 			$oModuleModel = getModel('module');
185 185
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($menuItem->url, 0);
186
-			if(!$moduleInfo) $menuItem->moduleType = 'url';
186
+			if (!$moduleInfo) $menuItem->moduleType = 'url';
187 187
 			else
188 188
 			{
189
-				if($moduleInfo->mid == $menuItem->url)
189
+				if ($moduleInfo->mid == $menuItem->url)
190 190
 				{
191 191
 					$menuItem->moduleType = $moduleInfo->module;
192 192
 					$menuItem->pageType = $moduleInfo->page_type;
@@ -197,13 +197,13 @@  discard block
 block discarded – undo
197 197
 		else $menuItem->moduleType = 'url';
198 198
 
199 199
 		// grant setting
200
-		if(is_array($menuItem->group_srls) && count($menuItem->group_srls) > 0)
200
+		if (is_array($menuItem->group_srls) && count($menuItem->group_srls) > 0)
201 201
 		{
202
-			if($menuItem->group_srls[0] == -1)
202
+			if ($menuItem->group_srls[0] == -1)
203 203
 			{
204 204
 				$menuItem->grant = 'member';
205 205
 			}
206
-			else if($menuItem->group_srls[0] == -3)
206
+			else if ($menuItem->group_srls[0] == -3)
207 207
 			{
208 208
 				$menuItem->grant = 'manager';
209 209
 			}
@@ -217,21 +217,21 @@  discard block
 block discarded – undo
217 217
 		$oMemberModel = getModel('member');
218 218
 		$oModuleAdminModel = getAdminModel('module');
219 219
 		$output = $oMemberModel->getGroups();
220
-		if(is_array($output))
220
+		if (is_array($output))
221 221
 		{
222 222
 			$groupList = array();
223
-			foreach($output AS $key=>$value)
223
+			foreach ($output AS $key=>$value)
224 224
 			{
225 225
 				$groupList[$value->group_srl] = new stdClass();
226 226
 				$groupList[$value->group_srl]->group_srl = $value->group_srl;
227
-				if(substr($value->title,0,12)=='$user_lang->')
227
+				if (substr($value->title, 0, 12) == '$user_lang->')
228 228
 				{
229 229
 					$tmp = $oModuleAdminModel->getLangCode(0, $value->title);
230 230
 					$groupList[$value->group_srl]->title = $tmp[Context::getLangType()];
231 231
 				}
232 232
 				else $groupList[$value->group_srl]->title = $value->title;
233 233
 
234
-				if(in_array($key, $menuItem->group_srls)) $groupList[$value->group_srl]->isChecked = true;
234
+				if (in_array($key, $menuItem->group_srls)) $groupList[$value->group_srl]->isChecked = true;
235 235
 				else $groupList[$value->group_srl]->isChecked = false;
236 236
 			}
237 237
 		}
@@ -269,10 +269,10 @@  discard block
 block discarded – undo
269 269
 	 */
270 270
 	function getMenuItemNames($source_name, $site_srl = null)
271 271
 	{
272
-		if(!$site_srl)
272
+		if (!$site_srl)
273 273
 		{
274 274
 			$site_module_info = Context::get('site_module_info');
275
-			$site_srl = (int)$site_module_info->site_srl;
275
+			$site_srl = (int) $site_module_info->site_srl;
276 276
 		}
277 277
 		// Get language code
278 278
 		$oModuleAdminModel = getAdminModel('module');
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 
297 297
 		// Add a sub-menu if there is parent_srl but not menu_item_srl
298 298
 		$item_info = new stdClass;
299
-		if(!$menu_item_srl && $parent_srl)
299
+		if (!$menu_item_srl && $parent_srl)
300 300
 		{
301 301
 			// Get information of the parent menu
302 302
 			$parent_info = $this->getMenuItemInfo($parent_srl);
@@ -309,9 +309,9 @@  discard block
 block discarded – undo
309 309
 		else
310 310
 		{
311 311
 			// Get information of the menu if menu_item_srl exists
312
-			if($menu_item_srl) $item_info = $this->getMenuItemInfo($menu_item_srl);
312
+			if ($menu_item_srl) $item_info = $this->getMenuItemInfo($menu_item_srl);
313 313
 			// Get only menu_item_srl if no values found, considering it as adding a new menu
314
-			if(!$item_info->menu_item_srl)
314
+			if (!$item_info->menu_item_srl)
315 315
 			{
316 316
 				$item_info->menu_item_srl = getNextSequence();
317 317
 			}
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 		$oTemplate = &TemplateHandler::getInstance();
328 328
 		$tpl = $oTemplate->compile($this->module_path.'tpl', 'menu_item_info');
329 329
 
330
-		$this->add('tpl', str_replace("\n"," ",$tpl));
330
+		$this->add('tpl', str_replace("\n", " ", $tpl));
331 331
 	}
332 332
 
333 333
 	/**
@@ -346,10 +346,10 @@  discard block
 block discarded – undo
346 346
 
347 347
 		Context::loadLang('modules/page/lang');
348 348
 
349
-		foreach($_allModules as $module_name)
349
+		foreach ($_allModules as $module_name)
350 350
 		{
351 351
 			$module = $oModuleModel->getModuleInfoXml($module_name);
352
-			if(!isset($module)) continue;
352
+			if (!isset($module)) continue;
353 353
 			$defaultSkin = $oModuleModel->getModuleDefaultSkin($module_name, 'P');
354 354
 			$defaultMobileSkin = $oModuleModel->getModuleDefaultSkin($module_name, 'M');
355 355
 			$skinInfo = $oModuleModel->loadSkinInfo(ModuleHandler::getModulePath($module_name), $defaultSkin);
@@ -361,10 +361,10 @@  discard block
 block discarded – undo
361 361
 			$module->defaultMobileSkin->skin = $defaultMobileSkin;
362 362
 			$module->defaultMobileSkin->title = $mobileSkinInfo->title ? $mobileSkinInfo->title : $defaultMobileSkin;
363 363
 
364
-			$module->package_srl = $oAutoinstallModel->getPackageSrlByPath('./modules/' . $module_name);
365
-			$module->url = _XE_LOCATION_SITE_ . '?mid=download&package_srl=' . $module->package_srl;
364
+			$module->package_srl = $oAutoinstallModel->getPackageSrlByPath('./modules/'.$module_name);
365
+			$module->url = _XE_LOCATION_SITE_.'?mid=download&package_srl='.$module->package_srl;
366 366
 
367
-			if($module_name == 'page')
367
+			if ($module_name == 'page')
368 368
 			{
369 369
 				$pageTypeName = Context::getLang('page_type_name');
370 370
 				$module->title = $pageTypeName['ARTICLE'];
@@ -401,11 +401,11 @@  discard block
 block discarded – undo
401 401
 		$moduleList = array('page');
402 402
 
403 403
 		$output = $oModuleModel->getModuleListByInstance($site_srl);
404
-		if(is_array($output->data))
404
+		if (is_array($output->data))
405 405
 		{
406
-			foreach($output->data as $value)
406
+			foreach ($output->data as $value)
407 407
 			{
408
-				if($value->instanceCount > 1)
408
+				if ($value->instanceCount > 1)
409 409
 				{
410 410
 					$moduleList[] = $value->module;
411 411
 				}
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 
415 415
 		// after trigger
416 416
 		$output = ModuleHandler::triggerCall('menu.getModuleListInSitemap', 'after', $moduleList);
417
-		if(!$output->toBool()) return $output;
417
+		if (!$output->toBool()) return $output;
418 418
 
419 419
 		$localModuleList = array_unique($moduleList);
420 420
 
@@ -423,9 +423,9 @@  discard block
 block discarded – undo
423 423
 		// get have instance
424 424
 		$remotePackageList = $oAutoinstallModel->getHaveInstance(array('path'));
425 425
 		$remoteModuleList = array();
426
-		foreach($remotePackageList as $package)
426
+		foreach ($remotePackageList as $package)
427 427
 		{
428
-			if(strpos($package->path, './modules/') !== 0) continue;
428
+			if (strpos($package->path, './modules/') !== 0) continue;
429 429
 
430 430
 			$pathInfo = explode('/', $package->path);
431 431
 			$remoteModuleList[] = $pathInfo[2];
@@ -443,13 +443,13 @@  discard block
 block discarded – undo
443 443
 
444 444
 		$moduleInfoList = array();
445 445
 		Context::loadLang('modules/page/lang');
446
-		if(is_array($moduleList))
446
+		if (is_array($moduleList))
447 447
 		{
448
-			foreach($moduleList as $value)
448
+			foreach ($moduleList as $value)
449 449
 			{
450 450
 				$moduleInfo = $oModuleModel->getModuleInfoXml($value);
451 451
 
452
-				if($value == 'page')
452
+				if ($value == 'page')
453 453
 				{
454 454
 					$pageTypeName = Context::getLang('page_type_name');
455 455
 					$moduleInfo->title = $pageTypeName['ARTICLE'];
@@ -480,10 +480,10 @@  discard block
 block discarded – undo
480 480
 		$siteSrl = Context::get('site_srl');
481 481
 		$menuSrl = Context::get('menu_srl');
482 482
 
483
-		if(!isset($siteSrl))
483
+		if (!isset($siteSrl))
484 484
 		{
485 485
 			$site_module_info = Context::get('site_module_info');
486
-			$siteSrl = (int)$site_module_info->site_srl;
486
+			$siteSrl = (int) $site_module_info->site_srl;
487 487
 		}
488 488
 
489 489
 		$oModuleModel = getModel('module');
@@ -492,24 +492,24 @@  discard block
 block discarded – undo
492 492
 		$start_module = $oModuleModel->getSiteInfo(0, $columnList);
493 493
 
494 494
 		$menuList = array();
495
-		if($menuSrl)
495
+		if ($menuSrl)
496 496
 		{
497 497
 			$isMenuFixed = false;
498 498
 			$output = $this->getMenu($menuSrl);
499
-			$php_file = sprintf(_XE_PATH_ . 'files/cache/menu/%s.php',$output->menu_srl);
500
-			if(file_exists($php_file)) include($php_file);
499
+			$php_file = sprintf(_XE_PATH_.'files/cache/menu/%s.php', $output->menu_srl);
500
+			if (file_exists($php_file)) include($php_file);
501 501
 			else $oMenuAdminController->makeXmlFile($menuSrl);
502 502
 
503
-			if(count($menu->list)>0)
503
+			if (count($menu->list) > 0)
504 504
 			{
505
-				foreach($menu->list AS $key=>$value)
505
+				foreach ($menu->list AS $key=>$value)
506 506
 				{
507
-					$this->_menuInfoSetting($menu->list[$key], $start_module, $isMenuFixed, $menuSrl,$siteSrl);
507
+					$this->_menuInfoSetting($menu->list[$key], $start_module, $isMenuFixed, $menuSrl, $siteSrl);
508 508
 				}
509 509
 			}
510 510
 
511 511
 			// menu recreate
512
-			if($isMenuFixed)
512
+			if ($isMenuFixed)
513 513
 			{
514 514
 				$oMenuAdminController->makeXmlFile($menuSrl);
515 515
 			}
@@ -522,18 +522,18 @@  discard block
 block discarded – undo
522 522
 		else
523 523
 		{
524 524
 			$menuListFromDB = $this->getMenus($siteSrl);
525
-			if(is_array($menuListFromDB))
525
+			if (is_array($menuListFromDB))
526 526
 			{
527 527
 				$oAdmin = getClass('admin');
528
-				foreach($menuListFromDB AS $key=>$value)
528
+				foreach ($menuListFromDB AS $key=>$value)
529 529
 				{
530
-					if($value->title == $oAdmin->getAdminMenuName()) unset($output[$key]);
530
+					if ($value->title == $oAdmin->getAdminMenuName()) unset($output[$key]);
531 531
 					else
532 532
 					{
533 533
 						unset($menu);
534 534
 						unset($menuItems);
535
-						$value->php_file = sprintf(_XE_PATH_ . 'files/cache/menu/%s.php',$value->menu_srl);
536
-						if(!file_exists($value->php_file))
535
+						$value->php_file = sprintf(_XE_PATH_.'files/cache/menu/%s.php', $value->menu_srl);
536
+						if (!file_exists($value->php_file))
537 537
 						{
538 538
 							$oMenuAdminController->makeXmlFile($value->menu_srl);
539 539
 						}
@@ -541,16 +541,16 @@  discard block
 block discarded – undo
541 541
 						include($value->php_file);
542 542
 
543 543
 						$isMenuFixed = false;
544
-						if(count($menu->list) > 0)
544
+						if (count($menu->list) > 0)
545 545
 						{
546
-							foreach($menu->list AS $key2=>$value2)
546
+							foreach ($menu->list AS $key2=>$value2)
547 547
 							{
548
-								$this->_menuInfoSetting($menu->list[$key2], $start_module, $isMenuFixed, $value->menu_srl,$siteSrl);
548
+								$this->_menuInfoSetting($menu->list[$key2], $start_module, $isMenuFixed, $value->menu_srl, $siteSrl);
549 549
 							}
550 550
 						}
551 551
 
552 552
 						// menu recreate
553
-						if($isMenuFixed)
553
+						if ($isMenuFixed)
554 554
 						{
555 555
 							$oMenuAdminController->makeXmlFile($value->menu_srl);
556 556
 						}
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
 						$menuItems->menuItems = $menu;
562 562
 
563 563
 						// If include home menu, move first
564
-						if($value->menu_srl == $this->menuSrlWithinHome)
564
+						if ($value->menu_srl == $this->menuSrlWithinHome)
565 565
 						{
566 566
 							$menuList[-1] = $menuItems;
567 567
 						}
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
 	public function getMenuAdminDetailSetup()
585 585
 	{
586 586
 		$menuItemSrl = Context::get('menu_item_srl');
587
-		if(!$menuItemSrl)
587
+		if (!$menuItemSrl)
588 588
 		{
589 589
 			return new Object(-1, 'msg_invalid_request');
590 590
 		}
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 		$menuItemInfo = $this->getMenuItemInfo($menuItemSrl);
593 593
 
594 594
 		// if menu is shortcut
595
-		if($menuItemInfo->is_shortcut == 'Y')
595
+		if ($menuItemInfo->is_shortcut == 'Y')
596 596
 		{
597 597
 			return new Object(-1, 'msg_invalid_request');
598 598
 		}
@@ -604,18 +604,18 @@  discard block
 block discarded – undo
604 604
 		// get xml info
605 605
 		$moduleConfInfo = $oModuleModel->getModuleInfoXml($moduleInfo->module);
606 606
 
607
-		if($moduleConfInfo->setup_index_act)
607
+		if ($moduleConfInfo->setup_index_act)
608 608
 		{
609 609
 			$setupUrl = getNotEncodedUrl('', 'module', 'admin', 'act', $moduleConfInfo->setup_index_act, 'module_srl', $moduleInfo->module_srl, 'isLayoutDrop', '1');
610 610
 		}
611 611
 
612
-		if($moduleConfInfo->simple_setup_index_act)
612
+		if ($moduleConfInfo->simple_setup_index_act)
613 613
 		{
614 614
 			$oTargetmoduleAdminModel = getAdminModel($moduleInfo->module);
615 615
 			$advancedSetupUrl = getUrl('', 'module', 'admin', 'act', $moduleConfInfo->setup_index_act, 'module_srl', $moduleInfo->module_srl);
616 616
 			$simpleSetupHtml = $oTargetmoduleAdminModel->{$moduleConfInfo->simple_setup_index_act}($moduleInfo->module_srl, $advancedSetupUrl);
617 617
 
618
-			if($simpleSetupHtml)
618
+			if ($simpleSetupHtml)
619 619
 			{
620 620
 				$this->add('simpleSetupHtml', $simpleSetupHtml);
621 621
 			}
@@ -628,18 +628,18 @@  discard block
 block discarded – undo
628 628
 	 * @param array $menu
629 629
 	 * @return void
630 630
 	 */
631
-	private function _menuInfoSetting(&$menu, &$start_module, &$isMenuFixed, $menuSrl,$siteSrl = 0)
631
+	private function _menuInfoSetting(&$menu, &$start_module, &$isMenuFixed, $menuSrl, $siteSrl = 0)
632 632
 	{
633 633
 		$oModuleModel = getModel('module');
634 634
 		// if url is empty and is_shortcut is 'N', change to is_shortcut 'Y'
635
-		if(!$menu['url'] && $menu['is_shortcut'] == 'N')
635
+		if (!$menu['url'] && $menu['is_shortcut'] == 'N')
636 636
 		{
637 637
 			$menu['is_shortcut'] = 'Y';
638 638
 
639 639
 			$args = new stdClass;
640 640
 			$args->menu_item_srl = $menu['node_srl'];
641 641
 			$args->is_shortcut = 'Y';
642
-			if($menu['menu_name_key']) $args->name = $menu['menu_name_key'];
642
+			if ($menu['menu_name_key']) $args->name = $menu['menu_name_key'];
643 643
 			else $args->name = $menu['menu_name'];
644 644
 			$output = executeQuery('menu.updateMenuItem', $args);
645 645
 
@@ -648,17 +648,17 @@  discard block
 block discarded – undo
648 648
 
649 649
 		//if menu type is module menu
650 650
 		//if(!empty($menu['url']) && !preg_match('/^http/i', $menu['url']))
651
-		if($menu['is_shortcut'] != 'Y')
651
+		if ($menu['is_shortcut'] != 'Y')
652 652
 		{
653 653
 			unset($midInfo, $moduleInfo);
654 654
 			$midInfo = $oModuleModel->getModuleInfoByMid($menu['url'], $siteSrl);
655 655
 			$moduleInfo = $oModuleModel->getModuleInfoXml($midInfo->module);
656 656
 
657
-			if($midInfo)
657
+			if ($midInfo)
658 658
 			{
659 659
 				$menu['module_srl'] = $midInfo->module_srl;
660 660
 				$menu['module'] = $midInfo->module;
661
-				if($midInfo->page_type)
661
+				if ($midInfo->page_type)
662 662
 				{
663 663
 					$menu['module_type'] = $midInfo->page_type;
664 664
 				}
@@ -668,16 +668,16 @@  discard block
 block discarded – undo
668 668
 				}
669 669
 			}
670 670
 
671
-			if($moduleInfo->setup_index_act)
671
+			if ($moduleInfo->setup_index_act)
672 672
 			{
673 673
 				$menu['setup_index_act'] = $moduleInfo->setup_index_act;
674 674
 			}
675
-			else if($moduleInfo->default_index_act)
675
+			else if ($moduleInfo->default_index_act)
676 676
 			{
677 677
 				$menu['setup_index_act'] = $moduleInfo->default_index_act;
678 678
 			}
679 679
 
680
-			if($menu['is_shortcut'] == 'N' && $midInfo->mid == $start_module->mid)
680
+			if ($menu['is_shortcut'] == 'N' && $midInfo->mid == $start_module->mid)
681 681
 			{
682 682
 				$menu['is_start_module'] = true;
683 683
 				$this->menuSrlWithinHome = $menuSrl;
@@ -686,9 +686,9 @@  discard block
 block discarded – undo
686 686
 			$menu['layout_srl'] = $midInfo->layout_srl;
687 687
 			$menu['browser_title'] = $midInfo->browser_title;
688 688
 		}
689
-		if(count($menu['list']) > 0)
689
+		if (count($menu['list']) > 0)
690 690
 		{
691
-			foreach($menu['list'] as $key=>$value)
691
+			foreach ($menu['list'] as $key=>$value)
692 692
 			{
693 693
 				$this->_menuInfoSetting($menu['list'][$key], $start_module, $isMenuFixed, $menuSrl, $siteSrl);
694 694
 			}
Please login to merge, or discard this patch.