<commit_before><?php
defined('BASEPATH') OR exit('No direct script access allowed');
class C_account extends API_Controller {
    /*
     * Access Control List
     * 1    - createAccount
     * 2    - retrieveAccount
     * 4    - updateAccount
     * 8    - deleteAccount
     * 16   - batchCreateAccount
     */
    public function __construct() {
        parent::__construct();
        $this->load->model("m_account");
        $this->load->model("M_account_basic_information");
        $this->APICONTROLLERID = 9;
    }
    public function createAccount(){
        $this->accessNumber = 1;
        //registration
        $valid  =true;
        if(!$valid){
            $this->responseError(5, "Captcha Required");
        }
        if($this->checkACL() && ($this->input->post("account_type_ID") != 2) && (($this->input->post("account_type_ID") == 1 && user_type() == 1) || ($this->input->post("account_type_ID") == 3 && user_type() == 1) || ($this->input->post("account_type_ID") == 4 && $this->validReCaptcha()))){
            $this->form_validation->set_rules('username', 'Username', 'trim|required|is_unique[account.username]|alpha_numeric');
            $this->form_validation->set_rules('password', 'Password', '<PASSWORD>]');
            $this->form_validation->set_rules('status', 'Status', 'required');
            $this->form_validation->set_rules('account_type_ID', 'Account Type', 'required');
            
            $this->form_validation->set_rules('first_name', 'First Name', 'trim|required|callback_alpha_dash_space');
            ($this->input->post("middle_name")) ? $this->form_validation->set_rules('middle_name', 'Middle Name', 'trim|callback_alpha_dash_space') : null;
            $this->form_validation->set_rules('last_name', 'Last Name', 'trim|required|callback_alpha_dash_space');
            $this->form_validation->set_rules('email_detail', 'Email Detail', 'required|valid_email|is_unique[account_contact_information.detail]');
            
//            $this->form_validation->set_message('alpha_dash_space', 'Only accept alpha and spaces');
            
            if($this->form_validation->run()){
                $result = $this->m_account->createAccount(
                        $this->input->post("username"),<commit_msg>fix captcha<commit_after><?php
defined('BASEPATH') OR exit('No direct script access allowed');
class C_account extends API_Controller {
    /*
     * Access Control List
     * 1    - createAccount
     * 2    - retrieveAccount
     * 4    - updateAccount
     * 8    - deleteAccount
     * 16   - batchCreateAccount
     */
    public function __construct() {
        parent::__construct();
        $this->load->model("m_account");
        $this->load->model("M_account_basic_information");
        $this->APICONTROLLERID = 9;
    }
    public function createAccount(){
        $this->accessNumber = 1;
        //registration
        if(($this->input->post("account_type_ID") != 2) && (($this->input->post("account_type_ID") == 1 && user_type() == 1) || ($this->input->post("account_type_ID") == 3 && user_type() == 1) || ($this->input->post("account_type_ID") == 4 ))){
            if(!$this->validReCaptcha() && $this->input->post("account_type_ID") == 4){
                $this->responseError(5, "Invalid Captcha");
                $this->outputResponse();
            }
            $this->form_validation->set_rules('username', 'Username', 'trim|required|is_unique[account.username]|alpha_numeric');
            $this->form_validation->set_rules('password', 'Password', '<PASSWORD>]');
            $this->form_validation->set_rules('status', 'Status', 'required');
            $this->form_validation->set_rules('account_type_ID', 'Account Type', 'required');
            
            $this->form_validation->set_rules('first_name', 'First Name', 'trim|required|callback_alpha_dash_space');
            ($this->input->post("middle_name")) ? $this->form_validation->set_rules('middle_name', 'Middle Name', 'trim|callback_alpha_dash_space') : null;
            $this->form_validation->set_rules('last_name', 'Last Name', 'trim|required|callback_alpha_dash_space');
            $this->form_validation->set_rules('email_detail', 'Email Detail', 'required|valid_email|is_unique[account_contact_information.detail]');
            
//            $this->form_validation->set_message('alpha_dash_space', 'Only accept alpha and spaces');
            
            if($this->form_validation->run()){
                $result = $this->m_account->createAccount(
                        $this->input->post("username"),
{'fraction_non_alphanumeric': 0.16940249507550886, 'fraction_numerical': 0.00678485445392865, 'mean_word_length': 3.0913160250671443, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 93, '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': '2361190', 'n_tokens_mistral': 1333, 'n_tokens_neox': 1295, 'n_words': 199}