Subversion Repositories ALCASAR

Rev

Details | Last modification | View Log

Rev Author Line No. Line
1805 clement.si 1
<?php
2
$op_eq = '=';
3
$op_set = ':=';
4
$op_add = '+=';
5
$op_eq2 = '==';
6
$op_ne = '!=';
7
$op_gt = '>';
8
$op_ge = '>=';
9
$op_lt = '<';
10
$op_le = '<=';
11
$op_regeq = '=~';
12
$op_regne = '!~';
13
$op_exst = '=*';
14
$op_nexst = '!*';
15
 
16
// Check the operator if it is allowed for this type of
17
// attribute (check or reply).
18
// Arguments:
19
// $op: The operator
20
// $type: 1(check),2(reply)
21
// Return value:0 for OK, -1 for error
22
function check_operator($op,$type)
23
{
24
	switch($op){
25
		case '=':
26
		case ':=':
27
		case '+=':
28
			return 0;
29
		case '==':
30
		case '!=':
31
		case '>':
32
		case '>=':
33
		case '<':
34
		case '<=':
35
		case '=~':
36
		case '!~':
37
		case '=*':
38
		case '!*':
39
			return ($type == 1) ? 0 : -1;
40
	}
41
}
42
?>