Browse Source

set_user_var() implemented

develop
Emre Akay 11 years ago
parent
commit
628d6d149a
  1. 25
      application/libraries/Aauth.php

25
application/libraries/Aauth.php

@ -1575,7 +1575,32 @@ class Aauth {
$user_id = $this->CI->session->userdata('id');
}
// if var not set, set
if ( ! $this->get_user_var($key,$user_id) ) {
$data = array(
'key' => $key,
'value' => $value,
'user_id' => $user_id
);
$this->db->insert( $this->config_vars['user_variables'] , $data);
}
// if var already set, overwrite
else {
$data = array(
'key' => $key,
'value' => $value,
'user_id' => $user_id
);
$this->db->where( 'key', $key );
$this->db->where( 'user_id', $user_id);
$this->db->update( $this->config_vars['user_variables'], $data);
}
}

Loading…
Cancel
Save