Skip to content

Commit

Permalink
removed System Variables
Browse files Browse the repository at this point in the history
if anyone use the System Variables and want update to v2.5.0 a Compatibility Library is available under https://github.com/REJack/CodeIgniter-Aauth-Compat
  • Loading branch information
REJack committed May 18, 2016
1 parent 569fc87 commit bfdc6ea
Showing 1 changed file with 0 additions and 92 deletions.
92 changes: 0 additions & 92 deletions application/libraries/Aauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -2306,98 +2306,6 @@ public function list_user_var_keys($user_id = FALSE){
}
}

########################
# Aauth System Variables
########################

//tested
/**
* Set Aauth System Variable as key value
* if variable not set before, it will be set
* if set, overwrites the value
* @param string $key
* @param string $value
* @return bool
*/
public function set_system_var( $key, $value ) {

// if var not set, set
if ($this->get_system_var($key) === FALSE) {

$data = array(
'data_key' => $key,
'value' => $value,
);

return $this->aauth_db->insert( $this->config_vars['system_variables'] , $data);

}
// if var already set, overwrite
else {

$data = array(
'data_key' => $key,
'value' => $value,
);

$this->aauth_db->where( 'data_key', $key );
return $this->aauth_db->update( $this->config_vars['system_variables'], $data);
}

}

//tested
/**
* Unset Aauth System Variable as key value
* @param string $key
* @return bool
*/
public function unset_system_var( $key ) {

$this->aauth_db->where('data_key', $key);

return $this->aauth_db->delete( $this->config_vars['system_variables'] );
}

//tested
/**
* Get Aauth System Variable by key
* Return string of variable value or FALSE
* @param string $key
* @return bool|string , FALSE if var is not set, the value of var if set
*/
public function get_system_var( $key ){

$query = $this->aauth_db->where('data_key', $key);

$query = $this->aauth_db->get( $this->config_vars['system_variables'] );

// if variable not set
if ($query->num_rows() < 1) { return FALSE;}

else {

$row = $query->row();
return $row->value;
}
}

/**
* List System Variable Keys
* Return array of variable keys or FALSE
* @return bool|array , FALSE if var is not set, the value of var if set
*/

public function list_system_var_keys(){
$query = $this->aauth_db->select('data_key');
$query = $this->aauth_db->get( $this->config_vars['system_variables'] );
// if variable not set
if ($query->num_rows() < 1) { return FALSE;}
else {
return $query->result();
}
}

public function generate_recaptcha_field(){
$content = '';
if($this->config_vars['ddos_protection'] && $this->config_vars['recaptcha_active']){
Expand Down

0 comments on commit bfdc6ea

Please sign in to comment.