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
9577ec16
Commit
9577ec16
authored
Jun 22, 2010
by
Mike Hibler
Browse files
More PHP5 changes.
parent
53fc7653
Changes
7
Hide whitespace changes
Inline
Side-by-side
www/beginexp_form.php3
View file @
9577ec16
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2007
, 2010
University of Utah and the Flux Group.
# All rights reserved.
#
...
...
@@ -35,12 +35,12 @@ function INITFORM($formfields, $projlist)
# this is to have another page for netbuild that does some magic and
# redirects the browser to this page.
#
if
(
isset
(
$nsref
)
&&
$nsref
!=
""
&&
e
reg
(
"
^[0-9]+$
"
,
$nsref
))
if
(
isset
(
$nsref
)
&&
$nsref
!=
""
&&
p
reg
_match
(
'/
^[0-9]+$
/'
,
$nsref
))
$defaults
[
"nsref"
]
=
$nsref
;
else
unset
(
$nsref
);
if
(
isset
(
$guid
)
&&
$guid
!=
""
&&
e
reg
(
"
^[0-9]+$
"
,
$guid
))
if
(
isset
(
$guid
)
&&
$guid
!=
""
&&
p
reg
_match
(
'/
^[0-9]+$
/'
,
$guid
))
$defaults
[
"guid"
]
=
$guid
;
else
unset
(
$guid
);
...
...
www/buildui/nssave.php3
View file @
9577ec16
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-200
7
University of Utah and the Flux Group.
# Copyright (c) 2000-20
1
0 University of Utah and the Flux Group.
# All rights reserved.
#
...
...
@@ -21,7 +21,7 @@ $optargs = OptionalPageArguments("guid", PAGEARG_INTEGER,
#
# Only known and logged in users.
#
if
(
isset
(
$guid
)
&&
e
reg
(
"
^[0-9]+$
"
,
$guid
))
{
if
(
isset
(
$guid
)
&&
p
reg
_match
(
'/
^[0-9]+$
/'
,
$guid
))
{
$uid
=
$guid
;
}
else
{
...
...
@@ -38,7 +38,7 @@ if (!isset($nsdata)) {
USERERROR
(
"Need to send NSFILE!"
,
1
);
}
if
(
!
isset
(
$nsref
)
||
!
e
reg
(
"
^[0-9]+$
"
,
$nsref
))
{
if
(
!
isset
(
$nsref
)
||
!
p
reg
_match
(
'/
^[0-9]+$
/'
,
$nsref
))
{
USERERROR
(
"Need to send valid NSREF!"
,
1
);
}
...
...
www/cdromcheckin.php3
View file @
9577ec16
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-200
3, 2007
University of Utah and the Flux Group.
# Copyright (c) 2000-20
1
0 University of Utah and the Flux Group.
# All rights reserved.
#
require
(
"defs.php3"
);
...
...
@@ -98,7 +98,7 @@ if ((!isset($cdkey) || !strcmp($cdkey, ""))) {
return
;
}
if
(
!
e
reg
(
"
[0-9a-zA-Z]+
"
,
$cdkey
))
{
if
(
!
p
reg
_match
(
'/
[0-9a-zA-Z]+
/'
,
$cdkey
))
{
SPITSTATUS
(
CDROMSTATUS_INVALIDARGS
);
return
;
}
...
...
@@ -157,14 +157,14 @@ if ((!isset($privkey) || !strcmp($privkey, "")) ||
return
;
}
if
(
!
e
reg
(
"
[0-9a-zA-Z ]+
"
,
$privkey
)
||
!
e
reg
(
"
[0-9\.]+
"
,
$IP
))
{
if
(
!
p
reg
_match
(
'/
[0-9a-zA-Z ]+
/'
,
$privkey
)
||
!
p
reg
_match
(
'/
[0-9\.]+
/'
,
$IP
))
{
SPITSTATUS
(
CDROMSTATUS_INVALIDARGS
);
return
;
}
if
(
isset
(
$wahostname
)
&&
!
e
reg
(
"
[-_0-9a-zA-Z\.]+
"
,
$wahostname
))
{
!
p
reg
_match
(
'/
[-_0-9a-zA-Z\.]+
/'
,
$wahostname
))
{
SPITSTATUS
(
CDROMSTATUS_INVALIDARGS
);
return
;
}
...
...
@@ -183,7 +183,7 @@ if (isset($wahostname)) {
}
if
(
isset
(
$roottag
)
&&
!
e
reg
(
"
[0-9a-zA-Z]+
"
,
$roottag
))
{
!
p
reg
_match
(
'/
[0-9a-zA-Z]+
/'
,
$roottag
))
{
SPITSTATUS
(
CDROMSTATUS_INVALIDARGS
);
return
;
}
...
...
www/defs.php3.in
View file @
9577ec16
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-200
9
University of Utah and the Flux Group.
# Copyright (c) 2000-20
1
0 University of Utah and the Flux Group.
# All rights reserved.
#
# Lets emulate register_globals=off for a while.
...
...
@@ -532,12 +532,12 @@ function VALIDUSERPATH($path, $uid="", $pid="", $gid="", $eid="")
# No ids specified, just make sure it starts with an appropriate prefix.
#
if
(
!
$uid
&&
!
$pid
&&
!
$gid
&&
!
$eid
)
{
if
(
e
reg
(
"^
$TBPROJ_DIR
/.*"
,
$path
)
||
e
reg
(
"^
$TBUSER_DIR
/.*"
,
$path
)
||
e
reg
(
"^
$TBGROUP_DIR
/.*"
,
$path
))
{
if
(
p
reg
_match
(
"
/
^
$TBPROJ_DIR
\
/.*
/
"
,
$path
)
||
p
reg
_match
(
"
/
^
$TBUSER_DIR
\
/.*
/
"
,
$path
)
||
p
reg
_match
(
"
/
^
$TBGROUP_DIR
\
/.*
/
"
,
$path
))
{
return
1
;
}
if
(
$TBSCRATCH_DIR
&&
e
reg
(
"^
$TBSCRATCH_DIR
/.*"
,
$path
))
{
if
(
$TBSCRATCH_DIR
&&
p
reg
_match
(
"
/
^
$TBSCRATCH_DIR
\
/.*
/
"
,
$path
))
{
return
1
;
}
return
0
;
...
...
www/delaycontrol.php3
View file @
9577ec16
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-200
7
University of Utah and the Flux Group.
# Copyright (c) 2000-20
1
0 University of Utah and the Flux Group.
# All rights reserved.
#
include
(
"defs.php3"
);
...
...
@@ -535,7 +535,7 @@ while (list ($header, $value) = each ($formfields)) {
continue
;
}
if
(
!
isset
(
$value
)
||
!
strcmp
(
$value
,
""
)
||
!
e
reg
(
"
^[0-9\.bs]*$
"
,
"
$value
"
))
{
!
p
reg
_match
(
'/
^[0-9\.bs]*$
/'
,
"
$value
"
))
{
continue
;
}
...
...
www/newnodelog.php3
View file @
9577ec16
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-200
7
University of Utah and the Flux Group.
# Copyright (c) 2000-20
1
0 University of Utah and the Flux Group.
# All rights reserved.
#
include
(
"defs.php3"
);
...
...
@@ -31,7 +31,7 @@ if (! ($isadmin || OPSGUY())) {
#
# Check log type. Strictly letters, not too long.
#
if
(
!
e
reg
(
"
^[a-zA-Z]+$
"
,
$log_type
)
||
strlen
(
$log_type
)
>
32
)
{
if
(
!
p
reg
_match
(
'/
^[a-zA-Z]+$
/'
,
$log_type
)
||
strlen
(
$log_type
)
>
32
)
{
USERERROR
(
"The log type you gave looks funky!"
,
1
);
}
...
...
www/spitnsdata.php3
View file @
9577ec16
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-200
3, 2005-2007
University of Utah and the Flux Group.
# Copyright (c) 2000-20
1
0 University of Utah and the Flux Group.
# All rights reserved.
#
include
(
"defs.php3"
);
...
...
@@ -134,8 +134,8 @@ if (isset($nsdata) && strcmp($nsdata, "") != 0) {
header
(
"Content-Type: text/plain"
);
echo
"
$nsdata
"
;
}
elseif
(
isset
(
$nsref
)
&&
strcmp
(
$nsref
,
""
)
!=
0
&&
e
reg
(
"
^[0-9]+$
"
,
$nsref
))
{
if
(
isset
(
$guid
)
&&
e
reg
(
"
^[0-9]+$
"
,
$guid
))
{
p
reg
_match
(
'/
^[0-9]+$
/'
,
$nsref
))
{
if
(
isset
(
$guid
)
&&
p
reg
_match
(
'/
^[0-9]+$
/'
,
$guid
))
{
$nsfile
=
"/tmp/
$guid
-
$nsref
.nsfile"
;
$id
=
$guid
;
}
else
{
...
...
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