#! /usr/bin/env php . // 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.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]; $passwd_hash = md5("foobar".$email_addr); $user = make_user($email_addr, $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 "done\n"; ?>