Skip to content

Commit

Permalink
More comment and whitespace cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtomlinson committed Jun 4, 2014
1 parent c4e9da7 commit a8fca2f
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions application/libraries/Aauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ class Aauth {
*/
public function __construct() {

// delete all errors at first :)
// Delete all errors at first
$this->errors = array();

$this->CI = & get_instance();

// dependancies
// Dependancies
$this->CI->load->library('session');
$this->CI->load->library('email');
$this->CI->load->database();
Expand All @@ -68,9 +68,6 @@ public function __construct() {

// config/aauth.php
$this->CI->config->load('aauth');

// the array which came from aauth config file
// $this->config_vars
$this->config_vars = & $this->CI->config->item('aauth');
}

Expand All @@ -88,7 +85,7 @@ public function __construct() {
*/
public function login($email, $pass, $remember = FALSE) {

// remove cookies first
// Remove cookies first
$cookie = array(
'name' => 'user',
'value' => '',
Expand Down Expand Up @@ -117,7 +114,7 @@ public function login($email, $pass, $remember = FALSE) {
$query = null;
$query = $this->CI->db->where('email', $email);

// database stores pasword md5 cripted
// Database stores pasword md5 cripted
$query = $this->CI->db->where('pass', md5($pass));
$query = $this->CI->db->where('banned', 0);
$query = $this->CI->db->get($this->config_vars['users']);
Expand All @@ -126,7 +123,7 @@ public function login($email, $pass, $remember = FALSE) {

if ($query->num_rows() > 0) {

// if email and pass matches
// If email and pass matches
// create session
$data = array(
'id' => $row->id,
Expand Down Expand Up @@ -263,6 +260,7 @@ public function control($perm_par = false){
* @return bool If session destroy successful
*/
public function logout() {

return $this->CI->session->sess_destroy();
}

Expand Down Expand Up @@ -318,6 +316,7 @@ public function list_users($group_par = FALSE, $limit = FALSE, $offset = FALSE,
* @param int $user_id User id to log in
*/
public function login_fast($user_id){

$query = $this->CI->db->where('id', $user_id);
$query = $this->CI->db->where('banned', 0);
$query = $this->CI->db->get($this->config_vars['users']);
Expand Down Expand Up @@ -374,7 +373,6 @@ public function create_user($email, $pass, $name='') {
'email' => $email,
'pass' => md5($pass),
'name' => $name,
//'banned' => 1
);

if ( $this->CI->db->insert($this->config_vars['users'], $data )){
Expand Down Expand Up @@ -456,7 +454,6 @@ public function send_verification($user_id){
$this->config_vars['link'] . $user_id . '/' . $ver_code );
$this->CI->email->send();
}
//echo $this->CI->email->print_debugger();
}

/**
Expand Down Expand Up @@ -910,6 +907,7 @@ public function is_member($group_par) {
* @return bool
*/
public function is_admin() {

return $this->is_member($this->config_vars['admin_group']);
}

Expand Down Expand Up @@ -1243,6 +1241,7 @@ public function get_pm($pm_id, $set_as_read = true){
* @return bool Delete success/failure
*/
public function delete_pm($pm_id){

return $this->CI->db->delete( $this->config_vars['pms'], array('id' => $pm_id) );
}

Expand Down

0 comments on commit a8fca2f

Please sign in to comment.