示例#1
0
文件: sumo.php 项目: airedale/sumo
require SUMO_PATH . '/inc/inc.get_variables.php';
$SUMO['user'] = sumo_get_user_info();
$SUMO['connection'] = sumo_get_connection_info();
// ...to remember 'security string' after login
if (empty($SUMO['connection']['security_string'])) {
    $SUMO['connection']['security_string'] = $_SESSION['security_string'];
}
// Define and Load language,
// if exist language cookie load language set by user
require SUMO_PATH . '/inc/inc.load_language.php';
$sumo_access = NULL;
if ($sumo_action) {
    $sumo_access = strtoupper($sumo_action);
} elseif (sumo_get_banned_ip($SUMO['client']['ip'])) {
    $sumo_access = 'IPDISABLED';
} elseif (!sumo_verify_node()) {
    $sumo_access = 'NODEDISABLED';
} elseif (!$_SESSION['user']['user'] && !$_SESSION['user']['password']) {
    $sumo_access = 'NULL';
} else {
    // Verify if user exist
    if (!$SUMO['user']['user']) {
        $sumo_access = 'USERNOTEXIST';
    } elseif (!$SUMO['user']['active']) {
        $sumo_access = 'USERNOTACTIVE';
    } elseif ($SUMO['user']['datasource_type'] != 'SUMO' && $SUMO['page']['pwd_encrypt']) {
        $sumo_access = 'CANNOTAUTHENTICATE';
    } elseif ($SUMO['user']['datasource_type'] == 'SUMO' && !$_SESSION['loggedin'] && !sumo_verify_password()) {
        $sumo_access = 'PASSWORDERROR';
    } elseif ($SUMO['user']['datasource_type'] != 'SUMO') {
        require SUMO_PATH . '/inc/inc.datasources.php';
示例#2
0
 */
// Verify startup errors
$err = FALSE;
if (preg_match("/" . basename(__FILE__) . "/", $_SERVER['SCRIPT_NAME'])) {
    $err = 'E00001S';
}
// Display startup error then exit
if ($err) {
    require SUMO_PATH . '/inc/inc.startup_errors.php';
}
// Get some server informations
$SUMO['server'] = sumo_get_server_info();
switch ($_GET['cmd']) {
    // Get node status
    case 'GET_NODE_STATUS':
        $status = sumo_verify_node() ? "I00013X" : "W00049X";
        echo $status;
        break;
    case 'CREATE_SID':
        if (SUMO_SESSIONS_REPLICA) {
            $session = sumo_get_session_info($_GET['id']);
            setcookie('SUMO', $session['session_id'], null, '/');
        }
        break;
        // Get datasource status
    // Get datasource status
    case 'GET_DS_STATUS':
        $id = intval($_GET['id']);
        if ($id < 2) {
            exit("E09000X");
        }
示例#3
0
    // do not echo any ADODB errors
}
// Database connection
require SUMO_PATH . '/inc/inc.db_connection.php';
// Get configuration parameters
$SUMO = array_merge($SUMO, sumo_get_config('server'), sumo_get_config('database'));
$SUMO['client'] = sumo_get_client_info();
// Get client informations (except session id)
$SUMO['server'] = sumo_get_server_info();
// Get some server informations
$SUMO['page'] = sumo_get_accesspoint_info();
// Get protection parameters for requested page
$sumo_db = NULL;
// delete database connection parameters!
// Verify if node client it's enabled to call services (except for create SSO)
if (!sumo_verify_node($SUMO['client']['ip']) && $_GET['cmd'] != 'CREATE_SSO') {
    exit('W00050X');
}
// Check login
//if($_GET['cmd'] != 'CREATE_SSO' && $_COOKIE['loggedin'] != 1) exit();
// Filter all input data
$_GET = sumo_array_combine(array_keys($_GET), sumo_array_filter(array_values($_GET)));
$service_file = SUMO_PATH . '/services/service.' . $_GET['service'] . '.php';
if (@file_exists($service_file)) {
    require $service_file;
} else {
    define('SUMO_PATH_MODULE', SUMO_PATH . '/modules/' . $_GET['module']);
    $module['file'] = array('language' => SUMO_PATH_MODULE . '/languages/lang.' . $_COOKIE['language'] . '.php', 'library' => SUMO_PATH_MODULE . '/libraries/lib.common.php', 'module' => SUMO_PATH_MODULE . '/module.php', 'config' => SUMO_PATH_MODULE . '/module.xml', 'service' => SUMO_PATH_MODULE . '/services/service.' . $_GET['service'] . '.php');
    // Get available modules
    $modules = sumo_get_available_modules();
    // Load module library and service if exist