GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( be81b0...d0c993 )
by gyeong-won
09:13
created
modules/member/member.admin.controller.php 4 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1114,7 +1114,7 @@  discard block
 block discarded – undo
1114 1114
 
1115 1115
 	/**
1116 1116
 	 * Insert a group
1117
-	 * @param object $args
1117
+	 * @param null|stdClass $args
1118 1118
 	 * @return Object
1119 1119
 	 */
1120 1120
 	function insertGroup($args)
@@ -1311,6 +1311,9 @@  discard block
 block discarded – undo
1311 1311
 		return executeQuery('member.insertDeniedID', $args);
1312 1312
 	}
1313 1313
 
1314
+	/**
1315
+	 * @param string $nick_name
1316
+	 */
1314 1317
 	function insertDeniedNickName($nick_name, $description = '')
1315 1318
 	{
1316 1319
 		$args = new stdClass();
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1284,7 +1284,7 @@
 block discarded – undo
1284 1284
 	/**
1285 1285
 	 * Delete cached group data
1286 1286
 	 * @return void
1287
-	*/
1287
+	 */
1288 1288
 	function _deleteMemberGroupCache($site_srl = 0)
1289 1289
 	{
1290 1290
 		//remove from cache
Please login to merge, or discard this patch.
Spacing   +175 added lines, -175 removed lines patch added patch discarded remove patch
@@ -24,31 +24,31 @@  discard block
 block discarded – undo
24 24
 		// if(Context::getRequestMethod() == "GET") return new Object(-1, "msg_invalid_request");
25 25
 		// Extract the necessary information in advance
26 26
 		$logged_info = Context::get('logged_info');
27
-		if($logged_info->is_admin != 'Y' || !checkCSRF())
27
+		if ($logged_info->is_admin != 'Y' || !checkCSRF())
28 28
 		{
29 29
 			return new Object(-1, 'msg_invalid_request');
30 30
 		}
31 31
 
32
-		$args = Context::gets('member_srl','email_address','find_account_answer', 'allow_mailing','allow_message','denied','is_admin','description','group_srl_list','limit_date');
33
-		$oMemberModel = &getModel ('member');
34
-		$config = $oMemberModel->getMemberConfig ();
32
+		$args = Context::gets('member_srl', 'email_address', 'find_account_answer', 'allow_mailing', 'allow_message', 'denied', 'is_admin', 'description', 'group_srl_list', 'limit_date');
33
+		$oMemberModel = &getModel('member');
34
+		$config = $oMemberModel->getMemberConfig();
35 35
 		$getVars = array();
36
-		if($config->signupForm)
36
+		if ($config->signupForm)
37 37
 		{
38
-			foreach($config->signupForm as $formInfo)
38
+			foreach ($config->signupForm as $formInfo)
39 39
 			{
40
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
40
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
41 41
 				{
42 42
 					$getVars[] = $formInfo->name;
43 43
 				}
44 44
 			}
45 45
 		}
46
-		foreach($getVars as $val)
46
+		foreach ($getVars as $val)
47 47
 		{
48 48
 			$args->{$val} = Context::get($val);
49 49
 		}
50 50
 		$args->member_srl = Context::get('member_srl');
51
-		if(Context::get('reset_password'))
51
+		if (Context::get('reset_password'))
52 52
 			$args->password = Context::get('reset_password');
53 53
 		else unset($args->password);
54 54
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 		unset($all_args->error_return_url);
61 61
 		unset($all_args->success_return_url);
62 62
 		unset($all_args->ruleset);
63
-		if(!isset($args->limit_date)) $args->limit_date = "";
63
+		if (!isset($args->limit_date)) $args->limit_date = "";
64 64
 		unset($all_args->password);
65 65
 		unset($all_args->password2);
66 66
 		unset($all_args->reset_password);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 		$extra_vars = delObjectVars($all_args, $args);
69 69
 		$args->extra_vars = serialize($extra_vars);
70 70
 		// Check if an original member exists having the member_srl
71
-		if($args->member_srl)
71
+		if ($args->member_srl)
72 72
 		{
73 73
 			// Create a member model object
74 74
 			$oMemberModel = getModel('member');
@@ -76,14 +76,14 @@  discard block
 block discarded – undo
76 76
 			$columnList = array('member_srl');
77 77
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl, 0, $columnList);
78 78
 			// If no original member exists, make a new one
79
-			if($member_info->member_srl != $args->member_srl) unset($args->member_srl);
79
+			if ($member_info->member_srl != $args->member_srl) unset($args->member_srl);
80 80
 		}
81 81
 
82 82
 		// remove whitespace
83 83
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
84
-		foreach($checkInfos as $val)
84
+		foreach ($checkInfos as $val)
85 85
 		{
86
-			if(isset($args->{$val}))
86
+			if (isset($args->{$val}))
87 87
 			{
88 88
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
89 89
 			}
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 		$oMemberController = getController('member');
93 93
 		// Execute insert or update depending on the value of member_srl
94
-		if(!$args->member_srl)
94
+		if (!$args->member_srl)
95 95
 		{
96 96
 			$args->password = Context::get('password');
97 97
 			$output = $oMemberController->insertMember($args);
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 			$msg_code = 'success_updated';
104 104
 		}
105 105
 
106
-		if(!$output->toBool()) return $output;
106
+		if (!$output->toBool()) return $output;
107 107
 		// Save Signature
108 108
 		$signature = Context::get('signature');
109 109
 		$oMemberController->putSignature($args->member_srl, $signature);
@@ -112,13 +112,13 @@  discard block
 block discarded – undo
112 112
 		$this->setMessage($msg_code);
113 113
 
114 114
 		$profile_image = $_FILES['profile_image'];
115
-		if(is_uploaded_file($profile_image['tmp_name']))
115
+		if (is_uploaded_file($profile_image['tmp_name']))
116 116
 		{
117 117
 			$oMemberController->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
118 118
 		}
119 119
 
120 120
 		$image_mark = $_FILES['image_mark'];
121
-		if(is_uploaded_file($image_mark['tmp_name']))
121
+		if (is_uploaded_file($image_mark['tmp_name']))
122 122
 		{
123 123
 			$oMemberController->insertImageMark($args->member_srl, $image_mark['tmp_name']);
124 124
 		}
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
 
145 145
 		$oMemberController = getController('member');
146 146
 		$output = $oMemberController->deleteMember($member_srl);
147
-		if(!$output->toBool()) return $output;
147
+		if (!$output->toBool()) return $output;
148 148
 
149
-		$this->add('page',Context::get('page'));
149
+		$this->add('page', Context::get('page'));
150 150
 		$this->setMessage("success_deleted");
151 151
 	}
152 152
 
@@ -165,26 +165,26 @@  discard block
 block discarded – undo
165 165
 		);
166 166
 		
167 167
 		$oPassword = new Password();
168
-		if(!array_key_exists($args->password_hashing_algorithm, $oPassword->getSupportedAlgorithms()))
168
+		if (!array_key_exists($args->password_hashing_algorithm, $oPassword->getSupportedAlgorithms()))
169 169
 		{
170 170
 			$args->password_hashing_algorithm = 'md5';
171 171
 		}
172 172
 		
173 173
 		$args->password_hashing_work_factor = intval($args->password_hashing_work_factor, 10);
174
-		if($args->password_hashing_work_factor < 4)
174
+		if ($args->password_hashing_work_factor < 4)
175 175
 		{
176 176
 			$args->password_hashing_work_factor = 4;
177 177
 		}
178
-		if($args->password_hashing_work_factor > 16)
178
+		if ($args->password_hashing_work_factor > 16)
179 179
 		{
180 180
 			$args->password_hashing_work_factor = 16;
181 181
 		}
182
-		if($args->password_hashing_auto_upgrade != 'Y')
182
+		if ($args->password_hashing_auto_upgrade != 'Y')
183 183
 		{
184 184
 			$args->password_hashing_auto_upgrade = 'N';
185 185
 		}
186 186
 
187
-		if((!$args->webmaster_name || !$args->webmaster_email) && $args->enable_confirm == 'Y')
187
+		if ((!$args->webmaster_name || !$args->webmaster_email) && $args->enable_confirm == 'Y')
188 188
 		{
189 189
 			return new Object(-1, 'msg_mail_authorization');
190 190
 		}
@@ -219,20 +219,20 @@  discard block
 block discarded – undo
219 219
 		$usable_list = Context::get('usable_list');
220 220
 		$all_args = Context::getRequestVars();
221 221
 
222
-		$args->limit_day = (int)$args->limit_day;
223
-		if(!trim(strip_tags($args->agreement)))
222
+		$args->limit_day = (int) $args->limit_day;
223
+		if (!trim(strip_tags($args->agreement)))
224 224
 		{
225
-			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
225
+			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt';
226 226
 			FileHandler::removeFile($agreement_file);
227 227
 			$args->agreement = NULL;
228 228
 		}
229 229
 
230
-		if($args->redirect_url)
230
+		if ($args->redirect_url)
231 231
 		{
232 232
 			$oModuleModel = getModel('module');
233 233
 			$redirectModuleInfo = $oModuleModel->getModuleInfoByModuleSrl($args->redirect_url, array('mid'));
234 234
 
235
-			if(!$redirectModuleInfo)
235
+			if (!$redirectModuleInfo)
236 236
 			{
237 237
 				return new Object('-1', 'msg_exist_selected_module');
238 238
 			}
@@ -256,28 +256,28 @@  discard block
 block discarded – undo
256 256
 		$items = array('user_id', 'password', 'user_name', 'nick_name', 'email_address', 'find_account_question', 'homepage', 'blog', 'birthday', 'signature', 'profile_image', 'image_name', 'image_mark', 'profile_image_max_width', 'profile_image_max_height', 'image_name_max_width', 'image_name_max_height', 'image_mark_max_width', 'image_mark_max_height');
257 257
 		$mustRequireds = array('email_address', 'nick_name', 'password', 'find_account_question');
258 258
 		$extendItems = $oMemberModel->getJoinFormList();
259
-		foreach($list_order as $key)
259
+		foreach ($list_order as $key)
260 260
 		{
261 261
 			$signupItem = new stdClass();
262 262
 			$signupItem->isIdentifier = ($key == $all_args->identifier);
263 263
 			$signupItem->isDefaultForm = in_array($key, $items);
264 264
 
265 265
 			$signupItem->name = $key;
266
-			if(!in_array($key, $items)) $signupItem->title = $key;
266
+			if (!in_array($key, $items)) $signupItem->title = $key;
267 267
 			else $signupItem->title = $lang->{$key};
268 268
 			$signupItem->mustRequired = in_array($key, $mustRequireds);
269 269
 			$signupItem->imageType = (strpos($key, 'image') !== false);
270 270
 			$signupItem->required = ($all_args->{$key} == 'required') || $signupItem->mustRequired || $signupItem->isIdentifier;
271 271
 			$signupItem->isUse = in_array($key, $usable_list) || $signupItem->required;
272 272
 			$signupItem->isPublic = ($all_args->{'is_'.$key.'_public'} == 'Y' && $signupItem->isUse) ? 'Y' : 'N';
273
-			if($signupItem->imageType)
273
+			if ($signupItem->imageType)
274 274
 			{
275 275
 				$signupItem->max_width = $all_args->{$key.'_max_width'};
276 276
 				$signupItem->max_height = $all_args->{$key.'_max_height'};
277 277
 			}
278 278
 
279 279
 			// set extends form
280
-			if(!$signupItem->isDefaultForm)
280
+			if (!$signupItem->isDefaultForm)
281 281
 			{
282 282
 				$extendItem = $extendItems[$all_args->{$key.'_member_join_form_srl'}];
283 283
 				$signupItem->type = $extendItem->column_type;
@@ -286,13 +286,13 @@  discard block
 block discarded – undo
286 286
 				$signupItem->description = $extendItem->description;
287 287
 
288 288
 				// check usable value change, required/option
289
-				if($signupItem->isUse != ($extendItem->is_active == 'Y') || $signupItem->required != ($extendItem->required == 'Y'))
289
+				if ($signupItem->isUse != ($extendItem->is_active == 'Y') || $signupItem->required != ($extendItem->required == 'Y'))
290 290
 				{
291 291
 					unset($update_args);
292 292
 					$update_args = new stdClass;
293 293
 					$update_args->member_join_form_srl = $extendItem->member_join_form_srl;
294
-					$update_args->is_active = $signupItem->isUse?'Y':'N';
295
-					$update_args->required = $signupItem->required?'Y':'N';
294
+					$update_args->is_active = $signupItem->isUse ? 'Y' : 'N';
295
+					$update_args->required = $signupItem->required ? 'Y' : 'N';
296 296
 
297 297
 					$update_output = executeQuery('member.updateJoinForm', $update_args);
298 298
 				}
@@ -309,9 +309,9 @@  discard block
 block discarded – undo
309 309
 		$this->_createFindAccountByQuestion($args->identifier);
310 310
 
311 311
 		// check agreement value exist
312
-		if($args->agreement)
312
+		if ($args->agreement)
313 313
 		{
314
-			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
314
+			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt';
315 315
 			$output = FileHandler::writeFile($agreement_file, $args->agreement);
316 316
 
317 317
 			unset($args->agreement);
@@ -339,16 +339,16 @@  discard block
 block discarded – undo
339 339
 			'after_logout_url'
340 340
 		);
341 341
 
342
-		if(!$args->change_password_date)
342
+		if (!$args->change_password_date)
343 343
 		{
344 344
 			$args->change_password_date = 0;
345 345
 		}
346 346
 
347
-		if(!trim(strip_tags($args->after_login_url)))
347
+		if (!trim(strip_tags($args->after_login_url)))
348 348
 		{
349 349
 			$args->after_login_url = NULL;
350 350
 		}
351
-		if(!trim(strip_tags($args->after_logout_url)))
351
+		if (!trim(strip_tags($args->after_logout_url)))
352 352
 		{
353 353
 			$args->after_logout_url = NULL;
354 354
 		}
@@ -375,17 +375,17 @@  discard block
 block discarded – undo
375 375
 		);
376 376
 
377 377
 		$args->layout_srl = $args->layout_srl ? $args->layout_srl : NULL;
378
-		if(!$args->skin)
378
+		if (!$args->skin)
379 379
 		{
380 380
 			$args->skin = 'default';
381 381
 		}
382
-		if(!$args->colorset)
382
+		if (!$args->colorset)
383 383
 		{
384 384
 			$args->colorset = 'white';
385 385
 		}
386 386
 
387 387
 		$args->mlayout_srl = $args->mlayout_srl ? $args->mlayout_srl : NULL;
388
-		if(!$args->mskin)
388
+		if (!$args->mskin)
389 389
 		{
390 390
 			$args->mskin = 'default';
391 391
 		}
@@ -408,12 +408,12 @@  discard block
 block discarded – undo
408 408
 		$extendItems = $oMemberModel->getJoinFormList();
409 409
 
410 410
 		$items = array('user_id', 'password', 'user_name', 'nick_name', 'email_address', 'find_account_question', 'homepage', 'blog', 'birthday', 'signature', 'profile_image', 'image_name', 'image_mark');
411
-		$mustRequireds = array('email_address', 'nick_name','password', 'find_account_question');
411
+		$mustRequireds = array('email_address', 'nick_name', 'password', 'find_account_question');
412 412
 		$orgRequireds = array('email_address', 'password', 'find_account_question', 'user_id', 'nick_name', 'user_name');
413 413
 		$orgUse = array('email_address', 'password', 'find_account_question', 'user_id', 'nick_name', 'user_name', 'homepage', 'blog', 'birthday');
414 414
 		$list_order = array();
415 415
 
416
-		foreach($items as $key)
416
+		foreach ($items as $key)
417 417
 		{
418 418
 			unset($signupItem);
419 419
 			$signupItem = new stdClass;
@@ -425,23 +425,23 @@  discard block
 block discarded – undo
425 425
 			$signupItem->required = in_array($key, $orgRequireds);
426 426
 			$signupItem->isUse = ($config->{$key} == 'Y') || in_array($key, $orgUse);
427 427
 			$signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N';
428
-			if($key == 'find_account_question' || $key == 'password')
428
+			if ($key == 'find_account_question' || $key == 'password')
429 429
 			{
430 430
 				$signupItem->isPublic = 'N';
431 431
 			}
432 432
 			$signupItem->isIdentifier = ($key == $identifier);
433
-			if ($signupItem->imageType){
433
+			if ($signupItem->imageType) {
434 434
 				$signupItem->max_width = $config->{$key.'_max_width'};
435 435
 				$signupItem->max_height = $config->{$key.'_max_height'};
436 436
 			}
437
-			if($signupItem->isIdentifier)
437
+			if ($signupItem->isIdentifier)
438 438
 				array_unshift($list_order, $signupItem);
439 439
 			else
440 440
 				$list_order[] = $signupItem;
441 441
 		}
442
-		if(is_array($extendItems))
442
+		if (is_array($extendItems))
443 443
 		{
444
-			foreach($extendItems as $form_srl=>$item_info)
444
+			foreach ($extendItems as $form_srl=>$item_info)
445 445
 			{
446 446
 				unset($signupItem);
447 447
 				$signupItem = new stdClass;
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 				$signupItem->isUse = ($item_info->is_active == 'Y');
455 455
 				$signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N';
456 456
 				$signupItem->description = $item_info->description;
457
-				if($signupItem->imageType)
457
+				if ($signupItem->imageType)
458 458
 				{
459 459
 					$signupItem->max_width = $config->{$key.'_max_width'};
460 460
 					$signupItem->max_height = $config->{$key.'_max_height'};
@@ -472,13 +472,13 @@  discard block
 block discarded – undo
472 472
 	 * @param string $agreement
473 473
 	 * @return void
474 474
 	 */
475
-	function _createSignupRuleset($signupForm, $agreement = null){
475
+	function _createSignupRuleset($signupForm, $agreement = null) {
476 476
 		$xml_file = './files/ruleset/insertMember.xml';
477
-		$buff = '<?xml version="1.0" encoding="utf-8"?>' . PHP_EOL.
478
-			'<ruleset version="1.5.0">' . PHP_EOL.
479
-			'<customrules>' . PHP_EOL.
480
-			'</customrules>' . PHP_EOL.
481
-			'<fields>' . PHP_EOL . '%s' . PHP_EOL . '</fields>' . PHP_EOL.
477
+		$buff = '<?xml version="1.0" encoding="utf-8"?>'.PHP_EOL.
478
+			'<ruleset version="1.5.0">'.PHP_EOL.
479
+			'<customrules>'.PHP_EOL.
480
+			'</customrules>'.PHP_EOL.
481
+			'<fields>'.PHP_EOL.'%s'.PHP_EOL.'</fields>'.PHP_EOL.
482 482
 			'</ruleset>';
483 483
 
484 484
 		$fields = array();
@@ -487,41 +487,41 @@  discard block
 block discarded – undo
487 487
 		{
488 488
 			$fields[] = '<field name="accept_agreement"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /></field>';
489 489
 		}
490
-		foreach($signupForm as $formInfo)
490
+		foreach ($signupForm as $formInfo)
491 491
 		{
492
-			if($formInfo->required || $formInfo->mustRequired)
492
+			if ($formInfo->required || $formInfo->mustRequired)
493 493
 			{
494
-				if($formInfo->type == 'tel' || $formInfo->type == 'kr_zip')
494
+				if ($formInfo->type == 'tel' || $formInfo->type == 'kr_zip')
495 495
 				{
496 496
 					$fields[] = sprintf('<field name="%s[]" required="true" />', $formInfo->name);
497 497
 				}
498
-				else if($formInfo->name == 'password')
498
+				else if ($formInfo->name == 'password')
499 499
 				{
500 500
 					$fields[] = '<field name="password"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="length" value="4:60" /></field>';
501 501
 					$fields[] = '<field name="password2"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="equalto" value="password" /></field>';
502 502
 				}
503
-				else if($formInfo->name == 'find_account_question')
503
+				else if ($formInfo->name == 'find_account_question')
504 504
 				{
505 505
 					$fields[] = '<field name="find_account_question" required="true" />';
506 506
 					$fields[] = '<field name="find_account_answer" required="true" length=":250" />';
507 507
 				}
508
-				else if($formInfo->name == 'email_address')
508
+				else if ($formInfo->name == 'email_address')
509 509
 				{
510 510
 					$fields[] = sprintf('<field name="%s" required="true" rule="email"/>', $formInfo->name);
511 511
 				}
512
-				else if($formInfo->name == 'user_id')
512
+				else if ($formInfo->name == 'user_id')
513 513
 				{
514 514
 					$fields[] = sprintf('<field name="%s" required="true" rule="userid" length="3:20" />', $formInfo->name);
515 515
 				}
516
-				else if($formInfo->name == 'nick_name')
516
+				else if ($formInfo->name == 'nick_name')
517 517
 				{
518 518
 					$fields[] = sprintf('<field name="%s" required="true" length="2:20" />', $formInfo->name);
519 519
 				}
520
-				else if(strpos($formInfo->name, 'image') !== false)
520
+				else if (strpos($formInfo->name, 'image') !== false)
521 521
 				{
522 522
 					$fields[] = sprintf('<field name="%s"><if test="$act != \'procMemberAdminInsert\' &amp;&amp; $__%s_exist != \'true\'" attr="required" value="true" /></field>', $formInfo->name, $formInfo->name);
523 523
 				}
524
-				else if($formInfo->name == 'signature')
524
+				else if ($formInfo->name == 'signature')
525 525
 				{
526 526
 					$fields[] = '<field name="signature"><if test="$member_srl" attr="required" value="true" /></field>';
527 527
 				}
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 		FileHandler::writeFile($xml_file, $xml_buff);
537 537
 		unset($xml_buff);
538 538
 
539
-		$validator   = new Validator($xml_file);
539
+		$validator = new Validator($xml_file);
540 540
 		$validator->setCacheDir('files/cache');
541 541
 		$validator->getJsPath();
542 542
 	}
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
 		$xml_buff = sprintf($buff, implode('', $fields));
565 565
 		Filehandler::writeFile($xml_file, $xml_buff);
566 566
 
567
-		$validator   = new Validator($xml_file);
567
+		$validator = new Validator($xml_file);
568 568
 		$validator->setCacheDir('files/cache');
569 569
 		$validator->getJsPath();
570 570
 	}
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
 			'</ruleset>';
586 586
 
587 587
 		$fields = array();
588
-		if($identifier == 'user_id')
588
+		if ($identifier == 'user_id')
589 589
 			$fields[] = '<field name="user_id" required="true" rule="userid" />';
590 590
 
591 591
 		$fields[] = '<field name="email_address" required="true" rule="email" />';
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 		$xml_buff = sprintf($buff, implode('', $fields));
596 596
 		Filehandler::writeFile($xml_file, $xml_buff);
597 597
 
598
-		$validator   = new Validator($xml_file);
598
+		$validator = new Validator($xml_file);
599 599
 		$validator->setCacheDir('files/cache');
600 600
 		$validator->getJsPath();
601 601
 	}
@@ -606,12 +606,12 @@  discard block
 block discarded – undo
606 606
 	 */
607 607
 	function procMemberAdminInsertGroup()
608 608
 	{
609
-		$args = Context::gets('title','description','is_default','image_mark');
609
+		$args = Context::gets('title', 'description', 'is_default', 'image_mark');
610 610
 		$output = $this->insertGroup($args);
611
-		if(!$output->toBool()) return $output;
611
+		if (!$output->toBool()) return $output;
612 612
 
613
-		$this->add('group_srl','');
614
-		$this->add('page',Context::get('page'));
613
+		$this->add('group_srl', '');
614
+		$this->add('page', Context::get('page'));
615 615
 		$this->setMessage('success_registed');
616 616
 
617 617
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList');
@@ -626,13 +626,13 @@  discard block
 block discarded – undo
626 626
 	{
627 627
 		$group_srl = Context::get('group_srl');
628 628
 
629
-		$args = Context::gets('group_srl','title','description','is_default','image_mark');
629
+		$args = Context::gets('group_srl', 'title', 'description', 'is_default', 'image_mark');
630 630
 		$args->site_srl = 0;
631 631
 		$output = $this->updateGroup($args);
632
-		if(!$output->toBool()) return $output;
632
+		if (!$output->toBool()) return $output;
633 633
 
634
-		$this->add('group_srl','');
635
-		$this->add('page',Context::get('page'));
634
+		$this->add('group_srl', '');
635
+		$this->add('page', Context::get('page'));
636 636
 		$this->setMessage('success_updated');
637 637
 
638 638
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList');
@@ -648,10 +648,10 @@  discard block
 block discarded – undo
648 648
 		$group_srl = Context::get('group_srl');
649 649
 
650 650
 		$output = $this->deleteGroup($group_srl);
651
-		if(!$output->toBool()) return $output;
651
+		if (!$output->toBool()) return $output;
652 652
 
653
-		$this->add('group_srl','');
654
-		$this->add('page',Context::get('page'));
653
+		$this->add('group_srl', '');
654
+		$this->add('page', Context::get('page'));
655 655
 		$this->setMessage('success_deleted');
656 656
 
657 657
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList');
@@ -673,10 +673,10 @@  discard block
 block discarded – undo
673 673
 		$args->default_value = explode("\n", str_replace("\r", '', Context::get('default_value')));
674 674
 		$args->required = Context::get('required');
675 675
 		$args->is_active = (isset($args->required));
676
-		if(!in_array(strtoupper($args->required), array('Y','N')))$args->required = 'N';
676
+		if (!in_array(strtoupper($args->required), array('Y', 'N')))$args->required = 'N';
677 677
 		$args->description = Context::get('description') ? Context::get('description') : '';
678 678
 		// Default values
679
-		if(in_array($args->column_type, array('checkbox','select','radio')) && count($args->default_value))
679
+		if (in_array($args->column_type, array('checkbox', 'select', 'radio')) && count($args->default_value))
680 680
 		{
681 681
 			$args->default_value = serialize($args->default_value);
682 682
 		}
@@ -688,17 +688,17 @@  discard block
 block discarded – undo
688 688
 		// Check ID duplicated
689 689
 		$oMemberModel = getModel('member');
690 690
 		$config = $oMemberModel->getMemberConfig();
691
-		foreach($config->signupForm as $item)
691
+		foreach ($config->signupForm as $item)
692 692
 		{
693
-			if($item->name == $args->column_name)
693
+			if ($item->name == $args->column_name)
694 694
 			{
695
-				if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue;
696
-				return new Object(-1,'msg_exists_user_id');
695
+				if ($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue;
696
+				return new Object(-1, 'msg_exists_user_id');
697 697
 			}
698 698
 		}
699 699
 		// Fix if member_join_form_srl exists. Add if not exists.
700 700
 		$isInsert;
701
-		if(!$args->member_join_form_srl)
701
+		if (!$args->member_join_form_srl)
702 702
 		{
703 703
 			$isInsert = true;
704 704
 			$args->list_order = $args->member_join_form_srl = getNextSequence();
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 			$output = executeQuery('member.updateJoinForm', $args);
710 710
 		}
711 711
 
712
-		if(!$output->toBool()) return $output;
712
+		if (!$output->toBool()) return $output;
713 713
 
714 714
 		// memberConfig update
715 715
 		$signupItem = new stdClass();
@@ -726,15 +726,15 @@  discard block
 block discarded – undo
726 726
 		$config = $oMemberModel->getMemberConfig();
727 727
 		unset($config->agreement);
728 728
 
729
-		if($isInsert)
729
+		if ($isInsert)
730 730
 		{
731 731
 			$config->signupForm[] = $signupItem;
732 732
 		}
733 733
 		else
734 734
 		{
735
-			foreach($config->signupForm as $key=>$val)
735
+			foreach ($config->signupForm as $key=>$val)
736 736
 			{
737
-				if($val->member_join_form_srl == $signupItem->member_join_form_srl)
737
+				if ($val->member_join_form_srl == $signupItem->member_join_form_srl)
738 738
 				{
739 739
 					$config->signupForm[$key] = $signupItem;
740 740
 				}
@@ -762,9 +762,9 @@  discard block
 block discarded – undo
762 762
 		$config = $oMemberModel->getMemberConfig();
763 763
 		unset($config->agreement);
764 764
 
765
-		foreach($config->signupForm as $key=>$val)
765
+		foreach ($config->signupForm as $key=>$val)
766 766
 		{
767
-			if($val->member_join_form_srl == $member_join_form_srl)
767
+			if ($val->member_join_form_srl == $member_join_form_srl)
768 768
 			{
769 769
 				unset($config->signupForm[$key]);
770 770
 				break;
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
 		$member_join_form_srl = Context::get('member_join_form_srl');
785 785
 		$mode = Context::get('mode');
786 786
 
787
-		switch($mode)
787
+		switch ($mode)
788 788
 		{
789 789
 			case 'up' :
790 790
 				$output = $this->moveJoinFormUp($member_join_form_srl);
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
 			case 'update' :
802 802
 				break;
803 803
 		}
804
-		if(!$output->toBool()) return $output;
804
+		if (!$output->toBool()) return $output;
805 805
 
806 806
 		$this->setMessage($msg_code);
807 807
 	}
@@ -820,40 +820,40 @@  discard block
 block discarded – undo
820 820
 		$oDB->begin();
821 821
 
822 822
 		$oMemberController = getController('member');
823
-		foreach($members as $key=>$member_srl)
823
+		foreach ($members as $key=>$member_srl)
824 824
 		{
825 825
 			$args = new stdClass();
826 826
 			$args->member_srl = $member_srl;
827
-			switch($var->type)
827
+			switch ($var->type)
828 828
 			{
829 829
 				case 'modify':
830 830
 					{
831
-						if(count($groups) > 0)
831
+						if (count($groups) > 0)
832 832
 						{
833 833
 							$args->site_srl = 0;
834 834
 							// One of its members to delete all the group
835 835
 							$output = executeQuery('member.deleteMemberGroupMember', $args);
836
-							if(!$output->toBool())
836
+							if (!$output->toBool())
837 837
 							{
838 838
 								$oDB->rollback();
839 839
 								return $output;
840 840
 							}
841 841
 							// Enter one of the loop a
842
-							foreach($groups as $group_srl)
842
+							foreach ($groups as $group_srl)
843 843
 							{
844
-								$output = $oMemberController->addMemberToGroup($args->member_srl,$group_srl);
845
-								if(!$output->toBool())
844
+								$output = $oMemberController->addMemberToGroup($args->member_srl, $group_srl);
845
+								if (!$output->toBool())
846 846
 								{
847 847
 									$oDB->rollback();
848 848
 									return $output;
849 849
 								}
850 850
 							}
851 851
 						}
852
-						if($var->denied)
852
+						if ($var->denied)
853 853
 						{
854 854
 							$args->denied = $var->denied;
855 855
 							$output = executeQuery('member.updateMemberDeniedInfo', $args);
856
-							if(!$output->toBool())
856
+							if (!$output->toBool())
857 857
 							{
858 858
 								$oDB->rollback();
859 859
 								return $output;
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
 					{
867 867
 						$oMemberController->memberInfo = null;
868 868
 						$output = $oMemberController->deleteMember($member_srl);
869
-						if(!$output->toBool())
869
+						if (!$output->toBool())
870 870
 						{
871 871
 							$oDB->rollback();
872 872
 							return $output;
@@ -879,15 +879,15 @@  discard block
 block discarded – undo
879 879
 
880 880
 		$message = $var->message;
881 881
 		// Send a message
882
-		if($message)
882
+		if ($message)
883 883
 		{
884 884
 			$oCommunicationController = getController('communication');
885 885
 
886 886
 			$logged_info = Context::get('logged_info');
887
-			$title = cut_str($message,10,'...');
887
+			$title = cut_str($message, 10, '...');
888 888
 			$sender_member_srl = $logged_info->member_srl;
889 889
 
890
-			foreach($members as $member_srl)
890
+			foreach ($members as $member_srl)
891 891
 			{
892 892
 				$oCommunicationController->sendMessage($sender_member_srl, $member_srl, $title, $message, false);
893 893
 			}
@@ -904,14 +904,14 @@  discard block
 block discarded – undo
904 904
 	function procMemberAdminDeleteMembers()
905 905
 	{
906 906
 		$target_member_srls = Context::get('target_member_srls');
907
-		if(!$target_member_srls) return new Object(-1, 'msg_invalid_request');
907
+		if (!$target_member_srls) return new Object(-1, 'msg_invalid_request');
908 908
 		$member_srls = explode(',', $target_member_srls);
909 909
 		$oMemberController = getController('member');
910 910
 
911
-		foreach($member_srls as $member)
911
+		foreach ($member_srls as $member)
912 912
 		{
913 913
 			$output = $oMemberController->deleteMember($member);
914
-			if(!$output->toBool())
914
+			if (!$output->toBool())
915 915
 			{
916 916
 				$this->setMessage('failed_deleted');
917 917
 				return $output;
@@ -928,11 +928,11 @@  discard block
 block discarded – undo
928 928
 	function procMemberAdminUpdateMembersGroup()
929 929
 	{
930 930
 		$member_srl = Context::get('member_srl');
931
-		if(!$member_srl) return new Object(-1,'msg_invalid_request');
932
-		$member_srls = explode(',',$member_srl);
931
+		if (!$member_srl) return new Object(-1, 'msg_invalid_request');
932
+		$member_srls = explode(',', $member_srl);
933 933
 
934 934
 		$group_srl = Context::get('group_srls');
935
-		if(!is_array($group_srl)) $group_srls = explode('|@|', $group_srl);
935
+		if (!is_array($group_srl)) $group_srls = explode('|@|', $group_srl);
936 936
 		else $group_srls = $group_srl;
937 937
 
938 938
 		$oDB = &DB::getInstance();
@@ -941,7 +941,7 @@  discard block
 block discarded – undo
941 941
 		$args = new stdClass;
942 942
 		$args->member_srl = $member_srl;
943 943
 		$output = executeQuery('member.deleteMembersGroup', $args);
944
-		if(!$output->toBool())
944
+		if (!$output->toBool())
945 945
 		{
946 946
 			$oDB->rollback();
947 947
 			return $output;
@@ -949,21 +949,21 @@  discard block
 block discarded – undo
949 949
 		// Add to a selected group
950 950
 		$group_count = count($group_srls);
951 951
 		$member_count = count($member_srls);
952
-		for($j=0;$j<$group_count;$j++)
952
+		for ($j = 0; $j < $group_count; $j++)
953 953
 		{
954
-			$group_srl = (int)trim($group_srls[$j]);
955
-			if(!$group_srl) continue;
956
-			for($i=0;$i<$member_count;$i++)
954
+			$group_srl = (int) trim($group_srls[$j]);
955
+			if (!$group_srl) continue;
956
+			for ($i = 0; $i < $member_count; $i++)
957 957
 			{
958
-				$member_srl = (int)trim($member_srls[$i]);
959
-				if(!$member_srl) continue;
958
+				$member_srl = (int) trim($member_srls[$i]);
959
+				if (!$member_srl) continue;
960 960
 
961 961
 				$args = new stdClass;
962 962
 				$args->member_srl = $member_srl;
963 963
 				$args->group_srl = $group_srl;
964 964
 
965 965
 				$output = executeQuery('member.addMemberToGroup', $args);
966
-				if(!$output->toBool())
966
+				if (!$output->toBool())
967 967
 				{
968 968
 					$oDB->rollback();
969 969
 					return $output;
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
 
977 977
 		$this->setMessage('success_updated');
978 978
 
979
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
979
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
980 980
 		{
981 981
 			global $lang;
982 982
 			htmlHeader();
@@ -997,19 +997,19 @@  discard block
 block discarded – undo
997 997
 	{
998 998
 		$user_ids = Context::get('user_id');
999 999
 
1000
-		$user_ids = explode(',',$user_ids);
1000
+		$user_ids = explode(',', $user_ids);
1001 1001
 		$success_ids = array();
1002 1002
 
1003
-		foreach($user_ids as $val)
1003
+		foreach ($user_ids as $val)
1004 1004
 		{
1005 1005
 			$val = trim($val);
1006
-			if(!$val) continue;
1006
+			if (!$val) continue;
1007 1007
 
1008 1008
 			$output = $this->insertDeniedID($val, '');
1009
-			if($output->toBool()) $success_ids[] = $val;
1009
+			if ($output->toBool()) $success_ids[] = $val;
1010 1010
 		}
1011 1011
 
1012
-		$this->add('user_ids', implode(',',$success_ids));
1012
+		$this->add('user_ids', implode(',', $success_ids));
1013 1013
 
1014 1014
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminDeniedIDList');
1015 1015
 		$this->setRedirectUrl($returnUrl);
@@ -1026,10 +1026,10 @@  discard block
 block discarded – undo
1026 1026
 		$mode = Context::get('mode');
1027 1027
 		$mode = $mode ? $mode : 'insert';
1028 1028
 
1029
-		if($mode == 'delete')
1029
+		if ($mode == 'delete')
1030 1030
 		{
1031 1031
 			$output = $this->deleteDeniedNickName($nick_name);
1032
-			if(!$output->toBool())
1032
+			if (!$output->toBool())
1033 1033
 			{
1034 1034
 				return $output;
1035 1035
 			}
@@ -1038,19 +1038,19 @@  discard block
 block discarded – undo
1038 1038
 		}
1039 1039
 		else
1040 1040
 		{
1041
-			$nick_names = explode(',',$nick_name);
1041
+			$nick_names = explode(',', $nick_name);
1042 1042
 			$success_nick_names = array();
1043 1043
 
1044
-			foreach($nick_names as $val)
1044
+			foreach ($nick_names as $val)
1045 1045
 			{
1046 1046
 				$val = trim($val);
1047
-				if(!$val) continue;
1047
+				if (!$val) continue;
1048 1048
 
1049 1049
 				$output = $this->insertDeniedNickName($val, '');
1050
-				if($output->toBool()) $success_nick_names[] = $val;
1050
+				if ($output->toBool()) $success_nick_names[] = $val;
1051 1051
 			}
1052 1052
 
1053
-			$this->add('nick_names', implode(',',$success_nick_names));
1053
+			$this->add('nick_names', implode(',', $success_nick_names));
1054 1054
 		}
1055 1055
 	}
1056 1056
 
@@ -1063,16 +1063,16 @@  discard block
 block discarded – undo
1063 1063
 		$user_id = Context::get('user_id');
1064 1064
 		$mode = Context::get('mode');
1065 1065
 
1066
-		switch($mode)
1066
+		switch ($mode)
1067 1067
 		{
1068 1068
 			case 'delete' :
1069 1069
 				$output = $this->deleteDeniedID($user_id);
1070
-				if(!$output->toBool()) return $output;
1070
+				if (!$output->toBool()) return $output;
1071 1071
 				$msg_code = 'success_deleted';
1072 1072
 				break;
1073 1073
 		}
1074 1074
 
1075
-		$this->add('page',Context::get('page'));
1075
+		$this->add('page', Context::get('page'));
1076 1076
 		$this->setMessage($msg_code);
1077 1077
 	}
1078 1078
 
@@ -1119,24 +1119,24 @@  discard block
 block discarded – undo
1119 1119
 	 */
1120 1120
 	function insertGroup($args)
1121 1121
 	{
1122
-		if(!$args->site_srl) $args->site_srl = 0;
1122
+		if (!$args->site_srl) $args->site_srl = 0;
1123 1123
 		// Check the value of is_default.
1124
-		if($args->is_default != 'Y')
1124
+		if ($args->is_default != 'Y')
1125 1125
 		{
1126 1126
 			$args->is_default = 'N';
1127 1127
 		}
1128 1128
 		else
1129 1129
 		{
1130 1130
 			$output = executeQuery('member.updateGroupDefaultClear', $args);
1131
-			if(!$output->toBool()) return $output;
1131
+			if (!$output->toBool()) return $output;
1132 1132
 		}
1133 1133
 
1134
-		if(!isset($args->list_order) || $args->list_order=='')
1134
+		if (!isset($args->list_order) || $args->list_order == '')
1135 1135
 		{
1136 1136
 			$args->list_order = $args->group_srl;
1137 1137
 		}
1138 1138
 
1139
-		if(!$args->group_srl) $args->group_srl = getNextSequence();
1139
+		if (!$args->group_srl) $args->group_srl = getNextSequence();
1140 1140
 		$args->list_order = $args->group_srl;
1141 1141
 		$output = executeQuery('member.insertGroup', $args);
1142 1142
 		$this->_deleteMemberGroupCache($args->site_srl);
@@ -1151,17 +1151,17 @@  discard block
 block discarded – undo
1151 1151
 	 */
1152 1152
 	function updateGroup($args)
1153 1153
 	{
1154
-		if(!$args->site_srl) $args->site_srl = 0;
1154
+		if (!$args->site_srl) $args->site_srl = 0;
1155 1155
 		// Check the value of is_default.
1156
-		if(!$args->group_srl) return new Object(-1, 'lang->msg_not_founded');
1157
-		if($args->is_default!='Y')
1156
+		if (!$args->group_srl) return new Object(-1, 'lang->msg_not_founded');
1157
+		if ($args->is_default != 'Y')
1158 1158
 		{
1159 1159
 			$args->is_default = 'N';
1160 1160
 		}
1161 1161
 		else
1162 1162
 		{
1163 1163
 			$output = executeQuery('member.updateGroupDefaultClear', $args);
1164
-			if(!$output->toBool()) return $output;
1164
+			if (!$output->toBool()) return $output;
1165 1165
 		}
1166 1166
 
1167 1167
 		$output = executeQuery('member.updateGroup', $args);
@@ -1184,8 +1184,8 @@  discard block
 block discarded – undo
1184 1184
 		$columnList = array('group_srl', 'is_default');
1185 1185
 		$group_info = $oMemberModel->getGroup($group_srl, $columnList);
1186 1186
 
1187
-		if(!$group_info) return new Object(-1, 'lang->msg_not_founded');
1188
-		if($group_info->is_default == 'Y') return new Object(-1, 'msg_not_delete_default');
1187
+		if (!$group_info) return new Object(-1, 'lang->msg_not_founded');
1188
+		if ($group_info->is_default == 'Y') return new Object(-1, 'msg_not_delete_default');
1189 1189
 
1190 1190
 		// Get groups where is_default == 'Y'
1191 1191
 		$columnList = array('site_srl', 'group_srl');
@@ -1222,7 +1222,7 @@  discard block
 block discarded – undo
1222 1222
 		$defaultGroup = $oMemberModel->getDefaultGroup(0);
1223 1223
 		$defaultGroupSrl = $defaultGroup->group_srl;
1224 1224
 		$group_srls = $vars->group_srls;
1225
-		foreach($group_srls as $order=>$group_srl)
1225
+		foreach ($group_srls as $order=>$group_srl)
1226 1226
 		{
1227 1227
 			$isInsert = false;
1228 1228
 			$update_args = new stdClass();
@@ -1231,9 +1231,9 @@  discard block
 block discarded – undo
1231 1231
 			$update_args->image_mark = $vars->image_marks[$order];
1232 1232
 			$update_args->list_order = $order + 1;
1233 1233
 
1234
-			if(!$update_args->title) continue;
1234
+			if (!$update_args->title) continue;
1235 1235
 
1236
-			if(is_numeric($group_srl)) {
1236
+			if (is_numeric($group_srl)) {
1237 1237
 				$update_args->group_srl = $group_srl;
1238 1238
 				$output = $this->updateGroup($update_args);
1239 1239
 			}
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
 				$output = $this->insertGroup($update_args);
1243 1243
 			}
1244 1244
 
1245
-			if($vars->defaultGroup == $group_srl) {
1245
+			if ($vars->defaultGroup == $group_srl) {
1246 1246
 				$defaultGroupSrl = $update_args->group_srl;
1247 1247
 			}
1248 1248
 		}
@@ -1268,7 +1268,7 @@  discard block
 block discarded – undo
1268 1268
 	{
1269 1269
 		$vars = Context::getRequestVars();
1270 1270
 
1271
-		foreach($vars->group_srls as $key => $val)
1271
+		foreach ($vars->group_srls as $key => $val)
1272 1272
 		{
1273 1273
 			$args = new stdClass;
1274 1274
 			$args->group_srl = $val;
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
 	{
1290 1290
 		//remove from cache
1291 1291
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
1292
-		if($oCacheHandler->isSupport())
1292
+		if ($oCacheHandler->isSupport())
1293 1293
 		{
1294 1294
 			$oCacheHandler->invalidateGroupKey('member');
1295 1295
 		}
@@ -1306,7 +1306,7 @@  discard block
 block discarded – undo
1306 1306
 		$args = new stdClass();
1307 1307
 		$args->user_id = $user_id;
1308 1308
 		$args->description = $description;
1309
-		$args->list_order = -1*getNextSequence();
1309
+		$args->list_order = -1 * getNextSequence();
1310 1310
 
1311 1311
 		return executeQuery('member.insertDeniedID', $args);
1312 1312
 	}
@@ -1327,7 +1327,7 @@  discard block
 block discarded – undo
1327 1327
 	 */
1328 1328
 	function deleteDeniedID($user_id)
1329 1329
 	{
1330
-		if(!$user_id) unset($user_id);
1330
+		if (!$user_id) unset($user_id);
1331 1331
 
1332 1332
 		$args = new stdClass;
1333 1333
 		$args->user_id = $user_id;
@@ -1341,7 +1341,7 @@  discard block
 block discarded – undo
1341 1341
 	 */
1342 1342
 	function deleteDeniedNickName($nick_name)
1343 1343
 	{
1344
-		if(!$nick_name) unset($nick_name);
1344
+		if (!$nick_name) unset($nick_name);
1345 1345
 
1346 1346
 		$args = new stdClass;
1347 1347
 		$args->nick_name = $nick_name;
@@ -1380,16 +1380,16 @@  discard block
 block discarded – undo
1380 1380
 		// Get a list of all join forms
1381 1381
 		$join_form_list = $oMemberModel->getJoinFormList();
1382 1382
 		$join_form_srl_list = array_keys($join_form_list);
1383
-		if(count($join_form_srl_list)<2) return new Object();
1383
+		if (count($join_form_srl_list) < 2) return new Object();
1384 1384
 
1385 1385
 		$prev_member_join_form = NULL;
1386
-		foreach($join_form_list as $key => $val)
1386
+		foreach ($join_form_list as $key => $val)
1387 1387
 		{
1388
-			if($val->member_join_form_srl == $member_join_form_srl) break;
1388
+			if ($val->member_join_form_srl == $member_join_form_srl) break;
1389 1389
 			$prev_member_join_form = $val;
1390 1390
 		}
1391 1391
 		// Return if no previous join form exists
1392
-		if(!$prev_member_join_form) return new Object();
1392
+		if (!$prev_member_join_form) return new Object();
1393 1393
 		// Information of the join form
1394 1394
 		$cur_args = new stdClass;
1395 1395
 		$cur_args->member_join_form_srl = $member_join_form_srl;
@@ -1400,10 +1400,10 @@  discard block
 block discarded – undo
1400 1400
 		$prev_args->list_order = $list_order;
1401 1401
 		// Execute Query
1402 1402
 		$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
1403
-		if(!$output->toBool()) return $output;
1403
+		if (!$output->toBool()) return $output;
1404 1404
 
1405 1405
 		executeQuery('member.updateMemberJoinFormListorder', $prev_args);
1406
-		if(!$output->toBool()) return $output;
1406
+		if (!$output->toBool()) return $output;
1407 1407
 
1408 1408
 		return new Object();
1409 1409
 	}
@@ -1427,16 +1427,16 @@  discard block
 block discarded – undo
1427 1427
 		// Get information of all join forms
1428 1428
 		$join_form_list = $oMemberModel->getJoinFormList();
1429 1429
 		$join_form_srl_list = array_keys($join_form_list);
1430
-		if(count($join_form_srl_list)<2) return new Object();
1430
+		if (count($join_form_srl_list) < 2) return new Object();
1431 1431
 
1432
-		for($i=0;$i<count($join_form_srl_list);$i++)
1432
+		for ($i = 0; $i < count($join_form_srl_list); $i++)
1433 1433
 		{
1434
-			if($join_form_srl_list[$i]==$member_join_form_srl) break;
1434
+			if ($join_form_srl_list[$i] == $member_join_form_srl) break;
1435 1435
 		}
1436 1436
 
1437
-		$next_member_join_form_srl = $join_form_srl_list[$i+1];
1437
+		$next_member_join_form_srl = $join_form_srl_list[$i + 1];
1438 1438
 		// Return if no previous join form exists
1439
-		if(!$next_member_join_form_srl) return new Object();
1439
+		if (!$next_member_join_form_srl) return new Object();
1440 1440
 		$next_member_join_form = $join_form_list[$next_member_join_form_srl];
1441 1441
 		// Information of the join form
1442 1442
 		$cur_args = new stdClass;
@@ -1448,10 +1448,10 @@  discard block
 block discarded – undo
1448 1448
 		$next_args->list_order = $list_order;
1449 1449
 		// Execute Query
1450 1450
 		$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
1451
-		if(!$output->toBool()) return $output;
1451
+		if (!$output->toBool()) return $output;
1452 1452
 
1453 1453
 		$output = executeQuery('member.updateMemberJoinFormListorder', $next_args);
1454
-		if(!$output->toBool()) return $output;
1454
+		if (!$output->toBool()) return $output;
1455 1455
 
1456 1456
 		return new Object();
1457 1457
 	}
Please login to merge, or discard this patch.
Braces   +162 added lines, -86 removed lines patch added patch discarded remove patch
@@ -48,9 +48,11 @@  discard block
 block discarded – undo
48 48
 			$args->{$val} = Context::get($val);
49 49
 		}
50 50
 		$args->member_srl = Context::get('member_srl');
51
-		if(Context::get('reset_password'))
52
-			$args->password = Context::get('reset_password');
53
-		else unset($args->password);
51
+		if(Context::get('reset_password')) {
52
+					$args->password = Context::get('reset_password');
53
+		} else {
54
+			unset($args->password);
55
+		}
54 56
 
55 57
 		// Remove some unnecessary variables from all the vars
56 58
 		$all_args = Context::getRequestVars();
@@ -60,7 +62,9 @@  discard block
 block discarded – undo
60 62
 		unset($all_args->error_return_url);
61 63
 		unset($all_args->success_return_url);
62 64
 		unset($all_args->ruleset);
63
-		if(!isset($args->limit_date)) $args->limit_date = "";
65
+		if(!isset($args->limit_date)) {
66
+			$args->limit_date = "";
67
+		}
64 68
 		unset($all_args->password);
65 69
 		unset($all_args->password2);
66 70
 		unset($all_args->reset_password);
@@ -76,7 +80,9 @@  discard block
 block discarded – undo
76 80
 			$columnList = array('member_srl');
77 81
 			$member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl, 0, $columnList);
78 82
 			// If no original member exists, make a new one
79
-			if($member_info->member_srl != $args->member_srl) unset($args->member_srl);
83
+			if($member_info->member_srl != $args->member_srl) {
84
+				unset($args->member_srl);
85
+			}
80 86
 		}
81 87
 
82 88
 		// remove whitespace
@@ -96,14 +102,15 @@  discard block
 block discarded – undo
96 102
 			$args->password = Context::get('password');
97 103
 			$output = $oMemberController->insertMember($args);
98 104
 			$msg_code = 'success_registed';
99
-		}
100
-		else
105
+		} else
101 106
 		{
102 107
 			$output = $oMemberController->updateMember($args);
103 108
 			$msg_code = 'success_updated';
104 109
 		}
105 110
 
106
-		if(!$output->toBool()) return $output;
111
+		if(!$output->toBool()) {
112
+			return $output;
113
+		}
107 114
 		// Save Signature
108 115
 		$signature = Context::get('signature');
109 116
 		$oMemberController->putSignature($args->member_srl, $signature);
@@ -144,7 +151,9 @@  discard block
 block discarded – undo
144 151
 
145 152
 		$oMemberController = getController('member');
146 153
 		$output = $oMemberController->deleteMember($member_srl);
147
-		if(!$output->toBool()) return $output;
154
+		if(!$output->toBool()) {
155
+			return $output;
156
+		}
148 157
 
149 158
 		$this->add('page',Context::get('page'));
150 159
 		$this->setMessage("success_deleted");
@@ -263,8 +272,11 @@  discard block
 block discarded – undo
263 272
 			$signupItem->isDefaultForm = in_array($key, $items);
264 273
 
265 274
 			$signupItem->name = $key;
266
-			if(!in_array($key, $items)) $signupItem->title = $key;
267
-			else $signupItem->title = $lang->{$key};
275
+			if(!in_array($key, $items)) {
276
+				$signupItem->title = $key;
277
+			} else {
278
+				$signupItem->title = $lang->{$key};
279
+			}
268 280
 			$signupItem->mustRequired = in_array($key, $mustRequireds);
269 281
 			$signupItem->imageType = (strpos($key, 'image') !== false);
270 282
 			$signupItem->required = ($all_args->{$key} == 'required') || $signupItem->mustRequired || $signupItem->isIdentifier;
@@ -434,10 +446,11 @@  discard block
 block discarded – undo
434 446
 				$signupItem->max_width = $config->{$key.'_max_width'};
435 447
 				$signupItem->max_height = $config->{$key.'_max_height'};
436 448
 			}
437
-			if($signupItem->isIdentifier)
438
-				array_unshift($list_order, $signupItem);
439
-			else
440
-				$list_order[] = $signupItem;
449
+			if($signupItem->isIdentifier) {
450
+							array_unshift($list_order, $signupItem);
451
+			} else {
452
+							$list_order[] = $signupItem;
453
+			}
441 454
 		}
442 455
 		if(is_array($extendItems))
443 456
 		{
@@ -494,38 +507,30 @@  discard block
 block discarded – undo
494 507
 				if($formInfo->type == 'tel' || $formInfo->type == 'kr_zip')
495 508
 				{
496 509
 					$fields[] = sprintf('<field name="%s[]" required="true" />', $formInfo->name);
497
-				}
498
-				else if($formInfo->name == 'password')
510
+				} else if($formInfo->name == 'password')
499 511
 				{
500 512
 					$fields[] = '<field name="password"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="length" value="4:60" /></field>';
501 513
 					$fields[] = '<field name="password2"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="equalto" value="password" /></field>';
502
-				}
503
-				else if($formInfo->name == 'find_account_question')
514
+				} else if($formInfo->name == 'find_account_question')
504 515
 				{
505 516
 					$fields[] = '<field name="find_account_question" required="true" />';
506 517
 					$fields[] = '<field name="find_account_answer" required="true" length=":250" />';
507
-				}
508
-				else if($formInfo->name == 'email_address')
518
+				} else if($formInfo->name == 'email_address')
509 519
 				{
510 520
 					$fields[] = sprintf('<field name="%s" required="true" rule="email"/>', $formInfo->name);
511
-				}
512
-				else if($formInfo->name == 'user_id')
521
+				} else if($formInfo->name == 'user_id')
513 522
 				{
514 523
 					$fields[] = sprintf('<field name="%s" required="true" rule="userid" length="3:20" />', $formInfo->name);
515
-				}
516
-				else if($formInfo->name == 'nick_name')
524
+				} else if($formInfo->name == 'nick_name')
517 525
 				{
518 526
 					$fields[] = sprintf('<field name="%s" required="true" length="2:20" />', $formInfo->name);
519
-				}
520
-				else if(strpos($formInfo->name, 'image') !== false)
527
+				} else if(strpos($formInfo->name, 'image') !== false)
521 528
 				{
522 529
 					$fields[] = sprintf('<field name="%s"><if test="$act != \'procMemberAdminInsert\' &amp;&amp; $__%s_exist != \'true\'" attr="required" value="true" /></field>', $formInfo->name, $formInfo->name);
523
-				}
524
-				else if($formInfo->name == 'signature')
530
+				} else if($formInfo->name == 'signature')
525 531
 				{
526 532
 					$fields[] = '<field name="signature"><if test="$member_srl" attr="required" value="true" /></field>';
527
-				}
528
-				else
533
+				} else
529 534
 				{
530 535
 					$fields[] = sprintf('<field name="%s" required="true" />', $formInfo->name);
531 536
 				}
@@ -585,8 +590,9 @@  discard block
 block discarded – undo
585 590
 			'</ruleset>';
586 591
 
587 592
 		$fields = array();
588
-		if($identifier == 'user_id')
589
-			$fields[] = '<field name="user_id" required="true" rule="userid" />';
593
+		if($identifier == 'user_id') {
594
+					$fields[] = '<field name="user_id" required="true" rule="userid" />';
595
+		}
590 596
 
591 597
 		$fields[] = '<field name="email_address" required="true" rule="email" />';
592 598
 		$fields[] = '<field name="find_account_question" required="true" />';
@@ -608,7 +614,9 @@  discard block
 block discarded – undo
608 614
 	{
609 615
 		$args = Context::gets('title','description','is_default','image_mark');
610 616
 		$output = $this->insertGroup($args);
611
-		if(!$output->toBool()) return $output;
617
+		if(!$output->toBool()) {
618
+			return $output;
619
+		}
612 620
 
613 621
 		$this->add('group_srl','');
614 622
 		$this->add('page',Context::get('page'));
@@ -629,7 +637,9 @@  discard block
 block discarded – undo
629 637
 		$args = Context::gets('group_srl','title','description','is_default','image_mark');
630 638
 		$args->site_srl = 0;
631 639
 		$output = $this->updateGroup($args);
632
-		if(!$output->toBool()) return $output;
640
+		if(!$output->toBool()) {
641
+			return $output;
642
+		}
633 643
 
634 644
 		$this->add('group_srl','');
635 645
 		$this->add('page',Context::get('page'));
@@ -648,7 +658,9 @@  discard block
 block discarded – undo
648 658
 		$group_srl = Context::get('group_srl');
649 659
 
650 660
 		$output = $this->deleteGroup($group_srl);
651
-		if(!$output->toBool()) return $output;
661
+		if(!$output->toBool()) {
662
+			return $output;
663
+		}
652 664
 
653 665
 		$this->add('group_srl','');
654 666
 		$this->add('page',Context::get('page'));
@@ -673,14 +685,15 @@  discard block
 block discarded – undo
673 685
 		$args->default_value = explode("\n", str_replace("\r", '', Context::get('default_value')));
674 686
 		$args->required = Context::get('required');
675 687
 		$args->is_active = (isset($args->required));
676
-		if(!in_array(strtoupper($args->required), array('Y','N')))$args->required = 'N';
688
+		if(!in_array(strtoupper($args->required), array('Y','N'))) {
689
+			$args->required = 'N';
690
+		}
677 691
 		$args->description = Context::get('description') ? Context::get('description') : '';
678 692
 		// Default values
679 693
 		if(in_array($args->column_type, array('checkbox','select','radio')) && count($args->default_value))
680 694
 		{
681 695
 			$args->default_value = serialize($args->default_value);
682
-		}
683
-		else
696
+		} else
684 697
 		{
685 698
 			$args->default_value = '';
686 699
 		}
@@ -692,7 +705,9 @@  discard block
 block discarded – undo
692 705
 		{
693 706
 			if($item->name == $args->column_name)
694 707
 			{
695
-				if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue;
708
+				if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) {
709
+					continue;
710
+				}
696 711
 				return new Object(-1,'msg_exists_user_id');
697 712
 			}
698 713
 		}
@@ -703,13 +718,14 @@  discard block
 block discarded – undo
703 718
 			$isInsert = true;
704 719
 			$args->list_order = $args->member_join_form_srl = getNextSequence();
705 720
 			$output = executeQuery('member.insertJoinForm', $args);
706
-		}
707
-		else
721
+		} else
708 722
 		{
709 723
 			$output = executeQuery('member.updateJoinForm', $args);
710 724
 		}
711 725
 
712
-		if(!$output->toBool()) return $output;
726
+		if(!$output->toBool()) {
727
+			return $output;
728
+		}
713 729
 
714 730
 		// memberConfig update
715 731
 		$signupItem = new stdClass();
@@ -729,8 +745,7 @@  discard block
 block discarded – undo
729 745
 		if($isInsert)
730 746
 		{
731 747
 			$config->signupForm[] = $signupItem;
732
-		}
733
-		else
748
+		} else
734 749
 		{
735 750
 			foreach($config->signupForm as $key=>$val)
736 751
 			{
@@ -801,7 +816,9 @@  discard block
 block discarded – undo
801 816
 			case 'update' :
802 817
 				break;
803 818
 		}
804
-		if(!$output->toBool()) return $output;
819
+		if(!$output->toBool()) {
820
+			return $output;
821
+		}
805 822
 
806 823
 		$this->setMessage($msg_code);
807 824
 	}
@@ -904,7 +921,9 @@  discard block
 block discarded – undo
904 921
 	function procMemberAdminDeleteMembers()
905 922
 	{
906 923
 		$target_member_srls = Context::get('target_member_srls');
907
-		if(!$target_member_srls) return new Object(-1, 'msg_invalid_request');
924
+		if(!$target_member_srls) {
925
+			return new Object(-1, 'msg_invalid_request');
926
+		}
908 927
 		$member_srls = explode(',', $target_member_srls);
909 928
 		$oMemberController = getController('member');
910 929
 
@@ -928,12 +947,17 @@  discard block
 block discarded – undo
928 947
 	function procMemberAdminUpdateMembersGroup()
929 948
 	{
930 949
 		$member_srl = Context::get('member_srl');
931
-		if(!$member_srl) return new Object(-1,'msg_invalid_request');
950
+		if(!$member_srl) {
951
+			return new Object(-1,'msg_invalid_request');
952
+		}
932 953
 		$member_srls = explode(',',$member_srl);
933 954
 
934 955
 		$group_srl = Context::get('group_srls');
935
-		if(!is_array($group_srl)) $group_srls = explode('|@|', $group_srl);
936
-		else $group_srls = $group_srl;
956
+		if(!is_array($group_srl)) {
957
+			$group_srls = explode('|@|', $group_srl);
958
+		} else {
959
+			$group_srls = $group_srl;
960
+		}
937 961
 
938 962
 		$oDB = &DB::getInstance();
939 963
 		$oDB->begin();
@@ -952,11 +976,15 @@  discard block
 block discarded – undo
952 976
 		for($j=0;$j<$group_count;$j++)
953 977
 		{
954 978
 			$group_srl = (int)trim($group_srls[$j]);
955
-			if(!$group_srl) continue;
979
+			if(!$group_srl) {
980
+				continue;
981
+			}
956 982
 			for($i=0;$i<$member_count;$i++)
957 983
 			{
958 984
 				$member_srl = (int)trim($member_srls[$i]);
959
-				if(!$member_srl) continue;
985
+				if(!$member_srl) {
986
+					continue;
987
+				}
960 988
 
961 989
 				$args = new stdClass;
962 990
 				$args->member_srl = $member_srl;
@@ -1003,10 +1031,14 @@  discard block
 block discarded – undo
1003 1031
 		foreach($user_ids as $val)
1004 1032
 		{
1005 1033
 			$val = trim($val);
1006
-			if(!$val) continue;
1034
+			if(!$val) {
1035
+				continue;
1036
+			}
1007 1037
 
1008 1038
 			$output = $this->insertDeniedID($val, '');
1009
-			if($output->toBool()) $success_ids[] = $val;
1039
+			if($output->toBool()) {
1040
+				$success_ids[] = $val;
1041
+			}
1010 1042
 		}
1011 1043
 
1012 1044
 		$this->add('user_ids', implode(',',$success_ids));
@@ -1035,8 +1067,7 @@  discard block
 block discarded – undo
1035 1067
 			}
1036 1068
 			$msg_code = 'success_deleted';
1037 1069
 			$this->setMessage($msg_code);
1038
-		}
1039
-		else
1070
+		} else
1040 1071
 		{
1041 1072
 			$nick_names = explode(',',$nick_name);
1042 1073
 			$success_nick_names = array();
@@ -1044,10 +1075,14 @@  discard block
 block discarded – undo
1044 1075
 			foreach($nick_names as $val)
1045 1076
 			{
1046 1077
 				$val = trim($val);
1047
-				if(!$val) continue;
1078
+				if(!$val) {
1079
+					continue;
1080
+				}
1048 1081
 
1049 1082
 				$output = $this->insertDeniedNickName($val, '');
1050
-				if($output->toBool()) $success_nick_names[] = $val;
1083
+				if($output->toBool()) {
1084
+					$success_nick_names[] = $val;
1085
+				}
1051 1086
 			}
1052 1087
 
1053 1088
 			$this->add('nick_names', implode(',',$success_nick_names));
@@ -1067,7 +1102,9 @@  discard block
 block discarded – undo
1067 1102
 		{
1068 1103
 			case 'delete' :
1069 1104
 				$output = $this->deleteDeniedID($user_id);
1070
-				if(!$output->toBool()) return $output;
1105
+				if(!$output->toBool()) {
1106
+					return $output;
1107
+				}
1071 1108
 				$msg_code = 'success_deleted';
1072 1109
 				break;
1073 1110
 		}
@@ -1119,16 +1156,19 @@  discard block
 block discarded – undo
1119 1156
 	 */
1120 1157
 	function insertGroup($args)
1121 1158
 	{
1122
-		if(!$args->site_srl) $args->site_srl = 0;
1159
+		if(!$args->site_srl) {
1160
+			$args->site_srl = 0;
1161
+		}
1123 1162
 		// Check the value of is_default.
1124 1163
 		if($args->is_default != 'Y')
1125 1164
 		{
1126 1165
 			$args->is_default = 'N';
1127
-		}
1128
-		else
1166
+		} else
1129 1167
 		{
1130 1168
 			$output = executeQuery('member.updateGroupDefaultClear', $args);
1131
-			if(!$output->toBool()) return $output;
1169
+			if(!$output->toBool()) {
1170
+				return $output;
1171
+			}
1132 1172
 		}
1133 1173
 
1134 1174
 		if(!isset($args->list_order) || $args->list_order=='')
@@ -1136,7 +1176,9 @@  discard block
 block discarded – undo
1136 1176
 			$args->list_order = $args->group_srl;
1137 1177
 		}
1138 1178
 
1139
-		if(!$args->group_srl) $args->group_srl = getNextSequence();
1179
+		if(!$args->group_srl) {
1180
+			$args->group_srl = getNextSequence();
1181
+		}
1140 1182
 		$args->list_order = $args->group_srl;
1141 1183
 		$output = executeQuery('member.insertGroup', $args);
1142 1184
 		$this->_deleteMemberGroupCache($args->site_srl);
@@ -1151,17 +1193,22 @@  discard block
 block discarded – undo
1151 1193
 	 */
1152 1194
 	function updateGroup($args)
1153 1195
 	{
1154
-		if(!$args->site_srl) $args->site_srl = 0;
1196
+		if(!$args->site_srl) {
1197
+			$args->site_srl = 0;
1198
+		}
1155 1199
 		// Check the value of is_default.
1156
-		if(!$args->group_srl) return new Object(-1, 'lang->msg_not_founded');
1200
+		if(!$args->group_srl) {
1201
+			return new Object(-1, 'lang->msg_not_founded');
1202
+		}
1157 1203
 		if($args->is_default!='Y')
1158 1204
 		{
1159 1205
 			$args->is_default = 'N';
1160
-		}
1161
-		else
1206
+		} else
1162 1207
 		{
1163 1208
 			$output = executeQuery('member.updateGroupDefaultClear', $args);
1164
-			if(!$output->toBool()) return $output;
1209
+			if(!$output->toBool()) {
1210
+				return $output;
1211
+			}
1165 1212
 		}
1166 1213
 
1167 1214
 		$output = executeQuery('member.updateGroup', $args);
@@ -1184,8 +1231,12 @@  discard block
 block discarded – undo
1184 1231
 		$columnList = array('group_srl', 'is_default');
1185 1232
 		$group_info = $oMemberModel->getGroup($group_srl, $columnList);
1186 1233
 
1187
-		if(!$group_info) return new Object(-1, 'lang->msg_not_founded');
1188
-		if($group_info->is_default == 'Y') return new Object(-1, 'msg_not_delete_default');
1234
+		if(!$group_info) {
1235
+			return new Object(-1, 'lang->msg_not_founded');
1236
+		}
1237
+		if($group_info->is_default == 'Y') {
1238
+			return new Object(-1, 'msg_not_delete_default');
1239
+		}
1189 1240
 
1190 1241
 		// Get groups where is_default == 'Y'
1191 1242
 		$columnList = array('site_srl', 'group_srl');
@@ -1231,13 +1282,14 @@  discard block
 block discarded – undo
1231 1282
 			$update_args->image_mark = $vars->image_marks[$order];
1232 1283
 			$update_args->list_order = $order + 1;
1233 1284
 
1234
-			if(!$update_args->title) continue;
1285
+			if(!$update_args->title) {
1286
+				continue;
1287
+			}
1235 1288
 
1236 1289
 			if(is_numeric($group_srl)) {
1237 1290
 				$update_args->group_srl = $group_srl;
1238 1291
 				$output = $this->updateGroup($update_args);
1239
-			}
1240
-			else {
1292
+			} else {
1241 1293
 				$update_args->group_srl = getNextSequence();
1242 1294
 				$output = $this->insertGroup($update_args);
1243 1295
 			}
@@ -1327,7 +1379,9 @@  discard block
 block discarded – undo
1327 1379
 	 */
1328 1380
 	function deleteDeniedID($user_id)
1329 1381
 	{
1330
-		if(!$user_id) unset($user_id);
1382
+		if(!$user_id) {
1383
+			unset($user_id);
1384
+		}
1331 1385
 
1332 1386
 		$args = new stdClass;
1333 1387
 		$args->user_id = $user_id;
@@ -1341,7 +1395,9 @@  discard block
 block discarded – undo
1341 1395
 	 */
1342 1396
 	function deleteDeniedNickName($nick_name)
1343 1397
 	{
1344
-		if(!$nick_name) unset($nick_name);
1398
+		if(!$nick_name) {
1399
+			unset($nick_name);
1400
+		}
1345 1401
 
1346 1402
 		$args = new stdClass;
1347 1403
 		$args->nick_name = $nick_name;
@@ -1380,16 +1436,22 @@  discard block
 block discarded – undo
1380 1436
 		// Get a list of all join forms
1381 1437
 		$join_form_list = $oMemberModel->getJoinFormList();
1382 1438
 		$join_form_srl_list = array_keys($join_form_list);
1383
-		if(count($join_form_srl_list)<2) return new Object();
1439
+		if(count($join_form_srl_list)<2) {
1440
+			return new Object();
1441
+		}
1384 1442
 
1385 1443
 		$prev_member_join_form = NULL;
1386 1444
 		foreach($join_form_list as $key => $val)
1387 1445
 		{
1388
-			if($val->member_join_form_srl == $member_join_form_srl) break;
1446
+			if($val->member_join_form_srl == $member_join_form_srl) {
1447
+				break;
1448
+			}
1389 1449
 			$prev_member_join_form = $val;
1390 1450
 		}
1391 1451
 		// Return if no previous join form exists
1392
-		if(!$prev_member_join_form) return new Object();
1452
+		if(!$prev_member_join_form) {
1453
+			return new Object();
1454
+		}
1393 1455
 		// Information of the join form
1394 1456
 		$cur_args = new stdClass;
1395 1457
 		$cur_args->member_join_form_srl = $member_join_form_srl;
@@ -1400,10 +1462,14 @@  discard block
 block discarded – undo
1400 1462
 		$prev_args->list_order = $list_order;
1401 1463
 		// Execute Query
1402 1464
 		$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
1403
-		if(!$output->toBool()) return $output;
1465
+		if(!$output->toBool()) {
1466
+			return $output;
1467
+		}
1404 1468
 
1405 1469
 		executeQuery('member.updateMemberJoinFormListorder', $prev_args);
1406
-		if(!$output->toBool()) return $output;
1470
+		if(!$output->toBool()) {
1471
+			return $output;
1472
+		}
1407 1473
 
1408 1474
 		return new Object();
1409 1475
 	}
@@ -1427,16 +1493,22 @@  discard block
 block discarded – undo
1427 1493
 		// Get information of all join forms
1428 1494
 		$join_form_list = $oMemberModel->getJoinFormList();
1429 1495
 		$join_form_srl_list = array_keys($join_form_list);
1430
-		if(count($join_form_srl_list)<2) return new Object();
1496
+		if(count($join_form_srl_list)<2) {
1497
+			return new Object();
1498
+		}
1431 1499
 
1432 1500
 		for($i=0;$i<count($join_form_srl_list);$i++)
1433 1501
 		{
1434
-			if($join_form_srl_list[$i]==$member_join_form_srl) break;
1502
+			if($join_form_srl_list[$i]==$member_join_form_srl) {
1503
+				break;
1504
+			}
1435 1505
 		}
1436 1506
 
1437 1507
 		$next_member_join_form_srl = $join_form_srl_list[$i+1];
1438 1508
 		// Return if no previous join form exists
1439
-		if(!$next_member_join_form_srl) return new Object();
1509
+		if(!$next_member_join_form_srl) {
1510
+			return new Object();
1511
+		}
1440 1512
 		$next_member_join_form = $join_form_list[$next_member_join_form_srl];
1441 1513
 		// Information of the join form
1442 1514
 		$cur_args = new stdClass;
@@ -1448,10 +1520,14 @@  discard block
 block discarded – undo
1448 1520
 		$next_args->list_order = $list_order;
1449 1521
 		// Execute Query
1450 1522
 		$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
1451
-		if(!$output->toBool()) return $output;
1523
+		if(!$output->toBool()) {
1524
+			return $output;
1525
+		}
1452 1526
 
1453 1527
 		$output = executeQuery('member.updateMemberJoinFormListorder', $next_args);
1454
-		if(!$output->toBool()) return $output;
1528
+		if(!$output->toBool()) {
1529
+			return $output;
1530
+		}
1455 1531
 
1456 1532
 		return new Object();
1457 1533
 	}
Please login to merge, or discard this patch.
modules/member/member.admin.view.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -380,10 +380,10 @@
 block discarded – undo
380 380
 	/**
381 381
 	 * Get tags by the member info type 
382 382
 	 *
383
-	 * @param object $memberInfo
383
+	 * @param string $memberInfo
384 384
 	 * @param boolean $isAdmin (true : admin, false : not admin)
385 385
 	 *
386
-	 * @return array
386
+	 * @return string
387 387
 	 */
388 388
 	function _getMemberInputTag($memberInfo, $isAdmin = false)
389 389
 	{
Please login to merge, or discard this patch.
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -43,16 +43,16 @@  discard block
 block discarded – undo
43 43
 
44 44
 		// if member_srl exists, set memberInfo
45 45
 		$member_srl = Context::get('member_srl');
46
-		if($member_srl) 
46
+		if ($member_srl) 
47 47
 		{
48 48
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
49
-			if(!$this->memberInfo)
49
+			if (!$this->memberInfo)
50 50
 			{
51
-				Context::set('member_srl','');
51
+				Context::set('member_srl', '');
52 52
 			}
53 53
 			else
54 54
 			{
55
-				Context::set('member_info',$this->memberInfo);
55
+				Context::set('member_info', $this->memberInfo);
56 56
 			}
57 57
 		}
58 58
 
@@ -79,30 +79,30 @@  discard block
 block discarded – undo
79 79
 
80 80
 		$filter = Context::get('filter_type');
81 81
 		global $lang;
82
-		switch($filter)
82
+		switch ($filter)
83 83
 		{
84
-			case 'super_admin' : Context::set('filter_type_title', $lang->cmd_show_super_admin_member);break;
85
-			case 'site_admin' : Context::set('filter_type_title', $lang->cmd_show_site_admin_member);break;
86
-			default : Context::set('filter_type_title', $lang->cmd_show_all_member);break;
84
+			case 'super_admin' : Context::set('filter_type_title', $lang->cmd_show_super_admin_member); break;
85
+			case 'site_admin' : Context::set('filter_type_title', $lang->cmd_show_site_admin_member); break;
86
+			default : Context::set('filter_type_title', $lang->cmd_show_all_member); break;
87 87
 		}
88 88
 		// retrieve list of groups for each member
89
-		if($output->data)
89
+		if ($output->data)
90 90
 		{
91
-			foreach($output->data as $key => $member)
91
+			foreach ($output->data as $key => $member)
92 92
 			{
93
-				$output->data[$key]->group_list = $oMemberModel->getMemberGroups($member->member_srl,0);
93
+				$output->data[$key]->group_list = $oMemberModel->getMemberGroups($member->member_srl, 0);
94 94
 			}
95 95
 		}
96 96
 		$config = $this->memberConfig;
97 97
 		$memberIdentifiers = array('user_id'=>'user_id', 'user_name'=>'user_name', 'nick_name'=>'nick_name');
98 98
 		$usedIdentifiers = array();	
99 99
 
100
-		if(is_array($config->signupForm))
100
+		if (is_array($config->signupForm))
101 101
 		{
102
-			foreach($config->signupForm as $signupItem)
102
+			foreach ($config->signupForm as $signupItem)
103 103
 			{
104
-				if(!count($memberIdentifiers)) break;
105
-				if(in_array($signupItem->name, $memberIdentifiers) && ($signupItem->required || $signupItem->isUse))
104
+				if (!count($memberIdentifiers)) break;
105
+				if (in_array($signupItem->name, $memberIdentifiers) && ($signupItem->required || $signupItem->isUse))
106 106
 				{
107 107
 					unset($memberIdentifiers[$signupItem->name]);
108 108
 					$usedIdentifiers[$signupItem->name] = $lang->{$signupItem->name};
@@ -139,14 +139,14 @@  discard block
 block discarded – undo
139 139
 	{
140 140
 		$config = $this->memberConfig;
141 141
 
142
-		if($config->redirect_url)
142
+		if ($config->redirect_url)
143 143
 		{
144 144
 			$mid = str_ireplace(Context::getDefaultUrl(), '', $config->redirect_url);
145 145
 
146 146
 			$siteModuleInfo = Context::get('site_module_info');
147 147
 
148 148
 			$oModuleModel = getModel('module');
149
-			$moduleInfo = $oModuleModel->getModuleInfoByMid($mid, (int)$siteModuleInfo->site_srl);
149
+			$moduleInfo = $oModuleModel->getModuleInfoByMid($mid, (int) $siteModuleInfo->site_srl);
150 150
 
151 151
 			$config->redirect_url = $moduleInfo->module_srl;
152 152
 			Context::set('config', $config);
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
 		Context::set('editor', $editor);
172 172
 
173 173
 		$signupForm = $config->signupForm;
174
-		foreach($signupForm as $val)
174
+		foreach ($signupForm as $val)
175 175
 		{
176
-			if($val->name == 'user_id')
176
+			if ($val->name == 'user_id')
177 177
 			{
178 178
 				$userIdInfo = $val;
179 179
 				break;
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 		}
182 182
 
183 183
 		$oSecurity = new Security();
184
-		if($userIdInfo->isUse)
184
+		if ($userIdInfo->isUse)
185 185
 		{
186 186
 			// get denied ID list
187 187
 			Context::set('useUserID', 1);
@@ -271,16 +271,16 @@  discard block
 block discarded – undo
271 271
 		Context::set('editor', $editor);
272 272
 
273 273
 		$signupForm = $config->signupForm;
274
-		foreach($signupForm as $val)
274
+		foreach ($signupForm as $val)
275 275
 		{
276
-			if($val->name == 'user_id')
276
+			if ($val->name == 'user_id')
277 277
 			{
278 278
 				$userIdInfo = $val;
279 279
 				break;
280 280
 			}
281 281
 		}
282 282
 
283
-		if($userIdInfo->isUse)
283
+		if ($userIdInfo->isUse)
284 284
 		{
285 285
 			// get denied ID list
286 286
 			Context::set('useUserID', 1);
@@ -341,14 +341,14 @@  discard block
 block discarded – undo
341 341
 		$oMemberModel = getModel('member');
342 342
 
343 343
 		$memberInfo = Context::get('member_info');
344
-		if(isset($memberInfo))
344
+		if (isset($memberInfo))
345 345
 		{
346 346
 			$memberInfo->signature = $oMemberModel->getSignature($this->memberInfo->member_srl);
347 347
 		}
348 348
 		Context::set('member_info', $memberInfo);
349 349
 
350 350
 		// get an editor for the signature
351
-		if($memberInfo->member_srl)
351
+		if ($memberInfo->member_srl)
352 352
 		{
353 353
 			$oEditorModel = getModel('editor');
354 354
 			$option = new stdClass();
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 		}
399 399
 
400 400
 		$member_config = $this->memberConfig;
401
-		if(!$this->memberConfig)
401
+		if (!$this->memberConfig)
402 402
 		{
403 403
 			$member_config = $this->memberConfig = $oMemberModel->getMemberConfig();
404 404
 		}
@@ -406,16 +406,16 @@  discard block
 block discarded – undo
406 406
 		$formTags = array();
407 407
 		global $lang;
408 408
 
409
-		foreach($member_config->signupForm as $no=>$formInfo)
409
+		foreach ($member_config->signupForm as $no=>$formInfo)
410 410
 		{
411
-			if(!$formInfo->isUse)continue;
412
-			if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue;
411
+			if (!$formInfo->isUse)continue;
412
+			if ($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue;
413 413
 			$formTag = new stdClass();
414 414
 			$inputTag = '';
415 415
 			$formTag->title = ($formInfo->isDefaultForm) ? $lang->{$formInfo->name} : $formInfo->title;
416
-			if($isAdmin)
416
+			if ($isAdmin)
417 417
 			{
418
-				if($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
418
+				if ($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
419 419
 			}
420 420
 			else
421 421
 			{
@@ -423,28 +423,28 @@  discard block
 block discarded – undo
423 423
 			}
424 424
 			$formTag->name = $formInfo->name;
425 425
 
426
-			if($formInfo->isDefaultForm)
426
+			if ($formInfo->isDefaultForm)
427 427
 			{
428
-				if($formInfo->imageType)
428
+				if ($formInfo->imageType)
429 429
 				{
430 430
 					$formTag->type = 'image';
431
-					if($formInfo->name == 'profile_image')
431
+					if ($formInfo->name == 'profile_image')
432 432
 					{
433 433
 						$target = $memberInfo['profile_image'];
434 434
 						$functionName = 'doDeleteProfileImage';
435 435
 					}
436
-					else if($formInfo->name == 'image_name')
436
+					else if ($formInfo->name == 'image_name')
437 437
 					{
438 438
 						$target = $memberInfo['image_name'];
439 439
 						$functionName = 'doDeleteImageName';
440 440
 					}
441
-					else if($formInfo->name == 'image_mark')
441
+					else if ($formInfo->name == 'image_mark')
442 442
 					{
443 443
 						$target = $memberInfo['image_mark'];
444 444
 						$functionName = 'doDeleteImageMark';
445 445
 					}
446 446
 
447
-					if($target->src)
447
+					if ($target->src)
448 448
 					{
449 449
 						$inputTag = sprintf('<input type="hidden" name="__%s_exist" value="true" /><span id="%s"><img src="%s" alt="%s" /> <button type="button" onclick="%s(%d);return false;">%s</button></span>',
450 450
 							$formInfo->name,
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 						$lang->{$formInfo->name.'_max_height'},
468 468
 						$member_config->{$formInfo->name.'_max_height'});
469 469
 					}//end imageType
470
-					else if($formInfo->name == 'birthday')
470
+					else if ($formInfo->name == 'birthday')
471 471
 					{
472 472
 						$formTag->type = 'date';
473 473
 						$inputTag = sprintf('<input type="hidden" name="birthday" id="date_birthday" value="%s" /><input type="text" placeholder="YYYY-MM-DD" name="birthday_ui" class="inputDate" id="birthday" value="%s" readonly="readonly" /> <input type="button" value="%s" class="btn dateRemover" />',
@@ -475,14 +475,14 @@  discard block
 block discarded – undo
475 475
 							zdate($memberInfo['birthday'], 'Y-m-d', false),
476 476
 							$lang->cmd_delete);
477 477
 					}
478
-					else if($formInfo->name == 'find_account_question')
478
+					else if ($formInfo->name == 'find_account_question')
479 479
 					{
480 480
 						$formTag->type = 'select';
481 481
 						$inputTag = '<select name="find_account_question" id="find_account_question" style="display:block;margin:0 0 8px 0">%s</select>';
482 482
 						$optionTag = array();
483
-						foreach($lang->find_account_question_items as $key=>$val)
483
+						foreach ($lang->find_account_question_items as $key=>$val)
484 484
 						{
485
-							if($key == $memberInfo['find_account_question']) $selected = 'selected="selected"';
485
+							if ($key == $memberInfo['find_account_question']) $selected = 'selected="selected"';
486 486
 							else $selected = '';
487 487
 							$optionTag[] = sprintf('<option value="%s" %s >%s</option>',
488 488
 								$key,
@@ -492,17 +492,17 @@  discard block
 block discarded – undo
492 492
 						$inputTag = sprintf($inputTag, implode('', $optionTag));
493 493
 						$inputTag .= '<input type="text" name="find_account_answer" id="find_account_answer" title="'.Context::getLang('find_account_answer').'" value="'.$memberInfo['find_account_answer'].'" />';
494 494
 					}
495
-					else if($formInfo->name == 'email_address')
495
+					else if ($formInfo->name == 'email_address')
496 496
 					{
497 497
 						$formTag->type = 'email';
498 498
 						$inputTag = '<input type="email" name="email_address" id="email_address" value="'.$memberInfo['email_address'].'" />';
499 499
 					}
500
-					else if($formInfo->name == 'homepage')
500
+					else if ($formInfo->name == 'homepage')
501 501
 					{
502 502
 						$formTag->type = 'url';
503 503
 						$inputTag = '<input type="url" name="homepage" id="homepage" value="'.$memberInfo['homepage'].'" />';
504 504
 					}
505
-					else if($formInfo->name == 'blog')
505
+					else if ($formInfo->name == 'blog')
506 506
 					{
507 507
 						$formTag->type = 'url';
508 508
 						$inputTag = '<input type="url" name="blog" id="blog" value="'.$memberInfo['blog'].'" />';
@@ -523,92 +523,92 @@  discard block
 block discarded – undo
523 523
 					$extentionReplace = array();
524 524
 
525 525
 					$formTag->type = $extendForm->column_type;
526
-					if($extendForm->column_type == 'text')
526
+					if ($extendForm->column_type == 'text')
527 527
 					{
528 528
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
529 529
 					}
530
-					else if($extendForm->column_type == 'homepage')
530
+					else if ($extendForm->column_type == 'homepage')
531 531
 					{
532 532
 						$template = '<input type="url" name="%column_name%" id="%column_name%" value="%value%" />';
533 533
 					}
534
-					else if($extendForm->column_type == 'email_address')
534
+					else if ($extendForm->column_type == 'email_address')
535 535
 					{
536 536
 						$template = '<input type="email" name="%column_name%" id="%column_name%" value="%value%" />';
537 537
 					}
538
-					else if($extendForm->column_type == 'tel')
538
+					else if ($extendForm->column_type == 'tel')
539 539
 					{
540 540
 						$extentionReplace = array('tel_0' => $extendForm->value[0],
541 541
 							'tel_1' => $extendForm->value[1],
542 542
 							'tel_2' => $extendForm->value[2]);
543 543
 						$template = '<input type="tel" name="%column_name%[]" id="%column_name%" value="%tel_0%" size="4" maxlength="4" style="width:30px" title="First Number" /> - <input type="tel" name="%column_name%[]" value="%tel_1%" size="4" maxlength="4" style="width:35px" title="Second Number" /> - <input type="tel" name="%column_name%[]" value="%tel_2%" size="4" maxlength="4" style="width:35px" title="Third Number" />';
544 544
 					}
545
-					else if($extendForm->column_type == 'textarea')
545
+					else if ($extendForm->column_type == 'textarea')
546 546
 					{
547 547
 						$template = '<textarea name="%column_name%" id="%column_name%" rows="4" cols="42">%value%</textarea>';
548 548
 					}
549
-					else if($extendForm->column_type == 'checkbox')
549
+					else if ($extendForm->column_type == 'checkbox')
550 550
 					{
551 551
 						$template = '';
552
-						if($extendForm->default_value)
552
+						if ($extendForm->default_value)
553 553
 						{
554 554
 							$template = '<div style="padding-top:5px">%s</div>';
555 555
 							$__i = 0;
556 556
 							$optionTag = array();
557
-							foreach($extendForm->default_value as $v)
557
+							foreach ($extendForm->default_value as $v)
558 558
 							{
559 559
 								$checked = '';
560
-								if(is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"';
560
+								if (is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"';
561 561
 								$optionTag[] = '<label for="%column_name%'.$__i.'"><input type="checkbox" id="%column_name%'.$__i.'" name="%column_name%[]" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
562 562
 								$__i++;
563 563
 							}
564 564
 							$template = sprintf($template, implode('', $optionTag));
565 565
 						}
566 566
 					}
567
-					else if($extendForm->column_type == 'radio')
567
+					else if ($extendForm->column_type == 'radio')
568 568
 					{
569 569
 						$template = '';
570
-						if($extendForm->default_value)
570
+						if ($extendForm->default_value)
571 571
 						{
572 572
 							$template = '<div style="padding-top:5px">%s</div>';
573 573
 							$optionTag = array();
574
-							foreach($extendForm->default_value as $v)
574
+							foreach ($extendForm->default_value as $v)
575 575
 							{
576
-								if($extendForm->value == $v)$checked = 'checked="checked"';
576
+								if ($extendForm->value == $v)$checked = 'checked="checked"';
577 577
 								else $checked = '';
578 578
 								$optionTag[] = '<label><input type="radio" name="%column_name%" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
579 579
 							}
580 580
 							$template = sprintf($template, implode('', $optionTag));
581 581
 						}
582 582
 					}
583
-					else if($extendForm->column_type == 'select')
583
+					else if ($extendForm->column_type == 'select')
584 584
 					{
585 585
 						$template = '<select name="'.$formInfo->name.'" id="'.$formInfo->name.'">%s</select>';
586 586
 						$optionTag = array();
587 587
 						$optionTag[] = sprintf('<option value="">%s</option>', $lang->cmd_select);
588
-						if($extendForm->default_value)
588
+						if ($extendForm->default_value)
589 589
 						{
590
-							foreach($extendForm->default_value as $v)
590
+							foreach ($extendForm->default_value as $v)
591 591
 							{
592
-								if($v == $extendForm->value) $selected = 'selected="selected"';
592
+								if ($v == $extendForm->value) $selected = 'selected="selected"';
593 593
 								else $selected = '';
594 594
 								$optionTag[] = sprintf('<option value="%s" %s >%s</option>', $v, $selected, $v);
595 595
 							}
596 596
 						}
597 597
 						$template = sprintf($template, implode('', $optionTag));
598 598
 					}
599
-					else if($extendForm->column_type == 'kr_zip')
599
+					else if ($extendForm->column_type == 'kr_zip')
600 600
 					{
601 601
 						$krzipModel = getModel('krzip');
602
-						if($krzipModel && method_exists($krzipModel , 'getKrzipCodeSearchHtml' ))
602
+						if ($krzipModel && method_exists($krzipModel, 'getKrzipCodeSearchHtml'))
603 603
 						{
604 604
 							$template = $krzipModel->getKrzipCodeSearchHtml($extendForm->column_name, $extendForm->value);
605 605
 						}
606 606
 					}
607
-					else if($extendForm->column_type == 'jp_zip')
607
+					else if ($extendForm->column_type == 'jp_zip')
608 608
 					{
609 609
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
610 610
 					}
611
-					else if($extendForm->column_type == 'date')
611
+					else if ($extendForm->column_type == 'date')
612 612
 					{
613 613
 						$extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete);
614 614
 						$template = '<input type="hidden" name="%column_name%" id="date_%column_name%" value="%value%" /><input type="text" placeholder="YYYY-MM-DD" class="inputDate" value="%date%" readonly="readonly" /> <input type="button" value="%cmd_delete%" class="btn dateRemover" />';
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
 					$replace = array_merge($extentionReplace, $replace);
618 618
 					$inputTag = preg_replace_callback('@%(\w+)%@', function($n) use($replace) { return $replace[$n[1]]; }, $template);
619 619
 
620
-					if($extendForm->description)
620
+					if ($extendForm->description)
621 621
 						$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
622 622
 				}
623 623
 				$formTag->inputTag = $inputTag;
@@ -648,12 +648,12 @@  discard block
 block discarded – undo
648 648
 	function dispMemberAdminInsertJoinForm() {
649 649
 		// Get the value of join_form
650 650
 		$member_join_form_srl = Context::get('member_join_form_srl');
651
-		if($member_join_form_srl)
651
+		if ($member_join_form_srl)
652 652
 		{
653 653
 			$oMemberModel = getModel('member');
654 654
 			$join_form = $oMemberModel->getJoinForm($member_join_form_srl);
655 655
 
656
-			if(!$join_form) Context::set('member_join_form_srl','',true);
656
+			if (!$join_form) Context::set('member_join_form_srl', '', true);
657 657
 			else
658 658
 			{
659 659
 				Context::set('join_form', $join_form);
Please login to merge, or discard this patch.
Braces   +62 added lines, -57 removed lines patch added patch discarded remove patch
@@ -49,8 +49,7 @@  discard block
 block discarded – undo
49 49
 			if(!$this->memberInfo)
50 50
 			{
51 51
 				Context::set('member_srl','');
52
-			}
53
-			else
52
+			} else
54 53
 			{
55 54
 				Context::set('member_info',$this->memberInfo);
56 55
 			}
@@ -101,7 +100,9 @@  discard block
 block discarded – undo
101 100
 		{
102 101
 			foreach($config->signupForm as $signupItem)
103 102
 			{
104
-				if(!count($memberIdentifiers)) break;
103
+				if(!count($memberIdentifiers)) {
104
+					break;
105
+				}
105 106
 				if(in_array($signupItem->name, $memberIdentifiers) && ($signupItem->required || $signupItem->isUse))
106 107
 				{
107 108
 					unset($memberIdentifiers[$signupItem->name]);
@@ -316,7 +317,9 @@  discard block
 block discarded – undo
316 317
 		$extendForm = $oMemberModel->getCombineJoinForm($this->memberInfo);
317 318
 		Context::set('extend_form_list', $extendForm);
318 319
 		$memberInfo = get_object_vars(Context::get('member_info'));
319
-		if (!is_array($memberInfo['group_list'])) $memberInfo['group_list'] = array();
320
+		if (!is_array($memberInfo['group_list'])) {
321
+			$memberInfo['group_list'] = array();
322
+		}
320 323
 		Context::set('memberInfo', $memberInfo);
321 324
 
322 325
 		$disableColumns = array('password', 'find_account_question');
@@ -412,18 +415,25 @@  discard block
 block discarded – undo
412 415
 
413 416
 		foreach($member_config->signupForm as $no=>$formInfo)
414 417
 		{
415
-			if(!$formInfo->isUse)continue;
416
-			if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') continue;
418
+			if(!$formInfo->isUse) {
419
+				continue;
420
+			}
421
+			if($formInfo->name == $member_config->identifier || $formInfo->name == 'password') {
422
+				continue;
423
+			}
417 424
 			$formTag = new stdClass();
418 425
 			$inputTag = '';
419 426
 			$formTag->title = ($formInfo->isDefaultForm) ? $lang->{$formInfo->name} : $formInfo->title;
420 427
 			if($isAdmin)
421 428
 			{
422
-				if($formInfo->mustRequired) $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
423
-			}
424
-			else
429
+				if($formInfo->mustRequired) {
430
+					$formTag->title = '<em style="color:red">*</em> '.$formTag->title;
431
+				}
432
+			} else
425 433
 			{
426
-				if ($formInfo->required && $formInfo->name != 'password') $formTag->title = '<em style="color:red">*</em> '.$formTag->title;
434
+				if ($formInfo->required && $formInfo->name != 'password') {
435
+					$formTag->title = '<em style="color:red">*</em> '.$formTag->title;
436
+				}
427 437
 			}
428 438
 			$formTag->name = $formInfo->name;
429 439
 
@@ -436,13 +446,11 @@  discard block
 block discarded – undo
436 446
 					{
437 447
 						$target = $memberInfo['profile_image'];
438 448
 						$functionName = 'doDeleteProfileImage';
439
-					}
440
-					else if($formInfo->name == 'image_name')
449
+					} else if($formInfo->name == 'image_name')
441 450
 					{
442 451
 						$target = $memberInfo['image_name'];
443 452
 						$functionName = 'doDeleteImageName';
444
-					}
445
-					else if($formInfo->name == 'image_mark')
453
+					} else if($formInfo->name == 'image_mark')
446 454
 					{
447 455
 						$target = $memberInfo['image_mark'];
448 456
 						$functionName = 'doDeleteImageMark';
@@ -458,8 +466,7 @@  discard block
 block discarded – undo
458 466
 							$functionName,
459 467
 							$memberInfo['member_srl'],
460 468
 							$lang->cmd_delete);
461
-					}
462
-					else
469
+					} else
463 470
 					{
464 471
 						$inputTag = sprintf('<input type="hidden" name="__%s_exist" value="false" />', $formInfo->name);
465 472
 					}
@@ -478,16 +485,18 @@  discard block
 block discarded – undo
478 485
 							$memberInfo['birthday'],
479 486
 							zdate($memberInfo['birthday'], 'Y-m-d', false),
480 487
 							$lang->cmd_delete);
481
-					}
482
-					else if($formInfo->name == 'find_account_question')
488
+					} else if($formInfo->name == 'find_account_question')
483 489
 					{
484 490
 						$formTag->type = 'select';
485 491
 						$inputTag = '<select name="find_account_question" id="find_account_question" style="display:block;margin:0 0 8px 0">%s</select>';
486 492
 						$optionTag = array();
487 493
 						foreach($lang->find_account_question_items as $key=>$val)
488 494
 						{
489
-							if($key == $memberInfo['find_account_question']) $selected = 'selected="selected"';
490
-							else $selected = '';
495
+							if($key == $memberInfo['find_account_question']) {
496
+								$selected = 'selected="selected"';
497
+							} else {
498
+								$selected = '';
499
+							}
491 500
 							$optionTag[] = sprintf('<option value="%s" %s >%s</option>',
492 501
 								$key,
493 502
 								$selected,
@@ -495,23 +504,19 @@  discard block
 block discarded – undo
495 504
 						}
496 505
 						$inputTag = sprintf($inputTag, implode('', $optionTag));
497 506
 						$inputTag .= '<input type="text" name="find_account_answer" id="find_account_answer" title="'.Context::getLang('find_account_answer').'" value="'.$memberInfo['find_account_answer'].'" />';
498
-					}
499
-					else if($formInfo->name == 'email_address')
507
+					} else if($formInfo->name == 'email_address')
500 508
 					{
501 509
 						$formTag->type = 'email';
502 510
 						$inputTag = '<input type="email" name="email_address" id="email_address" value="'.$memberInfo['email_address'].'" />';
503
-					}
504
-					else if($formInfo->name == 'homepage')
511
+					} else if($formInfo->name == 'homepage')
505 512
 					{
506 513
 						$formTag->type = 'url';
507 514
 						$inputTag = '<input type="url" name="homepage" id="homepage" value="'.$memberInfo['homepage'].'" />';
508
-					}
509
-					else if($formInfo->name == 'blog')
515
+					} else if($formInfo->name == 'blog')
510 516
 					{
511 517
 						$formTag->type = 'url';
512 518
 						$inputTag = '<input type="url" name="blog" id="blog" value="'.$memberInfo['blog'].'" />';
513
-					}
514
-					else
519
+					} else
515 520
 					{
516 521
 						$formTag->type = 'text';
517 522
 						$inputTag = sprintf('<input type="text" name="%s" id="%s" value="%s" />',
@@ -530,27 +535,22 @@  discard block
 block discarded – undo
530 535
 					if($extendForm->column_type == 'text')
531 536
 					{
532 537
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
533
-					}
534
-					else if($extendForm->column_type == 'homepage')
538
+					} else if($extendForm->column_type == 'homepage')
535 539
 					{
536 540
 						$template = '<input type="url" name="%column_name%" id="%column_name%" value="%value%" />';
537
-					}
538
-					else if($extendForm->column_type == 'email_address')
541
+					} else if($extendForm->column_type == 'email_address')
539 542
 					{
540 543
 						$template = '<input type="email" name="%column_name%" id="%column_name%" value="%value%" />';
541
-					}
542
-					else if($extendForm->column_type == 'tel')
544
+					} else if($extendForm->column_type == 'tel')
543 545
 					{
544 546
 						$extentionReplace = array('tel_0' => $extendForm->value[0],
545 547
 							'tel_1' => $extendForm->value[1],
546 548
 							'tel_2' => $extendForm->value[2]);
547 549
 						$template = '<input type="tel" name="%column_name%[]" id="%column_name%" value="%tel_0%" size="4" maxlength="4" style="width:30px" title="First Number" /> - <input type="tel" name="%column_name%[]" value="%tel_1%" size="4" maxlength="4" style="width:35px" title="Second Number" /> - <input type="tel" name="%column_name%[]" value="%tel_2%" size="4" maxlength="4" style="width:35px" title="Third Number" />';
548
-					}
549
-					else if($extendForm->column_type == 'textarea')
550
+					} else if($extendForm->column_type == 'textarea')
550 551
 					{
551 552
 						$template = '<textarea name="%column_name%" id="%column_name%" rows="4" cols="42">%value%</textarea>';
552
-					}
553
-					else if($extendForm->column_type == 'checkbox')
553
+					} else if($extendForm->column_type == 'checkbox')
554 554
 					{
555 555
 						$template = '';
556 556
 						if($extendForm->default_value)
@@ -561,14 +561,15 @@  discard block
 block discarded – undo
561 561
 							foreach($extendForm->default_value as $v)
562 562
 							{
563 563
 								$checked = '';
564
-								if(is_array($extendForm->value) && in_array($v, $extendForm->value))$checked = 'checked="checked"';
564
+								if(is_array($extendForm->value) && in_array($v, $extendForm->value)) {
565
+									$checked = 'checked="checked"';
566
+								}
565 567
 								$optionTag[] = '<label for="%column_name%'.$__i.'"><input type="checkbox" id="%column_name%'.$__i.'" name="%column_name%[]" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
566 568
 								$__i++;
567 569
 							}
568 570
 							$template = sprintf($template, implode('', $optionTag));
569 571
 						}
570
-					}
571
-					else if($extendForm->column_type == 'radio')
572
+					} else if($extendForm->column_type == 'radio')
572 573
 					{
573 574
 						$template = '';
574 575
 						if($extendForm->default_value)
@@ -577,14 +578,16 @@  discard block
 block discarded – undo
577 578
 							$optionTag = array();
578 579
 							foreach($extendForm->default_value as $v)
579 580
 							{
580
-								if($extendForm->value == $v)$checked = 'checked="checked"';
581
-								else $checked = '';
581
+								if($extendForm->value == $v) {
582
+									$checked = 'checked="checked"';
583
+								} else {
584
+									$checked = '';
585
+								}
582 586
 								$optionTag[] = '<label><input type="radio" name="%column_name%" value="'.$v.'" '.$checked.' /> '.$v.'</label>';
583 587
 							}
584 588
 							$template = sprintf($template, implode('', $optionTag));
585 589
 						}
586
-					}
587
-					else if($extendForm->column_type == 'select')
590
+					} else if($extendForm->column_type == 'select')
588 591
 					{
589 592
 						$template = '<select name="'.$formInfo->name.'" id="'.$formInfo->name.'">%s</select>';
590 593
 						$optionTag = array();
@@ -593,26 +596,26 @@  discard block
 block discarded – undo
593 596
 						{
594 597
 							foreach($extendForm->default_value as $v)
595 598
 							{
596
-								if($v == $extendForm->value) $selected = 'selected="selected"';
597
-								else $selected = '';
599
+								if($v == $extendForm->value) {
600
+									$selected = 'selected="selected"';
601
+								} else {
602
+									$selected = '';
603
+								}
598 604
 								$optionTag[] = sprintf('<option value="%s" %s >%s</option>', $v, $selected, $v);
599 605
 							}
600 606
 						}
601 607
 						$template = sprintf($template, implode('', $optionTag));
602
-					}
603
-					else if($extendForm->column_type == 'kr_zip')
608
+					} else if($extendForm->column_type == 'kr_zip')
604 609
 					{
605 610
 						$krzipModel = getModel('krzip');
606 611
 						if($krzipModel && method_exists($krzipModel , 'getKrzipCodeSearchHtml' ))
607 612
 						{
608 613
 							$template = $krzipModel->getKrzipCodeSearchHtml($extendForm->column_name, $extendForm->value);
609 614
 						}
610
-					}
611
-					else if($extendForm->column_type == 'jp_zip')
615
+					} else if($extendForm->column_type == 'jp_zip')
612 616
 					{
613 617
 						$template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
614
-					}
615
-					else if($extendForm->column_type == 'date')
618
+					} else if($extendForm->column_type == 'date')
616 619
 					{
617 620
 						$extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete);
618 621
 						$template = '<input type="hidden" name="%column_name%" id="date_%column_name%" value="%value%" /><input type="text" placeholder="YYYY-MM-DD" class="inputDate" value="%date%" readonly="readonly" /> <input type="button" value="%cmd_delete%" class="btn dateRemover" />';
@@ -621,8 +624,9 @@  discard block
 block discarded – undo
621 624
 					$replace = array_merge($extentionReplace, $replace);
622 625
 					$inputTag = preg_replace_callback('@%(\w+)%@', function($n) use($replace) { return $replace[$n[1]]; }, $template);
623 626
 
624
-					if($extendForm->description)
625
-						$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
627
+					if($extendForm->description) {
628
+											$inputTag .= '<p class="help-block">'.$extendForm->description.'</p>';
629
+					}
626 630
 				}
627 631
 				$formTag->inputTag = $inputTag;
628 632
 				$formTags[] = $formTag;
@@ -657,8 +661,9 @@  discard block
 block discarded – undo
657 661
 			$oMemberModel = getModel('member');
658 662
 			$join_form = $oMemberModel->getJoinForm($member_join_form_srl);
659 663
 
660
-			if(!$join_form) Context::set('member_join_form_srl','',true);
661
-			else
664
+			if(!$join_form) {
665
+				Context::set('member_join_form_srl','',true);
666
+			} else
662 667
 			{
663 668
 				Context::set('join_form', $join_form);
664 669
 				$security = new Security();
Please login to merge, or discard this patch.
modules/member/member.api.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	/**
25 25
 	 * Arrange Contents
26 26
 	 *
27
-	 * @param array $content_list
27
+	 * @param string $content_list
28 28
 	 *
29 29
 	 * @return array
30 30
 	 */
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	/**
42 42
 	 * Arrange Contents
43 43
 	 *
44
-	 * @param array $content_list
44
+	 * @param array $content
45 45
 	 *
46 46
 	 * @return array
47 47
 	 */
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
 	function dispSavedDocumentList(&$oModule)
18 18
 	{
19 19
 		$document_list = $this->arrangeContentList(Context::get('document_list'));
20
-		$oModule->add('document_list',$document_list);
21
-		$oModule->add('page_navigation',Context::get('page_navigation'));
20
+		$oModule->add('document_list', $document_list);
21
+		$oModule->add('page_navigation', Context::get('page_navigation'));
22 22
 	}
23 23
 
24 24
 	/**
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
 	function arrangeContentList($content_list)
32 32
 	{
33 33
 		$output = array();
34
-		if(count($content_list))
34
+		if (count($content_list))
35 35
 		{
36
-			foreach($content_list as $key => $val) $output[] = $this->arrangeContent($val);
36
+			foreach ($content_list as $key => $val) $output[] = $this->arrangeContent($val);
37 37
 		}
38 38
 		return $output;
39 39
 	}
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 	function arrangeContent($content)
49 49
 	{
50 50
 		$output = null;
51
-		if($content)
51
+		if ($content)
52 52
 		{
53
-			$output= $content->gets('document_srl','category_srl','nick_name','user_id','user_name','title','content','tags','voted_count','blamed_count','comment_count','regdate','last_update','extra_vars','status');
53
+			$output = $content->gets('document_srl', 'category_srl', 'nick_name', 'user_id', 'user_name', 'title', 'content', 'tags', 'voted_count', 'blamed_count', 'comment_count', 'regdate', 'last_update', 'extra_vars', 'status');
54 54
 		}
55 55
 		return $output;
56 56
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@
 block discarded – undo
33 33
 		$output = array();
34 34
 		if(count($content_list))
35 35
 		{
36
-			foreach($content_list as $key => $val) $output[] = $this->arrangeContent($val);
36
+			foreach($content_list as $key => $val) {
37
+				$output[] = $this->arrangeContent($val);
38
+			}
37 39
 		}
38 40
 		return $output;
39 41
 	}
Please login to merge, or discard this patch.
modules/member/member.controller.php 4 patches
Doc Comments   +21 added lines, -13 removed lines patch added patch discarded remove patch
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	/**
188 188
 	 * Delete the post
189 189
 	 *
190
-	 * @return void|Object (void : success, Object : fail)
190
+	 * @return Object|null (void : success, Object : fail)
191 191
 	 */
192 192
 	function procMemberDeleteSavedDocument()
193 193
 	{
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	/**
206 206
 	 * Check values when member joining
207 207
 	 *
208
-	 * @return void|Object (void : success, Object : fail)
208
+	 * @return null|Object (void : success, Object : fail)
209 209
 	 */
210 210
 	function procMemberCheckValue()
211 211
 	{
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 	/**
673 673
 	 * Add a profile image
674 674
 	 *
675
-	 * @return void|Object (void : success, Object : fail)
675
+	 * @return ModuleObject|null (void : success, Object : fail)
676 676
 	 */
677 677
 	function procMemberInsertProfileImage()
678 678
 	{
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 	/**
752 752
 	 * Add an image name
753 753
 	 *
754
-	 * @return void|Object (void : success, Object : fail)
754
+	 * @return ModuleObject|null (void : success, Object : fail)
755 755
 	 */
756 756
 	function procMemberInsertImageName()
757 757
 	{
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
 	/**
837 837
 	 * Delete Image name
838 838
 	 *
839
-	 * @return void
839
+	 * @return Object
840 840
 	 */
841 841
 	function procMemberDeleteImageName($_memberSrl = 0)
842 842
 	{
@@ -860,7 +860,7 @@  discard block
 block discarded – undo
860 860
 	/**
861 861
 	 * Add an image to mark
862 862
 	 *
863
-	 * @return void|Object (void : success, Object : fail)
863
+	 * @return ModuleObject|null (void : success, Object : fail)
864 864
 	 */
865 865
 	function procMemberInsertImageMark()
866 866
 	{
@@ -1100,7 +1100,7 @@  discard block
 block discarded – undo
1100 1100
 	 * Execute finding ID/Passoword
1101 1101
 	 * When clicking the link in the verification email, a method is called to change the old password and to authenticate it
1102 1102
 	 *
1103
-	 * @return void|Object (void : success, Object : fail)
1103
+	 * @return ModuleObject|null (void : success, Object : fail)
1104 1104
 	 */
1105 1105
 	function procMemberAuthAccount()
1106 1106
 	{
@@ -1172,7 +1172,7 @@  discard block
 block discarded – undo
1172 1172
 	/**
1173 1173
 	 * Request to re-send the authentication mail
1174 1174
 	 *
1175
-	 * @return void|Object (void : success, Object : fail)
1175
+	 * @return Object|null (void : success, Object : fail)
1176 1176
 	 */
1177 1177
 	function procMemberResendAuthMail()
1178 1178
 	{
@@ -1331,6 +1331,9 @@  discard block
 block discarded – undo
1331 1331
 		$this->setRedirectUrl($returnUrl);
1332 1332
 	}
1333 1333
 
1334
+	/**
1335
+	 * @param stdClass $auth_args
1336
+	 */
1334 1337
 	function _sendAuthMail($auth_args, $member_info)
1335 1338
 	{
1336 1339
 		$oMemberModel = getModel('member');
@@ -1386,7 +1389,7 @@  discard block
 block discarded – undo
1386 1389
 	/**
1387 1390
 	 * Join a virtual site
1388 1391
 	 *
1389
-	 * @return void|Object (void : success, Object : fail)
1392
+	 * @return Object|null (void : success, Object : fail)
1390 1393
 	 */
1391 1394
 	function procMemberSiteSignUp()
1392 1395
 	{
@@ -1463,7 +1466,7 @@  discard block
 block discarded – undo
1463 1466
 	 * @param int $member_srl
1464 1467
 	 * @param string $signature
1465 1468
 	 *
1466
-	 * @return void
1469
+	 * @return boolean|null
1467 1470
 	 */
1468 1471
 	function putSignature($member_srl, $signature)
1469 1472
 	{
@@ -1865,6 +1868,8 @@  discard block
 block discarded – undo
1865 1868
 	/**
1866 1869
 	 * Logged method for providing a personalized menu
1867 1870
 	 * Login information is used in the output widget, or personalized page
1871
+	 * @param string $act
1872
+	 * @param string $str
1868 1873
 	 */
1869 1874
 	function addMemberMenu($act, $str)
1870 1875
 	{
@@ -1895,6 +1900,7 @@  discard block
 block discarded – undo
1895 1900
 
1896 1901
 	/**
1897 1902
 	 * Add users to the member table
1903
+	 * @param stdClass $args
1898 1904
 	 */
1899 1905
 	function insertMember(&$args, $password_is_hashed = false)
1900 1906
 	{
@@ -2086,6 +2092,7 @@  discard block
 block discarded – undo
2086 2092
 	 * Modify member information
2087 2093
 	 *
2088 2094
 	 * @param bool $is_admin , modified 2013-11-22
2095
+	 * @param stdClass $args
2089 2096
 	 */
2090 2097
 	function updateMember($args, $is_admin = FALSE)
2091 2098
 	{
@@ -2272,6 +2279,7 @@  discard block
 block discarded – undo
2272 2279
 
2273 2280
 	/**
2274 2281
 	 * Modify member password
2282
+	 * @param stdClass $args
2275 2283
 	 */
2276 2284
 	function updateMemberPassword($args)
2277 2285
 	{
@@ -2555,7 +2563,7 @@  discard block
 block discarded – undo
2555 2563
 	 *
2556 2564
 	 * @param array &$menu_list
2557 2565
 	 *
2558
-	 * @return object
2566
+	 * @return Object
2559 2567
 	**/
2560 2568
 	function triggerGetDocumentMenu(&$menu_list)
2561 2569
 	{
@@ -2585,7 +2593,7 @@  discard block
 block discarded – undo
2585 2593
 	 *
2586 2594
 	 * @param array &$menu_list
2587 2595
 	 *
2588
-	 * @return object
2596
+	 * @return Object
2589 2597
 	**/
2590 2598
 	function triggerGetCommentMenu(&$menu_list)
2591 2599
 	{
@@ -2613,7 +2621,7 @@  discard block
 block discarded – undo
2613 2621
 	/**
2614 2622
 	 * Spammer manage. Denied user login. And delete or trash all documents. Response Ajax string
2615 2623
 	 *
2616
-	 * @return object
2624
+	 * @return Object
2617 2625
 	**/
2618 2626
 	function procMemberSpammerManage()
2619 2627
 	{
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -2556,7 +2556,7 @@  discard block
 block discarded – undo
2556 2556
 	 * @param array &$menu_list
2557 2557
 	 *
2558 2558
 	 * @return object
2559
-	**/
2559
+	 **/
2560 2560
 	function triggerGetDocumentMenu(&$menu_list)
2561 2561
 	{
2562 2562
 		if(!Context::get('is_logged')) return new Object();
@@ -2586,7 +2586,7 @@  discard block
 block discarded – undo
2586 2586
 	 * @param array &$menu_list
2587 2587
 	 *
2588 2588
 	 * @return object
2589
-	**/
2589
+	 **/
2590 2590
 	function triggerGetCommentMenu(&$menu_list)
2591 2591
 	{
2592 2592
 		if(!Context::get('is_logged')) return new Object();
@@ -2614,7 +2614,7 @@  discard block
 block discarded – undo
2614 2614
 	 * Spammer manage. Denied user login. And delete or trash all documents. Response Ajax string
2615 2615
 	 *
2616 2616
 	 * @return object
2617
-	**/
2617
+	 **/
2618 2618
 	function procMemberSpammerManage()
2619 2619
 	{
2620 2620
 		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
@@ -2680,7 +2680,7 @@  discard block
 block discarded – undo
2680 2680
 	 * @param int $member_srl
2681 2681
 	 *
2682 2682
 	 * @return object
2683
-	**/
2683
+	 **/
2684 2684
 	private function _spammerMember($member_srl) {
2685 2685
 		$logged_info = Context::get('logged_info');
2686 2686
 		$spam_description = trim( Context::get('spam_description') );
@@ -2721,7 +2721,7 @@  discard block
 block discarded – undo
2721 2721
 	 * @param bool $isMoveToTrash
2722 2722
 	 *
2723 2723
 	 * @return object
2724
-	**/
2724
+	 **/
2725 2725
 	private function _spammerDocuments($member_srl, $isMoveToTrash) {
2726 2726
 		$oDocumentController = getController('document');
2727 2727
 		$oDocumentModel = getModel('document');
Please login to merge, or discard this patch.
Spacing   +445 added lines, -445 removed lines patch added patch discarded remove patch
@@ -34,25 +34,25 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	function procMemberLogin($user_id = null, $password = null, $keep_signed = null)
36 36
 	{
37
-		if(!$user_id && !$password && Context::getRequestMethod() == 'GET')
37
+		if (!$user_id && !$password && Context::getRequestMethod() == 'GET')
38 38
 		{
39 39
 			$this->setRedirectUrl(getNotEncodedUrl(''));
40 40
 			return new Object(-1, 'null_user_id');
41 41
 		}
42 42
 
43 43
 		// Variables
44
-		if(!$user_id) $user_id = Context::get('user_id');
44
+		if (!$user_id) $user_id = Context::get('user_id');
45 45
 		$user_id = trim($user_id);
46 46
 
47
-		if(!$password) $password = Context::get('password');
47
+		if (!$password) $password = Context::get('password');
48 48
 		$password = trim($password);
49 49
 
50
-		if(!$keep_signed) $keep_signed = Context::get('keep_signed');
50
+		if (!$keep_signed) $keep_signed = Context::get('keep_signed');
51 51
 		// Return an error when id and password doesn't exist
52
-		if(!$user_id) return new Object(-1,'null_user_id');
53
-		if(!$password) return new Object(-1,'null_password');
52
+		if (!$user_id) return new Object(-1, 'null_user_id');
53
+		if (!$password) return new Object(-1, 'null_password');
54 54
 
55
-		$output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false);
55
+		$output = $this->doLogin($user_id, $password, $keep_signed == 'Y' ? true : false);
56 56
 		if (!$output->toBool()) return $output;
57 57
 
58 58
 		$oModuleModel = getModel('module');
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
 		$limit_date = $config->change_password_date;
63 63
 
64 64
 		// Check if change_password_date is set
65
-		if($limit_date > 0)
65
+		if ($limit_date > 0)
66 66
 		{
67 67
 			$oMemberModel = getModel('member');
68
-			if($this->memberInfo->change_password_date < date ('YmdHis', strtotime ('-' . $limit_date . ' day')))
68
+			if ($this->memberInfo->change_password_date < date('YmdHis', strtotime('-'.$limit_date.' day')))
69 69
 			{
70 70
 				$msg = sprintf(Context::getLang('msg_change_password_date'), $limit_date);
71
-				return $this->setRedirectUrl(getNotEncodedUrl('','vid',Context::get('vid'),'mid',Context::get('mid'),'act','dispMemberModifyPassword'), new Object(-1, $msg));
71
+				return $this->setRedirectUrl(getNotEncodedUrl('', 'vid', Context::get('vid'), 'mid', Context::get('mid'), 'act', 'dispMemberModifyPassword'), new Object(-1, $msg));
72 72
 			}
73 73
 		}
74 74
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		$args->member_srl = $this->memberInfo->member_srl;
78 78
 		executeQuery('member.deleteAuthMail', $args);
79 79
 
80
-		if(!$config->after_login_url)
80
+		if (!$config->after_login_url)
81 81
 		{
82 82
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
83 83
 		}
@@ -98,18 +98,18 @@  discard block
 block discarded – undo
98 98
 		// Call a trigger before log-out (before)
99 99
 		$logged_info = Context::get('logged_info');
100 100
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info);
101
-		if(!$trigger_output->toBool()) return $trigger_output;
101
+		if (!$trigger_output->toBool()) return $trigger_output;
102 102
 		// Destroy session information
103 103
 		$this->destroySessionInfo();
104 104
 		// Call a trigger after log-out (after)
105 105
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info);
106
-		if(!$trigger_output->toBool()) return $trigger_output;
106
+		if (!$trigger_output->toBool()) return $trigger_output;
107 107
 
108 108
 		$output = new Object();
109 109
 
110 110
 		$oModuleModel = getModel('module');
111 111
 		$config = $oModuleModel->getModuleConfig('member');
112
-		if($config->after_logout_url)
112
+		if ($config->after_logout_url)
113 113
 			$output->redirect_url = $config->after_logout_url;
114 114
 
115 115
 		$this->_clearMemberCache($logged_info->member_srl);
@@ -127,25 +127,25 @@  discard block
 block discarded – undo
127 127
 		$oModuleModel = &getModel('module');
128 128
 
129 129
 		// Check login information
130
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
130
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
131 131
 		$logged_info = Context::get('logged_info');
132 132
 
133
-		$document_srl = (int)Context::get('document_srl');
134
-		if(!$document_srl) $document_srl = (int)Context::get('target_srl');
135
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
133
+		$document_srl = (int) Context::get('document_srl');
134
+		if (!$document_srl) $document_srl = (int) Context::get('target_srl');
135
+		if (!$document_srl) return new Object(-1, 'msg_invalid_request');
136 136
 
137 137
 		// Get document
138 138
 		$oDocumentModel = getModel('document');
139 139
 		$oDocument = $oDocumentModel->getDocument($document_srl);
140 140
 
141
-		if($oDocument->isSecret() && !$oDocument->isGranted())
141
+		if ($oDocument->isSecret() && !$oDocument->isGranted())
142 142
 		{
143 143
 			return new Object(-1, 'msg_is_secret');
144 144
 		}
145 145
 
146 146
 		// 모듈 권한 확인
147 147
 		$grant = $oModuleModel->getGrant($oModuleModel->getModuleInfoByModuleSrl($oDocument->get('module_srl')), $logged_info);
148
-		if(!$grant->access)
148
+		if (!$grant->access)
149 149
 		{
150 150
 			return new Object(-1, 'msg_not_permitted');
151 151
 		}
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
 
163 163
 		// Check if already scrapped
164 164
 		$output = executeQuery('member.getScrapDocument', $args);
165
-		if($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
165
+		if ($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
166 166
 
167 167
 		// Insert
168 168
 		$output = executeQuery('member.addScrapDocument', $args);
169
-		if(!$output->toBool()) return $output;
169
+		if (!$output->toBool()) return $output;
170 170
 
171 171
 		$this->setError(-1);
172 172
 		$this->setMessage('success_registed');
@@ -180,11 +180,11 @@  discard block
 block discarded – undo
180 180
 	function procMemberDeleteScrap()
181 181
 	{
182 182
 		// Check login information
183
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
183
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
184 184
 		$logged_info = Context::get('logged_info');
185 185
 
186
-		$document_srl = (int)Context::get('document_srl');
187
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
186
+		$document_srl = (int) Context::get('document_srl');
187
+		if (!$document_srl) return new Object(-1, 'msg_invalid_request');
188 188
 		// Variables
189 189
 		$args = new stdClass;
190 190
 		$args->member_srl = $logged_info->member_srl;
@@ -210,23 +210,23 @@  discard block
 block discarded – undo
210 210
 	function procMemberDeleteSavedDocument()
211 211
 	{
212 212
 		// Check login information
213
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
213
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
214 214
 		$logged_info = Context::get('logged_info');
215 215
 
216
-		$document_srl = (int)Context::get('document_srl');
217
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
216
+		$document_srl = (int) Context::get('document_srl');
217
+		if (!$document_srl) return new Object(-1, 'msg_invalid_request');
218 218
 
219 219
 		$oDocumentModel = getModel('document');
220 220
 		$oDocument = $oDocumentModel->getDocument($document_srl);
221 221
 		if ($oDocument->get('member_srl') != $logged_info->member_srl)
222 222
 		{
223
-			return new Object(-1,'msg_invalid_request');
223
+			return new Object(-1, 'msg_invalid_request');
224 224
 		}
225 225
 
226 226
 		$configStatusList = $oDocumentModel->getStatusList();
227 227
 		if ($oDocument->get('status') != $configStatusList['temp'])
228 228
 		{
229
-			return new Object(-1,'msg_invalid_request');
229
+			return new Object(-1, 'msg_invalid_request');
230 230
 		}
231 231
 
232 232
 		$oDocumentController = getController('document');
@@ -242,37 +242,37 @@  discard block
 block discarded – undo
242 242
 	{
243 243
 		$name = Context::get('name');
244 244
 		$value = Context::get('value');
245
-		if(!$value) return;
245
+		if (!$value) return;
246 246
 
247 247
 		$oMemberModel = getModel('member');
248 248
 		// Check if logged-in
249 249
 		$logged_info = Context::get('logged_info');
250 250
 
251 251
 
252
-		switch($name)
252
+		switch ($name)
253 253
 		{
254 254
 			case 'user_id' :
255 255
 				// Check denied ID
256
-				if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id');
256
+				if ($oMemberModel->isDeniedID($value)) return new Object(0, 'denied_user_id');
257 257
 				// Check if duplicated
258 258
 				$member_srl = $oMemberModel->getMemberSrlByUserID($value);
259
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_user_id');
259
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_user_id');
260 260
 				break;
261 261
 			case 'nick_name' :
262 262
 				// Check denied ID
263
-				if($oMemberModel->isDeniedNickName($value))
263
+				if ($oMemberModel->isDeniedNickName($value))
264 264
 				{
265
-					return new Object(0,'denied_nick_name');
265
+					return new Object(0, 'denied_nick_name');
266 266
 				}
267 267
 				// Check if duplicated
268 268
 				$member_srl = $oMemberModel->getMemberSrlByNickName($value);
269
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name');
269
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_nick_name');
270 270
 
271 271
 				break;
272 272
 			case 'email_address' :
273 273
 				// Check if duplicated
274 274
 				$member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
275
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address');
275
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_email_address');
276 276
 				break;
277 277
 		}
278 278
 	}
@@ -284,25 +284,25 @@  discard block
 block discarded – undo
284 284
 	 */
285 285
 	function procMemberInsert()
286 286
 	{
287
-		if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request");
288
-		$oMemberModel = &getModel ('member');
287
+		if (Context::getRequestMethod() == "GET") return new Object(-1, "msg_invalid_request");
288
+		$oMemberModel = &getModel('member');
289 289
 		$config = $oMemberModel->getMemberConfig();
290 290
 
291 291
 		// call a trigger (before)
292
-		$trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config);
293
-		if(!$trigger_output->toBool ()) return $trigger_output;
292
+		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'before', $config);
293
+		if (!$trigger_output->toBool()) return $trigger_output;
294 294
 		// Check if an administrator allows a membership
295
-		if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled');
295
+		if ($config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
296 296
 		// Check if the user accept the license terms (only if terms exist)
297
-		if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
297
+		if ($config->agreement && Context::get('accept_agreement') != 'Y') return $this->stop('msg_accept_agreement');
298 298
 
299 299
 		// Extract the necessary information in advance
300 300
 		$getVars = array();
301
-		if($config->signupForm)
301
+		if ($config->signupForm)
302 302
 		{
303
-			foreach($config->signupForm as $formInfo)
303
+			foreach ($config->signupForm as $formInfo)
304 304
 			{
305
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
305
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
306 306
 				{
307 307
 					$getVars[] = $formInfo->name;
308 308
 				}
@@ -310,22 +310,22 @@  discard block
 block discarded – undo
310 310
 		}
311 311
 
312 312
 		$args = new stdClass;
313
-		foreach($getVars as $val)
313
+		foreach ($getVars as $val)
314 314
 		{
315 315
 			$args->{$val} = Context::get($val);
316
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
316
+			if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
317 317
 		}
318 318
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
319
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
319
+		if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
320 320
 
321 321
 		$args->find_account_answer = Context::get('find_account_answer');
322 322
 		$args->allow_mailing = Context::get('allow_mailing');
323 323
 		$args->allow_message = Context::get('allow_message');
324 324
 
325
-		if($args->password1) $args->password = $args->password1;
325
+		if ($args->password1) $args->password = $args->password1;
326 326
 
327 327
 		// check password strength
328
-		if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
328
+		if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
329 329
 		{
330 330
 			$message = Context::getLang('about_password_strength');
331 331
 			return new Object(-1, $message[$config->password_strength]);
@@ -351,58 +351,58 @@  discard block
 block discarded – undo
351 351
 		unset($all_args->secret_text);
352 352
 
353 353
 		// Set the user state as "denied" when using mail authentication
354
-		if($config->enable_confirm == 'Y') $args->denied = 'Y';
354
+		if ($config->enable_confirm == 'Y') $args->denied = 'Y';
355 355
 		// Add extra vars after excluding necessary information from all the requested arguments
356 356
 		$extra_vars = delObjectVars($all_args, $args);
357 357
 		$args->extra_vars = serialize($extra_vars);
358 358
 
359 359
 		// remove whitespace
360 360
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
361
-		foreach($checkInfos as $val)
361
+		foreach ($checkInfos as $val)
362 362
 		{
363
-			if(isset($args->{$val}))
363
+			if (isset($args->{$val}))
364 364
 			{
365 365
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
366 366
 			}
367 367
 		}
368 368
 		$output = $this->insertMember($args);
369
-		if(!$output->toBool()) return $output;
369
+		if (!$output->toBool()) return $output;
370 370
 
371 371
 		// insert ProfileImage, ImageName, ImageMark
372 372
 		$profile_image = $_FILES['profile_image'];
373
-		if(is_uploaded_file($profile_image['tmp_name']))
373
+		if (is_uploaded_file($profile_image['tmp_name']))
374 374
 		{
375 375
 			$this->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
376 376
 		}
377 377
 
378 378
 		$image_mark = $_FILES['image_mark'];
379
-		if(is_uploaded_file($image_mark['tmp_name']))
379
+		if (is_uploaded_file($image_mark['tmp_name']))
380 380
 		{
381 381
 			$this->insertImageMark($args->member_srl, $image_mark['tmp_name']);
382 382
 		}
383 383
 
384 384
 		$image_name = $_FILES['image_name'];
385
-		if(is_uploaded_file($image_name['tmp_name']))
385
+		if (is_uploaded_file($image_name['tmp_name']))
386 386
 		{
387 387
 			$this->insertImageName($args->member_srl, $image_name['tmp_name']);
388 388
 		}
389 389
 
390 390
 		// If a virtual site, join the site
391 391
 		$site_module_info = Context::get('site_module_info');
392
-		if($site_module_info->site_srl > 0)
392
+		if ($site_module_info->site_srl > 0)
393 393
 		{
394 394
 			$columnList = array('site_srl', 'group_srl');
395 395
 			$default_group = $oMemberModel->getDefaultGroup($site_module_info->site_srl, $columnList);
396
-			if($default_group->group_srl)
396
+			if ($default_group->group_srl)
397 397
 			{
398 398
 				$this->addMemberToGroup($args->member_srl, $default_group->group_srl, $site_module_info->site_srl);
399 399
 			}
400 400
 
401 401
 		}
402 402
 		// Log-in
403
-		if($config->enable_confirm != 'Y')
403
+		if ($config->enable_confirm != 'Y')
404 404
 		{
405
-			if($config->identifier == 'email_address')
405
+			if ($config->identifier == 'email_address')
406 406
 			{
407 407
 				$output = $this->doLogin($args->email_address);
408 408
 			}
@@ -410,8 +410,8 @@  discard block
 block discarded – undo
410 410
 			{
411 411
 				$output = $this->doLogin($args->user_id);
412 412
 			}
413
-			if(!$output->toBool()) {
414
-				if($output->error == -9)
413
+			if (!$output->toBool()) {
414
+				if ($output->error == -9)
415 415
 					$output->error = -11;
416 416
 				return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output);
417 417
 			}
@@ -419,8 +419,8 @@  discard block
 block discarded – undo
419 419
 
420 420
 		// Results
421 421
 		$this->add('member_srl', $args->member_srl);
422
-		if($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
423
-		if($config->enable_confirm == 'Y')
422
+		if ($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
423
+		if ($config->enable_confirm == 'Y')
424 424
 		{
425 425
 			$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
426 426
 			$this->setMessage($msg);
@@ -429,19 +429,19 @@  discard block
 block discarded – undo
429 429
 		else $this->setMessage('success_registed');
430 430
 		// Call a trigger (after)
431 431
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
432
-		if(!$trigger_output->toBool()) return $trigger_output;
432
+		if (!$trigger_output->toBool()) return $trigger_output;
433 433
 
434
-		if($config->redirect_url)
434
+		if ($config->redirect_url)
435 435
 		{
436 436
 			$returnUrl = $config->redirect_url;
437 437
 		}
438 438
 		else
439 439
 		{
440
-			if(Context::get('success_return_url'))
440
+			if (Context::get('success_return_url'))
441 441
 			{
442 442
 				$returnUrl = Context::get('success_return_url');
443 443
 			}
444
-			else if($_COOKIE['XE_REDIRECT_URL'])
444
+			else if ($_COOKIE['XE_REDIRECT_URL'])
445 445
 			{
446 446
 				$returnUrl = $_COOKIE['XE_REDIRECT_URL'];
447 447
 				setcookie("XE_REDIRECT_URL", '', 1);
@@ -455,26 +455,26 @@  discard block
 block discarded – undo
455 455
 
456 456
 	function procMemberModifyInfoBefore()
457 457
 	{
458
-		if($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD')
458
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD')
459 459
 		{
460 460
 			return $this->stop('msg_invalid_request');
461 461
 		}
462 462
 
463
-		if(!Context::get('is_logged'))
463
+		if (!Context::get('is_logged'))
464 464
 		{
465 465
 			return $this->stop('msg_not_logged');
466 466
 		}
467 467
 
468 468
 		$password = Context::get('password');
469 469
 
470
-		if(!$password)
470
+		if (!$password)
471 471
 		{
472 472
 			return $this->stop('msg_invalid_request');
473 473
 		}
474 474
 
475 475
 		$oMemberModel = getModel('member');
476 476
 
477
-		if(!$this->memberInfo->password)
477
+		if (!$this->memberInfo->password)
478 478
 		{
479 479
 			// Get information of logged-in user
480 480
 			$logged_info = Context::get('logged_info');
@@ -485,14 +485,14 @@  discard block
 block discarded – undo
485 485
 			$this->memberInfo->password = $memberInfo->password;
486 486
 		}
487 487
 		// Verify the current password
488
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
488
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
489 489
 		{
490 490
 			return new Object(-1, 'invalid_password');
491 491
 		}
492 492
 
493 493
 		$_SESSION['rechecked_password_step'] = 'VALIDATE_PASSWORD';
494 494
 
495
-		if(Context::get('success_return_url'))
495
+		if (Context::get('success_return_url'))
496 496
 		{
497 497
 			$redirectUrl = Context::get('success_return_url');
498 498
 		}
@@ -510,12 +510,12 @@  discard block
 block discarded – undo
510 510
 	 */
511 511
 	function procMemberModifyInfo()
512 512
 	{
513
-		if(!Context::get('is_logged'))
513
+		if (!Context::get('is_logged'))
514 514
 		{
515 515
 			return $this->stop('msg_not_logged');
516 516
 		}
517 517
 
518
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
518
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
519 519
 		{
520 520
 			return $this->stop('msg_invalid_request');
521 521
 		}
@@ -523,13 +523,13 @@  discard block
 block discarded – undo
523 523
 
524 524
 		// Extract the necessary information in advance
525 525
 		$oMemberModel = getModel('member');
526
-		$config = $oMemberModel->getMemberConfig ();
527
-		$getVars = array('find_account_answer','allow_mailing','allow_message');
528
-		if($config->signupForm)
526
+		$config = $oMemberModel->getMemberConfig();
527
+		$getVars = array('find_account_answer', 'allow_mailing', 'allow_message');
528
+		if ($config->signupForm)
529 529
 		{
530
-			foreach($config->signupForm as $formInfo)
530
+			foreach ($config->signupForm as $formInfo)
531 531
 			{
532
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
532
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
533 533
 				{
534 534
 					$getVars[] = $formInfo->name;
535 535
 				}
@@ -537,16 +537,16 @@  discard block
 block discarded – undo
537 537
 		}
538 538
 
539 539
 		$args = new stdClass;
540
-		foreach($getVars as $val)
540
+		foreach ($getVars as $val)
541 541
 		{
542 542
 			$args->{$val} = Context::get($val);
543
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
543
+			if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
544 544
 		}
545 545
 		// Login Information
546 546
 		$logged_info = Context::get('logged_info');
547 547
 		$args->member_srl = $logged_info->member_srl;
548 548
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
549
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
549
+		if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
550 550
 		// Remove some unnecessary variables from all the vars
551 551
 		$all_args = Context::getRequestVars();
552 552
 		unset($all_args->module);
@@ -570,9 +570,9 @@  discard block
 block discarded – undo
570 570
 
571 571
 		// remove whitespace
572 572
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
573
-		foreach($checkInfos as $val)
573
+		foreach ($checkInfos as $val)
574 574
 		{
575
-			if(isset($args->{$val}))
575
+			if (isset($args->{$val}))
576 576
 			{
577 577
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
578 578
 			}
@@ -580,22 +580,22 @@  discard block
 block discarded – undo
580 580
 
581 581
 		// Execute insert or update depending on the value of member_srl
582 582
 		$output = $this->updateMember($args);
583
-		if(!$output->toBool()) return $output;
583
+		if (!$output->toBool()) return $output;
584 584
 
585 585
 		$profile_image = $_FILES['profile_image'];
586
-		if(is_uploaded_file($profile_image['tmp_name']))
586
+		if (is_uploaded_file($profile_image['tmp_name']))
587 587
 		{
588 588
 			$this->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
589 589
 		}
590 590
 
591 591
 		$image_mark = $_FILES['image_mark'];
592
-		if(is_uploaded_file($image_mark['tmp_name']))
592
+		if (is_uploaded_file($image_mark['tmp_name']))
593 593
 		{
594 594
 			$this->insertImageMark($args->member_srl, $image_mark['tmp_name']);
595 595
 		}
596 596
 
597 597
 		$image_name = $_FILES['image_name'];
598
-		if(is_uploaded_file($image_name['tmp_name']))
598
+		if (is_uploaded_file($image_name['tmp_name']))
599 599
 		{
600 600
 			$this->insertImageName($args->member_srl, $image_name['tmp_name']);
601 601
 		}
@@ -610,7 +610,7 @@  discard block
 block discarded – undo
610 610
 
611 611
 		// Call a trigger after successfully log-in (after)
612 612
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo);
613
-		if(!$trigger_output->toBool()) return $trigger_output;
613
+		if (!$trigger_output->toBool()) return $trigger_output;
614 614
 
615 615
 		$this->setSessionInfo();
616 616
 		// Return result
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
 	 */
632 632
 	function procMemberModifyPassword()
633 633
 	{
634
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
634
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
635 635
 		// Extract the necessary information in advance
636 636
 		$current_password = trim(Context::get('current_password'));
637 637
 		$password = trim(Context::get('password1'));
@@ -645,17 +645,17 @@  discard block
 block discarded – undo
645 645
 
646 646
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
647 647
 		// Verify the cuttent password
648
-		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
648
+		if (!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
649 649
 
650 650
 		// Check if a new password is as same as the previous password
651
-		if($current_password == $password) return new Object(-1, 'invalid_new_password');
651
+		if ($current_password == $password) return new Object(-1, 'invalid_new_password');
652 652
 
653 653
 		// Execute insert or update depending on the value of member_srl
654 654
 		$args = new stdClass;
655 655
 		$args->member_srl = $member_srl;
656 656
 		$args->password = $password;
657 657
 		$output = $this->updateMemberPassword($args);
658
-		if(!$output->toBool()) return $output;
658
+		if (!$output->toBool()) return $output;
659 659
 
660 660
 		$this->add('member_srl', $args->member_srl);
661 661
 		$this->setMessage('success_updated');
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
 	 */
672 672
 	function procMemberLeave()
673 673
 	{
674
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
674
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
675 675
 		// Extract the necessary information in advance
676 676
 		$password = trim(Context::get('password'));
677 677
 		// Get information of logged-in user
@@ -680,17 +680,17 @@  discard block
 block discarded – undo
680 680
 		// Create a member model object
681 681
 		$oMemberModel = getModel('member');
682 682
 		// Get information of member_srl
683
-		if(!$this->memberInfo->password)
683
+		if (!$this->memberInfo->password)
684 684
 		{
685 685
 			$columnList = array('member_srl', 'password');
686 686
 			$memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
687 687
 			$this->memberInfo->password = $memberInfo->password;
688 688
 		}
689 689
 		// Verify the cuttent password
690
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
690
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
691 691
 
692 692
 		$output = $this->deleteMember($member_srl);
693
-		if(!$output->toBool()) return $output;
693
+		if (!$output->toBool()) return $output;
694 694
 		// Destroy all session information
695 695
 		$this->destroySessionInfo();
696 696
 		// Return success message
@@ -709,17 +709,17 @@  discard block
 block discarded – undo
709 709
 	{
710 710
 		// Check if the file is successfully uploaded
711 711
 		$file = $_FILES['profile_image'];
712
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
712
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
713 713
 		// Ignore if member_srl is invalid or doesn't exist.
714 714
 		$member_srl = Context::get('member_srl');
715
-		if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
715
+		if (!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
716 716
 
717 717
 		$logged_info = Context::get('logged_info');
718
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
718
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
719 719
 		// Return if member module is set not to use an image name or the user is not an administrator ;
720 720
 		$oModuleModel = getModel('module');
721 721
 		$config = $oModuleModel->getModuleConfig('member');
722
-		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
722
+		if ($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
723 723
 
724 724
 		$this->insertProfileImage($member_srl, $file['tmp_name']);
725 725
 		// Page refresh
@@ -741,25 +741,25 @@  discard block
 block discarded – undo
741 741
 	{
742 742
 
743 743
 		// Check uploaded file
744
-		if(!checkUploadedFile($target_file)) return;
744
+		if (!checkUploadedFile($target_file)) return;
745 745
 
746 746
 		$oMemberModel = getModel('member');
747 747
 		$config = $oMemberModel->getMemberConfig();
748 748
 
749 749
 		// Get an image size
750 750
 		$max_width = $config->profile_image_max_width;
751
-		if(!$max_width) $max_width = "90";
751
+		if (!$max_width) $max_width = "90";
752 752
 		$max_height = $config->profile_image_max_height;
753
-		if(!$max_height) $max_height = "90";
753
+		if (!$max_height) $max_height = "90";
754 754
 		// Get a target path to save
755 755
 		$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
756 756
 		FileHandler::makeDir($target_path);
757 757
 
758 758
 		// Get file information
759 759
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
760
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
761
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
762
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
760
+		if (IMAGETYPE_PNG == $type) $ext = 'png';
761
+		elseif (IMAGETYPE_JPEG == $type) $ext = 'jpg';
762
+		elseif (IMAGETYPE_GIF == $type) $ext = 'gif';
763 763
 		else
764 764
 		{
765 765
 			return;
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
 
770 770
 		$target_filename = sprintf('%s%d.%s', $target_path, $member_srl, $ext);
771 771
 		// Convert if the image size is larger than a given size or if the format is not a gif
772
-		if(($width > $max_width || $height > $max_height ) && $type != 1)
772
+		if (($width > $max_width || $height > $max_height) && $type != 1)
773 773
 		{
774 774
 			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
775 775
 		}
@@ -788,17 +788,17 @@  discard block
 block discarded – undo
788 788
 	{
789 789
 		// Check if the file is successfully uploaded
790 790
 		$file = $_FILES['image_name'];
791
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
791
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
792 792
 		// Ignore if member_srl is invalid or doesn't exist.
793 793
 		$member_srl = Context::get('member_srl');
794
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
794
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_name');
795 795
 
796 796
 		$logged_info = Context::get('logged_info');
797
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
797
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
798 798
 		// Return if member module is set not to use an image name or the user is not an administrator ;
799 799
 		$oModuleModel = getModel('module');
800 800
 		$config = $oModuleModel->getModuleConfig('member');
801
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
801
+		if ($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
802 802
 
803 803
 		$this->insertImageName($member_srl, $file['tmp_name']);
804 804
 		// Page refresh
@@ -819,15 +819,15 @@  discard block
 block discarded – undo
819 819
 	function insertImageName($member_srl, $target_file)
820 820
 	{
821 821
 		// Check uploaded file
822
-		if(!checkUploadedFile($target_file)) return;
822
+		if (!checkUploadedFile($target_file)) return;
823 823
 
824 824
 		$oModuleModel = getModel('module');
825 825
 		$config = $oModuleModel->getModuleConfig('member');
826 826
 		// Get an image size
827 827
 		$max_width = $config->image_name_max_width;
828
-		if(!$max_width) $max_width = "90";
828
+		if (!$max_width) $max_width = "90";
829 829
 		$max_height = $config->image_name_max_height;
830
-		if(!$max_height) $max_height = "20";
830
+		if (!$max_height) $max_height = "20";
831 831
 		// Get a target path to save
832 832
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
833 833
 		FileHandler::makeDir($target_path);
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
 		// Get file information
837 837
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
838 838
 		// Convert if the image size is larger than a given size or if the format is not a gif
839
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
839
+		if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
840 840
 		else @copy($target_file, $target_filename);
841 841
 	}
842 842
 
@@ -848,20 +848,20 @@  discard block
 block discarded – undo
848 848
 	function procMemberDeleteProfileImage($_memberSrl = 0)
849 849
 	{
850 850
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
851
-		if(!$member_srl)
851
+		if (!$member_srl)
852 852
 		{
853
-			return new Object(0,'success');
853
+			return new Object(0, 'success');
854 854
 		}
855 855
 
856 856
 		$logged_info = Context::get('logged_info');
857 857
 
858
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
858
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
859 859
 		{
860 860
 			$oMemberModel = getModel('member');
861 861
 			$profile_image = $oMemberModel->getProfileImage($member_srl);
862 862
 			FileHandler::removeFile($profile_image->file);
863 863
 		}
864
-		return new Object(0,'success');
864
+		return new Object(0, 'success');
865 865
 	}
866 866
 
867 867
 	/**
@@ -872,20 +872,20 @@  discard block
 block discarded – undo
872 872
 	function procMemberDeleteImageName($_memberSrl = 0)
873 873
 	{
874 874
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
875
-		if(!$member_srl)
875
+		if (!$member_srl)
876 876
 		{
877
-			return new Object(0,'success');
877
+			return new Object(0, 'success');
878 878
 		}
879 879
 
880 880
 		$logged_info = Context::get('logged_info');
881 881
 
882
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
882
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
883 883
 		{
884 884
 			$oMemberModel = getModel('member');
885 885
 			$image_name = $oMemberModel->getImageName($member_srl);
886 886
 			FileHandler::removeFile($image_name->file);
887 887
 		}
888
-		return new Object(0,'success');
888
+		return new Object(0, 'success');
889 889
 	}
890 890
 
891 891
 	/**
@@ -897,17 +897,17 @@  discard block
 block discarded – undo
897 897
 	{
898 898
 		// Check if the file is successfully uploaded
899 899
 		$file = $_FILES['image_mark'];
900
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
900
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
901 901
 		// Ignore if member_srl is invalid or doesn't exist.
902 902
 		$member_srl = Context::get('member_srl');
903
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
903
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
904 904
 
905 905
 		$logged_info = Context::get('logged_info');
906
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
906
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
907 907
 		// Membership in the images mark the module using the ban was set by an administrator or return;
908 908
 		$oModuleModel = getModel('module');
909 909
 		$config = $oModuleModel->getModuleConfig('member');
910
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
910
+		if ($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
911 911
 
912 912
 		$this->insertImageMark($member_srl, $file['tmp_name']);
913 913
 		// Page refresh
@@ -928,15 +928,15 @@  discard block
 block discarded – undo
928 928
 	function insertImageMark($member_srl, $target_file)
929 929
 	{
930 930
 		// Check uploaded file
931
-		if(!checkUploadedFile($target_file)) return;
931
+		if (!checkUploadedFile($target_file)) return;
932 932
 
933 933
 		$oModuleModel = getModel('module');
934 934
 		$config = $oModuleModel->getModuleConfig('member');
935 935
 		// Get an image size
936 936
 		$max_width = $config->image_mark_max_width;
937
-		if(!$max_width) $max_width = "20";
937
+		if (!$max_width) $max_width = "20";
938 938
 		$max_height = $config->image_mark_max_height;
939
-		if(!$max_height) $max_height = "20";
939
+		if (!$max_height) $max_height = "20";
940 940
 
941 941
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
942 942
 		FileHandler::makeDir($target_path);
@@ -945,7 +945,7 @@  discard block
 block discarded – undo
945 945
 		// Get file information
946 946
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
947 947
 
948
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
948
+		if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
949 949
 		else @copy($target_file, $target_filename);
950 950
 	}
951 951
 
@@ -957,20 +957,20 @@  discard block
 block discarded – undo
957 957
 	function procMemberDeleteImageMark($_memberSrl = 0)
958 958
 	{
959 959
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
960
-		if(!$member_srl)
960
+		if (!$member_srl)
961 961
 		{
962
-			return new Object(0,'success');
962
+			return new Object(0, 'success');
963 963
 		}
964 964
 
965 965
 		$logged_info = Context::get('logged_info');
966 966
 
967
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
967
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
968 968
 		{
969 969
 			$oMemberModel = getModel('member');
970 970
 			$image_mark = $oMemberModel->getImageMark($member_srl);
971 971
 			FileHandler::removeFile($image_mark->file);
972 972
 		}
973
-		return new Object(0,'success');
973
+		return new Object(0, 'success');
974 974
 	}
975 975
 
976 976
 	/**
@@ -981,26 +981,26 @@  discard block
 block discarded – undo
981 981
 	function procMemberFindAccount()
982 982
 	{
983 983
 		$email_address = Context::get('email_address');
984
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
984
+		if (!$email_address) return new Object(-1, 'msg_invalid_request');
985 985
 
986 986
 		$oMemberModel = getModel('member');
987 987
 		$oModuleModel = getModel('module');
988 988
 
989 989
 		// Check if a member having the same email address exists
990 990
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
991
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
991
+		if (!$member_srl) return new Object(-1, 'msg_email_not_exists');
992 992
 
993 993
 		// Get information of the member
994 994
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
995 995
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
996 996
 
997 997
 		// Check if possible to find member's ID and password
998
-		if($member_info->denied == 'Y')
998
+		if ($member_info->denied == 'Y')
999 999
 		{
1000 1000
 			$chk_args = new stdClass;
1001 1001
 			$chk_args->member_srl = $member_info->member_srl;
1002 1002
 			$output = executeQuery('member.chkAuthMail', $chk_args);
1003
-			if($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
1003
+			if ($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
1004 1004
 		}
1005 1005
 
1006 1006
 		// Insert data into the authentication DB
@@ -1013,19 +1013,19 @@  discard block
 block discarded – undo
1013 1013
 		$args->is_register = 'N';
1014 1014
 
1015 1015
 		$output = executeQuery('member.insertAuthMail', $args);
1016
-		if(!$output->toBool()) return $output;
1016
+		if (!$output->toBool()) return $output;
1017 1017
 		// Get content of the email to send a member
1018 1018
 		Context::set('auth_args', $args);
1019 1019
 
1020 1020
 		$member_config = $oModuleModel->getModuleConfig('member');
1021 1021
 		$memberInfo = array();
1022 1022
 		global $lang;
1023
-		if(is_array($member_config->signupForm))
1023
+		if (is_array($member_config->signupForm))
1024 1024
 		{
1025
-			$exceptForm=array('password', 'find_account_question');
1026
-			foreach($member_config->signupForm as $form)
1025
+			$exceptForm = array('password', 'find_account_question');
1026
+			foreach ($member_config->signupForm as $form)
1027 1027
 			{
1028
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1028
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1029 1029
 				{
1030 1030
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1031 1031
 				}
@@ -1040,15 +1040,15 @@  discard block
 block discarded – undo
1040 1040
 		}
1041 1041
 		Context::set('memberInfo', $memberInfo);
1042 1042
 
1043
-		if(!$member_config->skin) $member_config->skin = "default";
1044
-		if(!$member_config->colorset) $member_config->colorset = "white";
1043
+		if (!$member_config->skin) $member_config->skin = "default";
1044
+		if (!$member_config->colorset) $member_config->colorset = "white";
1045 1045
 
1046 1046
 		Context::set('member_config', $member_config);
1047 1047
 
1048 1048
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1049
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1049
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1050 1050
 
1051
-		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1051
+		$find_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1052 1052
 		Context::set('find_url', $find_url);
1053 1053
 
1054 1054
 		$oTemplate = &TemplateHandler::getInstance();
@@ -1058,19 +1058,19 @@  discard block
 block discarded – undo
1058 1058
 		$member_config = $oModuleModel->getModuleConfig('member');
1059 1059
 		// Send a mail
1060 1060
 		$oMail = new Mail();
1061
-		$oMail->setTitle( Context::getLang('msg_find_account_title') );
1061
+		$oMail->setTitle(Context::getLang('msg_find_account_title'));
1062 1062
 		$oMail->setContent($content);
1063
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1064
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1063
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1064
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1065 1065
 		$oMail->send();
1066 1066
 		// Return message
1067 1067
 		$msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address);
1068
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
1068
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
1069 1069
 		{
1070 1070
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberFindAccount');
1071 1071
 			$this->setRedirectUrl($returnUrl);
1072 1072
 		}
1073
-		return new Object(0,$msg);
1073
+		return new Object(0, $msg);
1074 1074
 	}
1075 1075
 
1076 1076
 	/**
@@ -1088,28 +1088,28 @@  discard block
 block discarded – undo
1088 1088
 		$find_account_question = trim(Context::get('find_account_question'));
1089 1089
 		$find_account_answer = trim(Context::get('find_account_answer'));
1090 1090
 
1091
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1091
+		if (($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1092 1092
 
1093 1093
 		$oModuleModel = getModel('module');
1094 1094
 		// Check if a member having the same email address exists
1095 1095
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1096
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1096
+		if (!$member_srl) return new Object(-1, 'msg_email_not_exists');
1097 1097
 		// Get information of the member
1098 1098
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1099 1099
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1100 1100
 
1101 1101
 		// Display a message if no answer is entered
1102
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1102
+		if (!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1103 1103
 
1104
-		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');
1104
+		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');
1105 1105
 
1106
-		if($config->identifier == 'email_address')
1106
+		if ($config->identifier == 'email_address')
1107 1107
 		{
1108 1108
 			$user_id = $email_address;
1109 1109
 		}
1110 1110
 
1111 1111
 		// Update to a temporary password and set change_password_date to 1
1112
-		$oPassword =  new Password();
1112
+		$oPassword = new Password();
1113 1113
 		$temp_password = $oPassword->createTemporaryPassword(8);
1114 1114
 
1115 1115
 		$args = new stdClass();
@@ -1117,11 +1117,11 @@  discard block
 block discarded – undo
1117 1117
 		$args->password = $temp_password;
1118 1118
 		$args->change_password_date = '1';
1119 1119
 		$output = $this->updateMemberPassword($args);
1120
-		if(!$output->toBool()) return $output;
1120
+		if (!$output->toBool()) return $output;
1121 1121
 
1122
-		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1122
+		$_SESSION['xe_temp_password_'.$user_id] = $temp_password;
1123 1123
 
1124
-		$this->add('user_id',$user_id);
1124
+		$this->add('user_id', $user_id);
1125 1125
 
1126 1126
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
1127 1127
 		$this->setRedirectUrl($returnUrl.'&user_id='.$user_id);
@@ -1141,7 +1141,7 @@  discard block
 block discarded – undo
1141 1141
 		$member_srl = Context::get('member_srl');
1142 1142
 		$auth_key = Context::get('auth_key');
1143 1143
 
1144
-		if(!$member_srl || !$auth_key)
1144
+		if (!$member_srl || !$auth_key)
1145 1145
 		{
1146 1146
 			return $this->stop('msg_invalid_request');
1147 1147
 		}
@@ -1152,9 +1152,9 @@  discard block
 block discarded – undo
1152 1152
 		$args->auth_key = $auth_key;
1153 1153
 		$output = executeQuery('member.getAuthMail', $args);
1154 1154
 
1155
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
1155
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
1156 1156
 		{
1157
-			if(strlen($output->data->auth_key) !== strlen($auth_key))
1157
+			if (strlen($output->data->auth_key) !== strlen($auth_key))
1158 1158
 			{
1159 1159
 				executeQuery('member.deleteAuthMail', $args);
1160 1160
 			}
@@ -1162,7 +1162,7 @@  discard block
 block discarded – undo
1162 1162
 			return $this->stop('msg_invalid_auth_key');
1163 1163
 		}
1164 1164
 
1165
-		if(ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1165
+		if (ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1166 1166
 		{
1167 1167
 			executeQuery('member.deleteAuthMail', $args);
1168 1168
 			return $this->stop('msg_invalid_auth_key');
@@ -1171,7 +1171,7 @@  discard block
 block discarded – undo
1171 1171
 		$args->password = $output->data->new_password;
1172 1172
 
1173 1173
 		// If credentials are correct, change the password to a new one
1174
-		if($output->data->is_register == 'Y')
1174
+		if ($output->data->is_register == 'Y')
1175 1175
 		{
1176 1176
 			$args->denied = 'N';
1177 1177
 		}
@@ -1184,13 +1184,13 @@  discard block
 block discarded – undo
1184 1184
 		$is_register = $output->data->is_register;
1185 1185
 
1186 1186
 		$output = executeQuery('member.updateMemberPassword', $args);
1187
-		if(!$output->toBool())
1187
+		if (!$output->toBool())
1188 1188
 		{
1189 1189
 			return $this->stop($output->getMessage());
1190 1190
 		}
1191 1191
 
1192 1192
 		// Remove all values having the member_srl from authentication table
1193
-		executeQuery('member.deleteAuthMail',$args);
1193
+		executeQuery('member.deleteAuthMail', $args);
1194 1194
 
1195 1195
 		$this->_clearMemberCache($args->member_srl);
1196 1196
 
@@ -1209,33 +1209,33 @@  discard block
 block discarded – undo
1209 1209
 	{
1210 1210
 		// Get an email_address
1211 1211
 		$email_address = Context::get('email_address');
1212
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1212
+		if (!$email_address) return new Object(-1, 'msg_invalid_request');
1213 1213
 		// Log test by using email_address
1214 1214
 		$oMemberModel = getModel('member');
1215 1215
 
1216 1216
 		$args = new stdClass;
1217 1217
 		$args->email_address = $email_address;
1218 1218
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1219
-		if(!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1219
+		if (!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1220 1220
 
1221 1221
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1222 1222
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1223 1223
 
1224 1224
 		$oModuleModel = getModel('module');
1225 1225
 		$member_config = $oModuleModel->getModuleConfig('member');
1226
-		if(!$member_config->skin) $member_config->skin = "default";
1227
-		if(!$member_config->colorset) $member_config->colorset = "white";
1226
+		if (!$member_config->skin) $member_config->skin = "default";
1227
+		if (!$member_config->colorset) $member_config->colorset = "white";
1228 1228
 
1229 1229
 		// Check if a authentication mail has been sent previously
1230 1230
 		$chk_args = new stdClass;
1231 1231
 		$chk_args->member_srl = $member_info->member_srl;
1232 1232
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1233
-		if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1233
+		if ($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1234 1234
 
1235 1235
 		$auth_args = new stdClass;
1236 1236
 		$auth_args->member_srl = $member_info->member_srl;
1237 1237
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1238
-		if(!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1238
+		if (!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1239 1239
 		$auth_info = $output->data[0];
1240 1240
 
1241 1241
 		// Update the regdate of authmail entry
@@ -1246,12 +1246,12 @@  discard block
 block discarded – undo
1246 1246
 
1247 1247
 		$memberInfo = array();
1248 1248
 		global $lang;
1249
-		if(is_array($member_config->signupForm))
1249
+		if (is_array($member_config->signupForm))
1250 1250
 		{
1251
-			$exceptForm=array('password', 'find_account_question');
1252
-			foreach($member_config->signupForm as $form)
1251
+			$exceptForm = array('password', 'find_account_question');
1252
+			foreach ($member_config->signupForm as $form)
1253 1253
 			{
1254
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1254
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1255 1255
 				{
1256 1256
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1257 1257
 				}
@@ -1270,19 +1270,19 @@  discard block
 block discarded – undo
1270 1270
 		Context::set('member_config', $member_config);
1271 1271
 
1272 1272
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1273
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1273
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1274 1274
 
1275
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1275
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_info->auth_key);
1276 1276
 		Context::set('auth_url', $auth_url);
1277 1277
 
1278 1278
 		$oTemplate = &TemplateHandler::getInstance();
1279 1279
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1280 1280
 		// Send a mail
1281 1281
 		$oMail = new Mail();
1282
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1282
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1283 1283
 		$oMail->setContent($content);
1284
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1285
-		$oMail->setReceiptor( $args->user_name, $args->email_address );
1284
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1285
+		$oMail->setReceiptor($args->user_name, $args->email_address);
1286 1286
 		$oMail->send();
1287 1287
 
1288 1288
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
@@ -1297,23 +1297,23 @@  discard block
 block discarded – undo
1297 1297
 		$memberInfo = $_SESSION['auth_member_info'];
1298 1298
 		unset($_SESSION['auth_member_info']);
1299 1299
 
1300
-		if(!$memberInfo)
1300
+		if (!$memberInfo)
1301 1301
 		{
1302 1302
 			return $this->stop('msg_invalid_request');
1303 1303
 		}
1304 1304
 
1305 1305
 		$newEmail = Context::get('email_address');
1306 1306
 
1307
-		if(!$newEmail)
1307
+		if (!$newEmail)
1308 1308
 		{
1309 1309
 			return $this->stop('msg_invalid_request');
1310 1310
 		}
1311 1311
 
1312 1312
 		$oMemberModel = getModel('member');
1313 1313
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
1314
-		if($member_srl)
1314
+		if ($member_srl)
1315 1315
 		{
1316
-			return new Object(-1,'msg_exists_email_address');
1316
+			return new Object(-1, 'msg_exists_email_address');
1317 1317
 		}
1318 1318
 
1319 1319
 		// remove all key by member_srl
@@ -1321,7 +1321,7 @@  discard block
 block discarded – undo
1321 1321
 		$args->member_srl = $memberInfo->member_srl;
1322 1322
 		$output = executeQuery('member.deleteAuthMail', $args);
1323 1323
 
1324
-		if(!$output->toBool())
1324
+		if (!$output->toBool())
1325 1325
 		{
1326 1326
 			return $output;
1327 1327
 		}
@@ -1331,7 +1331,7 @@  discard block
 block discarded – undo
1331 1331
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
1332 1332
 
1333 1333
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
1334
-		if(!$output->toBool())
1334
+		if (!$output->toBool())
1335 1335
 		{
1336 1336
 			return $this->stop($output->getMessage());
1337 1337
 		}
@@ -1348,7 +1348,7 @@  discard block
 block discarded – undo
1348 1348
 		$auth_args->is_register = 'Y';
1349 1349
 
1350 1350
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1351
-		if(!$output->toBool()) return $output;
1351
+		if (!$output->toBool()) return $output;
1352 1352
 
1353 1353
 		$memberInfo->email_address = $newEmail;
1354 1354
 
@@ -1372,12 +1372,12 @@  discard block
 block discarded – undo
1372 1372
 		$memberInfo = array();
1373 1373
 
1374 1374
 		global $lang;
1375
-		if(is_array($member_config->signupForm))
1375
+		if (is_array($member_config->signupForm))
1376 1376
 		{
1377
-			$exceptForm=array('password', 'find_account_question');
1378
-			foreach($member_config->signupForm as $form)
1377
+			$exceptForm = array('password', 'find_account_question');
1378
+			foreach ($member_config->signupForm as $form)
1379 1379
 			{
1380
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1380
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1381 1381
 				{
1382 1382
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1383 1383
 				}
@@ -1392,25 +1392,25 @@  discard block
 block discarded – undo
1392 1392
 		}
1393 1393
 		Context::set('memberInfo', $memberInfo);
1394 1394
 
1395
-		if(!$member_config->skin) $member_config->skin = "default";
1396
-		if(!$member_config->colorset) $member_config->colorset = "white";
1395
+		if (!$member_config->skin) $member_config->skin = "default";
1396
+		if (!$member_config->colorset) $member_config->colorset = "white";
1397 1397
 
1398 1398
 		Context::set('member_config', $member_config);
1399 1399
 
1400 1400
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1401
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1401
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1402 1402
 
1403
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1403
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
1404 1404
 		Context::set('auth_url', $auth_url);
1405 1405
 
1406 1406
 		$oTemplate = &TemplateHandler::getInstance();
1407 1407
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1408 1408
 		// Send a mail
1409 1409
 		$oMail = new Mail();
1410
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1410
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1411 1411
 		$oMail->setContent($content);
1412
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1413
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1412
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1413
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1414 1414
 		$oMail->send();
1415 1415
 	}
1416 1416
 
@@ -1423,7 +1423,7 @@  discard block
 block discarded – undo
1423 1423
 	{
1424 1424
 		$site_module_info = Context::get('site_module_info');
1425 1425
 		$logged_info = Context::get('logged_info');
1426
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1426
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new Object(-1, 'msg_invalid_request');
1427 1427
 
1428 1428
 		$oMemberModel = getModel('member');
1429 1429
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1442,13 +1442,13 @@  discard block
 block discarded – undo
1442 1442
 	{
1443 1443
 		$site_module_info = Context::get('site_module_info');
1444 1444
 		$logged_info = Context::get('logged_info');
1445
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1445
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new Object(-1, 'msg_invalid_request');
1446 1446
 
1447 1447
 		$args = new stdClass;
1448
-		$args->site_srl= $site_module_info->site_srl;
1448
+		$args->site_srl = $site_module_info->site_srl;
1449 1449
 		$args->member_srl = $logged_info->member_srl;
1450 1450
 		$output = executeQuery('member.deleteMembersGroup', $args);
1451
-		if(!$output->toBool()) return $output;
1451
+		if (!$output->toBool()) return $output;
1452 1452
 		$this->setMessage('success_deleted');
1453 1453
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1454 1454
 	}
@@ -1462,25 +1462,25 @@  discard block
 block discarded – undo
1462 1462
 	 */
1463 1463
 	function setMemberConfig($args)
1464 1464
 	{
1465
-		if(!$args->skin) $args->skin = "default";
1466
-		if(!$args->colorset) $args->colorset = "white";
1467
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1468
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1469
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1470
-		$args->enable_openid= 'N';
1471
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1472
-		if($args->image_name!='Y') $args->image_name = 'N';
1473
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1474
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1475
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1476
-		$args->limit_day = (int)$args->limit_day;
1465
+		if (!$args->skin) $args->skin = "default";
1466
+		if (!$args->colorset) $args->colorset = "white";
1467
+		if (!$args->editor_skin) $args->editor_skin = "ckeditor";
1468
+		if (!$args->editor_colorset) $args->editor_colorset = "moono";
1469
+		if ($args->enable_join != 'Y') $args->enable_join = 'N';
1470
+		$args->enable_openid = 'N';
1471
+		if ($args->profile_image != 'Y') $args->profile_image = 'N';
1472
+		if ($args->image_name != 'Y') $args->image_name = 'N';
1473
+		if ($args->image_mark != 'Y') $args->image_mark = 'N';
1474
+		if ($args->group_image_mark != 'Y') $args->group_image_mark = 'N';
1475
+		if (!trim(strip_tags($args->agreement))) $args->agreement = null;
1476
+		$args->limit_day = (int) $args->limit_day;
1477 1477
 
1478 1478
 		$agreement = trim($args->agreement);
1479 1479
 		unset($args->agreement);
1480 1480
 
1481 1481
 		$oModuleController = getController('module');
1482
-		$output = $oModuleController->insertModuleConfig('member',$args);
1483
-		if(!$output->toBool()) return $output;
1482
+		$output = $oModuleController->insertModuleConfig('member', $args);
1483
+		if (!$output->toBool()) return $output;
1484 1484
 
1485 1485
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1486 1486
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1501,11 +1501,11 @@  discard block
 block discarded – undo
1501 1501
 		$signature = trim(removeHackTag($signature));
1502 1502
 		$signature = preg_replace('/<(\/?)(embed|object|param)/is', '&lt;$1$2', $signature);
1503 1503
 
1504
-		$check_signature = trim(str_replace(array('&nbsp;',"\n","\r"), '', strip_tags($signature, '<img><object>')));
1504
+		$check_signature = trim(str_replace(array('&nbsp;', "\n", "\r"), '', strip_tags($signature, '<img><object>')));
1505 1505
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1506 1506
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1507 1507
 
1508
-		if(!$check_signature) return FileHandler::removeFile($filename);
1508
+		if (!$check_signature) return FileHandler::removeFile($filename);
1509 1509
 
1510 1510
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1511 1511
 		FileHandler::makeDir($path);
@@ -1534,15 +1534,15 @@  discard block
 block discarded – undo
1534 1534
 	 *
1535 1535
 	 * @return Object
1536 1536
 	 */
1537
-	function addMemberToGroup($member_srl, $group_srl, $site_srl=0)
1537
+	function addMemberToGroup($member_srl, $group_srl, $site_srl = 0)
1538 1538
 	{
1539 1539
 		$args = new stdClass();
1540 1540
 		$args->member_srl = $member_srl;
1541 1541
 		$args->group_srl = $group_srl;
1542
-		if($site_srl) $args->site_srl = $site_srl;
1542
+		if ($site_srl) $args->site_srl = $site_srl;
1543 1543
 
1544 1544
 		// Add
1545
-		$output = executeQuery('member.addMemberToGroup',$args);
1545
+		$output = executeQuery('member.addMemberToGroup', $args);
1546 1546
 		$output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args);
1547 1547
 
1548 1548
 		$this->_clearMemberCache($member_srl, $site_srl);
@@ -1562,18 +1562,18 @@  discard block
 block discarded – undo
1562 1562
 	{
1563 1563
 		$obj = new stdClass;
1564 1564
 		$obj->site_srl = $args->site_srl;
1565
-		$obj->member_srl = implode(',',$args->member_srl);
1565
+		$obj->member_srl = implode(',', $args->member_srl);
1566 1566
 
1567 1567
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1568
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1568
+		if ($output->data) foreach ($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1569 1569
 
1570 1570
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1571
-		if(!$output->toBool()) return $output;
1571
+		if (!$output->toBool()) return $output;
1572 1572
 
1573 1573
 		$inserted_members = array();
1574
-		foreach($args->member_srl as $key => $val)
1574
+		foreach ($args->member_srl as $key => $val)
1575 1575
 		{
1576
-			if($inserted_members[$val]) continue;
1576
+			if ($inserted_members[$val]) continue;
1577 1577
 			$inserted_members[$val] = true;
1578 1578
 
1579 1579
 			unset($obj);
@@ -1583,7 +1583,7 @@  discard block
 block discarded – undo
1583 1583
 			$obj->site_srl = $args->site_srl;
1584 1584
 			$obj->regdate = $date[$obj->member_srl];
1585 1585
 			$output = executeQuery('member.addMemberToGroup', $obj);
1586
-			if(!$output->toBool()) return $output;
1586
+			if (!$output->toBool()) return $output;
1587 1587
 
1588 1588
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1589 1589
 		}
@@ -1605,9 +1605,9 @@  discard block
 block discarded – undo
1605 1605
 		// Get information of the key
1606 1606
 		$output = executeQuery('member.getAutologin', $args);
1607 1607
 		// If no information exists, delete a cookie
1608
-		if(!$output->toBool() || !$output->data)
1608
+		if (!$output->toBool() || !$output->data)
1609 1609
 		{
1610
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
1610
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365);
1611 1611
 			return;
1612 1612
 		}
1613 1613
 
@@ -1617,9 +1617,9 @@  discard block
 block discarded – undo
1617 1617
 		$user_id = ($config->identifier == 'user_id') ? $output->data->user_id : $output->data->email_address;
1618 1618
 		$password = $output->data->password;
1619 1619
 
1620
-		if(!$user_id || !$password)
1620
+		if (!$user_id || !$password)
1621 1621
 		{
1622
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
1622
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365);
1623 1623
 			return;
1624 1624
 		}
1625 1625
 
@@ -1629,7 +1629,7 @@  discard block
 block discarded – undo
1629 1629
 		$check_key = strtolower($user_id).$password.$_SERVER['HTTP_USER_AGENT'];
1630 1630
 		$check_key = substr(hash_hmac('sha256', $check_key, substr($args->autologin_key, 0, 32)), 0, 32);
1631 1631
 
1632
-		if($check_key === substr($args->autologin_key, 32))
1632
+		if ($check_key === substr($args->autologin_key, 32))
1633 1633
 		{
1634 1634
 			// Check change_password_date
1635 1635
 			$oModuleModel = getModel('module');
@@ -1637,12 +1637,12 @@  discard block
 block discarded – undo
1637 1637
 			$limit_date = $member_config->change_password_date;
1638 1638
 
1639 1639
 			// Check if change_password_date is set
1640
-			if($limit_date > 0)
1640
+			if ($limit_date > 0)
1641 1641
 			{
1642 1642
 				$oMemberModel = getModel('member');
1643 1643
 				$columnList = array('member_srl', 'change_password_date');
1644 1644
 
1645
-				if($config->identifier == 'user_id')
1645
+				if ($config->identifier == 'user_id')
1646 1646
 				{
1647 1647
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1648 1648
 				}
@@ -1651,7 +1651,7 @@  discard block
 block discarded – undo
1651 1651
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1652 1652
 				}
1653 1653
 
1654
-				if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){
1654
+				if ($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day'))) {
1655 1655
 					$do_auto_login = true;
1656 1656
 				}
1657 1657
 
@@ -1662,14 +1662,14 @@  discard block
 block discarded – undo
1662 1662
 			}
1663 1663
 		}
1664 1664
 
1665
-		if($do_auto_login)
1665
+		if ($do_auto_login)
1666 1666
 		{
1667 1667
 			$output = $this->doLogin($user_id);
1668 1668
 		}
1669 1669
 		else
1670 1670
 		{
1671 1671
 			executeQuery('member.deleteAutologin', $args);
1672
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
1672
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365);
1673 1673
 		}
1674 1674
 	}
1675 1675
 
@@ -1685,13 +1685,13 @@  discard block
 block discarded – undo
1685 1685
 	function doLogin($user_id, $password = '', $keep_signed = false)
1686 1686
 	{
1687 1687
 		$user_id = strtolower($user_id);
1688
-		if(!$user_id) return new Object(-1, 'null_user_id');
1688
+		if (!$user_id) return new Object(-1, 'null_user_id');
1689 1689
 		// Call a trigger before log-in (before)
1690 1690
 		$trigger_obj = new stdClass();
1691 1691
 		$trigger_obj->user_id = $user_id;
1692 1692
 		$trigger_obj->password = $password;
1693 1693
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1694
-		if(!$trigger_output->toBool()) return $trigger_output;
1694
+		if (!$trigger_output->toBool()) return $trigger_output;
1695 1695
 		// Create a member model object
1696 1696
 		$oMemberModel = getModel('member');
1697 1697
 
@@ -1701,12 +1701,12 @@  discard block
 block discarded – undo
1701 1701
 		$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1702 1702
 
1703 1703
 		// check identifier
1704
-		if($config->identifier == 'email_address')
1704
+		if ($config->identifier == 'email_address')
1705 1705
 		{
1706 1706
 			// Get user_id information
1707 1707
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1708 1708
 			// Set an invalid user if no value returned
1709
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1709
+			if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1710 1710
 
1711 1711
 		}
1712 1712
 		else
@@ -1714,24 +1714,24 @@  discard block
 block discarded – undo
1714 1714
 			// Get user_id information
1715 1715
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1716 1716
 			// Set an invalid user if no value returned
1717
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1717
+			if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1718 1718
 		}
1719 1719
 
1720 1720
 		$output = executeQuery('member.getLoginCountByIp', $args);
1721 1721
 		$errorCount = $output->data->count;
1722
-		if($errorCount >= $config->max_error_count)
1722
+		if ($errorCount >= $config->max_error_count)
1723 1723
 		{
1724 1724
 			$last_update = strtotime($output->data->last_update);
1725
-			$term = intval($_SERVER['REQUEST_TIME']-$last_update);
1726
-			if($term < $config->max_error_count_time)
1725
+			$term = intval($_SERVER['REQUEST_TIME'] - $last_update);
1726
+			if ($term < $config->max_error_count_time)
1727 1727
 			{
1728 1728
 				$term = $config->max_error_count_time - $term;
1729
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1730
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1731
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1732
-				else $term = intval($term/86400).Context::getLang('unit_day');
1729
+				if ($term < 60) $term = intval($term).Context::getLang('unit_sec');
1730
+				elseif (60 <= $term && $term < 3600) $term = intval($term / 60).Context::getLang('unit_min');
1731
+				elseif (3600 <= $term && $term < 86400) $term = intval($term / 3600).Context::getLang('unit_hour');
1732
+				else $term = intval($term / 86400).Context::getLang('unit_day');
1733 1733
 
1734
-				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1734
+				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'), $term));
1735 1735
 			}
1736 1736
 			else
1737 1737
 			{
@@ -1741,13 +1741,13 @@  discard block
 block discarded – undo
1741 1741
 		}
1742 1742
 
1743 1743
 		// Password Check
1744
-		if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1744
+		if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1745 1745
 		{
1746
-			return $this->recordMemberLoginError(-1, 'invalid_password',$this->memberInfo);
1746
+			return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo);
1747 1747
 		}
1748 1748
 
1749 1749
 		// If denied == 'Y', notify
1750
-		if($this->memberInfo->denied == 'Y')
1750
+		if ($this->memberInfo->denied == 'Y')
1751 1751
 		{
1752 1752
 			$args->member_srl = $this->memberInfo->member_srl;
1753 1753
 			$output = executeQuery('member.chkAuthMail', $args);
@@ -1755,12 +1755,12 @@  discard block
 block discarded – undo
1755 1755
 			{
1756 1756
 				$_SESSION['auth_member_srl'] = $this->memberInfo->member_srl;
1757 1757
 				$redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail');
1758
-				return $this->setRedirectUrl($redirectUrl, new Object(-1,'msg_user_not_confirmed'));
1758
+				return $this->setRedirectUrl($redirectUrl, new Object(-1, 'msg_user_not_confirmed'));
1759 1759
 			}
1760
-			return new Object(-1,'msg_user_denied');
1760
+			return new Object(-1, 'msg_user_denied');
1761 1761
 		}
1762 1762
 		// Notify if denied_date is less than the current time
1763
-		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")));
1763
+		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")));
1764 1764
 		// Update the latest login time
1765 1765
 		$args->member_srl = $this->memberInfo->member_srl;
1766 1766
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1770,36 +1770,36 @@  discard block
 block discarded – undo
1770 1770
 
1771 1771
 		// Check if there is recoding table.
1772 1772
 		$oDB = &DB::getInstance();
1773
-		if($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1773
+		if ($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1774 1774
 		{
1775 1775
 			// check if there is login fail records.
1776 1776
 			$output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args);
1777
-			if($output->data && $output->data->content)
1777
+			if ($output->data && $output->data->content)
1778 1778
 			{
1779 1779
 				$title = Context::getLang('login_fail_report');
1780 1780
 				$message = '<ul>';
1781 1781
 				$content = unserialize($output->data->content);
1782
-				if(count($content) > $config->max_error_count)
1782
+				if (count($content) > $config->max_error_count)
1783 1783
 				{
1784
-					foreach($content as $val)
1784
+					foreach ($content as $val)
1785 1785
 					{
1786
-						$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>';
1786
+						$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>';
1787 1787
 					}
1788 1788
 					$message .= '</ul>';
1789
-					$content = sprintf(Context::getLang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa'));
1789
+					$content = sprintf(Context::getLang('login_fail_report_contents'), $message, date('Y-m-d h:i:sa'));
1790 1790
 
1791 1791
 					//send message
1792 1792
 					$oCommunicationController = getController('communication');
1793 1793
 					$oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true);
1794 1794
 
1795
-					if($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1795
+					if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1796 1796
 					{
1797 1797
 						$view_url = Context::getRequestUri();
1798
-						$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);
1798
+						$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);
1799 1799
 						$oMail = new Mail();
1800 1800
 						$oMail->setTitle($title);
1801 1801
 						$oMail->setContent($content);
1802
-						$oMail->setSender($config->webmaster_name?$config->webmaster_name:'webmaster', $config->webmaster_email);
1802
+						$oMail->setSender($config->webmaster_name ? $config->webmaster_name : 'webmaster', $config->webmaster_email);
1803 1803
 						$oMail->setReceiptor($this->memberInfo->email_id.'('.$this->memberInfo->nick_name.')', $this->memberInfo->email_address);
1804 1804
 						$oMail->send();
1805 1805
 					}
@@ -1809,9 +1809,9 @@  discard block
 block discarded – undo
1809 1809
 		}
1810 1810
 		// Call a trigger after successfully log-in (after)
1811 1811
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1812
-		if(!$trigger_output->toBool()) return $trigger_output;
1812
+		if (!$trigger_output->toBool()) return $trigger_output;
1813 1813
 		// When user checked to use auto-login
1814
-		if($keep_signed)
1814
+		if ($keep_signed)
1815 1815
 		{
1816 1816
 			// Key generate for auto login
1817 1817
 			$oPassword = new Password();
@@ -1823,12 +1823,12 @@  discard block
 block discarded – undo
1823 1823
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1824 1824
 			executeQuery('member.deleteAutologin', $autologin_args);
1825 1825
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1826
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000);
1826
+			if ($autologin_output->toBool()) setCookie('xeak', $autologin_args->autologin_key, $_SERVER['REQUEST_TIME'] + 31536000);
1827 1827
 		}
1828
-		if($this->memberInfo->is_admin == 'Y')
1828
+		if ($this->memberInfo->is_admin == 'Y')
1829 1829
 		{
1830 1830
 			$oMemberAdminModel = getAdminModel('member');
1831
-			if(!$oMemberAdminModel->getMemberAdminIPCheck())
1831
+			if (!$oMemberAdminModel->getMemberAdminIPCheck())
1832 1832
 			{
1833 1833
 				$_SESSION['denied_admin'] = 'Y';
1834 1834
 			}
@@ -1846,18 +1846,18 @@  discard block
 block discarded – undo
1846 1846
 	{
1847 1847
 		$oMemberModel = getModel('member');
1848 1848
 		// If your information came through the current session information to extract information from the users
1849
-		if(!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged() )
1849
+		if (!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged())
1850 1850
 		{
1851 1851
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']);
1852 1852
 			// If you do not destroy the session Profile
1853
-			if($this->memberInfo->member_srl != $_SESSION['member_srl'])
1853
+			if ($this->memberInfo->member_srl != $_SESSION['member_srl'])
1854 1854
 			{
1855 1855
 				$this->destroySessionInfo();
1856 1856
 				return;
1857 1857
 			}
1858 1858
 		}
1859 1859
 		// Stop using the session id is destroyed
1860
-		if($this->memberInfo->denied=='Y')
1860
+		if ($this->memberInfo->denied == 'Y')
1861 1861
 		{
1862 1862
 			$this->destroySessionInfo();
1863 1863
 			return;
@@ -1887,10 +1887,10 @@  discard block
 block discarded – undo
1887 1887
 		Context::set('logged_info', $this->memberInfo);
1888 1888
 
1889 1889
 		// Only the menu configuration of the user (such as an add-on to the menu can be changed)
1890
-		$this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info');
1891
-		$this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document');
1892
-		$this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document');
1893
-		$this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document');
1890
+		$this->addMemberMenu('dispMemberInfo', 'cmd_view_member_info');
1891
+		$this->addMemberMenu('dispMemberScrappedDocument', 'cmd_view_scrapped_document');
1892
+		$this->addMemberMenu('dispMemberSavedDocument', 'cmd_view_saved_document');
1893
+		$this->addMemberMenu('dispMemberOwnDocument', 'cmd_view_own_document');
1894 1894
 	}
1895 1895
 
1896 1896
 	/**
@@ -1912,7 +1912,7 @@  discard block
 block discarded – undo
1912 1912
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
1913 1913
 	{
1914 1914
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
1915
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
1915
+		if (!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
1916 1916
 
1917 1917
 		$obj = new stdClass;
1918 1918
 		$obj->url = $url;
@@ -1931,33 +1931,33 @@  discard block
 block discarded – undo
1931 1931
 	{
1932 1932
 		// Call a trigger (before)
1933 1933
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
1934
-		if(!$output->toBool()) return $output;
1934
+		if (!$output->toBool()) return $output;
1935 1935
 		// Terms and Conditions portion of the information set up by members reaffirmed
1936 1936
 		$oModuleModel = getModel('module');
1937 1937
 		$config = $oModuleModel->getModuleConfig('member');
1938 1938
 
1939 1939
 		$logged_info = Context::get('logged_info');
1940 1940
 		// If the date of the temporary restrictions limit further information on the date of
1941
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
1941
+		if ($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME'] + $config->limit_day * 60 * 60 * 24);
1942 1942
 
1943 1943
 		$args->member_srl = getNextSequence();
1944 1944
 		$args->list_order = -1 * $args->member_srl;
1945 1945
 
1946 1946
 		// Execute insert or update depending on the value of member_srl
1947
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
1947
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
1948 1948
 		// Enter the user's identity changed to lowercase
1949 1949
 		else $args->user_id = strtolower($args->user_id);
1950
-		if(!$args->user_name) $args->user_name = $args->member_srl;
1951
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
1950
+		if (!$args->user_name) $args->user_name = $args->member_srl;
1951
+		if (!$args->nick_name) $args->nick_name = $args->member_srl;
1952 1952
 
1953 1953
 		// Control of essential parameters
1954
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
1955
-		if($args->denied!='Y') $args->denied = 'N';
1956
-		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y';
1954
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
1955
+		if ($args->denied != 'Y') $args->denied = 'N';
1956
+		if (!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F')))) $args->allow_message = 'Y';
1957 1957
 
1958
-		if($logged_info->is_admin == 'Y')
1958
+		if ($logged_info->is_admin == 'Y')
1959 1959
 		{
1960
-			if($args->is_admin!='Y') $args->is_admin = 'N';
1960
+			if ($args->is_admin != 'Y') $args->is_admin = 'N';
1961 1961
 		}
1962 1962
 		else
1963 1963
 		{
@@ -1972,88 +1972,88 @@  discard block
 block discarded – undo
1972 1972
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1973 1973
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1974 1974
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1975
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
1976
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
1975
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//i", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
1976
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//i", $args->blog)) $args->blog = 'http://'.$args->blog;
1977 1977
 
1978 1978
 		// Create a model object
1979 1979
 		$oMemberModel = getModel('member');
1980 1980
 
1981 1981
 		// Check password strength
1982
-		if($args->password && !$password_is_hashed)
1982
+		if ($args->password && !$password_is_hashed)
1983 1983
 		{
1984
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
1984
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
1985 1985
 			{
1986 1986
 				$message = Context::getLang('about_password_strength');
1987 1987
 				return new Object(-1, $message[$config->password_strength]);
1988 1988
 			}
1989 1989
 			$args->password = $oMemberModel->hashPassword($args->password);
1990 1990
 		}
1991
-		elseif(!$args->password)
1991
+		elseif (!$args->password)
1992 1992
 		{
1993 1993
 			unset($args->password);
1994 1994
 		}
1995 1995
 
1996 1996
 		// Check if ID is prohibited
1997
-		if($oMemberModel->isDeniedID($args->user_id))
1997
+		if ($oMemberModel->isDeniedID($args->user_id))
1998 1998
 		{
1999
-			return new Object(-1,'denied_user_id');
1999
+			return new Object(-1, 'denied_user_id');
2000 2000
 		}
2001 2001
 
2002 2002
 		// Check if ID is duplicate
2003 2003
 		$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2004
-		if($member_srl)
2004
+		if ($member_srl)
2005 2005
 		{
2006
-			return new Object(-1,'msg_exists_user_id');
2006
+			return new Object(-1, 'msg_exists_user_id');
2007 2007
 		}
2008 2008
 
2009 2009
 		// Check if nickname is prohibited
2010
-		if($oMemberModel->isDeniedNickName($args->nick_name))
2010
+		if ($oMemberModel->isDeniedNickName($args->nick_name))
2011 2011
 		{
2012
-			return new Object(-1,'denied_nick_name');
2012
+			return new Object(-1, 'denied_nick_name');
2013 2013
 		}
2014 2014
 
2015 2015
 		// Check if nickname is duplicate
2016 2016
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
2017
-		if($member_srl)
2017
+		if ($member_srl)
2018 2018
 		{
2019
-			return new Object(-1,'msg_exists_nick_name');
2019
+			return new Object(-1, 'msg_exists_nick_name');
2020 2020
 		}
2021 2021
 
2022 2022
 		// Check if email address is duplicate
2023 2023
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2024
-		if($member_srl)
2024
+		if ($member_srl)
2025 2025
 		{
2026
-			return new Object(-1,'msg_exists_email_address');
2026
+			return new Object(-1, 'msg_exists_email_address');
2027 2027
 		}
2028 2028
 
2029 2029
 		// Insert data into the DB
2030 2030
 		$args->list_order = -1 * $args->member_srl;
2031 2031
 
2032
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2033
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2032
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
2033
+		if (!$args->user_name) $args->user_name = $args->member_srl;
2034 2034
 
2035 2035
 		$oDB = &DB::getInstance();
2036 2036
 		$oDB->begin();
2037 2037
 
2038 2038
 		$output = executeQuery('member.insertMember', $args);
2039
-		if(!$output->toBool())
2039
+		if (!$output->toBool())
2040 2040
 		{
2041 2041
 			$oDB->rollback();
2042 2042
 			return $output;
2043 2043
 		}
2044 2044
 
2045
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2045
+		if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2046 2046
 		else $group_srl_list = explode('|@|', $args->group_srl_list);
2047 2047
 		// If no value is entered the default group, the value of group registration
2048
-		if(!$args->group_srl_list)
2048
+		if (!$args->group_srl_list)
2049 2049
 		{
2050 2050
 			$columnList = array('site_srl', 'group_srl');
2051 2051
 			$default_group = $oMemberModel->getDefaultGroup(0, $columnList);
2052
-			if($default_group)
2052
+			if ($default_group)
2053 2053
 			{
2054 2054
 				// Add to the default group
2055
-				$output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl);
2056
-				if(!$output->toBool())
2055
+				$output = $this->addMemberToGroup($args->member_srl, $default_group->group_srl);
2056
+				if (!$output->toBool())
2057 2057
 				{
2058 2058
 					$oDB->rollback();
2059 2059
 					return $output;
@@ -2063,11 +2063,11 @@  discard block
 block discarded – undo
2063 2063
 		}
2064 2064
 		else
2065 2065
 		{
2066
-			for($i=0;$i<count($group_srl_list);$i++)
2066
+			for ($i = 0; $i < count($group_srl_list); $i++)
2067 2067
 			{
2068
-				$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2068
+				$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2069 2069
 
2070
-				if(!$output->toBool())
2070
+				if (!$output->toBool())
2071 2071
 				{
2072 2072
 					$oDB->rollback();
2073 2073
 					return $output;
@@ -2077,7 +2077,7 @@  discard block
 block discarded – undo
2077 2077
 
2078 2078
 		$member_config = $oModuleModel->getModuleConfig('member');
2079 2079
 		// When using email authentication mode (when you subscribed members denied a) certified mail sent
2080
-		if($args->denied == 'Y')
2080
+		if ($args->denied == 'Y')
2081 2081
 		{
2082 2082
 			// Insert data into the authentication DB
2083 2083
 			$oPassword = new Password();
@@ -2089,7 +2089,7 @@  discard block
 block discarded – undo
2089 2089
 			$auth_args->is_register = 'Y';
2090 2090
 
2091 2091
 			$output = executeQuery('member.insertAuthMail', $auth_args);
2092
-			if(!$output->toBool())
2092
+			if (!$output->toBool())
2093 2093
 			{
2094 2094
 				$oDB->rollback();
2095 2095
 				return $output;
@@ -2097,10 +2097,10 @@  discard block
 block discarded – undo
2097 2097
 			$this->_sendAuthMail($auth_args, $args);
2098 2098
 		}
2099 2099
 		// Call a trigger (after)
2100
-		if($output->toBool())
2100
+		if ($output->toBool())
2101 2101
 		{
2102 2102
 			$trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args);
2103
-			if(!$trigger_output->toBool())
2103
+			if (!$trigger_output->toBool())
2104 2104
 			{
2105 2105
 				$oDB->rollback();
2106 2106
 				return $trigger_output;
@@ -2122,41 +2122,41 @@  discard block
 block discarded – undo
2122 2122
 	{
2123 2123
 		// Call a trigger (before)
2124 2124
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2125
-		if(!$output->toBool()) return $output;
2125
+		if (!$output->toBool()) return $output;
2126 2126
 		// Create a model object
2127 2127
 		$oMemberModel = getModel('member');
2128 2128
 
2129 2129
 		$logged_info = Context::get('logged_info');
2130 2130
 		// Get what you want to modify the original information
2131
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2131
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2132 2132
 		// Control of essential parameters
2133
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2134
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2133
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
2134
+		if ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F'))) $args->allow_message = 'Y';
2135 2135
 
2136
-		if($logged_info->is_admin == 'Y')
2136
+		if ($logged_info->is_admin == 'Y')
2137 2137
 		{
2138
-			if($args->denied!='Y') $args->denied = 'N';
2139
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2138
+			if ($args->denied != 'Y') $args->denied = 'N';
2139
+			if ($args->is_admin != 'Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2140 2140
 		}
2141 2141
 		else
2142 2142
 		{
2143 2143
 			unset($args->is_admin);
2144
-			if($is_admin == false)
2144
+			if ($is_admin == false)
2145 2145
 				unset($args->denied);
2146
-			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2146
+			if ($logged_info->member_srl != $args->member_srl && $is_admin == false)
2147 2147
 			{
2148 2148
 				return $this->stop('msg_invalid_request');
2149 2149
 			}
2150 2150
 		}
2151 2151
 
2152 2152
 		// Sanitize user ID, username, nickname, homepage, blog
2153
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2153
+		if ($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2154 2154
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2155 2155
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2156 2156
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2157 2157
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2158
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2159
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2158
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//is", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
2159
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//is", $args->blog)) $args->blog = 'http://'.$args->blog;
2160 2160
 
2161 2161
 		// check member identifier form
2162 2162
 		$config = $oMemberModel->getMemberConfig();
@@ -2165,56 +2165,56 @@  discard block
 block discarded – undo
2165 2165
 		$orgMemberInfo = $output->data;
2166 2166
 
2167 2167
 		// Check if email address or user ID is duplicate
2168
-		if($config->identifier == 'email_address')
2168
+		if ($config->identifier == 'email_address')
2169 2169
 		{
2170 2170
 			$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2171
-			if($member_srl && $args->member_srl != $member_srl)
2171
+			if ($member_srl && $args->member_srl != $member_srl)
2172 2172
 			{
2173
-				return new Object(-1,'msg_exists_email_address');
2173
+				return new Object(-1, 'msg_exists_email_address');
2174 2174
 			}
2175 2175
 			$args->email_address = $orgMemberInfo->email_address;
2176 2176
 		}
2177 2177
 		else
2178 2178
 		{
2179 2179
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2180
-			if($member_srl && $args->member_srl != $member_srl)
2180
+			if ($member_srl && $args->member_srl != $member_srl)
2181 2181
 			{
2182
-				return new Object(-1,'msg_exists_user_id');
2182
+				return new Object(-1, 'msg_exists_user_id');
2183 2183
 			}
2184 2184
 
2185 2185
 			$args->user_id = $orgMemberInfo->user_id;
2186 2186
 		}
2187 2187
 
2188
-		if($logged_info->is_admin !== 'Y')
2188
+		if ($logged_info->is_admin !== 'Y')
2189 2189
 		{
2190 2190
 			// Check if ID is prohibited
2191
-			if($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2191
+			if ($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2192 2192
 			{
2193
-				return new Object(-1,'denied_user_id');
2193
+				return new Object(-1, 'denied_user_id');
2194 2194
 			}
2195 2195
 
2196 2196
 			// Check if nickname is prohibited
2197
-			if($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2197
+			if ($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2198 2198
 			{
2199 2199
 				return new Object(-1, 'denied_nick_name');
2200 2200
 			}
2201 2201
 		}
2202 2202
 
2203 2203
 		// Check if ID is duplicate
2204
-		if($args->user_id)
2204
+		if ($args->user_id)
2205 2205
 		{
2206 2206
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2207
-			if($member_srl && $args->member_srl != $member_srl)
2207
+			if ($member_srl && $args->member_srl != $member_srl)
2208 2208
 			{
2209
-				return new Object(-1,'msg_exists_user_id');
2209
+				return new Object(-1, 'msg_exists_user_id');
2210 2210
 			}
2211 2211
 		}
2212 2212
 
2213 2213
 		// Check if nickname is duplicate
2214 2214
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
2215
- 		if($member_srl && $args->member_srl != $member_srl)
2215
+ 		if ($member_srl && $args->member_srl != $member_srl)
2216 2216
  		{
2217
- 			return new Object(-1,'msg_exists_nick_name');
2217
+ 			return new Object(-1, 'msg_exists_nick_name');
2218 2218
  		}
2219 2219
 
2220 2220
 		list($args->email_id, $args->email_host) = explode('@', $args->email_address);
@@ -2223,9 +2223,9 @@  discard block
 block discarded – undo
2223 2223
 		$oDB->begin();
2224 2224
 
2225 2225
 		// Check password strength
2226
-		if($args->password)
2226
+		if ($args->password)
2227 2227
 		{
2228
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2228
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2229 2229
 			{
2230 2230
 				$message = Context::getLang('about_password_strength');
2231 2231
 				return new Object(-1, $message[$config->password_strength]);
@@ -2237,40 +2237,40 @@  discard block
 block discarded – undo
2237 2237
 			$args->password = $orgMemberInfo->password;
2238 2238
 		}
2239 2239
 
2240
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2241
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2242
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2243
-		if(!$args->description) $args->description = $orgMemberInfo->description;
2244
-		if(!$args->birthday) $args->birthday = '';
2240
+		if (!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2241
+		if (!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2242
+		if (!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2243
+		if (!$args->description) $args->description = $orgMemberInfo->description;
2244
+		if (!$args->birthday) $args->birthday = '';
2245 2245
 
2246 2246
 		$output = executeQuery('member.updateMember', $args);
2247 2247
 
2248
-		if(!$output->toBool())
2248
+		if (!$output->toBool())
2249 2249
 		{
2250 2250
 			$oDB->rollback();
2251 2251
 			return $output;
2252 2252
 		}
2253 2253
 
2254
-		if($args->group_srl_list)
2254
+		if ($args->group_srl_list)
2255 2255
 		{
2256
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2256
+			if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2257 2257
 			else $group_srl_list = explode('|@|', $args->group_srl_list);
2258 2258
 			// If the group information, group information changes
2259
-			if(count($group_srl_list) > 0)
2259
+			if (count($group_srl_list) > 0)
2260 2260
 			{
2261 2261
 				$args->site_srl = 0;
2262 2262
 				// One of its members to delete all the group
2263 2263
 				$output = executeQuery('member.deleteMemberGroupMember', $args);
2264
-				if(!$output->toBool())
2264
+				if (!$output->toBool())
2265 2265
 				{
2266 2266
 					$oDB->rollback();
2267 2267
 					return $output;
2268 2268
 				}
2269 2269
 				// Enter one of the loop a
2270
-				for($i=0;$i<count($group_srl_list);$i++)
2270
+				for ($i = 0; $i < count($group_srl_list); $i++)
2271 2271
 				{
2272
-					$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2273
-					if(!$output->toBool())
2272
+					$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2273
+					if (!$output->toBool())
2274 2274
 					{
2275 2275
 						$oDB->rollback();
2276 2276
 						return $output;
@@ -2282,9 +2282,9 @@  discard block
 block discarded – undo
2282 2282
 			}
2283 2283
 		}
2284 2284
 		// Call a trigger (after)
2285
-		if($output->toBool()) {
2285
+		if ($output->toBool()) {
2286 2286
 			$trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args);
2287
-			if(!$trigger_output->toBool())
2287
+			if (!$trigger_output->toBool())
2288 2288
 			{
2289 2289
 				$oDB->rollback();
2290 2290
 				return $trigger_output;
@@ -2297,7 +2297,7 @@  discard block
 block discarded – undo
2297 2297
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2298 2298
 
2299 2299
 		// Save Session
2300
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2300
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2301 2301
 		$logged_info = Context::get('logged_info');
2302 2302
 
2303 2303
 		$output->add('member_srl', $args->member_srl);
@@ -2309,14 +2309,14 @@  discard block
 block discarded – undo
2309 2309
 	 */
2310 2310
 	function updateMemberPassword($args)
2311 2311
 	{
2312
-		if($args->password)
2312
+		if ($args->password)
2313 2313
 		{
2314 2314
 
2315 2315
 			// check password strength
2316 2316
 			$oMemberModel = getModel('member');
2317 2317
 			$config = $oMemberModel->getMemberConfig();
2318 2318
 
2319
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2319
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2320 2320
 			{
2321 2321
 				$message = Context::getLang('about_password_strength');
2322 2322
 				return new Object(-1, $message[$config->password_strength]);
@@ -2324,13 +2324,13 @@  discard block
 block discarded – undo
2324 2324
 
2325 2325
 			$args->password = $oMemberModel->hashPassword($args->password);
2326 2326
 		}
2327
-		else if($args->hashed_password)
2327
+		else if ($args->hashed_password)
2328 2328
 		{
2329 2329
 			$args->password = $args->hashed_password;
2330 2330
 		}
2331 2331
 
2332 2332
 		$output = executeQuery('member.updateMemberPassword', $args);
2333
-		if($output->toBool())
2333
+		if ($output->toBool())
2334 2334
 		{
2335 2335
 			$result = executeQuery('member.updateChangePasswordDate', $args);
2336 2336
 		}
@@ -2349,18 +2349,18 @@  discard block
 block discarded – undo
2349 2349
 		$trigger_obj = new stdClass();
2350 2350
 		$trigger_obj->member_srl = $member_srl;
2351 2351
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2352
-		if(!$output->toBool()) return $output;
2352
+		if (!$output->toBool()) return $output;
2353 2353
 		// Create a model object
2354 2354
 		$oMemberModel = getModel('member');
2355 2355
 		// Bringing the user's information
2356
-		if(!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2356
+		if (!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2357 2357
 		{
2358 2358
 			$columnList = array('member_srl', 'is_admin');
2359 2359
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2360 2360
 		}
2361
-		if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2361
+		if (!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2362 2362
 		// If managers can not be deleted
2363
-		if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2363
+		if ($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2364 2364
 
2365 2365
 		$oDB = &DB::getInstance();
2366 2366
 		$oDB->begin();
@@ -2369,7 +2369,7 @@  discard block
 block discarded – undo
2369 2369
 		$args->member_srl = $member_srl;
2370 2370
 		// Delete the entries in member_auth_mail
2371 2371
 		$output = executeQuery('member.deleteAuthMail', $args);
2372
-		if(!$output->toBool())
2372
+		if (!$output->toBool())
2373 2373
 		{
2374 2374
 			$oDB->rollback();
2375 2375
 			return $output;
@@ -2384,23 +2384,23 @@  discard block
 block discarded – undo
2384 2384
 		 */
2385 2385
 		// Delete the entries in member_group_member
2386 2386
 		$output = executeQuery('member.deleteMemberGroupMember', $args);
2387
-		if(!$output->toBool())
2387
+		if (!$output->toBool())
2388 2388
 		{
2389 2389
 			$oDB->rollback();
2390 2390
 			return $output;
2391 2391
 		}
2392 2392
 		// member removed from the table
2393 2393
 		$output = executeQuery('member.deleteMember', $args);
2394
-		if(!$output->toBool())
2394
+		if (!$output->toBool())
2395 2395
 		{
2396 2396
 			$oDB->rollback();
2397 2397
 			return $output;
2398 2398
 		}
2399 2399
 		// Call a trigger (after)
2400
-		if($output->toBool())
2400
+		if ($output->toBool())
2401 2401
 		{
2402 2402
 			$trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj);
2403
-			if(!$trigger_output->toBool())
2403
+			if (!$trigger_output->toBool())
2404 2404
 			{
2405 2405
 				$oDB->rollback();
2406 2406
 				return $trigger_output;
@@ -2424,23 +2424,23 @@  discard block
 block discarded – undo
2424 2424
 	 */
2425 2425
 	function destroySessionInfo()
2426 2426
 	{
2427
-		if(!$_SESSION || !is_array($_SESSION)) return;
2427
+		if (!$_SESSION || !is_array($_SESSION)) return;
2428 2428
 
2429 2429
 		$memberInfo = Context::get('logged_info');
2430 2430
 		$memberSrl = $memberInfo->member_srl;
2431 2431
 
2432
-		foreach($_SESSION as $key => $val)
2432
+		foreach ($_SESSION as $key => $val)
2433 2433
 		{
2434 2434
 			$_SESSION[$key] = '';
2435 2435
 		}
2436 2436
 
2437 2437
 		session_destroy();
2438
-		setcookie(session_name(), '', $_SERVER['REQUEST_TIME']-42000);
2439
-		setcookie('sso','',$_SERVER['REQUEST_TIME']-42000);
2440
-		setcookie('xeak','',$_SERVER['REQUEST_TIME']-42000);
2438
+		setcookie(session_name(), '', $_SERVER['REQUEST_TIME'] - 42000);
2439
+		setcookie('sso', '', $_SERVER['REQUEST_TIME'] - 42000);
2440
+		setcookie('xeak', '', $_SERVER['REQUEST_TIME'] - 42000);
2441 2441
 		setcookie('xe_logged', 'false', $_SERVER['REQUEST_TIME'] - 42000);
2442 2442
 
2443
-		if($memberSrl || $_COOKIE['xeak'])
2443
+		if ($memberSrl || $_COOKIE['xeak'])
2444 2444
 		{
2445 2445
 			$args = new stdClass();
2446 2446
 			$args->member_srl = $memberSrl;
@@ -2456,22 +2456,22 @@  discard block
 block discarded – undo
2456 2456
 		$pointGroup = $pointModuleConfig->point_group;
2457 2457
 
2458 2458
 		$levelGroup = array();
2459
-		if(is_array($pointGroup) && count($pointGroup)>0)
2459
+		if (is_array($pointGroup) && count($pointGroup) > 0)
2460 2460
 		{
2461 2461
 			$levelGroup = array_flip($pointGroup);
2462 2462
 			ksort($levelGroup);
2463 2463
 		}
2464 2464
 		$maxLevel = 0;
2465 2465
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2466
-		if(count($resultGroup) > 0)
2466
+		if (count($resultGroup) > 0)
2467 2467
 			$maxLevel = max(array_flip($resultGroup));
2468 2468
 
2469
-		if($maxLevel > 0)
2469
+		if ($maxLevel > 0)
2470 2470
 		{
2471 2471
 			$oPointModel = getModel('point');
2472 2472
 			$originPoint = $oPointModel->getPoint($memberSrl);
2473 2473
 
2474
-			if($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2474
+			if ($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2475 2475
 			{
2476 2476
 				$oPointController = getController('point');
2477 2477
 				$oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel], 'update');
@@ -2481,18 +2481,18 @@  discard block
 block discarded – undo
2481 2481
 
2482 2482
 	function procMemberModifyEmailAddress()
2483 2483
 	{
2484
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2484
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
2485 2485
 
2486 2486
 		$member_info = Context::get('logged_info');
2487 2487
 		$newEmail = Context::get('email_address');
2488 2488
 
2489
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2489
+		if (!$newEmail) return $this->stop('msg_invalid_request');
2490 2490
 
2491 2491
 		$oMemberModel = getModel('member');
2492 2492
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2493
-		if($member_srl) return new Object(-1,'msg_exists_email_address');
2493
+		if ($member_srl) return new Object(-1, 'msg_exists_email_address');
2494 2494
 
2495
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2495
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2496 2496
 		{
2497 2497
 			return $this->stop('msg_invalid_request');
2498 2498
 		}
@@ -2508,7 +2508,7 @@  discard block
 block discarded – undo
2508 2508
 		$oDB = &DB::getInstance();
2509 2509
 		$oDB->begin();
2510 2510
 		$output = executeQuery('member.insertAuthMail', $auth_args);
2511
-		if(!$output->toBool())
2511
+		if (!$output->toBool())
2512 2512
 		{
2513 2513
 			$oDB->rollback();
2514 2514
 			return $output;
@@ -2518,7 +2518,7 @@  discard block
 block discarded – undo
2518 2518
 		$member_config = $oModuleModel->getModuleConfig('member');
2519 2519
 
2520 2520
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2521
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2521
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2522 2522
 
2523 2523
 		global $lang;
2524 2524
 
@@ -2530,17 +2530,17 @@  discard block
 block discarded – undo
2530 2530
 
2531 2531
 		Context::set('newEmail', $newEmail);
2532 2532
 
2533
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthEmailAddress','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
2533
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
2534 2534
 		Context::set('auth_url', $auth_url);
2535 2535
 
2536 2536
 		$oTemplate = &TemplateHandler::getInstance();
2537 2537
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_new_email');
2538 2538
 
2539 2539
 		$oMail = new Mail();
2540
-		$oMail->setTitle( Context::getLang('title_modify_email_address') );
2540
+		$oMail->setTitle(Context::getLang('title_modify_email_address'));
2541 2541
 		$oMail->setContent($content);
2542
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
2543
-		$oMail->setReceiptor( $member_info->nick_name, $newEmail );
2542
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
2543
+		$oMail->setReceiptor($member_info->nick_name, $newEmail);
2544 2544
 		$result = $oMail->send();
2545 2545
 
2546 2546
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail);
@@ -2554,16 +2554,16 @@  discard block
 block discarded – undo
2554 2554
 	{
2555 2555
 		$member_srl = Context::get('member_srl');
2556 2556
 		$auth_key = Context::get('auth_key');
2557
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2557
+		if (!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2558 2558
 
2559 2559
 		// Test logs for finding password by user_id and authkey
2560 2560
 		$args = new stdClass;
2561 2561
 		$args->member_srl = $member_srl;
2562 2562
 		$args->auth_key = $auth_key;
2563 2563
 		$output = executeQuery('member.getAuthMail', $args);
2564
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2564
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
2565 2565
 		{
2566
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2566
+			if (strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2567 2567
 			return $this->stop('msg_invalid_modify_email_auth_key');
2568 2568
 		}
2569 2569
 
@@ -2572,10 +2572,10 @@  discard block
 block discarded – undo
2572 2572
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2573 2573
 
2574 2574
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2575
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2575
+		if (!$output->toBool()) return $this->stop($output->getMessage());
2576 2576
 
2577 2577
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2578
-		executeQuery('member.deleteAuthChangeEmailAddress',$args);
2578
+		executeQuery('member.deleteAuthChangeEmailAddress', $args);
2579 2579
 
2580 2580
 		$this->_clearMemberCache($args->member_srl);
2581 2581
 
@@ -2593,7 +2593,7 @@  discard block
 block discarded – undo
2593 2593
 	**/
2594 2594
 	function triggerGetDocumentMenu(&$menu_list)
2595 2595
 	{
2596
-		if(!Context::get('is_logged')) return new Object();
2596
+		if (!Context::get('is_logged')) return new Object();
2597 2597
 
2598 2598
 		$logged_info = Context::get('logged_info');
2599 2599
 		$document_srl = Context::get('target_srl');
@@ -2604,12 +2604,12 @@  discard block
 block discarded – undo
2604 2604
 		$member_srl = $oDocument->get('member_srl');
2605 2605
 		$module_srl = $oDocument->get('module_srl');
2606 2606
 
2607
-		if(!$member_srl) return new Object();
2608
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2607
+		if (!$member_srl) return new Object();
2608
+		if ($oDocumentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object();
2609 2609
 
2610 2610
 		$oDocumentController = getController('document');
2611
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2612
-		$oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup');
2611
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2612
+		$oDocumentController->addDocumentPopupMenu($url, 'cmd_spammer', '', 'popup');
2613 2613
 
2614 2614
 		return new Object();
2615 2615
 	}
@@ -2623,7 +2623,7 @@  discard block
 block discarded – undo
2623 2623
 	**/
2624 2624
 	function triggerGetCommentMenu(&$menu_list)
2625 2625
 	{
2626
-		if(!Context::get('is_logged')) return new Object();
2626
+		if (!Context::get('is_logged')) return new Object();
2627 2627
 
2628 2628
 		$logged_info = Context::get('logged_info');
2629 2629
 		$comment_srl = Context::get('target_srl');
@@ -2634,12 +2634,12 @@  discard block
 block discarded – undo
2634 2634
 		$module_srl = $oComment->get('module_srl');
2635 2635
 		$member_srl = $oComment->get('member_srl');
2636 2636
 
2637
-		if(!$member_srl) return new Object();
2638
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2637
+		if (!$member_srl) return new Object();
2638
+		if ($oCommentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object();
2639 2639
 
2640 2640
 		$oCommentController = getController('comment');
2641
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2642
-		$oCommentController->addCommentPopupMenu($url,'cmd_spammer','','popup');
2641
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2642
+		$oCommentController->addCommentPopupMenu($url, 'cmd_spammer', '', 'popup');
2643 2643
 
2644 2644
 		return new Object();
2645 2645
 	}
@@ -2651,7 +2651,7 @@  discard block
 block discarded – undo
2651 2651
 	**/
2652 2652
 	function procMemberSpammerManage()
2653 2653
 	{
2654
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
2654
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
2655 2655
 
2656 2656
 		$logged_info = Context::get('logged_info');
2657 2657
 		$member_srl = Context::get('member_srl');
@@ -2659,7 +2659,7 @@  discard block
 block discarded – undo
2659 2659
 		$cnt_loop = Context::get('cnt_loop');
2660 2660
 		$proc_type = Context::get('proc_type');
2661 2661
 		$isMoveToTrash = true;
2662
-		if($proc_type == "delete")
2662
+		if ($proc_type == "delete")
2663 2663
 			$isMoveToTrash = false;
2664 2664
 
2665 2665
 		// check grant
@@ -2668,7 +2668,7 @@  discard block
 block discarded – undo
2668 2668
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2669 2669
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2670 2670
 
2671
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
2671
+		if (!$grant->manager) return new Object(-1, 'msg_not_permitted');
2672 2672
 
2673 2673
 		$proc_msg = "";
2674 2674
 
@@ -2677,10 +2677,10 @@  discard block
 block discarded – undo
2677 2677
 
2678 2678
 		// delete or trash destination
2679 2679
 		// proc member
2680
-		if($cnt_loop == 1)
2680
+		if ($cnt_loop == 1)
2681 2681
 			$this->_spammerMember($member_srl);
2682 2682
 		// proc document and comment
2683
-		elseif($cnt_loop>1)
2683
+		elseif ($cnt_loop > 1)
2684 2684
 			$this->_spammerDocuments($member_srl, $isMoveToTrash);
2685 2685
 
2686 2686
 		// get destination count
@@ -2689,11 +2689,11 @@  discard block
 block discarded – undo
2689 2689
 
2690 2690
 		$total_count = Context::get('total_count');
2691 2691
 		$remain_count = $cnt_document + $cnt_comment;
2692
-		if($cnt_loop == 1) $total_count = $remain_count;
2692
+		if ($cnt_loop == 1) $total_count = $remain_count;
2693 2693
 
2694 2694
 		// get progress percent
2695
-		if($total_count > 0)
2696
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2695
+		if ($total_count > 0)
2696
+			$progress = intval((($total_count - $remain_count) / $total_count) * 100);
2697 2697
 		else
2698 2698
 			$progress = 100;
2699 2699
 
@@ -2717,7 +2717,7 @@  discard block
 block discarded – undo
2717 2717
 	**/
2718 2718
 	private function _spammerMember($member_srl) {
2719 2719
 		$logged_info = Context::get('logged_info');
2720
-		$spam_description = trim( Context::get('spam_description') );
2720
+		$spam_description = trim(Context::get('spam_description'));
2721 2721
 
2722 2722
 		$oMemberModel = getModel('member');
2723 2723
 		$columnList = array('member_srl', 'email_address', 'user_id', 'nick_name', 'description');
@@ -2736,10 +2736,10 @@  discard block
 block discarded – undo
2736 2736
 		$args->user_id = $member_info->user_id;
2737 2737
 		$args->nick_name = $member_info->nick_name;
2738 2738
 		$args->denied = "Y";
2739
-		$args->description = trim( $member_info->description );
2740
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
2739
+		$args->description = trim($member_info->description);
2740
+		if ($args->description != "") $args->description .= "\n"; // add new line
2741 2741
 
2742
-		$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 . "]";
2742
+		$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."]";
2743 2743
 
2744 2744
 		$output = $this->updateMember($args, true);
2745 2745
 
@@ -2768,21 +2768,21 @@  discard block
 block discarded – undo
2768 2768
 		// 1. proc comment, 2. proc document
2769 2769
 		$cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl);
2770 2770
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
2771
-		if($cnt_comment > 0)
2771
+		if ($cnt_comment > 0)
2772 2772
 		{
2773 2773
 			$columnList = array();
2774 2774
 			$commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2775
-			if($commentList) {
2776
-				foreach($commentList as $v) {
2775
+			if ($commentList) {
2776
+				foreach ($commentList as $v) {
2777 2777
 					$oCommentController->deleteComment($v->comment_srl, true, $isMoveToTrash);
2778 2778
 				}
2779 2779
 			}
2780
-		} elseif($cnt_document > 0) {
2780
+		} elseif ($cnt_document > 0) {
2781 2781
 			$columnList = array();
2782 2782
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2783
-			if($documentList) {
2784
-				foreach($documentList as $v) {
2785
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2783
+			if ($documentList) {
2784
+				foreach ($documentList as $v) {
2785
+					if ($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2786 2786
 					else $oDocumentController->deleteDocument($v->document_srl);
2787 2787
 				}
2788 2788
 			}
@@ -2794,24 +2794,24 @@  discard block
 block discarded – undo
2794 2794
 	function _clearMemberCache($member_srl, $site_srl = 0)
2795 2795
 	{
2796 2796
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
2797
-		if($oCacheHandler->isSupport())
2797
+		if ($oCacheHandler->isSupport())
2798 2798
 		{
2799
-			$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_' . $site_srl;
2799
+			$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl;
2800 2800
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2801 2801
 			$oCacheHandler->delete($cache_key);
2802 2802
 
2803
-			if($site_srl !== 0)
2803
+			if ($site_srl !== 0)
2804 2804
 			{
2805
-				$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0';
2805
+				$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_0';
2806 2806
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2807 2807
 				$oCacheHandler->delete($cache_key);
2808 2808
 			}
2809 2809
 		}
2810 2810
 
2811 2811
 		$oCacheHandler = CacheHandler::getInstance('object');
2812
-		if($oCacheHandler->isSupport())
2812
+		if ($oCacheHandler->isSupport())
2813 2813
 		{
2814
-			$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
2814
+			$object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl;
2815 2815
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2816 2816
 			$oCacheHandler->delete($cache_key);
2817 2817
 		}
Please login to merge, or discard this patch.
Braces   +590 added lines, -247 removed lines patch added patch discarded remove patch
@@ -41,19 +41,31 @@  discard block
 block discarded – undo
41 41
 		}
42 42
 
43 43
 		// Variables
44
-		if(!$user_id) $user_id = Context::get('user_id');
44
+		if(!$user_id) {
45
+			$user_id = Context::get('user_id');
46
+		}
45 47
 		$user_id = trim($user_id);
46 48
 
47
-		if(!$password) $password = Context::get('password');
49
+		if(!$password) {
50
+			$password = Context::get('password');
51
+		}
48 52
 		$password = trim($password);
49 53
 
50
-		if(!$keep_signed) $keep_signed = Context::get('keep_signed');
54
+		if(!$keep_signed) {
55
+			$keep_signed = Context::get('keep_signed');
56
+		}
51 57
 		// Return an error when id and password doesn't exist
52
-		if(!$user_id) return new Object(-1,'null_user_id');
53
-		if(!$password) return new Object(-1,'null_password');
58
+		if(!$user_id) {
59
+			return new Object(-1,'null_user_id');
60
+		}
61
+		if(!$password) {
62
+			return new Object(-1,'null_password');
63
+		}
54 64
 
55 65
 		$output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false);
56
-		if (!$output->toBool()) return $output;
66
+		if (!$output->toBool()) {
67
+			return $output;
68
+		}
57 69
 
58 70
 		$oModuleModel = getModel('module');
59 71
 		$config = $oModuleModel->getModuleConfig('member');
@@ -80,8 +92,7 @@  discard block
 block discarded – undo
80 92
 		if(!$config->after_login_url)
81 93
 		{
82 94
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
83
-		}
84
-		else
95
+		} else
85 96
 		{
86 97
 			$returnUrl = $config->after_login_url;
87 98
 		}
@@ -98,19 +109,24 @@  discard block
 block discarded – undo
98 109
 		// Call a trigger before log-out (before)
99 110
 		$logged_info = Context::get('logged_info');
100 111
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info);
101
-		if(!$trigger_output->toBool()) return $trigger_output;
112
+		if(!$trigger_output->toBool()) {
113
+			return $trigger_output;
114
+		}
102 115
 		// Destroy session information
103 116
 		$this->destroySessionInfo();
104 117
 		// Call a trigger after log-out (after)
105 118
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info);
106
-		if(!$trigger_output->toBool()) return $trigger_output;
119
+		if(!$trigger_output->toBool()) {
120
+			return $trigger_output;
121
+		}
107 122
 
108 123
 		$output = new Object();
109 124
 
110 125
 		$oModuleModel = getModel('module');
111 126
 		$config = $oModuleModel->getModuleConfig('member');
112
-		if($config->after_logout_url)
113
-			$output->redirect_url = $config->after_logout_url;
127
+		if($config->after_logout_url) {
128
+					$output->redirect_url = $config->after_logout_url;
129
+		}
114 130
 
115 131
 		$this->_clearMemberCache($logged_info->member_srl);
116 132
 
@@ -127,12 +143,18 @@  discard block
 block discarded – undo
127 143
 		$oModuleModel = &getModel('module');
128 144
 
129 145
 		// Check login information
130
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
146
+		if(!Context::get('is_logged')) {
147
+			return new Object(-1, 'msg_not_logged');
148
+		}
131 149
 		$logged_info = Context::get('logged_info');
132 150
 
133 151
 		$document_srl = (int)Context::get('document_srl');
134
-		if(!$document_srl) $document_srl = (int)Context::get('target_srl');
135
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
152
+		if(!$document_srl) {
153
+			$document_srl = (int)Context::get('target_srl');
154
+		}
155
+		if(!$document_srl) {
156
+			return new Object(-1,'msg_invalid_request');
157
+		}
136 158
 
137 159
 		// Get document
138 160
 		$oDocumentModel = getModel('document');
@@ -162,11 +184,15 @@  discard block
 block discarded – undo
162 184
 
163 185
 		// Check if already scrapped
164 186
 		$output = executeQuery('member.getScrapDocument', $args);
165
-		if($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
187
+		if($output->data->count) {
188
+			return new Object(-1, 'msg_alreay_scrapped');
189
+		}
166 190
 
167 191
 		// Insert
168 192
 		$output = executeQuery('member.addScrapDocument', $args);
169
-		if(!$output->toBool()) return $output;
193
+		if(!$output->toBool()) {
194
+			return $output;
195
+		}
170 196
 
171 197
 		$this->setError(-1);
172 198
 		$this->setMessage('success_registed');
@@ -180,11 +206,15 @@  discard block
 block discarded – undo
180 206
 	function procMemberDeleteScrap()
181 207
 	{
182 208
 		// Check login information
183
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
209
+		if(!Context::get('is_logged')) {
210
+			return new Object(-1, 'msg_not_logged');
211
+		}
184 212
 		$logged_info = Context::get('logged_info');
185 213
 
186 214
 		$document_srl = (int)Context::get('document_srl');
187
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
215
+		if(!$document_srl) {
216
+			return new Object(-1,'msg_invalid_request');
217
+		}
188 218
 		// Variables
189 219
 		$args = new stdClass;
190 220
 		$args->member_srl = $logged_info->member_srl;
@@ -210,11 +240,15 @@  discard block
 block discarded – undo
210 240
 	function procMemberDeleteSavedDocument()
211 241
 	{
212 242
 		// Check login information
213
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
243
+		if(!Context::get('is_logged')) {
244
+			return new Object(-1, 'msg_not_logged');
245
+		}
214 246
 		$logged_info = Context::get('logged_info');
215 247
 
216 248
 		$document_srl = (int)Context::get('document_srl');
217
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
249
+		if(!$document_srl) {
250
+			return new Object(-1,'msg_invalid_request');
251
+		}
218 252
 
219 253
 		$oDocumentModel = getModel('document');
220 254
 		$oDocument = $oDocumentModel->getDocument($document_srl);
@@ -242,7 +276,9 @@  discard block
 block discarded – undo
242 276
 	{
243 277
 		$name = Context::get('name');
244 278
 		$value = Context::get('value');
245
-		if(!$value) return;
279
+		if(!$value) {
280
+			return;
281
+		}
246 282
 
247 283
 		$oMemberModel = getModel('member');
248 284
 		// Check if logged-in
@@ -253,10 +289,14 @@  discard block
 block discarded – undo
253 289
 		{
254 290
 			case 'user_id' :
255 291
 				// Check denied ID
256
-				if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id');
292
+				if($oMemberModel->isDeniedID($value)) {
293
+					return new Object(0,'denied_user_id');
294
+				}
257 295
 				// Check if duplicated
258 296
 				$member_srl = $oMemberModel->getMemberSrlByUserID($value);
259
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_user_id');
297
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
298
+					return new Object(0,'msg_exists_user_id');
299
+				}
260 300
 				break;
261 301
 			case 'nick_name' :
262 302
 				// Check denied ID
@@ -266,13 +306,17 @@  discard block
 block discarded – undo
266 306
 				}
267 307
 				// Check if duplicated
268 308
 				$member_srl = $oMemberModel->getMemberSrlByNickName($value);
269
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name');
309
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
310
+					return new Object(0,'msg_exists_nick_name');
311
+				}
270 312
 
271 313
 				break;
272 314
 			case 'email_address' :
273 315
 				// Check if duplicated
274 316
 				$member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
275
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address');
317
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
318
+					return new Object(0,'msg_exists_email_address');
319
+				}
276 320
 				break;
277 321
 		}
278 322
 	}
@@ -284,17 +328,25 @@  discard block
 block discarded – undo
284 328
 	 */
285 329
 	function procMemberInsert()
286 330
 	{
287
-		if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request");
331
+		if (Context::getRequestMethod () == "GET") {
332
+			return new Object (-1, "msg_invalid_request");
333
+		}
288 334
 		$oMemberModel = &getModel ('member');
289 335
 		$config = $oMemberModel->getMemberConfig();
290 336
 
291 337
 		// call a trigger (before)
292 338
 		$trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config);
293
-		if(!$trigger_output->toBool ()) return $trigger_output;
339
+		if(!$trigger_output->toBool ()) {
340
+			return $trigger_output;
341
+		}
294 342
 		// Check if an administrator allows a membership
295
-		if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled');
343
+		if($config->enable_join != 'Y') {
344
+			return $this->stop ('msg_signup_disabled');
345
+		}
296 346
 		// Check if the user accept the license terms (only if terms exist)
297
-		if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
347
+		if($config->agreement && Context::get('accept_agreement')!='Y') {
348
+			return $this->stop('msg_accept_agreement');
349
+		}
298 350
 
299 351
 		// Extract the necessary information in advance
300 352
 		$getVars = array();
@@ -313,16 +365,22 @@  discard block
 block discarded – undo
313 365
 		foreach($getVars as $val)
314 366
 		{
315 367
 			$args->{$val} = Context::get($val);
316
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
368
+			if($val == 'birthday') {
369
+				$args->birthday_ui = Context::get('birthday_ui');
370
+			}
317 371
 		}
318 372
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
319
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
373
+		if(!$args->birthday && $args->birthday_ui) {
374
+			$args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
375
+		}
320 376
 
321 377
 		$args->find_account_answer = Context::get('find_account_answer');
322 378
 		$args->allow_mailing = Context::get('allow_mailing');
323 379
 		$args->allow_message = Context::get('allow_message');
324 380
 
325
-		if($args->password1) $args->password = $args->password1;
381
+		if($args->password1) {
382
+			$args->password = $args->password1;
383
+		}
326 384
 
327 385
 		// check password strength
328 386
 		if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
@@ -351,7 +409,9 @@  discard block
 block discarded – undo
351 409
 		unset($all_args->secret_text);
352 410
 
353 411
 		// Set the user state as "denied" when using mail authentication
354
-		if($config->enable_confirm == 'Y') $args->denied = 'Y';
412
+		if($config->enable_confirm == 'Y') {
413
+			$args->denied = 'Y';
414
+		}
355 415
 		// Add extra vars after excluding necessary information from all the requested arguments
356 416
 		$extra_vars = delObjectVars($all_args, $args);
357 417
 		$args->extra_vars = serialize($extra_vars);
@@ -366,7 +426,9 @@  discard block
 block discarded – undo
366 426
 			}
367 427
 		}
368 428
 		$output = $this->insertMember($args);
369
-		if(!$output->toBool()) return $output;
429
+		if(!$output->toBool()) {
430
+			return $output;
431
+		}
370 432
 
371 433
 		// insert ProfileImage, ImageName, ImageMark
372 434
 		$profile_image = $_FILES['profile_image'];
@@ -405,43 +467,46 @@  discard block
 block discarded – undo
405 467
 			if($config->identifier == 'email_address')
406 468
 			{
407 469
 				$output = $this->doLogin($args->email_address);
408
-			}
409
-			else
470
+			} else
410 471
 			{
411 472
 				$output = $this->doLogin($args->user_id);
412 473
 			}
413 474
 			if(!$output->toBool()) {
414
-				if($output->error == -9)
415
-					$output->error = -11;
475
+				if($output->error == -9) {
476
+									$output->error = -11;
477
+				}
416 478
 				return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output);
417 479
 			}
418 480
 		}
419 481
 
420 482
 		// Results
421 483
 		$this->add('member_srl', $args->member_srl);
422
-		if($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
484
+		if($config->redirect_url) {
485
+			$this->add('redirect_url', $config->redirect_url);
486
+		}
423 487
 		if($config->enable_confirm == 'Y')
424 488
 		{
425 489
 			$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
426 490
 			$this->setMessage($msg);
427 491
 			return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), new Object(-12, $msg));
492
+		} else {
493
+			$this->setMessage('success_registed');
428 494
 		}
429
-		else $this->setMessage('success_registed');
430 495
 		// Call a trigger (after)
431 496
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
432
-		if(!$trigger_output->toBool()) return $trigger_output;
497
+		if(!$trigger_output->toBool()) {
498
+			return $trigger_output;
499
+		}
433 500
 
434 501
 		if($config->redirect_url)
435 502
 		{
436 503
 			$returnUrl = $config->redirect_url;
437
-		}
438
-		else
504
+		} else
439 505
 		{
440 506
 			if(Context::get('success_return_url'))
441 507
 			{
442 508
 				$returnUrl = Context::get('success_return_url');
443
-			}
444
-			else if($_COOKIE['XE_REDIRECT_URL'])
509
+			} else if($_COOKIE['XE_REDIRECT_URL'])
445 510
 			{
446 511
 				$returnUrl = $_COOKIE['XE_REDIRECT_URL'];
447 512
 				setcookie("XE_REDIRECT_URL", '', 1);
@@ -495,8 +560,7 @@  discard block
 block discarded – undo
495 560
 		if(Context::get('success_return_url'))
496 561
 		{
497 562
 			$redirectUrl = Context::get('success_return_url');
498
-		}
499
-		else
563
+		} else
500 564
 		{
501 565
 			$redirectUrl = getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
502 566
 		}
@@ -540,13 +604,17 @@  discard block
 block discarded – undo
540 604
 		foreach($getVars as $val)
541 605
 		{
542 606
 			$args->{$val} = Context::get($val);
543
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
607
+			if($val == 'birthday') {
608
+				$args->birthday_ui = Context::get('birthday_ui');
609
+			}
544 610
 		}
545 611
 		// Login Information
546 612
 		$logged_info = Context::get('logged_info');
547 613
 		$args->member_srl = $logged_info->member_srl;
548 614
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
549
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
615
+		if(!$args->birthday && $args->birthday_ui) {
616
+			$args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
617
+		}
550 618
 		// Remove some unnecessary variables from all the vars
551 619
 		$all_args = Context::getRequestVars();
552 620
 		unset($all_args->module);
@@ -580,7 +648,9 @@  discard block
 block discarded – undo
580 648
 
581 649
 		// Execute insert or update depending on the value of member_srl
582 650
 		$output = $this->updateMember($args);
583
-		if(!$output->toBool()) return $output;
651
+		if(!$output->toBool()) {
652
+			return $output;
653
+		}
584 654
 
585 655
 		$profile_image = $_FILES['profile_image'];
586 656
 		if(is_uploaded_file($profile_image['tmp_name']))
@@ -610,7 +680,9 @@  discard block
 block discarded – undo
610 680
 
611 681
 		// Call a trigger after successfully log-in (after)
612 682
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo);
613
-		if(!$trigger_output->toBool()) return $trigger_output;
683
+		if(!$trigger_output->toBool()) {
684
+			return $trigger_output;
685
+		}
614 686
 
615 687
 		$this->setSessionInfo();
616 688
 		// Return result
@@ -631,7 +703,9 @@  discard block
 block discarded – undo
631 703
 	 */
632 704
 	function procMemberModifyPassword()
633 705
 	{
634
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
706
+		if(!Context::get('is_logged')) {
707
+			return $this->stop('msg_not_logged');
708
+		}
635 709
 		// Extract the necessary information in advance
636 710
 		$current_password = trim(Context::get('current_password'));
637 711
 		$password = trim(Context::get('password1'));
@@ -645,17 +719,23 @@  discard block
 block discarded – undo
645 719
 
646 720
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
647 721
 		// Verify the cuttent password
648
-		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
722
+		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) {
723
+			return new Object(-1, 'invalid_password');
724
+		}
649 725
 
650 726
 		// Check if a new password is as same as the previous password
651
-		if($current_password == $password) return new Object(-1, 'invalid_new_password');
727
+		if($current_password == $password) {
728
+			return new Object(-1, 'invalid_new_password');
729
+		}
652 730
 
653 731
 		// Execute insert or update depending on the value of member_srl
654 732
 		$args = new stdClass;
655 733
 		$args->member_srl = $member_srl;
656 734
 		$args->password = $password;
657 735
 		$output = $this->updateMemberPassword($args);
658
-		if(!$output->toBool()) return $output;
736
+		if(!$output->toBool()) {
737
+			return $output;
738
+		}
659 739
 
660 740
 		$this->add('member_srl', $args->member_srl);
661 741
 		$this->setMessage('success_updated');
@@ -671,7 +751,9 @@  discard block
 block discarded – undo
671 751
 	 */
672 752
 	function procMemberLeave()
673 753
 	{
674
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
754
+		if(!Context::get('is_logged')) {
755
+			return $this->stop('msg_not_logged');
756
+		}
675 757
 		// Extract the necessary information in advance
676 758
 		$password = trim(Context::get('password'));
677 759
 		// Get information of logged-in user
@@ -687,10 +769,14 @@  discard block
 block discarded – undo
687 769
 			$this->memberInfo->password = $memberInfo->password;
688 770
 		}
689 771
 		// Verify the cuttent password
690
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
772
+		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) {
773
+			return new Object(-1, 'invalid_password');
774
+		}
691 775
 
692 776
 		$output = $this->deleteMember($member_srl);
693
-		if(!$output->toBool()) return $output;
777
+		if(!$output->toBool()) {
778
+			return $output;
779
+		}
694 780
 		// Destroy all session information
695 781
 		$this->destroySessionInfo();
696 782
 		// Return success message
@@ -709,17 +795,25 @@  discard block
 block discarded – undo
709 795
 	{
710 796
 		// Check if the file is successfully uploaded
711 797
 		$file = $_FILES['profile_image'];
712
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
798
+		if(!is_uploaded_file($file['tmp_name'])) {
799
+			return $this->stop('msg_not_uploaded_profile_image');
800
+		}
713 801
 		// Ignore if member_srl is invalid or doesn't exist.
714 802
 		$member_srl = Context::get('member_srl');
715
-		if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
803
+		if(!$member_srl) {
804
+			return $this->stop('msg_not_uploaded_profile_image');
805
+		}
716 806
 
717 807
 		$logged_info = Context::get('logged_info');
718
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
808
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
809
+			return $this->stop('msg_not_uploaded_profile_image');
810
+		}
719 811
 		// Return if member module is set not to use an image name or the user is not an administrator ;
720 812
 		$oModuleModel = getModel('module');
721 813
 		$config = $oModuleModel->getModuleConfig('member');
722
-		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
814
+		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') {
815
+			return $this->stop('msg_not_uploaded_profile_image');
816
+		}
723 817
 
724 818
 		$this->insertProfileImage($member_srl, $file['tmp_name']);
725 819
 		// Page refresh
@@ -741,26 +835,35 @@  discard block
 block discarded – undo
741 835
 	{
742 836
 
743 837
 		// Check uploaded file
744
-		if(!checkUploadedFile($target_file)) return;
838
+		if(!checkUploadedFile($target_file)) {
839
+			return;
840
+		}
745 841
 
746 842
 		$oMemberModel = getModel('member');
747 843
 		$config = $oMemberModel->getMemberConfig();
748 844
 
749 845
 		// Get an image size
750 846
 		$max_width = $config->profile_image_max_width;
751
-		if(!$max_width) $max_width = "90";
847
+		if(!$max_width) {
848
+			$max_width = "90";
849
+		}
752 850
 		$max_height = $config->profile_image_max_height;
753
-		if(!$max_height) $max_height = "90";
851
+		if(!$max_height) {
852
+			$max_height = "90";
853
+		}
754 854
 		// Get a target path to save
755 855
 		$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
756 856
 		FileHandler::makeDir($target_path);
757 857
 
758 858
 		// Get file information
759 859
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
760
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
761
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
762
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
763
-		else
860
+		if(IMAGETYPE_PNG == $type) {
861
+			$ext = 'png';
862
+		} elseif(IMAGETYPE_JPEG == $type) {
863
+			$ext = 'jpg';
864
+		} elseif(IMAGETYPE_GIF == $type) {
865
+			$ext = 'gif';
866
+		} else
764 867
 		{
765 868
 			return;
766 869
 		}
@@ -772,8 +875,7 @@  discard block
 block discarded – undo
772 875
 		if(($width > $max_width || $height > $max_height ) && $type != 1)
773 876
 		{
774 877
 			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
775
-		}
776
-		else
878
+		} else
777 879
 		{
778 880
 			@copy($target_file, $target_filename);
779 881
 		}
@@ -788,17 +890,25 @@  discard block
 block discarded – undo
788 890
 	{
789 891
 		// Check if the file is successfully uploaded
790 892
 		$file = $_FILES['image_name'];
791
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
893
+		if(!is_uploaded_file($file['tmp_name'])) {
894
+			return $this->stop('msg_not_uploaded_image_name');
895
+		}
792 896
 		// Ignore if member_srl is invalid or doesn't exist.
793 897
 		$member_srl = Context::get('member_srl');
794
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
898
+		if(!$member_srl) {
899
+			return $this->stop('msg_not_uploaded_image_name');
900
+		}
795 901
 
796 902
 		$logged_info = Context::get('logged_info');
797
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
903
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
904
+			return $this->stop('msg_not_uploaded_image_name');
905
+		}
798 906
 		// Return if member module is set not to use an image name or the user is not an administrator ;
799 907
 		$oModuleModel = getModel('module');
800 908
 		$config = $oModuleModel->getModuleConfig('member');
801
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
909
+		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') {
910
+			return $this->stop('msg_not_uploaded_image_name');
911
+		}
802 912
 
803 913
 		$this->insertImageName($member_srl, $file['tmp_name']);
804 914
 		// Page refresh
@@ -819,15 +929,21 @@  discard block
 block discarded – undo
819 929
 	function insertImageName($member_srl, $target_file)
820 930
 	{
821 931
 		// Check uploaded file
822
-		if(!checkUploadedFile($target_file)) return;
932
+		if(!checkUploadedFile($target_file)) {
933
+			return;
934
+		}
823 935
 
824 936
 		$oModuleModel = getModel('module');
825 937
 		$config = $oModuleModel->getModuleConfig('member');
826 938
 		// Get an image size
827 939
 		$max_width = $config->image_name_max_width;
828
-		if(!$max_width) $max_width = "90";
940
+		if(!$max_width) {
941
+			$max_width = "90";
942
+		}
829 943
 		$max_height = $config->image_name_max_height;
830
-		if(!$max_height) $max_height = "20";
944
+		if(!$max_height) {
945
+			$max_height = "20";
946
+		}
831 947
 		// Get a target path to save
832 948
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
833 949
 		FileHandler::makeDir($target_path);
@@ -836,8 +952,11 @@  discard block
 block discarded – undo
836 952
 		// Get file information
837 953
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
838 954
 		// Convert if the image size is larger than a given size or if the format is not a gif
839
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
840
-		else @copy($target_file, $target_filename);
955
+		if($width > $max_width || $height > $max_height || $type!=1) {
956
+			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
957
+		} else {
958
+			@copy($target_file, $target_filename);
959
+		}
841 960
 	}
842 961
 
843 962
 	/**
@@ -897,17 +1016,25 @@  discard block
 block discarded – undo
897 1016
 	{
898 1017
 		// Check if the file is successfully uploaded
899 1018
 		$file = $_FILES['image_mark'];
900
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
1019
+		if(!is_uploaded_file($file['tmp_name'])) {
1020
+			return $this->stop('msg_not_uploaded_image_mark');
1021
+		}
901 1022
 		// Ignore if member_srl is invalid or doesn't exist.
902 1023
 		$member_srl = Context::get('member_srl');
903
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
1024
+		if(!$member_srl) {
1025
+			return $this->stop('msg_not_uploaded_image_mark');
1026
+		}
904 1027
 
905 1028
 		$logged_info = Context::get('logged_info');
906
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
1029
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
1030
+			return $this->stop('msg_not_uploaded_image_mark');
1031
+		}
907 1032
 		// Membership in the images mark the module using the ban was set by an administrator or return;
908 1033
 		$oModuleModel = getModel('module');
909 1034
 		$config = $oModuleModel->getModuleConfig('member');
910
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
1035
+		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') {
1036
+			return $this->stop('msg_not_uploaded_image_mark');
1037
+		}
911 1038
 
912 1039
 		$this->insertImageMark($member_srl, $file['tmp_name']);
913 1040
 		// Page refresh
@@ -928,15 +1055,21 @@  discard block
 block discarded – undo
928 1055
 	function insertImageMark($member_srl, $target_file)
929 1056
 	{
930 1057
 		// Check uploaded file
931
-		if(!checkUploadedFile($target_file)) return;
1058
+		if(!checkUploadedFile($target_file)) {
1059
+			return;
1060
+		}
932 1061
 
933 1062
 		$oModuleModel = getModel('module');
934 1063
 		$config = $oModuleModel->getModuleConfig('member');
935 1064
 		// Get an image size
936 1065
 		$max_width = $config->image_mark_max_width;
937
-		if(!$max_width) $max_width = "20";
1066
+		if(!$max_width) {
1067
+			$max_width = "20";
1068
+		}
938 1069
 		$max_height = $config->image_mark_max_height;
939
-		if(!$max_height) $max_height = "20";
1070
+		if(!$max_height) {
1071
+			$max_height = "20";
1072
+		}
940 1073
 
941 1074
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
942 1075
 		FileHandler::makeDir($target_path);
@@ -945,8 +1078,11 @@  discard block
 block discarded – undo
945 1078
 		// Get file information
946 1079
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
947 1080
 
948
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
949
-		else @copy($target_file, $target_filename);
1081
+		if($width > $max_width || $height > $max_height || $type!=1) {
1082
+			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
1083
+		} else {
1084
+			@copy($target_file, $target_filename);
1085
+		}
950 1086
 	}
951 1087
 
952 1088
 	/**
@@ -981,14 +1117,18 @@  discard block
 block discarded – undo
981 1117
 	function procMemberFindAccount()
982 1118
 	{
983 1119
 		$email_address = Context::get('email_address');
984
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1120
+		if(!$email_address) {
1121
+			return new Object(-1, 'msg_invalid_request');
1122
+		}
985 1123
 
986 1124
 		$oMemberModel = getModel('member');
987 1125
 		$oModuleModel = getModel('module');
988 1126
 
989 1127
 		// Check if a member having the same email address exists
990 1128
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
991
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1129
+		if(!$member_srl) {
1130
+			return new Object(-1, 'msg_email_not_exists');
1131
+		}
992 1132
 
993 1133
 		// Get information of the member
994 1134
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
@@ -1000,7 +1140,9 @@  discard block
 block discarded – undo
1000 1140
 			$chk_args = new stdClass;
1001 1141
 			$chk_args->member_srl = $member_info->member_srl;
1002 1142
 			$output = executeQuery('member.chkAuthMail', $chk_args);
1003
-			if($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
1143
+			if($output->toBool() && $output->data->count != '0') {
1144
+				return new Object(-1, 'msg_user_not_confirmed');
1145
+			}
1004 1146
 		}
1005 1147
 
1006 1148
 		// Insert data into the authentication DB
@@ -1013,7 +1155,9 @@  discard block
 block discarded – undo
1013 1155
 		$args->is_register = 'N';
1014 1156
 
1015 1157
 		$output = executeQuery('member.insertAuthMail', $args);
1016
-		if(!$output->toBool()) return $output;
1158
+		if(!$output->toBool()) {
1159
+			return $output;
1160
+		}
1017 1161
 		// Get content of the email to send a member
1018 1162
 		Context::set('auth_args', $args);
1019 1163
 
@@ -1030,8 +1174,7 @@  discard block
 block discarded – undo
1030 1174
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1031 1175
 				}
1032 1176
 			}
1033
-		}
1034
-		else
1177
+		} else
1035 1178
 		{
1036 1179
 			$memberInfo[$lang->user_id] = $args->user_id;
1037 1180
 			$memberInfo[$lang->user_name] = $args->user_name;
@@ -1040,13 +1183,19 @@  discard block
 block discarded – undo
1040 1183
 		}
1041 1184
 		Context::set('memberInfo', $memberInfo);
1042 1185
 
1043
-		if(!$member_config->skin) $member_config->skin = "default";
1044
-		if(!$member_config->colorset) $member_config->colorset = "white";
1186
+		if(!$member_config->skin) {
1187
+			$member_config->skin = "default";
1188
+		}
1189
+		if(!$member_config->colorset) {
1190
+			$member_config->colorset = "white";
1191
+		}
1045 1192
 
1046 1193
 		Context::set('member_config', $member_config);
1047 1194
 
1048 1195
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1049
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1196
+		if(!is_dir($tpl_path)) {
1197
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1198
+		}
1050 1199
 
1051 1200
 		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1052 1201
 		Context::set('find_url', $find_url);
@@ -1088,20 +1237,28 @@  discard block
 block discarded – undo
1088 1237
 		$find_account_question = trim(Context::get('find_account_question'));
1089 1238
 		$find_account_answer = trim(Context::get('find_account_answer'));
1090 1239
 
1091
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1240
+		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) {
1241
+			return new Object(-1, 'msg_invalid_request');
1242
+		}
1092 1243
 
1093 1244
 		$oModuleModel = getModel('module');
1094 1245
 		// Check if a member having the same email address exists
1095 1246
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1096
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1247
+		if(!$member_srl) {
1248
+			return new Object(-1, 'msg_email_not_exists');
1249
+		}
1097 1250
 		// Get information of the member
1098 1251
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1099 1252
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1100 1253
 
1101 1254
 		// Display a message if no answer is entered
1102
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1255
+		if(!$member_info->find_account_question || !$member_info->find_account_answer) {
1256
+			return new Object(-1, 'msg_question_not_exists');
1257
+		}
1103 1258
 
1104
-		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');
1259
+		if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) {
1260
+			return new Object(-1, 'msg_answer_not_matches');
1261
+		}
1105 1262
 
1106 1263
 		if($config->identifier == 'email_address')
1107 1264
 		{
@@ -1117,7 +1274,9 @@  discard block
 block discarded – undo
1117 1274
 		$args->password = $temp_password;
1118 1275
 		$args->change_password_date = '1';
1119 1276
 		$output = $this->updateMemberPassword($args);
1120
-		if(!$output->toBool()) return $output;
1277
+		if(!$output->toBool()) {
1278
+			return $output;
1279
+		}
1121 1280
 
1122 1281
 		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1123 1282
 
@@ -1174,8 +1333,7 @@  discard block
 block discarded – undo
1174 1333
 		if($output->data->is_register == 'Y')
1175 1334
 		{
1176 1335
 			$args->denied = 'N';
1177
-		}
1178
-		else
1336
+		} else
1179 1337
 		{
1180 1338
 			$args->password = $oMemberModel->hashPassword($args->password);
1181 1339
 		}
@@ -1209,33 +1367,45 @@  discard block
 block discarded – undo
1209 1367
 	{
1210 1368
 		// Get an email_address
1211 1369
 		$email_address = Context::get('email_address');
1212
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1370
+		if(!$email_address) {
1371
+			return new Object(-1, 'msg_invalid_request');
1372
+		}
1213 1373
 		// Log test by using email_address
1214 1374
 		$oMemberModel = getModel('member');
1215 1375
 
1216 1376
 		$args = new stdClass;
1217 1377
 		$args->email_address = $email_address;
1218 1378
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1219
-		if(!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1379
+		if(!$memberSrl) {
1380
+			return new Object(-1, 'msg_not_exists_member');
1381
+		}
1220 1382
 
1221 1383
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1222 1384
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1223 1385
 
1224 1386
 		$oModuleModel = getModel('module');
1225 1387
 		$member_config = $oModuleModel->getModuleConfig('member');
1226
-		if(!$member_config->skin) $member_config->skin = "default";
1227
-		if(!$member_config->colorset) $member_config->colorset = "white";
1388
+		if(!$member_config->skin) {
1389
+			$member_config->skin = "default";
1390
+		}
1391
+		if(!$member_config->colorset) {
1392
+			$member_config->colorset = "white";
1393
+		}
1228 1394
 
1229 1395
 		// Check if a authentication mail has been sent previously
1230 1396
 		$chk_args = new stdClass;
1231 1397
 		$chk_args->member_srl = $member_info->member_srl;
1232 1398
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1233
-		if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1399
+		if($output->toBool() && $output->data->count == '0') {
1400
+			return new Object(-1, 'msg_invalid_request');
1401
+		}
1234 1402
 
1235 1403
 		$auth_args = new stdClass;
1236 1404
 		$auth_args->member_srl = $member_info->member_srl;
1237 1405
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1238
-		if(!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1406
+		if(!$output->data || !$output->data[0]->auth_key) {
1407
+			return new Object(-1, 'msg_invalid_request');
1408
+		}
1239 1409
 		$auth_info = $output->data[0];
1240 1410
 
1241 1411
 		// Update the regdate of authmail entry
@@ -1256,8 +1426,7 @@  discard block
 block discarded – undo
1256 1426
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1257 1427
 				}
1258 1428
 			}
1259
-		}
1260
-		else
1429
+		} else
1261 1430
 		{
1262 1431
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1263 1432
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1270,7 +1439,9 @@  discard block
 block discarded – undo
1270 1439
 		Context::set('member_config', $member_config);
1271 1440
 
1272 1441
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1273
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1442
+		if(!is_dir($tpl_path)) {
1443
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1444
+		}
1274 1445
 
1275 1446
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1276 1447
 		Context::set('auth_url', $auth_url);
@@ -1348,7 +1519,9 @@  discard block
 block discarded – undo
1348 1519
 		$auth_args->is_register = 'Y';
1349 1520
 
1350 1521
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1351
-		if(!$output->toBool()) return $output;
1522
+		if(!$output->toBool()) {
1523
+			return $output;
1524
+		}
1352 1525
 
1353 1526
 		$memberInfo->email_address = $newEmail;
1354 1527
 
@@ -1382,8 +1555,7 @@  discard block
 block discarded – undo
1382 1555
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1383 1556
 				}
1384 1557
 			}
1385
-		}
1386
-		else
1558
+		} else
1387 1559
 		{
1388 1560
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1389 1561
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1392,13 +1564,19 @@  discard block
 block discarded – undo
1392 1564
 		}
1393 1565
 		Context::set('memberInfo', $memberInfo);
1394 1566
 
1395
-		if(!$member_config->skin) $member_config->skin = "default";
1396
-		if(!$member_config->colorset) $member_config->colorset = "white";
1567
+		if(!$member_config->skin) {
1568
+			$member_config->skin = "default";
1569
+		}
1570
+		if(!$member_config->colorset) {
1571
+			$member_config->colorset = "white";
1572
+		}
1397 1573
 
1398 1574
 		Context::set('member_config', $member_config);
1399 1575
 
1400 1576
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1401
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1577
+		if(!is_dir($tpl_path)) {
1578
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1579
+		}
1402 1580
 
1403 1581
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1404 1582
 		Context::set('auth_url', $auth_url);
@@ -1423,7 +1601,9 @@  discard block
 block discarded – undo
1423 1601
 	{
1424 1602
 		$site_module_info = Context::get('site_module_info');
1425 1603
 		$logged_info = Context::get('logged_info');
1426
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1604
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1605
+			return new Object(-1,'msg_invalid_request');
1606
+		}
1427 1607
 
1428 1608
 		$oMemberModel = getModel('member');
1429 1609
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1442,13 +1622,17 @@  discard block
 block discarded – undo
1442 1622
 	{
1443 1623
 		$site_module_info = Context::get('site_module_info');
1444 1624
 		$logged_info = Context::get('logged_info');
1445
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1625
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1626
+			return new Object(-1,'msg_invalid_request');
1627
+		}
1446 1628
 
1447 1629
 		$args = new stdClass;
1448 1630
 		$args->site_srl= $site_module_info->site_srl;
1449 1631
 		$args->member_srl = $logged_info->member_srl;
1450 1632
 		$output = executeQuery('member.deleteMembersGroup', $args);
1451
-		if(!$output->toBool()) return $output;
1633
+		if(!$output->toBool()) {
1634
+			return $output;
1635
+		}
1452 1636
 		$this->setMessage('success_deleted');
1453 1637
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1454 1638
 	}
@@ -1462,17 +1646,37 @@  discard block
 block discarded – undo
1462 1646
 	 */
1463 1647
 	function setMemberConfig($args)
1464 1648
 	{
1465
-		if(!$args->skin) $args->skin = "default";
1466
-		if(!$args->colorset) $args->colorset = "white";
1467
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1468
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1469
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1649
+		if(!$args->skin) {
1650
+			$args->skin = "default";
1651
+		}
1652
+		if(!$args->colorset) {
1653
+			$args->colorset = "white";
1654
+		}
1655
+		if(!$args->editor_skin) {
1656
+			$args->editor_skin= "ckeditor";
1657
+		}
1658
+		if(!$args->editor_colorset) {
1659
+			$args->editor_colorset = "moono";
1660
+		}
1661
+		if($args->enable_join!='Y') {
1662
+			$args->enable_join = 'N';
1663
+		}
1470 1664
 		$args->enable_openid= 'N';
1471
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1472
-		if($args->image_name!='Y') $args->image_name = 'N';
1473
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1474
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1475
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1665
+		if($args->profile_image !='Y') {
1666
+			$args->profile_image = 'N';
1667
+		}
1668
+		if($args->image_name!='Y') {
1669
+			$args->image_name = 'N';
1670
+		}
1671
+		if($args->image_mark!='Y') {
1672
+			$args->image_mark = 'N';
1673
+		}
1674
+		if($args->group_image_mark!='Y') {
1675
+			$args->group_image_mark = 'N';
1676
+		}
1677
+		if(!trim(strip_tags($args->agreement))) {
1678
+			$args->agreement = null;
1679
+		}
1476 1680
 		$args->limit_day = (int)$args->limit_day;
1477 1681
 
1478 1682
 		$agreement = trim($args->agreement);
@@ -1480,7 +1684,9 @@  discard block
 block discarded – undo
1480 1684
 
1481 1685
 		$oModuleController = getController('module');
1482 1686
 		$output = $oModuleController->insertModuleConfig('member',$args);
1483
-		if(!$output->toBool()) return $output;
1687
+		if(!$output->toBool()) {
1688
+			return $output;
1689
+		}
1484 1690
 
1485 1691
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1486 1692
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1505,7 +1711,9 @@  discard block
 block discarded – undo
1505 1711
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1506 1712
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1507 1713
 
1508
-		if(!$check_signature) return FileHandler::removeFile($filename);
1714
+		if(!$check_signature) {
1715
+			return FileHandler::removeFile($filename);
1716
+		}
1509 1717
 
1510 1718
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1511 1719
 		FileHandler::makeDir($path);
@@ -1539,7 +1747,9 @@  discard block
 block discarded – undo
1539 1747
 		$args = new stdClass();
1540 1748
 		$args->member_srl = $member_srl;
1541 1749
 		$args->group_srl = $group_srl;
1542
-		if($site_srl) $args->site_srl = $site_srl;
1750
+		if($site_srl) {
1751
+			$args->site_srl = $site_srl;
1752
+		}
1543 1753
 
1544 1754
 		// Add
1545 1755
 		$output = executeQuery('member.addMemberToGroup',$args);
@@ -1565,15 +1775,21 @@  discard block
 block discarded – undo
1565 1775
 		$obj->member_srl = implode(',',$args->member_srl);
1566 1776
 
1567 1777
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1568
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1778
+		if($output->data) {
1779
+			foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1780
+		}
1569 1781
 
1570 1782
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1571
-		if(!$output->toBool()) return $output;
1783
+		if(!$output->toBool()) {
1784
+			return $output;
1785
+		}
1572 1786
 
1573 1787
 		$inserted_members = array();
1574 1788
 		foreach($args->member_srl as $key => $val)
1575 1789
 		{
1576
-			if($inserted_members[$val]) continue;
1790
+			if($inserted_members[$val]) {
1791
+				continue;
1792
+			}
1577 1793
 			$inserted_members[$val] = true;
1578 1794
 
1579 1795
 			unset($obj);
@@ -1583,7 +1799,9 @@  discard block
 block discarded – undo
1583 1799
 			$obj->site_srl = $args->site_srl;
1584 1800
 			$obj->regdate = $date[$obj->member_srl];
1585 1801
 			$output = executeQuery('member.addMemberToGroup', $obj);
1586
-			if(!$output->toBool()) return $output;
1802
+			if(!$output->toBool()) {
1803
+				return $output;
1804
+			}
1587 1805
 
1588 1806
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1589 1807
 		}
@@ -1645,8 +1863,7 @@  discard block
 block discarded – undo
1645 1863
 				if($config->identifier == 'user_id')
1646 1864
 				{
1647 1865
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1648
-				}
1649
-				else
1866
+				} else
1650 1867
 				{
1651 1868
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1652 1869
 				}
@@ -1655,8 +1872,7 @@  discard block
 block discarded – undo
1655 1872
 					$do_auto_login = true;
1656 1873
 				}
1657 1874
 
1658
-			}
1659
-			else
1875
+			} else
1660 1876
 			{
1661 1877
 				$do_auto_login = true;
1662 1878
 			}
@@ -1665,8 +1881,7 @@  discard block
 block discarded – undo
1665 1881
 		if($do_auto_login)
1666 1882
 		{
1667 1883
 			$output = $this->doLogin($user_id);
1668
-		}
1669
-		else
1884
+		} else
1670 1885
 		{
1671 1886
 			executeQuery('member.deleteAutologin', $args);
1672 1887
 			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365);
@@ -1685,13 +1900,17 @@  discard block
 block discarded – undo
1685 1900
 	function doLogin($user_id, $password = '', $keep_signed = false)
1686 1901
 	{
1687 1902
 		$user_id = strtolower($user_id);
1688
-		if(!$user_id) return new Object(-1, 'null_user_id');
1903
+		if(!$user_id) {
1904
+			return new Object(-1, 'null_user_id');
1905
+		}
1689 1906
 		// Call a trigger before log-in (before)
1690 1907
 		$trigger_obj = new stdClass();
1691 1908
 		$trigger_obj->user_id = $user_id;
1692 1909
 		$trigger_obj->password = $password;
1693 1910
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1694
-		if(!$trigger_output->toBool()) return $trigger_output;
1911
+		if(!$trigger_output->toBool()) {
1912
+			return $trigger_output;
1913
+		}
1695 1914
 		// Create a member model object
1696 1915
 		$oMemberModel = getModel('member');
1697 1916
 
@@ -1706,15 +1925,18 @@  discard block
 block discarded – undo
1706 1925
 			// Get user_id information
1707 1926
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1708 1927
 			// Set an invalid user if no value returned
1709
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1928
+			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) {
1929
+				return $this->recordLoginError(-1, 'invalid_email_address');
1930
+			}
1710 1931
 
1711
-		}
1712
-		else
1932
+		} else
1713 1933
 		{
1714 1934
 			// Get user_id information
1715 1935
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1716 1936
 			// Set an invalid user if no value returned
1717
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1937
+			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) {
1938
+				return $this->recordLoginError(-1, 'invalid_user_id');
1939
+			}
1718 1940
 		}
1719 1941
 
1720 1942
 		$output = executeQuery('member.getLoginCountByIp', $args);
@@ -1726,14 +1948,18 @@  discard block
 block discarded – undo
1726 1948
 			if($term < $config->max_error_count_time)
1727 1949
 			{
1728 1950
 				$term = $config->max_error_count_time - $term;
1729
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1730
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1731
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1732
-				else $term = intval($term/86400).Context::getLang('unit_day');
1951
+				if($term < 60) {
1952
+					$term = intval($term).Context::getLang('unit_sec');
1953
+				} elseif(60 <= $term && $term < 3600) {
1954
+					$term = intval($term/60).Context::getLang('unit_min');
1955
+				} elseif(3600 <= $term && $term < 86400) {
1956
+					$term = intval($term/3600).Context::getLang('unit_hour');
1957
+				} else {
1958
+					$term = intval($term/86400).Context::getLang('unit_day');
1959
+				}
1733 1960
 
1734 1961
 				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1735
-			}
1736
-			else
1962
+			} else
1737 1963
 			{
1738 1964
 				$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1739 1965
 				$output = executeQuery('member.deleteLoginCountByIp', $args);
@@ -1760,7 +1986,9 @@  discard block
 block discarded – undo
1760 1986
 			return new Object(-1,'msg_user_denied');
1761 1987
 		}
1762 1988
 		// Notify if denied_date is less than the current time
1763
-		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")));
1989
+		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) {
1990
+			return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
1991
+		}
1764 1992
 		// Update the latest login time
1765 1993
 		$args->member_srl = $this->memberInfo->member_srl;
1766 1994
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1809,7 +2037,9 @@  discard block
 block discarded – undo
1809 2037
 		}
1810 2038
 		// Call a trigger after successfully log-in (after)
1811 2039
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1812
-		if(!$trigger_output->toBool()) return $trigger_output;
2040
+		if(!$trigger_output->toBool()) {
2041
+			return $trigger_output;
2042
+		}
1813 2043
 		// When user checked to use auto-login
1814 2044
 		if($keep_signed)
1815 2045
 		{
@@ -1823,7 +2053,9 @@  discard block
 block discarded – undo
1823 2053
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1824 2054
 			executeQuery('member.deleteAutologin', $autologin_args);
1825 2055
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1826
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000);
2056
+			if($autologin_output->toBool()) {
2057
+				setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000);
2058
+			}
1827 2059
 		}
1828 2060
 		if($this->memberInfo->is_admin == 'Y')
1829 2061
 		{
@@ -1912,7 +2144,9 @@  discard block
 block discarded – undo
1912 2144
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
1913 2145
 	{
1914 2146
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
1915
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
2147
+		if(!is_array($member_popup_menu_list)) {
2148
+			$member_popup_menu_list = array();
2149
+		}
1916 2150
 
1917 2151
 		$obj = new stdClass;
1918 2152
 		$obj->url = $url;
@@ -1931,35 +2165,54 @@  discard block
 block discarded – undo
1931 2165
 	{
1932 2166
 		// Call a trigger (before)
1933 2167
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
1934
-		if(!$output->toBool()) return $output;
2168
+		if(!$output->toBool()) {
2169
+			return $output;
2170
+		}
1935 2171
 		// Terms and Conditions portion of the information set up by members reaffirmed
1936 2172
 		$oModuleModel = getModel('module');
1937 2173
 		$config = $oModuleModel->getModuleConfig('member');
1938 2174
 
1939 2175
 		$logged_info = Context::get('logged_info');
1940 2176
 		// If the date of the temporary restrictions limit further information on the date of
1941
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2177
+		if($config->limit_day) {
2178
+			$args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2179
+		}
1942 2180
 
1943 2181
 		$args->member_srl = getNextSequence();
1944 2182
 		$args->list_order = -1 * $args->member_srl;
1945 2183
 
1946 2184
 		// Execute insert or update depending on the value of member_srl
1947
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2185
+		if(!$args->user_id) {
2186
+			$args->user_id = 't'.$args->member_srl;
2187
+		}
1948 2188
 		// Enter the user's identity changed to lowercase
1949
-		else $args->user_id = strtolower($args->user_id);
1950
-		if(!$args->user_name) $args->user_name = $args->member_srl;
1951
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
2189
+		else {
2190
+			$args->user_id = strtolower($args->user_id);
2191
+		}
2192
+		if(!$args->user_name) {
2193
+			$args->user_name = $args->member_srl;
2194
+		}
2195
+		if(!$args->nick_name) {
2196
+			$args->nick_name = $args->member_srl;
2197
+		}
1952 2198
 
1953 2199
 		// Control of essential parameters
1954
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
1955
-		if($args->denied!='Y') $args->denied = 'N';
1956
-		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y';
2200
+		if($args->allow_mailing!='Y') {
2201
+			$args->allow_mailing = 'N';
2202
+		}
2203
+		if($args->denied!='Y') {
2204
+			$args->denied = 'N';
2205
+		}
2206
+		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) {
2207
+			$args->allow_message = 'Y';
2208
+		}
1957 2209
 
1958 2210
 		if($logged_info->is_admin == 'Y')
1959 2211
 		{
1960
-			if($args->is_admin!='Y') $args->is_admin = 'N';
1961
-		}
1962
-		else
2212
+			if($args->is_admin!='Y') {
2213
+				$args->is_admin = 'N';
2214
+			}
2215
+		} else
1963 2216
 		{
1964 2217
 			unset($args->is_admin);
1965 2218
 		}
@@ -1972,8 +2225,12 @@  discard block
 block discarded – undo
1972 2225
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1973 2226
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1974 2227
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1975
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
1976
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
2228
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) {
2229
+			$args->homepage = 'http://'.$args->homepage;
2230
+		}
2231
+		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) {
2232
+			$args->blog = 'http://'.$args->blog;
2233
+		}
1977 2234
 
1978 2235
 		// Create a model object
1979 2236
 		$oMemberModel = getModel('member');
@@ -1987,8 +2244,7 @@  discard block
 block discarded – undo
1987 2244
 				return new Object(-1, $message[$config->password_strength]);
1988 2245
 			}
1989 2246
 			$args->password = $oMemberModel->hashPassword($args->password);
1990
-		}
1991
-		elseif(!$args->password)
2247
+		} elseif(!$args->password)
1992 2248
 		{
1993 2249
 			unset($args->password);
1994 2250
 		}
@@ -2029,8 +2285,12 @@  discard block
 block discarded – undo
2029 2285
 		// Insert data into the DB
2030 2286
 		$args->list_order = -1 * $args->member_srl;
2031 2287
 
2032
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2033
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2288
+		if(!$args->user_id) {
2289
+			$args->user_id = 't'.$args->member_srl;
2290
+		}
2291
+		if(!$args->user_name) {
2292
+			$args->user_name = $args->member_srl;
2293
+		}
2034 2294
 
2035 2295
 		$oDB = &DB::getInstance();
2036 2296
 		$oDB->begin();
@@ -2042,8 +2302,11 @@  discard block
 block discarded – undo
2042 2302
 			return $output;
2043 2303
 		}
2044 2304
 
2045
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2046
-		else $group_srl_list = explode('|@|', $args->group_srl_list);
2305
+		if(is_array($args->group_srl_list)) {
2306
+			$group_srl_list = $args->group_srl_list;
2307
+		} else {
2308
+			$group_srl_list = explode('|@|', $args->group_srl_list);
2309
+		}
2047 2310
 		// If no value is entered the default group, the value of group registration
2048 2311
 		if(!$args->group_srl_list)
2049 2312
 		{
@@ -2060,8 +2323,7 @@  discard block
 block discarded – undo
2060 2323
 				}
2061 2324
 			}
2062 2325
 			// If the value is the value of the group entered the group registration
2063
-		}
2064
-		else
2326
+		} else
2065 2327
 		{
2066 2328
 			for($i=0;$i<count($group_srl_list);$i++)
2067 2329
 			{
@@ -2122,27 +2384,39 @@  discard block
 block discarded – undo
2122 2384
 	{
2123 2385
 		// Call a trigger (before)
2124 2386
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2125
-		if(!$output->toBool()) return $output;
2387
+		if(!$output->toBool()) {
2388
+			return $output;
2389
+		}
2126 2390
 		// Create a model object
2127 2391
 		$oMemberModel = getModel('member');
2128 2392
 
2129 2393
 		$logged_info = Context::get('logged_info');
2130 2394
 		// Get what you want to modify the original information
2131
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2395
+		if(!$this->memberInfo) {
2396
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2397
+		}
2132 2398
 		// Control of essential parameters
2133
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2134
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2399
+		if($args->allow_mailing!='Y') {
2400
+			$args->allow_mailing = 'N';
2401
+		}
2402
+		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) {
2403
+			$args->allow_message = 'Y';
2404
+		}
2135 2405
 
2136 2406
 		if($logged_info->is_admin == 'Y')
2137 2407
 		{
2138
-			if($args->denied!='Y') $args->denied = 'N';
2139
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2140
-		}
2141
-		else
2408
+			if($args->denied!='Y') {
2409
+				$args->denied = 'N';
2410
+			}
2411
+			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) {
2412
+				$args->is_admin = 'N';
2413
+			}
2414
+		} else
2142 2415
 		{
2143 2416
 			unset($args->is_admin);
2144
-			if($is_admin == false)
2145
-				unset($args->denied);
2417
+			if($is_admin == false) {
2418
+							unset($args->denied);
2419
+			}
2146 2420
 			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2147 2421
 			{
2148 2422
 				return $this->stop('msg_invalid_request');
@@ -2150,13 +2424,19 @@  discard block
 block discarded – undo
2150 2424
 		}
2151 2425
 
2152 2426
 		// Sanitize user ID, username, nickname, homepage, blog
2153
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2427
+		if($args->user_id) {
2428
+			$args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2429
+		}
2154 2430
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2155 2431
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2156 2432
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2157 2433
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2158
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2159
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2434
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) {
2435
+			$args->homepage = 'http://'.$args->homepage;
2436
+		}
2437
+		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) {
2438
+			$args->blog = 'http://'.$args->blog;
2439
+		}
2160 2440
 
2161 2441
 		// check member identifier form
2162 2442
 		$config = $oMemberModel->getMemberConfig();
@@ -2173,8 +2453,7 @@  discard block
 block discarded – undo
2173 2453
 				return new Object(-1,'msg_exists_email_address');
2174 2454
 			}
2175 2455
 			$args->email_address = $orgMemberInfo->email_address;
2176
-		}
2177
-		else
2456
+		} else
2178 2457
 		{
2179 2458
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2180 2459
 			if($member_srl && $args->member_srl != $member_srl)
@@ -2231,17 +2510,26 @@  discard block
 block discarded – undo
2231 2510
 				return new Object(-1, $message[$config->password_strength]);
2232 2511
 			}
2233 2512
 			$args->password = $oMemberModel->hashPassword($args->password);
2234
-		}
2235
-		else
2513
+		} else
2236 2514
 		{
2237 2515
 			$args->password = $orgMemberInfo->password;
2238 2516
 		}
2239 2517
 
2240
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2241
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2242
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2243
-		if(!$args->description) $args->description = $orgMemberInfo->description;
2244
-		if(!$args->birthday) $args->birthday = '';
2518
+		if(!$args->user_name) {
2519
+			$args->user_name = $orgMemberInfo->user_name;
2520
+		}
2521
+		if(!$args->user_id) {
2522
+			$args->user_id = $orgMemberInfo->user_id;
2523
+		}
2524
+		if(!$args->nick_name) {
2525
+			$args->nick_name = $orgMemberInfo->nick_name;
2526
+		}
2527
+		if(!$args->description) {
2528
+			$args->description = $orgMemberInfo->description;
2529
+		}
2530
+		if(!$args->birthday) {
2531
+			$args->birthday = '';
2532
+		}
2245 2533
 
2246 2534
 		$output = executeQuery('member.updateMember', $args);
2247 2535
 
@@ -2253,8 +2541,11 @@  discard block
 block discarded – undo
2253 2541
 
2254 2542
 		if($args->group_srl_list)
2255 2543
 		{
2256
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2257
-			else $group_srl_list = explode('|@|', $args->group_srl_list);
2544
+			if(is_array($args->group_srl_list)) {
2545
+				$group_srl_list = $args->group_srl_list;
2546
+			} else {
2547
+				$group_srl_list = explode('|@|', $args->group_srl_list);
2548
+			}
2258 2549
 			// If the group information, group information changes
2259 2550
 			if(count($group_srl_list) > 0)
2260 2551
 			{
@@ -2297,7 +2588,9 @@  discard block
 block discarded – undo
2297 2588
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2298 2589
 
2299 2590
 		// Save Session
2300
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2591
+		if(!$this->memberInfo) {
2592
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2593
+		}
2301 2594
 		$logged_info = Context::get('logged_info');
2302 2595
 
2303 2596
 		$output->add('member_srl', $args->member_srl);
@@ -2323,8 +2616,7 @@  discard block
 block discarded – undo
2323 2616
 			}
2324 2617
 
2325 2618
 			$args->password = $oMemberModel->hashPassword($args->password);
2326
-		}
2327
-		else if($args->hashed_password)
2619
+		} else if($args->hashed_password)
2328 2620
 		{
2329 2621
 			$args->password = $args->hashed_password;
2330 2622
 		}
@@ -2349,7 +2641,9 @@  discard block
 block discarded – undo
2349 2641
 		$trigger_obj = new stdClass();
2350 2642
 		$trigger_obj->member_srl = $member_srl;
2351 2643
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2352
-		if(!$output->toBool()) return $output;
2644
+		if(!$output->toBool()) {
2645
+			return $output;
2646
+		}
2353 2647
 		// Create a model object
2354 2648
 		$oMemberModel = getModel('member');
2355 2649
 		// Bringing the user's information
@@ -2358,9 +2652,13 @@  discard block
 block discarded – undo
2358 2652
 			$columnList = array('member_srl', 'is_admin');
2359 2653
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2360 2654
 		}
2361
-		if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2655
+		if(!$this->memberInfo) {
2656
+			return new Object(-1, 'msg_not_exists_member');
2657
+		}
2362 2658
 		// If managers can not be deleted
2363
-		if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2659
+		if($this->memberInfo->is_admin == 'Y') {
2660
+			return new Object(-1, 'msg_cannot_delete_admin');
2661
+		}
2364 2662
 
2365 2663
 		$oDB = &DB::getInstance();
2366 2664
 		$oDB->begin();
@@ -2424,7 +2722,9 @@  discard block
 block discarded – undo
2424 2722
 	 */
2425 2723
 	function destroySessionInfo()
2426 2724
 	{
2427
-		if(!$_SESSION || !is_array($_SESSION)) return;
2725
+		if(!$_SESSION || !is_array($_SESSION)) {
2726
+			return;
2727
+		}
2428 2728
 
2429 2729
 		$memberInfo = Context::get('logged_info');
2430 2730
 		$memberSrl = $memberInfo->member_srl;
@@ -2463,8 +2763,9 @@  discard block
 block discarded – undo
2463 2763
 		}
2464 2764
 		$maxLevel = 0;
2465 2765
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2466
-		if(count($resultGroup) > 0)
2467
-			$maxLevel = max(array_flip($resultGroup));
2766
+		if(count($resultGroup) > 0) {
2767
+					$maxLevel = max(array_flip($resultGroup));
2768
+		}
2468 2769
 
2469 2770
 		if($maxLevel > 0)
2470 2771
 		{
@@ -2481,16 +2782,22 @@  discard block
 block discarded – undo
2481 2782
 
2482 2783
 	function procMemberModifyEmailAddress()
2483 2784
 	{
2484
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2785
+		if(!Context::get('is_logged')) {
2786
+			return $this->stop('msg_not_logged');
2787
+		}
2485 2788
 
2486 2789
 		$member_info = Context::get('logged_info');
2487 2790
 		$newEmail = Context::get('email_address');
2488 2791
 
2489
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2792
+		if(!$newEmail) {
2793
+			return $this->stop('msg_invalid_request');
2794
+		}
2490 2795
 
2491 2796
 		$oMemberModel = getModel('member');
2492 2797
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2493
-		if($member_srl) return new Object(-1,'msg_exists_email_address');
2798
+		if($member_srl) {
2799
+			return new Object(-1,'msg_exists_email_address');
2800
+		}
2494 2801
 
2495 2802
 		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2496 2803
 		{
@@ -2518,7 +2825,9 @@  discard block
 block discarded – undo
2518 2825
 		$member_config = $oModuleModel->getModuleConfig('member');
2519 2826
 
2520 2827
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2521
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2828
+		if(!is_dir($tpl_path)) {
2829
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2830
+		}
2522 2831
 
2523 2832
 		global $lang;
2524 2833
 
@@ -2554,7 +2863,9 @@  discard block
 block discarded – undo
2554 2863
 	{
2555 2864
 		$member_srl = Context::get('member_srl');
2556 2865
 		$auth_key = Context::get('auth_key');
2557
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2866
+		if(!$member_srl || !$auth_key) {
2867
+			return $this->stop('msg_invalid_request');
2868
+		}
2558 2869
 
2559 2870
 		// Test logs for finding password by user_id and authkey
2560 2871
 		$args = new stdClass;
@@ -2563,7 +2874,9 @@  discard block
 block discarded – undo
2563 2874
 		$output = executeQuery('member.getAuthMail', $args);
2564 2875
 		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2565 2876
 		{
2566
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2877
+			if(strlen($output->data->auth_key) !== strlen($auth_key)) {
2878
+				executeQuery('member.deleteAuthChangeEmailAddress', $args);
2879
+			}
2567 2880
 			return $this->stop('msg_invalid_modify_email_auth_key');
2568 2881
 		}
2569 2882
 
@@ -2572,7 +2885,9 @@  discard block
 block discarded – undo
2572 2885
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2573 2886
 
2574 2887
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2575
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2888
+		if(!$output->toBool()) {
2889
+			return $this->stop($output->getMessage());
2890
+		}
2576 2891
 
2577 2892
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2578 2893
 		executeQuery('member.deleteAuthChangeEmailAddress',$args);
@@ -2593,7 +2908,9 @@  discard block
 block discarded – undo
2593 2908
 	**/
2594 2909
 	function triggerGetDocumentMenu(&$menu_list)
2595 2910
 	{
2596
-		if(!Context::get('is_logged')) return new Object();
2911
+		if(!Context::get('is_logged')) {
2912
+			return new Object();
2913
+		}
2597 2914
 
2598 2915
 		$logged_info = Context::get('logged_info');
2599 2916
 		$document_srl = Context::get('target_srl');
@@ -2604,8 +2921,12 @@  discard block
 block discarded – undo
2604 2921
 		$member_srl = $oDocument->get('member_srl');
2605 2922
 		$module_srl = $oDocument->get('module_srl');
2606 2923
 
2607
-		if(!$member_srl) return new Object();
2608
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2924
+		if(!$member_srl) {
2925
+			return new Object();
2926
+		}
2927
+		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
2928
+			return new Object();
2929
+		}
2609 2930
 
2610 2931
 		$oDocumentController = getController('document');
2611 2932
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2623,7 +2944,9 @@  discard block
 block discarded – undo
2623 2944
 	**/
2624 2945
 	function triggerGetCommentMenu(&$menu_list)
2625 2946
 	{
2626
-		if(!Context::get('is_logged')) return new Object();
2947
+		if(!Context::get('is_logged')) {
2948
+			return new Object();
2949
+		}
2627 2950
 
2628 2951
 		$logged_info = Context::get('logged_info');
2629 2952
 		$comment_srl = Context::get('target_srl');
@@ -2634,8 +2957,12 @@  discard block
 block discarded – undo
2634 2957
 		$module_srl = $oComment->get('module_srl');
2635 2958
 		$member_srl = $oComment->get('member_srl');
2636 2959
 
2637
-		if(!$member_srl) return new Object();
2638
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2960
+		if(!$member_srl) {
2961
+			return new Object();
2962
+		}
2963
+		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
2964
+			return new Object();
2965
+		}
2639 2966
 
2640 2967
 		$oCommentController = getController('comment');
2641 2968
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2651,7 +2978,9 @@  discard block
 block discarded – undo
2651 2978
 	**/
2652 2979
 	function procMemberSpammerManage()
2653 2980
 	{
2654
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
2981
+		if(!Context::get('is_logged')) {
2982
+			return new Object(-1,'msg_not_permitted');
2983
+		}
2655 2984
 
2656 2985
 		$logged_info = Context::get('logged_info');
2657 2986
 		$member_srl = Context::get('member_srl');
@@ -2659,8 +2988,9 @@  discard block
 block discarded – undo
2659 2988
 		$cnt_loop = Context::get('cnt_loop');
2660 2989
 		$proc_type = Context::get('proc_type');
2661 2990
 		$isMoveToTrash = true;
2662
-		if($proc_type == "delete")
2663
-			$isMoveToTrash = false;
2991
+		if($proc_type == "delete") {
2992
+					$isMoveToTrash = false;
2993
+		}
2664 2994
 
2665 2995
 		// check grant
2666 2996
 		$oModuleModel = getModel('module');
@@ -2668,7 +2998,9 @@  discard block
 block discarded – undo
2668 2998
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2669 2999
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2670 3000
 
2671
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
3001
+		if(!$grant->manager) {
3002
+			return new Object(-1,'msg_not_permitted');
3003
+		}
2672 3004
 
2673 3005
 		$proc_msg = "";
2674 3006
 
@@ -2677,11 +3009,13 @@  discard block
 block discarded – undo
2677 3009
 
2678 3010
 		// delete or trash destination
2679 3011
 		// proc member
2680
-		if($cnt_loop == 1)
2681
-			$this->_spammerMember($member_srl);
3012
+		if($cnt_loop == 1) {
3013
+					$this->_spammerMember($member_srl);
3014
+		}
2682 3015
 		// proc document and comment
2683
-		elseif($cnt_loop>1)
2684
-			$this->_spammerDocuments($member_srl, $isMoveToTrash);
3016
+		elseif($cnt_loop>1) {
3017
+					$this->_spammerDocuments($member_srl, $isMoveToTrash);
3018
+		}
2685 3019
 
2686 3020
 		// get destination count
2687 3021
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
@@ -2689,13 +3023,16 @@  discard block
 block discarded – undo
2689 3023
 
2690 3024
 		$total_count = Context::get('total_count');
2691 3025
 		$remain_count = $cnt_document + $cnt_comment;
2692
-		if($cnt_loop == 1) $total_count = $remain_count;
3026
+		if($cnt_loop == 1) {
3027
+			$total_count = $remain_count;
3028
+		}
2693 3029
 
2694 3030
 		// get progress percent
2695
-		if($total_count > 0)
2696
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2697
-		else
2698
-			$progress = 100;
3031
+		if($total_count > 0) {
3032
+					$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
3033
+		} else {
3034
+					$progress = 100;
3035
+		}
2699 3036
 
2700 3037
 		$this->add('total_count', $total_count);
2701 3038
 		$this->add('remain_count', $remain_count);
@@ -2737,7 +3074,10 @@  discard block
 block discarded – undo
2737 3074
 		$args->nick_name = $member_info->nick_name;
2738 3075
 		$args->denied = "Y";
2739 3076
 		$args->description = trim( $member_info->description );
2740
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
3077
+		if( $args->description != "" ) {
3078
+			$args->description .= "\n";
3079
+		}
3080
+		// add new line
2741 3081
 
2742 3082
 		$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 . "]";
2743 3083
 
@@ -2782,8 +3122,11 @@  discard block
 block discarded – undo
2782 3122
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2783 3123
 			if($documentList) {
2784 3124
 				foreach($documentList as $v) {
2785
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2786
-					else $oDocumentController->deleteDocument($v->document_srl);
3125
+					if($isMoveToTrash) {
3126
+						$oDocumentController->moveDocumentToTrash($v);
3127
+					} else {
3128
+						$oDocumentController->deleteDocument($v->document_srl);
3129
+					}
2787 3130
 				}
2788 3131
 			}
2789 3132
 		}
Please login to merge, or discard this patch.
modules/member/member.model.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -297,6 +297,7 @@
 block discarded – undo
297 297
 
298 298
 	/**
299 299
 	 * @brief Return member information with member_srl
300
+	 * @param string $member_srl
300 301
 	 */
301 302
 	function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array())
302 303
 	{
Please login to merge, or discard this patch.
Spacing   +175 added lines, -175 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	{
27 27
 		static $member_config;
28 28
 
29
-		if($member_config)
29
+		if ($member_config)
30 30
 		{
31 31
 			return $member_config;
32 32
 		}
@@ -35,42 +35,42 @@  discard block
 block discarded – undo
35 35
 		$oModuleModel = getModel('module');
36 36
 		$config = $oModuleModel->getModuleConfig('member');
37 37
 
38
-		if(!$config->signupForm || !is_array($config->signupForm))
38
+		if (!$config->signupForm || !is_array($config->signupForm))
39 39
 		{
40 40
 			$oMemberAdminController = getAdminController('member');
41 41
 			$identifier = ($config->identifier) ? $config->identifier : 'email_address';
42 42
 			$config->signupForm = $oMemberAdminController->createSignupForm($identifier);
43 43
 		}
44 44
 		//for multi language
45
-		foreach($config->signupForm AS $key=>$value)
45
+		foreach ($config->signupForm AS $key=>$value)
46 46
 		{
47 47
 			$config->signupForm[$key]->title = ($value->isDefaultForm) ? Context::getLang($value->name) : $value->title;
48
-			if($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y';
49
-			if($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N';
48
+			if ($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y';
49
+			if ($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N';
50 50
 		}
51 51
 
52 52
 		// Get terms of user
53 53
 		$config->agreement = memberModel::_getAgreement();
54 54
 
55
-		if(!$config->webmaster_name) $config->webmaster_name = 'webmaster';
56
-		if(!$config->image_name_max_width) $config->image_name_max_width = 90;
57
-		if(!$config->image_name_max_height) $config->image_name_max_height = 20;
58
-		if(!$config->image_mark_max_width) $config->image_mark_max_width = 20;
59
-		if(!$config->image_mark_max_height) $config->image_mark_max_height = 20;
60
-		if(!$config->profile_image_max_width) $config->profile_image_max_width = 90;
61
-		if(!$config->profile_image_max_height) $config->profile_image_max_height = 90;
62
-		if(!$config->skin) $config->skin = 'default';
63
-		if(!$config->colorset) $config->colorset = 'white';
64
-		if(!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor';
65
-		if(!$config->group_image_mark) $config->group_image_mark = "N";
55
+		if (!$config->webmaster_name) $config->webmaster_name = 'webmaster';
56
+		if (!$config->image_name_max_width) $config->image_name_max_width = 90;
57
+		if (!$config->image_name_max_height) $config->image_name_max_height = 20;
58
+		if (!$config->image_mark_max_width) $config->image_mark_max_width = 20;
59
+		if (!$config->image_mark_max_height) $config->image_mark_max_height = 20;
60
+		if (!$config->profile_image_max_width) $config->profile_image_max_width = 90;
61
+		if (!$config->profile_image_max_height) $config->profile_image_max_height = 90;
62
+		if (!$config->skin) $config->skin = 'default';
63
+		if (!$config->colorset) $config->colorset = 'white';
64
+		if (!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor';
65
+		if (!$config->group_image_mark) $config->group_image_mark = "N";
66 66
 
67
-		if(!$config->identifier) $config->identifier = 'user_id';
67
+		if (!$config->identifier) $config->identifier = 'user_id';
68 68
 
69
-		if(!$config->max_error_count) $config->max_error_count = 10;
70
-		if(!$config->max_error_count_time) $config->max_error_count_time = 300;
69
+		if (!$config->max_error_count) $config->max_error_count = 10;
70
+		if (!$config->max_error_count_time) $config->max_error_count_time = 300;
71 71
 
72
-		if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor';
73
-		if(!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono';
72
+		if (!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor';
73
+		if (!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono';
74 74
 
75 75
 		$member_config = $config;
76 76
 
@@ -79,24 +79,24 @@  discard block
 block discarded – undo
79 79
 
80 80
 	function _getAgreement()
81 81
 	{
82
-		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
83
-		if(is_readable($agreement_file))
82
+		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt';
83
+		if (is_readable($agreement_file))
84 84
 		{
85 85
 			return FileHandler::readFile($agreement_file);
86 86
 		}
87 87
 
88 88
 		$db_info = Context::getDBInfo();
89
-		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . $db_info->lang_type . '.txt';
90
-		if(is_readable($agreement_file))
89
+		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.$db_info->lang_type.'.txt';
90
+		if (is_readable($agreement_file))
91 91
 		{
92 92
 			return FileHandler::readFile($agreement_file);
93 93
 		}
94 94
 
95 95
 		$lang_selected = Context::loadLangSelected();
96
-		foreach($lang_selected as $key => $val)
96
+		foreach ($lang_selected as $key => $val)
97 97
 		{
98
-			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . $key . '.txt';
99
-			if(is_readable($agreement_file))
98
+			$agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.$key.'.txt';
99
+			if (is_readable($agreement_file))
100 100
 			{
101 101
 				return FileHandler::readFile($agreement_file);
102 102
 			}
@@ -116,12 +116,12 @@  discard block
 block discarded – undo
116 116
 		$logged_info = Context::get('logged_info');
117 117
 		$act = Context::get('cur_act');
118 118
 		// When click user's own nickname
119
-		if($member_srl == $logged_info->member_srl) $member_info = $logged_info;
119
+		if ($member_srl == $logged_info->member_srl) $member_info = $logged_info;
120 120
 		// When click other's nickname
121 121
 		else $member_info = $this->getMemberInfoByMemberSrl($member_srl);
122 122
 
123 123
 		$member_srl = $member_info->member_srl;
124
-		if(!$member_srl) return;
124
+		if (!$member_srl) return;
125 125
 		// List variables
126 126
 		$user_id = $member_info->user_id;
127 127
 		$user_name = $member_info->user_name;
@@ -130,18 +130,18 @@  discard block
 block discarded – undo
130 130
 
131 131
 		$oMemberController = getController('member');
132 132
 		// Display member information (Don't display to non-logged user)
133
-		if($logged_info->member_srl)
133
+		if ($logged_info->member_srl)
134 134
 		{
135
-			$url = getUrl('','mid',$mid,'act','dispMemberInfo','member_srl',$member_srl);
136
-			$oMemberController->addMemberPopupMenu($url,'cmd_view_member_info',$icon_path,'self');
135
+			$url = getUrl('', 'mid', $mid, 'act', 'dispMemberInfo', 'member_srl', $member_srl);
136
+			$oMemberController->addMemberPopupMenu($url, 'cmd_view_member_info', $icon_path, 'self');
137 137
 		}
138 138
 		// When click other's nickname
139
-		if($member_srl != $logged_info->member_srl && $logged_info->member_srl)
139
+		if ($member_srl != $logged_info->member_srl && $logged_info->member_srl)
140 140
 		{
141 141
 			// Get email config
142
-			foreach($this->module_config->signupForm as $field)
142
+			foreach ($this->module_config->signupForm as $field)
143 143
 			{
144
-				if($field->name == 'email_address')
144
+				if ($field->name == 'email_address')
145 145
 				{
146 146
 					$email_config = $field;
147 147
 					break;
@@ -149,36 +149,36 @@  discard block
 block discarded – undo
149 149
 			}
150 150
 
151 151
 			// Send an email only if email address is public
152
-			if(($logged_info->is_admin == 'Y' || $email_config->isPublic == 'Y') && $member_info->email_address)
152
+			if (($logged_info->is_admin == 'Y' || $email_config->isPublic == 'Y') && $member_info->email_address)
153 153
 			{
154 154
 				$url = 'mailto:'.htmlspecialchars($member_info->email_address, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
155
-				$oMemberController->addMemberPopupMenu($url,'cmd_send_email',$icon_path);
155
+				$oMemberController->addMemberPopupMenu($url, 'cmd_send_email', $icon_path);
156 156
 			}
157 157
 		}
158 158
 		// View homepage info
159
-		if($member_info->homepage)
159
+		if ($member_info->homepage)
160 160
 			$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'homepage', '', 'blank');
161 161
 		// View blog info
162
-		if($member_info->blog)
162
+		if ($member_info->blog)
163 163
 			$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'blog', '', 'blank');
164 164
 		// Call a trigger (after)
165 165
 		ModuleHandler::triggerCall('member.getMemberMenu', 'after', $null);
166 166
 		// Display a menu for editting member info to a top administrator
167
-		if($logged_info->is_admin == 'Y')
167
+		if ($logged_info->is_admin == 'Y')
168 168
 		{
169
-			$url = getUrl('','module','admin','act','dispMemberAdminInsert','member_srl',$member_srl);
170
-			$oMemberController->addMemberPopupMenu($url,'cmd_manage_member_info',$icon_path,'MemberModifyInfo');
169
+			$url = getUrl('', 'module', 'admin', 'act', 'dispMemberAdminInsert', 'member_srl', $member_srl);
170
+			$oMemberController->addMemberPopupMenu($url, 'cmd_manage_member_info', $icon_path, 'MemberModifyInfo');
171 171
 
172
-			$url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','member_srl','search_keyword',$member_srl);
173
-			$oMemberController->addMemberPopupMenu($url,'cmd_trace_document',$icon_path,'TraceMemberDocument');
172
+			$url = getUrl('', 'module', 'admin', 'act', 'dispDocumentAdminList', 'search_target', 'member_srl', 'search_keyword', $member_srl);
173
+			$oMemberController->addMemberPopupMenu($url, 'cmd_trace_document', $icon_path, 'TraceMemberDocument');
174 174
 
175
-			$url = getUrl('','module','admin','act','dispCommentAdminList','search_target','member_srl','search_keyword',$member_srl);
176
-			$oMemberController->addMemberPopupMenu($url,'cmd_trace_comment',$icon_path,'TraceMemberComment');
175
+			$url = getUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'member_srl', 'search_keyword', $member_srl);
176
+			$oMemberController->addMemberPopupMenu($url, 'cmd_trace_comment', $icon_path, 'TraceMemberComment');
177 177
 		}
178 178
 		// Change a language of pop-up menu
179 179
 		$menus = Context::get('member_popup_menu_list');
180 180
 		$menus_count = count($menus);
181
-		for($i=0;$i<$menus_count;$i++)
181
+		for ($i = 0; $i < $menus_count; $i++)
182 182
 		{
183 183
 			$menus[$i]->str = Context::getLang($menus[$i]->str);
184 184
 		}
@@ -190,16 +190,16 @@  discard block
 block discarded – undo
190 190
 	 * @brief Check if logged-in
191 191
 	 */
192 192
 	function isLogged() {
193
-		if($_SESSION['is_logged'])
193
+		if ($_SESSION['is_logged'])
194 194
 		{
195
-			if(Mobile::isFromMobilePhone())
195
+			if (Mobile::isFromMobilePhone())
196 196
 			{
197 197
 				return true;
198 198
 			}
199
-			elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
199
+			elseif (filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
200 200
 			{
201 201
 				// IPv6: require same /48
202
-				if(strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0)
202
+				if (strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0)
203 203
 				{
204 204
 					return true;
205 205
 				}
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 			else
208 208
 			{
209 209
 				// IPv4: require same /24
210
-				if(ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8)
210
+				if (ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8)
211 211
 				{
212 212
 					return true;
213 213
 				}
@@ -224,23 +224,23 @@  discard block
 block discarded – undo
224 224
 	function getLoggedInfo()
225 225
 	{
226 226
 		// Return session info if session info is requested and the user is logged-in
227
-		if($this->isLogged())
227
+		if ($this->isLogged())
228 228
 		{
229 229
 			$logged_info = Context::get('logged_info');
230 230
 			// Admin/Group list defined depending on site_module_info
231 231
 			$site_module_info = Context::get('site_module_info');
232
-			if($site_module_info->site_srl)
232
+			if ($site_module_info->site_srl)
233 233
 			{
234 234
 				$logged_info->group_list = $this->getMemberGroups($logged_info->member_srl, $site_module_info->site_srl);
235 235
 				// Add is_site_admin bool variable into logged_info if site_administrator is
236 236
 				$oModuleModel = getModel('module');
237
-				if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true;
237
+				if ($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true;
238 238
 				else $logged_info->is_site_admin = false;
239 239
 			}
240 240
 			else
241 241
 			{
242 242
 				// Register a default group if the site doesn't have a member group
243
-				if(count($logged_info->group_list) === 0)
243
+				if (count($logged_info->group_list) === 0)
244 244
 				{
245 245
 					$default_group = $this->getDefaultGroup(0);
246 246
 					$oMemberController = getController('member');
@@ -263,13 +263,13 @@  discard block
 block discarded – undo
263 263
 	 */
264 264
 	function getMemberInfoByUserID($user_id, $columnList = array())
265 265
 	{
266
-		if(!$user_id) return;
266
+		if (!$user_id) return;
267 267
 
268 268
 		$args = new stdClass;
269 269
 		$args->user_id = $user_id;
270 270
 		$output = executeQuery('member.getMemberInfo', $args);
271
-		if(!$output->toBool()) return $output;
272
-		if(!$output->data) return;
271
+		if (!$output->toBool()) return $output;
272
+		if (!$output->data) return;
273 273
 
274 274
 		$member_info = $this->arrangeMemberInfo($output->data);
275 275
 
@@ -281,12 +281,12 @@  discard block
 block discarded – undo
281 281
 	 */
282 282
 	function getMemberInfoByEmailAddress($email_address)
283 283
 	{
284
-		if(!$email_address) return;
284
+		if (!$email_address) return;
285 285
 
286 286
 		$args = new stdClass();
287 287
 		
288
-		$db_info = Context::getDBInfo ();
289
-		if($db_info->master_db['db_type'] == "cubrid")
288
+		$db_info = Context::getDBInfo();
289
+		if ($db_info->master_db['db_type'] == "cubrid")
290 290
 		{
291 291
 			$args->email_address = strtolower($email_address);
292 292
 			$output = executeQuery('member.getMemberInfoByEmailAddressForCubrid', $args);
@@ -297,8 +297,8 @@  discard block
 block discarded – undo
297 297
 			$output = executeQuery('member.getMemberInfoByEmailAddress', $args);
298 298
 		}
299 299
 		
300
-		if(!$output->toBool()) return $output;
301
-		if(!$output->data) return;
300
+		if (!$output->toBool()) return $output;
301
+		if (!$output->data) return;
302 302
 
303 303
 		$member_info = $this->arrangeMemberInfo($output->data);
304 304
 		return $member_info;
@@ -309,36 +309,36 @@  discard block
 block discarded – undo
309 309
 	 */
310 310
 	function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array())
311 311
 	{
312
-		if(!$member_srl) return;
312
+		if (!$member_srl) return;
313 313
 
314 314
 		//columnList size zero... get full member info
315
-		if(!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0)
315
+		if (!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0)
316 316
 		{
317 317
 			$GLOBALS['__member_info__'][$member_srl] = false;
318 318
 
319 319
 			$oCacheHandler = CacheHandler::getInstance('object');
320
-			if($oCacheHandler->isSupport())
320
+			if ($oCacheHandler->isSupport())
321 321
 			{
322 322
 				$columnList = array();
323
-				$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
323
+				$object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl;
324 324
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
325 325
 				$GLOBALS['__member_info__'][$member_srl] = $oCacheHandler->get($cache_key);
326 326
 			}
327 327
 
328
-			if($GLOBALS['__member_info__'][$member_srl] === false)
328
+			if ($GLOBALS['__member_info__'][$member_srl] === false)
329 329
 			{
330 330
 				$args = new stdClass();
331 331
 				$args->member_srl = $member_srl;
332 332
 				$output = executeQuery('member.getMemberInfoByMemberSrl', $args, $columnList);
333
-				if(!$output->data) 
333
+				if (!$output->data) 
334 334
 				{
335
-					if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass);
335
+					if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass);
336 336
 					return;
337 337
 				}
338 338
 				$this->arrangeMemberInfo($output->data, $site_srl);
339 339
 
340 340
 				//insert in cache
341
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]);
341
+				if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]);
342 342
 			}
343 343
 		}
344 344
 
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 	 */
351 351
 	function arrangeMemberInfo($info, $site_srl = 0)
352 352
 	{
353
-		if(!$GLOBALS['__member_info__'][$info->member_srl])
353
+		if (!$GLOBALS['__member_info__'][$info->member_srl])
354 354
 		{
355 355
 			$oModuleModel = getModel('module');
356 356
 			$config = $oModuleModel->getModuleConfig('member');
@@ -359,25 +359,25 @@  discard block
 block discarded – undo
359 359
 			$info->profile_image = $this->getProfileImage($info->member_srl);
360 360
 			$info->image_name = $this->getImageName($info->member_srl);
361 361
 			$info->image_mark = $this->getImageMark($info->member_srl);
362
-			if($config->group_image_mark=='Y')
362
+			if ($config->group_image_mark == 'Y')
363 363
 			{
364
-				$info->group_mark = $this->getGroupImageMark($info->member_srl,$site_srl);
364
+				$info->group_mark = $this->getGroupImageMark($info->member_srl, $site_srl);
365 365
 			}
366 366
 			$info->signature = $this->getSignature($info->member_srl);
367 367
 			$info->group_list = $this->getMemberGroups($info->member_srl, $site_srl);
368 368
 
369 369
 			$extra_vars = unserialize($info->extra_vars);
370 370
 			unset($info->extra_vars);
371
-			if($extra_vars)
371
+			if ($extra_vars)
372 372
 			{
373
-				foreach($extra_vars as $key => $val)
373
+				foreach ($extra_vars as $key => $val)
374 374
 				{
375
-					if(!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val);
376
-					if(!$info->{$key}) $info->{$key} = $val;
375
+					if (!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val);
376
+					if (!$info->{$key}) $info->{$key} = $val;
377 377
 				}
378 378
 			}
379 379
 
380
-			if(strlen($info->find_account_answer) == 32 && preg_match('/[a-zA-Z0-9]+/', $info->find_account_answer))
380
+			if (strlen($info->find_account_answer) == 32 && preg_match('/[a-zA-Z0-9]+/', $info->find_account_answer))
381 381
 			{
382 382
 				$info->find_account_answer = null;
383 383
 			}
@@ -389,13 +389,13 @@  discard block
 block discarded – undo
389 389
 			$info->homepage = strip_tags($info->homepage);
390 390
 			$info->blog = strip_tags($info->blog);
391 391
 
392
-			if($extra_vars)
392
+			if ($extra_vars)
393 393
 			{
394
-				foreach($extra_vars as $key => $val)
394
+				foreach ($extra_vars as $key => $val)
395 395
 				{
396
-					if(is_array($val))
396
+					if (is_array($val))
397 397
 					{
398
-						$oSecurity->encodeHTML($key . '.');
398
+						$oSecurity->encodeHTML($key.'.');
399 399
 					}
400 400
 					else
401 401
 					{
@@ -406,12 +406,12 @@  discard block
 block discarded – undo
406 406
 
407 407
 			// Check format.
408 408
 			$oValidator = new Validator();
409
-			if(!$oValidator->applyRule('url', $info->homepage))
409
+			if (!$oValidator->applyRule('url', $info->homepage))
410 410
 			{
411 411
 				$info->homepage = '';
412 412
 			}
413 413
 
414
-			if(!$oValidator->applyRule('url', $info->blog))
414
+			if (!$oValidator->applyRule('url', $info->blog))
415 415
 			{
416 416
 				$info->blog = '';
417 417
 			}
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 	 */
461 461
 	function getLoggedMemberSrl()
462 462
 	{
463
-		if(!$this->isLogged()) return;
463
+		if (!$this->isLogged()) return;
464 464
 		return $_SESSION['member_srl'];
465 465
 	}
466 466
 
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 	 */
470 470
 	function getLoggedUserID()
471 471
 	{
472
-		if(!$this->isLogged()) return;
472
+		if (!$this->isLogged()) return;
473 473
 		$logged_info = Context::get('logged_info');
474 474
 		return $logged_info->user_id;
475 475
 	}
@@ -484,16 +484,16 @@  discard block
 block discarded – undo
484 484
 		// cache controll
485 485
 		$group_list = false;
486 486
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
487
-		if($oCacheHandler->isSupport())
487
+		if ($oCacheHandler->isSupport())
488 488
 		{
489
-			$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_'.$site_srl;
489
+			$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl;
490 490
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
491 491
 			$group_list = $oCacheHandler->get($cache_key);
492 492
 		}
493 493
 
494
-		if(!$member_groups[$member_srl][$site_srl] || $force_reload)
494
+		if (!$member_groups[$member_srl][$site_srl] || $force_reload)
495 495
 		{
496
-			if($group_list === false)
496
+			if ($group_list === false)
497 497
 			{
498 498
 				$args = new stdClass();
499 499
 				$args->member_srl = $member_srl;
@@ -501,11 +501,11 @@  discard block
 block discarded – undo
501 501
 				$output = executeQueryArray('member.getMemberGroups', $args);
502 502
 				$group_list = $output->data;
503 503
 				//insert in cache
504
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
504
+				if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
505 505
 			}
506
-			if(!$group_list) return array();
506
+			if (!$group_list) return array();
507 507
 
508
-			foreach($group_list as $group)
508
+			foreach ($group_list as $group)
509 509
 			{
510 510
 				$result[$group->group_srl] = $group->title;
511 511
 			}
@@ -519,14 +519,14 @@  discard block
 block discarded – undo
519 519
 	 */
520 520
 	function getMembersGroups($member_srls, $site_srl = 0)
521 521
 	{
522
-		$args->member_srls = implode(',',$member_srls);
522
+		$args->member_srls = implode(',', $member_srls);
523 523
 		$args->site_srl = $site_srl;
524 524
 		$args->sort_index = 'list_order';
525 525
 		$output = executeQueryArray('member.getMembersGroups', $args);
526
-		if(!$output->data) return array();
526
+		if (!$output->data) return array();
527 527
 
528 528
 		$result = array();
529
-		foreach($output->data as $key=>$val)
529
+		foreach ($output->data as $key=>$val)
530 530
 		{
531 531
 			$result[$val->member_srl][] = $val->title;
532 532
 		}
@@ -540,21 +540,21 @@  discard block
 block discarded – undo
540 540
 	{
541 541
 		$default_group = false;
542 542
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
543
-		if($oCacheHandler->isSupport())
543
+		if ($oCacheHandler->isSupport())
544 544
 		{
545 545
 			$columnList = array();
546
-			$object_key = 'default_group_' . $site_srl;
546
+			$object_key = 'default_group_'.$site_srl;
547 547
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
548 548
 			$default_group = $oCacheHandler->get($cache_key);
549 549
 		}
550 550
 
551
-		if($default_group === false)
551
+		if ($default_group === false)
552 552
 		{
553 553
 			$args = new stdClass();
554 554
 			$args->site_srl = $site_srl;
555 555
 			$output = executeQuery('member.getDefaultGroup', $args, $columnList);
556 556
 			$default_group = $output->data;
557
-			if($oCacheHandler->isSupport())
557
+			if ($oCacheHandler->isSupport())
558 558
 			{
559 559
 				$oCacheHandler->put($cache_key, $default_group);
560 560
 			}
@@ -588,25 +588,25 @@  discard block
 block discarded – undo
588 588
 	 */
589 589
 	function getGroups($site_srl = 0)
590 590
 	{
591
-		if(!$GLOBALS['__group_info__'][$site_srl])
591
+		if (!$GLOBALS['__group_info__'][$site_srl])
592 592
 		{
593 593
 			$result = array();
594 594
 
595
-			if(!isset($site_srl))
595
+			if (!isset($site_srl))
596 596
 			{
597 597
 				$site_srl = 0;
598 598
 			}
599 599
 
600 600
 			$group_list = false;
601 601
 			$oCacheHandler = CacheHandler::getInstance('object', null, true);
602
-			if($oCacheHandler->isSupport())
602
+			if ($oCacheHandler->isSupport())
603 603
 			{
604 604
 				$object_key = 'member_groups:site_'.$site_srl;
605 605
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
606 606
 				$group_list = $oCacheHandler->get($cache_key);
607 607
 			}
608 608
 
609
-			if($group_list === false)
609
+			if ($group_list === false)
610 610
 			{
611 611
 				$args = new stdClass();
612 612
 				$args->site_srl = $site_srl;
@@ -615,16 +615,16 @@  discard block
 block discarded – undo
615 615
 				$output = executeQueryArray('member.getGroups', $args);
616 616
 				$group_list = $output->data;
617 617
 				//insert in cache
618
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
618
+				if ($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
619 619
 			}
620 620
 
621
-			if(!$group_list)
621
+			if (!$group_list)
622 622
 			{
623 623
 				return array();
624 624
 			}
625 625
 
626 626
 
627
-			foreach($group_list as $val)
627
+			foreach ($group_list as $val)
628 628
 			{
629 629
 				$result[$val->group_srl] = $val;
630 630
 			}
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 		// Set to ignore if a super administrator.
656 656
 		$logged_info = Context::get('logged_info');
657 657
 
658
-		if(!$this->join_form_list)
658
+		if (!$this->join_form_list)
659 659
 		{
660 660
 			// Argument setting to sort list_order column
661 661
 			$args = new stdClass();
@@ -663,11 +663,11 @@  discard block
 block discarded – undo
663 663
 			$output = executeQuery('member.getJoinFormList', $args);
664 664
 			// NULL if output data deosn't exist
665 665
 			$join_form_list = $output->data;
666
-			if(!$join_form_list) return NULL;
666
+			if (!$join_form_list) return NULL;
667 667
 			// Need to unserialize because serialized array is inserted into DB in case of default_value
668
-			if(!is_array($join_form_list)) $join_form_list = array($join_form_list);
668
+			if (!is_array($join_form_list)) $join_form_list = array($join_form_list);
669 669
 			$join_form_count = count($join_form_list);
670
-			for($i=0;$i<$join_form_count;$i++)
670
+			for ($i = 0; $i < $join_form_count; $i++)
671 671
 			{
672 672
 				$join_form_list[$i]->column_name = strtolower($join_form_list[$i]->column_name);
673 673
 
@@ -679,10 +679,10 @@  discard block
 block discarded – undo
679 679
 				// Add language variable
680 680
 				$lang->extend_vars[$column_name] = $column_title;
681 681
 				// unserialize if the data type if checkbox, select and so on
682
-				if(in_array($column_type, array('checkbox','select','radio')))
682
+				if (in_array($column_type, array('checkbox', 'select', 'radio')))
683 683
 				{
684 684
 					$join_form_list[$i]->default_value = unserialize($default_value);
685
-					if(!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = '';
685
+					if (!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = '';
686 686
 				}
687 687
 				else
688 688
 				{
@@ -694,16 +694,16 @@  discard block
 block discarded – undo
694 694
 			$this->join_form_list = $list;
695 695
 		}
696 696
 		// Get object style if the filter_response is true
697
-		if($filter_response && count($this->join_form_list))
697
+		if ($filter_response && count($this->join_form_list))
698 698
 		{
699
-			foreach($this->join_form_list as $key => $val)
699
+			foreach ($this->join_form_list as $key => $val)
700 700
 			{
701
-				if($val->is_active != 'Y') continue;
701
+				if ($val->is_active != 'Y') continue;
702 702
 				unset($obj);
703 703
 				$obj->type = $val->column_type;
704 704
 				$obj->name = $val->column_name;
705 705
 				$obj->lang = $val->column_title;
706
-				if($logged_info->is_admin != 'Y') $obj->required = $val->required=='Y'?true:false;
706
+				if ($logged_info->is_admin != 'Y') $obj->required = $val->required == 'Y' ? true : false;
707 707
 				else $obj->required = false;
708 708
 				$filter_output[] = $obj;
709 709
 
@@ -730,15 +730,15 @@  discard block
 block discarded – undo
730 730
 		$args->sort_index = "list_order";
731 731
 		$output = executeQueryArray('member.getJoinFormList', $args);
732 732
 
733
-		if(!$output->toBool())
733
+		if (!$output->toBool())
734 734
 		{
735 735
 			return array();
736 736
 		}
737 737
 
738 738
 		$joinFormList = array();
739
-		foreach($output->data as $val)
739
+		foreach ($output->data as $val)
740 740
 		{
741
-			if($val->is_active != 'Y')
741
+			if ($val->is_active != 'Y')
742 742
 			{
743 743
 				continue;
744 744
 			}
@@ -755,20 +755,20 @@  discard block
 block discarded – undo
755 755
 	function getCombineJoinForm($member_info)
756 756
 	{
757 757
 		$extend_form_list = $this->getJoinFormlist();
758
-		if(!$extend_form_list) return;
758
+		if (!$extend_form_list) return;
759 759
 		// Member info is open only to an administrator and him/herself when is_private is true.
760 760
 		$logged_info = Context::get('logged_info');
761 761
 
762
-		foreach($extend_form_list as $srl => $item)
762
+		foreach ($extend_form_list as $srl => $item)
763 763
 		{
764 764
 			$column_name = $item->column_name;
765 765
 			$value = $member_info->{$column_name};
766 766
 
767 767
 			// Change values depening on the type of extend form
768
-			switch($item->column_type)
768
+			switch ($item->column_type)
769 769
 			{
770 770
 				case 'checkbox' :
771
-					if($value && !is_array($value)) $value = array($value);
771
+					if ($value && !is_array($value)) $value = array($value);
772 772
 					break;
773 773
 				case 'text' :
774 774
 				case 'homepage' :
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
 
783 783
 			$extend_form_list[$srl]->value = $value;
784 784
 
785
-			if($member_info->{'open_'.$column_name}=='Y') $extend_form_list[$srl]->is_opened = true;
785
+			if ($member_info->{'open_'.$column_name} == 'Y') $extend_form_list[$srl]->is_opened = true;
786 786
 			else $extend_form_list[$srl]->is_opened = false;
787 787
 		}
788 788
 		return $extend_form_list;
@@ -796,12 +796,12 @@  discard block
 block discarded – undo
796 796
 		$args->member_join_form_srl = $member_join_form_srl;
797 797
 		$output = executeQuery('member.getJoinForm', $args);
798 798
 		$join_form = $output->data;
799
-		if(!$join_form) return NULL;
799
+		if (!$join_form) return NULL;
800 800
 
801 801
 		$column_type = $join_form->column_type;
802 802
 		$default_value = $join_form->default_value;
803 803
 
804
-		if(in_array($column_type, array('checkbox','select','radio')))
804
+		if (in_array($column_type, array('checkbox', 'select', 'radio')))
805 805
 		{
806 806
 			$join_form->default_value = unserialize($default_value);
807 807
 		}
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
 	 */
819 819
 	function getDeniedIDList()
820 820
 	{
821
-		if(!$this->denied_id_list)
821
+		if (!$this->denied_id_list)
822 822
 		{
823 823
 			$args->sort_index = "list_order";
824 824
 			$args->page = Context::get('page');
@@ -834,14 +834,14 @@  discard block
 block discarded – undo
834 834
 	function getDeniedIDs()
835 835
 	{
836 836
 		$output = executeQueryArray('member.getDeniedIDs');
837
-		if(!$output->toBool()) return array();
837
+		if (!$output->toBool()) return array();
838 838
 		return $output->data;
839 839
 	}
840 840
 
841 841
 	function getDeniedNickNames()
842 842
 	{
843 843
 		$output = executeQueryArray('member.getDeniedNickNames');
844
-		if(!$output->toBool())
844
+		if (!$output->toBool())
845 845
 		{
846 846
 			return array();
847 847
 		}
@@ -857,7 +857,7 @@  discard block
 block discarded – undo
857 857
 		$args = new stdClass();
858 858
 		$args->user_id = $user_id;
859 859
 		$output = executeQuery('member.chkDeniedID', $args);
860
-		if($output->data->count) return true;
860
+		if ($output->data->count) return true;
861 861
 		return false;
862 862
 	}
863 863
 
@@ -869,8 +869,8 @@  discard block
 block discarded – undo
869 869
 		$args = new stdClass();
870 870
 		$args->nick_name = $nickName;
871 871
 		$output = executeQuery('member.chkDeniedNickName', $args);
872
-		if($output->data->count) return true;
873
-		if(!$output->toBool())
872
+		if ($output->data->count) return true;
873
+		if (!$output->toBool())
874 874
 		{
875 875
 			return true;
876 876
 		}
@@ -881,20 +881,20 @@  discard block
 block discarded – undo
881 881
 	 */
882 882
 	function getProfileImage($member_srl)
883 883
 	{
884
-		if(!isset($GLOBALS['__member_info__']['profile_image'][$member_srl]))
884
+		if (!isset($GLOBALS['__member_info__']['profile_image'][$member_srl]))
885 885
 		{
886 886
 			$GLOBALS['__member_info__']['profile_image'][$member_srl] = null;
887
-			$exts = array('gif','jpg','png');
888
-			for($i=0;$i<3;$i++)
887
+			$exts = array('gif', 'jpg', 'png');
888
+			for ($i = 0; $i < 3; $i++)
889 889
 			{
890 890
 				$image_name_file = sprintf('files/member_extra_info/profile_image/%s%d.%s', getNumberingPath($member_srl), $member_srl, $exts[$i]);
891
-				if(file_exists($image_name_file))
891
+				if (file_exists($image_name_file))
892 892
 				{
893 893
 					list($width, $height, $type, $attrs) = getimagesize($image_name_file);
894 894
 					$info = new stdClass();
895 895
 					$info->width = $width;
896 896
 					$info->height = $height;
897
-					$info->src = Context::getRequestUri().$image_name_file . '?' . date('YmdHis', filemtime($image_name_file));
897
+					$info->src = Context::getRequestUri().$image_name_file.'?'.date('YmdHis', filemtime($image_name_file));
898 898
 					$info->file = './'.$image_name_file;
899 899
 					$GLOBALS['__member_info__']['profile_image'][$member_srl] = $info;
900 900
 					break;
@@ -910,16 +910,16 @@  discard block
 block discarded – undo
910 910
 	 */
911 911
 	function getImageName($member_srl)
912 912
 	{
913
-		if(!isset($GLOBALS['__member_info__']['image_name'][$member_srl]))
913
+		if (!isset($GLOBALS['__member_info__']['image_name'][$member_srl]))
914 914
 		{
915 915
 			$image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl);
916
-			if(file_exists($image_name_file))
916
+			if (file_exists($image_name_file))
917 917
 			{
918 918
 				list($width, $height, $type, $attrs) = getimagesize($image_name_file);
919 919
 				$info = new stdClass;
920 920
 				$info->width = $width;
921 921
 				$info->height = $height;
922
-				$info->src = Context::getRequestUri().$image_name_file. '?' . date('YmdHis', filemtime($image_name_file));
922
+				$info->src = Context::getRequestUri().$image_name_file.'?'.date('YmdHis', filemtime($image_name_file));
923 923
 				$info->file = './'.$image_name_file;
924 924
 				$GLOBALS['__member_info__']['image_name'][$member_srl] = $info;
925 925
 			}
@@ -933,15 +933,15 @@  discard block
 block discarded – undo
933 933
 	 */
934 934
 	function getImageMark($member_srl)
935 935
 	{
936
-		if(!isset($GLOBALS['__member_info__']['image_mark'][$member_srl]))
936
+		if (!isset($GLOBALS['__member_info__']['image_mark'][$member_srl]))
937 937
 		{
938 938
 			$image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl);
939
-			if(file_exists($image_mark_file))
939
+			if (file_exists($image_mark_file))
940 940
 			{
941 941
 				list($width, $height, $type, $attrs) = getimagesize($image_mark_file);
942 942
 				$info->width = $width;
943 943
 				$info->height = $height;
944
-				$info->src = Context::getRequestUri().$image_mark_file . '?' . date('YmdHis', filemtime($image_mark_file));
944
+				$info->src = Context::getRequestUri().$image_mark_file.'?'.date('YmdHis', filemtime($image_mark_file));
945 945
 				$info->file = './'.$image_mark_file;
946 946
 				$GLOBALS['__member_info__']['image_mark'][$member_srl] = $info;
947 947
 			}
@@ -955,27 +955,27 @@  discard block
 block discarded – undo
955 955
 	/**
956 956
 	 * @brief Get the image mark of the group
957 957
 	 */
958
-	function getGroupImageMark($member_srl,$site_srl=0)
958
+	function getGroupImageMark($member_srl, $site_srl = 0)
959 959
 	{
960
-		if(!isset($GLOBALS['__member_info__']['group_image_mark'][$member_srl]))
960
+		if (!isset($GLOBALS['__member_info__']['group_image_mark'][$member_srl]))
961 961
 		{
962 962
 			$oModuleModel = getModel('module');
963 963
 			$config = $oModuleModel->getModuleConfig('member');
964
-			if($config->group_image_mark!='Y')
964
+			if ($config->group_image_mark != 'Y')
965 965
 			{
966 966
 				return null;
967 967
 			}
968
-			$member_group = $this->getMemberGroups($member_srl,$site_srl);
968
+			$member_group = $this->getMemberGroups($member_srl, $site_srl);
969 969
 			$groups_info = $this->getGroups($site_srl);
970
-			if(count($member_group) > 0 && is_array($member_group))
970
+			if (count($member_group) > 0 && is_array($member_group))
971 971
 			{
972 972
 				$memberGroups = array_keys($member_group);
973 973
 
974
-				foreach($groups_info as $group_srl=>$group_info)
974
+				foreach ($groups_info as $group_srl=>$group_info)
975 975
 				{
976
-					if(in_array($group_srl, $memberGroups))
976
+					if (in_array($group_srl, $memberGroups))
977 977
 					{
978
-						if($group_info->image_mark)
978
+						if ($group_info->image_mark)
979 979
 						{
980 980
 							$info = new stdClass();
981 981
 							$info->title = $group_info->title;
@@ -999,10 +999,10 @@  discard block
 block discarded – undo
999 999
 	 */
1000 1000
 	function getSignature($member_srl)
1001 1001
 	{
1002
-		if(!isset($GLOBALS['__member_info__']['signature'][$member_srl]))
1002
+		if (!isset($GLOBALS['__member_info__']['signature'][$member_srl]))
1003 1003
 		{
1004 1004
 			$filename = sprintf('files/member_extra_info/signature/%s%d.signature.php', getNumberingPath($member_srl), $member_srl);
1005
-			if(file_exists($filename))
1005
+			if (file_exists($filename))
1006 1006
 			{
1007 1007
 				$buff = FileHandler::readFile($filename);
1008 1008
 				$signature = preg_replace('/<\?.*?\?>/', '', $buff);
@@ -1020,10 +1020,10 @@  discard block
 block discarded – undo
1020 1020
 	 * @param int $member_srl Set this to member_srl when comparing a member's password (optional)
1021 1021
 	 * @return bool
1022 1022
 	 */
1023
-	function isValidPassword($hashed_password, $password_text, $member_srl=null)
1023
+	function isValidPassword($hashed_password, $password_text, $member_srl = null)
1024 1024
 	{
1025 1025
 		// False if no password in entered
1026
-		if(!$password_text)
1026
+		if (!$password_text)
1027 1027
 		{
1028 1028
 			return false;
1029 1029
 		}
@@ -1032,31 +1032,31 @@  discard block
 block discarded – undo
1032 1032
 		$oPassword = new Password();
1033 1033
 		$current_algorithm = $oPassword->checkAlgorithm($hashed_password);
1034 1034
 		$match = $oPassword->checkPassword($password_text, $hashed_password, $current_algorithm);
1035
-		if(!$match)
1035
+		if (!$match)
1036 1036
 		{
1037 1037
 			return false;
1038 1038
 		}
1039 1039
 		
1040 1040
 		// Update the encryption method if necessary
1041 1041
 		$config = $this->getMemberConfig();
1042
-		if($member_srl > 0 && $config->password_hashing_auto_upgrade != 'N')
1042
+		if ($member_srl > 0 && $config->password_hashing_auto_upgrade != 'N')
1043 1043
 		{
1044 1044
 			$need_upgrade = false;
1045 1045
 			
1046
-			if(!$need_upgrade)
1046
+			if (!$need_upgrade)
1047 1047
 			{
1048 1048
 				$required_algorithm = $oPassword->getCurrentlySelectedAlgorithm();
1049
-				if($required_algorithm !== $current_algorithm) $need_upgrade = true;
1049
+				if ($required_algorithm !== $current_algorithm) $need_upgrade = true;
1050 1050
 			}
1051 1051
 			
1052
-			if(!$need_upgrade)
1052
+			if (!$need_upgrade)
1053 1053
 			{
1054 1054
 				$required_work_factor = $oPassword->getWorkFactor();
1055 1055
 				$current_work_factor = $oPassword->checkWorkFactor($hashed_password);
1056
-				if($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true;
1056
+				if ($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true;
1057 1057
 			}
1058 1058
 			
1059
-			if($need_upgrade === true)
1059
+			if ($need_upgrade === true)
1060 1060
 			{
1061 1061
 				$args = new stdClass();
1062 1062
 				$args->member_srl = $member_srl;
@@ -1084,27 +1084,27 @@  discard block
 block discarded – undo
1084 1084
 	function checkPasswordStrength($password, $strength)
1085 1085
 	{
1086 1086
 		$logged_info = Context::get('logged_info');
1087
-		if($logged_info->is_admin == 'Y') return true;
1087
+		if ($logged_info->is_admin == 'Y') return true;
1088 1088
 		
1089
-		if($strength == NULL)
1089
+		if ($strength == NULL)
1090 1090
 		{
1091 1091
 			$config = $this->getMemberConfig();
1092
-			$strength = $config->password_strength?$config->password_strength:'normal';
1092
+			$strength = $config->password_strength ? $config->password_strength : 'normal';
1093 1093
 		}
1094 1094
 		
1095 1095
 		$length = strlen($password);
1096 1096
 		
1097 1097
 		switch ($strength) {
1098 1098
 			case 'high':
1099
-				if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false;
1099
+				if ($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false;
1100 1100
 				/* no break */
1101 1101
 				
1102 1102
 			case 'normal':
1103
-				if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false;
1103
+				if ($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false;
1104 1104
 				break;
1105 1105
 				
1106 1106
 			case 'low':
1107
-				if($length < 4) return false;
1107
+				if ($length < 4) return false;
1108 1108
 				break; 
1109 1109
 		}
1110 1110
 		
@@ -1115,11 +1115,11 @@  discard block
 block discarded – undo
1115 1115
 	{
1116 1116
 		$groupSrl = 0;
1117 1117
 		$output = $this->getGroups($site_srl);
1118
-		if(is_array($output))
1118
+		if (is_array($output))
1119 1119
 		{
1120
-			foreach($output AS $key=>$value)
1120
+			foreach ($output AS $key=>$value)
1121 1121
 			{
1122
-				if($value->is_admin == 'Y')
1122
+				if ($value->is_admin == 'Y')
1123 1123
 				{
1124 1124
 					$groupSrl = $value->group_srl;
1125 1125
 					break;
Please login to merge, or discard this patch.
Braces   +202 added lines, -83 removed lines patch added patch discarded remove patch
@@ -45,32 +45,68 @@  discard block
 block discarded – undo
45 45
 		foreach($config->signupForm AS $key=>$value)
46 46
 		{
47 47
 			$config->signupForm[$key]->title = ($value->isDefaultForm) ? Context::getLang($value->name) : $value->title;
48
-			if($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y';
49
-			if($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N';
48
+			if($config->signupForm[$key]->isPublic != 'N') {
49
+				$config->signupForm[$key]->isPublic = 'Y';
50
+			}
51
+			if($value->name == 'find_account_question') {
52
+				$config->signupForm[$key]->isPublic = 'N';
53
+			}
50 54
 		}
51 55
 
52 56
 		// Get terms of user
53 57
 		$config->agreement = memberModel::_getAgreement();
54 58
 
55
-		if(!$config->webmaster_name) $config->webmaster_name = 'webmaster';
56
-		if(!$config->image_name_max_width) $config->image_name_max_width = 90;
57
-		if(!$config->image_name_max_height) $config->image_name_max_height = 20;
58
-		if(!$config->image_mark_max_width) $config->image_mark_max_width = 20;
59
-		if(!$config->image_mark_max_height) $config->image_mark_max_height = 20;
60
-		if(!$config->profile_image_max_width) $config->profile_image_max_width = 90;
61
-		if(!$config->profile_image_max_height) $config->profile_image_max_height = 90;
62
-		if(!$config->skin) $config->skin = 'default';
63
-		if(!$config->colorset) $config->colorset = 'white';
64
-		if(!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = 'ckeditor';
65
-		if(!$config->group_image_mark) $config->group_image_mark = "N";
59
+		if(!$config->webmaster_name) {
60
+			$config->webmaster_name = 'webmaster';
61
+		}
62
+		if(!$config->image_name_max_width) {
63
+			$config->image_name_max_width = 90;
64
+		}
65
+		if(!$config->image_name_max_height) {
66
+			$config->image_name_max_height = 20;
67
+		}
68
+		if(!$config->image_mark_max_width) {
69
+			$config->image_mark_max_width = 20;
70
+		}
71
+		if(!$config->image_mark_max_height) {
72
+			$config->image_mark_max_height = 20;
73
+		}
74
+		if(!$config->profile_image_max_width) {
75
+			$config->profile_image_max_width = 90;
76
+		}
77
+		if(!$config->profile_image_max_height) {
78
+			$config->profile_image_max_height = 90;
79
+		}
80
+		if(!$config->skin) {
81
+			$config->skin = 'default';
82
+		}
83
+		if(!$config->colorset) {
84
+			$config->colorset = 'white';
85
+		}
86
+		if(!$config->editor_skin || $config->editor_skin == 'default') {
87
+			$config->editor_skin = 'ckeditor';
88
+		}
89
+		if(!$config->group_image_mark) {
90
+			$config->group_image_mark = "N";
91
+		}
66 92
 
67
-		if(!$config->identifier) $config->identifier = 'user_id';
93
+		if(!$config->identifier) {
94
+			$config->identifier = 'user_id';
95
+		}
68 96
 
69
-		if(!$config->max_error_count) $config->max_error_count = 10;
70
-		if(!$config->max_error_count_time) $config->max_error_count_time = 300;
97
+		if(!$config->max_error_count) {
98
+			$config->max_error_count = 10;
99
+		}
100
+		if(!$config->max_error_count_time) {
101
+			$config->max_error_count_time = 300;
102
+		}
71 103
 
72
-		if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') $config->signature_editor_skin = 'ckeditor';
73
-		if(!$config->sel_editor_colorset) $config->sel_editor_colorset = 'moono';
104
+		if(!$config->signature_editor_skin || $config->signature_editor_skin == 'default') {
105
+			$config->signature_editor_skin = 'ckeditor';
106
+		}
107
+		if(!$config->sel_editor_colorset) {
108
+			$config->sel_editor_colorset = 'moono';
109
+		}
74 110
 
75 111
 		$member_config = $config;
76 112
 
@@ -116,12 +152,18 @@  discard block
 block discarded – undo
116 152
 		$logged_info = Context::get('logged_info');
117 153
 		$act = Context::get('cur_act');
118 154
 		// When click user's own nickname
119
-		if($member_srl == $logged_info->member_srl) $member_info = $logged_info;
155
+		if($member_srl == $logged_info->member_srl) {
156
+			$member_info = $logged_info;
157
+		}
120 158
 		// When click other's nickname
121
-		else $member_info = $this->getMemberInfoByMemberSrl($member_srl);
159
+		else {
160
+			$member_info = $this->getMemberInfoByMemberSrl($member_srl);
161
+		}
122 162
 
123 163
 		$member_srl = $member_info->member_srl;
124
-		if(!$member_srl) return;
164
+		if(!$member_srl) {
165
+			return;
166
+		}
125 167
 		// List variables
126 168
 		$user_id = $member_info->user_id;
127 169
 		$user_name = $member_info->user_name;
@@ -156,11 +198,13 @@  discard block
 block discarded – undo
156 198
 			}
157 199
 		}
158 200
 		// View homepage info
159
-		if($member_info->homepage)
160
-			$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'homepage', '', 'blank');
201
+		if($member_info->homepage) {
202
+					$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'homepage', '', 'blank');
203
+		}
161 204
 		// View blog info
162
-		if($member_info->blog)
163
-			$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'blog', '', 'blank');
205
+		if($member_info->blog) {
206
+					$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), 'blog', '', 'blank');
207
+		}
164 208
 		// Call a trigger (after)
165 209
 		ModuleHandler::triggerCall('member.getMemberMenu', 'after', $null);
166 210
 		// Display a menu for editting member info to a top administrator
@@ -195,16 +239,14 @@  discard block
 block discarded – undo
195 239
 			if(Mobile::isFromMobilePhone())
196 240
 			{
197 241
 				return true;
198
-			}
199
-			elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
242
+			} elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
200 243
 			{
201 244
 				// IPv6: require same /48
202 245
 				if(strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0)
203 246
 				{
204 247
 					return true;
205 248
 				}
206
-			}
207
-			else
249
+			} else
208 250
 			{
209 251
 				// IPv4: require same /24
210 252
 				if(ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8)
@@ -234,10 +276,12 @@  discard block
 block discarded – undo
234 276
 				$logged_info->group_list = $this->getMemberGroups($logged_info->member_srl, $site_module_info->site_srl);
235 277
 				// Add is_site_admin bool variable into logged_info if site_administrator is
236 278
 				$oModuleModel = getModel('module');
237
-				if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true;
238
-				else $logged_info->is_site_admin = false;
239
-			}
240
-			else
279
+				if($oModuleModel->isSiteAdmin($logged_info)) {
280
+					$logged_info->is_site_admin = true;
281
+				} else {
282
+					$logged_info->is_site_admin = false;
283
+				}
284
+			} else
241 285
 			{
242 286
 				// Register a default group if the site doesn't have a member group
243 287
 				if(count($logged_info->group_list) === 0)
@@ -263,13 +307,19 @@  discard block
 block discarded – undo
263 307
 	 */
264 308
 	function getMemberInfoByUserID($user_id, $columnList = array())
265 309
 	{
266
-		if(!$user_id) return;
310
+		if(!$user_id) {
311
+			return;
312
+		}
267 313
 
268 314
 		$args = new stdClass;
269 315
 		$args->user_id = $user_id;
270 316
 		$output = executeQuery('member.getMemberInfo', $args);
271
-		if(!$output->toBool()) return $output;
272
-		if(!$output->data) return;
317
+		if(!$output->toBool()) {
318
+			return $output;
319
+		}
320
+		if(!$output->data) {
321
+			return;
322
+		}
273 323
 
274 324
 		$member_info = $this->arrangeMemberInfo($output->data);
275 325
 
@@ -281,7 +331,9 @@  discard block
 block discarded – undo
281 331
 	 */
282 332
 	function getMemberInfoByEmailAddress($email_address)
283 333
 	{
284
-		if(!$email_address) return;
334
+		if(!$email_address) {
335
+			return;
336
+		}
285 337
 
286 338
 		$args = new stdClass();
287 339
 		
@@ -290,15 +342,18 @@  discard block
 block discarded – undo
290 342
 		{
291 343
 			$args->email_address = strtolower($email_address);
292 344
 			$output = executeQuery('member.getMemberInfoByEmailAddressForCubrid', $args);
293
-		}
294
-		else
345
+		} else
295 346
 		{
296 347
 			$args->email_address = $email_address;
297 348
 			$output = executeQuery('member.getMemberInfoByEmailAddress', $args);
298 349
 		}
299 350
 		
300
-		if(!$output->toBool()) return $output;
301
-		if(!$output->data) return;
351
+		if(!$output->toBool()) {
352
+			return $output;
353
+		}
354
+		if(!$output->data) {
355
+			return;
356
+		}
302 357
 
303 358
 		$member_info = $this->arrangeMemberInfo($output->data);
304 359
 		return $member_info;
@@ -309,7 +364,9 @@  discard block
 block discarded – undo
309 364
 	 */
310 365
 	function getMemberInfoByMemberSrl($member_srl, $site_srl = 0, $columnList = array())
311 366
 	{
312
-		if(!$member_srl) return;
367
+		if(!$member_srl) {
368
+			return;
369
+		}
313 370
 
314 371
 		//columnList size zero... get full member info
315 372
 		if(!$GLOBALS['__member_info__'][$member_srl] || count($columnList) == 0)
@@ -332,13 +389,17 @@  discard block
 block discarded – undo
332 389
 				$output = executeQuery('member.getMemberInfoByMemberSrl', $args, $columnList);
333 390
 				if(!$output->data) 
334 391
 				{
335
-					if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass);
392
+					if($oCacheHandler->isSupport()) {
393
+						$oCacheHandler->put($cache_key, new stdClass);
394
+					}
336 395
 					return;
337 396
 				}
338 397
 				$this->arrangeMemberInfo($output->data, $site_srl);
339 398
 
340 399
 				//insert in cache
341
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]);
400
+				if($oCacheHandler->isSupport()) {
401
+					$oCacheHandler->put($cache_key, $GLOBALS['__member_info__'][$member_srl]);
402
+				}
342 403
 			}
343 404
 		}
344 405
 
@@ -372,8 +433,12 @@  discard block
 block discarded – undo
372 433
 			{
373 434
 				foreach($extra_vars as $key => $val)
374 435
 				{
375
-					if(!is_array($val) && strpos($val, '|@|') !== FALSE) $val = explode('|@|', $val);
376
-					if(!$info->{$key}) $info->{$key} = $val;
436
+					if(!is_array($val) && strpos($val, '|@|') !== FALSE) {
437
+						$val = explode('|@|', $val);
438
+					}
439
+					if(!$info->{$key}) {
440
+						$info->{$key} = $val;
441
+					}
377 442
 				}
378 443
 			}
379 444
 
@@ -396,8 +461,7 @@  discard block
 block discarded – undo
396 461
 					if(is_array($val))
397 462
 					{
398 463
 						$oSecurity->encodeHTML($key . '.');
399
-					}
400
-					else
464
+					} else
401 465
 					{
402 466
 						$oSecurity->encodeHTML($key);
403 467
 					}
@@ -460,7 +524,9 @@  discard block
 block discarded – undo
460 524
 	 */
461 525
 	function getLoggedMemberSrl()
462 526
 	{
463
-		if(!$this->isLogged()) return;
527
+		if(!$this->isLogged()) {
528
+			return;
529
+		}
464 530
 		return $_SESSION['member_srl'];
465 531
 	}
466 532
 
@@ -469,7 +535,9 @@  discard block
 block discarded – undo
469 535
 	 */
470 536
 	function getLoggedUserID()
471 537
 	{
472
-		if(!$this->isLogged()) return;
538
+		if(!$this->isLogged()) {
539
+			return;
540
+		}
473 541
 		$logged_info = Context::get('logged_info');
474 542
 		return $logged_info->user_id;
475 543
 	}
@@ -501,9 +569,13 @@  discard block
 block discarded – undo
501 569
 				$output = executeQueryArray('member.getMemberGroups', $args);
502 570
 				$group_list = $output->data;
503 571
 				//insert in cache
504
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
572
+				if($oCacheHandler->isSupport()) {
573
+					$oCacheHandler->put($cache_key, $group_list);
574
+				}
575
+			}
576
+			if(!$group_list) {
577
+				return array();
505 578
 			}
506
-			if(!$group_list) return array();
507 579
 
508 580
 			foreach($group_list as $group)
509 581
 			{
@@ -523,7 +595,9 @@  discard block
 block discarded – undo
523 595
 		$args->site_srl = $site_srl;
524 596
 		$args->sort_index = 'list_order';
525 597
 		$output = executeQueryArray('member.getMembersGroups', $args);
526
-		if(!$output->data) return array();
598
+		if(!$output->data) {
599
+			return array();
600
+		}
527 601
 
528 602
 		$result = array();
529 603
 		foreach($output->data as $key=>$val)
@@ -615,7 +689,9 @@  discard block
 block discarded – undo
615 689
 				$output = executeQueryArray('member.getGroups', $args);
616 690
 				$group_list = $output->data;
617 691
 				//insert in cache
618
-				if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
692
+				if($oCacheHandler->isSupport()) {
693
+					$oCacheHandler->put($cache_key, $group_list);
694
+				}
619 695
 			}
620 696
 
621 697
 			if(!$group_list)
@@ -663,9 +739,13 @@  discard block
 block discarded – undo
663 739
 			$output = executeQuery('member.getJoinFormList', $args);
664 740
 			// NULL if output data deosn't exist
665 741
 			$join_form_list = $output->data;
666
-			if(!$join_form_list) return NULL;
742
+			if(!$join_form_list) {
743
+				return NULL;
744
+			}
667 745
 			// Need to unserialize because serialized array is inserted into DB in case of default_value
668
-			if(!is_array($join_form_list)) $join_form_list = array($join_form_list);
746
+			if(!is_array($join_form_list)) {
747
+				$join_form_list = array($join_form_list);
748
+			}
669 749
 			$join_form_count = count($join_form_list);
670 750
 			for($i=0;$i<$join_form_count;$i++)
671 751
 			{
@@ -682,9 +762,10 @@  discard block
 block discarded – undo
682 762
 				if(in_array($column_type, array('checkbox','select','radio')))
683 763
 				{
684 764
 					$join_form_list[$i]->default_value = unserialize($default_value);
685
-					if(!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = '';
686
-				}
687
-				else
765
+					if(!$join_form_list[$i]->default_value[0]) {
766
+						$join_form_list[$i]->default_value = '';
767
+					}
768
+				} else
688 769
 				{
689 770
 					$join_form_list[$i]->default_value = '';
690 771
 				}
@@ -698,13 +779,18 @@  discard block
 block discarded – undo
698 779
 		{
699 780
 			foreach($this->join_form_list as $key => $val)
700 781
 			{
701
-				if($val->is_active != 'Y') continue;
782
+				if($val->is_active != 'Y') {
783
+					continue;
784
+				}
702 785
 				unset($obj);
703 786
 				$obj->type = $val->column_type;
704 787
 				$obj->name = $val->column_name;
705 788
 				$obj->lang = $val->column_title;
706
-				if($logged_info->is_admin != 'Y') $obj->required = $val->required=='Y'?true:false;
707
-				else $obj->required = false;
789
+				if($logged_info->is_admin != 'Y') {
790
+					$obj->required = $val->required=='Y'?true:false;
791
+				} else {
792
+					$obj->required = false;
793
+				}
708 794
 				$filter_output[] = $obj;
709 795
 
710 796
 				unset($open_obj);
@@ -755,7 +841,9 @@  discard block
 block discarded – undo
755 841
 	function getCombineJoinForm($member_info)
756 842
 	{
757 843
 		$extend_form_list = $this->getJoinFormlist();
758
-		if(!$extend_form_list) return;
844
+		if(!$extend_form_list) {
845
+			return;
846
+		}
759 847
 		// Member info is open only to an administrator and him/herself when is_private is true.
760 848
 		$logged_info = Context::get('logged_info');
761 849
 
@@ -768,7 +856,9 @@  discard block
 block discarded – undo
768 856
 			switch($item->column_type)
769 857
 			{
770 858
 				case 'checkbox' :
771
-					if($value && !is_array($value)) $value = array($value);
859
+					if($value && !is_array($value)) {
860
+						$value = array($value);
861
+					}
772 862
 					break;
773 863
 				case 'text' :
774 864
 				case 'homepage' :
@@ -782,8 +872,11 @@  discard block
 block discarded – undo
782 872
 
783 873
 			$extend_form_list[$srl]->value = $value;
784 874
 
785
-			if($member_info->{'open_'.$column_name}=='Y') $extend_form_list[$srl]->is_opened = true;
786
-			else $extend_form_list[$srl]->is_opened = false;
875
+			if($member_info->{'open_'.$column_name}=='Y') {
876
+				$extend_form_list[$srl]->is_opened = true;
877
+			} else {
878
+				$extend_form_list[$srl]->is_opened = false;
879
+			}
787 880
 		}
788 881
 		return $extend_form_list;
789 882
 	}
@@ -796,7 +889,9 @@  discard block
 block discarded – undo
796 889
 		$args->member_join_form_srl = $member_join_form_srl;
797 890
 		$output = executeQuery('member.getJoinForm', $args);
798 891
 		$join_form = $output->data;
799
-		if(!$join_form) return NULL;
892
+		if(!$join_form) {
893
+			return NULL;
894
+		}
800 895
 
801 896
 		$column_type = $join_form->column_type;
802 897
 		$default_value = $join_form->default_value;
@@ -804,8 +899,7 @@  discard block
 block discarded – undo
804 899
 		if(in_array($column_type, array('checkbox','select','radio')))
805 900
 		{
806 901
 			$join_form->default_value = unserialize($default_value);
807
-		}
808
-		else
902
+		} else
809 903
 		{
810 904
 			$join_form->default_value = '';
811 905
 		}
@@ -834,7 +928,9 @@  discard block
 block discarded – undo
834 928
 	function getDeniedIDs()
835 929
 	{
836 930
 		$output = executeQueryArray('member.getDeniedIDs');
837
-		if(!$output->toBool()) return array();
931
+		if(!$output->toBool()) {
932
+			return array();
933
+		}
838 934
 		return $output->data;
839 935
 	}
840 936
 
@@ -857,7 +953,9 @@  discard block
 block discarded – undo
857 953
 		$args = new stdClass();
858 954
 		$args->user_id = $user_id;
859 955
 		$output = executeQuery('member.chkDeniedID', $args);
860
-		if($output->data->count) return true;
956
+		if($output->data->count) {
957
+			return true;
958
+		}
861 959
 		return false;
862 960
 	}
863 961
 
@@ -869,7 +967,9 @@  discard block
 block discarded – undo
869 967
 		$args = new stdClass();
870 968
 		$args->nick_name = $nickName;
871 969
 		$output = executeQuery('member.chkDeniedNickName', $args);
872
-		if($output->data->count) return true;
970
+		if($output->data->count) {
971
+			return true;
972
+		}
873 973
 		if(!$output->toBool())
874 974
 		{
875 975
 			return true;
@@ -922,8 +1022,9 @@  discard block
 block discarded – undo
922 1022
 				$info->src = Context::getRequestUri().$image_name_file. '?' . date('YmdHis', filemtime($image_name_file));
923 1023
 				$info->file = './'.$image_name_file;
924 1024
 				$GLOBALS['__member_info__']['image_name'][$member_srl] = $info;
1025
+			} else {
1026
+				$GLOBALS['__member_info__']['image_name'][$member_srl] = null;
925 1027
 			}
926
-			else $GLOBALS['__member_info__']['image_name'][$member_srl] = null;
927 1028
 		}
928 1029
 		return $GLOBALS['__member_info__']['image_name'][$member_srl];
929 1030
 	}
@@ -944,8 +1045,9 @@  discard block
 block discarded – undo
944 1045
 				$info->src = Context::getRequestUri().$image_mark_file . '?' . date('YmdHis', filemtime($image_mark_file));
945 1046
 				$info->file = './'.$image_mark_file;
946 1047
 				$GLOBALS['__member_info__']['image_mark'][$member_srl] = $info;
1048
+			} else {
1049
+				$GLOBALS['__member_info__']['image_mark'][$member_srl] = null;
947 1050
 			}
948
-			else $GLOBALS['__member_info__']['image_mark'][$member_srl] = null;
949 1051
 		}
950 1052
 
951 1053
 		return $GLOBALS['__member_info__']['image_mark'][$member_srl];
@@ -987,9 +1089,13 @@  discard block
 block discarded – undo
987 1089
 					}
988 1090
 				}
989 1091
 			}
990
-			if (!$info) $GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N';
1092
+			if (!$info) {
1093
+				$GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N';
1094
+			}
1095
+		}
1096
+		if ($GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N') {
1097
+			return null;
991 1098
 		}
992
-		if ($GLOBALS['__member_info__']['group_image_mark'][$member_srl] == 'N') return null;
993 1099
 
994 1100
 		return $GLOBALS['__member_info__']['group_image_mark'][$member_srl];
995 1101
 	}
@@ -1007,8 +1113,9 @@  discard block
 block discarded – undo
1007 1113
 				$buff = FileHandler::readFile($filename);
1008 1114
 				$signature = preg_replace('/<\?.*?\?>/', '', $buff);
1009 1115
 				$GLOBALS['__member_info__']['signature'][$member_srl] = $signature;
1116
+			} else {
1117
+				$GLOBALS['__member_info__']['signature'][$member_srl] = null;
1010 1118
 			}
1011
-			else $GLOBALS['__member_info__']['signature'][$member_srl] = null;
1012 1119
 		}
1013 1120
 		return $GLOBALS['__member_info__']['signature'][$member_srl];
1014 1121
 	}
@@ -1046,14 +1153,18 @@  discard block
 block discarded – undo
1046 1153
 			if(!$need_upgrade)
1047 1154
 			{
1048 1155
 				$required_algorithm = $oPassword->getCurrentlySelectedAlgorithm();
1049
-				if($required_algorithm !== $current_algorithm) $need_upgrade = true;
1156
+				if($required_algorithm !== $current_algorithm) {
1157
+					$need_upgrade = true;
1158
+				}
1050 1159
 			}
1051 1160
 			
1052 1161
 			if(!$need_upgrade)
1053 1162
 			{
1054 1163
 				$required_work_factor = $oPassword->getWorkFactor();
1055 1164
 				$current_work_factor = $oPassword->checkWorkFactor($hashed_password);
1056
-				if($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true;
1165
+				if($current_work_factor !== false && $required_work_factor > $current_work_factor) {
1166
+					$need_upgrade = true;
1167
+				}
1057 1168
 			}
1058 1169
 			
1059 1170
 			if($need_upgrade === true)
@@ -1084,7 +1195,9 @@  discard block
 block discarded – undo
1084 1195
 	function checkPasswordStrength($password, $strength)
1085 1196
 	{
1086 1197
 		$logged_info = Context::get('logged_info');
1087
-		if($logged_info->is_admin == 'Y') return true;
1198
+		if($logged_info->is_admin == 'Y') {
1199
+			return true;
1200
+		}
1088 1201
 		
1089 1202
 		if($strength == NULL)
1090 1203
 		{
@@ -1096,15 +1209,21 @@  discard block
 block discarded – undo
1096 1209
 		
1097 1210
 		switch ($strength) {
1098 1211
 			case 'high':
1099
-				if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) return false;
1212
+				if($length < 8 || !preg_match('/[^a-zA-Z0-9]/', $password)) {
1213
+					return false;
1214
+				}
1100 1215
 				/* no break */
1101 1216
 				
1102 1217
 			case 'normal':
1103
-				if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) return false;
1218
+				if($length < 6 || !preg_match('/[a-zA-Z]/', $password) || !preg_match('/[0-9]/', $password)) {
1219
+					return false;
1220
+				}
1104 1221
 				break;
1105 1222
 				
1106 1223
 			case 'low':
1107
-				if($length < 4) return false;
1224
+				if($length < 4) {
1225
+					return false;
1226
+				}
1108 1227
 				break; 
1109 1228
 		}
1110 1229
 		
Please login to merge, or discard this patch.
modules/member/member.view.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -634,7 +634,7 @@
 block discarded – undo
634 634
 	/**
635 635
 	 * Spammer manage popup
636 636
 	 * 
637
-	 * @return void
637
+	 * @return Object|null
638 638
 	**/
639 639
 	function dispMemberSpammer()
640 640
 	{
Please login to merge, or discard this patch.
Braces   +77 added lines, -58 removed lines patch added patch discarded remove patch
@@ -29,16 +29,14 @@  discard block
 block discarded – undo
29 29
 		{
30 30
 			$skin = 'default';
31 31
 			$template_path = sprintf('%sskins/%s', $this->module_path, $skin);
32
-		}
33
-		else
32
+		} else
34 33
 		{
35 34
 			//check theme
36 35
 			$config_parse = explode('|@|', $skin);
37 36
 			if (count($config_parse) > 1)
38 37
 			{
39 38
 				$template_path = sprintf('./themes/%s/modules/member/', $config_parse[0]);
40
-			}
41
-			else
39
+			} else
42 40
 			{
43 41
 				$template_path = sprintf('%sskins/%s', $this->module_path, $skin);
44 42
 			}
@@ -63,14 +61,15 @@  discard block
 block discarded – undo
63 61
 		$oMemberModel = getModel('member');
64 62
 		$logged_info = Context::get('logged_info');
65 63
 		// Don't display member info to non-logged user
66
-		if(!$logged_info->member_srl) return $this->stop('msg_not_permitted');
64
+		if(!$logged_info->member_srl) {
65
+			return $this->stop('msg_not_permitted');
66
+		}
67 67
 
68 68
 		$member_srl = Context::get('member_srl');
69 69
 		if(!$member_srl && Context::get('is_logged'))
70 70
 		{
71 71
 			$member_srl = $logged_info->member_srl;
72
-		}
73
-		elseif(!$member_srl)
72
+		} elseif(!$member_srl)
74 73
 		{
75 74
 			return $this->dispMemberSignUpForm();
76 75
 		}
@@ -89,7 +88,9 @@  discard block
 block discarded – undo
89 88
 			$member_info->email_address = substr_replace($member_info->email_address, $replaceStr, $start);
90 89
 		}
91 90
 
92
-		if(!$member_info->member_srl) return $this->dispMemberSignUpForm();
91
+		if(!$member_info->member_srl) {
92
+			return $this->dispMemberSignUpForm();
93
+		}
93 94
 
94 95
 		Context::set('memberInfo', get_object_vars($member_info));
95 96
 
@@ -135,43 +136,35 @@  discard block
 block discarded – undo
135 136
 				{
136 137
 					$target = $memberInfo->profile_image;
137 138
 					$item->value = '<img src="'.$target->src.'" />';
138
-				}
139
-				elseif($formInfo->name == 'image_name' && $memberInfo->image_name)
139
+				} elseif($formInfo->name == 'image_name' && $memberInfo->image_name)
140 140
 				{
141 141
 					$target = $memberInfo->image_name;
142 142
 					$item->value = '<img src="'.$target->src.'" />';
143
-				}
144
-				elseif($formInfo->name == 'image_mark' && $memberInfo->image_mark)
143
+				} elseif($formInfo->name == 'image_mark' && $memberInfo->image_mark)
145 144
 				{
146 145
 					$target = $memberInfo->image_mark;
147 146
 					$item->value = '<img src="'.$target->src.'" />';
148
-				}
149
-				elseif($formInfo->name == 'birthday' && $memberInfo->birthday)
147
+				} elseif($formInfo->name == 'birthday' && $memberInfo->birthday)
150 148
 				{
151 149
 					$item->value = zdate($item->value, 'Y-m-d');
152 150
 				}
153
-			}
154
-			else
151
+			} else
155 152
 			{
156 153
 				$item->title = $extendFormInfo[$formInfo->member_join_form_srl]->column_title;
157 154
 				$orgValue = $extendFormInfo[$formInfo->member_join_form_srl]->value;
158 155
 				if($formInfo->type=='tel' && is_array($orgValue))
159 156
 				{
160 157
 					$item->value = implode('-', $orgValue);
161
-				}
162
-				elseif($formInfo->type=='kr_zip' && is_array($orgValue))
158
+				} elseif($formInfo->type=='kr_zip' && is_array($orgValue))
163 159
 				{
164 160
 					$item->value = implode(' ', $orgValue);
165
-				}
166
-				elseif($formInfo->type=='checkbox' && is_array($orgValue))
161
+				} elseif($formInfo->type=='checkbox' && is_array($orgValue))
167 162
 				{
168 163
 					$item->value = implode(", ",$orgValue);
169
-				}
170
-				elseif($formInfo->type=='date')
164
+				} elseif($formInfo->type=='date')
171 165
 				{
172 166
 					$item->value = zdate($orgValue, "Y-m-d");
173
-				}
174
-				else
167
+				} else
175 168
 				{
176 169
 					$item->value = nl2br($orgValue);
177 170
 				}
@@ -198,12 +191,18 @@  discard block
 block discarded – undo
198 191
 
199 192
 		$oMemberModel = getModel('member');
200 193
 		// Get the member information if logged-in
201
-		if($oMemberModel->isLogged()) return $this->stop('msg_already_logged');
194
+		if($oMemberModel->isLogged()) {
195
+			return $this->stop('msg_already_logged');
196
+		}
202 197
 		// call a trigger (before) 
203 198
 		$trigger_output = ModuleHandler::triggerCall('member.dispMemberSignUpForm', 'before', $member_config);
204
-		if(!$trigger_output->toBool()) return $trigger_output;
199
+		if(!$trigger_output->toBool()) {
200
+			return $trigger_output;
201
+		}
205 202
 		// Error appears if the member is not allowed to join
206
-		if($member_config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
203
+		if($member_config->enable_join != 'Y') {
204
+			return $this->stop('msg_signup_disabled');
205
+		}
207 206
 
208 207
 		$oMemberAdminView = getAdminView('member');
209 208
 		$formTags = $oMemberAdminView->_getMemberInputTag($member_info);
@@ -244,8 +243,7 @@  discard block
 block discarded – undo
244 243
 		{
245 244
 			Context::set('identifierTitle', Context::getLang('email_address'));
246 245
 			Context::set('identifierValue', $logged_info->email_address); 
247
-		}
248
-		else
246
+		} else
249 247
 		{
250 248
 			Context::set('identifierTitle', Context::getLang('user_id'));
251 249
 			Context::set('identifierValue', $logged_info->user_id);
@@ -271,7 +269,9 @@  discard block
 block discarded – undo
271 269
 
272 270
 		$oMemberModel = getModel('member');
273 271
 		// A message appears if the user is not logged-in
274
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
272
+		if(!$oMemberModel->isLogged()) {
273
+			return $this->stop('msg_not_logged');
274
+		}
275 275
 
276 276
 		$logged_info = Context::get('logged_info');
277 277
 		$member_srl = $logged_info->member_srl;
@@ -330,7 +330,9 @@  discard block
 block discarded – undo
330 330
 	{
331 331
 		$oMemberModel = getModel('member');
332 332
 		// A message appears if the user is not logged-in
333
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
333
+		if(!$oMemberModel->isLogged()) {
334
+			return $this->stop('msg_not_logged');
335
+		}
334 336
 
335 337
 		$logged_info = Context::get('logged_info');
336 338
 		$member_srl = $logged_info->member_srl;
@@ -357,7 +359,9 @@  discard block
 block discarded – undo
357 359
 	{
358 360
 		$oMemberModel = getModel('member');
359 361
 		// A message appears if the user is not logged-in
360
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
362
+		if(!$oMemberModel->isLogged()) {
363
+			return $this->stop('msg_not_logged');
364
+		}
361 365
 
362 366
 		$logged_info = Context::get('logged_info');
363 367
 		$args = new stdClass();
@@ -381,7 +385,9 @@  discard block
 block discarded – undo
381 385
 	{
382 386
 		$oMemberModel = getModel('member');
383 387
 		// A message appears if the user is not logged-in
384
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
388
+		if(!$oMemberModel->isLogged()) {
389
+			return $this->stop('msg_not_logged');
390
+		}
385 391
 		// Get the saved document(module_srl is set to member_srl instead)
386 392
 		$logged_info = Context::get('logged_info');
387 393
 		$args = new stdClass();
@@ -420,13 +426,15 @@  discard block
 block discarded – undo
420 426
 
421 427
 		$XE_VALIDATOR_MESSAGE = Context::get('XE_VALIDATOR_MESSAGE');
422 428
 		$XE_VALIDATOR_ERROR = Context::get('XE_VALIDATOR_ERROR');
423
-		if($XE_VALIDATOR_ERROR == -11)
424
-			Context::set('XE_VALIDATOR_MESSAGE', $XE_VALIDATOR_MESSAGE . $config->limit_day_description);
429
+		if($XE_VALIDATOR_ERROR == -11) {
430
+					Context::set('XE_VALIDATOR_MESSAGE', $XE_VALIDATOR_MESSAGE . $config->limit_day_description);
431
+		}
425 432
 
426
-		if($XE_VALIDATOR_ERROR < -10 && $XE_VALIDATOR_ERROR > -21)
427
-			Context::set('referer_url', getUrl('')); 
428
-		else
429
-			Context::set('referer_url', htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
433
+		if($XE_VALIDATOR_ERROR < -10 && $XE_VALIDATOR_ERROR > -21) {
434
+					Context::set('referer_url', getUrl(''));
435
+		} else {
436
+					Context::set('referer_url', htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
437
+		}
430 438
 
431 439
 		// Set a template file
432 440
 		$this->setTemplateFile('login_form');
@@ -439,7 +447,9 @@  discard block
 block discarded – undo
439 447
 	{
440 448
 		$oMemberModel = getModel('member');
441 449
 		// A message appears if the user is not logged-in
442
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
450
+		if(!$oMemberModel->isLogged()) {
451
+			return $this->stop('msg_not_logged');
452
+		}
443 453
 
444 454
 		$memberConfig = $this->member_config;
445 455
 
@@ -454,8 +464,7 @@  discard block
 block discarded – undo
454 464
 		{
455 465
 			Context::set('identifier', 'user_id');
456 466
 			Context::set('formValue', $member_info->user_id);
457
-		}
458
-		else
467
+		} else
459 468
 		{
460 469
 			Context::set('identifier', 'email_address');
461 470
 			Context::set('formValue', $member_info->email_address);
@@ -471,7 +480,9 @@  discard block
 block discarded – undo
471 480
 	{
472 481
 		$oMemberModel = getModel('member');
473 482
 		// A message appears if the user is not logged-in
474
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
483
+		if(!$oMemberModel->isLogged()) {
484
+			return $this->stop('msg_not_logged');
485
+		}
475 486
 
476 487
 		$memberConfig = $this->member_config;
477 488
 
@@ -485,8 +496,7 @@  discard block
 block discarded – undo
485 496
 		{
486 497
 			Context::set('identifier', 'user_id');
487 498
 			Context::set('formValue', $member_info->user_id);
488
-		}
489
-		else
499
+		} else
490 500
 		{
491 501
 			Context::set('identifier', 'email_address');
492 502
 			Context::set('formValue', $member_info->email_address);
@@ -502,10 +512,11 @@  discard block
 block discarded – undo
502 512
 	{
503 513
 		$oMemberController = getController('member');
504 514
 		$output = $oMemberController->procMemberLogout();
505
-		if(!$output->redirect_url)
506
-			$this->setRedirectUrl(getNotEncodedUrl('act', ''));
507
-		else
508
-			$this->setRedirectUrl($output->redirect_url);
515
+		if(!$output->redirect_url) {
516
+					$this->setRedirectUrl(getNotEncodedUrl('act', ''));
517
+		} else {
518
+					$this->setRedirectUrl($output->redirect_url);
519
+		}
509 520
 
510 521
 		return;
511 522
 	}
@@ -524,7 +535,9 @@  discard block
 block discarded – undo
524 535
 	 */
525 536
 	function dispMemberFindAccount()
526 537
 	{
527
-		if(Context::get('is_logged')) return $this->stop('already_logged');
538
+		if(Context::get('is_logged')) {
539
+			return $this->stop('already_logged');
540
+		}
528 541
 
529 542
 		$config = $this->member_config;
530 543
 
@@ -538,13 +551,17 @@  discard block
 block discarded – undo
538 551
 	 */
539 552
 	function dispMemberGetTempPassword()
540 553
 	{
541
-		if(Context::get('is_logged')) return $this->stop('already_logged');
554
+		if(Context::get('is_logged')) {
555
+			return $this->stop('already_logged');
556
+		}
542 557
 
543 558
 		$user_id = Context::get('user_id');
544 559
 		$temp_password = $_SESSION['xe_temp_password_'.$user_id];
545 560
 		unset($_SESSION['xe_temp_password_'.$user_id]);
546 561
 
547
-		if(!$user_id||!$temp_password) return new Object(-1,'msg_invaild_request');
562
+		if(!$user_id||!$temp_password) {
563
+			return new Object(-1,'msg_invaild_request');
564
+		}
548 565
 
549 566
 		Context::set('temp_password', $temp_password);
550 567
 
@@ -572,8 +589,7 @@  discard block
 block discarded – undo
572 589
 			$_SESSION['auth_member_info'] = $memberInfo;
573 590
 			Context::set('memberInfo', $memberInfo);
574 591
 			$this->setTemplateFile('reset_mail');
575
-		}
576
-		else
592
+		} else
577 593
 		{
578 594
 			$this->setTemplateFile('resend_auth_mail');
579 595
 		}
@@ -615,8 +631,7 @@  discard block
 block discarded – undo
615 631
 			if($val->column_type == 'kr_zip' || $val->column_type == 'tel')
616 632
 			{
617 633
 				$js_code[] = sprintf('validator.cast("ADD_MESSAGE", ["%s[]","%s"]);', $val->column_name, $title);
618
-			}
619
-			else
634
+			} else
620 635
 			{
621 636
 				$js_code[] = sprintf('validator.cast("ADD_MESSAGE", ["%s","%s"]);', $val->column_name, $title);
622 637
 			}
@@ -638,7 +653,9 @@  discard block
 block discarded – undo
638 653
 	**/
639 654
 	function dispMemberSpammer()
640 655
 	{
641
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
656
+		if(!Context::get('is_logged')) {
657
+			return new Object(-1,'msg_not_permitted');
658
+		}
642 659
 
643 660
 		$member_srl = Context::get('member_srl');
644 661
 		$module_srl = Context::get('module_srl');
@@ -649,7 +666,9 @@  discard block
 block discarded – undo
649 666
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
650 667
 		$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
651 668
 
652
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
669
+		if(!$grant->manager) {
670
+			return new Object(-1,'msg_not_permitted');
671
+		}
653 672
 
654 673
 		$oMemberModel = getModel('member');
655 674
 
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -635,7 +635,7 @@
 block discarded – undo
635 635
 	 * Spammer manage popup
636 636
 	 * 
637 637
 	 * @return void
638
-	**/
638
+	 **/
639 639
 	function dispMemberSpammer()
640 640
 	{
641 641
 		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 		$skin = $this->member_config->skin;
27 27
 		// Set the template path
28
-		if(!$skin)
28
+		if (!$skin)
29 29
 		{
30 30
 			$skin = 'default';
31 31
 			$template_path = sprintf('%sskins/%s', $this->module_path, $skin);
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
 		$oLayoutModel = getModel('layout');
50 50
 		$layout_info = $oLayoutModel->getLayout($this->member_config->layout_srl);
51
-		if($layout_info)
51
+		if ($layout_info)
52 52
 		{
53 53
 			$this->module_info->layout_srl = $this->member_config->layout_srl;
54 54
 			$this->setLayoutPath($layout_info->path);
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
 		$oMemberModel = getModel('member');
64 64
 		$logged_info = Context::get('logged_info');
65 65
 		// Don't display member info to non-logged user
66
-		if(!$logged_info->member_srl) return $this->stop('msg_not_permitted');
66
+		if (!$logged_info->member_srl) return $this->stop('msg_not_permitted');
67 67
 
68 68
 		$member_srl = Context::get('member_srl');
69
-		if(!$member_srl && Context::get('is_logged'))
69
+		if (!$member_srl && Context::get('is_logged'))
70 70
 		{
71 71
 			$member_srl = $logged_info->member_srl;
72 72
 		}
73
-		elseif(!$member_srl)
73
+		elseif (!$member_srl)
74 74
 		{
75 75
 			return $this->dispMemberSignUpForm();
76 76
 		}
@@ -82,14 +82,14 @@  discard block
 block discarded – undo
82 82
 		unset($member_info->email_id);
83 83
 		unset($member_info->email_host);
84 84
 
85
-		if($logged_info->is_admin != 'Y' && ($member_info->member_srl != $logged_info->member_srl))
85
+		if ($logged_info->is_admin != 'Y' && ($member_info->member_srl != $logged_info->member_srl))
86 86
 		{
87
-			$start = strpos($member_info->email_address, '@')+1;
87
+			$start = strpos($member_info->email_address, '@') + 1;
88 88
 			$replaceStr = str_repeat('*', (strlen($member_info->email_address) - $start));
89 89
 			$member_info->email_address = substr_replace($member_info->email_address, $replaceStr, $start);
90 90
 		}
91 91
 
92
-		if(!$member_info->member_srl) return $this->dispMemberSignUpForm();
92
+		if (!$member_info->member_srl) return $this->dispMemberSignUpForm();
93 93
 
94 94
 		Context::set('memberInfo', get_object_vars($member_info));
95 95
 
@@ -107,46 +107,46 @@  discard block
 block discarded – undo
107 107
 	{
108 108
 		$logged_info = Context::get('logged_info');
109 109
 		$displayDatas = array();
110
-		foreach($memberConfig->signupForm as $no=>$formInfo)
110
+		foreach ($memberConfig->signupForm as $no=>$formInfo)
111 111
 		{
112
-			if(!$formInfo->isUse)
112
+			if (!$formInfo->isUse)
113 113
 			{
114 114
 				continue;
115 115
 			}
116 116
 
117
-			if($formInfo->name == 'password' || $formInfo->name == 'find_account_question')
117
+			if ($formInfo->name == 'password' || $formInfo->name == 'find_account_question')
118 118
 			{
119 119
 				continue;
120 120
 			}
121 121
 
122
-			if($logged_info->is_admin != 'Y' && $memberInfo->member_srl != $logged_info->member_srl && $formInfo->isPublic != 'Y')
122
+			if ($logged_info->is_admin != 'Y' && $memberInfo->member_srl != $logged_info->member_srl && $formInfo->isPublic != 'Y')
123 123
 			{
124 124
 				continue;
125 125
 			}
126 126
 
127 127
 			$item = $formInfo;
128 128
 
129
-			if($formInfo->isDefaultForm)
129
+			if ($formInfo->isDefaultForm)
130 130
 			{
131 131
 				$item->title = Context::getLang($formInfo->name);
132 132
 				$item->value = $memberInfo->{$formInfo->name};
133 133
 
134
-				if($formInfo->name == 'profile_image' && $memberInfo->profile_image)
134
+				if ($formInfo->name == 'profile_image' && $memberInfo->profile_image)
135 135
 				{
136 136
 					$target = $memberInfo->profile_image;
137 137
 					$item->value = '<img src="'.$target->src.'" />';
138 138
 				}
139
-				elseif($formInfo->name == 'image_name' && $memberInfo->image_name)
139
+				elseif ($formInfo->name == 'image_name' && $memberInfo->image_name)
140 140
 				{
141 141
 					$target = $memberInfo->image_name;
142 142
 					$item->value = '<img src="'.$target->src.'" />';
143 143
 				}
144
-				elseif($formInfo->name == 'image_mark' && $memberInfo->image_mark)
144
+				elseif ($formInfo->name == 'image_mark' && $memberInfo->image_mark)
145 145
 				{
146 146
 					$target = $memberInfo->image_mark;
147 147
 					$item->value = '<img src="'.$target->src.'" />';
148 148
 				}
149
-				elseif($formInfo->name == 'birthday' && $memberInfo->birthday)
149
+				elseif ($formInfo->name == 'birthday' && $memberInfo->birthday)
150 150
 				{
151 151
 					$item->value = zdate($item->value, 'Y-m-d');
152 152
 				}
@@ -155,19 +155,19 @@  discard block
 block discarded – undo
155 155
 			{
156 156
 				$item->title = $extendFormInfo[$formInfo->member_join_form_srl]->column_title;
157 157
 				$orgValue = $extendFormInfo[$formInfo->member_join_form_srl]->value;
158
-				if($formInfo->type=='tel' && is_array($orgValue))
158
+				if ($formInfo->type == 'tel' && is_array($orgValue))
159 159
 				{
160 160
 					$item->value = implode('-', $orgValue);
161 161
 				}
162
-				elseif($formInfo->type=='kr_zip' && is_array($orgValue))
162
+				elseif ($formInfo->type == 'kr_zip' && is_array($orgValue))
163 163
 				{
164 164
 					$item->value = implode(' ', $orgValue);
165 165
 				}
166
-				elseif($formInfo->type=='checkbox' && is_array($orgValue))
166
+				elseif ($formInfo->type == 'checkbox' && is_array($orgValue))
167 167
 				{
168
-					$item->value = implode(", ",$orgValue);
168
+					$item->value = implode(", ", $orgValue);
169 169
 				}
170
-				elseif($formInfo->type=='date')
170
+				elseif ($formInfo->type == 'date')
171 171
 				{
172 172
 					$item->value = zdate($orgValue, "Y-m-d");
173 173
 				}
@@ -198,12 +198,12 @@  discard block
 block discarded – undo
198 198
 
199 199
 		$oMemberModel = getModel('member');
200 200
 		// Get the member information if logged-in
201
-		if($oMemberModel->isLogged()) return $this->stop('msg_already_logged');
201
+		if ($oMemberModel->isLogged()) return $this->stop('msg_already_logged');
202 202
 		// call a trigger (before) 
203 203
 		$trigger_output = ModuleHandler::triggerCall('member.dispMemberSignUpForm', 'before', $member_config);
204
-		if(!$trigger_output->toBool()) return $trigger_output;
204
+		if (!$trigger_output->toBool()) return $trigger_output;
205 205
 		// Error appears if the member is not allowed to join
206
-		if($member_config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
206
+		if ($member_config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
207 207
 
208 208
 		$oMemberAdminView = getAdminView('member');
209 209
 		$formTags = $oMemberAdminView->_getMemberInputTag($member_info);
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 	{
227 227
 		$logged_info = Context::get('logged_info');
228 228
 		$oMemberModel = getModel('member');
229
-		if(!$oMemberModel->isLogged() || empty($logged_info))
229
+		if (!$oMemberModel->isLogged() || empty($logged_info))
230 230
 		{
231 231
 			return $this->stop('msg_not_logged');
232 232
 		}
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 		$_SESSION['rechecked_password_step'] = 'INPUT_PASSWORD';
235 235
 
236 236
 		$templateFile = $this->getTemplatePath().'rechecked_password.html';
237
-		if(!is_readable($templateFile))
237
+		if (!is_readable($templateFile))
238 238
 		{
239 239
 			$templatePath = sprintf('%sskins/default', $this->module_path);
240 240
 			$this->setTemplatePath($templatePath);
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 	 */
260 260
 	function dispMemberModifyInfo() 
261 261
 	{
262
-		if($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA')
262
+		if ($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA')
263 263
 		{
264 264
 			$this->dispMemberModifyInfoBefore();
265 265
 			return;
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 
272 272
 		$oMemberModel = getModel('member');
273 273
 		// A message appears if the user is not logged-in
274
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
274
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
275 275
 
276 276
 		$logged_info = Context::get('logged_info');
277 277
 		$member_srl = $logged_info->member_srl;
@@ -279,13 +279,13 @@  discard block
 block discarded – undo
279 279
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address', 'find_account_answer', 'homepage', 'blog', 'birthday', 'allow_mailing');
280 280
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
281 281
 		$member_info->signature = $oMemberModel->getSignature($member_srl);
282
-		Context::set('member_info',$member_info);
282
+		Context::set('member_info', $member_info);
283 283
 
284 284
 		// Get a list of extend join form
285 285
 		Context::set('extend_form_list', $oMemberModel->getCombineJoinForm($member_info));
286 286
 
287 287
 		// Editor of the module set for signing by calling getEditor
288
-		if($member_info->member_srl)
288
+		if ($member_info->member_srl)
289 289
 		{
290 290
 			$oEditorModel = getModel('editor');
291 291
 			$option = new stdClass();
@@ -330,15 +330,15 @@  discard block
 block discarded – undo
330 330
 	{
331 331
 		$oMemberModel = getModel('member');
332 332
 		// A message appears if the user is not logged-in
333
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
333
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
334 334
 
335 335
 		$logged_info = Context::get('logged_info');
336 336
 		$member_srl = $logged_info->member_srl;
337 337
 
338 338
 		$module_srl = Context::get('module_srl');
339
-		Context::set('module_srl',Context::get('selected_module_srl'));
340
-		Context::set('search_target','member_srl');
341
-		Context::set('search_keyword',$member_srl);
339
+		Context::set('module_srl', Context::get('selected_module_srl'));
340
+		Context::set('search_target', 'member_srl');
341
+		Context::set('search_keyword', $member_srl);
342 342
 
343 343
 		$oDocumentAdminView = getAdminView('document');
344 344
 		$oDocumentAdminView->dispDocumentAdminList();
@@ -357,12 +357,12 @@  discard block
 block discarded – undo
357 357
 	{
358 358
 		$oMemberModel = getModel('member');
359 359
 		// A message appears if the user is not logged-in
360
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
360
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
361 361
 
362 362
 		$logged_info = Context::get('logged_info');
363 363
 		$args = new stdClass();
364 364
 		$args->member_srl = $logged_info->member_srl;
365
-		$args->page = (int)Context::get('page');
365
+		$args->page = (int) Context::get('page');
366 366
 
367 367
 		$output = executeQuery('member.getScrapDocumentList', $args);
368 368
 		Context::set('total_count', $output->total_count);
@@ -381,12 +381,12 @@  discard block
 block discarded – undo
381 381
 	{
382 382
 		$oMemberModel = getModel('member');
383 383
 		// A message appears if the user is not logged-in
384
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
384
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
385 385
 		// Get the saved document(module_srl is set to member_srl instead)
386 386
 		$logged_info = Context::get('logged_info');
387 387
 		$args = new stdClass();
388 388
 		$args->member_srl = $logged_info->member_srl;
389
-		$args->page = (int)Context::get('page');
389
+		$args->page = (int) Context::get('page');
390 390
 		$args->statusList = array('TEMP');
391 391
 
392 392
 		$oDocumentModel = getModel('document');
@@ -405,9 +405,9 @@  discard block
 block discarded – undo
405 405
 	 */
406 406
 	function dispMemberLoginForm()
407 407
 	{
408
-		if(Context::get('is_logged'))
408
+		if (Context::get('is_logged'))
409 409
 		{
410
-			Context::set('redirect_url', getNotEncodedUrl('act',''));
410
+			Context::set('redirect_url', getNotEncodedUrl('act', ''));
411 411
 			$this->setTemplatePath($this->module_path.'tpl');
412 412
 			$this->setTemplateFile('redirect.html');
413 413
 			return;
@@ -420,10 +420,10 @@  discard block
 block discarded – undo
420 420
 
421 421
 		$XE_VALIDATOR_MESSAGE = Context::get('XE_VALIDATOR_MESSAGE');
422 422
 		$XE_VALIDATOR_ERROR = Context::get('XE_VALIDATOR_ERROR');
423
-		if($XE_VALIDATOR_ERROR == -11)
424
-			Context::set('XE_VALIDATOR_MESSAGE', $XE_VALIDATOR_MESSAGE . $config->limit_day_description);
423
+		if ($XE_VALIDATOR_ERROR == -11)
424
+			Context::set('XE_VALIDATOR_MESSAGE', $XE_VALIDATOR_MESSAGE.$config->limit_day_description);
425 425
 
426
-		if($XE_VALIDATOR_ERROR < -10 && $XE_VALIDATOR_ERROR > -21)
426
+		if ($XE_VALIDATOR_ERROR < -10 && $XE_VALIDATOR_ERROR > -21)
427 427
 			Context::set('referer_url', getUrl('')); 
428 428
 		else
429 429
 			Context::set('referer_url', htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 	{
440 440
 		$oMemberModel = getModel('member');
441 441
 		// A message appears if the user is not logged-in
442
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
442
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
443 443
 
444 444
 		$memberConfig = $this->member_config;
445 445
 
@@ -448,9 +448,9 @@  discard block
 block discarded – undo
448 448
 
449 449
 		$columnList = array('member_srl', 'user_id');
450 450
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
451
-		Context::set('member_info',$member_info);
451
+		Context::set('member_info', $member_info);
452 452
 
453
-		if($memberConfig->identifier == 'user_id')
453
+		if ($memberConfig->identifier == 'user_id')
454 454
 		{
455 455
 			Context::set('identifier', 'user_id');
456 456
 			Context::set('formValue', $member_info->user_id);
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 	{
472 472
 		$oMemberModel = getModel('member');
473 473
 		// A message appears if the user is not logged-in
474
-		if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
474
+		if (!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
475 475
 
476 476
 		$memberConfig = $this->member_config;
477 477
 
@@ -479,9 +479,9 @@  discard block
 block discarded – undo
479 479
 		$member_srl = $logged_info->member_srl;
480 480
 
481 481
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
482
-		Context::set('member_info',$member_info);
482
+		Context::set('member_info', $member_info);
483 483
 
484
-		if($memberConfig->identifier == 'user_id')
484
+		if ($memberConfig->identifier == 'user_id')
485 485
 		{
486 486
 			Context::set('identifier', 'user_id');
487 487
 			Context::set('formValue', $member_info->user_id);
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 	{
503 503
 		$oMemberController = getController('member');
504 504
 		$output = $oMemberController->procMemberLogout();
505
-		if(!$output->redirect_url)
505
+		if (!$output->redirect_url)
506 506
 			$this->setRedirectUrl(getNotEncodedUrl('act', ''));
507 507
 		else
508 508
 			$this->setRedirectUrl($output->redirect_url);
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 	 */
525 525
 	function dispMemberFindAccount()
526 526
 	{
527
-		if(Context::get('is_logged')) return $this->stop('already_logged');
527
+		if (Context::get('is_logged')) return $this->stop('already_logged');
528 528
 
529 529
 		$config = $this->member_config;
530 530
 
@@ -538,13 +538,13 @@  discard block
 block discarded – undo
538 538
 	 */
539 539
 	function dispMemberGetTempPassword()
540 540
 	{
541
-		if(Context::get('is_logged')) return $this->stop('already_logged');
541
+		if (Context::get('is_logged')) return $this->stop('already_logged');
542 542
 
543 543
 		$user_id = Context::get('user_id');
544 544
 		$temp_password = $_SESSION['xe_temp_password_'.$user_id];
545 545
 		unset($_SESSION['xe_temp_password_'.$user_id]);
546 546
 
547
-		if(!$user_id||!$temp_password) return new Object(-1,'msg_invaild_request');
547
+		if (!$user_id || !$temp_password) return new Object(-1, 'msg_invaild_request');
548 548
 
549 549
 		Context::set('temp_password', $temp_password);
550 550
 
@@ -559,12 +559,12 @@  discard block
 block discarded – undo
559 559
 		$authMemberSrl = $_SESSION['auth_member_srl'];
560 560
 		unset($_SESSION['auth_member_srl']);
561 561
 
562
-		if(Context::get('is_logged')) 
562
+		if (Context::get('is_logged')) 
563 563
 		{
564 564
 			return $this->stop('already_logged');
565 565
 		}
566 566
 
567
-		if($authMemberSrl)
567
+		if ($authMemberSrl)
568 568
 		{
569 569
 			$oMemberModel = getModel('member');
570 570
 			$memberInfo = $oMemberModel->getMemberInfoByMemberSrl($authMemberSrl);
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
 
582 582
 	function dispMemberModifyEmailAddress()
583 583
 	{
584
-		if($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA')
584
+		if ($_SESSION['rechecked_password_step'] != 'VALIDATE_PASSWORD' && $_SESSION['rechecked_password_step'] != 'INPUT_DATA')
585 585
 		{
586 586
 			Context::set('success_return_url', getUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyEmailAddress'));
587 587
 			$this->dispMemberModifyInfoBefore();
@@ -609,10 +609,10 @@  discard block
 block discarded – undo
609 609
 		$js_code[] = 'if(!validator) return false;';
610 610
 
611 611
 		$errorLang = array();
612
-		foreach($extraList as $val) 
612
+		foreach ($extraList as $val) 
613 613
 		{
614 614
 			$title = str_ireplace(array('<script', '</script'), array('<scr"+"ipt', '</scr"+"ipt'), addslashes($val->column_title));
615
-			if($val->column_type == 'kr_zip' || $val->column_type == 'tel')
615
+			if ($val->column_type == 'kr_zip' || $val->column_type == 'tel')
616 616
 			{
617 617
 				$js_code[] = sprintf('validator.cast("ADD_MESSAGE", ["%s[]","%s"]);', $val->column_name, $title);
618 618
 			}
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
 	**/
639 639
 	function dispMemberSpammer()
640 640
 	{
641
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
641
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
642 642
 
643 643
 		$member_srl = Context::get('member_srl');
644 644
 		$module_srl = Context::get('module_srl');
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
650 650
 		$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));
651 651
 
652
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
652
+		if (!$grant->manager) return new Object(-1, 'msg_not_permitted');
653 653
 
654 654
 		$oMemberModel = getModel('member');
655 655
 
Please login to merge, or discard this patch.
modules/menu/menu.admin.controller.php 3 patches
Doc Comments   +23 added lines, -3 removed lines patch added patch discarded remove patch
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 
246 246
 	/**
247 247
 	 * Delete menu process method
248
-	 * @return void|Object
248
+	 * @return Object|null
249 249
 	 */
250 250
 	function procMenuAdminDelete()
251 251
 	{
@@ -304,6 +304,7 @@  discard block
 block discarded – undo
304 304
 	/**
305 305
 	 * Delete menu
306 306
 	 * Delete menu_item and xml cache files
307
+	 * @param string $menu_srl
307 308
 	 * @return Object
308 309
 	 */
309 310
 	function deleteMenu($menu_srl)
@@ -380,6 +381,7 @@  discard block
 block discarded – undo
380 381
 
381 382
 	/**
382 383
 	 * Add an item to the menu, simple version
384
+	 * @param stdClass $request
383 385
 	 * @return void
384 386
 	 */
385 387
 	public function procMenuAdminInsertItem($request = NULL)
@@ -519,6 +521,9 @@  discard block
 block discarded – undo
519 521
 		$this->setMessage('success_registed', 'info');
520 522
 	}
521 523
 
524
+	/**
525
+	 * @param boolean $isProc
526
+	 */
522 527
 	private function _insertMenu(&$request, $isProc)
523 528
 	{
524 529
 		$oDB = DB::getInstance();
@@ -584,6 +589,7 @@  discard block
 block discarded – undo
584 589
 	 * insert module by men create value
585 590
 	 * @request value of client request
586 591
 	 * @args value for menu create
592
+	 * @param stdClass $args
587 593
 	 * @return bool result of create module
588 594
 	 */
589 595
 	private function _insertModule(&$request, &$args)
@@ -641,7 +647,7 @@  discard block
 block discarded – undo
641 647
 
642 648
 	/**
643 649
 	 * Update an item to the menu, simple version
644
-	 * @return void
650
+	 * @return Object|null
645 651
 	 */
646 652
 	public function procMenuAdminUpdateItem()
647 653
 	{
@@ -842,6 +848,7 @@  discard block
 block discarded – undo
842 848
 	/**
843 849
 	 * Delete menu item ( Only include BO )
844 850
 	 * @args menu_srl, menu_item_srl, is_force
851
+	 * @param stdClass $args
845 852
 	 * @return void|Object
846 853
 	 */
847 854
 	public function deleteItem($args)
@@ -990,6 +997,9 @@  discard block
 block discarded – undo
990 997
 		return new Object(0, 'success');
991 998
 	}
992 999
 
1000
+	/**
1001
+	 * @param DB $oDB
1002
+	 */
993 1003
 	private function _recursiveDeleteMenuItem(&$oDB, &$menuInfo, $node)
994 1004
 	{
995 1005
 		$output = $this->_deleteMenuItem($oDB, $menuInfo, $node);
@@ -1009,7 +1019,7 @@  discard block
 block discarded – undo
1009 1019
 
1010 1020
 	/**
1011 1021
 	 * Move menu items
1012
-	 * @return void
1022
+	 * @return Object|null
1013 1023
 	 */
1014 1024
 	function procMenuAdminMoveItem()
1015 1025
 	{
@@ -1174,6 +1184,9 @@  discard block
 block discarded – undo
1174 1184
 		}
1175 1185
 	}
1176 1186
 
1187
+	/**
1188
+	 * @param string $parentSrl
1189
+	 */
1177 1190
 	private function _copyMenu($menuSrl, $parentSrl, &$originMenu)
1178 1191
 	{
1179 1192
 		$oMenuAdminModel = getAdminModel('menu');
@@ -2182,6 +2195,7 @@  discard block
 block discarded – undo
2182 2195
 	/**
2183 2196
 	 * When copy a menu, button copied also.
2184 2197
 	 * @param $args menuItemInfo with button values
2198
+	 * @param string $insertedMenuItemSrl
2185 2199
 	 */
2186 2200
 	private function _copyButton($insertedMenuItemSrl, $insertedMenuSrl, &$menuItemInfo)
2187 2201
 	{
@@ -2222,6 +2236,9 @@  discard block
 block discarded – undo
2222 2236
 		return $copied_info;
2223 2237
 	}
2224 2238
 
2239
+	/**
2240
+	 * @param string $mode
2241
+	 */
2225 2242
 	private function _changeMenuItemSrlInButtonPath($buttonPath, $menuSrl, $menuItemSrl, $mode)
2226 2243
 	{
2227 2244
 		$path = sprintf('./files/attach/menu_button/%d/', $menuSrl);
@@ -2231,6 +2248,9 @@  discard block
 block discarded – undo
2231 2248
 		return sprintf('%s%d.%s.%s.%s', $path, $menuItemSrl,$date,'menu_'.$mode.'_btn', $ext);
2232 2249
 	}
2233 2250
 
2251
+	/**
2252
+	 * @param integer $menuSrl
2253
+	 */
2234 2254
 	public function makeHomemenuCacheFile($menuSrl)
2235 2255
 	{
2236 2256
 		$cacheBuff .= sprintf('<?php if(!defined("__XE__")) exit();');
Please login to merge, or discard this patch.
Spacing   +303 added lines, -303 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	}
57 57
 
58 58
 	function __construct() {
59
-		$this->homeMenuCacheFile = _XE_PATH_ . $this->homeMenuCacheFile;
59
+		$this->homeMenuCacheFile = _XE_PATH_.$this->homeMenuCacheFile;
60 60
 	}
61 61
 
62 62
 	/**
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 		// List variables
69 69
 		$site_module_info = Context::get('site_module_info');
70 70
 
71
-		$output = $this->addMenu(Context::get('title'), (int)$site_module_info->site_srl);
72
-		if(!$output->toBool()) return $output;
71
+		$output = $this->addMenu(Context::get('title'), (int) $site_module_info->site_srl);
72
+		if (!$output->toBool()) return $output;
73 73
 
74 74
 		$this->add('menu_srl', $output->get('menuSrl'));
75 75
 		$this->setMessage('success_registed');
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		$args->listorder = $args->menu_srl * -1;
96 96
 
97 97
 		$output = executeQuery('menu.insertMenu', $args);
98
-		if(!$output->toBool())
98
+		if (!$output->toBool())
99 99
 		{
100 100
 			return $output;
101 101
 		}
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
 		$unlinked_modules = false;
110 110
 		$args = new stdClass;
111 111
 		$args->site_srl = 0;
112
-		$output = executeQueryArray('module.getNotLinkedModuleBySiteSrl',$args);
113
-		if($output->toBool() && $output->data && count($output->data) > 0)
112
+		$output = executeQueryArray('module.getNotLinkedModuleBySiteSrl', $args);
113
+		if ($output->toBool() && $output->data && count($output->data) > 0)
114 114
 		{
115 115
 			$unlinked_modules = $output->data;
116 116
 		}
117 117
 
118
-		if($unlinked_modules)
118
+		if ($unlinked_modules)
119 119
 		{
120 120
 			$unlinked_menu_srl = $this->getUnlinkedMenu();
121 121
 			$output = $this->updateLinkModule($unlinked_modules, $unlinked_menu_srl);
@@ -129,21 +129,21 @@  discard block
 block discarded – undo
129 129
 		$oModuleModel = getModel('module');
130 130
 		$moduleConfig = $oModuleModel->getModuleConfig('menu');
131 131
 
132
-		if($moduleConfig->unlinked_menu_srl)
132
+		if ($moduleConfig->unlinked_menu_srl)
133 133
 		{
134 134
 			$menuArgs = new stdClass;
135 135
 			$menuArgs->menu_srl = $moduleConfig->unlinked_menu_srl;
136 136
 			$menuOutput = executeQuery('menu.getMenu', $menuArgs);
137
-			if(!$menuOutput->data)
137
+			if (!$menuOutput->data)
138 138
 			{
139 139
 				unset($moduleConfig->unlinked_menu_srl);
140 140
 			}
141 141
 		}
142 142
 
143
-		if(!$moduleConfig->unlinked_menu_srl)
143
+		if (!$moduleConfig->unlinked_menu_srl)
144 144
 		{
145 145
 			$output = $this->addMenu('unlinked', 0);
146
-			if($output->toBool())
146
+			if ($output->toBool())
147 147
 			{
148 148
 				$moduleConfig->unlinked_menu_srl = $output->get('menuSrl');
149 149
 				$oModuleController = getController('module');
@@ -168,12 +168,12 @@  discard block
 block discarded – undo
168 168
 	 */
169 169
 	function updateLinkModule($moduleInfos, $menuSrl)
170 170
 	{
171
-		if(!$moduleInfos || !is_array($moduleInfos) || count($moduleInfos) == 0 || $menuSrl == 0)
171
+		if (!$moduleInfos || !is_array($moduleInfos) || count($moduleInfos) == 0 || $menuSrl == 0)
172 172
 		{
173 173
 			return new Object(-1, 'msg_invalid_request');
174 174
 		}
175 175
 
176
-		foreach($moduleInfos as $moduleInfo)
176
+		foreach ($moduleInfos as $moduleInfo)
177 177
 		{
178 178
 			// search menu.
179 179
 			$args = new stdClass;
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
 			$output = executeQuery('menu.getMenuItemByUrl', $args);
185 185
 
186
-			if($output->toBool() && $output->data)
186
+			if ($output->toBool() && $output->data)
187 187
 			{
188 188
 				$moduleInfo->menu_srl = $output->data->menu_srl;
189 189
 			}
@@ -194,10 +194,10 @@  discard block
 block discarded – undo
194 194
 				$item_args->url = $moduleInfo->mid;
195 195
 				$item_args->name = $moduleInfo->mid;
196 196
 				$item_args->menu_item_srl = getNextSequence();
197
-				$item_args->listorder = -1*$item_args->menu_item_srl;
197
+				$item_args->listorder = -1 * $item_args->menu_item_srl;
198 198
 
199 199
 				$output = executeQuery('menu.insertMenuItem', $item_args);
200
-				if(!$output->toBool())
200
+				if (!$output->toBool())
201 201
 				{
202 202
 					return $output;
203 203
 				}
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 		}
211 211
 
212 212
 		$oCacheHandler = CacheHandler::getInstance('object', null, true);
213
-		if($oCacheHandler->isSupport())
213
+		if ($oCacheHandler->isSupport())
214 214
 		{
215 215
 			$oCacheHandler->invalidateGroupKey('site_and_module');
216 216
 		}
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 		$args->menu_srl = Context::get('menu_srl');
236 236
 
237 237
 		$output = executeQuery('menu.updateMenu', $args);
238
-		if(!$output->toBool()) return $output;
238
+		if (!$output->toBool()) return $output;
239 239
 
240 240
 		$this->setMessage('success_registed');
241 241
 
@@ -255,14 +255,14 @@  discard block
 block discarded – undo
255 255
 		$menuInfo = $oMenuAdminModel->getMenu($menu_srl);
256 256
 
257 257
 		$oAdmin = getClass('admin');
258
-		if($menuInfo->title == $oAdmin->getAdminMenuName())
258
+		if ($menuInfo->title == $oAdmin->getAdminMenuName())
259 259
 			return new Object(-1, 'msg_adminmenu_cannot_delete');
260 260
 
261 261
 		// get menu properies with child menu
262 262
 		$phpFile = sprintf("./files/cache/menu/%s.php", $menu_srl);
263 263
 		$originMenu = NULL;
264 264
 
265
-		if(is_readable(FileHandler::getRealPath($phpFile)))
265
+		if (is_readable(FileHandler::getRealPath($phpFile)))
266 266
 		{
267 267
 			include(FileHandler::getRealPath($phpFile));
268 268
 		}
@@ -273,25 +273,25 @@  discard block
 block discarded – undo
273 273
 
274 274
 		$isStartmenuInclude = false;
275 275
 
276
-		if(is_array($menu->list))
276
+		if (is_array($menu->list))
277 277
 		{
278
-			foreach($menu->list AS $key=>$value)
278
+			foreach ($menu->list AS $key=>$value)
279 279
 			{
280 280
 				$originMenu = $value;
281 281
 				$this->_checkHomeMenuInOriginMenu($originMenu, $siteInfo->mid, $isStartmenuInclude);
282 282
 
283
-				if($isStartmenuInclude)
283
+				if ($isStartmenuInclude)
284 284
 					break;
285 285
 			}
286 286
 		}
287 287
 
288
-		if($isStartmenuInclude)
288
+		if ($isStartmenuInclude)
289 289
 		{
290 290
 			return new Object(-1, 'msg_cannot_delete_homemenu');
291 291
 		}
292 292
 
293 293
 		$output = $this->deleteMenu($menu_srl);
294
-		if(!$output->toBool())
294
+		if (!$output->toBool())
295 295
 		{
296 296
 			return new Object(-1, $output->message);
297 297
 		}
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 
320 320
 		// Delete modules
321 321
 		$output = executeQueryArray('menu.getMenuItems', $args);
322
-		if(!$output->toBool())
322
+		if (!$output->toBool())
323 323
 		{
324 324
 			return $output;
325 325
 		}
@@ -327,15 +327,15 @@  discard block
 block discarded – undo
327 327
 		$oModuleController = getController('module');
328 328
 		$oModuleModel = getModel('module');
329 329
 
330
-		foreach($output->data as $itemInfo)
330
+		foreach ($output->data as $itemInfo)
331 331
 		{
332
-			if($itemInfo->is_shortcut != 'Y' && strncasecmp('http', $itemInfo->url, 4) !== 0)
332
+			if ($itemInfo->is_shortcut != 'Y' && strncasecmp('http', $itemInfo->url, 4) !== 0)
333 333
 			{
334 334
 				$moduleInfo = $oModuleModel->getModuleInfoByMid($itemInfo->url, $menuInfo->site_srl);
335
-				if($moduleInfo->module_srl)
335
+				if ($moduleInfo->module_srl)
336 336
 				{
337 337
 					$output = $oModuleController->onlyDeleteModule($moduleInfo->module_srl);
338
-					if(!$output->toBool())
338
+					if (!$output->toBool())
339 339
 					{
340 340
 						$oDB->rollback();
341 341
 						return $output;
@@ -346,27 +346,27 @@  discard block
 block discarded – undo
346 346
 
347 347
 		// Delete menu items
348 348
 		$output = executeQuery("menu.deleteMenuItems", $args);
349
-		if(!$output->toBool())
349
+		if (!$output->toBool())
350 350
 		{
351 351
 			$oDB->rollback();
352 352
 			return $output;
353 353
 		}
354 354
 		// Delete the menu
355 355
 		$output = executeQuery("menu.deleteMenu", $args);
356
-		if(!$output->toBool())
356
+		if (!$output->toBool())
357 357
 		{
358 358
 			$oDB->rollback();
359 359
 			return $output;
360 360
 		}
361 361
 
362 362
 		// Delete cache files
363
-		$cache_list = FileHandler::readDir("./files/cache/menu","",false,true);
364
-		if(count($cache_list))
363
+		$cache_list = FileHandler::readDir("./files/cache/menu", "", false, true);
364
+		if (count($cache_list))
365 365
 		{
366
-			foreach($cache_list as $cache_file)
366
+			foreach ($cache_list as $cache_file)
367 367
 			{
368 368
 				$pos = strpos($cache_file, $menu_srl.'.');
369
-				if($pos>0)FileHandler::removeFile($cache_file);
369
+				if ($pos > 0)FileHandler::removeFile($cache_file);
370 370
 			}
371 371
 		}
372 372
 		// Delete images of menu buttons
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 
376 376
 		$oDB->commit();
377 377
 
378
-		return new Object(0,'success_deleted');
378
+		return new Object(0, 'success_deleted');
379 379
 	}
380 380
 
381 381
 	/**
@@ -385,24 +385,24 @@  discard block
 block discarded – undo
385 385
 	public function procMenuAdminInsertItem($request = NULL)
386 386
 	{
387 387
 		$isProc = false;
388
-		if(!$request)
388
+		if (!$request)
389 389
 		{
390 390
 			$isProc = true;
391 391
 			$request = Context::getRequestVars();
392 392
 		}
393 393
 
394
-		if(!$request->parent_srl || !$request->menu_name)
394
+		if (!$request->parent_srl || !$request->menu_name)
395 395
 		{
396 396
 			return new Object(-1, 'msg_invalid_request');
397 397
 		}
398 398
 
399 399
 		$this->_setMenuSrl($request->parent_srl, $request->menu_srl);
400
-		if(!$request->menu_srl)
400
+		if (!$request->menu_srl)
401 401
 		{
402 402
 			return new Object(-1, 'msg_invalid_request');
403 403
 		}
404 404
 
405
-		if($request->is_shortcut == 'Y')
405
+		if ($request->is_shortcut == 'Y')
406 406
 		{
407 407
 			$result = $this->_insertShortcut($request);
408 408
 		}
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 			$result = $this->_insertMenu($request, $isProc);
412 412
 		}
413 413
 
414
-		if($result->error < 0)
414
+		if ($result->error < 0)
415 415
 		{
416 416
 			return new Object($result->error, $result->message);
417 417
 		}
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 		// recreate menu cache file
420 420
 		$this->makeXmlFile($request->menu_srl);
421 421
 
422
-		if(!$isProc)
422
+		if (!$isProc)
423 423
 		{
424 424
 			return $this->get('menu_item_srl');
425 425
 		}
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 		$oMenuAdminModel = getAdminModel('menu');
432 432
 		$itemInfo = $oMenuAdminModel->getMenuItemInfo($parent_srl);
433 433
 		// parent_srl is parent menu item's srl
434
-		if($itemInfo->menu_srl)
434
+		if ($itemInfo->menu_srl)
435 435
 		{
436 436
 			$menu_srl = $itemInfo->menu_srl;
437 437
 		}
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 		else
440 440
 		{
441 441
 			$output = $oMenuAdminModel->getMenu($parent_srl);
442
-			if($output->menu_srl == $parent_srl)
442
+			if ($output->menu_srl == $parent_srl)
443 443
 			{
444 444
 				$menu_srl = $output->menu_srl;
445 445
 				$parent_srl = 0;
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 		$oDB->begin();
454 454
 
455 455
 		// type is url
456
-		if(strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
456
+		if (strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
457 457
 		{
458 458
 			// set menu variable
459 459
 			$args = new stdClass();
@@ -464,27 +464,27 @@  discard block
 block discarded – undo
464 464
 			$args->is_shortcut = $request->is_shortcut;
465 465
 			$args->url = $request->shortcut_target;
466 466
 
467
-			if(!$args->open_window) $args->open_window = 'N';
468
-			if(!$args->expand) $args->expand = 'N';
469
-			if(!$args->is_shortcut) $args->is_shortcut = 'Y';
467
+			if (!$args->open_window) $args->open_window = 'N';
468
+			if (!$args->expand) $args->expand = 'N';
469
+			if (!$args->is_shortcut) $args->is_shortcut = 'Y';
470 470
 
471
-			if($request->menu_name_key) $args->name = $request->menu_name_key;
471
+			if ($request->menu_name_key) $args->name = $request->menu_name_key;
472 472
 			else $args->name = $request->menu_name;
473 473
 		}
474 474
 		// type is module short cut
475
-		else if(is_numeric($request->shortcut_target))
475
+		else if (is_numeric($request->shortcut_target))
476 476
 		{
477 477
 			// Get original information
478 478
 			$oMenuAdminModel = getAdminModel('menu');
479 479
 			$itemInfo = $oMenuAdminModel->getMenuItemInfo($request->shortcut_target);
480
-			if(!$itemInfo->menu_item_srl)
480
+			if (!$itemInfo->menu_item_srl)
481 481
 			{
482 482
 				return new Object(-1, 'msg_invalid_request');
483 483
 			}
484 484
 			unset($itemInfo->normal_btn, $itemInfo->hover_btn, $itemInfo->active_btn);
485 485
 
486 486
 			$args = $itemInfo;
487
-			if(count($args->group_srls) == 0)
487
+			if (count($args->group_srls) == 0)
488 488
 			{
489 489
 				unset($args->group_srls);
490 490
 			}
@@ -504,13 +504,13 @@  discard block
 block discarded – undo
504 504
 			$args->url = '#';
505 505
 		}
506 506
 
507
-		if($request->menu_desc) $args->desc = $request->menu_desc;
507
+		if ($request->menu_desc) $args->desc = $request->menu_desc;
508 508
 		else $args->desc = '';
509 509
 
510 510
 		$args->menu_item_srl = getNextSequence();
511
-		$args->listorder = -1*$args->menu_item_srl;
511
+		$args->listorder = -1 * $args->menu_item_srl;
512 512
 		$output = executeQuery('menu.insertMenuItem', $args);
513
-		if(!$output->toBool()) return $output;
513
+		if (!$output->toBool()) return $output;
514 514
 
515 515
 		$oDB->commit();
516 516
 
@@ -532,46 +532,46 @@  discard block
 block discarded – undo
532 532
 		$args->expand = $request->menu_expand;
533 533
 		$args->is_shortcut = $request->is_shortcut;
534 534
 
535
-		if(!$args->open_window) $args->open_window = 'N';
536
-		if(!$args->expand) $args->expand = 'N';
537
-		if(!$args->is_shortcut) $args->is_shortcut = 'N';
535
+		if (!$args->open_window) $args->open_window = 'N';
536
+		if (!$args->expand) $args->expand = 'N';
537
+		if (!$args->is_shortcut) $args->is_shortcut = 'N';
538 538
 
539
-		if($request->menu_name_key) $args->name = $request->menu_name_key;
539
+		if ($request->menu_name_key) $args->name = $request->menu_name_key;
540 540
 		else $args->name = $request->menu_name;
541 541
 
542
-		if($request->menu_desc) $args->desc = $request->menu_desc;
542
+		if ($request->menu_desc) $args->desc = $request->menu_desc;
543 543
 		else $args->desc = '';
544 544
 
545
-		if($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
545
+		if ($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
546 546
 		{
547 547
 			return new Object(-1, 'msg_invalid_request');
548 548
 		}
549 549
 
550 550
 		// when menu copy, module already copied
551
-		if($isProc)
551
+		if ($isProc)
552 552
 		{
553 553
 			$result = $this->_insertModule($request, $args);
554
-			if(!$result->toBool())
554
+			if (!$result->toBool())
555 555
 			{
556 556
 				return new Object(-1, $result->message);
557 557
 			}
558 558
 		}
559 559
 
560 560
 		// if setting button variables, set argument button variables for db insert. but not upload in this method
561
-		if($request->normal_btn) $args->normal_btn = $request->normal_btn;
562
-		if($request->hover_btn) $args->hover_btn = $request->hover_btn;
563
-		if($request->active_btn) $args->active_btn = $request->active_btn;
561
+		if ($request->normal_btn) $args->normal_btn = $request->normal_btn;
562
+		if ($request->hover_btn) $args->hover_btn = $request->hover_btn;
563
+		if ($request->active_btn) $args->active_btn = $request->active_btn;
564 564
 
565
-		if(!$request->module_id)
565
+		if (!$request->module_id)
566 566
 		{
567 567
 			return new Object(-1, 'msg_invalid_request');
568 568
 		}
569 569
 
570 570
 		$args->url = $request->module_id;
571 571
 		$args->menu_item_srl = getNextSequence();
572
-		$args->listorder = -1*$args->menu_item_srl;
572
+		$args->listorder = -1 * $args->menu_item_srl;
573 573
 		$output = executeQuery('menu.insertMenuItem', $args);
574
-		if(!$output->toBool()) return $output;
574
+		if (!$output->toBool()) return $output;
575 575
 
576 576
 		$oDB->commit();
577 577
 
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
 
604 604
 		//module create
605 605
 		$site_module_info = Context::get('site_module_info');
606
-		$cmArgs->site_srl = (int)$site_module_info->site_srl;
606
+		$cmArgs->site_srl = (int) $site_module_info->site_srl;
607 607
 		$cmArgs->browser_title = $args->name;
608 608
 		$cmArgs->menu_srl = $request->menu_srl;
609 609
 		$cmArgs->layout_srl = -1;
@@ -611,13 +611,13 @@  discard block
 block discarded – undo
611 611
 		$cmArgs->is_skin_fix = 'N';
612 612
 		$cmArgs->is_mskin_fix = 'N';
613 613
 
614
-		if(Mobile::isMobileEnabled() === true)
614
+		if (Mobile::isMobileEnabled() === true)
615 615
 		{
616 616
 			$cmArgs->use_mobile = 'Y';
617 617
 		}
618 618
 
619 619
 		// if mid is empty, auto create mid
620
-		if(!$request->module_id)
620
+		if (!$request->module_id)
621 621
 		{
622 622
 			$randomMid = $this->_makeRandomMid();
623 623
 			$request->module_id = $cmArgs->module.'_'.$randomMid;
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
 		// check already created module instance
628 628
 		$oModuleModel = getModel('module');
629 629
 		$output = $oModuleModel->getModuleInfoByMid($request->module_id);
630
-		if($output->module_srl)
630
+		if ($output->module_srl)
631 631
 		{
632 632
 			return new Object(-1, 'msg_module_name_exists');
633 633
 		}
@@ -646,14 +646,14 @@  discard block
 block discarded – undo
646 646
 	{
647 647
 		$request = Context::getRequestVars();
648 648
 
649
-		if(!$request->menu_item_srl || !$request->menu_name)
649
+		if (!$request->menu_item_srl || !$request->menu_name)
650 650
 		{
651 651
 			return new Object(-1, 'msg_invalid_request');
652 652
 		}
653 653
 
654 654
 		// variables set
655
-		if($request->menu_open_window != "Y") $request->menu_open_window = "N";
656
-		if($request->menu_expand != "Y") $request->menu_expand = "N";
655
+		if ($request->menu_open_window != "Y") $request->menu_open_window = "N";
656
+		if ($request->menu_expand != "Y") $request->menu_expand = "N";
657 657
 
658 658
 		// Get original information
659 659
 		$oMenuAdminModel = getAdminModel('menu');
@@ -661,19 +661,19 @@  discard block
 block discarded – undo
661 661
 		$args = $itemInfo;
662 662
 
663 663
 		// if menu type is module, check exists module and update
664
-		if($itemInfo->is_shortcut == 'Y')
664
+		if ($itemInfo->is_shortcut == 'Y')
665 665
 		{
666 666
 			// type is url
667
-			if(strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
667
+			if (strncasecmp('http', $request->shortcut_target, 4) === 0 || preg_match('/^(\.\/|\.\.\/|\/).*$/', $request->shortcut_target))
668 668
 			{
669 669
 				$args->url = $request->shortcut_target;
670 670
 			}
671 671
 			// type is module short cut
672
-			else if(is_numeric($request->shortcut_target))
672
+			else if (is_numeric($request->shortcut_target))
673 673
 			{
674 674
 				// Get new original information
675 675
 				$newItemInfo = $oMenuAdminModel->getMenuItemInfo($request->shortcut_target);
676
-				if(!$newItemInfo->menu_item_srl)
676
+				if (!$newItemInfo->menu_item_srl)
677 677
 				{
678 678
 					return new Object(-1, 'msg_invalid_request');
679 679
 				}
@@ -690,10 +690,10 @@  discard block
 block discarded – undo
690 690
 		{
691 691
 			// check already created module instance
692 692
 			$oModuleModel = getModel('module');
693
-			if($request->module_id != $itemInfo->url)
693
+			if ($request->module_id != $itemInfo->url)
694 694
 			{
695 695
 				$output = $oModuleModel->getModuleInfoByMid($request->module_id);
696
-				if($output->module_srl)
696
+				if ($output->module_srl)
697 697
 				{
698 698
 					return new Object(-1, 'msg_module_name_exists');
699 699
 				}
@@ -701,13 +701,13 @@  discard block
 block discarded – undo
701 701
 
702 702
 			// if not exist module, return error
703 703
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($itemInfo->url);
704
-			if(!$moduleInfo)
704
+			if (!$moduleInfo)
705 705
 			{
706 706
 				return new Object(-1, 'msg_invalid_request');
707 707
 			}
708 708
 
709 709
 			$moduleInfo->mid = $request->module_id;
710
-			if($request->browser_title)
710
+			if ($request->browser_title)
711 711
 			{
712 712
 				$moduleInfo->browser_title = $request->browser_title;
713 713
 			}
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 			$args->url = $request->module_id;
717 717
 		}
718 718
 
719
-		if($request->menu_name_key)
719
+		if ($request->menu_name_key)
720 720
 		{
721 721
 			$args->name = $request->menu_name_key;
722 722
 		}
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
 			$args->name = $request->menu_name;
726 726
 		}
727 727
 
728
-		if($request->menu_desc) $args->desc = $request->menu_desc;
728
+		if ($request->menu_desc) $args->desc = $request->menu_desc;
729 729
 		else $args->desc = '';
730 730
 
731 731
 		unset($args->group_srls);
@@ -753,38 +753,38 @@  discard block
 block discarded – undo
753 753
 
754 754
 		$btnOutput = $this->_uploadButton($args);
755 755
 
756
-		if($btnOutput['normal_btn'])
756
+		if ($btnOutput['normal_btn'])
757 757
 		{
758 758
 			$this->add('normal_btn', $btnOutput['normal_btn']);
759 759
 			$item_info->normal_btn = $btnOutput['normal_btn'];
760 760
 		}
761
-		if($btnOutput['hover_btn'])
761
+		if ($btnOutput['hover_btn'])
762 762
 		{
763 763
 			$this->add('hover_btn', $btnOutput['hover_btn']);
764 764
 			$item_info->hover_btn = $btnOutput['hover_btn'];
765 765
 		}
766
-		if($btnOutput['active_btn'])
766
+		if ($btnOutput['active_btn'])
767 767
 		{
768 768
 			$this->add('active_btn', $btnOutput['active_btn']);
769 769
 			$item_info->active_btn = $btnOutput['active_btn'];
770 770
 		}
771 771
 
772 772
 		// group_srls check
773
-		if(count($item_info->group_srls) == 0)
773
+		if (count($item_info->group_srls) == 0)
774 774
 		{
775 775
 			unset($item_info->group_srls);
776 776
 		}
777 777
 
778 778
 		// Button delete check
779
-		if(!$btnOutput['normal_btn'] && $args->isNormalDelete == 'Y')
779
+		if (!$btnOutput['normal_btn'] && $args->isNormalDelete == 'Y')
780 780
 		{
781 781
 			$item_info->normal_btn = '';
782 782
 		}
783
-		if(!$btnOutput['hover_btn'] && $args->isHoverDelete == 'Y')
783
+		if (!$btnOutput['hover_btn'] && $args->isHoverDelete == 'Y')
784 784
 		{
785 785
 			$item_info->hover_btn = '';
786 786
 		}
787
-		if(!$btnOutput['active_btn'] && $args->isActiveDelete == 'Y')
787
+		if (!$btnOutput['active_btn'] && $args->isActiveDelete == 'Y')
788 788
 		{
789 789
 			$item_info->active_btn = '';
790 790
 		}
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
 		$args->is_force = Context::get('is_force');
825 825
 
826 826
 		$returnObj = $this->deleteItem($args);
827
-		if(is_object($returnObj))
827
+		if (is_object($returnObj))
828 828
 		{
829 829
 			$this->setError($returnObj->error);
830 830
 			$this->setMessage($returnObj->message);
@@ -853,11 +853,11 @@  discard block
 block discarded – undo
853 853
 		$args->menu_srl = $itemInfo->menu_srl;
854 854
 
855 855
 		// Display an error that the category cannot be deleted if it has a child node	603
856
-		if($args->is_force != 'Y')
856
+		if ($args->is_force != 'Y')
857 857
 		{
858 858
 			$output = executeQuery('menu.getChildMenuCount', $args);
859
-			if(!$output->toBool()) return $output;
860
-			if($output->data->count > 0)
859
+			if (!$output->toBool()) return $output;
860
+			if ($output->data->count > 0)
861 861
 			{
862 862
 				return new Object(-1001, 'msg_cannot_delete_for_child');
863 863
 			}
@@ -869,22 +869,22 @@  discard block
 block discarded – undo
869 869
 
870 870
 		// check admin menu delete
871 871
 		$oAdmin = getClass('admin');
872
-		if($menu_title == $oAdmin->getAdminMenuName() && $itemInfo->parent_srl == 0)
872
+		if ($menu_title == $oAdmin->getAdminMenuName() && $itemInfo->parent_srl == 0)
873 873
 		{
874 874
 			return $this->stop('msg_cannot_delete_for_admin_topmenu');
875 875
 		}
876 876
 
877
-		if($itemInfo->parent_srl) $parent_srl = $itemInfo->parent_srl;
877
+		if ($itemInfo->parent_srl) $parent_srl = $itemInfo->parent_srl;
878 878
 
879 879
 		// get menu properies with child menu
880 880
 		$phpFile = sprintf("./files/cache/menu/%s.php", $args->menu_srl);
881 881
 		$originMenu = NULL;
882 882
 
883
-		if(is_readable(FileHandler::getRealPath($phpFile)))
883
+		if (is_readable(FileHandler::getRealPath($phpFile)))
884 884
 		{
885 885
 			include(FileHandler::getRealPath($phpFile));
886 886
 
887
-			if(is_array($menu->list))
887
+			if (is_array($menu->list))
888 888
 			{
889 889
 				$this->_searchMenu($menu->list, $args->menu_item_srl, $originMenu);
890 890
 			}
@@ -894,7 +894,7 @@  discard block
 block discarded – undo
894 894
 		$siteInfo = $oModuleModel->getSiteInfo($menuInfo->site_srl);
895 895
 		$isStartmenuInclude = false;
896 896
 		$this->_checkHomeMenuInOriginMenu($originMenu, $siteInfo->mid, $isStartmenuInclude);
897
-		if($isStartmenuInclude)
897
+		if ($isStartmenuInclude)
898 898
 		{
899 899
 			return new Object(-1, 'msg_cannot_delete_homemenu');
900 900
 		}
@@ -918,14 +918,14 @@  discard block
 block discarded – undo
918 918
 
919 919
 	private function _checkHomeMenuInOriginMenu($originMenu, $startMid, &$isStartmenuInclude)
920 920
 	{
921
-		if($originMenu['is_shortcut'] != 'Y' && $originMenu['url'] == $startMid)
921
+		if ($originMenu['is_shortcut'] != 'Y' && $originMenu['url'] == $startMid)
922 922
 		{
923 923
 			$isStartmenuInclude = true;
924 924
 		}
925 925
 
926
-		if(!$isStartmenuInclude && is_array($originMenu['list']))
926
+		if (!$isStartmenuInclude && is_array($originMenu['list']))
927 927
 		{
928
-			foreach($originMenu['list'] AS $key=>$value)
928
+			foreach ($originMenu['list'] AS $key=>$value)
929 929
 			{
930 930
 				$this->_checkHomeMenuInOriginMenu($value, $startMid, $isStartmenuInclude);
931 931
 			}
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
 		$args->menu_srl = $menuSrl;
940 940
 		$args->menu_item_srl = $node['node_srl'];
941 941
 		$output = executeQuery("menu.deleteMenuItem", $args);
942
-		if(!$output->toBool())
942
+		if (!$output->toBool())
943 943
 		{
944 944
 			$oDB->rollback();
945 945
 			return $output;
@@ -948,12 +948,12 @@  discard block
 block discarded – undo
948 948
 		// Update the xml file and get its location
949 949
 		$xml_file = $this->makeXmlFile($args->menu_srl);
950 950
 		// Delete all of image buttons
951
-		if($node['normal_btn']) FileHandler::removeFile($node['normal_btn']);
952
-		if($node['hover_btn']) FileHandler::removeFile($node['hover_btn']);
953
-		if($node['active_btn']) FileHandler::removeFile($node['active_btn']);
951
+		if ($node['normal_btn']) FileHandler::removeFile($node['normal_btn']);
952
+		if ($node['hover_btn']) FileHandler::removeFile($node['hover_btn']);
953
+		if ($node['active_btn']) FileHandler::removeFile($node['active_btn']);
954 954
 
955 955
 		// Delete module
956
-		if($node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
956
+		if ($node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
957 957
 		{
958 958
 			$oModuleController = getController('module');
959 959
 			$oModuleModel = getModel('module');
@@ -963,12 +963,12 @@  discard block
 block discarded – undo
963 963
 			$args->site_srl = $menuInfo->site_srl;
964 964
 			$args->is_shortcut = 'Y';
965 965
 			$output = executeQuery('menu.getMenuItemByUrl', $args);
966
-			if($output->data->menu_item_srl)
966
+			if ($output->data->menu_item_srl)
967 967
 			{
968 968
 				$output->data->url = '';
969 969
 				$referenceItem = $output->data;
970 970
 				$output = $this->_updateMenuItem($referenceItem);
971
-				if(!$output->toBool())
971
+				if (!$output->toBool())
972 972
 				{
973 973
 					$oDB->rollback();
974 974
 					return $output;
@@ -976,10 +976,10 @@  discard block
 block discarded – undo
976 976
 			}
977 977
 
978 978
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($node['url'], $menuInfo->site_srl);
979
-			if($moduleInfo->module_srl)
979
+			if ($moduleInfo->module_srl)
980 980
 			{
981 981
 				$output = $oModuleController->onlyDeleteModule($moduleInfo->module_srl);
982
-				if(!$output->toBool())
982
+				if (!$output->toBool())
983 983
 				{
984 984
 					$oDB->rollback();
985 985
 					return $output;
@@ -992,14 +992,14 @@  discard block
 block discarded – undo
992 992
 	private function _recursiveDeleteMenuItem(&$oDB, &$menuInfo, $node)
993 993
 	{
994 994
 		$output = $this->_deleteMenuItem($oDB, $menuInfo, $node);
995
-		if(!$output->toBool())
995
+		if (!$output->toBool())
996 996
 		{
997 997
 			return new Object(-1, $output->message);
998 998
 		}
999 999
 
1000
-		if(is_array($node['list']))
1000
+		if (is_array($node['list']))
1001 1001
 		{
1002
-			foreach($node['list'] AS $key=>$value)
1002
+			foreach ($node['list'] AS $key=>$value)
1003 1003
 			{
1004 1004
 				$this->_recursiveDeleteMenuItem($oDB, $menuInfo, $value);
1005 1005
 			}
@@ -1012,31 +1012,31 @@  discard block
 block discarded – undo
1012 1012
 	 */
1013 1013
 	function procMenuAdminMoveItem()
1014 1014
 	{
1015
-		$mode = Context::get('mode');	//move
1016
-		$parent_srl = Context::get('parent_srl');	// Parent menu item serial number
1017
-		$source_srl = Context::get('source_srl');	// Same hierarchy's menu item serial number
1018
-		$target_srl = Context::get('target_srl');	// Self menu item serial number
1015
+		$mode = Context::get('mode'); //move
1016
+		$parent_srl = Context::get('parent_srl'); // Parent menu item serial number
1017
+		$source_srl = Context::get('source_srl'); // Same hierarchy's menu item serial number
1018
+		$target_srl = Context::get('target_srl'); // Self menu item serial number
1019 1019
 
1020
-		if(!$mode || !$parent_srl || !$target_srl) return new Object(-1,'msg_invalid_request');
1020
+		if (!$mode || !$parent_srl || !$target_srl) return new Object(-1, 'msg_invalid_request');
1021 1021
 
1022 1022
 		$oMenuAdminModel = getAdminModel('menu');
1023 1023
 
1024 1024
 		// get original menu item info for cache file recreate
1025 1025
 		$originalItemInfo = $oMenuAdminModel->getMenuItemInfo($target_srl);
1026
-		if(!$originalItemInfo->menu_item_srl)
1026
+		if (!$originalItemInfo->menu_item_srl)
1027 1027
 		{
1028 1028
 			return new Object(-1, 'msg_empty_menu_item');
1029 1029
 		}
1030 1030
 
1031 1031
 		// get menu properies with child menu
1032
-		$phpFile = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $originalItemInfo->menu_srl);
1032
+		$phpFile = sprintf(_XE_PATH_."files/cache/menu/%s.php", $originalItemInfo->menu_srl);
1033 1033
 		$originMenu = NULL;
1034 1034
 
1035
-		if(is_readable(FileHandler::getRealPath($phpFile)))
1035
+		if (is_readable(FileHandler::getRealPath($phpFile)))
1036 1036
 		{
1037 1037
 			include(FileHandler::getRealPath($phpFile));
1038 1038
 
1039
-			if(is_array($menu->list))
1039
+			if (is_array($menu->list))
1040 1040
 			{
1041 1041
 				$this->_searchMenu($menu->list, $originalItemInfo->menu_item_srl, $originMenu);
1042 1042
 			}
@@ -1045,7 +1045,7 @@  discard block
 block discarded – undo
1045 1045
 		// get target menu info for move
1046 1046
 		$targetMenuItemInfo = $oMenuAdminModel->getMenuItemInfo($parent_srl);
1047 1047
 		// if move in same sitemap
1048
-		if($targetMenuItemInfo->menu_item_srl)
1048
+		if ($targetMenuItemInfo->menu_item_srl)
1049 1049
 		{
1050 1050
 			$menu_srl = $targetMenuItemInfo->menu_srl;
1051 1051
 		}
@@ -1057,20 +1057,20 @@  discard block
 block discarded – undo
1057 1057
 			$parent_srl = 0;
1058 1058
 		}
1059 1059
 
1060
-		if(!$this->homeModuleMid)
1060
+		if (!$this->homeModuleMid)
1061 1061
 		{
1062 1062
 			$oModuleModel = getModel('module');
1063 1063
 			$oMenuAdminController = getAdminController('menu');
1064 1064
 			$columnList = array('modules.mid',);
1065 1065
 			$output = $oModuleModel->getSiteInfo(0, $columnList);
1066
-			if($output->mid)
1066
+			if ($output->mid)
1067 1067
 			{
1068 1068
 				$this->homeModuleMid = $output->mid;
1069 1069
 			}
1070 1070
 		}
1071 1071
 
1072 1072
 		$this->moveMenuItem($menu_srl, $parent_srl, $source_srl, $target_srl, $mode, $originMenu['is_shortcut'], $originMenu['url']);
1073
-		if(count($originMenu['list']) > 0)
1073
+		if (count($originMenu['list']) > 0)
1074 1074
 		{
1075 1075
 			$this->_recursiveUpdateMenuItem($originMenu['list'], $menu_srl);
1076 1076
 		}
@@ -1084,9 +1084,9 @@  discard block
 block discarded – undo
1084 1084
 
1085 1085
 	private function _recursiveUpdateMenuItem($node, $menu_srl)
1086 1086
 	{
1087
-		if(is_array($node))
1087
+		if (is_array($node))
1088 1088
 		{
1089
-			foreach($node AS $key=>$node)
1089
+			foreach ($node AS $key=>$node)
1090 1090
 			{
1091 1091
 				$args = new stdClass();
1092 1092
 				$args->menu_srl = $menu_srl;
@@ -1094,11 +1094,11 @@  discard block
 block discarded – undo
1094 1094
 				$output = $this->_updateMenuItem($args);
1095 1095
 
1096 1096
 				//module's menu_srl move also
1097
-				if($node['is_shortcut'] == 'N' && !empty($node['url']))
1097
+				if ($node['is_shortcut'] == 'N' && !empty($node['url']))
1098 1098
 				{
1099 1099
 					$oModuleModel = getModel('module');
1100 1100
 					$moduleInfo = $oModuleModel->getModuleInfoByMid($node['url']);
1101
-					if($menu_srl != $moduleInfo->menu_srl)
1101
+					if ($menu_srl != $moduleInfo->menu_srl)
1102 1102
 					{
1103 1103
 						$moduleInfo->menu_srl = $menu_srl;
1104 1104
 						$oModuleController = getController('module');
@@ -1106,7 +1106,7 @@  discard block
 block discarded – undo
1106 1106
 					}
1107 1107
 				}
1108 1108
 
1109
-				if(count($node['list']) > 0)
1109
+				if (count($node['list']) > 0)
1110 1110
 				{
1111 1111
 					$this->_recursiveUpdateMenuItem($node['list'], $menu_srl);
1112 1112
 				}
@@ -1128,21 +1128,21 @@  discard block
 block discarded – undo
1128 1128
 		$menuSrl = $itemInfo->menu_srl;
1129 1129
 
1130 1130
 		// get menu properies with child menu
1131
-		$phpFile = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menuSrl);
1131
+		$phpFile = sprintf(_XE_PATH_."files/cache/menu/%s.php", $menuSrl);
1132 1132
 		$originMenu = NULL;
1133 1133
 
1134
-		if(is_readable(FileHandler::getRealPath($phpFile)))
1134
+		if (is_readable(FileHandler::getRealPath($phpFile)))
1135 1135
 		{
1136 1136
 			include(FileHandler::getRealPath($phpFile));
1137 1137
 
1138
-			if(is_array($menu->list))
1138
+			if (is_array($menu->list))
1139 1139
 			{
1140 1140
 				$this->_searchMenu($menu->list, $menuItemSrl, $originMenu);
1141 1141
 			}
1142 1142
 		}
1143 1143
 
1144 1144
 		// copy the menu item with recursively
1145
-		if(is_array($originMenu))
1145
+		if (is_array($originMenu))
1146 1146
 		{
1147 1147
 			$this->_copyMenu($menuSrl, $parentSrl, $originMenu);
1148 1148
 		}
@@ -1158,15 +1158,15 @@  discard block
 block discarded – undo
1158 1158
 	 */
1159 1159
 	private function _searchMenu(&$menuList, $menuItemSrl, &$originMenu)
1160 1160
 	{
1161
-		if(array_key_exists($menuItemSrl, $menuList))
1161
+		if (array_key_exists($menuItemSrl, $menuList))
1162 1162
 		{
1163 1163
 			$originMenu = $menuList[$menuItemSrl];
1164 1164
 			return;
1165 1165
 		}
1166 1166
 
1167
-		foreach($menuList AS $key=>$value)
1167
+		foreach ($menuList AS $key=>$value)
1168 1168
 		{
1169
-			if(count($value['list']) > 0)
1169
+			if (count($value['list']) > 0)
1170 1170
 			{
1171 1171
 				$this->_searchMenu($value['list'], $menuItemSrl, $originMenu);
1172 1172
 			}
@@ -1181,7 +1181,7 @@  discard block
 block discarded – undo
1181 1181
 		// default argument setting
1182 1182
 		$args = new stdClass();
1183 1183
 		$args->menu_srl = $menuSrl;
1184
-		if($parentSrl == 0) $args->parent_srl = $menuSrl;
1184
+		if ($parentSrl == 0) $args->parent_srl = $menuSrl;
1185 1185
 		else $args->parent_srl = $parentSrl;
1186 1186
 		$args->menu_name_key = $originMenu['text'];
1187 1187
 		$args->menu_name = $originMenu['text'];
@@ -1194,7 +1194,7 @@  discard block
 block discarded – undo
1194 1194
 
1195 1195
 		$isModuleCopySuccess = false;
1196 1196
 		// if menu have a reference of module instance
1197
-		if($menuItemInfo->is_shortcut == 'N' && strncasecmp('http', $originMenu['url'], 4) !== 0 )
1197
+		if ($menuItemInfo->is_shortcut == 'N' && strncasecmp('http', $originMenu['url'], 4) !== 0)
1198 1198
 		{
1199 1199
 			$oModuleModel = getModel('module');
1200 1200
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($originMenu['url']);
@@ -1214,22 +1214,22 @@  discard block
 block discarded – undo
1214 1214
 
1215 1215
 			$args->module_srl = $copiedModuleSrl;
1216 1216
 
1217
-			if($copiedModuleSrl)
1217
+			if ($copiedModuleSrl)
1218 1218
 			{
1219 1219
 				$isModuleCopySuccess = true;
1220 1220
 			}
1221 1221
 		}
1222 1222
 		// if menu type is shortcut
1223
-		else if($menuItemInfo->is_shortcut == 'Y')
1223
+		else if ($menuItemInfo->is_shortcut == 'Y')
1224 1224
 		{
1225 1225
 			$args->shortcut_target = $originMenu['url'];
1226 1226
 			$isModuleCopySuccess = true;
1227 1227
 		}
1228 1228
 
1229
-		if($isModuleCopySuccess)
1229
+		if ($isModuleCopySuccess)
1230 1230
 		{
1231 1231
 			// if have a group permission
1232
-			if($menuItemInfo->group_srls)
1232
+			if ($menuItemInfo->group_srls)
1233 1233
 			{
1234 1234
 				$args->group_srls = $menuItemInfo->group_srls;
1235 1235
 			}
@@ -1243,12 +1243,12 @@  discard block
 block discarded – undo
1243 1243
 
1244 1244
 			// if have a button, copy a button image also
1245 1245
 			$insertedMenuItemSrl = $this->get('menu_item_srl');
1246
-			if($menuItemInfo->normal_btn || $menuItemInfo->hover_btn || $menuItemInfo->active_btn)
1246
+			if ($menuItemInfo->normal_btn || $menuItemInfo->hover_btn || $menuItemInfo->active_btn)
1247 1247
 			{
1248 1248
 				// copy & upate
1249 1249
 				$update_item_info = $oMenuAdminModel->getMenuItemInfo($insertedMenuItemSrl);
1250
-				$copied_info = $this->_copyButton($insertedMenuItemSrl,$update_item_info->menu_srl, $menuItemInfo);
1251
-				if(count($update_item_info->group_srls) == 0)
1250
+				$copied_info = $this->_copyButton($insertedMenuItemSrl, $update_item_info->menu_srl, $menuItemInfo);
1251
+				if (count($update_item_info->group_srls) == 0)
1252 1252
 				{
1253 1253
 					unset($update_item_info->group_srls);
1254 1254
 				}
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
 
1263 1263
 		// if have a child menu, copy child menu also
1264 1264
 		$childMenu = array_shift($originMenu['list']);
1265
-		if(count($childMenu) > 0)
1265
+		if (count($childMenu) > 0)
1266 1266
 		{
1267 1267
 			$this->_copyMenu($menuSrl, $insertedMenuItemSrl, $childMenu);
1268 1268
 		}
@@ -1272,10 +1272,10 @@  discard block
 block discarded – undo
1272 1272
 	{
1273 1273
 		$time = $_SERVER['REQUEST_TIME'];
1274 1274
 		$randomString = "";
1275
-		for($i=0;$i<4;$i++)
1275
+		for ($i = 0; $i < 4; $i++)
1276 1276
 		{
1277 1277
 			$case = rand(0, 1);
1278
-			if($case) $doc = rand(65, 90);
1278
+			if ($case) $doc = rand(65, 90);
1279 1279
 			else $doc = rand(97, 122);
1280 1280
 
1281 1281
 			$randomString .= chr($doc);
@@ -1299,32 +1299,32 @@  discard block
 block discarded – undo
1299 1299
 		// menu name update
1300 1300
 		$args->menu_srl = $this->menuSrl;
1301 1301
 		$output = executeQuery('menu.updateMenu', $args);
1302
-		if(!$output->toBool()) return $output;
1302
+		if (!$output->toBool()) return $output;
1303 1303
 
1304 1304
 		$this->map = array();
1305
-		if(is_array($parentKeyList))
1305
+		if (is_array($parentKeyList))
1306 1306
 		{
1307
-			foreach($parentKeyList as $no=>$srl)
1307
+			foreach ($parentKeyList as $no=>$srl)
1308 1308
 			{
1309
-				if($srl === 0) continue;
1310
-				if(!is_array($this->map[$srl]))$this->map[$srl] = array();
1309
+				if ($srl === 0) continue;
1310
+				if (!is_array($this->map[$srl]))$this->map[$srl] = array();
1311 1311
 				$this->map[$srl][] = $no;
1312 1312
 			}
1313 1313
 		}
1314 1314
 
1315 1315
 		$result = array();
1316
-		if(is_array($this->itemKeyList))
1316
+		if (is_array($this->itemKeyList))
1317 1317
 		{
1318
-			foreach($this->itemKeyList as $srl)
1318
+			foreach ($this->itemKeyList as $srl)
1319 1319
 			{
1320
-				if(!$this->checked[$srl])
1320
+				if (!$this->checked[$srl])
1321 1321
 				{
1322 1322
 					$target = new stdClass();
1323 1323
 					$this->checked[$srl] = 1;
1324 1324
 					$target->node = $srl;
1325
-					$target->child= array();
1325
+					$target->child = array();
1326 1326
 
1327
-					while(count($this->map[$srl]))
1327
+					while (count($this->map[$srl]))
1328 1328
 					{
1329 1329
 						$this->_setParent($srl, array_shift($this->map[$srl]), $target);
1330 1330
 					}
@@ -1333,13 +1333,13 @@  discard block
 block discarded – undo
1333 1333
 			}
1334 1334
 		}
1335 1335
 
1336
-		if(is_array($result))
1336
+		if (is_array($result))
1337 1337
 		{
1338 1338
 			$i = 0;
1339
-			foreach($result AS $key=>$node)
1339
+			foreach ($result AS $key=>$node)
1340 1340
 			{
1341
-				$this->moveMenuItem($this->menuSrl, 0, $i, $node->node, 'move');	//move parent node
1342
-				$this->_recursiveMoveMenuItem($node);	//move child node
1341
+				$this->moveMenuItem($this->menuSrl, 0, $i, $node->node, 'move'); //move parent node
1342
+				$this->_recursiveMoveMenuItem($node); //move child node
1343 1343
 				$i = $node->node;
1344 1344
 			}
1345 1345
 		}
@@ -1368,7 +1368,7 @@  discard block
 block discarded – undo
1368 1368
 		$child_node->child = array();
1369 1369
 		$target->child[] = $child_node;
1370 1370
 
1371
-		while(count($this->map[$child_srl]))
1371
+		while (count($this->map[$child_srl]))
1372 1372
 		{
1373 1373
 			$this->_setParent($child_srl, array_shift($this->map[$child_srl]), $child_node);
1374 1374
 		}
@@ -1383,7 +1383,7 @@  discard block
 block discarded – undo
1383 1383
 	function _recursiveMoveMenuItem($result)
1384 1384
 	{
1385 1385
 		$i = 0;
1386
-		while(count($result->child))
1386
+		while (count($result->child))
1387 1387
 		{
1388 1388
 			unset($node);
1389 1389
 			$node = array_shift($result->child);
@@ -1403,48 +1403,48 @@  discard block
 block discarded – undo
1403 1403
 	 * @param string $mode 'move' or 'insert'
1404 1404
 	 * @return void
1405 1405
 	 */
1406
-	function moveMenuItem($menu_srl, $parent_srl, $source_srl, $target_srl, $mode, $isShortcut='Y', $url=NULL)
1406
+	function moveMenuItem($menu_srl, $parent_srl, $source_srl, $target_srl, $mode, $isShortcut = 'Y', $url = NULL)
1407 1407
 	{
1408 1408
 		// Get the original menus
1409 1409
 		$oMenuAdminModel = getAdminModel('menu');
1410 1410
 
1411 1411
 		$target_item = $oMenuAdminModel->getMenuItemInfo($target_srl);
1412
-		if($target_item->menu_item_srl != $target_srl) return new Object(-1,'msg_invalid_request');
1412
+		if ($target_item->menu_item_srl != $target_srl) return new Object(-1, 'msg_invalid_request');
1413 1413
 		// Move the menu location(change the order menu appears)
1414
-		if($mode == 'move')
1414
+		if ($mode == 'move')
1415 1415
 		{
1416 1416
 			$args = new stdClass();
1417 1417
 			$args->parent_srl = $parent_srl;
1418 1418
 			$args->menu_srl = $menu_srl;
1419 1419
 
1420
-			if($source_srl)
1420
+			if ($source_srl)
1421 1421
 			{
1422 1422
 				$source_item = $oMenuAdminModel->getMenuItemInfo($source_srl);
1423
-				if($source_item->menu_item_srl != $source_srl) return new Object(-1,'msg_invalid_request');
1424
-				$args->listorder = $source_item->listorder-1;
1423
+				if ($source_item->menu_item_srl != $source_srl) return new Object(-1, 'msg_invalid_request');
1424
+				$args->listorder = $source_item->listorder - 1;
1425 1425
 			}
1426 1426
 			else
1427 1427
 			{
1428 1428
 				$output = executeQuery('menu.getMaxListorder', $args);
1429
-				if(!$output->toBool()) return $output;
1430
-				$args->listorder = (int)$output->data->listorder;
1431
-				if(!$args->listorder) $args->listorder= 0;
1429
+				if (!$output->toBool()) return $output;
1430
+				$args->listorder = (int) $output->data->listorder;
1431
+				if (!$args->listorder) $args->listorder = 0;
1432 1432
 			}
1433 1433
 			$args->parent_srl = $parent_srl;
1434 1434
 			$output = executeQuery('menu.updateMenuItemListorder', $args);
1435
-			if(!$output->toBool()) return $output;
1435
+			if (!$output->toBool()) return $output;
1436 1436
 
1437 1437
 			$args->parent_srl = $parent_srl;
1438 1438
 			$args->menu_item_srl = $target_srl;
1439 1439
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1440
-			if(!$output->toBool()) return $output;
1440
+			if (!$output->toBool()) return $output;
1441 1441
 
1442 1442
 			//module's menu_srl move also
1443
-			if($isShortcut == 'N' && !empty($url))
1443
+			if ($isShortcut == 'N' && !empty($url))
1444 1444
 			{
1445 1445
 				$oModuleModel = getModel('module');
1446 1446
 				$moduleInfo = $oModuleModel->getModuleInfoByMid($url);
1447
-				if($menu_srl != $moduleInfo->menu_srl)
1447
+				if ($menu_srl != $moduleInfo->menu_srl)
1448 1448
 				{
1449 1449
 					$moduleInfo->menu_srl = $menu_srl;
1450 1450
 					$oModuleController = getController('module');
@@ -1452,13 +1452,13 @@  discard block
 block discarded – undo
1452 1452
 				}
1453 1453
 
1454 1454
 				// change home menu cache file
1455
-				if($url == $this->homeModuleMid)
1455
+				if ($url == $this->homeModuleMid)
1456 1456
 				{
1457
-					if(file_exists($this->homeMenuCacheFile))
1457
+					if (file_exists($this->homeMenuCacheFile))
1458 1458
 					{
1459 1459
 						include($this->homeMenuCacheFile);
1460 1460
 					}
1461
-					if(!$homeMenuSrl || $homeMenuSrl != $menu_srl)
1461
+					if (!$homeMenuSrl || $homeMenuSrl != $menu_srl)
1462 1462
 					{
1463 1463
 						$this->makeHomemenuCacheFile($menu_srl);
1464 1464
 					}
@@ -1466,13 +1466,13 @@  discard block
 block discarded – undo
1466 1466
 			}
1467 1467
 			// Add a child
1468 1468
 		}
1469
-		elseif($mode == 'insert')
1469
+		elseif ($mode == 'insert')
1470 1470
 		{
1471 1471
 			$args->menu_item_srl = $target_srl;
1472 1472
 			$args->parent_srl = $parent_srl;
1473
-			$args->listorder = -1*getNextSequence();
1473
+			$args->listorder = -1 * getNextSequence();
1474 1474
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1475
-			if(!$output->toBool()) return $output;
1475
+			if (!$output->toBool()) return $output;
1476 1476
 		}
1477 1477
 
1478 1478
 		$xml_file = $this->makeXmlFile($menu_srl);
@@ -1497,8 +1497,8 @@  discard block
 block discarded – undo
1497 1497
 		// Re-generate the xml file
1498 1498
 		$xml_file = $this->makeXmlFile($menu_srl);
1499 1499
 		// Set return value
1500
-		$this->add('menu_title',$menu_title);
1501
-		$this->add('xml_file',$xml_file);
1500
+		$this->add('menu_title', $menu_title);
1501
+		$this->add('xml_file', $xml_file);
1502 1502
 	}
1503 1503
 
1504 1504
 	/**
@@ -1512,12 +1512,12 @@  discard block
 block discarded – undo
1512 1512
 		$target = Context::get('target');
1513 1513
 		$target_file = Context::get($target);
1514 1514
 		// Error occurs when the target is neither a uploaded file nor a valid file
1515
-		if(!$menu_srl || !$menu_item_srl)
1515
+		if (!$menu_srl || !$menu_item_srl)
1516 1516
 		{
1517 1517
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1518 1518
 
1519 1519
 		}
1520
-		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']))
1520
+		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 1521
 		{
1522 1522
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1523 1523
 		}
@@ -1525,13 +1525,13 @@  discard block
 block discarded – undo
1525 1525
 		// Move the file to a specific director if the uploaded file meets requirement
1526 1526
 		else
1527 1527
 		{
1528
-			$tmp_arr = explode('.',$target_file['name']);
1529
-			$ext = $tmp_arr[count($tmp_arr)-1];
1528
+			$tmp_arr = explode('.', $target_file['name']);
1529
+			$ext = $tmp_arr[count($tmp_arr) - 1];
1530 1530
 
1531 1531
 			$path = sprintf('./files/attach/menu_button/%d/', $menu_srl);
1532 1532
 			$filename = sprintf('%s%d.%s.%s', $path, $menu_item_srl, $target, $ext);
1533 1533
 
1534
-			if(!is_dir($path)) FileHandler::makeDir($path);
1534
+			if (!is_dir($path)) FileHandler::makeDir($path);
1535 1535
 
1536 1536
 			move_uploaded_file($target_file['tmp_name'], $filename);
1537 1537
 			Context::set('filename', $filename);
@@ -1564,14 +1564,14 @@  discard block
 block discarded – undo
1564 1564
 	{
1565 1565
 		$oModuleModel = getModel('module');
1566 1566
 		$installed_module_list = $oModuleModel->getModulesXmlInfo();
1567
-		if(is_array($installed_module_list))
1567
+		if (is_array($installed_module_list))
1568 1568
 		{
1569 1569
 			$currentLang = Context::getLangType();
1570 1570
 			$menuList = array();
1571
-			foreach($installed_module_list AS $key=>$value)
1571
+			foreach ($installed_module_list AS $key=>$value)
1572 1572
 			{
1573 1573
 				$info = $oModuleModel->getModuleActionXml($value->module);
1574
-				if($info->menu) $menuList[$value->module] = $info->menu;
1574
+				if ($info->menu) $menuList[$value->module] = $info->menu;
1575 1575
 				unset($info->menu);
1576 1576
 			}
1577 1577
 		}
@@ -1603,8 +1603,8 @@  discard block
 block discarded – undo
1603 1603
 		$info = $oModuleModel->getModuleActionXml($moduleName);
1604 1604
 
1605 1605
 		$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->menu->{$menuName}->index);
1606
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1607
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');
1606
+		if (empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1607
+		if (empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');
1608 1608
 		$dbInfo = Context::getDBInfo();
1609 1609
 
1610 1610
 		$args = new stdClass();
@@ -1613,7 +1613,7 @@  discard block
 block discarded – undo
1613 1613
 		$args->menu_srl = $requestArgs->menu_srl;
1614 1614
 		$args->name = sprintf('{$lang->menu_gnb_sub[\'%s\']}', $menuName);
1615 1615
 		//if now page is https...
1616
-		if(strpos($url, 'https') !== false)
1616
+		if (strpos($url, 'https') !== false)
1617 1617
 		{
1618 1618
 			$args->url = str_replace('https'.substr($dbInfo->default_url, 4), '', $url);
1619 1619
 		}
@@ -1627,23 +1627,23 @@  discard block
 block discarded – undo
1627 1627
 		$args->hover_btn = '';
1628 1628
 		$args->active_btn = '';
1629 1629
 		$args->group_srls = implode(',', array_keys($groupSrlList));
1630
-		$args->listorder = -1*$args->menu_item_srl;
1630
+		$args->listorder = -1 * $args->menu_item_srl;
1631 1631
 
1632 1632
 		// Check if already exists
1633 1633
 		$oMenuModel = getAdminModel('menu');
1634 1634
 		$item_info = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
1635 1635
 		// Update if exists
1636
-		if($item_info->menu_item_srl == $args->menu_item_srl)
1636
+		if ($item_info->menu_item_srl == $args->menu_item_srl)
1637 1637
 		{
1638 1638
 			$output = $this->_updateMenuItem($args);
1639
-			if(!$output->toBool()) return $output;
1639
+			if (!$output->toBool()) return $output;
1640 1640
 		}
1641 1641
 		// Insert if not exist
1642 1642
 		else
1643 1643
 		{
1644
-			$args->listorder = -1*$args->menu_item_srl;
1644
+			$args->listorder = -1 * $args->menu_item_srl;
1645 1645
 			$output = executeQuery('menu.insertMenuItem', $args);
1646
-			if(!$output->toBool()) return $output;
1646
+			if (!$output->toBool()) return $output;
1647 1647
 		}
1648 1648
 		// Get information of the menu
1649 1649
 		$menu_info = $oMenuModel->getMenu($args->menu_srl);
@@ -1671,23 +1671,23 @@  discard block
 block discarded – undo
1671 1671
 
1672 1672
 		// Menu Exposure update
1673 1673
 		// if exposure target is only login user...
1674
-		if(!$exposure)
1674
+		if (!$exposure)
1675 1675
 		{
1676 1676
 			$args->group_srls = '';
1677 1677
 		}
1678 1678
 		else
1679 1679
 		{
1680 1680
 			$exposure = explode(',', $exposure);
1681
-			if(in_array($exposure, array('-1','-3')))
1681
+			if (in_array($exposure, array('-1', '-3')))
1682 1682
 			{
1683 1683
 				$args->group_srls = $exposure;
1684 1684
 			}
1685 1685
 
1686
-			if($exposure) $args->group_srls = implode(',', $exposure);
1686
+			if ($exposure) $args->group_srls = implode(',', $exposure);
1687 1687
 		}
1688 1688
 
1689 1689
 		$output = $this->_updateMenuItem($args);
1690
-		if(!$output->toBool())
1690
+		if (!$output->toBool())
1691 1691
 		{
1692 1692
 			return $output;
1693 1693
 		}
@@ -1701,21 +1701,21 @@  discard block
 block discarded – undo
1701 1701
 		$moduleInfo = $oModuleModel->getModuleInfoByMid($itemInfo->url, $menuInfo->site_srl);
1702 1702
 		$xml_info = $oModuleModel->getModuleActionXML($moduleInfo->module);
1703 1703
 
1704
-		if($itemInfo->is_shortcut === 'Y')
1704
+		if ($itemInfo->is_shortcut === 'Y')
1705 1705
 		{
1706 1706
 			$moduleGrnatsArgs = new stdClass;
1707 1707
 			$moduleGrnatsArgs->module_srl = $moduleInfo->module_srl;
1708 1708
 			$output = executeQueryArray('module.getModuleGrants', $moduleGrnatsArgs);
1709
-			if(!$output->data) $output->data = array();
1709
+			if (!$output->data) $output->data = array();
1710 1710
 			$moduleGrnats = new stdClass();
1711
-			foreach($output->data as $grant)
1711
+			foreach ($output->data as $grant)
1712 1712
 			{
1713 1713
 				$moduleGrnats->{$grant->name}[] = $grant->group_srl;
1714 1714
 			}
1715 1715
 		}
1716 1716
 
1717 1717
 		$grantList = $xml_info->grant;
1718
-		if(!$grantList) $grantList = new stdClass;
1718
+		if (!$grantList) $grantList = new stdClass;
1719 1719
 
1720 1720
 		$grantList->access = new stdClass();
1721 1721
 		$grantList->access->default = 'guest';
@@ -1723,14 +1723,14 @@  discard block
 block discarded – undo
1723 1723
 		$grantList->manager->default = 'manager';
1724 1724
 
1725 1725
 		$grant = new stdClass();
1726
-		foreach($grantList AS $grantName=>$grantInfo)
1726
+		foreach ($grantList AS $grantName=>$grantInfo)
1727 1727
 		{
1728
-			if($htPerm[$grantName])
1728
+			if ($htPerm[$grantName])
1729 1729
 			{
1730 1730
 				$htPerm[$grantName] = explode(',', $htPerm[$grantName]);
1731 1731
 
1732 1732
 				// users in a particular group
1733
-				if(is_array($htPerm[$grantName]))
1733
+				if (is_array($htPerm[$grantName]))
1734 1734
 				{
1735 1735
 					$grant->{$grantName} = $htPerm[$grantName];
1736 1736
 					continue;
@@ -1742,13 +1742,13 @@  discard block
 block discarded – undo
1742 1742
 					continue;
1743 1743
 				}
1744 1744
 			}
1745
-			else if($itemInfo->is_shortcut === 'Y')
1745
+			else if ($itemInfo->is_shortcut === 'Y')
1746 1746
 			{
1747
-				if(isset($moduleGrnats) && $moduleGrnats->{$grantName}) $grant->{$grantName} = $moduleGrnats->{$grantName};
1747
+				if (isset($moduleGrnats) && $moduleGrnats->{$grantName}) $grant->{$grantName} = $moduleGrnats->{$grantName};
1748 1748
 			}
1749 1749
 		}
1750 1750
 
1751
-		if(count($grant))
1751
+		if (count($grant))
1752 1752
 		{
1753 1753
 			$oModuleController = getController('module');
1754 1754
 			$oModuleController->insertModuleGrants($moduleInfo->module_srl, $grant);
@@ -1766,15 +1766,15 @@  discard block
 block discarded – undo
1766 1766
 	function makeXmlFile($menu_srl)
1767 1767
 	{
1768 1768
 		// Return if there is no information when creating the xml file
1769
-		if(!$menu_srl) return;
1769
+		if (!$menu_srl) return;
1770 1770
 		// Get menu informaton
1771 1771
 		$args = new stdClass();
1772 1772
 		$args->menu_srl = $menu_srl;
1773 1773
 		$output = executeQuery('menu.getMenu', $args);
1774
-		if(!$output->toBool() || !$output->data) return $output;
1775
-		$site_srl = (int)$output->data->site_srl;
1774
+		if (!$output->toBool() || !$output->data) return $output;
1775
+		$site_srl = (int) $output->data->site_srl;
1776 1776
 
1777
-		if($site_srl)
1777
+		if ($site_srl)
1778 1778
 		{
1779 1779
 			$oModuleModel = getModel('module');
1780 1780
 			$columnList = array('sites.domain');
@@ -1785,13 +1785,13 @@  discard block
 block discarded – undo
1785 1785
 		$args->menu_srl = $menu_srl;
1786 1786
 		$args->sort_index = 'listorder';
1787 1787
 		$output = executeQuery('menu.getMenuItems', $args);
1788
-		if(!$output->toBool()) return;
1788
+		if (!$output->toBool()) return;
1789 1789
 		// Specify the name of the cache file
1790
-		$xml_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.xml.php", $menu_srl);
1791
-		$php_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menu_srl);
1790
+		$xml_file = sprintf(_XE_PATH_."files/cache/menu/%s.xml.php", $menu_srl);
1791
+		$php_file = sprintf(_XE_PATH_."files/cache/menu/%s.php", $menu_srl);
1792 1792
 		// If no data found, generate an XML file without node data
1793 1793
 		$list = $output->data;
1794
-		if(!$list)
1794
+		if (!$list)
1795 1795
 		{
1796 1796
 			$xml_buff = "<root />";
1797 1797
 			FileHandler::writeFile($xml_file, $xml_buff);
@@ -1799,10 +1799,10 @@  discard block
 block discarded – undo
1799 1799
 			return $xml_file;
1800 1800
 		}
1801 1801
 		// Change to an array if only a single data is obtained
1802
-		if(!is_array($list)) $list = array($list);
1802
+		if (!is_array($list)) $list = array($list);
1803 1803
 		// Create a tree for loop
1804 1804
 		$list_count = count($list);
1805
-		for($i=0;$i<$list_count;$i++)
1805
+		for ($i = 0; $i < $list_count; $i++)
1806 1806
 		{
1807 1807
 			$node = $list[$i];
1808 1808
 			$menu_item_srl = $node->menu_item_srl;
@@ -1858,7 +1858,7 @@  discard block
 block discarded – undo
1858 1858
 		$php_buff = sprintf(
1859 1859
 			'<?php '.
1860 1860
 			'if(!defined("__XE__")) exit(); '.
1861
-			'$menu = new stdClass();' .
1861
+			'$menu = new stdClass();'.
1862 1862
 			'%s; '.
1863 1863
 			'%s; '.
1864 1864
 			'$menu->list = array(%s); '.
@@ -1887,26 +1887,26 @@  discard block
 block discarded – undo
1887 1887
 	 */
1888 1888
 	function getXmlTree($source_node, $tree, $site_srl, $domain)
1889 1889
 	{
1890
-		if(!$source_node) return;
1890
+		if (!$source_node) return;
1891 1891
 
1892 1892
 		$oMenuAdminModel = getAdminModel('menu');
1893 1893
 
1894
-		foreach($source_node as $menu_item_srl => $node)
1894
+		foreach ($source_node as $menu_item_srl => $node)
1895 1895
 		{
1896 1896
 			$child_buff = "";
1897 1897
 			// Get data of the child nodes
1898
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
1898
+			if ($menu_item_srl && $tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
1899 1899
 			// List variables
1900 1900
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1901
-			foreach($names as $key => $val)
1901
+			foreach ($names as $key => $val)
1902 1902
 			{
1903
-				$name_arr_str .= sprintf('"%s"=>\'%s\',',$key, str_replace(array('\\', '\''), array('\\\\', '\\\''), $val));
1903
+				$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\', '\''), array('\\\\', '\\\''), $val));
1904 1904
 			}
1905 1905
 			$name_str = sprintf('$_names = array(%s); print $_names[$lang_type];', $name_arr_str);
1906 1906
 
1907
-			$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
1908
-			$desc = str_replace(array('&','"',"'"),array('&amp;','&quot;','\\\''),$node->desc);
1909
-			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url))
1907
+			$url = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->url);
1908
+			$desc = str_replace(array('&', '"', "'"), array('&amp;', '&quot;', '\\\''), $node->desc);
1909
+			if (preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url))
1910 1910
 			{
1911 1911
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
1912 1912
 			}
@@ -1916,21 +1916,21 @@  discard block
 block discarded – undo
1916 1916
 			$expand = $node->expand;
1917 1917
 
1918 1918
 			$normal_btn = $node->normal_btn;
1919
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
1919
+			if ($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $normal_btn);
1920 1920
 			else $normal_btn = '';
1921 1921
 			$hover_btn = $node->hover_btn;
1922
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
1922
+			if ($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $hover_btn);
1923 1923
 			else $hover_btn = '';
1924 1924
 			$active_btn = $node->active_btn;
1925
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
1925
+			if ($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $active_btn);
1926 1926
 			else $active_btn = '';
1927 1927
 
1928 1928
 			$group_srls = $node->group_srls;
1929 1929
 
1930
-			if($normal_btn)
1930
+			if ($normal_btn)
1931 1931
 			{
1932
-				if($hover_btn) $hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn); else $hover_str = '';
1933
-				if($active_btn) $active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn); else $active_str = '';
1932
+				if ($hover_btn) $hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn); else $hover_str = '';
1933
+				if ($active_btn) $active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn); else $active_str = '';
1934 1934
 				$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);
1935 1935
 			}
1936 1936
 			else
@@ -1938,7 +1938,7 @@  discard block
 block discarded – undo
1938 1938
 				$link = '<?php print $_names[$lang_type]; ?>';
1939 1939
 			}
1940 1940
 			// If the value of node->group_srls exists
1941
-			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);
1941
+			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);
1942 1942
 			else $group_check_code = "true";
1943 1943
 			$attribute = sprintf(
1944 1944
 				'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 }?>"',
@@ -1962,8 +1962,8 @@  discard block
 block discarded – undo
1962 1962
 				$link
1963 1963
 			);
1964 1964
 
1965
-			if($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
1966
-			else $buff .=  sprintf('<node %s />', $attribute);
1965
+			if ($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
1966
+			else $buff .= sprintf('<node %s />', $attribute);
1967 1967
 		}
1968 1968
 		return $buff;
1969 1969
 	}
@@ -1982,84 +1982,84 @@  discard block
 block discarded – undo
1982 1982
 	function getPhpCacheCode($source_node, $tree, $site_srl, $domain)
1983 1983
 	{
1984 1984
 		$output = array("buff"=>"", "url_list"=>array());
1985
-		if(!$source_node) return $output;
1985
+		if (!$source_node) return $output;
1986 1986
 
1987 1987
 		$oMenuAdminModel = getAdminModel('menu');
1988 1988
 
1989
-		foreach($source_node as $menu_item_srl => $node)
1989
+		foreach ($source_node as $menu_item_srl => $node)
1990 1990
 		{
1991 1991
 			// Get data from child nodes if exist.
1992
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
1992
+			if ($menu_item_srl && $tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
1993 1993
 			else $child_output = array("buff"=>"", "url_list"=>array());
1994 1994
 
1995 1995
 			// List variables
1996 1996
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1997 1997
 			unset($name_arr_str);
1998
-			foreach($names as $key => $val)
1998
+			foreach ($names as $key => $val)
1999 1999
 			{
2000
-				if(preg_match('/\{\$lang->menu_gnb(?:_sub)?\[\'([a-zA-Z_]+)\'\]\}/', $val) === 1)
2000
+				if (preg_match('/\{\$lang->menu_gnb(?:_sub)?\[\'([a-zA-Z_]+)\'\]\}/', $val) === 1)
2001 2001
 				{
2002 2002
 					$name_arr_str .= sprintf('"%s"=>"%s",', $key, $val);
2003 2003
 				}
2004 2004
 				else
2005 2005
 				{
2006
-					$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\','\''), array('\\\\','\\\''), removeHackTag($val)));
2006
+					$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\', '\''), array('\\\\', '\\\''), removeHackTag($val)));
2007 2007
 				}
2008 2008
 			}
2009 2009
 			$name_str = sprintf('$_menu_names[%d] = array(%s); %s', $node->menu_item_srl, $name_arr_str, $child_output['name']);
2010 2010
 
2011 2011
 			// If url value is not empty in the current node, put the value into an array url_list
2012
-			if($node->url) $child_output['url_list'][] = $node->url;
2012
+			if ($node->url) $child_output['url_list'][] = $node->url;
2013 2013
 			$output['url_list'] = array_merge($output['url_list'], $child_output['url_list']);
2014 2014
 			// If node->group_srls value exists
2015
-			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);
2015
+			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);
2016 2016
 			else $group_check_code = "true";
2017 2017
 
2018 2018
 			// List variables
2019
-			$href = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->href);
2020
-			$url = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->url);
2021
-			$desc = str_replace(array('&','"',"'"),array('&amp;','&quot;','\\\''),$node->desc);
2022
-			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
2019
+			$href = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->href);
2020
+			$url = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->url);
2021
+			$desc = str_replace(array('&', '"', "'"), array('&amp;', '&quot;', '\\\''), $node->desc);
2022
+			if (preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
2023 2023
 			{
2024 2024
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
2025 2025
 			}
2026 2026
 			else $href = sprintf('"%s"', $url);
2027 2027
 			$is_shortcut = $node->is_shortcut;
2028 2028
 			$open_window = $node->open_window;
2029
-			$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->normal_btn);
2030
-			$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->hover_btn);
2031
-			$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->active_btn);
2029
+			$normal_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->normal_btn);
2030
+			$hover_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->hover_btn);
2031
+			$active_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $node->active_btn);
2032 2032
 
2033
-			foreach($child_output['url_list'] as $key =>$val)
2033
+			foreach ($child_output['url_list'] as $key =>$val)
2034 2034
 			{
2035 2035
 				$child_output['url_list'][$key] = addslashes($val);
2036 2036
 			}
2037 2037
 
2038
-			$selected = '"'.implode('","',$child_output['url_list']).'"';
2038
+			$selected = '"'.implode('","', $child_output['url_list']).'"';
2039 2039
 			$child_buff = $child_output['buff'];
2040 2040
 			$expand = $node->expand;
2041 2041
 
2042 2042
 			$normal_btn = $node->normal_btn;
2043
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2043
+			if ($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $normal_btn);
2044 2044
 			else $normal_btn = '';
2045 2045
 
2046 2046
 			$hover_btn = $node->hover_btn;
2047
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2047
+			if ($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $hover_btn);
2048 2048
 			else $hover_btn = '';
2049 2049
 
2050 2050
 			$active_btn = $node->active_btn;
2051
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2051
+			if ($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $active_btn);
2052 2052
 			else $active_btn = '';
2053 2053
 
2054 2054
 
2055 2055
 			$group_srls = $node->group_srls;
2056 2056
 
2057
-			if($normal_btn)
2057
+			if ($normal_btn)
2058 2058
 			{
2059
-				if($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2060
-				if($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2059
+				if ($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2060
+				if ($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2061 2061
 				$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);
2062
-				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);
2062
+				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);
2063 2063
 				else $link_active = $link;
2064 2064
 			}
2065 2065
 			else
@@ -2097,7 +2097,7 @@  discard block
 block discarded – undo
2097 2097
 			);
2098 2098
 
2099 2099
 			// Generate buff data
2100
-			$output['buff'] .=  sprintf('%s=>array(%s),', $node->menu_item_srl, $attribute);
2100
+			$output['buff'] .= sprintf('%s=>array(%s),', $node->menu_item_srl, $attribute);
2101 2101
 			$output['name'] .= $name_str;
2102 2102
 		}
2103 2103
 		return $output;
@@ -2111,19 +2111,19 @@  discard block
 block discarded – undo
2111 2111
 	 */
2112 2112
 	function updateMenuLayout($layout_srl, $menu_srl_list)
2113 2113
 	{
2114
-		if(!count($menu_srl_list)) return;
2114
+		if (!count($menu_srl_list)) return;
2115 2115
 		// Delete the value of menu_srls
2116
-		$args->menu_srls = implode(',',$menu_srl_list);
2116
+		$args->menu_srls = implode(',', $menu_srl_list);
2117 2117
 		$output = executeQuery('menu.deleteMenuLayout', $args);
2118
-		if(!$output->toBool()) return $output;
2118
+		if (!$output->toBool()) return $output;
2119 2119
 
2120 2120
 		$args->layout_srl = $layout_srl;
2121 2121
 		// Mapping menu_srls, layout_srl
2122
-		for($i=0;$i<count($menu_srl_list);$i++)
2122
+		for ($i = 0; $i < count($menu_srl_list); $i++)
2123 2123
 		{
2124 2124
 			$args->menu_srl = $menu_srl_list[$i];
2125 2125
 			$output = executeQuery('menu.insertMenuLayout', $args);
2126
-			if(!$output->toBool()) return $output;
2126
+			if (!$output->toBool()) return $output;
2127 2127
 		}
2128 2128
 	}
2129 2129
 
@@ -2136,47 +2136,47 @@  discard block
 block discarded – undo
2136 2136
 	{
2137 2137
 		// path setting
2138 2138
 		$path = sprintf('./files/attach/menu_button/%d/', $args->menu_srl);
2139
-		if($args->menu_normal_btn || $args->menu_hover_btn || $args->menu_active_btn && !is_dir($path))
2139
+		if ($args->menu_normal_btn || $args->menu_hover_btn || $args->menu_active_btn && !is_dir($path))
2140 2140
 		{
2141 2141
 			FileHandler::makeDir($path);
2142 2142
 		}
2143 2143
 
2144
-		if($args->isNormalDelete == 'Y' || $args->isHoverDelete == 'Y' || $args->isActiveDelete == 'Y')
2144
+		if ($args->isNormalDelete == 'Y' || $args->isHoverDelete == 'Y' || $args->isActiveDelete == 'Y')
2145 2145
 		{
2146 2146
 			$oMenuModel = getAdminModel('menu');
2147 2147
 			$itemInfo = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
2148 2148
 
2149
-			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2150
-			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2151
-			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2149
+			if ($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2150
+			if ($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2151
+			if ($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2152 2152
 		}
2153 2153
 
2154 2154
 		$returnArray = array();
2155 2155
 		$date = date('YmdHis');
2156 2156
 		// normal button
2157
-		if($args->menu_normal_btn)
2157
+		if ($args->menu_normal_btn)
2158 2158
 		{
2159
-			$tmp_arr = explode('.',$args->menu_normal_btn['name']);
2160
-			$ext = $tmp_arr[count($tmp_arr)-1];
2159
+			$tmp_arr = explode('.', $args->menu_normal_btn['name']);
2160
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2161 2161
 
2162 2162
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_normal_btn', $ext);
2163 2163
 
2164
-			if(checkUploadedFile($args->menu_normal_btn['tmp_name']))
2164
+			if (checkUploadedFile($args->menu_normal_btn['tmp_name']))
2165 2165
 			{
2166
-				move_uploaded_file ( $args->menu_normal_btn ['tmp_name'], $filename );
2166
+				move_uploaded_file($args->menu_normal_btn ['tmp_name'], $filename);
2167 2167
 				$returnArray ['normal_btn'] = $filename;
2168 2168
 			}
2169 2169
 		}
2170 2170
 
2171 2171
 		// hover button
2172
-		if($args->menu_hover_btn)
2172
+		if ($args->menu_hover_btn)
2173 2173
 		{
2174
-			$tmp_arr = explode('.',$args->menu_hover_btn['name']);
2175
-			$ext = $tmp_arr[count($tmp_arr)-1];
2174
+			$tmp_arr = explode('.', $args->menu_hover_btn['name']);
2175
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2176 2176
 
2177 2177
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_hover_btn', $ext);
2178 2178
 
2179
-			if(checkUploadedFile($args->menu_hover_btn['tmp_name']))
2179
+			if (checkUploadedFile($args->menu_hover_btn['tmp_name']))
2180 2180
 			{
2181 2181
 				move_uploaded_file($args->menu_hover_btn['tmp_name'], $filename);
2182 2182
 				$returnArray['hover_btn'] = $filename;
@@ -2184,14 +2184,14 @@  discard block
 block discarded – undo
2184 2184
 		}
2185 2185
 
2186 2186
 		// active button
2187
-		if($args->menu_active_btn)
2187
+		if ($args->menu_active_btn)
2188 2188
 		{
2189
-			$tmp_arr = explode('.',$args->menu_active_btn['name']);
2190
-			$ext = $tmp_arr[count($tmp_arr)-1];
2189
+			$tmp_arr = explode('.', $args->menu_active_btn['name']);
2190
+			$ext = $tmp_arr[count($tmp_arr) - 1];
2191 2191
 
2192 2192
 			$filename = sprintf('%s%d.%s.%s.%s', $path, $args->menu_item_srl, $date, 'menu_active_btn', $ext);
2193 2193
 
2194
-			if(checkUploadedFile($args->menu_active_btn['tmp_name']))
2194
+			if (checkUploadedFile($args->menu_active_btn['tmp_name']))
2195 2195
 			{
2196 2196
 				move_uploaded_file($args->menu_active_btn['tmp_name'], $filename);
2197 2197
 				$returnArray['active_btn'] = $filename;
@@ -2213,7 +2213,7 @@  discard block
 block discarded – undo
2213 2213
 			"active_btn"=>"",
2214 2214
 		);
2215 2215
 		//normal_btn
2216
-		if($menuItemInfo->normal_btn)
2216
+		if ($menuItemInfo->normal_btn)
2217 2217
 		{
2218 2218
 			$originFile = FileHandler::getRealPath($menuItemInfo->normal_btn);
2219 2219
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->normal_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'normal');
@@ -2223,7 +2223,7 @@  discard block
 block discarded – undo
2223 2223
 		}
2224 2224
 
2225 2225
 		//hover_btn
2226
-		if($menuItemInfo->hover_btn)
2226
+		if ($menuItemInfo->hover_btn)
2227 2227
 		{
2228 2228
 			$originFile = FileHandler::getRealPath($menuItemInfo->hover_btn);
2229 2229
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->hover_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'hover');
@@ -2233,7 +2233,7 @@  discard block
 block discarded – undo
2233 2233
 		}
2234 2234
 
2235 2235
 		//active_btn
2236
-		if($menuItemInfo->active_btn)
2236
+		if ($menuItemInfo->active_btn)
2237 2237
 		{
2238 2238
 			$originFile = FileHandler::getRealPath($menuItemInfo->active_btn);
2239 2239
 			$targetFile = $this->_changeMenuItemSrlInButtonPath($menuItemInfo->active_btn, $insertedMenuSrl, $insertedMenuItemSrl, 'active');
@@ -2248,9 +2248,9 @@  discard block
 block discarded – undo
2248 2248
 	{
2249 2249
 		$path = sprintf('./files/attach/menu_button/%d/', $menuSrl);
2250 2250
 		$tmp_arr = explode('.', $buttonPath);
2251
-		$ext = $tmp_arr[count($tmp_arr)-1];
2251
+		$ext = $tmp_arr[count($tmp_arr) - 1];
2252 2252
 		$date = date("YmdHis");
2253
-		return sprintf('%s%d.%s.%s.%s', $path, $menuItemSrl,$date,'menu_'.$mode.'_btn', $ext);
2253
+		return sprintf('%s%d.%s.%s.%s', $path, $menuItemSrl, $date, 'menu_'.$mode.'_btn', $ext);
2254 2254
 	}
2255 2255
 
2256 2256
 	public function makeHomemenuCacheFile($menuSrl)
Please login to merge, or discard this patch.
Braces   +304 added lines, -134 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
 		}
@@ -464,12 +469,21 @@  discard block
 block discarded – undo
464 469
 			$args->is_shortcut = $request->is_shortcut;
465 470
 			$args->url = $request->shortcut_target;
466 471
 
467
-			if(!$args->open_window) $args->open_window = 'N';
468
-			if(!$args->expand) $args->expand = 'N';
469
-			if(!$args->is_shortcut) $args->is_shortcut = 'Y';
472
+			if(!$args->open_window) {
473
+				$args->open_window = 'N';
474
+			}
475
+			if(!$args->expand) {
476
+				$args->expand = 'N';
477
+			}
478
+			if(!$args->is_shortcut) {
479
+				$args->is_shortcut = 'Y';
480
+			}
470 481
 
471
-			if($request->menu_name_key) $args->name = $request->menu_name_key;
472
-			else $args->name = $request->menu_name;
482
+			if($request->menu_name_key) {
483
+				$args->name = $request->menu_name_key;
484
+			} else {
485
+				$args->name = $request->menu_name;
486
+			}
473 487
 		}
474 488
 		// type is module short cut
475 489
 		else if(is_numeric($request->shortcut_target))
@@ -504,13 +518,18 @@  discard block
 block discarded – undo
504 518
 			$args->url = '#';
505 519
 		}
506 520
 
507
-		if($request->menu_desc) $args->desc = $request->menu_desc;
508
-		else $args->desc = '';
521
+		if($request->menu_desc) {
522
+			$args->desc = $request->menu_desc;
523
+		} else {
524
+			$args->desc = '';
525
+		}
509 526
 
510 527
 		$args->menu_item_srl = getNextSequence();
511 528
 		$args->listorder = -1*$args->menu_item_srl;
512 529
 		$output = executeQuery('menu.insertMenuItem', $args);
513
-		if(!$output->toBool()) return $output;
530
+		if(!$output->toBool()) {
531
+			return $output;
532
+		}
514 533
 
515 534
 		$oDB->commit();
516 535
 
@@ -532,15 +551,27 @@  discard block
 block discarded – undo
532 551
 		$args->expand = $request->menu_expand;
533 552
 		$args->is_shortcut = $request->is_shortcut;
534 553
 
535
-		if(!$args->open_window) $args->open_window = 'N';
536
-		if(!$args->expand) $args->expand = 'N';
537
-		if(!$args->is_shortcut) $args->is_shortcut = 'N';
554
+		if(!$args->open_window) {
555
+			$args->open_window = 'N';
556
+		}
557
+		if(!$args->expand) {
558
+			$args->expand = 'N';
559
+		}
560
+		if(!$args->is_shortcut) {
561
+			$args->is_shortcut = 'N';
562
+		}
538 563
 
539
-		if($request->menu_name_key) $args->name = $request->menu_name_key;
540
-		else $args->name = $request->menu_name;
564
+		if($request->menu_name_key) {
565
+			$args->name = $request->menu_name_key;
566
+		} else {
567
+			$args->name = $request->menu_name;
568
+		}
541 569
 
542
-		if($request->menu_desc) $args->desc = $request->menu_desc;
543
-		else $args->desc = '';
570
+		if($request->menu_desc) {
571
+			$args->desc = $request->menu_desc;
572
+		} else {
573
+			$args->desc = '';
574
+		}
544 575
 
545 576
 		if($request->module_id && strncasecmp('http', $request->module_id, 4) === 0)
546 577
 		{
@@ -558,9 +589,15 @@  discard block
 block discarded – undo
558 589
 		}
559 590
 
560 591
 		// if setting button variables, set argument button variables for db insert. but not upload in this method
561
-		if($request->normal_btn) $args->normal_btn = $request->normal_btn;
562
-		if($request->hover_btn) $args->hover_btn = $request->hover_btn;
563
-		if($request->active_btn) $args->active_btn = $request->active_btn;
592
+		if($request->normal_btn) {
593
+			$args->normal_btn = $request->normal_btn;
594
+		}
595
+		if($request->hover_btn) {
596
+			$args->hover_btn = $request->hover_btn;
597
+		}
598
+		if($request->active_btn) {
599
+			$args->active_btn = $request->active_btn;
600
+		}
564 601
 
565 602
 		if(!$request->module_id)
566 603
 		{
@@ -571,7 +608,9 @@  discard block
 block discarded – undo
571 608
 		$args->menu_item_srl = getNextSequence();
572 609
 		$args->listorder = -1*$args->menu_item_srl;
573 610
 		$output = executeQuery('menu.insertMenuItem', $args);
574
-		if(!$output->toBool()) return $output;
611
+		if(!$output->toBool()) {
612
+			return $output;
613
+		}
575 614
 
576 615
 		$oDB->commit();
577 616
 
@@ -652,8 +691,12 @@  discard block
 block discarded – undo
652 691
 		}
653 692
 
654 693
 		// variables set
655
-		if($request->menu_open_window != "Y") $request->menu_open_window = "N";
656
-		if($request->menu_expand != "Y") $request->menu_expand = "N";
694
+		if($request->menu_open_window != "Y") {
695
+			$request->menu_open_window = "N";
696
+		}
697
+		if($request->menu_expand != "Y") {
698
+			$request->menu_expand = "N";
699
+		}
657 700
 
658 701
 		// Get original information
659 702
 		$oMenuAdminModel = getAdminModel('menu');
@@ -680,13 +723,11 @@  discard block
 block discarded – undo
680 723
 
681 724
 				$args->url = $newItemInfo->url;
682 725
 				$args->is_shortcut = 'Y';
683
-			}
684
-			else
726
+			} else
685 727
 			{
686 728
 				$args->url = '#';
687 729
 			}
688
-		}
689
-		else
730
+		} else
690 731
 		{
691 732
 			// check already created module instance
692 733
 			$oModuleModel = getModel('module');
@@ -719,14 +760,16 @@  discard block
 block discarded – undo
719 760
 		if($request->menu_name_key)
720 761
 		{
721 762
 			$args->name = $request->menu_name_key;
722
-		}
723
-		else
763
+		} else
724 764
 		{
725 765
 			$args->name = $request->menu_name;
726 766
 		}
727 767
 
728
-		if($request->menu_desc) $args->desc = $request->menu_desc;
729
-		else $args->desc = '';
768
+		if($request->menu_desc) {
769
+			$args->desc = $request->menu_desc;
770
+		} else {
771
+			$args->desc = '';
772
+		}
730 773
 
731 774
 		unset($args->group_srls);
732 775
 		$args->open_window = $request->menu_open_window;
@@ -828,8 +871,7 @@  discard block
 block discarded – undo
828 871
 		{
829 872
 			$this->setError($returnObj->error);
830 873
 			$this->setMessage($returnObj->message);
831
-		}
832
-		else
874
+		} else
833 875
 		{
834 876
 			$this->setMessage('success_deleted');
835 877
 		}
@@ -856,7 +898,9 @@  discard block
 block discarded – undo
856 898
 		if($args->is_force != 'Y')
857 899
 		{
858 900
 			$output = executeQuery('menu.getChildMenuCount', $args);
859
-			if(!$output->toBool()) return $output;
901
+			if(!$output->toBool()) {
902
+				return $output;
903
+			}
860 904
 			if($output->data->count > 0)
861 905
 			{
862 906
 				return new Object(-1001, 'msg_cannot_delete_for_child');
@@ -874,7 +918,9 @@  discard block
 block discarded – undo
874 918
 			return $this->stop('msg_cannot_delete_for_admin_topmenu');
875 919
 		}
876 920
 
877
-		if($itemInfo->parent_srl) $parent_srl = $itemInfo->parent_srl;
921
+		if($itemInfo->parent_srl) {
922
+			$parent_srl = $itemInfo->parent_srl;
923
+		}
878 924
 
879 925
 		// get menu properies with child menu
880 926
 		$phpFile = sprintf("./files/cache/menu/%s.php", $args->menu_srl);
@@ -948,9 +994,15 @@  discard block
 block discarded – undo
948 994
 		// Update the xml file and get its location
949 995
 		$xml_file = $this->makeXmlFile($args->menu_srl);
950 996
 		// Delete all of image buttons
951
-		if($node['normal_btn']) FileHandler::removeFile($node['normal_btn']);
952
-		if($node['hover_btn']) FileHandler::removeFile($node['hover_btn']);
953
-		if($node['active_btn']) FileHandler::removeFile($node['active_btn']);
997
+		if($node['normal_btn']) {
998
+			FileHandler::removeFile($node['normal_btn']);
999
+		}
1000
+		if($node['hover_btn']) {
1001
+			FileHandler::removeFile($node['hover_btn']);
1002
+		}
1003
+		if($node['active_btn']) {
1004
+			FileHandler::removeFile($node['active_btn']);
1005
+		}
954 1006
 
955 1007
 		// Delete module
956 1008
 		if($node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
@@ -1017,7 +1069,9 @@  discard block
 block discarded – undo
1017 1069
 		$source_srl = Context::get('source_srl');	// Same hierarchy's menu item serial number
1018 1070
 		$target_srl = Context::get('target_srl');	// Self menu item serial number
1019 1071
 
1020
-		if(!$mode || !$parent_srl || !$target_srl) return new Object(-1,'msg_invalid_request');
1072
+		if(!$mode || !$parent_srl || !$target_srl) {
1073
+			return new Object(-1,'msg_invalid_request');
1074
+		}
1021 1075
 
1022 1076
 		$oMenuAdminModel = getAdminModel('menu');
1023 1077
 
@@ -1181,8 +1235,11 @@  discard block
 block discarded – undo
1181 1235
 		// default argument setting
1182 1236
 		$args = new stdClass();
1183 1237
 		$args->menu_srl = $menuSrl;
1184
-		if($parentSrl == 0) $args->parent_srl = $menuSrl;
1185
-		else $args->parent_srl = $parentSrl;
1238
+		if($parentSrl == 0) {
1239
+			$args->parent_srl = $menuSrl;
1240
+		} else {
1241
+			$args->parent_srl = $parentSrl;
1242
+		}
1186 1243
 		$args->menu_name_key = $originMenu['text'];
1187 1244
 		$args->menu_name = $originMenu['text'];
1188 1245
 		$args->menu_open_window = $originMenu['open_window'];
@@ -1275,8 +1332,11 @@  discard block
 block discarded – undo
1275 1332
 		for($i=0;$i<4;$i++)
1276 1333
 		{
1277 1334
 			$case = rand(0, 1);
1278
-			if($case) $doc = rand(65, 90);
1279
-			else $doc = rand(97, 122);
1335
+			if($case) {
1336
+				$doc = rand(65, 90);
1337
+			} else {
1338
+				$doc = rand(97, 122);
1339
+			}
1280 1340
 
1281 1341
 			$randomString .= chr($doc);
1282 1342
 		}
@@ -1299,15 +1359,21 @@  discard block
 block discarded – undo
1299 1359
 		// menu name update
1300 1360
 		$args->menu_srl = $this->menuSrl;
1301 1361
 		$output = executeQuery('menu.updateMenu', $args);
1302
-		if(!$output->toBool()) return $output;
1362
+		if(!$output->toBool()) {
1363
+			return $output;
1364
+		}
1303 1365
 
1304 1366
 		$this->map = array();
1305 1367
 		if(is_array($parentKeyList))
1306 1368
 		{
1307 1369
 			foreach($parentKeyList as $no=>$srl)
1308 1370
 			{
1309
-				if($srl === 0) continue;
1310
-				if(!is_array($this->map[$srl]))$this->map[$srl] = array();
1371
+				if($srl === 0) {
1372
+					continue;
1373
+				}
1374
+				if(!is_array($this->map[$srl])) {
1375
+					$this->map[$srl] = array();
1376
+				}
1311 1377
 				$this->map[$srl][] = $no;
1312 1378
 			}
1313 1379
 		}
@@ -1409,7 +1475,9 @@  discard block
 block discarded – undo
1409 1475
 		$oMenuAdminModel = getAdminModel('menu');
1410 1476
 
1411 1477
 		$target_item = $oMenuAdminModel->getMenuItemInfo($target_srl);
1412
-		if($target_item->menu_item_srl != $target_srl) return new Object(-1,'msg_invalid_request');
1478
+		if($target_item->menu_item_srl != $target_srl) {
1479
+			return new Object(-1,'msg_invalid_request');
1480
+		}
1413 1481
 		// Move the menu location(change the order menu appears)
1414 1482
 		if($mode == 'move')
1415 1483
 		{
@@ -1420,24 +1488,33 @@  discard block
 block discarded – undo
1420 1488
 			if($source_srl)
1421 1489
 			{
1422 1490
 				$source_item = $oMenuAdminModel->getMenuItemInfo($source_srl);
1423
-				if($source_item->menu_item_srl != $source_srl) return new Object(-1,'msg_invalid_request');
1491
+				if($source_item->menu_item_srl != $source_srl) {
1492
+					return new Object(-1,'msg_invalid_request');
1493
+				}
1424 1494
 				$args->listorder = $source_item->listorder-1;
1425
-			}
1426
-			else
1495
+			} else
1427 1496
 			{
1428 1497
 				$output = executeQuery('menu.getMaxListorder', $args);
1429
-				if(!$output->toBool()) return $output;
1498
+				if(!$output->toBool()) {
1499
+					return $output;
1500
+				}
1430 1501
 				$args->listorder = (int)$output->data->listorder;
1431
-				if(!$args->listorder) $args->listorder= 0;
1502
+				if(!$args->listorder) {
1503
+					$args->listorder= 0;
1504
+				}
1432 1505
 			}
1433 1506
 			$args->parent_srl = $parent_srl;
1434 1507
 			$output = executeQuery('menu.updateMenuItemListorder', $args);
1435
-			if(!$output->toBool()) return $output;
1508
+			if(!$output->toBool()) {
1509
+				return $output;
1510
+			}
1436 1511
 
1437 1512
 			$args->parent_srl = $parent_srl;
1438 1513
 			$args->menu_item_srl = $target_srl;
1439 1514
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1440
-			if(!$output->toBool()) return $output;
1515
+			if(!$output->toBool()) {
1516
+				return $output;
1517
+			}
1441 1518
 
1442 1519
 			//module's menu_srl move also
1443 1520
 			if($isShortcut == 'N' && !empty($url))
@@ -1465,14 +1542,15 @@  discard block
 block discarded – undo
1465 1542
 				}
1466 1543
 			}
1467 1544
 			// Add a child
1468
-		}
1469
-		elseif($mode == 'insert')
1545
+		} elseif($mode == 'insert')
1470 1546
 		{
1471 1547
 			$args->menu_item_srl = $target_srl;
1472 1548
 			$args->parent_srl = $parent_srl;
1473 1549
 			$args->listorder = -1*getNextSequence();
1474 1550
 			$output = executeQuery('menu.updateMenuItemNode', $args);
1475
-			if(!$output->toBool()) return $output;
1551
+			if(!$output->toBool()) {
1552
+				return $output;
1553
+			}
1476 1554
 		}
1477 1555
 
1478 1556
 		$xml_file = $this->makeXmlFile($menu_srl);
@@ -1516,8 +1594,7 @@  discard block
 block discarded – undo
1516 1594
 		{
1517 1595
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1518 1596
 
1519
-		}
1520
-		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']))
1597
+		} 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 1598
 		{
1522 1599
 			Context::set('error_messge', Context::getLang('msg_invalid_request'));
1523 1600
 		}
@@ -1531,7 +1608,9 @@  discard block
 block discarded – undo
1531 1608
 			$path = sprintf('./files/attach/menu_button/%d/', $menu_srl);
1532 1609
 			$filename = sprintf('%s%d.%s.%s', $path, $menu_item_srl, $target, $ext);
1533 1610
 
1534
-			if(!is_dir($path)) FileHandler::makeDir($path);
1611
+			if(!is_dir($path)) {
1612
+				FileHandler::makeDir($path);
1613
+			}
1535 1614
 
1536 1615
 			move_uploaded_file($target_file['tmp_name'], $filename);
1537 1616
 			Context::set('filename', $filename);
@@ -1571,7 +1650,9 @@  discard block
 block discarded – undo
1571 1650
 			foreach($installed_module_list AS $key=>$value)
1572 1651
 			{
1573 1652
 				$info = $oModuleModel->getModuleActionXml($value->module);
1574
-				if($info->menu) $menuList[$value->module] = $info->menu;
1653
+				if($info->menu) {
1654
+					$menuList[$value->module] = $info->menu;
1655
+				}
1575 1656
 				unset($info->menu);
1576 1657
 			}
1577 1658
 		}
@@ -1603,8 +1684,12 @@  discard block
 block discarded – undo
1603 1684
 		$info = $oModuleModel->getModuleActionXml($moduleName);
1604 1685
 
1605 1686
 		$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->menu->{$menuName}->index);
1606
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1607
-		if(empty($url)) $url = getNotEncodedFullUrl('', 'module', 'admin');
1687
+		if(empty($url)) {
1688
+			$url = getNotEncodedFullUrl('', 'module', 'admin', 'act', $info->admin_index_act);
1689
+		}
1690
+		if(empty($url)) {
1691
+			$url = getNotEncodedFullUrl('', 'module', 'admin');
1692
+		}
1608 1693
 		$dbInfo = Context::getDBInfo();
1609 1694
 
1610 1695
 		$args = new stdClass();
@@ -1616,8 +1701,7 @@  discard block
 block discarded – undo
1616 1701
 		if(strpos($url, 'https') !== false)
1617 1702
 		{
1618 1703
 			$args->url = str_replace('https'.substr($dbInfo->default_url, 4), '', $url);
1619
-		}
1620
-		else
1704
+		} else
1621 1705
 		{
1622 1706
 			$args->url = str_replace($dbInfo->default_url, '', $url);
1623 1707
 		}
@@ -1636,14 +1720,18 @@  discard block
 block discarded – undo
1636 1720
 		if($item_info->menu_item_srl == $args->menu_item_srl)
1637 1721
 		{
1638 1722
 			$output = $this->_updateMenuItem($args);
1639
-			if(!$output->toBool()) return $output;
1723
+			if(!$output->toBool()) {
1724
+				return $output;
1725
+			}
1640 1726
 		}
1641 1727
 		// Insert if not exist
1642 1728
 		else
1643 1729
 		{
1644 1730
 			$args->listorder = -1*$args->menu_item_srl;
1645 1731
 			$output = executeQuery('menu.insertMenuItem', $args);
1646
-			if(!$output->toBool()) return $output;
1732
+			if(!$output->toBool()) {
1733
+				return $output;
1734
+			}
1647 1735
 		}
1648 1736
 		// Get information of the menu
1649 1737
 		$menu_info = $oMenuModel->getMenu($args->menu_srl);
@@ -1674,8 +1762,7 @@  discard block
 block discarded – undo
1674 1762
 		if(!$exposure)
1675 1763
 		{
1676 1764
 			$args->group_srls = '';
1677
-		}
1678
-		else
1765
+		} else
1679 1766
 		{
1680 1767
 			$exposure = explode(',', $exposure);
1681 1768
 			if(in_array($exposure, array('-1','-3')))
@@ -1683,7 +1770,9 @@  discard block
 block discarded – undo
1683 1770
 				$args->group_srls = $exposure;
1684 1771
 			}
1685 1772
 
1686
-			if($exposure) $args->group_srls = implode(',', $exposure);
1773
+			if($exposure) {
1774
+				$args->group_srls = implode(',', $exposure);
1775
+			}
1687 1776
 		}
1688 1777
 
1689 1778
 		$output = $this->_updateMenuItem($args);
@@ -1706,7 +1795,9 @@  discard block
 block discarded – undo
1706 1795
 			$moduleGrnatsArgs = new stdClass;
1707 1796
 			$moduleGrnatsArgs->module_srl = $moduleInfo->module_srl;
1708 1797
 			$output = executeQueryArray('module.getModuleGrants', $moduleGrnatsArgs);
1709
-			if(!$output->data) $output->data = array();
1798
+			if(!$output->data) {
1799
+				$output->data = array();
1800
+			}
1710 1801
 			$moduleGrnats = new stdClass();
1711 1802
 			foreach($output->data as $grant)
1712 1803
 			{
@@ -1715,7 +1806,9 @@  discard block
 block discarded – undo
1715 1806
 		}
1716 1807
 
1717 1808
 		$grantList = $xml_info->grant;
1718
-		if(!$grantList) $grantList = new stdClass;
1809
+		if(!$grantList) {
1810
+			$grantList = new stdClass;
1811
+		}
1719 1812
 
1720 1813
 		$grantList->access = new stdClass();
1721 1814
 		$grantList->access->default = 'guest';
@@ -1741,10 +1834,11 @@  discard block
 block discarded – undo
1741 1834
 					$grant->{$grantName}[] = $htPerm[$grantName];
1742 1835
 					continue;
1743 1836
 				}
1744
-			}
1745
-			else if($itemInfo->is_shortcut === 'Y')
1837
+			} else if($itemInfo->is_shortcut === 'Y')
1746 1838
 			{
1747
-				if(isset($moduleGrnats) && $moduleGrnats->{$grantName}) $grant->{$grantName} = $moduleGrnats->{$grantName};
1839
+				if(isset($moduleGrnats) && $moduleGrnats->{$grantName}) {
1840
+					$grant->{$grantName} = $moduleGrnats->{$grantName};
1841
+				}
1748 1842
 			}
1749 1843
 		}
1750 1844
 
@@ -1766,12 +1860,16 @@  discard block
 block discarded – undo
1766 1860
 	function makeXmlFile($menu_srl)
1767 1861
 	{
1768 1862
 		// Return if there is no information when creating the xml file
1769
-		if(!$menu_srl) return;
1863
+		if(!$menu_srl) {
1864
+			return;
1865
+		}
1770 1866
 		// Get menu informaton
1771 1867
 		$args = new stdClass();
1772 1868
 		$args->menu_srl = $menu_srl;
1773 1869
 		$output = executeQuery('menu.getMenu', $args);
1774
-		if(!$output->toBool() || !$output->data) return $output;
1870
+		if(!$output->toBool() || !$output->data) {
1871
+			return $output;
1872
+		}
1775 1873
 		$site_srl = (int)$output->data->site_srl;
1776 1874
 
1777 1875
 		if($site_srl)
@@ -1785,7 +1883,9 @@  discard block
 block discarded – undo
1785 1883
 		$args->menu_srl = $menu_srl;
1786 1884
 		$args->sort_index = 'listorder';
1787 1885
 		$output = executeQuery('menu.getMenuItems', $args);
1788
-		if(!$output->toBool()) return;
1886
+		if(!$output->toBool()) {
1887
+			return;
1888
+		}
1789 1889
 		// Specify the name of the cache file
1790 1890
 		$xml_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.xml.php", $menu_srl);
1791 1891
 		$php_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menu_srl);
@@ -1799,7 +1899,9 @@  discard block
 block discarded – undo
1799 1899
 			return $xml_file;
1800 1900
 		}
1801 1901
 		// Change to an array if only a single data is obtained
1802
-		if(!is_array($list)) $list = array($list);
1902
+		if(!is_array($list)) {
1903
+			$list = array($list);
1904
+		}
1803 1905
 		// Create a tree for loop
1804 1906
 		$list_count = count($list);
1805 1907
 		for($i=0;$i<$list_count;$i++)
@@ -1887,7 +1989,9 @@  discard block
 block discarded – undo
1887 1989
 	 */
1888 1990
 	function getXmlTree($source_node, $tree, $site_srl, $domain)
1889 1991
 	{
1890
-		if(!$source_node) return;
1992
+		if(!$source_node) {
1993
+			return;
1994
+		}
1891 1995
 
1892 1996
 		$oMenuAdminModel = getAdminModel('menu');
1893 1997
 
@@ -1895,7 +1999,9 @@  discard block
 block discarded – undo
1895 1999
 		{
1896 2000
 			$child_buff = "";
1897 2001
 			// Get data of the child nodes
1898
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
2002
+			if($menu_item_srl&&$tree[$menu_item_srl]) {
2003
+				$child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
2004
+			}
1899 2005
 			// List variables
1900 2006
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
1901 2007
 			foreach($names as $key => $val)
@@ -1909,37 +2015,57 @@  discard block
 block discarded – undo
1909 2015
 			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url))
1910 2016
 			{
1911 2017
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
2018
+			} else {
2019
+				$href = sprintf('"%s"', $url);
1912 2020
 			}
1913
-			else $href = sprintf('"%s"', $url);
1914 2021
 			$is_shortcut = $node->is_shortcut;
1915 2022
 			$open_window = $node->open_window;
1916 2023
 			$expand = $node->expand;
1917 2024
 
1918 2025
 			$normal_btn = $node->normal_btn;
1919
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
1920
-			else $normal_btn = '';
2026
+			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) {
2027
+				$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2028
+			} else {
2029
+				$normal_btn = '';
2030
+			}
1921 2031
 			$hover_btn = $node->hover_btn;
1922
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
1923
-			else $hover_btn = '';
2032
+			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) {
2033
+				$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2034
+			} else {
2035
+				$hover_btn = '';
2036
+			}
1924 2037
 			$active_btn = $node->active_btn;
1925
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
1926
-			else $active_btn = '';
2038
+			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) {
2039
+				$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2040
+			} else {
2041
+				$active_btn = '';
2042
+			}
1927 2043
 
1928 2044
 			$group_srls = $node->group_srls;
1929 2045
 
1930 2046
 			if($normal_btn)
1931 2047
 			{
1932
-				if($hover_btn) $hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn); else $hover_str = '';
1933
-				if($active_btn) $active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn); else $active_str = '';
2048
+				if($hover_btn) {
2049
+					$hover_str = sprintf('onmouseover=&quot;this.src=\'%s\'&quot;', $hover_btn);
2050
+				} else {
2051
+					$hover_str = '';
2052
+				}
2053
+				if($active_btn) {
2054
+					$active_str = sprintf('onmousedown=&quot;this.src=\'%s\'&quot;', $active_btn);
2055
+				} else {
2056
+					$active_str = '';
2057
+				}
1934 2058
 				$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);
1935
-			}
1936
-			else
2059
+			} else
1937 2060
 			{
1938 2061
 				$link = '<?php print $_names[$lang_type]; ?>';
1939 2062
 			}
1940 2063
 			// If the value of node->group_srls exists
1941
-			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);
1942
-			else $group_check_code = "true";
2064
+			if($group_srls) {
2065
+				$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);
2066
+			} else {
2067
+				$group_check_code = "true";
2068
+			}
1943 2069
 			$attribute = sprintf(
1944 2070
 				'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 }?>"',
1945 2071
 				$menu_item_srl,
@@ -1962,8 +2088,11 @@  discard block
 block discarded – undo
1962 2088
 				$link
1963 2089
 			);
1964 2090
 
1965
-			if($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
1966
-			else $buff .=  sprintf('<node %s />', $attribute);
2091
+			if($child_buff) {
2092
+				$buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
2093
+			} else {
2094
+				$buff .=  sprintf('<node %s />', $attribute);
2095
+			}
1967 2096
 		}
1968 2097
 		return $buff;
1969 2098
 	}
@@ -1982,15 +2111,20 @@  discard block
 block discarded – undo
1982 2111
 	function getPhpCacheCode($source_node, $tree, $site_srl, $domain)
1983 2112
 	{
1984 2113
 		$output = array("buff"=>"", "url_list"=>array());
1985
-		if(!$source_node) return $output;
2114
+		if(!$source_node) {
2115
+			return $output;
2116
+		}
1986 2117
 
1987 2118
 		$oMenuAdminModel = getAdminModel('menu');
1988 2119
 
1989 2120
 		foreach($source_node as $menu_item_srl => $node)
1990 2121
 		{
1991 2122
 			// Get data from child nodes if exist.
1992
-			if($menu_item_srl&&$tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
1993
-			else $child_output = array("buff"=>"", "url_list"=>array());
2123
+			if($menu_item_srl&&$tree[$menu_item_srl]) {
2124
+				$child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
2125
+			} else {
2126
+				$child_output = array("buff"=>"", "url_list"=>array());
2127
+			}
1994 2128
 
1995 2129
 			// List variables
1996 2130
 			$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
@@ -2000,8 +2134,7 @@  discard block
 block discarded – undo
2000 2134
 				if(preg_match('/\{\$lang->menu_gnb(?:_sub)?\[\'([a-zA-Z_]+)\'\]\}/', $val) === 1)
2001 2135
 				{
2002 2136
 					$name_arr_str .= sprintf('"%s"=>"%s",', $key, $val);
2003
-				}
2004
-				else
2137
+				} else
2005 2138
 				{
2006 2139
 					$name_arr_str .= sprintf('"%s"=>\'%s\',', $key, str_replace(array('\\','\''), array('\\\\','\\\''), removeHackTag($val)));
2007 2140
 				}
@@ -2009,11 +2142,16 @@  discard block
 block discarded – undo
2009 2142
 			$name_str = sprintf('$_menu_names[%d] = array(%s); %s', $node->menu_item_srl, $name_arr_str, $child_output['name']);
2010 2143
 
2011 2144
 			// If url value is not empty in the current node, put the value into an array url_list
2012
-			if($node->url) $child_output['url_list'][] = $node->url;
2145
+			if($node->url) {
2146
+				$child_output['url_list'][] = $node->url;
2147
+			}
2013 2148
 			$output['url_list'] = array_merge($output['url_list'], $child_output['url_list']);
2014 2149
 			// If node->group_srls value exists
2015
-			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);
2016
-			else $group_check_code = "true";
2150
+			if($node->group_srls) {
2151
+				$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);
2152
+			} else {
2153
+				$group_check_code = "true";
2154
+			}
2017 2155
 
2018 2156
 			// List variables
2019 2157
 			$href = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->href);
@@ -2022,8 +2160,9 @@  discard block
 block discarded – undo
2022 2160
 			if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url))
2023 2161
 			{
2024 2162
 				$href = "getSiteUrl('$domain', '','mid','$node->url')";
2163
+			} else {
2164
+				$href = sprintf('"%s"', $url);
2025 2165
 			}
2026
-			else $href = sprintf('"%s"', $url);
2027 2166
 			$is_shortcut = $node->is_shortcut;
2028 2167
 			$open_window = $node->open_window;
2029 2168
 			$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->normal_btn);
@@ -2040,29 +2179,48 @@  discard block
 block discarded – undo
2040 2179
 			$expand = $node->expand;
2041 2180
 
2042 2181
 			$normal_btn = $node->normal_btn;
2043
-			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) $normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2044
-			else $normal_btn = '';
2182
+			if($normal_btn && strncasecmp('./files/attach/menu_button', $normal_btn, 26) === 0) {
2183
+				$normal_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$normal_btn);
2184
+			} else {
2185
+				$normal_btn = '';
2186
+			}
2045 2187
 
2046 2188
 			$hover_btn = $node->hover_btn;
2047
-			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) $hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2048
-			else $hover_btn = '';
2189
+			if($hover_btn && strncasecmp('./files/attach/menu_button', $hover_btn, 26) === 0) {
2190
+				$hover_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$hover_btn);
2191
+			} else {
2192
+				$hover_btn = '';
2193
+			}
2049 2194
 
2050 2195
 			$active_btn = $node->active_btn;
2051
-			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2052
-			else $active_btn = '';
2196
+			if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) {
2197
+				$active_btn = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$active_btn);
2198
+			} else {
2199
+				$active_btn = '';
2200
+			}
2053 2201
 
2054 2202
 
2055 2203
 			$group_srls = $node->group_srls;
2056 2204
 
2057 2205
 			if($normal_btn)
2058 2206
 			{
2059
-				if($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = '';
2060
-				if($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = '';
2207
+				if($hover_btn) {
2208
+					$hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn);
2209
+				} else {
2210
+					$hover_str = '';
2211
+				}
2212
+				if($active_btn) {
2213
+					$active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn);
2214
+				} else {
2215
+					$active_str = '';
2216
+				}
2061 2217
 				$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);
2062
-				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);
2063
-				else $link_active = $link;
2064
-			}
2065
-			else
2218
+				if($active_btn) {
2219
+					$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);
2220
+				} else {
2221
+					$link_active = $link;
2222
+				}
2223
+			} else
2066 2224
 			{
2067 2225
 				$link_active = $link = sprintf('$_menu_names[%d][$lang_type]', $node->menu_item_srl);
2068 2226
 			}
@@ -2111,11 +2269,15 @@  discard block
 block discarded – undo
2111 2269
 	 */
2112 2270
 	function updateMenuLayout($layout_srl, $menu_srl_list)
2113 2271
 	{
2114
-		if(!count($menu_srl_list)) return;
2272
+		if(!count($menu_srl_list)) {
2273
+			return;
2274
+		}
2115 2275
 		// Delete the value of menu_srls
2116 2276
 		$args->menu_srls = implode(',',$menu_srl_list);
2117 2277
 		$output = executeQuery('menu.deleteMenuLayout', $args);
2118
-		if(!$output->toBool()) return $output;
2278
+		if(!$output->toBool()) {
2279
+			return $output;
2280
+		}
2119 2281
 
2120 2282
 		$args->layout_srl = $layout_srl;
2121 2283
 		// Mapping menu_srls, layout_srl
@@ -2123,7 +2285,9 @@  discard block
 block discarded – undo
2123 2285
 		{
2124 2286
 			$args->menu_srl = $menu_srl_list[$i];
2125 2287
 			$output = executeQuery('menu.insertMenuLayout', $args);
2126
-			if(!$output->toBool()) return $output;
2288
+			if(!$output->toBool()) {
2289
+				return $output;
2290
+			}
2127 2291
 		}
2128 2292
 	}
2129 2293
 
@@ -2146,9 +2310,15 @@  discard block
 block discarded – undo
2146 2310
 			$oMenuModel = getAdminModel('menu');
2147 2311
 			$itemInfo = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
2148 2312
 
2149
-			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) FileHandler::removeFile($itemInfo->normal_btn);
2150
-			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) FileHandler::removeFile($itemInfo->hover_btn);
2151
-			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) FileHandler::removeFile($itemInfo->active_btn);
2313
+			if($args->isNormalDelete == 'Y' && $itemInfo->normal_btn) {
2314
+				FileHandler::removeFile($itemInfo->normal_btn);
2315
+			}
2316
+			if($args->isHoverDelete == 'Y' && $itemInfo->hover_btn) {
2317
+				FileHandler::removeFile($itemInfo->hover_btn);
2318
+			}
2319
+			if($args->isActiveDelete == 'Y' && $itemInfo->active_btn) {
2320
+				FileHandler::removeFile($itemInfo->active_btn);
2321
+			}
2152 2322
 		}
2153 2323
 
2154 2324
 		$returnArray = array();
Please login to merge, or discard this patch.
modules/menu/menu.admin.model.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -579,7 +579,7 @@
 block discarded – undo
579 579
 
580 580
 	/**
581 581
 	 * Get module's detail setup contents
582
-	 * @return void
582
+	 * @return Object|null
583 583
 	 */
584 584
 	public function getMenuAdminDetailSetup()
585 585
 	{
Please login to merge, or discard this patch.
Braces   +72 added lines, -45 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@  discard block
 block discarded – undo
41 41
 		// document.getDocumentList query execution
42 42
 		$output = executeQuery('menu.getMenuList', $args);
43 43
 		// Return if no result or an error occurs
44
-		if(!$output->toBool()||!count($output->data)) return $output;
44
+		if(!$output->toBool()||!count($output->data)) {
45
+			return $output;
46
+		}
45 47
 
46 48
 		return $output;
47 49
 	}
@@ -63,7 +65,9 @@  discard block
 block discarded – undo
63 65
 		$args->site_srl = $site_srl ;
64 66
 		$args->menu_srl = $menu_srl;
65 67
 		$output = executeQueryArray('menu.getMenus', $args);
66
-		if(!$output->data) return;
68
+		if(!$output->data) {
69
+			return;
70
+		}
67 71
 		$menus = $output->data;
68 72
 		return $menus;
69 73
 	}
@@ -80,7 +84,9 @@  discard block
 block discarded – undo
80 84
 		$args = new stdClass();
81 85
 		$args->menu_srl = $menu_srl;
82 86
 		$output = executeQuery('menu.getMenu', $args);
83
-		if(!$output->data) return;
87
+		if(!$output->data) {
88
+			return;
89
+		}
84 90
 
85 91
 		$menu_info = $output->data;
86 92
 		$menu_info->xml_file = sprintf('./files/cache/menu/%s.xml.php',$menu_srl);
@@ -105,10 +111,15 @@  discard block
 block discarded – undo
105 111
 		$args->title = $title;
106 112
 		$args->site_srl = $site_srl;
107 113
 		$output = executeQuery('menu.getMenuByTitle', $args);
108
-		if(!$output->data) return;
114
+		if(!$output->data) {
115
+			return;
116
+		}
109 117
 
110
-		if(is_array($output->data)) $menu_info = $output->data[0];
111
-		else $menu_info = $output->data;
118
+		if(is_array($output->data)) {
119
+			$menu_info = $output->data[0];
120
+		} else {
121
+			$menu_info = $output->data;
122
+		}
112 123
 
113 124
 		if($menu_info->menu_srl)
114 125
 		{
@@ -152,15 +163,20 @@  discard block
 block discarded – undo
152 163
 		$output = executeQuery('menu.getMenuItem', $args);
153 164
 		$node = $output->data;
154 165
 		settype($node,'object');
155
-		if($node->group_srls) $node->group_srls = explode(',',$node->group_srls);
156
-		else $node->group_srls = array();
166
+		if($node->group_srls) {
167
+			$node->group_srls = explode(',',$node->group_srls);
168
+		} else {
169
+			$node->group_srls = array();
170
+		}
157 171
 
158 172
 		$tmp_name = unserialize($node->name);
159 173
 		if($tmp_name && count($tmp_name))
160 174
 		{
161 175
 			$selected_lang = array();
162 176
 			$rand_name = $tmp_name[Context::getLangType()];
163
-			if(!$rand_name) $rand_name = array_shift($tmp_name);
177
+			if(!$rand_name) {
178
+				$rand_name = array_shift($tmp_name);
179
+			}
164 180
 			$node->name = $rand_name;
165 181
 		}
166 182
 		return $node;
@@ -178,13 +194,13 @@  discard block
 block discarded – undo
178 194
 		if(!$menuItem->url)
179 195
 		{
180 196
 			$menuItem->moduleType = null;
181
-		}
182
-		else if(strncasecmp('http', $menuItem->url, 4) !== 0)
197
+		} else if(strncasecmp('http', $menuItem->url, 4) !== 0)
183 198
 		{
184 199
 			$oModuleModel = getModel('module');
185 200
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($menuItem->url, 0);
186
-			if(!$moduleInfo) $menuItem->moduleType = 'url';
187
-			else
201
+			if(!$moduleInfo) {
202
+				$menuItem->moduleType = 'url';
203
+			} else
188 204
 			{
189 205
 				if($moduleInfo->mid == $menuItem->url)
190 206
 				{
@@ -193,8 +209,9 @@  discard block
 block discarded – undo
193 209
 					$menuItem->layoutSrl = $moduleInfo->layout_srl;
194 210
 				}
195 211
 			}
212
+		} else {
213
+			$menuItem->moduleType = 'url';
196 214
 		}
197
-		else $menuItem->moduleType = 'url';
198 215
 
199 216
 		// grant setting
200 217
 		if(is_array($menuItem->group_srls) && count($menuItem->group_srls) > 0)
@@ -202,12 +219,10 @@  discard block
 block discarded – undo
202 219
 			if($menuItem->group_srls[0] == -1)
203 220
 			{
204 221
 				$menuItem->grant = 'member';
205
-			}
206
-			else if($menuItem->group_srls[0] == -3)
222
+			} else if($menuItem->group_srls[0] == -3)
207 223
 			{
208 224
 				$menuItem->grant = 'manager';
209
-			}
210
-			else
225
+			} else
211 226
 			{
212 227
 				$menuItem->grant = 'group';
213 228
 			}
@@ -228,11 +243,15 @@  discard block
 block discarded – undo
228 243
 				{
229 244
 					$tmp = $oModuleAdminModel->getLangCode(0, $value->title);
230 245
 					$groupList[$value->group_srl]->title = $tmp[Context::getLangType()];
246
+				} else {
247
+					$groupList[$value->group_srl]->title = $value->title;
231 248
 				}
232
-				else $groupList[$value->group_srl]->title = $value->title;
233 249
 
234
-				if(in_array($key, $menuItem->group_srls)) $groupList[$value->group_srl]->isChecked = true;
235
-				else $groupList[$value->group_srl]->isChecked = false;
250
+				if(in_array($key, $menuItem->group_srls)) {
251
+					$groupList[$value->group_srl]->isChecked = true;
252
+				} else {
253
+					$groupList[$value->group_srl]->isChecked = false;
254
+				}
236 255
 			}
237 256
 		}
238 257
 		$menuItem->groupList = $groupList;
@@ -305,11 +324,12 @@  discard block
 block discarded – undo
305 324
 			$item_info->parent_srl = $parent_srl;
306 325
 			$item_info->parent_menu_name = $parent_info->name;
307 326
 			// In case of modifying the existing menu or addting a new menu to the root
308
-		}
309
-		else
327
+		} else
310 328
 		{
311 329
 			// Get information of the menu if menu_item_srl exists
312
-			if($menu_item_srl) $item_info = $this->getMenuItemInfo($menu_item_srl);
330
+			if($menu_item_srl) {
331
+				$item_info = $this->getMenuItemInfo($menu_item_srl);
332
+			}
313 333
 			// Get only menu_item_srl if no values found, considering it as adding a new menu
314 334
 			if(!$item_info->menu_item_srl)
315 335
 			{
@@ -349,7 +369,9 @@  discard block
 block discarded – undo
349 369
 		foreach($_allModules as $module_name)
350 370
 		{
351 371
 			$module = $oModuleModel->getModuleInfoXml($module_name);
352
-			if(!isset($module)) continue;
372
+			if(!isset($module)) {
373
+				continue;
374
+			}
353 375
 			$defaultSkin = $oModuleModel->getModuleDefaultSkin($module_name, 'P');
354 376
 			$defaultMobileSkin = $oModuleModel->getModuleDefaultSkin($module_name, 'M');
355 377
 			$skinInfo = $oModuleModel->loadSkinInfo(ModuleHandler::getModulePath($module_name), $defaultSkin);
@@ -379,8 +401,7 @@  discard block
 block discarded – undo
379 401
 				$oModuleInfo->title = $pageTypeName['OUTSIDE'];
380 402
 				$oModuleInfo->no_skin = 'Y';
381 403
 				$allModules['OUTSIDE'] = $oModuleInfo;
382
-			}
383
-			else
404
+			} else
384 405
 			{
385 406
 				$allModules[$module_name] = $module;
386 407
 			}
@@ -414,7 +435,9 @@  discard block
 block discarded – undo
414 435
 
415 436
 		// after trigger
416 437
 		$output = ModuleHandler::triggerCall('menu.getModuleListInSitemap', 'after', $moduleList);
417
-		if(!$output->toBool()) return $output;
438
+		if(!$output->toBool()) {
439
+			return $output;
440
+		}
418 441
 
419 442
 		$localModuleList = array_unique($moduleList);
420 443
 
@@ -425,7 +448,9 @@  discard block
 block discarded – undo
425 448
 		$remoteModuleList = array();
426 449
 		foreach($remotePackageList as $package)
427 450
 		{
428
-			if(strpos($package->path, './modules/') !== 0) continue;
451
+			if(strpos($package->path, './modules/') !== 0) {
452
+				continue;
453
+			}
429 454
 
430 455
 			$pathInfo = explode('/', $package->path);
431 456
 			$remoteModuleList[] = $pathInfo[2];
@@ -464,8 +489,7 @@  discard block
 block discarded – undo
464 489
 					$oModuleInfo->title = $pageTypeName['OUTSIDE'];
465 490
 					$oModuleInfo->no_skin = 'Y';
466 491
 					$moduleInfoList['OUTSIDE'] = $oModuleInfo;
467
-				}
468
-				else
492
+				} else
469 493
 				{
470 494
 					$moduleInfoList[$value] = $moduleInfo;
471 495
 				}
@@ -497,8 +521,11 @@  discard block
 block discarded – undo
497 521
 			$isMenuFixed = false;
498 522
 			$output = $this->getMenu($menuSrl);
499 523
 			$php_file = sprintf(_XE_PATH_ . 'files/cache/menu/%s.php',$output->menu_srl);
500
-			if(file_exists($php_file)) include($php_file);
501
-			else $oMenuAdminController->makeXmlFile($menuSrl);
524
+			if(file_exists($php_file)) {
525
+				include($php_file);
526
+			} else {
527
+				$oMenuAdminController->makeXmlFile($menuSrl);
528
+			}
502 529
 
503 530
 			if(count($menu->list)>0)
504 531
 			{
@@ -518,8 +545,7 @@  discard block
 block discarded – undo
518 545
 			$menuItems->title = $output->title;
519 546
 			$menuItems->menuItems = $menu;
520 547
 			$menuList[] = $menuItems;
521
-		}
522
-		else
548
+		} else
523 549
 		{
524 550
 			$menuListFromDB = $this->getMenus($siteSrl);
525 551
 			if(is_array($menuListFromDB))
@@ -527,8 +553,9 @@  discard block
 block discarded – undo
527 553
 				$oAdmin = getClass('admin');
528 554
 				foreach($menuListFromDB AS $key=>$value)
529 555
 				{
530
-					if($value->title == $oAdmin->getAdminMenuName()) unset($output[$key]);
531
-					else
556
+					if($value->title == $oAdmin->getAdminMenuName()) {
557
+						unset($output[$key]);
558
+					} else
532 559
 					{
533 560
 						unset($menu);
534 561
 						unset($menuItems);
@@ -564,8 +591,7 @@  discard block
 block discarded – undo
564 591
 						if($value->menu_srl == $this->menuSrlWithinHome)
565 592
 						{
566 593
 							$menuList[-1] = $menuItems;
567
-						}
568
-						else
594
+						} else
569 595
 						{
570 596
 							$menuList[] = $menuItems;
571 597
 						}
@@ -639,8 +665,11 @@  discard block
 block discarded – undo
639 665
 			$args = new stdClass;
640 666
 			$args->menu_item_srl = $menu['node_srl'];
641 667
 			$args->is_shortcut = 'Y';
642
-			if($menu['menu_name_key']) $args->name = $menu['menu_name_key'];
643
-			else $args->name = $menu['menu_name'];
668
+			if($menu['menu_name_key']) {
669
+				$args->name = $menu['menu_name_key'];
670
+			} else {
671
+				$args->name = $menu['menu_name'];
672
+			}
644 673
 			$output = executeQuery('menu.updateMenuItem', $args);
645 674
 
646 675
 			$isMenuFixed = true;
@@ -661,8 +690,7 @@  discard block
 block discarded – undo
661 690
 				if($midInfo->page_type)
662 691
 				{
663 692
 					$menu['module_type'] = $midInfo->page_type;
664
-				}
665
-				else
693
+				} else
666 694
 				{
667 695
 					$menu['module_type'] = $midInfo->module;
668 696
 				}
@@ -671,8 +699,7 @@  discard block
 block discarded – undo
671 699
 			if($moduleInfo->setup_index_act)
672 700
 			{
673 701
 				$menu['setup_index_act'] = $moduleInfo->setup_index_act;
674
-			}
675
-			else if($moduleInfo->default_index_act)
702
+			} else if($moduleInfo->default_index_act)
676 703
 			{
677 704
 				$menu['setup_index_act'] = $moduleInfo->default_index_act;
678 705
 			}
Please login to merge, or discard this patch.
Spacing   +90 added lines, -90 removed lines patch added patch discarded remove patch
@@ -27,21 +27,21 @@  discard block
 block discarded – undo
27 27
 	 */
28 28
 	function getMenuList($obj)
29 29
 	{
30
-		if(!$obj->site_srl)
30
+		if (!$obj->site_srl)
31 31
 		{
32 32
 			$site_module_info = Context::get('site_module_info');
33
-			$obj->site_srl = (int)$site_module_info->site_srl;
33
+			$obj->site_srl = (int) $site_module_info->site_srl;
34 34
 		}
35 35
 		$args = new stdClass;
36 36
 		$args->site_srl = $obj->site_srl;
37 37
 		$args->sort_index = $obj->sort_index;
38
-		$args->page = $obj->page?$obj->page:1;
39
-		$args->list_count = $obj->list_count?$obj->list_count:20;
40
-		$args->page_count = $obj->page_count?$obj->page_count:10;
38
+		$args->page = $obj->page ? $obj->page : 1;
39
+		$args->list_count = $obj->list_count ? $obj->list_count : 20;
40
+		$args->page_count = $obj->page_count ? $obj->page_count : 10;
41 41
 		// document.getDocumentList query execution
42 42
 		$output = executeQuery('menu.getMenuList', $args);
43 43
 		// Return if no result or an error occurs
44
-		if(!$output->toBool()||!count($output->data)) return $output;
44
+		if (!$output->toBool() || !count($output->data)) return $output;
45 45
 
46 46
 		return $output;
47 47
 	}
@@ -53,17 +53,17 @@  discard block
 block discarded – undo
53 53
 	 */
54 54
 	function getMenus($site_srl = null)
55 55
 	{
56
-		if(!isset($site_srl))
56
+		if (!isset($site_srl))
57 57
 		{
58 58
 			$site_module_info = Context::get('site_module_info');
59
-			$site_srl = (int)$site_module_info->site_srl;
59
+			$site_srl = (int) $site_module_info->site_srl;
60 60
 		}
61 61
 		// Get information from the DB
62 62
 		$args = new stdClass();
63
-		$args->site_srl = $site_srl ;
63
+		$args->site_srl = $site_srl;
64 64
 		$args->menu_srl = $menu_srl;
65 65
 		$output = executeQueryArray('menu.getMenus', $args);
66
-		if(!$output->data) return;
66
+		if (!$output->data) return;
67 67
 		$menus = $output->data;
68 68
 		return $menus;
69 69
 	}
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
 		$args = new stdClass();
81 81
 		$args->menu_srl = $menu_srl;
82 82
 		$output = executeQuery('menu.getMenu', $args);
83
-		if(!$output->data) return;
83
+		if (!$output->data) return;
84 84
 
85 85
 		$menu_info = $output->data;
86
-		$menu_info->xml_file = sprintf('./files/cache/menu/%s.xml.php',$menu_srl);
87
-		$menu_info->php_file = sprintf('./files/cache/menu/%s.php',$menu_srl);
86
+		$menu_info->xml_file = sprintf('./files/cache/menu/%s.xml.php', $menu_srl);
87
+		$menu_info->php_file = sprintf('./files/cache/menu/%s.php', $menu_srl);
88 88
 		return $menu_info;
89 89
 	}
90 90
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	function getMenuByTitle($title, $site_srl = 0)
98 98
 	{
99 99
 		// Get information from the DB
100
-		if(!is_array($title))
100
+		if (!is_array($title))
101 101
 		{
102 102
 			$title = array($title);
103 103
 		}
@@ -105,15 +105,15 @@  discard block
 block discarded – undo
105 105
 		$args->title = $title;
106 106
 		$args->site_srl = $site_srl;
107 107
 		$output = executeQuery('menu.getMenuByTitle', $args);
108
-		if(!$output->data) return;
108
+		if (!$output->data) return;
109 109
 
110
-		if(is_array($output->data)) $menu_info = $output->data[0];
110
+		if (is_array($output->data)) $menu_info = $output->data[0];
111 111
 		else $menu_info = $output->data;
112 112
 
113
-		if($menu_info->menu_srl)
113
+		if ($menu_info->menu_srl)
114 114
 		{
115
-			$menu_info->xml_file = sprintf('./files/cache/menu/%s.xml.php',$menu_info->menu_srl);
116
-			$menu_info->php_file = sprintf('./files/cache/menu/%s.php',$menu_info->menu_srl);
115
+			$menu_info->xml_file = sprintf('./files/cache/menu/%s.xml.php', $menu_info->menu_srl);
116
+			$menu_info->php_file = sprintf('./files/cache/menu/%s.php', $menu_info->menu_srl);
117 117
 		}
118 118
 		return $menu_info;
119 119
 	}
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 		$args = new stdClass();
131 131
 		$args->title = $title;
132 132
 		$output = executeQueryArray('menu.getMenuByTitle', $args);
133
-		if(!$output->data)
133
+		if (!$output->data)
134 134
 		{
135 135
 			return array();
136 136
 		}
@@ -151,16 +151,16 @@  discard block
 block discarded – undo
151 151
 		$args->menu_item_srl = $menu_item_srl;
152 152
 		$output = executeQuery('menu.getMenuItem', $args);
153 153
 		$node = $output->data;
154
-		settype($node,'object');
155
-		if($node->group_srls) $node->group_srls = explode(',',$node->group_srls);
154
+		settype($node, 'object');
155
+		if ($node->group_srls) $node->group_srls = explode(',', $node->group_srls);
156 156
 		else $node->group_srls = array();
157 157
 
158 158
 		$tmp_name = unserialize($node->name);
159
-		if($tmp_name && count($tmp_name))
159
+		if ($tmp_name && count($tmp_name))
160 160
 		{
161 161
 			$selected_lang = array();
162 162
 			$rand_name = $tmp_name[Context::getLangType()];
163
-			if(!$rand_name) $rand_name = array_shift($tmp_name);
163
+			if (!$rand_name) $rand_name = array_shift($tmp_name);
164 164
 			$node->name = $rand_name;
165 165
 		}
166 166
 		return $node;
@@ -175,18 +175,18 @@  discard block
 block discarded – undo
175 175
 		$menuItemSrl = Context::get('menu_item_srl');
176 176
 		$menuItem = $this->getMenuItemInfo($menuItemSrl);
177 177
 
178
-		if(!$menuItem->url)
178
+		if (!$menuItem->url)
179 179
 		{
180 180
 			$menuItem->moduleType = null;
181 181
 		}
182
-		else if(strncasecmp('http', $menuItem->url, 4) !== 0)
182
+		else if (strncasecmp('http', $menuItem->url, 4) !== 0)
183 183
 		{
184 184
 			$oModuleModel = getModel('module');
185 185
 			$moduleInfo = $oModuleModel->getModuleInfoByMid($menuItem->url, 0);
186
-			if(!$moduleInfo) $menuItem->moduleType = 'url';
186
+			if (!$moduleInfo) $menuItem->moduleType = 'url';
187 187
 			else
188 188
 			{
189
-				if($moduleInfo->mid == $menuItem->url)
189
+				if ($moduleInfo->mid == $menuItem->url)
190 190
 				{
191 191
 					$menuItem->moduleType = $moduleInfo->module;
192 192
 					$menuItem->pageType = $moduleInfo->page_type;
@@ -197,13 +197,13 @@  discard block
 block discarded – undo
197 197
 		else $menuItem->moduleType = 'url';
198 198
 
199 199
 		// grant setting
200
-		if(is_array($menuItem->group_srls) && count($menuItem->group_srls) > 0)
200
+		if (is_array($menuItem->group_srls) && count($menuItem->group_srls) > 0)
201 201
 		{
202
-			if($menuItem->group_srls[0] == -1)
202
+			if ($menuItem->group_srls[0] == -1)
203 203
 			{
204 204
 				$menuItem->grant = 'member';
205 205
 			}
206
-			else if($menuItem->group_srls[0] == -3)
206
+			else if ($menuItem->group_srls[0] == -3)
207 207
 			{
208 208
 				$menuItem->grant = 'manager';
209 209
 			}
@@ -217,21 +217,21 @@  discard block
 block discarded – undo
217 217
 		$oMemberModel = getModel('member');
218 218
 		$oModuleAdminModel = getAdminModel('module');
219 219
 		$output = $oMemberModel->getGroups();
220
-		if(is_array($output))
220
+		if (is_array($output))
221 221
 		{
222 222
 			$groupList = array();
223
-			foreach($output AS $key=>$value)
223
+			foreach ($output AS $key=>$value)
224 224
 			{
225 225
 				$groupList[$value->group_srl] = new stdClass();
226 226
 				$groupList[$value->group_srl]->group_srl = $value->group_srl;
227
-				if(substr($value->title,0,12)=='$user_lang->')
227
+				if (substr($value->title, 0, 12) == '$user_lang->')
228 228
 				{
229 229
 					$tmp = $oModuleAdminModel->getLangCode(0, $value->title);
230 230
 					$groupList[$value->group_srl]->title = $tmp[Context::getLangType()];
231 231
 				}
232 232
 				else $groupList[$value->group_srl]->title = $value->title;
233 233
 
234
-				if(in_array($key, $menuItem->group_srls)) $groupList[$value->group_srl]->isChecked = true;
234
+				if (in_array($key, $menuItem->group_srls)) $groupList[$value->group_srl]->isChecked = true;
235 235
 				else $groupList[$value->group_srl]->isChecked = false;
236 236
 			}
237 237
 		}
@@ -269,10 +269,10 @@  discard block
 block discarded – undo
269 269
 	 */
270 270
 	function getMenuItemNames($source_name, $site_srl = null)
271 271
 	{
272
-		if(!$site_srl)
272
+		if (!$site_srl)
273 273
 		{
274 274
 			$site_module_info = Context::get('site_module_info');
275
-			$site_srl = (int)$site_module_info->site_srl;
275
+			$site_srl = (int) $site_module_info->site_srl;
276 276
 		}
277 277
 		// Get language code
278 278
 		$oModuleAdminModel = getAdminModel('module');
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 
297 297
 		// Add a sub-menu if there is parent_srl but not menu_item_srl
298 298
 		$item_info = new stdClass;
299
-		if(!$menu_item_srl && $parent_srl)
299
+		if (!$menu_item_srl && $parent_srl)
300 300
 		{
301 301
 			// Get information of the parent menu
302 302
 			$parent_info = $this->getMenuItemInfo($parent_srl);
@@ -309,9 +309,9 @@  discard block
 block discarded – undo
309 309
 		else
310 310
 		{
311 311
 			// Get information of the menu if menu_item_srl exists
312
-			if($menu_item_srl) $item_info = $this->getMenuItemInfo($menu_item_srl);
312
+			if ($menu_item_srl) $item_info = $this->getMenuItemInfo($menu_item_srl);
313 313
 			// Get only menu_item_srl if no values found, considering it as adding a new menu
314
-			if(!$item_info->menu_item_srl)
314
+			if (!$item_info->menu_item_srl)
315 315
 			{
316 316
 				$item_info->menu_item_srl = getNextSequence();
317 317
 			}
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 		$oTemplate = &TemplateHandler::getInstance();
328 328
 		$tpl = $oTemplate->compile($this->module_path.'tpl', 'menu_item_info');
329 329
 
330
-		$this->add('tpl', str_replace("\n"," ",$tpl));
330
+		$this->add('tpl', str_replace("\n", " ", $tpl));
331 331
 	}
332 332
 
333 333
 	/**
@@ -346,10 +346,10 @@  discard block
 block discarded – undo
346 346
 
347 347
 		Context::loadLang('modules/page/lang');
348 348
 
349
-		foreach($_allModules as $module_name)
349
+		foreach ($_allModules as $module_name)
350 350
 		{
351 351
 			$module = $oModuleModel->getModuleInfoXml($module_name);
352
-			if(!isset($module)) continue;
352
+			if (!isset($module)) continue;
353 353
 			$defaultSkin = $oModuleModel->getModuleDefaultSkin($module_name, 'P');
354 354
 			$defaultMobileSkin = $oModuleModel->getModuleDefaultSkin($module_name, 'M');
355 355
 			$skinInfo = $oModuleModel->loadSkinInfo(ModuleHandler::getModulePath($module_name), $defaultSkin);
@@ -361,10 +361,10 @@  discard block
 block discarded – undo
361 361
 			$module->defaultMobileSkin->skin = $defaultMobileSkin;
362 362
 			$module->defaultMobileSkin->title = $mobileSkinInfo->title ? $mobileSkinInfo->title : $defaultMobileSkin;
363 363
 
364
-			$module->package_srl = $oAutoinstallModel->getPackageSrlByPath('./modules/' . $module_name);
365
-			$module->url = _XE_LOCATION_SITE_ . '?mid=download&package_srl=' . $module->package_srl;
364
+			$module->package_srl = $oAutoinstallModel->getPackageSrlByPath('./modules/'.$module_name);
365
+			$module->url = _XE_LOCATION_SITE_.'?mid=download&package_srl='.$module->package_srl;
366 366
 
367
-			if($module_name == 'page')
367
+			if ($module_name == 'page')
368 368
 			{
369 369
 				$pageTypeName = Context::getLang('page_type_name');
370 370
 				$module->title = $pageTypeName['ARTICLE'];
@@ -401,11 +401,11 @@  discard block
 block discarded – undo
401 401
 		$moduleList = array('page');
402 402
 
403 403
 		$output = $oModuleModel->getModuleListByInstance($site_srl);
404
-		if(is_array($output->data))
404
+		if (is_array($output->data))
405 405
 		{
406
-			foreach($output->data as $value)
406
+			foreach ($output->data as $value)
407 407
 			{
408
-				if($value->instanceCount > 1)
408
+				if ($value->instanceCount > 1)
409 409
 				{
410 410
 					$moduleList[] = $value->module;
411 411
 				}
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 
415 415
 		// after trigger
416 416
 		$output = ModuleHandler::triggerCall('menu.getModuleListInSitemap', 'after', $moduleList);
417
-		if(!$output->toBool()) return $output;
417
+		if (!$output->toBool()) return $output;
418 418
 
419 419
 		$localModuleList = array_unique($moduleList);
420 420
 
@@ -423,9 +423,9 @@  discard block
 block discarded – undo
423 423
 		// get have instance
424 424
 		$remotePackageList = $oAutoinstallModel->getHaveInstance(array('path'));
425 425
 		$remoteModuleList = array();
426
-		foreach($remotePackageList as $package)
426
+		foreach ($remotePackageList as $package)
427 427
 		{
428
-			if(strpos($package->path, './modules/') !== 0) continue;
428
+			if (strpos($package->path, './modules/') !== 0) continue;
429 429
 
430 430
 			$pathInfo = explode('/', $package->path);
431 431
 			$remoteModuleList[] = $pathInfo[2];
@@ -443,13 +443,13 @@  discard block
 block discarded – undo
443 443
 
444 444
 		$moduleInfoList = array();
445 445
 		Context::loadLang('modules/page/lang');
446
-		if(is_array($moduleList))
446
+		if (is_array($moduleList))
447 447
 		{
448
-			foreach($moduleList as $value)
448
+			foreach ($moduleList as $value)
449 449
 			{
450 450
 				$moduleInfo = $oModuleModel->getModuleInfoXml($value);
451 451
 
452
-				if($value == 'page')
452
+				if ($value == 'page')
453 453
 				{
454 454
 					$pageTypeName = Context::getLang('page_type_name');
455 455
 					$moduleInfo->title = $pageTypeName['ARTICLE'];
@@ -480,10 +480,10 @@  discard block
 block discarded – undo
480 480
 		$siteSrl = Context::get('site_srl');
481 481
 		$menuSrl = Context::get('menu_srl');
482 482
 
483
-		if(!isset($siteSrl))
483
+		if (!isset($siteSrl))
484 484
 		{
485 485
 			$site_module_info = Context::get('site_module_info');
486
-			$siteSrl = (int)$site_module_info->site_srl;
486
+			$siteSrl = (int) $site_module_info->site_srl;
487 487
 		}
488 488
 
489 489
 		$oModuleModel = getModel('module');
@@ -492,24 +492,24 @@  discard block
 block discarded – undo
492 492
 		$start_module = $oModuleModel->getSiteInfo(0, $columnList);
493 493
 
494 494
 		$menuList = array();
495
-		if($menuSrl)
495
+		if ($menuSrl)
496 496
 		{
497 497
 			$isMenuFixed = false;
498 498
 			$output = $this->getMenu($menuSrl);
499
-			$php_file = sprintf(_XE_PATH_ . 'files/cache/menu/%s.php',$output->menu_srl);
500
-			if(file_exists($php_file)) include($php_file);
499
+			$php_file = sprintf(_XE_PATH_.'files/cache/menu/%s.php', $output->menu_srl);
500
+			if (file_exists($php_file)) include($php_file);
501 501
 			else $oMenuAdminController->makeXmlFile($menuSrl);
502 502
 
503
-			if(count($menu->list)>0)
503
+			if (count($menu->list) > 0)
504 504
 			{
505
-				foreach($menu->list AS $key=>$value)
505
+				foreach ($menu->list AS $key=>$value)
506 506
 				{
507
-					$this->_menuInfoSetting($menu->list[$key], $start_module, $isMenuFixed, $menuSrl,$siteSrl);
507
+					$this->_menuInfoSetting($menu->list[$key], $start_module, $isMenuFixed, $menuSrl, $siteSrl);
508 508
 				}
509 509
 			}
510 510
 
511 511
 			// menu recreate
512
-			if($isMenuFixed)
512
+			if ($isMenuFixed)
513 513
 			{
514 514
 				$oMenuAdminController->makeXmlFile($menuSrl);
515 515
 			}
@@ -522,18 +522,18 @@  discard block
 block discarded – undo
522 522
 		else
523 523
 		{
524 524
 			$menuListFromDB = $this->getMenus($siteSrl);
525
-			if(is_array($menuListFromDB))
525
+			if (is_array($menuListFromDB))
526 526
 			{
527 527
 				$oAdmin = getClass('admin');
528
-				foreach($menuListFromDB AS $key=>$value)
528
+				foreach ($menuListFromDB AS $key=>$value)
529 529
 				{
530
-					if($value->title == $oAdmin->getAdminMenuName()) unset($output[$key]);
530
+					if ($value->title == $oAdmin->getAdminMenuName()) unset($output[$key]);
531 531
 					else
532 532
 					{
533 533
 						unset($menu);
534 534
 						unset($menuItems);
535
-						$value->php_file = sprintf(_XE_PATH_ . 'files/cache/menu/%s.php',$value->menu_srl);
536
-						if(!file_exists($value->php_file))
535
+						$value->php_file = sprintf(_XE_PATH_.'files/cache/menu/%s.php', $value->menu_srl);
536
+						if (!file_exists($value->php_file))
537 537
 						{
538 538
 							$oMenuAdminController->makeXmlFile($value->menu_srl);
539 539
 						}
@@ -541,16 +541,16 @@  discard block
 block discarded – undo
541 541
 						include($value->php_file);
542 542
 
543 543
 						$isMenuFixed = false;
544
-						if(count($menu->list) > 0)
544
+						if (count($menu->list) > 0)
545 545
 						{
546
-							foreach($menu->list AS $key2=>$value2)
546
+							foreach ($menu->list AS $key2=>$value2)
547 547
 							{
548
-								$this->_menuInfoSetting($menu->list[$key2], $start_module, $isMenuFixed, $value->menu_srl,$siteSrl);
548
+								$this->_menuInfoSetting($menu->list[$key2], $start_module, $isMenuFixed, $value->menu_srl, $siteSrl);
549 549
 							}
550 550
 						}
551 551
 
552 552
 						// menu recreate
553
-						if($isMenuFixed)
553
+						if ($isMenuFixed)
554 554
 						{
555 555
 							$oMenuAdminController->makeXmlFile($value->menu_srl);
556 556
 						}
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
 						$menuItems->menuItems = $menu;
562 562
 
563 563
 						// If include home menu, move first
564
-						if($value->menu_srl == $this->menuSrlWithinHome)
564
+						if ($value->menu_srl == $this->menuSrlWithinHome)
565 565
 						{
566 566
 							$menuList[-1] = $menuItems;
567 567
 						}
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
 	public function getMenuAdminDetailSetup()
585 585
 	{
586 586
 		$menuItemSrl = Context::get('menu_item_srl');
587
-		if(!$menuItemSrl)
587
+		if (!$menuItemSrl)
588 588
 		{
589 589
 			return new Object(-1, 'msg_invalid_request');
590 590
 		}
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 		$menuItemInfo = $this->getMenuItemInfo($menuItemSrl);
593 593
 
594 594
 		// if menu is shortcut
595
-		if($menuItemInfo->is_shortcut == 'Y')
595
+		if ($menuItemInfo->is_shortcut == 'Y')
596 596
 		{
597 597
 			return new Object(-1, 'msg_invalid_request');
598 598
 		}
@@ -604,18 +604,18 @@  discard block
 block discarded – undo
604 604
 		// get xml info
605 605
 		$moduleConfInfo = $oModuleModel->getModuleInfoXml($moduleInfo->module);
606 606
 
607
-		if($moduleConfInfo->setup_index_act)
607
+		if ($moduleConfInfo->setup_index_act)
608 608
 		{
609 609
 			$setupUrl = getNotEncodedUrl('', 'module', 'admin', 'act', $moduleConfInfo->setup_index_act, 'module_srl', $moduleInfo->module_srl, 'isLayoutDrop', '1');
610 610
 		}
611 611
 
612
-		if($moduleConfInfo->simple_setup_index_act)
612
+		if ($moduleConfInfo->simple_setup_index_act)
613 613
 		{
614 614
 			$oTargetmoduleAdminModel = getAdminModel($moduleInfo->module);
615 615
 			$advancedSetupUrl = getUrl('', 'module', 'admin', 'act', $moduleConfInfo->setup_index_act, 'module_srl', $moduleInfo->module_srl);
616 616
 			$simpleSetupHtml = $oTargetmoduleAdminModel->{$moduleConfInfo->simple_setup_index_act}($moduleInfo->module_srl, $advancedSetupUrl);
617 617
 
618
-			if($simpleSetupHtml)
618
+			if ($simpleSetupHtml)
619 619
 			{
620 620
 				$this->add('simpleSetupHtml', $simpleSetupHtml);
621 621
 			}
@@ -628,18 +628,18 @@  discard block
 block discarded – undo
628 628
 	 * @param array $menu
629 629
 	 * @return void
630 630
 	 */
631
-	private function _menuInfoSetting(&$menu, &$start_module, &$isMenuFixed, $menuSrl,$siteSrl = 0)
631
+	private function _menuInfoSetting(&$menu, &$start_module, &$isMenuFixed, $menuSrl, $siteSrl = 0)
632 632
 	{
633 633
 		$oModuleModel = getModel('module');
634 634
 		// if url is empty and is_shortcut is 'N', change to is_shortcut 'Y'
635
-		if(!$menu['url'] && $menu['is_shortcut'] == 'N')
635
+		if (!$menu['url'] && $menu['is_shortcut'] == 'N')
636 636
 		{
637 637
 			$menu['is_shortcut'] = 'Y';
638 638
 
639 639
 			$args = new stdClass;
640 640
 			$args->menu_item_srl = $menu['node_srl'];
641 641
 			$args->is_shortcut = 'Y';
642
-			if($menu['menu_name_key']) $args->name = $menu['menu_name_key'];
642
+			if ($menu['menu_name_key']) $args->name = $menu['menu_name_key'];
643 643
 			else $args->name = $menu['menu_name'];
644 644
 			$output = executeQuery('menu.updateMenuItem', $args);
645 645
 
@@ -648,17 +648,17 @@  discard block
 block discarded – undo
648 648
 
649 649
 		//if menu type is module menu
650 650
 		//if(!empty($menu['url']) && !preg_match('/^http/i', $menu['url']))
651
-		if($menu['is_shortcut'] != 'Y')
651
+		if ($menu['is_shortcut'] != 'Y')
652 652
 		{
653 653
 			unset($midInfo, $moduleInfo);
654 654
 			$midInfo = $oModuleModel->getModuleInfoByMid($menu['url'], $siteSrl);
655 655
 			$moduleInfo = $oModuleModel->getModuleInfoXml($midInfo->module);
656 656
 
657
-			if($midInfo)
657
+			if ($midInfo)
658 658
 			{
659 659
 				$menu['module_srl'] = $midInfo->module_srl;
660 660
 				$menu['module'] = $midInfo->module;
661
-				if($midInfo->page_type)
661
+				if ($midInfo->page_type)
662 662
 				{
663 663
 					$menu['module_type'] = $midInfo->page_type;
664 664
 				}
@@ -668,16 +668,16 @@  discard block
 block discarded – undo
668 668
 				}
669 669
 			}
670 670
 
671
-			if($moduleInfo->setup_index_act)
671
+			if ($moduleInfo->setup_index_act)
672 672
 			{
673 673
 				$menu['setup_index_act'] = $moduleInfo->setup_index_act;
674 674
 			}
675
-			else if($moduleInfo->default_index_act)
675
+			else if ($moduleInfo->default_index_act)
676 676
 			{
677 677
 				$menu['setup_index_act'] = $moduleInfo->default_index_act;
678 678
 			}
679 679
 
680
-			if($menu['is_shortcut'] == 'N' && $midInfo->mid == $start_module->mid)
680
+			if ($menu['is_shortcut'] == 'N' && $midInfo->mid == $start_module->mid)
681 681
 			{
682 682
 				$menu['is_start_module'] = true;
683 683
 				$this->menuSrlWithinHome = $menuSrl;
@@ -686,9 +686,9 @@  discard block
 block discarded – undo
686 686
 			$menu['layout_srl'] = $midInfo->layout_srl;
687 687
 			$menu['browser_title'] = $midInfo->browser_title;
688 688
 		}
689
-		if(count($menu['list']) > 0)
689
+		if (count($menu['list']) > 0)
690 690
 		{
691
-			foreach($menu['list'] as $key=>$value)
691
+			foreach ($menu['list'] as $key=>$value)
692 692
 			{
693 693
 				$this->_menuInfoSetting($menu['list'][$key], $start_module, $isMenuFixed, $menuSrl, $siteSrl);
694 694
 			}
Please login to merge, or discard this patch.
modules/menu/menu.mobile.php 3 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.
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.
Spacing   +11 added lines, -11 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 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.