Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-stable
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
emulab
emulab-stable
Commits
6744cb66
Commit
6744cb66
authored
Jul 20, 2007
by
Leigh B. Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up the cvsweb code that had bitrotted, and hook in the template
cvs repo from the template show page.
parent
e9f64cc2
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
116 deletions
+61
-116
www/cvsweb/cvsweb.cgi
www/cvsweb/cvsweb.cgi
+2
-2
www/cvsweb/cvsweb.php3
www/cvsweb/cvsweb.php3
+24
-93
www/cvsweb/cvswebwrap.php3
www/cvsweb/cvswebwrap.php3
+21
-20
www/template_defs.php
www/template_defs.php
+10
-1
www/template_show.php
www/template_show.php
+3
-0
www/url_defs.php
www/url_defs.php
+1
-0
No files found.
www/cvsweb/cvsweb.cgi
View file @
6744cb66
...
...
@@ -46,7 +46,7 @@
# SUCH DAMAGE.
#
# $FreeBSD: projects/cvsweb/cvsweb.cgi,v 1.119.2.6 2002/09/26 20:56:05 scop Exp $
# $Id: cvsweb.cgi,v 1.
9 2007-04-07 05:39:29 johnsond
Exp $
# $Id: cvsweb.cgi,v 1.
10 2007-07-20 18:52:07 stoller
Exp $
# $Idaemons: /home/cvs/cvsweb/cvsweb.cgi,v 1.84 2001/10/07 20:50:10 knu Exp $
#
###
...
...
@@ -312,7 +312,7 @@ $maycompress =
# their current value) to any link/query string
# you construct
@stickyvars = qw(cvsroot hideattic sortby logsort f only_with_tag
pid eid exptidx);
pid eid exptidx
guid version
);
@unsafevars = qw(logsort only_with_tag r1 r2 rev sortby tr1 tr2);
if (-f $config) {
...
...
www/cvsweb/cvsweb.php3
View file @
6744cb66
...
...
@@ -32,9 +32,7 @@ $use_viewvc = 0;
#
# Verify form arguments.
#
$optargs
=
OptionalPageArguments
(
"experiment"
,
PAGEARG_EXPERIMENT
,
"instance"
,
PAGEARG_INSTANCE
,
"template"
,
PAGEARG_TEMPLATE
,
$optargs
=
OptionalPageArguments
(
"template"
,
PAGEARG_TEMPLATE
,
"project"
,
PAGEARG_PROJECT
,
"embedded"
,
PAGEARG_BOOLEAN
);
if
(
!
isset
(
$embedded
))
{
...
...
@@ -57,37 +55,8 @@ if (isset($project)) {
header
(
"Location:
$url
"
);
return
;
}
if
(
isset
(
$experiment
))
{
#
# Wants access to the experiment archive, which is really a repo.
#
$pid
=
$experiment
->
pid
();
$eid
=
$experiment
->
eid
();
if
(
!
ISADMIN
()
&&
!
$experiment
->
AccessCheck
(
$this_user
,
$TB_EXPT_READINFO
))
{
USERERROR
(
"Not enough permission to view '
$pid
/
$eid
'"
,
1
);
}
# Get the repo index for the experiment.
$query_result
=
DBQueryFatal
(
"select s.archive_idx from experiments as e "
.
"left join experiment_stats as s on s.exptidx=e.idx "
.
"where e.pid='
$pid
' and e.eid='
$eid
'"
);
if
(
!
mysql_num_rows
(
$query_result
))
{
TBERROR
(
"Error getting repo index for '
$pid
/
$eid
'"
,
1
);
}
$row
=
mysql_fetch_array
(
$query_result
);
if
(
!
isset
(
$row
[
0
]))
{
TBERROR
(
"Error getting repo index for '
$pid
/
$eid
'"
,
1
);
}
$repoidx
=
$row
[
0
];
$repodir
=
"/usr/testbed/exparchive/
$repoidx
/repo/"
;
$use_viewvc
=
1
;
}
else
{
#
# Wants access to the project repo.
# Authenticated access to the project repo.
#
if
(
!
ISADMIN
()
&&
!
$project
->
AccessCheck
(
$this_user
,
$TB_PROJECT_READINFO
))
{
...
...
@@ -104,64 +73,26 @@ if (isset($project)) {
}
}
$repodir
=
"
$TBCVSREPO_DIR
/
$pid
"
;
}
}
elseif
(
isset
(
$
experiment
)
||
isset
(
$instance
)
||
isset
(
$
template
))
{
elseif
(
isset
(
$template
))
{
if
(
!
$CVSSUPPORT
)
{
USERERROR
(
"Project CVS support is not enabled!"
,
1
);
}
# Must be logged in for this!
if
(
$this_user
)
{
CheckLoginOrDie
();
}
if
(
isset
(
$template
))
{
$experiment
=
$template
->
GetExperiment
();
}
if
(
isset
(
$instance
))
{
$pid
=
$instance
->
pid
();
$eid
=
$instance
->
eid
();
$idx
=
$instance
->
exptidx
();
$project
=
$instance
->
Project
();
}
else
{
$pid
=
$experiment
->
pid
();
$eid
=
$experiment
->
eid
();
$idx
=
$experiment
->
idx
();
$project
=
$experiment
->
Project
();
}
$this_user
=
CheckLoginOrDie
();
# Need the pid/eid/gid. Access the stats table since we want to provide
# cvs access to terminated experiments via the archive.
$query_result
=
DBQueryFatal
(
"select s.archive_idx,a.archived "
.
" from experiment_stats as s "
.
"left join archives as a on a.idx=s.archive_idx "
.
"where s.exptidx='
$idx
'"
);
if
(
!
mysql_num_rows
(
$query_result
))
{
USERERROR
(
"Experiment '
$idx
' is not a valid experiment"
,
1
);
}
$row
=
mysql_fetch_array
(
$query_result
);
$repoidx
=
$row
[
0
];
$archived
=
$row
[
1
];
$guid
=
$template
->
guid
();
$vers
=
$template
->
vers
();
$pid
=
$template
->
pid
();
$project
=
$template
->
GetProject
();
# Lets do group level check since it might not be a current experiment.
if
(
!
$archived
)
{
if
(
!
ISADMIN
()
&&
!
$project
->
AccessCheck
(
$this_user
,
$TB_PROJECT_READINFO
))
{
USERERROR
(
"Not enough permission to view archive"
,
1
);
}
$repodir
=
"/usr/testbed/exparchive/
$repoidx
/repo/"
;
}
else
{
if
(
!
ISADMIN
())
{
USERERROR
(
"Must be administrator to view historical archives!"
,
1
);
}
$repodir
=
"/usr/testbed/exparchive/Archive/
$repoidx
/repo/"
;
USERERROR
(
"Not enough permission to view cvs repo for template"
,
1
);
}
$use_viewvc
=
1
;
# Repo for the entire template stored here per-template.
$repodir
=
"
$TBPROJ_DIR
/
$pid
/templates/
$guid
/cvsrepo/
$guid
"
;
}
else
{
$this_user
=
CheckLoginOrDie
();
...
...
www/cvsweb/cvswebwrap.php3
View file @
6744cb66
...
...
@@ -11,16 +11,21 @@
chdir
(
"../"
);
require
(
"defs.php3"
);
#
# Make sure that URL args are cleaned.
#
RequiredPageArguments
();
# Must be logged in.
$this_user
=
CheckLoginOrDie
();
$uid
=
$this_user
->
uid
();
$isadmin
=
ISADMIN
();
#
# Verify form arguments.
#
$optargs
=
OptionalPageArguments
(
"template"
,
PAGEARG_TEMPLATE
,
"project"
,
PAGEARG_PROJECT
,
"embedded"
,
PAGEARG_BOOLEAN
);
if
(
!
isset
(
$embedded
))
{
$embedded
=
0
;
}
#
# Form the real url.
#
...
...
@@ -32,24 +37,20 @@ $newurl = preg_replace("/php3/","php3/",$newurl);
#
PAGEHEADER
(
"Emulab CVS Repository"
);
?>
<head>
<style
type=
"text/css"
>
#cvsfr
{
width
:
100%
;
height
:
800px
;
if
(
isset
(
$project
))
{
;
}
elseif
(
isset
(
$template
))
{
echo
$template
->
PageHeader
();
}
</style>
</head>
<div
id=
"cvscon"
>
<iframe
id=
"cvsfr"
scrolling=
yes
src=
"
<?php
echo
$newurl
?>
"
border=
0
></iframe>
</div>
echo
"<div><iframe src='
$newurl
' class='outputframe' "
.
"id='outputframe' name='outputframe'></iframe></div>
\n
"
;
echo
"</center><br>
\n
"
;
<?php
echo
"<script type='text/javascript' language='javascript'>
\n
"
;
echo
"SetupOutputArea('outputframe', false);
\n
"
;
echo
"</script>
\n
"
;
#
# Standard Testbed Footer
...
...
www/template_defs.php
View file @
6744cb66
...
...
@@ -167,6 +167,15 @@ class Template
return
$this
->
experiment
;
}
function
GetProject
()
{
$pid
=
$this
->
pid
();
if
(
!
(
$project
=
Project
::
Lookup
(
$pid
)))
{
TBERROR
(
"Could not lookup project
$pid
!"
,
1
);
}
return
$project
;
}
# Return the unixgid for operating on this template.
function
UnixGID
()
{
$experiment
=
$this
->
experiment
;
...
...
@@ -2282,7 +2291,7 @@ function MakeLink($which, $args, $text)
$page
=
"showuser.php3"
;
}
elseif
(
$which
==
"template"
)
{
$page
=
"template_show.php"
;
$page
=
"
/
template_show.php"
;
}
elseif
(
$which
==
"metadata"
)
{
$page
=
"template_metadata.php"
;
...
...
www/template_show.php
View file @
6744cb66
...
...
@@ -323,6 +323,9 @@ if ($template->EventCount() > 0) {
WRITESUBMENUBUTTON
(
"Browse Datastore"
,
CreateURL
(
"archive_view"
,
$template
));
WRITESUBMENUBUTTON
(
"Browse CVS Repository"
,
CreateURL
(
"cvswebwrap"
,
$template
));
WRITESUBMENUBUTTON
(
"View Records"
,
CreateURL
(
"template_history"
,
$template
));
...
...
www/url_defs.php
View file @
6744cb66
...
...
@@ -105,6 +105,7 @@ $url_mapping["spitreport"] = "spitreport.php";
$url_mapping
[
"statechange"
]
=
"statechange.php"
;
$url_mapping
[
"experimentrun_show"
]
=
"experimentrun_show.php"
;
$url_mapping
[
"instance_show"
]
=
"instance_show.php"
;
$url_mapping
[
"cvswebwrap"
]
=
"cvsweb/cvswebwrap.php3"
;
#
# The caller will pass in a page id, and a list of things. If the thing
...
...
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