<?php
//
// If register_globals is on, delete all variables exept the ones in the array
//
if (ini_get('register_globals')) {
    foreach ($GLOBALS as $int_temp_name => $int_temp_value) {
        if (!in_array($int_temp_name, array (
                'GLOBALS',
                '_FILES',
                '_REQUEST',
                '_COOKIE',
                '_SERVER',
                '_ENV',
                '_SESSION',
                ini_get('session.name'),
                'int_temp_name',
                'int_temp_value'
            ))) {
            unset ($GLOBALS[$int_temp_name]);
        }
    }
}
//
// Now, (re)import the variables
//
if (isset ($_REQUEST['pass']))
    $ext_pass = $_REQUEST['pass'];
if (isset ($_REQUEST['user']))
    $ext_user = $_REQUEST['user'];
if (isset ($_REQUEST['action']))
    $ext_action = $_REQUEST['action'];
//
// Cleanup entries
//
$int_pass = (isset ($ext_pass) ? preg_replace("'[^A-Z]'", "", $ext_pass) : '');
$int_user = (isset ($ext_user) ? preg_replace("'[]A-Za-z0-9áäàâãëèéêïìîóöòôõúüùû \.^\$\!\_-()'", "", $ext_user) : '');
$int_action = (isset ($ext_action) ? intval($ext_action) : '');
//
// Import Session variables
//
if (isset ($_SESSION)) {
    foreach ($_SESSION as $int_temp_key => $int_temp_value) {
        if ($int_temp_value != '') {
            $$int_temp_key = $int_temp_value;
        }
    }
}
//
// Import Cookie variables
//
if (isset ($_COOKIE)) {
    foreach ($_COOKIE as $int_temp_key => $int_temp_value) {
        if ($int_temp_value != '') {
            $$int_temp_key = $int_temp_value;
        }
    }
}
//
// From here on, work only with $int_ variables and you're safe!
//
?>
