Jump to content

elzek1

Members
  • Posts

    24
  • Joined

  • Last visited

  • Days Won

    1

elzek1 last won the day on May 24 2019

elzek1 had the most liked content!

Recent Profile Visitors

821 profile views

elzek1's Achievements

  1. if you have correctly your cron, it take 5 minuts.
  2. You could indicate if you purchased it directly at blesta.com or with a reseller.
  3. I want to know if you bought it on a reseller or directly in blesta.com
  4. elzek1

    500 error

    you could check logs in the folder blesta_logs
  5. elzek1

    error after migration

    sometimes this error is about strength of password
  6. https://docs.planetteamspeak.com/ts3/php/framework/ On suspend Mode all option are disable from client side
  7. Hello I added functions to code of this module. Whit this code suspend and unsuspend works fine, please check it: Teamspeak.php suspend function: public function suspendService($package, $service, $parent_package = null, $parent_service = null) { $row = $this->getModuleRow(); $api = $this->getApi( $row->meta->hostname, $row->meta->username, $row->meta->password, $row->meta->port ); if (!$row) { $this->Input->setErrors( ['module_row' => ['missing' => Language::_('Teamspeak.!error.module_row.missing', true)]] ); return; } // Get service parameters $service_fields = $this->serviceFieldsToObject($service->fields); // Modify "virtualserver_autostart" to 0 $this->parseResponse($api->suspendServer($service_fields->teamspeak_sid)); // Stop server $this->parseResponse($api->stopServer($service_fields->teamspeak_sid)); return null; } Teamspeak.php unsuspend function: public function unsuspendService($package, $service, $parent_package = null, $parent_service = null) { $row = $this->getModuleRow(); $api = $this->getApi( $row->meta->hostname, $row->meta->username, $row->meta->password, $row->meta->port ); if (!$row) { $this->Input->setErrors( ['module_row' => ['missing' => Language::_('Teamspeak.!error.module_row.missing', true)]] ); return; } // Get service parameters $service_fields = $this->serviceFieldsToObject($service->fields); // Modify "virtualserver_autostart" to 1 $this->parseResponse($api->unsuspendServer($service_fields->teamspeak_sid)); // Start server $this->parseResponse($api->startServer($service_fields->teamspeak_sid)); return null; } These codes call two new functions in teamspeak_api.php: teamspeak_api.php suspendserver function: public function suspendServer($sid) { try { // Build the parameters array $api_params = [ 'virtualserver_autostart' => 0 ]; // Fetch the virtual server instance, and modify it $instance = $this->apiRequest('serverquery')->serverList()[$sid]; $result = $instance->modify($api_params); // Add a control variable to know if the API request has been send successfully if (empty($result['error'])) { $result['status'] = true; } } catch (Exception $e) { $result = [ 'error' => $e->getMessage(), 'status' => false, 'code' => $e->getCode() ]; } return (object) $result; } teamspeak_api.php unsuspendserver function: public function unsuspendServer($sid) { try { // Build the parameters array $api_params = [ 'virtualserver_autostart' => 1 ]; // Fetch the virtual server instance, and modify it $instance = $this->apiRequest('serverquery')->serverList()[$sid]; $result = $instance->modify($api_params); // Add a control variable to know if the API request has been send successfully if (empty($result['error'])) { $result['status'] = true; } } catch (Exception $e) { $result = [ 'error' => $e->getMessage(), 'status' => false, 'code' => $e->getCode() ]; } return (object) $result; } That is all, i attached file if someone wants to donwnload it teamspeak.php teamspeak_api.php
  8. Hello Tyson Previously I used whmcs and when the service went into suspension, 2 things happened: 1.- Virtual server was stopped 2.- Auto-start function disabled, this in case vps was restarted vitual server client did not start.
  9. Hello Paul I have installed the module and it has no suspend function, it only has cancel. the problem with the cancel function is that it permanently deletes the service and does not fulfill the same function as suspend.
  10. I do not think so, because the process fails when it imports invoices. Clients are imported without problem. [1] => importInvoices: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'client_id' cannot be null on line 196 I checked the invoices and they are all associated with a client. Im using Blesta 4.5.1 fresh installation only for testing because If the import is done correctly I hope to pass it to production.
  11. Hello Paul I have same problem, I can give you a copy of the database, but you should delete it when you finish working on it. This is my error code: importStaff ----------------- importStaff took: 0.293 seconds ----------------- importClients ----------------- importClients took: 0.0378 seconds ----------------- importContacts ----------------- importContacts took: 0.0013 seconds ----------------- importTaxes ----------------- importTaxes took: 0.0011 seconds ----------------- importCurrencies ----------------- importCurrencies took: 0.0054 seconds ----------------- importInvoices ----------------- importTransactions ----------------- importPackageOptions ----------------- importServices ----------------- importSupportDepartments ----------------- importSupportTickets ----------------- importMisc ----------------- decrypted 0 values using WHMCS' custom algorithm decrypt took: 0 seconds total time took: 0.3976 seconds Array ( [error] => Array ( [0] => The import completed but the following errors ocurred: [1] => importInvoices: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'client_id' cannot be null on line 196 [2] => importTransactions: There is already an active transaction on line 231 [3] => importPackageOptions: There is already an active transaction on line 231 [4] => importServices: There is already an active transaction on line 231 [5] => importSupportDepartments: There is already an active transaction on line 231 [6] => importSupportTickets: There is already an active transaction on line 231 [7] => importMisc: There is already an active transaction on line 231 ) )
×
×
  • Create New...