susee
This commit is contained in:
parent
2178c2bca4
commit
394f3a2f5b
@ -113,6 +113,7 @@ $routes->match(['get','post'],'/check_if_mail_exists','Common_controller::check_
|
||||
$routes->match(['get','post'],'/mail/(:any)','Sendmail_controller::index/$1');
|
||||
$routes->match(['get','post'],'/verify_email/(:any)','Sendmail_controller::verify_email/$1');
|
||||
$routes->match(['get','post'],'/forgot_password','Sendmail_controller::forgot_password');
|
||||
$routes->match(['get','post'],'/verify_update_email/(:any)','Sendmail_controller::verify_update_email/$1');
|
||||
|
||||
|
||||
$routes->match(['get','post'],'/membership','Cart_controller::index');
|
||||
|
||||
@ -108,7 +108,7 @@ class Admin_controller extends BaseController
|
||||
{
|
||||
if($userdata['is_active'] == 0)
|
||||
{
|
||||
$this->session->setTempdata('error','Your account is deactivated',3);
|
||||
$this->session->setTempdata('error','User id or password is invalid',3);
|
||||
$this->session->setTempdata('A_email',$this->request->getVar('email'),3);
|
||||
$this->session->setTempdata('A_password',$this->request->getVar('password'),3);
|
||||
return redirect()->to(base_url()."admin");
|
||||
@ -128,7 +128,7 @@ class Admin_controller extends BaseController
|
||||
|
||||
else{
|
||||
|
||||
$this->session->setTempdata('error','sorry wrong password entered for the Email',3);
|
||||
$this->session->setTempdata('error','User id or password is invalid',3);
|
||||
$this->session->setTempdata('A_email',$this->request->getVar('email'),3);
|
||||
$this->session->setTempdata('A_password',$this->request->getVar('password'),3);
|
||||
return redirect()->to(base_url()."admin");
|
||||
@ -139,7 +139,7 @@ class Admin_controller extends BaseController
|
||||
|
||||
{
|
||||
|
||||
$this->session->setTempdata('error','sorry Email does not exist',3);
|
||||
$this->session->setTempdata('error','User id or password is invalid',3);
|
||||
$this->session->setTempdata('A_email',$this->request->getVar('email'),3);
|
||||
$this->session->setTempdata('A_password',$this->request->getVar('password'),3);
|
||||
return redirect()->to(base_url()."admin");
|
||||
@ -207,13 +207,27 @@ class Admin_controller extends BaseController
|
||||
if($this->request->getmethod() == 'post')
|
||||
|
||||
{
|
||||
$UserData = $this->request->getVar();
|
||||
|
||||
$user_id = $this->request->getVar('id');
|
||||
|
||||
$check_if_mailid_is_diff = $this->UserModel->where('id', $user_id )->find();
|
||||
if($check_if_mailid_is_diff[0]['email'] != $this->request->getVar('email'))
|
||||
{
|
||||
|
||||
$this->UserModel->where('id', $user_id )->set(array( 'new_mail' => $this->request->getVar('email') ))->update();
|
||||
|
||||
$sendmail_controller = new Sendmail_controller();
|
||||
|
||||
$get_data = $sendmail_controller->index($check_if_mailid_is_diff[0]['email'] , $this->request->getVar('email') , 6 );
|
||||
|
||||
return redirect()->to(base_url()."users_list");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//update member details
|
||||
|
||||
$UserData = $this->request->getVar();
|
||||
|
||||
$user_id = $this->request->getVar('id');
|
||||
|
||||
$this->UserModel->where('id', $user_id )->set($UserData)->update();
|
||||
|
||||
if ($this->request->getVar('profile_check') == 'profile_edit') {
|
||||
@ -223,6 +237,8 @@ class Admin_controller extends BaseController
|
||||
}
|
||||
|
||||
return redirect()->to(base_url()."users_list");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -116,7 +116,7 @@ class Member_controller extends BaseController
|
||||
|
||||
if ($memberdata['is_active'] == 0)
|
||||
{
|
||||
$this->session->setTempdata('error','Your account is deactivated',3);
|
||||
$this->session->setTempdata('error','User id or password is invalid',3);
|
||||
$this->session->setTempdata('l_email',$this->request->getVar('email'),3);
|
||||
$this->session->setTempdata('l_password',$this->request->getVar('password'),3);
|
||||
return redirect()->to(base_url());
|
||||
@ -190,7 +190,7 @@ class Member_controller extends BaseController
|
||||
|
||||
else{
|
||||
|
||||
$this->session->setTempdata('error','sorry wrong password entered for the Email',3);
|
||||
$this->session->setTempdata('error','User id or password is invalid',3);
|
||||
$this->session->setTempdata('l_email',$this->request->getVar('email'),3);
|
||||
$this->session->setTempdata('l_password',$this->request->getVar('password'),3);
|
||||
return redirect()->to(base_url());
|
||||
@ -201,7 +201,7 @@ class Member_controller extends BaseController
|
||||
|
||||
else{
|
||||
|
||||
$this->session->setTempdata('error','Sorry your mail is not verified.please check your mail',3);
|
||||
$this->session->setTempdata('error','User id or password is invalid',3);
|
||||
$this->session->setTempdata('l_email',$this->request->getVar('email'),3);
|
||||
$this->session->setTempdata('l_password',$this->request->getVar('password'),3);
|
||||
return redirect()->to(base_url());
|
||||
@ -214,7 +214,7 @@ class Member_controller extends BaseController
|
||||
|
||||
{
|
||||
|
||||
$this->session->setTempdata('error','sorry email is not exist',3);
|
||||
$this->session->setTempdata('error','User id or password is invalid',3);
|
||||
$this->session->setTempdata('l_email',$this->request->getVar('email'),3);
|
||||
$this->session->setTempdata('l_password',$this->request->getVar('password'),3);
|
||||
return redirect()->to(base_url());
|
||||
@ -631,7 +631,7 @@ class Member_controller extends BaseController
|
||||
|
||||
$this->session->setTempdata('email',$data[0]['email'],3);
|
||||
|
||||
$this->session->setTempdata('mail_success', "OTP verification sucessfully",3);
|
||||
$this->session->setTempdata('mail_success', "OTP verified sucessfully",3);
|
||||
|
||||
return view('set_password.php');
|
||||
|
||||
@ -671,7 +671,7 @@ class Member_controller extends BaseController
|
||||
|
||||
$this->session->setTempdata('email',$data[0]['email'],3);
|
||||
|
||||
$this->session->setTempdata('mail_success', "OTP verification sucessfully",3);
|
||||
$this->session->setTempdata('mail_success', "OTP verified sucessfully",3);
|
||||
|
||||
return view('changepassword.php');
|
||||
|
||||
@ -719,7 +719,7 @@ class Member_controller extends BaseController
|
||||
|
||||
else
|
||||
|
||||
$this->session->setTempdata('mail_success', "Email already verified . Please set password",3);
|
||||
$this->session->setTempdata('mail_success', "Email verified . Please set password",3);
|
||||
|
||||
return view('changepassword.php');
|
||||
|
||||
|
||||
@ -355,6 +355,40 @@ class Sendmail_controller extends BaseController
|
||||
|
||||
}
|
||||
|
||||
// mail id changed verification => type 6
|
||||
else if($return == 6)
|
||||
{
|
||||
$data['id'] = '6';
|
||||
|
||||
$user_data = $this->UserModel->where('email', $to)->find();
|
||||
|
||||
$data['to'] = $to;
|
||||
|
||||
$data['new_mail'] = $code;
|
||||
|
||||
$data['url'] = base_url()."verify_update_email/".md5($user_data[0]['id']);
|
||||
|
||||
$temp_data = $this->MailModel->where('type' , 6)->where('is_active' , 1)->find();
|
||||
|
||||
if ($temp_data[0]['to'])
|
||||
|
||||
$email->setCC($temp_data[0]['to']);
|
||||
|
||||
if ($temp_data)
|
||||
|
||||
$data['html'] = str_replace("%name%",$user_data[0]['name'],$temp_data[0]['html']);
|
||||
|
||||
$message = view('verification_mail_temp',$data);
|
||||
|
||||
if ($temp_data[0]['is_active'] == 1)
|
||||
|
||||
$email->setSubject($temp_data[0]['subject']);
|
||||
|
||||
else
|
||||
|
||||
$email->setSubject('Verify your email address');
|
||||
}
|
||||
|
||||
$email->setMessage($message);
|
||||
|
||||
if ($email->send())
|
||||
@ -363,7 +397,7 @@ class Sendmail_controller extends BaseController
|
||||
|
||||
if ($return == 1)
|
||||
|
||||
$this->session->setTempdata('mail_success', "Please check your mail to verify",3);
|
||||
$this->session->setTempdata('mail_success', "We have send an email for verification. please check your mail account",3);
|
||||
|
||||
|
||||
|
||||
@ -470,6 +504,81 @@ class Sendmail_controller extends BaseController
|
||||
|
||||
}
|
||||
|
||||
public function verify_update_email($verification_code)
|
||||
|
||||
{
|
||||
|
||||
// Get the user data corresponding to the verification code
|
||||
|
||||
$user_data = $this->UserModel->where('md5(id)', $verification_code)->find();
|
||||
|
||||
if($user_data)
|
||||
|
||||
{
|
||||
|
||||
//print_r($user_data);die();
|
||||
|
||||
if($user_data[0]['is_email_verified'] == 0)
|
||||
|
||||
{
|
||||
|
||||
// Update the users status
|
||||
|
||||
// $update_data = $this->MemberModel->update_status($user_data['id']);
|
||||
|
||||
|
||||
$data['is_email_verified'] = 1;
|
||||
|
||||
$data['email'] = 1;
|
||||
|
||||
$update_data = $this->UserModel->where('id', $user_data[0]['id'] )->set(array( 'email' => $user_data[0]['new_mail'] ))->update();
|
||||
|
||||
if($update_data)
|
||||
|
||||
{
|
||||
|
||||
return redirect()->to(base_url());
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
// Show error message
|
||||
|
||||
echo 'Error in verifying email. Please try again.';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
// Show error message
|
||||
|
||||
// echo 'Email already verified.';
|
||||
|
||||
return redirect()->to(base_url()."set_password/".md5($user_data[0]['id']));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
// Show error message
|
||||
|
||||
echo 'Invalid verification code.';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function forgot_password()
|
||||
|
||||
@ -7,7 +7,7 @@ class User_model extends Model
|
||||
protected $table = 'users';
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
protected $allowedFields = ['role','name', 'mobile', 'profile' , 'email', 'password', 'address' , 'city' , 'state' , 'country' , 'pincode' , 'is_active' ,'created_at','updated_at'];
|
||||
protected $allowedFields = ['role','name', 'mobile', 'profile' , 'email', 'password', 'address' , 'city' , 'state' , 'country' , 'pincode' , 'new_mail' , 'is_active' ,'created_at','updated_at'];
|
||||
|
||||
protected $beforeInsert = ['beforeInsert'];
|
||||
protected $beforeUpdate = ['beforeUpdate'];
|
||||
|
||||
@ -80,7 +80,7 @@
|
||||
</div>
|
||||
<div class="col-lg-7 text-center">
|
||||
<h1><?= $avaiable_credit; ?></h1>
|
||||
<?php if($avaiable_credit <= 1) { echo '<p>Credit Available</p>'; } else { echo '<p>Credits Available</p>'; } ?>
|
||||
<?php if($avaiable_credit <= 1) { echo '<p>Credit Balance</p>'; } else { echo '<p>Credits Balance</p>'; } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -220,7 +220,7 @@
|
||||
|
||||
<h1>Welcome Back!</h1>
|
||||
|
||||
<p>To keep connected with us please login with your personal info</p>
|
||||
<p>If you already have an account click signin</p>
|
||||
|
||||
<button class="login-btn" id="signIn">Sign In</button>
|
||||
|
||||
@ -228,9 +228,9 @@
|
||||
|
||||
<div class="overlay-panel overlay-right">
|
||||
|
||||
<h1>Hello, Friend!</h1>
|
||||
<h1>Hello, Golfer!</h1>
|
||||
|
||||
<p>Enter your personal details and start playing with us</p>
|
||||
<p>If you dont't have a golf evo account click signup to create an account</p>
|
||||
|
||||
<button class="login-btn" id="signUp">Sign Up</button>
|
||||
|
||||
|
||||
@ -128,6 +128,40 @@ bgcolor="#f6f6f6">
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php }
|
||||
// CHANGE MAIL ID TEMPLATE
|
||||
// ###################################################################
|
||||
else if ($id == 6) { ?>
|
||||
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
||||
<?php if ($html) { ?>
|
||||
<td><?php echo $html ?></td>
|
||||
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
||||
<td class="content-block" itemprop="handler" itemscope
|
||||
itemtype="http://schema.org/HttpActionHandler"
|
||||
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;"
|
||||
valign="top">
|
||||
<a href="<?php echo $url ?>" class="btn-primary" itemprop="url"
|
||||
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; color: #FFF; text-decoration: none; line-height: 2em; font-weight: bold; text-align: center; cursor: pointer; display: inline-block; border-radius: 5px; text-transform: capitalize; background-color: #f1556c; margin: 0; border-color: #f1556c; border-style: solid; border-width: 8px 16px;">
|
||||
Verify Email</a>
|
||||
</td>
|
||||
<?php
|
||||
} else { ?>
|
||||
<td class="content-block"
|
||||
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;"
|
||||
valign="top">
|
||||
Dear Customer, Your email id has been changed. If you have not requested for the change, please contact golf evolution.
|
||||
</td>
|
||||
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
||||
<td class="content-block" itemprop="handler" itemscope
|
||||
itemtype="http://schema.org/HttpActionHandler"
|
||||
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;"
|
||||
valign="top">
|
||||
<a href="<?php echo $url ?>" class="btn-primary" itemprop="url"
|
||||
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; color: #FFF; text-decoration: none; line-height: 2em; font-weight: bold; text-align: center; cursor: pointer; display: inline-block; border-radius: 5px; text-transform: capitalize; background-color: #f1556c; margin: 0; border-color: #f1556c; border-style: solid; border-width: 8px 16px;">
|
||||
Verify Email</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php }
|
||||
// MEMBER TEMPLATE
|
||||
// ###################################################################
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user