Issues (1963)

html/user/show_apps.php (1 issue)

Labels
Severity
1
<?php
2
3
require_once('../inc/util.inc');
4
require_once('../inc/buda.inc');
5
require_once('../inc/keywords.inc');
6
require_once('../project/remote_apps.inc');
7
require_once('../project/submitters.inc');
8
9
function show_submitters() {
10
    global $submitters;
11
    if (!$submitters) return;
12
    echo '<h2>Researchers</h2>';
13
    foreach ($submitters as $s) {
14
        if (empty($s->picture)) {
15
            $s->picture = 'images/user.png';
16
        }
17
        echo sprintf(
18
            '<img height=100px src=%s>
19
            <p>Name: %s
20
            <br>Research interests: %s
21
            <br>Location: %s
22
            <p>
23
            ',
24
            $s->picture,
25
            $s->name,
26
            $s->interests,
27
            kw_array_to_str($s->loc_kw, '; ')
28
        );
29
    }
30
}
31
32
function show_buda_apps() {
33
    $apps = get_buda_apps();
34
    foreach ($apps as $app) {
35
        $desc = get_buda_desc($app);
36
        table_row(
37
            $desc->long_name,
38
            $desc->description,
39
            kw_array_to_str($desc->sci_kw),
40
            empty($desc->url)?'':"<a href=$desc->url>View</a>",
41
            'Yes'
42
        );
43
    }
44
}
45
46
function main() {
47
    global $remote_apps;
48
    page_head("Apps");
49
    echo sprintf('%s distributes jobs for the following applications:<p>', PROJECT);
50
    start_table('table-striped');
51
    table_header(
52
        'Name',
53
        'Description',
54
        'Science keywords',
55
        'Web page',
56
        'Docker required?<br><small><a href=https://github.com/BOINC/boinc/wiki/Installing-Docker>Details</a>'
57
    );
58
    foreach ($remote_apps as $category => $apps) {
59
        if (strstr($category, 'Docker')) {
60
            show_buda_apps();
61
        } else {
62
            foreach ($apps as $app) {
63
                table_row(
64
                    $app->long_name,
65
                    $app->description,
66
                    kw_array_to_str($app->sci_kw),
67
                    "<a href=$app->url>View</a>",
68
                    ''
69
                );
70
            }
71
            echo '</ul>';
72
        }
73
    }
74
    end_table();
75
    $user = get_logged_in_user(false);
0 ignored issues
show
Are you sure the assignment to $user is correct as get_logged_in_user(false) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
76
    if ($user) {
77
        $us = BoincUserSubmit::lookup_userid($user->id);
78
        if (!$us) {
79
            show_button("apply.php", "Apply to submit jobs");
80
        }
81
    } else {
82
        show_button("signup.php", "Register to submit jobs");
83
    }
84
    show_submitters();
85
    page_tail();
86
}
87
88
main();
89
90
?>
91