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

[eluser]Unknown[/eluser]
This is a brilliant auth library that I've been using with MySQL. Has anyone managed to get this library working with mssql server? I've created the db tables manually referencing my mysql setup but I'm getting username already in use errors even though the users table is empty. When I do manage to create a user (by disabling the username validation) I get an incorrect login error, though I KNOW my creds are correct.

Has anyone been able to use tank_auth with sql server?

Thanks in advance,

Billy

[eluser]breastfed[/eluser]
Where do it get all lastest MySql Tables from?

Thank you!

EDIT: sorry, blinded by the light..

[eluser]piehouserat[/eluser]
Complete CI beginner here and was wondering what was the best way of doing the following:

when accessing the default welcome controller without being logged in, instead of being redirected to auth/login how can I simply display a 'log in' hyperlink?

I can think of several ways of doing this, the most obvious being to create a new view titled something like 'notloggedin' and load that instead but would this be the best solution? Such a solution would mean that I would have a view with no matching 'notloggedin' controller.

So I guess my question is, is it bad practice to have views with no matching controllers or is it perfectly acceptable to have 1 controller that loads different views depending on the application logic.

So yeah would this be the best solution?
Code:
function index()
    {
        if (!$this->tank_auth->is_logged_in()) {
            $this->load->view('notloggedin'); // view shows link to login form
        } else {
            $data['user_id']    = $this->tank_auth->get_user_id();
            $data['username']    = $this->tank_auth->get_username();
            $this->load->view('welcome', $data);
        }
    }

[eluser]jshultz[/eluser]
Any word on when an official version will be released that supports CI 2.0 by default? Currently, we still have to d/l it and then make the changes to the models and controllers if we don't already have a patched version on hand.

[eluser]piehouserat[/eluser]
[quote author="jshultz" date="1297719374"]Any word on when an official version will be released that supports CI 2.0 by default? Currently, we still have to d/l it and then make the changes to the models and controllers if we don't already have a patched version on hand.[/quote]

directly from the developer's website http://www.konyukhov.com/soft/tank_auth/
the most recent version supports CI 2.0...

[eluser]jshultz[/eluser]
[quote author="piehouserat" date="1297720844"][quote author="jshultz" date="1297719374"]Any word on when an official version will be released that supports CI 2.0 by default? Currently, we still have to d/l it and then make the changes to the models and controllers if we don't already have a patched version on hand.[/quote]

directly from the developer's website http://www.konyukhov.com/soft/tank_auth/
the most recent version supports CI 2.0...[/quote]

lol. well apparently I need to learn to read better. I hadn't noticed that before. Smile

[eluser]imcl[/eluser]
Hello all,

I am using CI with Colin Williams' Template, as well as Tank_auth.

My template has a sidebar and content block.

While my nav menu is in the sidebar (eg, links to change email, change passwd, etc), I would like to show the corresponding forms on the content area when the links are clicked.

I haven't managed to render the change_password_form in the content area. Any ideas how to do this?

My code:

Code:
//controller, update_email.php

class Update_email extends CI_Controller
{
    function __construct()
    {
        parent::__construct();

        $this->load->helper('url');
        $this->load->library('tank_auth');
        $this->load->library('includes');
        $this->load->library('template');

    }

    function index()
    {
        if (!$this->tank_auth->is_logged_in())
        {
            redirect('/auth/login/');
        } else
        {

            $menu['items'] = $this->includes->profileMenu();
            $this->template->write_view('sidebar', 'menu_view', $menu, TRUE);
            
            $data['user_id'] = $this->tank_auth->get_user_id();
            $data['username'] = $this->tank_auth->get_username();

            $this->template->write_view('content', 'auth/change_email_form'); //not sure here what to do, not working

            $this->template->render();
        }
    }
}


Code:
//view, template.php

...

<tr>
                <td width="200">
                    <div class="">
                        &lt;?= $sidebar ?&gt;
                        </div>
                </td>

                <td width="700">
                    <div class="">
                        &lt;?= $content ?&gt;
                        </div>
                </td>
            </tr>

...

[eluser]dansmith65[/eluser]
I just noticed some issues with field lengths...


`users` table defines `username` as varchar(50) and `email` as carchar(100)

`login_attempts` table defines `login` as varchar(50)
(this needs to hold either username or email)

login_form view defines the login input to be "maxlength"=80

controller auth/login does not validate login field length

models do not trim values to be sure they fit into database without error


This can be fixed in either the database, model, controller, view, or all of the above. What's the best way to go about getting this fixed in the next release?

[eluser]dansmith65[/eluser]
I added this code to all my auth pages (substituting variable name accordingly). I always like being able to type into the first form field without having to first select it with the mouse.

Code:
&lt;!-- select login field on page load --&gt;
<javaScript type="text/javaScript">
window.onload = function () {document.getElementById("&lt;?php echo $login['id']; ?&gt;").focus();};
</javaScript>
(I replaced script tags with 'javaScript', since script tags are filtered out by the forum)

[eluser]JonoB[/eluser]
THe default index function in controllers/auth reads as follows:

Code:
function index()
{
    if ($message = $this->session->flashdata('message')) {
        $this->load->view('auth/general_message', array('message' => $message));
    } else {
        redirect('/auth/login/');
    }
}

This seems non-sensical to me.

1. Where is the $message var meant to come from?
2. Why is the $message var being compared to the flashdata var?
3. Why is the compare = and not == ?




Theme © iAndrew 2016 - Forum software by © MyBB