本文整理匯總了PHP中MemberModel::check_username方法的典型用法代碼示例。如果您正苦於以下問題:PHP MemberModel::check_username方法的具體用法?PHP MemberModel::check_username怎麽用?PHP MemberModel::check_username使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MemberModel
的用法示例。
在下文中一共展示了MemberModel::check_username方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: screen_modify
public function screen_modify($auth = "")
{
$btn = "";
$btn2 = "";
$this->file = "memberinfo_form.tpl";
// データベースを操作します。
$MemberModel = new MemberModel();
$PrememberModel = new PrememberModel();
if ($this->is_system && $this->action == "form") {
$_SESSION[_MEMBER_AUTHINFO] = $MemberModel->get_member_data_id($_GET['id']);
}
// フォーム要素のデフォルト値を設定
$date_defaults = ['Y' => substr($_SESSION[_MEMBER_AUTHINFO]['birthday'], 0, 4), 'm' => substr($_SESSION[_MEMBER_AUTHINFO]['birthday'], 4, 2), 'd' => substr($_SESSION[_MEMBER_AUTHINFO]['birthday'], 6, 2)];
$this->form->setDefaults(['username' => $_SESSION[_MEMBER_AUTHINFO]['username'], 'last_name' => $_SESSION[_MEMBER_AUTHINFO]['last_name'], 'first_name' => $_SESSION[_MEMBER_AUTHINFO]['first_name'], 'ken' => $_SESSION[_MEMBER_AUTHINFO]['ken'], 'birthday' => $date_defaults]);
$this->make_form_controle();
// フォームの妥當性検証
if (!$this->form->validate()) {
$this->action = "form";
}
if ($this->action == "form") {
$this->title = '更新畫麵';
$this->next_type = 'modify';
$this->next_action = 'confirm';
$btn = '確認畫麵へ';
} else {
if ($this->action == "confirm") {
$this->title = '確認畫麵';
$this->next_type = 'modify';
$this->next_action = 'complete';
$this->form->freeze();
$btn = '更新する';
$btn2 = '戻る';
} else {
if ($this->action == "complete" && isset($_POST['submit2']) && $_POST['submit2'] == '戻る') {
$this->title = '更新畫麵';
$this->next_type = 'modify';
$this->next_action = 'confirm';
$btn = '確認畫麵へ';
} else {
if ($this->action == "complete" && isset($_POST['submit']) && $_POST['submit'] == '更新する') {
$userdata = $this->form->getSubmitValues();
if (($MemberModel->check_username($userdata) || $PrememberModel->check_username($userdata)) && $_SESSION[_MEMBER_AUTHINFO]['username'] != $userdata['username']) {
$this->next_type = 'modify';
$this->next_action = 'confirm';
$this->title = '更新畫麵';
$this->message = "メールアドレスは登録済みです。";
$btn = '確認畫麵へ';
} else {
$this->title = '更新完了畫麵';
$userdata['id'] = $_SESSION[_MEMBER_AUTHINFO]['id'];
// システム側から利用するときに利用
if ($this->is_system && is_object($auth)) {
$userdata['password'] = $auth->get_hashed_password($userdata['password']);
} else {
$userdata['password'] = $this->auth->get_hashed_password($userdata['password']);
}
$userdata['birthday'] = sprintf("%04d%02d%02d", $userdata['birthday']['Y'], $userdata['birthday']['m'], $userdata['birthday']['d']);
$MemberModel->modify_member($userdata);
$this->message = "會員情報を修正しました。";
$this->file = "message.tpl";
if ($this->is_system) {
unset($_SESSION[_MEMBER_AUTHINFO]);
} else {
$_SESSION[_MEMBER_AUTHINFO] = $MemberModel->get_member_data_id($_SESSION[_MEMBER_AUTHINFO]['id']);
}
}
}
}
}
}
$this->form->addElement('submit', 'submit', $btn);
$this->form->addElement('submit', 'submit2', $btn2);
$this->form->addElement('reset', 'reset', '取り消し');
$this->view_display();
}