Subversion Repositories ALCASAR

Rev

Details | Last modification | View Log

Rev Author Line No. Line
703 stephane 1
<?php
2
/*
3
 
4
*/
5
if (!(defined('ALCASAR_SESSION') && (ALCASAR_SESSION === 1))){
6
	exit();
7
}
8
$config['general_use_session'] = "no";
9
$config['general_sql_attrmap'] = ALCASAR_ADMIN_PATH_INC."/sql.attrmap";
10
 
11
#Read sql attribute map
12
unset($attrmap);
13
unset($rev_attrmap);
14
unset($attr_type);
15
if (isset($_SESSION['attrmap'])){
16
	#If attrmap is set then the rest will also be set
17
	$attrmap = $_SESSION['attrmap'];
18
	$attr_type = $_SESSION['attr_type'];
19
	$attr_op = $_SESSION['attr_op'];
20
}
21
else{
22
	$ARR = file("$config[general_sql_attrmap]");
23
	foreach($ARR as $val){
24
		$val=chop($val);
25
		if (preg_match('/^[[:space:]]*#/',$val) || preg_match('/^[[:space:]]*$/',$val))
26
			continue;
27
		list($type,$key,$op)=preg_split('/[[:space:]]+/',$val);
28
		$attrmap["$key"]=$key;
29
		$attr_type["$key"]=$type;
30
		$attr_op["$key"]=$op;
31
	}
32
	if ($config['general_use_session'] == 'yes'){
33
		session_register('attrmap');
34
		session_register('attr_type');
35
		session_register('attr_op');
36
	}
37
}
38
?>