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

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

14 15 16
#
# Only known and logged in users can do this.
#
17 18 19
$this_user = CheckLoginOrDie();
$uid       = $this_user->uid();
$isadmin   = ISADMIN();
20 21 22 23

#
# Of course verify that this uid has admin privs!
#
24
if (! $isadmin) {
Chad Barb's avatar
Chad Barb committed
25
    USERERROR("You do not have admin privileges to approve projects!", 1);
26 27
}

28
#
29 30 31
# Verify page arguments.
#
$reqargs = RequiredPageArguments("project", PAGEARG_PROJECT);
32

33
#
34
# Check to make sure thats this is a valid PID.
35
#
36 37
if (! ($this_project = $reqargs["project"])) {
    USERERROR("Unknown project", 1);
38
}
39 40
$pid = $this_project->pid();
$projleader = $this_project->GetLeader();
41

42
echo "<center><h3>You have the following choices:</h3></center>
43
      <table class=stealth align=center border=0>
44
        <tr>
45 46 47
            <td class=stealth>Deny</td>
            <td class=stealth>-</td>
            <td class=stealth>Deny project application (kills project records)</td>
48 49 50
        </tr>

        <tr>
51 52 53
            <td class=stealth>Destroy</td>
            <td class=stealth>-</td>
            <td class=stealth>Deny project application, and kill the user account</td>
54 55
        </tr>

56
        <tr>
57 58 59
            <td class=stealth>Approve</td>
            <td class=stealth>-</td>
            <td class=stealth>Approve the project</td>
60 61
        </tr>

62
        <tr>
63 64 65
            <td class=stealth>More Info</td>
            <td class=stealth>-</td>
            <td class=stealth>Ask for more info</td>
66 67
        </tr>

68
        <tr>
69 70 71
            <td class=stealth>Postpone</td>
            <td class=stealth>-</td>
            <td class=stealth>Twiddle your thumbs some more</td>
72 73 74 75
        </tr>
      </table>\n";

#
76
# Show stuff
77
#
78
$this_project->Show();
79

80
$projleader = $this_project->GetLeader();
81 82 83 84 85 86

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

87
$projleader->Show();
88

89 90 91
#
# Check to make sure that the head user is 'unapproved' or 'active'
#
92
$headstatus = $projleader->status();
93 94 95 96 97 98 99
if (!strcmp($headstatus,TBDB_USERSTATUS_UNAPPROVED) ||
	!strcmp($headstatus,TBDB_USERSTATUS_ACTIVE)) {
    $approvable = 1;
} else {
    $approvable = 0;
}

100
#
101
# Now put up the menu choice along with a text box for an email message.
102
#
103 104 105 106
echo "<center>
      <h3>What would you like to do?</h3>
      </center>
      <table align=center border=1>
107 108
      <form action='" . CreateURL("approveproject", $project) .
             "' method='post'>\n";
109 110

echo "<tr>
111 112
          <td align=center>
              <select name=approval>
113 114 115 116 117
                      <option value='postpone'>Postpone</option>";
if ($approvable) {
    echo "                  <option value='approve'>Approve</option>";
}
echo "
118 119 120
                      <option value='moreinfo'>More Info</option>
                      <option value='deny'>Deny</option>
                      <option value='destroy'>Destroy</option>
121 122 123 124 125 126
              </select>";
if (!$approvable) {
	echo "              <br><b>WARNING:</b> Project cannot be approved,";
	echo"               since head user has not been verified";
}
echo "
127 128 129
          </td>
       </tr>\n";

130 131 132 133 134 135 136
echo "<tr>
         <td align=center>
	    <input type=checkbox value=Yep
                     name=silent>Silent (no email sent for deny,destroy)
	 </td>
       </tr>\n";

137
#
138
# Allow the approver to change the projects head UID - gotta find everyone in
139 140 141 142 143 144 145
# the default group, first
#
echo "<tr>
          <td align=center>
	      Head UID:
              <select name=head_uid>
                      <option value=''>(Unchanged)</option>";
146 147 148 149 150 151 152 153

$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";
154 155 156 157 158
}
echo "        </select>
          </td>
       </tr>\n";

159 160 161 162 163 164 165 166 167 168 169 170 171 172
#
# Set the user interface.
#
echo "<tr>
          <td align=center>
              Default User Interface:
              <select name=user_interface>\n";

foreach ($TBDB_USER_INTERFACE_LIST as $interface) {
    echo "            <option value='$interface'>$interface</option>\n";
}
echo "        </select>
          </td>
       </tr>\n";
173

174 175 176 177 178
#
# XXX
# Temporary Plab hack.
# See if remote nodes requested and put up checkboxes to allow override.
#
179
# These are now booleans, not actual counts.
180 181
$num_pcplab = $this_project->num_pcplab();
$num_ron    = $this_project->num_ron();
182 183 184 185 186 187 188 189 190 191 192 193

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>
194
                                 Allow RON (PCWA) &nbsp\n";
195 196 197 198
	}
	echo "   </td>
              </tr>\n";
}
199 200

echo "<tr>
201 202
          <td>Use the text box (70 columns wide) to add a message to the
              email notification. </td>
203 204
      </tr>\n";

205
echo "<tr>
206
         <td align=center class=left>
207
             <textarea name=message rows=15 cols=70></textarea>
208 209 210 211 212
         </td>
      </tr>\n";

echo "<tr>
          <td align=center colspan=2>
213 214 215 216
              <b><input type='submit' value='Submit' name='OK'></td>
      </tr>
      </form>
      </table>\n";
217 218 219 220 221

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