~ubuntu-branches/ubuntu/precise/boinc/precise

« back to all changes in this revision

Viewing changes to doc/help_vol.php

Tags: 6.12.8+dfsg-1
* New upstream release.
* Simplified debian/rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
2
 
3
3
require_once("docutil.php");
 
4
require_once("../html/inc/util.inc");
4
5
require_once("help_funcs.php");
5
6
require_once("help_db.php");
6
7
 
7
 
$volid = $_GET['volid'];
 
8
$volid = get_int('volid');
8
9
 
9
10
$vol = vol_lookup($volid);
10
11
 
11
 
function is_valid_email_addr($addr) {
12
 
    $pattern = '/^([^@]+)@([^@\.]+)\.([^@]{2,})$/';
13
 
    $match = preg_match($pattern, $addr);
14
 
    return (bool) $match;
15
 
}
16
 
 
17
12
function show_info($vol) {
18
13
    $x = "<span class=note> Country: $vol->country\n";
19
14
    if ($vol->availability) {
56
51
        ";
57
52
    }
58
53
 
59
 
    echo "
60
 
    <p>
61
 
    <span class=note>Note: BOINC helpers are unpaid volunteers.
62
 
    Their advise is not endorsed by BOINC
63
 
    or the University of California.</span>
64
 
    <hr>
65
 
    ";
 
54
    echo " <p>";
 
55
    help_warning();
 
56
    echo " <hr> ";
66
57
}
67
58
 
68
59
function show_rating($vol, $rating) {
97
88
        input("email_addr", "")
98
89
    );
99
90
    list_item("Subject<br><span class=note>Include 'BOINC' in the subject so $vol->name will know it's not spam</span>", input("subject", ""));
100
 
    list_item("Message<br><span class=note>Please including
101
 
        a detailed description of the problem you're experiencing.</span>",
 
91
    list_item("Message<br><span class=note>
 
92
            
 
93
        Please include a detailed description of the problem
 
94
        you're experiencing.
 
95
        If possible, include the contents of BOINC's message log.
 
96
        </span>",
102
97
        textarea("message", "")
103
98
    );
104
99
    list_item("", "<input type=submit name=send_email value=OK>");
118
113
    $subject = stripslashes($_GET['subject']);
119
114
    $vol = vol_lookup($volid);
120
115
    if (!$vol || $vol->hide) {
121
 
        error_page("No such volunteer $volid");
 
116
        boinc_error_page("No such volunteer $volid");
122
117
    }
123
118
    $msg = stripslashes($_GET['message']);
124
119
    if (!$msg) {
125
 
        error_page("You must supply a message");
 
120
        boinc_error_page("You must supply a message");
126
121
    }
127
122
    $body = "The following message was sent by a BOINC Help user.\n";
128
123
    $email_addr = $_GET['email_addr'];
129
124
    if (!is_valid_email_addr($email_addr)) {
130
 
        error_page("You must specify a valid email address");
 
125
        boinc_error_page("You must specify a valid email address");
131
126
    }
132
127
    $reply = "\r\nreply-to: $email_addr";
133
128
    $body .= "\n\n";
141
136
    $volid = $_GET['volid'];
142
137
    $vol = vol_lookup($volid);
143
138
    if (!$vol) {
144
 
        error_page("No such volunteer $volid");
 
139
        boinc_error_page("No such volunteer $volid");
145
140
    }
146
141
    $x = $_GET['rating'];
147
142
    if ($x==null) {
148
 
        error_page("no rating given");
 
143
        boinc_error_page("no rating given");
149
144
    }
150
145
    $rating = (int) $x;
151
146
    if ($rating < 0 || $rating > 5) {
152
 
        error_page("bad rating");
 
147
        boinc_error_page("bad rating");
153
148
    }
154
149
    $comment = stripslashes($_GET['comment']);
155
150
    $r = null;
173
168
    }
174
169
    if (!$retval) {
175
170
        echo mysql_error();
176
 
        error_page("database error");
 
171
        boinc_error_page("database error");
177
172
    }
178
173
    page_head("Feedback recorded");
179
174
    echo "Your feedback has been recorded.  Thanks.
198
193
        <script type=\"text/javascript\" src=\"http://download.skype.com/share/skypebuttons/js/skypeCheck.js\"></script>
199
194
        <img src=images/help/$image><p>
200
195
    ";
201
 
    echo "<table class=box cellpadding=8 width=100%><tr><td>";
 
196
    echo "<table class=box cellpadding=8 width=100%><tr><td width=40%>";
202
197
    if (online($status)) {
203
198
        live_contact($vol);
204
199
    }