Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 3.0.8.0
- * @ Author : DeZender
- * @ Release on : 25.09.2017
- * @ Official site : http://DeZender.Net
- *
- */
- function StreamlinetoStreamline($params)
- {
- $maxconnection = $params['configoption4'];
- $is_trial = (($params['configoption5'] == 'Yes' ? '1' : '0'));
- $is_isplock = (($params['configoption6'] == 'Yes' ? '1' : '0'));
- $is_restreamer = (($params['configoption7'] == 'Yes' ? '1' : '0'));
- $Bouquets = $params['configoption10'];
- $syn_expiry = $params['configoption17'];
- $trial_period = (($params['configoption18'] != 0 ? '+' . $params['configoption18'] . ' hours' : '+24 hours'));
- $tblhostingdetails = \Illuminate\Database\Capsule\Manager::table( 'tblhosting' )->where( 'id', '=', $params['serviceid'] )->get( );
- $nextduedate = $tblhostingdetails[0]->nextduedate;
- $serviceid = $tblhostingdetails[0]->id;
- $con = XtreamCodeTestConnection( $params['pid'] );
- $xtreamConfig = \Illuminate\Database\Capsule\Manager::table( 'mod_xtreamConfig' )->get( );
- $returndata = array( );
- if (isset( $xtreamConfig ) && !(empty( $xtreamConfig ))) {
- foreach ($xtreamConfig as $config) {
- $returndata[$config->setting] = $config->value;
- }
- }
- if (isset( $returndata['configoption_field_name'] ) && !(empty( $returndata['configoption_field_name'] ))) {
- if (isset( $params['configoptions'] ) && !(empty( $params['configoptions'] ))) {
- foreach ($params['configoptions'] as $configname => $configvalue) {
- if ($configname == $returndata['configoption_field_name']) {
- $maxconnection += $configvalue;
- }
- }
- }
- }
- $username = $params['username'];
- $password = $params['password'];
- $reseller_notes = $returndata['common_identifier'] . $serviceid;
- $result = mysqli_query( $con, 'SELECT username,id FROM users WHERE username=\'' . $username . '\' AND reseller_notes=\'' . $reseller_notes . '\'' );
- if (!($result)) {
- $radiussqlerror = mysqli_error( $con );
- XtreamCode_WHMCSReconnect( );
- return 'XtreamCode Database Query Error: ' . $radiussqlerror;
- }
- if (0 < mysqli_num_rows( $result )) {
- $xcuser = mysqli_fetch_assoc( $result );
- $xtreamuserid = $xcuser['id'];
- $checkmagdevice = $params['customfields'][$returndata['checkmagdevice']];
- if (isset( $checkmagdevice ) && !(empty( $checkmagdevice )) && ($checkmagdevice == 'on')) {
- if (!(empty( $params['customfields'][$returndata['custom_field_mag']] ))) {
- $macexists = XtreamCode_CheckMAG( $params['customfields'][$returndata['custom_field_mag']], $con );
- if (isset( $macexists ) && !(empty( $macexists ))) {
- return XtreamCode_UpdateMAG( $params );
- }
- return XtreamCode_AddMAG( $params, $params['customfields'][$returndata['custom_field_mag']] );
- }
- logModuleCall( 'XtreamCode', 'StreamlinetoStreamline', 'MAG Address field is requied for (Only MAG and Check MAG)', 'error' );
- return 'MAG Address field required, if you choose only MAG device';
- }
- $expdate = 'NULL';
- if (($is_trial == 1) && ($nextduedate != '0000-00-00')) {
- $expdate = strtotime( date( 'Y-m-d H:i:s', strtotime( $nextduedate ) ) );
- }
- else if (($syn_expiry == 'on') && ($nextduedate != '0000-00-00')) {
- $expdate = strtotime( date( 'Y-m-d H:i:s', strtotime( $nextduedate ) ) );
- }
- else if ($is_trial == 1) {
- $expdate = strtotime( date( 'Y-m-d H:i:s', strtotime( $trial_period ) ) );
- }
- $query = 'UPDATE users SET `bouquet`=\'' . $Bouquets . '\',`exp_date`=' . $expdate . ',enabled=\'1\',`is_trial`=\'' . $is_trial . '\',`max_connections`=\'' . $maxconnection . '\',`is_restreamer`=\'' . $is_restreamer . '\',`is_isplock`=\'' . $is_isplock . '\' WHERE id=\'' . $xtreamuserid . '\'';
- $result = mysqli_query( $con, $query );
- if (!($result)) {
- $radiussqlerror = mysqli_error( $con );
- XtreamCode_WHMCSReconnect( );
- return 'XtreamCode Database Query Error: ' . $radiussqlerror;
- }
- if (!(empty( $params['customfields'][$returndata['custom_field_mag']] ))) {
- $macexists = XtreamCode_CheckMAG( $params['customfields'][$returndata['custom_field_mag']], $con );
- if (isset( $macexists ) && !(empty( $macexists ))) {
- return XtreamCode_UpdateMAG( $params );
- }
- return XtreamCode_AddMAG( $params, $params['customfields'][$returndata['custom_field_mag']] );
- }
- $result = mysqli_query( $con, 'SELECT * FROM users WHERE reseller_notes=\'' . $reseller_notes . '\' AND is_mag=\'1\'' );
- $pairid = mysqli_fetch_assoc( $result );
- $xtreamuserid = $pairid['id'];
- if (isset( $pairid['pair_id'] ) && !(empty( $pairid['pair_id'] ))) {
- mysqli_query( $con, 'DELETE FROM `mag_devices` WHERE user_id=\'' . $pairid['pair_id'] . '\'' );
- $result = mysqli_query( $con, 'DELETE FROM users WHERE reseller_notes=\'' . $reseller_notes . '\' AND is_mag=\'1\'' );
- mysqli_query( $con, 'UPDATE users SET pair_id=\'\' WHERE reseller_notes=\'' . $reseller_notes . '\'' );
- }
- XtreamCode_WHMCSReconnect( );
- logModuleCall( 'XtreamCode', 'StreamlinetoStreamline', 'Upgrade Account: ' . $username, 'success' );
- return 'success';
- }
- $checkmagdevice = $params['customfields'][$returndata['checkmagdevice']];
- ...................................................
- .........................
- ............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement