@@ -26,6 +26,9 @@ discard block |
||
26 | 26 | // we need to give a unique physical name based on its content. |
27 | 27 | // Prepend the jf_ to make the origin of the file clear |
28 | 28 | // |
29 | +/** |
|
30 | + * @param string $md5 |
|
31 | + */ |
|
29 | 32 | function job_file_name($md5) { |
30 | 33 | return "jf_$md5"; |
31 | 34 | } |
@@ -179,12 +182,20 @@ discard block |
||
179 | 182 | return $batch_td_size; |
180 | 183 | } |
181 | 184 | |
185 | +/** |
|
186 | + * @param integer $i |
|
187 | + * |
|
188 | + * @return double |
|
189 | + */ |
|
182 | 190 | function boinc_get_output_file_url($user, $result, $i) { |
183 | 191 | $name = $result->name; |
184 | 192 | $auth_str = md5($user->authenticator.$name); |
185 | 193 | return "get_output.php?cmd=result_file&result_name=$name&file_num=$i&auth_str=$auth_str"; |
186 | 194 | } |
187 | 195 | |
196 | +/** |
|
197 | + * @param null|integer $batch_id |
|
198 | + */ |
|
188 | 199 | function boinc_get_output_files_url($user, $batch_id) { |
189 | 200 | $auth_str = md5($user->authenticator.$batch_id); |
190 | 201 | return "get_output.php?cmd=batch_files&batch_id=$batch_id&auth_str=$auth_str"; |
@@ -524,6 +524,9 @@ discard block |
||
524 | 524 | // an active request, i.e. after the 60 days elapse X has another |
525 | 525 | // 30 days to assume foundership before someone elase can request it |
526 | 526 | // |
527 | +/** |
|
528 | + * @param integer $now |
|
529 | + */ |
|
527 | 530 | function new_transfer_request_ok($team, $now) { |
528 | 531 | if ($team->ping_user <= 0) { |
529 | 532 | if ($team->ping_time < $now - 60 * 86400) { |
@@ -544,6 +547,9 @@ discard block |
||
544 | 547 | return $team->ping_time + 60*86400; |
545 | 548 | } |
546 | 549 | |
550 | +/** |
|
551 | + * @param integer $now |
|
552 | + */ |
|
547 | 553 | function transfer_ok($team, $now) { |
548 | 554 | if ($now > transfer_ok_time($team)) return true; |
549 | 555 | return false; |
@@ -105,6 +105,9 @@ discard block |
||
105 | 105 | |
106 | 106 | // handle [pre] and [code] separately because we need to remove <br />s |
107 | 107 | // |
108 | +/** |
|
109 | + * @param boolean $export |
|
110 | + */ |
|
108 | 111 | function replace_pre_code($text, $export) { |
109 | 112 | if ($export) { |
110 | 113 | $text = preg_replace_callback( |
@@ -272,6 +275,11 @@ discard block |
||
272 | 275 | // for example inside <pre> containers |
273 | 276 | // The original \n was retained after the br when it was added |
274 | 277 | // |
278 | +/** |
|
279 | + * @param string $text |
|
280 | + * |
|
281 | + * @return string |
|
282 | + */ |
|
275 | 283 | function remove_br($text){ |
276 | 284 | return str_replace("<br />", "", $text); |
277 | 285 | } |
@@ -19,6 +19,9 @@ |
||
19 | 19 | // express a time difference in readable form, e.g. "7 days ago". |
20 | 20 | // If it's more than 30 days, just show the date |
21 | 21 | // |
22 | +/** |
|
23 | + * @param integer $t2 |
|
24 | + */ |
|
22 | 25 | function time_diff_str($t1, $t2) { |
23 | 26 | if (!$t1 || !$t2) return "---"; |
24 | 27 | $diff = $t2 - $t1; |
@@ -112,6 +112,9 @@ discard block |
||
112 | 112 | // @param file The file to parse |
113 | 113 | // checking for inconsistencies if needed. |
114 | 114 | // |
115 | +/** |
|
116 | + * @param string $file |
|
117 | + */ |
|
115 | 118 | function parse_po_file($file) { |
116 | 119 | $translation_file = file($file); |
117 | 120 | $first_entry = true; |
@@ -157,6 +160,9 @@ discard block |
||
157 | 160 | |
158 | 161 | // Returns the contents of a line (ie removes "" from start and end) |
159 | 162 | // |
163 | +/** |
|
164 | + * @param string $line |
|
165 | + */ |
|
160 | 166 | function get_po_line($line, $file) { |
161 | 167 | $start = strpos($line, '"')+1; |
162 | 168 | $stop = strrpos($line, '"'); |
@@ -113,6 +113,9 @@ |
||
113 | 113 | return ($a->expavg_credit < $b->expavg_credit)? 1 : -1; |
114 | 114 | } |
115 | 115 | |
116 | +/** |
|
117 | + * @param boolean $personal |
|
118 | + */ |
|
116 | 119 | function show_other_projects($user, $personal) { |
117 | 120 | if (!isset($user->projects)) return; |
118 | 121 | if (count($user->projects) < 2) return; |
@@ -65,10 +65,17 @@ discard block |
||
65 | 65 | . "<p>\n"; |
66 | 66 | } |
67 | 67 | |
68 | +/** |
|
69 | + * @param string $x |
|
70 | + */ |
|
68 | 71 | function row($x, $y) { |
69 | 72 | echo "<tr><td valign=\"top\" align=\"right\">$x</td>\n<td>$y</td>\n</tr>\n"; |
70 | 73 | } |
71 | 74 | |
75 | +/** |
|
76 | + * @param string $color |
|
77 | + * @param string $x |
|
78 | + */ |
|
72 | 79 | function c_row2($color, $x, $y) { |
73 | 80 | echo "<tr bgcolor=\"$color\"><td align=\"right\">$x</td><td>$y</td></tr>\n"; |
74 | 81 | } |
@@ -134,6 +141,9 @@ discard block |
||
134 | 141 | |
135 | 142 | // allow access only if logged in as user in a given set |
136 | 143 | // |
144 | +/** |
|
145 | + * @param integer[] $admin_user_ids |
|
146 | + */ |
|
137 | 147 | function auth_ops_userid($admin_user_ids) { |
138 | 148 | $user = get_logged_in_user_ops(); |
139 | 149 | if (!$user) { |
@@ -288,6 +298,10 @@ discard block |
||
288 | 298 | |
289 | 299 | ////// badge-related stuff |
290 | 300 | |
301 | +/** |
|
302 | + * @param string $name |
|
303 | + * @param string $title |
|
304 | + */ |
|
291 | 305 | function get_badge($name, $title, $image_url) { |
292 | 306 | $b = BoincBadge::lookup("name='$name'"); |
293 | 307 | if ($b) return $b; |
@@ -319,6 +333,9 @@ discard block |
||
319 | 333 | |
320 | 334 | // unassign all badges except the given one |
321 | 335 | // |
336 | +/** |
|
337 | + * @param integer $k |
|
338 | + */ |
|
322 | 339 | function unassign_badges($is_user, $item, $badges, $k) { |
323 | 340 | $list = null; |
324 | 341 | for ($i=0; $i<count($badges); $i++) { |
@@ -21,6 +21,9 @@ discard block |
||
21 | 21 | // my PHP currently doesn't support file_get_contents(https://...) |
22 | 22 | // so do it with Curl |
23 | 23 | // |
24 | +/** |
|
25 | + * @param string $url |
|
26 | + */ |
|
24 | 27 | function fetch_url($url) { |
25 | 28 | if (0) { |
26 | 29 | return file_get_contents($url); |
@@ -35,6 +38,11 @@ discard block |
||
35 | 38 | } |
36 | 39 | } |
37 | 40 | |
41 | +/** |
|
42 | + * @param string $project_url |
|
43 | + * @param string $email_addr |
|
44 | + * @param string $passwd_hash |
|
45 | + */ |
|
38 | 46 | function lookup_account( |
39 | 47 | $project_url, |
40 | 48 | $email_addr, |
@@ -57,6 +65,12 @@ discard block |
||
57 | 65 | |
58 | 66 | // return (authenticator, errmsg) |
59 | 67 | // |
68 | +/** |
|
69 | + * @param string $project_url |
|
70 | + * @param string $email_addr |
|
71 | + * @param string $passwd_hash |
|
72 | + * @param string $user_name |
|
73 | + */ |
|
60 | 74 | function create_account( |
61 | 75 | $project_url, |
62 | 76 | $email_addr, |
@@ -57,6 +57,9 @@ |
||
57 | 57 | |
58 | 58 | $xml_outer_tag = ""; |
59 | 59 | |
60 | +/** |
|
61 | + * @param string $tag |
|
62 | + */ |
|
60 | 63 | function xml_start_tag($tag) { |
61 | 64 | global $xml_outer_tag; |
62 | 65 | echo "<$tag>\n"; |