Browse Source

Merge pull request #67 from REJack/master

fix for #66
develop v2.3.4
Emre Akay 10 years ago
parent
commit
81e28c6d72
  1. 27
      application/libraries/Aauth.php
  2. 4
      sql/Aauth_v2.sql

27
application/libraries/Aauth.php

@ -221,7 +221,7 @@ class Aauth {
}
$user_id = $query->row()->id;
if($this->config_vars['recaptcha_active']){
if( ($this->config_vars['use_cookies'] == TRUE && $this->CI->input->cookie('reCAPTCHA', TRUE) == 'true') || ($this->config_vars['use_cookies'] == FALSE && $this->CI->session->tempdata('reCAPTCHA') == 'true') ){
$reCaptcha = new ReCaptcha( $this->config_vars['recaptcha_secret']);
$resp = $reCaptcha->verifyResponse( $this->CI->input->server("REMOTE_ADDR"), $this->CI->input->post("g-recaptcha-response") );
@ -231,6 +231,7 @@ class Aauth {
return FALSE;
}
}
}
if($this->config_vars['totp_active'] == TRUE AND $this->config_vars['totp_only_on_ip_change'] == FALSE){
$query = null;
@ -2024,7 +2025,7 @@ class Aauth {
if ($this->get_user_var($key,$user_id) ===FALSE) {
$data = array(
'key' => $key,
'data_key' => $key,
'value' => $value,
'user_id' => $user_id
);
@ -2035,12 +2036,12 @@ class Aauth {
else {
$data = array(
'key' => $key,
'data_key' => $key,
'value' => $value,
'user_id' => $user_id
);
$this->aauth_db->where( 'key', $key );
$this->aauth_db->where( 'data_key', $key );
$this->aauth_db->where( 'user_id', $user_id);
return $this->aauth_db->update( $this->config_vars['user_variables'], $data);
@ -2065,7 +2066,7 @@ class Aauth {
return FALSE;
}
$this->aauth_db->where('key', $key);
$this->aauth_db->where('data_key', $key);
$this->aauth_db->where('user_id', $user_id);
return $this->aauth_db->delete( $this->config_vars['user_variables'] );
@ -2091,7 +2092,7 @@ class Aauth {
}
$query = $this->aauth_db->where('user_id', $user_id);
$query = $this->aauth_db->where('key', $key);
$query = $this->aauth_db->where('data_key', $key);
$query = $this->aauth_db->get( $this->config_vars['user_variables'] );
@ -2123,7 +2124,7 @@ class Aauth {
if ( ! $this->get_user($user_id)){
return FALSE;
}
$query = $this->aauth_db->select('key');
$query = $this->aauth_db->select('data_key');
$query = $this->aauth_db->where('user_id', $user_id);
@ -2155,7 +2156,7 @@ class Aauth {
if ($this->get_system_var($key) === FALSE) {
$data = array(
'key' => $key,
'data_key' => $key,
'value' => $value,
);
@ -2166,11 +2167,11 @@ class Aauth {
else {
$data = array(
'key' => $key,
'data_key' => $key,
'value' => $value,
);
$this->aauth_db->where( 'key', $key );
$this->aauth_db->where( 'data_key', $key );
return $this->aauth_db->update( $this->config_vars['system_variables'], $data);
}
@ -2184,7 +2185,7 @@ class Aauth {
*/
public function unset_system_var( $key ) {
$this->aauth_db->where('key', $key);
$this->aauth_db->where('data_key', $key);
return $this->aauth_db->delete( $this->config_vars['system_variables'] );
}
@ -2198,7 +2199,7 @@ class Aauth {
*/
public function get_system_var( $key ){
$query = $this->aauth_db->where('key', $key);
$query = $this->aauth_db->where('data_key', $key);
$query = $this->aauth_db->get( $this->config_vars['system_variables'] );
@ -2219,7 +2220,7 @@ class Aauth {
*/
public function list_system_var_keys(){
$query = $this->aauth_db->select('key');
$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;}

4
sql/Aauth_v2.sql

@ -91,7 +91,7 @@ CREATE TABLE `aauth_pms` (
DROP TABLE IF EXISTS `aauth_system_variables`;
CREATE TABLE `aauth_system_variables` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`key` varchar(100) NOT NULL,
`data_key` varchar(100) NOT NULL,
`value` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -151,7 +151,7 @@ DROP TABLE IF EXISTS `aauth_user_variables`;
CREATE TABLE `aauth_user_variables` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) unsigned NOT NULL,
`key` varchar(100) NOT NULL,
`data_key` varchar(100) NOT NULL,
`value` text,
PRIMARY KEY (`id`),
KEY `user_id_index` (`user_id`)

Loading…
Cancel
Save