-
Notifications
You must be signed in to change notification settings - Fork 3
/
hooks.php
36 lines (33 loc) · 1.21 KB
/
hooks.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
if (!defined("WHMCS")){
die("Access to this file is not possible");
}
use Illuminate\Database\Capsule\Manager as Capsule;
add_hook("ShoppingCartValidateCheckout", 1, function($vars){
$Emailauthentication=Capsule::table('mod_Verifyemail')->where('id', '1')->value('Emailauthentication');
if ($Emailauthentication=="on"){
$client = Menu::context("client");
if (!is_null($client) && $client) {
if ($client->isEmailAddressVerified()==false)
{
return array("قبل از تکمیل سفارش، ابتدا باید آدرس ایمیل خود را تأیید کنید");
}
}
}
});
// Redirect the user if the email is not confirmed
add_hook("ClientAreaPage", 1, function($vars){
$Userauthentication=Capsule::table('mod_Verifyemail')->where('id', '1')->value('Userauthentication');
if ($Userauthentication=="on"){
$client = Menu::context("client");
if (!is_null($client) && $client) {
if ($client->isEmailAddressVerified()==false)
{
$namepage = $vars['pagetitle'];
if($namepage!="احراز هویت ایمیل"){
header("Location: ./index.php?m=Verifyemail");
}
}
}
}
});