/**
  * Show info template
  * 
  * @param string error message
  * @param array screen info
  */
 private function show_template_info($error = null, $screen = null)
 {
     onapp_debug(__CLASS__ . ' :: ' . __FUNCTION__);
     onapp_permission('roles');
     $params = array('title' => onapp_string('SCREENS_'), 'screen' => $screen, 'screen_id' => onapp_get_arg('screen_id'), 'info_title' => onapp_string('SCREEN_INFO'), 'info_body' => onapp_string('SCREEN_INFO_INFO'));
     onapp_show_template('screen_info', $params);
 }
 /**
  * Initializes php error levels and frontend error levels arrays
  * Displays index log settings page
  *
  * @param string error message
  * @return void
  */
 private function show_template_edit($error = NULL)
 {
     onapp_debug(__CLASS__ . ' :: ' . __FUNCTION__);
     $params = array('title' => onapp_string($this->config['title']), 'log_levels_frontend' => onapp_get_frontend_errors(), 'php_error_levels' => onapp_get_php_errors(), 'error' => onapp_string($error), 'language_list' => onapp_get_dir_list('lang'), 'templates_list' => onapp_get_dir_list(ONAPP_SMARTY_TEMPLATE_DIR), 'controllers_list' => onapp_get_dir_list('controllers'), 'template' => $this->config['template'], 'info_title' => onapp_string('EDIT_' . $this->config['info_title']), 'info_body' => onapp_string('EDIT_' . $this->config['info_body']));
     //TODO check is variable $this->template['edit'] defined
     onapp_show_template($this->config['template'] . '_edit', $params);
 }
示例#3
0
 /**
  * Displays log details page
  *
  * @param object $onapp OnApp object
  * @return void
  */
 public function show_template_details($onapp)
 {
     onapp_debug(__CLASS__ . ' :: ' . __FUNCTION__);
     $id = onapp_get_arg('id');
     onapp_debug('$id => ' . $id);
     $logs = $onapp->factory('Transaction', ONAPP_WRAPPER_LOG_REPORT_ENABLE);
     $params = array('logs_obj' => $logs->load($id), 'title' => onapp_string('TRANSACTION_DETAILS'), 'info_title' => onapp_string('TRANSACTION_DETAILS'), 'info_body' => onapp_string('TRANSACTION_DETAILS_INFO'));
     onapp_show_template('logs_details', $params);
 }
