Skip to content

Commit

Permalink
v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sameerdm committed Dec 24, 2017
1 parent 6a02e70 commit d95f6e0
Show file tree
Hide file tree
Showing 37 changed files with 2,229 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/via_socket.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

934 changes: 934 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions hooks.php
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'], "");
}
25 changes: 25 additions & 0 deletions hooks/AdminLogin.php
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;
27 changes: 27 additions & 0 deletions hooks/AfterModuleChangePackage.php
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;
28 changes: 28 additions & 0 deletions hooks/AfterModuleChangePassword.php
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;
27 changes: 27 additions & 0 deletions hooks/ClientLogin_admin.php
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;
29 changes: 29 additions & 0 deletions hooks/acceptorder.php
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;
28 changes: 28 additions & 0 deletions hooks/aftermodulecreate_hosting.php
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;
29 changes: 29 additions & 0 deletions hooks/aftermodulesuspend.php
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;
28 changes: 28 additions & 0 deletions hooks/aftermoduleunsuspend.php
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;
31 changes: 31 additions & 0 deletions hooks/afterregistrarregistration.php
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;
26 changes: 26 additions & 0 deletions hooks/afterregistrarregistration_admin.php
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;
29 changes: 29 additions & 0 deletions hooks/afterregistrarregistrationfailed.php
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;
26 changes: 26 additions & 0 deletions hooks/afterregistrarregistrationfailed_admin.php
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;
Loading

0 comments on commit d95f6e0

Please sign in to comment.