@@ -38,8 +38,7 @@ |
||
38 | 38 | * |
39 | 39 | * @return string |
40 | 40 | */ |
41 | - function random_bytes($bytes) |
|
42 | - { |
|
41 | + function random_bytes($bytes) { |
|
43 | 42 | try { |
44 | 43 | $bytes = RandomCompat_intval($bytes); |
45 | 44 | } catch (TypeError $ex) { |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $expiration = $now + $duration; |
32 | 32 | $type = BoincDb::escape_string($type); |
33 | 33 | $ret = BoincToken::insert("(token,userid,type,create_time,expire_time) values ('$token', $userid, '$type', $now, $expiration)"); |
34 | - if ( !$ret ) { |
|
34 | + if (!$ret) { |
|
35 | 35 | return null; |
36 | 36 | } |
37 | 37 | return $token; |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | function is_valid_token($userid, $token, $type) { |
41 | 41 | $boincToken = BoincToken::lookup_valid_token($userid, $token, $type); |
42 | - if ( $boincToken == null ) { |
|
42 | + if ($boincToken == null) { |
|
43 | 43 | return false; |
44 | 44 | } |
45 | 45 | return true; |
@@ -26,5 +26,5 @@ |
||
26 | 26 | admin_show_result_summary(); |
27 | 27 | |
28 | 28 | admin_page_tail(); |
29 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
29 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
30 | 30 | ?> |
@@ -62,7 +62,7 @@ |
||
62 | 62 | echo tra("Invalid password."); |
63 | 63 | } else { |
64 | 64 | $passwd_hash = md5($passwd.$email_addr); |
65 | - $database_passwd_hash = password_hash($passwd_hash , PASSWORD_DEFAULT); |
|
65 | + $database_passwd_hash = password_hash($passwd_hash, PASSWORD_DEFAULT); |
|
66 | 66 | $email_addr = BoincDb::escape_string($email_addr); |
67 | 67 | $user->email_addr_change_time = time(); |
68 | 68 | $result = $user->update( |
@@ -56,9 +56,9 @@ |
||
56 | 56 | "email_addr=previous_email_addr, previous_email_addr='', email_addr_change_time=0, passwd_hash='$database_passwd_hash', email_validated=0" |
57 | 57 | ); |
58 | 58 | $result = delete_token($userid, $token, TOKEN_TYPE_CHANGE_EMAIL); |
59 | - } |
|
59 | + } |
|
60 | 60 | } else { |
61 | - echo tra("Invalid token."); |
|
61 | + echo tra("Invalid token."); |
|
62 | 62 | } |
63 | 63 | } else { |
64 | 64 | echo tra("Invalid token."); |
@@ -50,7 +50,7 @@ |
||
50 | 50 | } else { |
51 | 51 | echo tra("Email address has been reverted.")."<br /><br />".tra("You need to reset your password: ")."<a href=\"".secure_url_base()."get_passwd.php\">".secure_url_base()."get_passwd.php</a>"; |
52 | 52 | |
53 | - $database_passwd_hash = password_hash(random_string() , PASSWORD_DEFAULT); |
|
53 | + $database_passwd_hash = password_hash(random_string(), PASSWORD_DEFAULT); |
|
54 | 54 | //Change previous_email |
55 | 55 | $result = $tmpuser->update( |
56 | 56 | "email_addr=previous_email_addr, previous_email_addr='', email_addr_change_time=0, passwd_hash='$database_passwd_hash', email_validated=0" |
@@ -11,39 +11,39 @@ |
||
11 | 11 | BoincToken::insert("(token,userid,type,create_time, expire_time) values ('$token', 0, 'T', $now, $now+3600)"); |
12 | 12 | |
13 | 13 | $boincTokens = BoincToken::enum("userid=0"); |
14 | -foreach($boincTokens as $boincToken) { |
|
15 | - echo $boincToken->token . "\n"; |
|
16 | - echo $boincToken->userid . "\n"; |
|
17 | - echo $boincToken->type . "\n"; |
|
18 | - echo $boincToken->create_time . "\n"; |
|
19 | - echo $boincToken->expire_time . "\n"; |
|
14 | +foreach ($boincTokens as $boincToken) { |
|
15 | + echo $boincToken->token."\n"; |
|
16 | + echo $boincToken->userid."\n"; |
|
17 | + echo $boincToken->type."\n"; |
|
18 | + echo $boincToken->create_time."\n"; |
|
19 | + echo $boincToken->expire_time."\n"; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | echo "---------------\n"; |
23 | 23 | $boincToken = BoincToken::lookup("userid=0"); |
24 | -echo $boincToken->token . "\n"; |
|
25 | -echo $boincToken->userid . "\n"; |
|
26 | -echo $boincToken->type . "\n"; |
|
27 | -echo $boincToken->create_time . "\n"; |
|
28 | -echo $boincToken->expire_time . "\n"; |
|
24 | +echo $boincToken->token."\n"; |
|
25 | +echo $boincToken->userid."\n"; |
|
26 | +echo $boincToken->type."\n"; |
|
27 | +echo $boincToken->create_time."\n"; |
|
28 | +echo $boincToken->expire_time."\n"; |
|
29 | 29 | |
30 | 30 | echo "---------------\n"; |
31 | 31 | $boincToken = BoincToken::lookup_valid_token(0, $token, 'T'); |
32 | -if ( $boincToken != null ) { |
|
32 | +if ($boincToken != null) { |
|
33 | 33 | echo "Found valid token\n"; |
34 | 34 | } |
35 | 35 | |
36 | 36 | echo "---------------\n"; |
37 | 37 | $boincToken = BoincToken::lookup_valid_token(0, 'notrealtoken', 'T'); |
38 | -if ( $boincToken == null ) { |
|
38 | +if ($boincToken == null) { |
|
39 | 39 | echo "Successfully didn't find invalid token\n"; |
40 | 40 | } |
41 | 41 | |
42 | 42 | echo "---------------\n"; |
43 | 43 | $user = new BoincUser(); |
44 | -$user->id=0; |
|
44 | +$user->id = 0; |
|
45 | 45 | $token = create_token($user->id, TOKEN_TYPE_DELETE_ACCOUNT, TOKEN_DURATION_ONE_DAY); |
46 | -if ( is_valid_token($user->id, $token, TOKEN_TYPE_DELETE_ACCOUNT) ) { |
|
46 | +if (is_valid_token($user->id, $token, TOKEN_TYPE_DELETE_ACCOUNT)) { |
|
47 | 47 | echo "Successfully created and validated delete account token"; |
48 | 48 | } |
49 | 49 |
@@ -44,9 +44,9 @@ |
||
44 | 44 | page_head(tra("Delete Account")); |
45 | 45 | |
46 | 46 | echo "<p>".tra("Thank you for verifying ownership of your account.")."</p>" |
47 | - ."<p>".tra("You can now delete your account by entering in your password below and clicking the \"Delete Account\" button.")."</p>" |
|
48 | - ."<p>".tra("As a reminder, your account <b>cannot be recovered</b> once you delete it.")."</p>" |
|
49 | - ."<br/>"; |
|
47 | + ."<p>".tra("You can now delete your account by entering in your password below and clicking the \"Delete Account\" button.")."</p>" |
|
48 | + ."<p>".tra("As a reminder, your account <b>cannot be recovered</b> once you delete it.")."</p>" |
|
49 | + ."<br/>"; |
|
50 | 50 | |
51 | 51 | form_start(secure_url_base()."delete_account_confirm.php", "post"); |
52 | 52 | form_input_hidden("token", $token); |
@@ -82,7 +82,7 @@ |
||
82 | 82 | |
83 | 83 | page_head(tra("Account Deleted")); |
84 | 84 | |
85 | - echo "<p>".tra("Your account has been deleted. If you want to contribute to %1 in the future you will need to create a new account.",PROJECT)."</p>"; |
|
85 | + echo "<p>".tra("Your account has been deleted. If you want to contribute to %1 in the future you will need to create a new account.", PROJECT)."</p>"; |
|
86 | 86 | |
87 | 87 | page_tail(); |
88 | 88 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $subset = sanitize_tags(get_str("subset")); |
30 | 30 | $venue = sanitize_tags(get_str("venue", true)); |
31 | 31 | $columns = get_str("cols", true); |
32 | -$c = $columns?"&cols=$columns":""; |
|
32 | +$c = $columns ? "&cols=$columns" : ""; |
|
33 | 33 | check_subset($subset); |
34 | 34 | if ($action) { |
35 | 35 | check_tokens($user->authenticator); |
@@ -116,5 +116,5 @@ discard block |
||
116 | 116 | echo "<a href=prefs.php?subset=$subset$c>".tra("Back to preferences")."</a>\n"; |
117 | 117 | page_tail(); |
118 | 118 | |
119 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
119 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
120 | 120 | ?> |
@@ -99,8 +99,7 @@ |
||
99 | 99 | ); |
100 | 100 | |
101 | 101 | $form['#redirect'] = 'account'; |
102 | - } |
|
103 | - else { |
|
102 | + } else { |
|
104 | 103 | $form['noaccount'] = array( |
105 | 104 | '#value' => t('No such user with UID: %uid', array('%uid' => $uid)), |
106 | 105 | ); |
@@ -13,45 +13,45 @@ discard block |
||
13 | 13 | * a form array |
14 | 14 | */ |
15 | 15 | function boincuser_delete_settings() { |
16 | - $form = array(); |
|
16 | + $form = array(); |
|
17 | 17 | |
18 | - $default = array( |
|
18 | + $default = array( |
|
19 | 19 | 'boincuser_delete_type' => variable_get('boincuser_delete_type', ''), |
20 | 20 | 'boincuser_delete_redirect' => variable_get('boincuser_delete_redirect', '<front>'), |
21 | - ); |
|
21 | + ); |
|
22 | 22 | |
23 | - $form['options'] = array( |
|
23 | + $form['options'] = array( |
|
24 | 24 | '#type' => 'fieldset', |
25 | 25 | '#title' => t('Options'), |
26 | - ); |
|
27 | - $form['options']['help'] = array( |
|
26 | + ); |
|
27 | + $form['options']['help'] = array( |
|
28 | 28 | '#value' => t('When a user deletes their account, which option is shown to the user? A soft/obfusate delete, a hard/wipe delete, or let the user chose between the two.'), |
29 | 29 | '#weight' => 11, |
30 | - ); |
|
31 | - $form['options']['boincuser_delete_type'] = array( |
|
30 | + ); |
|
31 | + $form['options']['boincuser_delete_type'] = array( |
|
32 | 32 | '#type' => 'radios', |
33 | 33 | '#title' => t('Type of delete'), |
34 | 34 | '#default_value' => $default['boincuser_delete_type'], |
35 | 35 | '#options' => array( |
36 | - 'soft_obfuscate' => t('A soft/obfuscate delete. User\'s account is disabled, but some data is deleted.'), |
|
37 | - 'hard_wipe' => t('A hard/wipe delete. User\'s account is deleted along with many data.'), |
|
38 | - 'user_decides' => t('User is presented with radio buttons where they choose between the two options above.'), |
|
36 | + 'soft_obfuscate' => t('A soft/obfuscate delete. User\'s account is disabled, but some data is deleted.'), |
|
37 | + 'hard_wipe' => t('A hard/wipe delete. User\'s account is deleted along with many data.'), |
|
38 | + 'user_decides' => t('User is presented with radio buttons where they choose between the two options above.'), |
|
39 | 39 | ), |
40 | 40 | '#weight' => 21, |
41 | - ); |
|
41 | + ); |
|
42 | 42 | |
43 | - $form['redirect'] = array( |
|
43 | + $form['redirect'] = array( |
|
44 | 44 | '#type' => 'fieldset', |
45 | 45 | '#title' => t('Redirect'), |
46 | - ); |
|
47 | - $form['redirect']['boincuser_delete_redirect'] = array( |
|
46 | + ); |
|
47 | + $form['redirect']['boincuser_delete_redirect'] = array( |
|
48 | 48 | '#type' => 'textfield', |
49 | 49 | '#title' => t('Redirection page'), |
50 | 50 | '#default_value' => $default['boincuser_delete_redirect'], |
51 | 51 | '#description' => t('Choose where to redirect your users after account deletion. Any valid Drupal path will do, e.g. %front or %node', array('%front' => '<front>', '%node' => 'node/1')), |
52 | - ); |
|
52 | + ); |
|
53 | 53 | |
54 | - return system_settings_form($form); |
|
54 | + return system_settings_form($form); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -60,124 +60,124 @@ discard block |
||
60 | 60 | * password checks. |
61 | 61 | */ |
62 | 62 | function boincuser_delete_admindelete(&$form_state, $uid) { |
63 | - $form = array(); |
|
63 | + $form = array(); |
|
64 | 64 | |
65 | - $form['#uid'] = $uid; |
|
65 | + $form['#uid'] = $uid; |
|
66 | 66 | |
67 | - $form['account']['help'] = array( |
|
67 | + $form['account']['help'] = array( |
|
68 | 68 | '#value' => "<p>" . t("This form will delete this user <strong>without any email notification</strong> sent to the user. Be very careful in deleting users using this form. Once you select the delete type, check the checkbox, enter your password, and click submit, the user's account will be deleted. This will occur <strong>immediately</strong>. There is no 'undo'!") . "</p><p>" . t("You are deleting the following user, link opens in new window:") . "</p>", |
69 | 69 | '#weight' => -1, |
70 | 70 | '#prefix' => "<div id='delete-instructions'>", |
71 | 71 | '#suffix' => "</div>", |
72 | - ); |
|
72 | + ); |
|
73 | 73 | |
74 | - $account = user_load($uid); |
|
75 | - if ($account) { |
|
74 | + $account = user_load($uid); |
|
75 | + if ($account) { |
|
76 | 76 | drupal_set_title($account->boincuser_name); |
77 | 77 | |
78 | 78 | $form['account']['boincuser_name'] = array( |
79 | - '#value' => t('<li>BOINC username (public displayname): ') . l("{$account->boincuser_name}", "account/{$account->uid}", array('attributes' => array('target' => '_blank'))), |
|
79 | + '#value' => t('<li>BOINC username (public displayname): ') . l("{$account->boincuser_name}", "account/{$account->uid}", array('attributes' => array('target' => '_blank'))), |
|
80 | 80 | ); |
81 | 81 | $form['account']['boincuser_id'] = array( |
82 | - '#value' => t('<li>BOINC user ID: ') . $account->boincuser_id, |
|
82 | + '#value' => t('<li>BOINC user ID: ') . $account->boincuser_id, |
|
83 | 83 | ); |
84 | 84 | $form['account']['drupal_name'] = array( |
85 | - '#value' => t('<li>Drupal username (internal): ') . $account->name, |
|
85 | + '#value' => t('<li>Drupal username (internal): ') . $account->name, |
|
86 | 86 | ); |
87 | 87 | $form['account']['user_id'] = array( |
88 | - '#value' => t('<li>Drupal user ID: ') . $account->uid, |
|
88 | + '#value' => t('<li>Drupal user ID: ') . $account->uid, |
|
89 | 89 | ); |
90 | 90 | |
91 | 91 | $form['account']['user_delete_action'] = array( |
92 | 92 | '#type' => 'radios', |
93 | 93 | '#options' => array( |
94 | - 'soft_obfuscate' => bts('<b>Soft delete</b> the account. The account will be disabled, and all posts/comments will be attributed to the Anonymous User. The user profile will be deleted, the host information deleted, and the user will be removed from any team.', array(), NULL, 'boinc:delete-user-account'), |
|
95 | - 'hard_wipe' => bts('<b>Delete</b> the account. The account will be deleted, and all posts/comments will be attributed to the Anonymous User. The user profile will be deleted.', array(), NULL, 'boinc:delete-user-account'),), |
|
96 | - ); |
|
94 | + 'soft_obfuscate' => bts('<b>Soft delete</b> the account. The account will be disabled, and all posts/comments will be attributed to the Anonymous User. The user profile will be deleted, the host information deleted, and the user will be removed from any team.', array(), NULL, 'boinc:delete-user-account'), |
|
95 | + 'hard_wipe' => bts('<b>Delete</b> the account. The account will be deleted, and all posts/comments will be attributed to the Anonymous User. The user profile will be deleted.', array(), NULL, 'boinc:delete-user-account'),), |
|
96 | + ); |
|
97 | 97 | |
98 | 98 | $form['account']['surecheckbox'] = array( |
99 | - '#type' => 'checkbox', |
|
100 | - '#title' => t('I am <strong>sure</strong> I know what I am doing. I am <u><strong>deleting user</strong></u> %name.', |
|
99 | + '#type' => 'checkbox', |
|
100 | + '#title' => t('I am <strong>sure</strong> I know what I am doing. I am <u><strong>deleting user</strong></u> %name.', |
|
101 | 101 | array('%name' => $account->boincuser_name) |
102 | - ), |
|
103 | - '#default_value' => FALSE, |
|
102 | + ), |
|
103 | + '#default_value' => FALSE, |
|
104 | 104 | ); |
105 | 105 | |
106 | 106 | $form['account']['current_pass'] = array( |
107 | - '#type' => 'password', |
|
108 | - '#title' => bts('Enter your password before clicking Submit, or click Cancel to return to the user\'s edit page', array(), NULL, 'boinc:delete-user-account'), |
|
109 | - '#size' => 17, |
|
110 | - '#attributes' => array( |
|
107 | + '#type' => 'password', |
|
108 | + '#title' => bts('Enter your password before clicking Submit, or click Cancel to return to the user\'s edit page', array(), NULL, 'boinc:delete-user-account'), |
|
109 | + '#size' => 17, |
|
110 | + '#attributes' => array( |
|
111 | 111 | 'autocomplete' => 'off', |
112 | - ), |
|
113 | - '#weight' => 25, |
|
112 | + ), |
|
113 | + '#weight' => 25, |
|
114 | 114 | ); |
115 | 115 | |
116 | 116 | // Action buttons |
117 | 117 | $form['actions']['submit'] = array( |
118 | - '#type' => 'submit', |
|
119 | - '#value' => t('Submit'), |
|
118 | + '#type' => 'submit', |
|
119 | + '#value' => t('Submit'), |
|
120 | 120 | ); |
121 | 121 | $form['actions']['cancel'] = array( |
122 | - '#type' => 'button', |
|
123 | - '#value' => t('Cancel'), |
|
124 | - '#executes_submit_callback' => TRUE, |
|
125 | - '#validate' => array(), |
|
126 | - '#submit' => array('_boincuser_delete_cancel'), |
|
122 | + '#type' => 'button', |
|
123 | + '#value' => t('Cancel'), |
|
124 | + '#executes_submit_callback' => TRUE, |
|
125 | + '#validate' => array(), |
|
126 | + '#submit' => array('_boincuser_delete_cancel'), |
|
127 | 127 | ); |
128 | 128 | |
129 | 129 | $form['#redirect'] = 'account'; |
130 | - } |
|
131 | - else { |
|
130 | + } |
|
131 | + else { |
|
132 | 132 | $form['noaccount'] = array( |
133 | - '#value' => t('No such user with UID: %uid', array('%uid' => $uid)), |
|
133 | + '#value' => t('No such user with UID: %uid', array('%uid' => $uid)), |
|
134 | 134 | ); |
135 | - } |
|
135 | + } |
|
136 | 136 | |
137 | - return $form; |
|
137 | + return $form; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
141 | 141 | * Validation function for admin delete user. |
142 | 142 | */ |
143 | 143 | function boincuser_delete_admindelete_validate($form, &$form_state) { |
144 | - global $user; |
|
145 | - $boinc_user = boincuser_load($user->uid, TRUE); |
|
144 | + global $user; |
|
145 | + $boinc_user = boincuser_load($user->uid, TRUE); |
|
146 | 146 | |
147 | - if ($form_state['values']['user_delete_action'] == '') { |
|
147 | + if ($form_state['values']['user_delete_action'] == '') { |
|
148 | 148 | form_set_error('user_delete_action', t('Please select an action to perform using the radio buttons.')); |
149 | - } |
|
149 | + } |
|
150 | 150 | |
151 | - if ( ($form_state['values']['user_delete_action'] != 'soft_obfuscate') and ($form_state['values']['user_delete_action'] != 'hard_wipe') ) { |
|
151 | + if ( ($form_state['values']['user_delete_action'] != 'soft_obfuscate') and ($form_state['values']['user_delete_action'] != 'hard_wipe') ) { |
|
152 | 152 | form_set_error('user_delete_action', t('User Delete action not a predefined value, unknown error in radio buttons.')); |
153 | - } |
|
153 | + } |
|
154 | 154 | |
155 | - if (!($form_state['values']['surecheckbox'])) { |
|
155 | + if (!($form_state['values']['surecheckbox'])) { |
|
156 | 156 | return form_set_error('surecheckbox', t('Please confirm you are sure you want to delete this account.')); |
157 | - } |
|
157 | + } |
|
158 | 158 | |
159 | - if (_boincuser_delete_validatepasswd($boinc_user, $form_state['values']['current_pass'])) { |
|
159 | + if (_boincuser_delete_validatepasswd($boinc_user, $form_state['values']['current_pass'])) { |
|
160 | 160 | return true; |
161 | - } |
|
161 | + } |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
165 | 165 | * Submit function for admin delete user. |
166 | 166 | */ |
167 | 167 | function boincuser_delete_admindelete_submit($form, &$form_state) { |
168 | - // This is the account to be deleted, and not the administrator's |
|
169 | - // account. |
|
170 | - $account = user_load(array('uid' => $form['#uid'])); |
|
171 | - $action = $form_state['values']['user_delete_action']; |
|
168 | + // This is the account to be deleted, and not the administrator's |
|
169 | + // account. |
|
170 | + $account = user_load(array('uid' => $form['#uid'])); |
|
171 | + $action = $form_state['values']['user_delete_action']; |
|
172 | 172 | |
173 | - drupal_set_message(t('WARNING: Account @displayname, Drupal UID=@uid has been deleted.', |
|
173 | + drupal_set_message(t('WARNING: Account @displayname, Drupal UID=@uid has been deleted.', |
|
174 | 174 | array( |
175 | - '@uid' => $form['#uid'], |
|
176 | - '@displayname' => $account->boincuser_name, |
|
175 | + '@uid' => $form['#uid'], |
|
176 | + '@displayname' => $account->boincuser_name, |
|
177 | 177 | )), 'warning'); |
178 | 178 | |
179 | - // Delete the user |
|
180 | - _boincuser_delete_deleteuser($account, $action); |
|
179 | + // Delete the user |
|
180 | + _boincuser_delete_deleteuser($account, $action); |
|
181 | 181 | |
182 | - drupal_goto('/admin/boinc/user_delete'); |
|
182 | + drupal_goto('/admin/boinc/user_delete'); |
|
183 | 183 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $form['#uid'] = $uid; |
66 | 66 | |
67 | 67 | $form['account']['help'] = array( |
68 | - '#value' => "<p>" . t("This form will delete this user <strong>without any email notification</strong> sent to the user. Be very careful in deleting users using this form. Once you select the delete type, check the checkbox, enter your password, and click submit, the user's account will be deleted. This will occur <strong>immediately</strong>. There is no 'undo'!") . "</p><p>" . t("You are deleting the following user, link opens in new window:") . "</p>", |
|
68 | + '#value' => "<p>".t("This form will delete this user <strong>without any email notification</strong> sent to the user. Be very careful in deleting users using this form. Once you select the delete type, check the checkbox, enter your password, and click submit, the user's account will be deleted. This will occur <strong>immediately</strong>. There is no 'undo'!")."</p><p>".t("You are deleting the following user, link opens in new window:")."</p>", |
|
69 | 69 | '#weight' => -1, |
70 | 70 | '#prefix' => "<div id='delete-instructions'>", |
71 | 71 | '#suffix' => "</div>", |
@@ -76,16 +76,16 @@ discard block |
||
76 | 76 | drupal_set_title($account->boincuser_name); |
77 | 77 | |
78 | 78 | $form['account']['boincuser_name'] = array( |
79 | - '#value' => t('<li>BOINC username (public displayname): ') . l("{$account->boincuser_name}", "account/{$account->uid}", array('attributes' => array('target' => '_blank'))), |
|
79 | + '#value' => t('<li>BOINC username (public displayname): ').l("{$account->boincuser_name}", "account/{$account->uid}", array('attributes' => array('target' => '_blank'))), |
|
80 | 80 | ); |
81 | 81 | $form['account']['boincuser_id'] = array( |
82 | - '#value' => t('<li>BOINC user ID: ') . $account->boincuser_id, |
|
82 | + '#value' => t('<li>BOINC user ID: ').$account->boincuser_id, |
|
83 | 83 | ); |
84 | 84 | $form['account']['drupal_name'] = array( |
85 | - '#value' => t('<li>Drupal username (internal): ') . $account->name, |
|
85 | + '#value' => t('<li>Drupal username (internal): ').$account->name, |
|
86 | 86 | ); |
87 | 87 | $form['account']['user_id'] = array( |
88 | - '#value' => t('<li>Drupal user ID: ') . $account->uid, |
|
88 | + '#value' => t('<li>Drupal user ID: ').$account->uid, |
|
89 | 89 | ); |
90 | 90 | |
91 | 91 | $form['account']['user_delete_action'] = array( |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | form_set_error('user_delete_action', t('Please select an action to perform using the radio buttons.')); |
149 | 149 | } |
150 | 150 | |
151 | - if ( ($form_state['values']['user_delete_action'] != 'soft_obfuscate') and ($form_state['values']['user_delete_action'] != 'hard_wipe') ) { |
|
151 | + if (($form_state['values']['user_delete_action'] != 'soft_obfuscate') and ($form_state['values']['user_delete_action'] != 'hard_wipe')) { |
|
152 | 152 | form_set_error('user_delete_action', t('User Delete action not a predefined value, unknown error in radio buttons.')); |
153 | 153 | } |
154 | 154 |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | $form['account']['user_delete_action'] = array( |
92 | 92 | '#type' => 'radios', |
93 | 93 | '#options' => array( |
94 | - 'soft_obfuscate' => bts('<b>Soft delete</b> the account. The account will be disabled, and all posts/comments will be attributed to the Anonymous User. The user profile will be deleted, the host information deleted, and the user will be removed from any team.', array(), NULL, 'boinc:delete-user-account'), |
|
95 | - 'hard_wipe' => bts('<b>Delete</b> the account. The account will be deleted, and all posts/comments will be attributed to the Anonymous User. The user profile will be deleted.', array(), NULL, 'boinc:delete-user-account'),), |
|
94 | + 'soft_obfuscate' => bts('<b>Soft delete</b> the account. The account will be disabled, and all posts/comments will be attributed to the Anonymous User. The user profile will be deleted, the host information deleted, and the user will be removed from any team.', array(), null, 'boinc:delete-user-account'), |
|
95 | + 'hard_wipe' => bts('<b>Delete</b> the account. The account will be deleted, and all posts/comments will be attributed to the Anonymous User. The user profile will be deleted.', array(), null, 'boinc:delete-user-account'),), |
|
96 | 96 | ); |
97 | 97 | |
98 | 98 | $form['account']['surecheckbox'] = array( |
@@ -100,12 +100,12 @@ discard block |
||
100 | 100 | '#title' => t('I am <strong>sure</strong> I know what I am doing. I am <u><strong>deleting user</strong></u> %name.', |
101 | 101 | array('%name' => $account->boincuser_name) |
102 | 102 | ), |
103 | - '#default_value' => FALSE, |
|
103 | + '#default_value' => false, |
|
104 | 104 | ); |
105 | 105 | |
106 | 106 | $form['account']['current_pass'] = array( |
107 | 107 | '#type' => 'password', |
108 | - '#title' => bts('Enter your password before clicking Submit, or click Cancel to return to the user\'s edit page', array(), NULL, 'boinc:delete-user-account'), |
|
108 | + '#title' => bts('Enter your password before clicking Submit, or click Cancel to return to the user\'s edit page', array(), null, 'boinc:delete-user-account'), |
|
109 | 109 | '#size' => 17, |
110 | 110 | '#attributes' => array( |
111 | 111 | 'autocomplete' => 'off', |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $form['actions']['cancel'] = array( |
122 | 122 | '#type' => 'button', |
123 | 123 | '#value' => t('Cancel'), |
124 | - '#executes_submit_callback' => TRUE, |
|
124 | + '#executes_submit_callback' => true, |
|
125 | 125 | '#validate' => array(), |
126 | 126 | '#submit' => array('_boincuser_delete_cancel'), |
127 | 127 | ); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | */ |
143 | 143 | function boincuser_delete_admindelete_validate($form, &$form_state) { |
144 | 144 | global $user; |
145 | - $boinc_user = boincuser_load($user->uid, TRUE); |
|
145 | + $boinc_user = boincuser_load($user->uid, true); |
|
146 | 146 | |
147 | 147 | if ($form_state['values']['user_delete_action'] == '') { |
148 | 148 | form_set_error('user_delete_action', t('Please select an action to perform using the radio buttons.')); |