<commit_before><?php
class auth_model extends CI_Model{

    public function __construct(){
        parent:: __construct();
        $this->load->database();
    }

    public function login(){
        /**both variables are form fields */
        $username = $_POST['username'];
        $password = $_POST['password'];
        /** Query gets generated to look if user exists */
        $this->db->select('password');
        $this->db->from('users');
        $this->db->where('username', $username);
        $query = $this->db->get();
        /** if statement looks if query is filled with results */
        if($query->num_rows() > 0) {
            /** @var  $user  query row get ranamed  */
            $user = $query->row();
            /** looks if query has username in it */
            $hash = $query->result_object[0]->password;
                    if (verifyPassword($password, $hash)){
                            $roleId = $this->getRoleId($username);
                            $this->session->set_userdata('user_logged', TRUE);
                            $this->session->set_userdata('username', $username);
                            $this->session->set_userdata('role_id', $roleId);
                /** redirect to new page behind login page*/
                redirect('home');
            }
    }
        /** if $query is empty give error on login page*/
        else{
            $this->session->set_flashdata("ERROR", "Invalid username or password!");
            redirect("auth/login", "refresh");
        }<commit_msg>redirect admin<commit_after><?php
class auth_model extends CI_Model{

    public function __construct(){
        parent:: __construct();
        $this->load->database();
    }

    public function login(){
        /**both variables are form fields */
        $username = $_POST['username'];
        $password = $_POST['password'];
        /** Query gets generated to look if user exists */
        $this->db->select('password');
        $this->db->from('users');
        $this->db->where('username', $username);
        $query = $this->db->get();
        /** if statement looks if query is filled with results */
        if($query->num_rows() > 0) {
            /** @var  $user  query row get ranamed  */
            $user = $query->row();
            /** looks if query has username in it */
            $hash = $query->result_object[0]->password;
                    if (verifyPassword($password, $hash)){
                            $roleId = $this->getRoleId($username);
                            $this->session->set_userdata('user_logged', TRUE);
                            $this->session->set_userdata('username', $username);
                            $this->session->set_userdata('role_id', $roleId);
                /** redirect to new page behind login page*/
                if ($this->session->role_id == '99'){
                    redirect('backend/index');
                }
                else{
                redirect('home');
                }
            }
    }
        /** if $query is empty give error on login page*/
        else{
            $this->session->set_flashdata("ERROR", "Invalid username or password!");
            redirect("auth/login", "refresh");
        }
{'fraction_non_alphanumeric': 0.15030864197530863, 'fraction_numerical': 0.001851851851851852, 'mean_word_length': 1.7076023391812865, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 53, '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': '3201750', 'n_tokens_mistral': 820, 'n_tokens_neox': 800, 'n_words': 208}