@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | require_once("../inc/boinc_db.inc"); |
22 | 22 | require_once("../inc/util.inc"); |
23 | 23 | |
24 | -define('CONSENT_TYPE_ENROLL','ENROLL'); |
|
24 | +define('CONSENT_TYPE_ENROLL', 'ENROLL'); |
|
25 | 25 | |
26 | 26 | function check_termsofuse() { |
27 | 27 | return defined('TERMSOFUSE_FILE') and file_exists(TERMSOFUSE_FILE); |
@@ -32,13 +32,13 @@ discard block |
||
32 | 32 | $source, $ctime = 0 |
33 | 33 | ) { |
34 | 34 | $mys = BoincDb::escape_string($source); |
35 | - if ($ctime==0) { |
|
35 | + if ($ctime == 0) { |
|
36 | 36 | $mytime = $user->create_time; |
37 | 37 | } else { |
38 | 38 | $mytime = $ctime; |
39 | 39 | } |
40 | 40 | return BoincConsent::insert( |
41 | - "(userid, consent_type_id, consent_time, consent_flag, consent_not_required, source) " . |
|
41 | + "(userid, consent_type_id, consent_time, consent_flag, consent_not_required, source) ". |
|
42 | 42 | "values($user->id, $consent_type_id, $mytime, $consent_flag, $consent_not_required, '$mys')" |
43 | 43 | ); |
44 | 44 | |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | // The integer is the consent_type_id- the id from consent_type table. |
64 | 64 | // If the boolean is FALSE, the integer returned is -1. |
65 | 65 | // |
66 | -function check_consent_type($name, $checkenabled=TRUE) { |
|
66 | +function check_consent_type($name, $checkenabled = TRUE) { |
|
67 | 67 | $ct = BoincConsentType::lookup("shortname = '{$name}'"); |
68 | - if ($ct and ( !$checkenabled or ($ct->enabled)) ) { |
|
68 | + if ($ct and (!$checkenabled or ($ct->enabled))) { |
|
69 | 69 | return array(TRUE, $ct->id); |
70 | 70 | } |
71 | 71 | return array(FALSE, -1); |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | if ($checkct) { |
51 | 51 | $consent_result = BoincLatestConsent::lookup("userid={$user->id} AND consent_type_id=$ctid AND consent_flag=1"); |
52 | 52 | if ($consent_result) { |
53 | - return TRUE; |
|
53 | + return true; |
|
54 | 54 | } |
55 | 55 | } |
56 | - return FALSE; |
|
56 | + return false; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | // Check if a particular consent_type name is available. |
@@ -63,12 +63,12 @@ discard block |
||
63 | 63 | // The integer is the consent_type_id- the id from consent_type table. |
64 | 64 | // If the boolean is FALSE, the integer returned is -1. |
65 | 65 | // |
66 | -function check_consent_type($name, $checkenabled=TRUE) { |
|
66 | +function check_consent_type($name, $checkenabled=true) { |
|
67 | 67 | $ct = BoincConsentType::lookup("shortname = '{$name}'"); |
68 | 68 | if ($ct and ( !$checkenabled or ($ct->enabled)) ) { |
69 | - return array(TRUE, $ct->id); |
|
69 | + return array(true, $ct->id); |
|
70 | 70 | } |
71 | - return array(FALSE, -1); |
|
71 | + return array(false, -1); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | // When a user uses the Web site to login, this function checks the |