Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Hussamuddin Nasir
emulab-devel
Commits
c108da6a
Commit
c108da6a
authored
Dec 20, 2006
by
Leigh Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge uuid-branch back to the head revision. This is the next step in
converting to locally unique ids and later globally unique ids.
parent
9855627f
Changes
204
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
204 changed files
with
3668 additions
and
2917 deletions
+3668
-2917
www/approveproject.php3
www/approveproject.php3
+24
-33
www/approveproject_form.php3
www/approveproject_form.php3
+17
-15
www/approveproject_list.php3
www/approveproject_list.php3
+29
-23
www/approveuser.php3
www/approveuser.php3
+62
-51
www/approveuser_form.php3
www/approveuser_form.php3
+50
-66
www/approvewauser.php3
www/approvewauser.php3
+22
-25
www/approvewauser_form.php3
www/approvewauser_form.php3
+24
-22
www/archive_control.php3
www/archive_control.php3
+3
-3
www/archive_missing.php3
www/archive_missing.php3
+3
-3
www/archive_tag.php3
www/archive_tag.php3
+3
-3
www/archive_tags.php3
www/archive_tags.php3
+3
-3
www/archive_view.php3
www/archive_view.php3
+3
-3
www/beginexp_html.php3
www/beginexp_html.php3
+4
-4
www/beginexp_xml.php3
www/beginexp_xml.php3
+7
-11
www/boot.php3
www/boot.php3
+4
-13
www/bootlog.php3
www/bootlog.php3
+4
-4
www/buildui/bui.php3
www/buildui/bui.php3
+4
-4
www/buildui/nssave.php3
www/buildui/nssave.php3
+8
-25
www/cdromqueue.php3
www/cdromqueue.php3
+4
-4
www/changeuid.php
www/changeuid.php
+25
-22
www/chpasswd.php3
www/chpasswd.php3
+48
-42
www/clientui.php3
www/clientui.php3
+4
-4
www/currentusage.php3
www/currentusage.php3
+5
-5
www/cvsweb/cvsweb.php3
www/cvsweb/cvsweb.php3
+16
-12
www/cvsweb/cvswebwrap.php3
www/cvsweb/cvswebwrap.php3
+3
-3
www/dbcheck.php3
www/dbcheck.php3
+3
-0
www/dbdefs.php3.in
www/dbdefs.php3.in
+25
-448
www/defs.php3.in
www/defs.php3.in
+1
-0
www/delaycontrol.php3
www/delaycontrol.php3
+3
-3
www/deletegroup.php3
www/deletegroup.php3
+3
-2
www/deleteimageid.php3
www/deleteimageid.php3
+3
-2
www/deletenodelog.php3
www/deletenodelog.php3
+4
-4
www/deleteosid.php3
www/deleteosid.php3
+3
-2
www/deleteproject.php3
www/deleteproject.php3
+4
-4
www/deletepubkey.php3
www/deletepubkey.php3
+29
-25
www/deletesfskey.php3
www/deletesfskey.php3
+28
-24
www/deleteuser.php3
www/deleteuser.php3
+33
-36
www/delmmlist.php3
www/delmmlist.php3
+4
-4
www/editexp.php3
www/editexp.php3
+15
-9
www/editgroup.php3
www/editgroup.php3
+21
-8
www/editgroup_form.php3
www/editgroup_form.php3
+31
-14
www/editimageid.php3
www/editimageid.php3
+3
-3
www/editnodetype.php3
www/editnodetype.php3
+3
-7
www/editsitevars.php3
www/editsitevars.php3
+4
-7
www/endexp.php3
www/endexp.php3
+4
-3
www/expaccess.php3
www/expaccess.php3
+5
-4
www/expaccess_form.php3
www/expaccess_form.php3
+5
-4
www/experiment_defs.php
www/experiment_defs.php
+26
-2
www/experimentrun_show.php
www/experimentrun_show.php
+3
-3
www/feedback.php3
www/feedback.php3
+4
-3
www/floormap.php3
www/floormap.php3
+3
-3
www/floormap_aux.php3
www/floormap_aux.php3
+4
-4
www/freenode.php3
www/freenode.php3
+6
-5
www/freezeuser.php3
www/freezeuser.php3
+14
-13
www/gensslcert.php3
www/gensslcert.php3
+35
-29
www/getsslcert.php3
www/getsslcert.php3
+17
-15
www/gotobugdb.php3
www/gotobugdb.php3
+5
-4
www/gotochat.php3
www/gotochat.php3
+5
-13
www/gotommlist.php3
www/gotommlist.php3
+9
-7
www/gotowiki.php3
www/gotowiki.php3
+4
-4
www/group_defs.php
www/group_defs.php
+290
-16
www/index.php3
www/index.php3
+5
-4
www/instance_show.php
www/instance_show.php
+3
-3
www/joinproject.php3
www/joinproject.php3
+16
-17
www/kb-browse.php3
www/kb-browse.php3
+6
-3
www/kb-manage.php3
www/kb-manage.php3
+4
-5
www/kb-search.php3
www/kb-search.php3
+2
-2
www/kb-show.php3
www/kb-show.php3
+4
-5
www/ledpipe.php3
www/ledpipe.php3
+4
-3
www/linkgraph_image.php
www/linkgraph_image.php
+3
-3
www/linkmon_ctl.php3
www/linkmon_ctl.php3
+4
-3
www/linkmon_list.php3
www/linkmon_list.php3
+4
-3
www/linkmon_mon.php3
www/linkmon_mon.php3
+3
-2
www/linktest.php3
www/linktest.php3
+3
-2
www/listrepos.php3
www/listrepos.php3
+23
-26
www/loadimage.php3
www/loadimage.php3
+3
-3
www/login.php3
www/login.php3
+7
-5
www/login_redirect.php
www/login_redirect.php
+4
-3
www/logout.php3
www/logout.php3
+31
-19
www/menu.php3
www/menu.php3
+58
-100
www/modifyexp.php3
www/modifyexp.php3
+4
-4
www/modnodeattributes.php3
www/modnodeattributes.php3
+4
-4
www/modnodeattributes_form.php3
www/modnodeattributes_form.php3
+4
-4
www/moduserinfo.php3
www/moduserinfo.php3
+139
-194
www/moteleds.php3
www/moteleds.php3
+4
-3
www/mychat.php3
www/mychat.php3
+5
-12
www/newgroup.php3
www/newgroup.php3
+9
-6
www/newgroup_form.php3
www/newgroup_form.php3
+5
-4
www/newimageid.php3
www/newimageid.php3
+4
-4
www/newimageid_ez.php3
www/newimageid_ez.php3
+4
-4
www/newmmlist.php3
www/newmmlist.php3
+5
-5
www/newnode_edit.php3
www/newnode_edit.php3
+5
-4
www/newnodelog.php3
www/newnodelog.php3
+5
-5
www/newnodelog_form.php3
www/newnodelog_form.php3
+4
-4
www/newnodes_list.php3
www/newnodes_list.php3
+4
-3
www/newosid.php3
www/newosid.php3
+5
-5
www/newosid_form.php3
www/newosid_form.php3
+4
-4
www/newproject.php3
www/newproject.php3
+12
-14
www/news.php3
www/news.php3
+7
-5
www/nodecontrol.php3
www/nodecontrol.php3
+4
-4
www/nodecontrol_form.php3
www/nodecontrol_form.php3
+4
-4
www/nodecontrol_list.php3
www/nodecontrol_list.php3
+20
-14
www/noderdp.php3
www/noderdp.php3
+9
-11
www/nodessh.php3
www/nodessh.php3
+3
-2
www/nodetipacl.php3
www/nodetipacl.php3
+5
-4
www/nscheck.php3
www/nscheck.php3
+3
-2
www/nscheck_form.php3
www/nscheck_form.php3
+3
-2
www/nsgen.php3
www/nsgen.php3
+7
-6
www/obstacle_list.php3
www/obstacle_list.php3
+4
-4
www/panicbutton.php3
www/panicbutton.php3
+4
-3
www/password.php3
www/password.php3
+13
-23
www/plab_ez.php3
www/plab_ez.php3
+7
-5
www/plabmetrics.php3
www/plabmetrics.php3
+4
-3
www/plabstats.php3
www/plabstats.php3
+9
-6
www/powertime.php3
www/powertime.php3
+4
-4
www/prereserve_node.php3
www/prereserve_node.php3
+3
-3
www/project_defs.php
www/project_defs.php
+130
-10
www/remapexp.php3
www/remapexp.php3
+4
-3
www/replayexp.php3
www/replayexp.php3
+4
-3
www/request_idleinfo.php3
www/request_idleinfo.php3
+24
-17
www/request_swapexp.php3
www/request_swapexp.php3
+6
-5
www/resendkey.php3
www/resendkey.php3
+17
-11
www/robotmap.php3
www/robotmap.php3
+5
-5
www/robotrack/assignnodes.php3
www/robotrack/assignnodes.php3
+4
-3
www/robotrack/cameras.php3
www/robotrack/cameras.php3
+4
-3
www/robotrack/flooricon.php3
www/robotrack/flooricon.php3
+4
-3
www/robotrack/nodeinfo.php3
www/robotrack/nodeinfo.php3
+5
-4
www/robotrack/obstacles.php3
www/robotrack/obstacles.php3
+5
-4
www/robotrack/robopipe.php3
www/robotrack/robopipe.php3
+5
-6
www/robotrack/robotrack.php3
www/robotrack/robotrack.php3
+5
-4
www/robotrack/selector.php3
www/robotrack/selector.php3
+5
-4
www/robotrack/setdest.php3
www/robotrack/setdest.php3
+4
-3
www/robotrack/virtinfo.php3
www/robotrack/virtinfo.php3
+4
-3
www/sdr/preorder_list.php
www/sdr/preorder_list.php
+4
-4
www/sendtestmsg.php3
www/sendtestmsg.php3
+12
-10
www/servicepipe.php3
www/servicepipe.php3
+4
-3
www/setnodeloc.php3
www/setnodeloc.php3
+4
-4
www/showconlog.php3
www/showconlog.php3
+4
-4
www/showevents.php
www/showevents.php
+3
-4
www/showexp.php3
www/showexp.php3
+4
-3
www/showexp_list.php3
www/showexp_list.php3
+16
-6
www/showexpstats.php3
www/showexpstats.php3
+5
-5
www/showgroup.php3
www/showgroup.php3
+4
-5
www/showimageid.php3
www/showimageid.php3
+5
-5
www/showimageid_list.php3
www/showimageid_list.php3
+5
-5
www/showlasterror.php3
www/showlasterror.php3
+5
-6
www/showlogfile.php3
www/showlogfile.php3
+5
-5
www/showmmlists.php3
www/showmmlists.php3
+29
-22
www/shownode.php3
www/shownode.php3
+4
-4
www/shownodehistory.php3
www/shownodehistory.php3
+4
-4
www/shownodelog.php3
www/shownodelog.php3
+4
-4
www/shownsfile.php3
www/shownsfile.php3
+5
-8
www/showobstacle.php3
www/showobstacle.php3
+4
-4
www/showosid_list.php3
www/showosid_list.php3
+4
-4
www/showosinfo.php3
www/showosinfo.php3
+5
-5
www/showpolicies.php3
www/showpolicies.php3
+10
-5
www/showproject.php3
www/showproject.php3
+10
-6
www/showproject_list.php3
www/showproject_list.php3
+9
-5
www/showpubkeys.php3
www/showpubkeys.php3
+30
-31
www/showsfskeys.php3
www/showsfskeys.php3
+38
-34
www/showstats.php3
www/showstats.php3
+12
-9
www/showstuff.php3
www/showstuff.php3
+78
-238
www/showsumstats.php3
www/showsumstats.php3
+11
-8
www/showuser.php3
www/showuser.php3
+49
-51
www/showuser_list.php3
www/showuser_list.php3
+7
-9
www/spewconlog.php3
www/spewconlog.php3
+4
-4
www/spewevents.php
www/spewevents.php
+3
-4
www/spewlogfile.php3
www/spewlogfile.php3
+5
-6
www/spitnsdata.php3
www/spitnsdata.php3
+4
-3
www/spitreport.php
www/spitreport.php
+5
-3
www/statechange.php
www/statechange.php
+4
-3
www/suuser.php
www/suuser.php
+9
-14
www/swapexp.php3
www/swapexp.php3
+5
-4
www/tbauth.php3
www/tbauth.php3
+193
-161
www/telemetry.php3
www/telemetry.php3
+4
-3
www/template_analyze.php
www/template_analyze.php
+4
-3
www/template_commit.php
www/template_commit.php
+4
-3
www/template_create.php
www/template_create.php
+4
-4
www/template_defs.php
www/template_defs.php
+20
-2
www/template_editevents.php
www/template_editevents.php
+3
-3
www/template_export.php
www/template_export.php
+4
-3
www/template_exprun.php
www/template_exprun.php
+3
-3
www/template_history.php
www/template_history.php
+3
-3
www/template_metadata.php
www/template_metadata.php
+3
-3
www/template_modify.php
www/template_modify.php
+3
-4
www/template_show.php
www/template_show.php
+4
-4
www/template_swapin.php
www/template_swapin.php
+5
-5
www/toggle.php
www/toggle.php
+15
-17
www/top2image.php3
www/top2image.php3
+4
-3
www/updateaccounts.php3
www/updateaccounts.php3
+5
-4
www/url_defs.php
www/url_defs.php
+164
-0
www/user_defs.php
www/user_defs.php
+731
-16
www/verifyusr.php3
www/verifyusr.php3
+66
-83
www/verifyusr_form.php3
www/verifyusr_form.php3
+4
-5
www/webcam.php3
www/webcam.php3
+6
-6
www/webcamimg.php3
www/webcamimg.php3
+6
-6
www/webdb/webdb.php3
www/webdb/webdb.php3
+6
-4
www/widearea_info.php3
www/widearea_info.php3
+5
-4
www/widearea_nodeinfo.php3
www/widearea_nodeinfo.php3
+4
-3
www/widearea_register.php
www/widearea_register.php
+150
-162
www/wideareakeys.php3
www/wideareakeys.php3
+4
-4
www/wireless-stats/getdata.php3
www/wireless-stats/getdata.php3
+3
-2
www/wireless-stats/statsapp.php3
www/wireless-stats/statsapp.php3
+3
-2
www/xmlrpcpipe.php3.in
www/xmlrpcpipe.php3.in
+4
-4
No files found.
www/approveproject.php3
View file @
c108da6a
...
...
@@ -14,13 +14,13 @@ PAGEHEADER("New Project Approved");
#
# Only known and logged in users can do this.
#
$
uid
=
GETLOGIN
();
LOGGEDINORDIE
(
$uid
);
$
this_user
=
CheckLoginOrDie
();
$uid
=
$this_user
->
uid
(
);
#
# Of course verify that this uid has admin privs!
#
$isadmin
=
ISADMIN
(
$uid
);
$isadmin
=
ISADMIN
();
if
(
!
$isadmin
)
{
USERERROR
(
"You do not have admin privileges to approve projects!"
,
1
);
}
...
...
@@ -37,22 +37,27 @@ echo "<center><h1>
#
# Grab the head_uid for this project. This verifies it is a valid project.
#
$query_result
=
DBQueryFatal
(
"SELECT head_uid from projects where pid='
$pid
'"
);
if
((
$row
=
mysql_fetch_row
(
$query_result
))
==
0
)
{
if
(
!
(
$this_project
=
Project
::
Lookup
(
$pid
)))
{
TBERROR
(
"Unknown project
$pid
"
,
1
);
}
$headuid
=
$row
[
0
];
if
(
!
(
$leader
=
$this_project
->
GetLeader
()))
{
TBERROR
(
"Error getting leader for
$pid
"
,
1
);
}
$headuid
=
$this_project
->
head_uid
();
#
# If the user wanted to change the head uid, do that now (we change both
# the head_uid and the leader of the default project)
#
if
(
isset
(
$head_uid
)
&&
strcmp
(
$head_uid
,
""
))
{
if
(
isset
(
$head_uid
)
&&
$head_uid
!=
""
)
{
if
(
!
(
$newleader
=
User
::
Lookup
(
$head_uid
)))
{
TBERROR
(
"Unknown user
$head_uid
"
,
1
);
}
if
(
$this_project
->
ChangeLeader
(
$newleader
)
<
0
)
{
TBERROR
(
"Error changing leader to
$head_uid
"
,
1
);
}
$leader
=
$newleader
;
$headuid
=
$head_uid
;
DBQueryFatal
(
"UPDATE projects set head_uid='
$headuid
' where pid='
$pid
'"
);
DBQueryFatal
(
"UPDATE groups set leader='
$headuid
' where pid='
$pid
' and "
.
"gid='
$pid
'"
);
}
if
(
!
isset
(
$user_interface
)
||
...
...
@@ -70,26 +75,16 @@ if (!isset($user_interface) ||
# and we will change it to "unapproved" or "active", respectively.
# If the status is "active", we leave it alone.
#
$query_result
=
DBQueryFatal
(
"SELECT status,usr_email,usr_name from users "
.
"where uid='
$headuid
'"
);
if
(
mysql_num_rows
(
$query_result
)
==
0
)
{
TBERROR
(
"Unknown user
$headuid
"
,
1
);
}
$row
=
mysql_fetch_row
(
$query_result
);
$curstatus
=
$row
[
0
];
$headuid_email
=
$row
[
1
];
$headname
=
$row
[
2
];
$curstatus
=
$leader
->
status
();
$headuid_email
=
$leader
->
email
();
$headname
=
$leader
->
name
();
#echo "Status = $curstatus, Email = $headuid_email<br>\n";
#
# Then we check that the headuid is really listed in the group_membership
# table (default group), just to be sure.
#
$query_result
=
DBQueryFatal
(
"SELECT trust from group_membership where "
.
"uid='
$headuid
' and pid='
$pid
' and gid='
$pid
'"
);
if
(
mysql_num_rows
(
$query_result
)
==
0
)
{
if
(
!
$this_project
->
IsMember
(
$leader
,
$ignore
))
{
USERERROR
(
"User
$headuid
is not the leader of project
$pid
."
,
1
);
}
...
...
@@ -194,17 +189,14 @@ elseif (strcmp($approval, "approve") == 0) {
TBERROR
(
"Invalid
$headuid
status
$curstatus
in "
.
"approveproject.php3"
,
1
);
}
DBQueryFatal
(
"UPDATE users set status='
$newstatus
', "
.
" user_interface='
$user_interface
' "
.
"WHERE uid='
$headuid
'"
);
$leader
->
SetUserInterface
(
$user_interface
);
$leader
->
SetStatus
(
$newstatus
);
}
#
# Set the project "approved" field to true.
#
DBQueryFatal
(
"update projects set approved='1', "
.
" default_user_interface='
$user_interface
' "
.
"where pid='
$pid
'"
);
$this_project
->
SetApproved
(
1
);
#
# XXX
...
...
@@ -223,8 +215,7 @@ elseif (strcmp($approval, "approve") == 0) {
}
if
(
count
(
$pcremote_ok
))
{
$foo
=
implode
(
","
,
$pcremote_ok
);
DBQueryFatal
(
"UPDATE projects set pcremote_ok='
$foo
' "
.
"WHERE pid='
$pid
'"
);
$this_project
->
SetRemoteOK
(
$foo
);
}
#
...
...
www/approveproject_form.php3
View file @
c108da6a
...
...
@@ -15,13 +15,13 @@ PAGEHEADER("New Project Approval");
#
# Only known and logged in users can do this.
#
$uid
=
GETLOGIN
();
LOGGEDINORDIE
(
$uid
);
$this_user
=
CheckLoginOrDie
();
$uid
=
$this_user
->
uid
();
$isadmin
=
ISADMIN
();
#
# Of course verify that this uid has admin privs!
#
$isadmin
=
ISADMIN
(
$uid
);
if
(
!
$isadmin
)
{
USERERROR
(
"You do not have admin privileges to approve projects!"
,
1
);
}
...
...
@@ -37,8 +37,8 @@ if (!isset($pid) ||
#
# Check to make sure thats this is a valid PID.
#
if
(
!
TBValidProject
(
$pid
))
{
USERERROR
(
"
The project
$pid
is not a valid project.
"
,
1
);
if
(
!
(
$this_project
=
Project
::
Lookup
(
$pid
)
))
{
USERERROR
(
"
Unknown project
$pid
"
,
1
);
}
echo
"<center><h3>You have the following choices:</h3></center>
...
...
@@ -79,19 +79,19 @@ echo "<center><h3>You have the following choices:</h3></center>
#
SHOWPROJECT
(
$pid
,
$uid
);
TBProjLeader
(
$pid
,
$projleader
);
$projleader
=
$this_project
->
GetLeader
(
);
echo
"<center>
<h3>Project Leader Information</h3>
</center>
<table align=center border=0>
\n
"
;
SHOWUSER
(
$projleader
);
SHOWUSER
(
$projleader
->
uid
()
);
#
# Check to make sure that the head user is 'unapproved' or 'active'
#
$headstatus
=
TBUserStatus
(
$projleader
);
$headstatus
=
$projleader
->
status
(
);
if
(
!
strcmp
(
$headstatus
,
TBDB_USERSTATUS_UNAPPROVED
)
||
!
strcmp
(
$headstatus
,
TBDB_USERSTATUS_ACTIVE
))
{
$approvable
=
1
;
...
...
@@ -136,7 +136,7 @@ echo "<tr>
</tr>
\n
"
;
#
# Allow the approver to change the project
'
s head UID - gotta find everyone in
# Allow the approver to change the projects head UID - gotta find everyone in
# the default group, first
#
echo
"<tr>
...
...
@@ -144,12 +144,14 @@ echo "<tr>
Head UID:
<select name=head_uid>
<option value=''>(Unchanged)</option>"
;
$query_result
=
DBQueryFatal
(
"select uid from group_membership where pid='
$pid
' and "
.
"gid='
$pid
'"
);
while
(
$row
=
mysql_fetch_array
(
$query_result
))
{
$thisuid
=
$row
[
uid
];
echo
" <option value='
$thisuid
'>
$thisuid
</option>
\n
"
;
$allmembers
=
$this_project
->
MemberList
();
foreach
(
$allmembers
as
$other_user
)
{
$this_uid
=
$other_user
->
uid
();
$this_webid
=
$other_user
->
webid
();
echo
" <option value='
$this_webid
'>
$this_uid
</option>
\n
"
;
}
echo
" </select>
</td>
...
...
www/approveproject_list.php3
View file @
c108da6a
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2004
, 2006
University of Utah and the Flux Group.
# All rights reserved.
#
include
(
"defs.php3"
);
...
...
@@ -14,13 +14,13 @@ PAGEHEADER("New Project Approval List");
#
# Only known and logged in users can do this. uid came in with the URI.
#
$
uid
=
GETLOGIN
();
LOGGEDINORDIE
(
$uid
);
$
this_user
=
CheckLoginOrDie
();
$uid
=
$this_user
->
uid
(
);
#
# Of course verify that this uid has admin privs!
#
$isadmin
=
ISADMIN
(
$uid
);
$isadmin
=
ISADMIN
();
if
(
!
$isadmin
)
{
USERERROR
(
"You do not have admin privileges to approve projects!"
,
1
);
}
...
...
@@ -32,7 +32,7 @@ if (! $isadmin) {
# implies denying the project leader account, when there is just a single
# project pending for that project leader.
#
$query_result
=
DBQueryFatal
(
"SELECT
*
, "
.
$query_result
=
DBQueryFatal
(
"SELECT
pid_idx
, "
.
" DATE_FORMAT(created, '%m/%d/%y') as day_created "
.
" from projects "
.
"where approved='0' order by created desc"
);
...
...
@@ -64,36 +64,42 @@ echo "<tr>
</tr>
\n
"
;
while
(
$projectrow
=
mysql_fetch_array
(
$query_result
))
{
$pid
=
$projectrow
[
pid
];
$headuid
=
$projectrow
[
head_uid
];
$Purl
=
$projectrow
[
URL
];
$Pname
=
$projectrow
[
name
];
$Pcreated
=
$projectrow
[
day_created
];
$pid_idx
=
$projectrow
[
"pid_idx"
];
$Pcreated
=
$projectrow
[
"day_created"
];
$userinfo_result
=
DBQueryFatal
(
"SELECT * from users where uid='
$headuid
'"
);
if
(
!
(
$project
=
Project
::
Lookup
(
$pid_idx
)))
{
TBERROR
(
"Could not lookup project
$pid_idx
"
,
1
);
}
if
(
!
(
$leader
=
$project
->
GetLeader
()))
{
TBERROR
(
"Could not get leader for project
$pid_idx
"
,
1
);
}
$pid
=
$project
->
pid
();
$Purl
=
$project
->
URL
();
$Pname
=
$project
->
name
();
$headuid
=
$leader
->
uid
();
$name
=
$leader
->
name
();
$email
=
$leader
->
email
();
$title
=
$leader
->
title
();
$affil
=
$leader
->
affil
();
$phone
=
$leader
->
phone
();
$status
=
$leader
->
status
();
$row
=
mysql_fetch_array
(
$userinfo_result
);
$name
=
$row
[
usr_name
];
$email
=
$row
[
usr_email
];
$title
=
$row
[
usr_title
];
$affil
=
$row
[
usr_affil
];
$phone
=
$row
[
usr_phone
];
$status
=
$row
[
status
];
$apprproj_url
=
CreateURL
(
"approveproject_form"
,
$project
);
$showproj_url
=
CreateURL
(
"showproject"
,
$project
);
$showuser_url
=
CreateURL
(
"showuser"
,
$leader
);
echo
"<tr>
<td height=15 colspan=6></td>
</tr>
<tr>
<td align=center valign=center rowspan=2>
<A href='
approveproject_form.php3?pid=
$pid
'>
<A href='
$apprproj_url
'>
<img alt=
\"
o
\"
src=
\"
redball.gif
\"
></A></td>
<td rowspan=2>
<A href='
showproject.php3?pid=
$pid
'>
$pid
</A>
<A href='
$showproj_url
'>
$pid
</A>
<br>
$Pcreated
</td>
<td rowspan=2>
<A href='showuser.php3?target_uid=
$headuid
'>
$headuid
</A></td>
<A href='
$showuser_url
'>
$headuid
</A></td>
<td>
$name
"
;
if
(
$status
==
TBDB_USERSTATUS_NEWUSER
)
{
echo
" (<font color=red>unverified</font>)"
;
...
...
www/approveuser.php3
View file @
c108da6a
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003, 2005 University of Utah and the Flux Group.
# Copyright (c) 2000-2003, 2005
, 2006
University of Utah and the Flux Group.
# All rights reserved.
#
include
(
"defs.php3"
);
...
...
@@ -12,10 +12,10 @@ include("defs.php3");
PAGEHEADER
(
"New Users Approved"
);
#
# Only known and logged in users
can be verified
.
# Only known and logged in users.
#
$
uid
=
GETLOGIN
();
LOGGEDINORDIE
(
$uid
);
$
this_user
=
CheckLoginOrDie
();
$uid
=
$this_user
->
uid
(
);
$projectchecks
=
array
();
...
...
@@ -92,34 +92,42 @@ while (list ($header, $value) = each ($HTTP_POST_VARS)) {
#
# Verify an actual user that is being approved.
#
if
(
!
TBCurrentUser
(
$user
))
{
if
(
!
(
$target_user
=
User
::
Lookup
(
$user
)
))
{
TBERROR
(
"Trying to approve unknown user
$user
."
,
1
);
}
# Ditto the project.
if
(
!
(
$target_project
=
Project
::
Lookup
(
$project
)))
{
TBERROR
(
"Trying to approve user into unknown project
$project
."
,
1
);
}
# Ditto the group.
if
(
!
(
$target_group
=
Group
::
LookupByPidGid
(
$project
,
$group
)))
{
TBERROR
(
"Trying to approve user into unknown group
$group
"
,
1
);
}
#
# Check that the current uid has the necessary trust level
# to approver users in the project/group. Also, only project leaders
# can add someone to the default group as group_root.
#
if
(
!
TBProjAccessCheck
(
$uid
,
$project
,
$group
,
$TB_PROJECT_ADDUSER
))
{
if
(
!
$target_group
->
AccessCheck
(
$this_user
,
$TB_PROJECT_ADDUSER
))
{
USERERROR
(
"You are not allowed to approve users in "
.
"
$project
/
$group
!"
,
1
);
}
if
(
strcmp
(
$newtrust
,
"group_root"
)
==
0
&&
strcmp
(
$group
,
$project
)
==
0
)
{
if
(
!
TBProjAccessCheck
(
$uid
,
$project
,
$group
,
$TB_PROJECT_BESTOWGROUPROOT
))
{
USERERROR
(
"You do not have permission to add new users with group "
.
"root trust to the default group!"
,
1
);
}
if
(
$newtrust
==
"group_root"
&&
$project
==
$group
&&
!
$target_project
->
AccessCheck
(
$this_user
,
$TB_PROJECT_BESTOWGROUPROOT
))
{
USERERROR
(
"You do not have permission to add new users with group "
.
"root trust to the default group!"
,
1
);
}
#
# Check if already approved in the project/group. If already an
# approved member, something went wrong.
#
TBGroupMember
(
$user
,
$project
,
$group
,
$isapproved
);
$target_group
->
IsMember
(
$target_user
,
$isapproved
);
if
(
$isapproved
)
{
USERERROR
(
"
$user
is already an approved member of "
.
"
$project
/
$group
!"
,
1
);
...
...
@@ -146,12 +154,12 @@ while (list ($header, $value) = each ($HTTP_POST_VARS)) {
if
(
strcmp
(
$project
,
$group
)
==
0
&&
(
strcmp
(
$approval
,
"deny"
)
==
0
||
strcmp
(
$approval
,
"nuke"
)
==
0
))
{
$query_result
=
DBQueryFatal
(
"select gid from group_membership "
.
"where uid='
$user
' and pid='
$project
' and pid!=gid"
);
while
(
$row
=
mysql_fetch_array
(
$query_result
)
)
{
$gid
=
$
row
[
gid
]
;
# List of subgroup membership in this project
.
$grouplist
=
$target_project
->
GroupList
(
$target_user
);
foreach
(
$grouplist
as
$subgroup
)
{
$gid
=
$
subgroup
->
gid
()
;
#
# Create and indirect through post var for subgroup approval value.
...
...
@@ -183,7 +191,7 @@ while (list ($header, $value) = each ($HTTP_POST_VARS)) {
if
(
strcmp
(
$project
,
$group
)
==
0
)
continue
;
TBGroupMember
(
$user
,
$project
,
$project
,
$isapproved
);
$target_project
->
IsMember
(
$target_user
,
$isapproved
);
if
(
$isapproved
)
continue
;
...
...
@@ -236,6 +244,14 @@ while (list ($user, $value) = each ($projectchecks)) {
#echo "$user $pid $gid $trust $foo $bar<br>\n";
if
(
!
(
$target_group
=
Group
::
LookupByPidGid
(
$pid
,
$gid
)))
{
TBERROR
(
"Could not find group object for
$project
/
$group
"
,
1
);
}
if
(
!
(
$target_user
=
User
::
Lookup
(
$user
)))
{
TBERROR
(
"Could not find user object for
$user
"
,
1
);
}
#
# This looks for different trust levels in different subgroups
# of the same project. We are only checking the form arguments
...
...
@@ -258,8 +274,7 @@ while (list ($user, $value) = each ($projectchecks)) {
}
$pidlist
[
$pid
]
=
$pid
;
# Check vs. the database
TBCheckGroupTrustConsistency
(
$user
,
$pid
,
$gid
,
$trust
,
1
);
$target_group
->
CheckTrustConsistency
(
$target_user
,
$trust
,
1
);
}
reset
(
$value
);
...
...
@@ -298,27 +313,32 @@ while (list ($header, $value) = each ($POST_VARS_COPY)) {
# and we will change it to "unapproved" or "active", respectively.
# If the status is "active", we leave it alone.
#
$query_result
=
DBQueryFatal
(
"SELECT status,usr_email,usr_name from users where "
.
"uid='
$user
'"
);
if
(
mysql_num_rows
(
$query_result
)
==
0
)
{
TBERROR
(
"Unknown user
$user
"
,
1
);
if
(
!
(
$target_user
=
User
::
Lookup
(
$user
)))
{
TBERROR
(
"Trying to approve unknown user
$user
."
,
1
);
}
$row
=
mysql_fetch_row
(
$query_result
);
$curstatus
=
$row
[
0
];
$user_email
=
$row
[
1
];
$user_name
=
$row
[
2
];
$curstatus
=
$target_user
->
status
();
$user_email
=
$target_user
->
email
();
$user_name
=
$target_user
->
name
();
#echo "Status = $curstatus, Email = $user_email<br>\n";
# Ditto the project and group
if
(
!
(
$target_project
=
Project
::
Lookup
(
$project
)))
{
TBERROR
(
"Trying to approve user into unknown project
$project
."
,
1
);
}
if
(
!
(
$target_group
=
Group
::
LookupByPidGid
(
$project
,
$group
)))
{
TBERROR
(
"Trying to approve user into unknown group
$group
"
,
1
);
}
#
# Email info for current user.
#
TBUserInfo
(
$uid
,
$uid_name
,
$uid_email
);
#
$uid_name
=
$this_user
->
name
();
$uid_email
=
$this_user
->
email
();
#
# Email info for the proj/group leaders too.
#
$leaders
=
TBLeaderMailList
(
$project
,
$group
);
$leaders
=
$target_group
->
LeaderMailList
(
);
#
# Well, looks like everything is okay. Change the project membership
...
...
@@ -335,10 +355,7 @@ while (list ($header, $value) = each ($POST_VARS_COPY)) {
# Must delete the group_membership record since we require that the
# user reapply once denied. Send the luser email to let him know.
#
$query_result
=
DBQueryFatal
(
"delete from group_membership "
.
"where uid='
$user
' and pid='
$project
' and "
.
" gid='
$group
'"
);
$target_group
->
DeleteMember
(
$target_user
);
TBMAIL
(
"
$user_name
'
$user
' <
$user_email
>"
,
"Membership Denied in '
$project
/
$group
'"
,
...
...
@@ -365,21 +382,17 @@ while (list ($header, $value) = each ($POST_VARS_COPY)) {
# Must delete the group_membership record since we require that the
# user reapply once denied. Send the luser email to let him know.
#
$query_result
=
DBQueryFatal
(
"delete from group_membership "
.
"where uid='
$user
' and pid='
$project
' and "
.
" gid='
$group
'"
);
$target_group
->
DeleteMember
(
$target_user
);
#
# See if user is in any other projects (even unapproved).
#
$query_result
=
DBQueryFatal
(
"select * from group_membership where uid='
$user
'"
);
$project_list
=
$target_user
->
ProjectMembershipList
();
#
# If yes, then we cannot safely delete the user account.
#
if
(
mysql_num_rows
(
$query_resul
t
))
{
if
(
count
(
$project_lis
t
))
{
echo
"<p>
User
$user
was <b>denied</b> membership in
$project
/
$group
.
<br>
...
...
@@ -436,11 +449,9 @@ while (list ($header, $value) = each ($POST_VARS_COPY)) {
}
if
(
!
(
$user_interface
=
TBGetDefaultProjectUserInterface
(
$project
)))
$user_interface
=
TBDB_USER_INTERFACE_EMULAB
;
DBQueryFatal
(
"UPDATE users set "
.
" status='
$newstatus
', "
.
" user_interface='
$user_interface
' "
.
"WHERE uid='
$user
'"
);
$target_user
->
SetUserInterface
(
$user_interface
);
$target_user
->
SetStatus
(
$newstatus
);
#
# Create user account on control node.
...
...
www/approveuser_form.php3
View file @
c108da6a
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# Copyright (c) 2000-2003
, 2006
University of Utah and the Flux Group.
# All rights reserved.
#
include
(
"defs.php3"
);
...
...
@@ -9,13 +9,25 @@ include("defs.php3");
#
# Standard Testbed Header
#
PAGEHEADER
(
"New User
s Approval Form
"
);
PAGEHEADER
(
"New User
Approval
"
);
#
# Only known and logged in users can be verified.
#
$auth_usr
=
GETLOGIN
();
LOGGEDINORDIE
(
$auth_usr
);
$this_user
=
CheckLoginOrDie
();
$auth_usr
=
$this_user
->
uid
();
$auth_usridx
=
$this_user
->
uid_idx
();
#
# Find all of the groups that this person has project/group root in, and
# then in all of those groups, all of the people who are awaiting to be
# approved (status = none).
#
$approvelist
=
$this_user
->
ApprovalList
(
1
);
if
(
count
(
$approvelist
)
==
0
)
{
USERERROR
(
"You have no new project members who need approval."
,
1
);
}
echo
"
<h2>Approve new users in your Project or Group</h2>
...
...
@@ -79,44 +91,6 @@ echo "
\n
"
;
#
# Find all of the groups that this person has project/group root in, and
# then in all of those groups, all of the people who are awaiting to be
# approved (status = none).
#
# First off, just determine if this person has group/project root anywhere.
#
$query_result
=
DBQueryFatal
(
"SELECT pid FROM group_membership WHERE uid='
$auth_usr
' "
.
"and (trust='group_root' or trust='project_root')"
);
if
(
mysql_num_rows
(
$query_result
)
==
0
)
{
USERERROR
(
"You do not have Root permissions in any Project or Group."
,
1
);
}
#
# Okay, so this operation sucks out the right people by joining the
# group_membership table with itself. Kinda obtuse if you are not a natural
# DB guy. Sorry. Well, obtuse to me.
#
$query_result
=
DBQueryFatal
(
"select g.* from group_membership as authed "
.
"left join group_membership as g on "
.
" g.pid=authed.pid and g.gid=authed.gid "
.
"left join users as u on u.uid=g.uid "
.
"where u.status!='"
.
TBDB_USERSTATUS_UNVERIFIED
.
"' and "
.
" u.status!='"
.
TBDB_USERSTATUS_NEWUSER
.
"' and g.uid!='
$auth_usr
' and "
.
" g.trust='"
.
TBDB_TRUSTSTRING_NONE
.
"' "
.
" and authed.uid='
$auth_usr
' and "
.
" (authed.trust='group_root' or "
.
" authed.trust='project_root') "
.
"ORDER BY g.uid,g.pid,g.gid"
);
if
(
mysql_num_rows
(
$query_result
)
==
0
)
{
USERERROR
(
"You have no new project members who need approval."
,
1
);
}
#
# Now build a table with a bunch of selections. The thing to note about the
# form inside this table is that the selection fields are constructed with
...
...
@@ -151,11 +125,22 @@ echo "<tr>
echo
"<form action='approveuser.php3' method='post'>
\n
"
;
while
(
$usersrow
=
mysql_fetch_array
(
$query_result
))
{
$newuid
=
$usersrow
[
uid
];
$pid
=
$usersrow
[
pid
];
$gid
=
$usersrow
[
gid
];
$date_applied
=
$usersrow
[
date_applied
];
while
(
list
(
$uid_idx
,
$grouplist
)
=
each
(
$approvelist
))
{
if
(
!
(
$user
=
User
::
Lookup
(
$uid_idx
)))
{
TBERROR
(
"Could not lookup user
$uid_idx
"
,
1
);
}
# Iterate over groups for this user.
for
(
$i
=
0
;
$i
<
count
(
$grouplist
);
$i
++
)
{
$group
=
$grouplist
[
$i
];
$newuid
=
$user
->
uid
();
$gid
=
$group
->
gid
();
$gid_idx
=
$group
->
gid_idx
();
$pid
=
$group
->
pid
();
$pid_idx
=
$group
->
pid_idx
();
$group
->
MemberShipInfo
(
$user
,
$trust
,
$date_applied
,
$date_approved
);
#
# Cause this field was added late and might be null.
...
...
@@ -164,21 +149,17 @@ while ($usersrow = mysql_fetch_array($query_result)) {
$date_applied
=
"--"
;
}
$userinfo_result
=
DBQueryFatal
(
"SELECT * from users where uid='
$newuid
'"
);
$row
=
mysql_fetch_array
(
$userinfo_result
);
$name
=
$row
[
usr_name
];
$email
=
$row
[
usr_email
];
$title
=
$row
[
usr_title
];
$affil
=
$row
[
usr_affil
];
$addr
=
$row
[
usr_addr
];
$addr2
=
$row
[
usr_addr2
];
$city
=
$row
[
usr_city
];
$state
=
$row
[
usr_state
];
$zip
=
$row
[
usr_zip
];
$country
=
$row
[
usr_country
];
$phone
=
$row
[
usr_phone
];
$name
=
$user
->
name
();
$email
=
$user
->
email
();
$title
=
$user
->
title
();
$affil
=
$user
->
affil
();
$addr
=
$user
->
addr
();
$addr2
=
$user
->
addr2
();
$city
=
$user
->
city
();
$state
=
$user
->
state
();
$zip
=
$user
->
zip
();
$country
=
$user
->
country
();
$phone
=
$user
->
phone
();
echo
"<tr>
<td rowspan=2>
$newuid
</td>
...
...
@@ -195,14 +176,16 @@ while ($usersrow = mysql_fetch_array($query_result)) {
</td>
<td rowspan=2>
<select name=
\"
$newuid
\$\$
trust-
$pid
/
$gid
\"
>
\n
"
;
if
(
TBCheckGroupTrustConsistency
(
$newuid
,
$pid
,
$gid
,
"user"
,
0
))
{