Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
joyride phase2
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
Jansa Jose
joyride phase2
Commits
83c89958
Commit
83c89958
authored
6 years ago
by
Jansa Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
forgot password
parent
7ffd5c2b
master
…
dev_production
1 merge request
!47
forgot password
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
33 deletions
+51
-33
Webservice_model.php
application/models/Webservice_model.php
+51
-33
No files found.
application/models/Webservice_model.php
View file @
83c89958
...
...
@@ -158,38 +158,20 @@ class Webservice_model extends CI_Model{
$rand_id
=
rand
(
1111
,
9999
);
$rand_value
=
md5
(
time
()
.
$rand_id
);
$this
->
db
->
where
(
'id'
,
$user_id
)
->
update
(
"users"
,
array
(
'req_id'
=>
$rand_value
));
$this
->
db
->
where
(
'email'
,
$email
);
$query
=
$this
->
db
->
get
(
'users'
);
$rs
=
$query
->
row
();
if
(
$rs
)
{
$username
=
$rs
->
first_name
;
$this
->
load
->
helper
(
'string'
);
$link
=
base_url
()
.
"Verify_email/verify/"
.
$rand_value
;
// $password = array( 'password' => md5($rand_pwd) );
//$query = $this->db->where('email', $email);
// $query = $this->db->update('users', $password);
if
(
$query
)
{
//$settings = get_settings();
$settings
=
$this
->
db
->
get_where
(
'settings'
,
array
(
'id'
=>
'1'
))
->
row
();
$this
->
load
->
library
(
'email'
);
$config
=
Array
(
'protocol'
=>
'smtp'
,
...
...
@@ -206,28 +188,18 @@ class Webservice_model extends CI_Model{
$this
->
email
->
initialize
(
$config
);
// add this line
$subject
=
'New Mail'
;
//$name= $data->name;
//$mailTemplate=$data->message;
//$this->email->set_newline("\r\n");
$this
->
email
->
from
(
$settings
->
admin_email
);
$this
->
email
->
to
(
$email
);
$this
->
email
->
subject
(
"Verify Your Email Adress - Tukkibi"
);
$this
->
email
->
message
(
"Click the Link to verify your Email Adress:"
.
$link
);
$this
->
email
->
send
();
// echo $this->email->print_debugger();
return
"EmailSend"
;
}
}
else
{
// return "EmailNotExist";
}
else
{
return
false
;
}
}
}
}
...
...
@@ -457,7 +429,7 @@ class Webservice_model extends CI_Model{
function
forgot_mails
(
$data
,
$rand_pwd
){
/*
function forgot_mails($data,$rand_pwd){
// $data);
$mail = new PHPMailer(true);
...
...
@@ -485,9 +457,55 @@ class Webservice_model extends CI_Model{
$res = $mail->send();
//if($res)
//echo true;
}
}
*/
public
function
forgot_mails
(
$data
,
$rand_pwd
){
/*$rand_id = rand(1111,9999);
$rand_value = md5(time().$rand_id);
$this->db->where('id',$user_id)->update("users",array('req_id'=>$rand_value));
$this->db->where('email',$email);
$query = $this->db->get('users');
$rs = $query->row();
if ($rs) {
*/
// $username = $rs->first_name;
// $this->load->helper('string');
//$link = base_url()."Verify_email/verify/".$rand_value;
// if ($query) {
$settings
=
$this
->
db
->
get_where
(
'settings'
,
array
(
'id'
=>
'1'
))
->
row
();
$this
->
load
->
library
(
'email'
);
$config
=
Array
(
'protocol'
=>
'smtp'
,
'smtp_host'
=>
$settings
->
smtp_host
,
'smtp_port'
=>
25
,
'smtp_user'
=>
$settings
->
smtp_username
,
// change it to yours
'smtp_pass'
=>
$settings
->
smtp_password
,
// change it to yours
'smtp_timeout'
=>
20
,
'mailtype'
=>
'html'
,
'charset'
=>
'utf-8'
,
'wordwrap'
=>
TRUE
);
$this
->
email
->
initialize
(
$config
);
// add this line
$subject
=
'New Mail'
;
$this
->
email
->
from
(
$settings
->
admin_email
);
$this
->
email
->
to
(
$data
->
email
);
$this
->
email
->
subject
(
"Forgot Password - Tukkibi"
);
$this
->
email
->
message
(
"Hi "
.
$data
->
name
.
", Your New Password is :"
.
$rand_pwd
);
$this
->
email
->
send
();
// echo $this->email->print_debugger();
return
"EmailSend"
;
// }
/* }else {
return false;
} */
}
...
...
This diff is collapsed.
Click to expand it.
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