Menu

[r30]: / e9-core / request.class.php  Maximize  Restore  History

Download this file

66 lines (54 with data), 1.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
class e_request
{
private $node, $query_string, $full_request;
function __construct( $array )
{
if ( isset( $array['node'] ) )
$this->set_node( $array['node'] );
if ( isset( $array['query_string'] ) )
$this->set_query_string( $array['query_string'] );
if ( !$this->get_node() )
$this->set_node( 'index' );
// Modelling $_GET
$get_arr = explode( '&', $this->get_query_string() );
foreach( $get_arr as $value )
{
if ( $value )
{
$pair = explode( '=', $value );
$_GET[$pair[0]] = $pair[1];
}
}
}
public function get_node()
{
return $this->node;
}
public function set_node( $str )
{
$this->node = e_format::sanitize_input( $str );
}
public function get_query_string()
{
return $this->query_string;
}
public function set_query_string( $str )
{
$this->query_string = e_format::sanitize_input( $str );
}
static function parse_folder_node( $str )
{
return explode( '/', $str, 2 );
}
static function check_role()
{
if ( !isset( $_GET['node'] ) )
return false;
$role_check = e_request::parse_folder_node( $_GET['node'] );
if ( $role_check[0] == 'admin' )
return true;
return false;
}
};
?>