Skip to content
This repository has been archived by the owner on Nov 27, 2017. It is now read-only.

Commit

Permalink
unsigned added to IDs, removed company and telephone
Browse files Browse the repository at this point in the history
  • Loading branch information
emad-elsaid committed Apr 16, 2011
1 parent e211188 commit ca22f6a
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 63 deletions.
2 changes: 1 addition & 1 deletion application/config/config.php
Expand Up @@ -248,7 +248,7 @@
$config['sess_expiration'] = 7200;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = FALSE;
$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
Expand Down
4 changes: 2 additions & 2 deletions application/config/ion_auth.php
Expand Up @@ -16,7 +16,7 @@
* Original Author name has been kept but that does not mean that the method has not been modified.
*
*/

require 'config.php';
/**
* Tables.
**/
Expand All @@ -27,7 +27,7 @@
/**
* Site Title, example.com
*/
$config['site_title'] = "Example.com";
$config['site_title'] = $config_site_name;

/**
* Admin Email, admin@example.com
Expand Down
19 changes: 3 additions & 16 deletions application/controllers/auth.php
Expand Up @@ -189,8 +189,6 @@ public function create_user(){
$this->form_validation->set_rules('first_name', lang('system_first_name'), 'required|xss_clean');
$this->form_validation->set_rules('last_name', lang('system_last_name'), 'required|xss_clean');
$this->form_validation->set_rules('email', lang('system_email'), 'required|valid_email');
$this->form_validation->set_rules('phone', lang('system_phone'), 'required|xss_clean|min_length[3]|max_length[20]');
$this->form_validation->set_rules('company', lang('system_company'), 'required|xss_clean');
$this->form_validation->set_rules('password', lang('system_password'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');
$this->form_validation->set_rules('password_confirm', lang('system_password_conf'), 'required');

Expand All @@ -199,10 +197,9 @@ public function create_user(){
$email = $this->input->post('email');
$password = $this->input->post('password');

$additional_data = array('first_name' => $this->input->post('first_name'),
'last_name' => $this->input->post('last_name'),
'company' => $this->input->post('company'),
'phone' => $this->input->post('phone') ,
$additional_data = array(
'first_name' => $this->input->post('first_name'),
'last_name' => $this->input->post('last_name')
);
}

Expand All @@ -229,16 +226,6 @@ public function create_user(){
'type' => 'text',
'value' => $this->form_validation->set_value('email'),
);
$this->data['company'] = array('name' => 'company',
'id' => 'company',
'type' => 'text',
'value' => $this->form_validation->set_value('company'),
);
$this->data['phone'] = array('name' => 'phone',
'id' => 'phone',
'type' => 'text',
'value' => $this->form_validation->set_value('phone'),
);
$this->data['password'] = array('name' => 'password',
'id' => 'password',
'type' => 'password',
Expand Down
12 changes: 1 addition & 11 deletions application/controllers/users_editor.php
Expand Up @@ -233,10 +233,6 @@ public function newUser(){
$this->form_validation->set_rules('first_name', lang('system_first_name'), 'required|xss_clean');
$this->form_validation->set_rules('last_name', lang('system_last_name'), 'required|xss_clean');
$this->form_validation->set_rules('email', lang('system_email'), 'required|valid_email');
$this->form_validation->set_rules('phone1', lang('system_phone_first'), 'xss_clean|min_length[3]|max_length[3]');
$this->form_validation->set_rules('phone2', lang('system_phone_second'), 'xss_clean|min_length[3]|max_length[3]');
$this->form_validation->set_rules('phone3', lang('system_phone_third'), 'xss_clean|min_length[4]|max_length[4]');
$this->form_validation->set_rules('company', lang('system_company'), 'xss_clean');
$this->form_validation->set_rules('password', lang('system_password'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');
$this->form_validation->set_rules('password_confirm', lang('system_password_conf'), 'required');

Expand All @@ -247,9 +243,7 @@ public function newUser(){
$password = $this->input->post('password');

$additional_data = array('first_name' => $this->input->post('first_name'),
'last_name' => $this->input->post('last_name'),
'company' => $this->input->post('company'),
'phone' => $this->input->post('phone1') . '-' . $this->input->post('phone2') . '-' . $this->input->post('phone3'),
'last_name' => $this->input->post('last_name')
);
}
if ($this->form_validation->run() == true
Expand All @@ -276,10 +270,6 @@ public function newUser(){
lang('system_email').'*' => $this->gui->textbox( 'email', $this->form_validation->set_value('email')),
lang('system_password').'*' => $this->gui->password( 'password', $this->form_validation->set_value('password')),
lang('system_password_conf').'*' => $this->gui->password( 'password_confirm', $this->form_validation->set_value('password_confirm')),
lang('system_company') => $this->gui->textbox( 'company', $this->form_validation->set_value('company')),
lang('system_phone') => $this->gui->textbox( 'phone1', $this->form_validation->set_value('phone1')).' - '.
$this->gui->textbox( 'phone2', $this->form_validation->set_value('phone2')).' - '.
$this->gui->textbox( 'phone3', $this->form_validation->set_value('phone3')),
'' => $this->gui->button('submit',lang('system_create_user'), array('type'=>'submit'))
)));
}
Expand Down
5 changes: 0 additions & 5 deletions application/language/arabic/system_lang.php
Expand Up @@ -15,11 +15,6 @@
$lang['system_first_name'] = 'الإسم الأول';
$lang['system_last_name'] = 'الإسم الأخير';
$lang['system_email'] = 'عنوان البريد الإلكترونى';
$lang['system_phone'] = 'التليفون';
$lang['system_phone_first'] = 'اول مقطع من التليفون';
$lang['system_phone_second'] = 'ثانى مقطع من التليفون';
$lang['system_phone_third'] = 'ثالث مقطع من التليفون';
$lang['system_company'] = 'إسم الشركة';
$lang['system_password'] = 'كلمة السر';
$lang['system_password_salt'] = 'مشفر كلمة السر';
$lang['system_password_conf'] = 'تأكيد كلمة السر';
Expand Down
5 changes: 0 additions & 5 deletions application/language/english/system_lang.php
Expand Up @@ -15,11 +15,6 @@
$lang['system_first_name'] = 'First Name';
$lang['system_last_name'] = 'Last Name';
$lang['system_email'] = 'Email address';
$lang['system_phone'] = 'Phone';
$lang['system_phone_first'] = 'First Part of Phone';
$lang['system_phone_second'] = 'Second Part of Phone';
$lang['system_phone_third'] = 'Third Part of Phone';
$lang['system_company'] = 'Company Name';
$lang['system_password'] = 'Password';
$lang['system_password_salt'] = 'Password salt';
$lang['system_password_conf'] = 'Password Confirmation';
Expand Down
8 changes: 0 additions & 8 deletions application/views/auth/create_user.php
Expand Up @@ -65,18 +65,10 @@
<?php echo form_input($last_name);?>
</p>

<p><?=lang('system_company')?><br />
<?php echo form_input($company);?>
</p>

<p><?=lang('system_email')?><br />
<?php echo form_input($email);?>
</p>

<p><?=lang('system_phone')?><br />
<?php echo form_input($phone);?>
</p>

<p><?=lang('system_password')?><br />
<?php echo form_input($password);?>
</p>
Expand Down
36 changes: 21 additions & 15 deletions mysql.sql
@@ -1,11 +1,11 @@
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

CREATE TABLE `contents` (
`id` int(9) NOT NULL AUTO_INCREMENT,
`parent_content` int(9) DEFAULT NULL,
`parent_section` int(9) DEFAULT NULL,
`id` int(9) unsigned NOT NULL AUTO_INCREMENT,
`parent_content` int(9) unsigned DEFAULT NULL,
`parent_section` int(9) unsigned DEFAULT NULL,
`title` varchar(100) DEFAULT NULL,
`user` int(9) DEFAULT NULL,
`user` int(9) unsigned DEFAULT NULL,
`subsection` tinyint(4) DEFAULT '1',
`cell` tinyint(4) DEFAULT NULL,
`sort` int(11) DEFAULT NULL,
Expand All @@ -24,7 +24,7 @@ INSERT INTO `contents` (`id`, `parent_content`, `parent_section`, `title`, `user
(2, 1, 1, NULL, 1, 0, 0, 0, 'default.php', NULL, NULL, NULL);

CREATE TABLE `groups` (
`id` int(9) NOT NULL AUTO_INCREMENT,
`id` int(9) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL,
`description` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
Expand All @@ -35,22 +35,20 @@ INSERT INTO `groups` (`id`, `name`, `description`) VALUES
(2, 'members', 'General User');

CREATE TABLE `meta` (
`id` int(9) NOT NULL AUTO_INCREMENT,
`user_id` int(9) DEFAULT NULL,
`id` int(9) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(9) unsigned DEFAULT NULL,
`first_name` varchar(50) DEFAULT NULL,
`last_name` varchar(50) DEFAULT NULL,
`company` varchar(100) DEFAULT NULL,
`phone` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `meta` (`id`, `user_id`, `first_name`, `last_name`, `company`, `phone`) VALUES
(1, 1, 'Admin', 'istrator', 'ADMIN', '0');
INSERT INTO `meta` (`id`, `user_id`, `first_name`, `last_name`) VALUES
(1, 1, 'Admin', 'istrator');

CREATE TABLE `sections` (
`id` int(9) NOT NULL AUTO_INCREMENT,
`parent_section` int(9) DEFAULT NULL,
`id` int(9) unsigned NOT NULL AUTO_INCREMENT,
`parent_section` int(9) unsigned DEFAULT NULL,
`name` varchar(100) DEFAULT NULL,
`sort` int(11) DEFAULT NULL,
`view` text,
Expand All @@ -62,8 +60,8 @@ INSERT INTO `sections` (`id`, `parent_section`, `name`, `sort`, `view`) VALUES
(1, NULL, NULL, 0, NULL);

CREATE TABLE `users` (
`id` int(9) NOT NULL AUTO_INCREMENT,
`group_id` int(9) NOT NULL,
`id` int(9) unsigned NOT NULL AUTO_INCREMENT,
`group_id` int(9) unsigned NOT NULL,
`ip_address` char(16) NOT NULL,
`username` varchar(15) NOT NULL,
`password` varchar(40) NOT NULL,
Expand All @@ -82,6 +80,14 @@ CREATE TABLE `users` (
INSERT INTO `users` (`id`, `group_id`, `ip_address`, `username`, `password`, `salt`, `email`, `activation_code`, `forgotten_password_code`, `remember_code`, `created_on`, `last_login`, `active`) VALUES
(1, 1, '127.0.0.1', 'administrator', '59beecdf7fc966e2f17fd8f65a4a9aeb09d4a3d4', '9462e8eee0', 'admin@admin.com', '', NULL, NULL, 1268889823, 1268889823, 1);

CREATE TABLE `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 DEFAULT '' NOT NULL,
PRIMARY KEY (session_id)
);

ALTER TABLE `contents`
ADD CONSTRAINT `contents_ibfk_1` FOREIGN KEY (`parent_content`) REFERENCES `contents` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
Expand Down

0 comments on commit ca22f6a

Please sign in to comment.