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

[eluser]Gromozeka[/eluser]
Using corresponding methods of the library:

* is_logged_in - check if user authorized on the site.
* get_user_id returns user_id if user is authorized on the site, FALSE otherwise.
* get_username returns username for authorized user, FALSE otherwise. The method makes sense only if use_username is set to TRUE in config-file; otherwise returns an empty string for every user.
#22

[eluser]jabberjab[/eluser]
Awesome. Thanks again for this library, it works like a charm Smile
#23

[eluser]Gromozeka[/eluser]
U R welcome Smile Please let me know if you'll have any problem with the library.
#24

[eluser]RS71[/eluser]
Sounds promising although in my case I'd need roles & permissions
#25

[eluser]keiser1080[/eluser]
Hello i tri tank auth with postgresql,
But i get this error
Code:
A Database Error Occurred

Error Number:

ERREUR: une valeur NULL viole la contrainte NOT NULL de la colonne « user_data »

INSERT INTO "ci_sessions" ("session_id", "ip_address", "user_agent", "last_activity") VALUES ('fc40d7fc1a67d070866dc3578fdd1d1f', '81.247.128.65', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; fr; rv:1.', 1240510179)
the columns user_data is "`user_data` text COLLATE utf8_bin NOT NULL," normaly not null,
so i dont understand why the sql request contain no data for the field user_data.

Mayby the schema.sql is not correct in this version http://konyukhov.com/soft/tank_auth/tank_auth.zip ???
#26

[eluser]Gromozeka[/eluser]
It's strange. I took the session support from native CI code, as it written here:
http://ellislab.com/codeigniter/user-gui...sions.html
with the same table in DB:
Code:
CREATE TABLE IF NOT EXISTS  `ci_sessions` (
session_id varchar(40) DEFAULT '0' NOT NULL,
ip_address varchar(16) DEFAULT '0' NOT NULL,
user_agent varchar(50) NOT NULL,
last_activity int(10) unsigned DEFAULT 0 NOT NULL,
user_data text NOT NULL,
PRIMARY KEY (session_id)
);

When exactly this SQL error occur?
#27

[eluser]keiser1080[/eluser]
[quote author="Gromozeka" date="1240580059"]
with the same table in DB:
Code:
CREATE TABLE IF NOT EXISTS  `ci_sessions` (
session_id varchar(40) DEFAULT '0' NOT NULL,
ip_address varchar(16) DEFAULT '0' NOT NULL,
user_agent varchar(50) NOT NULL,
last_activity int(10) unsigned DEFAULT 0 NOT NULL,
user_data text NOT NULL,
PRIMARY KEY (session_id)
);
When exactly this SQL error occur?[/quote]

thanks for the reply
I trie to port tank auth to postgresql.
De probleme is, if i go to the page /auth/login/ . Apart of the script do this request

Code:
INSERT INTO "ci_sessions" ("session_id", "ip_address", "user_agent", "last_activity") VALUES ('fc40d7fc1a67d070866dc3578fdd1d1f', '81.247.128.65', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; fr; rv:1.', 1240510179)

as you can see there is only 4 fields in the sql request. But on the schema there are 5 field for test i have change the schema like this

Code:
CREATE TABLE IF NOT EXISTS  `ci_sessions` (
session_id varchar(40) DEFAULT '0' NOT NULL,
ip_address varchar(16) DEFAULT '0' NOT NULL,
user_agent varchar(50) NOT NULL,
last_activity int(10) unsigned DEFAULT 0 NOT NULL,
user_data text ,
PRIMARY KEY (session_id)
);
that work but i dont know if that change afect the tank auth script???
If you want i can post the schema of the postgresql database.
#28

[eluser]Gromozeka[/eluser]
I tried to google any info about this case, but found nothing.

It seems to me that the problem is in PostgreSQL driver for CodeIgniter, in session management. Unfortunately I can't prove it -- there is no PostgreSQL on my hoster's server.
Would you test how sessions work on PostgreSQL in your aplication regardless of Tank Auth? Does any similar error occur?
#29

[eluser]keiser1080[/eluser]
[quote author="Gromozeka" date="1240697657"]I tried to google any info about this case, but found nothing.

It seems to me that the problem is in PostgreSQL driver for CodeIgniter, in session management. Unfortunately I can't prove it -- there is no PostgreSQL on my hoster's server.
Would you test how sessions work on PostgreSQL in your aplication regardless of Tank Auth? Does any similar error occur?[/quote]

I think is very dificult to port to postgresql, because postgresql is realy different with mysql for exemple no unix time function in postgresql.

For testing i have install mysql to see the demo of tank auth.
I can create a account.
I recive de mail for validation.
I can validate de account.
I can login without capcha.
I can logout
I can login with capcha

include thank auth to my aplication?
I try like this, tell my if it is correct?
Code:
class Welcome extends Controller {

    function Welcome()
    {
        parent::Controller();    
        $this->load->config('tank_auth', TRUE);
        $this->load->helper(array('form', 'url'));
        $this->load->library('form_validation');
        $this->load->library('tank_auth');
        $this->lang->load('tank_auth');
    }
    
    function index()
    {  
        if ($this->tank_auth->is_logged_in())  
        {
            $this->load->view('welcome_message');
        }  
         else  
        {  
             redirect('/auth/login/');
        }  
    }
}
It is possible to manage users role with tank auth ???
If it is not possible, can you tell my the way to extend the thank auth with role and or profile for users?
#30

[eluser]Gromozeka[/eluser]
[quote author="keiser1080" date="1240753192"]

I try like this, tell my if it is correct?
Code:
class Welcome extends Controller {

    function Welcome()
    {
        parent::Controller();    
        $this->load->config('tank_auth', TRUE);
        $this->load->helper(array('form', 'url'));
        $this->load->library('form_validation');
        $this->load->library('tank_auth');
        $this->lang->load('tank_auth');
    }
    
    function index()
    {  
        if ($this->tank_auth->is_logged_in())  
        {
            $this->load->view('welcome_message');
        }  
         else  
        {  
             redirect('/auth/login/');
        }  
    }
}
It is possible to manage users role with tank auth ???
If it is not possible, can you tell my the way to extend the thank auth with role and or profile for users?[/quote]

Yes, it's correct. Also you can use get_username (or get_user_id) method to identify user when he/she is logged in.

Role management isn't supported in this version. I think that role management shouldn't be a part of authorisation library. Maybe there will be an extension for the lib, to manage user rights, give them access to different pages and moderate their profiles... But definitely it is not a direction in which I'm going to develop the library right now. I'd better add OpenId support to extend login options.

What about user profiles -- they are supported already. To add new fields to user profile you have to:
- add corresponding fields to user_profiles table in database
- create a page for editing this data by registered user.

This edit page is supposed to be added in next version of the library. Smile




Theme © iAndrew 2016 - Forum software by © MyBB