-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnewteam4.php
More file actions
87 lines (79 loc) · 2.64 KB
/
newteam4.php
File metadata and controls
87 lines (79 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
// $Id: newteam4.php,v 1.16 2005/12/07 05:44:01 fiddles Exp $
include "../etc/global.inc";
include "../etc/project.inc";
include "../etc/team.php";
include "../etc/teamstats.php";
unset($proj_name);
$lastupdate = last_update('t');
if ($readonly_tmedit != 0) {
$title = "Team Creation Disabled";
include "../templates/header.inc";
include "../templates/readonly.inc";
print "</body></html";
exit;
}
$title = "Adding Team data to stats...";
include "../templates/header.inc";
// Create the team object to save the information
$newteam = new Team($gdb, $gproj);
$newteam->set_name($_GET['name']);
$newteam->set_contact_name($_GET['contactname']);
$newteam->set_contact_email($_GET['contactemail']);
// Build a random password
$passstring = "0Aa1Bb2Cc3Dd4Ee5Ff6Gg7Hh8Ii9JjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz";
$password = "";
for($i = 0; $i < 8; $i++)
{
$password .= substr($passstring, rand(0,strlen($passstring)-1), 1);
}
$newteam->set_password($password);
$retVal = $newteam->save();
if($retVal != "")
{
// validation error
print "<br><h2>Validation Errors occurred:</h2><br>";
print str_replace("\n", "<br>", $retVal);
print "<br><a href=\"javascript:history.back()\">Go back and correct the problem</a><br>";
//include("../templates/footer.inc");
exit(0);
}
else
{
// Save was successful
}
$password = $newteam->get_password();
$teamnum = $newteam->get_id();
print "
<div style=\"text-align: center\">
<h2>Saving your new team...</h2>
<h1>Your team number is:</h1>
<p>
<h2 style=\"color: #770000\">$teamnum</h2>
</p>
<h1>Your team configuration password is:</h1>
<p>
<h2 style=\"color: #770000\">$password</h2>
</p>
<p>
Your team will <span style=\"font-weight: bold; color: #770000\">not</span> be listed in the stats database <span style=\"font-weight: bold;\">until you've joined it</span>
</p>
<p>
After you join your team, it will show up after the next stats run.
</p>
<p>
You may edit your team information by using this link:
<br>
<a href=\"tmedit.php?team=$teamnum&pass=$password\">http://stats.distributed.net/team/tmedit.php?team=$teamnum&pass=$password</a>
</p>
<p>
You should also join your team by using this link:
<br>
This link will require you to know your email address and your
participant password.
<br>
<a href=\"/participant/pjointeam.php?team=$teamnum\">http://stats.distributed.net/participant/pjointeam.php?team=$teamnum</a>
</p>
</div>";
include "../templates/footer.inc";
?>