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 — develop ( eb2efa...4eba32 )
by gyeong-won
11:48
created
modules/member/member.controller.php 1 patch
Spacing   +442 added lines, -442 removed lines patch added patch discarded remove patch
@@ -34,25 +34,25 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	function procMemberLogin($user_id = null, $password = null, $keep_signed = null)
36 36
 	{
37
-		if(!$user_id && !$password && Context::getRequestMethod() == 'GET')
37
+		if (!$user_id && !$password && Context::getRequestMethod() == 'GET')
38 38
 		{
39 39
 			$this->setRedirectUrl(getNotEncodedUrl(''));
40 40
 			return new Object(-1, 'null_user_id');
41 41
 		}
42 42
 
43 43
 		// Variables
44
-		if(!$user_id) $user_id = Context::get('user_id');
44
+		if (!$user_id) $user_id = Context::get('user_id');
45 45
 		$user_id = trim($user_id);
46 46
 
47
-		if(!$password) $password = Context::get('password');
47
+		if (!$password) $password = Context::get('password');
48 48
 		$password = trim($password);
49 49
 
50
-		if(!$keep_signed) $keep_signed = Context::get('keep_signed');
50
+		if (!$keep_signed) $keep_signed = Context::get('keep_signed');
51 51
 		// Return an error when id and password doesn't exist
52
-		if(!$user_id) return new Object(-1,'null_user_id');
53
-		if(!$password) return new Object(-1,'null_password');
52
+		if (!$user_id) return new Object(-1, 'null_user_id');
53
+		if (!$password) return new Object(-1, 'null_password');
54 54
 
55
-		$output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false);
55
+		$output = $this->doLogin($user_id, $password, $keep_signed == 'Y' ? true : false);
56 56
 		if (!$output->toBool()) return $output;
57 57
 
58 58
 		$oModuleModel = getModel('module');
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
 		$limit_date = $config->change_password_date;
63 63
 
64 64
 		// Check if change_password_date is set
65
-		if($limit_date > 0)
65
+		if ($limit_date > 0)
66 66
 		{
67 67
 			$oMemberModel = getModel('member');
68
-			if($this->memberInfo->change_password_date < date ('YmdHis', strtotime ('-' . $limit_date . ' day')))
68
+			if ($this->memberInfo->change_password_date < date('YmdHis', strtotime('-'.$limit_date.' day')))
69 69
 			{
70 70
 				$msg = sprintf(Context::getLang('msg_change_password_date'), $limit_date);
71
-				return $this->setRedirectUrl(getNotEncodedUrl('','vid',Context::get('vid'),'mid',Context::get('mid'),'act','dispMemberModifyPassword'), new Object(-1, $msg));
71
+				return $this->setRedirectUrl(getNotEncodedUrl('', 'vid', Context::get('vid'), 'mid', Context::get('mid'), 'act', 'dispMemberModifyPassword'), new Object(-1, $msg));
72 72
 			}
73 73
 		}
74 74
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		$args->member_srl = $this->memberInfo->member_srl;
78 78
 		executeQuery('member.deleteAuthMail', $args);
79 79
 
80
-		if(!$config->after_login_url)
80
+		if (!$config->after_login_url)
81 81
 		{
82 82
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
83 83
 		}
@@ -98,18 +98,18 @@  discard block
 block discarded – undo
98 98
 		// Call a trigger before log-out (before)
99 99
 		$logged_info = Context::get('logged_info');
100 100
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info);
101
-		if(!$trigger_output->toBool()) return $trigger_output;
101
+		if (!$trigger_output->toBool()) return $trigger_output;
102 102
 		// Destroy session information
103 103
 		$this->destroySessionInfo();
104 104
 		// Call a trigger after log-out (after)
105 105
 		$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info);
106
-		if(!$trigger_output->toBool()) return $trigger_output;
106
+		if (!$trigger_output->toBool()) return $trigger_output;
107 107
 
108 108
 		$output = new Object();
109 109
 
110 110
 		$oModuleModel = getModel('module');
111 111
 		$config = $oModuleModel->getModuleConfig('member');
112
-		if($config->after_logout_url)
112
+		if ($config->after_logout_url)
113 113
 			$output->redirect_url = $config->after_logout_url;
114 114
 
115 115
 		$this->_clearMemberCache($logged_info->member_srl);
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
 	function procMemberScrapDocument()
