Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
TimeOutAdmin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TimeOut
TimeOutAdmin
Commits
a097efb2
Commit
a097efb2
authored
Apr 01, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dc
parent
080681cf
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
7 deletions
+48
-7
.htaccess
application/.htaccess
+0
-7
Api.php
application/controllers/Api.php
+12
-0
Api_model.php
application/models/Api_model.php
+22
-0
Validation_model.php
application/models/Validation_model.php
+14
-0
No files found.
application/.htaccess
deleted
100644 → 0
View file @
080681cf
<
IfModule
authz_core_module
>
Require
all denied
</
IfModule
>
<
IfModule
!authz_core_module
>
Deny
from
all
</
IfModule
>
\ No newline at end of file
application/controllers/Api.php
View file @
a097efb2
...
@@ -520,5 +520,16 @@ class Api extends CI_Controller {
...
@@ -520,5 +520,16 @@ class Api extends CI_Controller {
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
}
}
public
function
reset_password
(){
$data
=
(
array
)
json_decode
(
file_get_contents
(
'php://input'
));
$res
=
$this
->
Api_model
->
reset_password
(
$data
);
if
(
$res
[
'status'
]
!=
0
){
$this
->
response
(
$res
[
'data'
]);
}
else
{
$this
->
errorResponse
(
$res
[
'code'
],
$res
[
'message'
]);
}
}
}
}
?>
?>
\ No newline at end of file
application/models/Api_model.php
View file @
a097efb2
...
@@ -1013,5 +1013,26 @@ class Api_model extends CI_Model {
...
@@ -1013,5 +1013,26 @@ class Api_model extends CI_Model {
}
}
return
$res
;
return
$res
;
}
}
public
function
reset_password
(
$data
){
try
{
$cust
=
$this
->
db
->
get_where
(
'customer'
,
array
(
'reset_key'
=>
$data
[
'reset_key'
]))
->
row_array
();
if
(
!
empty
(
$cust
)){
if
(
$this
->
db
->
update
(
'users'
,
array
(
'password'
=>
md5
(
$data
[
'password'
])),
array
(
'id'
=>
$cust
[
'customer_id'
]))){
$this
->
db
->
update
(
'customer'
,
array
(
'reset_key'
=>
''
),
array
(
'customer_id'
=>
$cust
[
'customer_id'
]));
$res
=
array
(
'status'
=>
1
,
'data'
=>
'Success'
);
}
else
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Ohh No!! Something went South!!'
,
'code'
=>
'ER24'
);
}
}
else
{
$res
=
array
(
'status'
=>
0
,
'message'
=>
'User Doesn\'t Exist'
,
'code'
=>
'ER25'
);
}
}
catch
(
Exception
$e
){
$res
=
array
(
'status'
=>
0
,
'message'
=>
'Ohh No!! Something went South!!'
,
'code'
=>
'ER06'
);
}
return
$res
;
}
}
}
?>
?>
\ No newline at end of file
application/models/Validation_model.php
View file @
a097efb2
...
@@ -310,6 +310,20 @@ class Validation_model extends CI_Model {
...
@@ -310,6 +310,20 @@ class Validation_model extends CI_Model {
)
,
)
,
)
)
)
,
)
,
'reset_password'
=>
array
(
'reset_key'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER16'
,
'message'
=>
'Reset Key is null or empty'
)
)
,
'password'
=>
array
(
'required'
=>
array
(
'code'
=>
'ER18'
,
'message'
=>
'Password is null or empty'
)
,
)
)
,
'checker_login'
=>
array
(
'checker_login'
=>
array
(
'email'
=>
array
(
'email'
=>
array
(
'required'
=>
array
(
'required'
=>
array
(
...
...
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