会員ログイン時のパスワードの必須解除

フォーラム 使い方全般 会員ログイン時のパスワードの必須解除

  • このトピックには2件の返信、2人の参加者があり、最後にROCKにより5年、 5ヶ月前に更新されました。
3件の投稿を表示中 - 1 - 3件目 (全3件中)
  • 投稿者
    投稿
  • #86604
    ROCK
    参加者

    ——————————————-
    WordPress のバージョン: 4.9.8
    Welcart のバージョン:1.9.13
    Welcart専用の拡張プラグイン:WCEX Multi Price
    ご利用のテーマ:WelcartBasic 子テーマ
    症状を確認したブラウザ:chrome
    サーバー:Xserver mixhost
    SSLの利用:常時SSL
    WordPress のパーマリンク設定:/2018/10/11/sample-post/
    ——————————————–

    はじめまして。
    当方、アパレルのお店をやっておりますが、
    Welcartをショッピングサイトで使用しているのではなく、
    実店舗で、お客様の管理用にと使用しております。
    お客様の電話番号のみで情報が引き出せるようにと下記のようにカスタマイズしました。

    add_filter(“usces_filter_member_check”,”my_filter_member_check”);
    function my_filter_member_check($mes){
    $mes = “”;

    if ( !WCUtils::is_blank($_POST[‘member’][‘password1’]) || !WCUtils::is_blank($_POST[‘member’][‘password2’]) ){
    if( !empty( $member_pass_rule_max ) ){
    if( $member_pass_rule_min > strlen( trim($_POST[‘member’][‘password1’]) ) || strlen( trim($_POST[‘member’][‘password1’]) ) > $member_pass_rule_max ){
    $mes .= sprintf(__(‘Please enter %2$s characters a minimum of %1$s characters and a maximum password.’, ‘usces’), $member_pass_rule_min, $member_pass_rule_max ) . “”;
    }
    }else{
    if( $member_pass_rule_min > strlen( trim($_POST[‘member’][‘password1’]) ) ){
    $mes .= sprintf(__(‘Please enter at least %s characters password.’, ‘usces’), $member_pass_rule_min) . “”;
    }
    }
    }
    if ( $_POST[‘member_regmode’] == ‘editmemberform’ ) {
    if ( (!WCUtils::is_blank($_POST[‘member’][‘password1’]) || !WCUtils::is_blank($_POST[‘member’][‘password2’]) ) && trim($_POST[‘member’][‘password1’]) != trim($_POST[‘member’][‘password2’]) )
    $mes .= __(‘Password is not correct.’, ‘usces’) . “”;

    if ( !is_email($_POST[‘member’][‘mailaddress1’]) || WCUtils::is_blank($_POST[‘member’][‘mailaddress1’]) )
    $mes .= __(‘e-mail address is not correct’, ‘usces’) . “”;

    } else if ( $_POST[‘member_regmode’] == ‘newmemberform’ ){
    if ( WCUtils::is_blank($_POST[‘member’][‘password1’]) || WCUtils::is_blank($_POST[‘member’][‘password2’]) || trim($_POST[‘member’][‘password1’]) != trim($_POST[‘member’][‘password2’]) )
    $mes .= __(‘Password is not correct.’, ‘usces’) . “”;
    if ( !is_email($_POST[‘member’][‘mailaddress1’]) || WCUtils::is_blank($_POST[‘member’][‘mailaddress1’]) || WCUtils::is_blank($_POST[‘member’][‘mailaddress2’]) || trim($_POST[‘member’][‘mailaddress1’]) != trim($_POST[‘member’][‘mailaddress2’]) )
    $mes .= __(‘e-mail address is not correct’, ‘usces’) . “”;

    }else{
    $mes .= __(‘ERROR: I was not able to complete collective operation’, ‘usces’) . “”;
    }

    if ( WCUtils::is_blank($_POST[“member”][“name1”]) )
    $mes .= __(‘Name is not correct’, ‘usces’) . “”;
    // if ( trim($_POST[“member”][“name3”]) == “” && USCES_JP )
    // $mes .= __(‘Invalid CANNAT pretend.’, ‘usces’) . “”;
    // if ( WCUtils::is_blank($_POST[“member”][“zipcode”]) )
    // $mes .= __(‘postal code is not correct’, ‘usces’) . “”;
    // if ( $_POST[“member”][“pref”] == __(‘– Select –‘, ‘usces_dual’) )
    // $mes .= __(‘enter the prefecture’, ‘usces’) . “”;
    // if ( WCUtils::is_blank($_POST[“member”][“address1”]) )
    // $mes .= __(‘enter the city name’, ‘usces’) . “”;
    // if ( WCUtils::is_blank($_POST[“member”][“address2”]) )
    // $mes .= __(‘enter house numbers’, ‘usces’) . “”;
    if ( WCUtils::is_blank($_POST[“member”][“tel”]) )
    $mes .= __(‘enter phone numbers’, ‘usces’) . “”;
    if( !WCUtils::is_blank($_POST[‘member’][“tel”]) && preg_match(“/[^\d-+]/”, trim($_POST[“member”][“tel”])) )
    $mes .= __(‘Please input a phone number with a half size number.’, ‘usces’) . “”;

    return $mes;
    }

    add_filter(“usces_filter_member_check_fromcart”,”my_filter_member_check_fromcart”);
    function my_filter_member_check_fromcart($mes){
    $mes = “”;

    if ( !WCUtils::is_blank($_POST[‘customer’][‘password1’]) || !WCUtils::is_blank($_POST[‘customer’][‘password2’]) ){
    if( !empty( $member_pass_rule_max ) ){
    if( $member_pass_rule_min > strlen( trim($_POST[‘customer’][‘password1’]) ) || strlen( trim($_POST[‘customer’][‘password1’]) ) > $member_pass_rule_max )
    $mes .= sprintf(__(‘Please enter %2$s characters a minimum of %1$s characters and a maximum password.’, ‘usces’), $member_pass_rule_min, $member_pass_rule_max ) . “”;
    }else{
    if( $member_pass_rule_min > strlen( trim($_POST[‘customer’][‘password1’]) ) )
    $mes .= sprintf(__(‘Please enter at least %s characters password.’, ‘usces’), $member_pass_rule_min) . “”;
    }
    }
    if ( WCUtils::is_blank($_POST[‘customer’][‘password1’]) || WCUtils::is_blank($_POST[‘customer’][‘password2’]) || trim($_POST[‘customer’][‘password1’]) != trim($_POST[‘customer’][‘password2’]) )
    $mes .= __(‘Password is not correct.’, ‘usces’) . “”;
    if ( !is_email($_POST[‘customer’][‘mailaddress1’]) || WCUtils::is_blank($_POST[‘customer’][‘mailaddress1’]) || WCUtils::is_blank($_POST[‘customer’][‘mailaddress2’]) || trim($_POST[‘customer’][‘mailaddress1’]) != trim($_POST[‘customer’][‘mailaddress2’]) )
    $mes .= __(‘e-mail address is not correct’, ‘usces’) . “”;

    // if ( WCUtils::is_blank($_POST[“member”][“name1”]) )
    // $mes .= __(‘Name is not correct’, ‘usces’) . “”;
    // if ( trim($_POST[“member”][“name3”]) == “” && USCES_JP )
    // $mes .= __(‘Invalid CANNAT pretend.’, ‘usces’) . “”;
    // if ( WCUtils::is_blank($_POST[“member”][“zipcode”]) )
    // $mes .= __(‘postal code is not correct’, ‘usces’) . “”;
    // if ( $_POST[“member”][“pref”] == __(‘– Select –‘, ‘usces_dual’) )
    // $mes .= __(‘enter the prefecture’, ‘usces’) . “”;
    // if ( WCUtils::is_blank($_POST[“member”][“address1”]) )
    // $mes .= __(‘enter the city name’, ‘usces’) . “”;
    // if ( WCUtils::is_blank($_POST[“member”][“address2”]) )
    // $mes .= __(‘enter house numbers’, ‘usces’) . “”;
    // if ( WCUtils::is_blank($_POST[“member”][“tel”]) )
    // $mes .= __(‘enter phone numbers’, ‘usces’) . “”;
    if( !WCUtils::is_blank($_POST[‘member’][“tel”]) && preg_match(“/[^\d-+]/”, trim($_POST[“member”][“tel”])) )
    $mes .= __(‘Please input a phone number with a half size number.’, ‘usces’) . “”;

    return $mes;
    }

    add_filter(“usces_filter_admin_member_check”,”my_filter_admin_member_check”);
    function my_filter_admin_member_check($mes){
    $mes = “”;
    if ( !is_email( trim($_POST[‘member’][“email”]) ) ){
    $mes .= __(‘e-mail address is not correct’, ‘usces’) . “”;
    }else{
    $member_table = $wpdb->prefix . “usces_member”;
    $mem_email = $wpdb->get_var( $wpdb->prepare(“SELECT mem_email FROM $member_table WHERE ID = %d LIMIT 1”, trim($_POST[‘member_id’])) );
    if( trim($_POST[‘member’][“email”]) != $mem_email ){
    $mem_ID = $wpdb->get_var( $wpdb->prepare(“SELECT ID FROM $member_table WHERE mem_email = %s LIMIT 1”, trim($_POST[‘member’][“email”])) );
    if( !empty($mem_ID) )
    $mes .= __(‘This e-mail address has been already registered.’, ‘usces’) . “”;
    }
    }

    if ( WCUtils::is_blank($_POST[‘member’][“name1”]) )
    $mes .= __(‘Name is not correct’, ‘usces’) . “”;
    // if ( trim($_POST[“mem_name3”]) == “” && USCES_JP )
    // $mes .= __(‘Invalid CANNAT pretend.’, ‘usces’) . “”;
    // if ( trim($_POST[‘member’][“zipcode”]) == “” )
    // $mes .= __(‘postal code is not correct’, ‘usces’) . “”;
    // if ( $_POST[‘member’][“pref”] == __(‘– Select –‘, ‘usces’) )
    // $mes .= __(‘enter the prefecture’, ‘usces’) . “”;
    // if ( trim($_POST[‘member’][“address1”]) == “” )
    // $mes .= __(‘enter the city name’, ‘usces’) . “”;
    // if ( trim($_POST[‘member’][“address2”]) == “” )
    // $mes .= __(‘enter house numbers’, ‘usces’) . “”;
    // if ( trim($_POST[‘member’][“tel”]) == “” )
    // $mes .= __(‘enter phone numbers’, ‘usces’) . “”;
    if( !WCUtils::is_blank($_POST[‘member’][“tel”]) && preg_match(“/[^\d-]/”, trim($_POST[“member”][“tel”])) )
    $mes .= __(‘Please input a phone number with a half size number.’, ‘usces’) . “”;

    return $mes;
    }

    Xserverですと、電話番号と名前だけ入力して新規登録しログイン時も電話番号のみで(パスワードも空)ログインできるのですが、
    mixhostですと、パスワードが空でも登録はできるのですが、ログインできません。

    こちらのフォーラムを参考にして、上記を子テーマのfunctions.phpに記述しております。
    パスワードを入力しないでログインする記述の仕方などありましたら、ご教授お願い致します。

    #86753
    nanbu
    キーマスター

    こんにちは

    パスワードが無いとなると、誰でもログインできてしまうのではないでしょうか。
    危険かと思いますが。

    #86757
    ROCK
    参加者

    nanbu様

    ご回答ありがとうございます。

    このページに関しては、私しか使用しないため、サーバーでサイト全体にアクセス制限、IP制限をかけ、WordPressでサイト全体へのログイン認証の3段階認証にしております。

3件の投稿を表示中 - 1 - 3件目 (全3件中)
  • このトピックに返信するにはログインが必要です。