Modified error() and info() to NOT use flashdata by default
After further analysis of how error and info messages were being used
and how they were likely to be implemented, I changed the default to
NOT use CI Flashdata by default.
* @todo separate (on some level) the unvalidated users from the "banned" users
* @todo remove requirement for unique name/username (or default it to use email address, perhaps via config file)
* @todo remove requirement for unique name/username (or default it to use email address, perhaps via config file). OR remove altogether as login uses email address
* @todo add configuration to not use cookies if sessions are enabled.
*/
class Aauth {
/**
* The CodeIgniter object variable
* @access public
* @var object
*/
public $CI;
/**
* Variable for loading the config array into
* @access public
* @var array
*/
public $config_vars;
/**
* Array to store error messages
* @access public
* @var array
*/
public $errors = array();
/**
* Array to store info messages
* @access public
* @var array
*/
public $infos = array();
@ -307,6 +312,7 @@ class Aauth {
* error message, unless 'no_permission' value is set in config. If 'no_permission' is
* set in config it redirects user to the set url and passes the 'no_access' error message.
* It also updates last activity every time function called.
*
* @param bool $perm_par If not given just control user logged in or not
*/
public function control( $perm_par = false ){
@ -352,6 +358,7 @@ class Aauth {
* Fast login
* Login with just a user id
* @param int $user_id User id to log in
* @return bool true if login successful.
*/
public function login_fast($user_id){
@ -373,7 +380,9 @@ class Aauth {
);
$this->CI->session->set_userdata($data);
return true;
}
return false;
}
/**
@ -754,6 +763,7 @@ class Aauth {
* Send verification email
* Sends a verification email based on user id
* @param int $user_id User id to send verification email to
* @todo return success indicator
*/
public function send_verification($user_id){
@ -1650,9 +1660,9 @@ class Aauth {
* Error
* Add message to error array and set flash data
* @param string $message Message to add to array
* @param boolean $flashdata if true add $message to CI flashdata (deflault: true)
* @param boolean $flashdata if true add $message to CI flashdata (deflault: false)
*/
public function error($message = '', $flashdata = true){
public function error($message = '', $flashdata = false){