/** * Handle uncaught exceptions * * @param Exception $exception Uncaught exception * @return void */ public function handleException(Exception $exception) { try { foreach ($this->writers as $writer) { $this->em->registerListener('onUncaughtException', new $writer()); } $this->em->dispatch(new iMSCP_Exception_Event($exception)); } catch (Exception $e) { die(sprintf('Unable to handle uncaught exception thrown in file %s at line %s with message: %s', $e->getFile(), $e->getLine(), $e->getMessage())); } }
$tpl = new iMSCP_pTemplate(); $tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => '../../plugins/OwnDDNS/frontend/reseller/ownddns.tpl', 'page_message' => 'layout', 'ownddns_list' => 'page', 'ownddns_edit' => 'page', 'ownddns_select_item' => 'page', 'ownddns_customer_list' => 'page', 'ownddns_customer_item' => 'page', 'ownddns_no_customer_item' => 'page', 'scroll_prev_gray' => 'ownddns_customer_list', 'scroll_prev' => 'ownddns_customer_list', 'scroll_next_gray', 'ownddns_customer_list', 'scroll_next' => 'ownddns_customer_list')); if (isset($_REQUEST['action'])) { $action = clean_input($_REQUEST['action']); if ($action === 'activate') { $customerAdminId = isset($_POST['admin_id']) && $_POST['admin_id'] !== '-1' ? clean_input($_POST['admin_id']) : ''; if ($customerAdminId != '') { ownddns_activateCustomer($tpl, $pluginManager, $customerAdminId, $_SESSION['user_id']); } } elseif ($action === 'edit') { $customerAdminId = $_GET['admin_id'] !== '' ? (int) clean_input($_GET['admin_id']) : ''; if ($customerAdminId != '') { ownddns_changeCustomerOwnDDNS($tpl, $customerAdminId, $_SESSION['user_id']); } } elseif ($action === 'delete') { $customerAdminId = isset($_GET['admin_id']) ? clean_input($_GET['admin_id']) : ''; if ($customerAdminId != '') { ownddns_deactivateCustomer($tpl, $customerAdminId, $_SESSION['user_id']); } } } $tpl->assign(array('TR_PAGE_TITLE' => tr('Customers / OwnDDNS'), 'THEME_CHARSET' => tr('encoding'), 'ISP_LOGO' => layout_getUserLogo(), 'CUSTOMER_NOT_SELECTED' => tr("No customer selected."), 'TR_OWNDDNS_SELECT_NAME_NONE' => tr('Select a customer'), 'TR_SHOW' => tr('Activate OwnDDNS for this customer'), 'TR_UPDATE' => tr('Update'), 'TR_CANCEL' => tr('Cancel'), 'TR_OWNDDNS_CUSTOMER_NAME' => tr('Customer'), 'TR_OWNDDNS_NO_CUSTOMER' => tr('OwnDDNS customer entries'), 'OWNDDNS_NO_CUSTOMER' => tr('No customer for OwnDDNS support activated'), 'TR_OWNDDNS_STATUS' => tr('Status'), 'TR_OWNDDNS_ACCOUNT_LIMIT' => tr('Account limit'), 'DEACTIVATE_CUSTOMER_ALERT' => tr('Are you sure, You want to deactivate OwnDDNS for this customer?'), 'TR_PREVIOUS' => tr('Previous'), 'TR_OWNDDNS_ACTIONS' => tr('Actions'), 'TR_EDIT_OWNDDNS_ACCOUNT' => tr('Edit customer OwnDDNS'), 'TR_DELETE_OWNDDNS_ACCOUNT' => tr('Delete customer OwnDDNS'), 'TR_LIMIT_VALUE' => tr('Limit value'), 'TR_MAX_ACCOUNT_LIMIT' => tr('Max creating accounts') . '<br /><i>(0 ' . tr('unlimited') . ')</i>', 'TR_NEXT' => tr('Next'))); generateNavigation($tpl); if (!isset($_GET['action'])) { ownddns_generateSelect($tpl, $_SESSION['user_id']); ownddns_generateActivatedCustomers($tpl, $_SESSION['user_id']); } generatePageMessage($tpl); $tpl->parse('LAYOUT_CONTENT', 'page'); iMSCP_Events_Manager::getInstance()->dispatch(iMSCP_Events::onResellerScriptEnd, array('templateEngine' => $tpl)); $tpl->prnt();
/** * Register callback to load navigation file * * @return void */ protected function initializeNavigation() { $this->eventManager->registerListener(array(iMSCP_Events::onAdminScriptStart, iMSCP_Events::onResellerScriptStart, iMSCP_Events::onClientScriptStart), 'layout_loadNavigation'); }