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

« back to all changes in this revision

Viewing changes to html/user/host_delete.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
1
<?php
2
2
 
3
 
require_once("../inc/db.inc");
 
3
require_once("../inc/boinc_db.inc");
4
4
require_once("../inc/util.inc");
5
5
require_once("../inc/host.inc");
6
6
 
7
 
function fail($msg) {
8
 
    echo "<h2>Error: $msg</h2>";
9
 
    page_tail();
10
 
    exit();
11
 
}
12
 
 
13
 
function get_host($hostid, $user) {
14
 
    return $host;
15
 
}
16
 
 
17
 
db_init();
18
7
$user = get_logged_in_user();
19
8
 
20
9
$hostid = get_int("hostid");
21
 
$host = lookup_host($hostid);
 
10
$host = BoincHost::lookup_id($hostid);
22
11
if (!$host || $host->userid != $user->id) {
23
12
    error_page("We have no record of that computer.");
24
13
}
25
14
 
26
15
$nresults = host_nresults($host);
27
16
if ($nresults == 0) {
28
 
    mysql_query("delete from host where id=$hostid");
 
17
    $host->delete();
29
18
} else {
30
19
    error_page(
31
20
        "You can not delete our record of this computer because our
32
21
        database still contains work for it.
33
22
        You must wait a few days until the work for this computer
34
 
        have been deleted from the project database."
 
23
        has been deleted from the project database."
35
24
    );
36
25
}
37
26
page_head("Delete record of computer");