Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
123c6368
Commit
123c6368
authored
Nov 06, 2013
by
Mike Hibler
Browse files
More HTTP_*_VARS cleanup.
parent
d1bb0a9c
Changes
3
Hide whitespace changes
Inline
Side-by-side
www/approveuser.php3
View file @
123c6368
<?php
#
# Copyright (c) 2000-20
03, 2005, 2006, 2007, 2010
University of Utah and the Flux Group.
# Copyright (c) 2000-20
13
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -60,14 +60,14 @@ ignore_user_abort(1);
#
#
# copy of
HTTP
_POST
_VARS
we use to do actual work.
# copy of _POST we use to do actual work.
# this is so I can insert an implicit default-group approval
# while iterating over
HTTP
_POST
_VARS.
# while iterating over _POST
.
# A bit kludgey, indeed.
#
$POST_VARS_COPY
=
array
();
while
(
list
(
$header
,
$value
)
=
each
(
$
HTTP
_POST
_VARS
))
{
while
(
list
(
$header
,
$value
)
=
each
(
$_POST
))
{
#echo "$header: $value<br>\n";
$POST_VARS_COPY
[
$header
]
=
$value
;
...
...
@@ -102,7 +102,7 @@ while (list ($header, $value) = each ($HTTP_POST_VARS)) {
$foo
=
"U${user}
\$\$
trust-
$project
/
$group
"
;
#echo "$foo<br>\n";
$newtrust
=
$
HTTP
_POST
_VARS
[
$foo
];
$newtrust
=
$_POST
[
$foo
];
if
(
!
$newtrust
||
strcmp
(
$newtrust
,
""
)
==
0
)
{
TBERROR
(
"Parse error finding trust in approveuser.php3"
,
1
);
}
...
...
@@ -193,9 +193,8 @@ while (list ($header, $value) = each ($HTTP_POST_VARS)) {
#
$foo
=
"
$user
\$\$
approval-
$project
/
$gid
"
;
if
(
!
isset
(
$HTTP_POST_VARS
[
$foo
])
||
(
$HTTP_POST_VARS
[
$foo
]
!=
"deny"
&&
$HTTP_POST_VARS
[
$foo
]
!=
"nuke"
))
{
if
(
!
isset
(
$_POST
[
$foo
])
||
(
$_POST
[
$foo
]
!=
"deny"
&&
$_POST
[
$foo
]
!=
"nuke"
))
{
USERERROR
(
"If you wish to deny/nuke user
$target_uid
in "
.
"project
$project
then you must deny/nuke in all "
.
"of the subgroups
$target_uid
is attempting to "
.
...
...
@@ -227,8 +226,7 @@ while (list ($header, $value) = each ($HTTP_POST_VARS)) {
#
$foo
=
"U${user}
\$\$
approval-
$project
/
$project
"
;
$bar
=
"U${user}
\$\$
trust-
$project
/
$project
"
;
$default_approval
=
(
isset
(
$HTTP_POST_VARS
[
$foo
])
?
$HTTP_POST_VARS
[
$foo
]
:
""
);
$default_approval
=
(
isset
(
$_POST
[
$foo
])
?
$_POST
[
$foo
]
:
""
);
if
(
$default_approval
==
""
)
{
# Implicit group approval as user.
...
...
@@ -243,8 +241,8 @@ while (list ($header, $value) = each ($HTTP_POST_VARS)) {
# 3. For the while loop which does the actual work
$POST_VARS_COPY
[
$foo
]
=
$approval
;
$
HTTP
_POST
_VARS
[
$foo
]
=
$approval
;
$
HTTP
_POST
_VARS
[
$bar
]
=
"user"
;
$_POST
[
$foo
]
=
$approval
;
$_POST
[
$bar
]
=
"user"
;
}
if
(
strcmp
(
$approval
,
"approve"
)
==
0
&&
strcmp
(
$default_approval
,
"approve"
))
{
...
...
@@ -305,7 +303,7 @@ while (list ($user, $value) = each ($projectchecks)) {
reset
(
$value
);
}
reset
(
$
HTTP
_POST
_VARS
);
reset
(
$_POST
);
STARTBUSY
(
"Approving Users"
);
...
...
@@ -331,7 +329,7 @@ while (list ($header, $value) = each ($POST_VARS_COPY)) {
# Corresponding trust value.
#
$foo
=
"U${user}
\$\$
trust-
$project
/
$group
"
;
$newtrust
=
$
HTTP
_POST
_VARS
[
$foo
];
$newtrust
=
$_POST
[
$foo
];
#
# Get the current status for the user, which we might need to change.
...
...
www/newnode_edit.php3
View file @
123c6368
<?PHP
#
# Copyright (c) 2003-201
2
University of Utah and the Flux Group.
# Copyright (c) 2003-201
3
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -77,16 +77,16 @@ if (isset($node_id)) {
#
# Same for interface update information
#
foreach
(
$
HTTP_GET_VARS
as
$key
=>
$value
)
{
foreach
(
$
_GET
as
$key
=>
$value
)
{
if
(
preg_match
(
"/iface(\d+)_mac/"
,
$key
,
$matches
))
{
$card
=
$matches
[
1
];
$mac
=
addslashes
(
$
HTTP_GET_VARS
[
"iface${card}_mac"
]);
$type
=
addslashes
(
$
HTTP_GET_VARS
[
"iface${card}_type"
]);
$switch_id
=
addslashes
(
$
HTTP_GET_VARS
[
"iface${card}_switch_id"
]);
$switch_card
=
addslashes
(
$
HTTP_GET_VARS
[
"iface${card}_switch_card"
]);
$switch_port
=
addslashes
(
$
HTTP_GET_VARS
[
"iface${card}_switch_port"
]);
$cable
=
addslashes
(
$
HTTP_GET_VARS
[
"iface${card}_cable"
]);
$len
=
addslashes
(
$
HTTP_GET_VARS
[
"iface${card}_len"
]);
$mac
=
addslashes
(
$
_GET
[
"iface${card}_mac"
]);
$type
=
addslashes
(
$
_GET
[
"iface${card}_type"
]);
$switch_id
=
addslashes
(
$
_GET
[
"iface${card}_switch_id"
]);
$switch_card
=
addslashes
(
$
_GET
[
"iface${card}_switch_card"
]);
$switch_port
=
addslashes
(
$
_GET
[
"iface${card}_switch_port"
]);
$cable
=
addslashes
(
$
_GET
[
"iface${card}_cable"
]);
$len
=
addslashes
(
$
_GET
[
"iface${card}_len"
]);
DBQueryFatal
(
"UPDATE new_interfaces SET mac='
$mac
', "
.
"interface_type='
$type
', switch_id='
$switch_id
', "
.
"switch_card='
$switch_card
', switch_port='
$switch_port
', "
.
...
...
www/newnodecheckin.php
View file @
123c6368
<?php
#
# Copyright (c) 2003
, 2005, 2007
University of Utah and the Flux Group.
# Copyright (c) 2003
-2013
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -55,7 +55,7 @@ $tmpIP = getenv("REMOTE_ADDR");
# Find all interfaces
#
$interfaces
=
array
();
foreach
(
$
HTTP_GET_VARS
as
$key
=>
$value
)
{
foreach
(
$
_GET
as
$key
=>
$value
)
{
if
(
preg_match
(
"/iface(name|mac|driver)(\d+)/"
,
$key
,
$matches
))
{
$vartype
=
$matches
[
1
];
$ifacenum
=
$matches
[
2
];
...
...
Write
Preview
Supports
Markdown
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