Commit 68b5467e by Tobin

dc

parent 3e098fcb
...@@ -149,13 +149,16 @@ class Api_model extends CI_Model { ...@@ -149,13 +149,16 @@ class Api_model extends CI_Model {
function forgot($data) { function forgot($data) {
try{ try{
$settings = getSettings();
$redUrl = $settings['web_base_url'];
$res_count = $this->db->where('email',$data['email_id'])->get('customer')->num_rows(); $res_count = $this->db->where('email',$data['email_id'])->get('customer')->num_rows();
if($res_count > 0) { if($res_count > 0) {
$unique_id = uniqid().time(); $unique_id = uniqid().time();
$this->db->where('email',$data['email_id'])->update('customer',array('reset_key'=>$unique_id)); $this->db->where('email',$data['email_id'])->update('customer',array('reset_key'=>$unique_id));
$subject = "TimeOut: Forgot Password"; $subject = "TimeOut: Forgot Password";
$url = 'https://timeout.sa/staging/forgot/?reset_key='.$unique_id; $url = $redUrl.'forgot/?reset_key='.$unique_id;
$msgContent = "Hi, Welcome to TimeOut. Please use this link $msgContent = "Hi, Welcome to TimeOut. Please use this link
for reset your password: ".$url; for reset your password: ".$url;
$message = "<html><body><p>".$msgContent."</p></body></html>"; $message = "<html><body><p>".$msgContent."</p></body></html>";
...@@ -1481,6 +1484,8 @@ class Api_model extends CI_Model { ...@@ -1481,6 +1484,8 @@ class Api_model extends CI_Model {
} }
public function verifyMail($data = ''){ public function verifyMail($data = ''){
$settings = getSettings();
$redUrl = $settings['web_base_url'];
try{ try{
$cust = $this->db->query("SELECT CUST.customer_id,CUST.email,CUST.phone $cust = $this->db->query("SELECT CUST.customer_id,CUST.email,CUST.phone
FROM customer AS CUST FROM customer AS CUST
...@@ -1505,11 +1510,11 @@ class Api_model extends CI_Model { ...@@ -1505,11 +1510,11 @@ class Api_model extends CI_Model {
if($this->db->update('customer',array('confirm_link'=>'','email_verified'=>'1'), if($this->db->update('customer',array('confirm_link'=>'','email_verified'=>'1'),
array('customer_id'=>$cust['customer_id']))){ array('customer_id'=>$cust['customer_id']))){
header('Location:https://timeout.sa/staging/location?login=1'); header('Location:'.$redUrl.'location?login=1');
} }
} }
}catch(Exception $e){} }catch(Exception $e){}
header('Location:https://timeout.sa/staging/location'); header('Location:'.$redUrl.'location');
} }
public function checkSeatAvailability($data = ''){ public function checkSeatAvailability($data = ''){
......
...@@ -62,6 +62,11 @@ ...@@ -62,6 +62,11 @@
<label>Admin Email-ID</label> <label>Admin Email-ID</label>
<input type="email" name="admin_mail_id" class="form-control required" placeholder="Admin Email-ID" value="<?= $data['admin_mail_id'] ?>"> <input type="email" name="admin_mail_id" class="form-control required" placeholder="Admin Email-ID" value="<?= $data['admin_mail_id'] ?>">
</div> </div>
<div class="form-group col-xs-6">
<label>Web Base URL</label>
<input type="text" name="web_base_url" class="form-control required"
placeholder="Web Base URL" value="<?= $data['web_base_url'] ?>">
</div>
</div> </div>
<div class="form-group col-xs-5"> <div class="form-group col-xs-5">
<div class="form-group"> <div class="form-group">
...@@ -158,4 +163,4 @@ ...@@ -158,4 +163,4 @@
</div> </div>
</div> </div>
</section> </section>
</div> </div>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment