本文整理汇总了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();
}