title: Getting Fatal Error: Call to undefined method
body: <p>I'm using CMS script. When I try to login to admin panel i'm getting error:</p>
  
  <blockquote>
    <p>Fatal error: Call to undefined method Users_model::get_user_function() in C:\xampp\htdocs\app\controllers\administrator\auth.php on line 105</p>
  </blockquote>
  
  <p>Line 105 auth.php:</p>
  
  <pre><code>$query = $this-&gt;Users_model-&gt;get_user_function($login);  
  </code></pre>
  
  <p>public function login from auth.php (where is the error causing 105 line):</p>
  
  <pre><code>public function login()
  {
  $val = $this-&gt;form_validation;
  if ($this-&gt;input-&gt;post()) {
      $val-&gt;set_rules("usernameli", "Username", "trim|required|xss_clean");
      $val-&gt;set_rules("passwordli", "Password", "trim|required|xss_clean");
      $val-&gt;set_rules("remember", "Remember me", "integer");
      if ($this-&gt;form_validation-&gt;run()) {
          if ($this-&gt;config-&gt;item("DX_login_using_username") &amp;&amp; $this-&gt;config-&gt;item("DX_login_using_email")) {
              $get_user_function = "get_login";
          } else {
              if ($this-&gt;config-&gt;item("DX_login_using_email")) {
                  $get_user_function = "get_user_by_email";
              } else {
                  $get_user_function = "get_user_by_username";
              }
          }
          $query = $this-&gt;Users_model-&gt;get_user_function($login);
          if ($query &amp;&amp; $query-&gt;num_rows() == 1) {
              $row = $val;
              if ($row-&gt;banned &gt; 0) {
                  $this-&gt;session-&gt;set_flashdata("flash_message", $this-&gt;Common_model-&gt;admin_flash_message("error", "Login failed! you are banned"));
                  redirect_admin("login", "refresh");
              } else {
                  $password    = $this-&gt;dx_auth-&gt;_encode($password);
                  $stored_hash = $row-&gt;password;
                  if (crypt($password, $stored_hash) === $stored_hash) {
                      $this-&gt;dx_auth-&gt;_set_session($row, "ALLOW");
                      if ($row-&gt;newpass) {
                          $this-&gt;users-&gt;clear_newpass($row-&gt;id);
                      }
                      if ($remember) {
                          $this-&gt;dx_auth-&gt;_create_autologin($row-&gt;id);
                      }
                      $this-&gt;dx_auth-&gt;_set_last_ip_and_last_login($row-&gt;id);
                      $this-&gt;dx_auth-&gt;_clear_login_attempts();
                      $this-&gt;dx_auth_event-&gt;user_logged_in($row-&gt;id);
                      $this-&gt;session-&gt;set_flashdata("flash_message", $this-&gt;Common_model-&gt;admin_flash_message("success", "Logged in successfully."));
                      redirect_admin("", "refresh");
                  } else {
                      $this-&gt;session-&gt;set_flashdata("flash_message", $this-&gt;Common_model-&gt;admin_flash_message("error", "Login failed! Incorrect username or password"));
                      redirect_admin("login", "refresh");
                  }
              }
          } else {
              $this-&gt;session-&gt;set_flashdata("flash_message", $this-&gt;Common_model-&gt;admin_flash_message("error", "Login failed! Incorrect username or password"));
              redirect_admin("login", "refresh");
          }
      }
  }
  $data['message_element'] = "administrator/view_login";
  $data['auth_message']    = "You are already logged in.";
  $this-&gt;load-&gt;view("administrator/admin_template", $data);
  }
  </code></pre>
  
  <p>A piece of users_model.php:</p>
  
  <pre><code>/*function get_user_by_username($username)
  {
      $this-&gt;db-&gt;where('username', $username);
      return $this-&gt;db-&gt;get($this-&gt;_table);
  }*/
  function get_user_by_username($username)
  {
      $this-&gt;db-&gt;where('username', $username);
      return $this-&gt;db-&gt;get($this-&gt;_table);
  }
  function get_user_by_email($email)
  {
      $this-&gt;db-&gt;where('email', $email);
      return $this-&gt;db-&gt;get($this-&gt;_table);
  }
  
  function get_login($login)
  {
      $this-&gt;db-&gt;where('username', $login);
      $this-&gt;db-&gt;or_where('email', $login);
      return $this-&gt;db-&gt;get($this-&gt;_table);
  }
  
  function check_ban($user_id)
  {
      $this-&gt;db-&gt;select('1', FALSE);
      $this-&gt;db-&gt;where('id', $user_id);
      $this-&gt;db-&gt;where('banned', '1');
      return $this-&gt;db-&gt;get($this-&gt;_table);
  }
  
  function check_username($username)
  {
      $this-&gt;db-&gt;select('1', FALSE);
      $this-&gt;db-&gt;where('LOWER(username)=', strtolower($username));
      return $this-&gt;db-&gt;get($this-&gt;_table);
  }
  </code></pre>