示例#1
0
 private function verifyFormToken($tokenName = 'f_tok', $tokenSeed = 0)
 {
     if (!Framework::isValidSecurityToken($this->CI->input->post($tokenName), $tokenSeed)) {
         return $this->getResponseObject(array('redirectOverride' => '/app/error/error_id/5', 'sessionParam' => \RightNow\Utils\Url::sessionParameter()), 'is_array', Config::getMessage(FORM_SUBMISSION_TOKEN_MATCH_EXP_LBL));
     }
 }
示例#2
0
 /**
  * Execute the following check before loading page
  * - SR doesn't exist
  * - user doesn't have the right to access the SR
  * - SR has been closed
  */
 private function checkBeforeLoadingPageHookForEbs()
 {
     $url = $_SERVER['REQUEST_URI'];
     // incident detail page
     if (Text::beginsWith($url, '/app/account/questions/detail/i_id')) {
         // check if the i_id is valid
         $incidentID = Url::getParameter('i_id');
         if (!$incidentID || !is_numeric($incidentID)) {
             $this->log->error("Invalid i_id#{$incidentID}", __METHOD__, array(null, $this->contact));
             Url::redirectToErrorPage(9);
         }
         // check if the linked SR has been closed
         if ($incident = RNCPHP\Incident::fetch(intval($incidentID))) {
             if ($incident->StatusWithType->Status->ID === 2) {
                 // solved
                 return;
             }
             if ($srID = $incident->CustomFields->Accelerator->ebs_sr_id) {
                 $srDetail = $this->checkServiceRequest($srID);
                 // if the status is closed, redirect to the read only page
                 if ($srDetail['INCIDENT_STATUS'] === 'Closed' && Url::getParameter('readonly') !== "1") {
                     $this->log->debug("Redirect to read-only page", __METHOD__, array(null, $this->contact));
                     header("Location: /app/account/questions/detail/i_id/{$incidentID}/readonly/1" . Url::sessionParameter());
                     exit;
                 }
             }
         }
         return;
     }
     // sr detail page
     if (Text::beginsWith($url, '/app/account/questions/detail/sr_id')) {
         $srID = Url::getParameter('sr_id');
         // check SR
         $srDetail = $this->checkServiceRequest($srID);
         // redirect to the incident detail page if the SR has already associated with an incident
         $incidentID = $srDetail['EXTATTRIBUTE15'];
         if ($incidentID) {
             $this->log->debug("Redirect to incident#{$incidentID} page", __METHOD__, array(null, $this->contact));
             header("Location: /app/account/questions/detail/i_id/{$incidentID}" . Url::sessionParameter());
             exit;
         }
         // if the status is closed, redirect to the read only page
         if ($srDetail['INCIDENT_STATUS'] === 'Closed' && Url::getParameter('readonly') !== "1") {
             $this->log->debug("Redirect to read-only page", __METHOD__, array(null, $this->contact));
             header("Location: /app/account/questions/detail/sr_id/{$srID}/readonly/1" . Url::sessionParameter());
             exit;
         }
     }
 }
示例#3
0
 /**
  * CheckBeforeLoadingPageHook for Siebel
  */
 private function checkBeforeLoadingPageHookForSiebel()
 {
     $url = $_SERVER['REQUEST_URI'];
     if (Text::beginsWith($url, '/app/account/questions/detail/i_id')) {
         // check if i_id in URL is valid
         $incidentID = Url::getParameter('i_id');
         if (!$incidentID || !is_numeric($incidentID)) {
             $this->log->error('Invalid i_id#{$incidentID}', __METHOD__, array(null, $this->contact));
             Url::redirectToErrorPage(9);
         }
         // check if the linked SR has been closed
         if ($incident = RNCPHP\Incident::fetch(intval($incidentID))) {
             if ($incident->StatusWithType->Status->ID === 2) {
                 // solved
                 return;
             }
             if ($srID = $incident->CustomFields->Accelerator->siebel_sr_id) {
                 $srDetail = $this->checkServiceRequest($srID);
                 // if the status is closed, redirect to the read only page
                 if ($srDetail['STATUS'] === 'Closed' && Url::getParameter('readonly') !== "1") {
                     $this->log->debug("Redirect to read-only page", __METHOD__, array(null, $this->contact));
                     header("Location: /app/account/questions/detail/i_id/{$incidentID}/readonly/1" . Url::sessionParameter());
                     exit;
                 }
             }
         }
         return;
     }
     // sr detail page
     if (Text::beginsWith($url, '/app/account/questions/detail/sr_id') === true) {
         $srID = Url::getParameter('sr_id');
         // check SR
         $srDetail = $this->checkServiceRequest($srID);
         // check if SR has already been associated with an Incident in RN.
         // if so, redirect to the corresponding Incident detail page
         $integrationID = $srDetail['INTEGRATIONID'];
         $integrationID = explode(',', $integrationID);
         $incidentID = $integrationID[0];
         if ($incidentID) {
             $this->log->debug('Redirect to incident#{$incidentID} page', __METHOD__, array(null, $this->contact));
             header("Location: /app/account/questions/detail/i_id/{$incidentID}" . Url::sessionParameter());
             exit;
         }
         // if the status is closed, redirect to the read only page
         if ($srDetail['STATUS'] === 'Closed' && Url::getParameter('readonly') !== "1") {
             $this->log->debug("Redirect to read-only page", __METHOD__, array(null, $this->contact));
             header("Location: /app/account/questions/detail/sr_id/{$srID}/readonly/1" . Url::sessionParameter());
             exit;
         }
     }
 }
            <div id="rn_FileAttach" class="rn_FileListDisplay">
                <?php 
if (count($answer->FileAttachments) > 0) {
    ?>
                    <span class="rn_DataLabel"> <?php 
    echo \RightNow\Utils\Config::getMessage(FILE_ATTACHMENTS_LBL);
    ?>
 </span>
                    <div class="rn_DataValue rn_FileList">
                        <ul>
                            <?php 
    foreach ($answer->FileAttachments as $attachment) {
        ?>
                            <li>
                                <a href="<?php 
        echo $attachment->URL . '/' . $attachment->CreatedTime . \RightNow\Utils\Url::sessionParameter();
        ?>
" target="_blank">
                                    <?php 
        echo \RightNow\Utils\Framework::getIcon($attachment->FileName);
        ?>
                                    <?php 
        echo $attachment->FileName;
        ?>
                                </a>
                            </li>
                            <?php 
    }
    ?>
                        </ul>
                    </div>