Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
d9782def
Commit
d9782def
authored
Jul 20, 2015
by
Ad Schellevis
Committed by
Franco Fichtner
Jul 29, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) cleanup requires/includes
parent
07012cc7
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
231 additions
and
260 deletions
+231
-260
auth.inc
src/etc/inc/auth.inc
+3
-4
authgui.inc
src/etc/inc/authgui.inc
+86
-5
captiveportal.inc
src/etc/inc/captiveportal.inc
+0
-1
captiveportal.radius_accounting.inc
src/etc/inc/captiveportal.radius_accounting.inc
+0
-2
captiveportal.radius_authentication.inc
src/etc/inc/captiveportal.radius_authentication.inc
+0
-2
config.inc
src/etc/inc/config.inc
+1
-2
config.lib.inc
src/etc/inc/config.lib.inc
+2
-1
functions.inc
src/etc/inc/functions.inc
+0
-92
gwlb.inc
src/etc/inc/gwlb.inc
+0
-1
legacy_bindings.inc
src/etc/inc/legacy_bindings.inc
+41
-0
miniupnpd.inc
src/etc/inc/miniupnpd.inc
+0
-1
pfsense-utils.inc
src/etc/inc/pfsense-utils.inc
+0
-12
priv.inc
src/etc/inc/priv.inc
+0
-113
util.inc
src/etc/inc/util.inc
+0
-7
rc.carpbackup
src/etc/rc.carpbackup
+0
-1
rc.carpmaster
src/etc/rc.carpmaster
+0
-1
rc.notify_message
src/etc/rc.notify_message
+0
-1
rc.restore_config_backup
src/etc/rc.restore_config_backup
+0
-1
gmirror_status_check.php
src/sbin/gmirror_status_check.php
+0
-1
diag_backup.php
src/www/diag_backup.php
+0
-1
diag_confbak.php
src/www/diag_confbak.php
+0
-1
fbegin.inc
src/www/fbegin.inc
+0
-1
guiconfig.inc
src/www/guiconfig.inc
+98
-5
index.php
src/www/index.php
+0
-1
system_advanced_notifications.php
src/www/system_advanced_notifications.php
+0
-1
system_information.widget.php
src/www/widgets/widgets/system_information.widget.php
+0
-2
No files found.
src/etc/inc/auth.inc
View file @
d9782def
...
...
@@ -41,11 +41,13 @@ require_once("globals.inc");
/* include globals from notices.inc /utility/XML parser files */
require_once
(
'config.lib.inc'
);
require_once
(
"notices.inc"
);
require_once
(
"util.inc"
);
require_once
(
"IPv6.inc"
);
require_once
(
"xmlparse.inc"
);
require_once
(
"crypt.inc"
);
require_once
(
"certs.inc"
);
require_once
(
"radius.inc"
);
$config
=
parse_config
();
//
...
...
@@ -654,7 +656,6 @@ function ldap_test_connection($authcfg)
function
ldap_setup_caenv
(
$authcfg
)
{
require_once
(
"certs.inc"
);
unset
(
$caref
);
...
...
@@ -1135,8 +1136,6 @@ function radius_backed($username, $passwd, $authcfg, &$attributes = array())
global
$config
;
$ret
=
false
;
require_once
(
"radius.inc"
);
$rauth
=
new
Auth_RADIUS_PAP
(
$username
,
$passwd
);
if
(
$authcfg
)
{
$radiusservers
=
array
();
...
...
src/etc/inc/authgui.inc
View file @
d9782def
...
...
@@ -5,6 +5,7 @@
Copyright (C) 2005-2006 Bill Marquette <bill.marquette@gmail.com>
Copyright (C) 2006 Paul Taylor <paultaylor@winn-dixie.com>.
Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
(from priv.inc) Copyright (C) 2008 Shrew Soft Inc
All rights reserved.
Redistribution and use in source and binary forms, with or without
...
...
@@ -29,9 +30,91 @@
POSSIBILITY OF SUCH DAMAGE.
*/
include_once
(
"auth.inc"
);
include_once
(
"priv.inc"
);
require_once
(
"auth.inc"
);
require_once
(
"filter.inc"
);
require_once
(
"functions.inc"
);
require_once
(
"globals.inc"
);
// provided via legacy_bindings.inc
global
$priv_list
;
$acl
=
new
OPNsense\Core\ACL
();
$priv_list
=
$acl
->
getLegacyPrivList
();
function
cmp_page_matches
(
$page
,
&
$matches
,
$fullwc
=
true
)
{
if
(
!
is_array
(
$matches
))
return
false
;
/* skip any leading fwdslash */
$test
=
strpos
(
$page
,
"/"
);
if
(
$test
!==
false
&&
$test
==
0
)
$page
=
substr
(
$page
,
1
);
/* look for a match */
foreach
(
$matches
as
$match
)
{
/* possibly ignore full wildcard match */
if
(
!
$fullwc
&&
!
strcmp
(
$match
,
"*"
))
continue
;
/* compare exact or wildcard match */
$match
=
str_replace
(
array
(
"."
,
"*"
,
"?"
),
array
(
"\."
,
".*"
,
"\?"
),
$match
);
$result
=
preg_match
(
"@^/
{
$match
}
$@"
,
"/
{
$page
}
"
);
if
(
$result
)
return
true
;
}
return
false
;
}
function
isAllowed
(
$username
,
$page
)
{
global
$_SESSION
;
if
(
!
isset
(
$username
))
{
return
false
;
}
/* root access check */
$user
=
getUserEntry
(
$username
);
if
(
isset
(
$user
))
{
if
(
isset
(
$user
[
'uid'
]))
{
if
(
$user
[
'uid'
]
==
0
)
{
return
true
;
}
}
}
/* user privelege access check */
if
(
cmp_page_matches
(
$page
,
$_SESSION
[
'page-match'
]))
{
return
true
;
}
return
false
;
}
function
isAllowedPage
(
$page
)
{
if
(
!
isset
(
$_SESSION
[
'Username'
]))
{
return
false
;
}
/* root access check */
$user
=
getUserEntry
(
$_SESSION
[
'Username'
]);
if
(
isset
(
$user
))
{
if
(
isset
(
$user
[
'uid'
]))
{
if
(
$user
[
'uid'
]
==
0
)
{
return
true
;
}
}
}
/* user privelege access check */
return
cmp_page_matches
(
$page
,
$_SESSION
[
'page-match'
]);
}
function
getPrivPages
(
&
$entry
,
&
$allowed_pages
)
{
global
$priv_list
;
...
...
@@ -233,8 +316,7 @@ $allowedpages = getAllowedPages($_SESSION['Username']);
if
(
!
isAllowedPage
(
$_SERVER
[
'REQUEST_URI'
]))
{
if
(
count
(
$allowedpages
)
>
0
)
{
$page
=
str_replace
(
'*'
,
''
,
$allowedpages
[
0
]);
require_once
(
"functions.inc"
);
redirectHeader
(
"/
{
$page
}
"
);
header
(
"Location: /
{
$page
}
"
);
$username
=
empty
(
$_SESSION
[
"Username"
])
?
"(system)"
:
$_SESSION
[
'Username'
];
if
(
!
empty
(
$_SERVER
[
'REMOTE_ADDR'
]))
{
...
...
@@ -306,7 +388,6 @@ function display_error_form($http_code, $desc)
function
display_login_form
()
{
require_once
(
"globals.inc"
);
global
$config
,
$g
;
$g
[
'theme'
]
=
get_current_theme
();
...
...
src/etc/inc/captiveportal.inc
View file @
d9782def
...
...
@@ -42,7 +42,6 @@ require_once("radius.inc");
require_once
(
"captiveportal.radius_accounting.inc"
);
require_once
(
"captiveportal.radius_authentication.inc"
);
require_once
(
"voucher.inc"
);
require_once
(
"script/load_phalcon.php"
);
function
get_include_contents
(
$filename
)
{
if
(
is_file
(
$filename
))
{
...
...
src/etc/inc/captiveportal.radius_accounting.inc
View file @
d9782def
...
...
@@ -61,8 +61,6 @@ function RADIUS_ACCOUNTING_START($ruleno, $username, $sessionid, $radiusservers,
break
;
default
:
if
(
!
function_exists
(
'getNasIP'
))
require_once
(
"captiveportal.inc"
);
$calledstationid
=
getNasIP
();
$callingstationid
=
$clientmac
;
break
;
...
...
src/etc/inc/captiveportal.radius_authentication.inc
View file @
d9782def
...
...
@@ -62,8 +62,6 @@ function RADIUS_AUTHENTICATION($username,$password,$radiusservers,$clientip,$cli
$callingstationid
=
$clientip
;
break
;
default
:
if
(
!
function_exists
(
'getNasIP'
))
require_once
(
"captiveportal.inc"
);
$calledstationid
=
getNasIP
();
$callingstationid
=
$clientmac
;
break
;
...
...
src/etc/inc/config.inc
View file @
d9782def
...
...
@@ -39,10 +39,9 @@ if(php_uname("m") == "amd64") {
}
/* include globals from notices.inc /utility/XML parser files */
require_once
(
"notices.inc"
);
require_once
(
'config.lib.inc'
);
require_once
(
"util.inc"
);
require_once
(
"IPv6.inc"
);
require_once
(
'config.lib.inc'
);
require_once
(
"xmlparse.inc"
);
require_once
(
"crypt.inc"
);
require_once
(
"globals.inc"
);
...
...
src/etc/inc/config.lib.inc
View file @
d9782def
...
...
@@ -33,7 +33,8 @@ require_once("globals.inc");
require_once
(
"xmlparse.inc"
);
require_once
(
"crypt.inc"
);
require_once
(
"util.inc"
);
require_once
(
"script/load_phalcon.php"
);
require_once
(
"notices.inc"
);
require_once
(
"legacy_bindings.inc"
);
/* make a global alias table (for faster lookups) */
function
alias_make_table
(
$config
)
...
...
src/etc/inc/functions.inc
View file @
d9782def
...
...
@@ -27,98 +27,6 @@
POSSIBILITY OF SUCH DAMAGE.
*/
/* BEGIN compatibility goo with HEAD */
if
(
!
function_exists
(
'gettext'
))
{
function
gettext
(
$text
)
{
return
$text
;
}
}
if
(
!
function_exists
(
'redirectHeader'
))
{
function
redirectHeader
(
$text
)
{
global
$_SERVER
;
if
(
isAjax
())
{
if
(
$_SERVER
[
'HTTPS'
]
==
'on'
)
{
$protocol
=
'https'
;
}
else
{
$protocol
=
'http'
;
}
$port
=
''
;
if
(
!
(
$_SERVER
[
'SERVER_PORT'
]
==
'80'
&&
$protocol
==
'http'
)
&&
!
(
$_SERVER
[
'SERVER_PORT'
]
==
'443'
&&
$protocol
==
'https'
)
)
{
$port
=
":
{
$_SERVER
[
'SERVER_PORT'
]
}
"
;
}
echo
"
\n
document.location.href = '
{
$protocol
}
://
{
$_SERVER
[
'SERVER_NAME'
]
}{
$port
}
/
{
$text
}
';
\n
"
;
}
else
{
header
(
"Location:
$text
"
);
}
}
}
/* END compatibility goo with HEAD */
function
get_menu_messages
()
{
global
$config
;
$menu_messages
=
''
;
if
(
are_notices_pending
())
{
$notices
=
get_notices
();
$requests
=
array
();
## Get Query Arguments from URL ###
foreach
(
$_REQUEST
as
$key
=>
$value
)
{
if
(
$key
!=
"PHPSESSID"
)
{
$requests
[]
=
$key
.
'='
.
$value
;
}
}
if
(
is_array
(
$requests
))
{
$request_string
=
implode
(
"&"
,
$requests
);
}
if
(
is_array
(
$notices
))
{
$notice_msgs
=
"<ul class=
\"
dropdown-menu
\"
role=
\"
menu
\"
>"
;
$notice_msgs
.=
"<li><a href=
\"
#
\"
onclick=
\"
notice_action('acknowledge','all');
\"
>"
.
gettext
(
"Acknowledge All Notices"
)
.
"</a></li><li class=
\"
divider
\"
></li>"
;
foreach
(
$notices
as
$key
=>
$value
)
{
$date
=
date
(
"m-d-y H:i:s"
,
$key
);
$noticemsg
=
(
$value
[
'notice'
]
!=
""
?
$value
[
'notice'
]
:
$value
[
'id'
]);
$noticemsg
=
preg_replace
(
"/(
\"
|\'|
\n
|<.?\w+>)/i"
,
""
,
$noticemsg
);
$alert_action
=
"onclick=
\"
notice_action('acknowledge','
{
$key
}
'); jQuery(this).parent().parent().remove();
\"
"
;
$notice_msgs
.=
"<li><a href=
\"
#
\"
{
$alert_action
}
>
{
$date
}
[ "
.
htmlspecialchars
(
$noticemsg
)
.
"]</a></li>"
;
}
$notice_msgs
.=
"</ul>"
;
if
(
count
(
$notices
)
==
1
)
{
$msg
=
sprintf
(
"%1$02d"
,
count
(
$notices
))
.
" "
.
gettext
(
"unread notice"
);
}
else
{
$msg
=
sprintf
(
"%1$02d"
,
count
(
$notices
))
.
" "
.
gettext
(
"unread notices"
);
}
$menu_messages
.=
"<a href=
\"
/
\"
class=
\"
dropdown-toggle
\"
data-toggle=
\"
dropdown
\"
role=
\"
button
\"
aria-expanded=
\"
false
\"
><span class=
\"
text-primary
\"
>
{
$msg
}
</span><span class=
\"
caret text-primary
\"
></span></a>
{
$notice_msgs
}
\n
"
;
}
}
else
{
$menu_messages
.=
sprintf
(
'<a href="#">%s@%s.%s</a>'
,
$_SESSION
[
'Username'
],
$config
[
'system'
][
'hostname'
],
$config
[
'system'
][
'domain'
]
);
}
return
(
$menu_messages
);
}
/* include all configuration functions */
require_once
(
"interfaces.inc"
);
require_once
(
"gwlb.inc"
);
...
...
src/etc/inc/gwlb.inc
View file @
d9782def
...
...
@@ -27,7 +27,6 @@
POSSIBILITY OF SUCH DAMAGE.
*/
require_once
(
"config.inc"
);
require_once
(
"rrd.inc"
);
/* Returns an array of default values used for apinger.conf */
...
...
src/etc/inc/legacy_bindings.inc
0 → 100644
View file @
d9782def
<?php
/**
* Copyright (C) 2015 Deciso B.V.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
require_once
(
"script/load_phalcon.php"
);
/**
* wrap config run
*/
function
configd_run
(
$cmd
,
$detach
=
false
)
{
require_once
(
"script/load_phalcon.php"
);
$backend
=
new
OPNsense\Core\Backend
();
return
$backend
->
configdRun
(
"
{
$cmd
}
"
,
$detach
);
}
src/etc/inc/miniupnpd.inc
View file @
d9782def
<?php
require_once
(
"util.inc"
);
require_once
(
"config.inc"
);
require_once
(
"functions.inc"
);
/* MiniUPnPd */
...
...
src/etc/inc/pfsense-utils.inc
View file @
d9782def
...
...
@@ -138,18 +138,6 @@ function setup_polling()
}
}
function
set_language
(
$lang
)
{
$lang_encoding
=
$lang
.
'.UTF-8'
;
$textdomain
=
'OPNsense'
;
putenv
(
'LANG='
.
$lang_encoding
);
setlocale
(
LC_ALL
,
$lang_encoding
);
textdomain
(
$textdomain
);
bindtextdomain
(
$textdomain
,
'/usr/local/share/locale'
);
bind_textdomain_codeset
(
$textdomain
,
$lang_encoding
);
}
/****f* legacy/setup_microcode
* NAME
* enumerates all interfaces and calls enable_hardware_offloading which
...
...
src/etc/inc/priv.inc
deleted
100644 → 0
View file @
07012cc7
<?php
/*
Copyright (C) 2008 Shrew Soft Inc
Copyright (C) 2007-2008 Scott Ullrich <sullrich@gmail.com>
Copyright (C) 2005-2006 Bill Marquette <bill.marquette@gmail.com>
Copyright (C) 2006 Paul Taylor <paultaylor@winn-dixie.com>
Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
require_once
(
"script/load_phalcon.php"
);
global
$priv_list
;
$acl
=
new
OPNsense\Core\ACL
();
$priv_list
=
$acl
->
getLegacyPrivList
();
function
cmp_page_matches
(
$page
,
&
$matches
,
$fullwc
=
true
)
{
if
(
!
is_array
(
$matches
))
return
false
;
/* skip any leading fwdslash */
$test
=
strpos
(
$page
,
"/"
);
if
(
$test
!==
false
&&
$test
==
0
)
$page
=
substr
(
$page
,
1
);
/* look for a match */
foreach
(
$matches
as
$match
)
{
/* possibly ignore full wildcard match */
if
(
!
$fullwc
&&
!
strcmp
(
$match
,
"*"
))
continue
;
/* compare exact or wildcard match */
$match
=
str_replace
(
array
(
"."
,
"*"
,
"?"
),
array
(
"\."
,
".*"
,
"\?"
),
$match
);
$result
=
preg_match
(
"@^/
{
$match
}
$@"
,
"/
{
$page
}
"
);
if
(
$result
)
return
true
;
}
return
false
;
}
function
isAllowed
(
$username
,
$page
)
{
global
$_SESSION
;
if
(
!
isset
(
$username
))
{
return
false
;
}
/* root access check */
$user
=
getUserEntry
(
$username
);
if
(
isset
(
$user
))
{
if
(
isset
(
$user
[
'uid'
]))
{
if
(
$user
[
'uid'
]
==
0
)
{
return
true
;
}
}
}
/* user privelege access check */
if
(
cmp_page_matches
(
$page
,
$_SESSION
[
'page-match'
]))
{
return
true
;
}
return
false
;
}
function
isAllowedPage
(
$page
)
{
if
(
!
isset
(
$_SESSION
[
'Username'
]))
{
return
false
;
}
/* root access check */
$user
=
getUserEntry
(
$_SESSION
[
'Username'
]);
if
(
isset
(
$user
))
{
if
(
isset
(
$user
[
'uid'
]))
{
if
(
$user
[
'uid'
]
==
0
)
{
return
true
;
}
}
}
/* user privelege access check */
return
cmp_page_matches
(
$page
,
$_SESSION
[
'page-match'
]);
}
?>
src/etc/inc/util.inc
View file @
d9782def
...
...
@@ -112,13 +112,6 @@ function unlock($cfglckkey = 0)
fclose
(
$cfglckkey
);
}
function
configd_run
(
$cmd
,
$detach
=
false
)
{
require_once
(
"script/load_phalcon.php"
);
$backend
=
new
OPNsense\Core\Backend
();
return
$backend
->
configdRun
(
"
{
$cmd
}
"
,
$detach
);
}
function
is_module_loaded
(
$module_name
)
{
$module_name
=
str_replace
(
".ko"
,
""
,
$module_name
);
$running
=
0
;
...
...
src/etc/rc.carpbackup
View file @
d9782def
...
...
@@ -29,7 +29,6 @@
require_once
(
"functions.inc"
);
require_once
(
"config.inc"
);
require_once
(
"notices.inc"
);
require_once
(
"openvpn.inc"
);
require_once
(
"interfaces.inc"
);
...
...
src/etc/rc.carpmaster
View file @
d9782def
...
...
@@ -29,7 +29,6 @@
require_once
(
"functions.inc"
);
require_once
(
"config.inc"
);
require_once
(
"notices.inc"
);
require_once
(
"openvpn.inc"
);
require_once
(
"interfaces.inc"
);
...
...
src/etc/rc.notify_message
View file @
d9782def
...
...
@@ -29,7 +29,6 @@
require_once
(
"config.inc"
);
require_once
(
"functions.inc"
);
require_once
(
"notices.inc"
);
$arguments
=
getopt
(
"egm:"
);
...
...
src/etc/rc.restore_config_backup
View file @
d9782def
...
...
@@ -2,7 +2,6 @@
<?php
require_once
(
'config.inc'
);
require_once
(
"script/load_phalcon.php"
);
$cnf
=
OPNsense\Core\Config
::
getInstance
();
$confvers
=
$cnf
->
getBackups
(
true
);
...
...
src/sbin/gmirror_status_check.php
View file @
d9782def
...
...
@@ -27,7 +27,6 @@
*/
require_once
(
"config.inc"
);
require_once
(
"notices.inc"
);
require_once
(
"globals.inc"
);
require_once
(
"gmirror.inc"
);
...
...
src/www/diag_backup.php
View file @
d9782def
...
...
@@ -27,7 +27,6 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
require_once
(
"script/load_phalcon.php"
);
/* Allow additional execution time 0 = no limit. */
ini_set
(
'max_execution_time'
,
'0'
);
...
...
src/www/diag_confbak.php
View file @
d9782def
...
...
@@ -30,7 +30,6 @@
require_once
(
"config.lib.inc"
);
require_once
(
"guiconfig.inc"
);
require_once
(
"script/load_phalcon.php"
);
// list backups
$cnf
=
OPNsense\Core\Config
::
getInstance
();
...
...
src/www/fbegin.inc
View file @
d9782def
...
...
@@ -32,7 +32,6 @@ require_once("globals.inc");
require_once
(
"functions.inc"
);
require_once
(
"shortcuts.inc"
);
require_once
(
"services.inc"
);
require_once
(
"script/load_phalcon.php"
);
function
find_service_by_name
(
$name
)
{
$services
=
get_services
();
...
...
src/www/guiconfig.inc
View file @
d9782def
...
...
@@ -27,7 +27,9 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
require_once
(
"config.inc"
);
require_once
(
"csrf/csrf-magic.php"
);
/* Include authentication routines */
/* THIS MUST BE ABOVE ALL OTHER CODE */
if
(
isset
(
$nocsrf
)
&&
!
$nocsrf
)
{
...
...
@@ -37,10 +39,22 @@ function csrf_startup() {
$timeout_minutes
=
isset
(
$config
[
'system'
][
'webgui'
][
'session_timeout'
])
?
$config
[
'system'
][
'webgui'
][
'session_timeout'
]
:
240
;
csrf_conf
(
'expires'
,
$timeout_minutes
*
60
);
}
require_once
(
"csrf/csrf-magic.php"
);
}
function
set_language
(
$lang
)
{
$lang_encoding
=
$lang
.
'.UTF-8'
;
$textdomain
=
'OPNsense'
;
putenv
(
'LANG='
.
$lang_encoding
);
setlocale
(
LC_ALL
,
$lang_encoding
);
textdomain
(
$textdomain
);
bindtextdomain
(
$textdomain
,
'/usr/local/share/locale'
);
bind_textdomain_codeset
(
$textdomain
,
$lang_encoding
);
}
/* make sure nothing is cached */
if
(
isset
(
$omit_nocacheheaders
)
&&
$omit_nocacheheaders
)
{
header
(
"Expires: 0"
);
...
...
@@ -52,9 +66,6 @@ if (isset($omit_nocacheheaders) && $omit_nocacheheaders) {
header
(
"X-Frame-Options: SAMEORIGIN"
);
/* parse the configuration and include all configuration functions */
require_once
(
"functions.inc"
);
$g
[
'theme'
]
=
get_current_theme
();
/* Set the default interface language */
...
...
@@ -635,3 +646,85 @@ function get_crash_report($pedantic = false)
return
$savemsg
;
}
function
redirectHeader
(
$text
)
{
global
$_SERVER
;
if
(
isAjax
())
{
if
(
$_SERVER
[
'HTTPS'
]
==
'on'
)
{
$protocol
=
'https'
;
}
else
{
$protocol
=
'http'
;
}
$port
=
''
;
if
(
!
(
$_SERVER
[
'SERVER_PORT'
]
==
'80'
&&
$protocol
==
'http'
)
&&
!
(
$_SERVER
[
'SERVER_PORT'
]
==
'443'
&&
$protocol
==
'https'
)
)
{
$port
=
":
{
$_SERVER
[
'SERVER_PORT'
]
}
"
;
}
echo
"
\n
document.location.href = '
{
$protocol
}
://
{
$_SERVER
[
'SERVER_NAME'
]
}{
$port
}
/
{
$text
}
';
\n
"
;
}
else
{
header
(
"Location:
$text
"
);
}
}
function
get_menu_messages
()
{
global
$config
;
$menu_messages
=
''
;
if
(
are_notices_pending
())
{
$notices
=
get_notices
();
$requests
=
array
();
## Get Query Arguments from URL ###
foreach
(
$_REQUEST
as
$key
=>
$value
)
{
if
(
$key
!=
"PHPSESSID"
)
{
$requests
[]
=
$key
.
'='
.
$value
;
}
}
if
(
is_array
(
$requests
))
{
$request_string
=
implode
(
"&"
,
$requests
);
}
if
(
is_array
(
$notices
))
{
$notice_msgs
=
"<ul class=
\"
dropdown-menu
\"
role=
\"
menu
\"
>"
;
$notice_msgs
.=
"<li><a href=
\"
#
\"
onclick=
\"
notice_action('acknowledge','all');
\"
>"
.
gettext
(
"Acknowledge All Notices"
)
.
"</a></li><li class=
\"
divider
\"
></li>"
;
foreach
(
$notices
as
$key
=>
$value
)
{
$date
=
date
(
"m-d-y H:i:s"
,
$key
);
$noticemsg
=
(
$value
[
'notice'
]
!=
""
?
$value
[
'notice'
]
:
$value
[
'id'
]);
$noticemsg
=
preg_replace
(
"/(
\"
|\'|
\n
|<.?\w+>)/i"
,
""
,
$noticemsg
);
$alert_action
=
"onclick=
\"
notice_action('acknowledge','
{
$key
}
'); jQuery(this).parent().parent().remove();
\"
"
;
$notice_msgs
.=
"<li><a href=
\"
#
\"
{
$alert_action
}
>
{
$date
}
[ "
.
htmlspecialchars
(
$noticemsg
)
.
"]</a></li>"
;
}
$notice_msgs
.=
"</ul>"
;
if
(
count
(
$notices
)
==
1
)
{
$msg
=
sprintf
(
"%1$02d"
,
count
(
$notices
))
.
" "
.
gettext
(
"unread notice"
);
}
else
{
$msg
=
sprintf
(
"%1$02d"
,
count
(
$notices
))
.
" "
.
gettext
(
"unread notices"
);
}
$menu_messages
.=
"<a href=
\"
/
\"
class=
\"
dropdown-toggle
\"
data-toggle=
\"
dropdown
\"
role=
\"
button
\"
aria-expanded=
\"
false
\"
><span class=
\"
text-primary
\"
>
{
$msg
}
</span><span class=
\"
caret text-primary
\"
></span></a>
{
$notice_msgs
}
\n
"
;
}
}
else
{
$menu_messages
.=
sprintf
(
'<a href="#">%s@%s.%s</a>'
,
$_SESSION
[
'Username'
],
$config
[
'system'
][
'hostname'
],
$config
[
'system'
][
'domain'
]
);
}
return
(
$menu_messages
);
}
src/www/index.php
View file @
d9782def
...
...
@@ -37,7 +37,6 @@ ob_start(null, "1000");
## Load Essential Includes
require_once
(
'guiconfig.inc'
);
require_once
(
'notices.inc'
);
if
(
isset
(
$_REQUEST
[
'closenotice'
]))
{
close_notice
(
$_REQUEST
[
'closenotice'
]);
...
...
src/www/system_advanced_notifications.php
View file @
d9782def
...
...
@@ -27,7 +27,6 @@
*/
require_once
(
"guiconfig.inc"
);
require_once
(
"notices.inc"
);
// Growl
$pconfig
[
'disable_growl'
]
=
isset
(
$config
[
'notifications'
][
'growl'
][
'disable'
]);
...
...
src/www/widgets/widgets/system_information.widget.php
View file @
d9782def
...
...
@@ -31,9 +31,7 @@
require_once
(
"functions.inc"
);
require_once
(
"guiconfig.inc"
);
require_once
(
'notices.inc'
);
include_once
(
"includes/functions.inc.php"
);
require_once
(
"script/load_phalcon.php"
);
if
(
isset
(
$_REQUEST
[
'getupdatestatus'
]))
{
$pkg_json
=
trim
(
configd_run
(
'firmware pkgstatus'
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment