-
Notifications
You must be signed in to change notification settings - Fork 9
/
create_boinc_wide_team.php
executable file
·65 lines (51 loc) · 1.88 KB
/
create_boinc_wide_team.php
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
#! /usr/bin/env php
<?php
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2016 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
// Script to create a BOINC-wide team and corresponding account.
// Probably useful only to me.
// usage: create_boinc_wide_team.php username emailaddr teamname
require_once("../inc/user_util.inc");
require_once("../inc/team.inc");
if ($argc != 4) die("usage: create_boinc_wide_team username email teamname\n");
$user_name = $argv[1];
$email_addr = $argv[2];
$team_name = $argv[3];
$user = BoincUser::lookup_email_addr($email_addr);
if (!$user) {
$e = strtolower($email_addr);
$passwd_hash = md5("foobar".$e);
$user = make_user($e, $user_name, $passwd_hash);
if (!$user) die("can't create user\n");
echo "created user $user->id\n";
}
$team = make_team($user->id, $team_name, "", "", "", "", "");
if (!$team) die("can't create team\n");
echo "created team $team->id\n";
$retval = $user->update("email_validated=1, teamid=$team->id");
if (!$retval) {
die("can't update user\n");
}
echo "I created a BOINC-wide team named '$team_name',
and an account with email address '$email_addr'
and password 'foobar'.
You can log in here:
https://boinc.berkeley.edu/teams/home.php
Let me know of any problems.
-- David
";
?>