CodeIgniter Forums
Ion Auth - Lightweight Auth System based on Redux Auth 2 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Ion Auth - Lightweight Auth System based on Redux Auth 2 (/showthread.php?tid=27435)



Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 07-17-2012

[eluser]rip_pit[/eluser]
[quote author="Ben Edmunds" date="1342459620"]rip_pit,

Please send a pull request for any additional translations that are needed. Thanks![/quote]

As you asked, i tried to submit the first part for untranslated strings i found but i'm not sure if i did it in the right way :

I already had a fork created : from this fork, i browsed the ion_auth files and edited the ones required.

Is that the right way ? is this helpfull to you ? Hope i'm wrong another time with using GHub haaha

Quote:Fork url: http://github.com/rotinpain/CodeIgniter-Ion-Auth/
Edited Files list
. auth controller: i replaced english only strings with reference to lang file
. language / english / ion_auth_lang.php : added the strings translations
. language / french / ion_auth_lang.php ! added the strings translations



Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 07-18-2012

[eluser]joeizang[/eluser]
Mr. Ben Edmunds,

God bless you for this library. It is just genius. I only would like to ask I saw a profile() function in the model somewhere in the past versions - do we still get something like that later? And I don't get the documentation of the trigger_event(). Can anyone shed light on some of these undocumented features of this awesome library?


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 07-18-2012

[eluser]Miguel Suárez[/eluser]
Weird, I cant get the current logged in user data:

Code:
if($this->ion_auth->logged_in())
{
$data['user'] = $this->ion_auth->user()->row();    
var_dump($data['user']);
}

Prints out:

Code:
array(0) { }

Any idea?

[EDIT]

Ok I fixed with this:

Code:
if($this->ion_auth->logged_in())
{
$data['user'] = $this->ion_auth->user($this->session->userdata('user_id'))->row();    
var_dump($data['user']);
}

Or change the line 1155 in the file ion_auth_model.php to:

Code:
//if no id was passed use the current users id
if($id == NULL)
$id = $this->session->userdata('user_id');

Maybe just uncommenting the line will help, but Ive no idea what that line does.

[EDIT2]
OK, aparently just uncommenting that line works, why was it commented out?


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 07-18-2012

[eluser]Ben Edmunds[/eluser]
Hey Miguel Suárez,

It's not commented out in the latest code, maybe you have an older version?


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 07-18-2012

[eluser]Miguel Suárez[/eluser]
I probably don't have the latest version, but I downloaded it yesterday, maybe some one removed the comment some time after I downloaded It.




Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 07-19-2012

[eluser]rei[/eluser]
Hi, do I need to escape user inputted data when using the built in functions of ion auth? Like when creating a new user using ion_auth->register() ? or It is auto escaped by the ion auth functions? And one more thing, how can I create new user groups? Because the default is just admin and member, can I add new user groups like contributor and subscriber? If yes, how can I do that? Thanks again in advance Smile


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 07-19-2012

[eluser]rei[/eluser]
Hi, I want to report something. I encountered a problem in displaying the change password success messages after forgot pasword. The flash_data is being cleared by the $this->ion_auth->logout() method.

Here is the code after successfuly changing password after forgot password:

Code:
if ($change)
     { //if the password was successfully changed
      $this->session->set_flashdata('message', $this->ion_auth->messages());
      
      $this->session->set_flashdata('try', 'password changed!');
      
      $this->session->set_userdata('some_name', 'some_value');
      
      
      $this->logout();
     }






function logout()
{
  $this->data['title'] = "Logout";
  
  //log the user out
  $logout = $this->ion_auth->logout();

  //redirect them back to the page they came from
  redirect('login', 'refresh');
}




Here is the problem in the logout() in Ion Auth

/**
  * logout
  *
  * @return void
  * @author Mathew
  **/
public function logout()
{
  //Recreate the session
  $this->session->sess_destroy();   // this is destroying all session data thats why the success message is being cleared.

}








Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 07-23-2012

[eluser]ZaLiTHkA[/eluser]
I've got a problem adding users using the form found in '/auth/create_user.php', when I try add a user, I get an error page with the following message:

Quote:Error Number:

Implicit conversion from data type varchar to varbinary is not allowed. Use the CONVERT function to run this query.

INSERT INTO AESW_users (first_name, last_name, company, username, password, email, ip_address, created_on, last_login, active) VALUES ('First', 'Last', 'Company', 'first last', '91d926115b5d238dd12fd83e3cb7d8b7014e34ca', '[email protected]', '', 1343032245, 1343032245, 1)

Filename: C:\EasyPHP\www\AESPortal_CI\system\database\DB_driver.php

Line Number: 330

Looking at the values in the query, it's trying to write an empty string to the [ip_address] field.. I'm not too worried about logging IP addresses though, this will only be used on a company WAN.

I'm using EasyPHP 12 in my dev environment, with PHP 5.3.9 using a DB on SQL2005. The provided SQL scripts didn't work for me, so I manually created the tables in Management Studio, as per the 'ion_auth.mssql.sql' file in the download, I setup [ip_address] with a data type of varbinary(16).

Any suggestions here?


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 07-23-2012

[eluser]rip_pit[/eluser]
[quote author="ZaLiTHkA" date="1343033244"]
Looking at the values in the query, it's trying to write an empty string to the [ip_address] field.. I'm not too worried about logging IP addresses though, this will only be used on a company WAN.
...
I setup [ip_address] with a data type of varbinary(16).[/quote]

i encounter a problem too with ion auth login ips on my local server but i can't really remember how i solved it

What's says your logs ? CI logs / php / apache / mysql logs ?

i remember of inet_pton function but i'm not sure it was directly related


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 07-23-2012

[eluser]ZaLiTHkA[/eluser]
[quote author="rip_pit" date="1343077946"]What's says your logs ? CI logs / php / apache / mysql logs ?[/quote]

The CI forum won't let me post the relative lines from my log (I get message about not being able to post certain content), so I dropped the lines in Pastebin for now.

There's nothing in the Apache log (which makes sense, this looks like a PHP issue). I'm using MSSQL not MySQL, watching SQL Profiler while I try create a user, SQL itself doesn't ever get to the point of trying to run any insert statement. I do see a line with a SELECT from the users table looking for entries with the same username as the user I'm trying to create, but other than that, I don't see anything else helpful there.