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 ( 3a5b79...d1f190 )
by gyeong-won
13:57 queued 06:24
created
modules/member/member.controller.php 2 patches
Spacing   +443 added lines, -443 removed lines patch added patch discarded remove patch
@@ -34,25 +34,25 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	function procMemberLogin($user_id = null, $password = null, $keep_signed = null)
36 36
 	{
37
-		if(!$user_id && !$password && Context::getRequestMethod() == 'GET')
37
+		if (!$user_id && !$password && Context::getRequestMethod() == 'GET')
38 38
 		{
39 39
 			$this->setRedirectUrl(getNotEncodedUrl(''));
40 40
 			return new Object(-1, 'null_user_id');
41 41
 		}
42 42
 
43 43
 		// Variables
44
-		if(!$user_id) $user_id = Context::get('user_id');
44
+		if (!$user_id) $user_id = Context::get('user_id');
45 45
 		$user_id = trim($user_id);
46 46
 
47
-		if(!$password) $password = Context::get('password');
47
+		if (!$password) $password = Context::get('password');
48 48
 		$password = trim($password);
49 49
 
50
-		if(!$keep_signed) $keep_signed = Context::get('keep_signed');
50
+		if (!$keep_signed) $keep_signed = Context::get('keep_signed');
51 51
 		// Return an error when id and password doesn't exist
52
-		if(!$user_id) return new Object(-1,'null_user_id');
53
-		if(!$password) return new Object(-1,'null_password');
52
+		if (!$user_id) return new Object(-1, 'null_user_id');
53
+		if (!$password) return new Object(-1, 'null_password');
54 54
 
55
-		$output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false);
55
+		$output = $this->doLogin($user_id, $password, $keep_signed == 'Y' ? true : false);
56 56
 		if (!$output->toBool()) return $output;
57 57
 
58 58
 		$oModuleModel = getModel('module');
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
 		$limit_date = $config->change_password_date;
63 63
 
64 64
 		// Check if change_password_date is set
65
-		if($limit_date > 0)
65
+		if ($limit_date > 0)
66 66
 		{
67 67
 			$oMemberModel = getModel('member');
68
-			if($this->memberInfo->change_password_date < date ('YmdHis', strtotime ('-' . $limit_date . ' day')))
68
+			if ($this->memberInfo->change_password_date < date('YmdHis', strtotime('-'.$limit_date.' day')))
69 69
 			{
70 70
 				$msg = sprintf(Context::getLang('msg_change_password_date'), $limit_date);
71
-				return $this->setRedirectUrl(getNotEncodedUrl('','vid',Context::get('vid'),'mid',Context::get('mid'),'act','dispMemberModifyPassword'), new Object(-1, $msg));
71
+				return $this->setRedirectUrl(getNotEncodedUrl('', 'vid', Context::get('vid'), 'mid', Context::get('mid'), 'act', 'dispMemberModifyPassword'), new Object(-1, $msg));
72 72
 			}
73 73
 		}
74 74
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		$args->member_srl = $this->memberInfo->member_srl;
78 78
 		executeQuery('member.deleteAuthMail', $args);
79 79
 
80
-		if(!$config->after_login_url)
80
+		if (!$config->after_login_url)
81 81
 		{
82 82
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
83 83
 		}
@@ -98,18 +98,18 @@  discard block
 block discarded – undo
98 98
 		// Call a trigger before log-out (before)
99 99
 		$logged_info = Context::get('logged_info');
100 100
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info);
101
-		if(!$trigger_output->toBool()) return $trigger_output;
101
+		if (!$trigger_output->toBool()) return $trigger_output;
102 102
 		// Destroy session information
103 103
 		$this->destroySessionInfo();
104 104
 		// Call a trigger after log-out (after)
105 105
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info);
106
-		if(!$trigger_output->toBool()) return $trigger_output;
106
+		if (!$trigger_output->toBool()) return $trigger_output;
107 107
 
108 108
 		$output = new Object();
109 109
 
110 110
 		$oModuleModel = getModel('module');
111 111
 		$config = $oModuleModel->getModuleConfig('member');
112
-		if($config->after_logout_url)
112
+		if ($config->after_logout_url)
113 113
 			$output->redirect_url = $config->after_logout_url;
114 114
 
115 115
 		$this->_clearMemberCache($logged_info->member_srl);
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
 	function procMemberScrapDocument()
