Beispiel #1
0
 /**
  * Assume content is not constructed properly for zip 
  */
 public static function gzSoapCompressEndFlush($status, $zip = false, $encoding = null, $logger = null)
 {
     header($status);
     header("Content-Type: text/xml; charset=UTF-8");
     global $_CALEM_conf;
     if ($_CALEM_conf['ws_conn_close']) {
         header("Connection: close");
     }
     if ($zip) {
         header("Content-Encoding: " . $encoding);
         $contents = ob_get_contents();
         ob_end_clean();
         $zipContents = gzencode($contents);
         print $zipContents;
         if ($logger && $logger->isDebugEnabled()) {
             $logger->debug("Zip contents from " . strlen($contents) . " to " . strlen($zipContents));
         }
     } else {
         ob_end_flush();
     }
     CalemExit::exitCalem();
 }
Beispiel #2
0
        $loadmode = $si['loadmode'];
    }
}
//If session is valid load the application
if ($sesReload) {
    $launch = isset($_REQUEST['aid']) ? $_CALEM_conf[$_REQUEST['aid']] : $_CALEM_conf['ses_launch_app'];
    //Place a cookie to remember the session Id.
    if (!$hasCookie) {
        $userRow = $sesReload->get('user');
        $locale = $lang ? $lang : NULL_LOCALE;
        $cookieValue = "{sid: '" . $sid . "', gid: '" . $userRow['acl_group_id'] . "', uid: '" . $userRow['id'] . "', uname: '" . $userRow['username'] . "', full_name: '" . $userRow['full_name'] . "', admin_type_id: '" . $userRow['admin_type_id'] . "', locale: '" . $locale . "', team_id: '" . $userRow['team_id'] . "'}";
        if ($logger->isDebugEnabled()) {
            $logger->debug("Cookie set to: " . $cookieValue);
        }
        setCookie('CALEM_SID', base64_encode($cookieValue));
    }
} else {
    if (isset($_REQUEST['aid'])) {
        $logger->error('Session expired, need to log in first, aid=' . $_REQUEST['aid']);
        die("Session expired. Please login first.");
    }
    $action = $_CALEM_conf['default_noses_action'];
    $launch = isset($_CALEM_conf['noses_allowed_actions'][$action]) ? $_CALEM_conf['noses_allowed_actions'][$action] : $_CALEM_conf['noses_allowed_actions'][$_CALEM_conf['default_noses_action']];
}
if ($logger->isInfoEnabled()) {
    $logger->info("Received request to launch: " . $launch . ", aid=" . $_REQUEST['aid']);
}
require_once _CALEM_DIR_ . $launch;
//Close down logger
CalemExit::exitCalem();
 /**
  * Shutdown the script environment
  * <ul>
  * <li> shutdown the logger
  * <li> exit the script
  * </ul>
  */
 private function shutdown()
 {
     CalemExit::exitCalem();
 }