Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
IPok_Web
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
IPok
IPok_Web
Commits
2f24f627
Commit
2f24f627
authored
Jul 25, 2018
by
Jansa Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
encrypt admn user
parent
bc3f2618
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
15 deletions
+23
-15
Webservice.php
admin/application/controllers/Webservice.php
+1
-1
User_model.php
admin/application/models/User_model.php
+18
-10
editUser.php
admin/application/views/ManageUser/editUser.php
+4
-4
No files found.
admin/application/controllers/Webservice.php
View file @
2f24f627
...
@@ -5659,7 +5659,7 @@ print_r(date('H:i',$ms));exit();*/
...
@@ -5659,7 +5659,7 @@ print_r(date('H:i',$ms));exit();*/
}
}
public
function
encrypt_data
(){
public
function
encrypt_data
(){
$data
=
'
20
'
;
$data
=
'
Sabana Asmi P.P
'
;
$new
=
encrypt_data
(
$data
);
$new
=
encrypt_data
(
$data
);
$neww
=
decrypt_data
(
$new
);
$neww
=
decrypt_data
(
$new
);
print_r
(
$new
);
echo
"<br>"
;
print_r
(
$new
);
echo
"<br>"
;
...
...
admin/application/models/User_model.php
View file @
2f24f627
...
@@ -12,7 +12,7 @@ class User_model extends CI_Model {
...
@@ -12,7 +12,7 @@ class User_model extends CI_Model {
}
}
function
addusers
(
$userdata
)
{
function
addusers
(
$userdata
)
{
$this
->
db
->
select
(
"count(*) as count"
);
$this
->
db
->
select
(
"count(*) as count"
);
$this
->
db
->
where
(
'username'
,
$userdata
[
'username'
]
);
$this
->
db
->
where
(
'username'
,
encrypt_data
(
$userdata
[
'username'
])
);
$this
->
db
->
from
(
'users'
);
$this
->
db
->
from
(
'users'
);
$count
=
$this
->
db
->
get
()
->
row
();
$count
=
$this
->
db
->
get
()
->
row
();
if
(
$count
->
count
<=
0
){
if
(
$count
->
count
<=
0
){
...
@@ -21,6 +21,10 @@ class User_model extends CI_Model {
...
@@ -21,6 +21,10 @@ class User_model extends CI_Model {
date_default_timezone_set
(
"Asia/Kolkata"
);
date_default_timezone_set
(
"Asia/Kolkata"
);
//$userdata['created_date']=date("Y-m-d h:i:sa");
//$userdata['created_date']=date("Y-m-d h:i:sa");
//$userdata['modified_date']=date("Y-m-d h:i:sa");
//$userdata['modified_date']=date("Y-m-d h:i:sa");
$userdata
[
'username'
]
=
encrypt_data
(
$userdata
[
'username'
]);
$userdata
[
'email_id'
]
=
encrypt_data
(
$userdata
[
'email_id'
]);
$userdata
[
'phone_no'
]
=
encrypt_data
(
$userdata
[
'phone_no'
]);
$userdata
[
'display_name'
]
=
encrypt_data
(
$userdata
[
'display_name'
]);
$this
->
db
->
insert
(
"users"
,
$userdata
);
$this
->
db
->
insert
(
"users"
,
$userdata
);
return
true
;
return
true
;
}
}
...
@@ -28,17 +32,21 @@ class User_model extends CI_Model {
...
@@ -28,17 +32,21 @@ class User_model extends CI_Model {
function
update_users
(
$data
,
$id
){
function
update_users
(
$data
,
$id
){
$this
->
db
->
select
(
"count(*) as count,users.id as uid"
);
$this
->
db
->
select
(
"count(*) as count,users.id as uid"
);
$this
->
db
->
where
(
'username'
,
$data
[
'username'
]
);
$this
->
db
->
where
(
'username'
,
encrypt_data
(
$data
[
'username'
])
);
$this
->
db
->
from
(
'users'
);
$this
->
db
->
from
(
'users'
);
$count
=
$this
->
db
->
get
()
->
row
();
$count
=
$this
->
db
->
get
()
->
row
();
if
(
$count
->
count
<=
0
||
$count
->
uid
==
$id
){
if
(
$count
->
count
<=
0
||
$count
->
uid
==
$id
){
$this
->
db
->
where
(
'id'
,
$id
);
$data
[
'username'
]
=
encrypt_data
(
$data
[
'username'
]);
$result
=
$this
->
db
->
update
(
'users'
,
$data
);
$data
[
'email_id'
]
=
encrypt_data
(
$data
[
'email_id'
]);
redirect
(
base_url
()
.
'ManageUsers'
);
$data
[
'phone_no'
]
=
encrypt_data
(
$data
[
'phone_no'
]);
}
$data
[
'display_name'
]
=
encrypt_data
(
$data
[
'display_name'
]);
else
{
$this
->
db
->
where
(
'id'
,
$id
);
return
false
;
$result
=
$this
->
db
->
update
(
'users'
,
$data
);
}
redirect
(
base_url
()
.
'ManageUsers'
);
}
else
{
return
false
;
}
}
}
function
delete_users
(
$id
){
function
delete_users
(
$id
){
$this
->
db
->
where
(
'id'
,
$id
);
$this
->
db
->
where
(
'id'
,
$id
);
...
...
admin/application/views/ManageUser/editUser.php
View file @
2f24f627
...
@@ -42,22 +42,22 @@ if(isset($data)) {
...
@@ -42,22 +42,22 @@ if(isset($data)) {
<div
class=
"form-group col-md-12"
>
<div
class=
"form-group col-md-12"
>
<label>
Full Name
</label>
<label>
Full Name
</label>
<input
type=
"text"
name=
"display_name"
value=
"
<?php
echo
$data
[
0
]
->
display_name
;
?>
"
class=
"form-control required"
placeholder=
"Enter Name"
>
<input
type=
"text"
name=
"display_name"
value=
"
<?php
echo
decrypt_data
(
$data
[
0
]
->
display_name
)
;
?>
"
class=
"form-control required"
placeholder=
"Enter Name"
>
</div>
</div>
<div
class=
"form-group col-md-12"
>
<div
class=
"form-group col-md-12"
>
<label>
Username
</label>
<label>
Username
</label>
<input
type=
"text"
name=
"username"
value=
"
<?php
echo
$data
[
0
]
->
username
;
?>
"
class=
"form-control required"
placeholder=
"Enter Username"
>
<input
type=
"text"
name=
"username"
value=
"
<?php
echo
decrypt_data
(
$data
[
0
]
->
username
)
;
?>
"
class=
"form-control required"
placeholder=
"Enter Username"
>
</div>
</div>
<div
class=
"form-group col-md-6"
>
<div
class=
"form-group col-md-6"
>
<label>
Email ID
</label>
<label>
Email ID
</label>
<input
type=
"email"
name=
"email_id"
value=
"
<?php
echo
$data
[
0
]
->
email_id
;
?>
"
class=
"form-control required"
placeholder=
"Enter Email ID"
>
<input
type=
"email"
name=
"email_id"
value=
"
<?php
echo
decrypt_data
(
$data
[
0
]
->
email_id
)
;
?>
"
class=
"form-control required"
placeholder=
"Enter Email ID"
>
</div>
</div>
<div
class=
"form-group col-md-6"
>
<div
class=
"form-group col-md-6"
>
<label>
Phone
</label>
<label>
Phone
</label>
<input
type=
"text"
name=
"phone_no"
value=
"
<?php
echo
$data
[
0
]
->
phone_no
;
?>
"
class=
"form-control required"
placeholder=
"Enter Phone No"
pattern=
"[0-9]{10}"
>
<input
type=
"text"
name=
"phone_no"
value=
"
<?php
echo
decrypt_data
(
$data
[
0
]
->
phone_no
)
;
?>
"
class=
"form-control required"
placeholder=
"Enter Phone No"
pattern=
"[0-9]{10}"
>
</div>
</div>
<div
class=
"form-group col-md-6"
>
<div
class=
"form-group col-md-6"
>
...
...
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