2007-12-07 23:23:25 +00:00
|
|
|
<?php
|
2008-08-05 22:43:14 +00:00
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2008 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/>.
|
2007-12-07 23:23:25 +00:00
|
|
|
|
|
|
|
require_once("../inc/util.inc");
|
2008-01-14 16:32:34 +00:00
|
|
|
require_once("../inc/user.inc");
|
2007-12-07 23:23:25 +00:00
|
|
|
|
2007-12-09 04:13:24 +00:00
|
|
|
$url = parse_config(get_config(), "<master_url>");
|
|
|
|
|
2007-12-07 23:23:25 +00:00
|
|
|
$user = get_logged_in_user();
|
2012-04-19 07:36:47 +00:00
|
|
|
page_head(tra("Account keys"));
|
2007-12-07 23:23:25 +00:00
|
|
|
|
2008-01-14 16:32:34 +00:00
|
|
|
$weak_auth = weak_auth($user);
|
2007-12-07 23:23:25 +00:00
|
|
|
|
2008-07-18 20:59:59 +00:00
|
|
|
// figure out the name of this project's account file.
|
2007-12-09 04:13:24 +00:00
|
|
|
|
2008-07-18 20:59:59 +00:00
|
|
|
// strip http://
|
2012-04-19 07:36:47 +00:00
|
|
|
//
|
2007-12-09 04:13:24 +00:00
|
|
|
$idx = strpos($url, '://');
|
2008-07-18 20:59:59 +00:00
|
|
|
if ($idx) {
|
2010-11-04 18:20:57 +00:00
|
|
|
$url = substr($url, $idx+strlen('://'));
|
2007-12-09 04:13:24 +00:00
|
|
|
}
|
2008-07-18 20:59:59 +00:00
|
|
|
|
2012-04-19 07:36:47 +00:00
|
|
|
// convert invalid characters into underscores
|
|
|
|
//
|
2007-12-09 04:13:24 +00:00
|
|
|
for ($i=0; $i<strlen($url); $i++) {
|
2010-11-04 18:20:57 +00:00
|
|
|
$c = $url[$i];
|
|
|
|
if (!ctype_alnum($c) && $c != '.' && $c != '-' && $c != '_') {
|
|
|
|
$url[$i] = '_';
|
|
|
|
}
|
2007-12-09 04:13:24 +00:00
|
|
|
}
|
2012-04-19 07:36:47 +00:00
|
|
|
|
2007-12-09 04:13:24 +00:00
|
|
|
//remove trailing underscore(s)
|
2012-04-19 07:36:47 +00:00
|
|
|
//
|
2007-12-09 04:13:24 +00:00
|
|
|
$account_file = "account_" . rtrim($url, '_') . ".xml";
|
|
|
|
|
2011-02-03 23:27:30 +00:00
|
|
|
echo "<table><tr><td>",
|
2012-04-19 07:36:47 +00:00
|
|
|
tra("You can access your account either by using your email address and password,
|
|
|
|
or by using an assigned 'account key'.
|
|
|
|
Your account key is:"),
|
|
|
|
"<pre>$user->authenticator</pre>
|
|
|
|
<p>",
|
|
|
|
tra("This key can be used to:"),
|
|
|
|
"<ul>
|
|
|
|
<li><a href=get_passwd.php>",tra("log in to your account on the web"),"</a>;
|
|
|
|
<li>",
|
|
|
|
tra("to attach a computer to your account without using the BOINC Manager.
|
|
|
|
To do so, install BOINC,
|
|
|
|
create a file named %1 in the BOINC
|
|
|
|
data directory, and set its contents to:","<b>$account_file</b>"),"
|
|
|
|
<pre>",
|
2010-11-04 18:20:57 +00:00
|
|
|
htmlspecialchars(
|
2007-12-09 04:13:24 +00:00
|
|
|
"<account>
|
2011-12-24 05:19:21 +00:00
|
|
|
<master_url>".URL_BASE."</master_url>
|
|
|
|
<authenticator>".$weak_auth."</authenticator>
|
2007-12-09 04:13:24 +00:00
|
|
|
</account>"),
|
2012-04-19 07:36:47 +00:00
|
|
|
"</pre>
|
|
|
|
</ul>
|
|
|
|
<h2>", tra("Weak account key"), "</h2>",
|
|
|
|
tra("Your 'weak account key' can be used to attach computers to your account
|
|
|
|
as described above, but cannot be used to log in to your account or change it in any way.
|
|
|
|
If you want to attach untrusted or insecure computers to your account,
|
|
|
|
do so using your weak account key.
|
|
|
|
Your weak account key is:"),"
|
|
|
|
<pre>$weak_auth</pre>
|
|
|
|
<p>",
|
|
|
|
tra("If you change your password, your weak account key changes, and your previous weak account key becomes invalid."),"
|
|
|
|
</td></tr></table>"
|
2007-12-09 04:13:24 +00:00
|
|
|
;
|
2007-12-07 23:23:25 +00:00
|
|
|
|
|
|
|
page_tail();
|
|
|
|
?>
|