approveproject_form.php3 4.25 KB
Newer Older
1
<?php
Leigh B. Stoller's avatar
Leigh B. Stoller committed
2 3
#
# EMULAB-COPYRIGHT
4
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
Leigh B. Stoller's avatar
Leigh B. Stoller committed
5 6
# All rights reserved.
#
7
include("defs.php3");
8
include("showstuff.php3");
9

10 11 12 13 14
#
# Standard Testbed Header
#
PAGEHEADER("New Project Approval");

15 16 17
#
# Only known and logged in users can do this.
#
18
$uid = GETLOGIN();
19 20 21 22 23
LOGGEDINORDIE($uid);

#
# Of course verify that this uid has admin privs!
#
24 25
$isadmin = ISADMIN($uid);
if (! $isadmin) {
26 27 28
    USERERROR("You do not have admin privledges to approve projects!", 1);
}

29 30 31 32 33 34 35 36
#
# Verify arguments.
# 
if (!isset($pid) ||
    strcmp($pid, "") == 0) {
    USERERROR("You must provide a project ID.", 1);
}

37
#
38
# Check to make sure thats this is a valid PID.
39
#
40 41
if (! TBValidProject($pid)) {
    USERERROR("The project $pid is not a valid project.", 1);
42 43
}

44
echo "<center><h3>You have the following choices:</h3></center>
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
      <table align=center border=0>
        <tr>
            <td>Deny</td>
            <td>-</td>
            <td>Deny project application (kills project records)</td>
        </tr>

        <tr>
            <td>Destroy</td>
            <td>-</td>
            <td>Deny project application, and kill the user account</td>
        </tr>

        <tr>
            <td>Approve</td>
            <td>-</td>
            <td>Approve the project</td>
        </tr>

64 65 66 67 68 69
        <tr>
            <td>More Info</td>
            <td>-</td>
            <td>Ask for more info</td>
        </tr>

70 71 72 73 74 75 76 77
        <tr>
            <td>Postpone</td>
            <td>-</td>
            <td>Twiddle your thumbs some more</td>
        </tr>
      </table>\n";

#
78
# Show stuff
79
#
80 81 82 83 84 85 86 87 88 89
SHOWPROJECT($pid, $uid);

TBProjLeader($pid, $projleader);

echo "<center>
      <h3>Project Leader Information</h3>
      </center>
      <table align=center border=0>\n";

SHOWUSER($projleader);
90

91
#
92
# Now put up the menu choice along with a text box for an email message.
93
#
94 95 96 97
echo "<center>
      <h3>What would you like to do?</h3>
      </center>
      <table align=center border=1>
98
      <form action='approveproject.php3?pid=$pid' method='post'>\n";
99 100

echo "<tr>
101 102 103 104 105 106 107 108 109 110 111
          <td align=center>
              <select name=approval>
                      <option value='postpone'>Postpone</option>
                      <option value='approve'>Approve</option>
                      <option value='moreinfo'>More Info</option>
                      <option value='deny'>Deny</option>
                      <option value='destroy'>Destroy</option>
              </select>
          </td>
       </tr>\n";

112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
#
# Allow the approver to change the project's head UID - gotta find everyone in
# the default group, first
#
echo "<tr>
          <td align=center>
	      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";
}
echo "        </select>
          </td>
       </tr>\n";


133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
#
# XXX
# Temporary Plab hack.
# See if remote nodes requested and put up checkboxes to allow override.
#
$query_result =
    DBQueryFatal("select num_pcplab,num_ron from projects where pid='$pid'");

$row = mysql_fetch_array($query_result);
$num_pcplab = $row[num_pcplab];
$num_ron    = $row[num_ron];

if ($num_ron || $num_pcplab) {
	echo "<tr>
                 <td align=center>\n";
	if ($num_pcplab) {
		echo "<input type=checkbox value=Yep checked
                                 name=pcplab_okay>
                                 Allow Plab &nbsp\n";
	}
	if ($num_ron) {
		echo "<input type=checkbox value=Yep checked
                                 name=ron_okay>
                                 Allow RON &nbsp\n";
	}
	echo "   </td>
              </tr>\n";
}
161 162

echo "<tr>
163 164
          <td>Use the text box (70 columns wide) to add a message to the
              email notification. </td>
165 166
      </tr>\n";

167
echo "<tr>
168
         <td align=center class=left>
169
             <textarea name=message rows=15 cols=70></textarea>
170 171 172 173 174
         </td>
      </tr>\n";

echo "<tr>
          <td align=center colspan=2>
175 176 177 178
              <b><input type='submit' value='Submit' name='OK'></td>
      </tr>
      </form>
      </table>\n";
179 180 181 182 183

#
# Standard Testbed Footer
# 
PAGEFOOTER();
184
?>