45 $user_id = trim($user_id);
48 $password = trim($password);
50 if(!$keep_signed) $keep_signed =
Context::get(
'keep_signed');
52 if(!$user_id)
return new BaseObject(-1,
'null_user_id');
53 if(!$password)
return new BaseObject(-1,
'null_password');
55 $output = $this->
doLogin($user_id, $password, $keep_signed==
'Y'?
true:
false);
62 $limit_date = $config->change_password_date;
68 if($this->memberInfo->change_password_date < date (
'YmdHis', strtotime (
'-' . $limit_date .
' day')))
76 $args =
new stdClass();
77 $args->member_srl = $this->memberInfo->member_srl;
80 if(!$config->after_login_url)
86 $returnUrl = $config->after_login_url;
101 if(!$trigger_output->toBool())
return $trigger_output;
106 if(!$trigger_output->toBool())
return $trigger_output;
112 if($config->after_logout_url)
113 $output->redirect_url = $config->after_logout_url;
141 if($oDocument->isSecret() && !$oDocument->isGranted())
152 return new BaseObject(-1,
'msg_not_permitted');
156 if(
$module_info->module ===
'board' && isset($grant->list) && !$grant->list)
158 return new BaseObject(-1,
'msg_not_permitted');
164 isset($grant->consultation_read) &&
165 !$grant->consultation_read && !$oDocument->isGranted()
168 return new BaseObject(-1,
'msg_not_permitted');
172 $args =
new stdClass();
175 $args->user_id = $oDocument->get(
'user_id');
176 $args->user_name = $oDocument->get(
'user_name');
177 $args->nick_name = $oDocument->get(
'nick_name');
178 $args->target_member_srl = $oDocument->get(
'member_srl');
179 $args->title = $oDocument->get(
'title');
207 $args =
new stdClass;
220 return new BaseObject(0,
'Deprecated method');
239 if ($oDocument->get(
'member_srl') !=
$logged_info->member_srl)
241 return new BaseObject(-1,
'msg_invalid_request');
245 if ($oDocument->get(
'status') != $configStatusList[
'temp'])
247 return new BaseObject(-1,
'msg_invalid_request');
274 if($oMemberModel->isDeniedID($value))
return new BaseObject(0,
'denied_user_id');
276 $member_srl = $oMemberModel->getMemberSrlByUserID($value);
277 if($member_srl &&
$logged_info->member_srl != $member_srl )
return new BaseObject(0,
'msg_exists_user_id');
281 if($oMemberModel->isDeniedNickName($value))
286 $member_srl = $oMemberModel->getMemberSrlByNickName($value);
287 if($member_srl &&
$logged_info->member_srl != $member_srl )
return new BaseObject(0,
'msg_exists_nick_name');
290 case 'email_address' :
292 $member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
293 if($member_srl &&
$logged_info->member_srl != $member_srl )
return new BaseObject(0,
'msg_exists_email_address');
306 $oMemberModel = &
getModel (
'member');
307 $config = $oMemberModel->getMemberConfig();
311 if(!$trigger_output->toBool ())
return $trigger_output;
313 if($config->enable_join !=
'Y')
return $this->
stop (
'msg_signup_disabled');
315 if($config->agreement &&
Context::get(
'accept_agreement')!=
'Y')
return $this->
stop(
'msg_accept_agreement');
319 if($config->signupForm)
321 foreach($config->signupForm as $formInfo)
323 if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
325 $getVars[] = $formInfo->name;
330 $args =
new stdClass;
331 foreach($getVars as $val)
336 $args->birthday = intval(strtr(
$args->birthday, array(
'-'=>
'',
'/'=>
'',
'.'=>
'',
' '=>
'')));
337 if(!
$args->birthday &&
$args->birthday_ui)
$args->birthday = intval(strtr(
$args->birthday_ui, array(
'-'=>
'',
'/'=>
'',
'.'=>
'',
' '=>
'')));
346 if(!$oMemberModel->checkPasswordStrength(
$args->password, $config->password_strength))
354 unset($all_args->module);
355 unset($all_args->act);
356 unset($all_args->is_admin);
357 unset($all_args->member_srl);
358 unset($all_args->description);
359 unset($all_args->group_srl_list);
360 unset($all_args->body);
361 unset($all_args->accept_agreement);
362 unset($all_args->signature);
363 unset($all_args->password);
364 unset($all_args->password2);
365 unset($all_args->mid);
366 unset($all_args->error_return_url);
367 unset($all_args->ruleset);
368 unset($all_args->captchaType);
369 unset($all_args->secret_text);
372 if($config->enable_confirm ==
'Y')
$args->denied =
'Y';
378 $checkInfos = array(
'user_id',
'user_name',
'nick_name',
'email_address');
379 foreach($checkInfos as $val)
381 if(isset(
$args->{$val}))
383 $args->{$val} = preg_replace(
'/[\pZ\pC]+/u',
'', html_entity_decode(
$args->{$val}));
391 if(is_uploaded_file($profile_image[
'tmp_name']))
393 $this->insertProfileImage(
$args->member_srl, $profile_image[
'tmp_name']);
397 if(is_uploaded_file($image_mark[
'tmp_name']))
399 $this->insertImageMark(
$args->member_srl, $image_mark[
'tmp_name']);
403 if(is_uploaded_file($image_name[
'tmp_name']))
405 $this->insertImageName(
$args->member_srl, $image_name[
'tmp_name']);
410 if($site_module_info->site_srl > 0)
412 $columnList = array(
'site_srl',
'group_srl');
413 $default_group = $oMemberModel->getDefaultGroup($site_module_info->site_srl, $columnList);
414 if($default_group->group_srl)
416 $this->addMemberToGroup(
$args->member_srl, $default_group->group_srl, $site_module_info->site_srl);
421 if($config->enable_confirm !=
'Y')
423 if($config->identifier ==
'email_address')
434 return $this->setRedirectUrl(
getUrl(
'',
'act',
'dispMemberLoginForm'),
$output);
439 $this->add(
'member_srl',
$args->member_srl);
440 if($config->redirect_url) $this->add(
'redirect_url', $config->redirect_url);
441 if($config->enable_confirm ==
'Y')
444 $this->setMessage($msg);
445 return $this->setRedirectUrl(
getUrl(
'',
'act',
'dispMemberLoginForm'),
new BaseObject(-12, $msg));
447 else $this->setMessage(
'success_registed');
450 if(!$trigger_output->toBool())
return $trigger_output;
452 if($config->redirect_url)
454 $returnUrl = $config->redirect_url;
462 else if($_COOKIE[
'XE_REDIRECT_URL'])
464 $returnUrl = $_COOKIE[
'XE_REDIRECT_URL'];
465 setcookie(
"XE_REDIRECT_URL",
'', 1);
469 $this->_clearMemberCache(
$args->member_srl, $site_module_info->site_srl);
471 $this->setRedirectUrl($returnUrl);
476 if($_SESSION[
'rechecked_password_step'] !=
'INPUT_PASSWORD')
478 return $this->stop(
'msg_invalid_request');
483 return $this->stop(
'msg_not_logged');
490 return $this->stop(
'msg_invalid_request');
495 if(!$this->memberInfo->password)
501 $columnList = array(
'member_srl',
'password');
502 $memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
503 $this->memberInfo->password = $memberInfo->password;
506 if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
508 return new BaseObject(-1,
'invalid_password');
511 $_SESSION[
'rechecked_password_step'] =
'VALIDATE_PASSWORD';
521 $this->setRedirectUrl($redirectUrl);
533 return $this->stop(
'msg_not_logged');
536 if($_SESSION[
'rechecked_password_step'] !=
'INPUT_DATA')
538 return $this->stop(
'msg_invalid_request');
540 unset($_SESSION[
'rechecked_password_step']);
544 $config = $oMemberModel->getMemberConfig ();
545 $getVars = array(
'find_account_answer',
'allow_mailing',
'allow_message');
546 if($config->signupForm)
548 foreach($config->signupForm as $formInfo)
550 if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired))
552 $getVars[] = $formInfo->name;
557 $args =
new stdClass;
558 foreach($getVars as $val)
562 if($val ==
'find_account_answer' && !
Context::get($val)) {
563 unset(
$args->{$val});
570 $args->birthday = intval(strtr(
$args->birthday, array(
'-'=>
'',
'/'=>
'',
'.'=>
'',
' '=>
'')));
571 if(!
$args->birthday &&
$args->birthday_ui)
$args->birthday = intval(strtr(
$args->birthday_ui, array(
'-'=>
'',
'/'=>
'',
'.'=>
'',
' '=>
'')));
575 unset($all_args->module);
576 unset($all_args->act);
577 unset($all_args->member_srl);
578 unset($all_args->is_admin);
579 unset($all_args->description);
580 unset($all_args->group_srl_list);
581 unset($all_args->body);
582 unset($all_args->accept_agreement);
583 unset($all_args->signature);
584 unset($all_args->_filter);
585 unset($all_args->mid);
586 unset($all_args->error_return_url);
587 unset($all_args->ruleset);
588 unset($all_args->password);
595 $checkInfos = array(
'user_id',
'user_name',
'nick_name',
'email_address');
596 foreach($checkInfos as $val)
598 if(isset(
$args->{$val}))
600 $args->{$val} = preg_replace(
'/[\pZ\pC]+/u',
'', html_entity_decode(
$args->{$val}));
609 if(is_uploaded_file($profile_image[
'tmp_name']))
611 $this->insertProfileImage(
$args->member_srl, $profile_image[
'tmp_name']);
615 if(is_uploaded_file($image_mark[
'tmp_name']))
617 $this->insertImageMark(
$args->member_srl, $image_mark[
'tmp_name']);
621 if(is_uploaded_file($image_name[
'tmp_name']))
623 $this->insertImageName(
$args->member_srl, $image_name[
'tmp_name']);
628 $this->putSignature(
$args->member_srl, $signature);
631 $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl(
$args->member_srl);
636 if(!$trigger_output->toBool())
return $trigger_output;
638 $this->setSessionInfo();
640 $this->add(
'member_srl',
$args->member_srl);
641 $this->setMessage(
'success_updated');
644 $this->_clearMemberCache(
$args->member_srl, $site_module_info->site_srl);
647 $this->setRedirectUrl($returnUrl);
657 if(!
Context::get(
'is_logged'))
return $this->stop(
'msg_not_logged');
659 $current_password = trim(
Context::get(
'current_password'));
667 $columnList = array(
'member_srl',
'password');
669 $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
671 if(!$oMemberModel->isValidPassword($member_info->password, $current_password, $member_srl))
return new BaseObject(-1,
'invalid_password');
674 if($current_password == $password)
return new BaseObject(-1,
'invalid_new_password');
677 $args =
new stdClass;
678 $args->member_srl = $member_srl;
679 $args->password = $password;
683 $this->add(
'member_srl',
$args->member_srl);
684 $this->setMessage(
'success_updated');
687 $this->setRedirectUrl($returnUrl);
697 if(!
Context::get(
'is_logged'))
return $this->stop(
'msg_not_logged');
706 if(!$this->memberInfo->password)
708 $columnList = array(
'member_srl',
'password');
709 $memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
710 $this->memberInfo->password = $memberInfo->password;
713 if(!$oMemberModel->isValidPassword($this->memberInfo->password, $password))
return new BaseObject(-1,
'invalid_password');
715 $output = $this->deleteMember($member_srl);
718 $this->destroySessionInfo();
720 $this->setMessage(
'success_leaved');
723 $this->setRedirectUrl($returnUrl);
735 if(!is_uploaded_file($file[
'tmp_name']))
return $this->stop(
'msg_not_uploaded_profile_image');
738 if(!$member_srl)
return $this->stop(
'msg_not_uploaded_profile_image');
741 if(
$logged_info->is_admin !=
'Y' &&
$logged_info->member_srl != $member_srl)
return $this->stop(
'msg_not_uploaded_profile_image');
744 $config = $oMemberModel->getMemberConfig();
745 if(
$logged_info->is_admin !=
'Y' && $config->profile_image !=
'Y')
return $this->stop(
'msg_not_uploaded_profile_image');
747 $output = $this->insertProfileImage($member_srl, $file[
'tmp_name']);
751 $this->setRedirectUrl($returnUrl);
765 $config = $oMemberModel->getMemberConfig();
766 $max_width = $config->profile_image_max_width;
767 $max_height = $config->profile_image_max_height;
768 $max_filesize = $config->profile_image_max_filesize;
769 foreach($config->signupForm as $val)
771 if($val->name ==
"profile_image")
772 $allow_transparent = $val->allow_transparent_thumbnail ==
'Y';
779 list($width, $height, $type) = @getimagesize($target_file);
780 if(IMAGETYPE_PNG == $type) $ext =
'png';
781 elseif(IMAGETYPE_JPEG == $type) $ext =
'jpg';
782 elseif(IMAGETYPE_GIF == $type) $ext =
'gif';
785 return $this->stop(
'msg_not_uploaded_profile_image');
788 $target_path = sprintf(
'files/member_extra_info/profile_image/%s',
getNumberingPath($member_srl));
791 $target_filename = sprintf(
'%s%d.%s', $target_path, $member_srl, $ext);
794 if(($width > $max_width || $height > $max_height ) && $type != 1)
796 $temp_filename = sprintf(
'files/cache/tmp/profile_image_%d.%s', $member_srl, $ext);
801 $filesize = filesize($temp_filename);
802 if($max_filesize && $filesize > ($max_filesize * 1024))
805 return $this->stop(implode(
' ' , array(
818 $filesize = filesize($target_file);
819 if($max_filesize && $filesize > ($max_filesize * 1024))
821 return $this->stop(implode(
' ' , array(
828 @copy($target_file, $target_filename);
844 if(!is_uploaded_file($file[
'tmp_name']))
return $this->stop(
'msg_not_uploaded_image_name');
847 if(!$member_srl)
return $this->stop(
'msg_not_uploaded_image_name');
850 if(
$logged_info->is_admin !=
'Y' &&
$logged_info->member_srl != $member_srl)
return $this->stop(
'msg_not_uploaded_image_name');
853 $config = $oMemberModel->getMemberConfig();
854 if(
$logged_info->is_admin !=
'Y' && $config->image_name !=
'Y')
return $this->stop(
'msg_not_uploaded_image_name');
856 $output = $this->insertImageName($member_srl, $file[
'tmp_name']);
863 $this->setRedirectUrl($returnUrl);
877 $config = $oMemberModel->getMemberConfig();
878 $max_width = $config->image_name_max_width;
879 $max_height = $config->image_name_max_height;
880 $max_filesize = $config->image_name_max_filesize;
885 $target_path = sprintf(
'files/member_extra_info/image_name/%s/',
getNumberingPath($member_srl));
888 $target_filename = sprintf(
'%s%d.gif', $target_path, $member_srl);
890 list($width, $height, $type) = @getimagesize($target_file);
892 if($width > $max_width || $height > $max_height || $type!=1)
894 $temp_filename = sprintf(
'files/cache/tmp/image_name_%d.gif', $member_srl, $ext);
899 $filesize = filesize($temp_filename);
900 if($max_filesize && $filesize > ($max_filesize * 1024))
903 return $this->stop(implode(
' ' , array(
916 $filesize = filesize($target_file);
917 if($max_filesize && $filesize > ($max_filesize * 1024))
919 return $this->stop(implode(
' ' , array(
926 @copy($target_file, $target_filename);
940 $member_srl = ($_memberSrl) ? $_memberSrl :
Context::get(
'member_srl');
951 $profile_image = $oMemberModel->getProfileImage($member_srl);
964 $member_srl = ($_memberSrl) ? $_memberSrl :
Context::get(
'member_srl');
975 $image_name = $oMemberModel->getImageName($member_srl);
990 if(!is_uploaded_file($file[
'tmp_name']))
return $this->stop(
'msg_not_uploaded_image_mark');
993 if(!$member_srl)
return $this->stop(
'msg_not_uploaded_image_mark');
996 if(
$logged_info->is_admin !=
'Y' &&
$logged_info->member_srl != $member_srl)
return $this->stop(
'msg_not_uploaded_image_mark');
999 $config = $oMemberModel->getMemberConfig();
1000 if(
$logged_info->is_admin !=
'Y' && $config->image_mark !=
'Y')
return $this->stop(
'msg_not_uploaded_image_mark');
1002 $this->insertImageMark($member_srl, $file[
'tmp_name']);
1006 $this->setRedirectUrl($returnUrl);
1019 $oMemberModel =
getModel(
'member');
1020 $config = $oMemberModel->getMemberConfig();
1021 $max_width = $config->image_mark_max_width;
1022 $max_height = $config->image_mark_max_height;
1023 $max_filesize = $config->image_mark_max_filesize;
1027 $target_path = sprintf(
'files/member_extra_info/image_mark/%s/',
getNumberingPath($member_srl));
1030 $target_filename = sprintf(
'%s%d.gif', $target_path, $member_srl);
1032 list($width, $height, $type, $attrs) = @getimagesize($target_file);
1034 if($width > $max_width || $height > $max_height || $type!=1)
1036 $temp_filename = sprintf(
'files/cache/tmp/image_mark_%d.gif', $member_srl);
1041 $filesize = filesize($temp_filename);
1042 if($max_filesize && $filesize > ($max_filesize * 1024))
1045 return $this->stop(implode(
' ' , array(
1057 $filesize = filesize($target_file);
1058 if($max_filesize && $filesize > ($max_filesize * 1024))
1061 return $this->stop(implode(
' ' , array(
1068 @copy($target_file, $target_filename);
1082 $member_srl = ($_memberSrl) ? $_memberSrl :
Context::get(
'member_srl');
1092 $oMemberModel =
getModel(
'member');
1093 $image_mark = $oMemberModel->getImageMark($member_srl);
1107 if(!$email_address)
return new BaseObject(-1,
'msg_invalid_request');
1109 $oMemberModel =
getModel(
'member');
1113 $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1114 if(!$member_srl)
return new BaseObject(-1,
'msg_email_not_exists');
1117 $columnList = array(
'denied',
'member_srl',
'user_id',
'user_name',
'email_address',
'nick_name');
1118 $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1121 if($member_info->denied ==
'Y')
1123 $chk_args =
new stdClass;
1124 $chk_args->member_srl = $member_info->member_srl;
1131 $args =
new stdClass();
1132 $args->user_id = $member_info->user_id;
1133 $args->member_srl = $member_info->member_srl;
1134 $args->new_password = $oPassword->createTemporaryPassword(8);
1135 $args->auth_key = $oPassword->createSecureSalt(40);
1136 $args->is_register =
'N';
1144 $memberInfo = array();
1146 if(is_array($member_config->signupForm))
1148 $exceptForm=array(
'password',
'find_account_question');
1149 foreach($member_config->signupForm as $form)
1151 if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1153 $memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1159 $memberInfo[
$lang->user_id] =
$args->user_id;
1160 $memberInfo[
$lang->user_name] =
$args->user_name;
1161 $memberInfo[
$lang->nick_name] =
$args->nick_name;
1162 $memberInfo[
$lang->email_address] =
$args->email_address;
1166 if(!$member_config->skin) $member_config->skin =
"default";
1167 if(!$member_config->colorset) $member_config->colorset =
"white";
1171 $tpl_path = sprintf(
'%sskins/%s', $this->module_path, $member_config->skin);
1172 if(!is_dir($tpl_path)) $tpl_path = sprintf(
'%sskins/%s', $this->module_path,
'default');
1174 $find_url =
getFullUrl (
'',
'module',
'member',
'act',
'procMemberAuthAccount',
'member_srl', $member_info->member_srl,
'auth_key',
$args->auth_key);
1178 $content = $oTemplate->compile($tpl_path,
'find_member_account_mail');
1183 $oMail =
new Mail();
1185 $oMail->setContent($content);
1186 $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:
'webmaster', $member_config->webmaster_email);
1187 $oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1190 $msg = sprintf(
Context::getLang(
'msg_auth_mail_sent'), $member_info->email_address);
1194 $this->setRedirectUrl($returnUrl);
1206 $oMemberModel =
getModel(
'member');
1208 $config = $oMemberModel->getMemberConfig();
1212 $find_account_question = trim(
Context::get(
'find_account_question'));
1213 $find_account_answer = trim(
Context::get(
'find_account_answer'));
1215 if(($config->identifier ==
'user_id' && !$user_id) || !$email_address || !$find_account_question || !$find_account_answer)
return new BaseObject(-1,
'msg_invalid_request');
1219 $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1220 if(!$member_srl)
return new BaseObject(-1,
'msg_email_not_exists');
1223 $columnList = array(
'member_srl',
'find_account_question',
'find_account_answer');
1224 $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
1227 if(!$member_info->find_account_question || !$member_info->find_account_answer)
return new BaseObject(-1,
'msg_question_not_exists');
1230 $hashed = $oPassword->checkAlgorithm($member_info->find_account_answer);
1232 $member_info->find_account_question = trim($member_info->find_account_question);
1233 if($member_info->find_account_question != $find_account_question)
1237 else if($hashed && !$oPassword->checkPassword($find_account_answer, $member_info->find_account_answer))
1241 else if(!$hashed && $find_account_answer != $member_info->find_account_answer)
1248 return new BaseObject(-1,
'msg_answer_not_matches');
1252 if($authed && !$hashed)
1254 $this->updateFindAccountAnswer($member_srl, $find_account_answer);
1257 if($config->identifier ==
'email_address')
1259 $user_id = $email_address;
1263 $temp_password = $oPassword->createTemporaryPassword(8);
1265 $args =
new stdClass();
1266 $args->member_srl = $member_srl;
1267 $args->password = $temp_password;
1268 $args->change_password_date =
'1';
1272 $_SESSION[
'xe_temp_password_' . $user_id] = $temp_password;
1274 $this->add(
'user_id',$user_id);
1277 $this->setRedirectUrl($returnUrl.
'&user_id='.$user_id);
1288 $oMemberModel =
getModel(
'member');
1294 if(!$member_srl || !$auth_key)
1296 return $this->stop(
'msg_invalid_request');
1300 $args =
new stdClass;
1301 $args->member_srl = $member_srl;
1302 $args->auth_key = $auth_key;
1307 if(strlen(
$output->data->auth_key) !== strlen($auth_key))
1312 return $this->stop(
'msg_invalid_auth_key');
1315 if(
ztime(
$output->data->regdate) < $_SERVER[
'REQUEST_TIME'] +
zgap() - 86400)
1319 $memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
1322 $auth_args =
new stdClass();
1323 $auth_args->user_id = $memberInfo->user_id;
1324 $auth_args->member_srl = $memberInfo->member_srl;
1325 $auth_args->new_password =
'';
1326 $auth_args->auth_key = $oPassword->createSecureSalt(40);
1327 $auth_args->is_register =
'Y';
1333 $this->_sendAuthMail($auth_args, $memberInfo);
1335 $this->setTemplatePath($this->module_path.
'tpl');
1336 $this->setTemplateFile(
'msg_failed_auth');
1344 if(
$output->data->is_register ==
'Y')
1346 $args->denied =
'N';
1350 $args->password = $oMemberModel->hashPassword(
$args->password);
1354 $is_register =
$output->data->is_register;
1359 return $this->stop(
$output->getMessage());
1365 $this->_clearMemberCache(
$args->member_srl);
1369 $this->setTemplatePath($this->module_path.
'tpl');
1370 $this->setTemplateFile(
'msg_success_authed');
1382 if(!$email_address)
return new BaseObject(-1,
'msg_invalid_request');
1384 $oMemberModel =
getModel(
'member');
1386 $args =
new stdClass;
1387 $args->email_address = $email_address;
1388 $memberSrl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
1389 if(!$memberSrl)
return new BaseObject(-1,
'msg_not_exists_member');
1391 $columnList = array(
'member_srl',
'user_id',
'user_name',
'nick_name',
'email_address');
1392 $member_info = $oMemberModel->getMemberInfoByMemberSrl($memberSrl, 0, $columnList);
1396 if(!$member_config->skin) $member_config->skin =
"default";
1397 if(!$member_config->colorset) $member_config->colorset =
"white";
1400 $chk_args =
new stdClass;
1401 $chk_args->member_srl = $member_info->member_srl;
1405 $auth_args =
new stdClass;
1406 $auth_args->member_srl = $member_info->member_srl;
1409 $auth_info =
$output->data[0];
1412 $renewal_args =
new stdClass;
1413 $renewal_args->member_srl = $member_info->member_srl;
1414 $renewal_args->auth_key = $auth_info->auth_key;
1417 $memberInfo = array();
1419 if(is_array($member_config->signupForm))
1421 $exceptForm=array(
'password',
'find_account_question');
1422 foreach($member_config->signupForm as $form)
1424 if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1426 $memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1432 $memberInfo[
$lang->user_id] = $member_info->user_id;
1433 $memberInfo[
$lang->user_name] = $member_info->user_name;
1434 $memberInfo[
$lang->nick_name] = $member_info->nick_name;
1435 $memberInfo[
$lang->email_address] = $member_info->email_address;
1442 $tpl_path = sprintf(
'%sskins/%s', $this->module_path, $member_config->skin);
1443 if(!is_dir($tpl_path)) $tpl_path = sprintf(
'%sskins/%s', $this->module_path,
'default');
1445 $auth_url =
getFullUrl(
'',
'module',
'member',
'act',
'procMemberAuthAccount',
'member_srl',$member_info->member_srl,
'auth_key',$auth_info->auth_key);
1449 $content = $oTemplate->compile($tpl_path,
'confirm_member_account_mail');
1451 $oMail =
new Mail();
1453 $oMail->setContent($content);
1454 $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:
'webmaster', $member_config->webmaster_email);
1455 $oMail->setReceiptor(
$args->user_name,
$args->email_address );
1459 $this->setMessage($msg);
1462 $this->setRedirectUrl($returnUrl);
1467 $memberInfo = $_SESSION[
'auth_member_info'];
1468 unset($_SESSION[
'auth_member_info']);
1472 return $this->stop(
'msg_invalid_request');
1479 return $this->stop(
'msg_invalid_request');
1482 $oMemberModel =
getModel(
'member');
1483 $member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
1486 return new BaseObject(-1,
'msg_exists_email_address');
1490 $args =
new stdClass;
1491 $args->member_srl = $memberInfo->member_srl;
1500 $args->email_address = $newEmail;
1501 list(
$args->email_id,
$args->email_host) = explode(
'@', $newEmail);
1506 return $this->stop(
$output->getMessage());
1509 $this->_clearMemberCache(
$args->member_srl);
1513 $auth_args =
new stdClass();
1514 $auth_args->user_id = $memberInfo->user_id;
1515 $auth_args->member_srl = $memberInfo->member_srl;
1516 $auth_args->new_password = $memberInfo->password;
1517 $auth_args->auth_key = $oPassword->createSecureSalt(40);
1518 $auth_args->is_register =
'Y';
1523 $memberInfo->email_address = $newEmail;
1526 $this->_sendAuthMail($auth_args, $memberInfo);
1528 $msg = sprintf(
Context::getLang(
'msg_confirm_mail_sent'), $memberInfo->email_address);
1529 $this->setMessage($msg);
1532 $this->setRedirectUrl($returnUrl);
1537 $oMemberModel =
getModel(
'member');
1538 $member_config = $oMemberModel->getMemberConfig();
1542 $memberInfo = array();
1545 if(is_array($member_config->signupForm))
1547 $exceptForm=array(
'password',
'find_account_question');
1548 foreach($member_config->signupForm as $form)
1550 if(!in_array($form->name, $exceptForm) && $form->isDefaultForm && ($form->required || $form->mustRequired))
1552 $memberInfo[$lang->{$form->name}] = $member_info->{$form->name};
1558 $memberInfo[
$lang->user_id] = $member_info->user_id;
1559 $memberInfo[
$lang->user_name] = $member_info->user_name;
1560 $memberInfo[
$lang->nick_name] = $member_info->nick_name;
1561 $memberInfo[
$lang->email_address] = $member_info->email_address;
1565 if(!$member_config->skin) $member_config->skin =
"default";
1566 if(!$member_config->colorset) $member_config->colorset =
"white";
1570 $tpl_path = sprintf(
'%sskins/%s', $this->module_path, $member_config->skin);
1571 if(!is_dir($tpl_path)) $tpl_path = sprintf(
'%sskins/%s', $this->module_path,
'default');
1573 $auth_url =
getFullUrl(
'',
'module',
'member',
'act',
'procMemberAuthAccount',
'member_srl',$member_info->member_srl,
'auth_key',$auth_args->auth_key);
1577 $content = $oTemplate->compile($tpl_path,
'confirm_member_account_mail');
1579 $oMail =
new Mail();
1581 $oMail->setContent($content);
1582 $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:
'webmaster', $member_config->webmaster_email);
1583 $oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
1598 $oMemberModel =
getModel(
'member');
1599 $columnList = array(
'site_srl',
'group_srl',
'title');
1600 $default_group = $oMemberModel->getDefaultGroup($site_module_info->site_srl, $columnList);
1601 $this->addMemberToGroup(
$logged_info->member_srl, $default_group->group_srl, $site_module_info->site_srl);
1602 $groups[$default_group->group_srl] = $default_group->title;
1617 $args =
new stdClass;
1618 $args->site_srl= $site_module_info->site_srl;
1622 $this->setMessage(
'success_deleted');
1623 $this->_clearMemberCache(
$args->member_srl, $site_module_info->site_srl);
1636 if(!
$args->colorset)
$args->colorset =
"white";
1637 if(!
$args->editor_skin)
$args->editor_skin=
"ckeditor";
1638 if(!
$args->editor_colorset)
$args->editor_colorset =
"moono";
1639 if(
$args->enable_join!=
'Y')
$args->enable_join =
'N';
1640 $args->enable_openid=
'N';
1641 if(
$args->profile_image !=
'Y')
$args->profile_image =
'N';
1642 if(
$args->image_name!=
'Y')
$args->image_name =
'N';
1643 if(
$args->image_mark!=
'Y')
$args->image_mark =
'N';
1644 if(
$args->group_image_mark!=
'Y')
$args->group_image_mark =
'N';
1645 if(!trim(strip_tags(
$args->agreement)))
$args->agreement = null;
1648 $agreement = trim(
$args->agreement);
1649 unset(
$args->agreement);
1655 $agreement_file =
_XE_PATH_.
'files/member_extra_info/agreement.txt';
1672 $signature = preg_replace(
'/<(\/?)(embed|object|param)/is',
'<$1$2', $signature);
1674 $check_signature = trim(str_replace(array(
' ',
"\n",
"\r"),
'', strip_tags($signature,
'<img><object>')));
1675 $path = sprintf(
'files/member_extra_info/signature/%s/',
getNumberingPath($member_srl));
1676 $filename = sprintf(
'%s%d.signature.php', $path, $member_srl);
1680 $buff = sprintf(
'<?php if(!defined("__XE__")) exit();?>%s', $signature);
1694 $filename = sprintf(
'files/member_extra_info/signature/%s%d.gif',
getNumberingPath($member_srl), $member_srl);
1709 $args =
new stdClass();
1710 $args->member_srl = $member_srl;
1711 $args->group_srl = $group_srl;
1712 if($site_srl)
$args->site_srl = $site_srl;
1718 $this->_clearMemberCache($member_srl, $site_srl);
1733 $obj =
new stdClass;
1735 $obj->member_srl = implode(
',',
$args->member_srl);
1738 if(
$output->data)
foreach(
$output->data as $key => $val) $date[$val->member_srl] = $val->regdate;
1743 $inserted_members = array();
1744 foreach(
$args->member_srl as $key => $val)
1746 if($inserted_members[$val])
continue;
1747 $inserted_members[$val] =
true;
1750 $obj =
new stdClass;
1751 $obj->member_srl = $val;
1754 $obj->regdate = $date[
$obj->member_srl];
1758 $this->_clearMemberCache(
$obj->member_srl,
$args->site_srl);
1773 $args =
new stdClass;
1774 $args->autologin_key = $_COOKIE[
'xeak'];
1780 setCookie(
'xeak',null,$_SERVER[
'REQUEST_TIME']+60*60*24*365);
1784 $oMemberModel =
getModel(
'member');
1785 $config = $oMemberModel->getMemberConfig();
1787 $user_id = ($config->identifier ==
'user_id') ?
$output->data->user_id :
$output->data->email_address;
1788 $password =
$output->data->password;
1790 if(!$user_id || !$password)
1792 setCookie(
'xeak',null,$_SERVER[
'REQUEST_TIME']+60*60*24*365);
1796 $do_auto_login =
false;
1799 $check_key = strtolower($user_id).$password.$_SERVER[
'HTTP_USER_AGENT'];
1800 $check_key = substr(hash_hmac(
'sha256', $check_key, substr(
$args->autologin_key, 0, 32)), 0, 32);
1802 if($check_key === substr(
$args->autologin_key, 32))
1807 $limit_date = $member_config->change_password_date;
1812 $oMemberModel =
getModel(
'member');
1813 $columnList = array(
'member_srl',
'change_password_date');
1815 if($config->identifier ==
'user_id')
1817 $member_info = $oMemberModel->getMemberInfoByUserID($user_id, $columnList);
1821 $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id, $columnList);
1824 if($member_info->change_password_date >= date(
'YmdHis', strtotime(
'-'.$limit_date.
' day')) ){
1825 $do_auto_login =
true;
1831 $do_auto_login =
true;
1837 $output = $this->doLogin($user_id);
1842 setCookie(
'xeak',null,$_SERVER[
'REQUEST_TIME']+60*60*24*365);
1855 function doLogin($user_id, $password =
'', $keep_signed =
false)
1857 $user_id = strtolower($user_id);
1858 if(!$user_id)
return new BaseObject(-1,
'null_user_id');
1860 $trigger_obj =
new stdClass();
1861 $trigger_obj->user_id = $user_id;
1862 $trigger_obj->password = $password;
1864 if(!$trigger_output->toBool())
return $trigger_output;
1866 $oMemberModel =
getModel(
'member');
1869 $config = $oMemberModel->getMemberConfig();
1870 $args =
new stdClass();
1871 $args->ipaddress = $_SERVER[
'REMOTE_ADDR'];
1874 if($config->identifier ==
'email_address')
1877 $this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
1879 if(!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id))
return $this->recordLoginError(-1,
'invalid_email_address');
1885 $this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
1887 if(!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id))
return $this->recordLoginError(-1,
'invalid_user_id');
1891 $errorCount =
$output->data->count;
1892 if($errorCount >= $config->max_error_count)
1894 $last_update = strtotime(
$output->data->last_update);
1895 $term = intval($_SERVER[
'REQUEST_TIME']-$last_update);
1896 if($term < $config->max_error_count_time)
1898 $term = $config->max_error_count_time - $term;
1899 if($term < 60) $term = intval($term).Context::getLang(
'unit_sec');
1900 elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang(
'unit_min');
1901 elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang(
'unit_hour');
1902 else $term = intval($term/86400).Context::getLang(
'unit_day');
1908 $args->ipaddress = $_SERVER[
'REMOTE_ADDR'];
1914 if($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl))
1916 return $this->recordMemberLoginError(-1,
'invalid_password',$this->memberInfo);
1920 if($this->memberInfo->denied ==
'Y')
1922 $args->member_srl = $this->memberInfo->member_srl;
1926 $_SESSION[
'auth_member_srl'] = $this->memberInfo->member_srl;
1927 $redirectUrl =
getUrl(
'',
'act',
'dispMemberResendAuthMail');
1928 return $this->setRedirectUrl($redirectUrl,
new BaseObject(-1,
'msg_user_not_confirmed'));
1933 if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date(
"Ymd"))
return new BaseObject(-9,sprintf(
Context::getLang(
'msg_user_limited'),
zdate($this->memberInfo->limit_date,
"Y-m-d")));
1935 $args->member_srl = $this->memberInfo->member_srl;
1939 $this->_clearMemberCache(
$args->member_srl, $site_module_info->site_srl);
1943 if($oDB->isTableExists(
'member_count_history') && $config->enable_login_fail_report !=
'N')
1951 $content = unserialize(
$output->data->content);
1952 if(count($content) > $config->max_error_count)
1954 foreach($content as $val)
1956 $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>';
1958 $message .=
'</ul>';
1959 $content = sprintf(
Context::getLang(
'login_fail_report_contents'),$message,date(
'Y-m-d h:i:sa'));
1963 $oCommunicationController->sendMessage(
$args->member_srl,
$args->member_srl, $title, $content,
true);
1965 if($this->memberInfo->email_address && $this->memberInfo->allow_mailing ==
'Y')
1968 $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);
1969 $oMail =
new Mail();
1970 $oMail->setTitle($title);
1971 $oMail->setContent($content);
1972 $oMail->setSender($config->webmaster_name?$config->webmaster_name:
'webmaster', $config->webmaster_email);
1973 $oMail->setReceiptor($this->memberInfo->email_id.
'('.$this->memberInfo->nick_name.
')', $this->memberInfo->email_address);
1982 if(!$trigger_output->toBool())
return $trigger_output;
1988 $random_key = $oPassword->createSecureSalt(32,
'hex');
1989 $extra_key = strtolower($user_id).$this->memberInfo->password.$_SERVER[
'HTTP_USER_AGENT'];
1990 $extra_key = substr(hash_hmac(
'sha256', $extra_key, $random_key), 0, 32);
1991 $autologin_args =
new stdClass;
1992 $autologin_args->autologin_key = $random_key.$extra_key;
1993 $autologin_args->member_srl = $this->memberInfo->member_srl;
1994 executeQuery(
'member.deleteAutologin', $autologin_args);
1995 $autologin_output =
executeQuery(
'member.insertAutologin', $autologin_args);
1996 if($autologin_output->toBool()) setCookie(
'xeak',$autologin_args->autologin_key, $_SERVER[
'REQUEST_TIME']+31536000);
1998 if($this->memberInfo->is_admin ==
'Y')
2001 if(!$oMemberAdminModel->getMemberAdminIPCheck())
2003 $_SESSION[
'denied_admin'] =
'Y';
2007 $this->setSessionInfo();
2017 $oMemberModel =
getModel(
'member');
2019 if(!$this->memberInfo && $_SESSION[
'member_srl'] && $oMemberModel->isLogged() )
2021 $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($_SESSION[
'member_srl']);
2023 if($this->memberInfo->member_srl != $_SESSION[
'member_srl'])
2025 $this->destroySessionInfo();
2030 if($this->memberInfo->denied==
'Y')
2032 $this->destroySessionInfo();
2036 $_SESSION[
'is_logged'] =
true;
2037 $_SESSION[
'ipaddress'] = $_SERVER[
'REMOTE_ADDR'];
2038 $_SESSION[
'member_srl'] = $this->memberInfo->member_srl;
2039 $_SESSION[
'is_admin'] =
'';
2040 setcookie(
'xe_logged',
'true');
2060 $this->addMemberMenu(
'dispMemberInfo',
'cmd_view_member_info');
2061 $this->addMemberMenu(
'dispMemberScrappedDocument',
'cmd_view_scrapped_document');
2062 $this->addMemberMenu(
'dispMemberSavedDocument',
'cmd_view_saved_document');
2063 $this->addMemberMenu(
'dispMemberOwnDocument',
'cmd_view_own_document');
2084 $member_popup_menu_list =
Context::get(
'member_popup_menu_list');
2085 if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array();
2087 $obj =
new stdClass;
2091 $obj->target = $target;
2092 $member_popup_menu_list[] =
$obj;
2094 Context::set(
'member_popup_menu_list', $member_popup_menu_list);
2111 if($config->limit_day)
$args->limit_date = date(
"YmdHis", $_SERVER[
'REQUEST_TIME']+$config->limit_day*60*60*24);
2117 if(!
$args->user_id)
$args->user_id =
't'.$args->member_srl;
2119 else $args->user_id = strtolower(
$args->user_id);
2124 if(
$args->allow_mailing!=
'Y')
$args->allow_mailing =
'N';
2126 if(!
$args->allow_message || (
$args->allow_message && !in_array(
$args->allow_message, array(
'Y',
'N',
'F'))))
$args->allow_message =
'Y';
2130 if(
$args->is_admin!=
'Y')
$args->is_admin =
'N';
2134 unset(
$args->is_admin);
2137 list(
$args->email_id,
$args->email_host) = explode(
'@',
$args->email_address);
2140 $args->user_id = htmlspecialchars(
$args->user_id, ENT_COMPAT | ENT_HTML401,
'UTF-8',
false);
2141 $args->user_name = htmlspecialchars(
$args->user_name, ENT_COMPAT | ENT_HTML401,
'UTF-8',
false);
2142 $args->nick_name = htmlspecialchars(
$args->nick_name, ENT_COMPAT | ENT_HTML401,
'UTF-8',
false);
2143 $args->homepage = htmlspecialchars(
$args->homepage, ENT_COMPAT | ENT_HTML401,
'UTF-8',
false);
2144 $args->blog = htmlspecialchars(
$args->blog, ENT_COMPAT | ENT_HTML401,
'UTF-8',
false);
2145 if(
$args->homepage && !preg_match(
"/^[a-z]+:\/\//i",
$args->homepage))
$args->homepage =
'http://'.$args->homepage;
2146 if(
$args->blog && !preg_match(
"/^[a-z]+:\/\//i",
$args->blog))
$args->blog =
'http://'.$args->blog;
2149 $oMemberModel =
getModel(
'member');
2152 if(
$args->password && !$password_is_hashed)
2154 if(!$oMemberModel->checkPasswordStrength(
$args->password, $config->password_strength))
2157 return new BaseObject(-1, $message[$config->password_strength]);
2159 $args->password = $oMemberModel->hashPassword(
$args->password);
2161 elseif(!
$args->password)
2163 unset(
$args->password);
2166 if(
$args->find_account_answer && !$password_is_hashed)
2168 $args->find_account_answer = $oMemberModel->hashPassword(
$args->find_account_answer);
2170 elseif(!
$args->find_account_answer)
2172 unset(
$args->find_account_answer);
2176 if($oMemberModel->isDeniedID(
$args->user_id))
2182 $member_srl = $oMemberModel->getMemberSrlByUserID(
$args->user_id);
2185 return new BaseObject(-1,
'msg_exists_user_id');
2189 if($oMemberModel->isDeniedNickName(
$args->nick_name))
2191 return new BaseObject(-1,
'denied_nick_name');
2195 $member_srl = $oMemberModel->getMemberSrlByNickName(
$args->nick_name);
2198 return new BaseObject(-1,
'msg_exists_nick_name');
2202 $member_srl = $oMemberModel->getMemberSrlByEmailAddress(
$args->email_address);
2205 return new BaseObject(-1,
'msg_exists_email_address');
2211 if(!
$args->user_id)
$args->user_id =
't'.$args->member_srl;
2224 if(is_array(
$args->group_srl_list)) $group_srl_list =
$args->group_srl_list;
2225 else $group_srl_list = explode(
'|@|',
$args->group_srl_list);
2227 if(!
$args->group_srl_list)
2229 $columnList = array(
'site_srl',
'group_srl');
2230 $default_group = $oMemberModel->getDefaultGroup(0, $columnList);
2234 $output = $this->addMemberToGroup(
$args->member_srl,$default_group->group_srl);
2245 for($i=0;$i<count($group_srl_list);$i++)
2247 $output = $this->addMemberToGroup(
$args->member_srl,$group_srl_list[$i]);
2259 if(
$args->denied ==
'Y')
2263 $auth_args =
new stdClass();
2264 $auth_args->user_id =
$args->user_id;
2265 $auth_args->member_srl =
$args->member_srl;
2266 $auth_args->new_password =
$args->password;
2267 $auth_args->auth_key = $oPassword->createSecureSalt(40);
2268 $auth_args->is_register =
'Y';
2276 $this->_sendAuthMail($auth_args,
$args);
2282 if(!$trigger_output->toBool())
2285 return $trigger_output;
2306 $oMemberModel =
getModel(
'member');
2310 if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl(
$args->member_srl);
2312 if(
$args->allow_mailing!=
'Y')
$args->allow_mailing =
'N';
2313 if(
$args->allow_message && !in_array(
$args->allow_message, array(
'Y',
'N',
'F')))
$args->allow_message =
'Y';
2322 unset(
$args->is_admin);
2323 if($is_admin ==
false)
2324 unset(
$args->denied);
2327 return $this->stop(
'msg_invalid_request');
2332 if(
$args->user_id)
$args->user_id = htmlspecialchars(
$args->user_id, ENT_COMPAT | ENT_HTML401,
'UTF-8',
false);
2333 $args->user_name = htmlspecialchars(
$args->user_name, ENT_COMPAT | ENT_HTML401,
'UTF-8',
false);
2334 $args->nick_name = htmlspecialchars(
$args->nick_name, ENT_COMPAT | ENT_HTML401,
'UTF-8',
false);
2335 $args->homepage = htmlspecialchars(
$args->homepage, ENT_COMPAT | ENT_HTML401,
'UTF-8',
false);
2336 $args->blog = htmlspecialchars(
$args->blog, ENT_COMPAT | ENT_HTML401,
'UTF-8',
false);
2337 if(
$args->homepage && !preg_match(
"/^[a-z]+:\/\//is",
$args->homepage))
$args->homepage =
'http://'.$args->homepage;
2338 if(
$args->blog && !preg_match(
"/^[a-z]+:\/\//is",
$args->blog))
$args->blog =
'http://'.$args->blog;
2341 $config = $oMemberModel->getMemberConfig();
2344 $orgMemberInfo =
$output->data;
2347 if($config->identifier ==
'email_address')
2349 $member_srl = $oMemberModel->getMemberSrlByEmailAddress(
$args->email_address);
2350 if($member_srl &&
$args->member_srl != $member_srl)
2352 return new BaseObject(-1,
'msg_exists_email_address');
2354 $args->email_address = $orgMemberInfo->email_address;
2358 $member_srl = $oMemberModel->getMemberSrlByUserID(
$args->user_id);
2359 if($member_srl &&
$args->member_srl != $member_srl)
2361 return new BaseObject(-1,
'msg_exists_user_id');
2364 $args->user_id = $orgMemberInfo->user_id;
2370 if(
$args->user_id && $oMemberModel->isDeniedID(
$args->user_id))
2376 if(
$args->nick_name && $oMemberModel->isDeniedNickName(
$args->nick_name))
2378 return new BaseObject(-1,
'denied_nick_name');
2385 $member_srl = $oMemberModel->getMemberSrlByUserID(
$args->user_id);
2386 if($member_srl &&
$args->member_srl != $member_srl)
2388 return new BaseObject(-1,
'msg_exists_user_id');
2393 $member_srl = $oMemberModel->getMemberSrlByNickName(
$args->nick_name);
2394 if($member_srl &&
$args->member_srl != $member_srl)
2396 return new BaseObject(-1,
'msg_exists_nick_name');
2399 list(
$args->email_id,
$args->email_host) = explode(
'@',
$args->email_address);
2407 if(!$oMemberModel->checkPasswordStrength(
$args->password, $config->password_strength))
2410 return new BaseObject(-1, $message[$config->password_strength]);
2412 $args->password = $oMemberModel->hashPassword(
$args->password);
2416 $args->password = $orgMemberInfo->password;
2419 if(
$args->find_account_answer) {
2420 $args->find_account_answer = $oMemberModel->hashPassword(
$args->find_account_answer);
2425 $hashed = $oPassword->checkAlgorithm($orgMemberInfo->find_account_answer);
2428 $args->find_account_answer = $orgMemberInfo->find_account_answer;
2430 $args->find_account_answer = $oPassword->createHash($orgMemberInfo->find_account_answer);
2434 if(!
$args->user_name)
$args->user_name = $orgMemberInfo->user_name;
2435 if(!
$args->user_id)
$args->user_id = $orgMemberInfo->user_id;
2436 if(!
$args->nick_name)
$args->nick_name = $orgMemberInfo->nick_name;
2437 if(!isset(
$args->description))
$args->description = $orgMemberInfo->description;
2448 if(
$args->group_srl_list)
2450 if(is_array(
$args->group_srl_list)) $group_srl_list =
$args->group_srl_list;
2451 else $group_srl_list = explode(
'|@|',
$args->group_srl_list);
2453 if(count($group_srl_list) > 0)
2455 $args->site_srl = 0;
2464 for($i=0;$i<count($group_srl_list);$i++)
2466 $output = $this->addMemberToGroup(
$args->member_srl,$group_srl_list[$i]);
2475 $this->_updatePointByGroup($orgMemberInfo->member_srl, $group_srl_list);
2481 if(!$trigger_output->toBool())
2484 return $trigger_output;
2491 $this->_clearMemberCache(
$args->member_srl,
$args->site_srl);
2494 if(!$this->memberInfo) $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl(
$args->member_srl);
2510 $oMemberModel =
getModel(
'member');
2511 $config = $oMemberModel->getMemberConfig();
2513 if(!$oMemberModel->checkPasswordStrength(
$args->password, $config->password_strength))
2516 return new BaseObject(-1, $message[$config->password_strength]);
2519 $args->password = $oMemberModel->hashPassword(
$args->password);
2521 else if(
$args->hashed_password)
2532 $this->_clearMemberCache(
$args->member_srl);
2541 $args =
new stdClass();
2542 $args->member_srl = $member_srl;
2543 $args->find_account_answer = $oPassword->createHash($answer);
2553 $trigger_obj =
new stdClass();
2554 $trigger_obj->member_srl = $member_srl;
2558 $oMemberModel =
getModel(
'member');
2560 if(!$this->memberInfo || $this->memberInfo->member_srl != $member_srl || !isset($this->memberInfo->is_admin))
2562 $columnList = array(
'member_srl',
'is_admin');
2563 $this->memberInfo = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2565 if(!$this->memberInfo)
return new BaseObject(-1,
'msg_not_exists_member');
2567 if($this->memberInfo->is_admin ==
'Y')
return new BaseObject(-1,
'msg_cannot_delete_admin');
2572 $args =
new stdClass();
2573 $args->member_srl = $member_srl;
2607 if(!$trigger_output->toBool())
2610 return $trigger_output;
2616 $this->procMemberDeleteImageName($member_srl);
2617 $this->procMemberDeleteImageMark($member_srl);
2618 $this->procMemberDeleteProfileImage($member_srl);
2619 $this->delSignature($member_srl);
2621 $this->_clearMemberCache($member_srl);
2631 if(!$_SESSION || !is_array($_SESSION))
return;
2634 $memberSrl = $memberInfo->member_srl;
2636 foreach($_SESSION as $key => $val)
2638 $_SESSION[$key] =
'';
2642 setcookie(session_name(),
'', $_SERVER[
'REQUEST_TIME']-42000);
2643 setcookie(
'sso',
'',$_SERVER[
'REQUEST_TIME']-42000);
2644 setcookie(
'xeak',
'',$_SERVER[
'REQUEST_TIME']-42000);
2645 setcookie(
'xe_logged',
'false', $_SERVER[
'REQUEST_TIME'] - 42000);
2647 if($memberSrl || $_COOKIE[
'xeak'])
2649 $args =
new stdClass();
2650 $args->member_srl = $memberSrl;
2651 $args->autologin_key = $_COOKIE[
'xeak'];
2659 $pointModuleConfig =
$oModuleModel->getModuleConfig(
'point');
2660 $pointGroup = $pointModuleConfig->point_group;
2662 $levelGroup = array();
2663 if(is_array($pointGroup) && count($pointGroup)>0)
2665 $levelGroup = array_flip($pointGroup);
2669 $resultGroup = array_intersect($levelGroup, $groupSrlList);
2670 if(count($resultGroup) > 0)
2671 $maxLevel = max(array_flip($resultGroup));
2676 $originPoint = $oPointModel->getPoint($memberSrl);
2678 if($pointModuleConfig->level_step[$maxLevel] > $originPoint)
2681 $oPointController->setPoint($memberSrl, $pointModuleConfig->level_step[$maxLevel],
'update');
2688 if(!
Context::get(
'is_logged'))
return $this->stop(
'msg_not_logged');
2693 if(!$newEmail)
return $this->stop(
'msg_invalid_request');
2695 $oMemberModel =
getModel(
'member');
2696 $member_srl = $oMemberModel->getMemberSrlByEmailAddress($newEmail);
2697 if($member_srl)
return new BaseObject(-1,
'msg_exists_email_address');
2699 if($_SESSION[
'rechecked_password_step'] !=
'INPUT_DATA')
2701 return $this->stop(
'msg_invalid_request');
2703 unset($_SESSION[
'rechecked_password_step']);
2706 $auth_args =
new stdClass();
2707 $auth_args->user_id = $newEmail;
2708 $auth_args->member_srl = $member_info->member_srl;
2709 $auth_args->auth_key = $oPassword->createSecureSalt(40);
2710 $auth_args->new_password =
'XE_change_emaill_address';
2724 $tpl_path = sprintf(
'%sskins/%s', $this->module_path, $member_config->skin);
2725 if(!is_dir($tpl_path)) $tpl_path = sprintf(
'%sskins/%s', $this->module_path,
'default');
2729 $memberInfo = array();
2730 $memberInfo[$lang->email_address] = $member_info->email_address;
2731 $memberInfo[$lang->nick_name] = $member_info->nick_name;
2737 $auth_url =
getFullUrl(
'',
'module',
'member',
'act',
'procMemberAuthEmailAddress',
'member_srl',$member_info->member_srl,
'auth_key',$auth_args->auth_key);
2741 $content = $oTemplate->compile($tpl_path,
'confirm_member_new_email');
2743 $oMail =
new Mail();
2745 $oMail->setContent($content);
2746 $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:
'webmaster', $member_config->webmaster_email);
2747 $oMail->setReceiptor( $member_info->nick_name, $newEmail );
2748 $result = $oMail->send();
2751 $this->setMessage($msg);
2754 $this->setRedirectUrl($returnUrl);
2761 if(!$member_srl || !$auth_key)
return $this->stop(
'msg_invalid_request');
2764 $args =
new stdClass;
2765 $args->member_srl = $member_srl;
2766 $args->auth_key = $auth_key;
2770 if(strlen(
$output->data->auth_key) !== strlen($auth_key))
executeQuery(
'member.deleteAuthChangeEmailAddress',
$args);
2771 return $this->stop(
'msg_invalid_modify_email_auth_key');
2774 $newEmail =
$output->data->user_id;
2775 $args->email_address = $newEmail;
2776 list(
$args->email_id,
$args->email_host) = explode(
'@', $newEmail);
2779 if(!
$output->toBool())
return $this->stop(
$output->getMessage());
2784 $this->_clearMemberCache(
$args->member_srl);
2787 $this->setTemplatePath($this->module_path.
'tpl');
2788 $this->setTemplateFile(
'msg_success_modify_email_address');
2806 $columnList = array(
'document_srl',
'module_srl',
'member_srl',
'ipaddress');
2808 $member_srl = $oDocument->get(
'member_srl');
2815 $url =
getUrl(
'',
'module',
'member',
'act',
'dispMemberSpammer',
'member_srl',$member_srl,
'module_srl',
$module_srl);
2835 $oCommentModel =
getModel(
'comment');
2836 $columnList = array(
'comment_srl',
'module_srl',
'member_srl',
'ipaddress');
2837 $oComment = $oCommentModel->getComment($comment_srl, FALSE, $columnList);
2839 $member_srl = $oComment->get(
'member_srl');
2842 if($oCommentModel->grant->manager != 1 || $member_srl==
$logged_info->member_srl)
return new BaseObject();
2845 $url =
getUrl(
'',
'module',
'member',
'act',
'dispMemberSpammer',
'member_srl',$member_srl,
'module_srl',
$module_srl);
2846 $oCommentController->addCommentPopupMenu($url,
'cmd_spammer',
'',
'popup');
2865 $isMoveToTrash =
true;
2866 if($proc_type ==
"delete")
2867 $isMoveToTrash =
false;
2871 $columnList = array(
'module_srl',
'module');
2875 if(!$grant->manager)
return new BaseObject(-1,
'msg_not_permitted');
2880 $oCommentModel =
getModel(
'comment');
2885 $this->_spammerMember($member_srl);
2888 $this->_spammerDocuments($member_srl, $isMoveToTrash);
2891 $cnt_document =
$oDocumentModel->getDocumentCountByMemberSrl($member_srl);
2892 $cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl);
2895 $remain_count = $cnt_document + $cnt_comment;
2896 if($cnt_loop == 1) $total_count = $remain_count;
2899 if($total_count > 0)
2900 $progress = intval( ( ( $total_count - $remain_count ) / $total_count ) * 100 );
2904 $this->add(
'total_count', $total_count);
2905 $this->add(
'remain_count', $remain_count);
2906 $this->add(
'progress', $progress);
2907 $this->add(
'member_srl', $member_srl);
2909 $this->add(
'cnt_loop', ++$cnt_loop);
2910 $this->add(
'proc_type', $proc_type);
2922 private function _spammerMember($member_srl) {
2924 $spam_description = trim(
Context::get(
'spam_description') );
2926 $oMemberModel =
getModel(
'member');
2927 $columnList = array(
'member_srl',
'email_address',
'user_id',
'nick_name',
'description');
2929 $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, 0, $columnList);
2932 $oCommentModel =
getModel(
'comment');
2933 $cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl);
2934 $cnt_document =
$oDocumentModel->getDocumentCountByMemberSrl($member_srl);
2935 $total_count = $cnt_comment + $cnt_document;
2937 $args =
new stdClass();
2938 $args->member_srl = $member_info->member_srl;
2939 $args->email_address = $member_info->email_address;
2940 $args->user_id = $member_info->user_id;
2941 $args->nick_name = $member_info->nick_name;
2942 $args->denied =
"Y";
2943 $args->description = trim( $member_info->description );
2944 if(
$args->description !=
"" )
$args->description .=
"\n";
2946 $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 .
"]";
2950 $this->_clearMemberCache(
$args->member_srl);
2963 private function _spammerDocuments($member_srl, $isMoveToTrash) {
2967 $oCommentModel =
getModel(
'comment');
2970 $getContentsCount = 10;
2973 $cnt_comment = $oCommentModel->getCommentCountByMemberSrl($member_srl);
2974 $cnt_document =
$oDocumentModel->getDocumentCountByMemberSrl($member_srl);
2975 if($cnt_comment > 0)
2977 $columnList = array();
2978 $commentList = $oCommentModel->getCommentListByMemberSrl($member_srl, $columnList, 0,
false, $getContentsCount);
2980 foreach($commentList as $v) {
2981 $oCommentController->deleteComment($v->comment_srl,
true, $isMoveToTrash);
2984 } elseif($cnt_document > 0) {
2985 $columnList = array();
2986 $documentList =
$oDocumentModel->getDocumentListByMemberSrl($member_srl, $columnList, 0,
false, $getContentsCount);
2988 foreach($documentList as $v) {
3001 if($oCacheHandler->isSupport())
3003 $object_key =
'member_groups:' .
getNumberingPath($member_srl) . $member_srl .
'_' . $site_srl;
3004 $cache_key = $oCacheHandler->getGroupKey(
'member', $object_key);
3005 $oCacheHandler->delete($cache_key);
3009 $object_key =
'member_groups:' .
getNumberingPath($member_srl) . $member_srl .
'_0';
3010 $cache_key = $oCacheHandler->getGroupKey(
'member', $object_key);
3011 $oCacheHandler->delete($cache_key);
3016 if($oCacheHandler->isSupport())
3018 $object_key =
'member_info:' .
getNumberingPath($member_srl) . $member_srl;
3019 $cache_key = $oCacheHandler->getGroupKey(
'member', $object_key);
3020 $oCacheHandler->delete($cache_key);
procMemberLogin($user_id=null, $password=null, $keep_signed=null)
setMessage($message= 'success', $type=NULL)
getController($module_name)
procMemberModifyInfoBefore()
getNumberingPath($no, $size=3)
zdate($str, $format= 'Y-m-d H:i:s', $conversion=TRUE)
procMemberInsertImageMark()
replaceMemberGroup($args)
doLogin($user_id, $password= '', $keep_signed=false)
procMemberFindAccountByQuestion()
& getInstance($target= 'object', $info=null, $always_use_file=false)
foreach($sitemap as $id=> &$val) $extra_vars
set($key, $val, $set_to_get_vars=0)
procMemberResetAuthMail()
insertMember(&$args, $password_is_hashed=false)
writeFile($filename, $buff, $mode="w")
procMemberSpammerManage()
updateFindAccountAnswer($member_srl, $answer)
procMemberAuthEmailAddress()
delObjectVars($target_obj, $del_obj)
_sendAuthMail($auth_args, $member_info)
addMemberToGroup($member_srl, $group_srl, $site_srl=0)
procMemberResendAuthMail()
triggerGetDocumentMenu(&$menu_list)
moveFile($source, $target)
procMemberInsertProfileImage()
procMemberDeleteImageMark($_memberSrl=0)
delSignature($member_srl)
$module_info
an object containing the module information
procMemberScrapDocument()
setRedirectUrl($url= './', $output=NULL)
deleteMember($member_srl)
insertImageMark($member_srl, $target_file)
updateMember($args, $is_admin=FALSE)
getAdminModel($module_name)
putSignature($member_srl, $signature)
procMemberDeleteSavedDocument()
getInstance($db_type=NULL)
_updatePointByGroup($memberSrl, $groupSrlList)
updateMemberPassword($args)
procMemberInsertImageName()
_clearMemberCache($member_srl, $site_srl=0)
createImageFile($source_file, $target_file, $resize_width=0, $resize_height=0, $target_type= '', $thumbnail_type= 'crop', $thumbnail_transparent=FALSE)
getRequestUri($ssl_mode=FOLLOW_REQUEST_SSL, $domain=null)
procMemberDeleteProfileImage($_memberSrl=0)
procMemberModifyPassword()
triggerGetCommentMenu(&$menu_list)
executeQueryArray($query_id, $args=NULL, $arg_columns=NULL)
executeQuery($query_id, $args=NULL, $arg_columns=NULL)
addMemberPopupMenu($url, $str, $icon= '', $target= 'self')
static clearStatCache($target, $include=false)
insertProfileImage($member_srl, $target_file)
procMemberDeleteImageName($_memberSrl=0)
triggerCall($trigger_name, $called_position, &$obj)
addMemberMenu($act, $str)
insertImageName($member_srl, $target_file)
if(isset($_REQUEST['encode'])) if(isset($_REQUEST['decode'])) $lang
procMemberModifyEmailAddress()