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

[eluser]Gromozeka[/eluser]
Hi jatap,

Well, I tested the library with OBSession, and it works fine. No special integration is needed, I just followed the guidelines on OBSession homepage, ie:

- copy Session.php file to library folder,
- create a new table in database, to store OB sessions,
- change config-file correspondingly,

That's it.


PS: I didn't find any advantages of OBSession in comparison to native CI sessions. Would you explain the reasons to use it?
#92

[eluser]jatap[/eluser]
Quote:PS: I didn’t find any advantages of OBSession in comparison to native CI sessions. Would you explain the reasons to use it?
I think you're right, I'm new in CI and I read OB Session page and "paranoia mode" started. ;-)


I'm working on auth controller in order to adapt it to my needs:

* Login and Register on homepage.
* Delete direct access of many functions.
* AJAX to show messages on homepage.


Any suggestion about CI AJAX library?
#93

[eluser]2think[/eluser]
Gromozeka or anyone else,

I've setup Tank Auth on Fedora Core 9, so far seems ok. However, even after giving write access to the Captcha folder, on my Register page, I'm being asked for a confirmation code. I don't see any captcha (local, not recaptcha) so clueless as to the code to enter.

As a temporary measure, I'm commenting out the lines in the register method that check for confirmation code or hard coding something.

Thanks again for what appears to be a very useful library!
#94

[eluser]jshultz[/eluser]
I'm trying to figure out how to get the views to appear in a particular location on the page. In other words, I have a page design and have got my regular views, etc. to appear as how I want them. However, now that i'm adding tank_auth into the mix I don't know enough about codeigniter to get everything to work together and play nice.

I've spent the past couple of days googling trying to figure this out but have not had much success.

So far this is what I have:

I have a site controller which contains my index and about functions. Each of those functions loads a collection of views that renders the pages. site is the default controller as of now. However, I modified it to contain the following:

Code:
function __construct()
    {
        parent::__construct();

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

This is at the top inside the Site class

inside the index function I have the following:

Code:
if (!$this->tank_auth->is_logged_in()) {
            redirect('/auth/login/');
        } else {
            $data['user_id']    = $this->tank_auth->get_user_id();
            $data['username']    = $this->tank_auth->get_username();
            $this->load->view('welcome', $data);
        }

which, as you know, loads the Auth class.

I have left this alone for the most part, except for the following. in each of the following functions (login() and register())I've added :

Code:
$this->load->view('header', $header_data);
      $this->load->view('menu');
      $this->load->view('sidebar', $sidebar_data);
      $this->load->view('content', $content_data);
      $this->load->view('footer');

This is the basic format of my sites pages and I'm using blueprint css for the css framework.

As you might have surmised I am new to codeigniter and I may be doing this all the hard way. I am determined to learn it however and will figure it out. Any help you can provide would be really appreciated.
#95

[eluser]2think[/eluser]
jshultz,

I'm new too but will try to help.

1. Although I run PHP 5, I renamed my Controller constructor to the class name. That means, when I had a class Site, my constructor was named function Site() {....
Don't know if this matters but may help some.

2. More importantly, you're calling parent::__construct and not sure why you've decided to do that. It should read as follows in this guide http://ellislab.com/codeigniter/user-gui...nstructors.
I think you need to change that to parent::Controller();

You said you want the views to appear in a certain position on the page, you'll likely need to use CSS (divs) to do that.
#96

[eluser]jshultz[/eluser]
In regards to number 1 and 2. I copied that line from welcome.php so i had no idea. Sad

I'm not sure how to get the forms to appear in the apriopriate place on the page. I agree div's should work I'm just not sure how in this instance since the content of that area will change depend on whether or not the visitor is logged in or not it's going to change.
#97

[eluser]brainer[/eluser]
I'm getting a strange issue with this libarary... when i try activate or logout i get this weird error...

It worked fine as a new project, but when i tried to replace dx auth in my existing project, i encountered these errors. I double and treble checked and all of old files have been deleted and updated with the neccassary tank auth replacements.

any ideas?

A PHP Error was encountered

Severity: Notice

Message: Undefined index: key

Filename: libraries/Tank_auth.php

Line Number: 525
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/creel3/public_html/mysite/igniter/system/libraries/Exceptions.php:164)

Filename: helpers/cookie_helper.php

Line Number: 92
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/creel3/public_html/mysite/igniter/system/libraries/Exceptions.php:164)

Filename: libraries/Session.php

Line Number: 408
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/creel3/public_html/mysite/igniter/system/libraries/Exceptions.php:164)

Filename: helpers/url_helper.php

Line Number: 541
#98

[eluser]Gromozeka[/eluser]
It looks like problem with cookies.
Please delete all cookie for your site and try again.
#99

[eluser]brainer[/eluser]
thank Gromozeka, that seems to have worked. But what caused this? is there a risk this could happen again to my users?

[eluser]Gromozeka[/eluser]
Both DX Auth and Tank Auth use the same name for autologin-cookie:
Code:
$config['autologin_cookie_name'] = 'autologin';
So when you switched to Tank Auth a cookie-collision happened. Erasing cookie cured the problem. Smile

No, I see no risk for your users here.




Theme © iAndrew 2016 - Forum software by © MyBB