Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
tetiana yaremko
/
web-app-group2
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3c24068b
authored
Apr 23, 2020
by
tetiana yaremko
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
ready to deploy
parent
773af4bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
application/controllers/Auth.php
application/models/Register_model.php
application/controllers/Auth.php
View file @
3c24068b
...
...
@@ -131,7 +131,7 @@ class Auth extends CI_Controller
$email
=
$this
->
input
->
post
(
'email'
);
$user
=
$this
->
db
->
get_where
(
'users'
,
array
(
'email'
=>
$email
,
'is_active'
=>
1
))
->
row_array
();
if
(
$user
)
{
$token
=
b
ase64_encode
(
random_bytes
(
32
));
$token
=
b
in2hex
(
openssl_random_pseudo_bytes
(
32
,
$cstrong
));
$user_token
=
array
(
'email'
=>
$email
,
'token'
=>
$token
,
...
...
@@ -154,7 +154,7 @@ class Auth extends CI_Controller
public
function
resetPassword
()
{
require_once
(
APPPATH
.
'libraries/random.php'
);
//
require_once(APPPATH.'libraries/random.php');
$email
=
$this
->
input
->
get
(
'email'
);
$token
=
$this
->
input
->
get
(
'token'
);
$user
=
$this
->
db
->
get_where
(
'users'
,
array
(
'email'
=>
$email
))
->
row_array
();
...
...
application/models/Register_model.php
View file @
3c24068b
...
...
@@ -20,7 +20,7 @@ class Register_model extends CI_Model {
'role_id'
=>
2
);
$this
->
db
->
insert
(
'users'
,
$data
);
$token
=
b
ase64_encode
(
random_bytes
(
32
));
$token
=
b
in2hex
(
openssl_random_pseudo_bytes
(
32
,
$cstrong
));
$user_token
=
array
(
'email'
=>
$this
->
input
->
post
(
'email'
),
'token'
=>
$token
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment