Skip to content

Commit

Permalink
Merge pull request benedmunds#210 from michaelbrooks/ipv6
Browse files Browse the repository at this point in the history
Support for IPv6 ip addresses
  • Loading branch information
benedmunds committed May 3, 2012
2 parents b566709 + 5dc4460 commit 1a64d1e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion models/ion_auth_model.php
Expand Up @@ -761,7 +761,7 @@ public function register($username, $password, $email, $additional_data = array(
'username' => $username,
'password' => $password,
'email' => $email,
'ip_address' => sprintf('%u', ip2long($ip_address)),
'ip_address' => $ip_address,
'created_on' => time(),
'last_login' => time(),
'active' => ($manual_activation === false ? 1 : 0)
Expand Down
2 changes: 1 addition & 1 deletion sql/ion_auth.mssql.sql
@@ -1,6 +1,6 @@
CREATE TABLE users (
id int NOT NULL IDENTITY(1,1),
ip_address char(16) NOT NULL,
ip_address varchar(40) NOT NULL,
username varchar(100) NOT NULL,
password varchar(40) NOT NULL,
salt varchar(40),
Expand Down
2 changes: 1 addition & 1 deletion sql/ion_auth.postgre.sql
@@ -1,6 +1,6 @@
CREATE TABLE "users" (
"id" SERIAL NOT NULL,
"ip_address" char(16) NOT NULL,
"ip_address" varchar(40) NOT NULL,
"username" varchar(100) NOT NULL,
"password" varchar(40) NOT NULL,
"salt" varchar(40),
Expand Down
4 changes: 2 additions & 2 deletions sql/ion_auth.sql
Expand Up @@ -29,7 +29,7 @@ DROP TABLE IF EXISTS `users`;

CREATE TABLE `users` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`ip_address` int(10) unsigned NOT NULL,
`ip_address` varchar(40) NOT NULL,
`username` varchar(100) NOT NULL,
`password` varchar(40) NOT NULL,
`salt` varchar(40) DEFAULT NULL,
Expand All @@ -54,7 +54,7 @@ CREATE TABLE `users` (
#

INSERT INTO `users` (`id`, `ip_address`, `username`, `password`, `salt`, `email`, `activation_code`, `forgotten_password_code`, `created_on`, `last_login`, `active`, `first_name`, `last_name`, `company`, `phone`) VALUES
('1',INET_ATON('127.0.0.1'),'administrator','59beecdf7fc966e2f17fd8f65a4a9aeb09d4a3d4','9462e8eee0','admin@admin.com','',NULL,'1268889823','1268889823','1', 'Admin','istrator','ADMIN','0');
('1','127.0.0.1','administrator','59beecdf7fc966e2f17fd8f65a4a9aeb09d4a3d4','9462e8eee0','admin@admin.com','',NULL,'1268889823','1268889823','1', 'Admin','istrator','ADMIN','0');


DROP TABLE IF EXISTS `users_groups`;
Expand Down

0 comments on commit 1a64d1e

Please sign in to comment.