summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-12-20 22:08:34 +0000
committerErmal <eri@pfsense.org>2013-12-20 22:08:34 +0000
commitaa205c3b69bf76b1565fd42dba83c7637212f793 (patch)
treef04ba2d5e093bd36f0e128690e72ae538b8104de /etc
parentcc2630208cc31ac3a19c185036a4b589d125e99a (diff)
downloadpfsense-aa205c3b69bf76b1565fd42dba83c7637212f793.zip
pfsense-aa205c3b69bf76b1565fd42dba83c7637212f793.tar.gz
Rmoeve register_long_arrays from php.ini and from php code the use of HTTP_*_VARS as its deprecated and luckily low use in pfSense to win memory and compativility
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/auth.inc4
-rw-r--r--etc/inc/authgui.inc2
-rw-r--r--etc/inc/xmlrpc_server.inc24
-rwxr-xr-xetc/rc.php_ini_setup1
4 files changed, 18 insertions, 13 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc
index 521656b..c686ff4 100644
--- a/etc/inc/auth.inc
+++ b/etc/inc/auth.inc
@@ -1344,7 +1344,7 @@ function authenticate_user($username, $password, $authcfg = NULL, &$attributes =
}
function session_auth() {
- global $HTTP_SERVER_VARS, $config, $_SESSION, $page;
+ global $config, $_SESSION, $page;
// Handle HTTPS httponly and secure flags
if($config['system']['webgui']['protocol'] == "https") {
@@ -1372,7 +1372,6 @@ function session_auth() {
if(! isset($config['system']['webgui']['quietlogin'])) {
log_auth(sprintf(gettext("Successful login for user '%1\$s' from: %2\$s"), $_POST['usernamefld'], $_SERVER['REMOTE_ADDR']));
}
- $HTTP_SERVER_VARS['AUTH_USER'] = $_SESSION['Username'];
if (isset($_POST['postafterlogin']))
return true;
else {
@@ -1464,7 +1463,6 @@ function session_auth() {
if ($_GET['enable_ajax'])
unset($_SESSION['NO_AJAX']);
- $HTTP_SERVER_VARS['AUTH_USER'] = $_SESSION['Username'];
return true;
}
diff --git a/etc/inc/authgui.inc b/etc/inc/authgui.inc
index 35d51c7..fe9d2ca 100644
--- a/etc/inc/authgui.inc
+++ b/etc/inc/authgui.inc
@@ -51,7 +51,7 @@ if (!session_auth()) {
* We give them access only to the appropriate pages based on
* the user or group privileges.
*/
-$allowedpages = getAllowedPages($HTTP_SERVER_VARS['AUTH_USER']);
+$allowedpages = getAllowedPages($_SESSION['Username']);
/*
* redirect to first allowed page if requesting a wrong url
diff --git a/etc/inc/xmlrpc_server.inc b/etc/inc/xmlrpc_server.inc
index 10b8beb..f4d8a46 100644
--- a/etc/inc/xmlrpc_server.inc
+++ b/etc/inc/xmlrpc_server.inc
@@ -304,6 +304,12 @@ class XML_RPC_Server
/**
+ * The HTTP request data
+ * @null
+ */
+ var $client_data = '';
+
+ /**
* Constructor for the XML_RPC_Server class
*
* @param array $dispMap the dispatch map. An associative array
@@ -328,7 +334,6 @@ class XML_RPC_Server
*/
function XML_RPC_Server($dispMap, $serviceNow = 1, $debug = 0)
{
- global $HTTP_RAW_POST_DATA;
if ($debug) {
$this->debug = 1;
@@ -351,11 +356,11 @@ class XML_RPC_Server
*/
function serializeDebug()
{
- global $XML_RPC_Server_debuginfo, $HTTP_RAW_POST_DATA;
+ global $XML_RPC_Server_debuginfo;
if ($this->debug) {
XML_RPC_Server_debugmsg('vvv POST DATA RECEIVED BY SERVER vvv' . "\n"
- . $HTTP_RAW_POST_DATA
+ . $this->server_payload . $this->client_data
. "\n" . '^^^ END POST DATA ^^^');
}
@@ -446,7 +451,9 @@ class XML_RPC_Server
*/
function createServerPayload()
{
- $r = $this->parseRequest();
+ $this->client_data = file_get_contents("php://input");
+
+ $r = $this->parseRequest($this->client_data);
$this->server_payload = '<?xml version="1.0" encoding="'
. $this->encoding . '"?>' . "\n"
. $this->serializeDebug()
@@ -537,12 +544,13 @@ class XML_RPC_Server
*/
function parseRequest($data = '')
{
- global $XML_RPC_xh, $HTTP_RAW_POST_DATA,
+ global $XML_RPC_xh,
$XML_RPC_err, $XML_RPC_str, $XML_RPC_errxml,
$XML_RPC_defencoding, $XML_RPC_Server_dmap;
if ($data == '') {
- $data = $HTTP_RAW_POST_DATA;
+ $data = file_get_contents("php://input");
+ $this->client_data = $data;
}
$this->encoding = XML_RPC_Message::getEncoding($data);
@@ -653,10 +661,8 @@ class XML_RPC_Server
*/
function echoInput()
{
- global $HTTP_RAW_POST_DATA;
-
$r = new XML_RPC_Response(0);
- $r->xv = new XML_RPC_Value("'Aha said I: '" . $HTTP_RAW_POST_DATA, 'string');
+ $r->xv = new XML_RPC_Value("'Aha said I: '" . $this->client_data, 'string');
print $r->serialize();
}
}
diff --git a/etc/rc.php_ini_setup b/etc/rc.php_ini_setup
index 6cbc517..7da05b4 100755
--- a/etc/rc.php_ini_setup
+++ b/etc/rc.php_ini_setup
@@ -178,6 +178,7 @@ magic_quotes_gpc = Off
max_execution_time = 900
max_input_time = 1800
register_argc_argv = On
+register_long_arrays = Off
file_uploads = On
upload_tmp_dir = ${UPLOADTMPDIR}
upload_max_filesize = 200M
OpenPOWER on IntegriCloud