-
Notifications
You must be signed in to change notification settings - Fork 0
/
lib.php
112 lines (96 loc) · 3.59 KB
/
lib.php
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
// This script and data application were generated by AppGini 5.72
// Download AppGini for free from https://bigprof.com/appgini/download/
error_reporting(E_ERROR | E_WARNING | E_PARSE);
if(!defined('datalist_db_encoding')) define('datalist_db_encoding', 'UTF-8');
if(!defined('maxSortBy')) define('maxSortBy', 4);
if(!defined('empty_lookup_value')) define('empty_lookup_value', '{empty_value}');
if(function_exists('date_default_timezone_set')) @date_default_timezone_set('America/New_York');
if(function_exists('set_magic_quotes_runtime')) @set_magic_quotes_runtime(0);
$GLOBALS['filter_operators'] = array(
'equal-to' => '<=>',
'not-equal-to' => '!=',
'greater-than' => '>',
'greater-than-or-equal-to' => '>=',
'less-than' => '<',
'less-than-or-equal-to' => '<=',
'like' => 'like',
'not-like' => 'not like',
'is-empty' => 'isEmpty',
'is-not-empty' => 'isNotEmpty'
);
$currDir = dirname(__FILE__);
include("$currDir/settings-manager.php");
detect_config();
migrate_config();
include("$currDir/config.php");
include("$currDir/db.php");
include("$currDir/ci_input.php");
include("$currDir/datalist.php");
include("$currDir/incCommon.php");
include("$currDir/admin/incFunctions.php");
ob_start();
/* trim $_POST, $_GET, $_REQUEST */
if(count($_POST)) $_POST = array_trim($_POST);
if(count($_GET)) $_GET = array_trim($_GET);
if(count($_REQUEST)) $_REQUEST = array_trim($_REQUEST);
// include nav menu links and hook functions
@include_once("$currDir/hooks/__global.php");
@include_once("$currDir/hooks/links-navmenu.php");
// check sessions config
$noPathCheck = true;
$arrPath = explode(';', ini_get('session.save_path'));
$save_path = $arrPath[count($arrPath)-1];
if(!$noPathCheck && !is_dir($save_path)){
?>
<center>
<div class="alert alert-danger">
Your site is not configured to support sessions correctly. Please edit your php.ini file and change the value of <i>session.save_path</i> to a valid path.
</div>
</center>
<?php
exit;
}
if(session_id()){ session_write_close(); }
$configured_save_handler = @ini_get('session.save_handler');
if($configured_save_handler != 'memcache' && $configured_save_handler != 'memcached')
@ini_set('session.save_handler', 'files');
@ini_set('session.serialize_handler', 'php');
@ini_set('session.use_cookies', '1');
@ini_set('session.use_only_cookies', '1');
@ini_set('session.cookie_httponly', '1');
@ini_set('session.use_strict_mode', '1');
@session_cache_expire(2);
@session_cache_limiter($_SERVER['REQUEST_METHOD'] == 'POST' ? 'private' : 'nocache');
@session_name('Jisort');
session_start();
// check if membership system exists
setupMembership();
// silently apply db changes, if any
@include_once("$currDir/updateDB.php");
// do we have a login request?
logInMember();
// convert expanded sorting variables, if provided, to SortField and SortDirection
$postedOrderBy = array();
for($i = 0; $i < maxSortBy; $i++){
if(isset($_REQUEST["OrderByField$i"])){
$sd = ($_REQUEST["OrderDir$i"] == 'desc' ? 'desc' : 'asc');
if($sfi = intval($_REQUEST["OrderByField$i"])){
$postedOrderBy[] = array($sfi => $sd);
}
}
}
if(count($postedOrderBy)){
$_REQUEST['SortField'] = '';
$_REQUEST['SortDirection'] = '';
foreach($postedOrderBy as $obi){
$sfi = ''; $sd = '';
foreach($obi as $sfi => $sd);
$_REQUEST['SortField'] .= "$sfi $sd,";
}
$_REQUEST['SortField'] = substr($_REQUEST['SortField'], 0, -2 - strlen($sd));
$_REQUEST['SortDirection'] = $sd;
}elseif($_REQUEST['apply_sorting']){
/* no sorting and came from filters page .. so clear sorting */
$_REQUEST['SortField'] = $_REQUEST['SortDirection'] = '';
}