示例#4
0
 /**
  * Shows template view
  * 
  * @return void
  */
 public function show_template_view($error = NULL)
 {
     $postfields = array('clientid' => 1);
     $response = onapp_send_whmcs_api_request(ONAPP_WHMCS_LOGIN, ONAPP_WHMCS_PASSWORD, ONAPP_WHMCS_API_FILE_URL, 'getclientsdetails', $postfields);
     print '<pre>';
     print_r($response);
     die;
     onapp_show_template('test_view', array('title' => onapp_string('TEST_'), 'info_title' => onapp_string('TEST_'), 'info_body' => onapp_string('TEST_INFO'), 'error' => onapp_string($error)));
 }
 /**
  * Displays error log details page
  *
  * @param string error log identifier
  * @return void
  */
 public function show_template_details($id)
 {
     onapp_debug(__CLASS__ . ' :: ' . __FUNCTION__);
     $contents = $this->get_debug($id);
     $params = array('id' => onapp_get_arg('id'), 'contents' => $contents, 'title' => onapp_string('DEBUG_LOGS_DETAILS'), 'info_title' => onapp_string('DEBUG_LOGS_DETAILS'), 'info_body' => onapp_string('DEBUG_LOGS_DETAILS_INFO'));
     if (!$contents) {
         $error = 'SESSION_IDENTIFIER_NOT_FOUND_IN_LOG_FILE';
         trigger_error(onapp_string($error));
         $this->show_template_view($error);
     } else {
         onapp_show_template('debugLogs_details', $params);
     }
 }
 /**
  * Displays mail template edit page
  *
  * @return void
  */
 public function show_template_create()
 {
     onapp_debug(__METHOD__);
     $events_list = onapp_scan_dir(ONAPP_PATH . ONAPP_DS . 'events' . ONAPP_DS);
     sort($events_list, SORT_STRING);
     $params = array('classes_fields' => $this->get_classes_fields(), 'events_list' => $events_list, 'title' => onapp_string('СREATE_EMAIL_TEMPLATE'), 'info_title' => onapp_string('CREATE_EMAIL_TEMPLATE'), 'info_body' => onapp_string('CREATE_EMAIL_TEMPLATE_INFO'));
     onapp_show_template('emailTemplates_create', $params);
 }
 /**
  * Displays error log details page
  *
  * @param string error log identifier
  * @return void
  */
 public function show_template_details($id)
 {
     onapp_debug(__CLASS__ . ' :: ' . __FUNCTION__);
     $filename = ONAPP_PATH . ONAPP_DS . ONAPP_LOG_DIRECTORY . ONAPP_DS . 'error_' . $id . '.log';
     // echo $filename; die();
     $handle = fopen($filename, "rb");
     $contents = fread($handle, filesize($filename));
     fclose($handle);
     $params = array('contents' => $contents, 'title' => onapp_string('ERROR_LOGS_DETAILS'), 'info_title' => onapp_string('ERROR_LOGS_DETAILS'), 'info_body' => onapp_string('ERROR_LOGS_DETAILS_INFO'));
     onapp_show_template('errorLogs_details', $params);
 }
 /**
  * Shows template view
  * 
  * @return void
  */
 public function show_template_view($error = NULL)
 {
     onapp_show_template('profile_view', array('title' => onapp_string('PROFILE_'), 'info_title' => onapp_string('PROFILE_'), 'info_body' => onapp_string('PROFILE_INFO'), 'error' => onapp_string($error)));
 }
示例#9
0
 private function show_template_edit($cron_jobs_array, $error = NULL)
 {
     onapp_debug(__METHOD__);
     $this->setConstants();
     $params = array('cron_jobs_array' => $cron_jobs_array, 'minute_php' => $this->minute_php, 'hour_php' => $this->hour_php, 'day_php' => $this->day_php, 'month_php' => $this->month_php, 'weekday_php' => $this->weekday_php, 'title' => onapp_string('EDIT_CRON_JOB'), 'info_title' => onapp_string('EDIT_CRON_JOB'), 'info_body' => onapp_string('EDIT_CRON_JOB_INFO'), 'error' => $error);
     onapp_show_template('cron_edit', $params);
 }
 /**
  * Displays particular load balancer details page
  *
  * @param integer load balancer id
  * @param string error message
  * @return void
  */
 public function show_template_details($id, $error = NULL)
 {
     onapp_debug(__METHOD__);
     onapp_debug('id => ' . $id . ' error => ' . $error);
     $load_balancer_obj = $this->load('LoadBalancer', array($id));
     $load_balancing_cluster = $this->load('LoadBalancingCluster', array(onapp_get_arg('cluster')));
     foreach ($load_balancing_cluster->_nodes as $node) {
         $nodes[] = $this->load('VirtualMachine', array($node->_virtual_machine_id));
     }
     $vm_backup_obj = $this->getList('VirtualMachine_Backup', array($id));
     $size_and_quantity = $this->calculateBackups($vm_backup_obj);
     $params = array('virtual_machine_id' => $id, 'user_obj' => $this->load('User', array($load_balancer_obj->_user_id)), 'profile_obj' => $_SESSION['profile_obj'], 'hypervisor_obj' => $this->load('Hypervisor', array($load_balancer_obj->_hypervisor_id)), 'load_balancer_obj' => $load_balancer_obj, 'backups_quantity' => $size_and_quantity['quantity'], 'backups_total_size' => $size_and_quantity['size'], 'nodes' => $nodes, 'title' => onapp_string('LOAD_BALANCER_DETAILS'), 'info_title' => onapp_string('LOAD_BALANCER_DETAILS'), 'info_body' => onapp_string('LOAD_BALANCER_DETAILS_INFO'), 'error' => $error);
     onapp_show_template('loadBalancers_details', $params);
 }
 /**
  * Shows user payments page
  *
  * @global array $_ALIASES menu page aliases
  * @param string error message
  * @return void
  */
 private function show_template_white_list($id, $error = NULL)
 {
     onapp_debug(__CLASS__ . ' :: ' . __FUNCTION__);
     onapp_debug('error => ' . print_r($error, true) . ', id  =>' . $id);
     onapp_permission(array('user_white_lists', 'user_white_lists.read.own', 'user_white_lists.read'));
     $params = array('user_id' => $id, 'white_list_obj' => $this->getList('User_WhiteList', array($id)), 'title' => onapp_string('WHITE_LIST_IPS_FOR_THIS_USER'), 'info_title' => onapp_string('WHITE_LIST_IPS_FOR_THIS_USER'), 'info_body' => onapp_string('WHITE_LIST_IPS_FOR_THIS_USER_INFO'), 'error' => $error);
     onapp_show_template('usersAndGroups_whiteList', $params);
 }
