mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-14 02:33:56 -04:00
Fix database init script + employee creation (#822)
This commit is contained in:
@@ -104,7 +104,7 @@ class Employees extends Persons
|
||||
'state' => $this->input->post('state'),
|
||||
'zip' => $this->input->post('zip'),
|
||||
'country' => $this->input->post('country'),
|
||||
'comments' => $this->input->post('comments')
|
||||
'comments' => $this->input->post('comments'),
|
||||
);
|
||||
$grants_data = $this->input->post('grants') != NULL ? $this->input->post('grants') : array();
|
||||
|
||||
@@ -113,7 +113,8 @@ class Employees extends Persons
|
||||
{
|
||||
$employee_data = array(
|
||||
'username' => $this->input->post('username'),
|
||||
'password' => md5($this->input->post('password'))
|
||||
'password' => password_hash($this->input->post('password')),
|
||||
'hash_version' => 2
|
||||
);
|
||||
}
|
||||
else //Password not changed
|
||||
|
||||
@@ -115,7 +115,7 @@ CREATE TABLE `ospos_employees` (
|
||||
`password` varchar(255) NOT NULL,
|
||||
`person_id` int(10) NOT NULL,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
`hash_version` int(1) NOT NULL DEFAULT '2'
|
||||
`hash_version` int(1) NOT NULL DEFAULT '2',
|
||||
UNIQUE KEY `username` (`username`),
|
||||
KEY `person_id` (`person_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
@@ -124,8 +124,8 @@ CREATE TABLE `ospos_employees` (
|
||||
-- Dumping data for table `ospos_employees`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_employees` (`username`, `password`, `person_id`, `deleted`) VALUES
|
||||
('admin', '439a6de57d475c1a0ba9bcb1c39f0af6', 1, 0);
|
||||
INSERT INTO `ospos_employees` (`username`, `password`, `person_id`, `deleted`, `hash_version`) VALUES
|
||||
('admin', '439a6de57d475c1a0ba9bcb1c39f0af6', 1, 0, 1);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ CREATE TABLE `ospos_employees` (
|
||||
`password` varchar(255) NOT NULL,
|
||||
`person_id` int(10) NOT NULL,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
`hash_version` int(1) NOT NULL DEFAULT '2'
|
||||
`hash_version` int(1) NOT NULL DEFAULT '2',
|
||||
UNIQUE KEY `username` (`username`),
|
||||
KEY `person_id` (`person_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
@@ -124,8 +124,8 @@ CREATE TABLE `ospos_employees` (
|
||||
-- Dumping data for table `ospos_employees`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_employees` (`username`, `password`, `person_id`, `deleted`) VALUES
|
||||
('admin', '439a6de57d475c1a0ba9bcb1c39f0af6', 1, 0);
|
||||
INSERT INTO `ospos_employees` (`username`, `password`, `person_id`, `deleted`, `hash_version`) VALUES
|
||||
('admin', '439a6de57d475c1a0ba9bcb1c39f0af6', 1, 0, 1);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ CREATE TABLE `ospos_employees` (
|
||||
`password` varchar(255) NOT NULL,
|
||||
`person_id` int(10) NOT NULL,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
`hash_version` int(1) NOT NULL DEFAULT '2'
|
||||
`hash_version` int(1) NOT NULL DEFAULT '2',
|
||||
UNIQUE KEY `username` (`username`),
|
||||
KEY `person_id` (`person_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
@@ -124,8 +124,8 @@ CREATE TABLE `ospos_employees` (
|
||||
-- Dumping data for table `ospos_employees`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_employees` (`username`, `password`, `person_id`, `deleted`) VALUES
|
||||
('admin', '439a6de57d475c1a0ba9bcb1c39f0af6', 1, 0);
|
||||
INSERT INTO `ospos_employees` (`username`, `password`, `person_id`, `deleted`, `hash_version`) VALUES
|
||||
('admin', '439a6de57d475c1a0ba9bcb1c39f0af6', 1, 0, 1);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user