@@ -34,25 +34,25 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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,12 +479,12 @@ discard block |
||
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 | } |
@@ -492,13 +492,13 @@ discard block |
||
492 | 492 | |
493 | 493 | // Extract the necessary information in advance |
494 | 494 | $oMemberModel = getModel('member'); |
495 | - $config = $oMemberModel->getMemberConfig (); |
|
496 | - $getVars = array('find_account_answer','allow_mailing','allow_message'); |
|
497 | - if($config->signupForm) |
|
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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); |
@@ -1471,11 +1471,11 @@ discard block |
||
1471 | 1471 | $signature = preg_replace('/<(\/?)(embed|object|param)/is', '<$1$2', $signature); |
1472 | 1472 | $signature = removeHackTag($signature); |
1473 | 1473 | |
1474 | - $check_signature = trim(str_replace(array(' ',"\n","\r"),'',strip_tags($signature,'<img><object>'))); |
|
1474 | + $check_signature = trim(str_replace(array(' ', "\n", "\r"), '', strip_tags($signature, '<img><object>'))); |
|
1475 | 1475 | $path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl)); |
1476 | 1476 | $filename = sprintf('%s%d.signature.php', $path, $member_srl); |
1477 | 1477 | |
1478 | - if(!$check_signature) return FileHandler::removeFile($filename); |
|
1478 | + if (!$check_signature) return FileHandler::removeFile($filename); |
|
1479 | 1479 | |
1480 | 1480 | $buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature); |
1481 | 1481 | FileHandler::makeDir($path); |
@@ -1504,15 +1504,15 @@ discard block |
||
1504 | 1504 | * |
1505 | 1505 | * @return Object |
1506 | 1506 | */ |
1507 | - function addMemberToGroup($member_srl, $group_srl, $site_srl=0) |
|
1507 | + function addMemberToGroup($member_srl, $group_srl, $site_srl = 0) |
|
1508 | 1508 | { |
1509 | 1509 | $args = new stdClass(); |
1510 | 1510 | $args->member_srl = $member_srl; |
1511 | 1511 | $args->group_srl = $group_srl; |
1512 | - if($site_srl) $args->site_srl = $site_srl; |
|
1512 | + if ($site_srl) $args->site_srl = $site_srl; |
|
1513 | 1513 | |
1514 | 1514 | // Add |
1515 | - $output = executeQuery('member.addMemberToGroup',$args); |
|
1515 | + $output = executeQuery('member.addMemberToGroup', $args); |
|
1516 | 1516 | $output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args); |
1517 | 1517 | |
1518 | 1518 | $this->_clearMemberCache($member_srl, $site_srl); |
@@ -1532,18 +1532,18 @@ discard block |
||
1532 | 1532 | { |
1533 | 1533 | $obj = new stdClass; |
1534 | 1534 | $obj->site_srl = $args->site_srl; |
1535 | - $obj->member_srl = implode(',',$args->member_srl); |
|
1535 | + $obj->member_srl = implode(',', $args->member_srl); |
|
1536 | 1536 | |
1537 | 1537 | $output = executeQueryArray('member.getMembersGroup', $obj); |
1538 | - if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
1538 | + if ($output->data) foreach ($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
1539 | 1539 | |
1540 | 1540 | $output = executeQuery('member.deleteMembersGroup', $obj); |
1541 | - if(!$output->toBool()) return $output; |
|
1541 | + if (!$output->toBool()) return $output; |
|
1542 | 1542 | |
1543 | 1543 | $inserted_members = array(); |
1544 | - foreach($args->member_srl as $key => $val) |
|
1544 | + foreach ($args->member_srl as $key => $val) |
|
1545 | 1545 | { |
1546 | - if($inserted_members[$val]) continue; |
|
1546 | + if ($inserted_members[$val]) continue; |
|
1547 | 1547 | $inserted_members[$val] = true; |
1548 | 1548 | |
1549 | 1549 | unset($obj); |
@@ -1553,7 +1553,7 @@ discard block |
||
1553 | 1553 | $obj->site_srl = $args->site_srl; |
1554 | 1554 | $obj->regdate = $date[$obj->member_srl]; |
1555 | 1555 | $output = executeQuery('member.addMemberToGroup', $obj); |
1556 | - if(!$output->toBool()) return $output; |
|
1556 | + if (!$output->toBool()) return $output; |
|
1557 | 1557 | |
1558 | 1558 | $this->_clearMemberCache($obj->member_srl, $args->site_srl); |
1559 | 1559 | } |
@@ -1575,9 +1575,9 @@ discard block |
||
1575 | 1575 | // Get information of the key |
1576 | 1576 | $output = executeQuery('member.getAutologin', $args); |
1577 | 1577 | // If no information exists, delete a cookie |
1578 | - if(!$output->toBool() || !$output->data) |
|
1578 | + if (!$output->toBool() || !$output->data) |
|
1579 | 1579 | { |
1580 | - setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/'); |
|
1580 | + setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365, '/'); |
|
1581 | 1581 | return; |
1582 | 1582 | } |
1583 | 1583 | |
@@ -1587,9 +1587,9 @@ discard block |
||
1587 | 1587 | $user_id = ($config->identifier == 'user_id') ? $output->data->user_id : $output->data->email_address; |
1588 | 1588 | $password = $output->data->password; |
1589 | 1589 | |
1590 | - if(!$user_id || !$password) |
|
1590 | + if (!$user_id || !$password) |
|
1591 | 1591 | { |
1592 | - setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/'); |
|
1592 | + setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365, '/'); |
|
1593 | 1593 | return; |
1594 | 1594 | } |
1595 | 1595 | |
@@ -1599,7 +1599,7 @@ discard block |
||
1599 | 1599 | $check_key = strtolower($user_id).$password.$_SERVER['HTTP_USER_AGENT']; |
1600 | 1600 | $check_key = substr(hash_hmac('sha256', $check_key, substr($args->autologin_key, 0, 32)), 0, 32); |
1601 | 1601 | |
1602 | - if($check_key === substr($args->autologin_key, 32)) |
|
1602 | + if ($check_key === substr($args->autologin_key, 32)) |
|
1603 | 1603 | { |
1604 | 1604 | // Check change_password_date |
1605 | 1605 | $oModuleModel = getModel('module'); |
@@ -1607,12 +1607,12 @@ discard block |
||
1607 | 1607 | $limit_date = $member_config->change_password_date; |
1608 | 1608 | |
1609 | 1609 | // Check if change_password_date is set |
1610 | - if($limit_date > 0) |
|
1610 | + if ($limit_date > 0) |
|
1611 | 1611 | { |
1612 | 1612 | $oMemberModel = getModel('member'); |
1613 | 1613 | $columnList = array('member_srl', 'change_password_date'); |
1614 | 1614 | |
1615 | - if($config->identifier == 'user_id') |
|
1615 | + if ($config->identifier == 'user_id') |
|
1616 | 1616 | { |
1617 | 1617 | $member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList); |
1618 | 1618 | } |
@@ -1621,7 +1621,7 @@ discard block |
||
1621 | 1621 | $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList); |
1622 | 1622 | } |
1623 | 1623 | |
1624 | - if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){ |
|
1624 | + if ($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day'))) { |
|
1625 | 1625 | $do_auto_login = true; |
1626 | 1626 | } |
1627 | 1627 | |
@@ -1632,14 +1632,14 @@ discard block |
||
1632 | 1632 | } |
1633 | 1633 | } |
1634 | 1634 | |
1635 | - if($do_auto_login) |
|
1635 | + if ($do_auto_login) |
|
1636 | 1636 | { |
1637 | 1637 | $output = $this->doLogin($user_id); |
1638 | 1638 | } |
1639 | 1639 | else |
1640 | 1640 | { |
1641 | 1641 | executeQuery('member.deleteAutologin', $args); |
1642 | - setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/'); |
|
1642 | + setCookie('xeak', null, $_SERVER['REQUEST_TIME'] + 60 * 60 * 24 * 365, '/'); |
|
1643 | 1643 | } |
1644 | 1644 | } |
1645 | 1645 | |
@@ -1655,13 +1655,13 @@ discard block |
||
1655 | 1655 | function doLogin($user_id, $password = '', $keep_signed = false) |
1656 | 1656 | { |
1657 | 1657 | $user_id = strtolower($user_id); |
1658 | - if(!$user_id) return new Object(-1, 'null_user_id'); |
|
1658 | + if (!$user_id) return new Object(-1, 'null_user_id'); |
|
1659 | 1659 | // Call a trigger before log-in (before) |
1660 | 1660 | $trigger_obj = new stdClass(); |
1661 | 1661 | $trigger_obj->user_id = $user_id; |
1662 | 1662 | $trigger_obj->password = $password; |
1663 | 1663 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj); |
1664 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
1664 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
1665 | 1665 | // Create a member model object |
1666 | 1666 | $oMemberModel = getModel('member'); |
1667 | 1667 | |
@@ -1671,12 +1671,12 @@ discard block |
||
1671 | 1671 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
1672 | 1672 | |
1673 | 1673 | // check identifier |
1674 | - if($config->identifier == 'email_address') |
|
1674 | + if ($config->identifier == 'email_address') |
|
1675 | 1675 | { |
1676 | 1676 | // Get user_id information |
1677 | 1677 | $this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id); |
1678 | 1678 | // Set an invalid user if no value returned |
1679 | - if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address'); |
|
1679 | + if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address'); |
|
1680 | 1680 | |
1681 | 1681 | } |
1682 | 1682 | else |
@@ -1684,24 +1684,24 @@ discard block |
||
1684 | 1684 | // Get user_id information |
1685 | 1685 | $this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id); |
1686 | 1686 | // Set an invalid user if no value returned |
1687 | - if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id'); |
|
1687 | + if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id'); |
|
1688 | 1688 | } |
1689 | 1689 | |
1690 | 1690 | $output = executeQuery('member.getLoginCountByIp', $args); |
1691 | 1691 | $errorCount = $output->data->count; |
1692 | - if($errorCount >= $config->max_error_count) |
|
1692 | + if ($errorCount >= $config->max_error_count) |
|
1693 | 1693 | { |
1694 | 1694 | $last_update = strtotime($output->data->last_update); |
1695 | - $term = intval($_SERVER['REQUEST_TIME']-$last_update); |
|
1696 | - if($term < $config->max_error_count_time) |
|
1695 | + $term = intval($_SERVER['REQUEST_TIME'] - $last_update); |
|
1696 | + if ($term < $config->max_error_count_time) |
|
1697 | 1697 | { |
1698 | 1698 | $term = $config->max_error_count_time - $term; |
1699 | - if($term < 60) $term = intval($term).Context::getLang('unit_sec'); |
|
1700 | - elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min'); |
|
1701 | - elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour'); |
|
1702 | - else $term = intval($term/86400).Context::getLang('unit_day'); |
|
1699 | + if ($term < 60) $term = intval($term).Context::getLang('unit_sec'); |
|
1700 | + elseif (60 <= $term && $term < 3600) $term = intval($term / 60).Context::getLang('unit_min'); |
|
1701 | + elseif (3600 <= $term && $term < 86400) $term = intval($term / 3600).Context::getLang('unit_hour'); |
|
1702 | + else $term = intval($term / 86400).Context::getLang('unit_day'); |
|
1703 | 1703 | |
1704 | - return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term)); |
|
1704 | + return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'), $term)); |
|
1705 | 1705 | } |
1706 | 1706 | else |
1707 | 1707 | { |
@@ -1711,13 +1711,13 @@ discard block |
||
1711 | 1711 | } |
1712 | 1712 | |
1713 | 1713 | // Password Check |
1714 | - if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl)) |
|
1714 | + if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl)) |
|
1715 | 1715 | { |
1716 | - return $this->recordMemberLoginError(-1, 'invalid_password',$this->memberInfo); |
|
1716 | + return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo); |
|
1717 | 1717 | } |
1718 | 1718 | |
1719 | 1719 | // If denied == 'Y', notify |
1720 | - if($this->memberInfo->denied == 'Y') |
|
1720 | + if ($this->memberInfo->denied == 'Y') |
|
1721 | 1721 | { |
1722 | 1722 | $args->member_srl = $this->memberInfo->member_srl; |
1723 | 1723 | $output = executeQuery('member.chkAuthMail', $args); |
@@ -1725,12 +1725,12 @@ discard block |
||
1725 | 1725 | { |
1726 | 1726 | $_SESSION['auth_member_srl'] = $this->memberInfo->member_srl; |
1727 | 1727 | $redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail'); |
1728 | - return $this->setRedirectUrl($redirectUrl, new Object(-1,'msg_user_not_confirmed')); |
|
1728 | + return $this->setRedirectUrl($redirectUrl, new Object(-1, 'msg_user_not_confirmed')); |
|
1729 | 1729 | } |
1730 | - return new Object(-1,'msg_user_denied'); |
|
1730 | + return new Object(-1, 'msg_user_denied'); |
|
1731 | 1731 | } |
1732 | 1732 | // Notify if denied_date is less than the current time |
1733 | - 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 | + 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"))); |
|
1734 | 1734 | // Update the latest login time |
1735 | 1735 | $args->member_srl = $this->memberInfo->member_srl; |
1736 | 1736 | $output = executeQuery('member.updateLastLogin', $args); |
@@ -1740,36 +1740,36 @@ discard block |
||
1740 | 1740 | |
1741 | 1741 | // Check if there is recoding table. |
1742 | 1742 | $oDB = &DB::getInstance(); |
1743 | - if($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N') |
|
1743 | + if ($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N') |
|
1744 | 1744 | { |
1745 | 1745 | // check if there is login fail records. |
1746 | 1746 | $output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args); |
1747 | - if($output->data && $output->data->content) |
|
1747 | + if ($output->data && $output->data->content) |
|
1748 | 1748 | { |
1749 | 1749 | $title = Context::getLang('login_fail_report'); |
1750 | 1750 | $message = '<ul>'; |
1751 | 1751 | $content = unserialize($output->data->content); |
1752 | - if(count($content) > $config->max_error_count) |
|
1752 | + if (count($content) > $config->max_error_count) |
|
1753 | 1753 | { |
1754 | - foreach($content as $val) |
|
1754 | + foreach ($content as $val) |
|
1755 | 1755 | { |
1756 | - $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 | + $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>'; |
|
1757 | 1757 | } |
1758 | 1758 | $message .= '</ul>'; |
1759 | - $content = sprintf(Context::getLang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa')); |
|
1759 | + $content = sprintf(Context::getLang('login_fail_report_contents'), $message, date('Y-m-d h:i:sa')); |
|
1760 | 1760 | |
1761 | 1761 | //send message |
1762 | 1762 | $oCommunicationController = getController('communication'); |
1763 | 1763 | $oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true); |
1764 | 1764 | |
1765 | - if($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y') |
|
1765 | + if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y') |
|
1766 | 1766 | { |
1767 | 1767 | $view_url = Context::getRequestUri(); |
1768 | - $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 | + $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); |
|
1769 | 1769 | $oMail = new Mail(); |
1770 | 1770 | $oMail->setTitle($title); |
1771 | 1771 | $oMail->setContent($content); |
1772 | - $oMail->setSender($config->webmaster_name?$config->webmaster_name:'webmaster', $config->webmaster_email); |
|
1772 | + $oMail->setSender($config->webmaster_name ? $config->webmaster_name : 'webmaster', $config->webmaster_email); |
|
1773 | 1773 | $oMail->setReceiptor($this->memberInfo->email_id.'('.$this->memberInfo->nick_name.')', $this->memberInfo->email_address); |
1774 | 1774 | $oMail->send(); |
1775 | 1775 | } |
@@ -1779,9 +1779,9 @@ discard block |
||
1779 | 1779 | } |
1780 | 1780 | // Call a trigger after successfully log-in (after) |
1781 | 1781 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo); |
1782 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
1782 | + if (!$trigger_output->toBool()) return $trigger_output; |
|
1783 | 1783 | // When user checked to use auto-login |
1784 | - if($keep_signed) |
|
1784 | + if ($keep_signed) |
|
1785 | 1785 | { |
1786 | 1786 | // Key generate for auto login |
1787 | 1787 | $oPassword = new Password(); |
@@ -1793,12 +1793,12 @@ discard block |
||
1793 | 1793 | $autologin_args->member_srl = $this->memberInfo->member_srl; |
1794 | 1794 | executeQuery('member.deleteAutologin', $autologin_args); |
1795 | 1795 | $autologin_output = executeQuery('member.insertAutologin', $autologin_args); |
1796 | - if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000, '/'); |
|
1796 | + if ($autologin_output->toBool()) setCookie('xeak', $autologin_args->autologin_key, $_SERVER['REQUEST_TIME'] + 31536000, '/'); |
|
1797 | 1797 | } |
1798 | - if($this->memberInfo->is_admin == 'Y') |
|
1798 | + if ($this->memberInfo->is_admin == 'Y') |
|
1799 | 1799 | { |
1800 | 1800 | $oMemberAdminModel = getAdminModel('member'); |
1801 | - if(!$oMemberAdminModel->getMemberAdminIPCheck()) |
|
1801 | + if (!$oMemberAdminModel->getMemberAdminIPCheck()) |
|
1802 | 1802 | { |
1803 | 1803 | $_SESSION['denied_admin'] = 'Y'; |
1804 | 1804 | } |
@@ -1816,18 +1816,18 @@ discard block |
||
1816 | 1816 | { |
1817 | 1817 | $oMemberModel = getModel('member'); |
1818 | 1818 | // If your information came through the current session information to extract information from the users |
1819 | - if(!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged() ) |
|
1819 | + if (!$this->memberInfo && $_SESSION['member_srl'] && $oMemberModel->isLogged()) |
|
1820 | 1820 | { |
1821 | 1821 | $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']); |
1822 | 1822 | // If you do not destroy the session Profile |
1823 | - if($this->memberInfo->member_srl != $_SESSION['member_srl']) |
|
1823 | + if ($this->memberInfo->member_srl != $_SESSION['member_srl']) |
|
1824 | 1824 | { |
1825 | 1825 | $this->destroySessionInfo(); |
1826 | 1826 | return; |
1827 | 1827 | } |
1828 | 1828 | } |
1829 | 1829 | // Stop using the session id is destroyed |
1830 | - if($this->memberInfo->denied=='Y') |
|
1830 | + if ($this->memberInfo->denied == 'Y') |
|
1831 | 1831 | { |
1832 | 1832 | $this->destroySessionInfo(); |
1833 | 1833 | return; |
@@ -1857,10 +1857,10 @@ discard block |
||
1857 | 1857 | Context::set('logged_info', $this->memberInfo); |
1858 | 1858 | |
1859 | 1859 | // Only the menu configuration of the user (such as an add-on to the menu can be changed) |
1860 | - $this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info'); |
|
1861 | - $this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document'); |
|
1862 | - $this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document'); |
|
1863 | - $this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document'); |
|
1860 | + $this->addMemberMenu('dispMemberInfo', 'cmd_view_member_info'); |
|
1861 | + $this->addMemberMenu('dispMemberScrappedDocument', 'cmd_view_scrapped_document'); |
|
1862 | + $this->addMemberMenu('dispMemberSavedDocument', 'cmd_view_saved_document'); |
|
1863 | + $this->addMemberMenu('dispMemberOwnDocument', 'cmd_view_own_document'); |
|
1864 | 1864 | } |
1865 | 1865 | |
1866 | 1866 | /** |
@@ -1882,7 +1882,7 @@ discard block |
||
1882 | 1882 | function addMemberPopupMenu($url, $str, $icon = '', $target = 'self') |
1883 | 1883 | { |
1884 | 1884 | $member_popup_menu_list = Context::get('member_popup_menu_list'); |
1885 | - if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array(); |
|
1885 | + if (!is_array($member_popup_menu_list)) $member_popup_menu_list = array(); |
|
1886 | 1886 | |
1887 | 1887 | $obj = new stdClass; |
1888 | 1888 | $obj->url = $url; |
@@ -1901,33 +1901,33 @@ discard block |
||
1901 | 1901 | { |
1902 | 1902 | // Call a trigger (before) |
1903 | 1903 | $output = ModuleHandler::triggerCall('member.insertMember', 'before', $args); |
1904 | - if(!$output->toBool()) return $output; |
|
1904 | + if (!$output->toBool()) return $output; |
|
1905 | 1905 | // Terms and Conditions portion of the information set up by members reaffirmed |
1906 | 1906 | $oModuleModel = getModel('module'); |
1907 | 1907 | $config = $oModuleModel->getModuleConfig('member'); |
1908 | 1908 | |
1909 | 1909 | $logged_info = Context::get('logged_info'); |
1910 | 1910 | // If the date of the temporary restrictions limit further information on the date of |
1911 | - if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24); |
|
1911 | + if ($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME'] + $config->limit_day * 60 * 60 * 24); |
|
1912 | 1912 | |
1913 | 1913 | $args->member_srl = getNextSequence(); |
1914 | 1914 | $args->list_order = -1 * $args->member_srl; |
1915 | 1915 | |
1916 | 1916 | // Execute insert or update depending on the value of member_srl |
1917 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
1917 | + if (!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
1918 | 1918 | // Enter the user's identity changed to lowercase |
1919 | 1919 | else $args->user_id = strtolower($args->user_id); |
1920 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
1921 | - if(!$args->nick_name) $args->nick_name = $args->member_srl; |
|
1920 | + if (!$args->user_name) $args->user_name = $args->member_srl; |
|
1921 | + if (!$args->nick_name) $args->nick_name = $args->member_srl; |
|
1922 | 1922 | |
1923 | 1923 | // Control of essential parameters |
1924 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
1925 | - if($args->denied!='Y') $args->denied = 'N'; |
|
1926 | - $args->allow_message= 'Y'; |
|
1924 | + if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N'; |
|
1925 | + if ($args->denied != 'Y') $args->denied = 'N'; |
|
1926 | + $args->allow_message = 'Y'; |
|
1927 | 1927 | |
1928 | - if($logged_info->is_admin == 'Y') |
|
1928 | + if ($logged_info->is_admin == 'Y') |
|
1929 | 1929 | { |
1930 | - if($args->is_admin!='Y') $args->is_admin = 'N'; |
|
1930 | + if ($args->is_admin != 'Y') $args->is_admin = 'N'; |
|
1931 | 1931 | } |
1932 | 1932 | else |
1933 | 1933 | { |
@@ -1942,88 +1942,88 @@ discard block |
||
1942 | 1942 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
1943 | 1943 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
1944 | 1944 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
1945 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
1946 | - if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
1945 | + if ($args->homepage && !preg_match("/^[a-z]+:\/\//i", $args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
1946 | + if ($args->blog && !preg_match("/^[a-z]+:\/\//i", $args->blog)) $args->blog = 'http://'.$args->blog; |
|
1947 | 1947 | |
1948 | 1948 | // Create a model object |
1949 | 1949 | $oMemberModel = getModel('member'); |
1950 | 1950 | |
1951 | 1951 | // Check password strength |
1952 | - if($args->password && !$password_is_hashed) |
|
1952 | + if ($args->password && !$password_is_hashed) |
|
1953 | 1953 | { |
1954 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
1954 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
1955 | 1955 | { |
1956 | 1956 | $message = Context::getLang('about_password_strength'); |
1957 | 1957 | return new Object(-1, $message[$config->password_strength]); |
1958 | 1958 | } |
1959 | 1959 | $args->password = $oMemberModel->hashPassword($args->password); |
1960 | 1960 | } |
1961 | - elseif(!$args->password) |
|
1961 | + elseif (!$args->password) |
|
1962 | 1962 | { |
1963 | 1963 | unset($args->password); |
1964 | 1964 | } |
1965 | 1965 | |
1966 | 1966 | // Check if ID is prohibited |
1967 | - if($oMemberModel->isDeniedID($args->user_id)) |
|
1967 | + if ($oMemberModel->isDeniedID($args->user_id)) |
|
1968 | 1968 | { |
1969 | - return new Object(-1,'denied_user_id'); |
|
1969 | + return new Object(-1, 'denied_user_id'); |
|
1970 | 1970 | } |
1971 | 1971 | |
1972 | 1972 | // Check if ID is duplicate |
1973 | 1973 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
1974 | - if($member_srl) |
|
1974 | + if ($member_srl) |
|
1975 | 1975 | { |
1976 | - return new Object(-1,'msg_exists_user_id'); |
|
1976 | + return new Object(-1, 'msg_exists_user_id'); |
|
1977 | 1977 | } |
1978 | 1978 | |
1979 | 1979 | // Check if nickname is prohibited |
1980 | - if($oMemberModel->isDeniedNickName($args->nick_name)) |
|
1980 | + if ($oMemberModel->isDeniedNickName($args->nick_name)) |
|
1981 | 1981 | { |
1982 | - return new Object(-1,'denied_nick_name'); |
|
1982 | + return new Object(-1, 'denied_nick_name'); |
|
1983 | 1983 | } |
1984 | 1984 | |
1985 | 1985 | // Check if nickname is duplicate |
1986 | 1986 | $member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name); |
1987 | - if($member_srl) |
|
1987 | + if ($member_srl) |
|
1988 | 1988 | { |
1989 | - return new Object(-1,'msg_exists_nick_name'); |
|
1989 | + return new Object(-1, 'msg_exists_nick_name'); |
|
1990 | 1990 | } |
1991 | 1991 | |
1992 | 1992 | // Check if email address is duplicate |
1993 | 1993 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address); |
1994 | - if($member_srl) |
|
1994 | + if ($member_srl) |
|
1995 | 1995 | { |
1996 | - return new Object(-1,'msg_exists_email_address'); |
|
1996 | + return new Object(-1, 'msg_exists_email_address'); |
|
1997 | 1997 | } |
1998 | 1998 | |
1999 | 1999 | // Insert data into the DB |
2000 | 2000 | $args->list_order = -1 * $args->member_srl; |
2001 | 2001 | |
2002 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
2003 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
2002 | + if (!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
2003 | + if (!$args->user_name) $args->user_name = $args->member_srl; |
|
2004 | 2004 | |
2005 | 2005 | $oDB = &DB::getInstance(); |
2006 | 2006 | $oDB->begin(); |
2007 | 2007 | |
2008 | 2008 | $output = executeQuery('member.insertMember', $args); |
2009 | - if(!$output->toBool()) |
|
2009 | + if (!$output->toBool()) |
|
2010 | 2010 | { |
2011 | 2011 | $oDB->rollback(); |
2012 | 2012 | return $output; |
2013 | 2013 | } |
2014 | 2014 | |
2015 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
2015 | + if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
2016 | 2016 | else $group_srl_list = explode('|@|', $args->group_srl_list); |
2017 | 2017 | // If no value is entered the default group, the value of group registration |
2018 | - if(!$args->group_srl_list) |
|
2018 | + if (!$args->group_srl_list) |
|
2019 | 2019 | { |
2020 | 2020 | $columnList = array('site_srl', 'group_srl'); |
2021 | 2021 | $default_group = $oMemberModel->getDefaultGroup(0, $columnList); |
2022 | - if($default_group) |
|
2022 | + if ($default_group) |
|
2023 | 2023 | { |
2024 | 2024 | // Add to the default group |
2025 | - $output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl); |
|
2026 | - if(!$output->toBool()) |
|
2025 | + $output = $this->addMemberToGroup($args->member_srl, $default_group->group_srl); |
|
2026 | + if (!$output->toBool()) |
|
2027 | 2027 | { |
2028 | 2028 | $oDB->rollback(); |
2029 | 2029 | return $output; |
@@ -2033,11 +2033,11 @@ discard block |
||
2033 | 2033 | } |
2034 | 2034 | else |
2035 | 2035 | { |
2036 | - for($i=0;$i<count($group_srl_list);$i++) |
|
2036 | + for ($i = 0; $i < count($group_srl_list); $i++) |
|
2037 | 2037 | { |
2038 | - $output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]); |
|
2038 | + $output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]); |
|
2039 | 2039 | |
2040 | - if(!$output->toBool()) |
|
2040 | + if (!$output->toBool()) |
|
2041 | 2041 | { |
2042 | 2042 | $oDB->rollback(); |
2043 | 2043 | return $output; |
@@ -2047,7 +2047,7 @@ discard block |
||
2047 | 2047 | |
2048 | 2048 | $member_config = $oModuleModel->getModuleConfig('member'); |
2049 | 2049 | // When using email authentication mode (when you subscribed members denied a) certified mail sent |
2050 | - if($args->denied == 'Y') |
|
2050 | + if ($args->denied == 'Y') |
|
2051 | 2051 | { |
2052 | 2052 | // Insert data into the authentication DB |
2053 | 2053 | $oPassword = new Password(); |
@@ -2059,7 +2059,7 @@ discard block |
||
2059 | 2059 | $auth_args->is_register = 'Y'; |
2060 | 2060 | |
2061 | 2061 | $output = executeQuery('member.insertAuthMail', $auth_args); |
2062 | - if(!$output->toBool()) |
|
2062 | + if (!$output->toBool()) |
|
2063 | 2063 | { |
2064 | 2064 | $oDB->rollback(); |
2065 | 2065 | return $output; |
@@ -2067,10 +2067,10 @@ discard block |
||
2067 | 2067 | $this->_sendAuthMail($auth_args, $args); |
2068 | 2068 | } |
2069 | 2069 | // Call a trigger (after) |
2070 | - if($output->toBool()) |
|
2070 | + if ($output->toBool()) |
|
2071 | 2071 | { |
2072 | 2072 | $trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args); |
2073 | - if(!$trigger_output->toBool()) |
|
2073 | + if (!$trigger_output->toBool()) |
|
2074 | 2074 | { |
2075 | 2075 | $oDB->rollback(); |
2076 | 2076 | return $trigger_output; |
@@ -2092,41 +2092,41 @@ discard block |
||
2092 | 2092 | { |
2093 | 2093 | // Call a trigger (before) |
2094 | 2094 | $output = ModuleHandler::triggerCall('member.updateMember', 'before', $args); |
2095 | - if(!$output->toBool()) return $output; |
|
2095 | + if (!$output->toBool()) return $output; |
|
2096 | 2096 | // Create a model object |
2097 | 2097 | $oMemberModel = getModel('member'); |
2098 | 2098 | |
2099 | 2099 | $logged_info = Context::get('logged_info'); |
2100 | 2100 | // Get what you want to modify the original information |
2101 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2101 | + if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2102 | 2102 | // Control of essential parameters |
2103 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
2104 | - if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y'; |
|
2103 | + if ($args->allow_mailing != 'Y') $args->allow_mailing = 'N'; |
|
2104 | + if ($args->allow_message && !in_array($args->allow_message, array('Y', 'N', 'F'))) $args->allow_message = 'Y'; |
|
2105 | 2105 | |
2106 | - if($logged_info->is_admin == 'Y') |
|
2106 | + if ($logged_info->is_admin == 'Y') |
|
2107 | 2107 | { |
2108 | - if($args->denied!='Y') $args->denied = 'N'; |
|
2109 | - if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N'; |
|
2108 | + if ($args->denied != 'Y') $args->denied = 'N'; |
|
2109 | + if ($args->is_admin != 'Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N'; |
|
2110 | 2110 | } |
2111 | 2111 | else |
2112 | 2112 | { |
2113 | 2113 | unset($args->is_admin); |
2114 | - if($is_admin == false) |
|
2114 | + if ($is_admin == false) |
|
2115 | 2115 | unset($args->denied); |
2116 | - if($logged_info->member_srl != $args->member_srl && $is_admin == false) |
|
2116 | + if ($logged_info->member_srl != $args->member_srl && $is_admin == false) |
|
2117 | 2117 | { |
2118 | 2118 | return $this->stop('msg_invalid_request'); |
2119 | 2119 | } |
2120 | 2120 | } |
2121 | 2121 | |
2122 | 2122 | // Sanitize user ID, username, nickname, homepage, blog |
2123 | - if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
2123 | + if ($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
2124 | 2124 | $args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2125 | 2125 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2126 | 2126 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2127 | 2127 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2128 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
2129 | - if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
2128 | + if ($args->homepage && !preg_match("/^[a-z]+:\/\//is", $args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
2129 | + if ($args->blog && !preg_match("/^[a-z]+:\/\//is", $args->blog)) $args->blog = 'http://'.$args->blog; |
|
2130 | 2130 | |
2131 | 2131 | // check member identifier form |
2132 | 2132 | $config = $oMemberModel->getMemberConfig(); |
@@ -2135,56 +2135,56 @@ discard block |
||
2135 | 2135 | $orgMemberInfo = $output->data; |
2136 | 2136 | |
2137 | 2137 | // Check if email address or user ID is duplicate |
2138 | - if($config->identifier == 'email_address') |
|
2138 | + if ($config->identifier == 'email_address') |
|
2139 | 2139 | { |
2140 | 2140 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address); |
2141 | - if($member_srl && $args->member_srl != $member_srl) |
|
2141 | + if ($member_srl && $args->member_srl != $member_srl) |
|
2142 | 2142 | { |
2143 | - return new Object(-1,'msg_exists_email_address'); |
|
2143 | + return new Object(-1, 'msg_exists_email_address'); |
|
2144 | 2144 | } |
2145 | 2145 | $args->email_address = $orgMemberInfo->email_address; |
2146 | 2146 | } |
2147 | 2147 | else |
2148 | 2148 | { |
2149 | 2149 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
2150 | - if($member_srl && $args->member_srl != $member_srl) |
|
2150 | + if ($member_srl && $args->member_srl != $member_srl) |
|
2151 | 2151 | { |
2152 | - return new Object(-1,'msg_exists_user_id'); |
|
2152 | + return new Object(-1, 'msg_exists_user_id'); |
|
2153 | 2153 | } |
2154 | 2154 | |
2155 | 2155 | $args->user_id = $orgMemberInfo->user_id; |
2156 | 2156 | } |
2157 | 2157 | |
2158 | - if($logged_info->is_admin !== 'Y') |
|
2158 | + if ($logged_info->is_admin !== 'Y') |
|
2159 | 2159 | { |
2160 | 2160 | // Check if ID is prohibited |
2161 | - if($args->user_id && $oMemberModel->isDeniedID($args->user_id)) |
|
2161 | + if ($args->user_id && $oMemberModel->isDeniedID($args->user_id)) |
|
2162 | 2162 | { |
2163 | - return new Object(-1,'denied_user_id'); |
|
2163 | + return new Object(-1, 'denied_user_id'); |
|
2164 | 2164 | } |
2165 | 2165 | |
2166 | 2166 | // Check if nickname is prohibited |
2167 | - if($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name)) |
|
2167 | + if ($args->nick_name && $oMemberModel->isDeniedNickName($args->nick_name)) |
|
2168 | 2168 | { |
2169 | 2169 | return new Object(-1, 'denied_nick_name'); |
2170 | 2170 | } |
2171 | 2171 | } |
2172 | 2172 | |
2173 | 2173 | // Check if ID is duplicate |
2174 | - if($args->user_id) |
|
2174 | + if ($args->user_id) |
|
2175 | 2175 | { |
2176 | 2176 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
2177 | - if($member_srl && $args->member_srl != $member_srl) |
|
2177 | + if ($member_srl && $args->member_srl != $member_srl) |
|
2178 | 2178 | { |
2179 | - return new Object(-1,'msg_exists_user_id'); |
|
2179 | + return new Object(-1, 'msg_exists_user_id'); |
|
2180 | 2180 | } |
2181 | 2181 | } |
2182 | 2182 | |
2183 | 2183 | // Check if nickname is duplicate |
2184 | 2184 | $member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name); |
2185 | - if($member_srl && $args->member_srl != $member_srl) |
|
2185 | + if ($member_srl && $args->member_srl != $member_srl) |
|
2186 | 2186 | { |
2187 | - return new Object(-1,'msg_exists_nick_name'); |
|
2187 | + return new Object(-1, 'msg_exists_nick_name'); |
|
2188 | 2188 | } |
2189 | 2189 | |
2190 | 2190 | list($args->email_id, $args->email_host) = explode('@', $args->email_address); |
@@ -2193,9 +2193,9 @@ discard block |
||
2193 | 2193 | $oDB->begin(); |
2194 | 2194 | |
2195 | 2195 | // Check password strength |
2196 | - if($args->password) |
|
2196 | + if ($args->password) |
|
2197 | 2197 | { |
2198 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
2198 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
2199 | 2199 | { |
2200 | 2200 | $message = Context::getLang('about_password_strength'); |
2201 | 2201 | return new Object(-1, $message[$config->password_strength]); |
@@ -2207,40 +2207,40 @@ discard block |
||
2207 | 2207 | $args->password = $orgMemberInfo->password; |
2208 | 2208 | } |
2209 | 2209 | |
2210 | - if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name; |
|
2211 | - if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id; |
|
2212 | - if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name; |
|
2213 | - if(!$args->description) $args->description = $orgMemberInfo->description; |
|
2214 | - if(!$args->birthday) $args->birthday = ''; |
|
2210 | + if (!$args->user_name) $args->user_name = $orgMemberInfo->user_name; |
|
2211 | + if (!$args->user_id) $args->user_id = $orgMemberInfo->user_id; |
|
2212 | + if (!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name; |
|
2213 | + if (!$args->description) $args->description = $orgMemberInfo->description; |
|
2214 | + if (!$args->birthday) $args->birthday = ''; |
|
2215 | 2215 | |
2216 | 2216 | $output = executeQuery('member.updateMember', $args); |
2217 | 2217 | |
2218 | - if(!$output->toBool()) |
|
2218 | + if (!$output->toBool()) |
|
2219 | 2219 | { |
2220 | 2220 | $oDB->rollback(); |
2221 | 2221 | return $output; |
2222 | 2222 | } |
2223 | 2223 | |
2224 | - if($args->group_srl_list) |
|
2224 | + if ($args->group_srl_list) |
|
2225 | 2225 | { |
2226 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
2226 | + if (is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
2227 | 2227 | else $group_srl_list = explode('|@|', $args->group_srl_list); |
2228 | 2228 | // If the group information, group information changes |
2229 | - if(count($group_srl_list) > 0) |
|
2229 | + if (count($group_srl_list) > 0) |
|
2230 | 2230 | { |
2231 | 2231 | $args->site_srl = 0; |
2232 | 2232 | // One of its members to delete all the group |
2233 | 2233 | $output = executeQuery('member.deleteMemberGroupMember', $args); |
2234 | - if(!$output->toBool()) |
|
2234 | + if (!$output->toBool()) |
|
2235 | 2235 | { |
2236 | 2236 | $oDB->rollback(); |
2237 | 2237 | return $output; |
2238 | 2238 | } |
2239 | 2239 | // Enter one of the loop a |
2240 | - for($i=0;$i<count($group_srl_list);$i++) |
|
2240 | + for ($i = 0; $i < count($group_srl_list); $i++) |
|
2241 | 2241 | { |
2242 | - $output = $this->addMemberToGroup($args->member_srl,$group_srl_list[$i]); |
|
2243 | - if(!$output->toBool()) |
|
2242 | + $output = $this->addMemberToGroup($args->member_srl, $group_srl_list[$i]); |
|
2243 | + if (!$output->toBool()) |
|
2244 | 2244 | { |
2245 | 2245 | $oDB->rollback(); |
2246 | 2246 | return $output; |
@@ -2252,9 +2252,9 @@ discard block |
||
2252 | 2252 | } |
2253 | 2253 | } |
2254 | 2254 | // Call a trigger (after) |
2255 | - if($output->toBool()) { |
|
2255 | + if ($output->toBool()) { |
|
2256 | 2256 | $trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args); |
2257 | - if(!$trigger_output->toBool()) |
|
2257 | + if (!$trigger_output->toBool()) |
|
2258 | 2258 | { |
2259 | 2259 | $oDB->rollback(); |
2260 | 2260 | return $trigger_output; |
@@ -2267,7 +2267,7 @@ discard block |
||
2267 | 2267 | $this->_clearMemberCache($args->member_srl, $args->site_srl); |
2268 | 2268 | |
2269 | 2269 | // Save Session |
2270 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2270 | + if (!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2271 | 2271 | $logged_info = Context::get('logged_info'); |
2272 | 2272 | |
2273 | 2273 | $output->add('member_srl', $args->member_srl); |
@@ -2279,14 +2279,14 @@ discard block |
||
2279 | 2279 | */ |
2280 | 2280 | function updateMemberPassword($args) |
2281 | 2281 | { |
2282 | - if($args->password) |
|
2282 | + if ($args->password) |
|
2283 | 2283 | { |
2284 | 2284 | |
2285 | 2285 | // check password strength |
2286 | 2286 | $oMemberModel = getModel('member'); |
2287 | 2287 | $config = $oMemberModel->getMemberConfig(); |
2288 | 2288 | |
2289 | - if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
2289 | + if (!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
|
2290 | 2290 | { |
2291 | 2291 | $message = Context::getLang('about_password_strength'); |
2292 | 2292 | return new Object(-1, $message[$config->password_strength]); |
@@ -2294,13 +2294,13 @@ discard block |
||
2294 | 2294 | |
2295 | 2295 | $args->password = $oMemberModel->hashPassword($args->password); |
2296 | 2296 | } |
2297 | - else if($args->hashed_password) |
|
2297 | + else if ($args->hashed_password) |
|
2298 | 2298 | { |
2299 | 2299 | $args->password = $args->hashed_password; |
2300 | 2300 | } |
2301 | 2301 | |
2302 | 2302 | $output = executeQuery('member.updateMemberPassword', $args); |
2303 | - if($output->toBool()) |
|
2303 | + if ($output->toBool()) |
|
2304 | 2304 | { |
2305 | 2305 | $result = executeQuery('member.updateChangePasswordDate', $args); |
2306 | 2306 | } |
@@ -2319,18 +2319,18 @@ discard block |
||
2319 | 2319 | $trigger_obj = new stdClass(); |
2320 | 2320 | $trigger_obj->member_srl = $member_srl; |
2321 | 2321 | $output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj); |
2322 | - if(!$output->toBool()) return $output; |
|
2322 | + if (!$output->toBool()) return $output; |
|
2323 | 2323 | // Create a model object |
2324 | 2324 | $oMemberModel = getModel('member'); |
2325 | 2325 | // Bringing the user's information |
2326 | - if(!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin)) |
|
2326 | + if (!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin)) |
|
2327 | 2327 | { |
2328 | 2328 | $columnList = array('member_srl', 'is_admin'); |
2329 | 2329 | $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
2330 | 2330 | } |
2331 | - if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member'); |
|
2331 | + if (!$this->memberInfo) return new Object(-1, 'msg_not_exists_member'); |
|
2332 | 2332 | // If managers can not be deleted |
2333 | - if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin'); |
|
2333 | + if ($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin'); |
|
2334 | 2334 | |
2335 | 2335 | $oDB = &DB::getInstance(); |
2336 | 2336 | $oDB->begin(); |
@@ -2339,7 +2339,7 @@ discard block |
||
2339 | 2339 | $args->member_srl = $member_srl; |
2340 | 2340 | // Delete the entries in member_auth_mail |
2341 | 2341 | $output = executeQuery('member.deleteAuthMail', $args); |
2342 | - if(!$output->toBool()) |
|
2342 | + if (!$output->toBool()) |
|
2343 | 2343 | { |
2344 | 2344 | $oDB->rollback(); |
2345 | 2345 | return $output; |
@@ -2354,23 +2354,23 @@ discard block |
||
2354 | 2354 | */ |
2355 | 2355 | // Delete the entries in member_group_member |
2356 | 2356 | $output = executeQuery('member.deleteMemberGroupMember', $args); |
2357 | - if(!$output->toBool()) |
|
2357 | + if (!$output->toBool()) |
|
2358 | 2358 | { |
2359 | 2359 | $oDB->rollback(); |
2360 | 2360 | return $output; |
2361 | 2361 | } |
2362 | 2362 | // member removed from the table |
2363 | 2363 | $output = executeQuery('member.deleteMember', $args); |
2364 | - if(!$output->toBool()) |
|
2364 | + if (!$output->toBool()) |
|
2365 | 2365 | { |
2366 | 2366 | $oDB->rollback(); |
2367 | 2367 | return $output; |
2368 | 2368 | } |
2369 | 2369 | // Call a trigger (after) |
2370 | - if($output->toBool()) |
|
2370 | + if ($output->toBool()) |
|
2371 | 2371 | { |
2372 | 2372 | $trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj); |
2373 | - if(!$trigger_output->toBool()) |
|
2373 | + if (!$trigger_output->toBool()) |
|
2374 | 2374 | { |
2375 | 2375 | $oDB->rollback(); |
2376 | 2376 | return $trigger_output; |
@@ -2394,23 +2394,23 @@ discard block |
||
2394 | 2394 | */ |
2395 | 2395 | function destroySessionInfo() |
2396 | 2396 | { |
2397 | - if(!$_SESSION || !is_array($_SESSION)) return; |
|
2397 | + if (!$_SESSION || !is_array($_SESSION)) return; |
|
2398 | 2398 | |
2399 | 2399 | $memberInfo = Context::get('logged_info'); |
2400 | 2400 | $memberSrl = $memberInfo->member_srl; |
2401 | 2401 | |
2402 | - foreach($_SESSION as $key => $val) |
|
2402 | + foreach ($_SESSION as $key => $val) |
|
2403 | 2403 | { |
2404 | 2404 | $_SESSION[$key] = ''; |
2405 | 2405 | } |
2406 | 2406 | |
2407 | 2407 | session_destroy(); |
2408 | - setcookie(session_name(), '', $_SERVER['REQUEST_TIME']-42000, '/'); |
|
2409 | - setcookie('sso','',$_SERVER['REQUEST_TIME']-42000, '/'); |
|
2410 | - setcookie('xeak','',$_SERVER['REQUEST_TIME']-42000, '/'); |
|
2408 | + setcookie(session_name(), '', $_SERVER['REQUEST_TIME'] - 42000, '/'); |
|
2409 | + setcookie('sso', '', $_SERVER['REQUEST_TIME'] - 42000, '/'); |
|
2410 | + setcookie('xeak', '', $_SERVER['REQUEST_TIME'] - 42000, '/'); |
|
2411 | 2411 | setcookie('xe_logged', 'false', $_SERVER['REQUEST_TIME'] - 42000, '/'); |
2412 | 2412 | |
2413 | - if($memberSrl || $_COOKIE['xeak']) |
|
2413 | + if ($memberSrl || $_COOKIE['xeak']) |
|
2414 | 2414 | { |
2415 | 2415 | $args = new stdClass(); |
2416 | 2416 | $args->member_srl = $memberSrl; |
@@ -2426,22 +2426,22 @@ discard block |
||
2426 | 2426 | $pointGroup = $pointModuleConfig->point_group; |
2427 | 2427 | |
2428 | 2428 | $levelGroup = array(); |
2429 | - if(is_array($pointGroup) && count($pointGroup)>0) |
|
2429 | + if (is_array($pointGroup) && count($pointGroup) > 0) |
|
2430 | 2430 | { |
2431 | 2431 | $levelGroup = array_flip($pointGroup); |
2432 | 2432 | ksort($levelGroup); |
2433 | 2433 | } |
2434 | 2434 | $maxLevel = 0; |
2435 | 2435 | $resultGroup = array_intersect($levelGroup, $groupSrlList); |
2436 | - if(count($resultGroup) > 0) |
|
2436 | + if (count($resultGroup) > 0) |
|
2437 | 2437 | $maxLevel = max(array_flip($resultGroup)); |
2438 | 2438 | |
2439 | - if($maxLevel > 0) |
|
2439 | + if ($maxLevel > 0) |
|
2440 | 2440 | { |
2441 | 2441 | $oPointModel = getModel('point'); |
2442 | 2442 | $originPoint = $oPointModel->getPoint($memberSrl); |
2443 | 2443 | |
2444 | - if($pointModuleConfig->level_step[$maxLevel] > $originPoint) |
|
2444 | + if ($pointModuleConfig->level_step[$maxLevel] > $originPoint) |
|
2445 | 2445 | { |
2446 | 2446 | $oPointController = getController('point'); |
2447 | 2447 | $oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel], 'update'); |
@@ -2451,18 +2451,18 @@ discard block |
||
2451 | 2451 | |
2452 | 2452 | function procMemberModifyEmailAddress() |
2453 | 2453 | { |
2454 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
2454 | + if (!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
2455 | 2455 | |
2456 | 2456 | $member_info = Context::get('logged_info'); |
2457 | 2457 | $newEmail = Context::get('email_address'); |
2458 | 2458 | |
2459 | - if(!$newEmail) return $this->stop('msg_invalid_request'); |
|
2459 | + if (!$newEmail) return $this->stop('msg_invalid_request'); |
|
2460 | 2460 | |
2461 | 2461 | $oMemberModel = getModel('member'); |
2462 | 2462 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail); |
2463 | - if($member_srl) return new Object(-1,'msg_exists_email_address'); |
|
2463 | + if ($member_srl) return new Object(-1, 'msg_exists_email_address'); |
|
2464 | 2464 | |
2465 | - if($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
2465 | + if ($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
|
2466 | 2466 | { |
2467 | 2467 | return $this->stop('msg_invalid_request'); |
2468 | 2468 | } |
@@ -2478,7 +2478,7 @@ discard block |
||
2478 | 2478 | $oDB = &DB::getInstance(); |
2479 | 2479 | $oDB->begin(); |
2480 | 2480 | $output = executeQuery('member.insertAuthMail', $auth_args); |
2481 | - if(!$output->toBool()) |
|
2481 | + if (!$output->toBool()) |
|
2482 | 2482 | { |
2483 | 2483 | $oDB->rollback(); |
2484 | 2484 | return $output; |
@@ -2488,7 +2488,7 @@ discard block |
||
2488 | 2488 | $member_config = $oModuleModel->getModuleConfig('member'); |
2489 | 2489 | |
2490 | 2490 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
2491 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
2491 | + if (!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
2492 | 2492 | |
2493 | 2493 | global $lang; |
2494 | 2494 | |
@@ -2500,17 +2500,17 @@ discard block |
||
2500 | 2500 | |
2501 | 2501 | Context::set('newEmail', $newEmail); |
2502 | 2502 | |
2503 | - $auth_url = getFullUrl('','module','member','act','procMemberAuthEmailAddress','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key); |
|
2503 | + $auth_url = getFullUrl('', 'module', 'member', 'act', 'procMemberAuthEmailAddress', 'member_srl', $member_info->member_srl, 'auth_key', $auth_args->auth_key); |
|
2504 | 2504 | Context::set('auth_url', $auth_url); |
2505 | 2505 | |
2506 | 2506 | $oTemplate = &TemplateHandler::getInstance(); |
2507 | 2507 | $content = $oTemplate->compile($tpl_path, 'confirm_member_new_email'); |
2508 | 2508 | |
2509 | 2509 | $oMail = new Mail(); |
2510 | - $oMail->setTitle( Context::getLang('title_modify_email_address') ); |
|
2510 | + $oMail->setTitle(Context::getLang('title_modify_email_address')); |
|
2511 | 2511 | $oMail->setContent($content); |
2512 | - $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); |
|
2513 | - $oMail->setReceiptor( $member_info->nick_name, $newEmail ); |
|
2512 | + $oMail->setSender($member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster', $member_config->webmaster_email); |
|
2513 | + $oMail->setReceiptor($member_info->nick_name, $newEmail); |
|
2514 | 2514 | $result = $oMail->send(); |
2515 | 2515 | |
2516 | 2516 | $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail); |
@@ -2524,16 +2524,16 @@ discard block |
||
2524 | 2524 | { |
2525 | 2525 | $member_srl = Context::get('member_srl'); |
2526 | 2526 | $auth_key = Context::get('auth_key'); |
2527 | - if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request'); |
|
2527 | + if (!$member_srl || !$auth_key) return $this->stop('msg_invalid_request'); |
|
2528 | 2528 | |
2529 | 2529 | // Test logs for finding password by user_id and authkey |
2530 | 2530 | $args = new stdClass; |
2531 | 2531 | $args->member_srl = $member_srl; |
2532 | 2532 | $args->auth_key = $auth_key; |
2533 | 2533 | $output = executeQuery('member.getAuthMail', $args); |
2534 | - if(!$output->toBool() || $output->data->auth_key != $auth_key) |
|
2534 | + if (!$output->toBool() || $output->data->auth_key != $auth_key) |
|
2535 | 2535 | { |
2536 | - if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
2536 | + if (strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
2537 | 2537 | return $this->stop('msg_invalid_modify_email_auth_key'); |
2538 | 2538 | } |
2539 | 2539 | |
@@ -2542,10 +2542,10 @@ discard block |
||
2542 | 2542 | list($args->email_id, $args->email_host) = explode('@', $newEmail); |
2543 | 2543 | |
2544 | 2544 | $output = executeQuery('member.updateMemberEmailAddress', $args); |
2545 | - if(!$output->toBool()) return $this->stop($output->getMessage()); |
|
2545 | + if (!$output->toBool()) return $this->stop($output->getMessage()); |
|
2546 | 2546 | |
2547 | 2547 | // Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table |
2548 | - executeQuery('member.deleteAuthChangeEmailAddress',$args); |
|
2548 | + executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
2549 | 2549 | |
2550 | 2550 | $this->_clearMemberCache($args->member_srl); |
2551 | 2551 | |
@@ -2563,7 +2563,7 @@ discard block |
||
2563 | 2563 | **/ |
2564 | 2564 | function triggerGetDocumentMenu(&$menu_list) |
2565 | 2565 | { |
2566 | - if(!Context::get('is_logged')) return new Object(); |
|
2566 | + if (!Context::get('is_logged')) return new Object(); |
|
2567 | 2567 | |
2568 | 2568 | $logged_info = Context::get('logged_info'); |
2569 | 2569 | $document_srl = Context::get('target_srl'); |
@@ -2574,12 +2574,12 @@ discard block |
||
2574 | 2574 | $member_srl = $oDocument->get('member_srl'); |
2575 | 2575 | $module_srl = $oDocument->get('module_srl'); |
2576 | 2576 | |
2577 | - if(!$member_srl) return new Object(); |
|
2578 | - if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object(); |
|
2577 | + if (!$member_srl) return new Object(); |
|
2578 | + if ($oDocumentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object(); |
|
2579 | 2579 | |
2580 | 2580 | $oDocumentController = getController('document'); |
2581 | - $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
|
2582 | - $oDocumentController->addDocumentPopupMenu($url,'cmd_spammer','','popup'); |
|
2581 | + $url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl); |
|
2582 | + $oDocumentController->addDocumentPopupMenu($url, 'cmd_spammer', '', 'popup'); |
|
2583 | 2583 | |
2584 | 2584 | return new Object(); |
2585 | 2585 | } |
@@ -2593,7 +2593,7 @@ discard block |
||
2593 | 2593 | **/ |
2594 | 2594 | function triggerGetCommentMenu(&$menu_list) |
2595 | 2595 | { |
2596 | - if(!Context::get('is_logged')) return new Object(); |
|
2596 | + if (!Context::get('is_logged')) return new Object(); |
|
2597 | 2597 | |
2598 | 2598 | $logged_info = Context::get('logged_info'); |
2599 | 2599 | $comment_srl = Context::get('target_srl'); |
@@ -2604,12 +2604,12 @@ discard block |
||
2604 | 2604 | $module_srl = $oComment->get('module_srl'); |
2605 | 2605 | $member_srl = $oComment->get('member_srl'); |
2606 | 2606 | |
2607 | - if(!$member_srl) return new Object(); |
|
2608 | - if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object(); |
|
2607 | + if (!$member_srl) return new Object(); |
|
2608 | + if ($oCommentModel->grant->manager != 1 || $member_srl == $logged_info->member_srl) return new Object(); |
|
2609 | 2609 | |
2610 | 2610 | $oCommentController = getController('comment'); |
2611 | - $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
|
2612 | - $oCommentController->addCommentPopupMenu($url,'cmd_spammer','','popup'); |
|
2611 | + $url = getUrl('', 'module', 'member', 'act', 'dispMemberSpammer', 'member_srl', $member_srl, 'module_srl', $module_srl); |
|
2612 | + $oCommentController->addCommentPopupMenu($url, 'cmd_spammer', '', 'popup'); |
|
2613 | 2613 | |
2614 | 2614 | return new Object(); |
2615 | 2615 | } |
@@ -2621,7 +2621,7 @@ discard block |
||
2621 | 2621 | **/ |
2622 | 2622 | function procMemberSpammerManage() |
2623 | 2623 | { |
2624 | - if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted'); |
|
2624 | + if (!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted'); |
|
2625 | 2625 | |
2626 | 2626 | $logged_info = Context::get('logged_info'); |
2627 | 2627 | $member_srl = Context::get('member_srl'); |
@@ -2629,7 +2629,7 @@ discard block |
||
2629 | 2629 | $cnt_loop = Context::get('cnt_loop'); |
2630 | 2630 | $proc_type = Context::get('proc_type'); |
2631 | 2631 | $isMoveToTrash = true; |
2632 | - if($proc_type == "delete") |
|
2632 | + if ($proc_type == "delete") |
|
2633 | 2633 | $isMoveToTrash = false; |
2634 | 2634 | |
2635 | 2635 | // check grant |
@@ -2638,7 +2638,7 @@ discard block |
||
2638 | 2638 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); |
2639 | 2639 | $grant = $oModuleModel->getGrant($module_info, $logged_info); |
2640 | 2640 | |
2641 | - if(!$grant->manager) return new Object(-1,'msg_not_permitted'); |
|
2641 | + if (!$grant->manager) return new Object(-1, 'msg_not_permitted'); |
|
2642 | 2642 | |
2643 | 2643 | $proc_msg = ""; |
2644 | 2644 | |
@@ -2647,10 +2647,10 @@ discard block |
||
2647 | 2647 | |
2648 | 2648 | // delete or trash destination |
2649 | 2649 | // proc member |
2650 | - if($cnt_loop == 1) |
|
2650 | + if ($cnt_loop == 1) |
|
2651 | 2651 | $this->_spammerMember($member_srl); |
2652 | 2652 | // proc document and comment |
2653 | - elseif($cnt_loop>1) |
|
2653 | + elseif ($cnt_loop > 1) |
|
2654 | 2654 | $this->_spammerDocuments($member_srl, $isMoveToTrash); |
2655 | 2655 | |
2656 | 2656 | // get destination count |
@@ -2659,11 +2659,11 @@ discard block |
||
2659 | 2659 | |
2660 | 2660 | $total_count = Context::get('total_count'); |
2661 | 2661 | $remain_count = $cnt_document + $cnt_comment; |
2662 | - if($cnt_loop == 1) $total_count = $remain_count; |
|
2662 | + if ($cnt_loop == 1) $total_count = $remain_count; |
|
2663 | 2663 | |
2664 | 2664 | // get progress percent |
2665 | - if($total_count > 0) |
|
2666 | - $progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 ); |
|
2665 | + if ($total_count > 0) |
|
2666 | + $progress = intval((($total_count - $remain_count) / $total_count) * 100); |
|
2667 | 2667 | else |
2668 | 2668 | $progress = 100; |
2669 | 2669 | |
@@ -2687,7 +2687,7 @@ discard block |
||
2687 | 2687 | **/ |
2688 | 2688 | private function _spammerMember($member_srl) { |
2689 | 2689 | $logged_info = Context::get('logged_info'); |
2690 | - $spam_description = trim( Context::get('spam_description') ); |
|
2690 | + $spam_description = trim(Context::get('spam_description')); |
|
2691 | 2691 | |
2692 | 2692 | $oMemberModel = getModel('member'); |
2693 | 2693 | $columnList = array('member_srl', 'email_address', 'user_id', 'nick_name', 'description'); |
@@ -2706,10 +2706,10 @@ discard block |
||
2706 | 2706 | $args->user_id = $member_info->user_id; |
2707 | 2707 | $args->nick_name = $member_info->nick_name; |
2708 | 2708 | $args->denied = "Y"; |
2709 | - $args->description = trim( $member_info->description ); |
|
2710 | - if( $args->description != "" ) $args->description .= "\n"; // add new line |
|
2709 | + $args->description = trim($member_info->description); |
|
2710 | + if ($args->description != "") $args->description .= "\n"; // add new line |
|
2711 | 2711 | |
2712 | - $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 | + $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."]"; |
|
2713 | 2713 | |
2714 | 2714 | $output = $this->updateMember($args, true); |
2715 | 2715 | |
@@ -2738,21 +2738,21 @@ discard block |
||
2738 | 2738 | // 1. proc comment, 2. proc document |
2739 | 2739 | $cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl); |
2740 | 2740 | $cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl); |
2741 | - if($cnt_comment > 0) |
|
2741 | + if ($cnt_comment > 0) |
|
2742 | 2742 | { |
2743 | 2743 | $columnList = array(); |
2744 | 2744 | $commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount); |
2745 | - if($commentList) { |
|
2746 | - foreach($commentList as $v) { |
|
2745 | + if ($commentList) { |
|
2746 | + foreach ($commentList as $v) { |
|
2747 | 2747 | $oCommentController->deleteComment($v->comment_srl, true, $isMoveToTrash); |
2748 | 2748 | } |
2749 | 2749 | } |
2750 | - } elseif($cnt_document > 0) { |
|
2750 | + } elseif ($cnt_document > 0) { |
|
2751 | 2751 | $columnList = array(); |
2752 | 2752 | $documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount); |
2753 | - if($documentList) { |
|
2754 | - foreach($documentList as $v) { |
|
2755 | - if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v); |
|
2753 | + if ($documentList) { |
|
2754 | + foreach ($documentList as $v) { |
|
2755 | + if ($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v); |
|
2756 | 2756 | else $oDocumentController->deleteDocument($v->document_srl); |
2757 | 2757 | } |
2758 | 2758 | } |
@@ -2764,24 +2764,24 @@ discard block |
||
2764 | 2764 | function _clearMemberCache($member_srl, $site_srl = 0) |
2765 | 2765 | { |
2766 | 2766 | $oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE); |
2767 | - if($oCacheHandler->isSupport()) |
|
2767 | + if ($oCacheHandler->isSupport()) |
|
2768 | 2768 | { |
2769 | - $object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_' . $site_srl; |
|
2769 | + $object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_'.$site_srl; |
|
2770 | 2770 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
2771 | 2771 | $oCacheHandler->delete($cache_key); |
2772 | 2772 | |
2773 | - if($site_srl !== 0) |
|
2773 | + if ($site_srl !== 0) |
|
2774 | 2774 | { |
2775 | - $object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0'; |
|
2775 | + $object_key = 'member_groups:'.getNumberingPath($member_srl).$member_srl.'_0'; |
|
2776 | 2776 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
2777 | 2777 | $oCacheHandler->delete($cache_key); |
2778 | 2778 | } |
2779 | 2779 | } |
2780 | 2780 | |
2781 | 2781 | $oCacheHandler = CacheHandler::getInstance('object'); |
2782 | - if($oCacheHandler->isSupport()) |
|
2782 | + if ($oCacheHandler->isSupport()) |
|
2783 | 2783 | { |
2784 | - $object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl; |
|
2784 | + $object_key = 'member_info:'.getNumberingPath($member_srl).$member_srl; |
|
2785 | 2785 | $cache_key = $oCacheHandler->getGroupKey('member', $object_key); |
2786 | 2786 | $oCacheHandler->delete($cache_key); |
2787 | 2787 | } |
@@ -41,19 +41,31 @@ discard block |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | // Variables |
44 | - if(!$user_id) $user_id = Context::get('user_id'); |
|
44 | + if(!$user_id) { |
|
45 | + $user_id = Context::get('user_id'); |
|
46 | + } |
|
45 | 47 | $user_id = trim($user_id); |
46 | 48 | |
47 | - if(!$password) $password = Context::get('password'); |
|
49 | + if(!$password) { |
|
50 | + $password = Context::get('password'); |
|
51 | + } |
|
48 | 52 | $password = trim($password); |
49 | 53 | |
50 | - if(!$keep_signed) $keep_signed = Context::get('keep_signed'); |
|
54 | + if(!$keep_signed) { |
|
55 | + $keep_signed = Context::get('keep_signed'); |
|
56 | + } |
|
51 | 57 | // Return an error when id and password doesn't exist |
52 | - if(!$user_id) return new Object(-1,'null_user_id'); |
|
53 | - if(!$password) return new Object(-1,'null_password'); |
|
58 | + if(!$user_id) { |
|
59 | + return new Object(-1,'null_user_id'); |
|
60 | + } |
|
61 | + if(!$password) { |
|
62 | + return new Object(-1,'null_password'); |
|
63 | + } |
|
54 | 64 | |
55 | 65 | $output = $this->doLogin($user_id, $password, $keep_signed=='Y'?true:false); |
56 | - if (!$output->toBool()) return $output; |
|
66 | + if (!$output->toBool()) { |
|
67 | + return $output; |
|
68 | + } |
|
57 | 69 | |
58 | 70 | $oModuleModel = getModel('module'); |
59 | 71 | $config = $oModuleModel->getModuleConfig('member'); |
@@ -80,8 +92,7 @@ discard block |
||
80 | 92 | if(!$config->after_login_url) |
81 | 93 | { |
82 | 94 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', ''); |
83 | - } |
|
84 | - else |
|
95 | + } else |
|
85 | 96 | { |
86 | 97 | $returnUrl = $config->after_login_url; |
87 | 98 | } |
@@ -98,19 +109,24 @@ discard block |
||
98 | 109 | // Call a trigger before log-out (before) |
99 | 110 | $logged_info = Context::get('logged_info'); |
100 | 111 | $trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info); |
101 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
112 | + if(!$trigger_output->toBool()) { |
|
113 | + return $trigger_output; |
|
114 | + } |
|
102 | 115 | // Destroy session information |
103 | 116 | $this->destroySessionInfo(); |
104 | 117 | // Call a trigger after log-out (after) |
105 | 118 | $trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info); |
106 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
119 | + if(!$trigger_output->toBool()) { |
|
120 | + return $trigger_output; |
|
121 | + } |
|
107 | 122 | |
108 | 123 | $output = new Object(); |
109 | 124 | |
110 | 125 | $oModuleModel = getModel('module'); |
111 | 126 | $config = $oModuleModel->getModuleConfig('member'); |
112 | - if($config->after_logout_url) |
|
113 | - $output->redirect_url = $config->after_logout_url; |
|
127 | + if($config->after_logout_url) { |
|
128 | + $output->redirect_url = $config->after_logout_url; |
|
129 | + } |
|
114 | 130 | |
115 | 131 | $this->_clearMemberCache($logged_info->member_srl); |
116 | 132 | |
@@ -125,12 +141,18 @@ discard block |
||
125 | 141 | function procMemberScrapDocument() |
126 | 142 | { |
127 | 143 | // Check login information |
128 | - if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); |
|
144 | + if(!Context::get('is_logged')) { |
|
145 | + return new Object(-1, 'msg_not_logged'); |
|
146 | + } |
|
129 | 147 | $logged_info = Context::get('logged_info'); |
130 | 148 | |
131 | 149 | $document_srl = (int)Context::get('document_srl'); |
132 | - if(!$document_srl) $document_srl = (int)Context::get('target_srl'); |
|
133 | - if(!$document_srl) return new Object(-1,'msg_invalid_request'); |
|
150 | + if(!$document_srl) { |
|
151 | + $document_srl = (int)Context::get('target_srl'); |
|
152 | + } |
|
153 | + if(!$document_srl) { |
|
154 | + return new Object(-1,'msg_invalid_request'); |
|
155 | + } |
|
134 | 156 | // Get document |
135 | 157 | $oDocumentModel = getModel('document'); |
136 | 158 | $oDocument = $oDocumentModel->getDocument($document_srl); |
@@ -145,10 +167,14 @@ discard block |
||
145 | 167 | $args->title = $oDocument->get('title'); |
146 | 168 | // Check if already scrapped |
147 | 169 | $output = executeQuery('member.getScrapDocument', $args); |
148 | - if($output->data->count) return new Object(-1, 'msg_alreay_scrapped'); |
|
170 | + if($output->data->count) { |
|
171 | + return new Object(-1, 'msg_alreay_scrapped'); |
|
172 | + } |
|
149 | 173 | // Insert |
150 | 174 | $output = executeQuery('member.addScrapDocument', $args); |
151 | - if(!$output->toBool()) return $output; |
|
175 | + if(!$output->toBool()) { |
|
176 | + return $output; |
|
177 | + } |
|
152 | 178 | |
153 | 179 | $this->setError(-1); |
154 | 180 | $this->setMessage('success_registed'); |
@@ -162,11 +188,15 @@ discard block |
||
162 | 188 | function procMemberDeleteScrap() |
163 | 189 | { |
164 | 190 | // Check login information |
165 | - if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); |
|
191 | + if(!Context::get('is_logged')) { |
|
192 | + return new Object(-1, 'msg_not_logged'); |
|
193 | + } |
|
166 | 194 | $logged_info = Context::get('logged_info'); |
167 | 195 | |
168 | 196 | $document_srl = (int)Context::get('document_srl'); |
169 | - if(!$document_srl) return new Object(-1,'msg_invalid_request'); |
|
197 | + if(!$document_srl) { |
|
198 | + return new Object(-1,'msg_invalid_request'); |
|
199 | + } |
|
170 | 200 | // Variables |
171 | 201 | $args = new stdClass; |
172 | 202 | $args->member_srl = $logged_info->member_srl; |
@@ -192,11 +222,15 @@ discard block |
||
192 | 222 | function procMemberDeleteSavedDocument() |
193 | 223 | { |
194 | 224 | // Check login information |
195 | - if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); |
|
225 | + if(!Context::get('is_logged')) { |
|
226 | + return new Object(-1, 'msg_not_logged'); |
|
227 | + } |
|
196 | 228 | $logged_info = Context::get('logged_info'); |
197 | 229 | |
198 | 230 | $document_srl = (int)Context::get('document_srl'); |
199 | - if(!$document_srl) return new Object(-1,'msg_invalid_request'); |
|
231 | + if(!$document_srl) { |
|
232 | + return new Object(-1,'msg_invalid_request'); |
|
233 | + } |
|
200 | 234 | // Variables |
201 | 235 | $oDocumentController = getController('document'); |
202 | 236 | $oDocumentController->deleteDocument($document_srl, true); |
@@ -211,7 +245,9 @@ discard block |
||
211 | 245 | { |
212 | 246 | $name = Context::get('name'); |
213 | 247 | $value = Context::get('value'); |
214 | - if(!$value) return; |
|
248 | + if(!$value) { |
|
249 | + return; |
|
250 | + } |
|
215 | 251 | |
216 | 252 | $oMemberModel = getModel('member'); |
217 | 253 | // Check if logged-in |
@@ -222,10 +258,14 @@ discard block |
||
222 | 258 | { |
223 | 259 | case 'user_id' : |
224 | 260 | // Check denied ID |
225 | - if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id'); |
|
261 | + if($oMemberModel->isDeniedID($value)) { |
|
262 | + return new Object(0,'denied_user_id'); |
|
263 | + } |
|
226 | 264 | // Check if duplicated |
227 | 265 | $member_srl = $oMemberModel->getMemberSrlByUserID($value); |
228 | - if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_user_id'); |
|
266 | + if($member_srl && $logged_info->member_srl != $member_srl ) { |
|
267 | + return new Object(0,'msg_exists_user_id'); |
|
268 | + } |
|
229 | 269 | break; |
230 | 270 | case 'nick_name' : |
231 | 271 | // Check denied ID |
@@ -235,13 +275,17 @@ discard block |
||
235 | 275 | } |
236 | 276 | // Check if duplicated |
237 | 277 | $member_srl = $oMemberModel->getMemberSrlByNickName($value); |
238 | - if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name'); |
|
278 | + if($member_srl && $logged_info->member_srl != $member_srl ) { |
|
279 | + return new Object(0,'msg_exists_nick_name'); |
|
280 | + } |
|
239 | 281 | |
240 | 282 | break; |
241 | 283 | case 'email_address' : |
242 | 284 | // Check if duplicated |
243 | 285 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($value); |
244 | - if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address'); |
|
286 | + if($member_srl && $logged_info->member_srl != $member_srl ) { |
|
287 | + return new Object(0,'msg_exists_email_address'); |
|
288 | + } |
|
245 | 289 | break; |
246 | 290 | } |
247 | 291 | } |
@@ -253,17 +297,25 @@ discard block |
||
253 | 297 | */ |
254 | 298 | function procMemberInsert() |
255 | 299 | { |
256 | - if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request"); |
|
300 | + if (Context::getRequestMethod () == "GET") { |
|
301 | + return new Object (-1, "msg_invalid_request"); |
|
302 | + } |
|
257 | 303 | $oMemberModel = &getModel ('member'); |
258 | 304 | $config = $oMemberModel->getMemberConfig(); |
259 | 305 | |
260 | 306 | // call a trigger (before) |
261 | 307 | $trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config); |
262 | - if(!$trigger_output->toBool ()) return $trigger_output; |
|
308 | + if(!$trigger_output->toBool ()) { |
|
309 | + return $trigger_output; |
|
310 | + } |
|
263 | 311 | // Check if an administrator allows a membership |
264 | - if($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled'); |
|
312 | + if($config->enable_join != 'Y') { |
|
313 | + return $this->stop ('msg_signup_disabled'); |
|
314 | + } |
|
265 | 315 | // Check if the user accept the license terms (only if terms exist) |
266 | - if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement'); |
|
316 | + if($config->agreement && Context::get('accept_agreement')!='Y') { |
|
317 | + return $this->stop('msg_accept_agreement'); |
|
318 | + } |
|
267 | 319 | |
268 | 320 | // Extract the necessary information in advance |
269 | 321 | $getVars = array(); |
@@ -282,16 +334,22 @@ discard block |
||
282 | 334 | foreach($getVars as $val) |
283 | 335 | { |
284 | 336 | $args->{$val} = Context::get($val); |
285 | - if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); |
|
337 | + if($val == 'birthday') { |
|
338 | + $args->birthday_ui = Context::get('birthday_ui'); |
|
339 | + } |
|
286 | 340 | } |
287 | 341 | $args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
288 | - if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
342 | + if(!$args->birthday && $args->birthday_ui) { |
|
343 | + $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
344 | + } |
|
289 | 345 | |
290 | 346 | $args->find_account_answer = Context::get('find_account_answer'); |
291 | 347 | $args->allow_mailing = Context::get('allow_mailing'); |
292 | 348 | $args->allow_message = Context::get('allow_message'); |
293 | 349 | |
294 | - if($args->password1) $args->password = $args->password1; |
|
350 | + if($args->password1) { |
|
351 | + $args->password = $args->password1; |
|
352 | + } |
|
295 | 353 | |
296 | 354 | // check password strength |
297 | 355 | if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) |
@@ -320,7 +378,9 @@ discard block |
||
320 | 378 | unset($all_args->secret_text); |
321 | 379 | |
322 | 380 | // Set the user state as "denied" when using mail authentication |
323 | - if($config->enable_confirm == 'Y') $args->denied = 'Y'; |
|
381 | + if($config->enable_confirm == 'Y') { |
|
382 | + $args->denied = 'Y'; |
|
383 | + } |
|
324 | 384 | // Add extra vars after excluding necessary information from all the requested arguments |
325 | 385 | $extra_vars = delObjectVars($all_args, $args); |
326 | 386 | $args->extra_vars = serialize($extra_vars); |
@@ -335,7 +395,9 @@ discard block |
||
335 | 395 | } |
336 | 396 | } |
337 | 397 | $output = $this->insertMember($args); |
338 | - if(!$output->toBool()) return $output; |
|
398 | + if(!$output->toBool()) { |
|
399 | + return $output; |
|
400 | + } |
|
339 | 401 | |
340 | 402 | // insert ProfileImage, ImageName, ImageMark |
341 | 403 | $profile_image = $_FILES['profile_image']; |
@@ -374,43 +436,46 @@ discard block |
||
374 | 436 | if($config->identifier == 'email_address') |
375 | 437 | { |
376 | 438 | $output = $this->doLogin($args->email_address); |
377 | - } |
|
378 | - else |
|
439 | + } else |
|
379 | 440 | { |
380 | 441 | $output = $this->doLogin($args->user_id); |
381 | 442 | } |
382 | 443 | if(!$output->toBool()) { |
383 | - if($output->error == -9) |
|
384 | - $output->error = -11; |
|
444 | + if($output->error == -9) { |
|
445 | + $output->error = -11; |
|
446 | + } |
|
385 | 447 | return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), $output); |
386 | 448 | } |
387 | 449 | } |
388 | 450 | |
389 | 451 | // Results |
390 | 452 | $this->add('member_srl', $args->member_srl); |
391 | - if($config->redirect_url) $this->add('redirect_url', $config->redirect_url); |
|
453 | + if($config->redirect_url) { |
|
454 | + $this->add('redirect_url', $config->redirect_url); |
|
455 | + } |
|
392 | 456 | if($config->enable_confirm == 'Y') |
393 | 457 | { |
394 | 458 | $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address); |
395 | 459 | $this->setMessage($msg); |
396 | 460 | return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), new Object(-12, $msg)); |
461 | + } else { |
|
462 | + $this->setMessage('success_registed'); |
|
397 | 463 | } |
398 | - else $this->setMessage('success_registed'); |
|
399 | 464 | // Call a trigger (after) |
400 | 465 | $trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config); |
401 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
466 | + if(!$trigger_output->toBool()) { |
|
467 | + return $trigger_output; |
|
468 | + } |
|
402 | 469 | |
403 | 470 | if($config->redirect_url) |
404 | 471 | { |
405 | 472 | $returnUrl = $config->redirect_url; |
406 | - } |
|
407 | - else |
|
473 | + } else |
|
408 | 474 | { |
409 | 475 | if(Context::get('success_return_url')) |
410 | 476 | { |
411 | 477 | $returnUrl = Context::get('success_return_url'); |
412 | - } |
|
413 | - else if($_COOKIE['XE_REDIRECT_URL']) |
|
478 | + } else if($_COOKIE['XE_REDIRECT_URL']) |
|
414 | 479 | { |
415 | 480 | $returnUrl = $_COOKIE['XE_REDIRECT_URL']; |
416 | 481 | setcookie("XE_REDIRECT_URL", '', 1); |
@@ -464,8 +529,7 @@ discard block |
||
464 | 529 | if(Context::get('success_return_url')) |
465 | 530 | { |
466 | 531 | $redirectUrl = Context::get('success_return_url'); |
467 | - } |
|
468 | - else |
|
532 | + } else |
|
469 | 533 | { |
470 | 534 | $redirectUrl = getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberModifyInfo'); |
471 | 535 | } |
@@ -509,13 +573,17 @@ discard block |
||
509 | 573 | foreach($getVars as $val) |
510 | 574 | { |
511 | 575 | $args->{$val} = Context::get($val); |
512 | - if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); |
|
576 | + if($val == 'birthday') { |
|
577 | + $args->birthday_ui = Context::get('birthday_ui'); |
|
578 | + } |
|
513 | 579 | } |
514 | 580 | // Login Information |
515 | 581 | $logged_info = Context::get('logged_info'); |
516 | 582 | $args->member_srl = $logged_info->member_srl; |
517 | 583 | $args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
518 | - if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
584 | + if(!$args->birthday && $args->birthday_ui) { |
|
585 | + $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); |
|
586 | + } |
|
519 | 587 | // Remove some unnecessary variables from all the vars |
520 | 588 | $all_args = Context::getRequestVars(); |
521 | 589 | unset($all_args->module); |
@@ -549,7 +617,9 @@ discard block |
||
549 | 617 | |
550 | 618 | // Execute insert or update depending on the value of member_srl |
551 | 619 | $output = $this->updateMember($args); |
552 | - if(!$output->toBool()) return $output; |
|
620 | + if(!$output->toBool()) { |
|
621 | + return $output; |
|
622 | + } |
|
553 | 623 | |
554 | 624 | $profile_image = $_FILES['profile_image']; |
555 | 625 | if(is_uploaded_file($profile_image['tmp_name'])) |
@@ -579,7 +649,9 @@ discard block |
||
579 | 649 | |
580 | 650 | // Call a trigger after successfully log-in (after) |
581 | 651 | $trigger_output = ModuleHandler::triggerCall('member.procMemberModifyInfo', 'after', $this->memberInfo); |
582 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
652 | + if(!$trigger_output->toBool()) { |
|
653 | + return $trigger_output; |
|
654 | + } |
|
583 | 655 | |
584 | 656 | $this->setSessionInfo(); |
585 | 657 | // Return result |
@@ -600,7 +672,9 @@ discard block |
||
600 | 672 | */ |
601 | 673 | function procMemberModifyPassword() |
602 | 674 | { |
603 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
675 | + if(!Context::get('is_logged')) { |
|
676 | + return $this->stop('msg_not_logged'); |
|
677 | + } |
|
604 | 678 | // Extract the necessary information in advance |
605 | 679 | $current_password = trim(Context::get('current_password')); |
606 | 680 | $password = trim(Context::get('password1')); |
@@ -614,17 +688,23 @@ discard block |
||
614 | 688 | |
615 | 689 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
616 | 690 | // Verify the cuttent password |
617 | - if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) return new Object(-1, 'invalid_password'); |
|
691 | + if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl)) { |
|
692 | + return new Object(-1, 'invalid_password'); |
|
693 | + } |
|
618 | 694 | |
619 | 695 | // Check if a new password is as same as the previous password |
620 | - if($current_password == $password) return new Object(-1, 'invalid_new_password'); |
|
696 | + if($current_password == $password) { |
|
697 | + return new Object(-1, 'invalid_new_password'); |
|
698 | + } |
|
621 | 699 | |
622 | 700 | // Execute insert or update depending on the value of member_srl |
623 | 701 | $args = new stdClass; |
624 | 702 | $args->member_srl = $member_srl; |
625 | 703 | $args->password = $password; |
626 | 704 | $output = $this->updateMemberPassword($args); |
627 | - if(!$output->toBool()) return $output; |
|
705 | + if(!$output->toBool()) { |
|
706 | + return $output; |
|
707 | + } |
|
628 | 708 | |
629 | 709 | $this->add('member_srl', $args->member_srl); |
630 | 710 | $this->setMessage('success_updated'); |
@@ -640,7 +720,9 @@ discard block |
||
640 | 720 | */ |
641 | 721 | function procMemberLeave() |
642 | 722 | { |
643 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
723 | + if(!Context::get('is_logged')) { |
|
724 | + return $this->stop('msg_not_logged'); |
|
725 | + } |
|
644 | 726 | // Extract the necessary information in advance |
645 | 727 | $password = trim(Context::get('password')); |
646 | 728 | // Get information of logged-in user |
@@ -656,10 +738,14 @@ discard block |
||
656 | 738 | $this->memberInfo->password = $memberInfo->password; |
657 | 739 | } |
658 | 740 | // Verify the cuttent password |
659 | - if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) return new Object(-1, 'invalid_password'); |
|
741 | + if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password)) { |
|
742 | + return new Object(-1, 'invalid_password'); |
|
743 | + } |
|
660 | 744 | |
661 | 745 | $output = $this->deleteMember($member_srl); |
662 | - if(!$output->toBool()) return $output; |
|
746 | + if(!$output->toBool()) { |
|
747 | + return $output; |
|
748 | + } |
|
663 | 749 | // Destroy all session information |
664 | 750 | $this->destroySessionInfo(); |
665 | 751 | // Return success message |
@@ -678,17 +764,25 @@ discard block |
||
678 | 764 | { |
679 | 765 | // Check if the file is successfully uploaded |
680 | 766 | $file = $_FILES['profile_image']; |
681 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image'); |
|
767 | + if(!is_uploaded_file($file['tmp_name'])) { |
|
768 | + return $this->stop('msg_not_uploaded_profile_image'); |
|
769 | + } |
|
682 | 770 | // Ignore if member_srl is invalid or doesn't exist. |
683 | 771 | $member_srl = Context::get('member_srl'); |
684 | - if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image'); |
|
772 | + if(!$member_srl) { |
|
773 | + return $this->stop('msg_not_uploaded_profile_image'); |
|
774 | + } |
|
685 | 775 | |
686 | 776 | $logged_info = Context::get('logged_info'); |
687 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image'); |
|
777 | + if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) { |
|
778 | + return $this->stop('msg_not_uploaded_profile_image'); |
|
779 | + } |
|
688 | 780 | // Return if member module is set not to use an image name or the user is not an administrator ; |
689 | 781 | $oModuleModel = getModel('module'); |
690 | 782 | $config = $oModuleModel->getModuleConfig('member'); |
691 | - if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image'); |
|
783 | + if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') { |
|
784 | + return $this->stop('msg_not_uploaded_profile_image'); |
|
785 | + } |
|
692 | 786 | |
693 | 787 | $this->insertProfileImage($member_srl, $file['tmp_name']); |
694 | 788 | // Page refresh |
@@ -710,26 +804,35 @@ discard block |
||
710 | 804 | { |
711 | 805 | |
712 | 806 | // Check uploaded file |
713 | - if(!checkUploadedFile($target_file)) return; |
|
807 | + if(!checkUploadedFile($target_file)) { |
|
808 | + return; |
|
809 | + } |
|
714 | 810 | |
715 | 811 | $oMemberModel = getModel('member'); |
716 | 812 | $config = $oMemberModel->getMemberConfig(); |
717 | 813 | |
718 | 814 | // Get an image size |
719 | 815 | $max_width = $config->profile_image_max_width; |
720 | - if(!$max_width) $max_width = "90"; |
|
816 | + if(!$max_width) { |
|
817 | + $max_width = "90"; |
|
818 | + } |
|
721 | 819 | $max_height = $config->profile_image_max_height; |
722 | - if(!$max_height) $max_height = "90"; |
|
820 | + if(!$max_height) { |
|
821 | + $max_height = "90"; |
|
822 | + } |
|
723 | 823 | // Get a target path to save |
724 | 824 | $target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl)); |
725 | 825 | FileHandler::makeDir($target_path); |
726 | 826 | |
727 | 827 | // Get file information |
728 | 828 | list($width, $height, $type, $attrs) = @getimagesize($target_file); |
729 | - if(IMAGETYPE_PNG == $type) $ext = 'png'; |
|
730 | - elseif(IMAGETYPE_JPEG == $type) $ext = 'jpg'; |
|
731 | - elseif(IMAGETYPE_GIF == $type) $ext = 'gif'; |
|
732 | - else |
|
829 | + if(IMAGETYPE_PNG == $type) { |
|
830 | + $ext = 'png'; |
|
831 | + } elseif(IMAGETYPE_JPEG == $type) { |
|
832 | + $ext = 'jpg'; |
|
833 | + } elseif(IMAGETYPE_GIF == $type) { |
|
834 | + $ext = 'gif'; |
|
835 | + } else |
|
733 | 836 | { |
734 | 837 | return; |
735 | 838 | } |
@@ -741,8 +844,7 @@ discard block |
||
741 | 844 | if(($width > $max_width || $height > $max_height ) && $type != 1) |
742 | 845 | { |
743 | 846 | FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext); |
744 | - } |
|
745 | - else |
|
847 | + } else |
|
746 | 848 | { |
747 | 849 | @copy($target_file, $target_filename); |
748 | 850 | } |
@@ -757,17 +859,25 @@ discard block |
||
757 | 859 | { |
758 | 860 | // Check if the file is successfully uploaded |
759 | 861 | $file = $_FILES['image_name']; |
760 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name'); |
|
862 | + if(!is_uploaded_file($file['tmp_name'])) { |
|
863 | + return $this->stop('msg_not_uploaded_image_name'); |
|
864 | + } |
|
761 | 865 | // Ignore if member_srl is invalid or doesn't exist. |
762 | 866 | $member_srl = Context::get('member_srl'); |
763 | - if(!$member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
867 | + if(!$member_srl) { |
|
868 | + return $this->stop('msg_not_uploaded_image_name'); |
|
869 | + } |
|
764 | 870 | |
765 | 871 | $logged_info = Context::get('logged_info'); |
766 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name'); |
|
872 | + if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) { |
|
873 | + return $this->stop('msg_not_uploaded_image_name'); |
|
874 | + } |
|
767 | 875 | // Return if member module is set not to use an image name or the user is not an administrator ; |
768 | 876 | $oModuleModel = getModel('module'); |
769 | 877 | $config = $oModuleModel->getModuleConfig('member'); |
770 | - if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name'); |
|
878 | + if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') { |
|
879 | + return $this->stop('msg_not_uploaded_image_name'); |
|
880 | + } |
|
771 | 881 | |
772 | 882 | $this->insertImageName($member_srl, $file['tmp_name']); |
773 | 883 | // Page refresh |
@@ -788,15 +898,21 @@ discard block |
||
788 | 898 | function insertImageName($member_srl, $target_file) |
789 | 899 | { |
790 | 900 | // Check uploaded file |
791 | - if(!checkUploadedFile($target_file)) return; |
|
901 | + if(!checkUploadedFile($target_file)) { |
|
902 | + return; |
|
903 | + } |
|
792 | 904 | |
793 | 905 | $oModuleModel = getModel('module'); |
794 | 906 | $config = $oModuleModel->getModuleConfig('member'); |
795 | 907 | // Get an image size |
796 | 908 | $max_width = $config->image_name_max_width; |
797 | - if(!$max_width) $max_width = "90"; |
|
909 | + if(!$max_width) { |
|
910 | + $max_width = "90"; |
|
911 | + } |
|
798 | 912 | $max_height = $config->image_name_max_height; |
799 | - if(!$max_height) $max_height = "20"; |
|
913 | + if(!$max_height) { |
|
914 | + $max_height = "20"; |
|
915 | + } |
|
800 | 916 | // Get a target path to save |
801 | 917 | $target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl)); |
802 | 918 | FileHandler::makeDir($target_path); |
@@ -805,8 +921,11 @@ discard block |
||
805 | 921 | // Get file information |
806 | 922 | list($width, $height, $type, $attrs) = @getimagesize($target_file); |
807 | 923 | // Convert if the image size is larger than a given size or if the format is not a gif |
808 | - if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif'); |
|
809 | - else @copy($target_file, $target_filename); |
|
924 | + if($width > $max_width || $height > $max_height || $type!=1) { |
|
925 | + FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif'); |
|
926 | + } else { |
|
927 | + @copy($target_file, $target_filename); |
|
928 | + } |
|
810 | 929 | } |
811 | 930 | |
812 | 931 | /** |
@@ -866,17 +985,25 @@ discard block |
||
866 | 985 | { |
867 | 986 | // Check if the file is successfully uploaded |
868 | 987 | $file = $_FILES['image_mark']; |
869 | - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark'); |
|
988 | + if(!is_uploaded_file($file['tmp_name'])) { |
|
989 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
990 | + } |
|
870 | 991 | // Ignore if member_srl is invalid or doesn't exist. |
871 | 992 | $member_srl = Context::get('member_srl'); |
872 | - if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
993 | + if(!$member_srl) { |
|
994 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
995 | + } |
|
873 | 996 | |
874 | 997 | $logged_info = Context::get('logged_info'); |
875 | - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark'); |
|
998 | + if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) { |
|
999 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
1000 | + } |
|
876 | 1001 | // Membership in the images mark the module using the ban was set by an administrator or return; |
877 | 1002 | $oModuleModel = getModel('module'); |
878 | 1003 | $config = $oModuleModel->getModuleConfig('member'); |
879 | - if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark'); |
|
1004 | + if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') { |
|
1005 | + return $this->stop('msg_not_uploaded_image_mark'); |
|
1006 | + } |
|
880 | 1007 | |
881 | 1008 | $this->insertImageMark($member_srl, $file['tmp_name']); |
882 | 1009 | // Page refresh |
@@ -897,15 +1024,21 @@ discard block |
||
897 | 1024 | function insertImageMark($member_srl, $target_file) |
898 | 1025 | { |
899 | 1026 | // Check uploaded file |
900 | - if(!checkUploadedFile($target_file)) return; |
|
1027 | + if(!checkUploadedFile($target_file)) { |
|
1028 | + return; |
|
1029 | + } |
|
901 | 1030 | |
902 | 1031 | $oModuleModel = getModel('module'); |
903 | 1032 | $config = $oModuleModel->getModuleConfig('member'); |
904 | 1033 | // Get an image size |
905 | 1034 | $max_width = $config->image_mark_max_width; |
906 | - if(!$max_width) $max_width = "20"; |
|
1035 | + if(!$max_width) { |
|
1036 | + $max_width = "20"; |
|
1037 | + } |
|
907 | 1038 | $max_height = $config->image_mark_max_height; |
908 | - if(!$max_height) $max_height = "20"; |
|
1039 | + if(!$max_height) { |
|
1040 | + $max_height = "20"; |
|
1041 | + } |
|
909 | 1042 | |
910 | 1043 | $target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl)); |
911 | 1044 | FileHandler::makeDir($target_path); |
@@ -914,8 +1047,11 @@ discard block |
||
914 | 1047 | // Get file information |
915 | 1048 | list($width, $height, $type, $attrs) = @getimagesize($target_file); |
916 | 1049 | |
917 | - if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif'); |
|
918 | - else @copy($target_file, $target_filename); |
|
1050 | + if($width > $max_width || $height > $max_height || $type!=1) { |
|
1051 | + FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif'); |
|
1052 | + } else { |
|
1053 | + @copy($target_file, $target_filename); |
|
1054 | + } |
|
919 | 1055 | } |
920 | 1056 | |
921 | 1057 | /** |
@@ -950,14 +1086,18 @@ discard block |
||
950 | 1086 | function procMemberFindAccount() |
951 | 1087 | { |
952 | 1088 | $email_address = Context::get('email_address'); |
953 | - if(!$email_address) return new Object(-1, 'msg_invalid_request'); |
|
1089 | + if(!$email_address) { |
|
1090 | + return new Object(-1, 'msg_invalid_request'); |
|
1091 | + } |
|
954 | 1092 | |
955 | 1093 | $oMemberModel = getModel('member'); |
956 | 1094 | $oModuleModel = getModel('module'); |
957 | 1095 | |
958 | 1096 | // Check if a member having the same email address exists |
959 | 1097 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
960 | - if(!$member_srl) return new Object(-1, 'msg_email_not_exists'); |
|
1098 | + if(!$member_srl) { |
|
1099 | + return new Object(-1, 'msg_email_not_exists'); |
|
1100 | + } |
|
961 | 1101 | |
962 | 1102 | // Get information of the member |
963 | 1103 | $columnList = array('denied', 'member_srl', 'user_id', 'user_name', 'email_address', 'nick_name'); |
@@ -969,7 +1109,9 @@ discard block |
||
969 | 1109 | $chk_args = new stdClass; |
970 | 1110 | $chk_args->member_srl = $member_info->member_srl; |
971 | 1111 | $output = executeQuery('member.chkAuthMail', $chk_args); |
972 | - if($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed'); |
|
1112 | + if($output->toBool() && $output->data->count != '0') { |
|
1113 | + return new Object(-1, 'msg_user_not_confirmed'); |
|
1114 | + } |
|
973 | 1115 | } |
974 | 1116 | |
975 | 1117 | // Insert data into the authentication DB |
@@ -982,7 +1124,9 @@ discard block |
||
982 | 1124 | $args->is_register = 'N'; |
983 | 1125 | |
984 | 1126 | $output = executeQuery('member.insertAuthMail', $args); |
985 | - if(!$output->toBool()) return $output; |
|
1127 | + if(!$output->toBool()) { |
|
1128 | + return $output; |
|
1129 | + } |
|
986 | 1130 | // Get content of the email to send a member |
987 | 1131 | Context::set('auth_args', $args); |
988 | 1132 | |
@@ -999,8 +1143,7 @@ discard block |
||
999 | 1143 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
1000 | 1144 | } |
1001 | 1145 | } |
1002 | - } |
|
1003 | - else |
|
1146 | + } else |
|
1004 | 1147 | { |
1005 | 1148 | $memberInfo[$lang->user_id] = $args->user_id; |
1006 | 1149 | $memberInfo[$lang->user_name] = $args->user_name; |
@@ -1009,13 +1152,19 @@ discard block |
||
1009 | 1152 | } |
1010 | 1153 | Context::set('memberInfo', $memberInfo); |
1011 | 1154 | |
1012 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
1013 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
1155 | + if(!$member_config->skin) { |
|
1156 | + $member_config->skin = "default"; |
|
1157 | + } |
|
1158 | + if(!$member_config->colorset) { |
|
1159 | + $member_config->colorset = "white"; |
|
1160 | + } |
|
1014 | 1161 | |
1015 | 1162 | Context::set('member_config', $member_config); |
1016 | 1163 | |
1017 | 1164 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
1018 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1165 | + if(!is_dir($tpl_path)) { |
|
1166 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1167 | + } |
|
1019 | 1168 | |
1020 | 1169 | $find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key); |
1021 | 1170 | Context::set('find_url', $find_url); |
@@ -1057,20 +1206,28 @@ discard block |
||
1057 | 1206 | $find_account_question = trim(Context::get('find_account_question')); |
1058 | 1207 | $find_account_answer = trim(Context::get('find_account_answer')); |
1059 | 1208 | |
1060 | - if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request'); |
|
1209 | + if(($config->identifier == 'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer) { |
|
1210 | + return new Object(-1, 'msg_invalid_request'); |
|
1211 | + } |
|
1061 | 1212 | |
1062 | 1213 | $oModuleModel = getModel('module'); |
1063 | 1214 | // Check if a member having the same email address exists |
1064 | 1215 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
1065 | - if(!$member_srl) return new Object(-1, 'msg_email_not_exists'); |
|
1216 | + if(!$member_srl) { |
|
1217 | + return new Object(-1, 'msg_email_not_exists'); |
|
1218 | + } |
|
1066 | 1219 | // Get information of the member |
1067 | 1220 | $columnList = array('member_srl', 'find_account_question', 'find_account_answer'); |
1068 | 1221 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
1069 | 1222 | |
1070 | 1223 | // Display a message if no answer is entered |
1071 | - if(!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists'); |
|
1224 | + if(!$member_info->find_account_question || !$member_info->find_account_answer) { |
|
1225 | + return new Object(-1, 'msg_question_not_exists'); |
|
1226 | + } |
|
1072 | 1227 | |
1073 | - if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) return new Object(-1, 'msg_answer_not_matches'); |
|
1228 | + if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) { |
|
1229 | + return new Object(-1, 'msg_answer_not_matches'); |
|
1230 | + } |
|
1074 | 1231 | |
1075 | 1232 | if($config->identifier == 'email_address') |
1076 | 1233 | { |
@@ -1086,7 +1243,9 @@ discard block |
||
1086 | 1243 | $args->password = $temp_password; |
1087 | 1244 | $args->change_password_date = '1'; |
1088 | 1245 | $output = $this->updateMemberPassword($args); |
1089 | - if(!$output->toBool()) return $output; |
|
1246 | + if(!$output->toBool()) { |
|
1247 | + return $output; |
|
1248 | + } |
|
1090 | 1249 | |
1091 | 1250 | $_SESSION['xe_temp_password_' . $user_id] = $temp_password; |
1092 | 1251 | |
@@ -1143,8 +1302,7 @@ discard block |
||
1143 | 1302 | if($output->data->is_register == 'Y') |
1144 | 1303 | { |
1145 | 1304 | $args->denied = 'N'; |
1146 | - } |
|
1147 | - else |
|
1305 | + } else |
|
1148 | 1306 | { |
1149 | 1307 | $args->password = $oMemberModel->hashPassword($args->password); |
1150 | 1308 | } |
@@ -1178,33 +1336,45 @@ discard block |
||
1178 | 1336 | { |
1179 | 1337 | // Get an email_address |
1180 | 1338 | $email_address = Context::get('email_address'); |
1181 | - if(!$email_address) return new Object(-1, 'msg_invalid_request'); |
|
1339 | + if(!$email_address) { |
|
1340 | + return new Object(-1, 'msg_invalid_request'); |
|
1341 | + } |
|
1182 | 1342 | // Log test by using email_address |
1183 | 1343 | $oMemberModel = getModel('member'); |
1184 | 1344 | |
1185 | 1345 | $args = new stdClass; |
1186 | 1346 | $args->email_address = $email_address; |
1187 | 1347 | $memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address); |
1188 | - if(!$memberSrl) return new Object(-1, 'msg_not_exists_member'); |
|
1348 | + if(!$memberSrl) { |
|
1349 | + return new Object(-1, 'msg_not_exists_member'); |
|
1350 | + } |
|
1189 | 1351 | |
1190 | 1352 | $columnList = array('member_srl', 'user_id', 'user_name', 'nick_name', 'email_address'); |
1191 | 1353 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList); |
1192 | 1354 | |
1193 | 1355 | $oModuleModel = getModel('module'); |
1194 | 1356 | $member_config = $oModuleModel->getModuleConfig('member'); |
1195 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
1196 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
1357 | + if(!$member_config->skin) { |
|
1358 | + $member_config->skin = "default"; |
|
1359 | + } |
|
1360 | + if(!$member_config->colorset) { |
|
1361 | + $member_config->colorset = "white"; |
|
1362 | + } |
|
1197 | 1363 | |
1198 | 1364 | // Check if a authentication mail has been sent previously |
1199 | 1365 | $chk_args = new stdClass; |
1200 | 1366 | $chk_args->member_srl = $member_info->member_srl; |
1201 | 1367 | $output = executeQuery('member.chkAuthMail', $chk_args); |
1202 | - if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request'); |
|
1368 | + if($output->toBool() && $output->data->count == '0') { |
|
1369 | + return new Object(-1, 'msg_invalid_request'); |
|
1370 | + } |
|
1203 | 1371 | |
1204 | 1372 | $auth_args = new stdClass; |
1205 | 1373 | $auth_args->member_srl = $member_info->member_srl; |
1206 | 1374 | $output = executeQueryArray('member.getAuthMailInfo', $auth_args); |
1207 | - if(!$output->data || !$output->data[0]->auth_key) return new Object(-1, 'msg_invalid_request'); |
|
1375 | + if(!$output->data || !$output->data[0]->auth_key) { |
|
1376 | + return new Object(-1, 'msg_invalid_request'); |
|
1377 | + } |
|
1208 | 1378 | $auth_info = $output->data[0]; |
1209 | 1379 | |
1210 | 1380 | // Update the regdate of authmail entry |
@@ -1225,8 +1395,7 @@ discard block |
||
1225 | 1395 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
1226 | 1396 | } |
1227 | 1397 | } |
1228 | - } |
|
1229 | - else |
|
1398 | + } else |
|
1230 | 1399 | { |
1231 | 1400 | $memberInfo[$lang->user_id] = $member_info->user_id; |
1232 | 1401 | $memberInfo[$lang->user_name] = $member_info->user_name; |
@@ -1239,7 +1408,9 @@ discard block |
||
1239 | 1408 | Context::set('member_config', $member_config); |
1240 | 1409 | |
1241 | 1410 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
1242 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1411 | + if(!is_dir($tpl_path)) { |
|
1412 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1413 | + } |
|
1243 | 1414 | |
1244 | 1415 | $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key); |
1245 | 1416 | Context::set('auth_url', $auth_url); |
@@ -1317,7 +1488,9 @@ discard block |
||
1317 | 1488 | $auth_args->is_register = 'Y'; |
1318 | 1489 | |
1319 | 1490 | $output = executeQuery('member.insertAuthMail', $auth_args); |
1320 | - if(!$output->toBool()) return $output; |
|
1491 | + if(!$output->toBool()) { |
|
1492 | + return $output; |
|
1493 | + } |
|
1321 | 1494 | |
1322 | 1495 | $memberInfo->email_address = $newEmail; |
1323 | 1496 | |
@@ -1351,8 +1524,7 @@ discard block |
||
1351 | 1524 | $memberInfo[$lang->{$form->name}] = $member_info->{$form->name}; |
1352 | 1525 | } |
1353 | 1526 | } |
1354 | - } |
|
1355 | - else |
|
1527 | + } else |
|
1356 | 1528 | { |
1357 | 1529 | $memberInfo[$lang->user_id] = $member_info->user_id; |
1358 | 1530 | $memberInfo[$lang->user_name] = $member_info->user_name; |
@@ -1361,13 +1533,19 @@ discard block |
||
1361 | 1533 | } |
1362 | 1534 | Context::set('memberInfo', $memberInfo); |
1363 | 1535 | |
1364 | - if(!$member_config->skin) $member_config->skin = "default"; |
|
1365 | - if(!$member_config->colorset) $member_config->colorset = "white"; |
|
1536 | + if(!$member_config->skin) { |
|
1537 | + $member_config->skin = "default"; |
|
1538 | + } |
|
1539 | + if(!$member_config->colorset) { |
|
1540 | + $member_config->colorset = "white"; |
|
1541 | + } |
|
1366 | 1542 | |
1367 | 1543 | Context::set('member_config', $member_config); |
1368 | 1544 | |
1369 | 1545 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
1370 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1546 | + if(!is_dir($tpl_path)) { |
|
1547 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
1548 | + } |
|
1371 | 1549 | |
1372 | 1550 | $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key); |
1373 | 1551 | Context::set('auth_url', $auth_url); |
@@ -1392,7 +1570,9 @@ discard block |
||
1392 | 1570 | { |
1393 | 1571 | $site_module_info = Context::get('site_module_info'); |
1394 | 1572 | $logged_info = Context::get('logged_info'); |
1395 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request'); |
|
1573 | + if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) { |
|
1574 | + return new Object(-1,'msg_invalid_request'); |
|
1575 | + } |
|
1396 | 1576 | |
1397 | 1577 | $oMemberModel = getModel('member'); |
1398 | 1578 | $columnList = array('site_srl', 'group_srl', 'title'); |
@@ -1411,13 +1591,17 @@ discard block |
||
1411 | 1591 | { |
1412 | 1592 | $site_module_info = Context::get('site_module_info'); |
1413 | 1593 | $logged_info = Context::get('logged_info'); |
1414 | - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request'); |
|
1594 | + if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) { |
|
1595 | + return new Object(-1,'msg_invalid_request'); |
|
1596 | + } |
|
1415 | 1597 | |
1416 | 1598 | $args = new stdClass; |
1417 | 1599 | $args->site_srl= $site_module_info->site_srl; |
1418 | 1600 | $args->member_srl = $logged_info->member_srl; |
1419 | 1601 | $output = executeQuery('member.deleteMembersGroup', $args); |
1420 | - if(!$output->toBool()) return $output; |
|
1602 | + if(!$output->toBool()) { |
|
1603 | + return $output; |
|
1604 | + } |
|
1421 | 1605 | $this->setMessage('success_deleted'); |
1422 | 1606 | $this->_clearMemberCache($args->member_srl, $site_module_info->site_srl); |
1423 | 1607 | } |
@@ -1431,17 +1615,37 @@ discard block |
||
1431 | 1615 | */ |
1432 | 1616 | function setMemberConfig($args) |
1433 | 1617 | { |
1434 | - if(!$args->skin) $args->skin = "default"; |
|
1435 | - if(!$args->colorset) $args->colorset = "white"; |
|
1436 | - if(!$args->editor_skin) $args->editor_skin= "ckeditor"; |
|
1437 | - if(!$args->editor_colorset) $args->editor_colorset = "moono"; |
|
1438 | - if($args->enable_join!='Y') $args->enable_join = 'N'; |
|
1618 | + if(!$args->skin) { |
|
1619 | + $args->skin = "default"; |
|
1620 | + } |
|
1621 | + if(!$args->colorset) { |
|
1622 | + $args->colorset = "white"; |
|
1623 | + } |
|
1624 | + if(!$args->editor_skin) { |
|
1625 | + $args->editor_skin= "ckeditor"; |
|
1626 | + } |
|
1627 | + if(!$args->editor_colorset) { |
|
1628 | + $args->editor_colorset = "moono"; |
|
1629 | + } |
|
1630 | + if($args->enable_join!='Y') { |
|
1631 | + $args->enable_join = 'N'; |
|
1632 | + } |
|
1439 | 1633 | $args->enable_openid= 'N'; |
1440 | - if($args->profile_image !='Y') $args->profile_image = 'N'; |
|
1441 | - if($args->image_name!='Y') $args->image_name = 'N'; |
|
1442 | - if($args->image_mark!='Y') $args->image_mark = 'N'; |
|
1443 | - if($args->group_image_mark!='Y') $args->group_image_mark = 'N'; |
|
1444 | - if(!trim(strip_tags($args->agreement))) $args->agreement = null; |
|
1634 | + if($args->profile_image !='Y') { |
|
1635 | + $args->profile_image = 'N'; |
|
1636 | + } |
|
1637 | + if($args->image_name!='Y') { |
|
1638 | + $args->image_name = 'N'; |
|
1639 | + } |
|
1640 | + if($args->image_mark!='Y') { |
|
1641 | + $args->image_mark = 'N'; |
|
1642 | + } |
|
1643 | + if($args->group_image_mark!='Y') { |
|
1644 | + $args->group_image_mark = 'N'; |
|
1645 | + } |
|
1646 | + if(!trim(strip_tags($args->agreement))) { |
|
1647 | + $args->agreement = null; |
|
1648 | + } |
|
1445 | 1649 | $args->limit_day = (int)$args->limit_day; |
1446 | 1650 | |
1447 | 1651 | $agreement = trim($args->agreement); |
@@ -1449,7 +1653,9 @@ discard block |
||
1449 | 1653 | |
1450 | 1654 | $oModuleController = getController('module'); |
1451 | 1655 | $output = $oModuleController->insertModuleConfig('member',$args); |
1452 | - if(!$output->toBool()) return $output; |
|
1656 | + if(!$output->toBool()) { |
|
1657 | + return $output; |
|
1658 | + } |
|
1453 | 1659 | |
1454 | 1660 | $agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt'; |
1455 | 1661 | FileHandler::writeFile($agreement_file, $agreement); |
@@ -1475,7 +1681,9 @@ discard block |
||
1475 | 1681 | $path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl)); |
1476 | 1682 | $filename = sprintf('%s%d.signature.php', $path, $member_srl); |
1477 | 1683 | |
1478 | - if(!$check_signature) return FileHandler::removeFile($filename); |
|
1684 | + if(!$check_signature) { |
|
1685 | + return FileHandler::removeFile($filename); |
|
1686 | + } |
|
1479 | 1687 | |
1480 | 1688 | $buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature); |
1481 | 1689 | FileHandler::makeDir($path); |
@@ -1509,7 +1717,9 @@ discard block |
||
1509 | 1717 | $args = new stdClass(); |
1510 | 1718 | $args->member_srl = $member_srl; |
1511 | 1719 | $args->group_srl = $group_srl; |
1512 | - if($site_srl) $args->site_srl = $site_srl; |
|
1720 | + if($site_srl) { |
|
1721 | + $args->site_srl = $site_srl; |
|
1722 | + } |
|
1513 | 1723 | |
1514 | 1724 | // Add |
1515 | 1725 | $output = executeQuery('member.addMemberToGroup',$args); |
@@ -1535,15 +1745,21 @@ discard block |
||
1535 | 1745 | $obj->member_srl = implode(',',$args->member_srl); |
1536 | 1746 | |
1537 | 1747 | $output = executeQueryArray('member.getMembersGroup', $obj); |
1538 | - if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
1748 | + if($output->data) { |
|
1749 | + foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; |
|
1750 | + } |
|
1539 | 1751 | |
1540 | 1752 | $output = executeQuery('member.deleteMembersGroup', $obj); |
1541 | - if(!$output->toBool()) return $output; |
|
1753 | + if(!$output->toBool()) { |
|
1754 | + return $output; |
|
1755 | + } |
|
1542 | 1756 | |
1543 | 1757 | $inserted_members = array(); |
1544 | 1758 | foreach($args->member_srl as $key => $val) |
1545 | 1759 | { |
1546 | - if($inserted_members[$val]) continue; |
|
1760 | + if($inserted_members[$val]) { |
|
1761 | + continue; |
|
1762 | + } |
|
1547 | 1763 | $inserted_members[$val] = true; |
1548 | 1764 | |
1549 | 1765 | unset($obj); |
@@ -1553,7 +1769,9 @@ discard block |
||
1553 | 1769 | $obj->site_srl = $args->site_srl; |
1554 | 1770 | $obj->regdate = $date[$obj->member_srl]; |
1555 | 1771 | $output = executeQuery('member.addMemberToGroup', $obj); |
1556 | - if(!$output->toBool()) return $output; |
|
1772 | + if(!$output->toBool()) { |
|
1773 | + return $output; |
|
1774 | + } |
|
1557 | 1775 | |
1558 | 1776 | $this->_clearMemberCache($obj->member_srl, $args->site_srl); |
1559 | 1777 | } |
@@ -1615,8 +1833,7 @@ discard block |
||
1615 | 1833 | if($config->identifier == 'user_id') |
1616 | 1834 | { |
1617 | 1835 | $member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList); |
1618 | - } |
|
1619 | - else |
|
1836 | + } else |
|
1620 | 1837 | { |
1621 | 1838 | $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList); |
1622 | 1839 | } |
@@ -1625,8 +1842,7 @@ discard block |
||
1625 | 1842 | $do_auto_login = true; |
1626 | 1843 | } |
1627 | 1844 | |
1628 | - } |
|
1629 | - else |
|
1845 | + } else |
|
1630 | 1846 | { |
1631 | 1847 | $do_auto_login = true; |
1632 | 1848 | } |
@@ -1635,8 +1851,7 @@ discard block |
||
1635 | 1851 | if($do_auto_login) |
1636 | 1852 | { |
1637 | 1853 | $output = $this->doLogin($user_id); |
1638 | - } |
|
1639 | - else |
|
1854 | + } else |
|
1640 | 1855 | { |
1641 | 1856 | executeQuery('member.deleteAutologin', $args); |
1642 | 1857 | setCookie('xeak',null,$_SERVER['REQUEST_TIME']+60*60*24*365, '/'); |
@@ -1655,13 +1870,17 @@ discard block |
||
1655 | 1870 | function doLogin($user_id, $password = '', $keep_signed = false) |
1656 | 1871 | { |
1657 | 1872 | $user_id = strtolower($user_id); |
1658 | - if(!$user_id) return new Object(-1, 'null_user_id'); |
|
1873 | + if(!$user_id) { |
|
1874 | + return new Object(-1, 'null_user_id'); |
|
1875 | + } |
|
1659 | 1876 | // Call a trigger before log-in (before) |
1660 | 1877 | $trigger_obj = new stdClass(); |
1661 | 1878 | $trigger_obj->user_id = $user_id; |
1662 | 1879 | $trigger_obj->password = $password; |
1663 | 1880 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj); |
1664 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
1881 | + if(!$trigger_output->toBool()) { |
|
1882 | + return $trigger_output; |
|
1883 | + } |
|
1665 | 1884 | // Create a member model object |
1666 | 1885 | $oMemberModel = getModel('member'); |
1667 | 1886 | |
@@ -1676,15 +1895,18 @@ discard block |
||
1676 | 1895 | // Get user_id information |
1677 | 1896 | $this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id); |
1678 | 1897 | // Set an invalid user if no value returned |
1679 | - if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_email_address'); |
|
1898 | + if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) { |
|
1899 | + return $this->recordLoginError(-1, 'invalid_email_address'); |
|
1900 | + } |
|
1680 | 1901 | |
1681 | - } |
|
1682 | - else |
|
1902 | + } else |
|
1683 | 1903 | { |
1684 | 1904 | // Get user_id information |
1685 | 1905 | $this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id); |
1686 | 1906 | // Set an invalid user if no value returned |
1687 | - if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) return $this->recordLoginError(-1, 'invalid_user_id'); |
|
1907 | + if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) { |
|
1908 | + return $this->recordLoginError(-1, 'invalid_user_id'); |
|
1909 | + } |
|
1688 | 1910 | } |
1689 | 1911 | |
1690 | 1912 | $output = executeQuery('member.getLoginCountByIp', $args); |
@@ -1696,14 +1918,18 @@ discard block |
||
1696 | 1918 | if($term < $config->max_error_count_time) |
1697 | 1919 | { |
1698 | 1920 | $term = $config->max_error_count_time - $term; |
1699 | - if($term < 60) $term = intval($term).Context::getLang('unit_sec'); |
|
1700 | - elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min'); |
|
1701 | - elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour'); |
|
1702 | - else $term = intval($term/86400).Context::getLang('unit_day'); |
|
1921 | + if($term < 60) { |
|
1922 | + $term = intval($term).Context::getLang('unit_sec'); |
|
1923 | + } elseif(60 <= $term && $term < 3600) { |
|
1924 | + $term = intval($term/60).Context::getLang('unit_min'); |
|
1925 | + } elseif(3600 <= $term && $term < 86400) { |
|
1926 | + $term = intval($term/3600).Context::getLang('unit_hour'); |
|
1927 | + } else { |
|
1928 | + $term = intval($term/86400).Context::getLang('unit_day'); |
|
1929 | + } |
|
1703 | 1930 | |
1704 | 1931 | return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term)); |
1705 | - } |
|
1706 | - else |
|
1932 | + } else |
|
1707 | 1933 | { |
1708 | 1934 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
1709 | 1935 | $output = executeQuery('member.deleteLoginCountByIp', $args); |
@@ -1730,7 +1956,9 @@ discard block |
||
1730 | 1956 | return new Object(-1,'msg_user_denied'); |
1731 | 1957 | } |
1732 | 1958 | // Notify if denied_date is less than the current time |
1733 | - 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"))); |
|
1959 | + if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) { |
|
1960 | + return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d"))); |
|
1961 | + } |
|
1734 | 1962 | // Update the latest login time |
1735 | 1963 | $args->member_srl = $this->memberInfo->member_srl; |
1736 | 1964 | $output = executeQuery('member.updateLastLogin', $args); |
@@ -1779,7 +2007,9 @@ discard block |
||
1779 | 2007 | } |
1780 | 2008 | // Call a trigger after successfully log-in (after) |
1781 | 2009 | $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo); |
1782 | - if(!$trigger_output->toBool()) return $trigger_output; |
|
2010 | + if(!$trigger_output->toBool()) { |
|
2011 | + return $trigger_output; |
|
2012 | + } |
|
1783 | 2013 | // When user checked to use auto-login |
1784 | 2014 | if($keep_signed) |
1785 | 2015 | { |
@@ -1793,7 +2023,9 @@ discard block |
||
1793 | 2023 | $autologin_args->member_srl = $this->memberInfo->member_srl; |
1794 | 2024 | executeQuery('member.deleteAutologin', $autologin_args); |
1795 | 2025 | $autologin_output = executeQuery('member.insertAutologin', $autologin_args); |
1796 | - if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000, '/'); |
|
2026 | + if($autologin_output->toBool()) { |
|
2027 | + setCookie('xeak',$autologin_args->autologin_key, $_SERVER['REQUEST_TIME']+31536000, '/'); |
|
2028 | + } |
|
1797 | 2029 | } |
1798 | 2030 | if($this->memberInfo->is_admin == 'Y') |
1799 | 2031 | { |
@@ -1882,7 +2114,9 @@ discard block |
||
1882 | 2114 | function addMemberPopupMenu($url, $str, $icon = '', $target = 'self') |
1883 | 2115 | { |
1884 | 2116 | $member_popup_menu_list = Context::get('member_popup_menu_list'); |
1885 | - if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array(); |
|
2117 | + if(!is_array($member_popup_menu_list)) { |
|
2118 | + $member_popup_menu_list = array(); |
|
2119 | + } |
|
1886 | 2120 | |
1887 | 2121 | $obj = new stdClass; |
1888 | 2122 | $obj->url = $url; |
@@ -1901,35 +2135,52 @@ discard block |
||
1901 | 2135 | { |
1902 | 2136 | // Call a trigger (before) |
1903 | 2137 | $output = ModuleHandler::triggerCall('member.insertMember', 'before', $args); |
1904 | - if(!$output->toBool()) return $output; |
|
2138 | + if(!$output->toBool()) { |
|
2139 | + return $output; |
|
2140 | + } |
|
1905 | 2141 | // Terms and Conditions portion of the information set up by members reaffirmed |
1906 | 2142 | $oModuleModel = getModel('module'); |
1907 | 2143 | $config = $oModuleModel->getModuleConfig('member'); |
1908 | 2144 | |
1909 | 2145 | $logged_info = Context::get('logged_info'); |
1910 | 2146 | // If the date of the temporary restrictions limit further information on the date of |
1911 | - if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24); |
|
2147 | + if($config->limit_day) { |
|
2148 | + $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24); |
|
2149 | + } |
|
1912 | 2150 | |
1913 | 2151 | $args->member_srl = getNextSequence(); |
1914 | 2152 | $args->list_order = -1 * $args->member_srl; |
1915 | 2153 | |
1916 | 2154 | // Execute insert or update depending on the value of member_srl |
1917 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
2155 | + if(!$args->user_id) { |
|
2156 | + $args->user_id = 't'.$args->member_srl; |
|
2157 | + } |
|
1918 | 2158 | // Enter the user's identity changed to lowercase |
1919 | - else $args->user_id = strtolower($args->user_id); |
|
1920 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
1921 | - if(!$args->nick_name) $args->nick_name = $args->member_srl; |
|
2159 | + else { |
|
2160 | + $args->user_id = strtolower($args->user_id); |
|
2161 | + } |
|
2162 | + if(!$args->user_name) { |
|
2163 | + $args->user_name = $args->member_srl; |
|
2164 | + } |
|
2165 | + if(!$args->nick_name) { |
|
2166 | + $args->nick_name = $args->member_srl; |
|
2167 | + } |
|
1922 | 2168 | |
1923 | 2169 | // Control of essential parameters |
1924 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
1925 | - if($args->denied!='Y') $args->denied = 'N'; |
|
2170 | + if($args->allow_mailing!='Y') { |
|
2171 | + $args->allow_mailing = 'N'; |
|
2172 | + } |
|
2173 | + if($args->denied!='Y') { |
|
2174 | + $args->denied = 'N'; |
|
2175 | + } |
|
1926 | 2176 | $args->allow_message= 'Y'; |
1927 | 2177 | |
1928 | 2178 | if($logged_info->is_admin == 'Y') |
1929 | 2179 | { |
1930 | - if($args->is_admin!='Y') $args->is_admin = 'N'; |
|
1931 | - } |
|
1932 | - else |
|
2180 | + if($args->is_admin!='Y') { |
|
2181 | + $args->is_admin = 'N'; |
|
2182 | + } |
|
2183 | + } else |
|
1933 | 2184 | { |
1934 | 2185 | unset($args->is_admin); |
1935 | 2186 | } |
@@ -1942,8 +2193,12 @@ discard block |
||
1942 | 2193 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
1943 | 2194 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
1944 | 2195 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
1945 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
1946 | - if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
2196 | + if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) { |
|
2197 | + $args->homepage = 'http://'.$args->homepage; |
|
2198 | + } |
|
2199 | + if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) { |
|
2200 | + $args->blog = 'http://'.$args->blog; |
|
2201 | + } |
|
1947 | 2202 | |
1948 | 2203 | // Create a model object |
1949 | 2204 | $oMemberModel = getModel('member'); |
@@ -1957,8 +2212,7 @@ discard block |
||
1957 | 2212 | return new Object(-1, $message[$config->password_strength]); |
1958 | 2213 | } |
1959 | 2214 | $args->password = $oMemberModel->hashPassword($args->password); |
1960 | - } |
|
1961 | - elseif(!$args->password) |
|
2215 | + } elseif(!$args->password) |
|
1962 | 2216 | { |
1963 | 2217 | unset($args->password); |
1964 | 2218 | } |
@@ -1999,8 +2253,12 @@ discard block |
||
1999 | 2253 | // Insert data into the DB |
2000 | 2254 | $args->list_order = -1 * $args->member_srl; |
2001 | 2255 | |
2002 | - if(!$args->user_id) $args->user_id = 't'.$args->member_srl; |
|
2003 | - if(!$args->user_name) $args->user_name = $args->member_srl; |
|
2256 | + if(!$args->user_id) { |
|
2257 | + $args->user_id = 't'.$args->member_srl; |
|
2258 | + } |
|
2259 | + if(!$args->user_name) { |
|
2260 | + $args->user_name = $args->member_srl; |
|
2261 | + } |
|
2004 | 2262 | |
2005 | 2263 | $oDB = &DB::getInstance(); |
2006 | 2264 | $oDB->begin(); |
@@ -2012,8 +2270,11 @@ discard block |
||
2012 | 2270 | return $output; |
2013 | 2271 | } |
2014 | 2272 | |
2015 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
2016 | - else $group_srl_list = explode('|@|', $args->group_srl_list); |
|
2273 | + if(is_array($args->group_srl_list)) { |
|
2274 | + $group_srl_list = $args->group_srl_list; |
|
2275 | + } else { |
|
2276 | + $group_srl_list = explode('|@|', $args->group_srl_list); |
|
2277 | + } |
|
2017 | 2278 | // If no value is entered the default group, the value of group registration |
2018 | 2279 | if(!$args->group_srl_list) |
2019 | 2280 | { |
@@ -2030,8 +2291,7 @@ discard block |
||
2030 | 2291 | } |
2031 | 2292 | } |
2032 | 2293 | // If the value is the value of the group entered the group registration |
2033 | - } |
|
2034 | - else |
|
2294 | + } else |
|
2035 | 2295 | { |
2036 | 2296 | for($i=0;$i<count($group_srl_list);$i++) |
2037 | 2297 | { |
@@ -2092,27 +2352,39 @@ discard block |
||
2092 | 2352 | { |
2093 | 2353 | // Call a trigger (before) |
2094 | 2354 | $output = ModuleHandler::triggerCall('member.updateMember', 'before', $args); |
2095 | - if(!$output->toBool()) return $output; |
|
2355 | + if(!$output->toBool()) { |
|
2356 | + return $output; |
|
2357 | + } |
|
2096 | 2358 | // Create a model object |
2097 | 2359 | $oMemberModel = getModel('member'); |
2098 | 2360 | |
2099 | 2361 | $logged_info = Context::get('logged_info'); |
2100 | 2362 | // Get what you want to modify the original information |
2101 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2363 | + if(!$this->memberInfo) { |
|
2364 | + $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2365 | + } |
|
2102 | 2366 | // Control of essential parameters |
2103 | - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; |
|
2104 | - if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y'; |
|
2367 | + if($args->allow_mailing!='Y') { |
|
2368 | + $args->allow_mailing = 'N'; |
|
2369 | + } |
|
2370 | + if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) { |
|
2371 | + $args->allow_message = 'Y'; |
|
2372 | + } |
|
2105 | 2373 | |
2106 | 2374 | if($logged_info->is_admin == 'Y') |
2107 | 2375 | { |
2108 | - if($args->denied!='Y') $args->denied = 'N'; |
|
2109 | - if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N'; |
|
2110 | - } |
|
2111 | - else |
|
2376 | + if($args->denied!='Y') { |
|
2377 | + $args->denied = 'N'; |
|
2378 | + } |
|
2379 | + if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) { |
|
2380 | + $args->is_admin = 'N'; |
|
2381 | + } |
|
2382 | + } else |
|
2112 | 2383 | { |
2113 | 2384 | unset($args->is_admin); |
2114 | - if($is_admin == false) |
|
2115 | - unset($args->denied); |
|
2385 | + if($is_admin == false) { |
|
2386 | + unset($args->denied); |
|
2387 | + } |
|
2116 | 2388 | if($logged_info->member_srl != $args->member_srl && $is_admin == false) |
2117 | 2389 | { |
2118 | 2390 | return $this->stop('msg_invalid_request'); |
@@ -2120,13 +2392,19 @@ discard block |
||
2120 | 2392 | } |
2121 | 2393 | |
2122 | 2394 | // Sanitize user ID, username, nickname, homepage, blog |
2123 | - if($args->user_id) $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
2395 | + if($args->user_id) { |
|
2396 | + $args->user_id = htmlspecialchars($args->user_id, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
|
2397 | + } |
|
2124 | 2398 | $args->user_name = htmlspecialchars($args->user_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2125 | 2399 | $args->nick_name = htmlspecialchars($args->nick_name, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2126 | 2400 | $args->homepage = htmlspecialchars($args->homepage, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2127 | 2401 | $args->blog = htmlspecialchars($args->blog, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
2128 | - if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage; |
|
2129 | - if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog; |
|
2402 | + if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) { |
|
2403 | + $args->homepage = 'http://'.$args->homepage; |
|
2404 | + } |
|
2405 | + if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) { |
|
2406 | + $args->blog = 'http://'.$args->blog; |
|
2407 | + } |
|
2130 | 2408 | |
2131 | 2409 | // check member identifier form |
2132 | 2410 | $config = $oMemberModel->getMemberConfig(); |
@@ -2143,8 +2421,7 @@ discard block |
||
2143 | 2421 | return new Object(-1,'msg_exists_email_address'); |
2144 | 2422 | } |
2145 | 2423 | $args->email_address = $orgMemberInfo->email_address; |
2146 | - } |
|
2147 | - else |
|
2424 | + } else |
|
2148 | 2425 | { |
2149 | 2426 | $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); |
2150 | 2427 | if($member_srl && $args->member_srl != $member_srl) |
@@ -2201,17 +2478,26 @@ discard block |
||
2201 | 2478 | return new Object(-1, $message[$config->password_strength]); |
2202 | 2479 | } |
2203 | 2480 | $args->password = $oMemberModel->hashPassword($args->password); |
2204 | - } |
|
2205 | - else |
|
2481 | + } else |
|
2206 | 2482 | { |
2207 | 2483 | $args->password = $orgMemberInfo->password; |
2208 | 2484 | } |
2209 | 2485 | |
2210 | - if(!$args->user_name) $args->user_name = $orgMemberInfo->user_name; |
|
2211 | - if(!$args->user_id) $args->user_id = $orgMemberInfo->user_id; |
|
2212 | - if(!$args->nick_name) $args->nick_name = $orgMemberInfo->nick_name; |
|
2213 | - if(!$args->description) $args->description = $orgMemberInfo->description; |
|
2214 | - if(!$args->birthday) $args->birthday = ''; |
|
2486 | + if(!$args->user_name) { |
|
2487 | + $args->user_name = $orgMemberInfo->user_name; |
|
2488 | + } |
|
2489 | + if(!$args->user_id) { |
|
2490 | + $args->user_id = $orgMemberInfo->user_id; |
|
2491 | + } |
|
2492 | + if(!$args->nick_name) { |
|
2493 | + $args->nick_name = $orgMemberInfo->nick_name; |
|
2494 | + } |
|
2495 | + if(!$args->description) { |
|
2496 | + $args->description = $orgMemberInfo->description; |
|
2497 | + } |
|
2498 | + if(!$args->birthday) { |
|
2499 | + $args->birthday = ''; |
|
2500 | + } |
|
2215 | 2501 | |
2216 | 2502 | $output = executeQuery('member.updateMember', $args); |
2217 | 2503 | |
@@ -2223,8 +2509,11 @@ discard block |
||
2223 | 2509 | |
2224 | 2510 | if($args->group_srl_list) |
2225 | 2511 | { |
2226 | - if(is_array($args->group_srl_list)) $group_srl_list = $args->group_srl_list; |
|
2227 | - else $group_srl_list = explode('|@|', $args->group_srl_list); |
|
2512 | + if(is_array($args->group_srl_list)) { |
|
2513 | + $group_srl_list = $args->group_srl_list; |
|
2514 | + } else { |
|
2515 | + $group_srl_list = explode('|@|', $args->group_srl_list); |
|
2516 | + } |
|
2228 | 2517 | // If the group information, group information changes |
2229 | 2518 | if(count($group_srl_list) > 0) |
2230 | 2519 | { |
@@ -2267,7 +2556,9 @@ discard block |
||
2267 | 2556 | $this->_clearMemberCache($args->member_srl, $args->site_srl); |
2268 | 2557 | |
2269 | 2558 | // Save Session |
2270 | - if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2559 | + if(!$this->memberInfo) { |
|
2560 | + $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); |
|
2561 | + } |
|
2271 | 2562 | $logged_info = Context::get('logged_info'); |
2272 | 2563 | |
2273 | 2564 | $output->add('member_srl', $args->member_srl); |
@@ -2293,8 +2584,7 @@ discard block |
||
2293 | 2584 | } |
2294 | 2585 | |
2295 | 2586 | $args->password = $oMemberModel->hashPassword($args->password); |
2296 | - } |
|
2297 | - else if($args->hashed_password) |
|
2587 | + } else if($args->hashed_password) |
|
2298 | 2588 | { |
2299 | 2589 | $args->password = $args->hashed_password; |
2300 | 2590 | } |
@@ -2319,7 +2609,9 @@ discard block |
||
2319 | 2609 | $trigger_obj = new stdClass(); |
2320 | 2610 | $trigger_obj->member_srl = $member_srl; |
2321 | 2611 | $output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj); |
2322 | - if(!$output->toBool()) return $output; |
|
2612 | + if(!$output->toBool()) { |
|
2613 | + return $output; |
|
2614 | + } |
|
2323 | 2615 | // Create a model object |
2324 | 2616 | $oMemberModel = getModel('member'); |
2325 | 2617 | // Bringing the user's information |
@@ -2328,9 +2620,13 @@ discard block |
||
2328 | 2620 | $columnList = array('member_srl', 'is_admin'); |
2329 | 2621 | $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList); |
2330 | 2622 | } |
2331 | - if(!$this->memberInfo) return new Object(-1, 'msg_not_exists_member'); |
|
2623 | + if(!$this->memberInfo) { |
|
2624 | + return new Object(-1, 'msg_not_exists_member'); |
|
2625 | + } |
|
2332 | 2626 | // If managers can not be deleted |
2333 | - if($this->memberInfo->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin'); |
|
2627 | + if($this->memberInfo->is_admin == 'Y') { |
|
2628 | + return new Object(-1, 'msg_cannot_delete_admin'); |
|
2629 | + } |
|
2334 | 2630 | |
2335 | 2631 | $oDB = &DB::getInstance(); |
2336 | 2632 | $oDB->begin(); |
@@ -2394,7 +2690,9 @@ discard block |
||
2394 | 2690 | */ |
2395 | 2691 | function destroySessionInfo() |
2396 | 2692 | { |
2397 | - if(!$_SESSION || !is_array($_SESSION)) return; |
|
2693 | + if(!$_SESSION || !is_array($_SESSION)) { |
|
2694 | + return; |
|
2695 | + } |
|
2398 | 2696 | |
2399 | 2697 | $memberInfo = Context::get('logged_info'); |
2400 | 2698 | $memberSrl = $memberInfo->member_srl; |
@@ -2433,8 +2731,9 @@ discard block |
||
2433 | 2731 | } |
2434 | 2732 | $maxLevel = 0; |
2435 | 2733 | $resultGroup = array_intersect($levelGroup, $groupSrlList); |
2436 | - if(count($resultGroup) > 0) |
|
2437 | - $maxLevel = max(array_flip($resultGroup)); |
|
2734 | + if(count($resultGroup) > 0) { |
|
2735 | + $maxLevel = max(array_flip($resultGroup)); |
|
2736 | + } |
|
2438 | 2737 | |
2439 | 2738 | if($maxLevel > 0) |
2440 | 2739 | { |
@@ -2451,16 +2750,22 @@ discard block |
||
2451 | 2750 | |
2452 | 2751 | function procMemberModifyEmailAddress() |
2453 | 2752 | { |
2454 | - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); |
|
2753 | + if(!Context::get('is_logged')) { |
|
2754 | + return $this->stop('msg_not_logged'); |
|
2755 | + } |
|
2455 | 2756 | |
2456 | 2757 | $member_info = Context::get('logged_info'); |
2457 | 2758 | $newEmail = Context::get('email_address'); |
2458 | 2759 | |
2459 | - if(!$newEmail) return $this->stop('msg_invalid_request'); |
|
2760 | + if(!$newEmail) { |
|
2761 | + return $this->stop('msg_invalid_request'); |
|
2762 | + } |
|
2460 | 2763 | |
2461 | 2764 | $oMemberModel = getModel('member'); |
2462 | 2765 | $member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail); |
2463 | - if($member_srl) return new Object(-1,'msg_exists_email_address'); |
|
2766 | + if($member_srl) { |
|
2767 | + return new Object(-1,'msg_exists_email_address'); |
|
2768 | + } |
|
2464 | 2769 | |
2465 | 2770 | if($_SESSION['rechecked_password_step'] != 'INPUT_DATA') |
2466 | 2771 | { |
@@ -2488,7 +2793,9 @@ discard block |
||
2488 | 2793 | $member_config = $oModuleModel->getModuleConfig('member'); |
2489 | 2794 | |
2490 | 2795 | $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); |
2491 | - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
2796 | + if(!is_dir($tpl_path)) { |
|
2797 | + $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); |
|
2798 | + } |
|
2492 | 2799 | |
2493 | 2800 | global $lang; |
2494 | 2801 | |
@@ -2524,7 +2831,9 @@ discard block |
||
2524 | 2831 | { |
2525 | 2832 | $member_srl = Context::get('member_srl'); |
2526 | 2833 | $auth_key = Context::get('auth_key'); |
2527 | - if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request'); |
|
2834 | + if(!$member_srl || !$auth_key) { |
|
2835 | + return $this->stop('msg_invalid_request'); |
|
2836 | + } |
|
2528 | 2837 | |
2529 | 2838 | // Test logs for finding password by user_id and authkey |
2530 | 2839 | $args = new stdClass; |
@@ -2533,7 +2842,9 @@ discard block |
||
2533 | 2842 | $output = executeQuery('member.getAuthMail', $args); |
2534 | 2843 | if(!$output->toBool() || $output->data->auth_key != $auth_key) |
2535 | 2844 | { |
2536 | - if(strlen($output->data->auth_key) !== strlen($auth_key)) executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
2845 | + if(strlen($output->data->auth_key) !== strlen($auth_key)) { |
|
2846 | + executeQuery('member.deleteAuthChangeEmailAddress', $args); |
|
2847 | + } |
|
2537 | 2848 | return $this->stop('msg_invalid_modify_email_auth_key'); |
2538 | 2849 | } |
2539 | 2850 | |
@@ -2542,7 +2853,9 @@ discard block |
||
2542 | 2853 | list($args->email_id, $args->email_host) = explode('@', $newEmail); |
2543 | 2854 | |
2544 | 2855 | $output = executeQuery('member.updateMemberEmailAddress', $args); |
2545 | - if(!$output->toBool()) return $this->stop($output->getMessage()); |
|
2856 | + if(!$output->toBool()) { |
|
2857 | + return $this->stop($output->getMessage()); |
|
2858 | + } |
|
2546 | 2859 | |
2547 | 2860 | // Remove all values having the member_srl and new_password equal to 'XE_change_emaill_address' from authentication table |
2548 | 2861 | executeQuery('member.deleteAuthChangeEmailAddress',$args); |
@@ -2563,7 +2876,9 @@ discard block |
||
2563 | 2876 | **/ |
2564 | 2877 | function triggerGetDocumentMenu(&$menu_list) |
2565 | 2878 | { |
2566 | - if(!Context::get('is_logged')) return new Object(); |
|
2879 | + if(!Context::get('is_logged')) { |
|
2880 | + return new Object(); |
|
2881 | + } |
|
2567 | 2882 | |
2568 | 2883 | $logged_info = Context::get('logged_info'); |
2569 | 2884 | $document_srl = Context::get('target_srl'); |
@@ -2574,8 +2889,12 @@ discard block |
||
2574 | 2889 | $member_srl = $oDocument->get('member_srl'); |
2575 | 2890 | $module_srl = $oDocument->get('module_srl'); |
2576 | 2891 | |
2577 | - if(!$member_srl) return new Object(); |
|
2578 | - if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object(); |
|
2892 | + if(!$member_srl) { |
|
2893 | + return new Object(); |
|
2894 | + } |
|
2895 | + if($oDocumentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) { |
|
2896 | + return new Object(); |
|
2897 | + } |
|
2579 | 2898 | |
2580 | 2899 | $oDocumentController = getController('document'); |
2581 | 2900 | $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
@@ -2593,7 +2912,9 @@ discard block |
||
2593 | 2912 | **/ |
2594 | 2913 | function triggerGetCommentMenu(&$menu_list) |
2595 | 2914 | { |
2596 | - if(!Context::get('is_logged')) return new Object(); |
|
2915 | + if(!Context::get('is_logged')) { |
|
2916 | + return new Object(); |
|
2917 | + } |
|
2597 | 2918 | |
2598 | 2919 | $logged_info = Context::get('logged_info'); |
2599 | 2920 | $comment_srl = Context::get('target_srl'); |
@@ -2604,8 +2925,12 @@ discard block |
||
2604 | 2925 | $module_srl = $oComment->get('module_srl'); |
2605 | 2926 | $member_srl = $oComment->get('member_srl'); |
2606 | 2927 | |
2607 | - if(!$member_srl) return new Object(); |
|
2608 | - if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) return new Object(); |
|
2928 | + if(!$member_srl) { |
|
2929 | + return new Object(); |
|
2930 | + } |
|
2931 | + if($oCommentModel->grant->manager != 1 || $member_srl==$logged_info->member_srl) { |
|
2932 | + return new Object(); |
|
2933 | + } |
|
2609 | 2934 | |
2610 | 2935 | $oCommentController = getController('comment'); |
2611 | 2936 | $url = getUrl('','module','member','act','dispMemberSpammer','member_srl',$member_srl,'module_srl',$module_srl); |
@@ -2621,7 +2946,9 @@ discard block |
||
2621 | 2946 | **/ |
2622 | 2947 | function procMemberSpammerManage() |
2623 | 2948 | { |
2624 | - if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted'); |
|
2949 | + if(!Context::get('is_logged')) { |
|
2950 | + return new Object(-1,'msg_not_permitted'); |
|
2951 | + } |
|
2625 | 2952 | |
2626 | 2953 | $logged_info = Context::get('logged_info'); |
2627 | 2954 | $member_srl = Context::get('member_srl'); |
@@ -2629,8 +2956,9 @@ discard block |
||
2629 | 2956 | $cnt_loop = Context::get('cnt_loop'); |
2630 | 2957 | $proc_type = Context::get('proc_type'); |
2631 | 2958 | $isMoveToTrash = true; |
2632 | - if($proc_type == "delete") |
|
2633 | - $isMoveToTrash = false; |
|
2959 | + if($proc_type == "delete") { |
|
2960 | + $isMoveToTrash = false; |
|
2961 | + } |
|
2634 | 2962 | |
2635 | 2963 | // check grant |
2636 | 2964 | $oModuleModel = getModel('module'); |
@@ -2638,7 +2966,9 @@ discard block |
||
2638 | 2966 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList); |
2639 | 2967 | $grant = $oModuleModel->getGrant($module_info, $logged_info); |
2640 | 2968 | |
2641 | - if(!$grant->manager) return new Object(-1,'msg_not_permitted'); |
|
2969 | + if(!$grant->manager) { |
|
2970 | + return new Object(-1,'msg_not_permitted'); |
|
2971 | + } |
|
2642 | 2972 | |
2643 | 2973 | $proc_msg = ""; |
2644 | 2974 | |
@@ -2647,11 +2977,13 @@ discard block |
||
2647 | 2977 | |
2648 | 2978 | // delete or trash destination |
2649 | 2979 | // proc member |
2650 | - if($cnt_loop == 1) |
|
2651 | - $this->_spammerMember($member_srl); |
|
2980 | + if($cnt_loop == 1) { |
|
2981 | + $this->_spammerMember($member_srl); |
|
2982 | + } |
|
2652 | 2983 | // proc document and comment |
2653 | - elseif($cnt_loop>1) |
|
2654 | - $this->_spammerDocuments($member_srl, $isMoveToTrash); |
|
2984 | + elseif($cnt_loop>1) { |
|
2985 | + $this->_spammerDocuments($member_srl, $isMoveToTrash); |
|
2986 | + } |
|
2655 | 2987 | |
2656 | 2988 | // get destination count |
2657 | 2989 | $cnt_document = $oDocumentModel->getDocumentCountByMemberSrl($member_srl); |
@@ -2659,13 +2991,16 @@ discard block |
||
2659 | 2991 | |
2660 | 2992 | $total_count = Context::get('total_count'); |
2661 | 2993 | $remain_count = $cnt_document + $cnt_comment; |
2662 | - if($cnt_loop == 1) $total_count = $remain_count; |
|
2994 | + if($cnt_loop == 1) { |
|
2995 | + $total_count = $remain_count; |
|
2996 | + } |
|
2663 | 2997 | |
2664 | 2998 | // get progress percent |
2665 | - if($total_count > 0) |
|
2666 | - $progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 ); |
|
2667 | - else |
|
2668 | - $progress = 100; |
|
2999 | + if($total_count > 0) { |
|
3000 | + $progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 ); |
|
3001 | + } else { |
|
3002 | + $progress = 100; |
|
3003 | + } |
|
2669 | 3004 | |
2670 | 3005 | $this->add('total_count', $total_count); |
2671 | 3006 | $this->add('remain_count', $remain_count); |
@@ -2707,7 +3042,10 @@ discard block |
||
2707 | 3042 | $args->nick_name = $member_info->nick_name; |
2708 | 3043 | $args->denied = "Y"; |
2709 | 3044 | $args->description = trim( $member_info->description ); |
2710 | - if( $args->description != "" ) $args->description .= "\n"; // add new line |
|
3045 | + if( $args->description != "" ) { |
|
3046 | + $args->description .= "\n"; |
|
3047 | + } |
|
3048 | + // add new line |
|
2711 | 3049 | |
2712 | 3050 | $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 . "]"; |
2713 | 3051 | |
@@ -2752,8 +3090,11 @@ discard block |
||
2752 | 3090 | $documentList = $oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0, false, $getContentsCount); |
2753 | 3091 | if($documentList) { |
2754 | 3092 | foreach($documentList as $v) { |
2755 | - if($isMoveToTrash) $oDocumentController->moveDocumentToTrash($v); |
|
2756 | - else $oDocumentController->deleteDocument($v->document_srl); |
|
3093 | + if($isMoveToTrash) { |
|
3094 | + $oDocumentController->moveDocumentToTrash($v); |
|
3095 | + } else { |
|
3096 | + $oDocumentController->deleteDocument($v->document_srl); |
|
3097 | + } |
|
2757 | 3098 | } |
2758 | 3099 | } |
2759 | 3100 | } |