示例#12
0
 /**
  * Performs the actions after successful getting of APIversion
  *
  * @return void
  */
 private function after_logedin_action()
 {
     onapp_debug('Login successfull!');
     if (isset($_SESSION['redirect']) && $_SESSION['redirect'] != ONAPP_BASE_URL . '/' . $_ALIASES['logout'] && $_SESSION['redirect'] != ONAPP_BASE_URL . '/') {
         $redirect_url = $_SESSION['redirect'];
         onapp_debug('Redirecting : ' . $_SESSION['redirect']);
         onapp_redirect($redirect_url);
     } else {
         onapp_redirect(ONAPP_BASE_URL . '/' . $_ALIASES[ONAPP_DEFAULT_ALIAS]);
     }
     onapp_show_template('login', $params);
 }
 /**
  * Shows virtual machine resource allocation page
  *
  * @param integer virtual machine id
  * @return void
  */
 private function show_template_edit($id)
 {
     onapp_debug(__CLASS__ . ' :: ' . __FUNCTION__);
     onapp_debug('id => ' . $id);
     onapp_permission(array('virtual_machines', 'virtual_machines.update.own', 'virtual_machines.update'));
     $params = array('vm_obj' => $this->load('VirtualMachine', array($id)), 'title' => onapp_string('ADJUST_RESOURCE_ALLOCATIONS'), 'info_title' => onapp_string('ADJUST_RESOURCE_ALLOCATIONS'), 'info_body' => onapp_string('ADJUST_RESOURCE_ALLOCATIONS_INFO'));
     onapp_show_template('vm_edit', $params);
 }
 /**
  * Shows hypervisor's params edit page
  *
  * @param integer user id
  * @return void
  */
 private function show_template_edit($id)
 {
     onapp_debug(__METHOD__);
     onapp_debug('id  =>' . $id);
     onapp_permission(array('hypervisors', 'hypervisors.update'));
     $onapp = $this->get_factory();
     $hypervisor = $onapp->factory('Hypervisor', ONAPP_WRAPPER_LOG_REPORT_ENABLE);
     $params = array('hypervisor_id' => $id, 'hypervisor_obj' => $hypervisor->load($id), 'hypervisor_types' => array('kvm', 'xen'), 'title' => onapp_string('EDIT_HYPERVISOR'), 'info_title' => onapp_string('EDIT_HYPERVISOR'), 'info_body' => onapp_string('EDIT_HYPERVISOR_INFO'));
     onapp_show_template('hypervisor_edit', $params);
 }