~ubuntu-branches/ubuntu/lucid/boinc/lucid

« back to all changes in this revision

Viewing changes to html/user/weak_auth.php

  • Committer: Bazaar Package Importer
  • Author(s): Frank S. Thomas, Frank S. Thomas
  • Date: 2008-05-31 08:02:47 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20080531080247-4ce890lp2rc768cr
Tags: 6.2.7-1
[ Frank S. Thomas ]
* New upstream release.
  - BOINC Manager: Redraw disk usage charts immediately after connecting to
    a (different) client. (closes: 463823)
* debian/copyright:
  - Added the instructions from debian/README.Debian-source about how
    repackaged BOINC tarballs can be reproduced because DevRef now
    recommends to put this here instead of in the afore-mentioned file.
  - Updated for the new release.
* Removed the obsolete debian/README.Debian-source.
* For consistency upstream renamed the core client and the command tool
  ("boinc_client" to "boinc" and "boinc_cmd" to "boinccmd"). Done the same
  in all packages and created symlinks with the old names for the binaries
  and man pages. Also added an entry in debian/boinc-client.NEWS explaining
  this change.
* debian/rules: Do not list Makefile.ins in the clean target individually,
  just remove all that can be found.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
require_once("../inc/util.inc");
 
4
require_once("../inc/user.inc");
 
5
 
 
6
$url = parse_config(get_config(), "<master_url>");
 
7
 
 
8
$user = get_logged_in_user();
 
9
page_head("Weak account key");
 
10
 
 
11
$weak_auth = weak_auth($user);
 
12
 
 
13
//this is somewhat a rewrite of escape_url_readable from str_util.C - maybe it 
 
14
//should be moved into its own function instead of inline here
 
15
 
 
16
//cut off the http://
 
17
$idx = strpos($url, '://');
 
18
if ($idx !== FALSE) {
 
19
        $url = substr($url, $idx+strlen('://'));
 
20
}
 
21
//convert invalid characters into underscores
 
22
for ($i=0; $i<strlen($url); $i++) {
 
23
        $c = $url[$i];
 
24
        if (ctype_alnum($c) || $c == '.' || $c == '-' || $c == '_') {
 
25
                //noop; easier than inverting the condition
 
26
        } else {
 
27
                //in-place modification
 
28
                $url[$i] = '_';
 
29
        }
 
30
}
 
31
//remove trailing underscore(s)
 
32
$account_file = "account_" . rtrim($url, '_') . ".xml";
 
33
 
 
34
echo "<p>",tra("Your 'weak account key' lets you attach computers to your account on this project, without giving the ability to log in to your account or to change it in any way."), " ",
 
35
        tra("This mechanism works only with projects that have upgraded their server software 7 Dec 2007 or later."), "</p>",
 
36
        "<p>", tra("Your weak account key for this project is:"), "</p>",
 
37
        "<pre>$weak_auth</pre>",
 
38
        "<p>" , tra("To use your weak account key on a given host, find or create the 'account file' for this project. This file has a name of the form <b>account_PROJECT_URL.xml</b>. The account file for %1 is <b>%2</b>.", PROJECT, $account_file), "</p>",
 
39
        "<p>", tra("Create this file if needed. Set its contents to:"), "</p>",
 
40
        "<pre>",
 
41
        htmlspecialchars(
 
42
"<account>
 
43
        <master_url>PROJECT_URL</master_url>
 
44
        <authenticator>WEAK_ACCOUNT_KEY</authenticator>
 
45
</account>"),
 
46
        "</pre>",
 
47
        "<p>", tra("Your weak account key is a function of your password. If you change your password, your weak account key changes, and your previous weak account key becomes invalid."), "</p>"
 
48
;
 
49
 
 
50
page_tail();
 
51
?>