126 126
 	{
127 127
 		// Check login information
128
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
128
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
129 129
 		$logged_info = Context::get('logged_info');
130 130
 
131
-		$document_srl = (int)Context::get('document_srl');
132
-		if(!$document_srl) $document_srl = (int)Context::get('target_srl');
133
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
131
+		$document_srl = (int) Context::get('document_srl');
132
+		if (!$document_srl) $document_srl = (int) Context::get('target_srl');
133
+		if (!$document_srl) return new Object(-1, 'msg_invalid_request');
134 134
 		// Get document
135 135
 		$oDocumentModel = getModel('document');
136 136
 		$oDocument = $oDocumentModel->getDocument($document_srl);
@@ -145,10 +145,10 @@  discard block
 block discarded – undo
145 145
 		$args->title = $oDocument->get('title');
146 146
 		// Check if already scrapped
147 147
 		$output = executeQuery('member.getScrapDocument', $args);
148
-		if($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
148
+		if ($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
149 149
 		// Insert
150 150
 		$output = executeQuery('member.addScrapDocument', $args);
151
-		if(!$output->toBool()) return $output;
151
+		if (!$output->toBool()) return $output;
152 152
 
153 153
 		$this->setError(-1);
154 154
 		$this->setMessage('success_registed');
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
 	function procMemberDeleteScrap()
163 163
 	{
164 164
 		// Check login information
165
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
165
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
166 166
 		$logged_info = Context::get('logged_info');
167 167
 
168
-		$document_srl = (int)Context::get('document_srl');
169
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
168
+		$document_srl = (int) Context::get('document_srl');
169
+		if (!$document_srl) return new Object(-1, 'msg_invalid_request');
170 170
 		// Variables
171 171
 		$args = new stdClass;
172 172
 		$args->member_srl = $logged_info->member_srl;
@@ -192,11 +192,11 @@  discard block
 block discarded – undo
192 192
 	function procMemberDeleteSavedDocument()
193 193
 	{
194 194
 		// Check login information
195
-		if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
195
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
196 196
 		$logged_info = Context::get('logged_info');
197 197
 
198
-		$document_srl = (int)Context::get('document_srl');
199
-		if(!$document_srl) return new Object(-1,'msg_invalid_request');
198
+		$document_srl = (int) Context::get('document_srl');
199
+		if (!$document_srl) return new Object(-1, 'msg_invalid_request');
200 200
 		// Variables
201 201
 		$oDocumentController = getController('document');
202 202
 		$oDocumentController->deleteDocument($document_srl, true);
@@ -211,37 +211,37 @@  discard block
 block discarded – undo
211 211
 	{
212 212
 		$name = Context::get('name');
213 213
 		$value = Context::get('value');
214
-		if(!$value) return;
214
+		if (!$value) return;
215 215
 
216 216
 		$oMemberModel = getModel('member');
217 217
 		// Check if logged-in
218 218
 		$logged_info = Context::get('logged_info');
219 219
 
220 220
 
221
-		switch($name)
221
+		switch ($name)
222 222
 		{
223 223
 			case 'user_id' :
224 224
 				// Check denied ID
225
-				if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id');
225
+				if ($oMemberModel->isDeniedID($value)) return new Object(0, 'denied_user_id');
226 226
 				// Check if duplicated
227 227
 				$member_srl = $oMemberModel->getMemberSrlByUserID($value);
228
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_user_id');
228
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_user_id');
229 229
 				break;
230 230
 			case 'nick_name' :
231 231
 				// Check denied ID
232
-				if($oMemberModel->isDeniedNickName($value))
232
+				if ($oMemberModel->isDeniedNickName($value))
233 233
 				{
234
-					return new Object(0,'denied_nick_name');
234
+					return new Object(0, 'denied_nick_name');
235 235
 				}
236 236
 				// Check if duplicated
237 237
 				$member_srl = $oMemberModel->getMemberSrlByNickName($value);
238
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name');
238
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_nick_name');
239 239
 
240 240
 				break;
241 241
 			case 'email_address' :
242 242
 				// Check if duplicated
243 243
 				$member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
244
-				if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address');
244
+				if ($member_srl && $logged_info->member_srl != $member_srl) return new Object(0, 'msg_exists_email_address');
245 245
 				break;
246 246
 		}
247 247
 	}
@@ -253,25 +253,25 @@  discard block
 block discarded – undo
253 253
 	 */
254 254
 	function procMemberInsert()
255 255
 	{
256
-		if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request");
257
-		$oMemberModel = &getModel ('member');
256
+		if (Context::getRequestMethod() == "GET") return new Object(-1, "msg_invalid_request");
257
+		$oMemberModel = &getModel('member');
258 258
 		$config = $oMemberModel->getMemberConfig();
259 259
 
260 260
 		// call a trigger (before)
261
-		$trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config);
262
-		if(!$trigger_output->toBool ()) return $trigger_output;
261
+		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'before', $config);
262
+		if (!$trigger_output->toBool()) return $trigger_output;
263 263
 		// Check if an administrator allows a membership
264
-		if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled');
264
+		if ($config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
265 265
 		// Check if the user accept the license terms (only if terms exist)
266
-		if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
266
+		if ($config->agreement && Context::get('accept_agreement') != 'Y') return $this->stop('msg_accept_agreement');
267 267
 
268 268
 		// Extract the necessary information in advance
269 269
 		$getVars = array();
270
-		if($config->signupForm)
270
+		if ($config->signupForm)
271 271
 		{
272
-			foreach($config->signupForm as $formInfo)
272
+			foreach ($config->signupForm as $formInfo)
273 273
 			{
274
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
274
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
275 275
 				{
276 276
 					$getVars[] = $formInfo->name;
277 277
 				}
@@ -279,22 +279,22 @@  discard block
 block discarded – undo
279 279
 		}
280 280
 
281 281
 		$args = new stdClass;
282
-		foreach($getVars as $val)
282
+		foreach ($getVars as $val)
283 283
 		{
284 284
 			$args->{$val} = Context::get($val);
285
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
285
+			if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
286 286
 		}
287 287
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
288
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
288
+		if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
289 289
 
290 290
 		$args->find_account_answer = Context::get('find_account_answer');
291 291
 		$args->allow_mailing = Context::get('allow_mailing');
292 292
 		$args->allow_message = Context::get('allow_message');
293 293
 
294
-		if($args->password1) $args->password = $args->password1;
294
+		if ($args->password1) $args->password = $args->password1;
295 295
 
296 296
 		// check password strength
297
-		if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
297
+		if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
298 298
 		{
299 299
 			$message = Context::getLang('about_password_strength');
300 300
 			return new Object(-1, $message[$config->password_strength]);
@@ -320,58 +320,58 @@  discard block
 block discarded – undo
320 320
 		unset($all_args->secret_text);
321 321
 
322 322
 		// Set the user state as "denied" when using mail authentication
323
-		if($config->enable_confirm == 'Y') $args->denied = 'Y';
323
+		if ($config->enable_confirm == 'Y') $args->denied = 'Y';
324 324
 		// Add extra vars after excluding necessary information from all the requested arguments
325 325
 		$extra_vars = delObjectVars($all_args, $args);
326 326
 		$args->extra_vars = serialize($extra_vars);
327 327
 
328 328
 		// remove whitespace
329 329
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
330
-		foreach($checkInfos as $val)
330
+		foreach ($checkInfos as $val)
331 331
 		{
332
-			if(isset($args->{$val}))
332
+			if (isset($args->{$val}))
333 333
 			{
334 334
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
335 335
 			}
336 336
 		}
337 337
 		$output = $this->insertMember($args);
338
-		if(!$output->toBool()) return $output;
338
+		if (!$output->toBool()) return $output;
339 339
 
340 340
 		// insert ProfileImage, ImageName, ImageMark
341 341
 		$profile_image = $_FILES['profile_image'];
342
-		if(is_uploaded_file($profile_image['tmp_name']))
342
+		if (is_uploaded_file($profile_image['tmp_name']))
343 343
 		{
344 344
 			$this->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
345 345
 		}
346 346
 
347 347
 		$image_mark = $_FILES['image_mark'];
348
-		if(is_uploaded_file($image_mark['tmp_name']))
348
+		if (is_uploaded_file($image_mark['tmp_name']))
349 349
 		{
350 350
 			$this->insertImageMark($args->member_srl, $image_mark['tmp_name']);
351 351
 		}
352 352
 
353 353
 		$image_name = $_FILES['image_name'];
354
-		if(is_uploaded_file($image_name['tmp_name']))
354
+		if (is_uploaded_file($image_name['tmp_name']))
355 355
 		{
356 356
 			$this->insertImageName($args->member_srl, $image_name['tmp_name']);
357 357
 		}
358 358
 
359 359
 		// If a virtual site, join the site
360 360
 		$site_module_info = Context::get('site_module_info');
361
-		if($site_module_info->site_srl > 0)
361
+		if ($site_module_info->site_srl > 0)
362 362
 		{
363 363
 			$columnList = array('site_srl', 'group_srl');
364 364
 			$default_group = $oMemberModel->getDefaultGroup($site_module_info->site_srl, $columnList);
365
-			if($default_group->group_srl)
365
+			if ($default_group->group_srl)
366 366
 			{
367 367
 				$this->addMemberToGroup($args->member_srl, $default_group->group_srl, $site_module_info->site_srl);
368 368
 			}
369 369
 
370 370
 		}
371 371
 		// Log-in
372
-		if($config->enable_confirm != 'Y')
372
+		if ($config->enable_confirm != 'Y')
373 373
 		{
374
-			if($config->identifier == 'email_address')
374
+			if ($config->identifier == 'email_address')
375 375
 			{
376 376
 				$output = $this->doLogin($args->email_address);
377 377
 			}
@@ -379,8 +379,8 @@  discard block
 block discarded – undo
379 379
 			{
380 380
 				$output = $this->doLogin($args->user_id);
381 381
 			}
382
-			if(!$output->toBool()) {
383
-				if($output->error == -9)
382
+			if (!$output->toBool()) {
383
+				if ($output->error == -9)
384 384
 					$output->error = -11;
385 385
 				return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output);
386 386
 			}
@@ -388,8 +388,8 @@  discard block
 block discarded – undo
388 388
 
389 389
 		// Results
390 390
 		$this->add('member_srl', $args->member_srl);
391
-		if($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
392
-		if($config->enable_confirm == 'Y')
391
+		if ($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
392
+		if ($config->enable_confirm == 'Y')
393 393
 		{
394 394
 			$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
395 395
 			$this->setMessage($msg);
@@ -398,19 +398,19 @@  discard block
 block discarded – undo
398 398
 		else $this->setMessage('success_registed');
399 399
 		// Call a trigger (after)
400 400
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
401
-		if(!$trigger_output->toBool()) return $trigger_output;
401
+		if (!$trigger_output->toBool()) return $trigger_output;
402 402
 
403
-		if($config->redirect_url)
403
+		if ($config->redirect_url)
404 404
 		{
405 405
 			$returnUrl = $config->redirect_url;
406 406
 		}
407 407
 		else
408 408
 		{
409
-			if(Context::get('success_return_url'))
409
+			if (Context::get('success_return_url'))
410 410
 			{
411 411
 				$returnUrl = Context::get('success_return_url');
412 412
 			}
413
-			else if($_COOKIE['XE_REDIRECT_URL'])
413
+			else if ($_COOKIE['XE_REDIRECT_URL'])
414 414
 			{
415 415
 				$returnUrl = $_COOKIE['XE_REDIRECT_URL'];
416 416
 				setcookie("XE_REDIRECT_URL", '', 1);
@@ -424,26 +424,26 @@  discard block
 block discarded – undo
424 424
 
425 425
 	function procMemberModifyInfoBefore()
426 426
 	{
427
-		if($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD')
427
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_PASSWORD')
428 428
 		{
429 429
 			return $this->stop('msg_invalid_request');
430 430
 		}
431 431
 
432
-		if(!Context::get('is_logged'))
432
+		if (!Context::get('is_logged'))
433 433
 		{
434 434
 			return $this->stop('msg_not_logged');
435 435
 		}
436 436
 
437 437
 		$password = Context::get('password');
438 438
 
439
-		if(!$password)
439
+		if (!$password)
440 440
 		{
441 441
 			return $this->stop('msg_invalid_request');
442 442
 		}
443 443
 
444 444
 		$oMemberModel = getModel('member');
445 445
 
446
-		if(!$this->memberInfo->password)
446
+		if (!$this->memberInfo->password)
447 447
 		{
448 448
 			// Get information of logged-in user
449 449
 			$logged_info = Context::get('logged_info');
@@ -454,14 +454,14 @@  discard block
 block discarded – undo
454 454
 			$this->memberInfo->password = $memberInfo->password;
455 455
 		}
456 456
 		// Verify the current password
457
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
457
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
458 458
 		{
459 459
 			return new Object(-1, 'invalid_password');
460 460
 		}
461 461
 
462 462
 		$_SESSION['rechecked_password_step'] = 'VALIDATE_PASSWORD';
463 463
 
464
-		if(Context::get('success_return_url'))
464
+		if (Context::get('success_return_url'))
465 465
 		{
466 466
 			$redirectUrl = Context::get('success_return_url');
467 467
 		}
@@ -479,26 +479,26 @@  discard block
 block discarded – undo
479 479
 	 */
480 480
 	function procMemberModifyInfo()
481 481
 	{
482
-		if(!Context::get('is_logged'))
482
+		if (!Context::get('is_logged'))
483 483
 		{
484 484
 			return $this->stop('msg_not_logged');
485 485
 		}
486 486
 
487
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
487
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
488 488
 		{
489 489
 			return $this->stop('msg_invalid_request');
490 490
 		}
491 491
 		unset($_SESSION['rechecked_password_step']);
492 492
 
493 493
 		// Extract the necessary information in advance
494
-		$oMemberModel = &getModel ('member');
495
-		$config = $oMemberModel->getMemberConfig ();
496
-		$getVars = array('find_account_answer','allow_mailing','allow_message');
497
-		if($config->signupForm)
494
+		$oMemberModel = &getModel('member');
495
+		$config = $oMemberModel->getMemberConfig();
496
+		$getVars = array('find_account_answer', 'allow_mailing', 'allow_message');
497
+		if ($config->signupForm)
498 498
 		{
499
-			foreach($config->signupForm as $formInfo)
499
+			foreach ($config->signupForm as $formInfo)
500 500
 			{
501
-				if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
501
+				if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
502 502
 				{
503 503
 					$getVars[] = $formInfo->name;
504 504
 				}
@@ -506,16 +506,16 @@  discard block
 block discarded – undo
506 506
 		}
507 507
 
508 508
 		$args = new stdClass;
509
-		foreach($getVars as $val)
509
+		foreach ($getVars as $val)
510 510
 		{
511 511
 			$args->{$val} = Context::get($val);
512
-			if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
512
+			if ($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui');
513 513
 		}
514 514
 		// Login Information
515 515
 		$logged_info = Context::get('logged_info');
516 516
 		$args->member_srl = $logged_info->member_srl;
517 517
 		$args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
518
-		if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
518
+		if (!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>'')));
519 519
 		// Remove some unnecessary variables from all the vars
520 520
 		$all_args = Context::getRequestVars();
521 521
 		unset($all_args->module);
@@ -539,9 +539,9 @@  discard block
 block discarded – undo
539 539
 
540 540
 		// remove whitespace
541 541
 		$checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address');
542
-		foreach($checkInfos as $val)
542
+		foreach ($checkInfos as $val)
543 543
 		{
544
-			if(isset($args->{$val}))
544
+			if (isset($args->{$val}))
545 545
 			{
546 546
 				$args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val});
547 547
 			}
@@ -549,22 +549,22 @@  discard block
 block discarded – undo
549 549
 
550 550
 		// Execute insert or update depending on the value of member_srl
551 551
 		$output = $this->updateMember($args);
552
-		if(!$output->toBool()) return $output;
552
+		if (!$output->toBool()) return $output;
553 553
 
554 554
 		$profile_image = $_FILES['profile_image'];
555
-		if(is_uploaded_file($profile_image['tmp_name']))
555
+		if (is_uploaded_file($profile_image['tmp_name']))
556 556
 		{
557 557
 			$this->insertProfileImage($args->member_srl, $profile_image['tmp_name']);
558 558
 		}
559 559
 
560 560
 		$image_mark = $_FILES['image_mark'];
561
-		if(is_uploaded_file($image_mark['tmp_name']))
561
+		if (is_uploaded_file($image_mark['tmp_name']))
562 562
 		{
563 563
 			$this->insertImageMark($args->member_srl, $image_mark['tmp_name']);
564 564
 		}
565 565
 
566 566
 		$image_name = $_FILES['image_name'];
567
-		if(is_uploaded_file($image_name['tmp_name']))
567
+		if (is_uploaded_file($image_name['tmp_name']))
568 568
 		{
569 569
 			$this->insertImageName($args->member_srl, $image_name['tmp_name']);
570 570
 		}
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 
580 580
 		// Call a trigger after successfully log-in (after)
581 581
 		$trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo);
582
-		if(!$trigger_output->toBool()) return $trigger_output;
582
+		if (!$trigger_output->toBool()) return $trigger_output;
583 583
 
584 584
 		$this->setSessionInfo();
585 585
 		// Return result
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
 	 */
601 601
 	function procMemberModifyPassword()
602 602
 	{
603
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
603
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
604 604
 		// Extract the necessary information in advance
605 605
 		$current_password = trim(Context::get('current_password'));
606 606
 		$password = trim(Context::get('password1'));
@@ -614,17 +614,17 @@  discard block
 block discarded – undo
614 614
 
615 615
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
616 616
 		// Verify the cuttent password
617
-		if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
617
+		if (!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password');
618 618
 
619 619
 		// Check if a new password is as same as the previous password
620
-		if($current_password == $password) return new Object(-1, 'invalid_new_password');
620
+		if ($current_password == $password) return new Object(-1, 'invalid_new_password');
621 621
 
622 622
 		// Execute insert or update depending on the value of member_srl
623 623
 		$args = new stdClass;
624 624
 		$args->member_srl = $member_srl;
625 625
 		$args->password = $password;
626 626
 		$output = $this->updateMemberPassword($args);
627
-		if(!$output->toBool()) return $output;
627
+		if (!$output->toBool()) return $output;
628 628
 
629 629
 		$this->add('member_srl', $args->member_srl);
630 630
 		$this->setMessage('success_updated');
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 	 */
641 641
 	function procMemberLeave()
642 642
 	{
643
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
643
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
644 644
 		// Extract the necessary information in advance
645 645
 		$password = trim(Context::get('password'));
646 646
 		// Get information of logged-in user
@@ -649,17 +649,17 @@  discard block
 block discarded – undo
649 649
 		// Create a member model object
650 650
 		$oMemberModel = getModel('member');
651 651
 		// Get information of member_srl
652
-		if(!$this->memberInfo->password)
652
+		if (!$this->memberInfo->password)
653 653
 		{
654 654
 			$columnList = array('member_srl', 'password');
655 655
 			$memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
656 656
 			$this->memberInfo->password = $memberInfo->password;
657 657
 		}
658 658
 		// Verify the cuttent password
659
-		if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
659
+		if (!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password');
660 660
 
661 661
 		$output = $this->deleteMember($member_srl);
662
-		if(!$output->toBool()) return $output;
662
+		if (!$output->toBool()) return $output;
663 663
 		// Destroy all session information
664 664
 		$this->destroySessionInfo();
665 665
 		// Return success message
@@ -678,17 +678,17 @@  discard block
 block discarded – undo
678 678
 	{
679 679
 		// Check if the file is successfully uploaded
680 680
 		$file = $_FILES['profile_image'];
681
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
681
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
682 682
 		// Ignore if member_srl is invalid or doesn't exist.
683 683
 		$member_srl = Context::get('member_srl');
684
-		if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
684
+		if (!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
685 685
 
686 686
 		$logged_info = Context::get('logged_info');
687
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
687
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
688 688
 		// Return if member module is set not to use an image name or the user is not an administrator ;
689 689
 		$oModuleModel = getModel('module');
690 690
 		$config = $oModuleModel->getModuleConfig('member');
691
-		if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
691
+		if ($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
692 692
 
693 693
 		$this->insertProfileImage($member_srl, $file['tmp_name']);
694 694
 		// Page refresh
@@ -710,25 +710,25 @@  discard block
 block discarded – undo
710 710
 	{
711 711
 
712 712
 		// Check uploaded file
713
-		if(!checkUploadedFile($target_file)) return;
713
+		if (!checkUploadedFile($target_file)) return;
714 714
 
715 715
 		$oMemberModel = getModel('member');
716 716
 		$config = $oMemberModel->getMemberConfig();
717 717
 
718 718
 		// Get an image size
719 719
 		$max_width = $config->profile_image_max_width;
720
-		if(!$max_width) $max_width = "90";
720
+		if (!$max_width) $max_width = "90";
721 721
 		$max_height = $config->profile_image_max_height;
722
-		if(!$max_height) $max_height = "90";
722
+		if (!$max_height) $max_height = "90";
723 723
 		// Get a target path to save
724 724
 		$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
725 725
 		FileHandler::makeDir($target_path);
726 726
 
727 727
 		// Get file information
728 728
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
729
-		if(IMAGETYPE_PNG == $type) $ext = 'png';
730
-		elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg';
731
-		elseif(IMAGETYPE_GIF == $type) $ext = 'gif';
729
+		if (IMAGETYPE_PNG == $type) $ext = 'png';
730
+		elseif (IMAGETYPE_JPEG == $type) $ext = 'jpg';
731
+		elseif (IMAGETYPE_GIF == $type) $ext = 'gif';
732 732
 		else
733 733
 		{
734 734
 			return;
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 
739 739
 		$target_filename = sprintf('%s%d.%s', $target_path, $member_srl, $ext);
740 740
 		// Convert if the image size is larger than a given size or if the format is not a gif
741
-		if(($width > $max_width || $height > $max_height ) && $type != 1)
741
+		if (($width > $max_width || $height > $max_height) && $type != 1)
742 742
 		{
743 743
 			FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
744 744
 		}
@@ -757,17 +757,17 @@  discard block
 block discarded – undo
757 757
 	{
758 758
 		// Check if the file is successfully uploaded
759 759
 		$file = $_FILES['image_name'];
760
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
760
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
761 761
 		// Ignore if member_srl is invalid or doesn't exist.
762 762
 		$member_srl = Context::get('member_srl');
763
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
763
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_name');
764 764
 
765 765
 		$logged_info = Context::get('logged_info');
766
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
766
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
767 767
 		// Return if member module is set not to use an image name or the user is not an administrator ;
768 768
 		$oModuleModel = getModel('module');
769 769
 		$config = $oModuleModel->getModuleConfig('member');
770
-		if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
770
+		if ($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
771 771
 
772 772
 		$this->insertImageName($member_srl, $file['tmp_name']);
773 773
 		// Page refresh
@@ -788,15 +788,15 @@  discard block
 block discarded – undo
788 788
 	function insertImageName($member_srl, $target_file)
789 789
 	{
790 790
 		// Check uploaded file
791
-		if(!checkUploadedFile($target_file)) return;
791
+		if (!checkUploadedFile($target_file)) return;
792 792
 
793 793
 		$oModuleModel = getModel('module');
794 794
 		$config = $oModuleModel->getModuleConfig('member');
795 795
 		// Get an image size
796 796
 		$max_width = $config->image_name_max_width;
797
-		if(!$max_width) $max_width = "90";
797
+		if (!$max_width) $max_width = "90";
798 798
 		$max_height = $config->image_name_max_height;
799
-		if(!$max_height) $max_height = "20";
799
+		if (!$max_height) $max_height = "20";
800 800
 		// Get a target path to save
801 801
 		$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
802 802
 		FileHandler::makeDir($target_path);
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
 		// Get file information
806 806
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
807 807
 		// Convert if the image size is larger than a given size or if the format is not a gif
808
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
808
+		if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
809 809
 		else @copy($target_file, $target_filename);
810 810
 	}
811 811
 
@@ -817,20 +817,20 @@  discard block
 block discarded – undo
817 817
 	function procMemberDeleteProfileImage($_memberSrl = 0)
818 818
 	{
819 819
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
820
-		if(!$member_srl)
820
+		if (!$member_srl)
821 821
 		{
822
-			return new Object(0,'success');
822
+			return new Object(0, 'success');
823 823
 		}
824 824
 
825 825
 		$logged_info = Context::get('logged_info');
826 826
 
827
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
827
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
828 828
 		{
829 829
 			$oMemberModel = getModel('member');
830 830
 			$profile_image = $oMemberModel->getProfileImage($member_srl);
831 831
 			FileHandler::removeFile($profile_image->file);
832 832
 		}
833
-		return new Object(0,'success');
833
+		return new Object(0, 'success');
834 834
 	}
835 835
 
836 836
 	/**
@@ -841,20 +841,20 @@  discard block
 block discarded – undo
841 841
 	function procMemberDeleteImageName($_memberSrl = 0)
842 842
 	{
843 843
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
844
-		if(!$member_srl)
844
+		if (!$member_srl)
845 845
 		{
846
-			return new Object(0,'success');
846
+			return new Object(0, 'success');
847 847
 		}
848 848
 
849 849
 		$logged_info = Context::get('logged_info');
850 850
 
851
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
851
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
852 852
 		{
853 853
 			$oMemberModel = getModel('member');
854 854
 			$image_name = $oMemberModel->getImageName($member_srl);
855 855
 			FileHandler::removeFile($image_name->file);
856 856
 		}
857
-		return new Object(0,'success');
857
+		return new Object(0, 'success');
858 858
 	}
859 859
 
860 860
 	/**
@@ -866,17 +866,17 @@  discard block
 block discarded – undo
866 866
 	{
867 867
 		// Check if the file is successfully uploaded
868 868
 		$file = $_FILES['image_mark'];
869
-		if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
869
+		if (!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
870 870
 		// Ignore if member_srl is invalid or doesn't exist.
871 871
 		$member_srl = Context::get('member_srl');
872
-		if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
872
+		if (!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
873 873
 
874 874
 		$logged_info = Context::get('logged_info');
875
-		if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
875
+		if ($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
876 876
 		// Membership in the images mark the module using the ban was set by an administrator or return;
877 877
 		$oModuleModel = getModel('module');
878 878
 		$config = $oModuleModel->getModuleConfig('member');
879
-		if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
879
+		if ($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
880 880
 
881 881
 		$this->insertImageMark($member_srl, $file['tmp_name']);
882 882
 		// Page refresh
@@ -897,15 +897,15 @@  discard block
 block discarded – undo
897 897
 	function insertImageMark($member_srl, $target_file)
898 898
 	{
899 899
 		// Check uploaded file
900
-		if(!checkUploadedFile($target_file)) return;
900
+		if (!checkUploadedFile($target_file)) return;
901 901
 
902 902
 		$oModuleModel = getModel('module');
903 903
 		$config = $oModuleModel->getModuleConfig('member');
904 904
 		// Get an image size
905 905
 		$max_width = $config->image_mark_max_width;
906
-		if(!$max_width) $max_width = "20";
906
+		if (!$max_width) $max_width = "20";
907 907
 		$max_height = $config->image_mark_max_height;
908
-		if(!$max_height) $max_height = "20";
908
+		if (!$max_height) $max_height = "20";
909 909
 
910 910
 		$target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl));
911 911
 		FileHandler::makeDir($target_path);
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
 		// Get file information
915 915
 		list($width, $height, $type, $attrs) = @getimagesize($target_file);
916 916
 
917
-		if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
917
+		if ($width > $max_width || $height > $max_height || $type != 1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
918 918
 		else @copy($target_file, $target_filename);
919 919
 	}
920 920
 
@@ -926,20 +926,20 @@  discard block
 block discarded – undo
926 926
 	function procMemberDeleteImageMark($_memberSrl = 0)
927 927
 	{
928 928
 		$member_srl = ($_memberSrl) ? $_memberSrl : Context::get('member_srl');
929
-		if(!$member_srl)
929
+		if (!$member_srl)
930 930
 		{
931
-			return new Object(0,'success');
931
+			return new Object(0, 'success');
932 932
 		}
933 933
 
934 934
 		$logged_info = Context::get('logged_info');
935 935
 
936
-		if($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
936
+		if ($logged_info && ($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl))
937 937
 		{
938 938
 			$oMemberModel = getModel('member');
939 939
 			$image_mark = $oMemberModel->getImageMark($member_srl);
940 940
 			FileHandler::removeFile($image_mark->file);
941 941
 		}
942
-		return new Object(0,'success');
942
+		return new Object(0, 'success');
943 943
 	}
944 944
 
945 945
 	/**
@@ -950,26 +950,26 @@  discard block
 block discarded – undo
950 950
 	function procMemberFindAccount()
951 951
 	{
952 952
 		$email_address = Context::get('email_address');
953
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
953
+		if (!$email_address) return new Object(-1, 'msg_invalid_request');
954 954
 
955 955
 		$oMemberModel = getModel('member');
956 956
 		$oModuleModel = getModel('module');
957 957
 
958 958
 		// Check if a member having the same email address exists
959 959
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
960
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
960
+		if (!$member_srl) return new Object(-1, 'msg_email_not_exists');
961 961
 
962 962
 		// Get information of the member
963 963
 		$columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name');
964 964
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
965 965
 
966 966
 		// Check if possible to find member's ID and password
967
-		if($member_info->denied == 'Y')
967
+		if ($member_info->denied == 'Y')
968 968
 		{
969 969
 			$chk_args = new stdClass;
970 970
 			$chk_args->member_srl = $member_info->member_srl;
971 971
 			$output = executeQuery('member.chkAuthMail', $chk_args);
972
-			if($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
972
+			if ($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
973 973
 		}
974 974
 
975 975
 		// Insert data into the authentication DB
@@ -982,19 +982,19 @@  discard block
 block discarded – undo
982 982
 		$args->is_register = 'N';
983 983
 
984 984
 		$output = executeQuery('member.insertAuthMail', $args);
985
-		if(!$output->toBool()) return $output;
985
+		if (!$output->toBool()) return $output;
986 986
 		// Get content of the email to send a member
987 987
 		Context::set('auth_args', $args);
988 988
 
989 989
 		$member_config = $oModuleModel->getModuleConfig('member');
990 990
 		$memberInfo = array();
991 991
 		global $lang;
992
-		if(is_array($member_config->signupForm))
992
+		if (is_array($member_config->signupForm))
993 993
 		{
994
-			$exceptForm=array('password', 'find_account_question');
995
-			foreach($member_config->signupForm as $form)
994
+			$exceptForm = array('password', 'find_account_question');
995
+			foreach ($member_config->signupForm as $form)
996 996
 			{
997
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
997
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
998 998
 				{
999 999
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1000 1000
 				}
@@ -1009,15 +1009,15 @@  discard block
 block discarded – undo
1009 1009
 		}
1010 1010
 		Context::set('memberInfo', $memberInfo);
1011 1011
 
1012
-		if(!$member_config->skin) $member_config->skin = "default";
1013
-		if(!$member_config->colorset) $member_config->colorset = "white";
1012
+		if (!$member_config->skin) $member_config->skin = "default";
1013
+		if (!$member_config->colorset) $member_config->colorset = "white";
1014 1014
 
1015 1015
 		Context::set('member_config', $member_config);
1016 1016
 
1017 1017
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1018
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1018
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1019 1019
 
1020
-		$find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1020
+		$find_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key);
1021 1021
 		Context::set('find_url', $find_url);
1022 1022
 
1023 1023
 		$oTemplate = &TemplateHandler::getInstance();
@@ -1027,19 +1027,19 @@  discard block
 block discarded – undo
1027 1027
 		$member_config = $oModuleModel->getModuleConfig('member');
1028 1028
 		// Send a mail
1029 1029
 		$oMail = new Mail();
1030
-		$oMail->setTitle( Context::getLang('msg_find_account_title') );
1030
+		$oMail->setTitle(Context::getLang('msg_find_account_title'));
1031 1031
 		$oMail->setContent($content);
1032
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1033
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1032
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1033
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1034 1034
 		$oMail->send();
1035 1035
 		// Return message
1036 1036
 		$msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address);
1037
-		if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
1037
+		if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON')))
1038 1038
 		{
1039 1039
 			$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberFindAccount');
1040 1040
 			$this->setRedirectUrl($returnUrl);
1041 1041
 		}
1042
-		return new Object(0,$msg);
1042
+		return new Object(0, $msg);
1043 1043
 	}
1044 1044
 
1045 1045
 	/**
@@ -1057,28 +1057,28 @@  discard block
 block discarded – undo
1057 1057
 		$find_account_question = trim(Context::get('find_account_question'));
1058 1058
 		$find_account_answer = trim(Context::get('find_account_answer'));
1059 1059
 
1060
-		if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1060
+		if (($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request');
1061 1061
 
1062 1062
 		$oModuleModel = getModel('module');
1063 1063
 		// Check if a member having the same email address exists
1064 1064
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1065
-		if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
1065
+		if (!$member_srl) return new Object(-1, 'msg_email_not_exists');
1066 1066
 		// Get information of the member
1067 1067
 		$columnList = array('member_srl', 'find_account_question', 'find_account_answer');
1068 1068
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1069 1069
 
1070 1070
 		// Display a message if no answer is entered
1071
-		if(!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1071
+		if (!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
1072 1072
 
1073
-		if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) return new Object(-1, 'msg_answer_not_matches');
1073
+		if (trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) return new Object(-1, 'msg_answer_not_matches');
1074 1074
 
1075
-		if($config->identifier == 'email_address')
1075
+		if ($config->identifier == 'email_address')
1076 1076
 		{
1077 1077
 			$user_id = $email_address;
1078 1078
 		}
1079 1079
 
1080 1080
 		// Update to a temporary password and set change_password_date to 1
1081
-		$oPassword =  new Password();
1081
+		$oPassword = new Password();
1082 1082
 		$temp_password = $oPassword->createTemporaryPassword(8);
1083 1083
 
1084 1084
 		$args = new stdClass();
@@ -1086,11 +1086,11 @@  discard block
 block discarded – undo
1086 1086
 		$args->password = $temp_password;
1087 1087
 		$args->change_password_date = '1';
1088 1088
 		$output = $this->updateMemberPassword($args);
1089
-		if(!$output->toBool()) return $output;
1089
+		if (!$output->toBool()) return $output;
1090 1090
 
1091
-		$_SESSION['xe_temp_password_' . $user_id] = $temp_password;
1091
+		$_SESSION['xe_temp_password_'.$user_id] = $temp_password;
1092 1092
 
1093
-		$this->add('user_id',$user_id);
1093
+		$this->add('user_id', $user_id);
1094 1094
 
1095 1095
 		$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
1096 1096
 		$this->setRedirectUrl($returnUrl.'&user_id='.$user_id);
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
 		$member_srl = Context::get('member_srl');
1111 1111
 		$auth_key = Context::get('auth_key');
1112 1112
 
1113
-		if(!$member_srl || !$auth_key)
1113
+		if (!$member_srl || !$auth_key)
1114 1114
 		{
1115 1115
 			return $this->stop('msg_invalid_request');
1116 1116
 		}
@@ -1121,9 +1121,9 @@  discard block
 block discarded – undo
1121 1121
 		$args->auth_key = $auth_key;
1122 1122
 		$output = executeQuery('member.getAuthMail', $args);
1123 1123
 
1124
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
1124
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
1125 1125
 		{
1126
-			if(strlen($output->data->auth_key) !== strlen($auth_key))
1126
+			if (strlen($output->data->auth_key) !== strlen($auth_key))
1127 1127
 			{
1128 1128
 				executeQuery('member.deleteAuthMail', $args);
1129 1129
 			}
@@ -1131,7 +1131,7 @@  discard block
 block discarded – undo
1131 1131
 			return $this->stop('msg_invalid_auth_key');
1132 1132
 		}
1133 1133
 
1134
-		if(ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1134
+		if (ztime($output->data->regdate) < $_SERVER['REQUEST_TIME'] + zgap() - 86400)
1135 1135
 		{
1136 1136
 			executeQuery('member.deleteAuthMail', $args);
1137 1137
 			return $this->stop('msg_invalid_auth_key');
@@ -1140,7 +1140,7 @@  discard block
 block discarded – undo
1140 1140
 		$args->password = $output->data->new_password;
1141 1141
 
1142 1142
 		// If credentials are correct, change the password to a new one
1143
-		if($output->data->is_register == 'Y')
1143
+		if ($output->data->is_register == 'Y')
1144 1144
 		{
1145 1145
 			$args->denied = 'N';
1146 1146
 		}
@@ -1153,13 +1153,13 @@  discard block
 block discarded – undo
1153 1153
 		$is_register = $output->data->is_register;
1154 1154
 
1155 1155
 		$output = executeQuery('member.updateMemberPassword', $args);
1156
-		if(!$output->toBool())
1156
+		if (!$output->toBool())
1157 1157
 		{
1158 1158
 			return $this->stop($output->getMessage());
1159 1159
 		}
1160 1160
 
1161 1161
 		// Remove all values having the member_srl from authentication table
1162
-		executeQuery('member.deleteAuthMail',$args);
1162
+		executeQuery('member.deleteAuthMail', $args);
1163 1163
 
1164 1164
 		$this->_clearMemberCache($args->member_srl);
1165 1165
 
@@ -1178,33 +1178,33 @@  discard block
 block discarded – undo
1178 1178
 	{
1179 1179
 		// Get an email_address
1180 1180
 		$email_address = Context::get('email_address');
1181
-		if(!$email_address) return new Object(-1, 'msg_invalid_request');
1181
+		if (!$email_address) return new Object(-1, 'msg_invalid_request');
1182 1182
 		// Log test by using email_address
1183 1183
 		$oMemberModel = getModel('member');
1184 1184
 
1185 1185
 		$args = new stdClass;
1186 1186
 		$args->email_address = $email_address;
1187 1187
 		$memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1188
-		if(!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1188
+		if (!$memberSrl) return new Object(-1, 'msg_not_exists_member');
1189 1189
 
1190 1190
 		$columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address');
1191 1191
 		$member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1192 1192
 
1193 1193
 		$oModuleModel = getModel('module');
1194 1194
 		$member_config = $oModuleModel->getModuleConfig('member');
1195
-		if(!$member_config->skin) $member_config->skin = "default";
1196
-		if(!$member_config->colorset) $member_config->colorset = "white";
1195
+		if (!$member_config->skin) $member_config->skin = "default";
1196
+		if (!$member_config->colorset) $member_config->colorset = "white";
1197 1197
 
1198 1198
 		// Check if a authentication mail has been sent previously
1199 1199
 		$chk_args = new stdClass;
1200 1200
 		$chk_args->member_srl = $member_info->member_srl;
1201 1201
 		$output = executeQuery('member.chkAuthMail', $chk_args);
1202
-		if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1202
+		if ($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
1203 1203
 
1204 1204
 		$auth_args = new stdClass;
1205 1205
 		$auth_args->member_srl = $member_info->member_srl;
1206 1206
 		$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
1207
-		if(!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1207
+		if (!$output->data || !$output->data[0]->auth_key)  return new Object(-1, 'msg_invalid_request');
1208 1208
 		$auth_info = $output->data[0];
1209 1209
 
1210 1210
 		// Update the regdate of authmail entry
@@ -1215,12 +1215,12 @@  discard block
 block discarded – undo
1215 1215
 
1216 1216
 		$memberInfo = array();
1217 1217
 		global $lang;
1218
-		if(is_array($member_config->signupForm))
1218
+		if (is_array($member_config->signupForm))
1219 1219
 		{
1220
-			$exceptForm=array('password', 'find_account_question');
1221
-			foreach($member_config->signupForm as $form)
1220
+			$exceptForm = array('password', 'find_account_question');
1221
+			foreach ($member_config->signupForm as $form)
1222 1222
 			{
1223
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1223
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1224 1224
 				{
1225 1225
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1226 1226
 				}
@@ -1239,19 +1239,19 @@  discard block
 block discarded – undo
1239 1239
 		Context::set('member_config', $member_config);
1240 1240
 
1241 1241
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1242
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1242
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1243 1243
 
1244
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key);
1244
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_info->auth_key);
1245 1245
 		Context::set('auth_url', $auth_url);
1246 1246
 
1247 1247
 		$oTemplate = &TemplateHandler::getInstance();
1248 1248
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1249 1249
 		// Send a mail
1250 1250
 		$oMail = new Mail();
1251
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1251
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1252 1252
 		$oMail->setContent($content);
1253
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1254
-		$oMail->setReceiptor( $args->user_name, $args->email_address );
1253
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1254
+		$oMail->setReceiptor($args->user_name, $args->email_address);
1255 1255
 		$oMail->send();
1256 1256
 
1257 1257
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address);
@@ -1266,23 +1266,23 @@  discard block
 block discarded – undo
1266 1266
 		$memberInfo = $_SESSION['auth_member_info'];
1267 1267
 		unset($_SESSION['auth_member_info']);
1268 1268
 
1269
-		if(!$memberInfo)
1269
+		if (!$memberInfo)
1270 1270
 		{
1271 1271
 			return $this->stop('msg_invalid_request');
1272 1272
 		}
1273 1273
 
1274 1274
 		$newEmail = Context::get('email_address');
1275 1275
 
1276
-		if(!$newEmail)
1276
+		if (!$newEmail)
1277 1277
 		{
1278 1278
 			return $this->stop('msg_invalid_request');
1279 1279
 		}
1280 1280
 
1281 1281
 		$oMemberModel = getModel('member');
1282 1282
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
1283
-		if($member_srl)
1283
+		if ($member_srl)
1284 1284
 		{
1285
-			return new Object(-1,'msg_exists_email_address');
1285
+			return new Object(-1, 'msg_exists_email_address');
1286 1286
 		}
1287 1287
 
1288 1288
 		// remove all key by member_srl
@@ -1290,7 +1290,7 @@  discard block
 block discarded – undo
1290 1290
 		$args->member_srl = $memberInfo->member_srl;
1291 1291
 		$output = executeQuery('member.deleteAuthMail', $args);
1292 1292
 
1293
-		if(!$output->toBool())
1293
+		if (!$output->toBool())
1294 1294
 		{
1295 1295
 			return $output;
1296 1296
 		}
@@ -1300,7 +1300,7 @@  discard block
 block discarded – undo
1300 1300
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
1301 1301
 
1302 1302
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
1303
-		if(!$output->toBool())
1303
+		if (!$output->toBool())
1304 1304
 		{
1305 1305
 			return $this->stop($output->getMessage());
1306 1306
 		}
@@ -1317,7 +1317,7 @@  discard block
 block discarded – undo
1317 1317
 		$auth_args->is_register = 'Y';
1318 1318
 
1319 1319
 		$output = executeQuery('member.insertAuthMail', $auth_args);
1320
-		if(!$output->toBool()) return $output;
1320
+		if (!$output->toBool()) return $output;
1321 1321
 
1322 1322
 		$memberInfo->email_address = $newEmail;
1323 1323
 
@@ -1341,12 +1341,12 @@  discard block
 block discarded – undo
1341 1341
 		$memberInfo = array();
1342 1342
 
1343 1343
 		global $lang;
1344
-		if(is_array($member_config->signupForm))
1344
+		if (is_array($member_config->signupForm))
1345 1345
 		{
1346
-			$exceptForm=array('password', 'find_account_question');
1347
-			foreach($member_config->signupForm as $form)
1346
+			$exceptForm = array('password', 'find_account_question');
1347
+			foreach ($member_config->signupForm as $form)
1348 1348
 			{
1349
-				if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1349
+				if (!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1350 1350
 				{
1351 1351
 					$memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1352 1352
 				}
@@ -1361,25 +1361,25 @@  discard block
 block discarded – undo
1361 1361
 		}
1362 1362
 		Context::set('memberInfo', $memberInfo);
1363 1363
 
1364
-		if(!$member_config->skin) $member_config->skin = "default";
1365
-		if(!$member_config->colorset) $member_config->colorset = "white";
1364
+		if (!$member_config->skin) $member_config->skin = "default";
1365
+		if (!$member_config->colorset) $member_config->colorset = "white";
1366 1366
 
1367 1367
 		Context::set('member_config', $member_config);
1368 1368
 
1369 1369
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
1370
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1370
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
1371 1371
 
1372
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
1372
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
1373 1373
 		Context::set('auth_url', $auth_url);
1374 1374
 
1375 1375
 		$oTemplate = &TemplateHandler::getInstance();
1376 1376
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
1377 1377
 		// Send a mail
1378 1378
 		$oMail = new Mail();
1379
-		$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
1379
+		$oMail->setTitle(Context::getLang('msg_confirm_account_title'));
1380 1380
 		$oMail->setContent($content);
1381
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
1382
-		$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1381
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
1382
+		$oMail->setReceiptor($member_info->user_name, $member_info->email_address);
1383 1383
 		$oMail->send();
1384 1384
 	}
1385 1385
 
@@ -1392,7 +1392,7 @@  discard block
 block discarded – undo
1392 1392
 	{
1393 1393
 		$site_module_info = Context::get('site_module_info');
1394 1394
 		$logged_info = Context::get('logged_info');
1395
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1395
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new Object(-1, 'msg_invalid_request');
1396 1396
 
1397 1397
 		$oMemberModel = getModel('member');
1398 1398
 		$columnList = array('site_srl', 'group_srl', 'title');
@@ -1411,13 +1411,13 @@  discard block
 block discarded – undo
1411 1411
 	{
1412 1412
 		$site_module_info = Context::get('site_module_info');
1413 1413
 		$logged_info = Context::get('logged_info');
1414
-		if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request');
1414
+		if (!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list)) return new Object(-1, 'msg_invalid_request');
1415 1415
 
1416 1416
 		$args = new stdClass;
1417
-		$args->site_srl= $site_module_info->site_srl;
1417
+		$args->site_srl = $site_module_info->site_srl;
1418 1418
 		$args->member_srl = $logged_info->member_srl;
1419 1419
 		$output = executeQuery('member.deleteMembersGroup', $args);
1420
-		if(!$output->toBool()) return $output;
1420
+		if (!$output->toBool()) return $output;
1421 1421
 		$this->setMessage('success_deleted');
1422 1422
 		$this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
1423 1423
 	}
@@ -1431,25 +1431,25 @@  discard block
 block discarded – undo
1431 1431
 	 */
1432 1432
 	function setMemberConfig($args)
1433 1433
 	{
1434
-		if(!$args->skin) $args->skin = "default";
1435
-		if(!$args->colorset) $args->colorset = "white";
1436
-		if(!$args->editor_skin) $args->editor_skin= "ckeditor";
1437
-		if(!$args->editor_colorset) $args->editor_colorset = "moono";
1438
-		if($args->enable_join!='Y') $args->enable_join = 'N';
1439
-		$args->enable_openid= 'N';
1440
-		if($args->profile_image !='Y') $args->profile_image = 'N';
1441
-		if($args->image_name!='Y') $args->image_name = 'N';
1442
-		if($args->image_mark!='Y') $args->image_mark = 'N';
1443
-		if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
1444
-		if(!trim(strip_tags($args->agreement))) $args->agreement = null;
1445
-		$args->limit_day = (int)$args->limit_day;
1434
+		if (!$args->skin) $args->skin = "default";
1435
+		if (!$args->colorset) $args->colorset = "white";
1436
+		if (!$args->editor_skin) $args->editor_skin = "ckeditor";
1437
+		if (!$args->editor_colorset) $args->editor_colorset = "moono";
1438
+		if ($args->enable_join != 'Y') $args->enable_join = 'N';
1439
+		$args->enable_openid = 'N';
1440
+		if ($args->profile_image != 'Y') $args->profile_image = 'N';
1441
+		if ($args->image_name != 'Y') $args->image_name = 'N';
1442
+		if ($args->image_mark != 'Y') $args->image_mark = 'N';
1443
+		if ($args->group_image_mark != 'Y') $args->group_image_mark = 'N';
1444
+		if (!trim(strip_tags($args->agreement))) $args->agreement = null;
1445
+		$args->limit_day = (int) $args->limit_day;
1446 1446
 
1447 1447
 		$agreement = trim($args->agreement);
1448 1448
 		unset($args->agreement);
1449 1449
 
1450 1450
 		$oModuleController = getController('module');
1451
-		$output = $oModuleController->insertModuleConfig('member',$args);
1452
-		if(!$output->toBool()) return $output;
1451
+		$output = $oModuleController->insertModuleConfig('member', $args);
1452
+		if (!$output->toBool()) return $output;
1453 1453
 
1454 1454
 		$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
1455 1455
 		FileHandler::writeFile($agreement_file, $agreement);
@@ -1470,11 +1470,11 @@  discard block
 block discarded – undo
1470 1470
 		$signature = trim(removeHackTag($signature));
1471 1471
 		$signature = preg_replace('/<(\/?)(embed|object|param)/is', '&lt;$1$2', $signature);
1472 1472
 
1473
-		$check_signature = trim(str_replace(array('&nbsp;',"\n","\r"),'',strip_tags($signature,'<img><object>')));
1473
+		$check_signature = trim(str_replace(array('&nbsp;', "\n", "\r"), '', strip_tags($signature, '<img><object>')));
1474 1474
 		$path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl));
1475 1475
 		$filename = sprintf('%s%d.signature.php', $path, $member_srl);
1476 1476
 
1477
-		if(!$check_signature) return FileHandler::removeFile($filename);
1477
+		if (!$check_signature) return FileHandler::removeFile($filename);
1478 1478
 
1479 1479
 		$buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature);
1480 1480
 		FileHandler::makeDir($path);
@@ -1503,15 +1503,15 @@  discard block
 block discarded – undo
1503 1503
 	 *
1504 1504
 	 * @return Object
1505 1505
 	 */
1506
-	function addMemberToGroup($member_srl, $group_srl, $site_srl=0)
1506
+	function addMemberToGroup($member_srl, $group_srl, $site_srl = 0)
1507 1507
 	{
1508 1508
 		$args = new stdClass();
1509 1509
 		$args->member_srl = $member_srl;
1510 1510
 		$args->group_srl = $group_srl;
1511
-		if($site_srl) $args->site_srl = $site_srl;
1511
+		if ($site_srl) $args->site_srl = $site_srl;
1512 1512
 
1513 1513
 		// Add
1514
-		$output = executeQuery('member.addMemberToGroup',$args);
1514
+		$output = executeQuery('member.addMemberToGroup', $args);
1515 1515
 		$output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args);
1516 1516
 
1517 1517
 		$this->_clearMemberCache($member_srl, $site_srl);
@@ -1531,18 +1531,18 @@  discard block
 block discarded – undo
1531 1531
 	{
1532 1532
 		$obj = new stdClass;
1533 1533
 		$obj->site_srl = $args->site_srl;
1534
-		$obj->member_srl = implode(',',$args->member_srl);
1534
+		$obj->member_srl = implode(',', $args->member_srl);
1535 1535
 
1536 1536
 		$output = executeQueryArray('member.getMembersGroup', $obj);
1537
-		if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1537
+		if ($output->data) foreach ($output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1538 1538
 
1539 1539
 		$output = executeQuery('member.deleteMembersGroup', $obj);
1540
-		if(!$output->toBool()) return $output;
1540
+		if (!$output->toBool()) return $output;
1541 1541
 
1542 1542
 		$inserted_members = array();
1543
-		foreach($args->member_srl as $key => $val)
1543
+		foreach ($args->member_srl as $key => $val)
1544 1544
 		{
1545
-			if($inserted_members[$val]) continue;
1545
+			if ($inserted_members[$val]) continue;
1546 1546
 			$inserted_members[$val] = true;
1547 1547
 
1548 1548
 			unset($obj);
@@ -1552,7 +1552,7 @@  discard block
 block discarded – undo
1552 1552
 			$obj->site_srl = $args->site_srl;
1553 1553
 			$obj->regdate = $date[$obj->member_srl];
1554 1554
 			$output = executeQuery('member.addMemberToGroup', $obj);
1555
-			if(!$output->toBool()) return $output;
1555
+			if (!$output->toBool()) return $output;
1556 1556
 
1557 1557
 			$this->_clearMemberCache($obj->member_srl, $args->site_srl);
1558 1558
 		}
@@ -1574,9 +1574,9 @@  discard block
 block discarded – undo
1574 1574
 		// Get information of the key
1575 1575
 		$output = executeQuery('member.getAutologin', $args);
1576 1576
 		// If no information exists, delete a cookie
1577
-		if(!$output->toBool() || !$output->data)
1577
+		if (!$output->toBool() || !$output->data)
1578 1578
 		{
1579
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/');
1579
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365, '/');
1580 1580
 			return;
1581 1581
 		}
1582 1582
 
@@ -1586,9 +1586,9 @@  discard block
 block discarded – undo
1586 1586
 		$user_id = ($config->identifier == 'user_id') ? $output->data->user_id : $output->data->email_address;
1587 1587
 		$password = $output->data->password;
1588 1588
 
1589
-		if(!$user_id || !$password)
1589
+		if (!$user_id || !$password)
1590 1590
 		{
1591
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/');
1591
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365, '/');
1592 1592
 			return;
1593 1593
 		}
1594 1594
 
@@ -1598,7 +1598,7 @@  discard block
 block discarded – undo
1598 1598
 		$check_key = strtolower($user_id).$password.$_SERVER['HTTP_USER_AGENT'];
1599 1599
 		$check_key = substr(hash_hmac('sha256', $check_key, substr($args->autologin_key, 0, 32)), 0, 32);
1600 1600
 
1601
-		if($check_key === substr($args->autologin_key, 32))
1601
+		if ($check_key === substr($args->autologin_key, 32))
1602 1602
 		{
1603 1603
 			// Check change_password_date
1604 1604
 			$oModuleModel = getModel('module');
@@ -1606,12 +1606,12 @@  discard block
 block discarded – undo
1606 1606
 			$limit_date = $member_config->change_password_date;
1607 1607
 
1608 1608
 			// Check if change_password_date is set
1609
-			if($limit_date > 0)
1609
+			if ($limit_date > 0)
1610 1610
 			{
1611 1611
 				$oMemberModel = getModel('member');
1612 1612
 				$columnList = array('member_srl', 'change_password_date');
1613 1613
 
1614
-				if($config->identifier == 'user_id')
1614
+				if ($config->identifier == 'user_id')
1615 1615
 				{
1616 1616
 					$member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1617 1617
 				}
@@ -1620,7 +1620,7 @@  discard block
 block discarded – undo
1620 1620
 					$member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1621 1621
 				}
1622 1622
 
1623
-				if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){
1623
+				if ($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day'))) {
1624 1624
 					$do_auto_login = true;
1625 1625
 				}
1626 1626
 
@@ -1631,14 +1631,14 @@  discard block
 block discarded – undo
1631 1631
 			}
1632 1632
 		}
1633 1633
 
1634
-		if($do_auto_login)
1634
+		if ($do_auto_login)
1635 1635
 		{
1636 1636
 			$output = $this->doLogin($user_id);
1637 1637
 		}
1638 1638
 		else
1639 1639
 		{
1640 1640
 			executeQuery('member.deleteAutologin', $args);
1641
-			setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/');
1641
+			setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365, '/');
1642 1642
 		}
1643 1643
 	}
1644 1644
 
@@ -1654,13 +1654,13 @@  discard block
 block discarded – undo
1654 1654
 	function doLogin($user_id, $password = '', $keep_signed = false)
1655 1655
 	{
1656 1656
 		$user_id = strtolower($user_id);
1657
-		if(!$user_id) return new Object(-1, 'null_user_id');
1657
+		if (!$user_id) return new Object(-1, 'null_user_id');
1658 1658
 		// Call a trigger before log-in (before)
1659 1659
 		$trigger_obj = new stdClass();
1660 1660
 		$trigger_obj->user_id = $user_id;
1661 1661
 		$trigger_obj->password = $password;
1662 1662
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
1663
-		if(!$trigger_output->toBool()) return $trigger_output;
1663
+		if (!$trigger_output->toBool()) return $trigger_output;
1664 1664
 		// Create a member model object
1665 1665
 		$oMemberModel = getModel('member');
1666 1666
 
@@ -1670,12 +1670,12 @@  discard block
 block discarded – undo
1670 1670
 		$args->ipaddress = $_SERVER['REMOTE_ADDR'];
1671 1671
 
1672 1672
 		// check identifier
1673
-		if($config->identifier == 'email_address')
1673
+		if ($config->identifier == 'email_address')
1674 1674
 		{
1675 1675
 			// Get user_id information
1676 1676
 			$this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1677 1677
 			// Set an invalid user if no value returned
1678
-			if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1678
+			if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address');
1679 1679
 
1680 1680
 		}
1681 1681
 		else
@@ -1683,24 +1683,24 @@  discard block
 block discarded – undo
1683 1683
 			// Get user_id information
1684 1684
 			$this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1685 1685
 			// Set an invalid user if no value returned
1686
-			if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1686
+			if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id');
1687 1687
 		}
1688 1688
 
1689 1689
 		$output = executeQuery('member.getLoginCountByIp', $args);
1690 1690
 		$errorCount = $output->data->count;
1691
-		if($errorCount >= $config->max_error_count)
1691
+		if ($errorCount >= $config->max_error_count)
1692 1692
 		{
1693 1693
 			$last_update = strtotime($output->data->last_update);
1694
-			$term = intval($_SERVER['REQUEST_TIME']-$last_update);
1695
-			if($term < $config->max_error_count_time)
1694
+			$term = intval($_SERVER['REQUEST_TIME'] - $last_update);
1695
+			if ($term < $config->max_error_count_time)
1696 1696
 			{
1697 1697
 				$term = $config->max_error_count_time - $term;
1698
-				if($term < 60) $term = intval($term).Context::getLang('unit_sec');
1699
-				elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min');
1700
-				elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour');
1701
-				else $term = intval($term/86400).Context::getLang('unit_day');
1698
+				if ($term < 60) $term = intval($term).Context::getLang('unit_sec');
1699
+				elseif (60 <= $term && $term < 3600) $term = intval($term / 60).Context::getLang('unit_min');
1700
+				elseif (3600 <= $term && $term < 86400) $term = intval($term / 3600).Context::getLang('unit_hour');
1701
+				else $term = intval($term / 86400).Context::getLang('unit_day');
1702 1702
 
1703
-				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term));
1703
+				return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'), $term));
1704 1704
 			}
1705 1705
 			else
1706 1706
 			{
@@ -1710,13 +1710,13 @@  discard block
 block discarded – undo
1710 1710
 		}
1711 1711
 
1712 1712
 		// Password Check
1713
-		if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1713
+		if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1714 1714
 		{
1715
-			return $this->recordMemberLoginError(-1, 'invalid_password',$this->memberInfo);
1715
+			return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo);
1716 1716
 		}
1717 1717
 
1718 1718
 		// If denied == 'Y', notify
1719
-		if($this->memberInfo->denied == 'Y')
1719
+		if ($this->memberInfo->denied == 'Y')
1720 1720
 		{
1721 1721
 			$args->member_srl = $this->memberInfo->member_srl;
1722 1722
 			$output = executeQuery('member.chkAuthMail', $args);
@@ -1724,12 +1724,12 @@  discard block
 block discarded – undo
1724 1724
 			{
1725 1725
 				$_SESSION['auth_member_srl'] = $this->memberInfo->member_srl;
1726 1726
 				$redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail');
1727
-				return $this->setRedirectUrl($redirectUrl, new Object(-1,'msg_user_not_confirmed'));
1727
+				return $this->setRedirectUrl($redirectUrl, new Object(-1, 'msg_user_not_confirmed'));
1728 1728
 			}
1729
-			return new Object(-1,'msg_user_denied');
1729
+			return new Object(-1, 'msg_user_denied');
1730 1730
 		}
1731 1731
 		// Notify if denied_date is less than the current time
1732
-		if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d")));
1732
+		if ($this->memberInfo->limit_date && substr($this->memberInfo->limit_date, 0, 8) >= date("Ymd")) return new Object(-9, sprintf(Context::getLang('msg_user_limited'), zdate($this->memberInfo->limit_date, "Y-m-d")));
1733 1733
 		// Update the latest login time
1734 1734
 		$args->member_srl = $this->memberInfo->member_srl;
1735 1735
 		$output = executeQuery('member.updateLastLogin', $args);
@@ -1739,36 +1739,36 @@  discard block
 block discarded – undo
1739 1739
 
1740 1740
 		// Check if there is recoding table.
1741 1741
 		$oDB = &DB::getInstance();
1742
-		if($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1742
+		if ($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N')
1743 1743
 		{
1744 1744
 			// check if there is login fail records.
1745 1745
 			$output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args);
1746
-			if($output->data && $output->data->content)
1746
+			if ($output->data && $output->data->content)
1747 1747
 			{
1748 1748
 				$title = Context::getLang('login_fail_report');
1749 1749
 				$message = '<ul>';
1750 1750
 				$content = unserialize($output->data->content);
1751
-				if(count($content) > $config->max_error_count)
1751
+				if (count($content) > $config->max_error_count)
1752 1752
 				{
1753
-					foreach($content as $val)
1753
+					foreach ($content as $val)
1754 1754
 					{
1755
-						$message .= '<li>'.Context::getLang('regdate').': '.date('Y-m-d h:i:sa',$val[2]).'<ul><li>'.Context::getLang('ipaddress').': '.$val[0].'</li><li>'.Context::getLang('message').': '.$val[1].'</li></ul></li>';
1755
+						$message .= '<li>'.Context::getLang('regdate').': '.date('Y-m-d h:i:sa', $val[2]).'<ul><li>'.Context::getLang('ipaddress').': '.$val[0].'</li><li>'.Context::getLang('message').': '.$val[1].'</li></ul></li>';
1756 1756
 					}
1757 1757
 					$message .= '</ul>';
1758
-					$content = sprintf(Context::getLang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa'));
1758
+					$content = sprintf(Context::getLang('login_fail_report_contents'), $message, date('Y-m-d h:i:sa'));
1759 1759
 
1760 1760
 					//send message
1761 1761
 					$oCommunicationController = getController('communication');
1762 1762
 					$oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true);
1763 1763
 
1764
-					if($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1764
+					if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y')
1765 1765
 					{
1766 1766
 						$view_url = Context::getRequestUri();
1767
-						$content = sprintf("%s<hr /><p>From: <a href=\"%s\" target=\"_blank\">%s</a><br />To: %s(%s)</p>",$content, $view_url, $view_url, $this->memberInfo->nick_name, $this->memberInfo->email_id);
1767
+						$content = sprintf("%s<hr /><p>From: <a href=\"%s\" target=\"_blank\">%s</a><br />To: %s(%s)</p>", $content, $view_url, $view_url, $this->memberInfo->nick_name, $this->memberInfo->email_id);
1768 1768
 						$oMail = new Mail();
1769 1769
 						$oMail->setTitle($title);
1770 1770
 						$oMail->setContent($content);
1771
-						$oMail->setSender($config->webmaster_name?$config->webmaster_name:'webmaster', $config->webmaster_email);
1771
+						$oMail->setSender($config->webmaster_name ? $config->webmaster_name : 'webmaster', $config->webmaster_email);
1772 1772
 						$oMail->setReceiptor($this->memberInfo->email_id.'('.$this->memberInfo->nick_name.')', $this->memberInfo->email_address);
1773 1773
 						$oMail->send();
1774 1774
 					}
@@ -1778,9 +1778,9 @@  discard block
 block discarded – undo
1778 1778
 		}
1779 1779
 		// Call a trigger after successfully log-in (after)
1780 1780
 		$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
1781
-		if(!$trigger_output->toBool()) return $trigger_output;
1781
+		if (!$trigger_output->toBool()) return $trigger_output;
1782 1782
 		// When user checked to use auto-login
1783
-		if($keep_signed)
1783
+		if ($keep_signed)
1784 1784
 		{
1785 1785
 			// Key generate for auto login
1786 1786
 			$oPassword = new Password();
@@ -1792,12 +1792,12 @@  discard block
 block discarded – undo
1792 1792
 			$autologin_args->member_srl = $this->memberInfo->member_srl;
1793 1793
 			executeQuery('member.deleteAutologin', $autologin_args);
1794 1794
 			$autologin_output = executeQuery('member.insertAutologin', $autologin_args);
1795
-			if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000, '/');
1795
+			if ($autologin_output->toBool()) setCookie('xeak', $autologin_args->autologin_key, $_SERVER['REQUEST_TIME'] + 31536000, '/');
1796 1796
 		}
1797
-		if($this->memberInfo->is_admin == 'Y')
1797
+		if ($this->memberInfo->is_admin == 'Y')
1798 1798
 		{
1799 1799
 			$oMemberAdminModel = getAdminModel('member');
1800
-			if(!$oMemberAdminModel->getMemberAdminIPCheck())
1800
+			if (!$oMemberAdminModel->getMemberAdminIPCheck())
1801 1801
 			{
1802 1802
 				$_SESSION['denied_admin'] = 'Y';
1803 1803
 			}
@@ -1815,18 +1815,18 @@  discard block
 block discarded – undo
1815 1815
 	{
1816 1816
 		$oMemberModel = getModel('member');
1817 1817
 		// If your information came through the current session information to extract information from the users
1818
-		if(!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged() )
1818
+		if (!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged())
1819 1819
 		{
1820 1820
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']);
1821 1821
 			// If you do not destroy the session Profile
1822
-			if($this->memberInfo->member_srl != $_SESSION['member_srl'])
1822
+			if ($this->memberInfo->member_srl != $_SESSION['member_srl'])
1823 1823
 			{
1824 1824
 				$this->destroySessionInfo();
1825 1825
 				return;
1826 1826
 			}
1827 1827
 		}
1828 1828
 		// Stop using the session id is destroyed
1829
-		if($this->memberInfo->denied=='Y')
1829
+		if ($this->memberInfo->denied == 'Y')
1830 1830
 		{
1831 1831
 			$this->destroySessionInfo();
1832 1832
 			return;
@@ -1856,10 +1856,10 @@  discard block
 block discarded – undo
1856 1856
 		Context::set('logged_info', $this->memberInfo);
1857 1857
 
1858 1858
 		// Only the menu configuration of the user (such as an add-on to the menu can be changed)
1859
-		$this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info');
1860
-		$this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document');
1861
-		$this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document');
1862
-		$this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document');
1859
+		$this->addMemberMenu('dispMemberInfo', 'cmd_view_member_info');
1860
+		$this->addMemberMenu('dispMemberScrappedDocument', 'cmd_view_scrapped_document');
1861
+		$this->addMemberMenu('dispMemberSavedDocument', 'cmd_view_saved_document');
1862
+		$this->addMemberMenu('dispMemberOwnDocument', 'cmd_view_own_document');
1863 1863
 	}
1864 1864
 
1865 1865
 	/**
@@ -1881,7 +1881,7 @@  discard block
 block discarded – undo
1881 1881
 	function addMemberPopupMenu($url, $str, $icon = '', $target = 'self')
1882 1882
 	{
1883 1883
 		$member_popup_menu_list = Context::get('member_popup_menu_list');
1884
-		if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
1884
+		if (!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
1885 1885
 
1886 1886
 		$obj = new stdClass;
1887 1887
 		$obj->url = $url;
@@ -1900,33 +1900,33 @@  discard block
 block discarded – undo
1900 1900
 	{
1901 1901
 		// Call a trigger (before)
1902 1902
 		$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
1903
-		if(!$output->toBool()) return $output;
1903
+		if (!$output->toBool()) return $output;
1904 1904
 		// Terms and Conditions portion of the information set up by members reaffirmed
1905 1905
 		$oModuleModel = getModel('module');
1906 1906
 		$config = $oModuleModel->getModuleConfig('member');
1907 1907
 
1908 1908
 		$logged_info = Context::get('logged_info');
1909 1909
 		// If the date of the temporary restrictions limit further information on the date of
1910
-		if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24);
1910
+		if ($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME'] + $config->limit_day * 60 * 60 * 24);
1911 1911
 
1912 1912
 		$args->member_srl = getNextSequence();
1913 1913
 		$args->list_order = -1 * $args->member_srl;
1914 1914
 
1915 1915
 		// Execute insert or update depending on the value of member_srl
1916
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
1916
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
1917 1917
 		// Enter the user's identity changed to lowercase
1918 1918
 		else $args->user_id = strtolower($args->user_id);
1919
-		if(!$args->user_name) $args->user_name = $args->member_srl;
1920
-		if(!$args->nick_name) $args->nick_name = $args->member_srl;
1919
+		if (!$args->user_name) $args->user_name = $args->member_srl;
1920
+		if (!$args->nick_name) $args->nick_name = $args->member_srl;
1921 1921
 
1922 1922
 		// Control of essential parameters
1923
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
1924
-		if($args->denied!='Y') $args->denied = 'N';
1925
-		$args->allow_message= 'Y';
1923
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
1924
+		if ($args->denied != 'Y') $args->denied = 'N';
1925
+		$args->allow_message = 'Y';
1926 1926
 
1927
-		if($logged_info->is_admin == 'Y')
1927
+		if ($logged_info->is_admin == 'Y')
1928 1928
 		{
1929
-			if($args->is_admin!='Y') $args->is_admin = 'N';
1929
+			if ($args->is_admin != 'Y') $args->is_admin = 'N';
1930 1930
 		}
1931 1931
 		else
1932 1932
 		{
@@ -1941,88 +1941,88 @@  discard block
 block discarded – undo
1941 1941
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1942 1942
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1943 1943
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
1944
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
1945
-		if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
1944
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//i", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
1945
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//i", $args->blog)) $args->blog = 'http://'.$args->blog;
1946 1946
 
1947 1947
 		// Create a model object
1948 1948
 		$oMemberModel = getModel('member');
1949 1949
 
1950 1950
 		// Check password strength
1951
-		if($args->password && !$password_is_hashed)
1951
+		if ($args->password && !$password_is_hashed)
1952 1952
 		{
1953
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
1953
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
1954 1954
 			{
1955 1955
 				$message = Context::getLang('about_password_strength');
1956 1956
 				return new Object(-1, $message[$config->password_strength]);
1957 1957
 			}
1958 1958
 			$args->password = $oMemberModel->hashPassword($args->password);
1959 1959
 		}
1960
-		elseif(!$args->password)
1960
+		elseif (!$args->password)
1961 1961
 		{
1962 1962
 			unset($args->password);
1963 1963
 		}
1964 1964
 
1965 1965
 		// Check if ID is prohibited
1966
-		if($oMemberModel->isDeniedID($args->user_id))
1966
+		if ($oMemberModel->isDeniedID($args->user_id))
1967 1967
 		{
1968
-			return new Object(-1,'denied_user_id');
1968
+			return new Object(-1, 'denied_user_id');
1969 1969
 		}
1970 1970
 
1971 1971
 		// Check if ID is duplicate
1972 1972
 		$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
1973
-		if($member_srl)
1973
+		if ($member_srl)
1974 1974
 		{
1975
-			return new Object(-1,'msg_exists_user_id');
1975
+			return new Object(-1, 'msg_exists_user_id');
1976 1976
 		}
1977 1977
 
1978 1978
 		// Check if nickname is prohibited
1979
-		if($oMemberModel->isDeniedNickName($args->nick_name))
1979
+		if ($oMemberModel->isDeniedNickName($args->nick_name))
1980 1980
 		{
1981
-			return new Object(-1,'denied_nick_name');
1981
+			return new Object(-1, 'denied_nick_name');
1982 1982
 		}
1983 1983
 
1984 1984
 		// Check if nickname is duplicate
1985 1985
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
1986
-		if($member_srl)
1986
+		if ($member_srl)
1987 1987
 		{
1988
-			return new Object(-1,'msg_exists_nick_name');
1988
+			return new Object(-1, 'msg_exists_nick_name');
1989 1989
 		}
1990 1990
 
1991 1991
 		// Check if email address is duplicate
1992 1992
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
1993
-		if($member_srl)
1993
+		if ($member_srl)
1994 1994
 		{
1995
-			return new Object(-1,'msg_exists_email_address');
1995
+			return new Object(-1, 'msg_exists_email_address');
1996 1996
 		}
1997 1997
 
1998 1998
 		// Insert data into the DB
1999 1999
 		$args->list_order = -1 * $args->member_srl;
2000 2000
 
2001
-		if(!$args->user_id) $args->user_id = 't'.$args->member_srl;
2002
-		if(!$args->user_name) $args->user_name = $args->member_srl;
2001
+		if (!$args->user_id) $args->user_id = 't'.$args->member_srl;
2002
+		if (!$args->user_name) $args->user_name = $args->member_srl;
2003 2003
 
2004 2004
 		$oDB = &DB::getInstance();
2005 2005
 		$oDB->begin();
2006 2006
 
2007 2007
 		$output = executeQuery('member.insertMember', $args);
2008
-		if(!$output->toBool())
2008
+		if (!$output->toBool())
2009 2009
 		{
2010 2010
 			$oDB->rollback();
2011 2011
 			return $output;
2012 2012
 		}
2013 2013
 
2014
-		if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2014
+		if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2015 2015
 		else $group_srl_list = explode('|@|', $args->group_srl_list);
2016 2016
 		// If no value is entered the default group, the value of group registration
2017
-		if(!$args->group_srl_list)
2017
+		if (!$args->group_srl_list)
2018 2018
 		{
2019 2019
 			$columnList = array('site_srl', 'group_srl');
2020 2020
 			$default_group = $oMemberModel->getDefaultGroup(0, $columnList);
2021
-			if($default_group)
2021
+			if ($default_group)
2022 2022
 			{
2023 2023
 				// Add to the default group
2024
-				$output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl);
2025
-				if(!$output->toBool())
2024
+				$output = $this->addMemberToGroup($args->member_srl, $default_group->group_srl);
2025
+				if (!$output->toBool())
2026 2026
 				{
2027 2027
 					$oDB->rollback();
2028 2028
 					return $output;
@@ -2032,11 +2032,11 @@  discard block
 block discarded – undo
2032 2032
 		}
2033 2033
 		else
2034 2034
 		{
2035
-			for($i=0;$i<count($group_srl_list);$i++)
2035
+			for ($i = 0; $i < count($group_srl_list); $i++)
2036 2036
 			{
2037
-				$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2037
+				$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2038 2038
 
2039
-				if(!$output->toBool())
2039
+				if (!$output->toBool())
2040 2040
 				{
2041 2041
 					$oDB->rollback();
2042 2042
 					return $output;
@@ -2046,7 +2046,7 @@  discard block
 block discarded – undo
2046 2046
 
2047 2047
 		$member_config = $oModuleModel->getModuleConfig('member');
2048 2048
 		// When using email authentication mode (when you subscribed members denied a) certified mail sent
2049
-		if($args->denied == 'Y')
2049
+		if ($args->denied == 'Y')
2050 2050
 		{
2051 2051
 			// Insert data into the authentication DB
2052 2052
 			$oPassword = new Password();
@@ -2058,7 +2058,7 @@  discard block
 block discarded – undo
2058 2058
 			$auth_args->is_register = 'Y';
2059 2059
 
2060 2060
 			$output = executeQuery('member.insertAuthMail', $auth_args);
2061
-			if(!$output->toBool())
2061
+			if (!$output->toBool())
2062 2062
 			{
2063 2063
 				$oDB->rollback();
2064 2064
 				return $output;
@@ -2066,10 +2066,10 @@  discard block
 block discarded – undo
2066 2066
 			$this->_sendAuthMail($auth_args, $args);
2067 2067
 		}
2068 2068
 		// Call a trigger (after)
2069
-		if($output->toBool())
2069
+		if ($output->toBool())
2070 2070
 		{
2071 2071
 			$trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args);
2072
-			if(!$trigger_output->toBool())
2072
+			if (!$trigger_output->toBool())
2073 2073
 			{
2074 2074
 				$oDB->rollback();
2075 2075
 				return $trigger_output;
@@ -2091,41 +2091,41 @@  discard block
 block discarded – undo
2091 2091
 	{
2092 2092
 		// Call a trigger (before)
2093 2093
 		$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
2094
-		if(!$output->toBool()) return $output;
2094
+		if (!$output->toBool()) return $output;
2095 2095
 		// Create a model object
2096 2096
 		$oMemberModel = getModel('member');
2097 2097
 
2098 2098
 		$logged_info = Context::get('logged_info');
2099 2099
 		// Get what you want to modify the original information
2100
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2100
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2101 2101
 		// Control of essential parameters
2102
-		if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
2103
-		if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
2102
+		if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N';
2103
+		if ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F'))) $args->allow_message = 'Y';
2104 2104
 
2105
-		if($logged_info->is_admin == 'Y')
2105
+		if ($logged_info->is_admin == 'Y')
2106 2106
 		{
2107
-			if($args->denied!='Y') $args->denied = 'N';
2108
-			if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2107
+			if ($args->denied != 'Y') $args->denied = 'N';
2108
+			if ($args->is_admin != 'Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N';
2109 2109
 		}
2110 2110
 		else
2111 2111
 		{
2112 2112
 			unset($args->is_admin);
2113
-			if($is_admin == false)
2113
+			if ($is_admin == false)
2114 2114
 				unset($args->denied);
2115
-			if($logged_info->member_srl != $args->member_srl && $is_admin == false)
2115
+			if ($logged_info->member_srl != $args->member_srl && $is_admin == false)
2116 2116
 			{
2117 2117
 				return $this->stop('msg_invalid_request');
2118 2118
 			}
2119 2119
 		}
2120 2120
 
2121 2121
 		// Sanitize user ID, username, nickname, homepage, blog
2122
-		if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2122
+		if ($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2123 2123
 		$args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2124 2124
 		$args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2125 2125
 		$args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2126 2126
 		$args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
2127
-		if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
2128
-		if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
2127
+		if ($args->homepage && !preg_match("/^[a-z]+:\/\//is", $args->homepage)) $args->homepage = 'http://'.$args->homepage;
2128
+		if ($args->blog && !preg_match("/^[a-z]+:\/\//is", $args->blog)) $args->blog = 'http://'.$args->blog;
2129 2129
 
2130 2130
 		// check member identifier form
2131 2131
 		$config = $oMemberModel->getMemberConfig();
@@ -2134,56 +2134,56 @@  discard block
 block discarded – undo
2134 2134
 		$orgMemberInfo = $output->data;
2135 2135
 
2136 2136
 		// Check if email address or user ID is duplicate
2137
-		if($config->identifier == 'email_address')
2137
+		if ($config->identifier == 'email_address')
2138 2138
 		{
2139 2139
 			$member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address);
2140
-			if($member_srl && $args->member_srl != $member_srl)
2140
+			if ($member_srl && $args->member_srl != $member_srl)
2141 2141
 			{
2142
-				return new Object(-1,'msg_exists_email_address');
2142
+				return new Object(-1, 'msg_exists_email_address');
2143 2143
 			}
2144 2144
 			$args->email_address = $orgMemberInfo->email_address;
2145 2145
 		}
2146 2146
 		else
2147 2147
 		{
2148 2148
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2149
-			if($member_srl && $args->member_srl != $member_srl)
2149
+			if ($member_srl && $args->member_srl != $member_srl)
2150 2150
 			{
2151
-				return new Object(-1,'msg_exists_user_id');
2151
+				return new Object(-1, 'msg_exists_user_id');
2152 2152
 			}
2153 2153
 
2154 2154
 			$args->user_id = $orgMemberInfo->user_id;
2155 2155
 		}
2156 2156
 
2157
-		if($logged_info->is_admin !== 'Y')
2157
+		if ($logged_info->is_admin !== 'Y')
2158 2158
 		{
2159 2159
 			// Check if ID is prohibited
2160
-			if($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2160
+			if ($args->user_id && $oMemberModel->isDeniedID($args->user_id))
2161 2161
 			{
2162
-				return new Object(-1,'denied_user_id');
2162
+				return new Object(-1, 'denied_user_id');
2163 2163
 			}
2164 2164
 
2165 2165
 			// Check if nickname is prohibited
2166
-			if($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2166
+			if ($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name))
2167 2167
 			{
2168 2168
 				return new Object(-1, 'denied_nick_name');
2169 2169
 			}
2170 2170
 		}
2171 2171
 
2172 2172
 		// Check if ID is duplicate
2173
-		if($args->user_id)
2173
+		if ($args->user_id)
2174 2174
 		{
2175 2175
 			$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
2176
-			if($member_srl && $args->member_srl != $member_srl)
2176
+			if ($member_srl && $args->member_srl != $member_srl)
2177 2177
 			{
2178
-				return new Object(-1,'msg_exists_user_id');
2178
+				return new Object(-1, 'msg_exists_user_id');
2179 2179
 			}
2180 2180
 		}
2181 2181
 
2182 2182
 		// Check if nickname is duplicate
2183 2183
 		$member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name);
2184
- 		if($member_srl && $args->member_srl != $member_srl)
2184
+ 		if ($member_srl && $args->member_srl != $member_srl)
2185 2185
  		{
2186
- 			return new Object(-1,'msg_exists_nick_name');
2186
+ 			return new Object(-1, 'msg_exists_nick_name');
2187 2187
  		}
2188 2188
 
2189 2189
 		list($args->email_id, $args->email_host) = explode('@', $args->email_address);
@@ -2192,9 +2192,9 @@  discard block
 block discarded – undo
2192 2192
 		$oDB->begin();
2193 2193
 
2194 2194
 		// Check password strength
2195
-		if($args->password)
2195
+		if ($args->password)
2196 2196
 		{
2197
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2197
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2198 2198
 			{
2199 2199
 				$message = Context::getLang('about_password_strength');
2200 2200
 				return new Object(-1, $message[$config->password_strength]);
@@ -2206,40 +2206,40 @@  discard block
 block discarded – undo
2206 2206
 			$args->password = $orgMemberInfo->password;
2207 2207
 		}
2208 2208
 		
2209
-		if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2210
-		if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2211
-		if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2212
-		if(!$args->description) $args->description = '';
2213
-		if(!$args->birthday) $args->birthday = '';
2209
+		if (!$args->user_name) $args->user_name = $orgMemberInfo->user_name;
2210
+		if (!$args->user_id) $args->user_id = $orgMemberInfo->user_id;
2211
+		if (!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name;
2212
+		if (!$args->description) $args->description = '';
2213
+		if (!$args->birthday) $args->birthday = '';
2214 2214
 
2215 2215
 		$output = executeQuery('member.updateMember', $args);
2216 2216
 
2217
-		if(!$output->toBool())
2217
+		if (!$output->toBool())
2218 2218
 		{
2219 2219
 			$oDB->rollback();
2220 2220
 			return $output;
2221 2221
 		}
2222 2222
 
2223
-		if($args->group_srl_list)
2223
+		if ($args->group_srl_list)
2224 2224
 		{
2225
-			if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2225
+			if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list;
2226 2226
 			else $group_srl_list = explode('|@|', $args->group_srl_list);
2227 2227
 			// If the group information, group information changes
2228
-			if(count($group_srl_list) > 0)
2228
+			if (count($group_srl_list) > 0)
2229 2229
 			{
2230 2230
 				$args->site_srl = 0;
2231 2231
 				// One of its members to delete all the group
2232 2232
 				$output = executeQuery('member.deleteMemberGroupMember', $args);
2233
-				if(!$output->toBool())
2233
+				if (!$output->toBool())
2234 2234
 				{
2235 2235
 					$oDB->rollback();
2236 2236
 					return $output;
2237 2237
 				}
2238 2238
 				// Enter one of the loop a
2239
-				for($i=0;$i<count($group_srl_list);$i++)
2239
+				for ($i = 0; $i < count($group_srl_list); $i++)
2240 2240
 				{
2241
-					$output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]);
2242
-					if(!$output->toBool())
2241
+					$output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]);
2242
+					if (!$output->toBool())
2243 2243
 					{
2244 2244
 						$oDB->rollback();
2245 2245
 						return $output;
@@ -2251,9 +2251,9 @@  discard block
 block discarded – undo
2251 2251
 			}
2252 2252
 		}
2253 2253
 		// Call a trigger (after)
2254
-		if($output->toBool()) {
2254
+		if ($output->toBool()) {
2255 2255
 			$trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args);
2256
-			if(!$trigger_output->toBool())
2256
+			if (!$trigger_output->toBool())
2257 2257
 			{
2258 2258
 				$oDB->rollback();
2259 2259
 				return $trigger_output;
@@ -2266,7 +2266,7 @@  discard block
 block discarded – undo
2266 2266
 		$this->_clearMemberCache($args->member_srl, $args->site_srl);
2267 2267
 
2268 2268
 		// Save Session
2269
-		if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2269
+		if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
2270 2270
 		$logged_info = Context::get('logged_info');
2271 2271
 
2272 2272
 		$output->add('member_srl', $args->member_srl);
@@ -2278,14 +2278,14 @@  discard block
 block discarded – undo
2278 2278
 	 */
2279 2279
 	function updateMemberPassword($args)
2280 2280
 	{
2281
-		if($args->password)
2281
+		if ($args->password)
2282 2282
 		{
2283 2283
 
2284 2284
 			// check password strength
2285 2285
 			$oMemberModel = getModel('member');
2286 2286
 			$config = $oMemberModel->getMemberConfig();
2287 2287
 
2288
-			if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2288
+			if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength))
2289 2289
 			{
2290 2290
 				$message = Context::getLang('about_password_strength');
2291 2291
 				return new Object(-1, $message[$config->password_strength]);
@@ -2293,13 +2293,13 @@  discard block
 block discarded – undo
2293 2293
 
2294 2294
 			$args->password = $oMemberModel->hashPassword($args->password);
2295 2295
 		}
2296
-		else if($args->hashed_password)
2296
+		else if ($args->hashed_password)
2297 2297
 		{
2298 2298
 			$args->password = $args->hashed_password;
2299 2299
 		}
2300 2300
 
2301 2301
 		$output = executeQuery('member.updateMemberPassword', $args);
2302
-		if($output->toBool())
2302
+		if ($output->toBool())
2303 2303
 		{
2304 2304
 			$result = executeQuery('member.updateChangePasswordDate', $args);
2305 2305
 		}
@@ -2318,18 +2318,18 @@  discard block
 block discarded – undo
2318 2318
 		$trigger_obj = new stdClass();
2319 2319
 		$trigger_obj->member_srl = $member_srl;
2320 2320
 		$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
2321
-		if(!$output->toBool()) return $output;
2321
+		if (!$output->toBool()) return $output;
2322 2322
 		// Create a model object
2323 2323
 		$oMemberModel = getModel('member');
2324 2324
 		// Bringing the user's information
2325
-		if(!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2325
+		if (!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2326 2326
 		{
2327 2327
 			$columnList = array('member_srl', 'is_admin');
2328 2328
 			$this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2329 2329
 		}
2330
-		if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2330
+		if (!$this->memberInfo) return new Object(-1, 'msg_not_exists_member');
2331 2331
 		// If managers can not be deleted
2332
-		if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2332
+		if ($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
2333 2333
 
2334 2334
 		$oDB = &DB::getInstance();
2335 2335
 		$oDB->begin();
@@ -2338,7 +2338,7 @@  discard block
 block discarded – undo
2338 2338
 		$args->member_srl = $member_srl;
2339 2339
 		// Delete the entries in member_auth_mail
2340 2340
 		$output = executeQuery('member.deleteAuthMail', $args);
2341
-		if(!$output->toBool())
2341
+		if (!$output->toBool())
2342 2342
 		{
2343 2343
 			$oDB->rollback();
2344 2344
 			return $output;
@@ -2353,23 +2353,23 @@  discard block
 block discarded – undo
2353 2353
 		 */
2354 2354
 		// Delete the entries in member_group_member
2355 2355
 		$output = executeQuery('member.deleteMemberGroupMember', $args);
2356
-		if(!$output->toBool())
2356
+		if (!$output->toBool())
2357 2357
 		{
2358 2358
 			$oDB->rollback();
2359 2359
 			return $output;
2360 2360
 		}
2361 2361
 		// member removed from the table
2362 2362
 		$output = executeQuery('member.deleteMember', $args);
2363
-		if(!$output->toBool())
2363
+		if (!$output->toBool())
2364 2364
 		{
2365 2365
 			$oDB->rollback();
2366 2366
 			return $output;
2367 2367
 		}
2368 2368
 		// Call a trigger (after)
2369
-		if($output->toBool())
2369
+		if ($output->toBool())
2370 2370
 		{
2371 2371
 			$trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj);
2372
-			if(!$trigger_output->toBool())
2372
+			if (!$trigger_output->toBool())
2373 2373
 			{
2374 2374
 				$oDB->rollback();
2375 2375
 				return $trigger_output;
@@ -2393,23 +2393,23 @@  discard block
 block discarded – undo
2393 2393
 	 */
2394 2394
 	function destroySessionInfo()
2395 2395
 	{
2396
-		if(!$_SESSION || !is_array($_SESSION)) return;
2396
+		if (!$_SESSION || !is_array($_SESSION)) return;
2397 2397
 
2398 2398
 		$memberInfo = Context::get('logged_info');
2399 2399
 		$memberSrl = $memberInfo->member_srl;
2400 2400
 
2401
-		foreach($_SESSION as $key => $val)
2401
+		foreach ($_SESSION as $key => $val)
2402 2402
 		{
2403 2403
 			$_SESSION[$key] = '';
2404 2404
 		}
2405 2405
 
2406 2406
 		session_destroy();
2407
-		setcookie(session_name(), '', $_SERVER['REQUEST_TIME']-42000, '/');
2408
-		setcookie('sso','',$_SERVER['REQUEST_TIME']-42000, '/');
2409
-		setcookie('xeak','',$_SERVER['REQUEST_TIME']-42000, '/');
2407
+		setcookie(session_name(), '', $_SERVER['REQUEST_TIME'] - 42000, '/');
2408
+		setcookie('sso', '', $_SERVER['REQUEST_TIME'] - 42000, '/');
2409
+		setcookie('xeak', '', $_SERVER['REQUEST_TIME'] - 42000, '/');
2410 2410
 		setcookie('xe_logged', 'false', $_SERVER['REQUEST_TIME'] - 42000, '/');
2411 2411
 
2412
-		if($memberSrl || $_COOKIE['xeak'])
2412
+		if ($memberSrl || $_COOKIE['xeak'])
2413 2413
 		{
2414 2414
 			$args = new stdClass();
2415 2415
 			$args->member_srl = $memberSrl;
@@ -2425,22 +2425,22 @@  discard block
 block discarded – undo
2425 2425
 		$pointGroup = $pointModuleConfig->point_group;
2426 2426
 
2427 2427
 		$levelGroup = array();
2428
-		if(is_array($pointGroup) && count($pointGroup)>0)
2428
+		if (is_array($pointGroup) && count($pointGroup) > 0)
2429 2429
 		{
2430 2430
 			$levelGroup = array_flip($pointGroup);
2431 2431
 			ksort($levelGroup);
2432 2432
 		}
2433 2433
 		$maxLevel = 0;
2434 2434
 		$resultGroup = array_intersect($levelGroup, $groupSrlList);
2435
-		if(count($resultGroup) > 0)
2435
+		if (count($resultGroup) > 0)
2436 2436
 			$maxLevel = max(array_flip($resultGroup));
2437 2437
 
2438
-		if($maxLevel > 0)
2438
+		if ($maxLevel > 0)
2439 2439
 		{
2440 2440
 			$oPointModel = getModel('point');
2441 2441
 			$originPoint = $oPointModel->getPoint($memberSrl);
2442 2442
 
2443
-			if($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2443
+			if ($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2444 2444
 			{
2445 2445
 				$oPointController = getController('point');
2446 2446
 				$oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel], 'update');
@@ -2450,18 +2450,18 @@  discard block
 block discarded – undo
2450 2450
 
2451 2451
 	function procMemberModifyEmailAddress()
2452 2452
 	{
2453
-		if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
2453
+		if (!Context::get('is_logged')) return $this->stop('msg_not_logged');
2454 2454
 
2455 2455
 		$member_info = Context::get('logged_info');
2456 2456
 		$newEmail = Context::get('email_address');
2457 2457
 
2458
-		if(!$newEmail) return $this->stop('msg_invalid_request');
2458
+		if (!$newEmail) return $this->stop('msg_invalid_request');
2459 2459
 
2460 2460
 		$oMemberModel = getModel('member');
2461 2461
 		$member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2462
-		if($member_srl) return new Object(-1,'msg_exists_email_address');
2462
+		if ($member_srl) return new Object(-1, 'msg_exists_email_address');
2463 2463
 
2464
-		if($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2464
+		if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA')
2465 2465
 		{
2466 2466
 			return $this->stop('msg_invalid_request');
2467 2467
 		}
@@ -2477,7 +2477,7 @@  discard block
 block discarded – undo
2477 2477
 		$oDB = &DB::getInstance();
2478 2478
 		$oDB->begin();
2479 2479
 		$output = executeQuery('member.insertAuthMail', $auth_args);
2480
-		if(!$output->toBool())
2480
+		if (!$output->toBool())
2481 2481
 		{
2482 2482
 			$oDB->rollback();
2483 2483
 			return $output;
@@ -2487,7 +2487,7 @@  discard block
 block discarded – undo
2487 2487
 		$member_config = $oModuleModel->getModuleConfig('member');
2488 2488
 
2489 2489
 		$tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin);
2490
-		if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2490
+		if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
2491 2491
 
2492 2492
 		global $lang;
2493 2493
 
@@ -2499,17 +2499,17 @@  discard block
 block discarded – undo
2499 2499
 
2500 2500
 		Context::set('newEmail', $newEmail);
2501 2501
 
2502
-		$auth_url = getFullUrl('','module','member','act','procMemberAuthEmailAddress','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key);
2502
+		$auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key);
2503 2503
 		Context::set('auth_url', $auth_url);
2504 2504
 
2505 2505
 		$oTemplate = &TemplateHandler::getInstance();
2506 2506
 		$content = $oTemplate->compile($tpl_path, 'confirm_member_new_email');
2507 2507
 
2508 2508
 		$oMail = new Mail();
2509
-		$oMail->setTitle( Context::getLang('title_modify_email_address') );
2509
+		$oMail->setTitle(Context::getLang('title_modify_email_address'));
2510 2510
 		$oMail->setContent($content);
2511
-		$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
2512
-		$oMail->setReceiptor( $member_info->nick_name, $newEmail );
2511
+		$oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email);
2512
+		$oMail->setReceiptor($member_info->nick_name, $newEmail);
2513 2513
 		$result = $oMail->send();
2514 2514
 
2515 2515
 		$msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail);
@@ -2523,16 +2523,16 @@  discard block
 block discarded – undo
2523 2523
 	{
2524 2524
 		$member_srl = Context::get('member_srl');
2525 2525
 		$auth_key = Context::get('auth_key');
2526
-		if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2526
+		if (!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
2527 2527
 
2528 2528
 		// Test logs for finding password by user_id and authkey
2529 2529
 		$args = new stdClass;
2530 2530
 		$args->member_srl = $member_srl;
2531 2531
 		$args->auth_key = $auth_key;
2532 2532
 		$output = executeQuery('member.getAuthMail', $args);
2533
-		if(!$output->toBool() || $output->data->auth_key != $auth_key)
2533
+		if (!$output->toBool() || $output->data->auth_key != $auth_key)
2534 2534
 		{
2535
-			if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2535
+			if (strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args);
2536 2536
 			return $this->stop('msg_invalid_modify_email_auth_key');
2537 2537
 		}
2538 2538
 
@@ -2541,10 +2541,10 @@  discard block
 block discarded – undo
2541 2541
 		list($args->email_id, $args->email_host) = explode('@', $newEmail);
2542 2542
 
2543 2543
 		$output = executeQuery('member.updateMemberEmailAddress', $args);
2544
-		if(!$output->toBool()) return $this->stop($output->getMessage());
2544
+		if (!$output->toBool()) return $this->stop($output->getMessage());
2545 2545
 
2546 2546
 		// Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table
2547
-		executeQuery('member.deleteAuthChangeEmailAddress',$args);
2547
+		executeQuery('member.deleteAuthChangeEmailAddress', $args);
2548 2548
 
2549 2549
 		$this->_clearMemberCache($args->member_srl);
2550 2550
 
@@ -2562,7 +2562,7 @@  discard block
 block discarded – undo
2562 2562
 	**/
2563 2563
 	function triggerGetDocumentMenu(&$menu_list)
2564 2564
 	{
2565
-		if(!Context::get('is_logged')) return new Object();
2565
+		if (!Context::get('is_logged')) return new Object();
2566 2566
 
2567 2567
 		$logged_info = Context::get('logged_info');
2568 2568
 		$document_srl = Context::get('target_srl');
@@ -2573,12 +2573,12 @@  discard block
 block discarded – undo
2573 2573
 		$member_srl = $oDocument->get('member_srl');
2574 2574
 		$module_srl = $oDocument->get('module_srl');
2575 2575
 
2576
-		if(!$member_srl) return new Object();
2577
-		if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2576
+		if (!$member_srl) return new Object();
2577
+		if ($oDocumentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object();
2578 2578
 
2579 2579
 		$oDocumentController = getController('document');
2580
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2581
-		$oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup');
2580
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2581
+		$oDocumentController->addDocumentPopupMenu($url, 'cmd_spammer', '', 'popup');
2582 2582
 
2583 2583
 		return new Object();
2584 2584
 	}
@@ -2592,7 +2592,7 @@  discard block
 block discarded – undo
2592 2592
 	**/
2593 2593
 	function triggerGetCommentMenu(&$menu_list)
2594 2594
 	{
2595
-		if(!Context::get('is_logged')) return new Object();
2595
+		if (!Context::get('is_logged')) return new Object();
2596 2596
 
2597 2597
 		$logged_info = Context::get('logged_info');
2598 2598
 		$comment_srl = Context::get('target_srl');
@@ -2603,12 +2603,12 @@  discard block
 block discarded – undo
2603 2603
 		$module_srl = $oComment->get('module_srl');
2604 2604
 		$member_srl = $oComment->get('member_srl');
2605 2605
 
2606
-		if(!$member_srl) return new Object();
2607
-		if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object();
2606
+		if (!$member_srl) return new Object();
2607
+		if ($oCommentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object();
2608 2608
 
2609 2609
 		$oCommentController = getController('comment');
2610
-		$url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl);
2611
-		$oCommentController->addCommentPopupMenu($url,'cmd_spammer','','popup');
2610
+		$url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl);
2611
+		$oCommentController->addCommentPopupMenu($url, 'cmd_spammer', '', 'popup');
2612 2612
 
2613 2613
 		return new Object();
2614 2614
 	}
@@ -2620,7 +2620,7 @@  discard block
 block discarded – undo
2620 2620
 	**/
2621 2621
 	function procMemberSpammerManage()
2622 2622
 	{
2623
-		if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
2623
+		if (!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
2624 2624
 
2625 2625
 		$logged_info = Context::get('logged_info');
2626 2626
 		$member_srl = Context::get('member_srl');
@@ -2628,7 +2628,7 @@  discard block
 block discarded – undo
2628 2628
 		$cnt_loop = Context::get('cnt_loop');
2629 2629
 		$proc_type = Context::get('proc_type');
2630 2630
 		$isMoveToTrash = true;
2631
-		if($proc_type == "delete")
2631
+		if ($proc_type == "delete")
2632 2632
 			$isMoveToTrash = false;
2633 2633
 
2634 2634
 		// check grant
@@ -2637,7 +2637,7 @@  discard block
 block discarded – undo
2637 2637
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
2638 2638
 		$grant = $oModuleModel->getGrant($module_info, $logged_info);
2639 2639
 
2640
-		if(!$grant->manager) return new Object(-1,'msg_not_permitted');
2640
+		if (!$grant->manager) return new Object(-1, 'msg_not_permitted');
2641 2641
 
2642 2642
 		$proc_msg = "";
2643 2643
 
@@ -2646,10 +2646,10 @@  discard block
 block discarded – undo
2646 2646
 
2647 2647
 		// delete or trash destination
2648 2648
 		// proc member
2649
-		if($cnt_loop == 1)
2649
+		if ($cnt_loop == 1)
2650 2650
 			$this->_spammerMember($member_srl);
2651 2651
 		// proc document and comment
2652
-		elseif($cnt_loop>1)
2652
+		elseif ($cnt_loop > 1)
2653 2653
 			$this->_spammerDocuments($member_srl, $isMoveToTrash);
2654 2654
 
2655 2655
 		// get destination count
@@ -2658,11 +2658,11 @@  discard block
 block discarded – undo
2658 2658
 
2659 2659
 		$total_count = Context::get('total_count');
2660 2660
 		$remain_count = $cnt_document + $cnt_comment;
2661
-		if($cnt_loop == 1) $total_count = $remain_count;
2661
+		if ($cnt_loop == 1) $total_count = $remain_count;
2662 2662
 
2663 2663
 		// get progress percent
2664
-		if($total_count > 0)
2665
-			$progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2664
+		if ($total_count > 0)
2665
+			$progress = intval((($total_count - $remain_count) / $total_count) * 100);
2666 2666
 		else
2667 2667
 			$progress = 100;
2668 2668
 
@@ -2686,7 +2686,7 @@  discard block
 block discarded – undo
2686 2686
 	**/
2687 2687
 	private function _spammerMember($member_srl) {
2688 2688
 		$logged_info = Context::get('logged_info');
2689
-		$spam_description = trim( Context::get('spam_description') );
2689
+		$spam_description = trim(Context::get('spam_description'));
2690 2690
 
2691 2691
 		$oMemberModel = getModel('member');
2692 2692
 		$columnList = array('member_srl', 'email_address', 'user_id', 'nick_name', 'description');
@@ -2705,10 +2705,10 @@  discard block
 block discarded – undo
2705 2705
 		$args->user_id = $member_info->user_id;
2706 2706
 		$args->nick_name = $member_info->nick_name;
2707 2707
 		$args->denied = "Y";
2708
-		$args->description = trim( $member_info->description );
2709
-		if( $args->description != "" ) $args->description .= "\n";	// add new line
2708
+		$args->description = trim($member_info->description);
2709
+		if ($args->description != "") $args->description .= "\n"; // add new line
2710 2710
 
2711
-		$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 . "]";
2711
+		$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."]";
2712 2712
 
2713 2713
 		$output = $this->updateMember($args, true);
2714 2714
 
@@ -2737,21 +2737,21 @@  discard block
 block discarded – undo
2737 2737
 		// 1. proc comment, 2. proc document
2738 2738
 		$cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl);
2739 2739
 		$cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl);
2740
-		if($cnt_comment > 0)
2740
+		if ($cnt_comment > 0)
2741 2741
 		{
2742 2742
 			$columnList = array();
2743 2743
 			$commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2744
-			if($commentList) {
2745
-				foreach($commentList as $v) {
2744
+			if ($commentList) {
2745
+				foreach ($commentList as $v) {
2746 2746
 					$oCommentController->deleteComment($v->comment_srl, true, $isMoveToTrash);
2747 2747
 				}
2748 2748
 			}
2749
-		} elseif($cnt_document > 0) {
2749
+		} elseif ($cnt_document > 0) {
2750 2750
 			$columnList = array();
2751 2751
 			$documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount);
2752
-			if($documentList) {
2753
-				foreach($documentList as $v) {
2754
-					if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2752
+			if ($documentList) {
2753
+				foreach ($documentList as $v) {
2754
+					if ($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v);
2755 2755
 					else $oDocumentController->deleteDocument($v->document_srl);
2756 2756
 				}
2757 2757
 			}
@@ -2763,24 +2763,24 @@  discard block
 block discarded – undo
2763 2763
 	function _clearMemberCache($member_srl, $site_srl = 0)
2764 2764
 	{
2765 2765
 		$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
2766
-		if($oCacheHandler->isSupport())
2766
+		if ($oCacheHandler->isSupport())
2767 2767
 		{
2768
-			$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_' . $site_srl;
2768
+			$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl;
2769 2769
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2770 2770
 			$oCacheHandler->delete($cache_key);
2771 2771
 
2772
-			if($site_srl !== 0)
2772
+			if ($site_srl !== 0)
2773 2773
 			{
2774
-				$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0';
2774
+				$object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_0';
2775 2775
 				$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2776 2776
 				$oCacheHandler->delete($cache_key);
2777 2777
 			}
2778 2778
 		}
2779 2779
 
2780 2780
 		$oCacheHandler = CacheHandler::getInstance('object');
2781
-		if($oCacheHandler->isSupport())
2781
+		if ($oCacheHandler->isSupport())
2782 2782
 		{
2783
-			$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
2783
+			$object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl;
2784 2784
 			$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
2785 2785
 			$oCacheHandler->delete($cache_key);
2786 2786
 		}
Please login to merge, or discard this patch.