megabyte,
Those aren’t bugs, they’re just proposed enhancements.
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
February 10, 2010 7:00pm
Subscribe [287]#331 / May 13, 2010 10:36pm
megabyte,
Those aren’t bugs, they’re just proposed enhancements.
#332 / May 13, 2010 10:39pm
Once again confirming your awesomeness! 😛
I have been using a highly modified tank_auth but plan to give your a try.
#333 / May 13, 2010 10:44pm
Glad to hear it. Just let me know if you have any questions.
Take it easy,
#334 / May 14, 2010 4:14am
Hi Ben,
Thanks for the quick response, added both code snippets from page 25 to controller and works perfectly, once agin thanks for the support.
#335 / May 14, 2010 4:14am
Hi Ben,
Thanks for the quick response, added both code snippets from page 25 to controller and works perfectly, once aagin thanks for the support.
#336 / May 14, 2010 9:35am
I was under the impression that
$this->ion_auth->is_group('admin', 'editors', 'writers')would work. Is this correct? Or do I need to use the cumbersome
$this->ion_auth->is_group('editors')||$this->ion_auth->is_group('editors')||$this->ion_auth->is_group('writers')Thanks for clarifying me on this point!
#337 / May 14, 2010 10:04am
I was under the impression that
$this->ion_auth->is_group('admin', 'editors', 'writers')would work. Is this correct? Or do I need to use the cumbersome
$this->ion_auth->is_group('editors')||$this->ion_auth->is_group('editors')||$this->ion_auth->is_group('writers')Thanks for clarifying me on this point!
$this->ion_auth->is_group(array(‘foo’, ‘bar’));
#338 / May 14, 2010 11:23pm
Does anyone have a good solution to retrieving the users that are currently logged in?
Thanks,
Tim
What about showing the username from table ci_sessions WHERE last_activity > now() - 360
Best regards
Bernd
Hi Bernd,
Thanks for this.
What measurement is the 360 you refer to and why have you chosen it? My guess is that it is in seconds?
Thanks,
Tim
#339 / May 15, 2010 4:01am
Tim,
the session is updated every 300 seconds by default:
http://ellislab.com/codeigniter/user-guide/libraries/sessions.html
360 is just a bit overlap.
Best regards
Bernd
#340 / May 15, 2010 4:11am
Ben,
now I have joined github and pushed the files to
http://github.com/joytopia/CodeIgniter-Ion-Auth/tree/joytopia
Git and github are very new for me, and I hope I did everything allright.
Did my pull request reach you?
Best regards
Bernd
#341 / May 16, 2010 12:06pm
Hi Ben,
Trying to see if a password exists on login page so I can return an error if it doesn’t (usability issue), I have used the below code to check username and it works perfectly
/**
* Username check
*
* @return bool
* @author Ben Edmunds
**/
public function username_check($username)
{
if ($this->ion_auth->username_check($username))
{
$this->form_validation->set_message('username_check', 'The username "'.$username.'" already exists.');
return FALSE;
}
else
{
return TRUE;
}
}does something exist to check_password?
#342 / May 16, 2010 12:36pm
Bernd,
Yes I got it, thank you! I’ll try to go through it soon.
davidjlynch,
You can check to see if ion_auth->login return true or false.
#343 / May 16, 2010 2:31pm
Hi Ben,
Once again thanks for the quick response, glad to see I’m not the only one working on a Sunday. I have tried the following but just get errors, the email_check works, but as I said password_check returns errors, could you possibly help further?
public function email_check($email)
{
if ($this->ion_auth->email_check($email)){
$this->form_validation->set_message('email_check', 'The email "'.$email.'" already exists.');
return FALSE;
} else{
return TRUE;
}
}
public function password_check($password)
{
if ($this->ion_auth->login($password)){
$this->form_validation->set_message('password_check', 'The password you entered does not exists.');
return FALSE;
} else{
return TRUE;
}
}Once again thanks for all your help.
#344 / May 16, 2010 4:33pm
So I have a security question.
The is logged in function:
/**
* logged_in
*
* @return bool
* @author Mathew
**/
public function logged_in()
{
$identity = $this->ci->config->item('identity', 'ion_auth');
return (bool) $this->ci->session->userdata($identity);
}Do you think it would be better to check their credential as far as being active, and not just checking a session?
#345 / May 17, 2010 12:46am
I also don’t understand how there can be arguments in a public function inside a controller?
When I say I don’t understand, I don’t mean I’m questioning you. I mean I didn’t know you can do this, or how they would be used.
//activate the user
function activate($id, $code=false)
{
$activation = $this->ion_auth->activate($id, $code);
if ($activation) {
//redirect them to the auth page
$this->session->set_flashdata('message', $this->ion_auth->messages());
redirect("auth", 'refresh');
}
else {
//redirect them to the forgot password page
$this->session->set_flashdata('message', $this->ion_auth->errors());
redirect("auth/forgot_password", 'refresh');
}
}