@@ -4,48 +4,48 @@ |
||
4 | 4 | * Implementation of hook_user_default_permissions(). |
5 | 5 | */ |
6 | 6 | function private_messages_user_default_permissions() { |
7 | - $permissions = array(); |
|
7 | + $permissions = array(); |
|
8 | 8 | |
9 | - // Exported permission: administer privatemsg settings |
|
10 | - $permissions['administer privatemsg settings'] = array( |
|
9 | + // Exported permission: administer privatemsg settings |
|
10 | + $permissions['administer privatemsg settings'] = array( |
|
11 | 11 | 'name' => 'administer privatemsg settings', |
12 | 12 | 'roles' => array( |
13 | - '0' => 'administrator', |
|
13 | + '0' => 'administrator', |
|
14 | 14 | ), |
15 | - ); |
|
15 | + ); |
|
16 | 16 | |
17 | - // Exported permission: delete privatemsg |
|
18 | - $permissions['delete privatemsg'] = array( |
|
17 | + // Exported permission: delete privatemsg |
|
18 | + $permissions['delete privatemsg'] = array( |
|
19 | 19 | 'name' => 'delete privatemsg', |
20 | 20 | 'roles' => array( |
21 | - '0' => 'administrator', |
|
22 | - '1' => 'authenticated user', |
|
21 | + '0' => 'administrator', |
|
22 | + '1' => 'authenticated user', |
|
23 | 23 | ), |
24 | - ); |
|
24 | + ); |
|
25 | 25 | |
26 | - // Exported permission: read all private messages |
|
27 | - $permissions['read all private messages'] = array( |
|
26 | + // Exported permission: read all private messages |
|
27 | + $permissions['read all private messages'] = array( |
|
28 | 28 | 'name' => 'read all private messages', |
29 | 29 | 'roles' => array(), |
30 | - ); |
|
30 | + ); |
|
31 | 31 | |
32 | - // Exported permission: read privatemsg |
|
33 | - $permissions['read privatemsg'] = array( |
|
32 | + // Exported permission: read privatemsg |
|
33 | + $permissions['read privatemsg'] = array( |
|
34 | 34 | 'name' => 'read privatemsg', |
35 | 35 | 'roles' => array( |
36 | - '0' => 'administrator', |
|
37 | - '1' => 'authenticated user', |
|
36 | + '0' => 'administrator', |
|
37 | + '1' => 'authenticated user', |
|
38 | 38 | ), |
39 | - ); |
|
39 | + ); |
|
40 | 40 | |
41 | - // Exported permission: write privatemsg |
|
42 | - $permissions['write privatemsg'] = array( |
|
41 | + // Exported permission: write privatemsg |
|
42 | + $permissions['write privatemsg'] = array( |
|
43 | 43 | 'name' => 'write privatemsg', |
44 | 44 | 'roles' => array( |
45 | - '0' => 'administrator', |
|
46 | - '1' => 'community member', |
|
45 | + '0' => 'administrator', |
|
46 | + '1' => 'community member', |
|
47 | 47 | ), |
48 | - ); |
|
48 | + ); |
|
49 | 49 | |
50 | - return $permissions; |
|
50 | + return $permissions; |
|
51 | 51 | } |
@@ -16,16 +16,16 @@ |
||
16 | 16 | */ |
17 | 17 | |
18 | 18 | function boinccore_rules_event_info() { |
19 | - return array( |
|
19 | + return array( |
|
20 | 20 | 'boinccore_comment_convert' => array( |
21 | - 'label' => bts('A comment was converted to a new forum topic.', array(), NULL, 'boinc:rule-event'), |
|
22 | - 'module' => 'BOINCcore', |
|
23 | - 'arguments' => rules_events_hook_comment_arguments(t('converted comment')), |
|
21 | + 'label' => bts('A comment was converted to a new forum topic.', array(), NULL, 'boinc:rule-event'), |
|
22 | + 'module' => 'BOINCcore', |
|
23 | + 'arguments' => rules_events_hook_comment_arguments(t('converted comment')), |
|
24 | 24 | ), |
25 | 25 | 'boinccore_comment_unhidden' => array( |
26 | - 'label' => bts('A comment was unhidden.', array(), 'boinc:rule-event'), |
|
27 | - 'module' => 'BOINCcore', |
|
28 | - 'arguments' => rules_events_hook_comment_arguments(t('unhidden comment')), |
|
26 | + 'label' => bts('A comment was unhidden.', array(), 'boinc:rule-event'), |
|
27 | + 'module' => 'BOINCcore', |
|
28 | + 'arguments' => rules_events_hook_comment_arguments(t('unhidden comment')), |
|
29 | 29 | ), |
30 | - ); |
|
30 | + ); |
|
31 | 31 | } |
32 | 32 | \ No newline at end of file |
@@ -12,33 +12,33 @@ |
||
12 | 12 | */ |
13 | 13 | |
14 | 14 | |
15 | - require_once('./includes/bootstrap.inc'); |
|
16 | - drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); |
|
17 | - require_boinc('db'); |
|
15 | + require_once('./includes/bootstrap.inc'); |
|
16 | + drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); |
|
17 | + require_boinc('db'); |
|
18 | 18 | |
19 | - // Parse arguments |
|
20 | - $record_offset = isset($argv[1]) ? $argv[1] : 0; |
|
21 | - $chunk_size = isset($argv[2]) ? $argv[2] : 100; |
|
19 | + // Parse arguments |
|
20 | + $record_offset = isset($argv[1]) ? $argv[1] : 0; |
|
21 | + $chunk_size = isset($argv[2]) ? $argv[2] : 100; |
|
22 | 22 | |
23 | - // Construct sql conditions |
|
24 | - $limit = sprintf('LIMIT %d,%d', $record_offset, $chunk_size); |
|
23 | + // Construct sql conditions |
|
24 | + $limit = sprintf('LIMIT %d,%d', $record_offset, $chunk_size); |
|
25 | 25 | |
26 | - $total_count = 0; |
|
26 | + $total_count = 0; |
|
27 | 27 | |
28 | - // Get the users with subscriptions to import |
|
29 | - db_set_active('boinc_rw'); |
|
30 | - $subscribed_boinc_users = db_query(" |
|
28 | + // Get the users with subscriptions to import |
|
29 | + db_set_active('boinc_rw'); |
|
30 | + $subscribed_boinc_users = db_query(" |
|
31 | 31 | SELECT DISTINCT userid FROM {subscriptions} |
32 | 32 | ORDER BY userid ASC %s", $limit |
33 | - ); |
|
34 | - db_set_active('default'); |
|
33 | + ); |
|
34 | + db_set_active('default'); |
|
35 | 35 | |
36 | - // Import subscriptions |
|
37 | - while ($boinc_subscription = db_fetch_object($subscribed_boinc_users)) { |
|
36 | + // Import subscriptions |
|
37 | + while ($boinc_subscription = db_fetch_object($subscribed_boinc_users)) { |
|
38 | 38 | $uid = get_drupal_id($boinc_subscription->userid); |
39 | 39 | $count = boincuser_pull_subscriptions($uid); |
40 | 40 | $total_count += $count; |
41 | 41 | echo "\nuser: {$uid}; boinc_id: {$boinc_subscription->userid}; {$count} subscriptions"; |
42 | - } |
|
43 | - echo "\n"; |
|
44 | - echo $total_count; |
|
42 | + } |
|
43 | + echo "\n"; |
|
44 | + echo $total_count; |
@@ -12,26 +12,26 @@ discard block |
||
12 | 12 | */ |
13 | 13 | |
14 | 14 | |
15 | - require_once('./includes/bootstrap.inc'); |
|
16 | - drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); |
|
17 | - require_boinc('db'); |
|
15 | + require_once('./includes/bootstrap.inc'); |
|
16 | + drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); |
|
17 | + require_boinc('db'); |
|
18 | 18 | |
19 | - // Parse arguments |
|
20 | - $import_lurkers = isset($argv[1]) ? $argv[1] : false; |
|
21 | - $record_offset = isset($argv[2]) ? $argv[2] : 0; |
|
22 | - $chunk_size = isset($argv[3]) ? $argv[3] : 100; |
|
19 | + // Parse arguments |
|
20 | + $import_lurkers = isset($argv[1]) ? $argv[1] : false; |
|
21 | + $record_offset = isset($argv[2]) ? $argv[2] : 0; |
|
22 | + $chunk_size = isset($argv[3]) ? $argv[3] : 100; |
|
23 | 23 | |
24 | - // Construct sql conditions |
|
25 | - $limit = sprintf('LIMIT %d,%d', $record_offset, $chunk_size); |
|
24 | + // Construct sql conditions |
|
25 | + $limit = sprintf('LIMIT %d,%d', $record_offset, $chunk_size); |
|
26 | 26 | |
27 | - $count = 0; |
|
27 | + $count = 0; |
|
28 | 28 | |
29 | - db_set_active('boinc_rw'); |
|
30 | - if ($import_lurkers) { |
|
29 | + db_set_active('boinc_rw'); |
|
30 | + if ($import_lurkers) { |
|
31 | 31 | $boinc_accounts = db_query('SELECT id FROM user ORDER BY id %s', $limit); |
32 | - } |
|
33 | - //else $boinc_accounts = db_query('SELECT DISTINCT user AS boinc_id FROM post ORDER BY boinc_id %s', $limit); |
|
34 | - else { |
|
32 | + } |
|
33 | + //else $boinc_accounts = db_query('SELECT DISTINCT user AS boinc_id FROM post ORDER BY boinc_id %s', $limit); |
|
34 | + else { |
|
35 | 35 | // Need to import any user who is currently ignored in order to keep them |
36 | 36 | // ignored... not particularly clean (ignored users are stored in a string) |
37 | 37 | $ignored_user_list = array(); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | ORDER BY userid ASC" |
43 | 43 | ); |
44 | 44 | while ($ignoring_user = db_fetch_object($ignoring_users)) { |
45 | - $ignored_user_list = $ignored_user_list + array_fill_keys(explode('|', trim($ignoring_user->ignorelist, '|')), 1); |
|
45 | + $ignored_user_list = $ignored_user_list + array_fill_keys(explode('|', trim($ignoring_user->ignorelist, '|')), 1); |
|
46 | 46 | } |
47 | 47 | $ignored_user_list = array_keys($ignored_user_list); |
48 | 48 | $boinc_accounts = db_query(" |
@@ -58,14 +58,14 @@ discard block |
||
58 | 58 | (SELECT DISTINCT senderid FROM {private_messages}) |
59 | 59 | ) AS usersToImport ORDER BY id ASC %s", implode(',', $ignored_user_list), $limit |
60 | 60 | ); |
61 | - } |
|
62 | - db_set_active('default'); |
|
61 | + } |
|
62 | + db_set_active('default'); |
|
63 | 63 | |
64 | - while ($boinc_account = db_fetch_object($boinc_accounts)) { |
|
64 | + while ($boinc_account = db_fetch_object($boinc_accounts)) { |
|
65 | 65 | // Grab the BOINC user object and create a Drupal user from it |
66 | 66 | if (boincuser_register_make_drupal_user($boinc_account->id)) { |
67 | - $count++; |
|
67 | + $count++; |
|
68 | + } |
|
68 | 69 | } |
69 | - } |
|
70 | 70 | |
71 | - echo $count; |
|
71 | + echo $count; |
@@ -114,10 +114,10 @@ discard block |
||
114 | 114 | */ |
115 | 115 | require_once('dbconfig.php'); |
116 | 116 | if (!isset($dbserver) || empty($dbserver)) |
117 | - $dbserver='localhost'; |
|
117 | + $dbserver='localhost'; |
|
118 | 118 | $db_url = array( |
119 | - 'default' => "{$dbtype}://{$dbuser}:".urlencode($dbpass)."@{$dbserver}/{$dbname}", |
|
120 | - 'boinc_rw' => "{$boinc_rw_dbtype}://{$boinc_rw_dbuser}:".urlencode($boinc_rw_dbpass)."@{$boinc_rw_dbserver}/{$boinc_rw_dbname}" |
|
119 | + 'default' => "{$dbtype}://{$dbuser}:".urlencode($dbpass)."@{$dbserver}/{$dbname}", |
|
120 | + 'boinc_rw' => "{$boinc_rw_dbtype}://{$boinc_rw_dbuser}:".urlencode($boinc_rw_dbpass)."@{$boinc_rw_dbserver}/{$boinc_rw_dbname}" |
|
121 | 121 | ); |
122 | 122 | $db_prefix = ''; |
123 | 123 | |
@@ -125,10 +125,10 @@ discard block |
||
125 | 125 | // 'boinc_rw' entry as 'boinc_ro'. |
126 | 126 | |
127 | 127 | if (isset($boinc_ro_dbtype) && isset($boinc_ro_dbuser) && isset($boinc_ro_dbpass) && isset($boinc_ro_dbserver) && isset($boinc_ro_dbname)) { |
128 | - $db_url['boinc_ro'] = "{$boinc_ro_dbtype}://{$boinc_ro_dbuser}:".urlencode($boinc_ro_dbpass)."@{$boinc_ro_dbserver}/{$boinc_ro_dbname}"; |
|
128 | + $db_url['boinc_ro'] = "{$boinc_ro_dbtype}://{$boinc_ro_dbuser}:".urlencode($boinc_ro_dbpass)."@{$boinc_ro_dbserver}/{$boinc_ro_dbname}"; |
|
129 | 129 | } |
130 | 130 | else { |
131 | - $db_url['boinc_ro'] = $db_url['boinc_rw']; |
|
131 | + $db_url['boinc_ro'] = $db_url['boinc_rw']; |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | /** |
@@ -216,5 +216,5 @@ discard block |
||
216 | 216 | */ |
217 | 217 | |
218 | 218 | if (stream_resolve_include_path('settings.local.php')) { |
219 | - include 'settings.local.php'; |
|
219 | + include 'settings.local.php'; |
|
220 | 220 | } |
@@ -17,15 +17,15 @@ discard block |
||
17 | 17 | * Utility Form to delete teams suspected of being spammers. |
18 | 18 | */ |
19 | 19 | function boincteam_utility_delete(&$form_state) { |
20 | - $form = array(); |
|
20 | + $form = array(); |
|
21 | 21 | |
22 | - $form['help'] = array( |
|
22 | + $form['help'] = array( |
|
23 | 23 | '#type' => 'fieldset', |
24 | 24 | '#title' => t('Help'), |
25 | 25 | '#collapsible' => TRUE, |
26 | - ); |
|
26 | + ); |
|
27 | 27 | |
28 | - $form['help']['text'] = array( |
|
28 | + $form['help']['text'] = array( |
|
29 | 29 | '#type' => 'item', |
30 | 30 | '#description' => t('This utility page will help in identifying BOINC teams created by SPAMMERs which can be deleted. The search will find BOINC teams that meet the following criteria. |
31 | 31 | <ul> |
@@ -38,19 +38,19 @@ discard block |
||
38 | 38 | <p> <i>How teams are deleted</i>: Select the teams to be deleted from the table below. Click "Delete Selected Teams" button to begin a batch operation to delete the teams. If you select teams, and then page through to another page of the table, your selections will be lost. I.e., only the teams select on the current page will be deleted. |
39 | 39 | <p> The site must be offline/in maintenance mode before searching for and deleting teams. If not, the delete button below is disabled. |
40 | 40 | '), |
41 | - ); |
|
41 | + ); |
|
42 | 42 | |
43 | - // This variable name has been changed for Drupal 7/8. |
|
44 | - $maintenance_mode = variable_get('site_offline'); |
|
45 | - if (!$maintenance_mode) { |
|
43 | + // This variable name has been changed for Drupal 7/8. |
|
44 | + $maintenance_mode = variable_get('site_offline'); |
|
45 | + if (!$maintenance_mode) { |
|
46 | 46 | drupal_set_message(t('WARNING: Site is online (not in maintenance mode)! Deleting teams is only allowed when site is offline. Change this setting in ') . l(t('Site maintenance'), '/admin/settings/site-maintenance'), 'warning'); |
47 | - } |
|
47 | + } |
|
48 | 48 | |
49 | - $form['teamdelete'] = array( |
|
49 | + $form['teamdelete'] = array( |
|
50 | 50 | '#type' => 'fieldset', |
51 | 51 | '#title' => t('Teams to delete'), |
52 | - ); |
|
53 | - $form['teamdelete']['deleteall'] = array( |
|
52 | + ); |
|
53 | + $form['teamdelete']['deleteall'] = array( |
|
54 | 54 | '#type' => 'submit', |
55 | 55 | '#disabled' => !($maintenance_mode), |
56 | 56 | '#value' => t('Delete Selected Teams'), |
@@ -58,101 +58,101 @@ discard block |
||
58 | 58 | '#attributes' => array( |
59 | 59 | 'onclick' => 'return confirm(\'' . t('You are about to delete the selected teams suspected of being SPAM. Do you want to continue?') . '\')', |
60 | 60 | ), |
61 | - ); |
|
62 | - $form['teamdelete']['results_table'] = array( |
|
61 | + ); |
|
62 | + $form['teamdelete']['results_table'] = array( |
|
63 | 63 | '#value' => drupal_get_form('boincteam_utility_team_table'), |
64 | - ); |
|
64 | + ); |
|
65 | 65 | |
66 | - return $form; |
|
66 | + return $form; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | function boincteam_utility_team_table() { |
70 | 70 | |
71 | - $limit=50; |
|
72 | - $sql = "SELECT team.id AS id, team.name AS name, team.nusers AS nusers FROM {team} WHERE team.nusers<2 AND team.total_credit=0 AND team.seti_id=0 AND team.description REGEXP '<a href'"; |
|
71 | + $limit=50; |
|
72 | + $sql = "SELECT team.id AS id, team.name AS name, team.nusers AS nusers FROM {team} WHERE team.nusers<2 AND team.total_credit=0 AND team.seti_id=0 AND team.description REGEXP '<a href'"; |
|
73 | 73 | |
74 | - // @todo - add bts() or t() |
|
75 | - $resultheader = array( |
|
74 | + // @todo - add bts() or t() |
|
75 | + $resultheader = array( |
|
76 | 76 | array( |
77 | - 'data' => 'Team ID', |
|
78 | - 'field' => 'id', |
|
79 | - 'sort' => 'asc', |
|
77 | + 'data' => 'Team ID', |
|
78 | + 'field' => 'id', |
|
79 | + 'sort' => 'asc', |
|
80 | 80 | ), |
81 | 81 | array( |
82 | - 'data' => 'Team Name', |
|
83 | - 'field' => 'name', |
|
82 | + 'data' => 'Team Name', |
|
83 | + 'field' => 'name', |
|
84 | 84 | ), |
85 | 85 | array( |
86 | - 'data' => 'Num Users', |
|
87 | - 'field' => 'nusers', |
|
86 | + 'data' => 'Num Users', |
|
87 | + 'field' => 'nusers', |
|
88 | 88 | ), |
89 | 89 | array( |
90 | - 'data' => 'Link to Team', |
|
91 | - 'field' => 'link', |
|
90 | + 'data' => 'Link to Team', |
|
91 | + 'field' => 'link', |
|
92 | 92 | ), |
93 | - ); |
|
93 | + ); |
|
94 | 94 | |
95 | - $tablesort = tablesort_sql($resultheader); |
|
96 | - db_set_active('boinc_rw'); |
|
97 | - $db_res = pager_query($sql . $tablesort, $limit); |
|
98 | - db_set_active('default'); |
|
95 | + $tablesort = tablesort_sql($resultheader); |
|
96 | + db_set_active('boinc_rw'); |
|
97 | + $db_res = pager_query($sql . $tablesort, $limit); |
|
98 | + db_set_active('default'); |
|
99 | 99 | |
100 | - $form = array(); |
|
101 | - $form['options'] = array(); |
|
102 | - $checkboxes = array(); |
|
103 | - if ($db_res) { |
|
100 | + $form = array(); |
|
101 | + $form['options'] = array(); |
|
102 | + $checkboxes = array(); |
|
103 | + if ($db_res) { |
|
104 | 104 | while ($result = db_fetch_object($db_res)) { |
105 | - $drupalnid = boincteam_lookup_nid($result->id); |
|
106 | - if ($drupalnid) { |
|
105 | + $drupalnid = boincteam_lookup_nid($result->id); |
|
106 | + if ($drupalnid) { |
|
107 | 107 | $tlink = l($result->name, '/community/teams/' . $drupalnid); |
108 | - } |
|
109 | - else { |
|
108 | + } |
|
109 | + else { |
|
110 | 110 | $tlink = ''; |
111 | - } |
|
112 | - // only keys no values |
|
113 | - $checkboxes[$result->id] = ''; |
|
111 | + } |
|
112 | + // only keys no values |
|
113 | + $checkboxes[$result->id] = ''; |
|
114 | 114 | |
115 | - $form['id'][$result->id] = array( |
|
115 | + $form['id'][$result->id] = array( |
|
116 | 116 | '#value' => $result->id, |
117 | - ); |
|
118 | - $form['name'][$result->id] = array( |
|
117 | + ); |
|
118 | + $form['name'][$result->id] = array( |
|
119 | 119 | '#value' => $result->name, |
120 | - ); |
|
121 | - $form['nusers'][$result->id] = array( |
|
120 | + ); |
|
121 | + $form['nusers'][$result->id] = array( |
|
122 | 122 | '#value' => $result->nusers, |
123 | - ); |
|
124 | - $form['link'][$result->id] = array( |
|
123 | + ); |
|
124 | + $form['link'][$result->id] = array( |
|
125 | 125 | '#value' => $tlink, |
126 | - ); |
|
126 | + ); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | $form['checkboxes'] = array('#type' => 'checkboxes', '#options' => $checkboxes); |
130 | 130 | $form['pager'] = array('#value' => theme('pager', NULL, $limit, 0)); |
131 | 131 | |
132 | 132 | return $form; |
133 | - } |
|
134 | - return "<p>No teams matched the criteria for a SPAM team.</p>"; |
|
133 | + } |
|
134 | + return "<p>No teams matched the criteria for a SPAM team.</p>"; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | /** |
138 | 138 | * Submit handler - also creates the batch job to delete the teams. |
139 | 139 | */ |
140 | 140 | function boincteam_utility_delete_team($form, &$form_state) { |
141 | - $checkedteamids = $form_state['clicked_button']['#post']['checkboxes']; |
|
142 | - // Use batch to delete teams |
|
143 | - $operations = array(); |
|
144 | - foreach ($checkedteamids as $id) { |
|
141 | + $checkedteamids = $form_state['clicked_button']['#post']['checkboxes']; |
|
142 | + // Use batch to delete teams |
|
143 | + $operations = array(); |
|
144 | + foreach ($checkedteamids as $id) { |
|
145 | 145 | $operations[] = array('boincteam_utility_batch_process', array($id)); |
146 | - } |
|
147 | - $batch = array( |
|
146 | + } |
|
147 | + $batch = array( |
|
148 | 148 | 'title' => t('Processing BOINC Teams'), |
149 | 149 | 'operations' => $operations, |
150 | 150 | 'init_message' => t('Starting team deletion'), |
151 | 151 | 'finished' => 'boincteam_utility_batch_finished', |
152 | 152 | 'file' => drupal_get_path('module', 'boincteam') . '/boincteam.admin.inc', |
153 | - ); |
|
154 | - batch_set($batch); |
|
155 | - //batch_process('/admin/boinc/utility-team-delete'); |
|
153 | + ); |
|
154 | + batch_set($batch); |
|
155 | + //batch_process('/admin/boinc/utility-team-delete'); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | /* |
@@ -163,37 +163,37 @@ discard block |
||
163 | 163 | * Input form (table) |
164 | 164 | */ |
165 | 165 | function theme_boincteam_utility_team_table($form) { |
166 | - //define table header |
|
167 | - $header = array( |
|
166 | + //define table header |
|
167 | + $header = array( |
|
168 | 168 | theme('table_select_header_cell'), //using that previously empty field |
169 | 169 | array('data' => t('Team ID'), 'field' => 'id', 'sort' => 'asc'), |
170 | 170 | array('data' => t('Name'), 'field' => 'name'), |
171 | 171 | array('data' => t('Num Users'), 'field' => 'nusers'), |
172 | 172 | array('data' => t('Link to Team'), 'field' => 'link'), |
173 | - ); |
|
174 | - $rows = array(); |
|
175 | - $output = ""; |
|
176 | - if(!empty($form['checkboxes']['#options'])) { |
|
173 | + ); |
|
174 | + $rows = array(); |
|
175 | + $output = ""; |
|
176 | + if(!empty($form['checkboxes']['#options'])) { |
|
177 | 177 | foreach (element_children($form['id']) as $key) { |
178 | - $rows[] = array( |
|
178 | + $rows[] = array( |
|
179 | 179 | drupal_render($form['checkboxes'][$key]), |
180 | 180 | drupal_render($form['id'][$key]), |
181 | 181 | drupal_render($form['name'][$key]), |
182 | 182 | drupal_render($form['nusers'][$key]), |
183 | 183 | drupal_render($form['link'][$key]), |
184 | - ); |
|
184 | + ); |
|
185 | + } |
|
185 | 186 | } |
186 | - } |
|
187 | - else { |
|
187 | + else { |
|
188 | 188 | $rows[] = array(array('data' => '<div class="error">No teams found</div>', 'colspan' => 5)); |
189 | - } |
|
190 | - $output .= theme('table', $header, $rows); |
|
191 | - if ($form['pager']['#value']) { |
|
189 | + } |
|
190 | + $output .= theme('table', $header, $rows); |
|
191 | + if ($form['pager']['#value']) { |
|
192 | 192 | $output .= drupal_render($form['pager']); |
193 | - } |
|
193 | + } |
|
194 | 194 | |
195 | - $output .= drupal_render($form); |
|
196 | - return $output; |
|
195 | + $output .= drupal_render($form); |
|
196 | + return $output; |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | /** |
@@ -202,26 +202,26 @@ discard block |
||
202 | 202 | * table. It also removes the team's drupal page (node) if found. |
203 | 203 | */ |
204 | 204 | function boincteam_utility_batch_process($id, &$context) { |
205 | - $boincteam = boincteam_load($id); |
|
206 | - $drupalid = boincteam_lookup_nid($id); |
|
205 | + $boincteam = boincteam_load($id); |
|
206 | + $drupalid = boincteam_lookup_nid($id); |
|
207 | 207 | |
208 | - // Delete entry in team table |
|
209 | - db_set_active('boinc_rw'); |
|
210 | - $sql1='DELETE FROM {team} WHERE id=%d'; |
|
211 | - $db_res = db_query($sql1, $id); |
|
212 | - db_set_active('default'); |
|
208 | + // Delete entry in team table |
|
209 | + db_set_active('boinc_rw'); |
|
210 | + $sql1='DELETE FROM {team} WHERE id=%d'; |
|
211 | + $db_res = db_query($sql1, $id); |
|
212 | + db_set_active('default'); |
|
213 | 213 | |
214 | - // Delete entry in boincteam table |
|
215 | - $sql2='DELETE FROM {boincteam} WHERE id=%d'; |
|
216 | - $db_res = db_query($sql2, $id); |
|
214 | + // Delete entry in boincteam table |
|
215 | + $sql2='DELETE FROM {boincteam} WHERE id=%d'; |
|
216 | + $db_res = db_query($sql2, $id); |
|
217 | 217 | |
218 | - // Delete the drupal node (if present) |
|
219 | - if ($drupalid) { |
|
218 | + // Delete the drupal node (if present) |
|
219 | + if ($drupalid) { |
|
220 | 220 | node_delete($drupalid); |
221 | - } |
|
221 | + } |
|
222 | 222 | |
223 | - $context['results'][] = $id . ' : ' . check_plain($boincteam->name); |
|
224 | - $context['message'] = t('Processing team @name', array('@name' => $boincteam->name)); |
|
223 | + $context['results'][] = $id . ' : ' . check_plain($boincteam->name); |
|
224 | + $context['message'] = t('Processing team @name', array('@name' => $boincteam->name)); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | /** |
@@ -229,15 +229,15 @@ discard block |
||
229 | 229 | * or failure. |
230 | 230 | */ |
231 | 231 | function boincteam_utility_batch_finished($success, $results, $operations) { |
232 | - if ($success) { |
|
232 | + if ($success) { |
|
233 | 233 | $message = 'Info: Delete SPAM Teams utility- ' . count($results) . ' team(s) deleted.'; |
234 | 234 | drupal_set_message($message, 'info'); |
235 | - } |
|
236 | - else { |
|
235 | + } |
|
236 | + else { |
|
237 | 237 | // An error occurred. |
238 | 238 | // $operations contains the operations that remained unprocessed. |
239 | 239 | $error_operation = reset($operations); |
240 | 240 | $message = 'Error: An error occurred while processing ' . $error_operation[0] . ' with arguments :' . print_r($error_operation[0], TRUE); |
241 | 241 | drupal_set_message($message, 'error'); |
242 | - } |
|
242 | + } |
|
243 | 243 | } |
244 | 244 | \ No newline at end of file |
@@ -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."); |
@@ -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); |
@@ -4,110 +4,110 @@ |
||
4 | 4 | * Implementation of hook_user_default_permissions(). |
5 | 5 | */ |
6 | 6 | function discussion_forums_user_default_permissions() { |
7 | - $permissions = array(); |
|
7 | + $permissions = array(); |
|
8 | 8 | |
9 | - // Exported permission: access comments |
|
10 | - $permissions['access comments'] = array( |
|
9 | + // Exported permission: access comments |
|
10 | + $permissions['access comments'] = array( |
|
11 | 11 | 'name' => 'access comments', |
12 | 12 | 'roles' => array( |
13 | - '0' => 'administrator', |
|
14 | - '1' => 'anonymous user', |
|
15 | - '2' => 'authenticated user', |
|
13 | + '0' => 'administrator', |
|
14 | + '1' => 'anonymous user', |
|
15 | + '2' => 'authenticated user', |
|
16 | 16 | ), |
17 | - ); |
|
17 | + ); |
|
18 | 18 | |
19 | - // Exported permission: administer comments |
|
20 | - $permissions['administer comments'] = array( |
|
19 | + // Exported permission: administer comments |
|
20 | + $permissions['administer comments'] = array( |
|
21 | 21 | 'name' => 'administer comments', |
22 | 22 | 'roles' => array( |
23 | - '0' => 'administrator', |
|
24 | - '1' => 'moderator', |
|
23 | + '0' => 'administrator', |
|
24 | + '1' => 'moderator', |
|
25 | 25 | ), |
26 | - ); |
|
26 | + ); |
|
27 | 27 | |
28 | - // Exported permission: administer forums |
|
29 | - $permissions['administer forums'] = array( |
|
28 | + // Exported permission: administer forums |
|
29 | + $permissions['administer forums'] = array( |
|
30 | 30 | 'name' => 'administer forums', |
31 | 31 | 'roles' => array( |
32 | - '0' => 'administrator', |
|
32 | + '0' => 'administrator', |
|
33 | 33 | ), |
34 | - ); |
|
34 | + ); |
|
35 | 35 | |
36 | - // Exported permission: assign community member role |
|
37 | - $permissions['assign community member role'] = array( |
|
36 | + // Exported permission: assign community member role |
|
37 | + $permissions['assign community member role'] = array( |
|
38 | 38 | 'name' => 'assign community member role', |
39 | 39 | 'roles' => array( |
40 | - '0' => 'moderator', |
|
40 | + '0' => 'moderator', |
|
41 | 41 | ), |
42 | - ); |
|
42 | + ); |
|
43 | 43 | |
44 | - // Exported permission: create forum topics |
|
45 | - $permissions['create forum topics'] = array( |
|
44 | + // Exported permission: create forum topics |
|
45 | + $permissions['create forum topics'] = array( |
|
46 | 46 | 'name' => 'create forum topics', |
47 | 47 | 'roles' => array( |
48 | - '0' => 'administrator', |
|
49 | - '1' => 'community member', |
|
50 | - '2' => 'moderator', |
|
51 | - '3' => 'verified contributor', |
|
48 | + '0' => 'administrator', |
|
49 | + '1' => 'community member', |
|
50 | + '2' => 'moderator', |
|
51 | + '3' => 'verified contributor', |
|
52 | 52 | ), |
53 | - ); |
|
53 | + ); |
|
54 | 54 | |
55 | - // Exported permission: delete any forum topic |
|
56 | - $permissions['delete any forum topic'] = array( |
|
55 | + // Exported permission: delete any forum topic |
|
56 | + $permissions['delete any forum topic'] = array( |
|
57 | 57 | 'name' => 'delete any forum topic', |
58 | 58 | 'roles' => array( |
59 | - '0' => 'administrator', |
|
59 | + '0' => 'administrator', |
|
60 | 60 | ), |
61 | - ); |
|
61 | + ); |
|
62 | 62 | |
63 | - // Exported permission: delete own forum topics |
|
64 | - $permissions['delete own forum topics'] = array( |
|
63 | + // Exported permission: delete own forum topics |
|
64 | + $permissions['delete own forum topics'] = array( |
|
65 | 65 | 'name' => 'delete own forum topics', |
66 | 66 | 'roles' => array( |
67 | - '0' => 'administrator', |
|
67 | + '0' => 'administrator', |
|
68 | 68 | ), |
69 | - ); |
|
69 | + ); |
|
70 | 70 | |
71 | - // Exported permission: edit any forum topic |
|
72 | - $permissions['edit any forum topic'] = array( |
|
71 | + // Exported permission: edit any forum topic |
|
72 | + $permissions['edit any forum topic'] = array( |
|
73 | 73 | 'name' => 'edit any forum topic', |
74 | 74 | 'roles' => array( |
75 | - '0' => 'administrator', |
|
76 | - '1' => 'moderator', |
|
75 | + '0' => 'administrator', |
|
76 | + '1' => 'moderator', |
|
77 | 77 | ), |
78 | - ); |
|
78 | + ); |
|
79 | 79 | |
80 | - // Exported permission: edit own forum topics |
|
81 | - $permissions['edit own forum topics'] = array( |
|
80 | + // Exported permission: edit own forum topics |
|
81 | + $permissions['edit own forum topics'] = array( |
|
82 | 82 | 'name' => 'edit own forum topics', |
83 | 83 | 'roles' => array( |
84 | - '0' => 'administrator', |
|
85 | - '1' => 'community member', |
|
86 | - '2' => 'verified contributor', |
|
84 | + '0' => 'administrator', |
|
85 | + '1' => 'community member', |
|
86 | + '2' => 'verified contributor', |
|
87 | 87 | ), |
88 | - ); |
|
88 | + ); |
|
89 | 89 | |
90 | - // Exported permission: post comments |
|
91 | - $permissions['post comments'] = array( |
|
90 | + // Exported permission: post comments |
|
91 | + $permissions['post comments'] = array( |
|
92 | 92 | 'name' => 'post comments', |
93 | 93 | 'roles' => array( |
94 | - '0' => 'administrator', |
|
95 | - '1' => 'community member', |
|
96 | - '2' => 'moderator', |
|
97 | - '3' => 'verified contributor', |
|
94 | + '0' => 'administrator', |
|
95 | + '1' => 'community member', |
|
96 | + '2' => 'moderator', |
|
97 | + '3' => 'verified contributor', |
|
98 | 98 | ), |
99 | - ); |
|
99 | + ); |
|
100 | 100 | |
101 | - // Exported permission: post comments without approval |
|
102 | - $permissions['post comments without approval'] = array( |
|
101 | + // Exported permission: post comments without approval |
|
102 | + $permissions['post comments without approval'] = array( |
|
103 | 103 | 'name' => 'post comments without approval', |
104 | 104 | 'roles' => array( |
105 | - '0' => 'administrator', |
|
106 | - '1' => 'community member', |
|
107 | - '2' => 'moderator', |
|
108 | - '3' => 'verified contributor', |
|
105 | + '0' => 'administrator', |
|
106 | + '1' => 'community member', |
|
107 | + '2' => 'moderator', |
|
108 | + '3' => 'verified contributor', |
|
109 | 109 | ), |
110 | - ); |
|
110 | + ); |
|
111 | 111 | |
112 | - return $permissions; |
|
112 | + return $permissions; |
|
113 | 113 | } |