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
Pull Request — develop (#1814)
by
unknown
11:57
created
modules/layout/layout.view.php 4 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.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 /**
4
- * @class  layoutView
5
- * @author NAVER ([email protected])
6
- * admin view class of the layout module
7
- */
4
+	 * @class  layoutView
5
+	 * @author NAVER ([email protected])
6
+	 * admin view class of the layout module
7
+	 */
8 8
 class layoutView extends layout
9 9
 {
10 10
 	/**
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   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 	 */
14 14
 	function init()
15 15
 	{
16
-		$this->setTemplatePath($this->module_path.'tpl');
16
+		$this->setTemplatePath($this->module_path . 'tpl');
17 17
 	}
18 18
 
19 19
 	/**
@@ -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,10 +67,10 @@  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 75
 						$c .= Context::getLang('article_preview_content') . ' ';
76 76
 					}
@@ -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 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,19 +130,19 @@  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 147
 									$val->value = Context::getRequestUri() . substr($val->value, 2);
148 148
 								}
@@ -152,22 +152,22 @@  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 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);
@@ -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,7 +193,7 @@  discard block
 block discarded – undo
193 193
 				}
194 194
 			}
195 195
 		}
196
-		catch(Exception $e)
196
+		catch (Exception $e)
197 197
 		{
198 198
 			$content = '<div class="message error"><p id="preview_error">' . $e->getMessage() . '</p></div>';
199 199
 			Context::set('content', $content);
@@ -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,12 +225,12 @@  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();
232 232
 		Context::set('layout_tpl', $layout_tpl);
233
-		$this->setTemplatePath($this->module_path.'tpl');
233
+		$this->setTemplatePath($this->module_path . 'tpl');
234 234
 		$this->setTemplateFile('layout_preview');
235 235
 	}
236 236
 
@@ -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,7 +299,7 @@  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
 		}
@@ -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
-		Context::addHtmlHeader("<style type=\"text/css\" charset=\"UTF-8\">".$code_css."</style>");
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
 			}
@@ -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   +195 added lines, -195 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,25 +219,25 @@  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
 			}
239 239
 
240
-			$args->redirect_url = Context::getDefaultUrl().$redirectModuleInfo->mid;
240
+			$args->redirect_url = Context::getDefaultUrl() . $redirectModuleInfo->mid;
241 241
 		}
242 242
 
243 243
 		$args->profile_image = $args->profile_image ? 'Y' : 'N';
@@ -256,43 +256,43 @@  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
-			$signupItem->isPublic = ($all_args->{'is_'.$key.'_public'} == 'Y' && $signupItem->isUse) ? 'Y' : 'N';
273
-			if($signupItem->imageType)
272
+			$signupItem->isPublic = ($all_args->{'is_' . $key . '_public'} == 'Y' && $signupItem->isUse) ? 'Y' : 'N';
273
+			if ($signupItem->imageType)
274 274
 			{
275
-				$signupItem->max_width = $all_args->{$key.'_max_width'};
276
-				$signupItem->max_height = $all_args->{$key.'_max_height'};
275
+				$signupItem->max_width = $all_args->{$key . '_max_width'};
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
-				$extendItem = $extendItems[$all_args->{$key.'_member_join_form_srl'}];
282
+				$extendItem = $extendItems[$all_args->{$key . '_member_join_form_srl'}];
283 283
 				$signupItem->type = $extendItem->column_type;
284 284
 				$signupItem->member_join_form_srl = $extendItem->member_join_form_srl;
285 285
 				$signupItem->title = $extendItem->column_title;
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){
434
-				$signupItem->max_width = $config->{$key.'_max_width'};
435
-				$signupItem->max_height = $config->{$key.'_max_height'};
433
+			if ($signupItem->imageType) {
434
+				$signupItem->max_width = $config->{$key . '_max_width'};
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,10 +454,10 @@  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
-					$signupItem->max_width = $config->{$key.'_max_width'};
460
-					$signupItem->max_height = $config->{$key.'_max_height'};
459
+					$signupItem->max_width = $config->{$key . '_max_width'};
460
+					$signupItem->max_height = $config->{$key . '_max_height'};
461 461
 				}
462 462
 				$list_order[] = $signupItem;
463 463
 			}
@@ -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:20" /></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
 	}
@@ -549,11 +549,11 @@  discard block
 block discarded – undo
549 549
 	function _createLoginRuleset($identifier)
550 550
 	{
551 551
 		$xml_file = './files/ruleset/login.xml';
552
-		$buff = '<?xml version="1.0" encoding="utf-8"?>'.
553
-			'<ruleset version="1.5.0">'.
554
-			'<customrules>'.
555
-			'</customrules>'.
556
-			'<fields>%s</fields>'.
552
+		$buff = '<?xml version="1.0" encoding="utf-8"?>' .
553
+			'<ruleset version="1.5.0">' .
554
+			'<customrules>' .
555
+			'</customrules>' .
556
+			'<fields>%s</fields>' .
557 557
 			'</ruleset>';
558 558
 
559 559
 		$fields = array();
@@ -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
 	}
@@ -577,15 +577,15 @@  discard block
 block discarded – undo
577 577
 	function _createFindAccountByQuestion($identifier)
578 578
 	{
579 579
 		$xml_file = './files/ruleset/find_member_account_by_question.xml';
580
-		$buff = '<?xml version="1.0" encoding="utf-8"?>'.
581
-			'<ruleset version="1.5.0">'.
582
-			'<customrules>'.
583
-			'</customrules>'.
584
-			'<fields>%s</fields>'.
580
+		$buff = '<?xml version="1.0" encoding="utf-8"?>' .
581
+			'<ruleset version="1.5.0">' .
582
+			'<customrules>' .
583
+			'</customrules>' .
584
+			'<fields>%s</fields>' .
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
 		}
@@ -1253,7 +1253,7 @@  discard block
 block discarded – undo
1253 1253
 		$default_args->group_srl = $defaultGroupSrl;
1254 1254
 		$output = $this->updateGroup($default_args);
1255 1255
 
1256
-		$this->setMessage(Context::getLang('success_updated').' ('.Context::getLang('msg_insert_group_name_detail').')');
1256
+		$this->setMessage(Context::getLang('success_updated') . ' (' . Context::getLang('msg_insert_group_name_detail') . ')');
1257 1257
 
1258 1258
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList');
1259 1259
 		$this->setRedirectUrl($returnUrl);
@@ -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:20" /></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 4 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.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php	
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 /**
4
- * @class  memberAdminView
5
- * @author NAVER ([email protected])
6
- * member module's admin view class
7
- */
4
+	 * @class  memberAdminView
5
+	 * @author NAVER ([email protected])
6
+	 * member module's admin view class
7
+	 */
8 8
 class memberAdminView extends member
9 9
 {
10 10
 	/**
Please login to merge, or discard this patch.
Spacing   +83 added lines, -83 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
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 		$security = new Security();
64 64
 		$security->encodeHTML('group_list..', 'config..');
65 65
 
66
-		$this->setTemplatePath($this->module_path.'tpl');
66
+		$this->setTemplatePath($this->module_path . 'tpl');
67 67
 	}
68 68
 
69 69
 	/**
@@ -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,49 +406,49 @@  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
 			{
422
-				if ($formInfo->required && $formInfo->name != 'password') $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
422
+				if ($formInfo->required && $formInfo->name != 'password') $formTag->title = '<em style="color:red">*</em> ' . $formTag->title;
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,
451
-							$formInfo->name.'tag',
451
+							$formInfo->name . 'tag',
452 452
 							$target->src,
453 453
 							$formInfo->title,
454 454
 							$functionName,
@@ -462,12 +462,12 @@  discard block
 block discarded – undo
462 462
 					$inputTag .= sprintf('<input type="file" name="%s" id="%s" value="" accept="image/*" /><p class="help-block">%s: %dpx, %s: %dpx</p>',
463 463
 						$formInfo->name,
464 464
 						$formInfo->name,
465
-						$lang->{$formInfo->name.'_max_width'},
466
-						$member_config->{$formInfo->name.'_max_width'},
467
-						$lang->{$formInfo->name.'_max_height'},
468
-						$member_config->{$formInfo->name.'_max_height'});
465
+						$lang->{$formInfo->name . '_max_width'},
466
+						$member_config->{$formInfo->name . '_max_width'},
467
+						$lang->{$formInfo->name . '_max_height'},
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,
@@ -490,22 +490,22 @@  discard block
 block discarded – undo
490 490
 								$val);
491 491
 						}
492 492
 						$inputTag = sprintf($inputTag, implode('', $optionTag));
493
-						$inputTag .= '<input type="text" name="find_account_answer" id="find_account_answer" title="'.Context::getLang('find_account_answer').'" value="'.$memberInfo['find_account_answer'].'" />';
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
-						$inputTag = '<input type="email" name="email_address" id="email_address" value="'.$memberInfo['email_address'].'" />';
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
-						$inputTag = '<input type="url" name="homepage" id="homepage" value="'.$memberInfo['homepage'].'" />';
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
-						$inputTag = '<input type="url" name="blog" id="blog" value="'.$memberInfo['blog'].'" />';
508
+						$inputTag = '<input type="url" name="blog" id="blog" value="' . $memberInfo['blog'] . '" />';
509 509
 					}
510 510
 					else
511 511
 					{
@@ -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"';
561
-								$optionTag[] = '<label for="%column_name%'.$__i.'"><input type="checkbox" id="%column_name%'.$__i.'" name="%column_name%[]" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
560
+								if (is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"';
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
-								$optionTag[] = '<label><input type="radio" name="%column_name%" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
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
-						$template = '<select name="'.$formInfo->name.'" id="'.$formInfo->name.'">%s</select>';
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,8 +617,8 @@  discard block
 block discarded – undo
617 617
 					$replace = array_merge($extentionReplace, $replace);
618 618
 					$inputTag = preg_replace('@%(\w+)%@e', '$replace[$1]', $template);
619 619
 
620
-					if($extendForm->description)
621
-						$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
620
+					if ($extendForm->description)
621
+						$inputTag .= '<p class="help-block">' . $extendForm->description . '</p>';
622 622
 				}
623 623
 				$formTag->inputTag = $inputTag;
624 624
 				$formTags[] = $formTag;
@@ -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]);
@@ -313,7 +314,9 @@  discard block
 block discarded – undo
313 314
 		$extendForm = $oMemberModel->getCombineJoinForm($this->memberInfo);
314 315
 		Context::set('extend_form_list', $extendForm);
315 316
 		$memberInfo = get_object_vars(Context::get('member_info'));
316
-		if (!is_array($memberInfo['group_list'])) $memberInfo['group_list'] = array();
317
+		if (!is_array($memberInfo['group_list'])) {
318
+			$memberInfo['group_list'] = array();
319
+		}
317 320
 		Context::set('memberInfo', $memberInfo);
318 321
 
319 322
 		$disableColumns = array('password', 'find_account_question');
@@ -408,18 +411,25 @@  discard block
 block discarded – undo
408 411
 
409 412
 		foreach($member_config->signupForm as $no=>$formInfo)
410 413
 		{
411
-			if(!$formInfo->isUse)continue;
412
-			if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue;
414
+			if(!$formInfo->isUse) {
415
+				continue;
416
+			}
417
+			if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') {
418
+				continue;
419
+			}
413 420
 			$formTag = new stdClass();
414 421
 			$inputTag = '';
415 422
 			$formTag->title = ($formInfo->isDefaultForm) ? $lang->{$formInfo->name} : $formInfo->title;
416 423
 			if($isAdmin)
417 424
 			{
418
-				if($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
419
-			}
420
-			else
425
+				if($formInfo->mustRequired) {
426
+					$formTag->title = '<em style="color:red">*</em> '.$formTag->title;
427
+				}
428
+			} else
421 429
 			{
422
-				if ($formInfo->required && $formInfo->name != 'password') $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
430
+				if ($formInfo->required && $formInfo->name != 'password') {
431
+					$formTag->title = '<em style="color:red">*</em> '.$formTag->title;
432
+				}
423 433
 			}
424 434
 			$formTag->name = $formInfo->name;
425 435
 
@@ -432,13 +442,11 @@  discard block
 block discarded – undo
432 442
 					{
433 443
 						$target = $memberInfo['profile_image'];
434 444
 						$functionName = 'doDeleteProfileImage';
435
-					}
436
-					else if($formInfo->name == 'image_name')
445
+					} else if($formInfo->name == 'image_name')
437 446
 					{
438 447
 						$target = $memberInfo['image_name'];
439 448
 						$functionName = 'doDeleteImageName';
440
-					}
441
-					else if($formInfo->name == 'image_mark')
449
+					} else if($formInfo->name == 'image_mark')
442 450
 					{
443 451
 						$target = $memberInfo['image_mark'];
444 452
 						$functionName = 'doDeleteImageMark';
@@ -454,8 +462,7 @@  discard block
 block discarded – undo
454 462
 							$functionName,
455 463
 							$memberInfo['member_srl'],
456 464
 							$lang->cmd_delete);
457
-					}
458
-					else
465
+					} else
459 466
 					{
460 467
 						$inputTag = sprintf('<input type="hidden" name="__%s_exist" value="false" />', $formInfo->name);
461 468
 					}
@@ -474,16 +481,18 @@  discard block
 block discarded – undo
474 481
 							$memberInfo['birthday'],
475 482
 							zdate($memberInfo['birthday'], 'Y-m-d', false),
476 483
 							$lang->cmd_delete);
477
-					}
478
-					else if($formInfo->name == 'find_account_question')
484
+					} else if($formInfo->name == 'find_account_question')
479 485
 					{
480 486
 						$formTag->type = 'select';
481 487
 						$inputTag = '<select name="find_account_question" id="find_account_question" style="display:block;margin:0 0 8px 0">%s</select>';
482 488
 						$optionTag = array();
483 489
 						foreach($lang->find_account_question_items as $key=>$val)
484 490
 						{
485
-							if($key == $memberInfo['find_account_question']) $selected = 'selected="selected"';
486
-							else $selected = '';
491
+							if($key == $memberInfo['find_account_question']) {
492
+								$selected = 'selected="selected"';
493
+							} else {
494
+								$selected = '';
495
+							}
487 496
 							$optionTag[] = sprintf('<option value="%s" %s >%s</option>',
488 497
 								$key,
489 498
 								$selected,
@@ -491,23 +500,19 @@  discard block
 block discarded – undo
491 500
 						}
492 501
 						$inputTag = sprintf($inputTag, implode('', $optionTag));
493 502
 						$inputTag .= '<input type="text" name="find_account_answer" id="find_account_answer" title="'.Context::getLang('find_account_answer').'" value="'.$memberInfo['find_account_answer'].'" />';
494
-					}
495
-					else if($formInfo->name == 'email_address')
503
+					} else if($formInfo->name == 'email_address')
496 504
 					{
497 505
 						$formTag->type = 'email';
498 506
 						$inputTag = '<input type="email" name="email_address" id="email_address" value="'.$memberInfo['email_address'].'" />';
499
-					}
500
-					else if($formInfo->name == 'homepage')
507
+					} else if($formInfo->name == 'homepage')
501 508
 					{
502 509
 						$formTag->type = 'url';
503 510
 						$inputTag = '<input type="url" name="homepage" id="homepage" value="'.$memberInfo['homepage'].'" />';
504
-					}
505
-					else if($formInfo->name == 'blog')
511
+					} else if($formInfo->name == 'blog')
506 512
 					{
507 513
 						$formTag->type = 'url';
508 514
 						$inputTag = '<input type="url" name="blog" id="blog" value="'.$memberInfo['blog'].'" />';
509
-					}
510
-					else
515
+					} else
511 516
 					{
512 517
 						$formTag->type = 'text';
513 518
 						$inputTag = sprintf('<input type="text" name="%s" id="%s" value="%s" />',
@@ -526,27 +531,22 @@  discard block
 block discarded – undo
526 531
 					if($extendForm->column_type == 'text')
527 532
 					{
528 533
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
529
-					}
530
-					else if($extendForm->column_type == 'homepage')
534
+					} else if($extendForm->column_type == 'homepage')
531 535
 					{
532 536
 						$template = '<input type="url" name="%column_name%" id="%column_name%" value="%value%" />';
533
-					}
534
-					else if($extendForm->column_type == 'email_address')
537
+					} else if($extendForm->column_type == 'email_address')
535 538
 					{
536 539
 						$template = '<input type="email" name="%column_name%" id="%column_name%" value="%value%" />';
537
-					}
538
-					else if($extendForm->column_type == 'tel')
540
+					} else if($extendForm->column_type == 'tel')
539 541
 					{
540 542
 						$extentionReplace = array('tel_0' => $extendForm->value[0],
541 543
 							'tel_1' => $extendForm->value[1],
542 544
 							'tel_2' => $extendForm->value[2]);
543 545
 						$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
-					}
545
-					else if($extendForm->column_type == 'textarea')
546
+					} else if($extendForm->column_type == 'textarea')
546 547
 					{
547 548
 						$template = '<textarea name="%column_name%" id="%column_name%" rows="4" cols="42">%value%</textarea>';
548
-					}
549
-					else if($extendForm->column_type == 'checkbox')
549
+					} else if($extendForm->column_type == 'checkbox')
550 550
 					{
551 551
 						$template = '';
552 552
 						if($extendForm->default_value)
@@ -557,14 +557,15 @@  discard block
 block discarded – undo
557 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)) {
561
+									$checked = 'checked="checked"';
562
+								}
561 563
 								$optionTag[] = '<label for="%column_name%'.$__i.'"><input type="checkbox" id="%column_name%'.$__i.'" name="%column_name%[]" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
562 564
 								$__i++;
563 565
 							}
564 566
 							$template = sprintf($template, implode('', $optionTag));
565 567
 						}
566
-					}
567
-					else if($extendForm->column_type == 'radio')
568
+					} else if($extendForm->column_type == 'radio')
568 569
 					{
569 570
 						$template = '';
570 571
 						if($extendForm->default_value)
@@ -573,14 +574,16 @@  discard block
 block discarded – undo
573 574
 							$optionTag = array();
574 575
 							foreach($extendForm->default_value as $v)
575 576
 							{
576
-								if($extendForm->value == $v)$checked = 'checked="checked"';
577
-								else $checked = '';
577
+								if($extendForm->value == $v) {
578
+									$checked = 'checked="checked"';
579
+								} else {
580
+									$checked = '';
581
+								}
578 582
 								$optionTag[] = '<label><input type="radio" name="%column_name%" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
579 583
 							}
580 584
 							$template = sprintf($template, implode('', $optionTag));
581 585
 						}
582
-					}
583
-					else if($extendForm->column_type == 'select')
586
+					} else if($extendForm->column_type == 'select')
584 587
 					{
585 588
 						$template = '<select name="'.$formInfo->name.'" id="'.$formInfo->name.'">%s</select>';
586 589
 						$optionTag = array();
@@ -589,26 +592,26 @@  discard block
 block discarded – undo
589 592
 						{
590 593
 							foreach($extendForm->default_value as $v)
591 594
 							{
592
-								if($v == $extendForm->value) $selected = 'selected="selected"';
593
-								else $selected = '';
595
+								if($v == $extendForm->value) {
596
+									$selected = 'selected="selected"';
597
+								} else {
598
+									$selected = '';
599
+								}
594 600
 								$optionTag[] = sprintf('<option value="%s" %s >%s</option>', $v, $selected, $v);
595 601
 							}
596 602
 						}
597 603
 						$template = sprintf($template, implode('', $optionTag));
598
-					}
599
-					else if($extendForm->column_type == 'kr_zip')
604
+					} else if($extendForm->column_type == 'kr_zip')
600 605
 					{
601 606
 						$krzipModel = getModel('krzip');
602 607
 						if($krzipModel && method_exists($krzipModel , 'getKrzipCodeSearchHtml' ))
603 608
 						{
604 609
 							$template = $krzipModel->getKrzipCodeSearchHtml($extendForm->column_name, $extendForm->value);
605 610
 						}
606
-					}
607
-					else if($extendForm->column_type == 'jp_zip')
611
+					} else if($extendForm->column_type == 'jp_zip')
608 612
 					{
609 613
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
610
-					}
611
-					else if($extendForm->column_type == 'date')
614
+					} else if($extendForm->column_type == 'date')
612 615
 					{
613 616
 						$extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete);
614 617
 						$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,8 +620,9 @@  discard block
 block discarded – undo
617 620
 					$replace = array_merge($extentionReplace, $replace);
618 621
 					$inputTag = preg_replace('@%(\w+)%@e', '$replace[$1]', $template);
619 622
 
620
-					if($extendForm->description)
621
-						$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
623
+					if($extendForm->description) {
624
+											$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
625
+					}
622 626
 				}
623 627
 				$formTag->inputTag = $inputTag;
624 628
 				$formTags[] = $formTag;
@@ -653,8 +657,9 @@  discard block
 block discarded – undo
653 657
 			$oMemberModel = getModel('member');
654 658
 			$join_form = $oMemberModel->getJoinForm($member_join_form_srl);
655 659
 
656
-			if(!$join_form) Context::set('member_join_form_srl','',true);
657
-			else
660
+			if(!$join_form) {
661
+				Context::set('member_join_form_srl','',true);
662
+			} else
658 663
 			{
659 664
 				Context::set('join_form', $join_form);
660 665
 				$security = new Security();
Please login to merge, or discard this patch.
modules/member/member.api.php 4 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.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 /**
4
- * @class  memberAPI
5
- * @author NAVER ([email protected])
6
- * API Processing of View Action in the member module
7
- */
4
+	 * @class  memberAPI
5
+	 * @author NAVER ([email protected])
6
+	 * API Processing of View Action in the member module
7
+	 */
8 8
 class memberAPI extends member
9 9
 {
10 10
 	/**
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   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 /**
4
- * @class  memberController
5
- * @author NAVER ([email protected])
6
- * Controller class of member module
7
- */
4
+	 * @class  memberController
5
+	 * @author NAVER ([email protected])
6
+	 * Controller class of member module
7
+	 */
8 8
 class memberController extends member
9 9
 {
10 10
 	/**
@@ -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   +444 added lines, -444 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,11 +192,11 @@  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
 		// Variables
201 201
 		$oDocumentController = getController('document');
202 202
 		$oDocumentController->deleteDocument($document_srl, true);
@@ -211,37 +211,37 @@  discard block
 block discarded – undo
211 211
 	{
212 212
 		$name = Context::get('name');
213 213
 		$value = Context::get('value');
214
-		if(!$value) return;
214
+		if (!$value) return;
215 215
 
216 216
 		$oMemberModel = getModel('member');
217 217
 		// Check if logged-in
218 218
 		$logged_info = Context::get('logged_info');
219 219
 
220 220
 
221
-		switch($name)
221
+		switch ($name)
222 222
 		{
223 223
 			case 'user_id' :
224 224
 				// Check denied ID
225
-				if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id');
225
+				if ($oMemberModel->isDeniedID($value)) return new Object(0, 'denied_user_id');
226 226
 				// Check if duplicated
227 227
 				$member_srl = $oMemberModel->getMemberSrlByUserID($value);
228
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_user_id');
228
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_user_id');
229 229
 				break;
230 230
 			case 'nick_name' :
231 231
 				// Check denied ID
232
-				if($oMemberModel->isDeniedNickName($value))
232
+				if ($oMemberModel->isDeniedNickName($value))
233 233
 				{
234
-					return new Object(0,'denied_nick_name');
234
+					return new Object(0, 'denied_nick_name');
235 235
 				}
236 236
 				// Check if duplicated
237 237
 				$member_srl = $oMemberModel->getMemberSrlByNickName($value);
238
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name');
238
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_nick_name');
239 239
 
240 240
 				break;
241 241
 			case 'email_address' :
242 242
 				// Check if duplicated
243 243
 				$member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
244
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address');
244
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_email_address');
245 245
 				break;
246 246
 		}
247 247
 	}
@@ -253,25 +253,25 @@  discard block
 block discarded – undo
253 253
 	 */
254 254
 	function procMemberInsert()
255 255
 	{
256
-		if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request");
257
-		$oMemberModel = &getModel ('member');
256
+		if (Context::getRequestMethod() == "GET") return new Object(-1, "msg_invalid_request");
257
+		$oMemberModel = &getModel('member');
258 258
 		$config = $oMemberModel->getMemberConfig();
259 259
 
260 260
 		// call a trigger (before)
261
-		$trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config);
262
-		if(!$trigger_output->toBool ()) return $trigger_output;
261
+		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'before', $config);
262
+		if (!$trigger_output->toBool()) return $trigger_output;
263 263
 		// Check if an administrator allows a membership
264
-		if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled');
264
+		if ($config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
265 265
 		// Check if the user accept the license terms (only if terms exist)
266
-		if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
266
+		if ($config->agreement && Context::get('accept_agreement') != 'Y') return $this->stop('msg_accept_agreement');
267 267
 
268 268
 		// Extract the necessary information in advance
269 269
 		$getVars = array();
270
-		if($config->signupForm)
270
+		if ($config->signupForm)
271 271
 		{
272
-			foreach($config->signupForm as $formInfo)
272
+			foreach ($config->signupForm as $formInfo)
273 273
 			{
274
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
274
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
275 275
 				{
276 276
 					$getVars[] = $formInfo->name;
277 277
 				}
@@ -279,22 +279,22 @@  discard block
 block discarded – undo
279 279
 		}
280 280
 
281 281
 		$args = new stdClass;
282
-		foreach($getVars as $val)
282
+		foreach ($getVars as $val)
283 283
 		{
284 284
 			$args->{$val} = Context::get($val);
285
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
285
+			if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
286 286
 		}
287 287
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
288
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
288
+		if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
289 289
 
290 290
 		$args->find_account_answer = Context::get('find_account_answer');
291 291
 		$args->allow_mailing = Context::get('allow_mailing');
292 292
 		$args->allow_message = Context::get('allow_message');
293 293
 
294
-		if($args->password1) $args->password = $args->password1;
294
+		if ($args->password1) $args->password = $args->password1;
295 295
 
296 296
 		// check password strength
297
-		if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
297
+		if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
298 298
 		{
299 299
 			$message = Context::getLang('about_password_strength');
300 300
 			return new Object(-1, $message[$config->password_strength]);
@@ -320,58 +320,58 @@  discard block
 block discarded – undo
320 320
 		unset($all_args->secret_text);
321 321
 
322 322
 		// Set the user state as "denied" when using mail authentication
323
-		if($config->enable_confirm == 'Y') $args->denied = 'Y';
323
+		if ($config->enable_confirm == 'Y') $args->denied = 'Y';
324 324
 		// Add extra vars after excluding necessary information from all the requested arguments
325 325
 		$extra_vars = delObjectVars($all_args, $args);
326 326
 		$args->extra_vars = serialize($extra_vars);
327 327
 
328 328
 		// remove whitespace
329 329
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
330
-		foreach($checkInfos as $val)
330
+		foreach ($checkInfos as $val)
331 331
 		{
332
-			if(isset($args->{$val}))
332
+			if (isset($args->{$val}))
333 333
 			{
334 334
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
335 335
 			}
336 336
 		}
337 337
 		$output = $this->insertMember($args);
338
-		if(!$output->toBool()) return $output;
338
+		if (!$output->toBool()) return $output;
339 339
 
340 340
 		// insert ProfileImage, ImageName, ImageMark
341 341
 		$profile_image = $_FILES['profile_image'];
342
-		if(is_uploaded_file($profile_image['tmp_name']))
342
+		if (is_uploaded_file($profile_image['tmp_name']))
343 343
 		{
344 344
 			$this->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
345 345
 		}
346 346
 
347 347
 		$image_mark = $_FILES['image_mark'];
348
-		if(is_uploaded_file($image_mark['tmp_name']))
348
+		if (is_uploaded_file($image_mark['tmp_name']))
349 349
 		{
350 350
 			$this->insertImageMark($args->member_srl, $image_mark['tmp_name']);
351 351
 		}
352 352
 
353 353
 		$image_name = $_FILES['image_name'];
354
-		if(is_uploaded_file($image_name['tmp_name']))
354
+		if (is_uploaded_file($image_name['tmp_name']))
355 355
 		{
356 356
 			$this->insertImageName($args->member_srl, $image_name['tmp_name']);
357 357
 		}
358 358
 
359 359
 		// If a virtual site, join the site
360 360
 		$site_module_info = Context::get('site_module_info');
361
-		if($site_module_info->site_srl > 0)
361
+		if ($site_module_info->site_srl > 0)
362 362
 		{
363 363
 			$columnList = array('site_srl', 'group_srl');
364 364
 			$default_group = $oMemberModel->getDefaultGroup($site_module_info->site_srl, $columnList);
365
-			if($default_group->group_srl)
365
+			if ($default_group->group_srl)
366 366
 			{
367 367
 				$this->addMemberToGroup($args->member_srl, $default_group->group_srl, $site_module_info->site_srl);
368 368
 			}
369 369
 
370 370
 		}
371 371
 		// Log-in
372
-		if($config->enable_confirm != 'Y')
372
+		if ($config->enable_confirm != 'Y')
373 373
 		{
374
-			if($config->identifier == 'email_address')
374
+			if ($config->identifier == 'email_address')
375 375
 			{
376 376
 				$output = $this->doLogin($args->email_address);
377 377
 			}
@@ -379,8 +379,8 @@  discard block
 block discarded – undo
379 379
 			{
380 380
 				$output = $this->doLogin($args->user_id);
381 381
 			}
382
-			if(!$output->toBool()) {
383
-				if($output->error == -9)
382
+			if (!$output->toBool()) {
383
+				if ($output->error == -9)
384 384
 					$output->error = -11;
385 385
 				return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output);
386 386
 			}
@@ -388,8 +388,8 @@  discard block
 block discarded – undo
388 388
 
389 389
 		// Results
390 390
 		$this->add('member_srl', $args->member_srl);
391
-		if($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
392
-		if($config->enable_confirm == 'Y')
391
+		if ($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
392
+		if ($config->enable_confirm == 'Y')
393 393
 		{
394 394
 			$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
395 395
 			$this->setMessage($msg);
@@ -398,19 +398,19 @@  discard block
 block discarded – undo
398 398
 		else $this->setMessage('success_registed');
399 399
 		// Call a trigger (after)
400 400
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
401
-		if(!$trigger_output->toBool()) return $trigger_output;
401
+		if (!$trigger_output->toBool()) return $trigger_output;
402 402
 
403
-		if($config->redirect_url)
403
+		if ($config->redirect_url)
404 404
 		{
405 405
 			$returnUrl = $config->redirect_url;
406 406
 		}
407 407
 		else
408 408
 		{
409
-			if(Context::get('success_return_url'))
409
+			if (Context::get('success_return_url'))
410 410
 			{
411 411
 				$returnUrl = Context::get('success_return_url');
412 412
 			}
413
-			else if($_COOKIE['XE_REDIRECT_URL'])
413
+			else if ($_COOKIE['XE_REDIRECT_URL'])
414 414
 			{
415 415
 				$returnUrl = $_COOKIE['XE_REDIRECT_URL'];
416 416
 				setcookie("XE_REDIRECT_URL", '', 1);
@@ -424,26 +424,26 @@  discard block
 block discarded – undo
424 424
 
425 425
 	function procMemberModifyInfoBefore()
426 426
 	{
427
-		if($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD')
427
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD')
428 428
 		{
429 429
 			return $this->stop('msg_invalid_request');
430 430
 		}
431 431
 
432
-		if(!Context::get('is_logged'))
432
+		if (!Context::get('is_logged'))
433 433
 		{
434 434
 			return $this->stop('msg_not_logged');
435 435
 		}
436 436
 
437 437
 		$password = Context::get('password');
438 438
 
439
-		if(!$password)
439
+		if (!$password)
440 440
 		{
441 441
 			return $this->stop('msg_invalid_request');
442 442
 		}
443 443
 
444 444
 		$oMemberModel = getModel('member');
445 445
 
446
-		if(!$this->memberInfo->password)
446
+		if (!$this->memberInfo->password)
447 447
 		{
448 448
 			// Get information of logged-in user
449 449
 			$logged_info = Context::get('logged_info');
@@ -454,14 +454,14 @@  discard block
 block discarded – undo
454 454
 			$this->memberInfo->password = $memberInfo->password;
455 455
 		}
456 456
 		// Verify the current password
457
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
457
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
458 458
 		{
459 459
 			return new Object(-1, 'invalid_password');
460 460
 		}
461 461
 
462 462
 		$_SESSION['rechecked_password_step'] = 'VALIDATE_PASSWORD';
463 463
 
464
-		if(Context::get('success_return_url'))
464
+		if (Context::get('success_return_url'))
465 465
 		{
466 466
 			$redirectUrl = Context::get('success_return_url');
467 467
 		}
@@ -479,26 +479,26 @@  discard block
 block discarded – undo
479 479
 	 */
480 480
 	function procMemberModifyInfo()
481 481
 	{
482
-		if(!Context::get('is_logged'))
482
+		if (!Context::get('is_logged'))
483 483
 		{
484 484
 			return $this->stop('msg_not_logged');
485 485
 		}
486 486
 
487
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
487
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
488 488
 		{
489 489
 			return $this->stop('msg_invalid_request');
490 490
 		}
491 491
 		unset($_SESSION['rechecked_password_step']);
492 492
 
493 493
 		// Extract the necessary information in advance
494
-		$oMemberModel = &getModel ('member');
495
-		$config = $oMemberModel->getMemberConfig ();
496
-		$getVars = array('find_account_answer','allow_mailing','allow_message');
497
-		if($config->signupForm)
494
+		$oMemberModel = &getModel('member');
495
+		$config = $oMemberModel->getMemberConfig();
496
+		$getVars = array('find_account_answer', 'allow_mailing', 'allow_message');
497
+		if ($config->signupForm)
498 498
 		{
499
-			foreach($config->signupForm as $formInfo)
499
+			foreach ($config->signupForm as $formInfo)
500 500
 			{
501
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
501
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
502 502
 				{
503 503
 					$getVars[] = $formInfo->name;
504 504
 				}
@@ -506,16 +506,16 @@  discard block
 block discarded – undo
506 506
 		}
507 507
 
508 508
 		$args = new stdClass;
509
-		foreach($getVars as $val)
509
+		foreach ($getVars as $val)
510 510
 		{
511 511
 			$args->{$val} = Context::get($val);
512
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
512
+			if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
513 513
 		}
514 514
 		// Login Information
515 515
 		$logged_info = Context::get('logged_info');
516 516
 		$args->member_srl = $logged_info->member_srl;
517 517
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
518
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
518
+		if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
519 519
 		// Remove some unnecessary variables from all the vars
520 520
 		$all_args = Context::getRequestVars();
521 521
 		unset($all_args->module);
@@ -539,9 +539,9 @@  discard block
 block discarded – undo
539 539
 
540 540
 		// remove whitespace
541 541
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
542
-		foreach($checkInfos as $val)
542
+		foreach ($checkInfos as $val)
543 543
 		{
544
-			if(isset($args->{$val}))
544
+			if (isset($args->{$val}))
545 545
 			{
546 546
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
547 547
 			}
@@ -549,22 +549,22 @@  discard block
 block discarded – undo
549 549
 
550 550
 		// Execute insert or update depending on the value of member_srl
551 551
 		$output = $this->updateMember($args);
552
-		if(!$output->toBool()) return $output;
552
+		if (!$output->toBool()) return $output;
553 553
 
554 554
 		$profile_image = $_FILES['profile_image'];
555
-		if(is_uploaded_file($profile_image['tmp_name']))
555
+		if (is_uploaded_file($profile_image['tmp_name']))
556 556
 		{
557 557
 			$this->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
558 558
 		}
559 559
 
560 560
 		$image_mark = $_FILES['image_mark'];
561
-		if(is_uploaded_file($image_mark['tmp_name']))
561
+		if (is_uploaded_file($image_mark['tmp_name']))
562 562
 		{
563 563
 			$this->insertImageMark($args->member_srl, $image_mark['tmp_name']);
564 564
 		}
565 565
 
566 566
 		$image_name = $_FILES['image_name'];
567
-		if(is_uploaded_file($image_name['tmp_name']))
567
+		if (is_uploaded_file($image_name['tmp_name']))
568 568
 		{
569 569
 			$this->insertImageName($args->member_srl, $image_name['tmp_name']);
570 570
 		}
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 
580 580
 		// Call a trigger after successfully log-in (after)
581 581
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo);
582
-		if(!$trigger_output->toBool()) return $trigger_output;
582
+		if (!$trigger_output->toBool()) return $trigger_output;
583 583
 
584 584
 		$this->setSessionInfo();
585 585
 		// Return result
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
 	 */
601 601
 	function procMemberModifyPassword()
602 602
 	{
603
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
603
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
604 604
 		// Extract the necessary information in advance
605 605
 		$current_password = trim(Context::get('current_password'));
606 606
 		$password = trim(Context::get('password1'));
@@ -614,17 +614,17 @@  discard block
 block discarded – undo
614 614
 
615 615
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
616 616
 		// Verify the cuttent password
617
-		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
617
+		if (!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
618 618
 
619 619
 		// Check if a new password is as same as the previous password
620
-		if($current_password == $password) return new Object(-1, 'invalid_new_password');
620
+		if ($current_password == $password) return new Object(-1, 'invalid_new_password');
621 621
 
622 622
 		// Execute insert or update depending on the value of member_srl
623 623
 		$args = new stdClass;
624 624
 		$args->member_srl = $member_srl;
625 625
 		$args->password = $password;
626 626
 		$output = $this->updateMemberPassword($args);
627
-		if(!$output->toBool()) return $output;
627
+		if (!$output->toBool()) return $output;
628 628
 
629 629
 		$this->add('member_srl', $args->member_srl);
630 630
 		$this->setMessage('success_updated');
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 	 */
641 641
 	function procMemberLeave()
642 642
 	{
643
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
643
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
644 644
 		// Extract the necessary information in advance
645 645
 		$password = trim(Context::get('password'));
646 646
 		// Get information of logged-in user
@@ -649,17 +649,17 @@  discard block
 block discarded – undo
649 649
 		// Create a member model object
650 650
 		$oMemberModel = getModel('member');
651 651
 		// Get information of member_srl
652
-		if(!$this->memberInfo->password)
652
+		if (!$this->memberInfo->password)
653 653
 		{
654 654
 			$columnList = array('member_srl', 'password');
655 655
 			$memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
656 656
 			$this->memberInfo->password = $memberInfo->password;
657 657
 		}
658 658
 		// Verify the cuttent password
659
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
659
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
660 660
 
661 661
 		$output = $this->deleteMember($member_srl);
662
-		if(!$output->toBool()) return $output;
662
+		if (!$output->toBool()) return $output;
663 663
 		// Destroy all session information
664 664
 		$this->destroySessionInfo();
665 665
 		// Return success message
@@ -678,17 +678,17 @@  discard block
 block discarded – undo
678 678
 	{
679 679
 		// Check if the file is successfully uploaded
680 680
 		$file = $_FILES['profile_image'];
681
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
681
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
682 682
 		// Ignore if member_srl is invalid or doesn't exist.
683 683
 		$member_srl = Context::get('member_srl');
684
-		if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
684
+		if (!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
685 685
 
686 686
 		$logged_info = Context::get('logged_info');
687
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
687
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
688 688
 		// Return if member module is set not to use an image name or the user is not an administrator ;
689 689
 		$oModuleModel = getModel('module');
690 690
 		$config = $oModuleModel->getModuleConfig('member');
691
-		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
691
+		if ($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
692 692
 
693 693
 		$this->insertProfileImage($member_srl, $file['tmp_name']);
694 694
 		// Page refresh
@@ -710,25 +710,25 @@  discard block
 block discarded – undo
710 710
 	{
711 711
 
712 712
 		// Check uploaded file
713
-		if(!checkUploadedFile($target_file)) return;
713
+		if (!checkUploadedFile($target_file)) return;
714 714
 
715 715
 		$oMemberModel = getModel('member');
716 716
 		$config = $oMemberModel->getMemberConfig();
717 717
 
718 718
 		// Get an image size
719 719
 		$max_width = $config->profile_image_max_width;
720
-		if(!$max_width) $max_width = "90";
720
+		if (!$max_width) $max_width = "90";
721 721
 		$max_height = $config->profile_image_max_height;
722
-		if(!$max_height) $max_height = "90";
722
+		if (!$max_height) $max_height = "90";
723 723
 		// Get a target path to save
724 724
 		$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
725 725
 		FileHandler::makeDir($target_path);
726 726
 
727 727
 		// Get file information
728 728
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
729
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
730
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
731
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
729
+		if (IMAGETYPE_PNG == $type) $ext = 'png';
730
+		elseif (IMAGETYPE_JPEG == $type) $ext = 'jpg';
731
+		elseif (IMAGETYPE_GIF == $type) $ext = 'gif';
732 732
 		else
733 733
 		{
734 734
 			return;
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 
739 739
 		$target_filename = sprintf('%s%d.%s', $target_path, $member_srl, $ext);
740 740
 		// Convert if the image size is larger than a given size or if the format is not a gif
741
-		if(($width > $max_width || $height > $max_height ) && $type != 1)
741
+		if (($width > $max_width || $height > $max_height) && $type != 1)
742 742
 		{
743 743
 			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
744 744
 		}
@@ -757,17 +757,17 @@  discard block
 block discarded – undo
757 757
 	{
758 758
 		// Check if the file is successfully uploaded
759 759
 		$file = $_FILES['image_name'];
760
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
760
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
761 761
 		// Ignore if member_srl is invalid or doesn't exist.
762 762
 		$member_srl = Context::get('member_srl');
763
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
763
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_name');
764 764
 
765 765
 		$logged_info = Context::get('logged_info');
766
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
766
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
767 767
 		// Return if member module is set not to use an image name or the user is not an administrator ;
768 768
 		$oModuleModel = getModel('module');
769 769
 		$config = $oModuleModel->getModuleConfig('member');
770
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
770
+		if ($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
771 771
 
772 772
 		$this->insertImageName($member_srl, $file['tmp_name']);
773 773
 		// Page refresh
@@ -788,15 +788,15 @@  discard block
 block discarded – undo
788 788
 	function insertImageName($member_srl, $target_file)
789 789
 	{
790 790
 		// Check uploaded file
791
-		if(!checkUploadedFile($target_file)) return;
791
+		if (!checkUploadedFile($target_file)) return;
792 792
 
793 793
 		$oModuleModel = getModel('module');
794 794
 		$config = $oModuleModel->getModuleConfig('member');
795 795
 		// Get an image size
796 796
 		$max_width = $config->image_name_max_width;
797
-		if(!$max_width) $max_width = "90";
797
+		if (!$max_width) $max_width = "90";
798 798
 		$max_height = $config->image_name_max_height;
799
-		if(!$max_height) $max_height = "20";
799
+		if (!$max_height) $max_height = "20";
800 800
 		// Get a target path to save
801 801
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
802 802
 		FileHandler::makeDir($target_path);
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
 		// Get file information
806 806
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
807 807
 		// Convert if the image size is larger than a given size or if the format is not a gif
808
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
808
+		if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
809 809
 		else @copy($target_file, $target_filename);
810 810
 	}
811 811
 
@@ -817,20 +817,20 @@  discard block
 block discarded – undo
817 817
 	function procMemberDeleteProfileImage($_memberSrl = 0)
818 818
 	{
819 819
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
820
-		if(!$member_srl)
820
+		if (!$member_srl)
821 821
 		{
822
-			return new Object(0,'success');
822
+			return new Object(0, 'success');
823 823
 		}
824 824
 
825 825
 		$logged_info = Context::get('logged_info');
826 826
 
827
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
827
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
828 828
 		{
829 829
 			$oMemberModel = getModel('member');
830 830
 			$profile_image = $oMemberModel->getProfileImage($member_srl);
831 831
 			FileHandler::removeFile($profile_image->file);
832 832
 		}
833
-		return new Object(0,'success');
833
+		return new Object(0, 'success');
834 834
 	}
835 835
 
836 836
 	/**
@@ -841,20 +841,20 @@  discard block
 block discarded – undo
841 841
 	function procMemberDeleteImageName($_memberSrl = 0)
842 842
 	{
843 843
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
844
-		if(!$member_srl)
844
+		if (!$member_srl)
845 845
 		{
846
-			return new Object(0,'success');
846
+			return new Object(0, 'success');
847 847
 		}
848 848
 
849 849
 		$logged_info = Context::get('logged_info');
850 850
 
851
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
851
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
852 852
 		{
853 853
 			$oMemberModel = getModel('member');
854 854
 			$image_name = $oMemberModel->getImageName($member_srl);
855 855
 			FileHandler::removeFile($image_name->file);
856 856
 		}
857
-		return new Object(0,'success');
857
+		return new Object(0, 'success');
858 858
 	}
859 859
 
860 860
 	/**
@@ -866,17 +866,17 @@  discard block
 block discarded – undo
866 866
 	{
867 867
 		// Check if the file is successfully uploaded
868 868
 		$file = $_FILES['image_mark'];
869
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
869
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
870 870
 		// Ignore if member_srl is invalid or doesn't exist.
871 871
 		$member_srl = Context::get('member_srl');
872
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
872
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
873 873
 
874 874
 		$logged_info = Context::get('logged_info');
875
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
875
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
876 876
 		// Membership in the images mark the module using the ban was set by an administrator or return;
877 877
 		$oModuleModel = getModel('module');
878 878
 		$config = $oModuleModel->getModuleConfig('member');
879
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
879
+		if ($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
880 880
 
881 881
 		$this->insertImageMark($member_srl, $file['tmp_name']);
882 882
 		// Page refresh
@@ -897,15 +897,15 @@  discard block
 block discarded – undo
897 897
 	function insertImageMark($member_srl, $target_file)
898 898
 	{
899 899
 		// Check uploaded file
900
-		if(!checkUploadedFile($target_file)) return;
900
+		if (!checkUploadedFile($target_file)) return;
901 901
 
902 902
 		$oModuleModel = getModel('module');
903 903
 		$config = $oModuleModel->getModuleConfig('member');
904 904
 		// Get an image size
905 905
 		$max_width = $config->image_mark_max_width;
906
-		if(!$max_width) $max_width = "20";
906
+		if (!$max_width) $max_width = "20";
907 907
 		$max_height = $config->image_mark_max_height;
908
-		if(!$max_height) $max_height = "20";
908
+		if (!$max_height) $max_height = "20";
909 909
 
910 910
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
911 911
 		FileHandler::makeDir($target_path);
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
 		// Get file information
915 915
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
916 916
 
917
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
917
+		if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
918 918
 		else @copy($target_file, $target_filename);
919 919
 	}
920 920
 
@@ -926,20 +926,20 @@  discard block
 block discarded – undo
926 926
 	function procMemberDeleteImageMark($_memberSrl = 0)
927 927
 	{
928 928
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
929
-		if(!$member_srl)
929
+		if (!$member_srl)
930 930
 		{
931
-			return new Object(0,'success');
931
+			return new Object(0, 'success');
932 932
 		}
933 933
 
934 934
 		$logged_info = Context::get('logged_info');
935 935
 
936
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
936
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
937 937
 		{
938 938
 			$oMemberModel = getModel('member');
939 939
 			$image_mark = $oMemberModel->getImageMark($member_srl);
940 940
 			FileHandler::removeFile($image_mark->file);
941 941
 		}
942
-		return new Object(0,'success');
942
+		return new Object(0, 'success');
943 943
 	}
944 944
 
945 945
 	/**
@@ -950,26 +950,26 @@  discard block
 block discarded – undo
950 950
 	function procMemberFindAccount()
951 951
 	{
952 952
 		$email_address = Context::get('email_address');
953
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
953
+		if (!$email_address) return new Object(-1, 'msg_invalid_request');
954 954
 
955 955
 		$oMemberModel = getModel('member');
956 956
 		$oModuleModel = getModel('module');
957 957
 
958 958
 		// Check if a member having the same email address exists
959 959
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
960
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
960
+		if (!$member_srl) return new Object(-1, 'msg_email_not_exists');
961 961
 
962 962
 		// Get information of the member
963 963
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
964 964
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
965 965
 
966 966
 		// Check if possible to find member's ID and password
967
-		if($member_info->denied == 'Y')
967
+		if ($member_info->denied == 'Y')
968 968
 		{
969 969
 			$chk_args = new stdClass;
970 970
 			$chk_args->member_srl = $member_info->member_srl;
971 971
 			$output = executeQuery('member.chkAuthMail', $chk_args);
972
-			if($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
972
+			if ($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
973 973
 		}
974 974
 
975 975
 		// Insert data into the authentication DB
@@ -982,19 +982,19 @@  discard block
 block discarded – undo
982 982
 		$args->is_register = 'N';
983 983
 
984 984
 		$output = executeQuery('member.insertAuthMail', $args);
985
-		if(!$output->toBool()) return $output;
985
+		if (!$output->toBool()) return $output;
986 986
 		// Get content of the email to send a member
987 987
 		Context::set('auth_args', $args);
988 988
 
989 989
 		$member_config = $oModuleModel->getModuleConfig('member');
990 990
 		$memberInfo = array();
991 991
 		global $lang;
992
-		if(is_array($member_config->signupForm))
992
+		if (is_array($member_config->signupForm))
993 993
 		{
994
-			$exceptForm=array('password', 'find_account_question');
995
-			foreach($member_config->signupForm as $form)
994
+			$exceptForm = array('password', 'find_account_question');
995
+			foreach ($member_config->signupForm as $form)
996 996
 			{
997
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
997
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
998 998
 				{
999 999
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1000 1000
 				}
@@ -1009,15 +1009,15 @@  discard block
 block discarded – undo
1009 1009
 		}
1010 1010
 		Context::set('memberInfo', $memberInfo);
1011 1011
 
1012
-		if(!$member_config->skin) $member_config->skin = "default";
1013
-		if(!$member_config->colorset) $member_config->colorset = "white";
1012
+		if (!$member_config->skin) $member_config->skin = "default";
1013
+		if (!$member_config->colorset) $member_config->colorset = "white";
1014 1014
 
1015 1015
 		Context::set('member_config', $member_config);
1016 1016
 
1017 1017
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1018
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1018
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1019 1019
 
1020
-		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1020
+		$find_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1021 1021
 		Context::set('find_url', $find_url);
1022 1022
 
1023 1023
 		$oTemplate = &TemplateHandler::getInstance();
@@ -1027,19 +1027,19 @@  discard block
 block discarded – undo
1027 1027
 		$member_config = $oModuleModel->getModuleConfig('member');
1028 1028
 		// Send a mail
1029 1029
 		$oMail = new Mail();
1030
-		$oMail->setTitle( Context::getLang('msg_find_account_title') );
1030
+		$oMail->setTitle(Context::getLang('msg_find_account_title'));
1031 1031
 		$oMail->setContent($content);
1032
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1033
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1032
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1033
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1034 1034
 		$oMail->send();
1035 1035
 		// Return message
1036 1036
 		$msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address);
1037
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
1037
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
1038 1038
 		{
1039 1039
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberFindAccount');
1040 1040
 			$this->setRedirectUrl($returnUrl);
1041 1041
 		}
1042
-		return new Object(0,$msg);
1042
+		return new Object(0, $msg);
1043 1043
 	}
1044 1044
 
1045 1045
 	/**
@@ -1057,28 +1057,28 @@  discard block
 block discarded – undo
1057 1057
 		$find_account_question = trim(Context::get('find_account_question'));
1058 1058
 		$find_account_answer = trim(Context::get('find_account_answer'));
1059 1059
 
1060
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1060
+		if (($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1061 1061
 
1062 1062
 		$oModuleModel = getModel('module');
1063 1063
 		// Check if a member having the same email address exists
1064 1064
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1065
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1065
+		if (!$member_srl) return new Object(-1, 'msg_email_not_exists');
1066 1066
 		// Get information of the member
1067 1067
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1068 1068
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1069 1069
 
1070 1070
 		// Display a message if no answer is entered
1071
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1071
+		if (!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1072 1072
 
1073
-		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');
1073
+		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');
1074 1074
 
1075
-		if($config->identifier == 'email_address')
1075
+		if ($config->identifier == 'email_address')
1076 1076
 		{
1077 1077
 			$user_id = $email_address;
1078 1078
 		}
1079 1079
 
1080 1080
 		// Update to a temporary password and set change_password_date to 1
1081
-		$oPassword =  new Password();
1081
+		$oPassword = new Password();
1082 1082
 		$temp_password = $oPassword->createTemporaryPassword(8);
1083 1083
 
1084 1084
 		$args = new stdClass();
@@ -1086,14 +1086,14 @@  discard block
 block discarded – undo
1086 1086
 		$args->password = $temp_password;
1087 1087
 		$args->change_password_date = '1';
1088 1088
 		$output = $this->updateMemberPassword($args);
1089
-		if(!$output->toBool()) return $output;
1089
+		if (!$output->toBool()) return $output;
1090 1090
 
1091 1091
 		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1092 1092
 
1093
-		$this->add('user_id',$user_id);
1093
+		$this->add('user_id', $user_id);
1094 1094
 
1095 1095
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
1096
-		$this->setRedirectUrl($returnUrl.'&user_id='.$user_id);
1096
+		$this->setRedirectUrl($returnUrl . '&user_id=' . $user_id);
1097 1097
 	}
1098 1098
 
1099 1099
 	/**
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
 		$member_srl = Context::get('member_srl');
1111 1111
 		$auth_key = Context::get('auth_key');
1112 1112
 
1113
-		if(!$member_srl || !$auth_key)
1113
+		if (!$member_srl || !$auth_key)
1114 1114
 		{
1115 1115
 			return $this->stop('msg_invalid_request');
1116 1116
 		}
@@ -1121,9 +1121,9 @@  discard block
 block discarded – undo
1121 1121
 		$args->auth_key = $auth_key;
1122 1122
 		$output = executeQuery('member.getAuthMail', $args);
1123 1123
 
1124
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
1124
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
1125 1125
 		{
1126
-			if(strlen($output->data->auth_key) !== strlen($auth_key))
1126
+			if (strlen($output->data->auth_key) !== strlen($auth_key))
1127 1127
 			{
1128 1128
 				executeQuery('member.deleteAuthMail', $args);
1129 1129
 			}
@@ -1131,7 +1131,7 @@  discard block
 block discarded – undo
1131 1131
 			return $this->stop('msg_invalid_auth_key');
1132 1132
 		}
1133 1133
 
1134
-		if(ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1134
+		if (ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1135 1135
 		{
1136 1136
 			executeQuery('member.deleteAuthMail', $args);
1137 1137
 			return $this->stop('msg_invalid_auth_key');
@@ -1140,7 +1140,7 @@  discard block
 block discarded – undo
1140 1140
 		$args->password = $output->data->new_password;
1141 1141
 
1142 1142
 		// If credentials are correct, change the password to a new one
1143
-		if($output->data->is_register == 'Y')
1143
+		if ($output->data->is_register == 'Y')
1144 1144
 		{
1145 1145
 			$args->denied = 'N';
1146 1146
 		}
@@ -1153,19 +1153,19 @@  discard block
 block discarded – undo
1153 1153
 		$is_register = $output->data->is_register;
1154 1154
 
1155 1155
 		$output = executeQuery('member.updateMemberPassword', $args);
1156
-		if(!$output->toBool())
1156
+		if (!$output->toBool())
1157 1157
 		{
1158 1158
 			return $this->stop($output->getMessage());
1159 1159
 		}
1160 1160
 
1161 1161
 		// Remove all values having the member_srl from authentication table
1162
-		executeQuery('member.deleteAuthMail',$args);
1162
+		executeQuery('member.deleteAuthMail', $args);
1163 1163
 
1164 1164
 		$this->_clearMemberCache($args->member_srl);
1165 1165
 
1166 1166
 		// Notify the result
1167 1167
 		Context::set('is_register', $is_register);
1168
-		$this->setTemplatePath($this->module_path.'tpl');
1168
+		$this->setTemplatePath($this->module_path . 'tpl');
1169 1169
 		$this->setTemplateFile('msg_success_authed');
1170 1170
 	}
1171 1171
 
@@ -1178,33 +1178,33 @@  discard block
 block discarded – undo
1178 1178
 	{
1179 1179
 		// Get an email_address
1180 1180
 		$email_address = Context::get('email_address');
1181
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1181
+		if (!$email_address) return new Object(-1, 'msg_invalid_request');
1182 1182
 		// Log test by using email_address
1183 1183
 		$oMemberModel = getModel('member');
1184 1184
 
1185 1185
 		$args = new stdClass;
1186 1186
 		$args->email_address = $email_address;
1187 1187
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1188
-		if(!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1188
+		if (!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1189 1189
 
1190 1190
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1191 1191
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1192 1192
 
1193 1193
 		$oModuleModel = getModel('module');
1194 1194
 		$member_config = $oModuleModel->getModuleConfig('member');
1195
-		if(!$member_config->skin) $member_config->skin = "default";
1196
-		if(!$member_config->colorset) $member_config->colorset = "white";
1195
+		if (!$member_config->skin) $member_config->skin = "default";
1196
+		if (!$member_config->colorset) $member_config->colorset = "white";
1197 1197
 
1198 1198
 		// Check if a authentication mail has been sent previously
1199 1199
 		$chk_args = new stdClass;
1200 1200
 		$chk_args->member_srl = $member_info->member_srl;
1201 1201
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1202
-		if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1202
+		if ($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1203 1203
 
1204 1204
 		$auth_args = new stdClass;
1205 1205
 		$auth_args->member_srl = $member_info->member_srl;
1206 1206
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1207
-		if(!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1207
+		if (!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1208 1208
 		$auth_info = $output->data[0];
1209 1209
 
1210 1210
 		// Update the regdate of authmail entry
@@ -1215,12 +1215,12 @@  discard block
 block discarded – undo
1215 1215
 
1216 1216
 		$memberInfo = array();
1217 1217
 		global $lang;
1218
-		if(is_array($member_config->signupForm))
1218
+		if (is_array($member_config->signupForm))
1219 1219
 		{
1220
-			$exceptForm=array('password', 'find_account_question');
1221
-			foreach($member_config->signupForm as $form)
1220
+			$exceptForm = array('password', 'find_account_question');
1221
+			foreach ($member_config->signupForm as $form)
1222 1222
 			{
1223
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1223
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1224 1224
 				{
1225 1225
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1226 1226
 				}
@@ -1239,19 +1239,19 @@  discard block
 block discarded – undo
1239 1239
 		Context::set('member_config', $member_config);
1240 1240
 
1241 1241
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1242
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1242
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1243 1243
 
1244
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1244
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_info->auth_key);
1245 1245
 		Context::set('auth_url', $auth_url);
1246 1246
 
1247 1247
 		$oTemplate = &TemplateHandler::getInstance();
1248 1248
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1249 1249
 		// Send a mail
1250 1250
 		$oMail = new Mail();
1251
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1251
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1252 1252
 		$oMail->setContent($content);
1253
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1254
-		$oMail->setReceiptor( $args->user_name, $args->email_address );
1253
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1254
+		$oMail->setReceiptor($args->user_name, $args->email_address);
1255 1255
 		$oMail->send();
1256 1256
 
1257 1257
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
@@ -1266,23 +1266,23 @@  discard block
 block discarded – undo
1266 1266
 		$memberInfo = $_SESSION['auth_member_info'];
1267 1267
 		unset($_SESSION['auth_member_info']);
1268 1268
 
1269
-		if(!$memberInfo)
1269
+		if (!$memberInfo)
1270 1270
 		{
1271 1271
 			return $this->stop('msg_invalid_request');
1272 1272
 		}
1273 1273
 
1274 1274
 		$newEmail = Context::get('email_address');
1275 1275
 
1276
-		if(!$newEmail)
1276
+		if (!$newEmail)
1277 1277
 		{
1278 1278
 			return $this->stop('msg_invalid_request');
1279 1279
 		}
1280 1280
 
1281 1281
 		$oMemberModel = getModel('member');
1282 1282
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
1283
-		if($member_srl)
1283
+		if ($member_srl)
1284 1284
 		{
1285
-			return new Object(-1,'msg_exists_email_address');
1285
+			return new Object(-1, 'msg_exists_email_address');
1286 1286
 		}
1287 1287
 
1288 1288
 		// remove all key by member_srl
@@ -1290,7 +1290,7 @@  discard block
 block discarded – undo
1290 1290
 		$args->member_srl = $memberInfo->member_srl;
1291 1291
 		$output = executeQuery('member.deleteAuthMail', $args);
1292 1292
 
1293
-		if(!$output->toBool())
1293
+		if (!$output->toBool())
1294 1294
 		{
1295 1295
 			return $output;
1296 1296
 		}
@@ -1300,7 +1300,7 @@  discard block
 block discarded – undo
1300 1300
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
1301 1301
 
1302 1302
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
1303
-		if(!$output->toBool())
1303
+		if (!$output->toBool())
1304 1304
 		{
1305 1305
 			return $this->stop($output->getMessage());
1306 1306
 		}
@@ -1317,7 +1317,7 @@  discard block
 block discarded – undo
1317 1317
 		$auth_args->is_register = 'Y';
1318 1318
 
1319 1319
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1320
-		if(!$output->toBool()) return $output;
1320
+		if (!$output->toBool()) return $output;
1321 1321
 
1322 1322
 		$memberInfo->email_address = $newEmail;
1323 1323
 
@@ -1341,12 +1341,12 @@  discard block
 block discarded – undo
1341 1341
 		$memberInfo = array();
1342 1342
 
1343 1343
 		global $lang;
1344
-		if(is_array($member_config->signupForm))
1344
+		if (is_array($member_config->signupForm))
1345 1345
 		{
1346
-			$exceptForm=array('password', 'find_account_question');
1347
-			foreach($member_config->signupForm as $form)
1346
+			$exceptForm = array('password', 'find_account_question');
1347
+			foreach ($member_config->signupForm as $form)
1348 1348
 			{
1349
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1349
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1350 1350
 				{
1351 1351
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1352 1352
 				}
@@ -1361,25 +1361,25 @@  discard block
 block discarded – undo
1361 1361
 		}
1362 1362
 		Context::set('memberInfo', $memberInfo);
1363 1363
 
1364
-		if(!$member_config->skin) $member_config->skin = "default";
1365
-		if(!$member_config->colorset) $member_config->colorset = "white";
1364
+		if (!$member_config->skin) $member_config->skin = "default";
1365
+		if (!$member_config->colorset) $member_config->colorset = "white";
1366 1366
 
1367 1367
 		Context::set('member_config', $member_config);
1368 1368
 
1369 1369
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1370
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1370
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1371 1371
 
1372
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1372
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
1373 1373
 		Context::set('auth_url', $auth_url);
1374 1374
 
1375 1375
 		$oTemplate = &TemplateHandler::getInstance();
1376 1376
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1377 1377
 		// Send a mail
1378 1378
 		$oMail = new Mail();
1379
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1379
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1380 1380
 		$oMail->setContent($content);
1381
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1382
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1381
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1382
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1383 1383
 		$oMail->send();
1384 1384
 	}
1385 1385
 
@@ -1392,7 +1392,7 @@  discard block
 block discarded – undo
1392 1392
 	{
1393 1393
 		$site_module_info = Context::get('site_module_info');
1394 1394
 		$logged_info = Context::get('logged_info');
1395
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1395
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new Object(-1, 'msg_invalid_request');
1396 1396
 
1397 1397
 		$oMemberModel = getModel('member');
1398 1398
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1411,13 +1411,13 @@  discard block
 block discarded – undo
1411 1411
 	{
1412 1412
 		$site_module_info = Context::get('site_module_info');
1413 1413
 		$logged_info = Context::get('logged_info');
1414
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1414
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new Object(-1, 'msg_invalid_request');
1415 1415
 
1416 1416
 		$args = new stdClass;
1417
-		$args->site_srl= $site_module_info->site_srl;
1417
+		$args->site_srl = $site_module_info->site_srl;
1418 1418
 		$args->member_srl = $logged_info->member_srl;
1419 1419
 		$output = executeQuery('member.deleteMembersGroup', $args);
1420
-		if(!$output->toBool()) return $output;
1420
+		if (!$output->toBool()) return $output;
1421 1421
 		$this->setMessage('success_deleted');
1422 1422
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1423 1423
 	}
@@ -1431,27 +1431,27 @@  discard block
 block discarded – undo
1431 1431
 	 */
1432 1432
 	function setMemberConfig($args)
1433 1433
 	{
1434
-		if(!$args->skin) $args->skin = "default";
1435
-		if(!$args->colorset) $args->colorset = "white";
1436
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1437
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1438
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1439
-		$args->enable_openid= 'N';
1440
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1441
-		if($args->image_name!='Y') $args->image_name = 'N';
1442
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1443
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1444
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1445
-		$args->limit_day = (int)$args->limit_day;
1434
+		if (!$args->skin) $args->skin = "default";
1435
+		if (!$args->colorset) $args->colorset = "white";
1436
+		if (!$args->editor_skin) $args->editor_skin = "ckeditor";
1437
+		if (!$args->editor_colorset) $args->editor_colorset = "moono";
1438
+		if ($args->enable_join != 'Y') $args->enable_join = 'N';
1439
+		$args->enable_openid = 'N';
1440
+		if ($args->profile_image != 'Y') $args->profile_image = 'N';
1441
+		if ($args->image_name != 'Y') $args->image_name = 'N';
1442
+		if ($args->image_mark != 'Y') $args->image_mark = 'N';
1443
+		if ($args->group_image_mark != 'Y') $args->group_image_mark = 'N';
1444
+		if (!trim(strip_tags($args->agreement))) $args->agreement = null;
1445
+		$args->limit_day = (int) $args->limit_day;
1446 1446
 
1447 1447
 		$agreement = trim($args->agreement);
1448 1448
 		unset($args->agreement);
1449 1449
 
1450 1450
 		$oModuleController = getController('module');
1451
-		$output = $oModuleController->insertModuleConfig('member',$args);
1452
-		if(!$output->toBool()) return $output;
1451
+		$output = $oModuleController->insertModuleConfig('member', $args);
1452
+		if (!$output->toBool()) return $output;
1453 1453
 
1454
-		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1454
+		$agreement_file = _XE_PATH_ . 'files/member_extra_info/agreement.txt';
1455 1455
 		FileHandler::writeFile($agreement_file, $agreement);
1456 1456
 
1457 1457
 		return new Object();
@@ -1470,11 +1470,11 @@  discard block
 block discarded – undo
1470 1470
 		$signature = trim(removeHackTag($signature));
1471 1471
 		$signature = preg_replace('/<(\/?)(embed|object|param)/is', '&lt;$1$2', $signature);
1472 1472
 
1473
-		$check_signature = trim(str_replace(array('&nbsp;',"\n","\r"),'',strip_tags($signature,'<img><object>')));
1473
+		$check_signature = trim(str_replace(array('&nbsp;', "\n", "\r"), '', strip_tags($signature, '<img><object>')));
1474 1474
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1475 1475
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1476 1476
 
1477
-		if(!$check_signature) return FileHandler::removeFile($filename);
1477
+		if (!$check_signature) return FileHandler::removeFile($filename);
1478 1478
 
1479 1479
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1480 1480
 		FileHandler::makeDir($path);
@@ -1503,15 +1503,15 @@  discard block
 block discarded – undo
1503 1503
 	 *
1504 1504
 	 * @return Object
1505 1505
 	 */
1506
-	function addMemberToGroup($member_srl, $group_srl, $site_srl=0)
1506
+	function addMemberToGroup($member_srl, $group_srl, $site_srl = 0)
1507 1507
 	{
1508 1508
 		$args = new stdClass();
1509 1509
 		$args->member_srl = $member_srl;
1510 1510
 		$args->group_srl = $group_srl;
1511
-		if($site_srl) $args->site_srl = $site_srl;
1511
+		if ($site_srl) $args->site_srl = $site_srl;
1512 1512
 
1513 1513
 		// Add
1514
-		$output = executeQuery('member.addMemberToGroup',$args);
1514
+		$output = executeQuery('member.addMemberToGroup', $args);
1515 1515
 		$output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args);
1516 1516
 
1517 1517
 		$this->_clearMemberCache($member_srl, $site_srl);
@@ -1531,18 +1531,18 @@  discard block
 block discarded – undo
1531 1531
 	{
1532 1532
 		$obj = new stdClass;
1533 1533
 		$obj->site_srl = $args->site_srl;
1534
-		$obj->member_srl = implode(',',$args->member_srl);
1534
+		$obj->member_srl = implode(',', $args->member_srl);
1535 1535
 
1536 1536
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1537
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1537
+		if ($output->data) foreach ($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1538 1538
 
1539 1539
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1540
-		if(!$output->toBool()) return $output;
1540
+		if (!$output->toBool()) return $output;
1541 1541
 
1542 1542
 		$inserted_members = array();
1543
-		foreach($args->member_srl as $key => $val)
1543
+		foreach ($args->member_srl as $key => $val)
1544 1544
 		{
1545
-			if($inserted_members[$val]) continue;
1545
+			if ($inserted_members[$val]) continue;
1546 1546
 			$inserted_members[$val] = true;
1547 1547
 
1548 1548
 			unset($obj);
@@ -1552,7 +1552,7 @@  discard block
 block discarded – undo
1552 1552
 			$obj->site_srl = $args->site_srl;
1553 1553
 			$obj->regdate = $date[$obj->member_srl];
1554 1554
 			$output = executeQuery('member.addMemberToGroup', $obj);
1555
-			if(!$output->toBool()) return $output;
1555
+			if (!$output->toBool()) return $output;
1556 1556
 
1557 1557
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1558 1558
 		}
@@ -1574,9 +1574,9 @@  discard block
 block discarded – undo
1574 1574
 		// Get information of the key
1575 1575
 		$output = executeQuery('member.getAutologin', $args);
1576 1576
 		// If no information exists, delete a cookie
1577
-		if(!$output->toBool() || !$output->data)
1577
+		if (!$output->toBool() || !$output->data)
1578 1578
 		{
1579
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/');
1579
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365, '/');
1580 1580
 			return;
1581 1581
 		}
1582 1582
 
@@ -1586,19 +1586,19 @@  discard block
 block discarded – undo
1586 1586
 		$user_id = ($config->identifier == 'user_id') ? $output->data->user_id : $output->data->email_address;
1587 1587
 		$password = $output->data->password;
1588 1588
 
1589
-		if(!$user_id || !$password)
1589
+		if (!$user_id || !$password)
1590 1590
 		{
1591
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/');
1591
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365, '/');
1592 1592
 			return;
1593 1593
 		}
1594 1594
 
1595 1595
 		$do_auto_login = false;
1596 1596
 
1597 1597
 		// Compare key values based on the information
1598
-		$check_key = strtolower($user_id).$password.$_SERVER['HTTP_USER_AGENT'];
1598
+		$check_key = strtolower($user_id) . $password . $_SERVER['HTTP_USER_AGENT'];
1599 1599
 		$check_key = substr(hash_hmac('sha256', $check_key, substr($args->autologin_key, 0, 32)), 0, 32);
1600 1600
 
1601
-		if($check_key === substr($args->autologin_key, 32))
1601
+		if ($check_key === substr($args->autologin_key, 32))
1602 1602
 		{
1603 1603
 			// Check change_password_date
1604 1604
 			$oModuleModel = getModel('module');
@@ -1606,12 +1606,12 @@  discard block
 block discarded – undo
1606 1606
 			$limit_date = $member_config->change_password_date;
1607 1607
 
1608 1608
 			// Check if change_password_date is set
1609
-			if($limit_date > 0)
1609
+			if ($limit_date > 0)
1610 1610
 			{
1611 1611
 				$oMemberModel = getModel('member');
1612 1612
 				$columnList = array('member_srl', 'change_password_date');
1613 1613
 
1614
-				if($config->identifier == 'user_id')
1614
+				if ($config->identifier == 'user_id')
1615 1615
 				{
1616 1616
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1617 1617
 				}
@@ -1620,7 +1620,7 @@  discard block
 block discarded – undo
1620 1620
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1621 1621
 				}
1622 1622
 
1623
-				if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){
1623
+				if ($member_info->change_password_date >= date('YmdHis', strtotime('-' . $limit_date . ' day'))) {
1624 1624
 					$do_auto_login = true;
1625 1625
 				}
1626 1626
 
@@ -1631,14 +1631,14 @@  discard block
 block discarded – undo
1631 1631
 			}
1632 1632
 		}
1633 1633
 
1634
-		if($do_auto_login)
1634
+		if ($do_auto_login)
1635 1635
 		{
1636 1636
 			$output = $this->doLogin($user_id);
1637 1637
 		}
1638 1638
 		else
1639 1639
 		{
1640 1640
 			executeQuery('member.deleteAutologin', $args);
1641
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/');
1641
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365, '/');
1642 1642
 		}
1643 1643
 	}
1644 1644
 
@@ -1654,13 +1654,13 @@  discard block
 block discarded – undo
1654 1654
 	function doLogin($user_id, $password = '', $keep_signed = false)
1655 1655
 	{
1656 1656
 		$user_id = strtolower($user_id);
1657
-		if(!$user_id) return new Object(-1, 'null_user_id');
1657
+		if (!$user_id) return new Object(-1, 'null_user_id');
1658 1658
 		// Call a trigger before log-in (before)
1659 1659
 		$trigger_obj = new stdClass();
1660 1660
 		$trigger_obj->user_id = $user_id;
1661 1661
 		$trigger_obj->password = $password;
1662 1662
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1663
-		if(!$trigger_output->toBool()) return $trigger_output;
1663
+		if (!$trigger_output->toBool()) return $trigger_output;
1664 1664
 		// Create a member model object
1665 1665
 		$oMemberModel = getModel('member');
1666 1666
 
@@ -1670,12 +1670,12 @@  discard block
 block discarded – undo
1670 1670
 		$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1671 1671
 
1672 1672
 		// check identifier
1673
-		if($config->identifier == 'email_address')
1673
+		if ($config->identifier == 'email_address')
1674 1674
 		{
1675 1675
 			// Get user_id information
1676 1676
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1677 1677
 			// Set an invalid user if no value returned
1678
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1678
+			if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1679 1679
 
1680 1680
 		}
1681 1681
 		else
@@ -1683,24 +1683,24 @@  discard block
 block discarded – undo
1683 1683
 			// Get user_id information
1684 1684
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1685 1685
 			// Set an invalid user if no value returned
1686
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1686
+			if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1687 1687
 		}
1688 1688
 
1689 1689
 		$output = executeQuery('member.getLoginCountByIp', $args);
1690 1690
 		$errorCount = $output->data->count;
1691
-		if($errorCount >= $config->max_error_count)
1691
+		if ($errorCount >= $config->max_error_count)
1692 1692
 		{
1693 1693
 			$last_update = strtotime($output->data->last_update);
1694
-			$term = intval($_SERVER['REQUEST_TIME']-$last_update);
1695
-			if($term < $config->max_error_count_time)
1694
+			$term = intval($_SERVER['REQUEST_TIME'] - $last_update);
1695
+			if ($term < $config->max_error_count_time)
1696 1696
 			{
1697 1697
 				$term = $config->max_error_count_time - $term;
1698
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1699
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1700
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1701
-				else $term = intval($term/86400).Context::getLang('unit_day');
1698
+				if ($term < 60) $term = intval($term) . Context::getLang('unit_sec');
1699
+				elseif (60 <= $term && $term < 3600) $term = intval($term / 60) . Context::getLang('unit_min');
1700
+				elseif (3600 <= $term && $term < 86400) $term = intval($term / 3600) . Context::getLang('unit_hour');
1701
+				else $term = intval($term / 86400) . Context::getLang('unit_day');
1702 1702
 
1703
-				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1703
+				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'), $term));
1704 1704
 			}
1705 1705
 			else
1706 1706
 			{
@@ -1710,13 +1710,13 @@  discard block
 block discarded – undo
1710 1710
 		}
1711 1711
 
1712 1712
 		// Password Check
1713
-		if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1713
+		if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1714 1714
 		{
1715
-			return $this->recordMemberLoginError(-1, 'invalid_password',$this->memberInfo);
1715
+			return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo);
1716 1716
 		}
1717 1717
 
1718 1718
 		// If denied == 'Y', notify
1719
-		if($this->memberInfo->denied == 'Y')
1719
+		if ($this->memberInfo->denied == 'Y')
1720 1720
 		{
1721 1721
 			$args->member_srl = $this->memberInfo->member_srl;
1722 1722
 			$output = executeQuery('member.chkAuthMail', $args);
@@ -1724,12 +1724,12 @@  discard block
 block discarded – undo
1724 1724
 			{
1725 1725
 				$_SESSION['auth_member_srl'] = $this->memberInfo->member_srl;
1726 1726
 				$redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail');
1727
-				return $this->setRedirectUrl($redirectUrl, new Object(-1,'msg_user_not_confirmed'));
1727
+				return $this->setRedirectUrl($redirectUrl, new Object(-1, 'msg_user_not_confirmed'));
1728 1728
 			}
1729
-			return new Object(-1,'msg_user_denied');
1729
+			return new Object(-1, 'msg_user_denied');
1730 1730
 		}
1731 1731
 		// Notify if denied_date is less than the current time
1732
-		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")));
1732
+		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")));
1733 1733
 		// Update the latest login time
1734 1734
 		$args->member_srl = $this->memberInfo->member_srl;
1735 1735
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1739,37 +1739,37 @@  discard block
 block discarded – undo
1739 1739
 
1740 1740
 		// Check if there is recoding table.
1741 1741
 		$oDB = &DB::getInstance();
1742
-		if($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1742
+		if ($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1743 1743
 		{
1744 1744
 			// check if there is login fail records.
1745 1745
 			$output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args);
1746
-			if($output->data && $output->data->content)
1746
+			if ($output->data && $output->data->content)
1747 1747
 			{
1748 1748
 				$title = Context::getLang('login_fail_report');
1749 1749
 				$message = '<ul>';
1750 1750
 				$content = unserialize($output->data->content);
1751
-				if(count($content) > $config->max_error_count)
1751
+				if (count($content) > $config->max_error_count)
1752 1752
 				{
1753
-					foreach($content as $val)
1753
+					foreach ($content as $val)
1754 1754
 					{
1755
-						$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>';
1755
+						$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>';
1756 1756
 					}
1757 1757
 					$message .= '</ul>';
1758
-					$content = sprintf(Context::getLang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa'));
1758
+					$content = sprintf(Context::getLang('login_fail_report_contents'), $message, date('Y-m-d h:i:sa'));
1759 1759
 
1760 1760
 					//send message
1761 1761
 					$oCommunicationController = getController('communication');
1762 1762
 					$oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true);
1763 1763
 
1764
-					if($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1764
+					if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1765 1765
 					{
1766 1766
 						$view_url = Context::getRequestUri();
1767
-						$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);
1767
+						$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);
1768 1768
 						$oMail = new Mail();
1769 1769
 						$oMail->setTitle($title);
1770 1770
 						$oMail->setContent($content);
1771
-						$oMail->setSender($config->webmaster_name?$config->webmaster_name:'webmaster', $config->webmaster_email);
1772
-						$oMail->setReceiptor($this->memberInfo->email_id.'('.$this->memberInfo->nick_name.')', $this->memberInfo->email_address);
1771
+						$oMail->setSender($config->webmaster_name ? $config->webmaster_name : 'webmaster', $config->webmaster_email);
1772
+						$oMail->setReceiptor($this->memberInfo->email_id . '(' . $this->memberInfo->nick_name . ')', $this->memberInfo->email_address);
1773 1773
 						$oMail->send();
1774 1774
 					}
1775 1775
 					$output = executeQuery('member.deleteLoginCountHistoryByMemberSrl', $args);
@@ -1778,26 +1778,26 @@  discard block
 block discarded – undo
1778 1778
 		}
1779 1779
 		// Call a trigger after successfully log-in (after)
1780 1780
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1781
-		if(!$trigger_output->toBool()) return $trigger_output;
1781
+		if (!$trigger_output->toBool()) return $trigger_output;
1782 1782
 		// When user checked to use auto-login
1783
-		if($keep_signed)
1783
+		if ($keep_signed)
1784 1784
 		{
1785 1785
 			// Key generate for auto login
1786 1786
 			$oPassword = new Password();
1787 1787
 			$random_key = $oPassword->createSecureSalt(32, 'hex');
1788
-			$extra_key = strtolower($user_id).$this->memberInfo->password.$_SERVER['HTTP_USER_AGENT'];
1788
+			$extra_key = strtolower($user_id) . $this->memberInfo->password . $_SERVER['HTTP_USER_AGENT'];
1789 1789
 			$extra_key = substr(hash_hmac('sha256', $extra_key, $random_key), 0, 32);
1790 1790
 			$autologin_args = new stdClass;
1791
-			$autologin_args->autologin_key = $random_key.$extra_key;
1791
+			$autologin_args->autologin_key = $random_key . $extra_key;
1792 1792
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1793 1793
 			executeQuery('member.deleteAutologin', $autologin_args);
1794 1794
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1795
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000, '/');
1795
+			if ($autologin_output->toBool()) setCookie('xeak', $autologin_args->autologin_key, $_SERVER['REQUEST_TIME'] + 31536000, '/');
1796 1796
 		}
1797
-		if($this->memberInfo->is_admin == 'Y')
1797
+		if ($this->memberInfo->is_admin == 'Y')
1798 1798
 		{
1799 1799
 			$oMemberAdminModel = getAdminModel('member');
1800
-			if(!$oMemberAdminModel->getMemberAdminIPCheck())
1800
+			if (!$oMemberAdminModel->getMemberAdminIPCheck())
1801 1801
 			{
1802 1802
 				$_SESSION['denied_admin'] = 'Y';
1803 1803
 			}
@@ -1815,18 +1815,18 @@  discard block
 block discarded – undo
1815 1815
 	{
1816 1816
 		$oMemberModel = getModel('member');
1817 1817
 		// If your information came through the current session information to extract information from the users
1818
-		if(!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged() )
1818
+		if (!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged())
1819 1819
 		{
1820 1820
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']);
1821 1821
 			// If you do not destroy the session Profile
1822
-			if($this->memberInfo->member_srl != $_SESSION['member_srl'])
1822
+			if ($this->memberInfo->member_srl != $_SESSION['member_srl'])
1823 1823
 			{
1824 1824
 				$this->destroySessionInfo();
1825 1825
 				return;
1826 1826
 			}
1827 1827
 		}
1828 1828
 		// Stop using the session id is destroyed
1829
-		if($this->memberInfo->denied=='Y')
1829
+		if ($this->memberInfo->denied == 'Y')
1830 1830
 		{
1831 1831
 			$this->destroySessionInfo();
1832 1832
 			return;
@@ -1856,10 +1856,10 @@  discard block
 block discarded – undo
1856 1856
 		Context::set('logged_info', $this->memberInfo);
1857 1857
 
1858 1858
 		// Only the menu configuration of the user (such as an add-on to the menu can be changed)
1859
-		$this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info');
1860
-		$this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document');
1861
-		$this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document');
1862
-		$this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document');
1859
+		$this->addMemberMenu('dispMemberInfo', 'cmd_view_member_info');
1860
+		$this->addMemberMenu('dispMemberScrappedDocument', 'cmd_view_scrapped_document');
1861
+		$this->addMemberMenu('dispMemberSavedDocument', 'cmd_view_saved_document');
1862
+		$this->addMemberMenu('dispMemberOwnDocument', 'cmd_view_own_document');
1863 1863
 	}
1864 1864
 
1865 1865
 	/**
@@ -1881,7 +1881,7 @@  discard block
 block discarded – undo
1881 1881
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
1882 1882
 	{
1883 1883
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
1884
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
1884
+		if (!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
1885 1885
 
1886 1886
 		$obj = new stdClass;
1887 1887
 		$obj->url = $url;
@@ -1900,33 +1900,33 @@  discard block
 block discarded – undo
1900 1900
 	{
1901 1901
 		// Call a trigger (before)
1902 1902
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
1903
-		if(!$output->toBool()) return $output;
1903
+		if (!$output->toBool()) return $output;
1904 1904
 		// Terms and Conditions portion of the information set up by members reaffirmed
1905 1905
 		$oModuleModel = getModel('module');
1906 1906
 		$config = $oModuleModel->getModuleConfig('member');
1907 1907
 
1908 1908
 		$logged_info = Context::get('logged_info');
1909 1909
 		// If the date of the temporary restrictions limit further information on the date of
1910
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
1910
+		if ($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME'] + $config->limit_day * 60 * 60 * 24);
1911 1911
 
1912 1912
 		$args->member_srl = getNextSequence();
1913 1913
 		$args->list_order = -1 * $args->member_srl;
1914 1914
 
1915 1915
 		// Execute insert or update depending on the value of member_srl
1916
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
1916
+		if (!$args->user_id) $args->user_id = 't' . $args->member_srl;
1917 1917
 		// Enter the user's identity changed to lowercase
1918 1918
 		else $args->user_id = strtolower($args->user_id);
1919
-		if(!$args->user_name) $args->user_name = $args->member_srl;
1920
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
1919
+		if (!$args->user_name) $args->user_name = $args->member_srl;
1920
+		if (!$args->nick_name) $args->nick_name = $args->member_srl;
1921 1921
 
1922 1922
 		// Control of essential parameters
1923
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
1924
-		if($args->denied!='Y') $args->denied = 'N';
1925
-		$args->allow_message= 'Y';
1923
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
1924
+		if ($args->denied != 'Y') $args->denied = 'N';
1925
+		$args->allow_message = 'Y';
1926 1926
 
1927
-		if($logged_info->is_admin == 'Y')
1927
+		if ($logged_info->is_admin == 'Y')
1928 1928
 		{
1929
-			if($args->is_admin!='Y') $args->is_admin = 'N';
1929
+			if ($args->is_admin != 'Y') $args->is_admin = 'N';
1930 1930
 		}
1931 1931
 		else
1932 1932
 		{
@@ -1941,88 +1941,88 @@  discard block
 block discarded – undo
1941 1941
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1942 1942
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1943 1943
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1944
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
1945
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
1944
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//i", $args->homepage)) $args->homepage = 'http://' . $args->homepage;
1945
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//i", $args->blog)) $args->blog = 'http://' . $args->blog;
1946 1946
 
1947 1947
 		// Create a model object
1948 1948
 		$oMemberModel = getModel('member');
1949 1949
 
1950 1950
 		// Check password strength
1951
-		if($args->password && !$password_is_hashed)
1951
+		if ($args->password && !$password_is_hashed)
1952 1952
 		{
1953
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
1953
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
1954 1954
 			{
1955 1955
 				$message = Context::getLang('about_password_strength');
1956 1956
 				return new Object(-1, $message[$config->password_strength]);
1957 1957
 			}
1958 1958
 			$args->password = $oMemberModel->hashPassword($args->password);
1959 1959
 		}
1960
-		elseif(!$args->password)
1960
+		elseif (!$args->password)
1961 1961
 		{
1962 1962
 			unset($args->password);
1963 1963
 		}
1964 1964
 
1965 1965
 		// Check if ID is prohibited
1966
-		if($oMemberModel->isDeniedID($args->user_id))
1966
+		if ($oMemberModel->isDeniedID($args->user_id))
1967 1967
 		{
1968
-			return new Object(-1,'denied_user_id');
1968
+			return new Object(-1, 'denied_user_id');
1969 1969
 		}
1970 1970
 
1971 1971
 		// Check if ID is duplicate
1972 1972
 		$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
1973
-		if($member_srl)
1973
+		if ($member_srl)
1974 1974
 		{
1975
-			return new Object(-1,'msg_exists_user_id');
1975
+			return new Object(-1, 'msg_exists_user_id');
1976 1976
 		}
1977 1977
 
1978 1978
 		// Check if nickname is prohibited
1979
-		if($oMemberModel->isDeniedNickName($args->nick_name))
1979
+		if ($oMemberModel->isDeniedNickName($args->nick_name))
1980 1980
 		{
1981
-			return new Object(-1,'denied_nick_name');
1981
+			return new Object(-1, 'denied_nick_name');
1982 1982
 		}
1983 1983
 
1984 1984
 		// Check if nickname is duplicate
1985 1985
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
1986
-		if($member_srl)
1986
+		if ($member_srl)
1987 1987
 		{
1988
-			return new Object(-1,'msg_exists_nick_name');
1988
+			return new Object(-1, 'msg_exists_nick_name');
1989 1989
 		}
1990 1990
 
1991 1991
 		// Check if email address is duplicate
1992 1992
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
1993
-		if($member_srl)
1993
+		if ($member_srl)
1994 1994
 		{
1995
-			return new Object(-1,'msg_exists_email_address');
1995
+			return new Object(-1, 'msg_exists_email_address');
1996 1996
 		}
1997 1997
 
1998 1998
 		// Insert data into the DB
1999 1999
 		$args->list_order = -1 * $args->member_srl;
2000 2000
 
2001
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2002
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2001
+		if (!$args->user_id) $args->user_id = 't' . $args->member_srl;
2002
+		if (!$args->user_name) $args->user_name = $args->member_srl;
2003 2003
 
2004 2004
 		$oDB = &DB::getInstance();
2005 2005
 		$oDB->begin();
2006 2006
 
2007 2007
 		$output = executeQuery('member.insertMember', $args);
2008
-		if(!$output->toBool())
2008
+		if (!$output->toBool())
2009 2009
 		{
2010 2010
 			$oDB->rollback();
2011 2011
 			return $output;
2012 2012
 		}
2013 2013
 
2014
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2014
+		if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2015 2015
 		else $group_srl_list = explode('|@|', $args->group_srl_list);
2016 2016
 		// If no value is entered the default group, the value of group registration
2017
-		if(!$args->group_srl_list)
2017
+		if (!$args->group_srl_list)
2018 2018
 		{
2019 2019
 			$columnList = array('site_srl', 'group_srl');
2020 2020
 			$default_group = $oMemberModel->getDefaultGroup(0, $columnList);
2021
-			if($default_group)
2021
+			if ($default_group)
2022 2022
 			{
2023 2023
 				// Add to the default group
2024
-				$output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl);
2025
-				if(!$output->toBool())
2024
+				$output = $this->addMemberToGroup($args->member_srl, $default_group->group_srl);
2025
+				if (!$output->toBool())
2026 2026
 				{
2027 2027
 					$oDB->rollback();
2028 2028
 					return $output;
@@ -2032,11 +2032,11 @@  discard block
 block discarded – undo
2032 2032
 		}
2033 2033
 		else
2034 2034
 		{
2035
-			for($i=0;$i<count($group_srl_list);$i++)
2035
+			for ($i = 0; $i < count($group_srl_list); $i++)
2036 2036
 			{
2037
-				$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2037
+				$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2038 2038
 
2039
-				if(!$output->toBool())
2039
+				if (!$output->toBool())
2040 2040
 				{
2041 2041
 					$oDB->rollback();
2042 2042
 					return $output;
@@ -2046,7 +2046,7 @@  discard block
 block discarded – undo
2046 2046
 
2047 2047
 		$member_config = $oModuleModel->getModuleConfig('member');
2048 2048
 		// When using email authentication mode (when you subscribed members denied a) certified mail sent
2049
-		if($args->denied == 'Y')
2049
+		if ($args->denied == 'Y')
2050 2050
 		{
2051 2051
 			// Insert data into the authentication DB
2052 2052
 			$oPassword = new Password();
@@ -2058,7 +2058,7 @@  discard block
 block discarded – undo
2058 2058
 			$auth_args->is_register = 'Y';
2059 2059
 
2060 2060
 			$output = executeQuery('member.insertAuthMail', $auth_args);
2061
-			if(!$output->toBool())
2061
+			if (!$output->toBool())
2062 2062
 			{
2063 2063
 				$oDB->rollback();
2064 2064
 				return $output;
@@ -2066,10 +2066,10 @@  discard block
 block discarded – undo
2066 2066
 			$this->_sendAuthMail($auth_args, $args);
2067 2067
 		}
2068 2068
 		// Call a trigger (after)
2069
-		if($output->toBool())
2069
+		if ($output->toBool())
2070 2070
 		{
2071 2071
 			$trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args);
2072
-			if(!$trigger_output->toBool())
2072
+			if (!$trigger_output->toBool())
2073 2073
 			{
2074 2074
 				$oDB->rollback();
2075 2075
 				return $trigger_output;
@@ -2091,41 +2091,41 @@  discard block
 block discarded – undo
2091 2091
 	{
2092 2092
 		// Call a trigger (before)
2093 2093
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2094
-		if(!$output->toBool()) return $output;
2094
+		if (!$output->toBool()) return $output;
2095 2095
 		// Create a model object
2096 2096
 		$oMemberModel = getModel('member');
2097 2097
 
2098 2098
 		$logged_info = Context::get('logged_info');
2099 2099
 		// Get what you want to modify the original information
2100
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2100
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2101 2101
 		// Control of essential parameters
2102
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2103
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2102
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
2103
+		if ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F'))) $args->allow_message = 'Y';
2104 2104
 
2105
-		if($logged_info->is_admin == 'Y')
2105
+		if ($logged_info->is_admin == 'Y')
2106 2106
 		{
2107
-			if($args->denied!='Y') $args->denied = 'N';
2108
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2107
+			if ($args->denied != 'Y') $args->denied = 'N';
2108
+			if ($args->is_admin != 'Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2109 2109
 		}
2110 2110
 		else
2111 2111
 		{
2112 2112
 			unset($args->is_admin);
2113
-			if($is_admin == false)
2113
+			if ($is_admin == false)
2114 2114
 				unset($args->denied);
2115
-			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2115
+			if ($logged_info->member_srl != $args->member_srl && $is_admin == false)
2116 2116
 			{
2117 2117
 				return $this->stop('msg_invalid_request');
2118 2118
 			}
2119 2119
 		}
2120 2120
 
2121 2121
 		// Sanitize user ID, username, nickname, homepage, blog
2122
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2122
+		if ($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2123 2123
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2124 2124
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2125 2125
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2126 2126
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2127
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2128
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2127
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//is", $args->homepage)) $args->homepage = 'http://' . $args->homepage;
2128
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//is", $args->blog)) $args->blog = 'http://' . $args->blog;
2129 2129
 
2130 2130
 		// check member identifier form
2131 2131
 		$config = $oMemberModel->getMemberConfig();
@@ -2134,53 +2134,53 @@  discard block
 block discarded – undo
2134 2134
 		$orgMemberInfo = $output->data;
2135 2135
 
2136 2136
 		// Check if email address or user ID is duplicate
2137
-		if($config->identifier == 'email_address')
2137
+		if ($config->identifier == 'email_address')
2138 2138
 		{
2139 2139
 			$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2140
-			if($member_srl && $args->member_srl != $member_srl)
2140
+			if ($member_srl && $args->member_srl != $member_srl)
2141 2141
 			{
2142
-				return new Object(-1,'msg_exists_email_address');
2142
+				return new Object(-1, 'msg_exists_email_address');
2143 2143
 			}
2144 2144
 			$args->email_address = $orgMemberInfo->email_address;
2145 2145
 		}
2146 2146
 		else
2147 2147
 		{
2148 2148
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2149
-			if($member_srl && $args->member_srl != $member_srl)
2149
+			if ($member_srl && $args->member_srl != $member_srl)
2150 2150
 			{
2151
-				return new Object(-1,'msg_exists_user_id');
2151
+				return new Object(-1, 'msg_exists_user_id');
2152 2152
 			}
2153 2153
 
2154 2154
 			$args->user_id = $orgMemberInfo->user_id;
2155 2155
 		}
2156 2156
 
2157 2157
 		// Check if ID is prohibited
2158
-		if($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2158
+		if ($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2159 2159
 		{
2160
-			return new Object(-1,'denied_user_id');
2160
+			return new Object(-1, 'denied_user_id');
2161 2161
 		}
2162 2162
 
2163 2163
 		// Check if ID is duplicate
2164
-		if($args->user_id)
2164
+		if ($args->user_id)
2165 2165
 		{
2166 2166
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2167
-			if($member_srl && $args->member_srl != $member_srl)
2167
+			if ($member_srl && $args->member_srl != $member_srl)
2168 2168
 			{
2169
-				return new Object(-1,'msg_exists_user_id');
2169
+				return new Object(-1, 'msg_exists_user_id');
2170 2170
 			}
2171 2171
 		}
2172 2172
 
2173 2173
 		// Check if nickname is prohibited
2174
-		if($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2174
+		if ($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2175 2175
 		{
2176 2176
 			return new Object(-1, 'denied_nick_name');
2177 2177
 		}
2178 2178
 
2179 2179
 		// Check if nickname is duplicate
2180 2180
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
2181
- 		if($member_srl && $args->member_srl != $member_srl)
2181
+ 		if ($member_srl && $args->member_srl != $member_srl)
2182 2182
  		{
2183
- 			return new Object(-1,'msg_exists_nick_name');
2183
+ 			return new Object(-1, 'msg_exists_nick_name');
2184 2184
  		}
2185 2185
 
2186 2186
 		list($args->email_id, $args->email_host) = explode('@', $args->email_address);
@@ -2189,9 +2189,9 @@  discard block
 block discarded – undo
2189 2189
 		$oDB->begin();
2190 2190
 
2191 2191
 		// Check password strength
2192
-		if($args->password)
2192
+		if ($args->password)
2193 2193
 		{
2194
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2194
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2195 2195
 			{
2196 2196
 				$message = Context::getLang('about_password_strength');
2197 2197
 				return new Object(-1, $message[$config->password_strength]);
@@ -2203,40 +2203,40 @@  discard block
 block discarded – undo
2203 2203
 			$args->password = $orgMemberInfo->password;
2204 2204
 		}
2205 2205
 		
2206
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2207
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2208
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2209
-		if(!$args->description) $args->description = '';
2210
-		if(!$args->birthday) $args->birthday = '';
2206
+		if (!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2207
+		if (!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2208
+		if (!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2209
+		if (!$args->description) $args->description = '';
2210
+		if (!$args->birthday) $args->birthday = '';
2211 2211
 
2212 2212
 		$output = executeQuery('member.updateMember', $args);
2213 2213
 
2214
-		if(!$output->toBool())
2214
+		if (!$output->toBool())
2215 2215
 		{
2216 2216
 			$oDB->rollback();
2217 2217
 			return $output;
2218 2218
 		}
2219 2219
 
2220
-		if($args->group_srl_list)
2220
+		if ($args->group_srl_list)
2221 2221
 		{
2222
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2222
+			if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2223 2223
 			else $group_srl_list = explode('|@|', $args->group_srl_list);
2224 2224
 			// If the group information, group information changes
2225
-			if(count($group_srl_list) > 0)
2225
+			if (count($group_srl_list) > 0)
2226 2226
 			{
2227 2227
 				$args->site_srl = 0;
2228 2228
 				// One of its members to delete all the group
2229 2229
 				$output = executeQuery('member.deleteMemberGroupMember', $args);
2230
-				if(!$output->toBool())
2230
+				if (!$output->toBool())
2231 2231
 				{
2232 2232
 					$oDB->rollback();
2233 2233
 					return $output;
2234 2234
 				}
2235 2235
 				// Enter one of the loop a
2236
-				for($i=0;$i<count($group_srl_list);$i++)
2236
+				for ($i = 0; $i < count($group_srl_list); $i++)
2237 2237
 				{
2238
-					$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2239
-					if(!$output->toBool())
2238
+					$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2239
+					if (!$output->toBool())
2240 2240
 					{
2241 2241
 						$oDB->rollback();
2242 2242
 						return $output;
@@ -2248,9 +2248,9 @@  discard block
 block discarded – undo
2248 2248
 			}
2249 2249
 		}
2250 2250
 		// Call a trigger (after)
2251
-		if($output->toBool()) {
2251
+		if ($output->toBool()) {
2252 2252
 			$trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args);
2253
-			if(!$trigger_output->toBool())
2253
+			if (!$trigger_output->toBool())
2254 2254
 			{
2255 2255
 				$oDB->rollback();
2256 2256
 				return $trigger_output;
@@ -2263,7 +2263,7 @@  discard block
 block discarded – undo
2263 2263
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2264 2264
 
2265 2265
 		// Save Session
2266
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2266
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2267 2267
 		$logged_info = Context::get('logged_info');
2268 2268
 
2269 2269
 		$output->add('member_srl', $args->member_srl);
@@ -2275,14 +2275,14 @@  discard block
 block discarded – undo
2275 2275
 	 */
2276 2276
 	function updateMemberPassword($args)
2277 2277
 	{
2278
-		if($args->password)
2278
+		if ($args->password)
2279 2279
 		{
2280 2280
 
2281 2281
 			// check password strength
2282 2282
 			$oMemberModel = getModel('member');
2283 2283
 			$config = $oMemberModel->getMemberConfig();
2284 2284
 
2285
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2285
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2286 2286
 			{
2287 2287
 				$message = Context::getLang('about_password_strength');
2288 2288
 				return new Object(-1, $message[$config->password_strength]);
@@ -2290,13 +2290,13 @@  discard block
 block discarded – undo
2290 2290
 
2291 2291
 			$args->password = $oMemberModel->hashPassword($args->password);
2292 2292
 		}
2293
-		else if($args->hashed_password)
2293
+		else if ($args->hashed_password)
2294 2294
 		{
2295 2295
 			$args->password = $args->hashed_password;
2296 2296
 		}
2297 2297
 
2298 2298
 		$output = executeQuery('member.updateMemberPassword', $args);
2299
-		if($output->toBool())
2299
+		if ($output->toBool())
2300 2300
 		{
2301 2301
 			$result = executeQuery('member.updateChangePasswordDate', $args);
2302 2302
 		}
@@ -2315,18 +2315,18 @@  discard block
 block discarded – undo
2315 2315
 		$trigger_obj = new stdClass();
2316 2316
 		$trigger_obj->member_srl = $member_srl;
2317 2317
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2318
-		if(!$output->toBool()) return $output;
2318
+		if (!$output->toBool()) return $output;
2319 2319
 		// Create a model object
2320 2320
 		$oMemberModel = getModel('member');
2321 2321
 		// Bringing the user's information
2322
-		if(!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2322
+		if (!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2323 2323
 		{
2324 2324
 			$columnList = array('member_srl', 'is_admin');
2325 2325
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2326 2326
 		}
2327
-		if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2327
+		if (!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2328 2328
 		// If managers can not be deleted
2329
-		if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2329
+		if ($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2330 2330
 
2331 2331
 		$oDB = &DB::getInstance();
2332 2332
 		$oDB->begin();
@@ -2335,7 +2335,7 @@  discard block
 block discarded – undo
2335 2335
 		$args->member_srl = $member_srl;
2336 2336
 		// Delete the entries in member_auth_mail
2337 2337
 		$output = executeQuery('member.deleteAuthMail', $args);
2338
-		if(!$output->toBool())
2338
+		if (!$output->toBool())
2339 2339
 		{
2340 2340
 			$oDB->rollback();
2341 2341
 			return $output;
@@ -2350,23 +2350,23 @@  discard block
 block discarded – undo
2350 2350
 		 */
2351 2351
 		// Delete the entries in member_group_member
2352 2352
 		$output = executeQuery('member.deleteMemberGroupMember', $args);
2353
-		if(!$output->toBool())
2353
+		if (!$output->toBool())
2354 2354
 		{
2355 2355
 			$oDB->rollback();
2356 2356
 			return $output;
2357 2357
 		}
2358 2358
 		// member removed from the table
2359 2359
 		$output = executeQuery('member.deleteMember', $args);
2360
-		if(!$output->toBool())
2360
+		if (!$output->toBool())
2361 2361
 		{
2362 2362
 			$oDB->rollback();
2363 2363
 			return $output;
2364 2364
 		}
2365 2365
 		// Call a trigger (after)
2366
-		if($output->toBool())
2366
+		if ($output->toBool())
2367 2367
 		{
2368 2368
 			$trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj);
2369
-			if(!$trigger_output->toBool())
2369
+			if (!$trigger_output->toBool())
2370 2370
 			{
2371 2371
 				$oDB->rollback();
2372 2372
 				return $trigger_output;
@@ -2390,23 +2390,23 @@  discard block
 block discarded – undo
2390 2390
 	 */
2391 2391
 	function destroySessionInfo()
2392 2392
 	{
2393
-		if(!$_SESSION || !is_array($_SESSION)) return;
2393
+		if (!$_SESSION || !is_array($_SESSION)) return;
2394 2394
 
2395 2395
 		$memberInfo = Context::get('logged_info');
2396 2396
 		$memberSrl = $memberInfo->member_srl;
2397 2397
 
2398
-		foreach($_SESSION as $key => $val)
2398
+		foreach ($_SESSION as $key => $val)
2399 2399
 		{
2400 2400
 			$_SESSION[$key] = '';
2401 2401
 		}
2402 2402
 
2403 2403
 		session_destroy();
2404
-		setcookie(session_name(), '', $_SERVER['REQUEST_TIME']-42000, '/');
2405
-		setcookie('sso','',$_SERVER['REQUEST_TIME']-42000, '/');
2406
-		setcookie('xeak','',$_SERVER['REQUEST_TIME']-42000, '/');
2404
+		setcookie(session_name(), '', $_SERVER['REQUEST_TIME'] - 42000, '/');
2405
+		setcookie('sso', '', $_SERVER['REQUEST_TIME'] - 42000, '/');
2406
+		setcookie('xeak', '', $_SERVER['REQUEST_TIME'] - 42000, '/');
2407 2407
 		setcookie('xe_logged', 'false', $_SERVER['REQUEST_TIME'] - 42000, '/');
2408 2408
 
2409
-		if($memberSrl || $_COOKIE['xeak'])
2409
+		if ($memberSrl || $_COOKIE['xeak'])
2410 2410
 		{
2411 2411
 			$args = new stdClass();
2412 2412
 			$args->member_srl = $memberSrl;
@@ -2422,22 +2422,22 @@  discard block
 block discarded – undo
2422 2422
 		$pointGroup = $pointModuleConfig->point_group;
2423 2423
 
2424 2424
 		$levelGroup = array();
2425
-		if(is_array($pointGroup) && count($pointGroup)>0)
2425
+		if (is_array($pointGroup) && count($pointGroup) > 0)
2426 2426
 		{
2427 2427
 			$levelGroup = array_flip($pointGroup);
2428 2428
 			ksort($levelGroup);
2429 2429
 		}
2430 2430
 		$maxLevel = 0;
2431 2431
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2432
-		if(count($resultGroup) > 0)
2432
+		if (count($resultGroup) > 0)
2433 2433
 			$maxLevel = max(array_flip($resultGroup));
2434 2434
 
2435
-		if($maxLevel > 0)
2435
+		if ($maxLevel > 0)
2436 2436
 		{
2437 2437
 			$oPointModel = getModel('point');
2438 2438
 			$originPoint = $oPointModel->getPoint($memberSrl);
2439 2439
 
2440
-			if($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2440
+			if ($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2441 2441
 			{
2442 2442
 				$oPointController = getController('point');
2443 2443
 				$oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel], 'update');
@@ -2447,18 +2447,18 @@  discard block
 block discarded – undo
2447 2447
 
2448 2448
 	function procMemberModifyEmailAddress()
2449 2449
 	{
2450
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2450
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
2451 2451
 
2452 2452
 		$member_info = Context::get('logged_info');
2453 2453
 		$newEmail = Context::get('email_address');
2454 2454
 
2455
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2455
+		if (!$newEmail) return $this->stop('msg_invalid_request');
2456 2456
 
2457 2457
 		$oMemberModel = getModel('member');
2458 2458
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2459
-		if($member_srl) return new Object(-1,'msg_exists_email_address');
2459
+		if ($member_srl) return new Object(-1, 'msg_exists_email_address');
2460 2460
 
2461
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2461
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2462 2462
 		{
2463 2463
 			return $this->stop('msg_invalid_request');
2464 2464
 		}
@@ -2474,7 +2474,7 @@  discard block
 block discarded – undo
2474 2474
 		$oDB = &DB::getInstance();
2475 2475
 		$oDB->begin();
2476 2476
 		$output = executeQuery('member.insertAuthMail', $auth_args);
2477
-		if(!$output->toBool())
2477
+		if (!$output->toBool())
2478 2478
 		{
2479 2479
 			$oDB->rollback();
2480 2480
 			return $output;
@@ -2484,7 +2484,7 @@  discard block
 block discarded – undo
2484 2484
 		$member_config = $oModuleModel->getModuleConfig('member');
2485 2485
 
2486 2486
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2487
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2487
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2488 2488
 
2489 2489
 		global $lang;
2490 2490
 
@@ -2496,17 +2496,17 @@  discard block
 block discarded – undo
2496 2496
 
2497 2497
 		Context::set('newEmail', $newEmail);
2498 2498
 
2499
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthEmailAddress','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
2499
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
2500 2500
 		Context::set('auth_url', $auth_url);
2501 2501
 
2502 2502
 		$oTemplate = &TemplateHandler::getInstance();
2503 2503
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_new_email');
2504 2504
 
2505 2505
 		$oMail = new Mail();
2506
-		$oMail->setTitle( Context::getLang('title_modify_email_address') );
2506
+		$oMail->setTitle(Context::getLang('title_modify_email_address'));
2507 2507
 		$oMail->setContent($content);
2508
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
2509
-		$oMail->setReceiptor( $member_info->nick_name, $newEmail );
2508
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
2509
+		$oMail->setReceiptor($member_info->nick_name, $newEmail);
2510 2510
 		$result = $oMail->send();
2511 2511
 
2512 2512
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail);
@@ -2520,16 +2520,16 @@  discard block
 block discarded – undo
2520 2520
 	{
2521 2521
 		$member_srl = Context::get('member_srl');
2522 2522
 		$auth_key = Context::get('auth_key');
2523
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2523
+		if (!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2524 2524
 
2525 2525
 		// Test logs for finding password by user_id and authkey
2526 2526
 		$args = new stdClass;
2527 2527
 		$args->member_srl = $member_srl;
2528 2528
 		$args->auth_key = $auth_key;
2529 2529
 		$output = executeQuery('member.getAuthMail', $args);
2530
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2530
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
2531 2531
 		{
2532
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2532
+			if (strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2533 2533
 			return $this->stop('msg_invalid_modify_email_auth_key');
2534 2534
 		}
2535 2535
 
@@ -2538,15 +2538,15 @@  discard block
 block discarded – undo
2538 2538
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2539 2539
 
2540 2540
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2541
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2541
+		if (!$output->toBool()) return $this->stop($output->getMessage());
2542 2542
 
2543 2543
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2544
-		executeQuery('member.deleteAuthChangeEmailAddress',$args);
2544
+		executeQuery('member.deleteAuthChangeEmailAddress', $args);
2545 2545
 
2546 2546
 		$this->_clearMemberCache($args->member_srl);
2547 2547
 
2548 2548
 		// Notify the result
2549
-		$this->setTemplatePath($this->module_path.'tpl');
2549
+		$this->setTemplatePath($this->module_path . 'tpl');
2550 2550
 		$this->setTemplateFile('msg_success_modify_email_address');
2551 2551
 	}
2552 2552
 
@@ -2559,7 +2559,7 @@  discard block
 block discarded – undo
2559 2559
 	**/
2560 2560
 	function triggerGetDocumentMenu(&$menu_list)
2561 2561
 	{
2562
-		if(!Context::get('is_logged')) return new Object();
2562
+		if (!Context::get('is_logged')) return new Object();
2563 2563
 
2564 2564
 		$logged_info = Context::get('logged_info');
2565 2565
 		$document_srl = Context::get('target_srl');
@@ -2570,12 +2570,12 @@  discard block
 block discarded – undo
2570 2570
 		$member_srl = $oDocument->get('member_srl');
2571 2571
 		$module_srl = $oDocument->get('module_srl');
2572 2572
 
2573
-		if(!$member_srl) return new Object();
2574
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2573
+		if (!$member_srl) return new Object();
2574
+		if ($oDocumentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object();
2575 2575
 
2576 2576
 		$oDocumentController = getController('document');
2577
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2578
-		$oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup');
2577
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2578
+		$oDocumentController->addDocumentPopupMenu($url, 'cmd_spammer', '', 'popup');
2579 2579
 
2580 2580
 		return new Object();
2581 2581
 	}
@@ -2589,7 +2589,7 @@  discard block
 block discarded – undo
2589 2589
 	**/
2590 2590
 	function triggerGetCommentMenu(&$menu_list)
2591 2591
 	{
2592
-		if(!Context::get('is_logged')) return new Object();
2592
+		if (!Context::get('is_logged')) return new Object();
2593 2593
 
2594 2594
 		$logged_info = Context::get('logged_info');
2595 2595
 		$comment_srl = Context::get('target_srl');
@@ -2600,12 +2600,12 @@  discard block
 block discarded – undo
2600 2600
 		$module_srl = $oComment->get('module_srl');
2601 2601
 		$member_srl = $oComment->get('member_srl');
2602 2602
 
2603
-		if(!$member_srl) return new Object();
2604
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2603
+		if (!$member_srl) return new Object();
2604
+		if ($oCommentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object();
2605 2605
 
2606 2606
 		$oCommentController = getController('comment');
2607
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2608
-		$oCommentController->addCommentPopupMenu($url,'cmd_spammer','','popup');
2607
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2608
+		$oCommentController->addCommentPopupMenu($url, 'cmd_spammer', '', 'popup');
2609 2609
 
2610 2610
 		return new Object();
2611 2611
 	}
@@ -2617,7 +2617,7 @@  discard block
 block discarded – undo
2617 2617
 	**/
2618 2618
 	function procMemberSpammerManage()
2619 2619
 	{
2620
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
2620
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
2621 2621
 
2622 2622
 		$logged_info = Context::get('logged_info');
2623 2623
 		$member_srl = Context::get('member_srl');
@@ -2625,7 +2625,7 @@  discard block
 block discarded – undo
2625 2625
 		$cnt_loop = Context::get('cnt_loop');
2626 2626
 		$proc_type = Context::get('proc_type');
2627 2627
 		$isMoveToTrash = true;
2628
-		if($proc_type == "delete")
2628
+		if ($proc_type == "delete")
2629 2629
 			$isMoveToTrash = false;
2630 2630
 
2631 2631
 		// check grant
@@ -2634,7 +2634,7 @@  discard block
 block discarded – undo
2634 2634
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2635 2635
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2636 2636
 
2637
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
2637
+		if (!$grant->manager) return new Object(-1, 'msg_not_permitted');
2638 2638
 
2639 2639
 		$proc_msg = "";
2640 2640
 
@@ -2643,10 +2643,10 @@  discard block
 block discarded – undo
2643 2643
 
2644 2644
 		// delete or trash destination
2645 2645
 		// proc member
2646
-		if($cnt_loop == 1)
2646
+		if ($cnt_loop == 1)
2647 2647
 			$this->_spammerMember($member_srl);
2648 2648
 		// proc document and comment
2649
-		elseif($cnt_loop>1)
2649
+		elseif ($cnt_loop > 1)
2650 2650
 			$this->_spammerDocuments($member_srl, $isMoveToTrash);
2651 2651
 
2652 2652
 		// get destination count
@@ -2655,11 +2655,11 @@  discard block
 block discarded – undo
2655 2655
 
2656 2656
 		$total_count = Context::get('total_count');
2657 2657
 		$remain_count = $cnt_document + $cnt_comment;
2658
-		if($cnt_loop == 1) $total_count = $remain_count;
2658
+		if ($cnt_loop == 1) $total_count = $remain_count;
2659 2659
 
2660 2660
 		// get progress percent
2661
-		if($total_count > 0)
2662
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2661
+		if ($total_count > 0)
2662
+			$progress = intval((($total_count - $remain_count) / $total_count) * 100);
2663 2663
 		else
2664 2664
 			$progress = 100;
2665 2665
 
@@ -2683,7 +2683,7 @@  discard block
 block discarded – undo
2683 2683
 	**/
2684 2684
 	private function _spammerMember($member_srl) {
2685 2685
 		$logged_info = Context::get('logged_info');
2686
-		$spam_description = trim( Context::get('spam_description') );
2686
+		$spam_description = trim(Context::get('spam_description'));
2687 2687
 
2688 2688
 		$oMemberModel = getModel('member');
2689 2689
 		$columnList = array('member_srl', 'email_address', 'user_id', 'nick_name', 'description');
@@ -2702,8 +2702,8 @@  discard block
 block discarded – undo
2702 2702
 		$args->user_id = $member_info->user_id;
2703 2703
 		$args->nick_name = $member_info->nick_name;
2704 2704
 		$args->denied = "Y";
2705
-		$args->description = trim( $member_info->description );
2706
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
2705
+		$args->description = trim($member_info->description);
2706
+		if ($args->description != "") $args->description .= "\n"; // add new line
2707 2707
 
2708 2708
 		$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 . "]";
2709 2709
 
@@ -2734,21 +2734,21 @@  discard block
 block discarded – undo
2734 2734
 		// 1. proc comment, 2. proc document
2735 2735
 		$cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl);
2736 2736
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
2737
-		if($cnt_comment > 0)
2737
+		if ($cnt_comment > 0)
2738 2738
 		{
2739 2739
 			$columnList = array();
2740 2740
 			$commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2741
-			if($commentList) {
2742
-				foreach($commentList as $v) {
2741
+			if ($commentList) {
2742
+				foreach ($commentList as $v) {
2743 2743
 					$oCommentController->deleteComment($v->comment_srl, true, $isMoveToTrash);
2744 2744
 				}
2745 2745
 			}
2746
-		} elseif($cnt_document > 0) {
2746
+		} elseif ($cnt_document > 0) {
2747 2747
 			$columnList = array();
2748 2748
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2749
-			if($documentList) {
2750
-				foreach($documentList as $v) {
2751
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2749
+			if ($documentList) {
2750
+				foreach ($documentList as $v) {
2751
+					if ($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2752 2752
 					else $oDocumentController->deleteDocument($v->document_srl);
2753 2753
 				}
2754 2754
 			}
@@ -2760,13 +2760,13 @@  discard block
 block discarded – undo
2760 2760
 	function _clearMemberCache($member_srl, $site_srl = 0)
2761 2761
 	{
2762 2762
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
2763
-		if($oCacheHandler->isSupport())
2763
+		if ($oCacheHandler->isSupport())
2764 2764
 		{
2765 2765
 			$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_' . $site_srl;
2766 2766
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2767 2767
 			$oCacheHandler->delete($cache_key);
2768 2768
 
2769
-			if($site_srl !== 0)
2769
+			if ($site_srl !== 0)
2770 2770
 			{
2771 2771
 				$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0';
2772 2772
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
@@ -2775,7 +2775,7 @@  discard block
 block discarded – undo
2775 2775
 		}
2776 2776
 
2777 2777
 		$oCacheHandler = CacheHandler::getInstance('object');
2778
-		if($oCacheHandler->isSupport())
2778
+		if ($oCacheHandler->isSupport())
2779 2779
 		{
2780 2780
 			$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
2781 2781
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
Please login to merge, or discard this patch.
Braces   +587 added lines, -246 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
 		// Variables
201 235
 		$oDocumentController = getController('document');
202 236
 		$oDocumentController->deleteDocument($document_srl, true);
@@ -211,7 +245,9 @@  discard block
 block discarded – undo
211 245
 	{
212 246
 		$name = Context::get('name');
213 247
 		$value = Context::get('value');
214
-		if(!$value) return;
248
+		if(!$value) {
249
+			return;
250
+		}
215 251
 
216 252
 		$oMemberModel = getModel('member');
217 253
 		// Check if logged-in
@@ -222,10 +258,14 @@  discard block
 block discarded – undo
222 258
 		{
223 259
 			case 'user_id' :
224 260
 				// Check denied ID
225
-				if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id');
261
+				if($oMemberModel->isDeniedID($value)) {
262
+					return new Object(0,'denied_user_id');
263
+				}
226 264
 				// Check if duplicated
227 265
 				$member_srl = $oMemberModel->getMemberSrlByUserID($value);
228
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_user_id');
266
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
267
+					return new Object(0,'msg_exists_user_id');
268
+				}
229 269
 				break;
230 270
 			case 'nick_name' :
231 271
 				// Check denied ID
@@ -235,13 +275,17 @@  discard block
 block discarded – undo
235 275
 				}
236 276
 				// Check if duplicated
237 277
 				$member_srl = $oMemberModel->getMemberSrlByNickName($value);
238
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name');
278
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
279
+					return new Object(0,'msg_exists_nick_name');
280
+				}
239 281
 
240 282
 				break;
241 283
 			case 'email_address' :
242 284
 				// Check if duplicated
243 285
 				$member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
244
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address');
286
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
287
+					return new Object(0,'msg_exists_email_address');
288
+				}
245 289
 				break;
246 290
 		}
247 291
 	}
@@ -253,17 +297,25 @@  discard block
 block discarded – undo
253 297
 	 */
254 298
 	function procMemberInsert()
255 299
 	{
256
-		if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request");
300
+		if (Context::getRequestMethod () == "GET") {
301
+			return new Object (-1, "msg_invalid_request");
302
+		}
257 303
 		$oMemberModel = &getModel ('member');
258 304
 		$config = $oMemberModel->getMemberConfig();
259 305
 
260 306
 		// call a trigger (before)
261 307
 		$trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config);
262
-		if(!$trigger_output->toBool ()) return $trigger_output;
308
+		if(!$trigger_output->toBool ()) {
309
+			return $trigger_output;
310
+		}
263 311
 		// Check if an administrator allows a membership
264
-		if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled');
312
+		if($config->enable_join != 'Y') {
313
+			return $this->stop ('msg_signup_disabled');
314
+		}
265 315
 		// Check if the user accept the license terms (only if terms exist)
266
-		if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
316
+		if($config->agreement && Context::get('accept_agreement')!='Y') {
317
+			return $this->stop('msg_accept_agreement');
318
+		}
267 319
 
268 320
 		// Extract the necessary information in advance
269 321
 		$getVars = array();
@@ -282,16 +334,22 @@  discard block
 block discarded – undo
282 334
 		foreach($getVars as $val)
283 335
 		{
284 336
 			$args->{$val} = Context::get($val);
285
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
337
+			if($val == 'birthday') {
338
+				$args->birthday_ui = Context::get('birthday_ui');
339
+			}
286 340
 		}
287 341
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
288
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
342
+		if(!$args->birthday && $args->birthday_ui) {
343
+			$args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
344
+		}
289 345
 
290 346
 		$args->find_account_answer = Context::get('find_account_answer');
291 347
 		$args->allow_mailing = Context::get('allow_mailing');
292 348
 		$args->allow_message = Context::get('allow_message');
293 349
 
294
-		if($args->password1) $args->password = $args->password1;
350
+		if($args->password1) {
351
+			$args->password = $args->password1;
352
+		}
295 353
 
296 354
 		// check password strength
297 355
 		if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
@@ -320,7 +378,9 @@  discard block
 block discarded – undo
320 378
 		unset($all_args->secret_text);
321 379
 
322 380
 		// Set the user state as "denied" when using mail authentication
323
-		if($config->enable_confirm == 'Y') $args->denied = 'Y';
381
+		if($config->enable_confirm == 'Y') {
382
+			$args->denied = 'Y';
383
+		}
324 384
 		// Add extra vars after excluding necessary information from all the requested arguments
325 385
 		$extra_vars = delObjectVars($all_args, $args);
326 386
 		$args->extra_vars = serialize($extra_vars);
@@ -335,7 +395,9 @@  discard block
 block discarded – undo
335 395
 			}
336 396
 		}
337 397
 		$output = $this->insertMember($args);
338
-		if(!$output->toBool()) return $output;
398
+		if(!$output->toBool()) {
399
+			return $output;
400
+		}
339 401
 
340 402
 		// insert ProfileImage, ImageName, ImageMark
341 403
 		$profile_image = $_FILES['profile_image'];
@@ -374,43 +436,46 @@  discard block
 block discarded – undo
374 436
 			if($config->identifier == 'email_address')
375 437
 			{
376 438
 				$output = $this->doLogin($args->email_address);
377
-			}
378
-			else
439
+			} else
379 440
 			{
380 441
 				$output = $this->doLogin($args->user_id);
381 442
 			}
382 443
 			if(!$output->toBool()) {
383
-				if($output->error == -9)
384
-					$output->error = -11;
444
+				if($output->error == -9) {
445
+									$output->error = -11;
446
+				}
385 447
 				return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output);
386 448
 			}
387 449
 		}
388 450
 
389 451
 		// Results
390 452
 		$this->add('member_srl', $args->member_srl);
391
-		if($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
453
+		if($config->redirect_url) {
454
+			$this->add('redirect_url', $config->redirect_url);
455
+		}
392 456
 		if($config->enable_confirm == 'Y')
393 457
 		{
394 458
 			$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
395 459
 			$this->setMessage($msg);
396 460
 			return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), new Object(-12, $msg));
461
+		} else {
462
+			$this->setMessage('success_registed');
397 463
 		}
398
-		else $this->setMessage('success_registed');
399 464
 		// Call a trigger (after)
400 465
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
401
-		if(!$trigger_output->toBool()) return $trigger_output;
466
+		if(!$trigger_output->toBool()) {
467
+			return $trigger_output;
468
+		}
402 469
 
403 470
 		if($config->redirect_url)
404 471
 		{
405 472
 			$returnUrl = $config->redirect_url;
406
-		}
407
-		else
473
+		} else
408 474
 		{
409 475
 			if(Context::get('success_return_url'))
410 476
 			{
411 477
 				$returnUrl = Context::get('success_return_url');
412
-			}
413
-			else if($_COOKIE['XE_REDIRECT_URL'])
478
+			} else if($_COOKIE['XE_REDIRECT_URL'])
414 479
 			{
415 480
 				$returnUrl = $_COOKIE['XE_REDIRECT_URL'];
416 481
 				setcookie("XE_REDIRECT_URL", '', 1);
@@ -464,8 +529,7 @@  discard block
 block discarded – undo
464 529
 		if(Context::get('success_return_url'))
465 530
 		{
466 531
 			$redirectUrl = Context::get('success_return_url');
467
-		}
468
-		else
532
+		} else
469 533
 		{
470 534
 			$redirectUrl = getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
471 535
 		}
@@ -509,13 +573,17 @@  discard block
 block discarded – undo
509 573
 		foreach($getVars as $val)
510 574
 		{
511 575
 			$args->{$val} = Context::get($val);
512
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
576
+			if($val == 'birthday') {
577
+				$args->birthday_ui = Context::get('birthday_ui');
578
+			}
513 579
 		}
514 580
 		// Login Information
515 581
 		$logged_info = Context::get('logged_info');
516 582
 		$args->member_srl = $logged_info->member_srl;
517 583
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
518
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
584
+		if(!$args->birthday && $args->birthday_ui) {
585
+			$args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
586
+		}
519 587
 		// Remove some unnecessary variables from all the vars
520 588
 		$all_args = Context::getRequestVars();
521 589
 		unset($all_args->module);
@@ -549,7 +617,9 @@  discard block
 block discarded – undo
549 617
 
550 618
 		// Execute insert or update depending on the value of member_srl
551 619
 		$output = $this->updateMember($args);
552
-		if(!$output->toBool()) return $output;
620
+		if(!$output->toBool()) {
621
+			return $output;
622
+		}
553 623
 
554 624
 		$profile_image = $_FILES['profile_image'];
555 625
 		if(is_uploaded_file($profile_image['tmp_name']))
@@ -579,7 +649,9 @@  discard block
 block discarded – undo
579 649
 
580 650
 		// Call a trigger after successfully log-in (after)
581 651
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo);
582
-		if(!$trigger_output->toBool()) return $trigger_output;
652
+		if(!$trigger_output->toBool()) {
653
+			return $trigger_output;
654
+		}
583 655
 
584 656
 		$this->setSessionInfo();
585 657
 		// Return result
@@ -600,7 +672,9 @@  discard block
 block discarded – undo
600 672
 	 */
601 673
 	function procMemberModifyPassword()
602 674
 	{
603
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
675
+		if(!Context::get('is_logged')) {
676
+			return $this->stop('msg_not_logged');
677
+		}
604 678
 		// Extract the necessary information in advance
605 679
 		$current_password = trim(Context::get('current_password'));
606 680
 		$password = trim(Context::get('password1'));
@@ -614,17 +688,23 @@  discard block
 block discarded – undo
614 688
 
615 689
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
616 690
 		// Verify the cuttent password
617
-		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
691
+		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) {
692
+			return new Object(-1, 'invalid_password');
693
+		}
618 694
 
619 695
 		// Check if a new password is as same as the previous password
620
-		if($current_password == $password) return new Object(-1, 'invalid_new_password');
696
+		if($current_password == $password) {
697
+			return new Object(-1, 'invalid_new_password');
698
+		}
621 699
 
622 700
 		// Execute insert or update depending on the value of member_srl
623 701
 		$args = new stdClass;
624 702
 		$args->member_srl = $member_srl;
625 703
 		$args->password = $password;
626 704
 		$output = $this->updateMemberPassword($args);
627
-		if(!$output->toBool()) return $output;
705
+		if(!$output->toBool()) {
706
+			return $output;
707
+		}
628 708
 
629 709
 		$this->add('member_srl', $args->member_srl);
630 710
 		$this->setMessage('success_updated');
@@ -640,7 +720,9 @@  discard block
 block discarded – undo
640 720
 	 */
641 721
 	function procMemberLeave()
642 722
 	{
643
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
723
+		if(!Context::get('is_logged')) {
724
+			return $this->stop('msg_not_logged');
725
+		}
644 726
 		// Extract the necessary information in advance
645 727
 		$password = trim(Context::get('password'));
646 728
 		// Get information of logged-in user
@@ -656,10 +738,14 @@  discard block
 block discarded – undo
656 738
 			$this->memberInfo->password = $memberInfo->password;
657 739
 		}
658 740
 		// Verify the cuttent password
659
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
741
+		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) {
742
+			return new Object(-1, 'invalid_password');
743
+		}
660 744
 
661 745
 		$output = $this->deleteMember($member_srl);
662
-		if(!$output->toBool()) return $output;
746
+		if(!$output->toBool()) {
747
+			return $output;
748
+		}
663 749
 		// Destroy all session information
664 750
 		$this->destroySessionInfo();
665 751
 		// Return success message
@@ -678,17 +764,25 @@  discard block
 block discarded – undo
678 764
 	{
679 765
 		// Check if the file is successfully uploaded
680 766
 		$file = $_FILES['profile_image'];
681
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
767
+		if(!is_uploaded_file($file['tmp_name'])) {
768
+			return $this->stop('msg_not_uploaded_profile_image');
769
+		}
682 770
 		// Ignore if member_srl is invalid or doesn't exist.
683 771
 		$member_srl = Context::get('member_srl');
684
-		if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
772
+		if(!$member_srl) {
773
+			return $this->stop('msg_not_uploaded_profile_image');
774
+		}
685 775
 
686 776
 		$logged_info = Context::get('logged_info');
687
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
777
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
778
+			return $this->stop('msg_not_uploaded_profile_image');
779
+		}
688 780
 		// Return if member module is set not to use an image name or the user is not an administrator ;
689 781
 		$oModuleModel = getModel('module');
690 782
 		$config = $oModuleModel->getModuleConfig('member');
691
-		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
783
+		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') {
784
+			return $this->stop('msg_not_uploaded_profile_image');
785
+		}
692 786
 
693 787
 		$this->insertProfileImage($member_srl, $file['tmp_name']);
694 788
 		// Page refresh
@@ -710,26 +804,35 @@  discard block
 block discarded – undo
710 804
 	{
711 805
 
712 806
 		// Check uploaded file
713
-		if(!checkUploadedFile($target_file)) return;
807
+		if(!checkUploadedFile($target_file)) {
808
+			return;
809
+		}
714 810
 
715 811
 		$oMemberModel = getModel('member');
716 812
 		$config = $oMemberModel->getMemberConfig();
717 813
 
718 814
 		// Get an image size
719 815
 		$max_width = $config->profile_image_max_width;
720
-		if(!$max_width) $max_width = "90";
816
+		if(!$max_width) {
817
+			$max_width = "90";
818
+		}
721 819
 		$max_height = $config->profile_image_max_height;
722
-		if(!$max_height) $max_height = "90";
820
+		if(!$max_height) {
821
+			$max_height = "90";
822
+		}
723 823
 		// Get a target path to save
724 824
 		$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
725 825
 		FileHandler::makeDir($target_path);
726 826
 
727 827
 		// Get file information
728 828
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
729
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
730
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
731
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
732
-		else
829
+		if(IMAGETYPE_PNG == $type) {
830
+			$ext = 'png';
831
+		} elseif(IMAGETYPE_JPEG == $type) {
832
+			$ext = 'jpg';
833
+		} elseif(IMAGETYPE_GIF == $type) {
834
+			$ext = 'gif';
835
+		} else
733 836
 		{
734 837
 			return;
735 838
 		}
@@ -741,8 +844,7 @@  discard block
 block discarded – undo
741 844
 		if(($width > $max_width || $height > $max_height ) && $type != 1)
742 845
 		{
743 846
 			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
744
-		}
745
-		else
847
+		} else
746 848
 		{
747 849
 			@copy($target_file, $target_filename);
748 850
 		}
@@ -757,17 +859,25 @@  discard block
 block discarded – undo
757 859
 	{
758 860
 		// Check if the file is successfully uploaded
759 861
 		$file = $_FILES['image_name'];
760
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
862
+		if(!is_uploaded_file($file['tmp_name'])) {
863
+			return $this->stop('msg_not_uploaded_image_name');
864
+		}
761 865
 		// Ignore if member_srl is invalid or doesn't exist.
762 866
 		$member_srl = Context::get('member_srl');
763
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
867
+		if(!$member_srl) {
868
+			return $this->stop('msg_not_uploaded_image_name');
869
+		}
764 870
 
765 871
 		$logged_info = Context::get('logged_info');
766
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
872
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
873
+			return $this->stop('msg_not_uploaded_image_name');
874
+		}
767 875
 		// Return if member module is set not to use an image name or the user is not an administrator ;
768 876
 		$oModuleModel = getModel('module');
769 877
 		$config = $oModuleModel->getModuleConfig('member');
770
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
878
+		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') {
879
+			return $this->stop('msg_not_uploaded_image_name');
880
+		}
771 881
 
772 882
 		$this->insertImageName($member_srl, $file['tmp_name']);
773 883
 		// Page refresh
@@ -788,15 +898,21 @@  discard block
 block discarded – undo
788 898
 	function insertImageName($member_srl, $target_file)
789 899
 	{
790 900
 		// Check uploaded file
791
-		if(!checkUploadedFile($target_file)) return;
901
+		if(!checkUploadedFile($target_file)) {
902
+			return;
903
+		}
792 904
 
793 905
 		$oModuleModel = getModel('module');
794 906
 		$config = $oModuleModel->getModuleConfig('member');
795 907
 		// Get an image size
796 908
 		$max_width = $config->image_name_max_width;
797
-		if(!$max_width) $max_width = "90";
909
+		if(!$max_width) {
910
+			$max_width = "90";
911
+		}
798 912
 		$max_height = $config->image_name_max_height;
799
-		if(!$max_height) $max_height = "20";
913
+		if(!$max_height) {
914
+			$max_height = "20";
915
+		}
800 916
 		// Get a target path to save
801 917
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
802 918
 		FileHandler::makeDir($target_path);
@@ -805,8 +921,11 @@  discard block
 block discarded – undo
805 921
 		// Get file information
806 922
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
807 923
 		// Convert if the image size is larger than a given size or if the format is not a gif
808
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
809
-		else @copy($target_file, $target_filename);
924
+		if($width > $max_width || $height > $max_height || $type!=1) {
925
+			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
926
+		} else {
927
+			@copy($target_file, $target_filename);
928
+		}
810 929
 	}
811 930
 
812 931
 	/**
@@ -866,17 +985,25 @@  discard block
 block discarded – undo
866 985
 	{
867 986
 		// Check if the file is successfully uploaded
868 987
 		$file = $_FILES['image_mark'];
869
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
988
+		if(!is_uploaded_file($file['tmp_name'])) {
989
+			return $this->stop('msg_not_uploaded_image_mark');
990
+		}
870 991
 		// Ignore if member_srl is invalid or doesn't exist.
871 992
 		$member_srl = Context::get('member_srl');
872
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
993
+		if(!$member_srl) {
994
+			return $this->stop('msg_not_uploaded_image_mark');
995
+		}
873 996
 
874 997
 		$logged_info = Context::get('logged_info');
875
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
998
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
999
+			return $this->stop('msg_not_uploaded_image_mark');
1000
+		}
876 1001
 		// Membership in the images mark the module using the ban was set by an administrator or return;
877 1002
 		$oModuleModel = getModel('module');
878 1003
 		$config = $oModuleModel->getModuleConfig('member');
879
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
1004
+		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') {
1005
+			return $this->stop('msg_not_uploaded_image_mark');
1006
+		}
880 1007
 
881 1008
 		$this->insertImageMark($member_srl, $file['tmp_name']);
882 1009
 		// Page refresh
@@ -897,15 +1024,21 @@  discard block
 block discarded – undo
897 1024
 	function insertImageMark($member_srl, $target_file)
898 1025
 	{
899 1026
 		// Check uploaded file
900
-		if(!checkUploadedFile($target_file)) return;
1027
+		if(!checkUploadedFile($target_file)) {
1028
+			return;
1029
+		}
901 1030
 
902 1031
 		$oModuleModel = getModel('module');
903 1032
 		$config = $oModuleModel->getModuleConfig('member');
904 1033
 		// Get an image size
905 1034
 		$max_width = $config->image_mark_max_width;
906
-		if(!$max_width) $max_width = "20";
1035
+		if(!$max_width) {
1036
+			$max_width = "20";
1037
+		}
907 1038
 		$max_height = $config->image_mark_max_height;
908
-		if(!$max_height) $max_height = "20";
1039
+		if(!$max_height) {
1040
+			$max_height = "20";
1041
+		}
909 1042
 
910 1043
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
911 1044
 		FileHandler::makeDir($target_path);
@@ -914,8 +1047,11 @@  discard block
 block discarded – undo
914 1047
 		// Get file information
915 1048
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
916 1049
 
917
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
918
-		else @copy($target_file, $target_filename);
1050
+		if($width > $max_width || $height > $max_height || $type!=1) {
1051
+			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
1052
+		} else {
1053
+			@copy($target_file, $target_filename);
1054
+		}
919 1055
 	}
920 1056
 
921 1057
 	/**
@@ -950,14 +1086,18 @@  discard block
 block discarded – undo
950 1086
 	function procMemberFindAccount()
951 1087
 	{
952 1088
 		$email_address = Context::get('email_address');
953
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1089
+		if(!$email_address) {
1090
+			return new Object(-1, 'msg_invalid_request');
1091
+		}
954 1092
 
955 1093
 		$oMemberModel = getModel('member');
956 1094
 		$oModuleModel = getModel('module');
957 1095
 
958 1096
 		// Check if a member having the same email address exists
959 1097
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
960
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1098
+		if(!$member_srl) {
1099
+			return new Object(-1, 'msg_email_not_exists');
1100
+		}
961 1101
 
962 1102
 		// Get information of the member
963 1103
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
@@ -969,7 +1109,9 @@  discard block
 block discarded – undo
969 1109
 			$chk_args = new stdClass;
970 1110
 			$chk_args->member_srl = $member_info->member_srl;
971 1111
 			$output = executeQuery('member.chkAuthMail', $chk_args);
972
-			if($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
1112
+			if($output->toBool() && $output->data->count != '0') {
1113
+				return new Object(-1, 'msg_user_not_confirmed');
1114
+			}
973 1115
 		}
974 1116
 
975 1117
 		// Insert data into the authentication DB
@@ -982,7 +1124,9 @@  discard block
 block discarded – undo
982 1124
 		$args->is_register = 'N';
983 1125
 
984 1126
 		$output = executeQuery('member.insertAuthMail', $args);
985
-		if(!$output->toBool()) return $output;
1127
+		if(!$output->toBool()) {
1128
+			return $output;
1129
+		}
986 1130
 		// Get content of the email to send a member
987 1131
 		Context::set('auth_args', $args);
988 1132
 
@@ -999,8 +1143,7 @@  discard block
 block discarded – undo
999 1143
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1000 1144
 				}
1001 1145
 			}
1002
-		}
1003
-		else
1146
+		} else
1004 1147
 		{
1005 1148
 			$memberInfo[$lang->user_id] = $args->user_id;
1006 1149
 			$memberInfo[$lang->user_name] = $args->user_name;
@@ -1009,13 +1152,19 @@  discard block
 block discarded – undo
1009 1152
 		}
1010 1153
 		Context::set('memberInfo', $memberInfo);
1011 1154
 
1012
-		if(!$member_config->skin) $member_config->skin = "default";
1013
-		if(!$member_config->colorset) $member_config->colorset = "white";
1155
+		if(!$member_config->skin) {
1156
+			$member_config->skin = "default";
1157
+		}
1158
+		if(!$member_config->colorset) {
1159
+			$member_config->colorset = "white";
1160
+		}
1014 1161
 
1015 1162
 		Context::set('member_config', $member_config);
1016 1163
 
1017 1164
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1018
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1165
+		if(!is_dir($tpl_path)) {
1166
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1167
+		}
1019 1168
 
1020 1169
 		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1021 1170
 		Context::set('find_url', $find_url);
@@ -1057,20 +1206,28 @@  discard block
 block discarded – undo
1057 1206
 		$find_account_question = trim(Context::get('find_account_question'));
1058 1207
 		$find_account_answer = trim(Context::get('find_account_answer'));
1059 1208
 
1060
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1209
+		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) {
1210
+			return new Object(-1, 'msg_invalid_request');
1211
+		}
1061 1212
 
1062 1213
 		$oModuleModel = getModel('module');
1063 1214
 		// Check if a member having the same email address exists
1064 1215
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1065
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1216
+		if(!$member_srl) {
1217
+			return new Object(-1, 'msg_email_not_exists');
1218
+		}
1066 1219
 		// Get information of the member
1067 1220
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1068 1221
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1069 1222
 
1070 1223
 		// Display a message if no answer is entered
1071
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1224
+		if(!$member_info->find_account_question || !$member_info->find_account_answer) {
1225
+			return new Object(-1, 'msg_question_not_exists');
1226
+		}
1072 1227
 
1073
-		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');
1228
+		if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) {
1229
+			return new Object(-1, 'msg_answer_not_matches');
1230
+		}
1074 1231
 
1075 1232
 		if($config->identifier == 'email_address')
1076 1233
 		{
@@ -1086,7 +1243,9 @@  discard block
 block discarded – undo
1086 1243
 		$args->password = $temp_password;
1087 1244
 		$args->change_password_date = '1';
1088 1245
 		$output = $this->updateMemberPassword($args);
1089
-		if(!$output->toBool()) return $output;
1246
+		if(!$output->toBool()) {
1247
+			return $output;
1248
+		}
1090 1249
 
1091 1250
 		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1092 1251
 
@@ -1143,8 +1302,7 @@  discard block
 block discarded – undo
1143 1302
 		if($output->data->is_register == 'Y')
1144 1303
 		{
1145 1304
 			$args->denied = 'N';
1146
-		}
1147
-		else
1305
+		} else
1148 1306
 		{
1149 1307
 			$args->password = $oMemberModel->hashPassword($args->password);
1150 1308
 		}
@@ -1178,33 +1336,45 @@  discard block
 block discarded – undo
1178 1336
 	{
1179 1337
 		// Get an email_address
1180 1338
 		$email_address = Context::get('email_address');
1181
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1339
+		if(!$email_address) {
1340
+			return new Object(-1, 'msg_invalid_request');
1341
+		}
1182 1342
 		// Log test by using email_address
1183 1343
 		$oMemberModel = getModel('member');
1184 1344
 
1185 1345
 		$args = new stdClass;
1186 1346
 		$args->email_address = $email_address;
1187 1347
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1188
-		if(!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1348
+		if(!$memberSrl) {
1349
+			return new Object(-1, 'msg_not_exists_member');
1350
+		}
1189 1351
 
1190 1352
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1191 1353
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1192 1354
 
1193 1355
 		$oModuleModel = getModel('module');
1194 1356
 		$member_config = $oModuleModel->getModuleConfig('member');
1195
-		if(!$member_config->skin) $member_config->skin = "default";
1196
-		if(!$member_config->colorset) $member_config->colorset = "white";
1357
+		if(!$member_config->skin) {
1358
+			$member_config->skin = "default";
1359
+		}
1360
+		if(!$member_config->colorset) {
1361
+			$member_config->colorset = "white";
1362
+		}
1197 1363
 
1198 1364
 		// Check if a authentication mail has been sent previously
1199 1365
 		$chk_args = new stdClass;
1200 1366
 		$chk_args->member_srl = $member_info->member_srl;
1201 1367
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1202
-		if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1368
+		if($output->toBool() && $output->data->count == '0') {
1369
+			return new Object(-1, 'msg_invalid_request');
1370
+		}
1203 1371
 
1204 1372
 		$auth_args = new stdClass;
1205 1373
 		$auth_args->member_srl = $member_info->member_srl;
1206 1374
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1207
-		if(!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1375
+		if(!$output->data || !$output->data[0]->auth_key) {
1376
+			return new Object(-1, 'msg_invalid_request');
1377
+		}
1208 1378
 		$auth_info = $output->data[0];
1209 1379
 
1210 1380
 		// Update the regdate of authmail entry
@@ -1225,8 +1395,7 @@  discard block
 block discarded – undo
1225 1395
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1226 1396
 				}
1227 1397
 			}
1228
-		}
1229
-		else
1398
+		} else
1230 1399
 		{
1231 1400
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1232 1401
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1239,7 +1408,9 @@  discard block
 block discarded – undo
1239 1408
 		Context::set('member_config', $member_config);
1240 1409
 
1241 1410
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1242
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1411
+		if(!is_dir($tpl_path)) {
1412
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1413
+		}
1243 1414
 
1244 1415
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1245 1416
 		Context::set('auth_url', $auth_url);
@@ -1317,7 +1488,9 @@  discard block
 block discarded – undo
1317 1488
 		$auth_args->is_register = 'Y';
1318 1489
 
1319 1490
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1320
-		if(!$output->toBool()) return $output;
1491
+		if(!$output->toBool()) {
1492
+			return $output;
1493
+		}
1321 1494
 
1322 1495
 		$memberInfo->email_address = $newEmail;
1323 1496
 
@@ -1351,8 +1524,7 @@  discard block
 block discarded – undo
1351 1524
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1352 1525
 				}
1353 1526
 			}
1354
-		}
1355
-		else
1527
+		} else
1356 1528
 		{
1357 1529
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1358 1530
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1361,13 +1533,19 @@  discard block
 block discarded – undo
1361 1533
 		}
1362 1534
 		Context::set('memberInfo', $memberInfo);
1363 1535
 
1364
-		if(!$member_config->skin) $member_config->skin = "default";
1365
-		if(!$member_config->colorset) $member_config->colorset = "white";
1536
+		if(!$member_config->skin) {
1537
+			$member_config->skin = "default";
1538
+		}
1539
+		if(!$member_config->colorset) {
1540
+			$member_config->colorset = "white";
1541
+		}
1366 1542
 
1367 1543
 		Context::set('member_config', $member_config);
1368 1544
 
1369 1545
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1370
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1546
+		if(!is_dir($tpl_path)) {
1547
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1548
+		}
1371 1549
 
1372 1550
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1373 1551
 		Context::set('auth_url', $auth_url);
@@ -1392,7 +1570,9 @@  discard block
 block discarded – undo
1392 1570
 	{
1393 1571
 		$site_module_info = Context::get('site_module_info');
1394 1572
 		$logged_info = Context::get('logged_info');
1395
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1573
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1574
+			return new Object(-1,'msg_invalid_request');
1575
+		}
1396 1576
 
1397 1577
 		$oMemberModel = getModel('member');
1398 1578
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1411,13 +1591,17 @@  discard block
 block discarded – undo
1411 1591
 	{
1412 1592
 		$site_module_info = Context::get('site_module_info');
1413 1593
 		$logged_info = Context::get('logged_info');
1414
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1594
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1595
+			return new Object(-1,'msg_invalid_request');
1596
+		}
1415 1597
 
1416 1598
 		$args = new stdClass;
1417 1599
 		$args->site_srl= $site_module_info->site_srl;
1418 1600
 		$args->member_srl = $logged_info->member_srl;
1419 1601
 		$output = executeQuery('member.deleteMembersGroup', $args);
1420
-		if(!$output->toBool()) return $output;
1602
+		if(!$output->toBool()) {
1603
+			return $output;
1604
+		}
1421 1605
 		$this->setMessage('success_deleted');
1422 1606
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1423 1607
 	}
@@ -1431,17 +1615,37 @@  discard block
 block discarded – undo
1431 1615
 	 */
1432 1616
 	function setMemberConfig($args)
1433 1617
 	{
1434
-		if(!$args->skin) $args->skin = "default";
1435
-		if(!$args->colorset) $args->colorset = "white";
1436
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1437
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1438
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1618
+		if(!$args->skin) {
1619
+			$args->skin = "default";
1620
+		}
1621
+		if(!$args->colorset) {
1622
+			$args->colorset = "white";
1623
+		}
1624
+		if(!$args->editor_skin) {
1625
+			$args->editor_skin= "ckeditor";
1626
+		}
1627
+		if(!$args->editor_colorset) {
1628
+			$args->editor_colorset = "moono";
1629
+		}
1630
+		if($args->enable_join!='Y') {
1631
+			$args->enable_join = 'N';
1632
+		}
1439 1633
 		$args->enable_openid= 'N';
1440
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1441
-		if($args->image_name!='Y') $args->image_name = 'N';
1442
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1443
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1444
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1634
+		if($args->profile_image !='Y') {
1635
+			$args->profile_image = 'N';
1636
+		}
1637
+		if($args->image_name!='Y') {
1638
+			$args->image_name = 'N';
1639
+		}
1640
+		if($args->image_mark!='Y') {
1641
+			$args->image_mark = 'N';
1642
+		}
1643
+		if($args->group_image_mark!='Y') {
1644
+			$args->group_image_mark = 'N';
1645
+		}
1646
+		if(!trim(strip_tags($args->agreement))) {
1647
+			$args->agreement = null;
1648
+		}
1445 1649
 		$args->limit_day = (int)$args->limit_day;
1446 1650
 
1447 1651
 		$agreement = trim($args->agreement);
@@ -1449,7 +1653,9 @@  discard block
 block discarded – undo
1449 1653
 
1450 1654
 		$oModuleController = getController('module');
1451 1655
 		$output = $oModuleController->insertModuleConfig('member',$args);
1452
-		if(!$output->toBool()) return $output;
1656
+		if(!$output->toBool()) {
1657
+			return $output;
1658
+		}
1453 1659
 
1454 1660
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1455 1661
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1474,7 +1680,9 @@  discard block
 block discarded – undo
1474 1680
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1475 1681
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1476 1682
 
1477
-		if(!$check_signature) return FileHandler::removeFile($filename);
1683
+		if(!$check_signature) {
1684
+			return FileHandler::removeFile($filename);
1685
+		}
1478 1686
 
1479 1687
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1480 1688
 		FileHandler::makeDir($path);
@@ -1508,7 +1716,9 @@  discard block
 block discarded – undo
1508 1716
 		$args = new stdClass();
1509 1717
 		$args->member_srl = $member_srl;
1510 1718
 		$args->group_srl = $group_srl;
1511
-		if($site_srl) $args->site_srl = $site_srl;
1719
+		if($site_srl) {
1720
+			$args->site_srl = $site_srl;
1721
+		}
1512 1722
 
1513 1723
 		// Add
1514 1724
 		$output = executeQuery('member.addMemberToGroup',$args);
@@ -1534,15 +1744,21 @@  discard block
 block discarded – undo
1534 1744
 		$obj->member_srl = implode(',',$args->member_srl);
1535 1745
 
1536 1746
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1537
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1747
+		if($output->data) {
1748
+			foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1749
+		}
1538 1750
 
1539 1751
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1540
-		if(!$output->toBool()) return $output;
1752
+		if(!$output->toBool()) {
1753
+			return $output;
1754
+		}
1541 1755
 
1542 1756
 		$inserted_members = array();
1543 1757
 		foreach($args->member_srl as $key => $val)
1544 1758
 		{
1545
-			if($inserted_members[$val]) continue;
1759
+			if($inserted_members[$val]) {
1760
+				continue;
1761
+			}
1546 1762
 			$inserted_members[$val] = true;
1547 1763
 
1548 1764
 			unset($obj);
@@ -1552,7 +1768,9 @@  discard block
 block discarded – undo
1552 1768
 			$obj->site_srl = $args->site_srl;
1553 1769
 			$obj->regdate = $date[$obj->member_srl];
1554 1770
 			$output = executeQuery('member.addMemberToGroup', $obj);
1555
-			if(!$output->toBool()) return $output;
1771
+			if(!$output->toBool()) {
1772
+				return $output;
1773
+			}
1556 1774
 
1557 1775
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1558 1776
 		}
@@ -1614,8 +1832,7 @@  discard block
 block discarded – undo
1614 1832
 				if($config->identifier == 'user_id')
1615 1833
 				{
1616 1834
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1617
-				}
1618
-				else
1835
+				} else
1619 1836
 				{
1620 1837
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1621 1838
 				}
@@ -1624,8 +1841,7 @@  discard block
 block discarded – undo
1624 1841
 					$do_auto_login = true;
1625 1842
 				}
1626 1843
 
1627
-			}
1628
-			else
1844
+			} else
1629 1845
 			{
1630 1846
 				$do_auto_login = true;
1631 1847
 			}
@@ -1634,8 +1850,7 @@  discard block
 block discarded – undo
1634 1850
 		if($do_auto_login)
1635 1851
 		{
1636 1852
 			$output = $this->doLogin($user_id);
1637
-		}
1638
-		else
1853
+		} else
1639 1854
 		{
1640 1855
 			executeQuery('member.deleteAutologin', $args);
1641 1856
 			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/');
@@ -1654,13 +1869,17 @@  discard block
 block discarded – undo
1654 1869
 	function doLogin($user_id, $password = '', $keep_signed = false)
1655 1870
 	{
1656 1871
 		$user_id = strtolower($user_id);
1657
-		if(!$user_id) return new Object(-1, 'null_user_id');
1872
+		if(!$user_id) {
1873
+			return new Object(-1, 'null_user_id');
1874
+		}
1658 1875
 		// Call a trigger before log-in (before)
1659 1876
 		$trigger_obj = new stdClass();
1660 1877
 		$trigger_obj->user_id = $user_id;
1661 1878
 		$trigger_obj->password = $password;
1662 1879
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1663
-		if(!$trigger_output->toBool()) return $trigger_output;
1880
+		if(!$trigger_output->toBool()) {
1881
+			return $trigger_output;
1882
+		}
1664 1883
 		// Create a member model object
1665 1884
 		$oMemberModel = getModel('member');
1666 1885
 
@@ -1675,15 +1894,18 @@  discard block
 block discarded – undo
1675 1894
 			// Get user_id information
1676 1895
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1677 1896
 			// Set an invalid user if no value returned
1678
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1897
+			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) {
1898
+				return $this->recordLoginError(-1, 'invalid_email_address');
1899
+			}
1679 1900
 
1680
-		}
1681
-		else
1901
+		} else
1682 1902
 		{
1683 1903
 			// Get user_id information
1684 1904
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1685 1905
 			// Set an invalid user if no value returned
1686
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1906
+			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) {
1907
+				return $this->recordLoginError(-1, 'invalid_user_id');
1908
+			}
1687 1909
 		}
1688 1910
 
1689 1911
 		$output = executeQuery('member.getLoginCountByIp', $args);
@@ -1695,14 +1917,18 @@  discard block
 block discarded – undo
1695 1917
 			if($term < $config->max_error_count_time)
1696 1918
 			{
1697 1919
 				$term = $config->max_error_count_time - $term;
1698
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1699
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1700
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1701
-				else $term = intval($term/86400).Context::getLang('unit_day');
1920
+				if($term < 60) {
1921
+					$term = intval($term).Context::getLang('unit_sec');
1922
+				} elseif(60 <= $term && $term < 3600) {
1923
+					$term = intval($term/60).Context::getLang('unit_min');
1924
+				} elseif(3600 <= $term && $term < 86400) {
1925
+					$term = intval($term/3600).Context::getLang('unit_hour');
1926
+				} else {
1927
+					$term = intval($term/86400).Context::getLang('unit_day');
1928
+				}
1702 1929
 
1703 1930
 				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1704
-			}
1705
-			else
1931
+			} else
1706 1932
 			{
1707 1933
 				$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1708 1934
 				$output = executeQuery('member.deleteLoginCountByIp', $args);
@@ -1729,7 +1955,9 @@  discard block
 block discarded – undo
1729 1955
 			return new Object(-1,'msg_user_denied');
1730 1956
 		}
1731 1957
 		// Notify if denied_date is less than the current time
1732
-		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")));
1958
+		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) {
1959
+			return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
1960
+		}
1733 1961
 		// Update the latest login time
1734 1962
 		$args->member_srl = $this->memberInfo->member_srl;
1735 1963
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1778,7 +2006,9 @@  discard block
 block discarded – undo
1778 2006
 		}
1779 2007
 		// Call a trigger after successfully log-in (after)
1780 2008
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1781
-		if(!$trigger_output->toBool()) return $trigger_output;
2009
+		if(!$trigger_output->toBool()) {
2010
+			return $trigger_output;
2011
+		}
1782 2012
 		// When user checked to use auto-login
1783 2013
 		if($keep_signed)
1784 2014
 		{
@@ -1792,7 +2022,9 @@  discard block
 block discarded – undo
1792 2022
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1793 2023
 			executeQuery('member.deleteAutologin', $autologin_args);
1794 2024
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1795
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000, '/');
2025
+			if($autologin_output->toBool()) {
2026
+				setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000, '/');
2027
+			}
1796 2028
 		}
1797 2029
 		if($this->memberInfo->is_admin == 'Y')
1798 2030
 		{
@@ -1881,7 +2113,9 @@  discard block
 block discarded – undo
1881 2113
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
1882 2114
 	{
1883 2115
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
1884
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
2116
+		if(!is_array($member_popup_menu_list)) {
2117
+			$member_popup_menu_list = array();
2118
+		}
1885 2119
 
1886 2120
 		$obj = new stdClass;
1887 2121
 		$obj->url = $url;
@@ -1900,35 +2134,52 @@  discard block
 block discarded – undo
1900 2134
 	{
1901 2135
 		// Call a trigger (before)
1902 2136
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
1903
-		if(!$output->toBool()) return $output;
2137
+		if(!$output->toBool()) {
2138
+			return $output;
2139
+		}
1904 2140
 		// Terms and Conditions portion of the information set up by members reaffirmed
1905 2141
 		$oModuleModel = getModel('module');
1906 2142
 		$config = $oModuleModel->getModuleConfig('member');
1907 2143
 
1908 2144
 		$logged_info = Context::get('logged_info');
1909 2145
 		// If the date of the temporary restrictions limit further information on the date of
1910
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2146
+		if($config->limit_day) {
2147
+			$args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2148
+		}
1911 2149
 
1912 2150
 		$args->member_srl = getNextSequence();
1913 2151
 		$args->list_order = -1 * $args->member_srl;
1914 2152
 
1915 2153
 		// Execute insert or update depending on the value of member_srl
1916
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2154
+		if(!$args->user_id) {
2155
+			$args->user_id = 't'.$args->member_srl;
2156
+		}
1917 2157
 		// Enter the user's identity changed to lowercase
1918
-		else $args->user_id = strtolower($args->user_id);
1919
-		if(!$args->user_name) $args->user_name = $args->member_srl;
1920
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
2158
+		else {
2159
+			$args->user_id = strtolower($args->user_id);
2160
+		}
2161
+		if(!$args->user_name) {
2162
+			$args->user_name = $args->member_srl;
2163
+		}
2164
+		if(!$args->nick_name) {
2165
+			$args->nick_name = $args->member_srl;
2166
+		}
1921 2167
 
1922 2168
 		// Control of essential parameters
1923
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
1924
-		if($args->denied!='Y') $args->denied = 'N';
2169
+		if($args->allow_mailing!='Y') {
2170
+			$args->allow_mailing = 'N';
2171
+		}
2172
+		if($args->denied!='Y') {
2173
+			$args->denied = 'N';
2174
+		}
1925 2175
 		$args->allow_message= 'Y';
1926 2176
 
1927 2177
 		if($logged_info->is_admin == 'Y')
1928 2178
 		{
1929
-			if($args->is_admin!='Y') $args->is_admin = 'N';
1930
-		}
1931
-		else
2179
+			if($args->is_admin!='Y') {
2180
+				$args->is_admin = 'N';
2181
+			}
2182
+		} else
1932 2183
 		{
1933 2184
 			unset($args->is_admin);
1934 2185
 		}
@@ -1941,8 +2192,12 @@  discard block
 block discarded – undo
1941 2192
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1942 2193
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1943 2194
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1944
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
1945
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
2195
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) {
2196
+			$args->homepage = 'http://'.$args->homepage;
2197
+		}
2198
+		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) {
2199
+			$args->blog = 'http://'.$args->blog;
2200
+		}
1946 2201
 
1947 2202
 		// Create a model object
1948 2203
 		$oMemberModel = getModel('member');
@@ -1956,8 +2211,7 @@  discard block
 block discarded – undo
1956 2211
 				return new Object(-1, $message[$config->password_strength]);
1957 2212
 			}
1958 2213
 			$args->password = $oMemberModel->hashPassword($args->password);
1959
-		}
1960
-		elseif(!$args->password)
2214
+		} elseif(!$args->password)
1961 2215
 		{
1962 2216
 			unset($args->password);
1963 2217
 		}
@@ -1998,8 +2252,12 @@  discard block
 block discarded – undo
1998 2252
 		// Insert data into the DB
1999 2253
 		$args->list_order = -1 * $args->member_srl;
2000 2254
 
2001
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2002
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2255
+		if(!$args->user_id) {
2256
+			$args->user_id = 't'.$args->member_srl;
2257
+		}
2258
+		if(!$args->user_name) {
2259
+			$args->user_name = $args->member_srl;
2260
+		}
2003 2261
 
2004 2262
 		$oDB = &DB::getInstance();
2005 2263
 		$oDB->begin();
@@ -2011,8 +2269,11 @@  discard block
 block discarded – undo
2011 2269
 			return $output;
2012 2270
 		}
2013 2271
 
2014
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2015
-		else $group_srl_list = explode('|@|', $args->group_srl_list);
2272
+		if(is_array($args->group_srl_list)) {
2273
+			$group_srl_list = $args->group_srl_list;
2274
+		} else {
2275
+			$group_srl_list = explode('|@|', $args->group_srl_list);
2276
+		}
2016 2277
 		// If no value is entered the default group, the value of group registration
2017 2278
 		if(!$args->group_srl_list)
2018 2279
 		{
@@ -2029,8 +2290,7 @@  discard block
 block discarded – undo
2029 2290
 				}
2030 2291
 			}
2031 2292
 			// If the value is the value of the group entered the group registration
2032
-		}
2033
-		else
2293
+		} else
2034 2294
 		{
2035 2295
 			for($i=0;$i<count($group_srl_list);$i++)
2036 2296
 			{
@@ -2091,27 +2351,39 @@  discard block
 block discarded – undo
2091 2351
 	{
2092 2352
 		// Call a trigger (before)
2093 2353
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2094
-		if(!$output->toBool()) return $output;
2354
+		if(!$output->toBool()) {
2355
+			return $output;
2356
+		}
2095 2357
 		// Create a model object
2096 2358
 		$oMemberModel = getModel('member');
2097 2359
 
2098 2360
 		$logged_info = Context::get('logged_info');
2099 2361
 		// Get what you want to modify the original information
2100
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2362
+		if(!$this->memberInfo) {
2363
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2364
+		}
2101 2365
 		// Control of essential parameters
2102
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2103
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2366
+		if($args->allow_mailing!='Y') {
2367
+			$args->allow_mailing = 'N';
2368
+		}
2369
+		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) {
2370
+			$args->allow_message = 'Y';
2371
+		}
2104 2372
 
2105 2373
 		if($logged_info->is_admin == 'Y')
2106 2374
 		{
2107
-			if($args->denied!='Y') $args->denied = 'N';
2108
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2109
-		}
2110
-		else
2375
+			if($args->denied!='Y') {
2376
+				$args->denied = 'N';
2377
+			}
2378
+			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) {
2379
+				$args->is_admin = 'N';
2380
+			}
2381
+		} else
2111 2382
 		{
2112 2383
 			unset($args->is_admin);
2113
-			if($is_admin == false)
2114
-				unset($args->denied);
2384
+			if($is_admin == false) {
2385
+							unset($args->denied);
2386
+			}
2115 2387
 			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2116 2388
 			{
2117 2389
 				return $this->stop('msg_invalid_request');
@@ -2119,13 +2391,19 @@  discard block
 block discarded – undo
2119 2391
 		}
2120 2392
 
2121 2393
 		// Sanitize user ID, username, nickname, homepage, blog
2122
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2394
+		if($args->user_id) {
2395
+			$args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2396
+		}
2123 2397
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2124 2398
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2125 2399
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2126 2400
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2127
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2128
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2401
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) {
2402
+			$args->homepage = 'http://'.$args->homepage;
2403
+		}
2404
+		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) {
2405
+			$args->blog = 'http://'.$args->blog;
2406
+		}
2129 2407
 
2130 2408
 		// check member identifier form
2131 2409
 		$config = $oMemberModel->getMemberConfig();
@@ -2142,8 +2420,7 @@  discard block
 block discarded – undo
2142 2420
 				return new Object(-1,'msg_exists_email_address');
2143 2421
 			}
2144 2422
 			$args->email_address = $orgMemberInfo->email_address;
2145
-		}
2146
-		else
2423
+		} else
2147 2424
 		{
2148 2425
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2149 2426
 			if($member_srl && $args->member_srl != $member_srl)
@@ -2197,17 +2474,26 @@  discard block
 block discarded – undo
2197 2474
 				return new Object(-1, $message[$config->password_strength]);
2198 2475
 			}
2199 2476
 			$args->password = $oMemberModel->hashPassword($args->password);
2200
-		}
2201
-		else
2477
+		} else
2202 2478
 		{
2203 2479
 			$args->password = $orgMemberInfo->password;
2204 2480
 		}
2205 2481
 		
2206
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2207
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2208
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2209
-		if(!$args->description) $args->description = '';
2210
-		if(!$args->birthday) $args->birthday = '';
2482
+		if(!$args->user_name) {
2483
+			$args->user_name = $orgMemberInfo->user_name;
2484
+		}
2485
+		if(!$args->user_id) {
2486
+			$args->user_id = $orgMemberInfo->user_id;
2487
+		}
2488
+		if(!$args->nick_name) {
2489
+			$args->nick_name = $orgMemberInfo->nick_name;
2490
+		}
2491
+		if(!$args->description) {
2492
+			$args->description = '';
2493
+		}
2494
+		if(!$args->birthday) {
2495
+			$args->birthday = '';
2496
+		}
2211 2497
 
2212 2498
 		$output = executeQuery('member.updateMember', $args);
2213 2499
 
@@ -2219,8 +2505,11 @@  discard block
 block discarded – undo
2219 2505
 
2220 2506
 		if($args->group_srl_list)
2221 2507
 		{
2222
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2223
-			else $group_srl_list = explode('|@|', $args->group_srl_list);
2508
+			if(is_array($args->group_srl_list)) {
2509
+				$group_srl_list = $args->group_srl_list;
2510
+			} else {
2511
+				$group_srl_list = explode('|@|', $args->group_srl_list);
2512
+			}
2224 2513
 			// If the group information, group information changes
2225 2514
 			if(count($group_srl_list) > 0)
2226 2515
 			{
@@ -2263,7 +2552,9 @@  discard block
 block discarded – undo
2263 2552
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2264 2553
 
2265 2554
 		// Save Session
2266
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2555
+		if(!$this->memberInfo) {
2556
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2557
+		}
2267 2558
 		$logged_info = Context::get('logged_info');
2268 2559
 
2269 2560
 		$output->add('member_srl', $args->member_srl);
@@ -2289,8 +2580,7 @@  discard block
 block discarded – undo
2289 2580
 			}
2290 2581
 
2291 2582
 			$args->password = $oMemberModel->hashPassword($args->password);
2292
-		}
2293
-		else if($args->hashed_password)
2583
+		} else if($args->hashed_password)
2294 2584
 		{
2295 2585
 			$args->password = $args->hashed_password;
2296 2586
 		}
@@ -2315,7 +2605,9 @@  discard block
 block discarded – undo
2315 2605
 		$trigger_obj = new stdClass();
2316 2606
 		$trigger_obj->member_srl = $member_srl;
2317 2607
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2318
-		if(!$output->toBool()) return $output;
2608
+		if(!$output->toBool()) {
2609
+			return $output;
2610
+		}
2319 2611
 		// Create a model object
2320 2612
 		$oMemberModel = getModel('member');
2321 2613
 		// Bringing the user's information
@@ -2324,9 +2616,13 @@  discard block
 block discarded – undo
2324 2616
 			$columnList = array('member_srl', 'is_admin');
2325 2617
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2326 2618
 		}
2327
-		if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2619
+		if(!$this->memberInfo) {
2620
+			return new Object(-1, 'msg_not_exists_member');
2621
+		}
2328 2622
 		// If managers can not be deleted
2329
-		if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2623
+		if($this->memberInfo->is_admin == 'Y') {
2624
+			return new Object(-1, 'msg_cannot_delete_admin');
2625
+		}
2330 2626
 
2331 2627
 		$oDB = &DB::getInstance();
2332 2628
 		$oDB->begin();
@@ -2390,7 +2686,9 @@  discard block
 block discarded – undo
2390 2686
 	 */
2391 2687
 	function destroySessionInfo()
2392 2688
 	{
2393
-		if(!$_SESSION || !is_array($_SESSION)) return;
2689
+		if(!$_SESSION || !is_array($_SESSION)) {
2690
+			return;
2691
+		}
2394 2692
 
2395 2693
 		$memberInfo = Context::get('logged_info');
2396 2694
 		$memberSrl = $memberInfo->member_srl;
@@ -2429,8 +2727,9 @@  discard block
 block discarded – undo
2429 2727
 		}
2430 2728
 		$maxLevel = 0;
2431 2729
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2432
-		if(count($resultGroup) > 0)
2433
-			$maxLevel = max(array_flip($resultGroup));
2730
+		if(count($resultGroup) > 0) {
2731
+					$maxLevel = max(array_flip($resultGroup));
2732
+		}
2434 2733
 
2435 2734
 		if($maxLevel > 0)
2436 2735
 		{
@@ -2447,16 +2746,22 @@  discard block
 block discarded – undo
2447 2746
 
2448 2747
 	function procMemberModifyEmailAddress()
2449 2748
 	{
2450
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2749
+		if(!Context::get('is_logged')) {
2750
+			return $this->stop('msg_not_logged');
2751
+		}
2451 2752
 
2452 2753
 		$member_info = Context::get('logged_info');
2453 2754
 		$newEmail = Context::get('email_address');
2454 2755
 
2455
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2756
+		if(!$newEmail) {
2757
+			return $this->stop('msg_invalid_request');
2758
+		}
2456 2759
 
2457 2760
 		$oMemberModel = getModel('member');
2458 2761
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2459
-		if($member_srl) return new Object(-1,'msg_exists_email_address');
2762
+		if($member_srl) {
2763
+			return new Object(-1,'msg_exists_email_address');
2764
+		}
2460 2765
 
2461 2766
 		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2462 2767
 		{
@@ -2484,7 +2789,9 @@  discard block
 block discarded – undo
2484 2789
 		$member_config = $oModuleModel->getModuleConfig('member');
2485 2790
 
2486 2791
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2487
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2792
+		if(!is_dir($tpl_path)) {
2793
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2794
+		}
2488 2795
 
2489 2796
 		global $lang;
2490 2797
 
@@ -2520,7 +2827,9 @@  discard block
 block discarded – undo
2520 2827
 	{
2521 2828
 		$member_srl = Context::get('member_srl');
2522 2829
 		$auth_key = Context::get('auth_key');
2523
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2830
+		if(!$member_srl || !$auth_key) {
2831
+			return $this->stop('msg_invalid_request');
2832
+		}
2524 2833
 
2525 2834
 		// Test logs for finding password by user_id and authkey
2526 2835
 		$args = new stdClass;
@@ -2529,7 +2838,9 @@  discard block
 block discarded – undo
2529 2838
 		$output = executeQuery('member.getAuthMail', $args);
2530 2839
 		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2531 2840
 		{
2532
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2841
+			if(strlen($output->data->auth_key) !== strlen($auth_key)) {
2842
+				executeQuery('member.deleteAuthChangeEmailAddress', $args);
2843
+			}
2533 2844
 			return $this->stop('msg_invalid_modify_email_auth_key');
2534 2845
 		}
2535 2846
 
@@ -2538,7 +2849,9 @@  discard block
 block discarded – undo
2538 2849
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2539 2850
 
2540 2851
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2541
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2852
+		if(!$output->toBool()) {
2853
+			return $this->stop($output->getMessage());
2854
+		}
2542 2855
 
2543 2856
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2544 2857
 		executeQuery('member.deleteAuthChangeEmailAddress',$args);
@@ -2559,7 +2872,9 @@  discard block
 block discarded – undo
2559 2872
 	**/
2560 2873
 	function triggerGetDocumentMenu(&$menu_list)
2561 2874
 	{
2562
-		if(!Context::get('is_logged')) return new Object();
2875
+		if(!Context::get('is_logged')) {
2876
+			return new Object();
2877
+		}
2563 2878
 
2564 2879
 		$logged_info = Context::get('logged_info');
2565 2880
 		$document_srl = Context::get('target_srl');
@@ -2570,8 +2885,12 @@  discard block
 block discarded – undo
2570 2885
 		$member_srl = $oDocument->get('member_srl');
2571 2886
 		$module_srl = $oDocument->get('module_srl');
2572 2887
 
2573
-		if(!$member_srl) return new Object();
2574
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2888
+		if(!$member_srl) {
2889
+			return new Object();
2890
+		}
2891
+		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
2892
+			return new Object();
2893
+		}
2575 2894
 
2576 2895
 		$oDocumentController = getController('document');
2577 2896
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2589,7 +2908,9 @@  discard block
 block discarded – undo
2589 2908
 	**/
2590 2909
 	function triggerGetCommentMenu(&$menu_list)
2591 2910
 	{
2592
-		if(!Context::get('is_logged')) return new Object();
2911
+		if(!Context::get('is_logged')) {
2912
+			return new Object();
2913
+		}
2593 2914
 
2594 2915
 		$logged_info = Context::get('logged_info');
2595 2916
 		$comment_srl = Context::get('target_srl');
@@ -2600,8 +2921,12 @@  discard block
 block discarded – undo
2600 2921
 		$module_srl = $oComment->get('module_srl');
2601 2922
 		$member_srl = $oComment->get('member_srl');
2602 2923
 
2603
-		if(!$member_srl) return new Object();
2604
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2924
+		if(!$member_srl) {
2925
+			return new Object();
2926
+		}
2927
+		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
2928
+			return new Object();
2929
+		}
2605 2930
 
2606 2931
 		$oCommentController = getController('comment');
2607 2932
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2617,7 +2942,9 @@  discard block
 block discarded – undo
2617 2942
 	**/
2618 2943
 	function procMemberSpammerManage()
2619 2944
 	{
2620
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
2945
+		if(!Context::get('is_logged')) {
2946
+			return new Object(-1,'msg_not_permitted');
2947
+		}
2621 2948
 
2622 2949
 		$logged_info = Context::get('logged_info');
2623 2950
 		$member_srl = Context::get('member_srl');
@@ -2625,8 +2952,9 @@  discard block
 block discarded – undo
2625 2952
 		$cnt_loop = Context::get('cnt_loop');
2626 2953
 		$proc_type = Context::get('proc_type');
2627 2954
 		$isMoveToTrash = true;
2628
-		if($proc_type == "delete")
2629
-			$isMoveToTrash = false;
2955
+		if($proc_type == "delete") {
2956
+					$isMoveToTrash = false;
2957
+		}
2630 2958
 
2631 2959
 		// check grant
2632 2960
 		$oModuleModel = getModel('module');
@@ -2634,7 +2962,9 @@  discard block
 block discarded – undo
2634 2962
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2635 2963
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2636 2964
 
2637
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
2965
+		if(!$grant->manager) {
2966
+			return new Object(-1,'msg_not_permitted');
2967
+		}
2638 2968
 
2639 2969
 		$proc_msg = "";
2640 2970
 
@@ -2643,11 +2973,13 @@  discard block
 block discarded – undo
2643 2973
 
2644 2974
 		// delete or trash destination
2645 2975
 		// proc member
2646
-		if($cnt_loop == 1)
2647
-			$this->_spammerMember($member_srl);
2976
+		if($cnt_loop == 1) {
2977
+					$this->_spammerMember($member_srl);
2978
+		}
2648 2979
 		// proc document and comment
2649
-		elseif($cnt_loop>1)
2650
-			$this->_spammerDocuments($member_srl, $isMoveToTrash);
2980
+		elseif($cnt_loop>1) {
2981
+					$this->_spammerDocuments($member_srl, $isMoveToTrash);
2982
+		}
2651 2983
 
2652 2984
 		// get destination count
2653 2985
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
@@ -2655,13 +2987,16 @@  discard block
 block discarded – undo
2655 2987
 
2656 2988
 		$total_count = Context::get('total_count');
2657 2989
 		$remain_count = $cnt_document + $cnt_comment;
2658
-		if($cnt_loop == 1) $total_count = $remain_count;
2990
+		if($cnt_loop == 1) {
2991
+			$total_count = $remain_count;
2992
+		}
2659 2993
 
2660 2994
 		// get progress percent
2661
-		if($total_count > 0)
2662
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2663
-		else
2664
-			$progress = 100;
2995
+		if($total_count > 0) {
2996
+					$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2997
+		} else {
2998
+					$progress = 100;
2999
+		}
2665 3000
 
2666 3001
 		$this->add('total_count', $total_count);
2667 3002
 		$this->add('remain_count', $remain_count);
@@ -2703,7 +3038,10 @@  discard block
 block discarded – undo
2703 3038
 		$args->nick_name = $member_info->nick_name;
2704 3039
 		$args->denied = "Y";
2705 3040
 		$args->description = trim( $member_info->description );
2706
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
3041
+		if( $args->description != "" ) {
3042
+			$args->description .= "\n";
3043
+		}
3044
+		// add new line
2707 3045
 
2708 3046
 		$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 . "]";
2709 3047
 
@@ -2748,8 +3086,11 @@  discard block
 block discarded – undo
2748 3086
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2749 3087
 			if($documentList) {
2750 3088
 				foreach($documentList as $v) {
2751
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2752
-					else $oDocumentController->deleteDocument($v->document_srl);
3089
+					if($isMoveToTrash) {
3090
+						$oDocumentController->moveDocumentToTrash($v);
3091
+					} else {
3092
+						$oDocumentController->deleteDocument($v->document_srl);
3093
+					}
2753 3094
 				}
2754 3095
 			}
2755 3096
 		}
Please login to merge, or discard this patch.
modules/member/member.model.php 4 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.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 /**
4
- * @class  memberModel
5
- * @author NAVER ([email protected])
6
- * @brief Model class of the member module
7
- */
4
+	 * @class  memberModel
5
+	 * @author NAVER ([email protected])
6
+	 * @brief Model class of the member module
7
+	 */
8 8
 class memberModel extends member
9 9
 {
10 10
 	/**
Please login to merge, or discard this patch.
Spacing   +176 added lines, -176 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
-				$url = 'mailto:'.htmlspecialchars($member_info->email_address, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
155
-				$oMemberController->addMemberPopupMenu($url,'cmd_send_email',$icon_path);
154
+				$url = 'mailto:' . htmlspecialchars($member_info->email_address, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
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,15 +190,15 @@  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 199
 			else
200 200
 			{
201
-				if(ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8)
201
+				if (ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8)
202 202
 				{
203 203
 					return true;
204 204
 				}
@@ -215,23 +215,23 @@  discard block
 block discarded – undo
215 215
 	function getLoggedInfo()
216 216
 	{
217 217
 		// Return session info if session info is requested and the user is logged-in
218
-		if($this->isLogged())
218
+		if ($this->isLogged())
219 219
 		{
220 220
 			$logged_info = Context::get('logged_info');
221 221
 			// Admin/Group list defined depending on site_module_info
222 222
 			$site_module_info = Context::get('site_module_info');
223
-			if($site_module_info->site_srl)
223
+			if ($site_module_info->site_srl)
224 224
 			{
225 225
 				$logged_info->group_list = $this->getMemberGroups($logged_info->member_srl, $site_module_info->site_srl);
226 226
 				// Add is_site_admin bool variable into logged_info if site_administrator is
227 227
 				$oModuleModel = getModel('module');
228
-				if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true;
228
+				if ($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true;
229 229
 				else $logged_info->is_site_admin = false;
230 230
 			}
231 231
 			else
232 232
 			{
233 233
 				// Register a default group if the site doesn't have a member group
234
-				if(count($logged_info->group_list) === 0)
234
+				if (count($logged_info->group_list) === 0)
235 235
 				{
236 236
 					$default_group = $this->getDefaultGroup(0);
237 237
 					$oMemberController = getController('member');
@@ -254,13 +254,13 @@  discard block
 block discarded – undo
254 254
 	 */
255 255
 	function getMemberInfoByUserID($user_id, $columnList = array())
256 256
 	{
257
-		if(!$user_id) return;
257
+		if (!$user_id) return;
258 258
 
259 259
 		$args = new stdClass;
260 260
 		$args->user_id = $user_id;
261 261
 		$output = executeQuery('member.getMemberInfo', $args);
262
-		if(!$output->toBool()) return $output;
263
-		if(!$output->data) return;
262
+		if (!$output->toBool()) return $output;
263
+		if (!$output->data) return;
264 264
 
265 265
 		$member_info = $this->arrangeMemberInfo($output->data);
266 266
 
@@ -272,12 +272,12 @@  discard block
 block discarded – undo
272 272
 	 */
273 273
 	function getMemberInfoByEmailAddress($email_address)
274 274
 	{
275
-		if(!$email_address) return;
275
+		if (!$email_address) return;
276 276
 
277 277
 		$args = new stdClass();
278 278
 		
279
-		$db_info = Context::getDBInfo ();
280
-		if($db_info->master_db['db_type'] == "cubrid")
279
+		$db_info = Context::getDBInfo();
280
+		if ($db_info->master_db['db_type'] == "cubrid")
281 281
 		{
282 282
 			$args->email_address = strtolower($email_address);
283 283
 			$output = executeQuery('member.getMemberInfoByEmailAddressForCubrid', $args);
@@ -288,8 +288,8 @@  discard block
 block discarded – undo
288 288
 			$output = executeQuery('member.getMemberInfoByEmailAddress', $args);
289 289
 		}
290 290
 		
291
-		if(!$output->toBool()) return $output;
292
-		if(!$output->data) return;
291
+		if (!$output->toBool()) return $output;
292
+		if (!$output->data) return;
293 293
 
294 294
 		$member_info = $this->arrangeMemberInfo($output->data);
295 295
 		return $member_info;
@@ -300,15 +300,15 @@  discard block
 block discarded – undo
300 300
 	 */
301 301
 	function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array())
302 302
 	{
303
-		if(!$member_srl) return;
303
+		if (!$member_srl) return;
304 304
 
305 305
 		//columnList size zero... get full member info
306
-		if(!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0)
306
+		if (!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0)
307 307
 		{
308 308
 			$GLOBALS['__member_info__'][$member_srl] = false;
309 309
 
310 310
 			$oCacheHandler = CacheHandler::getInstance('object');
311
-			if($oCacheHandler->isSupport())
311
+			if ($oCacheHandler->isSupport())
312 312
 			{
313 313
 				$columnList = array();
314 314
 				$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
@@ -316,20 +316,20 @@  discard block
 block discarded – undo
316 316
 				$GLOBALS['__member_info__'][$member_srl] = $oCacheHandler->get($cache_key);
317 317
 			}
318 318
 
319
-			if($GLOBALS['__member_info__'][$member_srl] === false)
319
+			if ($GLOBALS['__member_info__'][$member_srl] === false)
320 320
 			{
321 321
 				$args = new stdClass();
322 322
 				$args->member_srl = $member_srl;
323 323
 				$output = executeQuery('member.getMemberInfoByMemberSrl', $args, $columnList);
324
-				if(!$output->data) 
324
+				if (!$output->data) 
325 325
 				{
326
-					if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass);
326
+					if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass);
327 327
 					return;
328 328
 				}
329 329
 				$this->arrangeMemberInfo($output->data, $site_srl);
330 330
 
331 331
 				//insert in cache
332
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]);
332
+				if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]);
333 333
 			}
334 334
 		}
335 335
 
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 	 */
342 342
 	function arrangeMemberInfo($info, $site_srl = 0)
343 343
 	{
344
-		if(!$GLOBALS['__member_info__'][$info->member_srl])
344
+		if (!$GLOBALS['__member_info__'][$info->member_srl])
345 345
 		{
346 346
 			$oModuleModel = getModel('module');
347 347
 			$config = $oModuleModel->getModuleConfig('member');
@@ -350,25 +350,25 @@  discard block
 block discarded – undo
350 350
 			$info->profile_image = $this->getProfileImage($info->member_srl);
351 351
 			$info->image_name = $this->getImageName($info->member_srl);
352 352
 			$info->image_mark = $this->getImageMark($info->member_srl);
353
-			if($config->group_image_mark=='Y')
353
+			if ($config->group_image_mark == 'Y')
354 354
 			{
355
-				$info->group_mark = $this->getGroupImageMark($info->member_srl,$site_srl);
355
+				$info->group_mark = $this->getGroupImageMark($info->member_srl, $site_srl);
356 356
 			}
357 357
 			$info->signature = $this->getSignature($info->member_srl);
358 358
 			$info->group_list = $this->getMemberGroups($info->member_srl, $site_srl);
359 359
 
360 360
 			$extra_vars = unserialize($info->extra_vars);
361 361
 			unset($info->extra_vars);
362
-			if($extra_vars)
362
+			if ($extra_vars)
363 363
 			{
364
-				foreach($extra_vars as $key => $val)
364
+				foreach ($extra_vars as $key => $val)
365 365
 				{
366
-					if(!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val);
367
-					if(!$info->{$key}) $info->{$key} = $val;
366
+					if (!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val);
367
+					if (!$info->{$key}) $info->{$key} = $val;
368 368
 				}
369 369
 			}
370 370
 
371
-			if(strlen($info->find_account_answer) == 32 && preg_match('/[a-zA-Z0-9]+/', $info->find_account_answer))
371
+			if (strlen($info->find_account_answer) == 32 && preg_match('/[a-zA-Z0-9]+/', $info->find_account_answer))
372 372
 			{
373 373
 				$info->find_account_answer = null;
374 374
 			}
@@ -380,11 +380,11 @@  discard block
 block discarded – undo
380 380
 			$info->homepage = strip_tags($info->homepage);
381 381
 			$info->blog = strip_tags($info->blog);
382 382
 
383
-			if($extra_vars)
383
+			if ($extra_vars)
384 384
 			{
385
-				foreach($extra_vars as $key => $val)
385
+				foreach ($extra_vars as $key => $val)
386 386
 				{
387
-					if(is_array($val))
387
+					if (is_array($val))
388 388
 					{
389 389
 						$oSecurity->encodeHTML($key . '.');
390 390
 					}
@@ -397,12 +397,12 @@  discard block
 block discarded – undo
397 397
 
398 398
 			// Check format.
399 399
 			$oValidator = new Validator();
400
-			if(!$oValidator->applyRule('url', $info->homepage))
400
+			if (!$oValidator->applyRule('url', $info->homepage))
401 401
 			{
402 402
 				$info->homepage = '';
403 403
 			}
404 404
 
405
-			if(!$oValidator->applyRule('url', $info->blog))
405
+			if (!$oValidator->applyRule('url', $info->blog))
406 406
 			{
407 407
 				$info->blog = '';
408 408
 			}
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
 	 */
452 452
 	function getLoggedMemberSrl()
453 453
 	{
454
-		if(!$this->isLogged()) return;
454
+		if (!$this->isLogged()) return;
455 455
 		return $_SESSION['member_srl'];
456 456
 	}
457 457
 
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 	 */
461 461
 	function getLoggedUserID()
462 462
 	{
463
-		if(!$this->isLogged()) return;
463
+		if (!$this->isLogged()) return;
464 464
 		$logged_info = Context::get('logged_info');
465 465
 		return $logged_info->user_id;
466 466
 	}
@@ -475,16 +475,16 @@  discard block
 block discarded – undo
475 475
 		// cache controll
476 476
 		$group_list = false;
477 477
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
478
-		if($oCacheHandler->isSupport())
478
+		if ($oCacheHandler->isSupport())
479 479
 		{
480
-			$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_'.$site_srl;
480
+			$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_' . $site_srl;
481 481
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
482 482
 			$group_list = $oCacheHandler->get($cache_key);
483 483
 		}
484 484
 
485
-		if(!$member_groups[$member_srl][$site_srl] || $force_reload)
485
+		if (!$member_groups[$member_srl][$site_srl] || $force_reload)
486 486
 		{
487
-			if($group_list === false)
487
+			if ($group_list === false)
488 488
 			{
489 489
 				$args = new stdClass();
490 490
 				$args->member_srl = $member_srl;
@@ -492,11 +492,11 @@  discard block
 block discarded – undo
492 492
 				$output = executeQueryArray('member.getMemberGroups', $args);
493 493
 				$group_list = $output->data;
494 494
 				//insert in cache
495
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
495
+				if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
496 496
 			}
497
-			if(!$group_list) return array();
497
+			if (!$group_list) return array();
498 498
 
499
-			foreach($group_list as $group)
499
+			foreach ($group_list as $group)
500 500
 			{
501 501
 				$result[$group->group_srl] = $group->title;
502 502
 			}
@@ -510,14 +510,14 @@  discard block
 block discarded – undo
510 510
 	 */
511 511
 	function getMembersGroups($member_srls, $site_srl = 0)
512 512
 	{
513
-		$args->member_srls = implode(',',$member_srls);
513
+		$args->member_srls = implode(',', $member_srls);
514 514
 		$args->site_srl = $site_srl;
515 515
 		$args->sort_index = 'list_order';
516 516
 		$output = executeQueryArray('member.getMembersGroups', $args);
517
-		if(!$output->data) return array();
517
+		if (!$output->data) return array();
518 518
 
519 519
 		$result = array();
520
-		foreach($output->data as $key=>$val)
520
+		foreach ($output->data as $key=>$val)
521 521
 		{
522 522
 			$result[$val->member_srl][] = $val->title;
523 523
 		}
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
 	{
532 532
 		$default_group = false;
533 533
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
534
-		if($oCacheHandler->isSupport())
534
+		if ($oCacheHandler->isSupport())
535 535
 		{
536 536
 			$columnList = array();
537 537
 			$object_key = 'default_group_' . $site_srl;
@@ -539,13 +539,13 @@  discard block
 block discarded – undo
539 539
 			$default_group = $oCacheHandler->get($cache_key);
540 540
 		}
541 541
 
542
-		if($default_group === false)
542
+		if ($default_group === false)
543 543
 		{
544 544
 			$args = new stdClass();
545 545
 			$args->site_srl = $site_srl;
546 546
 			$output = executeQuery('member.getDefaultGroup', $args, $columnList);
547 547
 			$default_group = $output->data;
548
-			if($oCacheHandler->isSupport())
548
+			if ($oCacheHandler->isSupport())
549 549
 			{
550 550
 				$oCacheHandler->put($cache_key, $default_group);
551 551
 			}
@@ -579,25 +579,25 @@  discard block
 block discarded – undo
579 579
 	 */
580 580
 	function getGroups($site_srl = 0)
581 581
 	{
582
-		if(!$GLOBALS['__group_info__'][$site_srl])
582
+		if (!$GLOBALS['__group_info__'][$site_srl])
583 583
 		{
584 584
 			$result = array();
585 585
 
586
-			if(!isset($site_srl))
586
+			if (!isset($site_srl))
587 587
 			{
588 588
 				$site_srl = 0;
589 589
 			}
590 590
 
591 591
 			$group_list = false;
592 592
 			$oCacheHandler = CacheHandler::getInstance('object', null, true);
593
-			if($oCacheHandler->isSupport())
593
+			if ($oCacheHandler->isSupport())
594 594
 			{
595
-				$object_key = 'member_groups:site_'.$site_srl;
595
+				$object_key = 'member_groups:site_' . $site_srl;
596 596
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
597 597
 				$group_list = $oCacheHandler->get($cache_key);
598 598
 			}
599 599
 
600
-			if($group_list === false)
600
+			if ($group_list === false)
601 601
 			{
602 602
 				$args = new stdClass();
603 603
 				$args->site_srl = $site_srl;
@@ -606,16 +606,16 @@  discard block
 block discarded – undo
606 606
 				$output = executeQueryArray('member.getGroups', $args);
607 607
 				$group_list = $output->data;
608 608
 				//insert in cache
609
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
609
+				if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
610 610
 			}
611 611
 
612
-			if(!$group_list)
612
+			if (!$group_list)
613 613
 			{
614 614
 				return array();
615 615
 			}
616 616
 
617 617
 
618
-			foreach($group_list as $val)
618
+			foreach ($group_list as $val)
619 619
 			{
620 620
 				$result[$val->group_srl] = $val;
621 621
 			}
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
 		// Set to ignore if a super administrator.
647 647
 		$logged_info = Context::get('logged_info');
648 648
 
649
-		if(!$this->join_form_list)
649
+		if (!$this->join_form_list)
650 650
 		{
651 651
 			// Argument setting to sort list_order column
652 652
 			$args = new stdClass();
@@ -654,11 +654,11 @@  discard block
 block discarded – undo
654 654
 			$output = executeQuery('member.getJoinFormList', $args);
655 655
 			// NULL if output data deosn't exist
656 656
 			$join_form_list = $output->data;
657
-			if(!$join_form_list) return NULL;
657
+			if (!$join_form_list) return NULL;
658 658
 			// Need to unserialize because serialized array is inserted into DB in case of default_value
659
-			if(!is_array($join_form_list)) $join_form_list = array($join_form_list);
659
+			if (!is_array($join_form_list)) $join_form_list = array($join_form_list);
660 660
 			$join_form_count = count($join_form_list);
661
-			for($i=0;$i<$join_form_count;$i++)
661
+			for ($i = 0; $i < $join_form_count; $i++)
662 662
 			{
663 663
 				$join_form_list[$i]->column_name = strtolower($join_form_list[$i]->column_name);
664 664
 
@@ -670,10 +670,10 @@  discard block
 block discarded – undo
670 670
 				// Add language variable
671 671
 				$lang->extend_vars[$column_name] = $column_title;
672 672
 				// unserialize if the data type if checkbox, select and so on
673
-				if(in_array($column_type, array('checkbox','select','radio')))
673
+				if (in_array($column_type, array('checkbox', 'select', 'radio')))
674 674
 				{
675 675
 					$join_form_list[$i]->default_value = unserialize($default_value);
676
-					if(!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = '';
676
+					if (!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = '';
677 677
 				}
678 678
 				else
679 679
 				{
@@ -685,21 +685,21 @@  discard block
 block discarded – undo
685 685
 			$this->join_form_list = $list;
686 686
 		}
687 687
 		// Get object style if the filter_response is true
688
-		if($filter_response && count($this->join_form_list))
688
+		if ($filter_response && count($this->join_form_list))
689 689
 		{
690
-			foreach($this->join_form_list as $key => $val)
690
+			foreach ($this->join_form_list as $key => $val)
691 691
 			{
692
-				if($val->is_active != 'Y') continue;
692
+				if ($val->is_active != 'Y') continue;
693 693
 				unset($obj);
694 694
 				$obj->type = $val->column_type;
695 695
 				$obj->name = $val->column_name;
696 696
 				$obj->lang = $val->column_title;
697
-				if($logged_info->is_admin != 'Y') $obj->required = $val->required=='Y'?true:false;
697
+				if ($logged_info->is_admin != 'Y') $obj->required = $val->required == 'Y' ? true : false;
698 698
 				else $obj->required = false;
699 699
 				$filter_output[] = $obj;
700 700
 
701 701
 				unset($open_obj);
702
-				$open_obj->name = 'open_'.$val->column_name;
702
+				$open_obj->name = 'open_' . $val->column_name;
703 703
 				$open_obj->required = false;
704 704
 				$filter_output[] = $open_obj;
705 705
 
@@ -721,15 +721,15 @@  discard block
 block discarded – undo
721 721
 		$args->sort_index = "list_order";
722 722
 		$output = executeQueryArray('member.getJoinFormList', $args);
723 723
 
724
-		if(!$output->toBool())
724
+		if (!$output->toBool())
725 725
 		{
726 726
 			return array();
727 727
 		}
728 728
 
729 729
 		$joinFormList = array();
730
-		foreach($output->data as $val)
730
+		foreach ($output->data as $val)
731 731
 		{
732
-			if($val->is_active != 'Y')
732
+			if ($val->is_active != 'Y')
733 733
 			{
734 734
 				continue;
735 735
 			}
@@ -746,20 +746,20 @@  discard block
 block discarded – undo
746 746
 	function getCombineJoinForm($member_info)
747 747
 	{
748 748
 		$extend_form_list = $this->getJoinFormlist();
749
-		if(!$extend_form_list) return;
749
+		if (!$extend_form_list) return;
750 750
 		// Member info is open only to an administrator and him/herself when is_private is true.
751 751
 		$logged_info = Context::get('logged_info');
752 752
 
753
-		foreach($extend_form_list as $srl => $item)
753
+		foreach ($extend_form_list as $srl => $item)
754 754
 		{
755 755
 			$column_name = $item->column_name;
756 756
 			$value = $member_info->{$column_name};
757 757
 
758 758
 			// Change values depening on the type of extend form
759
-			switch($item->column_type)
759
+			switch ($item->column_type)
760 760
 			{
761 761
 				case 'checkbox' :
762
-					if($value && !is_array($value)) $value = array($value);
762
+					if ($value && !is_array($value)) $value = array($value);
763 763
 					break;
764 764
 				case 'text' :
765 765
 				case 'homepage' :
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
 
774 774
 			$extend_form_list[$srl]->value = $value;
775 775
 
776
-			if($member_info->{'open_'.$column_name}=='Y') $extend_form_list[$srl]->is_opened = true;
776
+			if ($member_info->{'open_' . $column_name} == 'Y') $extend_form_list[$srl]->is_opened = true;
777 777
 			else $extend_form_list[$srl]->is_opened = false;
778 778
 		}
779 779
 		return $extend_form_list;
@@ -787,12 +787,12 @@  discard block
 block discarded – undo
787 787
 		$args->member_join_form_srl = $member_join_form_srl;
788 788
 		$output = executeQuery('member.getJoinForm', $args);
789 789
 		$join_form = $output->data;
790
-		if(!$join_form) return NULL;
790
+		if (!$join_form) return NULL;
791 791
 
792 792
 		$column_type = $join_form->column_type;
793 793
 		$default_value = $join_form->default_value;
794 794
 
795
-		if(in_array($column_type, array('checkbox','select','radio')))
795
+		if (in_array($column_type, array('checkbox', 'select', 'radio')))
796 796
 		{
797 797
 			$join_form->default_value = unserialize($default_value);
798 798
 		}
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
 	 */
810 810
 	function getDeniedIDList()
811 811
 	{
812
-		if(!$this->denied_id_list)
812
+		if (!$this->denied_id_list)
813 813
 		{
814 814
 			$args->sort_index = "list_order";
815 815
 			$args->page = Context::get('page');
@@ -825,14 +825,14 @@  discard block
 block discarded – undo
825 825
 	function getDeniedIDs()
826 826
 	{
827 827
 		$output = executeQueryArray('member.getDeniedIDs');
828
-		if(!$output->toBool()) return array();
828
+		if (!$output->toBool()) return array();
829 829
 		return $output->data;
830 830
 	}
831 831
 
832 832
 	function getDeniedNickNames()
833 833
 	{
834 834
 		$output = executeQueryArray('member.getDeniedNickNames');
835
-		if(!$output->toBool())
835
+		if (!$output->toBool())
836 836
 		{
837 837
 			return array();
838 838
 		}
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
 		$args = new stdClass();
849 849
 		$args->user_id = $user_id;
850 850
 		$output = executeQuery('member.chkDeniedID', $args);
851
-		if($output->data->count) return true;
851
+		if ($output->data->count) return true;
852 852
 		return false;
853 853
 	}
854 854
 
@@ -860,8 +860,8 @@  discard block
 block discarded – undo
860 860
 		$args = new stdClass();
861 861
 		$args->nick_name = $nickName;
862 862
 		$output = executeQuery('member.chkDeniedNickName', $args);
863
-		if($output->data->count) return true;
864
-		if(!$output->toBool())
863
+		if ($output->data->count) return true;
864
+		if (!$output->toBool())
865 865
 		{
866 866
 			return true;
867 867
 		}
@@ -872,21 +872,21 @@  discard block
 block discarded – undo
872 872
 	 */
873 873
 	function getProfileImage($member_srl)
874 874
 	{
875
-		if(!isset($GLOBALS['__member_info__']['profile_image'][$member_srl]))
875
+		if (!isset($GLOBALS['__member_info__']['profile_image'][$member_srl]))
876 876
 		{
877 877
 			$GLOBALS['__member_info__']['profile_image'][$member_srl] = null;
878
-			$exts = array('gif','jpg','png');
879
-			for($i=0;$i<3;$i++)
878
+			$exts = array('gif', 'jpg', 'png');
879
+			for ($i = 0; $i < 3; $i++)
880 880
 			{
881 881
 				$image_name_file = sprintf('files/member_extra_info/profile_image/%s%d.%s', getNumberingPath($member_srl), $member_srl, $exts[$i]);
882
-				if(file_exists($image_name_file))
882
+				if (file_exists($image_name_file))
883 883
 				{
884 884
 					list($width, $height, $type, $attrs) = getimagesize($image_name_file);
885 885
 					$info = new stdClass();
886 886
 					$info->width = $width;
887 887
 					$info->height = $height;
888
-					$info->src = Context::getRequestUri().$image_name_file;
889
-					$info->file = './'.$image_name_file;
888
+					$info->src = Context::getRequestUri() . $image_name_file;
889
+					$info->file = './' . $image_name_file;
890 890
 					$GLOBALS['__member_info__']['profile_image'][$member_srl] = $info;
891 891
 					break;
892 892
 				}
@@ -901,17 +901,17 @@  discard block
 block discarded – undo
901 901
 	 */
902 902
 	function getImageName($member_srl)
903 903
 	{
904
-		if(!isset($GLOBALS['__member_info__']['image_name'][$member_srl]))
904
+		if (!isset($GLOBALS['__member_info__']['image_name'][$member_srl]))
905 905
 		{
906 906
 			$image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl);
907
-			if(file_exists($image_name_file))
907
+			if (file_exists($image_name_file))
908 908
 			{
909 909
 				list($width, $height, $type, $attrs) = getimagesize($image_name_file);
910 910
 				$info = new stdClass;
911 911
 				$info->width = $width;
912 912
 				$info->height = $height;
913
-				$info->src = Context::getRequestUri().$image_name_file;
914
-				$info->file = './'.$image_name_file;
913
+				$info->src = Context::getRequestUri() . $image_name_file;
914
+				$info->file = './' . $image_name_file;
915 915
 				$GLOBALS['__member_info__']['image_name'][$member_srl] = $info;
916 916
 			}
917 917
 			else $GLOBALS['__member_info__']['image_name'][$member_srl] = null;
@@ -924,16 +924,16 @@  discard block
 block discarded – undo
924 924
 	 */
925 925
 	function getImageMark($member_srl)
926 926
 	{
927
-		if(!isset($GLOBALS['__member_info__']['image_mark'][$member_srl]))
927
+		if (!isset($GLOBALS['__member_info__']['image_mark'][$member_srl]))
928 928
 		{
929 929
 			$image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl);
930
-			if(file_exists($image_mark_file))
930
+			if (file_exists($image_mark_file))
931 931
 			{
932 932
 				list($width, $height, $type, $attrs) = getimagesize($image_mark_file);
933 933
 				$info->width = $width;
934 934
 				$info->height = $height;
935
-				$info->src = Context::getRequestUri().$image_mark_file;
936
-				$info->file = './'.$image_mark_file;
935
+				$info->src = Context::getRequestUri() . $image_mark_file;
936
+				$info->file = './' . $image_mark_file;
937 937
 				$GLOBALS['__member_info__']['image_mark'][$member_srl] = $info;
938 938
 			}
939 939
 			else $GLOBALS['__member_info__']['image_mark'][$member_srl] = null;
@@ -946,27 +946,27 @@  discard block
 block discarded – undo
946 946
 	/**
947 947
 	 * @brief Get the image mark of the group
948 948
 	 */
949
-	function getGroupImageMark($member_srl,$site_srl=0)
949
+	function getGroupImageMark($member_srl, $site_srl = 0)
950 950
 	{
951
-		if(!isset($GLOBALS['__member_info__']['group_image_mark'][$member_srl]))
951
+		if (!isset($GLOBALS['__member_info__']['group_image_mark'][$member_srl]))
952 952
 		{
953 953
 			$oModuleModel = getModel('module');
954 954
 			$config = $oModuleModel->getModuleConfig('member');
955
-			if($config->group_image_mark!='Y')
955
+			if ($config->group_image_mark != 'Y')
956 956
 			{
957 957
 				return null;
958 958
 			}
959
-			$member_group = $this->getMemberGroups($member_srl,$site_srl);
959
+			$member_group = $this->getMemberGroups($member_srl, $site_srl);
960 960
 			$groups_info = $this->getGroups($site_srl);
961
-			if(count($member_group) > 0 && is_array($member_group))
961
+			if (count($member_group) > 0 && is_array($member_group))
962 962
 			{
963 963
 				$memberGroups = array_keys($member_group);
964 964
 
965
-				foreach($groups_info as $group_srl=>$group_info)
965
+				foreach ($groups_info as $group_srl=>$group_info)
966 966
 				{
967
-					if(in_array($group_srl, $memberGroups))
967
+					if (in_array($group_srl, $memberGroups))
968 968
 					{
969
-						if($group_info->image_mark)
969
+						if ($group_info->image_mark)
970 970
 						{
971 971
 							$info = new stdClass();
972 972
 							$info->title = $group_info->title;
@@ -990,10 +990,10 @@  discard block
 block discarded – undo
990 990
 	 */
991 991
 	function getSignature($member_srl)
992 992
 	{
993
-		if(!isset($GLOBALS['__member_info__']['signature'][$member_srl]))
993
+		if (!isset($GLOBALS['__member_info__']['signature'][$member_srl]))
994 994
 		{
995 995
 			$filename = sprintf('files/member_extra_info/signature/%s%d.signature.php', getNumberingPath($member_srl), $member_srl);
996
-			if(file_exists($filename))
996
+			if (file_exists($filename))
997 997
 			{
998 998
 				$buff = FileHandler::readFile($filename);
999 999
 				$signature = preg_replace('/<\?.*\?>/', '', $buff);
@@ -1011,10 +1011,10 @@  discard block
 block discarded – undo
1011 1011
 	 * @param int $member_srl Set this to member_srl when comparing a member's password (optional)
1012 1012
 	 * @return bool
1013 1013
 	 */
1014
-	function isValidPassword($hashed_password, $password_text, $member_srl=null)
1014
+	function isValidPassword($hashed_password, $password_text, $member_srl = null)
1015 1015
 	{
1016 1016
 		// False if no password in entered
1017
-		if(!$password_text)
1017
+		if (!$password_text)
1018 1018
 		{
1019 1019
 			return false;
1020 1020
 		}
@@ -1023,31 +1023,31 @@  discard block
 block discarded – undo
1023 1023
 		$oPassword = new Password();
1024 1024
 		$current_algorithm = $oPassword->checkAlgorithm($hashed_password);
1025 1025
 		$match = $oPassword->checkPassword($password_text, $hashed_password, $current_algorithm);
1026
-		if(!$match)
1026
+		if (!$match)
1027 1027
 		{
1028 1028
 			return false;
1029 1029
 		}
1030 1030
 		
1031 1031
 		// Update the encryption method if necessary
1032 1032
 		$config = $this->getMemberConfig();
1033
-		if($member_srl > 0 && $config->password_hashing_auto_upgrade != 'N')
1033
+		if ($member_srl > 0 && $config->password_hashing_auto_upgrade != 'N')
1034 1034
 		{
1035 1035
 			$need_upgrade = false;
1036 1036
 			
1037
-			if(!$need_upgrade)
1037
+			if (!$need_upgrade)
1038 1038
 			{
1039 1039
 				$required_algorithm = $oPassword->getCurrentlySelectedAlgorithm();
1040
-				if($required_algorithm !== $current_algorithm) $need_upgrade = true;
1040
+				if ($required_algorithm !== $current_algorithm) $need_upgrade = true;
1041 1041
 			}
1042 1042
 			
1043
-			if(!$need_upgrade)
1043
+			if (!$need_upgrade)
1044 1044
 			{
1045 1045
 				$required_work_factor = $oPassword->getWorkFactor();
1046 1046
 				$current_work_factor = $oPassword->checkWorkFactor($hashed_password);
1047
-				if($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true;
1047
+				if ($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true;
1048 1048
 			}
1049 1049
 			
1050
-			if($need_upgrade === true)
1050
+			if ($need_upgrade === true)
1051 1051
 			{
1052 1052
 				$args = new stdClass();
1053 1053
 				$args->member_srl = $member_srl;
@@ -1075,27 +1075,27 @@  discard block
 block discarded – undo
1075 1075
 	function checkPasswordStrength($password, $strength)
1076 1076
 	{
1077 1077
 		$logged_info = Context::get('logged_info');
1078
-		if($logged_info->is_admin == 'Y') return true;
1078
+		if ($logged_info->is_admin == 'Y') return true;
1079 1079
 		
1080
-		if($strength == NULL)
1080
+		if ($strength == NULL)
1081 1081
 		{
1082 1082
 			$config = $this->getMemberConfig();
1083
-			$strength = $config->password_strength?$config->password_strength:'normal';
1083
+			$strength = $config->password_strength ? $config->password_strength : 'normal';
1084 1084
 		}
1085 1085
 		
1086 1086
 		$length = strlen($password);
1087 1087
 		
1088 1088
 		switch ($strength) {
1089 1089
 			case 'high':
1090
-				if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false;
1090
+				if ($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false;
1091 1091
 				/* no break */
1092 1092
 				
1093 1093
 			case 'normal':
1094
-				if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false;
1094
+				if ($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false;
1095 1095
 				break;
1096 1096
 				
1097 1097
 			case 'low':
1098
-				if($length < 4) return false;
1098
+				if ($length < 4) return false;
1099 1099
 				break; 
1100 1100
 		}
1101 1101
 		
@@ -1106,11 +1106,11 @@  discard block
 block discarded – undo
1106 1106
 	{
1107 1107
 		$groupSrl = 0;
1108 1108
 		$output = $this->getGroups($site_srl);
1109
-		if(is_array($output))
1109
+		if (is_array($output))
1110 1110
 		{
1111
-			foreach($output AS $key=>$value)
1111
+			foreach ($output AS $key=>$value)
1112 1112
 			{
1113
-				if($value->is_admin == 'Y')
1113
+				if ($value->is_admin == 'Y')
1114 1114
 				{
1115 1115
 					$groupSrl = $value->group_srl;
1116 1116
 					break;
Please login to merge, or discard this patch.
Braces   +201 added lines, -81 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,8 +239,7 @@  discard block
 block discarded – undo
195 239
 			if(Mobile::isFromMobilePhone())
196 240
 			{
197 241
 				return true;
198
-			}
199
-			else
242
+			} else
200 243
 			{
201 244
 				if(ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8)
202 245
 				{
@@ -225,10 +268,12 @@  discard block
 block discarded – undo
225 268
 				$logged_info->group_list = $this->getMemberGroups($logged_info->member_srl, $site_module_info->site_srl);
226 269
 				// Add is_site_admin bool variable into logged_info if site_administrator is
227 270
 				$oModuleModel = getModel('module');
228
-				if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true;
229
-				else $logged_info->is_site_admin = false;
230
-			}
231
-			else
271
+				if($oModuleModel->isSiteAdmin($logged_info)) {
272
+					$logged_info->is_site_admin = true;
273
+				} else {
274
+					$logged_info->is_site_admin = false;
275
+				}
276
+			} else
232 277
 			{
233 278
 				// Register a default group if the site doesn't have a member group
234 279
 				if(count($logged_info->group_list) === 0)
@@ -254,13 +299,19 @@  discard block
 block discarded – undo
254 299
 	 */
255 300
 	function getMemberInfoByUserID($user_id, $columnList = array())
256 301
 	{
257
-		if(!$user_id) return;
302
+		if(!$user_id) {
303
+			return;
304
+		}
258 305
 
259 306
 		$args = new stdClass;
260 307
 		$args->user_id = $user_id;
261 308
 		$output = executeQuery('member.getMemberInfo', $args);
262
-		if(!$output->toBool()) return $output;
263
-		if(!$output->data) return;
309
+		if(!$output->toBool()) {
310
+			return $output;
311
+		}
312
+		if(!$output->data) {
313
+			return;
314
+		}
264 315
 
265 316
 		$member_info = $this->arrangeMemberInfo($output->data);
266 317
 
@@ -272,7 +323,9 @@  discard block
 block discarded – undo
272 323
 	 */
273 324
 	function getMemberInfoByEmailAddress($email_address)
274 325
 	{
275
-		if(!$email_address) return;
326
+		if(!$email_address) {
327
+			return;
328
+		}
276 329
 
277 330
 		$args = new stdClass();
278 331
 		
@@ -281,15 +334,18 @@  discard block
 block discarded – undo
281 334
 		{
282 335
 			$args->email_address = strtolower($email_address);
283 336
 			$output = executeQuery('member.getMemberInfoByEmailAddressForCubrid', $args);
284
-		}
285
-		else
337
+		} else
286 338
 		{
287 339
 			$args->email_address = $email_address;
288 340
 			$output = executeQuery('member.getMemberInfoByEmailAddress', $args);
289 341
 		}
290 342
 		
291
-		if(!$output->toBool()) return $output;
292
-		if(!$output->data) return;
343
+		if(!$output->toBool()) {
344
+			return $output;
345
+		}
346
+		if(!$output->data) {
347
+			return;
348
+		}
293 349
 
294 350
 		$member_info = $this->arrangeMemberInfo($output->data);
295 351
 		return $member_info;
@@ -300,7 +356,9 @@  discard block
 block discarded – undo
300 356
 	 */
301 357
 	function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array())
302 358
 	{
303
-		if(!$member_srl) return;
359
+		if(!$member_srl) {
360
+			return;
361
+		}
304 362
 
305 363
 		//columnList size zero... get full member info
306 364
 		if(!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0)
@@ -323,13 +381,17 @@  discard block
 block discarded – undo
323 381
 				$output = executeQuery('member.getMemberInfoByMemberSrl', $args, $columnList);
324 382
 				if(!$output->data) 
325 383
 				{
326
-					if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass);
384
+					if($oCacheHandler->isSupport()) {
385
+						$oCacheHandler->put($cache_key, new stdClass);
386
+					}
327 387
 					return;
328 388
 				}
329 389
 				$this->arrangeMemberInfo($output->data, $site_srl);
330 390
 
331 391
 				//insert in cache
332
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]);
392
+				if($oCacheHandler->isSupport()) {
393
+					$oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]);
394
+				}
333 395
 			}
334 396
 		}
335 397
 
@@ -363,8 +425,12 @@  discard block
 block discarded – undo
363 425
 			{
364 426
 				foreach($extra_vars as $key => $val)
365 427
 				{
366
-					if(!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val);
367
-					if(!$info->{$key}) $info->{$key} = $val;
428
+					if(!is_array($val) && strpos($val, '|@|') !== FALSE) {
429
+						$val = explode('|@|', $val);
430
+					}
431
+					if(!$info->{$key}) {
432
+						$info->{$key} = $val;
433
+					}
368 434
 				}
369 435
 			}
370 436
 
@@ -387,8 +453,7 @@  discard block
 block discarded – undo
387 453
 					if(is_array($val))
388 454
 					{
389 455
 						$oSecurity->encodeHTML($key . '.');
390
-					}
391
-					else
456
+					} else
392 457
 					{
393 458
 						$oSecurity->encodeHTML($key);
394 459
 					}
@@ -451,7 +516,9 @@  discard block
 block discarded – undo
451 516
 	 */
452 517
 	function getLoggedMemberSrl()
453 518
 	{
454
-		if(!$this->isLogged()) return;
519
+		if(!$this->isLogged()) {
520
+			return;
521
+		}
455 522
 		return $_SESSION['member_srl'];
456 523
 	}
457 524
 
@@ -460,7 +527,9 @@  discard block
 block discarded – undo
460 527
 	 */
461 528
 	function getLoggedUserID()
462 529
 	{
463
-		if(!$this->isLogged()) return;
530
+		if(!$this->isLogged()) {
531
+			return;
532
+		}
464 533
 		$logged_info = Context::get('logged_info');
465 534
 		return $logged_info->user_id;
466 535
 	}
@@ -492,9 +561,13 @@  discard block
 block discarded – undo
492 561
 				$output = executeQueryArray('member.getMemberGroups', $args);
493 562
 				$group_list = $output->data;
494 563
 				//insert in cache
495
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
564
+				if($oCacheHandler->isSupport()) {
565
+					$oCacheHandler->put($cache_key, $group_list);
566
+				}
567
+			}
568
+			if(!$group_list) {
569
+				return array();
496 570
 			}
497
-			if(!$group_list) return array();
498 571
 
499 572
 			foreach($group_list as $group)
500 573
 			{
@@ -514,7 +587,9 @@  discard block
 block discarded – undo
514 587
 		$args->site_srl = $site_srl;
515 588
 		$args->sort_index = 'list_order';
516 589
 		$output = executeQueryArray('member.getMembersGroups', $args);
517
-		if(!$output->data) return array();
590
+		if(!$output->data) {
591
+			return array();
592
+		}
518 593
 
519 594
 		$result = array();
520 595
 		foreach($output->data as $key=>$val)
@@ -606,7 +681,9 @@  discard block
 block discarded – undo
606 681
 				$output = executeQueryArray('member.getGroups', $args);
607 682
 				$group_list = $output->data;
608 683
 				//insert in cache
609
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
684
+				if($oCacheHandler->isSupport()) {
685
+					$oCacheHandler->put($cache_key, $group_list);
686
+				}
610 687
 			}
611 688
 
612 689
 			if(!$group_list)
@@ -654,9 +731,13 @@  discard block
 block discarded – undo
654 731
 			$output = executeQuery('member.getJoinFormList', $args);
655 732
 			// NULL if output data deosn't exist
656 733
 			$join_form_list = $output->data;
657
-			if(!$join_form_list) return NULL;
734
+			if(!$join_form_list) {
735
+				return NULL;
736
+			}
658 737
 			// Need to unserialize because serialized array is inserted into DB in case of default_value
659
-			if(!is_array($join_form_list)) $join_form_list = array($join_form_list);
738
+			if(!is_array($join_form_list)) {
739
+				$join_form_list = array($join_form_list);
740
+			}
660 741
 			$join_form_count = count($join_form_list);
661 742
 			for($i=0;$i<$join_form_count;$i++)
662 743
 			{
@@ -673,9 +754,10 @@  discard block
 block discarded – undo
673 754
 				if(in_array($column_type, array('checkbox','select','radio')))
674 755
 				{
675 756
 					$join_form_list[$i]->default_value = unserialize($default_value);
676
-					if(!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = '';
677
-				}
678
-				else
757
+					if(!$join_form_list[$i]->default_value[0]) {
758
+						$join_form_list[$i]->default_value = '';
759
+					}
760
+				} else
679 761
 				{
680 762
 					$join_form_list[$i]->default_value = '';
681 763
 				}
@@ -689,13 +771,18 @@  discard block
 block discarded – undo
689 771
 		{
690 772
 			foreach($this->join_form_list as $key => $val)
691 773
 			{
692
-				if($val->is_active != 'Y') continue;
774
+				if($val->is_active != 'Y') {
775
+					continue;
776
+				}
693 777
 				unset($obj);
694 778
 				$obj->type = $val->column_type;
695 779
 				$obj->name = $val->column_name;
696 780
 				$obj->lang = $val->column_title;
697
-				if($logged_info->is_admin != 'Y') $obj->required = $val->required=='Y'?true:false;
698
-				else $obj->required = false;
781
+				if($logged_info->is_admin != 'Y') {
782
+					$obj->required = $val->required=='Y'?true:false;
783
+				} else {
784
+					$obj->required = false;
785
+				}
699 786
 				$filter_output[] = $obj;
700 787
 
701 788
 				unset($open_obj);
@@ -746,7 +833,9 @@  discard block
 block discarded – undo
746 833
 	function getCombineJoinForm($member_info)
747 834
 	{
748 835
 		$extend_form_list = $this->getJoinFormlist();
749
-		if(!$extend_form_list) return;
836
+		if(!$extend_form_list) {
837
+			return;
838
+		}
750 839
 		// Member info is open only to an administrator and him/herself when is_private is true.
751 840
 		$logged_info = Context::get('logged_info');
752 841
 
@@ -759,7 +848,9 @@  discard block
 block discarded – undo
759 848
 			switch($item->column_type)
760 849
 			{
761 850
 				case 'checkbox' :
762
-					if($value && !is_array($value)) $value = array($value);
851
+					if($value && !is_array($value)) {
852
+						$value = array($value);
853
+					}
763 854
 					break;
764 855
 				case 'text' :
765 856
 				case 'homepage' :
@@ -773,8 +864,11 @@  discard block
 block discarded – undo
773 864
 
774 865
 			$extend_form_list[$srl]->value = $value;
775 866
 
776
-			if($member_info->{'open_'.$column_name}=='Y') $extend_form_list[$srl]->is_opened = true;
777
-			else $extend_form_list[$srl]->is_opened = false;
867
+			if($member_info->{'open_'.$column_name}=='Y') {
868
+				$extend_form_list[$srl]->is_opened = true;
869
+			} else {
870
+				$extend_form_list[$srl]->is_opened = false;
871
+			}
778 872
 		}
779 873
 		return $extend_form_list;
780 874
 	}
@@ -787,7 +881,9 @@  discard block
 block discarded – undo
787 881
 		$args->member_join_form_srl = $member_join_form_srl;
788 882
 		$output = executeQuery('member.getJoinForm', $args);
789 883
 		$join_form = $output->data;
790
-		if(!$join_form) return NULL;
884
+		if(!$join_form) {
885
+			return NULL;
886
+		}
791 887
 
792 888
 		$column_type = $join_form->column_type;
793 889
 		$default_value = $join_form->default_value;
@@ -795,8 +891,7 @@  discard block
 block discarded – undo
795 891
 		if(in_array($column_type, array('checkbox','select','radio')))
796 892
 		{
797 893
 			$join_form->default_value = unserialize($default_value);
798
-		}
799
-		else
894
+		} else
800 895
 		{
801 896
 			$join_form->default_value = '';
802 897
 		}
@@ -825,7 +920,9 @@  discard block
 block discarded – undo
825 920
 	function getDeniedIDs()
826 921
 	{
827 922
 		$output = executeQueryArray('member.getDeniedIDs');
828
-		if(!$output->toBool()) return array();
923
+		if(!$output->toBool()) {
924
+			return array();
925
+		}
829 926
 		return $output->data;
830 927
 	}
831 928
 
@@ -848,7 +945,9 @@  discard block
 block discarded – undo
848 945
 		$args = new stdClass();
849 946
 		$args->user_id = $user_id;
850 947
 		$output = executeQuery('member.chkDeniedID', $args);
851
-		if($output->data->count) return true;
948
+		if($output->data->count) {
949
+			return true;
950
+		}
852 951
 		return false;
853 952
 	}
854 953
 
@@ -860,7 +959,9 @@  discard block
 block discarded – undo
860 959
 		$args = new stdClass();
861 960
 		$args->nick_name = $nickName;
862 961
 		$output = executeQuery('member.chkDeniedNickName', $args);
863
-		if($output->data->count) return true;
962
+		if($output->data->count) {
963
+			return true;
964
+		}
864 965
 		if(!$output->toBool())
865 966
 		{
866 967
 			return true;
@@ -913,8 +1014,9 @@  discard block
 block discarded – undo
913 1014
 				$info->src = Context::getRequestUri().$image_name_file;
914 1015
 				$info->file = './'.$image_name_file;
915 1016
 				$GLOBALS['__member_info__']['image_name'][$member_srl] = $info;
1017
+			} else {
1018
+				$GLOBALS['__member_info__']['image_name'][$member_srl] = null;
916 1019
 			}
917
-			else $GLOBALS['__member_info__']['image_name'][$member_srl] = null;
918 1020
 		}
919 1021
 		return $GLOBALS['__member_info__']['image_name'][$member_srl];
920 1022
 	}
@@ -935,8 +1037,9 @@  discard block
 block discarded – undo
935 1037
 				$info->src = Context::getRequestUri().$image_mark_file;
936 1038
 				$info->file = './'.$image_mark_file;
937 1039
 				$GLOBALS['__member_info__']['image_mark'][$member_srl] = $info;
1040
+			} else {
1041
+				$GLOBALS['__member_info__']['image_mark'][$member_srl] = null;
938 1042
 			}
939
-			else $GLOBALS['__member_info__']['image_mark'][$member_srl] = null;
940 1043
 		}
941 1044
 
942 1045
 		return $GLOBALS['__member_info__']['image_mark'][$member_srl];
@@ -978,9 +1081,13 @@  discard block
 block discarded – undo
978 1081
 					}
979 1082
 				}
980 1083
 			}
981
-			if (!$info) $GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N';
1084
+			if (!$info) {
1085
+				$GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N';
1086
+			}
1087
+		}
1088
+		if ($GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N') {
1089
+			return null;
982 1090
 		}
983
-		if ($GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N') return null;
984 1091
 
985 1092
 		return $GLOBALS['__member_info__']['group_image_mark'][$member_srl];
986 1093
 	}
@@ -998,8 +1105,9 @@  discard block
 block discarded – undo
998 1105
 				$buff = FileHandler::readFile($filename);
999 1106
 				$signature = preg_replace('/<\?.*\?>/', '', $buff);
1000 1107
 				$GLOBALS['__member_info__']['signature'][$member_srl] = $signature;
1108
+			} else {
1109
+				$GLOBALS['__member_info__']['signature'][$member_srl] = null;
1001 1110
 			}
1002
-			else $GLOBALS['__member_info__']['signature'][$member_srl] = null;
1003 1111
 		}
1004 1112
 		return $GLOBALS['__member_info__']['signature'][$member_srl];
1005 1113
 	}
@@ -1037,14 +1145,18 @@  discard block
 block discarded – undo
1037 1145
 			if(!$need_upgrade)
1038 1146
 			{
1039 1147
 				$required_algorithm = $oPassword->getCurrentlySelectedAlgorithm();
1040
-				if($required_algorithm !== $current_algorithm) $need_upgrade = true;
1148
+				if($required_algorithm !== $current_algorithm) {
1149
+					$need_upgrade = true;
1150
+				}
1041 1151
 			}
1042 1152
 			
1043 1153
 			if(!$need_upgrade)
1044 1154
 			{
1045 1155
 				$required_work_factor = $oPassword->getWorkFactor();
1046 1156
 				$current_work_factor = $oPassword->checkWorkFactor($hashed_password);
1047
-				if($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true;
1157
+				if($current_work_factor !== false && $required_work_factor > $current_work_factor) {
1158
+					$need_upgrade = true;
1159
+				}
1048 1160
 			}
1049 1161
 			
1050 1162
 			if($need_upgrade === true)
@@ -1075,7 +1187,9 @@  discard block
 block discarded – undo
1075 1187
 	function checkPasswordStrength($password, $strength)
1076 1188
 	{
1077 1189
 		$logged_info = Context::get('logged_info');
1078
-		if($logged_info->is_admin == 'Y') return true;
1190
+		if($logged_info->is_admin == 'Y') {
1191
+			return true;
1192
+		}
1079 1193
 		
1080 1194
 		if($strength == NULL)
1081 1195
 		{
@@ -1087,15 +1201,21 @@  discard block
 block discarded – undo
1087 1201
 		
1088 1202
 		switch ($strength) {
1089 1203
 			case 'high':
1090
-				if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false;
1204
+				if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) {
1205
+					return false;
1206
+				}
1091 1207
 				/* no break */
1092 1208
 				
1093 1209
 			case 'normal':
1094
-				if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false;
1210
+				if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) {
1211
+					return false;
1212
+				}
1095 1213
 				break;
1096 1214
 				
1097 1215
 			case 'low':
1098
-				if($length < 4) return false;
1216
+				if($length < 4) {
1217
+					return false;
1218
+				}
1099 1219
 				break; 
1100 1220
 		}
1101 1221
 		
Please login to merge, or discard this patch.
modules/menu/menu.admin.controller.php 4 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   +339 added lines, -339 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 */
53 53
 	function init()
54 54
 	{
55
-		$this->setTemplatePath($this->module_path.'tpl');
55
+		$this->setTemplatePath($this->module_path . 'tpl');
56 56
 	}
57 57
 
58 58
 	function __construct() {
@@ -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
-				$pos = strpos($cache_file, $menu_srl.'.');
369
-				if($pos>0)FileHandler::removeFile($cache_file);
368
+				$pos = strpos($cache_file, $menu_srl . '.');
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,23 +612,23 @@  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
-			$request->module_id = $cmArgs->module.'_'.$randomMid;
624
+			$request->module_id = $cmArgs->module . '_' . $randomMid;
625 625
 		}
626 626
 		$cmArgs->mid = $request->module_id;
627 627
 
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,18 +1013,18 @@  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
 		}
@@ -1033,11 +1033,11 @@  discard block
 block discarded – undo
1033 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
 				}
@@ -1132,18 +1132,18 @@  discard block
 block discarded – undo
1132 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,14 +1195,14 @@  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']);
1202 1202
 
1203 1203
 			$args->module_type = $moduleInfo->module;
1204 1204
 			$randomMid = $this->_makeRandomMid();
1205
-			$args->module_id = $moduleInfo->module.'_'.$randomMid;
1205
+			$args->module_id = $moduleInfo->module . '_' . $randomMid;
1206 1206
 			$args->layout_srl = $moduleInfo->layout_srl;
1207 1207
 
1208 1208
 			$oModuleAdminController = getAdminController('module');
@@ -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,16 +1273,16 @@  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);
1283 1283
 		}
1284 1284
 
1285
-		return $randomString.substr($time, -2);
1285
+		return $randomString . substr($time, -2);
1286 1286
 	}
1287 1287
 
1288 1288
 	/**
@@ -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,19 +1526,19 @@  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);
1539 1539
 		}
1540 1540
 
1541
-		$this->setTemplatePath($this->module_path.'tpl');
1541
+		$this->setTemplatePath($this->module_path . 'tpl');
1542 1542
 		$this->setTemplateFile('menu_file_uploaded');
1543 1543
 	}
1544 1544
 
@@ -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,9 +1614,9 @@  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
-			$args->url = str_replace('https'.substr($dbInfo->default_url, 4), '', $url);
1619
+			$args->url = str_replace('https' . substr($dbInfo->default_url, 4), '', $url);
1620 1620
 		}
1621 1621
 		else
1622 1622
 		{
@@ -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 1778
 		$xml_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.xml.php", $menu_srl);
1779 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;
@@ -1800,43 +1800,43 @@  discard block
 block discarded – undo
1800 1800
 		}
1801 1801
 		// A common header to set permissions of the cache file and groups
1802 1802
 		$header_script =
1803
-			'$lang_type = Context::getLangType(); '.
1804
-			'$is_logged = Context::get(\'is_logged\'); '.
1805
-			'$logged_info = Context::get(\'logged_info\'); '.
1806
-			'$site_srl = '.$site_srl.';'.
1807
-			'$site_admin = false;'.
1808
-			'if($site_srl) { '.
1809
-			'$oModuleModel = getModel(\'module\');'.
1810
-			'$site_module_info = $oModuleModel->getSiteInfo($site_srl); '.
1811
-			'if($site_module_info) Context::set(\'site_module_info\',$site_module_info);'.
1812
-			'else $site_module_info = Context::get(\'site_module_info\');'.
1813
-			'$grant = $oModuleModel->getGrant($site_module_info, $logged_info); '.
1814
-			'if($grant->manager ==1) $site_admin = true;'.
1815
-			'}'.
1816
-			'if($is_logged) {'.
1817
-			'if($logged_info->is_admin=="Y") $is_admin = true; '.
1818
-			'else $is_admin = false; '.
1819
-			'$group_srls = array_keys($logged_info->group_list); '.
1820
-			'} else { '.
1821
-			'$is_admin = false; '.
1822
-			'$group_srls = array(); '.
1803
+			'$lang_type = Context::getLangType(); ' .
1804
+			'$is_logged = Context::get(\'is_logged\'); ' .
1805
+			'$logged_info = Context::get(\'logged_info\'); ' .
1806
+			'$site_srl = ' . $site_srl . ';' .
1807
+			'$site_admin = false;' .
1808
+			'if($site_srl) { ' .
1809
+			'$oModuleModel = getModel(\'module\');' .
1810
+			'$site_module_info = $oModuleModel->getSiteInfo($site_srl); ' .
1811
+			'if($site_module_info) Context::set(\'site_module_info\',$site_module_info);' .
1812
+			'else $site_module_info = Context::get(\'site_module_info\');' .
1813
+			'$grant = $oModuleModel->getGrant($site_module_info, $logged_info); ' .
1814
+			'if($grant->manager ==1) $site_admin = true;' .
1815
+			'}' .
1816
+			'if($is_logged) {' .
1817
+			'if($logged_info->is_admin=="Y") $is_admin = true; ' .
1818
+			'else $is_admin = false; ' .
1819
+			'$group_srls = array_keys($logged_info->group_list); ' .
1820
+			'} else { ' .
1821
+			'$is_admin = false; ' .
1822
+			'$group_srls = array(); ' .
1823 1823
 			'}';
1824 1824
 		// Create the xml cache file (a separate session is needed for xml cache)
1825 1825
 		$xml_buff = sprintf(
1826
-			'<?php '.
1827
-			'define(\'__XE__\', true); '.
1828
-			'require_once(\''.FileHandler::getRealPath('./config/config.inc.php').'\'); '.
1829
-			'$oContext = Context::getInstance(); '.
1830
-			'$oContext->init(); '.
1831
-			'header("Content-Type: text/xml; charset=UTF-8"); '.
1832
-			'header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); '.
1833
-			'header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); '.
1834
-			'header("Cache-Control: no-store, no-cache, must-revalidate"); '.
1835
-			'header("Cache-Control: post-check=0, pre-check=0", false); '.
1836
-			'header("Pragma: no-cache"); '.
1837
-			'%s '.
1838
-			'$oContext->close(); '.
1839
-			'?>'.
1826
+			'<?php ' .
1827
+			'define(\'__XE__\', true); ' .
1828
+			'require_once(\'' . FileHandler::getRealPath('./config/config.inc.php') . '\'); ' .
1829
+			'$oContext = Context::getInstance(); ' .
1830
+			'$oContext->init(); ' .
1831
+			'header("Content-Type: text/xml; charset=UTF-8"); ' .
1832
+			'header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); ' .
1833
+			'header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); ' .
1834
+			'header("Cache-Control: no-store, no-cache, must-revalidate"); ' .
1835
+			'header("Cache-Control: post-check=0, pre-check=0", false); ' .
1836
+			'header("Pragma: no-cache"); ' .
1837
+			'%s ' .
1838
+			'$oContext->close(); ' .
1839
+			'?>' .
1840 1840
 			'<root>%s</root>',
1841 1841
 			$header_script,
1842 1842
 			$this->getXmlTree($tree[0], $tree, $site_srl, $domain)
@@ -1844,14 +1844,14 @@  discard block
 block discarded – undo
1844 1844
 		// Create php cache file
1845 1845
 		$php_output = $this->getPhpCacheCode($tree[0], $tree, $site_srl, $domain);
1846 1846
 		$php_buff = sprintf(
1847
-			'<?php '.
1848
-			'if(!defined("__XE__")) exit(); '.
1847
+			'<?php ' .
1848
+			'if(!defined("__XE__")) exit(); ' .
1849 1849
 			'$menu = new stdClass();' .
1850
-			'%s; '.
1851
-			'%s; '.
1852
-			'$menu->list = array(%s); '.
1853
-			'if(!$is_admin) { recurciveExposureCheck($menu->list); }'.
1854
-			'Context::set("included_menu", $menu); '.
1850
+			'%s; ' .
1851
+			'%s; ' .
1852
+			'$menu->list = array(%s); ' .
1853
+			'if(!$is_admin) { recurciveExposureCheck($menu->list); }' .
1854
+			'Context::set("included_menu", $menu); ' .
1855 1855
 			'?>',
1856 1856
 			$header_script,
1857 1857
 			$php_output['name'],
@@ -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,74 +1970,74 @@  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
 			// List variables
1983 1983
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1984 1984
 			unset($name_arr_str);
1985
-			foreach($names as $key => $val)
1985
+			foreach ($names as $key => $val)
1986 1986
 			{
1987
-				$name_arr_str .= sprintf('"%s"=>"%s",',$key, str_replace(array('\\','"'),array('\\\\','&quot;'),$val));
1987
+				$name_arr_str .= sprintf('"%s"=>"%s",', $key, str_replace(array('\\', '"'), array('\\\\', '&quot;'), $val));
1988 1988
 			}
1989 1989
 			$name_str = sprintf('$_menu_names[%d] = array(%s); %s', $node->menu_item_srl, $name_arr_str, $child_output['name']);
1990 1990
 			// If url value is not empty in the current node, put the value into an array url_list
1991
-			if($node->url) $child_output['url_list'][] = $node->url;
1991
+			if ($node->url) $child_output['url_list'][] = $node->url;
1992 1992
 			$output['url_list'] = array_merge($output['url_list'], $child_output['url_list']);
1993 1993
 			// If node->group_srls value exists
1994
-			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);
1994
+			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);
1995 1995
 			else $group_check_code = "true";
1996 1996
 			// List variables
1997
-			$href = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->href);
1998
-			$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
1999
-			$desc = str_replace(array('&','"',"'"),array('&amp;','&quot;','\\\''),$node->desc);
2000
-			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
1997
+			$href = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->href);
1998
+			$url = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->url);
1999
+			$desc = str_replace(array('&', '"', "'"), array('&amp;', '&quot;', '\\\''), $node->desc);
2000
+			if (preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
2001 2001
 			{
2002 2002
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
2003 2003
 			}
2004 2004
 			else $href = sprintf('"%s"', $url);
2005 2005
 			$is_shortcut = $node->is_shortcut;
2006 2006
 			$open_window = $node->open_window;
2007
-			$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->normal_btn);
2008
-			$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->hover_btn);
2009
-			$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->active_btn);
2007
+			$normal_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->normal_btn);
2008
+			$hover_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->hover_btn);
2009
+			$active_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->active_btn);
2010 2010
 
2011
-			foreach($child_output['url_list'] as $key =>$val)
2011
+			foreach ($child_output['url_list'] as $key =>$val)
2012 2012
 			{
2013 2013
 				$child_output['url_list'][$key] = addslashes($val);
2014 2014
 			}
2015 2015
 
2016
-			$selected = '"'.implode('","',$child_output['url_list']).'"';
2016
+			$selected = '"' . implode('","', $child_output['url_list']) . '"';
2017 2017
 			$child_buff = $child_output['buff'];
2018 2018
 			$expand = $node->expand;
2019 2019
 
2020 2020
 			$normal_btn = $node->normal_btn;
2021
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2021
+			if ($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $normal_btn);
2022 2022
 			else $normal_btn = '';
2023 2023
 
2024 2024
 			$hover_btn = $node->hover_btn;
2025
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2025
+			if ($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $hover_btn);
2026 2026
 			else $hover_btn = '';
2027 2027
 
2028 2028
 			$active_btn = $node->active_btn;
2029
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2029
+			if ($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $active_btn);
2030 2030
 			else $active_btn = '';
2031 2031
 
2032 2032
 
2033 2033
 			$group_srls = $node->group_srls;
2034 2034
 
2035
-			if($normal_btn)
2035
+			if ($normal_btn)
2036 2036
 			{
2037
-				if($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2038
-				if($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2037
+				if ($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2038
+				if ($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2039 2039
 				$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);
2040
-				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);
2040
+				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);
2041 2041
 				else $link_active = $link;
2042 2042
 			}
2043 2043
 			else
@@ -2075,7 +2075,7 @@  discard block
 block discarded – undo
2075 2075
 			);
2076 2076
 
2077 2077
 			// Generate buff data
2078
-			$output['buff'] .=  sprintf('%s=>array(%s),', $node->menu_item_srl, $attribute);
2078
+			$output['buff'] .= sprintf('%s=>array(%s),', $node->menu_item_srl, $attribute);
2079 2079
 			$output['name'] .= $name_str;
2080 2080
 		}
2081 2081
 		return $output;
@@ -2089,19 +2089,19 @@  discard block
 block discarded – undo
2089 2089
 	 */
2090 2090
 	function updateMenuLayout($layout_srl, $menu_srl_list)
2091 2091
 	{
2092
-		if(!count($menu_srl_list)) return;
2092
+		if (!count($menu_srl_list)) return;
2093 2093
 		// Delete the value of menu_srls
2094
-		$args->menu_srls = implode(',',$menu_srl_list);
2094
+		$args->menu_srls = implode(',', $menu_srl_list);
2095 2095
 		$output = executeQuery('menu.deleteMenuLayout', $args);
2096
-		if(!$output->toBool()) return $output;
2096
+		if (!$output->toBool()) return $output;
2097 2097
 
2098 2098
 		$args->layout_srl = $layout_srl;
2099 2099
 		// Mapping menu_srls, layout_srl
2100
-		for($i=0;$i<count($menu_srl_list);$i++)
2100
+		for ($i = 0; $i < count($menu_srl_list); $i++)
2101 2101
 		{
2102 2102
 			$args->menu_srl = $menu_srl_list[$i];
2103 2103
 			$output = executeQuery('menu.insertMenuLayout', $args);
2104
-			if(!$output->toBool()) return $output;
2104
+			if (!$output->toBool()) return $output;
2105 2105
 		}
2106 2106
 	}
2107 2107
 
@@ -2114,47 +2114,47 @@  discard block
 block discarded – undo
2114 2114
 	{
2115 2115
 		// path setting
2116 2116
 		$path = sprintf('./files/attach/menu_button/%d/', $args->menu_srl);
2117
-		if($args->menu_normal_btn || $args->menu_hover_btn || $args->menu_active_btn && !is_dir($path))
2117
+		if ($args->menu_normal_btn || $args->menu_hover_btn || $args->menu_active_btn && !is_dir($path))
2118 2118
 		{
2119 2119
 			FileHandler::makeDir($path);
2120 2120
 		}
2121 2121
 
2122
-		if($args->isNormalDelete == 'Y' || $args->isHoverDelete == 'Y' || $args->isActiveDelete == 'Y')
2122
+		if ($args->isNormalDelete == 'Y' || $args->isHoverDelete == 'Y' || $args->isActiveDelete == 'Y')
2123 2123
 		{
2124 2124
 			$oMenuModel = getAdminModel('menu');
2125 2125
 			$itemInfo = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
2126 2126
 
2127
-			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2128
-			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2129
-			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2127
+			if ($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2128
+			if ($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2129
+			if ($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2130 2130
 		}
2131 2131
 
2132 2132
 		$returnArray = array();
2133 2133
 		$date = date('YmdHis');
2134 2134
 		// normal button
2135
-		if($args->menu_normal_btn)
2135
+		if ($args->menu_normal_btn)
2136 2136
 		{
2137
-			$tmp_arr = explode('.',$args->menu_normal_btn['name']);
2138
-			$ext = $tmp_arr[count($tmp_arr)-1];
2137
+			$tmp_arr = explode('.', $args->menu_normal_btn['name']);
2138
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2139 2139
 
2140 2140
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_normal_btn', $ext);
2141 2141
 
2142
-			if(checkUploadedFile($args->menu_normal_btn['tmp_name']))
2142
+			if (checkUploadedFile($args->menu_normal_btn['tmp_name']))
2143 2143
 			{
2144
-				move_uploaded_file ( $args->menu_normal_btn ['tmp_name'], $filename );
2144
+				move_uploaded_file($args->menu_normal_btn ['tmp_name'], $filename);
2145 2145
 				$returnArray ['normal_btn'] = $filename;
2146 2146
 			}
2147 2147
 		}
2148 2148
 
2149 2149
 		// hover button
2150
-		if($args->menu_hover_btn)
2150
+		if ($args->menu_hover_btn)
2151 2151
 		{
2152
-			$tmp_arr = explode('.',$args->menu_hover_btn['name']);
2153
-			$ext = $tmp_arr[count($tmp_arr)-1];
2152
+			$tmp_arr = explode('.', $args->menu_hover_btn['name']);
2153
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2154 2154
 
2155 2155
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_hover_btn', $ext);
2156 2156
 
2157
-			if(checkUploadedFile($args->menu_hover_btn['tmp_name']))
2157
+			if (checkUploadedFile($args->menu_hover_btn['tmp_name']))
2158 2158
 			{
2159 2159
 				move_uploaded_file($args->menu_hover_btn['tmp_name'], $filename);
2160 2160
 				$returnArray['hover_btn'] = $filename;
@@ -2162,14 +2162,14 @@  discard block
 block discarded – undo
2162 2162
 		}
2163 2163
 
2164 2164
 		// active button
2165
-		if($args->menu_active_btn)
2165
+		if ($args->menu_active_btn)
2166 2166
 		{
2167
-			$tmp_arr = explode('.',$args->menu_active_btn['name']);
2168
-			$ext = $tmp_arr[count($tmp_arr)-1];
2167
+			$tmp_arr = explode('.', $args->menu_active_btn['name']);
2168
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2169 2169
 
2170 2170
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_active_btn', $ext);
2171 2171
 
2172
-			if(checkUploadedFile($args->menu_active_btn['tmp_name']))
2172
+			if (checkUploadedFile($args->menu_active_btn['tmp_name']))
2173 2173
 			{
2174 2174
 				move_uploaded_file($args->menu_active_btn['tmp_name'], $filename);
2175 2175
 				$returnArray['active_btn'] = $filename;
@@ -2191,7 +2191,7 @@  discard block
 block discarded – undo
2191 2191
 			"active_btn"=>"",
2192 2192
 		);
2193 2193
 		//normal_btn
2194
-		if($menuItemInfo->normal_btn)
2194
+		if ($menuItemInfo->normal_btn)
2195 2195
 		{
2196 2196
 			$originFile = FileHandler::getRealPath($menuItemInfo->normal_btn);
2197 2197
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->normal_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'normal');
@@ -2201,7 +2201,7 @@  discard block
 block discarded – undo
2201 2201
 		}
2202 2202
 
2203 2203
 		//hover_btn
2204
-		if($menuItemInfo->hover_btn)
2204
+		if ($menuItemInfo->hover_btn)
2205 2205
 		{
2206 2206
 			$originFile = FileHandler::getRealPath($menuItemInfo->hover_btn);
2207 2207
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->hover_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'hover');
@@ -2211,7 +2211,7 @@  discard block
 block discarded – undo
2211 2211
 		}
2212 2212
 
2213 2213
 		//active_btn
2214
-		if($menuItemInfo->active_btn)
2214
+		if ($menuItemInfo->active_btn)
2215 2215
 		{
2216 2216
 			$originFile = FileHandler::getRealPath($menuItemInfo->active_btn);
2217 2217
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->active_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'active');
@@ -2226,9 +2226,9 @@  discard block
 block discarded – undo
2226 2226
 	{
2227 2227
 		$path = sprintf('./files/attach/menu_button/%d/', $menuSrl);
2228 2228
 		$tmp_arr = explode('.', $buttonPath);
2229
-		$ext = $tmp_arr[count($tmp_arr)-1];
2229
+		$ext = $tmp_arr[count($tmp_arr) - 1];
2230 2230
 		$date = date("YmdHis");
2231
-		return sprintf('%s%d.%s.%s.%s', $path, $menuItemSrl,$date,'menu_'.$mode.'_btn', $ext);
2231
+		return sprintf('%s%d.%s.%s.%s', $path, $menuItemSrl, $date, 'menu_' . $mode . '_btn', $ext);
2232 2232
 	}
2233 2233
 
2234 2234
 	public function makeHomemenuCacheFile($menuSrl)
Please login to merge, or discard this patch.
Braces   +296 added lines, -128 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
 			// List variables
1983 2114
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1984 2115
 			unset($name_arr_str);
@@ -1988,11 +2119,16 @@  discard block
 block discarded – undo
1988 2119
 			}
1989 2120
 			$name_str = sprintf('$_menu_names[%d] = array(%s); %s', $node->menu_item_srl, $name_arr_str, $child_output['name']);
1990 2121
 			// If url value is not empty in the current node, put the value into an array url_list
1991
-			if($node->url) $child_output['url_list'][] = $node->url;
2122
+			if($node->url) {
2123
+				$child_output['url_list'][] = $node->url;
2124
+			}
1992 2125
 			$output['url_list'] = array_merge($output['url_list'], $child_output['url_list']);
1993 2126
 			// If node->group_srls value exists
1994
-			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);
1995
-			else $group_check_code = "true";
2127
+			if($node->group_srls) {
2128
+				$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);
2129
+			} else {
2130
+				$group_check_code = "true";
2131
+			}
1996 2132
 			// List variables
1997 2133
 			$href = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->href);
1998 2134
 			$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
@@ -2000,8 +2136,9 @@  discard block
 block discarded – undo
2000 2136
 			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
2001 2137
 			{
2002 2138
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
2139
+			} else {
2140
+				$href = sprintf('"%s"', $url);
2003 2141
 			}
2004
-			else $href = sprintf('"%s"', $url);
2005 2142
 			$is_shortcut = $node->is_shortcut;
2006 2143
 			$open_window = $node->open_window;
2007 2144
 			$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->normal_btn);
@@ -2018,29 +2155,48 @@  discard block
 block discarded – undo
2018 2155
 			$expand = $node->expand;
2019 2156
 
2020 2157
 			$normal_btn = $node->normal_btn;
2021
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2022
-			else $normal_btn = '';
2158
+			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) {
2159
+				$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2160
+			} else {
2161
+				$normal_btn = '';
2162
+			}
2023 2163
 
2024 2164
 			$hover_btn = $node->hover_btn;
2025
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2026
-			else $hover_btn = '';
2165
+			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) {
2166
+				$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2167
+			} else {
2168
+				$hover_btn = '';
2169
+			}
2027 2170
 
2028 2171
 			$active_btn = $node->active_btn;
2029
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2030
-			else $active_btn = '';
2172
+			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) {
2173
+				$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2174
+			} else {
2175
+				$active_btn = '';
2176
+			}
2031 2177
 
2032 2178
 
2033 2179
 			$group_srls = $node->group_srls;
2034 2180
 
2035 2181
 			if($normal_btn)
2036 2182
 			{
2037
-				if($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2038
-				if($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2183
+				if($hover_btn) {
2184
+					$hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn);
2185
+				} else {
2186
+					$hover_str = '';
2187
+				}
2188
+				if($active_btn) {
2189
+					$active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn);
2190
+				} else {
2191
+					$active_str = '';
2192
+				}
2039 2193
 				$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);
2040
-				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);
2041
-				else $link_active = $link;
2042
-			}
2043
-			else
2194
+				if($active_btn) {
2195
+					$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);
2196
+				} else {
2197
+					$link_active = $link;
2198
+				}
2199
+			} else
2044 2200
 			{
2045 2201
 				$link_active = $link = sprintf('$_menu_names[%d][$lang_type]', $node->menu_item_srl);
2046 2202
 			}
@@ -2089,11 +2245,15 @@  discard block
 block discarded – undo
2089 2245
 	 */
2090 2246
 	function updateMenuLayout($layout_srl, $menu_srl_list)
2091 2247
 	{
2092
-		if(!count($menu_srl_list)) return;
2248
+		if(!count($menu_srl_list)) {
2249
+			return;
2250
+		}
2093 2251
 		// Delete the value of menu_srls
2094 2252
 		$args->menu_srls = implode(',',$menu_srl_list);
2095 2253
 		$output = executeQuery('menu.deleteMenuLayout', $args);
2096
-		if(!$output->toBool()) return $output;
2254
+		if(!$output->toBool()) {
2255
+			return $output;
2256
+		}
2097 2257
 
2098 2258
 		$args->layout_srl = $layout_srl;
2099 2259
 		// Mapping menu_srls, layout_srl
@@ -2101,7 +2261,9 @@  discard block
 block discarded – undo
2101 2261
 		{
2102 2262
 			$args->menu_srl = $menu_srl_list[$i];
2103 2263
 			$output = executeQuery('menu.insertMenuLayout', $args);
2104
-			if(!$output->toBool()) return $output;
2264
+			if(!$output->toBool()) {
2265
+				return $output;
2266
+			}
2105 2267
 		}
2106 2268
 	}
2107 2269
 
@@ -2124,9 +2286,15 @@  discard block
 block discarded – undo
2124 2286
 			$oMenuModel = getAdminModel('menu');
2125 2287
 			$itemInfo = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
2126 2288
 
2127
-			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2128
-			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2129
-			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2289
+			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) {
2290
+				FileHandler::removeFile($itemInfo->normal_btn);
2291
+			}
2292
+			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) {
2293
+				FileHandler::removeFile($itemInfo->hover_btn);
2294
+			}
2295
+			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) {
2296
+				FileHandler::removeFile($itemInfo->active_btn);
2297
+			}
2130 2298
 		}
2131 2299
 
2132 2300
 		$returnArray = array();
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 /**
4
- * menuAdminController class
5
- * admin controller class of the menu module
6
- *
7
- * @author NAVER ([email protected])
8
- * @package /modules/menu
9
- * @version 0.1
10
- */
4
+	 * menuAdminController class
5
+	 * admin controller class of the menu module
6
+	 *
7
+	 * @author NAVER ([email protected])
8
+	 * @package /modules/menu
9
+	 * @version 0.1
10
+	 */
11 11
 class menuAdminController extends menu
12 12
 {
13 13
 	/**
Please login to merge, or discard this patch.
modules/menu/menu.mobile.php 4 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -18,6 +18,7 @@
 block discarded – undo
18 18
 
19 19
 	/**
20 20
 	 * Menu depth arrange
21
+	 * @param integer $depth
21 22
 	 * @return void
22 23
 	 */
23 24
 	function straightenMenu($menu_item, $depth)
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 /**
4
- * menuMobile class
5
- * mobile class of the menu module
6
- *
7
- * @author NAVER ([email protected])
8
- * @package /modules/menu
9
- * @version 0.1
10
- */
4
+	 * menuMobile class
5
+	 * mobile class of the menu module
6
+	 *
7
+	 * @author NAVER ([email protected])
8
+	 * @package /modules/menu
9
+	 * @version 0.1
10
+	 */
11 11
 class menuMobile extends moduleObject
12 12
 {
13 13
 	/**
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -22,17 +22,17 @@  discard block
 block discarded – undo
22 22
 	 */
23 23
 	function straightenMenu($menu_item, $depth)
24 24
 	{
25
-		if(!$menu_item['link']) return;
25
+		if (!$menu_item['link']) return;
26 26
 		$obj = new stdClass;
27 27
 		$obj->href = $menu_item['href'];
28 28
 		$obj->depth = $depth;
29 29
 		$obj->text = $menu_item['text'];
30 30
 		$obj->open_window = $menu_item['open_window'];
31 31
 		$this->result[] = $obj;
32
-		if(!$menu_item['list']) return;
33
-		foreach($menu_item['list'] as $item)
32
+		if (!$menu_item['list']) return;
33
+		foreach ($menu_item['list'] as $item)
34 34
 		{
35
-			$this->straightenMenu($item, $depth+1);
35
+			$this->straightenMenu($item, $depth + 1);
36 36
 		}
37 37
 	}
38 38
 
@@ -43,25 +43,25 @@  discard block
 block discarded – undo
43 43
 	function dispMenuMenu()
44 44
 	{
45 45
 		$menu_srl = Context::get('menu_srl');
46
-		$oAdminModel =& getAdminModel('menu');
46
+		$oAdminModel = & getAdminModel('menu');
47 47
 		$menu_info = $oAdminModel->getMenu($menu_srl);
48 48
 
49
-		if(!$menu_srl)
49
+		if (!$menu_srl)
50 50
 		{
51 51
 			$oMenuAdminController = getAdminController('menu');
52 52
 			$homeMenuCacheFile = $oMenuAdminController->getHomeMenuCacheFile();
53 53
 
54
-			if(file_exists($homeMenuCacheFile))
54
+			if (file_exists($homeMenuCacheFile))
55 55
 			{
56 56
 				@include($homeMenuCacheFile);
57 57
 			}
58
-			$menu_info->php_file = './files/cache/menu/'.$homeMenuSrl.'.php';
58
+			$menu_info->php_file = './files/cache/menu/' . $homeMenuSrl . '.php';
59 59
 		}
60 60
 
61
-		if(file_exists($menu_info->php_file)) @include($menu_info->php_file);
62
-		if(is_array($menu->list))
61
+		if (file_exists($menu_info->php_file)) @include($menu_info->php_file);
62
+		if (is_array($menu->list))
63 63
 		{
64
-			foreach($menu->list as $menu_item)
64
+			foreach ($menu->list as $menu_item)
65 65
 			{
66 66
 				$this->straightenMenu($menu_item, 0);
67 67
 			}
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
 		Context::set('menu', $this->result);	
71 71
 
72
-		$this->setTemplatePath(sprintf("%stpl/",$this->module_path));
72
+		$this->setTemplatePath(sprintf("%stpl/", $this->module_path));
73 73
 		$this->setTemplateFile('menu.html');
74 74
 	}
75 75
 }
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,14 +22,18 @@  discard block
 block discarded – undo
22 22
 	 */
23 23
 	function straightenMenu($menu_item, $depth)
24 24
 	{
25
-		if(!$menu_item['link']) return;
25
+		if(!$menu_item['link']) {
26
+			return;
27
+		}
26 28
 		$obj = new stdClass;
27 29
 		$obj->href = $menu_item['href'];
28 30
 		$obj->depth = $depth;
29 31
 		$obj->text = $menu_item['text'];
30 32
 		$obj->open_window = $menu_item['open_window'];
31 33
 		$this->result[] = $obj;
32
-		if(!$menu_item['list']) return;
34
+		if(!$menu_item['list']) {
35
+			return;
36
+		}
33 37
 		foreach($menu_item['list'] as $item)
34 38
 		{
35 39
 			$this->straightenMenu($item, $depth+1);
@@ -58,7 +62,9 @@  discard block
 block discarded – undo
58 62
 			$menu_info->php_file = './files/cache/menu/'.$homeMenuSrl.'.php';
59 63
 		}
60 64
 
61
-		if(file_exists($menu_info->php_file)) @include($menu_info->php_file);
65
+		if(file_exists($menu_info->php_file)) {
66
+			@include($menu_info->php_file);
67
+		}
62 68
 		if(is_array($menu->list))
63 69
 		{
64 70
 			foreach($menu->list as $menu_item)
Please login to merge, or discard this patch.
modules/module/module.admin.controller.php 4 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -260,6 +260,9 @@  discard block
 block discarded – undo
260 260
 		return $module_srl;
261 261
 	}
262 262
 
263
+	/**
264
+	 * @param boolean $isProc
265
+	 */
263 266
 	private function _returnByProc($isProc, $msg='msg_invalid_request')
264 267
 	{
265 268
 		if(!$isProc)
@@ -938,6 +941,9 @@  discard block
 block discarded – undo
938 941
 
939 942
 	}
940 943
 
944
+	/**
945
+	 * @param string $skinVars
946
+	 */
941 947
 	public function setDesignInfo($moduleSrl = 0, $mid = '', $skinType = 'P', $layoutSrl = 0, $isSkinFix = 'Y', $skinName = '', $skinVars = NULL)
942 948
 	{
943 949
 		if(!$moduleSrl && !$mid)
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 3
 /**
4
- * @class  moduleAdminController
5
- * @author NAVER ([email protected])
6
- * @brief admin controller class of the module module
7
- */
4
+	 * @class  moduleAdminController
5
+	 * @author NAVER ([email protected])
6
+	 * @brief admin controller class of the module module
7
+	 */
8 8
 class moduleAdminController extends module
9 9
 {
10 10
 	/**
Please login to merge, or discard this patch.
Spacing   +161 added lines, -161 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 		$args = new stdClass();
23 23
 		$args->title = Context::get('title');
24 24
 		$output = executeQuery('module.insertModuleCategory', $args);
25
-		if(!$output->toBool()) return $output;
25
+		if (!$output->toBool()) return $output;
26 26
 
27 27
 		$this->setMessage("success_registed");
28 28
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	function procModuleAdminUpdateCategory()
37 37
 	{
38 38
 		$output = $this->doUpdateModuleCategory();
39
-		if(!$output->toBool()) return $output;
39
+		if (!$output->toBool()) return $output;
40 40
 
41 41
 		$this->setMessage('success_updated');
42 42
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	function procModuleAdminDeleteCategory()
51 51
 	{
52 52
 		$output = $this->doDeleteModuleCategory();
53
-		if(!$output->toBool()) return $output;
53
+		if (!$output->toBool()) return $output;
54 54
 
55 55
 		$this->setMessage('success_deleted');
56 56
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	function procModuleAdminCopyModule($args = NULL)
86 86
 	{
87 87
 		$isProc = false;
88
-		if(!$args)
88
+		if (!$args)
89 89
 		{
90 90
 			$isProc = true;
91 91
 			// Get information of the target module to copy
@@ -97,24 +97,24 @@  discard block
 block discarded – undo
97 97
 			$module_srl = $args->module_srl;
98 98
 		}
99 99
 
100
-		if(!$module_srl)
100
+		if (!$module_srl)
101 101
 		{
102 102
 			return $this->_returnByProc($isProc);
103 103
 		}
104 104
 
105 105
 		// Get module name to create and browser title
106 106
 		$clones = array();
107
-		for($i=1;$i<=10;$i++)
107
+		for ($i = 1; $i <= 10; $i++)
108 108
 		{
109
-			$mid = trim($args->{"mid_".$i});
110
-			if(!$mid) continue;
111
-			if(!preg_match("/^[a-zA-Z]([a-zA-Z0-9_]*)$/i", $mid)) return new Object(-1, 'msg_limit_mid');
112
-			$browser_title = $args->{"browser_title_".$i};
113
-			if(!$mid) continue;
114
-			if($mid && !$browser_title) $browser_title = $mid;
109
+			$mid = trim($args->{"mid_" . $i});
110
+			if (!$mid) continue;
111
+			if (!preg_match("/^[a-zA-Z]([a-zA-Z0-9_]*)$/i", $mid)) return new Object(-1, 'msg_limit_mid');
112
+			$browser_title = $args->{"browser_title_" . $i};
113
+			if (!$mid) continue;
114
+			if ($mid && !$browser_title) $browser_title = $mid;
115 115
 			$clones[$mid] = $browser_title;
116 116
 		}
117
-		if(count($clones) < 1)
117
+		if (count($clones) < 1)
118 118
 		{
119 119
 			return $this->_returnByProc($isProc);
120 120
 		}
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
 		$module_args->module_srl = $module_srl;
130 130
 		$output = executeQueryArray('module.getModuleGrants', $module_args);
131 131
 		$grant = array();
132
-		if($output->data)
132
+		if ($output->data)
133 133
 		{
134
-			foreach($output->data as $val) $grant[$val->name][] = $val->group_srl;
134
+			foreach ($output->data as $val) $grant[$val->name][] = $val->group_srl;
135 135
 		}
136 136
 
137 137
 		// get Extra Vars
@@ -139,9 +139,9 @@  discard block
 block discarded – undo
139 139
 		$extra_args->module_srl = $module_srl;
140 140
 		$extra_output = executeQueryArray('module.getModuleExtraVars', $extra_args);
141 141
 		$extra_vars = new stdClass();
142
-		if($extra_output->toBool() && is_array($extra_output->data))
142
+		if ($extra_output->toBool() && is_array($extra_output->data))
143 143
 		{
144
-			foreach($extra_output->data as $info)
144
+			foreach ($extra_output->data as $info)
145 145
 			{
146 146
 				$extra_vars->{$info->name} = $info->value;
147 147
 			}
@@ -150,17 +150,17 @@  discard block
 block discarded – undo
150 150
 		$tmpModuleSkinVars = $oModuleModel->getModuleSkinVars($module_srl);
151 151
 		$tmpModuleMobileSkinVars = $oModuleModel->getModuleMobileSkinVars($module_srl);
152 152
 
153
-		if($tmpModuleSkinVars)
153
+		if ($tmpModuleSkinVars)
154 154
 		{
155
-			foreach($tmpModuleSkinVars as $key=>$value)
155
+			foreach ($tmpModuleSkinVars as $key=>$value)
156 156
 			{
157 157
 				$moduleSkinVars->{$key} = $value->value;
158 158
 			}
159 159
 		}
160 160
 
161
-		if($tmpModuleMobileSkinVars)
161
+		if ($tmpModuleMobileSkinVars)
162 162
 		{
163
-			foreach($tmpModuleMobileSkinVars as $key=>$value)
163
+			foreach ($tmpModuleMobileSkinVars as $key=>$value)
164 164
 			{
165 165
 				$moduleMobileSkinVars->{$key} = $value->value;
166 166
 			}
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 		$triggerObj->moduleSrlList = array();
175 175
 
176 176
 		$errorLog = array();
177
-		foreach($clones as $mid => $browser_title)
177
+		foreach ($clones as $mid => $browser_title)
178 178
 		{
179 179
 			$clone_args = new stdClass;
180 180
 			$clone_args = clone $module_info;
@@ -188,29 +188,29 @@  discard block
 block discarded – undo
188 188
 			// Create a module
189 189
 			$output = $oModuleController->insertModule($clone_args);
190 190
 
191
-			if(!$output->toBool())
191
+			if (!$output->toBool())
192 192
 			{
193
-				$errorLog[] = $mid . ' : '. $output->message;
193
+				$errorLog[] = $mid . ' : ' . $output->message;
194 194
 				continue;
195 195
 			}
196 196
 			$module_srl = $output->get('module_srl');
197 197
 
198
-			if($module_info->module == 'page' && $extra_vars->page_type == 'ARTICLE')
198
+			if ($module_info->module == 'page' && $extra_vars->page_type == 'ARTICLE')
199 199
 			{
200 200
 				// copy document
201 201
 				$oDocumentAdminController = getAdminController('document');
202 202
 				$copyOutput = $oDocumentAdminController->copyDocumentModule(array($extra_vars->document_srl), $module_srl, $module_info->category_srl);
203 203
 				$document_srls = $copyOutput->get('copied_srls');
204
-				if($document_srls && count($document_srls) > 0)
204
+				if ($document_srls && count($document_srls) > 0)
205 205
 				{
206 206
 					$extra_vars->document_srl = array_pop($document_srls);
207 207
 				}
208 208
 
209
-				if($extra_vars->mdocument_srl)
209
+				if ($extra_vars->mdocument_srl)
210 210
 				{
211 211
 					$copyOutput = $oDocumentAdminController->copyDocumentModule(array($extra_vars->mdocument_srl), $module_srl, $module_info->category_srl);
212 212
 					$copiedSrls = $copyOutput->get('copied_srls');
213
-					if($copiedSrls && count($copiedSrls) > 0)
213
+					if ($copiedSrls && count($copiedSrls) > 0)
214 214
 					{
215 215
 						$extra_vars->mdocument_srl = array_pop($copiedSrls);
216 216
 					}
@@ -218,11 +218,11 @@  discard block
 block discarded – undo
218 218
 			}
219 219
 
220 220
 			// Grant module permissions
221
-			if(count($grant) > 0) $oModuleController->insertModuleGrants($module_srl, $grant);
222
-			if($extra_vars) $oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
221
+			if (count($grant) > 0) $oModuleController->insertModuleGrants($module_srl, $grant);
222
+			if ($extra_vars) $oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
223 223
 
224
-			if($moduleSkinVars) $oModuleController->insertModuleSkinVars($module_srl, $moduleSkinVars);
225
-			if($moduleMobileSkinVars) $oModuleController->insertModuleMobileSkinVars($module_srl, $moduleMobileSkinVars);
224
+			if ($moduleSkinVars) $oModuleController->insertModuleSkinVars($module_srl, $moduleSkinVars);
225
+			if ($moduleMobileSkinVars) $oModuleController->insertModuleMobileSkinVars($module_srl, $moduleMobileSkinVars);
226 226
 
227 227
 			$triggerObj->moduleSrlList[] = $module_srl;
228 228
 		}
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 
232 232
 		$oDB->commit();
233 233
 
234
-		if(count($errorLog) > 0)
234
+		if (count($errorLog) > 0)
235 235
 		{
236 236
 			$message = implode('\n', $errorLog);
237 237
 			$this->setMessage($message);
@@ -242,9 +242,9 @@  discard block
 block discarded – undo
242 242
 			$this->setMessage('success_registed');
243 243
 		}
244 244
 
245
-		if($isProc)
245
+		if ($isProc)
246 246
 		{
247
-			if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
247
+			if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
248 248
 			{
249 249
 				global $lang;
250 250
 				htmlHeader();
@@ -260,9 +260,9 @@  discard block
 block discarded – undo
260 260
 		return $module_srl;
261 261
 	}
262 262
 
263
-	private function _returnByProc($isProc, $msg='msg_invalid_request')
263
+	private function _returnByProc($isProc, $msg = 'msg_invalid_request')
264 264
 	{
265
-		if(!$isProc)
265
+		if (!$isProc)
266 266
 			return;
267 267
 		else
268 268
 		{
@@ -282,17 +282,17 @@  discard block
 block discarded – undo
282 282
 		// Get information of the module
283 283
 		$columnList = array('module_srl', 'module');
284 284
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
285
-		if(!$module_info) return new Object(-1,'msg_invalid_request');
285
+		if (!$module_info) return new Object(-1, 'msg_invalid_request');
286 286
 		// Register Admin ID
287 287
 		$oModuleController->deleteAdminId($module_srl);
288 288
 		$admin_member = Context::get('admin_member');
289
-		if($admin_member)
289
+		if ($admin_member)
290 290
 		{
291
-			$admin_members = explode(',',$admin_member);
292
-			foreach($admin_members as $admin_id)
291
+			$admin_members = explode(',', $admin_member);
292
+			foreach ($admin_members as $admin_id)
293 293
 			{
294 294
 				$admin_id = trim($admin_id);
295
-				if(!$admin_id) continue;
295
+				if (!$admin_id) continue;
296 296
 				$oModuleController->insertAdminId($module_srl, $admin_id);
297 297
 			}
298 298
 		}
@@ -307,13 +307,13 @@  discard block
 block discarded – undo
307 307
 		$grant_list->manager->default = 'manager';
308 308
 
309 309
 		$grant = new stdClass();
310
-		foreach($grant_list as $grant_name => $grant_info)
310
+		foreach ($grant_list as $grant_name => $grant_info)
311 311
 		{
312 312
 			// Get the default value
313
-			$default = Context::get($grant_name.'_default');
313
+			$default = Context::get($grant_name . '_default');
314 314
 			// -1 = Log-in user only, -2 = site members only, -3 = manager only, 0 = all users
315 315
 			$grant->{$grant_name} = array();
316
-			if(strlen($default))
316
+			if (strlen($default))
317 317
 			{
318 318
 				$grant->{$grant_name}[] = $default;
319 319
 				continue;
@@ -322,10 +322,10 @@  discard block
 block discarded – undo
322 322
 			else
323 323
 			{
324 324
 				$group_srls = Context::get($grant_name);
325
-				if($group_srls)
325
+				if ($group_srls)
326 326
 				{
327
-					if(strpos($group_srls,'|@|')!==false) $group_srls = explode('|@|',$group_srls);
328
-					elseif(strpos($group_srls,',')!==false) $group_srls = explode(',',$group_srls);
327
+					if (strpos($group_srls, '|@|') !== false) $group_srls = explode('|@|', $group_srls);
328
+					elseif (strpos($group_srls, ',') !== false) $group_srls = explode(',', $group_srls);
329 329
 					else $group_srls = array($group_srls);
330 330
 					$grant->{$grant_name} = $group_srls;
331 331
 				}
@@ -338,18 +338,18 @@  discard block
 block discarded – undo
338 338
 		$args = new stdClass();
339 339
 		$args->module_srl = $module_srl;
340 340
 		$output = executeQuery('module.deleteModuleGrants', $args);
341
-		if(!$output->toBool()) return $output;
341
+		if (!$output->toBool()) return $output;
342 342
 		// Permissions stored in the DB
343
-		foreach($grant as $grant_name => $group_srls)
343
+		foreach ($grant as $grant_name => $group_srls)
344 344
 		{
345
-			foreach($group_srls as $val)
345
+			foreach ($group_srls as $val)
346 346
 			{
347 347
 				$args = new stdClass();
348 348
 				$args->module_srl = $module_srl;
349 349
 				$args->name = $grant_name;
350 350
 				$args->group_srl = $val;
351 351
 				$output = executeQuery('module.insertModuleGrant', $args);
352
-				if(!$output->toBool()) return $output;
352
+				if (!$output->toBool()) return $output;
353 353
 			}
354 354
 		}
355 355
 		$this->setMessage('success_registed');
@@ -368,11 +368,11 @@  discard block
 block discarded – undo
368 368
 		$oModuleModel = getModel('module');
369 369
 		$columnList = array('module_srl', 'module', 'skin', 'mskin', 'is_skin_fix', 'is_mskin_fix');
370 370
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
371
-		if($module_info->module_srl)
371
+		if ($module_info->module_srl)
372 372
 		{
373
-			if($mode === 'M')
373
+			if ($mode === 'M')
374 374
 			{
375
-				if($module_info->is_mskin_fix == 'Y')
375
+				if ($module_info->is_mskin_fix == 'Y')
376 376
 				{
377 377
 					$skin = $module_info->mskin;
378 378
 				}
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 			}
384 384
 			else
385 385
 			{
386
-				if($module_info->is_skin_fix == 'Y')
386
+				if ($module_info->is_skin_fix == 'Y')
387 387
 				{
388 388
 					$skin = $module_info->skin;
389 389
 				}
@@ -394,9 +394,9 @@  discard block
 block discarded – undo
394 394
 			}
395 395
 
396 396
 			// Get skin information (to check extra_vars)
397
-			$module_path = _XE_PATH_ . 'modules/'.$module_info->module;
397
+			$module_path = _XE_PATH_ . 'modules/' . $module_info->module;
398 398
 
399
-			if($mode === 'M')
399
+			if ($mode === 'M')
400 400
 			{
401 401
 				$skin_info = $oModuleModel->loadSkinInfo($module_path, $skin, 'm.skins');
402 402
 				$skin_vars = $oModuleModel->getModuleMobileSkinVars($module_srl);
@@ -417,35 +417,35 @@  discard block
 block discarded – undo
417 417
 			unset($obj->module);
418 418
 			unset($obj->_mode);
419 419
 			// Separately handle if a type of extra_vars is an image in the original skin_info
420
-			if($skin_info->extra_vars)
420
+			if ($skin_info->extra_vars)
421 421
 			{
422
-				foreach($skin_info->extra_vars as $vars)
422
+				foreach ($skin_info->extra_vars as $vars)
423 423
 				{
424
-					if($vars->type!='image') continue;
424
+					if ($vars->type != 'image') continue;
425 425
 
426 426
 					$image_obj = $obj->{$vars->name};
427 427
 					// Get a variable to delete
428
-					$del_var = $obj->{"del_".$vars->name};
429
-					unset($obj->{"del_".$vars->name});
430
-					if($del_var == 'Y')
428
+					$del_var = $obj->{"del_" . $vars->name};
429
+					unset($obj->{"del_" . $vars->name});
430
+					if ($del_var == 'Y')
431 431
 					{
432 432
 						FileHandler::removeFile($skin_vars[$vars->name]->value);
433 433
 						continue;
434 434
 					}
435 435
 					// Use the previous data if not uploaded
436
-					if(!$image_obj['tmp_name'])
436
+					if (!$image_obj['tmp_name'])
437 437
 					{
438 438
 						$obj->{$vars->name} = $skin_vars[$vars->name]->value;
439 439
 						continue;
440 440
 					}
441 441
 					// Ignore if the file is not successfully uploaded
442
-					if(!is_uploaded_file($image_obj['tmp_name']) || !checkUploadedFile($image_obj['tmp_name']))
442
+					if (!is_uploaded_file($image_obj['tmp_name']) || !checkUploadedFile($image_obj['tmp_name']))
443 443
 					{
444 444
 						unset($obj->{$vars->name});
445 445
 						continue;
446 446
 					}
447 447
 					// Ignore if the file is not an image
448
-					if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name']))
448
+					if (!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name']))
449 449
 					{
450 450
 						unset($obj->{$vars->name});
451 451
 						continue;
@@ -453,11 +453,11 @@  discard block
 block discarded – undo
453 453
 					// Upload the file to a path
454 454
 					$path = sprintf("./files/attach/images/%s/", $module_srl);
455 455
 					// Create a directory
456
-					if(!FileHandler::makeDir($path)) return false;
456
+					if (!FileHandler::makeDir($path)) return false;
457 457
 
458
-					$filename = $path.$image_obj['name'];
458
+					$filename = $path . $image_obj['name'];
459 459
 					// Move the file
460
-					if(!move_uploaded_file($image_obj['tmp_name'], $filename))
460
+					if (!move_uploaded_file($image_obj['tmp_name'], $filename))
461 461
 					{
462 462
 						unset($obj->{$vars->name});
463 463
 						continue;
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 			*/
482 482
 			$oModuleController = getController('module');
483 483
 
484
-			if($mode === 'M')
484
+			if ($mode === 'M')
485 485
 			{
486 486
 				$output = $oModuleController->insertModuleMobileSkinVars($module_srl, $obj);
487 487
 			}
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
 			{
490 490
 				$output = $oModuleController->insertModuleSkinVars($module_srl, $obj);
491 491
 			}
492
-			if(!$output->toBool())
492
+			if (!$output->toBool())
493 493
 			{
494 494
 				return $output;
495 495
 			}
@@ -506,29 +506,29 @@  discard block
 block discarded – undo
506 506
 	{
507 507
 		$vars = Context::getRequestVars();
508 508
 
509
-		if(!$vars->module_srls) return new Object(-1,'msg_invalid_request');
509
+		if (!$vars->module_srls) return new Object(-1, 'msg_invalid_request');
510 510
 
511
-		$module_srls = explode(',',$vars->module_srls);
512
-		if(count($module_srls) < 1) return new Object(-1,'msg_invalid_request');
511
+		$module_srls = explode(',', $vars->module_srls);
512
+		if (count($module_srls) < 1) return new Object(-1, 'msg_invalid_request');
513 513
 
514 514
 		$oModuleModel = getModel('module');
515
-		$oModuleController= getController('module');
515
+		$oModuleController = getController('module');
516 516
 		$columnList = array('module_srl', 'module', 'menu_srl', 'site_srl', 'mid', 'browser_title', 'is_default', 'content', 'mcontent', 'open_rss', 'regdate');
517
-		$updateList = array('module_category_srl','layout_srl','skin','mlayout_srl','mskin','description','header_text','footer_text', 'use_mobile');
518
-		foreach($updateList as $key=>$val)
517
+		$updateList = array('module_category_srl', 'layout_srl', 'skin', 'mlayout_srl', 'mskin', 'description', 'header_text', 'footer_text', 'use_mobile');
518
+		foreach ($updateList as $key=>$val)
519 519
 		{
520
-			if(!strlen($vars->{$val}))
520
+			if (!strlen($vars->{$val}))
521 521
 			{
522 522
 				unset($updateList[$key]);
523 523
 				$columnList[] = $val;
524 524
 			}
525 525
 		}
526 526
 
527
-		foreach($module_srls as $module_srl)
527
+		foreach ($module_srls as $module_srl)
528 528
 		{
529 529
 			$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
530 530
 
531
-			foreach($updateList as $val)
531
+			foreach ($updateList as $val)
532 532
 			{
533 533
 				$module_info->{$val} = $vars->{$val};
534 534
 			}
@@ -536,9 +536,9 @@  discard block
 block discarded – undo
536 536
 		}
537 537
 
538 538
 		$this->setMessage('success_registed');
539
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
539
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
540 540
 		{
541
-			if(Context::get('success_return_url'))
541
+			if (Context::get('success_return_url'))
542 542
 			{
543 543
 				$this->setRedirectUrl(Context::get('success_return_url'));
544 544
 			}
@@ -561,10 +561,10 @@  discard block
 block discarded – undo
561 561
 	function procModuleAdminModuleGrantSetup()
562 562
 	{
563 563
 		$module_srls = Context::get('module_srls');
564
-		if(!$module_srls) return new Object(-1,'msg_invalid_request');
564
+		if (!$module_srls) return new Object(-1, 'msg_invalid_request');
565 565
 
566
-		$modules = explode(',',$module_srls);
567
-		if(count($modules) < 1) return new Object(-1,'msg_invalid_request');
566
+		$modules = explode(',', $module_srls);
567
+		if (count($modules) < 1) return new Object(-1, 'msg_invalid_request');
568 568
 
569 569
 		$oModuleController = getController('module');
570 570
 		$oModuleModel = getModel('module');
@@ -581,13 +581,13 @@  discard block
 block discarded – undo
581 581
 
582 582
 		$grant = new stdClass;
583 583
 
584
-		foreach($grant_list as $grant_name => $grant_info)
584
+		foreach ($grant_list as $grant_name => $grant_info)
585 585
 		{
586 586
 			// Get the default value
587
-			$default = Context::get($grant_name.'_default');
587
+			$default = Context::get($grant_name . '_default');
588 588
 			// -1 = Sign only, 0 = all users
589 589
 			$grant->{$grant_name} = array();
590
-			if(strlen($default))
590
+			if (strlen($default))
591 591
 			{
592 592
 				$grant->{$grant_name}[] = $default;
593 593
 				continue;
@@ -596,12 +596,12 @@  discard block
 block discarded – undo
596 596
 			else
597 597
 			{
598 598
 				$group_srls = Context::get($grant_name);
599
-				if($group_srls)
599
+				if ($group_srls)
600 600
 				{
601
-					if(!is_array($group_srls))
601
+					if (!is_array($group_srls))
602 602
 					{
603
-						if(strpos($group_srls,'|@|')!==false) $group_srls = explode('|@|',$group_srls);
604
-						elseif(strpos($group_srls,',')!==false) $group_srls = explode(',',$group_srls);
603
+						if (strpos($group_srls, '|@|') !== false) $group_srls = explode('|@|', $group_srls);
604
+						elseif (strpos($group_srls, ',') !== false) $group_srls = explode(',', $group_srls);
605 605
 						else $group_srls = array($group_srls);
606 606
 					}
607 607
 					$grant->{$grant_name} = $group_srls;
@@ -612,30 +612,30 @@  discard block
 block discarded – undo
612 612
 		}
613 613
 
614 614
 		// Stored in the DB
615
-		foreach($modules as $module_srl)
615
+		foreach ($modules as $module_srl)
616 616
 		{
617 617
 			$args = new stdClass();
618 618
 			$args->module_srl = $module_srl;
619 619
 			$output = executeQuery('module.deleteModuleGrants', $args);
620
-			if(!$output->toBool()) continue;
620
+			if (!$output->toBool()) continue;
621 621
 			// Permissions stored in the DB
622
-			foreach($grant as $grant_name => $group_srls)
622
+			foreach ($grant as $grant_name => $group_srls)
623 623
 			{
624
-				foreach($group_srls as $val)
624
+				foreach ($group_srls as $val)
625 625
 				{
626 626
 					$args = new stdClass();
627 627
 					$args->module_srl = $module_srl;
628 628
 					$args->name = $grant_name;
629 629
 					$args->group_srl = $val;
630 630
 					$output = executeQuery('module.insertModuleGrant', $args);
631
-					if(!$output->toBool()) return $output;
631
+					if (!$output->toBool()) return $output;
632 632
 				}
633 633
 			}
634 634
 		}
635 635
 		$this->setMessage('success_registed');
636
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
636
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
637 637
 		{
638
-			if(Context::get('success_return_url'))
638
+			if (Context::get('success_return_url'))
639 639
 			{
640 640
 				$this->setRedirectUrl(Context::get('success_return_url'));
641 641
 			}
@@ -662,38 +662,38 @@  discard block
 block discarded – undo
662 662
 		$target = Context::get('target');
663 663
 		$module = Context::get('module');
664 664
 		$args = new stdClass();
665
-		$args->site_srl = (int)$site_module_info->site_srl;
666
-		$args->name = str_replace(' ','_',Context::get('lang_code'));
667
-		$args->lang_name = str_replace(' ','_',Context::get('lang_name'));
668
-		if(!empty($args->lang_name)) $args->name = $args->lang_name;
665
+		$args->site_srl = (int) $site_module_info->site_srl;
666
+		$args->name = str_replace(' ', '_', Context::get('lang_code'));
667
+		$args->lang_name = str_replace(' ', '_', Context::get('lang_name'));
668
+		if (!empty($args->lang_name)) $args->name = $args->lang_name;
669 669
 
670 670
 		// if args->name is empty, random generate for user define language
671
-		if(empty($args->name)) $args->name = 'userLang'.date('YmdHis').''.sprintf('%03d', mt_rand(0, 100));
671
+		if (empty($args->name)) $args->name = 'userLang' . date('YmdHis') . '' . sprintf('%03d', mt_rand(0, 100));
672 672
 
673
-		if(!$args->name) return new Object(-1,'msg_invalid_request');
673
+		if (!$args->name) return new Object(-1, 'msg_invalid_request');
674 674
 		// Check whether a language code exists
675 675
 		$output = executeQueryArray('module.getLang', $args);
676
-		if(!$output->toBool()) return $output;
676
+		if (!$output->toBool()) return $output;
677 677
 		// If exists, clear the old values for updating
678
-		if($output->data) $output = executeQuery('module.deleteLang', $args);
679
-		if(!$output->toBool()) return $output;
678
+		if ($output->data) $output = executeQuery('module.deleteLang', $args);
679
+		if (!$output->toBool()) return $output;
680 680
 		// Enter
681 681
 		$lang_supported = Context::get('lang_supported');
682
-		foreach($lang_supported as $key => $val)
682
+		foreach ($lang_supported as $key => $val)
683 683
 		{
684 684
 			$args->lang_code = $key;
685 685
 			$args->value = trim(Context::get($key));
686 686
 
687 687
 			// if request method is json, strip slashes
688
-			if(Context::getRequestMethod() == 'JSON' && version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc())
688
+			if (Context::getRequestMethod() == 'JSON' && version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc())
689 689
 			{
690 690
 				$args->value = stripslashes($args->value);
691 691
 			}
692 692
 
693
-			if($args->value)
693
+			if ($args->value)
694 694
 			{
695 695
 				$output = executeQuery('module.insertLang', $args);
696
-				if(!$output->toBool()) return $output;
696
+				if (!$output->toBool()) return $output;
697 697
 			}
698 698
 		}
699 699
 		$this->makeCacheDefinedLangCode($args->site_srl);
@@ -713,14 +713,14 @@  discard block
 block discarded – undo
713 713
 		// Get language code
714 714
 		$site_module_info = Context::get('site_module_info');
715 715
 		$args = new stdClass();
716
-		$args->site_srl = (int)$site_module_info->site_srl;
717
-		$args->name = str_replace(' ','_',Context::get('name'));
718
-		$args->lang_name = str_replace(' ','_',Context::get('lang_name'));
719
-		if(!empty($args->lang_name)) $args->name = $args->lang_name;
720
-		if(!$args->name) return new Object(-1,'msg_invalid_request');
716
+		$args->site_srl = (int) $site_module_info->site_srl;
717
+		$args->name = str_replace(' ', '_', Context::get('name'));
718
+		$args->lang_name = str_replace(' ', '_', Context::get('lang_name'));
719
+		if (!empty($args->lang_name)) $args->name = $args->lang_name;
720
+		if (!$args->name) return new Object(-1, 'msg_invalid_request');
721 721
 
722 722
 		$output = executeQuery('module.deleteLang', $args);
723
-		if(!$output->toBool()) return $output;
723
+		if (!$output->toBool()) return $output;
724 724
 		$this->makeCacheDefinedLangCode($args->site_srl);
725 725
 
726 726
 		$this->setMessage("success_deleted", 'info');
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 
732 732
 	function procModuleAdminGetList()
733 733
 	{
734
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
734
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
735 735
 
736 736
 		$oModuleController = getController('module');
737 737
 		$oModuleModel = getModel('module');
@@ -744,12 +744,12 @@  discard block
 block discarded – undo
744 744
 		$args = new stdClass;
745 745
 		$logged_info = Context::get('logged_info');
746 746
 		$site_module_info = Context::get('site_module_info');
747
-		if($site_keyword) $args->site_keyword = $site_keyword;
747
+		if ($site_keyword) $args->site_keyword = $site_keyword;
748 748
 
749
-		if(!$site_srl)
749
+		if (!$site_srl)
750 750
 		{
751
-			if($logged_info->is_admin == 'Y' && !$site_keyword && !$vid) $args->site_srl = 0;
752
-			else $args->site_srl = (int)$site_module_info->site_srl;
751
+			if ($logged_info->is_admin == 'Y' && !$site_keyword && !$vid) $args->site_srl = 0;
752
+			else $args->site_srl = (int) $site_module_info->site_srl;
753 753
 		}
754 754
 		else $args->site_srl = $site_srl;
755 755
 
@@ -759,12 +759,12 @@  discard block
 block discarded – undo
759 759
 		// Get a list of modules at the site
760 760
 		$output = executeQueryArray('module.getSiteModules', $args);
761 761
 		$mid_list = array();
762
-		if(count($output->data) > 0)
762
+		if (count($output->data) > 0)
763 763
 		{
764
-			foreach($output->data as $val)
764
+			foreach ($output->data as $val)
765 765
 			{
766 766
 				$module = trim($val->module);
767
-				if(!$module) continue;
767
+				if (!$module) continue;
768 768
 
769 769
 				// replace user defined lang.
770 770
 				$oModuleController->replaceDefinedLangCode($val->browser_title);
@@ -775,7 +775,7 @@  discard block
 block discarded – undo
775 775
 				$obj->browser_title = $val->browser_title;
776 776
 				$obj->mid = $val->mid;
777 777
 				$obj->module_category_srl = $val->module_category_srl;
778
-				if($val->module_category_srl > 0)
778
+				if ($val->module_category_srl > 0)
779 779
 				{
780 780
 					$moduleCategorySrl[] = $val->module_category_srl;
781 781
 				}
@@ -787,23 +787,23 @@  discard block
 block discarded – undo
787 787
 		$moduleCategorySrl = array_unique($moduleCategorySrl);
788 788
 		$output = $oModuleModel->getModuleCategories($moduleCategorySrl);
789 789
 		$categoryNameList = array();
790
-		if(is_array($output))
790
+		if (is_array($output))
791 791
 		{
792
-			foreach($output as $value)
792
+			foreach ($output as $value)
793 793
 			{
794 794
 				$categoryNameList[$value->module_category_srl] = $value->title;
795 795
 			}
796 796
 		}
797 797
 
798 798
 		$selected_module = Context::get('selected_module');
799
-		if(count($mid_list) > 0)
799
+		if (count($mid_list) > 0)
800 800
 		{
801
-			foreach($mid_list as $module => $val)
801
+			foreach ($mid_list as $module => $val)
802 802
 			{
803
-				if(!$selected_module) $selected_module = $module;
803
+				if (!$selected_module) $selected_module = $module;
804 804
 				$xml_info = $oModuleModel->getModuleInfoXml($module);
805 805
 
806
-				if(!$xml_info)
806
+				if (!$xml_info)
807 807
 				{
808 808
 					unset($mid_list[$module]);
809 809
 					continue;
@@ -812,14 +812,14 @@  discard block
 block discarded – undo
812 812
 				$mid_list[$module]->title = $xml_info->title;
813 813
 
814 814
 				// change module category srl to title
815
-				if(is_array($val->list))
815
+				if (is_array($val->list))
816 816
 				{
817
-					foreach($val->list as $key=>$value)
817
+					foreach ($val->list as $key=>$value)
818 818
 					{
819
-						if($value->module_category_srl > 0)
819
+						if ($value->module_category_srl > 0)
820 820
 						{
821 821
 							$categorySrl = $mid_list[$module]->list[$key]->module_category_srl;
822
-							if(isset($categoryNameList[$categorySrl]))
822
+							if (isset($categoryNameList[$categorySrl]))
823 823
 							{
824 824
 								$mid_list[$module]->list[$key]->module_category_srl = $categoryNameList[$categorySrl];
825 825
 							}
@@ -847,23 +847,23 @@  discard block
 block discarded – undo
847 847
 		$args = new stdClass();
848 848
 
849 849
 		// Get the language file of the current site
850
-		if(!$site_srl)
850
+		if (!$site_srl)
851 851
 		{
852 852
 			$site_module_info = Context::get('site_module_info');
853
-			$args->site_srl = (int)$site_module_info->site_srl;
853
+			$args->site_srl = (int) $site_module_info->site_srl;
854 854
 		}
855 855
 		else
856 856
 		{
857 857
 			$args->site_srl = $site_srl;
858 858
 		}
859 859
 		$output = executeQueryArray('module.getLang', $args);
860
-		if(!$output->toBool() || !$output->data) return;
860
+		if (!$output->toBool() || !$output->data) return;
861 861
 		// Set the cache directory
862
-		$cache_path = _XE_PATH_.'files/cache/lang_defined/';
862
+		$cache_path = _XE_PATH_ . 'files/cache/lang_defined/';
863 863
 		FileHandler::makeDir($cache_path);
864 864
 
865 865
 		$langMap = array();
866
-		foreach($output->data as $val)
866
+		foreach ($output->data as $val)
867 867
 		{
868 868
 			$langMap[$val->lang_code][$val->name] = $val->value;
869 869
 		}
@@ -872,27 +872,27 @@  discard block
 block discarded – undo
872 872
 		$dbInfo = Context::getDBInfo();
873 873
 		$defaultLang = $dbInfo->lang_type;
874 874
 
875
-		if(!is_array($langMap[$defaultLang]))
875
+		if (!is_array($langMap[$defaultLang]))
876 876
 		{
877 877
 			$langMap[$defaultLang] = array();
878 878
 		}
879 879
 
880
-		foreach($lang_supported as $langCode => $langName)
880
+		foreach ($lang_supported as $langCode => $langName)
881 881
 		{
882
-			if(!is_array($langMap[$langCode]))
882
+			if (!is_array($langMap[$langCode]))
883 883
 			{
884 884
 				$langMap[$langCode] = array();
885 885
 			}
886 886
 
887 887
 			$langMap[$langCode] += $langMap[$defaultLang];
888
-			foreach($lang_supported as $targetLangCode => $targetLangName)
888
+			foreach ($lang_supported as $targetLangCode => $targetLangName)
889 889
 			{
890
-				if($langCode == $targetLangCode || $langCode == $defaultLang)
890
+				if ($langCode == $targetLangCode || $langCode == $defaultLang)
891 891
 				{
892 892
 					continue;
893 893
 				}
894 894
 
895
-				if(!is_array($langMap[$targetLangCode]))
895
+				if (!is_array($langMap[$targetLangCode]))
896 896
 				{
897 897
 					$langMap[$targetLangCode] = array();
898 898
 				}
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
 			}
902 902
 
903 903
 			$buff = array("<?php if(!defined('__XE__')) exit();");
904
-			foreach($langMap[$langCode] as $code => $value)
904
+			foreach ($langMap[$langCode] as $code => $value)
905 905
 			{
906 906
 				$buff[] = sprintf('$lang[\'%s\'] = \'%s\';', $code, addcslashes($value, "'"));
907 907
 			}
@@ -924,7 +924,7 @@  discard block
 block discarded – undo
924 924
 
925 925
 		$isSkinFix = Context::get('is_skin_fix');
926 926
 
927
-		if($isSkinFix)
927
+		if ($isSkinFix)
928 928
 		{
929 929
 			$isSkinFix = ($isSkinFix == 'N') ? 'N' : 'Y';
930 930
 		}
@@ -940,14 +940,14 @@  discard block
 block discarded – undo
940 940
 
941 941
 	public function setDesignInfo($moduleSrl = 0, $mid = '', $skinType = 'P', $layoutSrl = 0, $isSkinFix = 'Y', $skinName = '', $skinVars = NULL)
942 942
 	{
943
-		if(!$moduleSrl && !$mid)
943
+		if (!$moduleSrl && !$mid)
944 944
 		{
945 945
 			return $this->stop(-1, 'msg_invalid_request');
946 946
 		}
947 947
 
948 948
 		$oModuleModel = getModel('module');
949 949
 
950
-		if($mid)
950
+		if ($mid)
951 951
 		{
952 952
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($mid);
953 953
 		}
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
 			$moduleInfo = $oModuleModel->getModuleInfoByModuleSrl($moduleSrl);
957 957
 		}
958 958
 
959
-		if(!$moduleInfo)
959
+		if (!$moduleInfo)
960 960
 		{
961 961
 			return $this->stop(-1, 'msg_module_not_exists');
962 962
 		}
@@ -965,26 +965,26 @@  discard block
 block discarded – undo
965 965
 		$layoutTargetValue = ($skinType == 'M') ? 'mlayout_srl' : 'layout_srl';
966 966
 		$skinFixTargetValue = ($skinType == 'M') ? 'is_mskin_fix' : 'is_skin_fix';
967 967
 
968
-		if(strlen($layoutSrl))
968
+		if (strlen($layoutSrl))
969 969
 		{
970 970
 			$moduleInfo->{$layoutTargetValue} = $layoutSrl;
971 971
 		}
972 972
 
973
-		if(strlen($isSkinFix))
973
+		if (strlen($isSkinFix))
974 974
 		{
975 975
 			$moduleInfo->{$skinFixTargetValue} = $isSkinFix;
976 976
 		}
977 977
 
978
-		if($isSkinFix == 'Y')
978
+		if ($isSkinFix == 'Y')
979 979
 		{
980 980
 			$moduleInfo->{$skinTargetValue} = $skinName;
981 981
 			$skinVars = json_decode($skinVars);
982 982
 
983
-			if(is_array($skinVars))
983
+			if (is_array($skinVars))
984 984
 			{
985
-				foreach($skinVars as $key => $val)
985
+				foreach ($skinVars as $key => $val)
986 986
 				{
987
-					if(empty($val))
987
+					if (empty($val))
988 988
 					{
989 989
 						continue;
990 990
 					}
@@ -1005,7 +1005,7 @@  discard block
 block discarded – undo
1005 1005
 		$menuItemSrl = Context::get('menu_item_srl');
1006 1006
 		$useMobile = Context::get('use_mobile');
1007 1007
 
1008
-		if(!$menuItemSrl)
1008
+		if (!$menuItemSrl)
1009 1009
 		{
1010 1010
 			return $this->stop(-1, 'msg_invalid_request');
1011 1011
 		}
Please login to merge, or discard this patch.
Braces   +155 added lines, -79 removed lines patch added patch discarded remove patch
@@ -22,7 +22,9 @@  discard block
 block discarded – undo
22 22
 		$args = new stdClass();
23 23
 		$args->title = Context::get('title');
24 24
 		$output = executeQuery('module.insertModuleCategory', $args);
25
-		if(!$output->toBool()) return $output;
25
+		if(!$output->toBool()) {
26
+			return $output;
27
+		}
26 28
 
27 29
 		$this->setMessage("success_registed");
28 30
 
@@ -36,7 +38,9 @@  discard block
 block discarded – undo
36 38
 	function procModuleAdminUpdateCategory()
37 39
 	{
38 40
 		$output = $this->doUpdateModuleCategory();
39
-		if(!$output->toBool()) return $output;
41
+		if(!$output->toBool()) {
42
+			return $output;
43
+		}
40 44
 
41 45
 		$this->setMessage('success_updated');
42 46
 
@@ -50,7 +54,9 @@  discard block
 block discarded – undo
50 54
 	function procModuleAdminDeleteCategory()
51 55
 	{
52 56
 		$output = $this->doDeleteModuleCategory();
53
-		if(!$output->toBool()) return $output;
57
+		if(!$output->toBool()) {
58
+			return $output;
59
+		}
54 60
 
55 61
 		$this->setMessage('success_deleted');
56 62
 
@@ -91,8 +97,7 @@  discard block
 block discarded – undo
91 97
 			// Get information of the target module to copy
92 98
 			$module_srl = Context::get('module_srl');
93 99
 			$args = Context::getRequestVars();
94
-		}
95
-		else
100
+		} else
96 101
 		{
97 102
 			$module_srl = $args->module_srl;
98 103
 		}
@@ -107,11 +112,19 @@  discard block
 block discarded – undo
107 112
 		for($i=1;$i<=10;$i++)
108 113
 		{
109 114
 			$mid = trim($args->{"mid_".$i});
110
-			if(!$mid) continue;
111
-			if(!preg_match("/^[a-zA-Z]([a-zA-Z0-9_]*)$/i", $mid)) return new Object(-1, 'msg_limit_mid');
115
+			if(!$mid) {
116
+				continue;
117
+			}
118
+			if(!preg_match("/^[a-zA-Z]([a-zA-Z0-9_]*)$/i", $mid)) {
119
+				return new Object(-1, 'msg_limit_mid');
120
+			}
112 121
 			$browser_title = $args->{"browser_title_".$i};
113
-			if(!$mid) continue;
114
-			if($mid && !$browser_title) $browser_title = $mid;
122
+			if(!$mid) {
123
+				continue;
124
+			}
125
+			if($mid && !$browser_title) {
126
+				$browser_title = $mid;
127
+			}
115 128
 			$clones[$mid] = $browser_title;
116 129
 		}
117 130
 		if(count($clones) < 1)
@@ -131,7 +144,9 @@  discard block
 block discarded – undo
131 144
 		$grant = array();
132 145
 		if($output->data)
133 146
 		{
134
-			foreach($output->data as $val) $grant[$val->name][] = $val->group_srl;
147
+			foreach($output->data as $val) {
148
+				$grant[$val->name][] = $val->group_srl;
149
+			}
135 150
 		}
136 151
 
137 152
 		// get Extra Vars
@@ -218,11 +233,19 @@  discard block
 block discarded – undo
218 233
 			}
219 234
 
220 235
 			// Grant module permissions
221
-			if(count($grant) > 0) $oModuleController->insertModuleGrants($module_srl, $grant);
222
-			if($extra_vars) $oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
236
+			if(count($grant) > 0) {
237
+				$oModuleController->insertModuleGrants($module_srl, $grant);
238
+			}
239
+			if($extra_vars) {
240
+				$oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
241
+			}
223 242
 
224
-			if($moduleSkinVars) $oModuleController->insertModuleSkinVars($module_srl, $moduleSkinVars);
225
-			if($moduleMobileSkinVars) $oModuleController->insertModuleMobileSkinVars($module_srl, $moduleMobileSkinVars);
243
+			if($moduleSkinVars) {
244
+				$oModuleController->insertModuleSkinVars($module_srl, $moduleSkinVars);
245
+			}
246
+			if($moduleMobileSkinVars) {
247
+				$oModuleController->insertModuleMobileSkinVars($module_srl, $moduleMobileSkinVars);
248
+			}
226 249
 
227 250
 			$triggerObj->moduleSrlList[] = $module_srl;
228 251
 		}
@@ -235,8 +258,7 @@  discard block
 block discarded – undo
235 258
 		{
236 259
 			$message = implode('\n', $errorLog);
237 260
 			$this->setMessage($message);
238
-		}
239
-		else
261
+		} else
240 262
 		{
241 263
 			$message = $lang->success_registed;
242 264
 			$this->setMessage('success_registed');
@@ -262,9 +284,9 @@  discard block
 block discarded – undo
262 284
 
263 285
 	private function _returnByProc($isProc, $msg='msg_invalid_request')
264 286
 	{
265
-		if(!$isProc)
266
-			return;
267
-		else
287
+		if(!$isProc) {
288
+					return;
289
+		} else
268 290
 		{
269 291
 			return new Object(-1, $msg);
270 292
 		}
@@ -282,7 +304,9 @@  discard block
 block discarded – undo
282 304
 		// Get information of the module
283 305
 		$columnList = array('module_srl', 'module');
284 306
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
285
-		if(!$module_info) return new Object(-1,'msg_invalid_request');
307
+		if(!$module_info) {
308
+			return new Object(-1,'msg_invalid_request');
309
+		}
286 310
 		// Register Admin ID
287 311
 		$oModuleController->deleteAdminId($module_srl);
288 312
 		$admin_member = Context::get('admin_member');
@@ -292,7 +316,9 @@  discard block
 block discarded – undo
292 316
 			foreach($admin_members as $admin_id)
293 317
 			{
294 318
 				$admin_id = trim($admin_id);
295
-				if(!$admin_id) continue;
319
+				if(!$admin_id) {
320
+					continue;
321
+				}
296 322
 				$oModuleController->insertAdminId($module_srl, $admin_id);
297 323
 			}
298 324
 		}
@@ -318,15 +344,18 @@  discard block
 block discarded – undo
318 344
 				$grant->{$grant_name}[] = $default;
319 345
 				continue;
320 346
 				// users in a particular group
321
-			}
322
-			else
347
+			} else
323 348
 			{
324 349
 				$group_srls = Context::get($grant_name);
325 350
 				if($group_srls)
326 351
 				{
327
-					if(strpos($group_srls,'|@|')!==false) $group_srls = explode('|@|',$group_srls);
328
-					elseif(strpos($group_srls,',')!==false) $group_srls = explode(',',$group_srls);
329
-					else $group_srls = array($group_srls);
352
+					if(strpos($group_srls,'|@|')!==false) {
353
+						$group_srls = explode('|@|',$group_srls);
354
+					} elseif(strpos($group_srls,',')!==false) {
355
+						$group_srls = explode(',',$group_srls);
356
+					} else {
357
+						$group_srls = array($group_srls);
358
+					}
330 359
 					$grant->{$grant_name} = $group_srls;
331 360
 				}
332 361
 				continue;
@@ -338,7 +367,9 @@  discard block
 block discarded – undo
338 367
 		$args = new stdClass();
339 368
 		$args->module_srl = $module_srl;
340 369
 		$output = executeQuery('module.deleteModuleGrants', $args);
341
-		if(!$output->toBool()) return $output;
370
+		if(!$output->toBool()) {
371
+			return $output;
372
+		}
342 373
 		// Permissions stored in the DB
343 374
 		foreach($grant as $grant_name => $group_srls)
344 375
 		{
@@ -349,7 +380,9 @@  discard block
 block discarded – undo
349 380
 				$args->name = $grant_name;
350 381
 				$args->group_srl = $val;
351 382
 				$output = executeQuery('module.insertModuleGrant', $args);
352
-				if(!$output->toBool()) return $output;
383
+				if(!$output->toBool()) {
384
+					return $output;
385
+				}
353 386
 			}
354 387
 		}
355 388
 		$this->setMessage('success_registed');
@@ -375,19 +408,16 @@  discard block
 block discarded – undo
375 408
 				if($module_info->is_mskin_fix == 'Y')
376 409
 				{
377 410
 					$skin = $module_info->mskin;
378
-				}
379
-				else
411
+				} else
380 412
 				{
381 413
 					$skin = $oModuleModel->getModuleDefaultSkin($module_info->module, 'M');
382 414
 				}
383
-			}
384
-			else
415
+			} else
385 416
 			{
386 417
 				if($module_info->is_skin_fix == 'Y')
387 418
 				{
388 419
 					$skin = $module_info->skin;
389
-				}
390
-				else
420
+				} else
391 421
 				{
392 422
 					$skin = $oModuleModel->getModuleDefaultSkin($module_info->module, 'P');
393 423
 				}
@@ -400,8 +430,7 @@  discard block
 block discarded – undo
400 430
 			{
401 431
 				$skin_info = $oModuleModel->loadSkinInfo($module_path, $skin, 'm.skins');
402 432
 				$skin_vars = $oModuleModel->getModuleMobileSkinVars($module_srl);
403
-			}
404
-			else
433
+			} else
405 434
 			{
406 435
 				$skin_info = $oModuleModel->loadSkinInfo($module_path, $skin);
407 436
 				$skin_vars = $oModuleModel->getModuleSkinVars($module_srl);
@@ -421,7 +450,9 @@  discard block
 block discarded – undo
421 450
 			{
422 451
 				foreach($skin_info->extra_vars as $vars)
423 452
 				{
424
-					if($vars->type!='image') continue;
453
+					if($vars->type!='image') {
454
+						continue;
455
+					}
425 456
 
426 457
 					$image_obj = $obj->{$vars->name};
427 458
 					// Get a variable to delete
@@ -453,7 +484,9 @@  discard block
 block discarded – undo
453 484
 					// Upload the file to a path
454 485
 					$path = sprintf("./files/attach/images/%s/", $module_srl);
455 486
 					// Create a directory
456
-					if(!FileHandler::makeDir($path)) return false;
487
+					if(!FileHandler::makeDir($path)) {
488
+						return false;
489
+					}
457 490
 
458 491
 					$filename = $path.$image_obj['name'];
459 492
 					// Move the file
@@ -484,8 +517,7 @@  discard block
 block discarded – undo
484 517
 			if($mode === 'M')
485 518
 			{
486 519
 				$output = $oModuleController->insertModuleMobileSkinVars($module_srl, $obj);
487
-			}
488
-			else
520
+			} else
489 521
 			{
490 522
 				$output = $oModuleController->insertModuleSkinVars($module_srl, $obj);
491 523
 			}
@@ -506,10 +538,14 @@  discard block
 block discarded – undo
506 538
 	{
507 539
 		$vars = Context::getRequestVars();
508 540
 
509
-		if(!$vars->module_srls) return new Object(-1,'msg_invalid_request');
541
+		if(!$vars->module_srls) {
542
+			return new Object(-1,'msg_invalid_request');
543
+		}
510 544
 
511 545
 		$module_srls = explode(',',$vars->module_srls);
512
-		if(count($module_srls) < 1) return new Object(-1,'msg_invalid_request');
546
+		if(count($module_srls) < 1) {
547
+			return new Object(-1,'msg_invalid_request');
548
+		}
513 549
 
514 550
 		$oModuleModel = getModel('module');
515 551
 		$oModuleController= getController('module');
@@ -541,8 +577,7 @@  discard block
 block discarded – undo
541 577
 			if(Context::get('success_return_url'))
542 578
 			{
543 579
 				$this->setRedirectUrl(Context::get('success_return_url'));
544
-			}
545
-			else
580
+			} else
546 581
 			{
547 582
 				global $lang;
548 583
 				htmlHeader();
@@ -561,10 +596,14 @@  discard block
 block discarded – undo
561 596
 	function procModuleAdminModuleGrantSetup()
562 597
 	{
563 598
 		$module_srls = Context::get('module_srls');
564
-		if(!$module_srls) return new Object(-1,'msg_invalid_request');
599
+		if(!$module_srls) {
600
+			return new Object(-1,'msg_invalid_request');
601
+		}
565 602
 
566 603
 		$modules = explode(',',$module_srls);
567
-		if(count($modules) < 1) return new Object(-1,'msg_invalid_request');
604
+		if(count($modules) < 1) {
605
+			return new Object(-1,'msg_invalid_request');
606
+		}
568 607
 
569 608
 		$oModuleController = getController('module');
570 609
 		$oModuleModel = getModel('module');
@@ -592,17 +631,20 @@  discard block
 block discarded – undo
592 631
 				$grant->{$grant_name}[] = $default;
593 632
 				continue;
594 633
 				// Users in a particular group
595
-			}
596
-			else
634
+			} else
597 635
 			{
598 636
 				$group_srls = Context::get($grant_name);
599 637
 				if($group_srls)
600 638
 				{
601 639
 					if(!is_array($group_srls))
602 640
 					{
603
-						if(strpos($group_srls,'|@|')!==false) $group_srls = explode('|@|',$group_srls);
604
-						elseif(strpos($group_srls,',')!==false) $group_srls = explode(',',$group_srls);
605
-						else $group_srls = array($group_srls);
641
+						if(strpos($group_srls,'|@|')!==false) {
642
+							$group_srls = explode('|@|',$group_srls);
643
+						} elseif(strpos($group_srls,',')!==false) {
644
+							$group_srls = explode(',',$group_srls);
645
+						} else {
646
+							$group_srls = array($group_srls);
647
+						}
606 648
 					}
607 649
 					$grant->{$grant_name} = $group_srls;
608 650
 				}
@@ -617,7 +659,9 @@  discard block
 block discarded – undo
617 659
 			$args = new stdClass();
618 660
 			$args->module_srl = $module_srl;
619 661
 			$output = executeQuery('module.deleteModuleGrants', $args);
620
-			if(!$output->toBool()) continue;
662
+			if(!$output->toBool()) {
663
+				continue;
664
+			}
621 665
 			// Permissions stored in the DB
622 666
 			foreach($grant as $grant_name => $group_srls)
623 667
 			{
@@ -628,7 +672,9 @@  discard block
 block discarded – undo
628 672
 					$args->name = $grant_name;
629 673
 					$args->group_srl = $val;
630 674
 					$output = executeQuery('module.insertModuleGrant', $args);
631
-					if(!$output->toBool()) return $output;
675
+					if(!$output->toBool()) {
676
+						return $output;
677
+					}
632 678
 				}
633 679
 			}
634 680
 		}
@@ -638,8 +684,7 @@  discard block
 block discarded – undo
638 684
 			if(Context::get('success_return_url'))
639 685
 			{
640 686
 				$this->setRedirectUrl(Context::get('success_return_url'));
641
-			}
642
-			else
687
+			} else
643 688
 			{
644 689
 				global $lang;
645 690
 				htmlHeader();
@@ -665,18 +710,30 @@  discard block
 block discarded – undo
665 710
 		$args->site_srl = (int)$site_module_info->site_srl;
666 711
 		$args->name = str_replace(' ','_',Context::get('lang_code'));
667 712
 		$args->lang_name = str_replace(' ','_',Context::get('lang_name'));
668
-		if(!empty($args->lang_name)) $args->name = $args->lang_name;
713
+		if(!empty($args->lang_name)) {
714
+			$args->name = $args->lang_name;
715
+		}
669 716
 
670 717
 		// if args->name is empty, random generate for user define language
671
-		if(empty($args->name)) $args->name = 'userLang'.date('YmdHis').''.sprintf('%03d', mt_rand(0, 100));
718
+		if(empty($args->name)) {
719
+			$args->name = 'userLang'.date('YmdHis').''.sprintf('%03d', mt_rand(0, 100));
720
+		}
672 721
 
673
-		if(!$args->name) return new Object(-1,'msg_invalid_request');
722
+		if(!$args->name) {
723
+			return new Object(-1,'msg_invalid_request');
724
+		}
674 725
 		// Check whether a language code exists
675 726
 		$output = executeQueryArray('module.getLang', $args);
676
-		if(!$output->toBool()) return $output;
727
+		if(!$output->toBool()) {
728
+			return $output;
729
+		}
677 730
 		// If exists, clear the old values for updating
678
-		if($output->data) $output = executeQuery('module.deleteLang', $args);
679
-		if(!$output->toBool()) return $output;
731
+		if($output->data) {
732
+			$output = executeQuery('module.deleteLang', $args);
733
+		}
734
+		if(!$output->toBool()) {
735
+			return $output;
736
+		}
680 737
 		// Enter
681 738
 		$lang_supported = Context::get('lang_supported');
682 739
 		foreach($lang_supported as $key => $val)
@@ -693,7 +750,9 @@  discard block
 block discarded – undo
693 750
 			if($args->value)
694 751
 			{
695 752
 				$output = executeQuery('module.insertLang', $args);
696
-				if(!$output->toBool()) return $output;
753
+				if(!$output->toBool()) {
754
+					return $output;
755
+				}
697 756
 			}
698 757
 		}
699 758
 		$this->makeCacheDefinedLangCode($args->site_srl);
@@ -716,11 +775,17 @@  discard block
 block discarded – undo
716 775
 		$args->site_srl = (int)$site_module_info->site_srl;
717 776
 		$args->name = str_replace(' ','_',Context::get('name'));
718 777
 		$args->lang_name = str_replace(' ','_',Context::get('lang_name'));
719
-		if(!empty($args->lang_name)) $args->name = $args->lang_name;
720
-		if(!$args->name) return new Object(-1,'msg_invalid_request');
778
+		if(!empty($args->lang_name)) {
779
+			$args->name = $args->lang_name;
780
+		}
781
+		if(!$args->name) {
782
+			return new Object(-1,'msg_invalid_request');
783
+		}
721 784
 
722 785
 		$output = executeQuery('module.deleteLang', $args);
723
-		if(!$output->toBool()) return $output;
786
+		if(!$output->toBool()) {
787
+			return $output;
788
+		}
724 789
 		$this->makeCacheDefinedLangCode($args->site_srl);
725 790
 
726 791
 		$this->setMessage("success_deleted", 'info');
@@ -731,7 +796,9 @@  discard block
 block discarded – undo
731 796
 
732 797
 	function procModuleAdminGetList()
733 798
 	{
734
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
799
+		if(!Context::get('is_logged')) {
800
+			return new Object(-1, 'msg_not_permitted');
801
+		}
735 802
 
736 803
 		$oModuleController = getController('module');
737 804
 		$oModuleModel = getModel('module');
@@ -744,14 +811,20 @@  discard block
 block discarded – undo
744 811
 		$args = new stdClass;
745 812
 		$logged_info = Context::get('logged_info');
746 813
 		$site_module_info = Context::get('site_module_info');
747
-		if($site_keyword) $args->site_keyword = $site_keyword;
814
+		if($site_keyword) {
815
+			$args->site_keyword = $site_keyword;
816
+		}
748 817
 
749 818
 		if(!$site_srl)
750 819
 		{
751
-			if($logged_info->is_admin == 'Y' && !$site_keyword && !$vid) $args->site_srl = 0;
752
-			else $args->site_srl = (int)$site_module_info->site_srl;
820
+			if($logged_info->is_admin == 'Y' && !$site_keyword && !$vid) {
821
+				$args->site_srl = 0;
822
+			} else {
823
+				$args->site_srl = (int)$site_module_info->site_srl;
824
+			}
825
+		} else {
826
+			$args->site_srl = $site_srl;
753 827
 		}
754
-		else $args->site_srl = $site_srl;
755 828
 
756 829
 		$args->sort_index1 = 'sites.domain';
757 830
 
@@ -764,7 +837,9 @@  discard block
 block discarded – undo
764 837
 			foreach($output->data as $val)
765 838
 			{
766 839
 				$module = trim($val->module);
767
-				if(!$module) continue;
840
+				if(!$module) {
841
+					continue;
842
+				}
768 843
 
769 844
 				// replace user defined lang.
770 845
 				$oModuleController->replaceDefinedLangCode($val->browser_title);
@@ -800,7 +875,9 @@  discard block
 block discarded – undo
800 875
 		{
801 876
 			foreach($mid_list as $module => $val)
802 877
 			{
803
-				if(!$selected_module) $selected_module = $module;
878
+				if(!$selected_module) {
879
+					$selected_module = $module;
880
+				}
804 881
 				$xml_info = $oModuleModel->getModuleInfoXml($module);
805 882
 
806 883
 				if(!$xml_info)
@@ -823,8 +900,7 @@  discard block
 block discarded – undo
823 900
 							{
824 901
 								$mid_list[$module]->list[$key]->module_category_srl = $categoryNameList[$categorySrl];
825 902
 							}
826
-						}
827
-						else
903
+						} else
828 904
 						{
829 905
 							$mid_list[$module]->list[$key]->module_category_srl = Context::getLang('none_category');
830 906
 						}
@@ -851,13 +927,14 @@  discard block
 block discarded – undo
851 927
 		{
852 928
 			$site_module_info = Context::get('site_module_info');
853 929
 			$args->site_srl = (int)$site_module_info->site_srl;
854
-		}
855
-		else
930
+		} else
856 931
 		{
857 932
 			$args->site_srl = $site_srl;
858 933
 		}
859 934
 		$output = executeQueryArray('module.getLang', $args);
860
-		if(!$output->toBool() || !$output->data) return;
935
+		if(!$output->toBool() || !$output->data) {
936
+			return;
937
+		}
861 938
 		// Set the cache directory
862 939
 		$cache_path = _XE_PATH_.'files/cache/lang_defined/';
863 940
 		FileHandler::makeDir($cache_path);
@@ -950,8 +1027,7 @@  discard block
 block discarded – undo
950 1027
 		if($mid)
951 1028
 		{
952 1029
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($mid);
953
-		}
954
-		else
1030
+		} else
955 1031
 		{
956 1032
 			$moduleInfo = $oModuleModel->getModuleInfoByModuleSrl($moduleSrl);
957 1033
 		}
Please login to merge, or discard this patch.