126 126
 	{
127 127
 		// Check login information
128
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
128
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
129 129
 		$logged_info = Context::get('logged_info');
130 130
 
131
-		$document_srl = (int)Context::get('document_srl');
132
-		if(!$document_srl) $document_srl = (int)Context::get('target_srl');
133
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
131
+		$document_srl = (int) Context::get('document_srl');
132
+		if (!$document_srl) $document_srl = (int) Context::get('target_srl');
133
+		if (!$document_srl) return new Object(-1, 'msg_invalid_request');
134 134
 		// Get document
135 135
 		$oDocumentModel = getModel('document');
136 136
 		$oDocument = $oDocumentModel->getDocument($document_srl);
@@ -145,10 +145,10 @@  discard block
 block discarded – undo
145 145
 		$args->title = $oDocument->get('title');
146 146
 		// Check if already scrapped
147 147
 		$output = executeQuery('member.getScrapDocument', $args);
148
-		if($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
148
+		if ($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
149 149
 		// Insert
150 150
 		$output = executeQuery('member.addScrapDocument', $args);
151
-		if(!$output->toBool()) return $output;
151
+		if (!$output->toBool()) return $output;
152 152
 
153 153
 		$this->setError(-1);
154 154
 		$this->setMessage('success_registed');
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
 	function procMemberDeleteScrap()
163 163
 	{
164 164
 		// Check login information
165
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
165
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
166 166
 		$logged_info = Context::get('logged_info');
167 167
 
168
-		$document_srl = (int)Context::get('document_srl');
169
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
168
+		$document_srl = (int) Context::get('document_srl');
169
+		if (!$document_srl) return new Object(-1, 'msg_invalid_request');
170 170
 		// Variables
171 171
 		$args = new stdClass;
172 172
 		$args->member_srl = $logged_info->member_srl;
@@ -192,23 +192,23 @@  discard block
 block discarded – undo
192 192
 	function procMemberDeleteSavedDocument()
193 193
 	{
194 194
 		// Check login information
195
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
195
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
196 196
 		$logged_info = Context::get('logged_info');
197 197
 
198
-		$document_srl = (int)Context::get('document_srl');
199
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
198
+		$document_srl = (int) Context::get('document_srl');
199
+		if (!$document_srl) return new Object(-1, 'msg_invalid_request');
200 200
 
201 201
 		$oDocumentModel = getModel('document');
202 202
 		$oDocument = $oDocumentModel->getDocument($document_srl);
203 203
 		if ($oDocument->get('member_srl') != $logged_info->member_srl)
204 204
 		{
205
-			return new Object(-1,'msg_invalid_request');
205
+			return new Object(-1, 'msg_invalid_request');
206 206
 		}
207 207
 
208 208
 		$configStatusList = $oDocumentModel->getStatusList();
209 209
 		if ($oDocument->get('status') != $configStatusList['temp'])
210 210
 		{
211
-			return new Object(-1,'msg_invalid_request');
211
+			return new Object(-1, 'msg_invalid_request');
212 212
 		}
213 213
 
214 214
 		$oDocumentController = getController('document');
@@ -224,37 +224,37 @@  discard block
 block discarded – undo
224 224
 	{
225 225
 		$name = Context::get('name');
226 226
 		$value = Context::get('value');
227
-		if(!$value) return;
227
+		if (!$value) return;
228 228
 
229 229
 		$oMemberModel = getModel('member');
230 230
 		// Check if logged-in
231 231
 		$logged_info = Context::get('logged_info');
232 232
 
233 233
 
234
-		switch($name)
234
+		switch ($name)
235 235
 		{
236 236
 			case 'user_id' :
237 237
 				// Check denied ID
238
-				if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id');
238
+				if ($oMemberModel->isDeniedID($value)) return new Object(0, 'denied_user_id');
239 239
 				// Check if duplicated
240 240
 				$member_srl = $oMemberModel->getMemberSrlByUserID($value);
241
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_user_id');
241
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_user_id');
242 242
 				break;
243 243
 			case 'nick_name' :
244 244
 				// Check denied ID
245
-				if($oMemberModel->isDeniedNickName($value))
245
+				if ($oMemberModel->isDeniedNickName($value))
246 246
 				{
247
-					return new Object(0,'denied_nick_name');
247
+					return new Object(0, 'denied_nick_name');
248 248
 				}
249 249
 				// Check if duplicated
250 250
 				$member_srl = $oMemberModel->getMemberSrlByNickName($value);
251
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name');
251
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_nick_name');
252 252
 
253 253
 				break;
254 254
 			case 'email_address' :
255 255
 				// Check if duplicated
256 256
 				$member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
257
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address');
257
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_email_address');
258 258
 				break;
259 259
 		}
260 260
 	}
@@ -266,25 +266,25 @@  discard block
 block discarded – undo
266 266
 	 */
267 267
 	function procMemberInsert()
268 268
 	{
269
-		if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request");
270
-		$oMemberModel = &getModel ('member');
269
+		if (Context::getRequestMethod() == "GET") return new Object(-1, "msg_invalid_request");
270
+		$oMemberModel = &getModel('member');
271 271
 		$config = $oMemberModel->getMemberConfig();
272 272
 
273 273
 		// call a trigger (before)
274
-		$trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config);
275
-		if(!$trigger_output->toBool ()) return $trigger_output;
274
+		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'before', $config);
275
+		if (!$trigger_output->toBool()) return $trigger_output;
276 276
 		// Check if an administrator allows a membership
277
-		if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled');
277
+		if ($config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
278 278
 		// Check if the user accept the license terms (only if terms exist)
279
-		if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
279
+		if ($config->agreement && Context::get('accept_agreement') != 'Y') return $this->stop('msg_accept_agreement');
280 280
 
281 281
 		// Extract the necessary information in advance
282 282
 		$getVars = array();
283
-		if($config->signupForm)
283
+		if ($config->signupForm)
284 284
 		{
285
-			foreach($config->signupForm as $formInfo)
285
+			foreach ($config->signupForm as $formInfo)
286 286
 			{
287
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
287
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
288 288
 				{
289 289
 					$getVars[] = $formInfo->name;
290 290
 				}
@@ -292,22 +292,22 @@  discard block
 block discarded – undo
292 292
 		}
293 293
 
294 294
 		$args = new stdClass;
295
-		foreach($getVars as $val)
295
+		foreach ($getVars as $val)
296 296
 		{
297 297
 			$args->{$val} = Context::get($val);
298
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
298
+			if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
299 299
 		}
300 300
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
301
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
301
+		if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
302 302
 
303 303
 		$args->find_account_answer = Context::get('find_account_answer');
304 304
 		$args->allow_mailing = Context::get('allow_mailing');
305 305
 		$args->allow_message = Context::get('allow_message');
306 306
 
307
-		if($args->password1) $args->password = $args->password1;
307
+		if ($args->password1) $args->password = $args->password1;
308 308
 
309 309
 		// check password strength
310
-		if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
310
+		if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
311 311
 		{
312 312
 			$message = Context::getLang('about_password_strength');
313 313
 			return new Object(-1, $message[$config->password_strength]);
@@ -333,58 +333,58 @@  discard block
 block discarded – undo
333 333
 		unset($all_args->secret_text);
334 334
 
335 335
 		// Set the user state as "denied" when using mail authentication
336
-		if($config->enable_confirm == 'Y') $args->denied = 'Y';
336
+		if ($config->enable_confirm == 'Y') $args->denied = 'Y';
337 337
 		// Add extra vars after excluding necessary information from all the requested arguments
338 338
 		$extra_vars = delObjectVars($all_args, $args);
339 339
 		$args->extra_vars = serialize($extra_vars);
340 340
 
341 341
 		// remove whitespace
342 342
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
343
-		foreach($checkInfos as $val)
343
+		foreach ($checkInfos as $val)
344 344
 		{
345
-			if(isset($args->{$val}))
345
+			if (isset($args->{$val}))
346 346
 			{
347 347
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
348 348
 			}
349 349
 		}
350 350
 		$output = $this->insertMember($args);
351
-		if(!$output->toBool()) return $output;
351
+		if (!$output->toBool()) return $output;
352 352
 
353 353
 		// insert ProfileImage, ImageName, ImageMark
354 354
 		$profile_image = $_FILES['profile_image'];
355
-		if(is_uploaded_file($profile_image['tmp_name']))
355
+		if (is_uploaded_file($profile_image['tmp_name']))
356 356
 		{
357 357
 			$this->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
358 358
 		}
359 359
 
360 360
 		$image_mark = $_FILES['image_mark'];
361
-		if(is_uploaded_file($image_mark['tmp_name']))
361
+		if (is_uploaded_file($image_mark['tmp_name']))
362 362
 		{
363 363
 			$this->insertImageMark($args->member_srl, $image_mark['tmp_name']);
364 364
 		}
365 365
 
366 366
 		$image_name = $_FILES['image_name'];
367
-		if(is_uploaded_file($image_name['tmp_name']))
367
+		if (is_uploaded_file($image_name['tmp_name']))
368 368
 		{
369 369
 			$this->insertImageName($args->member_srl, $image_name['tmp_name']);
370 370
 		}
371 371
 
372 372
 		// If a virtual site, join the site
373 373
 		$site_module_info = Context::get('site_module_info');
374
-		if($site_module_info->site_srl > 0)
374
+		if ($site_module_info->site_srl > 0)
375 375
 		{
376 376
 			$columnList = array('site_srl', 'group_srl');
377 377
 			$default_group = $oMemberModel->getDefaultGroup($site_module_info->site_srl, $columnList);
378
-			if($default_group->group_srl)
378
+			if ($default_group->group_srl)
379 379
 			{
380 380
 				$this->addMemberToGroup($args->member_srl, $default_group->group_srl, $site_module_info->site_srl);
381 381
 			}
382 382
 
383 383
 		}
384 384
 		// Log-in
385
-		if($config->enable_confirm != 'Y')
385
+		if ($config->enable_confirm != 'Y')
386 386
 		{
387
-			if($config->identifier == 'email_address')
387
+			if ($config->identifier == 'email_address')
388 388
 			{
389 389
 				$output = $this->doLogin($args->email_address);
390 390
 			}
@@ -392,8 +392,8 @@  discard block
 block discarded – undo
392 392
 			{
393 393
 				$output = $this->doLogin($args->user_id);
394 394
 			}
395
-			if(!$output->toBool()) {
396
-				if($output->error == -9)
395
+			if (!$output->toBool()) {
396
+				if ($output->error == -9)
397 397
 					$output->error = -11;
398 398
 				return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output);
399 399
 			}
@@ -401,8 +401,8 @@  discard block
 block discarded – undo
401 401
 
402 402
 		// Results
403 403
 		$this->add('member_srl', $args->member_srl);
404
-		if($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
405
-		if($config->enable_confirm == 'Y')
404
+		if ($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
405
+		if ($config->enable_confirm == 'Y')
406 406
 		{
407 407
 			$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
408 408
 			$this->setMessage($msg);
@@ -411,19 +411,19 @@  discard block
 block discarded – undo
411 411
 		else $this->setMessage('success_registed');
412 412
 		// Call a trigger (after)
413 413
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
414
-		if(!$trigger_output->toBool()) return $trigger_output;
414
+		if (!$trigger_output->toBool()) return $trigger_output;
415 415
 
416
-		if($config->redirect_url)
416
+		if ($config->redirect_url)
417 417
 		{
418 418
 			$returnUrl = $config->redirect_url;
419 419
 		}
420 420
 		else
421 421
 		{
422
-			if(Context::get('success_return_url'))
422
+			if (Context::get('success_return_url'))
423 423
 			{
424 424
 				$returnUrl = Context::get('success_return_url');
425 425
 			}
426
-			else if($_COOKIE['XE_REDIRECT_URL'])
426
+			else if ($_COOKIE['XE_REDIRECT_URL'])
427 427
 			{
428 428
 				$returnUrl = $_COOKIE['XE_REDIRECT_URL'];
429 429
 				setcookie("XE_REDIRECT_URL", '', 1);
@@ -437,26 +437,26 @@  discard block
 block discarded – undo
437 437
 
438 438
 	function procMemberModifyInfoBefore()
439 439
 	{
440
-		if($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD')
440
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD')
441 441
 		{
442 442
 			return $this->stop('msg_invalid_request');
443 443
 		}
444 444
 
445
-		if(!Context::get('is_logged'))
445
+		if (!Context::get('is_logged'))
446 446
 		{
447 447
 			return $this->stop('msg_not_logged');
448 448
 		}
449 449
 
450 450
 		$password = Context::get('password');
451 451
 
452
-		if(!$password)
452
+		if (!$password)
453 453
 		{
454 454
 			return $this->stop('msg_invalid_request');
455 455
 		}
456 456
 
457 457
 		$oMemberModel = getModel('member');
458 458
 
459
-		if(!$this->memberInfo->password)
459
+		if (!$this->memberInfo->password)
460 460
 		{
461 461
 			// Get information of logged-in user
462 462
 			$logged_info = Context::get('logged_info');
@@ -467,14 +467,14 @@  discard block
 block discarded – undo
467 467
 			$this->memberInfo->password = $memberInfo->password;
468 468
 		}
469 469
 		// Verify the current password
470
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
470
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
471 471
 		{
472 472
 			return new Object(-1, 'invalid_password');
473 473
 		}
474 474
 
475 475
 		$_SESSION['rechecked_password_step'] = 'VALIDATE_PASSWORD';
476 476
 
477
-		if(Context::get('success_return_url'))
477
+		if (Context::get('success_return_url'))
478 478
 		{
479 479
 			$redirectUrl = Context::get('success_return_url');
480 480
 		}
@@ -492,12 +492,12 @@  discard block
 block discarded – undo
492 492
 	 */
493 493
 	function procMemberModifyInfo()
494 494
 	{
495
-		if(!Context::get('is_logged'))
495
+		if (!Context::get('is_logged'))
496 496
 		{
497 497
 			return $this->stop('msg_not_logged');
498 498
 		}
499 499
 
500
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
500
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
501 501
 		{
502 502
 			return $this->stop('msg_invalid_request');
503 503
 		}
@@ -505,13 +505,13 @@  discard block
 block discarded – undo
505 505
 
506 506
 		// Extract the necessary information in advance
507 507
 		$oMemberModel = getModel('member');
508
-		$config = $oMemberModel->getMemberConfig ();
509
-		$getVars = array('find_account_answer','allow_mailing','allow_message');
510
-		if($config->signupForm)
508
+		$config = $oMemberModel->getMemberConfig();
509
+		$getVars = array('find_account_answer', 'allow_mailing', 'allow_message');
510
+		if ($config->signupForm)
511 511
 		{
512
-			foreach($config->signupForm as $formInfo)
512
+			foreach ($config->signupForm as $formInfo)
513 513
 			{
514
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
514
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
515 515
 				{
516 516
 					$getVars[] = $formInfo->name;
517 517
 				}
@@ -519,16 +519,16 @@  discard block
 block discarded – undo
519 519
 		}
520 520
 
521 521
 		$args = new stdClass;
522
-		foreach($getVars as $val)
522
+		foreach ($getVars as $val)
523 523
 		{
524 524
 			$args->{$val} = Context::get($val);
525
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
525
+			if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
526 526
 		}
527 527
 		// Login Information
528 528
 		$logged_info = Context::get('logged_info');
529 529
 		$args->member_srl = $logged_info->member_srl;
530 530
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
531
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
531
+		if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
532 532
 		// Remove some unnecessary variables from all the vars
533 533
 		$all_args = Context::getRequestVars();
534 534
 		unset($all_args->module);
@@ -552,9 +552,9 @@  discard block
 block discarded – undo
552 552
 
553 553
 		// remove whitespace
554 554
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
555
-		foreach($checkInfos as $val)
555
+		foreach ($checkInfos as $val)
556 556
 		{
557
-			if(isset($args->{$val}))
557
+			if (isset($args->{$val}))
558 558
 			{
559 559
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
560 560
 			}
@@ -562,22 +562,22 @@  discard block
 block discarded – undo
562 562
 
563 563
 		// Execute insert or update depending on the value of member_srl
564 564
 		$output = $this->updateMember($args);
565
-		if(!$output->toBool()) return $output;
565
+		if (!$output->toBool()) return $output;
566 566
 
567 567
 		$profile_image = $_FILES['profile_image'];
568
-		if(is_uploaded_file($profile_image['tmp_name']))
568
+		if (is_uploaded_file($profile_image['tmp_name']))
569 569
 		{
570 570
 			$this->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
571 571
 		}
572 572
 
573 573
 		$image_mark = $_FILES['image_mark'];
574
-		if(is_uploaded_file($image_mark['tmp_name']))
574
+		if (is_uploaded_file($image_mark['tmp_name']))
575 575
 		{
576 576
 			$this->insertImageMark($args->member_srl, $image_mark['tmp_name']);
577 577
 		}
578 578
 
579 579
 		$image_name = $_FILES['image_name'];
580
-		if(is_uploaded_file($image_name['tmp_name']))
580
+		if (is_uploaded_file($image_name['tmp_name']))
581 581
 		{
582 582
 			$this->insertImageName($args->member_srl, $image_name['tmp_name']);
583 583
 		}
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 
593 593
 		// Call a trigger after successfully log-in (after)
594 594
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo);
595
-		if(!$trigger_output->toBool()) return $trigger_output;
595
+		if (!$trigger_output->toBool()) return $trigger_output;
596 596
 
597 597
 		$this->setSessionInfo();
598 598
 		// Return result
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
 	 */
614 614
 	function procMemberModifyPassword()
615 615
 	{
616
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
616
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
617 617
 		// Extract the necessary information in advance
618 618
 		$current_password = trim(Context::get('current_password'));
619 619
 		$password = trim(Context::get('password1'));
@@ -627,17 +627,17 @@  discard block
 block discarded – undo
627 627
 
628 628
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
629 629
 		// Verify the cuttent password
630
-		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
630
+		if (!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
631 631
 
632 632
 		// Check if a new password is as same as the previous password
633
-		if($current_password == $password) return new Object(-1, 'invalid_new_password');
633
+		if ($current_password == $password) return new Object(-1, 'invalid_new_password');
634 634
 
635 635
 		// Execute insert or update depending on the value of member_srl
636 636
 		$args = new stdClass;
637 637
 		$args->member_srl = $member_srl;
638 638
 		$args->password = $password;
639 639
 		$output = $this->updateMemberPassword($args);
640
-		if(!$output->toBool()) return $output;
640
+		if (!$output->toBool()) return $output;
641 641
 
642 642
 		$this->add('member_srl', $args->member_srl);
643 643
 		$this->setMessage('success_updated');
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
 	 */
654 654
 	function procMemberLeave()
655 655
 	{
656
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
656
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
657 657
 		// Extract the necessary information in advance
658 658
 		$password = trim(Context::get('password'));
659 659
 		// Get information of logged-in user
@@ -662,17 +662,17 @@  discard block
 block discarded – undo
662 662
 		// Create a member model object
663 663
 		$oMemberModel = getModel('member');
664 664
 		// Get information of member_srl
665
-		if(!$this->memberInfo->password)
665
+		if (!$this->memberInfo->password)
666 666
 		{
667 667
 			$columnList = array('member_srl', 'password');
668 668
 			$memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
669 669
 			$this->memberInfo->password = $memberInfo->password;
670 670
 		}
671 671
 		// Verify the cuttent password
672
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
672
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
673 673
 
674 674
 		$output = $this->deleteMember($member_srl);
675
-		if(!$output->toBool()) return $output;
675
+		if (!$output->toBool()) return $output;
676 676
 		// Destroy all session information
677 677
 		$this->destroySessionInfo();
678 678
 		// Return success message
@@ -691,17 +691,17 @@  discard block
 block discarded – undo
691 691
 	{
692 692
 		// Check if the file is successfully uploaded
693 693
 		$file = $_FILES['profile_image'];
694
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
694
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
695 695
 		// Ignore if member_srl is invalid or doesn't exist.
696 696
 		$member_srl = Context::get('member_srl');
697
-		if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
697
+		if (!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
698 698
 
699 699
 		$logged_info = Context::get('logged_info');
700
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
700
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
701 701
 		// Return if member module is set not to use an image name or the user is not an administrator ;
702 702
 		$oModuleModel = getModel('module');
703 703
 		$config = $oModuleModel->getModuleConfig('member');
704
-		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
704
+		if ($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
705 705
 
706 706
 		$this->insertProfileImage($member_srl, $file['tmp_name']);
707 707
 		// Page refresh
@@ -723,25 +723,25 @@  discard block
 block discarded – undo
723 723
 	{
724 724
 
725 725
 		// Check uploaded file
726
-		if(!checkUploadedFile($target_file)) return;
726
+		if (!checkUploadedFile($target_file)) return;
727 727
 
728 728
 		$oMemberModel = getModel('member');
729 729
 		$config = $oMemberModel->getMemberConfig();
730 730
 
731 731
 		// Get an image size
732 732
 		$max_width = $config->profile_image_max_width;
733
-		if(!$max_width) $max_width = "90";
733
+		if (!$max_width) $max_width = "90";
734 734
 		$max_height = $config->profile_image_max_height;
735
-		if(!$max_height) $max_height = "90";
735
+		if (!$max_height) $max_height = "90";
736 736
 		// Get a target path to save
737 737
 		$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
738 738
 		FileHandler::makeDir($target_path);
739 739
 
740 740
 		// Get file information
741 741
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
742
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
743
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
744
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
742
+		if (IMAGETYPE_PNG == $type) $ext = 'png';
743
+		elseif (IMAGETYPE_JPEG == $type) $ext = 'jpg';
744
+		elseif (IMAGETYPE_GIF == $type) $ext = 'gif';
745 745
 		else
746 746
 		{
747 747
 			return;
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
 
752 752
 		$target_filename = sprintf('%s%d.%s', $target_path, $member_srl, $ext);
753 753
 		// Convert if the image size is larger than a given size or if the format is not a gif
754
-		if(($width > $max_width || $height > $max_height ) && $type != 1)
754
+		if (($width > $max_width || $height > $max_height) && $type != 1)
755 755
 		{
756 756
 			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
757 757
 		}
@@ -770,17 +770,17 @@  discard block
 block discarded – undo
770 770
 	{
771 771
 		// Check if the file is successfully uploaded
772 772
 		$file = $_FILES['image_name'];
773
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
773
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
774 774
 		// Ignore if member_srl is invalid or doesn't exist.
775 775
 		$member_srl = Context::get('member_srl');
776
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
776
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_name');
777 777
 
778 778
 		$logged_info = Context::get('logged_info');
779
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
779
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
780 780
 		// Return if member module is set not to use an image name or the user is not an administrator ;
781 781
 		$oModuleModel = getModel('module');
782 782
 		$config = $oModuleModel->getModuleConfig('member');
783
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
783
+		if ($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
784 784
 
785 785
 		$this->insertImageName($member_srl, $file['tmp_name']);
786 786
 		// Page refresh
@@ -801,15 +801,15 @@  discard block
 block discarded – undo
801 801
 	function insertImageName($member_srl, $target_file)
802 802
 	{
803 803
 		// Check uploaded file
804
-		if(!checkUploadedFile($target_file)) return;
804
+		if (!checkUploadedFile($target_file)) return;
805 805
 
806 806
 		$oModuleModel = getModel('module');
807 807
 		$config = $oModuleModel->getModuleConfig('member');
808 808
 		// Get an image size
809 809
 		$max_width = $config->image_name_max_width;
810
-		if(!$max_width) $max_width = "90";
810
+		if (!$max_width) $max_width = "90";
811 811
 		$max_height = $config->image_name_max_height;
812
-		if(!$max_height) $max_height = "20";
812
+		if (!$max_height) $max_height = "20";
813 813
 		// Get a target path to save
814 814
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
815 815
 		FileHandler::makeDir($target_path);
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
 		// Get file information
819 819
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
820 820
 		// Convert if the image size is larger than a given size or if the format is not a gif
821
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
821
+		if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
822 822
 		else @copy($target_file, $target_filename);
823 823
 	}
824 824
 
@@ -830,20 +830,20 @@  discard block
 block discarded – undo
830 830
 	function procMemberDeleteProfileImage($_memberSrl = 0)
831 831
 	{
832 832
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
833
-		if(!$member_srl)
833
+		if (!$member_srl)
834 834
 		{
835
-			return new Object(0,'success');
835
+			return new Object(0, 'success');
836 836
 		}
837 837
 
838 838
 		$logged_info = Context::get('logged_info');
839 839
 
840
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
840
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
841 841
 		{
842 842
 			$oMemberModel = getModel('member');
843 843
 			$profile_image = $oMemberModel->getProfileImage($member_srl);
844 844
 			FileHandler::removeFile($profile_image->file);
845 845
 		}
846
-		return new Object(0,'success');
846
+		return new Object(0, 'success');
847 847
 	}
848 848
 
849 849
 	/**
@@ -854,20 +854,20 @@  discard block
 block discarded – undo
854 854
 	function procMemberDeleteImageName($_memberSrl = 0)
855 855
 	{
856 856
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
857
-		if(!$member_srl)
857
+		if (!$member_srl)
858 858
 		{
859
-			return new Object(0,'success');
859
+			return new Object(0, 'success');
860 860
 		}
861 861
 
862 862
 		$logged_info = Context::get('logged_info');
863 863
 
864
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
864
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
865 865
 		{
866 866
 			$oMemberModel = getModel('member');
867 867
 			$image_name = $oMemberModel->getImageName($member_srl);
868 868
 			FileHandler::removeFile($image_name->file);
869 869
 		}
870
-		return new Object(0,'success');
870
+		return new Object(0, 'success');
871 871
 	}
872 872
 
873 873
 	/**
@@ -879,17 +879,17 @@  discard block
 block discarded – undo
879 879
 	{
880 880
 		// Check if the file is successfully uploaded
881 881
 		$file = $_FILES['image_mark'];
882
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
882
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
883 883
 		// Ignore if member_srl is invalid or doesn't exist.
884 884
 		$member_srl = Context::get('member_srl');
885
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
885
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
886 886
 
887 887
 		$logged_info = Context::get('logged_info');
888
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
888
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
889 889
 		// Membership in the images mark the module using the ban was set by an administrator or return;
890 890
 		$oModuleModel = getModel('module');
891 891
 		$config = $oModuleModel->getModuleConfig('member');
892
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
892
+		if ($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
893 893
 
894 894
 		$this->insertImageMark($member_srl, $file['tmp_name']);
895 895
 		// Page refresh
@@ -910,15 +910,15 @@  discard block
 block discarded – undo
910 910
 	function insertImageMark($member_srl, $target_file)
911 911
 	{
912 912
 		// Check uploaded file
913
-		if(!checkUploadedFile($target_file)) return;
913
+		if (!checkUploadedFile($target_file)) return;
914 914
 
915 915
 		$oModuleModel = getModel('module');
916 916
 		$config = $oModuleModel->getModuleConfig('member');
917 917
 		// Get an image size
918 918
 		$max_width = $config->image_mark_max_width;
919
-		if(!$max_width) $max_width = "20";
919
+		if (!$max_width) $max_width = "20";
920 920
 		$max_height = $config->image_mark_max_height;
921
-		if(!$max_height) $max_height = "20";
921
+		if (!$max_height) $max_height = "20";
922 922
 
923 923
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
924 924
 		FileHandler::makeDir($target_path);
@@ -927,7 +927,7 @@  discard block
 block discarded – undo
927 927
 		// Get file information
928 928
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
929 929
 
930
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
930
+		if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
931 931
 		else @copy($target_file, $target_filename);
932 932
 	}
933 933
 
@@ -939,20 +939,20 @@  discard block
 block discarded – undo
939 939
 	function procMemberDeleteImageMark($_memberSrl = 0)
940 940
 	{
941 941
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
942
-		if(!$member_srl)
942
+		if (!$member_srl)
943 943
 		{
944
-			return new Object(0,'success');
944
+			return new Object(0, 'success');
945 945
 		}
946 946
 
947 947
 		$logged_info = Context::get('logged_info');
948 948
 
949
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
949
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
950 950
 		{
951 951
 			$oMemberModel = getModel('member');
952 952
 			$image_mark = $oMemberModel->getImageMark($member_srl);
953 953
 			FileHandler::removeFile($image_mark->file);
954 954
 		}
955
-		return new Object(0,'success');
955
+		return new Object(0, 'success');
956 956
 	}
957 957
 
958 958
 	/**
@@ -963,26 +963,26 @@  discard block
 block discarded – undo
963 963
 	function procMemberFindAccount()
964 964
 	{
965 965
 		$email_address = Context::get('email_address');
966
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
966
+		if (!$email_address) return new Object(-1, 'msg_invalid_request');
967 967
 
968 968
 		$oMemberModel = getModel('member');
969 969
 		$oModuleModel = getModel('module');
970 970
 
971 971
 		// Check if a member having the same email address exists
972 972
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
973
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
973
+		if (!$member_srl) return new Object(-1, 'msg_email_not_exists');
974 974
 
975 975
 		// Get information of the member
976 976
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
977 977
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
978 978
 
979 979
 		// Check if possible to find member's ID and password
980
-		if($member_info->denied == 'Y')
980
+		if ($member_info->denied == 'Y')
981 981
 		{
982 982
 			$chk_args = new stdClass;
983 983
 			$chk_args->member_srl = $member_info->member_srl;
984 984
 			$output = executeQuery('member.chkAuthMail', $chk_args);
985
-			if($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
985
+			if ($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
986 986
 		}
987 987
 
988 988
 		// Insert data into the authentication DB
@@ -995,19 +995,19 @@  discard block
 block discarded – undo
995 995
 		$args->is_register = 'N';
996 996
 
997 997
 		$output = executeQuery('member.insertAuthMail', $args);
998
-		if(!$output->toBool()) return $output;
998
+		if (!$output->toBool()) return $output;
999 999
 		// Get content of the email to send a member
1000 1000
 		Context::set('auth_args', $args);
1001 1001
 
1002 1002
 		$member_config = $oModuleModel->getModuleConfig('member');
1003 1003
 		$memberInfo = array();
1004 1004
 		global $lang;
1005
-		if(is_array($member_config->signupForm))
1005
+		if (is_array($member_config->signupForm))
1006 1006
 		{
1007
-			$exceptForm=array('password', 'find_account_question');
1008
-			foreach($member_config->signupForm as $form)
1007
+			$exceptForm = array('password', 'find_account_question');
1008
+			foreach ($member_config->signupForm as $form)
1009 1009
 			{
1010
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1010
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1011 1011
 				{
1012 1012
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1013 1013
 				}
@@ -1022,15 +1022,15 @@  discard block
 block discarded – undo
1022 1022
 		}
1023 1023
 		Context::set('memberInfo', $memberInfo);
1024 1024
 
1025
-		if(!$member_config->skin) $member_config->skin = "default";
1026
-		if(!$member_config->colorset) $member_config->colorset = "white";
1025
+		if (!$member_config->skin) $member_config->skin = "default";
1026
+		if (!$member_config->colorset) $member_config->colorset = "white";
1027 1027
 
1028 1028
 		Context::set('member_config', $member_config);
1029 1029
 
1030 1030
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1031
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1031
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1032 1032
 
1033
-		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1033
+		$find_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1034 1034
 		Context::set('find_url', $find_url);
1035 1035
 
1036 1036
 		$oTemplate = &TemplateHandler::getInstance();
@@ -1040,19 +1040,19 @@  discard block
 block discarded – undo
1040 1040
 		$member_config = $oModuleModel->getModuleConfig('member');
1041 1041
 		// Send a mail
1042 1042
 		$oMail = new Mail();
1043
-		$oMail->setTitle( Context::getLang('msg_find_account_title') );
1043
+		$oMail->setTitle(Context::getLang('msg_find_account_title'));
1044 1044
 		$oMail->setContent($content);
1045
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1046
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1045
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1046
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1047 1047
 		$oMail->send();
1048 1048
 		// Return message
1049 1049
 		$msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address);
1050
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
1050
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
1051 1051
 		{
1052 1052
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberFindAccount');
1053 1053
 			$this->setRedirectUrl($returnUrl);
1054 1054
 		}
1055
-		return new Object(0,$msg);
1055
+		return new Object(0, $msg);
1056 1056
 	}
1057 1057
 
1058 1058
 	/**
@@ -1070,28 +1070,28 @@  discard block
 block discarded – undo
1070 1070
 		$find_account_question = trim(Context::get('find_account_question'));
1071 1071
 		$find_account_answer = trim(Context::get('find_account_answer'));
1072 1072
 
1073
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1073
+		if (($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1074 1074
 
1075 1075
 		$oModuleModel = getModel('module');
1076 1076
 		// Check if a member having the same email address exists
1077 1077
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1078
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1078
+		if (!$member_srl) return new Object(-1, 'msg_email_not_exists');
1079 1079
 		// Get information of the member
1080 1080
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1081 1081
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1082 1082
 
1083 1083
 		// Display a message if no answer is entered
1084
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1084
+		if (!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1085 1085
 
1086
-		if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) return new Object(-1, 'msg_answer_not_matches');
1086
+		if (trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) return new Object(-1, 'msg_answer_not_matches');
1087 1087
 
1088
-		if($config->identifier == 'email_address')
1088
+		if ($config->identifier == 'email_address')
1089 1089
 		{
1090 1090
 			$user_id = $email_address;
1091 1091
 		}
1092 1092
 
1093 1093
 		// Update to a temporary password and set change_password_date to 1
1094
-		$oPassword =  new Password();
1094
+		$oPassword = new Password();
1095 1095
 		$temp_password = $oPassword->createTemporaryPassword(8);
1096 1096
 
1097 1097
 		$args = new stdClass();
@@ -1099,11 +1099,11 @@  discard block
 block discarded – undo
1099 1099
 		$args->password = $temp_password;
1100 1100
 		$args->change_password_date = '1';
1101 1101
 		$output = $this->updateMemberPassword($args);
1102
-		if(!$output->toBool()) return $output;
1102
+		if (!$output->toBool()) return $output;
1103 1103
 
1104
-		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1104
+		$_SESSION['xe_temp_password_'.$user_id] = $temp_password;
1105 1105
 
1106
-		$this->add('user_id',$user_id);
1106
+		$this->add('user_id', $user_id);
1107 1107
 
1108 1108
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
1109 1109
 		$this->setRedirectUrl($returnUrl.'&user_id='.$user_id);
@@ -1123,7 +1123,7 @@  discard block
 block discarded – undo
1123 1123
 		$member_srl = Context::get('member_srl');
1124 1124
 		$auth_key = Context::get('auth_key');
1125 1125
 
1126
-		if(!$member_srl || !$auth_key)
1126
+		if (!$member_srl || !$auth_key)
1127 1127
 		{
1128 1128
 			return $this->stop('msg_invalid_request');
1129 1129
 		}
@@ -1134,9 +1134,9 @@  discard block
 block discarded – undo
1134 1134
 		$args->auth_key = $auth_key;
1135 1135
 		$output = executeQuery('member.getAuthMail', $args);
1136 1136
 
1137
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
1137
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
1138 1138
 		{
1139
-			if(strlen($output->data->auth_key) !== strlen($auth_key))
1139
+			if (strlen($output->data->auth_key) !== strlen($auth_key))
1140 1140
 			{
1141 1141
 				executeQuery('member.deleteAuthMail', $args);
1142 1142
 			}
@@ -1144,7 +1144,7 @@  discard block
 block discarded – undo
1144 1144
 			return $this->stop('msg_invalid_auth_key');
1145 1145
 		}
1146 1146
 
1147
-		if(ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1147
+		if (ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1148 1148
 		{
1149 1149
 			executeQuery('member.deleteAuthMail', $args);
1150 1150
 			return $this->stop('msg_invalid_auth_key');
@@ -1153,7 +1153,7 @@  discard block
 block discarded – undo
1153 1153
 		$args->password = $output->data->new_password;
1154 1154
 
1155 1155
 		// If credentials are correct, change the password to a new one
1156
-		if($output->data->is_register == 'Y')
1156
+		if ($output->data->is_register == 'Y')
1157 1157
 		{
1158 1158
 			$args->denied = 'N';
1159 1159
 		}
@@ -1166,13 +1166,13 @@  discard block
 block discarded – undo
1166 1166
 		$is_register = $output->data->is_register;
1167 1167
 
1168 1168
 		$output = executeQuery('member.updateMemberPassword', $args);
1169
-		if(!$output->toBool())
1169
+		if (!$output->toBool())
1170 1170
 		{
1171 1171
 			return $this->stop($output->getMessage());
1172 1172
 		}
1173 1173
 
1174 1174
 		// Remove all values having the member_srl from authentication table
1175
-		executeQuery('member.deleteAuthMail',$args);
1175
+		executeQuery('member.deleteAuthMail', $args);
1176 1176
 
1177 1177
 		$this->_clearMemberCache($args->member_srl);
1178 1178
 
@@ -1191,33 +1191,33 @@  discard block
 block discarded – undo
1191 1191
 	{
1192 1192
 		// Get an email_address
1193 1193
 		$email_address = Context::get('email_address');
1194
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1194
+		if (!$email_address) return new Object(-1, 'msg_invalid_request');
1195 1195
 		// Log test by using email_address
1196 1196
 		$oMemberModel = getModel('member');
1197 1197
 
1198 1198
 		$args = new stdClass;
1199 1199
 		$args->email_address = $email_address;
1200 1200
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1201
-		if(!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1201
+		if (!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1202 1202
 
1203 1203
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1204 1204
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1205 1205
 
1206 1206
 		$oModuleModel = getModel('module');
1207 1207
 		$member_config = $oModuleModel->getModuleConfig('member');
1208
-		if(!$member_config->skin) $member_config->skin = "default";
1209
-		if(!$member_config->colorset) $member_config->colorset = "white";
1208
+		if (!$member_config->skin) $member_config->skin = "default";
1209
+		if (!$member_config->colorset) $member_config->colorset = "white";
1210 1210
 
1211 1211
 		// Check if a authentication mail has been sent previously
1212 1212
 		$chk_args = new stdClass;
1213 1213
 		$chk_args->member_srl = $member_info->member_srl;
1214 1214
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1215
-		if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1215
+		if ($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1216 1216
 
1217 1217
 		$auth_args = new stdClass;
1218 1218
 		$auth_args->member_srl = $member_info->member_srl;
1219 1219
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1220
-		if(!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1220
+		if (!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1221 1221
 		$auth_info = $output->data[0];
1222 1222
 
1223 1223
 		// Update the regdate of authmail entry
@@ -1228,12 +1228,12 @@  discard block
 block discarded – undo
1228 1228
 
1229 1229
 		$memberInfo = array();
1230 1230
 		global $lang;
1231
-		if(is_array($member_config->signupForm))
1231
+		if (is_array($member_config->signupForm))
1232 1232
 		{
1233
-			$exceptForm=array('password', 'find_account_question');
1234
-			foreach($member_config->signupForm as $form)
1233
+			$exceptForm = array('password', 'find_account_question');
1234
+			foreach ($member_config->signupForm as $form)
1235 1235
 			{
1236
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1236
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1237 1237
 				{
1238 1238
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1239 1239
 				}
@@ -1252,19 +1252,19 @@  discard block
 block discarded – undo
1252 1252
 		Context::set('member_config', $member_config);
1253 1253
 
1254 1254
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1255
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1255
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1256 1256
 
1257
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1257
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_info->auth_key);
1258 1258
 		Context::set('auth_url', $auth_url);
1259 1259
 
1260 1260
 		$oTemplate = &TemplateHandler::getInstance();
1261 1261
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1262 1262
 		// Send a mail
1263 1263
 		$oMail = new Mail();
1264
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1264
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1265 1265
 		$oMail->setContent($content);
1266
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1267
-		$oMail->setReceiptor( $args->user_name, $args->email_address );
1266
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1267
+		$oMail->setReceiptor($args->user_name, $args->email_address);
1268 1268
 		$oMail->send();
1269 1269
 
1270 1270
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
@@ -1279,23 +1279,23 @@  discard block
 block discarded – undo
1279 1279
 		$memberInfo = $_SESSION['auth_member_info'];
1280 1280
 		unset($_SESSION['auth_member_info']);
1281 1281
 
1282
-		if(!$memberInfo)
1282
+		if (!$memberInfo)
1283 1283
 		{
1284 1284
 			return $this->stop('msg_invalid_request');
1285 1285
 		}
1286 1286
 
1287 1287
 		$newEmail = Context::get('email_address');
1288 1288
 
1289
-		if(!$newEmail)
1289
+		if (!$newEmail)
1290 1290
 		{
1291 1291
 			return $this->stop('msg_invalid_request');
1292 1292
 		}
1293 1293
 
1294 1294
 		$oMemberModel = getModel('member');
1295 1295
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
1296
-		if($member_srl)
1296
+		if ($member_srl)
1297 1297
 		{
1298
-			return new Object(-1,'msg_exists_email_address');
1298
+			return new Object(-1, 'msg_exists_email_address');
1299 1299
 		}
1300 1300
 
1301 1301
 		// remove all key by member_srl
@@ -1303,7 +1303,7 @@  discard block
 block discarded – undo
1303 1303
 		$args->member_srl = $memberInfo->member_srl;
1304 1304
 		$output = executeQuery('member.deleteAuthMail', $args);
1305 1305
 
1306
-		if(!$output->toBool())
1306
+		if (!$output->toBool())
1307 1307
 		{
1308 1308
 			return $output;
1309 1309
 		}
@@ -1313,7 +1313,7 @@  discard block
 block discarded – undo
1313 1313
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
1314 1314
 
1315 1315
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
1316
-		if(!$output->toBool())
1316
+		if (!$output->toBool())
1317 1317
 		{
1318 1318
 			return $this->stop($output->getMessage());
1319 1319
 		}
@@ -1330,7 +1330,7 @@  discard block
 block discarded – undo
1330 1330
 		$auth_args->is_register = 'Y';
1331 1331
 
1332 1332
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1333
-		if(!$output->toBool()) return $output;
1333
+		if (!$output->toBool()) return $output;
1334 1334
 
1335 1335
 		$memberInfo->email_address = $newEmail;
1336 1336
 
@@ -1354,12 +1354,12 @@  discard block
 block discarded – undo
1354 1354
 		$memberInfo = array();
1355 1355
 
1356 1356
 		global $lang;
1357
-		if(is_array($member_config->signupForm))
1357
+		if (is_array($member_config->signupForm))
1358 1358
 		{
1359
-			$exceptForm=array('password', 'find_account_question');
1360
-			foreach($member_config->signupForm as $form)
1359
+			$exceptForm = array('password', 'find_account_question');
1360
+			foreach ($member_config->signupForm as $form)
1361 1361
 			{
1362
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1362
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1363 1363
 				{
1364 1364
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1365 1365
 				}
@@ -1374,25 +1374,25 @@  discard block
 block discarded – undo
1374 1374
 		}
1375 1375
 		Context::set('memberInfo', $memberInfo);
1376 1376
 
1377
-		if(!$member_config->skin) $member_config->skin = "default";
1378
-		if(!$member_config->colorset) $member_config->colorset = "white";
1377
+		if (!$member_config->skin) $member_config->skin = "default";
1378
+		if (!$member_config->colorset) $member_config->colorset = "white";
1379 1379
 
1380 1380
 		Context::set('member_config', $member_config);
1381 1381
 
1382 1382
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1383
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1383
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1384 1384
 
1385
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1385
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
1386 1386
 		Context::set('auth_url', $auth_url);
1387 1387
 
1388 1388
 		$oTemplate = &TemplateHandler::getInstance();
1389 1389
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1390 1390
 		// Send a mail
1391 1391
 		$oMail = new Mail();
1392
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1392
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1393 1393
 		$oMail->setContent($content);
1394
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1395
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1394
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1395
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1396 1396
 		$oMail->send();
1397 1397
 	}
1398 1398
 
@@ -1405,7 +1405,7 @@  discard block
 block discarded – undo
1405 1405
 	{
1406 1406
 		$site_module_info = Context::get('site_module_info');
1407 1407
 		$logged_info = Context::get('logged_info');
1408
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1408
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new Object(-1, 'msg_invalid_request');
1409 1409
 
1410 1410
 		$oMemberModel = getModel('member');
1411 1411
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1424,13 +1424,13 @@  discard block
 block discarded – undo
1424 1424
 	{
1425 1425
 		$site_module_info = Context::get('site_module_info');
1426 1426
 		$logged_info = Context::get('logged_info');
1427
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1427
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new Object(-1, 'msg_invalid_request');
1428 1428
 
1429 1429
 		$args = new stdClass;
1430
-		$args->site_srl= $site_module_info->site_srl;
1430
+		$args->site_srl = $site_module_info->site_srl;
1431 1431
 		$args->member_srl = $logged_info->member_srl;
1432 1432
 		$output = executeQuery('member.deleteMembersGroup', $args);
1433
-		if(!$output->toBool()) return $output;
1433
+		if (!$output->toBool()) return $output;
1434 1434
 		$this->setMessage('success_deleted');
1435 1435
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1436 1436
 	}
@@ -1444,25 +1444,25 @@  discard block
 block discarded – undo
1444 1444
 	 */
1445 1445
 	function setMemberConfig($args)
1446 1446
 	{
1447
-		if(!$args->skin) $args->skin = "default";
1448
-		if(!$args->colorset) $args->colorset = "white";
1449
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1450
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1451
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1452
-		$args->enable_openid= 'N';
1453
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1454
-		if($args->image_name!='Y') $args->image_name = 'N';
1455
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1456
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1457
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1458
-		$args->limit_day = (int)$args->limit_day;
1447
+		if (!$args->skin) $args->skin = "default";
1448
+		if (!$args->colorset) $args->colorset = "white";
1449
+		if (!$args->editor_skin) $args->editor_skin = "ckeditor";
1450
+		if (!$args->editor_colorset) $args->editor_colorset = "moono";
1451
+		if ($args->enable_join != 'Y') $args->enable_join = 'N';
1452
+		$args->enable_openid = 'N';
1453
+		if ($args->profile_image != 'Y') $args->profile_image = 'N';
1454
+		if ($args->image_name != 'Y') $args->image_name = 'N';
1455
+		if ($args->image_mark != 'Y') $args->image_mark = 'N';
1456
+		if ($args->group_image_mark != 'Y') $args->group_image_mark = 'N';
1457
+		if (!trim(strip_tags($args->agreement))) $args->agreement = null;
1458
+		$args->limit_day = (int) $args->limit_day;
1459 1459
 
1460 1460
 		$agreement = trim($args->agreement);
1461 1461
 		unset($args->agreement);
1462 1462
 
1463 1463
 		$oModuleController = getController('module');
1464
-		$output = $oModuleController->insertModuleConfig('member',$args);
1465
-		if(!$output->toBool()) return $output;
1464
+		$output = $oModuleController->insertModuleConfig('member', $args);
1465
+		if (!$output->toBool()) return $output;
1466 1466
 
1467 1467
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1468 1468
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1483,11 +1483,11 @@  discard block
 block discarded – undo
1483 1483
 		$signature = trim(removeHackTag($signature));
1484 1484
 		$signature = preg_replace('/<(\/?)(embed|object|param)/is', '&lt;$1$2', $signature);
1485 1485
 
1486
-		$check_signature = trim(str_replace(array('&nbsp;',"\n","\r"), '', strip_tags($signature, '<img><object>')));
1486
+		$check_signature = trim(str_replace(array('&nbsp;', "\n", "\r"), '', strip_tags($signature, '<img><object>')));
1487 1487
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1488 1488
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1489 1489
 
1490
-		if(!$check_signature) return FileHandler::removeFile($filename);
1490
+		if (!$check_signature) return FileHandler::removeFile($filename);
1491 1491
 
1492 1492
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1493 1493
 		FileHandler::makeDir($path);
@@ -1516,15 +1516,15 @@  discard block
 block discarded – undo
1516 1516
 	 *
1517 1517
 	 * @return Object
1518 1518
 	 */
1519
-	function addMemberToGroup($member_srl, $group_srl, $site_srl=0)
1519
+	function addMemberToGroup($member_srl, $group_srl, $site_srl = 0)
1520 1520
 	{
1521 1521
 		$args = new stdClass();
1522 1522
 		$args->member_srl = $member_srl;
1523 1523
 		$args->group_srl = $group_srl;
1524
-		if($site_srl) $args->site_srl = $site_srl;
1524
+		if ($site_srl) $args->site_srl = $site_srl;
1525 1525
 
1526 1526
 		// Add
1527
-		$output = executeQuery('member.addMemberToGroup',$args);
1527
+		$output = executeQuery('member.addMemberToGroup', $args);
1528 1528
 		$output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args);
1529 1529
 
1530 1530
 		$this->_clearMemberCache($member_srl, $site_srl);
@@ -1544,18 +1544,18 @@  discard block
 block discarded – undo
1544 1544
 	{
1545 1545
 		$obj = new stdClass;
1546 1546
 		$obj->site_srl = $args->site_srl;
1547
-		$obj->member_srl = implode(',',$args->member_srl);
1547
+		$obj->member_srl = implode(',', $args->member_srl);
1548 1548
 
1549 1549
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1550
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1550
+		if ($output->data) foreach ($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1551 1551
 
1552 1552
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1553
-		if(!$output->toBool()) return $output;
1553
+		if (!$output->toBool()) return $output;
1554 1554
 
1555 1555
 		$inserted_members = array();
1556
-		foreach($args->member_srl as $key => $val)
1556
+		foreach ($args->member_srl as $key => $val)
1557 1557
 		{
1558
-			if($inserted_members[$val]) continue;
1558
+			if ($inserted_members[$val]) continue;
1559 1559
 			$inserted_members[$val] = true;
1560 1560
 
1561 1561
 			unset($obj);
@@ -1565,7 +1565,7 @@  discard block
 block discarded – undo
1565 1565
 			$obj->site_srl = $args->site_srl;
1566 1566
 			$obj->regdate = $date[$obj->member_srl];
1567 1567
 			$output = executeQuery('member.addMemberToGroup', $obj);
1568
-			if(!$output->toBool()) return $output;
1568
+			if (!$output->toBool()) return $output;
1569 1569
 
1570 1570
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1571 1571
 		}
@@ -1587,9 +1587,9 @@  discard block
 block discarded – undo
1587 1587
 		// Get information of the key
1588 1588
 		$output = executeQuery('member.getAutologin', $args);
1589 1589
 		// If no information exists, delete a cookie
1590
-		if(!$output->toBool() || !$output->data)
1590
+		if (!$output->toBool() || !$output->data)
1591 1591
 		{
1592
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/');
1592
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365, '/');
1593 1593
 			return;
1594 1594
 		}
1595 1595
 
@@ -1599,9 +1599,9 @@  discard block
 block discarded – undo
1599 1599
 		$user_id = ($config->identifier == 'user_id') ? $output->data->user_id : $output->data->email_address;
1600 1600
 		$password = $output->data->password;
1601 1601
 
1602
-		if(!$user_id || !$password)
1602
+		if (!$user_id || !$password)
1603 1603
 		{
1604
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/');
1604
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365, '/');
1605 1605
 			return;
1606 1606
 		}
1607 1607
 
@@ -1611,7 +1611,7 @@  discard block
 block discarded – undo
1611 1611
 		$check_key = strtolower($user_id).$password.$_SERVER['HTTP_USER_AGENT'];
1612 1612
 		$check_key = substr(hash_hmac('sha256', $check_key, substr($args->autologin_key, 0, 32)), 0, 32);
1613 1613
 
1614
-		if($check_key === substr($args->autologin_key, 32))
1614
+		if ($check_key === substr($args->autologin_key, 32))
1615 1615
 		{
1616 1616
 			// Check change_password_date
1617 1617
 			$oModuleModel = getModel('module');
@@ -1619,12 +1619,12 @@  discard block
 block discarded – undo
1619 1619
 			$limit_date = $member_config->change_password_date;
1620 1620
 
1621 1621
 			// Check if change_password_date is set
1622
-			if($limit_date > 0)
1622
+			if ($limit_date > 0)
1623 1623
 			{
1624 1624
 				$oMemberModel = getModel('member');
1625 1625
 				$columnList = array('member_srl', 'change_password_date');
1626 1626
 
1627
-				if($config->identifier == 'user_id')
1627
+				if ($config->identifier == 'user_id')
1628 1628
 				{
1629 1629
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1630 1630
 				}
@@ -1633,7 +1633,7 @@  discard block
 block discarded – undo
1633 1633
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1634 1634
 				}
1635 1635
 
1636
-				if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){
1636
+				if ($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day'))) {
1637 1637
 					$do_auto_login = true;
1638 1638
 				}
1639 1639
 
@@ -1644,14 +1644,14 @@  discard block
 block discarded – undo
1644 1644
 			}
1645 1645
 		}
1646 1646
 
1647
-		if($do_auto_login)
1647
+		if ($do_auto_login)
1648 1648
 		{
1649 1649
 			$output = $this->doLogin($user_id);
1650 1650
 		}
1651 1651
 		else
1652 1652
 		{
1653 1653
 			executeQuery('member.deleteAutologin', $args);
1654
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/');
1654
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365, '/');
1655 1655
 		}
1656 1656
 	}
1657 1657
 
@@ -1667,13 +1667,13 @@  discard block
 block discarded – undo
1667 1667
 	function doLogin($user_id, $password = '', $keep_signed = false)
1668 1668
 	{
1669 1669
 		$user_id = strtolower($user_id);
1670
-		if(!$user_id) return new Object(-1, 'null_user_id');
1670
+		if (!$user_id) return new Object(-1, 'null_user_id');
1671 1671
 		// Call a trigger before log-in (before)
1672 1672
 		$trigger_obj = new stdClass();
1673 1673
 		$trigger_obj->user_id = $user_id;
1674 1674
 		$trigger_obj->password = $password;
1675 1675
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1676
-		if(!$trigger_output->toBool()) return $trigger_output;
1676
+		if (!$trigger_output->toBool()) return $trigger_output;
1677 1677
 		// Create a member model object
1678 1678
 		$oMemberModel = getModel('member');
1679 1679
 
@@ -1683,12 +1683,12 @@  discard block
 block discarded – undo
1683 1683
 		$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1684 1684
 
1685 1685
 		// check identifier
1686
-		if($config->identifier == 'email_address')
1686
+		if ($config->identifier == 'email_address')
1687 1687
 		{
1688 1688
 			// Get user_id information
1689 1689
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1690 1690
 			// Set an invalid user if no value returned
1691
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1691
+			if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1692 1692
 
1693 1693
 		}
1694 1694
 		else
@@ -1696,24 +1696,24 @@  discard block
 block discarded – undo
1696 1696
 			// Get user_id information
1697 1697
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1698 1698
 			// Set an invalid user if no value returned
1699
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1699
+			if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1700 1700
 		}
1701 1701
 
1702 1702
 		$output = executeQuery('member.getLoginCountByIp', $args);
1703 1703
 		$errorCount = $output->data->count;
1704
-		if($errorCount >= $config->max_error_count)
1704
+		if ($errorCount >= $config->max_error_count)
1705 1705
 		{
1706 1706
 			$last_update = strtotime($output->data->last_update);
1707
-			$term = intval($_SERVER['REQUEST_TIME']-$last_update);
1708
-			if($term < $config->max_error_count_time)
1707
+			$term = intval($_SERVER['REQUEST_TIME'] - $last_update);
1708
+			if ($term < $config->max_error_count_time)
1709 1709
 			{
1710 1710
 				$term = $config->max_error_count_time - $term;
1711
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1712
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1713
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1714
-				else $term = intval($term/86400).Context::getLang('unit_day');
1711
+				if ($term < 60) $term = intval($term).Context::getLang('unit_sec');
1712
+				elseif (60 <= $term && $term < 3600) $term = intval($term / 60).Context::getLang('unit_min');
1713
+				elseif (3600 <= $term && $term < 86400) $term = intval($term / 3600).Context::getLang('unit_hour');
1714
+				else $term = intval($term / 86400).Context::getLang('unit_day');
1715 1715
 
1716
-				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1716
+				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'), $term));
1717 1717
 			}
1718 1718
 			else
1719 1719
 			{
@@ -1723,13 +1723,13 @@  discard block
 block discarded – undo
1723 1723
 		}
1724 1724
 
1725 1725
 		// Password Check
1726
-		if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1726
+		if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1727 1727
 		{
1728
-			return $this->recordMemberLoginError(-1, 'invalid_password',$this->memberInfo);
1728
+			return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo);
1729 1729
 		}
1730 1730
 
1731 1731
 		// If denied == 'Y', notify
1732
-		if($this->memberInfo->denied == 'Y')
1732
+		if ($this->memberInfo->denied == 'Y')
1733 1733
 		{
1734 1734
 			$args->member_srl = $this->memberInfo->member_srl;
1735 1735
 			$output = executeQuery('member.chkAuthMail', $args);
@@ -1737,12 +1737,12 @@  discard block
 block discarded – undo
1737 1737
 			{
1738 1738
 				$_SESSION['auth_member_srl'] = $this->memberInfo->member_srl;
1739 1739
 				$redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail');
1740
-				return $this->setRedirectUrl($redirectUrl, new Object(-1,'msg_user_not_confirmed'));
1740
+				return $this->setRedirectUrl($redirectUrl, new Object(-1, 'msg_user_not_confirmed'));
1741 1741
 			}
1742
-			return new Object(-1,'msg_user_denied');
1742
+			return new Object(-1, 'msg_user_denied');
1743 1743
 		}
1744 1744
 		// Notify if denied_date is less than the current time
1745
-		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
1745
+		if ($this->memberInfo->limit_date && substr($this->memberInfo->limit_date, 0, 8) >= date("Ymd")) return new Object(-9, sprintf(Context::getLang('msg_user_limited'), zdate($this->memberInfo->limit_date, "Y-m-d")));
1746 1746
 		// Update the latest login time
1747 1747
 		$args->member_srl = $this->memberInfo->member_srl;
1748 1748
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1752,36 +1752,36 @@  discard block
 block discarded – undo
1752 1752
 
1753 1753
 		// Check if there is recoding table.
1754 1754
 		$oDB = &DB::getInstance();
1755
-		if($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1755
+		if ($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1756 1756
 		{
1757 1757
 			// check if there is login fail records.
1758 1758
 			$output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args);
1759
-			if($output->data && $output->data->content)
1759
+			if ($output->data && $output->data->content)
1760 1760
 			{
1761 1761
 				$title = Context::getLang('login_fail_report');
1762 1762
 				$message = '<ul>';
1763 1763
 				$content = unserialize($output->data->content);
1764
-				if(count($content) > $config->max_error_count)
1764
+				if (count($content) > $config->max_error_count)
1765 1765
 				{
1766
-					foreach($content as $val)
1766
+					foreach ($content as $val)
1767 1767
 					{
1768
-						$message .= '<li>'.Context::getLang('regdate').': '.date('Y-m-d h:i:sa',$val[2]).'<ul><li>'.Context::getLang('ipaddress').': '.$val[0].'</li><li>'.Context::getLang('message').': '.$val[1].'</li></ul></li>';
1768
+						$message .= '<li>'.Context::getLang('regdate').': '.date('Y-m-d h:i:sa', $val[2]).'<ul><li>'.Context::getLang('ipaddress').': '.$val[0].'</li><li>'.Context::getLang('message').': '.$val[1].'</li></ul></li>';
1769 1769
 					}
1770 1770
 					$message .= '</ul>';
1771
-					$content = sprintf(Context::getLang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa'));
1771
+					$content = sprintf(Context::getLang('login_fail_report_contents'), $message, date('Y-m-d h:i:sa'));
1772 1772
 
1773 1773
 					//send message
1774 1774
 					$oCommunicationController = getController('communication');
1775 1775
 					$oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true);
1776 1776
 
1777
-					if($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1777
+					if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1778 1778
 					{
1779 1779
 						$view_url = Context::getRequestUri();
1780
-						$content = sprintf("%s<hr /><p>From: <a href=\"%s\" target=\"_blank\">%s</a><br />To: %s(%s)</p>",$content, $view_url, $view_url, $this->memberInfo->nick_name, $this->memberInfo->email_id);
1780
+						$content = sprintf("%s<hr /><p>From: <a href=\"%s\" target=\"_blank\">%s</a><br />To: %s(%s)</p>", $content, $view_url, $view_url, $this->memberInfo->nick_name, $this->memberInfo->email_id);
1781 1781
 						$oMail = new Mail();
1782 1782
 						$oMail->setTitle($title);
1783 1783
 						$oMail->setContent($content);
1784
-						$oMail->setSender($config->webmaster_name?$config->webmaster_name:'webmaster', $config->webmaster_email);
1784
+						$oMail->setSender($config->webmaster_name ? $config->webmaster_name : 'webmaster', $config->webmaster_email);
1785 1785
 						$oMail->setReceiptor($this->memberInfo->email_id.'('.$this->memberInfo->nick_name.')', $this->memberInfo->email_address);
1786 1786
 						$oMail->send();
1787 1787
 					}
@@ -1791,9 +1791,9 @@  discard block
 block discarded – undo
1791 1791
 		}
1792 1792
 		// Call a trigger after successfully log-in (after)
1793 1793
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1794
-		if(!$trigger_output->toBool()) return $trigger_output;
1794
+		if (!$trigger_output->toBool()) return $trigger_output;
1795 1795
 		// When user checked to use auto-login
1796
-		if($keep_signed)
1796
+		if ($keep_signed)
1797 1797
 		{
1798 1798
 			// Key generate for auto login
1799 1799
 			$oPassword = new Password();
@@ -1805,12 +1805,12 @@  discard block
 block discarded – undo
1805 1805
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1806 1806
 			executeQuery('member.deleteAutologin', $autologin_args);
1807 1807
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1808
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000, '/');
1808
+			if ($autologin_output->toBool()) setCookie('xeak', $autologin_args->autologin_key, $_SERVER['REQUEST_TIME'] + 31536000, '/');
1809 1809
 		}
1810
-		if($this->memberInfo->is_admin == 'Y')
1810
+		if ($this->memberInfo->is_admin == 'Y')
1811 1811
 		{
1812 1812
 			$oMemberAdminModel = getAdminModel('member');
1813
-			if(!$oMemberAdminModel->getMemberAdminIPCheck())
1813
+			if (!$oMemberAdminModel->getMemberAdminIPCheck())
1814 1814
 			{
1815 1815
 				$_SESSION['denied_admin'] = 'Y';
1816 1816
 			}
@@ -1828,18 +1828,18 @@  discard block
 block discarded – undo
1828 1828
 	{
1829 1829
 		$oMemberModel = getModel('member');
1830 1830
 		// If your information came through the current session information to extract information from the users
1831
-		if(!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged() )
1831
+		if (!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged())
1832 1832
 		{
1833 1833
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']);
1834 1834
 			// If you do not destroy the session Profile
1835
-			if($this->memberInfo->member_srl != $_SESSION['member_srl'])
1835
+			if ($this->memberInfo->member_srl != $_SESSION['member_srl'])
1836 1836
 			{
1837 1837
 				$this->destroySessionInfo();
1838 1838
 				return;
1839 1839
 			}
1840 1840
 		}
1841 1841
 		// Stop using the session id is destroyed
1842
-		if($this->memberInfo->denied=='Y')
1842
+		if ($this->memberInfo->denied == 'Y')
1843 1843
 		{
1844 1844
 			$this->destroySessionInfo();
1845 1845
 			return;
@@ -1869,10 +1869,10 @@  discard block
 block discarded – undo
1869 1869
 		Context::set('logged_info', $this->memberInfo);
1870 1870
 
1871 1871
 		// Only the menu configuration of the user (such as an add-on to the menu can be changed)
1872
-		$this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info');
1873
-		$this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document');
1874
-		$this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document');
1875
-		$this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document');
1872
+		$this->addMemberMenu('dispMemberInfo', 'cmd_view_member_info');
1873
+		$this->addMemberMenu('dispMemberScrappedDocument', 'cmd_view_scrapped_document');
1874
+		$this->addMemberMenu('dispMemberSavedDocument', 'cmd_view_saved_document');
1875
+		$this->addMemberMenu('dispMemberOwnDocument', 'cmd_view_own_document');
1876 1876
 	}
1877 1877
 
1878 1878
 	/**
@@ -1894,7 +1894,7 @@  discard block
 block discarded – undo
1894 1894
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
1895 1895
 	{
1896 1896
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
1897
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
1897
+		if (!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
1898 1898
 
1899 1899
 		$obj = new stdClass;
1900 1900
 		$obj->url = $url;
@@ -1913,33 +1913,33 @@  discard block
 block discarded – undo
1913 1913
 	{
1914 1914
 		// Call a trigger (before)
1915 1915
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
1916
-		if(!$output->toBool()) return $output;
1916
+		if (!$output->toBool()) return $output;
1917 1917
 		// Terms and Conditions portion of the information set up by members reaffirmed
1918 1918
 		$oModuleModel = getModel('module');
1919 1919
 		$config = $oModuleModel->getModuleConfig('member');
1920 1920
 
1921 1921
 		$logged_info = Context::get('logged_info');
1922 1922
 		// If the date of the temporary restrictions limit further information on the date of
1923
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
1923
+		if ($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME'] + $config->limit_day * 60 * 60 * 24);
1924 1924
 
1925 1925
 		$args->member_srl = getNextSequence();
1926 1926
 		$args->list_order = -1 * $args->member_srl;
1927 1927
 
1928 1928
 		// Execute insert or update depending on the value of member_srl
1929
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
1929
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
1930 1930
 		// Enter the user's identity changed to lowercase
1931 1931
 		else $args->user_id = strtolower($args->user_id);
1932
-		if(!$args->user_name) $args->user_name = $args->member_srl;
1933
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
1932
+		if (!$args->user_name) $args->user_name = $args->member_srl;
1933
+		if (!$args->nick_name) $args->nick_name = $args->member_srl;
1934 1934
 
1935 1935
 		// Control of essential parameters
1936
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
1937
-		if($args->denied!='Y') $args->denied = 'N';
1938
-		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y';
1936
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
1937
+		if ($args->denied != 'Y') $args->denied = 'N';
1938
+		if (!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F')))) $args->allow_message = 'Y';
1939 1939
 
1940
-		if($logged_info->is_admin == 'Y')
1940
+		if ($logged_info->is_admin == 'Y')
1941 1941
 		{
1942
-			if($args->is_admin!='Y') $args->is_admin = 'N';
1942
+			if ($args->is_admin != 'Y') $args->is_admin = 'N';
1943 1943
 		}
1944 1944
 		else
1945 1945
 		{
@@ -1954,88 +1954,88 @@  discard block
 block discarded – undo
1954 1954
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1955 1955
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1956 1956
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1957
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
1958
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
1957
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//i", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
1958
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//i", $args->blog)) $args->blog = 'http://'.$args->blog;
1959 1959
 
1960 1960
 		// Create a model object
1961 1961
 		$oMemberModel = getModel('member');
1962 1962
 
1963 1963
 		// Check password strength
1964
-		if($args->password && !$password_is_hashed)
1964
+		if ($args->password && !$password_is_hashed)
1965 1965
 		{
1966
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
1966
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
1967 1967
 			{
1968 1968
 				$message = Context::getLang('about_password_strength');
1969 1969
 				return new Object(-1, $message[$config->password_strength]);
1970 1970
 			}
1971 1971
 			$args->password = $oMemberModel->hashPassword($args->password);
1972 1972
 		}
1973
-		elseif(!$args->password)
1973
+		elseif (!$args->password)
1974 1974
 		{
1975 1975
 			unset($args->password);
1976 1976
 		}
1977 1977
 
1978 1978
 		// Check if ID is prohibited
1979
-		if($oMemberModel->isDeniedID($args->user_id))
1979
+		if ($oMemberModel->isDeniedID($args->user_id))
1980 1980
 		{
1981
-			return new Object(-1,'denied_user_id');
1981
+			return new Object(-1, 'denied_user_id');
1982 1982
 		}
1983 1983
 
1984 1984
 		// Check if ID is duplicate
1985 1985
 		$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
1986
-		if($member_srl)
1986
+		if ($member_srl)
1987 1987
 		{
1988
-			return new Object(-1,'msg_exists_user_id');
1988
+			return new Object(-1, 'msg_exists_user_id');
1989 1989
 		}
1990 1990
 
1991 1991
 		// Check if nickname is prohibited
1992
-		if($oMemberModel->isDeniedNickName($args->nick_name))
1992
+		if ($oMemberModel->isDeniedNickName($args->nick_name))
1993 1993
 		{
1994
-			return new Object(-1,'denied_nick_name');
1994
+			return new Object(-1, 'denied_nick_name');
1995 1995
 		}
1996 1996
 
1997 1997
 		// Check if nickname is duplicate
1998 1998
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
1999
-		if($member_srl)
1999
+		if ($member_srl)
2000 2000
 		{
2001
-			return new Object(-1,'msg_exists_nick_name');
2001
+			return new Object(-1, 'msg_exists_nick_name');
2002 2002
 		}
2003 2003
 
2004 2004
 		// Check if email address is duplicate
2005 2005
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2006
-		if($member_srl)
2006
+		if ($member_srl)
2007 2007
 		{
2008
-			return new Object(-1,'msg_exists_email_address');
2008
+			return new Object(-1, 'msg_exists_email_address');
2009 2009
 		}
2010 2010
 
2011 2011
 		// Insert data into the DB
2012 2012
 		$args->list_order = -1 * $args->member_srl;
2013 2013
 
2014
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2015
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2014
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
2015
+		if (!$args->user_name) $args->user_name = $args->member_srl;
2016 2016
 
2017 2017
 		$oDB = &DB::getInstance();
2018 2018
 		$oDB->begin();
2019 2019
 
2020 2020
 		$output = executeQuery('member.insertMember', $args);
2021
-		if(!$output->toBool())
2021
+		if (!$output->toBool())
2022 2022
 		{
2023 2023
 			$oDB->rollback();
2024 2024
 			return $output;
2025 2025
 		}
2026 2026
 
2027
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2027
+		if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2028 2028
 		else $group_srl_list = explode('|@|', $args->group_srl_list);
2029 2029
 		// If no value is entered the default group, the value of group registration
2030
-		if(!$args->group_srl_list)
2030
+		if (!$args->group_srl_list)
2031 2031
 		{
2032 2032
 			$columnList = array('site_srl', 'group_srl');
2033 2033
 			$default_group = $oMemberModel->getDefaultGroup(0, $columnList);
2034
-			if($default_group)
2034
+			if ($default_group)
2035 2035
 			{
2036 2036
 				// Add to the default group
2037
-				$output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl);
2038
-				if(!$output->toBool())
2037
+				$output = $this->addMemberToGroup($args->member_srl, $default_group->group_srl);
2038
+				if (!$output->toBool())
2039 2039
 				{
2040 2040
 					$oDB->rollback();
2041 2041
 					return $output;
@@ -2045,11 +2045,11 @@  discard block
 block discarded – undo
2045 2045
 		}
2046 2046
 		else
2047 2047
 		{
2048
-			for($i=0;$i<count($group_srl_list);$i++)
2048
+			for ($i = 0; $i < count($group_srl_list); $i++)
2049 2049
 			{
2050
-				$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2050
+				$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2051 2051
 
2052
-				if(!$output->toBool())
2052
+				if (!$output->toBool())
2053 2053
 				{
2054 2054
 					$oDB->rollback();
2055 2055
 					return $output;
@@ -2059,7 +2059,7 @@  discard block
 block discarded – undo
2059 2059
 
2060 2060
 		$member_config = $oModuleModel->getModuleConfig('member');
2061 2061
 		// When using email authentication mode (when you subscribed members denied a) certified mail sent
2062
-		if($args->denied == 'Y')
2062
+		if ($args->denied == 'Y')
2063 2063
 		{
2064 2064
 			// Insert data into the authentication DB
2065 2065
 			$oPassword = new Password();
@@ -2071,7 +2071,7 @@  discard block
 block discarded – undo
2071 2071
 			$auth_args->is_register = 'Y';
2072 2072
 
2073 2073
 			$output = executeQuery('member.insertAuthMail', $auth_args);
2074
-			if(!$output->toBool())
2074
+			if (!$output->toBool())
2075 2075
 			{
2076 2076
 				$oDB->rollback();
2077 2077
 				return $output;
@@ -2079,10 +2079,10 @@  discard block
 block discarded – undo
2079 2079
 			$this->_sendAuthMail($auth_args, $args);
2080 2080
 		}
2081 2081
 		// Call a trigger (after)
2082
-		if($output->toBool())
2082
+		if ($output->toBool())
2083 2083
 		{
2084 2084
 			$trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args);
2085
-			if(!$trigger_output->toBool())
2085
+			if (!$trigger_output->toBool())
2086 2086
 			{
2087 2087
 				$oDB->rollback();
2088 2088
 				return $trigger_output;
@@ -2104,41 +2104,41 @@  discard block
 block discarded – undo
2104 2104
 	{
2105 2105
 		// Call a trigger (before)
2106 2106
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2107
-		if(!$output->toBool()) return $output;
2107
+		if (!$output->toBool()) return $output;
2108 2108
 		// Create a model object
2109 2109
 		$oMemberModel = getModel('member');
2110 2110
 
2111 2111
 		$logged_info = Context::get('logged_info');
2112 2112
 		// Get what you want to modify the original information
2113
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2113
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2114 2114
 		// Control of essential parameters
2115
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2116
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2115
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
2116
+		if ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F'))) $args->allow_message = 'Y';
2117 2117
 
2118
-		if($logged_info->is_admin == 'Y')
2118
+		if ($logged_info->is_admin == 'Y')
2119 2119
 		{
2120
-			if($args->denied!='Y') $args->denied = 'N';
2121
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2120
+			if ($args->denied != 'Y') $args->denied = 'N';
2121
+			if ($args->is_admin != 'Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2122 2122
 		}
2123 2123
 		else
2124 2124
 		{
2125 2125
 			unset($args->is_admin);
2126
-			if($is_admin == false)
2126
+			if ($is_admin == false)
2127 2127
 				unset($args->denied);
2128
-			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2128
+			if ($logged_info->member_srl != $args->member_srl && $is_admin == false)
2129 2129
 			{
2130 2130
 				return $this->stop('msg_invalid_request');
2131 2131
 			}
2132 2132
 		}
2133 2133
 
2134 2134
 		// Sanitize user ID, username, nickname, homepage, blog
2135
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2135
+		if ($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2136 2136
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2137 2137
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2138 2138
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2139 2139
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2140
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2141
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2140
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//is", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
2141
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//is", $args->blog)) $args->blog = 'http://'.$args->blog;
2142 2142
 
2143 2143
 		// check member identifier form
2144 2144
 		$config = $oMemberModel->getMemberConfig();
@@ -2147,56 +2147,56 @@  discard block
 block discarded – undo
2147 2147
 		$orgMemberInfo = $output->data;
2148 2148
 
2149 2149
 		// Check if email address or user ID is duplicate
2150
-		if($config->identifier == 'email_address')
2150
+		if ($config->identifier == 'email_address')
2151 2151
 		{
2152 2152
 			$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2153
-			if($member_srl && $args->member_srl != $member_srl)
2153
+			if ($member_srl && $args->member_srl != $member_srl)
2154 2154
 			{
2155
-				return new Object(-1,'msg_exists_email_address');
2155
+				return new Object(-1, 'msg_exists_email_address');
2156 2156
 			}
2157 2157
 			$args->email_address = $orgMemberInfo->email_address;
2158 2158
 		}
2159 2159
 		else
2160 2160
 		{
2161 2161
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2162
-			if($member_srl && $args->member_srl != $member_srl)
2162
+			if ($member_srl && $args->member_srl != $member_srl)
2163 2163
 			{
2164
-				return new Object(-1,'msg_exists_user_id');
2164
+				return new Object(-1, 'msg_exists_user_id');
2165 2165
 			}
2166 2166
 
2167 2167
 			$args->user_id = $orgMemberInfo->user_id;
2168 2168
 		}
2169 2169
 
2170
-		if($logged_info->is_admin !== 'Y')
2170
+		if ($logged_info->is_admin !== 'Y')
2171 2171
 		{
2172 2172
 			// Check if ID is prohibited
2173
-			if($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2173
+			if ($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2174 2174
 			{
2175
-				return new Object(-1,'denied_user_id');
2175
+				return new Object(-1, 'denied_user_id');
2176 2176
 			}
2177 2177
 
2178 2178
 			// Check if nickname is prohibited
2179
-			if($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2179
+			if ($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2180 2180
 			{
2181 2181
 				return new Object(-1, 'denied_nick_name');
2182 2182
 			}
2183 2183
 		}
2184 2184
 
2185 2185
 		// Check if ID is duplicate
2186
-		if($args->user_id)
2186
+		if ($args->user_id)
2187 2187
 		{
2188 2188
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2189
-			if($member_srl && $args->member_srl != $member_srl)
2189
+			if ($member_srl && $args->member_srl != $member_srl)
2190 2190
 			{
2191
-				return new Object(-1,'msg_exists_user_id');
2191
+				return new Object(-1, 'msg_exists_user_id');
2192 2192
 			}
2193 2193
 		}
2194 2194
 
2195 2195
 		// Check if nickname is duplicate
2196 2196
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
2197
- 		if($member_srl && $args->member_srl != $member_srl)
2197
+ 		if ($member_srl && $args->member_srl != $member_srl)
2198 2198
  		{
2199
- 			return new Object(-1,'msg_exists_nick_name');
2199
+ 			return new Object(-1, 'msg_exists_nick_name');
2200 2200
  		}
2201 2201
 
2202 2202
 		list($args->email_id, $args->email_host) = explode('@', $args->email_address);
@@ -2205,9 +2205,9 @@  discard block
 block discarded – undo
2205 2205
 		$oDB->begin();
2206 2206
 
2207 2207
 		// Check password strength
2208
-		if($args->password)
2208
+		if ($args->password)
2209 2209
 		{
2210
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2210
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2211 2211
 			{
2212 2212
 				$message = Context::getLang('about_password_strength');
2213 2213
 				return new Object(-1, $message[$config->password_strength]);
@@ -2219,40 +2219,40 @@  discard block
 block discarded – undo
2219 2219
 			$args->password = $orgMemberInfo->password;
2220 2220
 		}
2221 2221
 
2222
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2223
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2224
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2225
-		if(!$args->description) $args->description = $orgMemberInfo->description;
2226
-		if(!$args->birthday) $args->birthday = '';
2222
+		if (!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2223
+		if (!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2224
+		if (!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2225
+		if (!$args->description) $args->description = $orgMemberInfo->description;
2226
+		if (!$args->birthday) $args->birthday = '';
2227 2227
 
2228 2228
 		$output = executeQuery('member.updateMember', $args);
2229 2229
 
2230
-		if(!$output->toBool())
2230
+		if (!$output->toBool())
2231 2231
 		{
2232 2232
 			$oDB->rollback();
2233 2233
 			return $output;
2234 2234
 		}
2235 2235
 
2236
-		if($args->group_srl_list)
2236
+		if ($args->group_srl_list)
2237 2237
 		{
2238
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2238
+			if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2239 2239
 			else $group_srl_list = explode('|@|', $args->group_srl_list);
2240 2240
 			// If the group information, group information changes
2241
-			if(count($group_srl_list) > 0)
2241
+			if (count($group_srl_list) > 0)
2242 2242
 			{
2243 2243
 				$args->site_srl = 0;
2244 2244
 				// One of its members to delete all the group
2245 2245
 				$output = executeQuery('member.deleteMemberGroupMember', $args);
2246
-				if(!$output->toBool())
2246
+				if (!$output->toBool())
2247 2247
 				{
2248 2248
 					$oDB->rollback();
2249 2249
 					return $output;
2250 2250
 				}
2251 2251
 				// Enter one of the loop a
2252
-				for($i=0;$i<count($group_srl_list);$i++)
2252
+				for ($i = 0; $i < count($group_srl_list); $i++)
2253 2253
 				{
2254
-					$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2255
-					if(!$output->toBool())
2254
+					$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2255
+					if (!$output->toBool())
2256 2256
 					{
2257 2257
 						$oDB->rollback();
2258 2258
 						return $output;
@@ -2264,9 +2264,9 @@  discard block
 block discarded – undo
2264 2264
 			}
2265 2265
 		}
2266 2266
 		// Call a trigger (after)
2267
-		if($output->toBool()) {
2267
+		if ($output->toBool()) {
2268 2268
 			$trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args);
2269
-			if(!$trigger_output->toBool())
2269
+			if (!$trigger_output->toBool())
2270 2270
 			{
2271 2271
 				$oDB->rollback();
2272 2272
 				return $trigger_output;
@@ -2279,7 +2279,7 @@  discard block
 block discarded – undo
2279 2279
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2280 2280
 
2281 2281
 		// Save Session
2282
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2282
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2283 2283
 		$logged_info = Context::get('logged_info');
2284 2284
 
2285 2285
 		$output->add('member_srl', $args->member_srl);
@@ -2291,14 +2291,14 @@  discard block
 block discarded – undo
2291 2291
 	 */
2292 2292
 	function updateMemberPassword($args)
2293 2293
 	{
2294
-		if($args->password)
2294
+		if ($args->password)
2295 2295
 		{
2296 2296
 
2297 2297
 			// check password strength
2298 2298
 			$oMemberModel = getModel('member');
2299 2299
 			$config = $oMemberModel->getMemberConfig();
2300 2300
 
2301
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2301
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2302 2302
 			{
2303 2303
 				$message = Context::getLang('about_password_strength');
2304 2304
 				return new Object(-1, $message[$config->password_strength]);
@@ -2306,13 +2306,13 @@  discard block
 block discarded – undo
2306 2306
 
2307 2307
 			$args->password = $oMemberModel->hashPassword($args->password);
2308 2308
 		}
2309
-		else if($args->hashed_password)
2309
+		else if ($args->hashed_password)
2310 2310
 		{
2311 2311
 			$args->password = $args->hashed_password;
2312 2312
 		}
2313 2313
 
2314 2314
 		$output = executeQuery('member.updateMemberPassword', $args);
2315
-		if($output->toBool())
2315
+		if ($output->toBool())
2316 2316
 		{
2317 2317
 			$result = executeQuery('member.updateChangePasswordDate', $args);
2318 2318
 		}
@@ -2331,18 +2331,18 @@  discard block
 block discarded – undo
2331 2331
 		$trigger_obj = new stdClass();
2332 2332
 		$trigger_obj->member_srl = $member_srl;
2333 2333
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2334
-		if(!$output->toBool()) return $output;
2334
+		if (!$output->toBool()) return $output;
2335 2335
 		// Create a model object
2336 2336
 		$oMemberModel = getModel('member');
2337 2337
 		// Bringing the user's information
2338
-		if(!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2338
+		if (!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2339 2339
 		{
2340 2340
 			$columnList = array('member_srl', 'is_admin');
2341 2341
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2342 2342
 		}
2343
-		if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2343
+		if (!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2344 2344
 		// If managers can not be deleted
2345
-		if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2345
+		if ($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2346 2346
 
2347 2347
 		$oDB = &DB::getInstance();
2348 2348
 		$oDB->begin();
@@ -2351,7 +2351,7 @@  discard block
 block discarded – undo
2351 2351
 		$args->member_srl = $member_srl;
2352 2352
 		// Delete the entries in member_auth_mail
2353 2353
 		$output = executeQuery('member.deleteAuthMail', $args);
2354
-		if(!$output->toBool())
2354
+		if (!$output->toBool())
2355 2355
 		{
2356 2356
 			$oDB->rollback();
2357 2357
 			return $output;
@@ -2366,23 +2366,23 @@  discard block
 block discarded – undo
2366 2366
 		 */
2367 2367
 		// Delete the entries in member_group_member
2368 2368
 		$output = executeQuery('member.deleteMemberGroupMember', $args);
2369
-		if(!$output->toBool())
2369
+		if (!$output->toBool())
2370 2370
 		{
2371 2371
 			$oDB->rollback();
2372 2372
 			return $output;
2373 2373
 		}
2374 2374
 		// member removed from the table
2375 2375
 		$output = executeQuery('member.deleteMember', $args);
2376
-		if(!$output->toBool())
2376
+		if (!$output->toBool())
2377 2377
 		{
2378 2378
 			$oDB->rollback();
2379 2379
 			return $output;
2380 2380
 		}
2381 2381
 		// Call a trigger (after)
2382
-		if($output->toBool())
2382
+		if ($output->toBool())
2383 2383
 		{
2384 2384
 			$trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj);
2385
-			if(!$trigger_output->toBool())
2385
+			if (!$trigger_output->toBool())
2386 2386
 			{
2387 2387
 				$oDB->rollback();
2388 2388
 				return $trigger_output;
@@ -2406,23 +2406,23 @@  discard block
 block discarded – undo
2406 2406
 	 */
2407 2407
 	function destroySessionInfo()
2408 2408
 	{
2409
-		if(!$_SESSION || !is_array($_SESSION)) return;
2409
+		if (!$_SESSION || !is_array($_SESSION)) return;
2410 2410
 
2411 2411
 		$memberInfo = Context::get('logged_info');
2412 2412
 		$memberSrl = $memberInfo->member_srl;
2413 2413
 
2414
-		foreach($_SESSION as $key => $val)
2414
+		foreach ($_SESSION as $key => $val)
2415 2415
 		{
2416 2416
 			$_SESSION[$key] = '';
2417 2417
 		}
2418 2418
 
2419 2419
 		session_destroy();
2420
-		setcookie(session_name(), '', $_SERVER['REQUEST_TIME']-42000, '/');
2421
-		setcookie('sso','',$_SERVER['REQUEST_TIME']-42000, '/');
2422
-		setcookie('xeak','',$_SERVER['REQUEST_TIME']-42000, '/');
2420
+		setcookie(session_name(), '', $_SERVER['REQUEST_TIME'] - 42000, '/');
2421
+		setcookie('sso', '', $_SERVER['REQUEST_TIME'] - 42000, '/');
2422
+		setcookie('xeak', '', $_SERVER['REQUEST_TIME'] - 42000, '/');
2423 2423
 		setcookie('xe_logged', 'false', $_SERVER['REQUEST_TIME'] - 42000, '/');
2424 2424
 
2425
-		if($memberSrl || $_COOKIE['xeak'])
2425
+		if ($memberSrl || $_COOKIE['xeak'])
2426 2426
 		{
2427 2427
 			$args = new stdClass();
2428 2428
 			$args->member_srl = $memberSrl;
@@ -2438,22 +2438,22 @@  discard block
 block discarded – undo
2438 2438
 		$pointGroup = $pointModuleConfig->point_group;
2439 2439
 
2440 2440
 		$levelGroup = array();
2441
-		if(is_array($pointGroup) && count($pointGroup)>0)
2441
+		if (is_array($pointGroup) && count($pointGroup) > 0)
2442 2442
 		{
2443 2443
 			$levelGroup = array_flip($pointGroup);
2444 2444
 			ksort($levelGroup);
2445 2445
 		}
2446 2446
 		$maxLevel = 0;
2447 2447
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2448
-		if(count($resultGroup) > 0)
2448
+		if (count($resultGroup) > 0)
2449 2449
 			$maxLevel = max(array_flip($resultGroup));
2450 2450
 
2451
-		if($maxLevel > 0)
2451
+		if ($maxLevel > 0)
2452 2452
 		{
2453 2453
 			$oPointModel = getModel('point');
2454 2454
 			$originPoint = $oPointModel->getPoint($memberSrl);
2455 2455
 
2456
-			if($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2456
+			if ($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2457 2457
 			{
2458 2458
 				$oPointController = getController('point');
2459 2459
 				$oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel], 'update');
@@ -2463,18 +2463,18 @@  discard block
 block discarded – undo
2463 2463
 
2464 2464
 	function procMemberModifyEmailAddress()
2465 2465
 	{
2466
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2466
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
2467 2467
 
2468 2468
 		$member_info = Context::get('logged_info');
2469 2469
 		$newEmail = Context::get('email_address');
2470 2470
 
2471
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2471
+		if (!$newEmail) return $this->stop('msg_invalid_request');
2472 2472
 
2473 2473
 		$oMemberModel = getModel('member');
2474 2474
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2475
-		if($member_srl) return new Object(-1,'msg_exists_email_address');
2475
+		if ($member_srl) return new Object(-1, 'msg_exists_email_address');
2476 2476
 
2477
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2477
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2478 2478
 		{
2479 2479
 			return $this->stop('msg_invalid_request');
2480 2480
 		}
@@ -2490,7 +2490,7 @@  discard block
 block discarded – undo
2490 2490
 		$oDB = &DB::getInstance();
2491 2491
 		$oDB->begin();
2492 2492
 		$output = executeQuery('member.insertAuthMail', $auth_args);
2493
-		if(!$output->toBool())
2493
+		if (!$output->toBool())
2494 2494
 		{
2495 2495
 			$oDB->rollback();
2496 2496
 			return $output;
@@ -2500,7 +2500,7 @@  discard block
 block discarded – undo
2500 2500
 		$member_config = $oModuleModel->getModuleConfig('member');
2501 2501
 
2502 2502
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2503
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2503
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2504 2504
 
2505 2505
 		global $lang;
2506 2506
 
@@ -2512,17 +2512,17 @@  discard block
 block discarded – undo
2512 2512
 
2513 2513
 		Context::set('newEmail', $newEmail);
2514 2514
 
2515
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthEmailAddress','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
2515
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
2516 2516
 		Context::set('auth_url', $auth_url);
2517 2517
 
2518 2518
 		$oTemplate = &TemplateHandler::getInstance();
2519 2519
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_new_email');
2520 2520
 
2521 2521
 		$oMail = new Mail();
2522
-		$oMail->setTitle( Context::getLang('title_modify_email_address') );
2522
+		$oMail->setTitle(Context::getLang('title_modify_email_address'));
2523 2523
 		$oMail->setContent($content);
2524
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
2525
-		$oMail->setReceiptor( $member_info->nick_name, $newEmail );
2524
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
2525
+		$oMail->setReceiptor($member_info->nick_name, $newEmail);
2526 2526
 		$result = $oMail->send();
2527 2527
 
2528 2528
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail);
@@ -2536,16 +2536,16 @@  discard block
 block discarded – undo
2536 2536
 	{
2537 2537
 		$member_srl = Context::get('member_srl');
2538 2538
 		$auth_key = Context::get('auth_key');
2539
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2539
+		if (!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2540 2540
 
2541 2541
 		// Test logs for finding password by user_id and authkey
2542 2542
 		$args = new stdClass;
2543 2543
 		$args->member_srl = $member_srl;
2544 2544
 		$args->auth_key = $auth_key;
2545 2545
 		$output = executeQuery('member.getAuthMail', $args);
2546
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2546
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
2547 2547
 		{
2548
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2548
+			if (strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2549 2549
 			return $this->stop('msg_invalid_modify_email_auth_key');
2550 2550
 		}
2551 2551
 
@@ -2554,10 +2554,10 @@  discard block
 block discarded – undo
2554 2554
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2555 2555
 
2556 2556
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2557
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2557
+		if (!$output->toBool()) return $this->stop($output->getMessage());
2558 2558
 
2559 2559
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2560
-		executeQuery('member.deleteAuthChangeEmailAddress',$args);
2560
+		executeQuery('member.deleteAuthChangeEmailAddress', $args);
2561 2561
 
2562 2562
 		$this->_clearMemberCache($args->member_srl);
2563 2563
 
@@ -2575,7 +2575,7 @@  discard block
 block discarded – undo
2575 2575
 	**/
2576 2576
 	function triggerGetDocumentMenu(&$menu_list)
2577 2577
 	{
2578
-		if(!Context::get('is_logged')) return new Object();
2578
+		if (!Context::get('is_logged')) return new Object();
2579 2579
 
2580 2580
 		$logged_info = Context::get('logged_info');
2581 2581
 		$document_srl = Context::get('target_srl');
@@ -2586,12 +2586,12 @@  discard block
 block discarded – undo
2586 2586
 		$member_srl = $oDocument->get('member_srl');
2587 2587
 		$module_srl = $oDocument->get('module_srl');
2588 2588
 
2589
-		if(!$member_srl) return new Object();
2590
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2589
+		if (!$member_srl) return new Object();
2590
+		if ($oDocumentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object();
2591 2591
 
2592 2592
 		$oDocumentController = getController('document');
2593
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2594
-		$oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup');
2593
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2594
+		$oDocumentController->addDocumentPopupMenu($url, 'cmd_spammer', '', 'popup');
2595 2595
 
2596 2596
 		return new Object();
2597 2597
 	}
@@ -2605,7 +2605,7 @@  discard block
 block discarded – undo
2605 2605
 	**/
2606 2606
 	function triggerGetCommentMenu(&$menu_list)
2607 2607
 	{
2608
-		if(!Context::get('is_logged')) return new Object();
2608
+		if (!Context::get('is_logged')) return new Object();
2609 2609
 
2610 2610
 		$logged_info = Context::get('logged_info');
2611 2611
 		$comment_srl = Context::get('target_srl');
@@ -2616,12 +2616,12 @@  discard block
 block discarded – undo
2616 2616
 		$module_srl = $oComment->get('module_srl');
2617 2617
 		$member_srl = $oComment->get('member_srl');
2618 2618
 
2619
-		if(!$member_srl) return new Object();
2620
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2619
+		if (!$member_srl) return new Object();
2620
+		if ($oCommentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object();
2621 2621
 
2622 2622
 		$oCommentController = getController('comment');
2623
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2624
-		$oCommentController->addCommentPopupMenu($url,'cmd_spammer','','popup');
2623
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2624
+		$oCommentController->addCommentPopupMenu($url, 'cmd_spammer', '', 'popup');
2625 2625
 
2626 2626
 		return new Object();
2627 2627
 	}
@@ -2633,7 +2633,7 @@  discard block
 block discarded – undo
2633 2633
 	**/
2634 2634
 	function procMemberSpammerManage()
2635 2635
 	{
2636
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
2636
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
2637 2637
 
2638 2638
 		$logged_info = Context::get('logged_info');
2639 2639
 		$member_srl = Context::get('member_srl');
@@ -2641,7 +2641,7 @@  discard block
 block discarded – undo
2641 2641
 		$cnt_loop = Context::get('cnt_loop');
2642 2642
 		$proc_type = Context::get('proc_type');
2643 2643
 		$isMoveToTrash = true;
2644
-		if($proc_type == "delete")
2644
+		if ($proc_type == "delete")
2645 2645
 			$isMoveToTrash = false;
2646 2646
 
2647 2647
 		// check grant
@@ -2650,7 +2650,7 @@  discard block
 block discarded – undo
2650 2650
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2651 2651
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2652 2652
 
2653
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
2653
+		if (!$grant->manager) return new Object(-1, 'msg_not_permitted');
2654 2654
 
2655 2655
 		$proc_msg = "";
2656 2656
 
@@ -2659,10 +2659,10 @@  discard block
 block discarded – undo
2659 2659
 
2660 2660
 		// delete or trash destination
2661 2661
 		// proc member
2662
-		if($cnt_loop == 1)
2662
+		if ($cnt_loop == 1)
2663 2663
 			$this->_spammerMember($member_srl);
2664 2664
 		// proc document and comment
2665
-		elseif($cnt_loop>1)
2665
+		elseif ($cnt_loop > 1)
2666 2666
 			$this->_spammerDocuments($member_srl, $isMoveToTrash);
2667 2667
 
2668 2668
 		// get destination count
@@ -2671,11 +2671,11 @@  discard block
 block discarded – undo
2671 2671
 
2672 2672
 		$total_count = Context::get('total_count');
2673 2673
 		$remain_count = $cnt_document + $cnt_comment;
2674
-		if($cnt_loop == 1) $total_count = $remain_count;
2674
+		if ($cnt_loop == 1) $total_count = $remain_count;
2675 2675
 
2676 2676
 		// get progress percent
2677
-		if($total_count > 0)
2678
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2677
+		if ($total_count > 0)
2678
+			$progress = intval((($total_count - $remain_count) / $total_count) * 100);
2679 2679
 		else
2680 2680
 			$progress = 100;
2681 2681
 
@@ -2699,7 +2699,7 @@  discard block
 block discarded – undo
2699 2699
 	**/
2700 2700
 	private function _spammerMember($member_srl) {
2701 2701
 		$logged_info = Context::get('logged_info');
2702
-		$spam_description = trim( Context::get('spam_description') );
2702
+		$spam_description = trim(Context::get('spam_description'));
2703 2703
 
2704 2704
 		$oMemberModel = getModel('member');
2705 2705
 		$columnList = array('member_srl', 'email_address', 'user_id', 'nick_name', 'description');
@@ -2718,10 +2718,10 @@  discard block
 block discarded – undo
2718 2718
 		$args->user_id = $member_info->user_id;
2719 2719
 		$args->nick_name = $member_info->nick_name;
2720 2720
 		$args->denied = "Y";
2721
-		$args->description = trim( $member_info->description );
2722
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
2721
+		$args->description = trim($member_info->description);
2722
+		if ($args->description != "") $args->description .= "\n"; // add new line
2723 2723
 
2724
-		$args->description .= Context::getLang('cmd_spammer') . "[" . date("Y-m-d H:i:s") . " from:" . $logged_info->user_id . " info:" . $spam_description . " docuemnts count:" . $total_count . "]";
2724
+		$args->description .= Context::getLang('cmd_spammer')."[".date("Y-m-d H:i:s")." from:".$logged_info->user_id." info:".$spam_description." docuemnts count:".$total_count."]";
2725 2725
 
2726 2726
 		$output = $this->updateMember($args, true);
2727 2727
 
@@ -2750,21 +2750,21 @@  discard block
 block discarded – undo
2750 2750
 		// 1. proc comment, 2. proc document
2751 2751
 		$cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl);
2752 2752
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
2753
-		if($cnt_comment > 0)
2753
+		if ($cnt_comment > 0)
2754 2754
 		{
2755 2755
 			$columnList = array();
2756 2756
 			$commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2757
-			if($commentList) {
2758
-				foreach($commentList as $v) {
2757
+			if ($commentList) {
2758
+				foreach ($commentList as $v) {
2759 2759
 					$oCommentController->deleteComment($v->comment_srl, true, $isMoveToTrash);
2760 2760
 				}
2761 2761
 			}
2762
-		} elseif($cnt_document > 0) {
2762
+		} elseif ($cnt_document > 0) {
2763 2763
 			$columnList = array();
2764 2764
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2765
-			if($documentList) {
2766
-				foreach($documentList as $v) {
2767
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2765
+			if ($documentList) {
2766
+				foreach ($documentList as $v) {
2767
+					if ($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2768 2768
 					else $oDocumentController->deleteDocument($v->document_srl);
2769 2769
 				}
2770 2770
 			}
@@ -2776,24 +2776,24 @@  discard block
 block discarded – undo
2776 2776
 	function _clearMemberCache($member_srl, $site_srl = 0)
2777 2777
 	{
2778 2778
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
2779
-		if($oCacheHandler->isSupport())
2779
+		if ($oCacheHandler->isSupport())
2780 2780
 		{
2781
-			$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_' . $site_srl;
2781
+			$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl;
2782 2782
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2783 2783
 			$oCacheHandler->delete($cache_key);
2784 2784
 
2785
-			if($site_srl !== 0)
2785
+			if ($site_srl !== 0)
2786 2786
 			{
2787
-				$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0';
2787
+				$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_0';
2788 2788
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2789 2789
 				$oCacheHandler->delete($cache_key);
2790 2790
 			}
2791 2791
 		}
2792 2792
 
2793 2793
 		$oCacheHandler = CacheHandler::getInstance('object');
2794
-		if($oCacheHandler->isSupport())
2794
+		if ($oCacheHandler->isSupport())
2795 2795
 		{
2796
-			$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
2796
+			$object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl;
2797 2797
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2798 2798
 			$oCacheHandler->delete($cache_key);
2799 2799
 		}
Please login to merge, or discard this patch.
Braces   +590 added lines, -247 removed lines patch added patch discarded remove patch
@@ -41,19 +41,31 @@  discard block
 block discarded – undo
41 41
 		}
42 42
 
43 43
 		// Variables
44
-		if(!$user_id) $user_id = Context::get('user_id');
44
+		if(!$user_id) {
45
+			$user_id = Context::get('user_id');
46
+		}
45 47
 		$user_id = trim($user_id);
46 48
 
47
-		if(!$password) $password = Context::get('password');
49
+		if(!$password) {
50
+			$password = Context::get('password');
51
+		}
48 52
 		$password = trim($password);
49 53
 
50
-		if(!$keep_signed) $keep_signed = Context::get('keep_signed');
54
+		if(!$keep_signed) {
55
+			$keep_signed = Context::get('keep_signed');
56
+		}
51 57
 		// Return an error when id and password doesn't exist
52
-		if(!$user_id) return new Object(-1,'null_user_id');
53
-		if(!$password) return new Object(-1,'null_password');
58
+		if(!$user_id) {
59
+			return new Object(-1,'null_user_id');
60
+		}
61
+		if(!$password) {
62
+			return new Object(-1,'null_password');
63
+		}
54 64
 
55 65
 		$output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false);
56
-		if (!$output->toBool()) return $output;
66
+		if (!$output->toBool()) {
67
+			return $output;
68
+		}
57 69
 
58 70
 		$oModuleModel = getModel('module');
59 71
 		$config = $oModuleModel->getModuleConfig('member');
@@ -80,8 +92,7 @@  discard block
 block discarded – undo
80 92
 		if(!$config->after_login_url)
81 93
 		{
82 94
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
83
-		}
84
-		else
95
+		} else
85 96
 		{
86 97
 			$returnUrl = $config->after_login_url;
87 98
 		}
@@ -98,19 +109,24 @@  discard block
 block discarded – undo
98 109
 		// Call a trigger before log-out (before)
99 110
 		$logged_info = Context::get('logged_info');
100 111
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info);
101
-		if(!$trigger_output->toBool()) return $trigger_output;
112
+		if(!$trigger_output->toBool()) {
113
+			return $trigger_output;
114
+		}
102 115
 		// Destroy session information
103 116
 		$this->destroySessionInfo();
104 117
 		// Call a trigger after log-out (after)
105 118
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info);
106
-		if(!$trigger_output->toBool()) return $trigger_output;
119
+		if(!$trigger_output->toBool()) {
120
+			return $trigger_output;
121
+		}
107 122
 
108 123
 		$output = new Object();
109 124
 
110 125
 		$oModuleModel = getModel('module');
111 126
 		$config = $oModuleModel->getModuleConfig('member');
112
-		if($config->after_logout_url)
113
-			$output->redirect_url = $config->after_logout_url;
127
+		if($config->after_logout_url) {
128
+					$output->redirect_url = $config->after_logout_url;
129
+		}
114 130
 
115 131
 		$this->_clearMemberCache($logged_info->member_srl);
116 132
 
@@ -125,12 +141,18 @@  discard block
 block discarded – undo
125 141
 	function procMemberScrapDocument()
126 142
 	{
127 143
 		// Check login information
128
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
144
+		if(!Context::get('is_logged')) {
145
+			return new Object(-1, 'msg_not_logged');
146
+		}
129 147
 		$logged_info = Context::get('logged_info');
130 148
 
131 149
 		$document_srl = (int)Context::get('document_srl');
132
-		if(!$document_srl) $document_srl = (int)Context::get('target_srl');
133
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
150
+		if(!$document_srl) {
151
+			$document_srl = (int)Context::get('target_srl');
152
+		}
153
+		if(!$document_srl) {
154
+			return new Object(-1,'msg_invalid_request');
155
+		}
134 156
 		// Get document
135 157
 		$oDocumentModel = getModel('document');
136 158
 		$oDocument = $oDocumentModel->getDocument($document_srl);
@@ -145,10 +167,14 @@  discard block
 block discarded – undo
145 167
 		$args->title = $oDocument->get('title');
146 168
 		// Check if already scrapped
147 169
 		$output = executeQuery('member.getScrapDocument', $args);
148
-		if($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
170
+		if($output->data->count) {
171
+			return new Object(-1, 'msg_alreay_scrapped');
172
+		}
149 173
 		// Insert
150 174
 		$output = executeQuery('member.addScrapDocument', $args);
151
-		if(!$output->toBool()) return $output;
175
+		if(!$output->toBool()) {
176
+			return $output;
177
+		}
152 178
 
153 179
 		$this->setError(-1);
154 180
 		$this->setMessage('success_registed');
@@ -162,11 +188,15 @@  discard block
 block discarded – undo
162 188
 	function procMemberDeleteScrap()
163 189
 	{
164 190
 		// Check login information
165
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
191
+		if(!Context::get('is_logged')) {
192
+			return new Object(-1, 'msg_not_logged');
193
+		}
166 194
 		$logged_info = Context::get('logged_info');
167 195
 
168 196
 		$document_srl = (int)Context::get('document_srl');
169
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
197
+		if(!$document_srl) {
198
+			return new Object(-1,'msg_invalid_request');
199
+		}
170 200
 		// Variables
171 201
 		$args = new stdClass;
172 202
 		$args->member_srl = $logged_info->member_srl;
@@ -192,11 +222,15 @@  discard block
 block discarded – undo
192 222
 	function procMemberDeleteSavedDocument()
193 223
 	{
194 224
 		// Check login information
195
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
225
+		if(!Context::get('is_logged')) {
226
+			return new Object(-1, 'msg_not_logged');
227
+		}
196 228
 		$logged_info = Context::get('logged_info');
197 229
 
198 230
 		$document_srl = (int)Context::get('document_srl');
199
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
231
+		if(!$document_srl) {
232
+			return new Object(-1,'msg_invalid_request');
233
+		}
200 234
 
201 235
 		$oDocumentModel = getModel('document');
202 236
 		$oDocument = $oDocumentModel->getDocument($document_srl);
@@ -224,7 +258,9 @@  discard block
 block discarded – undo
224 258
 	{
225 259
 		$name = Context::get('name');
226 260
 		$value = Context::get('value');
227
-		if(!$value) return;
261
+		if(!$value) {
262
+			return;
263
+		}
228 264
 
229 265
 		$oMemberModel = getModel('member');
230 266
 		// Check if logged-in
@@ -235,10 +271,14 @@  discard block
 block discarded – undo
235 271
 		{
236 272
 			case 'user_id' :
237 273
 				// Check denied ID
238
-				if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id');
274
+				if($oMemberModel->isDeniedID($value)) {
275
+					return new Object(0,'denied_user_id');
276
+				}
239 277
 				// Check if duplicated
240 278
 				$member_srl = $oMemberModel->getMemberSrlByUserID($value);
241
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_user_id');
279
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
280
+					return new Object(0,'msg_exists_user_id');
281
+				}
242 282
 				break;
243 283
 			case 'nick_name' :
244 284
 				// Check denied ID
@@ -248,13 +288,17 @@  discard block
 block discarded – undo
248 288
 				}
249 289
 				// Check if duplicated
250 290
 				$member_srl = $oMemberModel->getMemberSrlByNickName($value);
251
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name');
291
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
292
+					return new Object(0,'msg_exists_nick_name');
293
+				}
252 294
 
253 295
 				break;
254 296
 			case 'email_address' :
255 297
 				// Check if duplicated
256 298
 				$member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
257
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address');
299
+				if($member_srl && $logged_info->member_srl != $member_srl ) {
300
+					return new Object(0,'msg_exists_email_address');
301
+				}
258 302
 				break;
259 303
 		}
260 304
 	}
@@ -266,17 +310,25 @@  discard block
 block discarded – undo
266 310
 	 */
267 311
 	function procMemberInsert()
268 312
 	{
269
-		if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request");
313
+		if (Context::getRequestMethod () == "GET") {
314
+			return new Object (-1, "msg_invalid_request");
315
+		}
270 316
 		$oMemberModel = &getModel ('member');
271 317
 		$config = $oMemberModel->getMemberConfig();
272 318
 
273 319
 		// call a trigger (before)
274 320
 		$trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config);
275
-		if(!$trigger_output->toBool ()) return $trigger_output;
321
+		if(!$trigger_output->toBool ()) {
322
+			return $trigger_output;
323
+		}
276 324
 		// Check if an administrator allows a membership
277
-		if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled');
325
+		if($config->enable_join != 'Y') {
326
+			return $this->stop ('msg_signup_disabled');
327
+		}
278 328
 		// Check if the user accept the license terms (only if terms exist)
279
-		if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
329
+		if($config->agreement && Context::get('accept_agreement')!='Y') {
330
+			return $this->stop('msg_accept_agreement');
331
+		}
280 332
 
281 333
 		// Extract the necessary information in advance
282 334
 		$getVars = array();
@@ -295,16 +347,22 @@  discard block
 block discarded – undo
295 347
 		foreach($getVars as $val)
296 348
 		{
297 349
 			$args->{$val} = Context::get($val);
298
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
350
+			if($val == 'birthday') {
351
+				$args->birthday_ui = Context::get('birthday_ui');
352
+			}
299 353
 		}
300 354
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
301
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
355
+		if(!$args->birthday && $args->birthday_ui) {
356
+			$args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
357
+		}
302 358
 
303 359
 		$args->find_account_answer = Context::get('find_account_answer');
304 360
 		$args->allow_mailing = Context::get('allow_mailing');
305 361
 		$args->allow_message = Context::get('allow_message');
306 362
 
307
-		if($args->password1) $args->password = $args->password1;
363
+		if($args->password1) {
364
+			$args->password = $args->password1;
365
+		}
308 366
 
309 367
 		// check password strength
310 368
 		if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
@@ -333,7 +391,9 @@  discard block
 block discarded – undo
333 391
 		unset($all_args->secret_text);
334 392
 
335 393
 		// Set the user state as "denied" when using mail authentication
336
-		if($config->enable_confirm == 'Y') $args->denied = 'Y';
394
+		if($config->enable_confirm == 'Y') {
395
+			$args->denied = 'Y';
396
+		}
337 397
 		// Add extra vars after excluding necessary information from all the requested arguments
338 398
 		$extra_vars = delObjectVars($all_args, $args);
339 399
 		$args->extra_vars = serialize($extra_vars);
@@ -348,7 +408,9 @@  discard block
 block discarded – undo
348 408
 			}
349 409
 		}
350 410
 		$output = $this->insertMember($args);
351
-		if(!$output->toBool()) return $output;
411
+		if(!$output->toBool()) {
412
+			return $output;
413
+		}
352 414
 
353 415
 		// insert ProfileImage, ImageName, ImageMark
354 416
 		$profile_image = $_FILES['profile_image'];
@@ -387,43 +449,46 @@  discard block
 block discarded – undo
387 449
 			if($config->identifier == 'email_address')
388 450
 			{
389 451
 				$output = $this->doLogin($args->email_address);
390
-			}
391
-			else
452
+			} else
392 453
 			{
393 454
 				$output = $this->doLogin($args->user_id);
394 455
 			}
395 456
 			if(!$output->toBool()) {
396
-				if($output->error == -9)
397
-					$output->error = -11;
457
+				if($output->error == -9) {
458
+									$output->error = -11;
459
+				}
398 460
 				return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output);
399 461
 			}
400 462
 		}
401 463
 
402 464
 		// Results
403 465
 		$this->add('member_srl', $args->member_srl);
404
-		if($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
466
+		if($config->redirect_url) {
467
+			$this->add('redirect_url', $config->redirect_url);
468
+		}
405 469
 		if($config->enable_confirm == 'Y')
406 470
 		{
407 471
 			$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
408 472
 			$this->setMessage($msg);
409 473
 			return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), new Object(-12, $msg));
474
+		} else {
475
+			$this->setMessage('success_registed');
410 476
 		}
411
-		else $this->setMessage('success_registed');
412 477
 		// Call a trigger (after)
413 478
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
414
-		if(!$trigger_output->toBool()) return $trigger_output;
479
+		if(!$trigger_output->toBool()) {
480
+			return $trigger_output;
481
+		}
415 482
 
416 483
 		if($config->redirect_url)
417 484
 		{
418 485
 			$returnUrl = $config->redirect_url;
419
-		}
420
-		else
486
+		} else
421 487
 		{
422 488
 			if(Context::get('success_return_url'))
423 489
 			{
424 490
 				$returnUrl = Context::get('success_return_url');
425
-			}
426
-			else if($_COOKIE['XE_REDIRECT_URL'])
491
+			} else if($_COOKIE['XE_REDIRECT_URL'])
427 492
 			{
428 493
 				$returnUrl = $_COOKIE['XE_REDIRECT_URL'];
429 494
 				setcookie("XE_REDIRECT_URL", '', 1);
@@ -477,8 +542,7 @@  discard block
 block discarded – undo
477 542
 		if(Context::get('success_return_url'))
478 543
 		{
479 544
 			$redirectUrl = Context::get('success_return_url');
480
-		}
481
-		else
545
+		} else
482 546
 		{
483 547
 			$redirectUrl = getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo');
484 548
 		}
@@ -522,13 +586,17 @@  discard block
 block discarded – undo
522 586
 		foreach($getVars as $val)
523 587
 		{
524 588
 			$args->{$val} = Context::get($val);
525
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
589
+			if($val == 'birthday') {
590
+				$args->birthday_ui = Context::get('birthday_ui');
591
+			}
526 592
 		}
527 593
 		// Login Information
528 594
 		$logged_info = Context::get('logged_info');
529 595
 		$args->member_srl = $logged_info->member_srl;
530 596
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
531
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
597
+		if(!$args->birthday && $args->birthday_ui) {
598
+			$args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
599
+		}
532 600
 		// Remove some unnecessary variables from all the vars
533 601
 		$all_args = Context::getRequestVars();
534 602
 		unset($all_args->module);
@@ -562,7 +630,9 @@  discard block
 block discarded – undo
562 630
 
563 631
 		// Execute insert or update depending on the value of member_srl
564 632
 		$output = $this->updateMember($args);
565
-		if(!$output->toBool()) return $output;
633
+		if(!$output->toBool()) {
634
+			return $output;
635
+		}
566 636
 
567 637
 		$profile_image = $_FILES['profile_image'];
568 638
 		if(is_uploaded_file($profile_image['tmp_name']))
@@ -592,7 +662,9 @@  discard block
 block discarded – undo
592 662
 
593 663
 		// Call a trigger after successfully log-in (after)
594 664
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo);
595
-		if(!$trigger_output->toBool()) return $trigger_output;
665
+		if(!$trigger_output->toBool()) {
666
+			return $trigger_output;
667
+		}
596 668
 
597 669
 		$this->setSessionInfo();
598 670
 		// Return result
@@ -613,7 +685,9 @@  discard block
 block discarded – undo
613 685
 	 */
614 686
 	function procMemberModifyPassword()
615 687
 	{
616
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
688
+		if(!Context::get('is_logged')) {
689
+			return $this->stop('msg_not_logged');
690
+		}
617 691
 		// Extract the necessary information in advance
618 692
 		$current_password = trim(Context::get('current_password'));
619 693
 		$password = trim(Context::get('password1'));
@@ -627,17 +701,23 @@  discard block
 block discarded – undo
627 701
 
628 702
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
629 703
 		// Verify the cuttent password
630
-		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
704
+		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) {
705
+			return new Object(-1, 'invalid_password');
706
+		}
631 707
 
632 708
 		// Check if a new password is as same as the previous password
633
-		if($current_password == $password) return new Object(-1, 'invalid_new_password');
709
+		if($current_password == $password) {
710
+			return new Object(-1, 'invalid_new_password');
711
+		}
634 712
 
635 713
 		// Execute insert or update depending on the value of member_srl
636 714
 		$args = new stdClass;
637 715
 		$args->member_srl = $member_srl;
638 716
 		$args->password = $password;
639 717
 		$output = $this->updateMemberPassword($args);
640
-		if(!$output->toBool()) return $output;
718
+		if(!$output->toBool()) {
719
+			return $output;
720
+		}
641 721
 
642 722
 		$this->add('member_srl', $args->member_srl);
643 723
 		$this->setMessage('success_updated');
@@ -653,7 +733,9 @@  discard block
 block discarded – undo
653 733
 	 */
654 734
 	function procMemberLeave()
655 735
 	{
656
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
736
+		if(!Context::get('is_logged')) {
737
+			return $this->stop('msg_not_logged');
738
+		}
657 739
 		// Extract the necessary information in advance
658 740
 		$password = trim(Context::get('password'));
659 741
 		// Get information of logged-in user
@@ -669,10 +751,14 @@  discard block
 block discarded – undo
669 751
 			$this->memberInfo->password = $memberInfo->password;
670 752
 		}
671 753
 		// Verify the cuttent password
672
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
754
+		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) {
755
+			return new Object(-1, 'invalid_password');
756
+		}
673 757
 
674 758
 		$output = $this->deleteMember($member_srl);
675
-		if(!$output->toBool()) return $output;
759
+		if(!$output->toBool()) {
760
+			return $output;
761
+		}
676 762
 		// Destroy all session information
677 763
 		$this->destroySessionInfo();
678 764
 		// Return success message
@@ -691,17 +777,25 @@  discard block
 block discarded – undo
691 777
 	{
692 778
 		// Check if the file is successfully uploaded
693 779
 		$file = $_FILES['profile_image'];
694
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
780
+		if(!is_uploaded_file($file['tmp_name'])) {
781
+			return $this->stop('msg_not_uploaded_profile_image');
782
+		}
695 783
 		// Ignore if member_srl is invalid or doesn't exist.
696 784
 		$member_srl = Context::get('member_srl');
697
-		if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
785
+		if(!$member_srl) {
786
+			return $this->stop('msg_not_uploaded_profile_image');
787
+		}
698 788
 
699 789
 		$logged_info = Context::get('logged_info');
700
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
790
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
791
+			return $this->stop('msg_not_uploaded_profile_image');
792
+		}
701 793
 		// Return if member module is set not to use an image name or the user is not an administrator ;
702 794
 		$oModuleModel = getModel('module');
703 795
 		$config = $oModuleModel->getModuleConfig('member');
704
-		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
796
+		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') {
797
+			return $this->stop('msg_not_uploaded_profile_image');
798
+		}
705 799
 
706 800
 		$this->insertProfileImage($member_srl, $file['tmp_name']);
707 801
 		// Page refresh
@@ -723,26 +817,35 @@  discard block
 block discarded – undo
723 817
 	{
724 818
 
725 819
 		// Check uploaded file
726
-		if(!checkUploadedFile($target_file)) return;
820
+		if(!checkUploadedFile($target_file)) {
821
+			return;
822
+		}
727 823
 
728 824
 		$oMemberModel = getModel('member');
729 825
 		$config = $oMemberModel->getMemberConfig();
730 826
 
731 827
 		// Get an image size
732 828
 		$max_width = $config->profile_image_max_width;
733
-		if(!$max_width) $max_width = "90";
829
+		if(!$max_width) {
830
+			$max_width = "90";
831
+		}
734 832
 		$max_height = $config->profile_image_max_height;
735
-		if(!$max_height) $max_height = "90";
833
+		if(!$max_height) {
834
+			$max_height = "90";
835
+		}
736 836
 		// Get a target path to save
737 837
 		$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
738 838
 		FileHandler::makeDir($target_path);
739 839
 
740 840
 		// Get file information
741 841
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
742
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
743
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
744
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
745
-		else
842
+		if(IMAGETYPE_PNG == $type) {
843
+			$ext = 'png';
844
+		} elseif(IMAGETYPE_JPEG == $type) {
845
+			$ext = 'jpg';
846
+		} elseif(IMAGETYPE_GIF == $type) {
847
+			$ext = 'gif';
848
+		} else
746 849
 		{
747 850
 			return;
748 851
 		}
@@ -754,8 +857,7 @@  discard block
 block discarded – undo
754 857
 		if(($width > $max_width || $height > $max_height ) && $type != 1)
755 858
 		{
756 859
 			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
757
-		}
758
-		else
860
+		} else
759 861
 		{
760 862
 			@copy($target_file, $target_filename);
761 863
 		}
@@ -770,17 +872,25 @@  discard block
 block discarded – undo
770 872
 	{
771 873
 		// Check if the file is successfully uploaded
772 874
 		$file = $_FILES['image_name'];
773
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
875
+		if(!is_uploaded_file($file['tmp_name'])) {
876
+			return $this->stop('msg_not_uploaded_image_name');
877
+		}
774 878
 		// Ignore if member_srl is invalid or doesn't exist.
775 879
 		$member_srl = Context::get('member_srl');
776
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
880
+		if(!$member_srl) {
881
+			return $this->stop('msg_not_uploaded_image_name');
882
+		}
777 883
 
778 884
 		$logged_info = Context::get('logged_info');
779
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
885
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
886
+			return $this->stop('msg_not_uploaded_image_name');
887
+		}
780 888
 		// Return if member module is set not to use an image name or the user is not an administrator ;
781 889
 		$oModuleModel = getModel('module');
782 890
 		$config = $oModuleModel->getModuleConfig('member');
783
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
891
+		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') {
892
+			return $this->stop('msg_not_uploaded_image_name');
893
+		}
784 894
 
785 895
 		$this->insertImageName($member_srl, $file['tmp_name']);
786 896
 		// Page refresh
@@ -801,15 +911,21 @@  discard block
 block discarded – undo
801 911
 	function insertImageName($member_srl, $target_file)
802 912
 	{
803 913
 		// Check uploaded file
804
-		if(!checkUploadedFile($target_file)) return;
914
+		if(!checkUploadedFile($target_file)) {
915
+			return;
916
+		}
805 917
 
806 918
 		$oModuleModel = getModel('module');
807 919
 		$config = $oModuleModel->getModuleConfig('member');
808 920
 		// Get an image size
809 921
 		$max_width = $config->image_name_max_width;
810
-		if(!$max_width) $max_width = "90";
922
+		if(!$max_width) {
923
+			$max_width = "90";
924
+		}
811 925
 		$max_height = $config->image_name_max_height;
812
-		if(!$max_height) $max_height = "20";
926
+		if(!$max_height) {
927
+			$max_height = "20";
928
+		}
813 929
 		// Get a target path to save
814 930
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
815 931
 		FileHandler::makeDir($target_path);
@@ -818,8 +934,11 @@  discard block
 block discarded – undo
818 934
 		// Get file information
819 935
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
820 936
 		// Convert if the image size is larger than a given size or if the format is not a gif
821
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
822
-		else @copy($target_file, $target_filename);
937
+		if($width > $max_width || $height > $max_height || $type!=1) {
938
+			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
939
+		} else {
940
+			@copy($target_file, $target_filename);
941
+		}
823 942
 	}
824 943
 
825 944
 	/**
@@ -879,17 +998,25 @@  discard block
 block discarded – undo
879 998
 	{
880 999
 		// Check if the file is successfully uploaded
881 1000
 		$file = $_FILES['image_mark'];
882
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
1001
+		if(!is_uploaded_file($file['tmp_name'])) {
1002
+			return $this->stop('msg_not_uploaded_image_mark');
1003
+		}
883 1004
 		// Ignore if member_srl is invalid or doesn't exist.
884 1005
 		$member_srl = Context::get('member_srl');
885
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
1006
+		if(!$member_srl) {
1007
+			return $this->stop('msg_not_uploaded_image_mark');
1008
+		}
886 1009
 
887 1010
 		$logged_info = Context::get('logged_info');
888
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
1011
+		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) {
1012
+			return $this->stop('msg_not_uploaded_image_mark');
1013
+		}
889 1014
 		// Membership in the images mark the module using the ban was set by an administrator or return;
890 1015
 		$oModuleModel = getModel('module');
891 1016
 		$config = $oModuleModel->getModuleConfig('member');
892
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
1017
+		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') {
1018
+			return $this->stop('msg_not_uploaded_image_mark');
1019
+		}
893 1020
 
894 1021
 		$this->insertImageMark($member_srl, $file['tmp_name']);
895 1022
 		// Page refresh
@@ -910,15 +1037,21 @@  discard block
 block discarded – undo
910 1037
 	function insertImageMark($member_srl, $target_file)
911 1038
 	{
912 1039
 		// Check uploaded file
913
-		if(!checkUploadedFile($target_file)) return;
1040
+		if(!checkUploadedFile($target_file)) {
1041
+			return;
1042
+		}
914 1043
 
915 1044
 		$oModuleModel = getModel('module');
916 1045
 		$config = $oModuleModel->getModuleConfig('member');
917 1046
 		// Get an image size
918 1047
 		$max_width = $config->image_mark_max_width;
919
-		if(!$max_width) $max_width = "20";
1048
+		if(!$max_width) {
1049
+			$max_width = "20";
1050
+		}
920 1051
 		$max_height = $config->image_mark_max_height;
921
-		if(!$max_height) $max_height = "20";
1052
+		if(!$max_height) {
1053
+			$max_height = "20";
1054
+		}
922 1055
 
923 1056
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
924 1057
 		FileHandler::makeDir($target_path);
@@ -927,8 +1060,11 @@  discard block
 block discarded – undo
927 1060
 		// Get file information
928 1061
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
929 1062
 
930
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
931
-		else @copy($target_file, $target_filename);
1063
+		if($width > $max_width || $height > $max_height || $type!=1) {
1064
+			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
1065
+		} else {
1066
+			@copy($target_file, $target_filename);
1067
+		}
932 1068
 	}
933 1069
 
934 1070
 	/**
@@ -963,14 +1099,18 @@  discard block
 block discarded – undo
963 1099
 	function procMemberFindAccount()
964 1100
 	{
965 1101
 		$email_address = Context::get('email_address');
966
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1102
+		if(!$email_address) {
1103
+			return new Object(-1, 'msg_invalid_request');
1104
+		}
967 1105
 
968 1106
 		$oMemberModel = getModel('member');
969 1107
 		$oModuleModel = getModel('module');
970 1108
 
971 1109
 		// Check if a member having the same email address exists
972 1110
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
973
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1111
+		if(!$member_srl) {
1112
+			return new Object(-1, 'msg_email_not_exists');
1113
+		}
974 1114
 
975 1115
 		// Get information of the member
976 1116
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
@@ -982,7 +1122,9 @@  discard block
 block discarded – undo
982 1122
 			$chk_args = new stdClass;
983 1123
 			$chk_args->member_srl = $member_info->member_srl;
984 1124
 			$output = executeQuery('member.chkAuthMail', $chk_args);
985
-			if($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
1125
+			if($output->toBool() && $output->data->count != '0') {
1126
+				return new Object(-1, 'msg_user_not_confirmed');
1127
+			}
986 1128
 		}
987 1129
 
988 1130
 		// Insert data into the authentication DB
@@ -995,7 +1137,9 @@  discard block
 block discarded – undo
995 1137
 		$args->is_register = 'N';
996 1138
 
997 1139
 		$output = executeQuery('member.insertAuthMail', $args);
998
-		if(!$output->toBool()) return $output;
1140
+		if(!$output->toBool()) {
1141
+			return $output;
1142
+		}
999 1143
 		// Get content of the email to send a member
1000 1144
 		Context::set('auth_args', $args);
1001 1145
 
@@ -1012,8 +1156,7 @@  discard block
 block discarded – undo
1012 1156
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1013 1157
 				}
1014 1158
 			}
1015
-		}
1016
-		else
1159
+		} else
1017 1160
 		{
1018 1161
 			$memberInfo[$lang->user_id] = $args->user_id;
1019 1162
 			$memberInfo[$lang->user_name] = $args->user_name;
@@ -1022,13 +1165,19 @@  discard block
 block discarded – undo
1022 1165
 		}
1023 1166
 		Context::set('memberInfo', $memberInfo);
1024 1167
 
1025
-		if(!$member_config->skin) $member_config->skin = "default";
1026
-		if(!$member_config->colorset) $member_config->colorset = "white";
1168
+		if(!$member_config->skin) {
1169
+			$member_config->skin = "default";
1170
+		}
1171
+		if(!$member_config->colorset) {
1172
+			$member_config->colorset = "white";
1173
+		}
1027 1174
 
1028 1175
 		Context::set('member_config', $member_config);
1029 1176
 
1030 1177
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1031
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1178
+		if(!is_dir($tpl_path)) {
1179
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1180
+		}
1032 1181
 
1033 1182
 		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1034 1183
 		Context::set('find_url', $find_url);
@@ -1070,20 +1219,28 @@  discard block
 block discarded – undo
1070 1219
 		$find_account_question = trim(Context::get('find_account_question'));
1071 1220
 		$find_account_answer = trim(Context::get('find_account_answer'));
1072 1221
 
1073
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1222
+		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) {
1223
+			return new Object(-1, 'msg_invalid_request');
1224
+		}
1074 1225
 
1075 1226
 		$oModuleModel = getModel('module');
1076 1227
 		// Check if a member having the same email address exists
1077 1228
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1078
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1229
+		if(!$member_srl) {
1230
+			return new Object(-1, 'msg_email_not_exists');
1231
+		}
1079 1232
 		// Get information of the member
1080 1233
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1081 1234
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1082 1235
 
1083 1236
 		// Display a message if no answer is entered
1084
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1237
+		if(!$member_info->find_account_question || !$member_info->find_account_answer) {
1238
+			return new Object(-1, 'msg_question_not_exists');
1239
+		}
1085 1240
 
1086
-		if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) return new Object(-1, 'msg_answer_not_matches');
1241
+		if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) {
1242
+			return new Object(-1, 'msg_answer_not_matches');
1243
+		}
1087 1244
 
1088 1245
 		if($config->identifier == 'email_address')
1089 1246
 		{
@@ -1099,7 +1256,9 @@  discard block
 block discarded – undo
1099 1256
 		$args->password = $temp_password;
1100 1257
 		$args->change_password_date = '1';
1101 1258
 		$output = $this->updateMemberPassword($args);
1102
-		if(!$output->toBool()) return $output;
1259
+		if(!$output->toBool()) {
1260
+			return $output;
1261
+		}
1103 1262
 
1104 1263
 		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1105 1264
 
@@ -1156,8 +1315,7 @@  discard block
 block discarded – undo
1156 1315
 		if($output->data->is_register == 'Y')
1157 1316
 		{
1158 1317
 			$args->denied = 'N';
1159
-		}
1160
-		else
1318
+		} else
1161 1319
 		{
1162 1320
 			$args->password = $oMemberModel->hashPassword($args->password);
1163 1321
 		}
@@ -1191,33 +1349,45 @@  discard block
 block discarded – undo
1191 1349
 	{
1192 1350
 		// Get an email_address
1193 1351
 		$email_address = Context::get('email_address');
1194
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1352
+		if(!$email_address) {
1353
+			return new Object(-1, 'msg_invalid_request');
1354
+		}
1195 1355
 		// Log test by using email_address
1196 1356
 		$oMemberModel = getModel('member');
1197 1357
 
1198 1358
 		$args = new stdClass;
1199 1359
 		$args->email_address = $email_address;
1200 1360
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1201
-		if(!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1361
+		if(!$memberSrl) {
1362
+			return new Object(-1, 'msg_not_exists_member');
1363
+		}
1202 1364
 
1203 1365
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1204 1366
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1205 1367
 
1206 1368
 		$oModuleModel = getModel('module');
1207 1369
 		$member_config = $oModuleModel->getModuleConfig('member');
1208
-		if(!$member_config->skin) $member_config->skin = "default";
1209
-		if(!$member_config->colorset) $member_config->colorset = "white";
1370
+		if(!$member_config->skin) {
1371
+			$member_config->skin = "default";
1372
+		}
1373
+		if(!$member_config->colorset) {
1374
+			$member_config->colorset = "white";
1375
+		}
1210 1376
 
1211 1377
 		// Check if a authentication mail has been sent previously
1212 1378
 		$chk_args = new stdClass;
1213 1379
 		$chk_args->member_srl = $member_info->member_srl;
1214 1380
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1215
-		if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1381
+		if($output->toBool() && $output->data->count == '0') {
1382
+			return new Object(-1, 'msg_invalid_request');
1383
+		}
1216 1384
 
1217 1385
 		$auth_args = new stdClass;
1218 1386
 		$auth_args->member_srl = $member_info->member_srl;
1219 1387
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1220
-		if(!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1388
+		if(!$output->data || !$output->data[0]->auth_key) {
1389
+			return new Object(-1, 'msg_invalid_request');
1390
+		}
1221 1391
 		$auth_info = $output->data[0];
1222 1392
 
1223 1393
 		// Update the regdate of authmail entry
@@ -1238,8 +1408,7 @@  discard block
 block discarded – undo
1238 1408
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1239 1409
 				}
1240 1410
 			}
1241
-		}
1242
-		else
1411
+		} else
1243 1412
 		{
1244 1413
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1245 1414
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1252,7 +1421,9 @@  discard block
 block discarded – undo
1252 1421
 		Context::set('member_config', $member_config);
1253 1422
 
1254 1423
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1255
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1424
+		if(!is_dir($tpl_path)) {
1425
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1426
+		}
1256 1427
 
1257 1428
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1258 1429
 		Context::set('auth_url', $auth_url);
@@ -1330,7 +1501,9 @@  discard block
 block discarded – undo
1330 1501
 		$auth_args->is_register = 'Y';
1331 1502
 
1332 1503
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1333
-		if(!$output->toBool()) return $output;
1504
+		if(!$output->toBool()) {
1505
+			return $output;
1506
+		}
1334 1507
 
1335 1508
 		$memberInfo->email_address = $newEmail;
1336 1509
 
@@ -1364,8 +1537,7 @@  discard block
 block discarded – undo
1364 1537
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1365 1538
 				}
1366 1539
 			}
1367
-		}
1368
-		else
1540
+		} else
1369 1541
 		{
1370 1542
 			$memberInfo[$lang->user_id] = $member_info->user_id;
1371 1543
 			$memberInfo[$lang->user_name] = $member_info->user_name;
@@ -1374,13 +1546,19 @@  discard block
 block discarded – undo
1374 1546
 		}
1375 1547
 		Context::set('memberInfo', $memberInfo);
1376 1548
 
1377
-		if(!$member_config->skin) $member_config->skin = "default";
1378
-		if(!$member_config->colorset) $member_config->colorset = "white";
1549
+		if(!$member_config->skin) {
1550
+			$member_config->skin = "default";
1551
+		}
1552
+		if(!$member_config->colorset) {
1553
+			$member_config->colorset = "white";
1554
+		}
1379 1555
 
1380 1556
 		Context::set('member_config', $member_config);
1381 1557
 
1382 1558
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1383
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1559
+		if(!is_dir($tpl_path)) {
1560
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1561
+		}
1384 1562
 
1385 1563
 		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1386 1564
 		Context::set('auth_url', $auth_url);
@@ -1405,7 +1583,9 @@  discard block
 block discarded – undo
1405 1583
 	{
1406 1584
 		$site_module_info = Context::get('site_module_info');
1407 1585
 		$logged_info = Context::get('logged_info');
1408
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1586
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1587
+			return new Object(-1,'msg_invalid_request');
1588
+		}
1409 1589
 
1410 1590
 		$oMemberModel = getModel('member');
1411 1591
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1424,13 +1604,17 @@  discard block
 block discarded – undo
1424 1604
 	{
1425 1605
 		$site_module_info = Context::get('site_module_info');
1426 1606
 		$logged_info = Context::get('logged_info');
1427
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1607
+		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) {
1608
+			return new Object(-1,'msg_invalid_request');
1609
+		}
1428 1610
 
1429 1611
 		$args = new stdClass;
1430 1612
 		$args->site_srl= $site_module_info->site_srl;
1431 1613
 		$args->member_srl = $logged_info->member_srl;
1432 1614
 		$output = executeQuery('member.deleteMembersGroup', $args);
1433
-		if(!$output->toBool()) return $output;
1615
+		if(!$output->toBool()) {
1616
+			return $output;
1617
+		}
1434 1618
 		$this->setMessage('success_deleted');
1435 1619
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1436 1620
 	}
@@ -1444,17 +1628,37 @@  discard block
 block discarded – undo
1444 1628
 	 */
1445 1629
 	function setMemberConfig($args)
1446 1630
 	{
1447
-		if(!$args->skin) $args->skin = "default";
1448
-		if(!$args->colorset) $args->colorset = "white";
1449
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1450
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1451
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1631
+		if(!$args->skin) {
1632
+			$args->skin = "default";
1633
+		}
1634
+		if(!$args->colorset) {
1635
+			$args->colorset = "white";
1636
+		}
1637
+		if(!$args->editor_skin) {
1638
+			$args->editor_skin= "ckeditor";
1639
+		}
1640
+		if(!$args->editor_colorset) {
1641
+			$args->editor_colorset = "moono";
1642
+		}
1643
+		if($args->enable_join!='Y') {
1644
+			$args->enable_join = 'N';
1645
+		}
1452 1646
 		$args->enable_openid= 'N';
1453
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1454
-		if($args->image_name!='Y') $args->image_name = 'N';
1455
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1456
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1457
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1647
+		if($args->profile_image !='Y') {
1648
+			$args->profile_image = 'N';
1649
+		}
1650
+		if($args->image_name!='Y') {
1651
+			$args->image_name = 'N';
1652
+		}
1653
+		if($args->image_mark!='Y') {
1654
+			$args->image_mark = 'N';
1655
+		}
1656
+		if($args->group_image_mark!='Y') {
1657
+			$args->group_image_mark = 'N';
1658
+		}
1659
+		if(!trim(strip_tags($args->agreement))) {
1660
+			$args->agreement = null;
1661
+		}
1458 1662
 		$args->limit_day = (int)$args->limit_day;
1459 1663
 
1460 1664
 		$agreement = trim($args->agreement);
@@ -1462,7 +1666,9 @@  discard block
 block discarded – undo
1462 1666
 
1463 1667
 		$oModuleController = getController('module');
1464 1668
 		$output = $oModuleController->insertModuleConfig('member',$args);
1465
-		if(!$output->toBool()) return $output;
1669
+		if(!$output->toBool()) {
1670
+			return $output;
1671
+		}
1466 1672
 
1467 1673
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1468 1674
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1487,7 +1693,9 @@  discard block
 block discarded – undo
1487 1693
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1488 1694
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1489 1695
 
1490
-		if(!$check_signature) return FileHandler::removeFile($filename);
1696
+		if(!$check_signature) {
1697
+			return FileHandler::removeFile($filename);
1698
+		}
1491 1699
 
1492 1700
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1493 1701
 		FileHandler::makeDir($path);
@@ -1521,7 +1729,9 @@  discard block
 block discarded – undo
1521 1729
 		$args = new stdClass();
1522 1730
 		$args->member_srl = $member_srl;
1523 1731
 		$args->group_srl = $group_srl;
1524
-		if($site_srl) $args->site_srl = $site_srl;
1732
+		if($site_srl) {
1733
+			$args->site_srl = $site_srl;
1734
+		}
1525 1735
 
1526 1736
 		// Add
1527 1737
 		$output = executeQuery('member.addMemberToGroup',$args);
@@ -1547,15 +1757,21 @@  discard block
 block discarded – undo
1547 1757
 		$obj->member_srl = implode(',',$args->member_srl);
1548 1758
 
1549 1759
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1550
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1760
+		if($output->data) {
1761
+			foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1762
+		}
1551 1763
 
1552 1764
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1553
-		if(!$output->toBool()) return $output;
1765
+		if(!$output->toBool()) {
1766
+			return $output;
1767
+		}
1554 1768
 
1555 1769
 		$inserted_members = array();
1556 1770
 		foreach($args->member_srl as $key => $val)
1557 1771
 		{
1558
-			if($inserted_members[$val]) continue;
1772
+			if($inserted_members[$val]) {
1773
+				continue;
1774
+			}
1559 1775
 			$inserted_members[$val] = true;
1560 1776
 
1561 1777
 			unset($obj);
@@ -1565,7 +1781,9 @@  discard block
 block discarded – undo
1565 1781
 			$obj->site_srl = $args->site_srl;
1566 1782
 			$obj->regdate = $date[$obj->member_srl];
1567 1783
 			$output = executeQuery('member.addMemberToGroup', $obj);
1568
-			if(!$output->toBool()) return $output;
1784
+			if(!$output->toBool()) {
1785
+				return $output;
1786
+			}
1569 1787
 
1570 1788
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1571 1789
 		}
@@ -1627,8 +1845,7 @@  discard block
 block discarded – undo
1627 1845
 				if($config->identifier == 'user_id')
1628 1846
 				{
1629 1847
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1630
-				}
1631
-				else
1848
+				} else
1632 1849
 				{
1633 1850
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1634 1851
 				}
@@ -1637,8 +1854,7 @@  discard block
 block discarded – undo
1637 1854
 					$do_auto_login = true;
1638 1855
 				}
1639 1856
 
1640
-			}
1641
-			else
1857
+			} else
1642 1858
 			{
1643 1859
 				$do_auto_login = true;
1644 1860
 			}
@@ -1647,8 +1863,7 @@  discard block
 block discarded – undo
1647 1863
 		if($do_auto_login)
1648 1864
 		{
1649 1865
 			$output = $this->doLogin($user_id);
1650
-		}
1651
-		else
1866
+		} else
1652 1867
 		{
1653 1868
 			executeQuery('member.deleteAutologin', $args);
1654 1869
 			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/');
@@ -1667,13 +1882,17 @@  discard block
 block discarded – undo
1667 1882
 	function doLogin($user_id, $password = '', $keep_signed = false)
1668 1883
 	{
1669 1884
 		$user_id = strtolower($user_id);
1670
-		if(!$user_id) return new Object(-1, 'null_user_id');
1885
+		if(!$user_id) {
1886
+			return new Object(-1, 'null_user_id');
1887
+		}
1671 1888
 		// Call a trigger before log-in (before)
1672 1889
 		$trigger_obj = new stdClass();
1673 1890
 		$trigger_obj->user_id = $user_id;
1674 1891
 		$trigger_obj->password = $password;
1675 1892
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1676
-		if(!$trigger_output->toBool()) return $trigger_output;
1893
+		if(!$trigger_output->toBool()) {
1894
+			return $trigger_output;
1895
+		}
1677 1896
 		// Create a member model object
1678 1897
 		$oMemberModel = getModel('member');
1679 1898
 
@@ -1688,15 +1907,18 @@  discard block
 block discarded – undo
1688 1907
 			// Get user_id information
1689 1908
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1690 1909
 			// Set an invalid user if no value returned
1691
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1910
+			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) {
1911
+				return $this->recordLoginError(-1, 'invalid_email_address');
1912
+			}
1692 1913
 
1693
-		}
1694
-		else
1914
+		} else
1695 1915
 		{
1696 1916
 			// Get user_id information
1697 1917
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1698 1918
 			// Set an invalid user if no value returned
1699
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1919
+			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) {
1920
+				return $this->recordLoginError(-1, 'invalid_user_id');
1921
+			}
1700 1922
 		}
1701 1923
 
1702 1924
 		$output = executeQuery('member.getLoginCountByIp', $args);
@@ -1708,14 +1930,18 @@  discard block
 block discarded – undo
1708 1930
 			if($term < $config->max_error_count_time)
1709 1931
 			{
1710 1932
 				$term = $config->max_error_count_time - $term;
1711
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1712
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1713
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1714
-				else $term = intval($term/86400).Context::getLang('unit_day');
1933
+				if($term < 60) {
1934
+					$term = intval($term).Context::getLang('unit_sec');
1935
+				} elseif(60 <= $term && $term < 3600) {
1936
+					$term = intval($term/60).Context::getLang('unit_min');
1937
+				} elseif(3600 <= $term && $term < 86400) {
1938
+					$term = intval($term/3600).Context::getLang('unit_hour');
1939
+				} else {
1940
+					$term = intval($term/86400).Context::getLang('unit_day');
1941
+				}
1715 1942
 
1716 1943
 				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1717
-			}
1718
-			else
1944
+			} else
1719 1945
 			{
1720 1946
 				$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1721 1947
 				$output = executeQuery('member.deleteLoginCountByIp', $args);
@@ -1742,7 +1968,9 @@  discard block
 block discarded – undo
1742 1968
 			return new Object(-1,'msg_user_denied');
1743 1969
 		}
1744 1970
 		// Notify if denied_date is less than the current time
1745
-		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
1971
+		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) {
1972
+			return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
1973
+		}
1746 1974
 		// Update the latest login time
1747 1975
 		$args->member_srl = $this->memberInfo->member_srl;
1748 1976
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1791,7 +2019,9 @@  discard block
 block discarded – undo
1791 2019
 		}
1792 2020
 		// Call a trigger after successfully log-in (after)
1793 2021
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1794
-		if(!$trigger_output->toBool()) return $trigger_output;
2022
+		if(!$trigger_output->toBool()) {
2023
+			return $trigger_output;
2024
+		}
1795 2025
 		// When user checked to use auto-login
1796 2026
 		if($keep_signed)
1797 2027
 		{
@@ -1805,7 +2035,9 @@  discard block
 block discarded – undo
1805 2035
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1806 2036
 			executeQuery('member.deleteAutologin', $autologin_args);
1807 2037
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1808
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000, '/');
2038
+			if($autologin_output->toBool()) {
2039
+				setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000, '/');
2040
+			}
1809 2041
 		}
1810 2042
 		if($this->memberInfo->is_admin == 'Y')
1811 2043
 		{
@@ -1894,7 +2126,9 @@  discard block
 block discarded – undo
1894 2126
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
1895 2127
 	{
1896 2128
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
1897
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
2129
+		if(!is_array($member_popup_menu_list)) {
2130
+			$member_popup_menu_list = array();
2131
+		}
1898 2132
 
1899 2133
 		$obj = new stdClass;
1900 2134
 		$obj->url = $url;
@@ -1913,35 +2147,54 @@  discard block
 block discarded – undo
1913 2147
 	{
1914 2148
 		// Call a trigger (before)
1915 2149
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
1916
-		if(!$output->toBool()) return $output;
2150
+		if(!$output->toBool()) {
2151
+			return $output;
2152
+		}
1917 2153
 		// Terms and Conditions portion of the information set up by members reaffirmed
1918 2154
 		$oModuleModel = getModel('module');
1919 2155
 		$config = $oModuleModel->getModuleConfig('member');
1920 2156
 
1921 2157
 		$logged_info = Context::get('logged_info');
1922 2158
 		// If the date of the temporary restrictions limit further information on the date of
1923
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2159
+		if($config->limit_day) {
2160
+			$args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
2161
+		}
1924 2162
 
1925 2163
 		$args->member_srl = getNextSequence();
1926 2164
 		$args->list_order = -1 * $args->member_srl;
1927 2165
 
1928 2166
 		// Execute insert or update depending on the value of member_srl
1929
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2167
+		if(!$args->user_id) {
2168
+			$args->user_id = 't'.$args->member_srl;
2169
+		}
1930 2170
 		// Enter the user's identity changed to lowercase
1931
-		else $args->user_id = strtolower($args->user_id);
1932
-		if(!$args->user_name) $args->user_name = $args->member_srl;
1933
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
2171
+		else {
2172
+			$args->user_id = strtolower($args->user_id);
2173
+		}
2174
+		if(!$args->user_name) {
2175
+			$args->user_name = $args->member_srl;
2176
+		}
2177
+		if(!$args->nick_name) {
2178
+			$args->nick_name = $args->member_srl;
2179
+		}
1934 2180
 
1935 2181
 		// Control of essential parameters
1936
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
1937
-		if($args->denied!='Y') $args->denied = 'N';
1938
-		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) $args->allow_message = 'Y';
2182
+		if($args->allow_mailing!='Y') {
2183
+			$args->allow_mailing = 'N';
2184
+		}
2185
+		if($args->denied!='Y') {
2186
+			$args->denied = 'N';
2187
+		}
2188
+		if(!$args->allow_message || ($args->allow_message && !in_array($args->allow_message, array('Y','N','F')))) {
2189
+			$args->allow_message = 'Y';
2190
+		}
1939 2191
 
1940 2192
 		if($logged_info->is_admin == 'Y')
1941 2193
 		{
1942
-			if($args->is_admin!='Y') $args->is_admin = 'N';
1943
-		}
1944
-		else
2194
+			if($args->is_admin!='Y') {
2195
+				$args->is_admin = 'N';
2196
+			}
2197
+		} else
1945 2198
 		{
1946 2199
 			unset($args->is_admin);
1947 2200
 		}
@@ -1954,8 +2207,12 @@  discard block
 block discarded – undo
1954 2207
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1955 2208
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1956 2209
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1957
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
1958
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
2210
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) {
2211
+			$args->homepage = 'http://'.$args->homepage;
2212
+		}
2213
+		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) {
2214
+			$args->blog = 'http://'.$args->blog;
2215
+		}
1959 2216
 
1960 2217
 		// Create a model object
1961 2218
 		$oMemberModel = getModel('member');
@@ -1969,8 +2226,7 @@  discard block
 block discarded – undo
1969 2226
 				return new Object(-1, $message[$config->password_strength]);
1970 2227
 			}
1971 2228
 			$args->password = $oMemberModel->hashPassword($args->password);
1972
-		}
1973
-		elseif(!$args->password)
2229
+		} elseif(!$args->password)
1974 2230
 		{
1975 2231
 			unset($args->password);
1976 2232
 		}
@@ -2011,8 +2267,12 @@  discard block
 block discarded – undo
2011 2267
 		// Insert data into the DB
2012 2268
 		$args->list_order = -1 * $args->member_srl;
2013 2269
 
2014
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2015
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2270
+		if(!$args->user_id) {
2271
+			$args->user_id = 't'.$args->member_srl;
2272
+		}
2273
+		if(!$args->user_name) {
2274
+			$args->user_name = $args->member_srl;
2275
+		}
2016 2276
 
2017 2277
 		$oDB = &DB::getInstance();
2018 2278
 		$oDB->begin();
@@ -2024,8 +2284,11 @@  discard block
 block discarded – undo
2024 2284
 			return $output;
2025 2285
 		}
2026 2286
 
2027
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2028
-		else $group_srl_list = explode('|@|', $args->group_srl_list);
2287
+		if(is_array($args->group_srl_list)) {
2288
+			$group_srl_list = $args->group_srl_list;
2289
+		} else {
2290
+			$group_srl_list = explode('|@|', $args->group_srl_list);
2291
+		}
2029 2292
 		// If no value is entered the default group, the value of group registration
2030 2293
 		if(!$args->group_srl_list)
2031 2294
 		{
@@ -2042,8 +2305,7 @@  discard block
 block discarded – undo
2042 2305
 				}
2043 2306
 			}
2044 2307
 			// If the value is the value of the group entered the group registration
2045
-		}
2046
-		else
2308
+		} else
2047 2309
 		{
2048 2310
 			for($i=0;$i<count($group_srl_list);$i++)
2049 2311
 			{
@@ -2104,27 +2366,39 @@  discard block
 block discarded – undo
2104 2366
 	{
2105 2367
 		// Call a trigger (before)
2106 2368
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2107
-		if(!$output->toBool()) return $output;
2369
+		if(!$output->toBool()) {
2370
+			return $output;
2371
+		}
2108 2372
 		// Create a model object
2109 2373
 		$oMemberModel = getModel('member');
2110 2374
 
2111 2375
 		$logged_info = Context::get('logged_info');
2112 2376
 		// Get what you want to modify the original information
2113
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2377
+		if(!$this->memberInfo) {
2378
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2379
+		}
2114 2380
 		// Control of essential parameters
2115
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2116
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2381
+		if($args->allow_mailing!='Y') {
2382
+			$args->allow_mailing = 'N';
2383
+		}
2384
+		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) {
2385
+			$args->allow_message = 'Y';
2386
+		}
2117 2387
 
2118 2388
 		if($logged_info->is_admin == 'Y')
2119 2389
 		{
2120
-			if($args->denied!='Y') $args->denied = 'N';
2121
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2122
-		}
2123
-		else
2390
+			if($args->denied!='Y') {
2391
+				$args->denied = 'N';
2392
+			}
2393
+			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) {
2394
+				$args->is_admin = 'N';
2395
+			}
2396
+		} else
2124 2397
 		{
2125 2398
 			unset($args->is_admin);
2126
-			if($is_admin == false)
2127
-				unset($args->denied);
2399
+			if($is_admin == false) {
2400
+							unset($args->denied);
2401
+			}
2128 2402
 			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2129 2403
 			{
2130 2404
 				return $this->stop('msg_invalid_request');
@@ -2132,13 +2406,19 @@  discard block
 block discarded – undo
2132 2406
 		}
2133 2407
 
2134 2408
 		// Sanitize user ID, username, nickname, homepage, blog
2135
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2409
+		if($args->user_id) {
2410
+			$args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2411
+		}
2136 2412
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2137 2413
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2138 2414
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2139 2415
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2140
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2141
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2416
+		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) {
2417
+			$args->homepage = 'http://'.$args->homepage;
2418
+		}
2419
+		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) {
2420
+			$args->blog = 'http://'.$args->blog;
2421
+		}
2142 2422
 
2143 2423
 		// check member identifier form
2144 2424
 		$config = $oMemberModel->getMemberConfig();
@@ -2155,8 +2435,7 @@  discard block
 block discarded – undo
2155 2435
 				return new Object(-1,'msg_exists_email_address');
2156 2436
 			}
2157 2437
 			$args->email_address = $orgMemberInfo->email_address;
2158
-		}
2159
-		else
2438
+		} else
2160 2439
 		{
2161 2440
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2162 2441
 			if($member_srl && $args->member_srl != $member_srl)
@@ -2213,17 +2492,26 @@  discard block
 block discarded – undo
2213 2492
 				return new Object(-1, $message[$config->password_strength]);
2214 2493
 			}
2215 2494
 			$args->password = $oMemberModel->hashPassword($args->password);
2216
-		}
2217
-		else
2495
+		} else
2218 2496
 		{
2219 2497
 			$args->password = $orgMemberInfo->password;
2220 2498
 		}
2221 2499
 
2222
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2223
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2224
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2225
-		if(!$args->description) $args->description = $orgMemberInfo->description;
2226
-		if(!$args->birthday) $args->birthday = '';
2500
+		if(!$args->user_name) {
2501
+			$args->user_name = $orgMemberInfo->user_name;
2502
+		}
2503
+		if(!$args->user_id) {
2504
+			$args->user_id = $orgMemberInfo->user_id;
2505
+		}
2506
+		if(!$args->nick_name) {
2507
+			$args->nick_name = $orgMemberInfo->nick_name;
2508
+		}
2509
+		if(!$args->description) {
2510
+			$args->description = $orgMemberInfo->description;
2511
+		}
2512
+		if(!$args->birthday) {
2513
+			$args->birthday = '';
2514
+		}
2227 2515
 
2228 2516
 		$output = executeQuery('member.updateMember', $args);
2229 2517
 
@@ -2235,8 +2523,11 @@  discard block
 block discarded – undo
2235 2523
 
2236 2524
 		if($args->group_srl_list)
2237 2525
 		{
2238
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2239
-			else $group_srl_list = explode('|@|', $args->group_srl_list);
2526
+			if(is_array($args->group_srl_list)) {
2527
+				$group_srl_list = $args->group_srl_list;
2528
+			} else {
2529
+				$group_srl_list = explode('|@|', $args->group_srl_list);
2530
+			}
2240 2531
 			// If the group information, group information changes
2241 2532
 			if(count($group_srl_list) > 0)
2242 2533
 			{
@@ -2279,7 +2570,9 @@  discard block
 block discarded – undo
2279 2570
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2280 2571
 
2281 2572
 		// Save Session
2282
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2573
+		if(!$this->memberInfo) {
2574
+			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2575
+		}
2283 2576
 		$logged_info = Context::get('logged_info');
2284 2577
 
2285 2578
 		$output->add('member_srl', $args->member_srl);
@@ -2305,8 +2598,7 @@  discard block
 block discarded – undo
2305 2598
 			}
2306 2599
 
2307 2600
 			$args->password = $oMemberModel->hashPassword($args->password);
2308
-		}
2309
-		else if($args->hashed_password)
2601
+		} else if($args->hashed_password)
2310 2602
 		{
2311 2603
 			$args->password = $args->hashed_password;
2312 2604
 		}
@@ -2331,7 +2623,9 @@  discard block
 block discarded – undo
2331 2623
 		$trigger_obj = new stdClass();
2332 2624
 		$trigger_obj->member_srl = $member_srl;
2333 2625
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2334
-		if(!$output->toBool()) return $output;
2626
+		if(!$output->toBool()) {
2627
+			return $output;
2628
+		}
2335 2629
 		// Create a model object
2336 2630
 		$oMemberModel = getModel('member');
2337 2631
 		// Bringing the user's information
@@ -2340,9 +2634,13 @@  discard block
 block discarded – undo
2340 2634
 			$columnList = array('member_srl', 'is_admin');
2341 2635
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2342 2636
 		}
2343
-		if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2637
+		if(!$this->memberInfo) {
2638
+			return new Object(-1, 'msg_not_exists_member');
2639
+		}
2344 2640
 		// If managers can not be deleted
2345
-		if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2641
+		if($this->memberInfo->is_admin == 'Y') {
2642
+			return new Object(-1, 'msg_cannot_delete_admin');
2643
+		}
2346 2644
 
2347 2645
 		$oDB = &DB::getInstance();
2348 2646
 		$oDB->begin();
@@ -2406,7 +2704,9 @@  discard block
 block discarded – undo
2406 2704
 	 */
2407 2705
 	function destroySessionInfo()
2408 2706
 	{
2409
-		if(!$_SESSION || !is_array($_SESSION)) return;
2707
+		if(!$_SESSION || !is_array($_SESSION)) {
2708
+			return;
2709
+		}
2410 2710
 
2411 2711
 		$memberInfo = Context::get('logged_info');
2412 2712
 		$memberSrl = $memberInfo->member_srl;
@@ -2445,8 +2745,9 @@  discard block
 block discarded – undo
2445 2745
 		}
2446 2746
 		$maxLevel = 0;
2447 2747
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2448
-		if(count($resultGroup) > 0)
2449
-			$maxLevel = max(array_flip($resultGroup));
2748
+		if(count($resultGroup) > 0) {
2749
+					$maxLevel = max(array_flip($resultGroup));
2750
+		}
2450 2751
 
2451 2752
 		if($maxLevel > 0)
2452 2753
 		{
@@ -2463,16 +2764,22 @@  discard block
 block discarded – undo
2463 2764
 
2464 2765
 	function procMemberModifyEmailAddress()
2465 2766
 	{
2466
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2767
+		if(!Context::get('is_logged')) {
2768
+			return $this->stop('msg_not_logged');
2769
+		}
2467 2770
 
2468 2771
 		$member_info = Context::get('logged_info');
2469 2772
 		$newEmail = Context::get('email_address');
2470 2773
 
2471
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2774
+		if(!$newEmail) {
2775
+			return $this->stop('msg_invalid_request');
2776
+		}
2472 2777
 
2473 2778
 		$oMemberModel = getModel('member');
2474 2779
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2475
-		if($member_srl) return new Object(-1,'msg_exists_email_address');
2780
+		if($member_srl) {
2781
+			return new Object(-1,'msg_exists_email_address');
2782
+		}
2476 2783
 
2477 2784
 		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2478 2785
 		{
@@ -2500,7 +2807,9 @@  discard block
 block discarded – undo
2500 2807
 		$member_config = $oModuleModel->getModuleConfig('member');
2501 2808
 
2502 2809
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2503
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2810
+		if(!is_dir($tpl_path)) {
2811
+			$tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2812
+		}
2504 2813
 
2505 2814
 		global $lang;
2506 2815
 
@@ -2536,7 +2845,9 @@  discard block
 block discarded – undo
2536 2845
 	{
2537 2846
 		$member_srl = Context::get('member_srl');
2538 2847
 		$auth_key = Context::get('auth_key');
2539
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2848
+		if(!$member_srl || !$auth_key) {
2849
+			return $this->stop('msg_invalid_request');
2850
+		}
2540 2851
 
2541 2852
 		// Test logs for finding password by user_id and authkey
2542 2853
 		$args = new stdClass;
@@ -2545,7 +2856,9 @@  discard block
 block discarded – undo
2545 2856
 		$output = executeQuery('member.getAuthMail', $args);
2546 2857
 		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2547 2858
 		{
2548
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2859
+			if(strlen($output->data->auth_key) !== strlen($auth_key)) {
2860
+				executeQuery('member.deleteAuthChangeEmailAddress', $args);
2861
+			}
2549 2862
 			return $this->stop('msg_invalid_modify_email_auth_key');
2550 2863
 		}
2551 2864
 
@@ -2554,7 +2867,9 @@  discard block
 block discarded – undo
2554 2867
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2555 2868
 
2556 2869
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2557
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2870
+		if(!$output->toBool()) {
2871
+			return $this->stop($output->getMessage());
2872
+		}
2558 2873
 
2559 2874
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2560 2875
 		executeQuery('member.deleteAuthChangeEmailAddress',$args);
@@ -2575,7 +2890,9 @@  discard block
 block discarded – undo
2575 2890
 	**/
2576 2891
 	function triggerGetDocumentMenu(&$menu_list)
2577 2892
 	{
2578
-		if(!Context::get('is_logged')) return new Object();
2893
+		if(!Context::get('is_logged')) {
2894
+			return new Object();
2895
+		}
2579 2896
 
2580 2897
 		$logged_info = Context::get('logged_info');
2581 2898
 		$document_srl = Context::get('target_srl');
@@ -2586,8 +2903,12 @@  discard block
 block discarded – undo
2586 2903
 		$member_srl = $oDocument->get('member_srl');
2587 2904
 		$module_srl = $oDocument->get('module_srl');
2588 2905
 
2589
-		if(!$member_srl) return new Object();
2590
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2906
+		if(!$member_srl) {
2907
+			return new Object();
2908
+		}
2909
+		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
2910
+			return new Object();
2911
+		}
2591 2912
 
2592 2913
 		$oDocumentController = getController('document');
2593 2914
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2605,7 +2926,9 @@  discard block
 block discarded – undo
2605 2926
 	**/
2606 2927
 	function triggerGetCommentMenu(&$menu_list)
2607 2928
 	{
2608
-		if(!Context::get('is_logged')) return new Object();
2929
+		if(!Context::get('is_logged')) {
2930
+			return new Object();
2931
+		}
2609 2932
 
2610 2933
 		$logged_info = Context::get('logged_info');
2611 2934
 		$comment_srl = Context::get('target_srl');
@@ -2616,8 +2939,12 @@  discard block
 block discarded – undo
2616 2939
 		$module_srl = $oComment->get('module_srl');
2617 2940
 		$member_srl = $oComment->get('member_srl');
2618 2941
 
2619
-		if(!$member_srl) return new Object();
2620
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2942
+		if(!$member_srl) {
2943
+			return new Object();
2944
+		}
2945
+		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) {
2946
+			return new Object();
2947
+		}
2621 2948
 
2622 2949
 		$oCommentController = getController('comment');
2623 2950
 		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
@@ -2633,7 +2960,9 @@  discard block
 block discarded – undo
2633 2960
 	**/
2634 2961
 	function procMemberSpammerManage()
2635 2962
 	{
2636
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
2963
+		if(!Context::get('is_logged')) {
2964
+			return new Object(-1,'msg_not_permitted');
2965
+		}
2637 2966
 
2638 2967
 		$logged_info = Context::get('logged_info');
2639 2968
 		$member_srl = Context::get('member_srl');
@@ -2641,8 +2970,9 @@  discard block
 block discarded – undo
2641 2970
 		$cnt_loop = Context::get('cnt_loop');
2642 2971
 		$proc_type = Context::get('proc_type');
2643 2972
 		$isMoveToTrash = true;
2644
-		if($proc_type == "delete")
2645
-			$isMoveToTrash = false;
2973
+		if($proc_type == "delete") {
2974
+					$isMoveToTrash = false;
2975
+		}
2646 2976
 
2647 2977
 		// check grant
2648 2978
 		$oModuleModel = getModel('module');
@@ -2650,7 +2980,9 @@  discard block
 block discarded – undo
2650 2980
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2651 2981
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2652 2982
 
2653
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
2983
+		if(!$grant->manager) {
2984
+			return new Object(-1,'msg_not_permitted');
2985
+		}
2654 2986
 
2655 2987
 		$proc_msg = "";
2656 2988
 
@@ -2659,11 +2991,13 @@  discard block
 block discarded – undo
2659 2991
 
2660 2992
 		// delete or trash destination
2661 2993
 		// proc member
2662
-		if($cnt_loop == 1)
2663
-			$this->_spammerMember($member_srl);
2994
+		if($cnt_loop == 1) {
2995
+					$this->_spammerMember($member_srl);
2996
+		}
2664 2997
 		// proc document and comment
2665
-		elseif($cnt_loop>1)
2666
-			$this->_spammerDocuments($member_srl, $isMoveToTrash);
2998
+		elseif($cnt_loop>1) {
2999
+					$this->_spammerDocuments($member_srl, $isMoveToTrash);
3000
+		}
2667 3001
 
2668 3002
 		// get destination count
2669 3003
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
@@ -2671,13 +3005,16 @@  discard block
 block discarded – undo
2671 3005
 
2672 3006
 		$total_count = Context::get('total_count');
2673 3007
 		$remain_count = $cnt_document + $cnt_comment;
2674
-		if($cnt_loop == 1) $total_count = $remain_count;
3008
+		if($cnt_loop == 1) {
3009
+			$total_count = $remain_count;
3010
+		}
2675 3011
 
2676 3012
 		// get progress percent
2677
-		if($total_count > 0)
2678
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2679
-		else
2680
-			$progress = 100;
3013
+		if($total_count > 0) {
3014
+					$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
3015
+		} else {
3016
+					$progress = 100;
3017
+		}
2681 3018
 
2682 3019
 		$this->add('total_count', $total_count);
2683 3020
 		$this->add('remain_count', $remain_count);
@@ -2719,7 +3056,10 @@  discard block
 block discarded – undo
2719 3056
 		$args->nick_name = $member_info->nick_name;
2720 3057
 		$args->denied = "Y";
2721 3058
 		$args->description = trim( $member_info->description );
2722
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
3059
+		if( $args->description != "" ) {
3060
+			$args->description .= "\n";
3061
+		}
3062
+		// add new line
2723 3063
 
2724 3064
 		$args->description .= Context::getLang('cmd_spammer') . "[" . date("Y-m-d H:i:s") . " from:" . $logged_info->user_id . " info:" . $spam_description . " docuemnts count:" . $total_count . "]";
2725 3065
 
@@ -2764,8 +3104,11 @@  discard block
 block discarded – undo
2764 3104
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2765 3105
 			if($documentList) {
2766 3106
 				foreach($documentList as $v) {
2767
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2768
-					else $oDocumentController->deleteDocument($v->document_srl);
3107
+					if($isMoveToTrash) {
3108
+						$oDocumentController->moveDocumentToTrash($v);
3109
+					} else {
3110
+						$oDocumentController->deleteDocument($v->document_srl);
3111
+					}
2769 3112
 				}
2770 3113
 			}
2771 3114
 		}
Please login to merge, or discard this patch.