<commit_before><?php

class Application extends CI_Controller {

    protected $data = array();      // parameters for view components
    protected $id;                  // identifier for our content
    protected $choices = array();   // our menu navbar

    public function __construct()
    {
        parent::__construct();

        // load libraries
        $this->load->model('users');

        // menu items for the navigation bar
        $this->choices['Home']               = base_url('/');
        $this->choices['Register']           = base_url('/Register');
        $this->choices['Profile Management'] = base_url('/Profile_management');
        $this->choices['User Details']       = base_url('/User_detail');
        $this->choices['Create Ad']          = base_url('/Create_ad');
        $this->choices['Admin Page']         = base_url('/Admin');

        // default placeholder values for _template view
        $this->data['baseurl']           = base_url('/');  // base url of the site
        $this->data['current_url']       = current_url();  // current url being viewed
        $this->data['page_title']        = 'Welcome';      // our default page
        $this->data['navbar_title']      = 'TobyCatApps';  // our default title
        $this->data['navbar_activelink'] = '';

        $this->errors = array();
    }

    public function login()
    {
        // extract login parameters
        $current_url = $_POST['currenturl'];
        $username    = $_POST['username'];
        $password    = $_POST['password'];

        // login the user if they provided the correct credentials
        $user_id = $this->users->get_id_by_credentials($username,$password);
        if($user_id != null)
        {
            $this->session->set_userdata(SESSION_UID,$user_id);
        }

        // go back to the user's original url
        redirect($current_url);
    }<commit_msg>all pages change navbar dep[ending on session state<commit_after><?php

class Application extends CI_Controller {

    protected $data = array();      // parameters for view components
    protected $id;                  // identifier for our content
    protected $choices = array();   // our menu navbar

    public function __construct()
    {
        parent::__construct();

        // load libraries
        $this->load->model('users');

        // menu items for the navigation bar
        if($this->users->get_current_user_id() == null)
        {
            $this->choices['Register']           = base_url('/Register');
        }
        else
        {
            $this->choices['Profile Management'] = base_url('/Profile_management');
            $this->choices['User Details']       = base_url('/User_detail');
            $this->choices['Create Ad']          = base_url('/Create_ad');
        }
        if($this->users->is_current_user_admin())
        {
            $this->choices['Admin Page']     = base_url('/Admin');
        }

        // default placeholder values for _template view
        $this->data['baseurl']           = base_url('/');  // base url of the site
        $this->data['current_url']       = current_url();  // current url being viewed
        $this->data['page_title']        = 'Welcome';      // our default page
        $this->data['navbar_title']      = 'TobyCatApps';  // our default title
        $this->data['navbar_activelink'] = '';

        $this->errors = array();
    }

    public function login()
    {
        // extract login parameters
        $current_url = $_POST['currenturl'];
        $username    = $_POST['username'];
        $password    = $_POST['password'];

        // login the user if they provided the correct credentials
        $user_id = $this->users->get_id_by_credentials($username,$password);
        if($user_id != null)
        {
            $this->session->set_userdata(SESSION_UID,$user_id);
        }

        // go back to the user's original url
        redirect($current_url);
    }
{'fraction_non_alphanumeric': 0.14242347584113332, 'fraction_numerical': 0.0, 'mean_word_length': 2.0603715170278636, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 42, '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': '4991706', 'n_tokens_mistral': 1064, 'n_tokens_neox': 1034, 'n_words': 247}