<commit_before><?php

/**
 * Description of BAdminRegistration
 *
 */
class SwpmAdminRegistration extends SwpmRegistration {

    public static function get_instance() {
        self::$_intance = empty(self::$_intance) ? new SwpmAdminRegistration() : self::$_intance;
        return self::$_intance;
    }

    public function show_form() {

    }

    public function register() {
        global $wpdb;
        $member = SwpmTransfer::$default_fields;
        $form = new SwpmForm($member);
        if ($form->is_valid()) {
            $member_info = $form->get_sanitized();
            $account_status = SwpmSettings::get_instance()->get_value('default-account-status', 'active');
            $member_info['account_state'] = $account_status;
            $plain_password = $member_info['<PASSWORD>'];
            unset($member_info['plain_password']);
            $wpdb->insert($wpdb->prefix . "swpm_members_tbl", $member_info);
            /*             * ******************** register to wordpress ********** */
            $query = $wpdb->prepare("SELECT role FROM " . $wpdb->prefix . "swpm_membership_tbl WHERE id = %d", $member_info['membership_level']);
            $wp_user_info = array();
            $wp_user_info['user_nicename'] = implode('-', explode(' ', $member_info['user_name']));
            $wp_user_info['display_name'] = $member_info['user_name'];
            $wp_user_info['user_email'] = $member_info['email'];
            $wp_user_info['nickname'] = $member_info['user_name'];
            if (isset($member_info['first_name'])) {
                $wp_user_info['first_name'] = $member_info['first_name'];
            }
            if (isset($member_info['last_name'])) {
                $wp_user_info['last_name'] = $member_info['last_name'];
            }
            $wp_user_info['user_login'] = $member_info['user_name'];
            $wp_user_info['password'] = $<PASSWORD>;
            $wp_user_info['role'] = $wpdb->get_var($query);
            $wp_user_info['user_registered'] = date('Y-m-d H:i:s');
            SwpmUtils::create_wp_user($wp_user_info);
            /*             * ******************** register to wordpress ********** */<commit_msg>Fix admin's account status being overridden on create.<commit_after><?php

/**
 * Description of BAdminRegistration
 *
 */
class SwpmAdminRegistration extends SwpmRegistration {

    public static function get_instance() {
        self::$_intance = empty(self::$_intance) ? new SwpmAdminRegistration() : self::$_intance;
        return self::$_intance;
    }

    public function show_form() {

    }

    public function register() {
        global $wpdb;
        $member = SwpmTransfer::$default_fields;
        $form = new SwpmForm($member);
        if ($form->is_valid()) {
            $member_info = $form->get_sanitized();
            /* -JS- Make it so that what the admin says regarding account status, goes when creating a new user.
             *$account_status = SwpmSettings::get_instance()->get_value('default-account-status', 'active');
             *$member_info['account_state'] = $account_status;
             */
            $plain_password = $<PASSWORD>['<PASSWORD>'];
            unset($member_info['plain_password']);
            $wpdb->insert($wpdb->prefix . "swpm_members_tbl", $member_info);
            /*             * ******************** register to wordpress ********** */
            $query = $wpdb->prepare("SELECT role FROM " . $wpdb->prefix . "swpm_membership_tbl WHERE id = %d", $member_info['membership_level']);
            $wp_user_info = array();
            $wp_user_info['user_nicename'] = implode('-', explode(' ', $member_info['user_name']));
            $wp_user_info['display_name'] = $member_info['user_name'];
            $wp_user_info['user_email'] = $member_info['email'];
            $wp_user_info['nickname'] = $member_info['user_name'];
            if (isset($member_info['first_name'])) {
                $wp_user_info['first_name'] = $member_info['first_name'];
            }
            if (isset($member_info['last_name'])) {
                $wp_user_info['last_name'] = $member_info['last_name'];
            }
            $wp_user_info['user_login'] = $member_info['user_name'];
            $wp_user_info['password'] = $<PASSWORD>;
            $wp_user_info['role'] = $wpdb->get_var($query);
            $wp_user_info['user_registered'] = date('Y-m-d H:i:s');
            SwpmUtils::create_wp_user($wp_user_info);
            /*             * ******************** register to wordpress ********** */
{'fraction_non_alphanumeric': 0.1767687899493057, 'fraction_numerical': 0.0, 'mean_word_length': 2.753515301902399, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5633834', 'n_tokens_mistral': 1339, 'n_tokens_neox': 1325, 'n_words': 211}