public function __construct() { // Load components required by this module Loader::loadComponents($this, array("Input")); // Load the language required by this module Language::loadLang("paymentwall", null, dirname(__FILE__) . DS . "language" . DS); }
/** * Construct a new merchant gateway */ public function __construct() { // Load components required by this gateway Loader::loadComponents($this, array("Input")); // Load the language required by this gateway Language::loadLang("nonmerchant_demo", null, dirname(__FILE__) . DS . "language" . DS); }
public function __construct() { Loader::loadComponents($this, array("Input")); Language::loadLang("lang", null, dirname(__FILE__) . DS . "language" . DS); Loader::loadHelpers($this, array("Html")); $this->loadConfig(dirname(__FILE__) . DS . "config.json"); }
/** * Initializes the Automatic Billing Extended library. * * @param string $gateway_identifier The gateway's chosen identifier * @param string $gateway_hash The gateway's chosen hash (if null, it will use the gateway_identifier's sha256 hash as the gateway hash) */ public function __construct($gateway_identifier, $gateway_hash = null) { Loader::loadComponents($this, array("Record")); $this->gateway_identifier = $gateway_identifier; if ($gateway_hash == null) { $this->gateway_hash = hash("sha256", $this->gateway_identifier); } else { $this->gateway_hash = $gateway_hash; } }
/** * Initializes the module */ public function __construct() { // Load components required by this module Loader::loadComponents($this, array("Input")); // Load the language required by this module Language::loadLang("gogetsslv2", null, dirname(__FILE__) . DS . "language" . DS); //load our config file Configure::load("gogetsslv2", dirname(__FILE__) . DS . "config" . DS); //error_reporting(E_ALL); //ini_set('display_errors', 1); }
/** * Performs any necessary cleanup actions * * @param int $plugin_id The ID of the plugin being uninstalled * @param boolean $last_instance True if $plugin_id is the last instance across all companies for this plugin, false otherwise */ public function uninstall($plugin_id, $last_instance) { if (!isset($this->Record)) { Loader::loadComponents($this, array("Record")); } // Remove all tables *IFF* no other company in the system is using this plugin if ($last_instance) { try { if (is_dir($this->upload_path)) { $this->delTree($this->upload_path); } } catch (Exception $e) { // Error dropping... no permission? // $this->Input->setErrors(array('db'=> array('create'=>$e->getMessage()))); return; } } }
public function __construct() { Loader::loadComponents($this, array("Input", "Record")); Language::loadLang("tastycpanel_lang", null, dirname(__FILE__) . DS . "language" . DS); Loader::loadHelpers($this, array("Html")); }
/** * Loads the JSON component into this object, making it ready to use * * /DONE/ */ private function loadJson() { if (!isset($this->Json) || !$this->Json instanceof Json) { Loader::loadComponents($this, array("Json")); } }
/** * SSL * * @param type $package * @param type $service * @param array $vars * @param array $post */ public function ssl($package, $service, array $vars = array(), array $post = array()) { Loader::loadComponents($this, array("Record")); $row = $this->getModuleRow(); $fields = $this->serviceFieldsToObject($service->fields); $api = $this->getApiByMeta($row->meta, $fields); $this->vars = $this->getPageVars($vars); switch ($this->vars->action) { case "generatecsr": $data = array('city' => $post['city'], 'company' => $post['company'], 'companydivision' => $post['companydivision'], 'country' => $post['country'], 'email' => $post['email'], 'host' => $post['domain'], 'state' => $post['state'], 'pass' => $post['pass']); if ($api->sendApi2Request("SSL", "gencsr", $data)) { $this->printJson($this->parseResponseToJson($api->getCleanResponse())); } break; case "generatekey": if ($api->sendApi2Request("SSL", "genkey", array('host' => empty($post["selectdomain"]) ? $post["domain"] : $post["selectdomain"], 'keysize' => $post["keysize"]))) { $this->printJson($this->parseResponseToJson($api->getCleanResponse())); } break; case "generatecrt": $data = array('host' => $post['domain'], 'city' => $post['city'], 'company' => $post['company'], 'companydivision' => $post['companydivision'], 'country' => $post['country'], 'email' => $post['email'], 'state' => $post['state']); if ($api->sendApi2Request("SSL", "gencrt", $data)) { $this->printJson($this->parseResponseToJson($api->getCleanResponse())); } break; case "uploadkey": if ($api->sendApi2Request("SSL", "uploadkey", array('host' => empty($post["selectdomain"]) ? $post["domain"] : $post["selectdomain"], 'key' => $post["key"]))) { $this->printJson($this->parseResponseToJson($api->getCleanResponse())); } break; case "uploadcrt": if ($api->sendApi2Request("SSL", "uploadcrt", array($post["key"]))) { $this->printJson($this->parseResponseToJson($api->getCleanResponse())); } break; case "viewkey": $domain = $this->getFromVars($_GET, "domain", $fields->cpanel_domain); if ($api->sendApi2Request("SSLInfo", "fetchinfo", array('domain' => $domain))->isSuccess()) { $this->prepareView("sslviewkey"); $this->view->data = $api->getResponse()->cpanelresult->data[0]; return $this->showCorrectView($this->view); } else { $this->prepareView("sslerror"); $this->view->response = $api->getResponse(); return $this->showCorrectView($this->view); } break; case "viewcrt": $domain = $this->getFromVars($_GET, "domain", $fields->cpanel_domain); if ($api->sendApi2Request("SSLInfo", "fetchinfo", array('domain' => $domain))->isSuccess()) { $this->prepareView("sslviewcrt"); $this->view->data = $api->getResponse()->cpanelresult->data[0]; return $this->showCorrectView($this->view); } else { return 'Unknown error occured'; } break; default: break; } $api2 = clone $api; $api3 = clone $api; $api4 = clone $api; $request1 = $api->sendApi2Request("SSL", "listkeys"); $request2 = $api3->sendApi2Request("SSL", "listcrts"); $request3 = $api4->sendApi2Request("SSL", "listcsrs"); if ($request1->isSuccess() and $request2->isSuccess() and $request3->isSuccess() and !$this->Input->errors()) { $domains[''] = 'Select a domain'; $domains[$fields->cpanel_domain] = $fields->cpanel_domain; $domains = array_merge($domains, $this->DataStructure->create("Array")->numericToKey($api2->sendApi2Request("AddonDomain", "listaddondomains")->getResponse()->cpanelresult->data, "domain", "domain")); $domains = array_merge($domains, $this->DataStructure->create("Array")->numericToKey($api2->sendApi2Request("SubDomain", "listsubdomains")->getResponse()->cpanelresult->data, 'domain', 'domain')); $domains = array_merge($domains, $this->DataStructure->create("Array")->numericToKey($api2->sendApi2Request("Park", "listparkeddomains")->getResponse()->cpanelresult->data, 'domain', 'domain')); $keysdomains[''] = 'Select a domain'; $keysdomains = array_merge($keysdomains, $this->DataStructure->create("Array")->numericToKey($request1->getResponse()->cpanelresult->data, 'host', 'host')); $this->prepareView("ssl"); $this->view->set("cpanel_domain", $fields->cpanel_domain); $this->view->keys = $request1->getResponse(); $this->view->crts = $request2->getResponse(); $this->view->csrs = $request3->getResponse(); $this->view->domains = $domains; $this->view->keysdomains = $keysdomains; $this->view->username = $fields->cpanel_username; $this->view->client = $this->Record->select(array("contacts.*"))->from("clients")->leftJoin("contacts", "contacts.client_id", "=", "clients.id", false)->where("clients.id", "=", $service->client_id)->fetch(); return $this->view->fetch(); } else { return "Request 1 status: <code>{$request1->getResultMessage()}</code><br>Request 2 status: <code>{$request2->getResultMessage()}</code><br>Request 3 status: <code>{$request3->getResultMessage()}</code><br>"; } }