This repository has been archived by the owner on May 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathirnic-handle.php
executable file
·79 lines (56 loc) · 2.02 KB
/
irnic-handle.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
/**
*
* PHP version 5.6.x | 7.x | 8.x
*
* @category Modules
* @package WHMCS
* @author Pejman Kheyri <[email protected]>
* @copyright 2021 All rights reserved.
*/
use WHMCS\ClientArea;
use WHMCS\Database\Capsule;
define('CLIENTAREA', true);
//define('FORCESSL', true); // Uncomment to force the page to use https://
require __DIR__ . '/init.php';
$ca = new ClientArea();
$ca->setPageTitle($whmcs->get_lang('irnicnewcontacthandle'));
$ca->addToBreadCrumb('index.php', Lang::trans('globalsystemname'));
$ca->addToBreadCrumb('irnic-handle.php', $whmcs->get_lang('irnicnewcontacthandle'));
$ca->initPage();
//$ca->requireLogin(); // Uncomment this line to require a login to access this page
// To assign variables to the template system use the following syntax.
// These can then be referenced using {$variablename} in the template.
//$ca->assign('variablename', $value);
// Check login status
if ($ca->isLoggedIn()) {
/**
* User is logged in - put any code you like here
*
* Here's an example to get the currently logged in clients first name
*/
$clientName = Capsule::table('tblclients')
->where('id', '=', $ca->getUserID())->pluck('firstname');
// 'pluck' was renamed within WHMCS 7.0. Replace it with 'value' instead.
// ->where('id', '=', $ca->getUserID())->value('firstname');
$ca->assign('clientname', $clientName);
} else {
// User is not logged in
$ca->assign('clientname', 'Random User');
}
/**
* Set a context for sidebars
*
* @link http://docs.whmcs.com/Editing_Client_Area_Menus#Context
*/
Menu::addContext('irnic', 'domainView');
/**
* Setup the primary and secondary sidebars
*
* @link http://docs.whmcs.com/Editing_Client_Area_Menus#Context
*/
Menu::primarySidebar('orderFormView');
Menu::secondarySidebar('domainView');
# Define the template filename to be used without the .tpl extension
$ca->setTemplate('irnic-handle');
$ca->output();