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

[eluser]Khanh[/eluser]
[quote author="bargainph" date="1246610930"][quote author="Khanh" date="1246606975"]Is Tank auth use for kohana framework?[/quote]

Are you serious? Does this look like the Kohana website?[/quote]

At present, I am using Kohana framework. It is same as Codeigniter, but structure and writing is different from Codeigniter a little.
#82

[eluser]Thorpe Obazee[/eluser]
[quote author="Khanh" date="1246613699"]
At present, I am using Kohana framework. It is same as Codeigniter, but structure and writing is different from Codeigniter a little.[/quote]

And your point is?

Anyway, Kohana has it's own native Auth Module and it's very easy to learn...

And I don't think TankAuth was meant to use for Kohana as stated in the first post.
[quote author="Gromozeka" date="1239135230"]Hi folks,

I'd like to introduce a new authorization library for CI, based on DX Auth.[/quote]
#83

[eluser]Gromozeka[/eluser]
[quote author="Khanh" date="1246606975"]Is Tank auth use for kohana framework?[/quote]

Sorry, I hasn't tested it for Kohana.

But it's interesting. If you check it and find any errors I would be glad to fix it.
#84

[eluser]rvillalon[/eluser]
Hi,

In response to the simple HTML from the very first post-->I agree that this authentication library makes it very simple to integrate when building a social network with only minimal code.

Also, how would I go about elegantly adding an option to disable/enable the "remember me" function?
#85

[eluser]Gromozeka[/eluser]
[quote author="rvillalon" date="1246839458"]Also, how would I go about elegantly adding an option to disable/enable the "remember me" function?[/quote]

To disable this option just remove the checkbox from the login page.

If you want to disable corresponding code in controller also, then you have to get rid of 'remember' field processing code -- there are 2 lines in login() method. That's all.


But I would stop after removing checkbox from the view.. Smile
#86

[eluser]rvillalon[/eluser]
Hey Gromozeka,

I wanted to add the feature into Tank Auth more gracefully so I made all the necessary modifications on all the files and tried to go along with your programming style.

For anyone who might need to disable the "remember me" feature, I'ved attached the modified files for you.

Here's a list of the modifications (MODIFIED Tank Auth 1.0.3):

config/tank_auth.php
Added line 61

From
Code:
$config['login_by_email'] = TRUE;
$config['login_record_ip'] = TRUE;

To
Code:
$config['login_by_email'] = TRUE;
$config['login_remember'] = FALSE;
$config['login_record_ip'] = TRUE;

controllers/auth.php
Added line 38
Added/modified lines 43-44
Added line 70

From
Code:
$data['login_by_email'] = $this->config->item('login_by_email', 'tank_auth');

To
Code:
$data['login_by_email'] = $this->config->item('login_by_email', 'tank_auth');
$data['login_remember'] = $this->config->item('login_remember', 'tank_auth');

From
Code:
$this->form_validation->set_rules('remember', 'Remember me', 'integer');

To
Code:
if ($data['login_remember'])
    $this->form_validation->set_rules('remember', 'Remember me', 'integer');

From
Code:
$data['login_by_email'])) {

To
Code:
$data['login_by_email'],
$data['login_remember'])) {

libraries/Tank_auth.php
Modified line 47
Modified lines 80-84

From
Code:
function login($login, $password, $remember, $login_by_username, $login_by_email)

To
Code:
function login($login, $password, $remember, $login_by_username, $login_by_email, $login_remember)

From
Code:
if ($remember) {
    $this->create_autologin($user->id);
}

To
Code:
if ($login_remember) {
    if ($remember) {
        $this->create_autologin($user->id);
    }
}

views/login_form.php
Added/modified lines 85-88

From
Code:
<?php echo form_checkbox($remember); ?>
<?php echo form_label('Remember me', $remember['id']); ?>

To
Code:
<?php if ($login_remember) { ?>
    <?php echo form_checkbox($remember); ?>
    <?php echo form_label('Remember me', $remember['id']); ?>
<?php } ?>

----------

Let me know if anyone has issues with this! :-)
#87

[eluser]jatap[/eluser]
Hi Gromozeka and friends,

I've tested other auth libs and this one makes my best option to use in production status, with some little changes.

I'd like to replace or add OBSession support, it improves CI and it's similar. Is there any open develop or idea about it to collaborate?


Thanks for your work and your effort.
#88

[eluser]Gromozeka[/eluser]
Hi jatap,

Sure! it's open library, so any improvements are welcome.

Would you describe these OBSessions a little bit? Pros & cons, how to integrate?

Thanks in advance.
#89

[eluser]jatap[/eluser]
Hello again,

let's start describing OB Session as a improve of CI session native class.

I'm testing it last week and looks good. Althout library creator leaved project to join Kohana Framework, code is bug free and operative.



Quote:From CI Wiki -> OB Session

* Modifications of original CI implementation:

The session variable “last_visit” is removed and replaced with “session_start”.

Be aware that some session data is always present in the session cookie.
* session_id
* session_start
* session_last_activity
* session_ip
* session_user_agent

Please enable cookie encryption if you do not want this info to be visible.

* Usage

The same as the original CI session library

Quote:From OB Session -> Homepage

* Major weaknesses of the library:

1. Security: The User Data is stored in a cookie, client-side.
2. Security: The session is vulnerable to session fixation.
3. Usability: Enabling the session database does not actually store User-Data in the database!
4. Usability: Things like non-persistent sessions, flash variables and session id regeneration are not enabled.


To replace CI native session with OB Session you must follow OBSession install steps and change Tank_Auth sql insert file with new table fields.

I'm writing some little code to extend Output Class in order to show session values when starts debug(enable_profiler).

Greetings.

Excuse my english, is not so good as I wish. ;-)
#90

[eluser]2think[/eluser]
Nice library, is there any list of items you want/need help on for updating? Hands full right now but may have some free time over the weekend and really think this is a great lib.

If there's a list of to-do's for the next version, that would be great.

Thanks again for the work




Theme © iAndrew 2016 - Forum software by © MyBB