Welcome Guest, Not a member yet? Register   Sign In
Tank Auth v1.0 (CI authentication library)

[eluser]niranjnn01[/eluser]
Hello...

after logging in... if we click the back button,.... we are taken to the login page again.... security lapse ...

what can be done to prevent it??

Rakesh

[eluser]Trae R.[/eluser]
Gromzeka,

Fabulous work, really.

I have a few questions, all out of curiosity:

1. Any specific reason for choosing InnoDB?
2. Any specific reason for not setting many of the database fields to UNSIGNED?
3. Where can I donate $$ to the project?

Thank you for Tank Auth!

[eluser]night_day[/eluser]
[quote author="Gromozeka" date="1239907450"]Hi Laurentvw,

Thank you for your support and for the time you've spent to work with Tank Auth. Smile

I've fixed the issues you found. Now email and username fields are case-insensitive (so both 'laurentvw' and 'Laurentvw' will work). SQL-injection is also fixed. Please download the latest version (1.0.2) from the same location:

http://konyukhov.com/soft/tank_auth/tank_auth.zip

About captcha: I met the same problem with CAPTCHA while working with DX Auth, so maybe my experience will be useful for you. There were 2 problems: 1) server was unable to create captcha-files, and 2) browser was unable to show them.

The solution for 1st one was to fix write-rights for the captcha folder. Please notice, the path in the config-file is absolute and server-related. So if you set it this way: $config['captcha_path'] = 'img/captcha/'; then you will have to create folder img (with writable folder captcha inside) in the same directory where your system folder is.

If the captcha-images are been creating in this folder but the browser cannot render them, I recommend you to check your htaccess file -- maybe access to your captcha folder is not permitted (as it was in my case).

Hope that it will help you. Smile[/quote]

Can you share the htaccess solution? I'm having this issue as well and always am horrible with htaccess!

[eluser]frogsaway[/eluser]
Gromozeka,

Thank you for the work you've put into Tank Auth. I like it a lot (especially since I didn't have to write it myself).

I've been playing around with it and noticed that you have no method built in to return the users email address. You do provide functions to return the user id & username (get_user_id, get_username).

Normally this wouldn't be an issue, but I'm building a site with email login only, and as the email address it the login it'd be handy to be able to retrieve it when necessary.

There are two work arounds to this, I don't know which is better.

1/ Alter the login function so that on successful login the username session variable is the email address. This way get_username() will return the email address that was used to login.

Note I haven't tested this bit.
Code:
if (($login_by_username AND $login_by_email) OR $login_by_username)
  $this->ci->session->set_userdata(array(
    'user_id'  => $user->id,
    'username' => $user->username,
    'status'   => ($user->activated == 1) ? STATUS_ACTIVATED : STATUS_NOT_ACTIVATED,
  ));
                        
if ($login_by_email)
  $this->ci->session->set_userdata(array(
    'user_id'  => $user->id,
    'username' => $user->email,
    'status'   => ($user->activated == 1) ? STATUS_ACTIVATED : STATUS_NOT_ACTIVATED,
  ));

or

2/ Alter the login function to create an extra session variable for the users email address and create a new function get_email() which returns this, then leave it up to the developer to know which one should be used in their situation.

eg
Code:
$this->ci->session->set_userdata(array(
  'user_id'  => $user->id,
  'username' => $user->username,
  'email'    => $user->email,
  'status'   => ($user->activated == 1) ? STATUS_ACTIVATED : STATUS_NOT_ACTIVATED,
));

and

Code:
/**
     * Get email
     *
     * @return    string
     */
    function get_email()
    {
        return $this->ci->session->userdata('email');
    }

Or alternately combine them together so that the users email address is available regardless of login method.

Shrug, Just a suggestion.

Cheers,
D.

[eluser]souzadavi[/eluser]
Hello, thanks for great job done... i´m not sure if it´s already in this topic, i couldn´t find....

I want to grab the users who are logged (online) in the page.... to use a chat system like gmail, http://anantgarg.com/2009/05/13/gmail-fa...uery-chat/

could you please give some directions how to get this done?

the tank auth is working like a charm in my site!

Thanks
Davi Souza

[eluser]rich.a.coy[/eluser]
Love this library. Got it installed and working except for 1 little detail. Where/how do I set it that as soon as someone logs in they are sent to my dashboard controller?

I've tried this in the login function of the auth.php file but it does not work:
Code:
function login()
{
if ($this->tank_auth->is_logged_in()) {                                    
redirect('dashboard');
}

I'm new to CI, and OOP, so please bare with me if this is an obvious question.

Thanks!

[EDIT]

Okay, I got this working. Not sure if this the approved way but it solved my issue.
I made a controller called Site_router and made that the default controller for my site. Then used the following code to either pass someone into the dashboard controller if logged in or on to the home page if not logged in.

Code:
class Site_router extends Controller
{
    function __construct()
    {
      parent::__construct();
      $this->load->helper('url');
      $this->load->library('tank_auth');
    }

    function index()
    {
        // If user is logged in reroute to dashboard
        if ($this->tank_auth->is_logged_in()) {
            redirect('/dashboard/');
        } else {
        // If user not logged in show home page content
            $this->load->view('home_page');
        }
    }
}

If there is a better way I'd love to know about it but this works and hopefully will help someone else who is new to CI and Tank Auth.

[eluser]rip_pit[/eluser]
hi guys, first, thanks for the good work and helpful topic.

Working with tank auth, even if it works fine "out of the box" I would need some advices to go further.

I'm trying (without success) to insert tank_auth's parts into another page.

It's to say, I would want to insert (like with an include) the login_form part from tank auth into my own page (instead of having to load the auth/login existing page).

Does any of you have any clues about what's the best way to do it ?

instead of
Code:
if (!$this->tank_auth->is_logged_in())
redirect('/auth/login/');

i would want something like
Code:
if (!$this->tank_auth->is_logged_in())
//show the login form from tank auth (like with include('login_form');
//in order the user could log in from the first page, not only from auth/login

Hope someone could help coz i'm having a bad time trying to do it alone. thanx for reading Wink

[eluser]rip_pit[/eluser]
not sure about the place for your question ?
is it related to C.I. ?

[eluser]laurisnet[/eluser]
Hello,

Is there any possibility to create this captcha on simple form which is not related to login or registration?

Thanks
Lauris

[eluser]souzadavi[/eluser]
i already have tank auth working fine, and now i isntalled phpbb, and i want to know how could i integrate this library with phpbb?? any suggestion?

thanks




Theme © iAndrew 2016 - Forum software by © MyBB