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
4ae52ce4
Commit
4ae52ce4
authored
Mar 08, 2006
by
Leigh B. Stoller
Browse files
Allow cross-project experiment copy when the source experiment is
a current experiment and the user has permission to view the source.
parent
095adf54
Changes
1
Hide whitespace changes
Inline
Side-by-side
www/beginexp_xml.php3
View file @
4ae52ce4
...
...
@@ -292,20 +292,35 @@ $exp_pid = $formfields[exp_pid];
$exp_gid
=
((
isset
(
$formfields
[
exp_gid
])
&&
$formfields
[
exp_gid
]
!=
""
)
?
$formfields
[
exp_gid
]
:
$exp_pid
);
$exp_id
=
$formfields
[
exp_id
];
$extragroups
=
""
;
#
# Verify permissions. We do this here since pid/eid/gid could be bogus above.
#
if
(
!
TBProjAccessCheck
(
$uid
,
$exp_pid
,
$exp_gid
,
$TB_PROJECT_CREATEEXPT
))
{
$errors
[
"Project/Group"
]
=
"Not
$exp_gid
enough permission to create experiment"
;
$errors
[
"Project/Group"
]
=
"Not enough permission to create experiment"
;
XMLERROR
();
}
#
# Figure out the NS file to give to the script. Eventually we will allow
# it to come inline as an XML argument.
#
if
(
$nsfilelocale
==
"copyid"
)
{
if
(
preg_match
(
"/^([-\w]+),([-\w]+)$/"
,
$formfields
[
'copyid'
],
$matches
))
{
$copypid
=
$matches
[
1
];
$copyeid
=
$matches
[
2
];
if
(
!
TBExptAccessCheck
(
$uid
,
$copypid
,
$copyeid
,
$TB_EXPT_READINFO
)){
$errors
[
"Project/Group"
]
=
"Not enough permission to copy experiment
$copypid
/
$copyeid
"
;
XMLERROR
();
}
if
(
$copypid
!=
$exp_pid
)
$extragroups
=
",
$copypid
"
;
}
$thensfile
=
"-c "
.
$formfields
[
'copyid'
];
# A branch needs the -b option.
...
...
@@ -426,7 +441,7 @@ TBGroupUnixInfo($exp_pid, $exp_gid, $unix_gid, $unix_name);
#
set_time_limit
(
0
);
$retval
=
SUEXEC
(
$uid
,
"
$exp_pid
,
$unix_gid
"
,
$retval
=
SUEXEC
(
$uid
,
"
$exp_pid
,
$unix_gid
"
.
$extragroups
,
"webbatchexp
$batcharg
-E
$exp_desc
$exp_swappable
"
.
"
$linktestarg
-p
$exp_pid
-g
$exp_gid
-e
$exp_id
"
.
(
$nonsfile
?
""
:
"
$thensfile
"
),
...
...
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