Subversion Repositories ALCASAR

Rev

Blame | Last modification | View Log

<?php
/*

*/
if (!(defined('ALCASAR_SESSION') && (ALCASAR_SESSION === 1))){
        exit();
}
$config['general_use_session'] = "no";
$config['general_sql_attrmap'] = ALCASAR_ADMIN_PATH_INC."/sql.attrmap";

#Read sql attribute map
unset($attrmap);
unset($rev_attrmap);
unset($attr_type);
if (isset($_SESSION['attrmap'])){
        #If attrmap is set then the rest will also be set
        $attrmap = $_SESSION['attrmap'];
        $attr_type = $_SESSION['attr_type'];
        $attr_op = $_SESSION['attr_op'];
}
else{
        $ARR = file("$config[general_sql_attrmap]");
        foreach($ARR as $val){
                $val=chop($val);
                if (preg_match('/^[[:space:]]*#/',$val) || preg_match('/^[[:space:]]*$/',$val))
                        continue;
                list($type,$key,$op)=preg_split('/[[:space:]]+/',$val);
                $attrmap["$key"]=$key;
                $attr_type["$key"]=$type;
                $attr_op["$key"]=$op;
        }
        if ($config['general_use_session'] == 'yes'){
                session_register('attrmap');
                session_register('attr_type');
                session_register('attr_op');
        }
}
?>