-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
2,229 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
/* WHMCS ViaSocket Addon with GNU/GPL Licence | ||
* ViaSocket - http://www.MSG91.com | ||
* | ||
* https://github.com/ViaSocket/ViaSocket-WHMCS-Plugin | ||
* | ||
* | ||
* Licence: GPLv3 (http://www.gnu.org/licenses/gpl-3.0.txt) | ||
* */ | ||
if (!defined("WHMCS")) | ||
die("This file cannot be accessed directly"); | ||
|
||
require_once("utils.php"); | ||
$class = new Viasocket(); | ||
$hooks = $class->getHooks(); | ||
|
||
|
||
|
||
foreach($hooks as $hook){ | ||
add_hook($hook['hook'], 1, $hook['function'], ""); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
$hook = array( | ||
'hook' => 'AdminLogin', | ||
'function' => 'AdminLogin_admin', | ||
'type' => 'admin', | ||
'extra' => '', | ||
); | ||
if(!function_exists('AdminLogin_admin')){ | ||
function AdminLogin_admin($args){ | ||
$class = new Viasocket(); | ||
$event = $class->getEventStatus(__FUNCTION__); | ||
if($event['active'] == 0){ | ||
return null; | ||
} | ||
$args['event'] = __FUNCTION__; | ||
|
||
$settings = $class->getSettings(); | ||
if(!$settings['api']){ | ||
return null; | ||
} | ||
$class->callSocket($settings['api'],$args); | ||
} | ||
} | ||
|
||
return $hook; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
$hook = array( | ||
'hook' => 'AfterModuleChangePackage', | ||
'function' => 'AfterModuleChangePackage', | ||
'description' => array( | ||
'english' => 'After module Change Package' | ||
), | ||
'type' => 'client', | ||
'extra' => '', | ||
); | ||
if(!function_exists('AfterModuleChangePackage')){ | ||
function AfterModuleChangePackage($args){ | ||
$class = new Viasocket(); | ||
$settings = $class->getSettings(); | ||
if(!$settings['api']){ | ||
return null; | ||
} | ||
$event = $class->getEventStatus(__FUNCTION__); | ||
if($event['active'] == 0){ | ||
return null; | ||
} | ||
$args['event'] = __FUNCTION__; | ||
|
||
$class->callSocket($settings['api'],$args); | ||
} | ||
} | ||
return $hook; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
$hook = array( | ||
'hook' => 'AfterModuleChangePassword', | ||
'function' => 'AfterModuleChangePassword', | ||
'description' => array( | ||
'english' => 'After module change password' | ||
), | ||
'type' => 'client', | ||
'extra' => '', | ||
|
||
); | ||
if(!function_exists('AfterModuleChangePassword')){ | ||
function AfterModuleChangePassword($args){ | ||
$class = new Viasocket(); | ||
$settings = $class->getSettings(); | ||
if(!$settings['api']){ | ||
return null; | ||
} | ||
$event = $class->getEventStatus(__FUNCTION__); | ||
if($event['active'] == 0){ | ||
return null; | ||
} | ||
$args['event'] = __FUNCTION__; | ||
|
||
$class->callSocket($settings['api'],$args); | ||
} | ||
} | ||
return $hook; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
$hook = array( | ||
'hook' => 'ClientLogin', | ||
'function' => 'ClientLogin_admin', | ||
'type' => 'admin', | ||
'extra' => '', | ||
|
||
); | ||
|
||
if(!function_exists('ClientLogin_admin')){ | ||
function ClientLogin_admin($args){ | ||
$class = new Viasocket(); | ||
$settings = $class->getSettings(); | ||
if(!$settings['api']){ | ||
return null; | ||
} | ||
$event = $class->getEventStatus(__FUNCTION__); | ||
if($event['active'] == 0){ | ||
return null; | ||
} | ||
$args['event'] = __FUNCTION__; | ||
|
||
$class->callSocket($settings['api'],$args); | ||
} | ||
} | ||
|
||
return $hook; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
$hook = array( | ||
'hook' => 'AcceptOrder', | ||
'function' => 'AcceptOrder_SMS', | ||
'description' => array( | ||
'english' => 'After order accepted' | ||
), | ||
'type' => 'client', | ||
'extra' => '', | ||
); | ||
if(!function_exists('AcceptOrder_SMS')){ | ||
function AcceptOrder_SMS($args){ | ||
$class = new Viasocket(); | ||
$event = $class->getEventStatus(__FUNCTION__); | ||
if($event['active'] == 0){ | ||
return null; | ||
} | ||
$args['event'] = __FUNCTION__; | ||
|
||
$settings = $class->getSettings(); | ||
if(!$settings['api']){ | ||
return null; | ||
} | ||
|
||
$class->callSocket($settings['api'],$args); | ||
} | ||
} | ||
|
||
return $hook; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
$hook = array( | ||
'hook' => 'AfterModuleCreate', | ||
'function' => 'AfterModuleCreate_Hosting', | ||
'description' => array( | ||
'english' => 'After hosting create' | ||
), | ||
'type' => 'client', | ||
'extra' => '', | ||
|
||
); | ||
if(!function_exists('AfterModuleCreate_Hosting')){ | ||
function AfterModuleCreate_Hosting($args){ | ||
$class = new Viasocket(); | ||
$settings = $class->getSettings(); | ||
if(!$settings['api']){ | ||
return null; | ||
} | ||
$event = $class->getEventStatus(__FUNCTION__); | ||
if($event['active'] == 0){ | ||
return null; | ||
} | ||
$args['event'] = __FUNCTION__; | ||
|
||
$class->callSocket($settings['api'],$args); | ||
} | ||
} | ||
return $hook; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
$hook = array( | ||
'hook' => 'AfterModuleSuspend', | ||
'function' => 'AfterModuleSuspend', | ||
'description' => array( | ||
'english' => 'After module suspended' | ||
), | ||
'type' => 'client', | ||
'extra' => '', | ||
|
||
); | ||
if(!function_exists('AfterModuleSuspend')){ | ||
function AfterModuleSuspend($args){ | ||
$class = new Viasocket(); | ||
$settings = $class->getSettings(); | ||
if(!$settings['api']){ | ||
return null; | ||
} | ||
$event = $class->getEventStatus(__FUNCTION__); | ||
if($event['active'] == 0){ | ||
return null; | ||
} | ||
$args['event'] = __FUNCTION__; | ||
|
||
$class->callSocket($settings['api'],$args); | ||
} | ||
} | ||
|
||
return $hook; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
$hook = array( | ||
'hook' => 'AfterModuleUnsuspend', | ||
'function' => 'AfterModuleUnsuspend', | ||
'description' => array( | ||
'english' => 'After module unsuspend' | ||
), | ||
'type' => 'client', | ||
'extra' => '', | ||
|
||
); | ||
if(!function_exists('AfterModuleUnsuspend')){ | ||
function AfterModuleUnsuspend($args){ | ||
$class = new Viasocket(); | ||
$settings = $class->getSettings(); | ||
if(!$settings['api']){ | ||
return null; | ||
} | ||
$event = $class->getEventStatus(__FUNCTION__); | ||
if($event['active'] == 0){ | ||
return null; | ||
} | ||
$args['event'] = __FUNCTION__; | ||
|
||
$class->callSocket($settings['api'],$args); | ||
} | ||
} | ||
return $hook; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
$hook = array( | ||
'hook' => 'AfterRegistrarRegistration', | ||
'function' => 'AfterRegistrarRegistration', | ||
'description' => array( | ||
'english' => 'After domain registration' | ||
), | ||
'type' => 'client', | ||
'extra' => '', | ||
|
||
); | ||
if (!function_exists('AfterRegistrarRegistration')) { | ||
function AfterRegistrarRegistration($args) | ||
{ | ||
$class = new Viasocket(); | ||
$settings = $class->getSettings(); | ||
if (!$settings['api']) { | ||
return null; | ||
} | ||
$event = $class->getEventStatus(__FUNCTION__); | ||
if($event['active'] == 0){ | ||
return null; | ||
} | ||
$args['event'] = __FUNCTION__; | ||
|
||
$class->callSocket($settings['api'], $args); | ||
|
||
} | ||
} | ||
|
||
return $hook; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
$hook = array( | ||
'hook' => 'AfterRegistrarRegistration', | ||
'function' => 'AfterRegistrarRegistration_admin', | ||
'type' => 'admin', | ||
'extra' => '', | ||
|
||
); | ||
if(!function_exists('AfterRegistrarRegistration_admin')){ | ||
function AfterRegistrarRegistration_admin($args){ | ||
$class = new Viasocket(); | ||
$settings = $class->getSettings(); | ||
if(!$settings['api']){ | ||
return null; | ||
} | ||
$event = $class->getEventStatus(__FUNCTION__); | ||
if($event['active'] == 0){ | ||
return null; | ||
} | ||
$args['event'] = __FUNCTION__; | ||
|
||
$class->callSocket($settings['api'],$args); | ||
} | ||
} | ||
|
||
return $hook; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
$hook = array( | ||
'hook' => 'AfterRegistrarRegistrationFailed', | ||
'function' => 'AfterRegistrarRegistrationFailed', | ||
'description' => array( | ||
'english' => 'After domain registration failed' | ||
), | ||
'type' => 'client', | ||
'extra' => '', | ||
|
||
); | ||
if(!function_exists('AfterRegistrarRegistrationFailed')){ | ||
function AfterRegistrarRegistrationFailed($args){ | ||
$class = new Viasocket(); | ||
$settings = $class->getSettings(); | ||
if(!$settings['api']){ | ||
return null; | ||
} | ||
$event = $class->getEventStatus(__FUNCTION__); | ||
if($event['active'] == 0){ | ||
return null; | ||
} | ||
$args['event'] = __FUNCTION__; | ||
|
||
$class->callSocket($settings['api'],$args); | ||
} | ||
} | ||
|
||
return $hook; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
$hook = array( | ||
'hook' => 'AfterRegistrarRegistrationFailed', | ||
'function' => 'AfterRegistrarRegistrationFailed_admin', | ||
'type' => 'admin', | ||
'extra' => '', | ||
|
||
); | ||
if(!function_exists('AfterRegistrarRegistrationFailed_admin')){ | ||
function AfterRegistrarRegistrationFailed_admin($args){ | ||
$class = new Viasocket(); | ||
$settings = $class->getSettings(); | ||
if(!$settings['api']){ | ||
return null; | ||
} | ||
$event = $class->getEventStatus(__FUNCTION__); | ||
if($event['active'] == 0){ | ||
return null; | ||
} | ||
$args['event'] = __FUNCTION__; | ||
|
||
$class->callSocket($settings['api'],$args); | ||
} | ||
} | ||
|
||
return $hook; |
Oops, something went wrong.