Example #1
0
 /**
  * Gets the requested page name  
  */
 public static function getPage()
 {
     $page = Request::getSafeGetOrPost("p");
     if ($page == NULL || !ctype_alnum($page)) {
         $page = StaticConfig::getDefaultPage();
     }
     return $page;
 }
Example #2
0
<?php

/* Copyright 2011 - 88 Creative Pty Ltd. 
 * Copyright of this program is the property of 88 Creative, 
 * without whose written permission reproduction in
 * whole or in part is prohibited. All rights reserved.
 * http://www.inform8.com
 * http://www.88creative.com.au
 */
// site settings + config + seession load
require_once 'config/settings.php';
//TODO add checks
$calendarEntries = array();
$tables = Request::getSafeGetOrPost('object');
$tableList = array();
if ($tables == 'ALL') {
    $tableCount = count($JACK_TABLE_LIST);
    for ($i = 0; $i < $tableCount; $i++) {
        $table = $JACK_TABLE_LIST[$i];
        //echo $table;
        $reqDef = $table . "Definition";
        $def = new $reqDef();
        if ($def->getTable()->getDisplaySettings()->hasLabel('CALENDAR')) {
            $tableList[] = $def->getTable()->getName();
        }
    }
} else {
    $tableList = explode(',', $tables);
}
$tableCount = count($tableList);
for ($i = 0; $i < $tableCount; $i++) {
Example #3
0
<?php

Session::getInstance()->setPostLoginCommand(Request::getSafeGetOrPost('postcmd'));
Example #4
0
if ($action == null) {
    // old option, conflicts with the file upload plugin though... form
    // action attribute does not get set...
    $action = Request::getSafeGetOrPost("action");
}
if ($action == 'help') {
    include 'config/authenticatedajax/help.php';
} else {
    if ($action == 'home') {
        include 'config/authenticatedajax/home.php';
    } else {
        if ($action == 'calendar') {
            include 'config/authenticatedajax/calendar.php';
        } else {
            if ($action == 'Manager' || $action == 'Update' || $action == 'View' || $action == 'Create' || $action == 'Order' || $action == 'FkData' || $action == 'Upload' || $action == 'Send') {
                require 'config/authenticatedajax/' . $reqobj . $action . '.php';
            } else {
                require 'config/authenticatedajax/' . $reqobj . 'Crud' . '.php';
                $crudName = $reqobj . 'Crud';
                $crud = new $crudName(WebContext::getLanguage());
                $res = $crud->{$action}();
                $wrapWithTa = Request::getSafeGetOrPost("wta");
                if ($wrapWithTa == 1) {
                    echo '<textarea>' . json_encode($res) . '</textarea>';
                } else {
                    echo json_encode($res);
                }
            }
        }
    }
}
Example #5
0
<?php

/* Copyright 2011 - 88 Creative Pty Ltd. 
 * Copyright of this program is the property of 88 Creative, 
 * without whose written permission reproduction in
 * whole or in part is prohibited. All rights reserved.
 * http://www.inform8.com
 * http://www.88creative.com.au
 */
// site settings + config + seession load
require_once 'config/settings.php';
$auth = Session::getInstance()->getAuthenticationManager()->isAuthenticated();
if (!$auth) {
    die('Error - 1000');
}
$call = Request::getSafeGetOrPost("call");
$pkg = Request::getSafeGetOrPost("pkg");
if ($pkg == '' || ctype_alpha($pkg) && ctype_alpha($call)) {
    if ($pkg == '') {
        include 'config/authenticatedajax/' . $call . '.php';
    } else {
        include 'config/authenticatedajax/' . $pkg . '/' . $call . '.php';
    }
} else {
    die('Error - 2000');
}
Example #6
0
// get how many rows we want to have into the grid
$sidx = Request::getOrPost('sidx');
// get index row - i.e. user click to sort
$sord = Request::getOrPost('sord');
// get the direction
$start = $limit * $page - $limit;
//print_r($_GET);
$reqDao = $reqobj . "Dao";
$dao = new $reqDao();
$reqDef = $reqobj . "Definition";
$def = new $reqDef();
$reqBuilder = $reqobj . "JqGridBuilder";
$builder = new $reqBuilder();
$joinTable = Request::getSafeGetOrPost('joinTable');
$joinField = Request::getSafeGetOrPost('joinField');
$otherJoinField = Request::getSafeGetOrPost('otherJoinField');
Inform8Context::getLogger()->log(0, 'jt:' . $joinTable);
Inform8Context::getLogger()->log(0, 'jf:' . $joinField);
Inform8Context::getLogger()->log(0, 'ojf:' . $otherJoinField);
$totalCount = 0;
if ($field == 'ALL' && $value == 'ALL') {
    $objs = $dao->getAll($limit, $start, $sidx, $sord);
    $totalCount = $dao->countAll();
    if ($totalCount > 0) {
        $totalPages = ceil($totalCount / $limit);
    } else {
        $totalPages = 0;
    }
} else {
    Inform8Context::getLogger()->log(0, 'jt:' . $joinTable);
    if ($joinTable != null && $joinTable != '') {
Example #7
0
<?php

/**
 * Copyright 2011 - Inform8
 * http://www.inform8.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License")
 * http://www.apache.org/licenses/LICENSE-2.0
 */
$authManager = Session::getInstance()->getAuthenticationManager();
if (Request::getSafeGetOrPost("logout") == 'true') {
    $authManager->reset();
}
if (!$authManager->isAuthenticated()) {
    //attempt login if set
    if (isset($_POST["login"]) && '1' == $_POST["login"]) {
        if ($authManager->performAuthentication()) {
            if ($session->getPostLoginCommand() != NULL) {
                header("Location: /" . $session->getPostLoginCommand() . '.htm');
                die;
            }
        } else {
            $authError = true;
            Inform8Context::getLogger()->log(BaseLogger::$DEBUG, "AuthError: " . json_encode($authManager->getAuthenticationError()));
        }
    }
}
?>
 
Example #8
0
/* Copyright 2011 - 88 Creative Pty Ltd. 
 * Copyright of this program is the property of 88 Creative, 
 * without whose written permission reproduction in
 * whole or in part is prohibited. All rights reserved.
 * http://www.inform8.com
 * http://www.88creative.com.au
 */
// site settings + config + seession load
require_once 'config/settings.php';
//TODO add checks to ensure table ok.
$reqobj = Request::getSafeGetOrPost("object");
$field = Request::getSafeGetOrPost("field");
$value = Request::getSafeGetOrPost("value");
$fields = Request::getSafeGetOrPost("fields");
$expanded = Request::getSafeGetOrPost("expanded");
$fieldsArray = array('*');
$jsonFieldsArray = NULL;
if ($fields != NULL && $fields != '') {
    $fieldsArray = explode(',', $fields);
    $jsonFieldsArray = $fieldsArray;
}
//	print($reqobj);
//	print($field);
//	print($value);
$reqDao = $reqobj . "Dao";
$reqIql = $reqobj . "IQL";
$dao = new $reqDao();
$reqJsonBuilder = $reqobj . "JsonBuilder";
$builder = new $reqJsonBuilder($jsonFieldsArray);
if ($field == 'ALL' && $value == 'ALL') {
Example #9
0
<?php

/**
 * Copyright 2011 - Inform8
 * http://www.inform8.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License")
 * http://www.apache.org/licenses/LICENSE-2.0
 */
require_once 'config/settings.php';
$call = Request::getSafeGetOrPost("call");
if (ctype_alpha($call)) {
    $regAjax = file_exists('config/ajax/' . $call . '.ajax.php');
    $secureAjax = file_exists('config/authenticatedajax/' . $call . '.ajax.php');
    if ($secureAjax) {
        if (Session::getInstance()->getAuthenticationManager()->isAuthenticated()) {
            include 'config/authenticatedajax/' . $call . '.ajax.php';
        }
    } else {
        if ($regAjax) {
            BasicLogger::logToFile('Running ajax action: ' . $call);
            include 'config/ajax/' . $call . '.ajax.php';
        }
    }
}
Example #10
0
<?php

/**
 * Copyright 2011 - Inform8
 * http://www.inform8.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License")
 * http://www.apache.org/licenses/LICENSE-2.0
 */
require_once 'config/settings.php';
$job = Request::getSafeGetOrPost("job");
if (ctype_alpha($job)) {
    $regJob = file_exists('config/phpcron/' . $job . '.job.php');
    if ($regJob) {
        BasicLogger::logToFile('Running local job: ' . $job . '.job.php');
        include 'config/phpcron/' . $job . '.job.php';
    }
}
Example #11
0
    # Returns the canonical file extension for the MIME type specified, as defined in /etc/mime.types (considering the first
    # extension listed to be canonical).
    #
    # $type - the MIME type
    static $exts;
    if (!isset($exts)) {
        $exts = system_mime_type_extensions();
    }
    return isset($exts[$type]) ? $exts[$type] : null;
}
require_once 'config/settings.php';
if (!Session::getInstance()->getAuthenticationManager()->isAuthenticated()) {
    header('Location: /');
    exit;
}
$pfile = Request::getSafeGetOrPost('f');
$fileName = StaticConfig::getStreamedContentLocalFolder() . $pfile;
if (!file_exists($fileName)) {
    header('Location: /');
    exit;
}
$fileparts = explode('/', $file);
// check no .. in file name
header("Content-Type: " . system_extension_mime_type($fileName));
header("Content-Length: " . filesize($fileName));
header("Pragma: no-cache");
header("Expires: 0");
$fp = fopen($fileName, "rb");
//start buffered download
while (!feof($fp)) {
    //reset time limit for big files