@@ -4,152 +4,152 @@ |
||
4 | 4 | * Implementation of hook_ctools_plugin_api(). |
5 | 5 | */ |
6 | 6 | function teams_ctools_plugin_api() { |
7 | - list($module, $api) = func_get_args(); |
|
8 | - if ($module == "page_manager" && $api == "pages_default") { |
|
7 | + list($module, $api) = func_get_args(); |
|
8 | + if ($module == "page_manager" && $api == "pages_default") { |
|
9 | 9 | return array("version" => 1); |
10 | - } |
|
11 | - elseif ($module == "strongarm" && $api == "strongarm") { |
|
10 | + } |
|
11 | + elseif ($module == "strongarm" && $api == "strongarm") { |
|
12 | 12 | return array("version" => 1); |
13 | - } |
|
13 | + } |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | /** |
17 | 17 | * Implementation of hook_node_info(). |
18 | 18 | */ |
19 | 19 | function teams_node_info() { |
20 | - $items = array( |
|
20 | + $items = array( |
|
21 | 21 | 'team' => array( |
22 | - 'name' => t('Team'), |
|
23 | - 'module' => 'features', |
|
24 | - 'description' => t('A grouping of users, centered on a common interest.'), |
|
25 | - 'has_title' => '1', |
|
26 | - 'title_label' => t('Name'), |
|
27 | - 'has_body' => '1', |
|
28 | - 'body_label' => t('Description'), |
|
29 | - 'min_word_count' => '0', |
|
30 | - 'help' => '', |
|
22 | + 'name' => t('Team'), |
|
23 | + 'module' => 'features', |
|
24 | + 'description' => t('A grouping of users, centered on a common interest.'), |
|
25 | + 'has_title' => '1', |
|
26 | + 'title_label' => t('Name'), |
|
27 | + 'has_body' => '1', |
|
28 | + 'body_label' => t('Description'), |
|
29 | + 'min_word_count' => '0', |
|
30 | + 'help' => '', |
|
31 | 31 | ), |
32 | - ); |
|
33 | - return $items; |
|
32 | + ); |
|
33 | + return $items; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | 37 | * Implementation of hook_rules_defaults(). |
38 | 38 | */ |
39 | 39 | function teams_rules_defaults() { |
40 | - return array( |
|
40 | + return array( |
|
41 | 41 | 'rules' => array( |
42 | - 'rules_notify_admins_about_error_creating_a_boinc_team' => array( |
|
42 | + 'rules_notify_admins_about_error_creating_a_boinc_team' => array( |
|
43 | 43 | '#type' => 'rule', |
44 | 44 | '#set' => 'event_boincteam_create_team_error', |
45 | 45 | '#label' => 'Notify admins about error creating a BOINC team', |
46 | 46 | '#active' => 1, |
47 | 47 | '#weight' => '0', |
48 | 48 | '#categories' => array( |
49 | - '0' => 'boinc_team', |
|
50 | - 'teams' => 'teams', |
|
49 | + '0' => 'boinc_team', |
|
50 | + 'teams' => 'teams', |
|
51 | 51 | ), |
52 | 52 | '#status' => 'default', |
53 | 53 | '#conditions' => array(), |
54 | 54 | '#actions' => array( |
55 | - '0' => array( |
|
55 | + '0' => array( |
|
56 | 56 | '#type' => 'action', |
57 | 57 | '#settings' => array( |
58 | - 'from' => '', |
|
59 | - 'subject' => '[subject_tag:string] Error creating new team', |
|
60 | - 'message' => '[user:display-name] attempted to create team [team_name:string], but an error was returned. See function \'boincteam_create_form_submit\'. BOINC function \'make_team\' did not return a valid boinc_team object.', |
|
61 | - '#eval input' => array( |
|
58 | + 'from' => '', |
|
59 | + 'subject' => '[subject_tag:string] Error creating new team', |
|
60 | + 'message' => '[user:display-name] attempted to create team [team_name:string], but an error was returned. See function \'boincteam_create_form_submit\'. BOINC function \'make_team\' did not return a valid boinc_team object.', |
|
61 | + '#eval input' => array( |
|
62 | 62 | 'token_rules_input_evaluator' => array( |
63 | - 'subject' => array( |
|
63 | + 'subject' => array( |
|
64 | 64 | '0' => 'subject_tag', |
65 | 65 | '1' => ':global', |
66 | - ), |
|
67 | - 'message' => array( |
|
66 | + ), |
|
67 | + 'message' => array( |
|
68 | 68 | '0' => 'team_name', |
69 | 69 | '1' => 'user', |
70 | 70 | '2' => ':global', |
71 | - ), |
|
72 | - 'from' => array( |
|
71 | + ), |
|
72 | + 'from' => array( |
|
73 | 73 | '0' => ':global', |
74 | - ), |
|
74 | + ), |
|
75 | + ), |
|
75 | 76 | ), |
76 | - ), |
|
77 | 77 | ), |
78 | 78 | '#name' => 'boinccore_rules_action_mail_to_admins', |
79 | 79 | '#info' => array( |
80 | - 'label' => 'Notify admins via email', |
|
81 | - 'module' => 'BOINC core', |
|
82 | - 'eval input' => array( |
|
80 | + 'label' => 'Notify admins via email', |
|
81 | + 'module' => 'BOINC core', |
|
82 | + 'eval input' => array( |
|
83 | 83 | '0' => 'subject', |
84 | 84 | '1' => 'message', |
85 | 85 | '2' => 'from', |
86 | - ), |
|
86 | + ), |
|
87 | 87 | ), |
88 | 88 | '#weight' => 0.0, |
89 | - ), |
|
89 | + ), |
|
90 | 90 | ), |
91 | 91 | '#version' => 6003, |
92 | - ), |
|
93 | - 'rules_notify_admins_about_error_creating_a_boinc_team_no_pathauto' => array( |
|
92 | + ), |
|
93 | + 'rules_notify_admins_about_error_creating_a_boinc_team_no_pathauto' => array( |
|
94 | 94 | '#type' => 'rule', |
95 | 95 | '#set' => 'event_boincteam_create_team_nopathauto_error', |
96 | 96 | '#label' => 'Notify admins about error creating a BOINC team no pathauto', |
97 | 97 | '#active' => 1, |
98 | 98 | '#weight' => '0', |
99 | 99 | '#categories' => array( |
100 | - '0' => 'boinc_team', |
|
101 | - 'teams' => 'teams', |
|
100 | + '0' => 'boinc_team', |
|
101 | + 'teams' => 'teams', |
|
102 | 102 | ), |
103 | 103 | '#status' => 'default', |
104 | 104 | '#conditions' => array(), |
105 | 105 | '#actions' => array( |
106 | - '0' => array( |
|
106 | + '0' => array( |
|
107 | 107 | '#type' => 'action', |
108 | 108 | '#settings' => array( |
109 | - 'from' => '', |
|
110 | - 'subject' => '[subject_tag:string] Error creating BOINC team - no pathauo module', |
|
111 | - 'message' => '[user:display-name] attempted to create team [team_name:string], but no pathauto module detected. See function \'boincteam_create_form_submit\'.', |
|
112 | - '#eval input' => array( |
|
109 | + 'from' => '', |
|
110 | + 'subject' => '[subject_tag:string] Error creating BOINC team - no pathauo module', |
|
111 | + 'message' => '[user:display-name] attempted to create team [team_name:string], but no pathauto module detected. See function \'boincteam_create_form_submit\'.', |
|
112 | + '#eval input' => array( |
|
113 | 113 | 'token_rules_input_evaluator' => array( |
114 | - 'subject' => array( |
|
114 | + 'subject' => array( |
|
115 | 115 | '0' => 'subject_tag', |
116 | 116 | '1' => ':global', |
117 | - ), |
|
118 | - 'message' => array( |
|
117 | + ), |
|
118 | + 'message' => array( |
|
119 | 119 | '0' => 'team_name', |
120 | 120 | '1' => 'user', |
121 | 121 | '2' => ':global', |
122 | - ), |
|
123 | - 'from' => array( |
|
122 | + ), |
|
123 | + 'from' => array( |
|
124 | 124 | '0' => ':global', |
125 | - ), |
|
125 | + ), |
|
126 | + ), |
|
126 | 127 | ), |
127 | - ), |
|
128 | 128 | ), |
129 | 129 | '#name' => 'boinccore_rules_action_mail_to_admins', |
130 | 130 | '#info' => array( |
131 | - 'label' => 'Notify admins via email', |
|
132 | - 'module' => 'BOINC core', |
|
133 | - 'eval input' => array( |
|
131 | + 'label' => 'Notify admins via email', |
|
132 | + 'module' => 'BOINC core', |
|
133 | + 'eval input' => array( |
|
134 | 134 | '0' => 'subject', |
135 | 135 | '1' => 'message', |
136 | 136 | '2' => 'from', |
137 | - ), |
|
137 | + ), |
|
138 | 138 | ), |
139 | 139 | '#weight' => 0.0, |
140 | - ), |
|
140 | + ), |
|
141 | 141 | ), |
142 | 142 | '#version' => 6003, |
143 | - ), |
|
143 | + ), |
|
144 | 144 | ), |
145 | - ); |
|
145 | + ); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |
149 | 149 | * Implementation of hook_views_api(). |
150 | 150 | */ |
151 | 151 | function teams_views_api() { |
152 | - return array( |
|
152 | + return array( |
|
153 | 153 | 'api' => '2', |
154 | - ); |
|
154 | + ); |
|
155 | 155 | } |
@@ -16,39 +16,39 @@ |
||
16 | 16 | */ |
17 | 17 | |
18 | 18 | function boincteam_rules_event_info() { |
19 | - return array( |
|
19 | + return array( |
|
20 | 20 | 'boincteam_create_team_error' => array( |
21 | - 'label' => bts('Error creating a new BOINC team - general error.', array(), NULL, 'boinc:rule-event'), |
|
22 | - 'module' => 'Boincteam', |
|
23 | - 'arguments' => rules_events_hook_boincteam_arguments(), |
|
21 | + 'label' => bts('Error creating a new BOINC team - general error.', array(), NULL, 'boinc:rule-event'), |
|
22 | + 'module' => 'Boincteam', |
|
23 | + 'arguments' => rules_events_hook_boincteam_arguments(), |
|
24 | 24 | ), |
25 | 25 | 'boincteam_create_team_nopathauto_error' => array( |
26 | - 'label' => bts('Error creating a new BOINC team - no pathauto module.', array(), NULL, 'boinc:rule-event'), |
|
27 | - 'module' => 'Boincteam', |
|
28 | - 'arguments' => rules_events_hook_boincteam_arguments(), |
|
26 | + 'label' => bts('Error creating a new BOINC team - no pathauto module.', array(), NULL, 'boinc:rule-event'), |
|
27 | + 'module' => 'Boincteam', |
|
28 | + 'arguments' => rules_events_hook_boincteam_arguments(), |
|
29 | 29 | ), |
30 | - ); |
|
30 | + ); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Arguments suitable for boincteam |
35 | 35 | **/ |
36 | 36 | function rules_events_hook_boincteam_arguments() { |
37 | - return array( |
|
37 | + return array( |
|
38 | 38 | 'team_name' => array( |
39 | - 'type' => 'string', |
|
40 | - 'label' => 'team name', |
|
41 | - 'required' => TRUE, |
|
39 | + 'type' => 'string', |
|
40 | + 'label' => 'team name', |
|
41 | + 'required' => TRUE, |
|
42 | 42 | ), |
43 | - ) + rules_events_hook_boincteam_adminnotify_argument(); |
|
43 | + ) + rules_events_hook_boincteam_adminnotify_argument(); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | function rules_events_hook_boincteam_adminnotify_argument() { |
47 | - return array( |
|
47 | + return array( |
|
48 | 48 | 'subject_tag' => array( |
49 | - 'type' => 'string', |
|
50 | - 'label' => 'Subject tag for email filtering', |
|
51 | - 'required' => TRUE, |
|
49 | + 'type' => 'string', |
|
50 | + 'label' => 'Subject tag for email filtering', |
|
51 | + 'required' => TRUE, |
|
52 | 52 | ), |
53 | - ) + rules_events_global_user_argument(); |
|
53 | + ) + rules_events_global_user_argument(); |
|
54 | 54 | } |
55 | 55 | \ No newline at end of file |
@@ -16,59 +16,59 @@ |
||
16 | 16 | */ |
17 | 17 | |
18 | 18 | function boincuser_rules_event_info() { |
19 | - return array( |
|
19 | + return array( |
|
20 | 20 | 'boincuser_change_email_error' => array( |
21 | - 'label' => bts('Error from user changing e-mail address.', array(), NULL, 'boinc:rule-event'), |
|
22 | - 'module' => 'Boincuser', |
|
23 | - 'arguments' => rules_events_hook_boincuser_chemail_arguments(), |
|
21 | + 'label' => bts('Error from user changing e-mail address.', array(), NULL, 'boinc:rule-event'), |
|
22 | + 'module' => 'Boincuser', |
|
23 | + 'arguments' => rules_events_hook_boincuser_chemail_arguments(), |
|
24 | 24 | ), |
25 | 25 | 'boincuser_revert_email_error' => array( |
26 | - 'label' => bts('Error from user reverting to previous e-mail address.', array(), NULL, 'boinc:rule-event'), |
|
27 | - 'module' => 'Boincuser', |
|
28 | - 'arguments' => rules_events_hook_boincuser_chemail_arguments(), |
|
26 | + 'label' => bts('Error from user reverting to previous e-mail address.', array(), NULL, 'boinc:rule-event'), |
|
27 | + 'module' => 'Boincuser', |
|
28 | + 'arguments' => rules_events_hook_boincuser_chemail_arguments(), |
|
29 | 29 | ), |
30 | 30 | 'boincuser_general_consent_error' => array( |
31 | - 'label' => bts('Error from user consenting to terms-of-use.', array(), NULL, 'boinc:rule-event'), |
|
32 | - 'module' => 'Boincuser', |
|
33 | - 'arguments' => rules_events_hook_boincuser_adminnotify_argument(), |
|
31 | + 'label' => bts('Error from user consenting to terms-of-use.', array(), NULL, 'boinc:rule-event'), |
|
32 | + 'module' => 'Boincuser', |
|
33 | + 'arguments' => rules_events_hook_boincuser_adminnotify_argument(), |
|
34 | 34 | ), |
35 | 35 | 'boincuser_general_consent_type_error' => array( |
36 | - 'label' => bts('Error dealing with missing consent type.', array(), NULL, 'boinc:rule-event'), |
|
37 | - 'module' => 'Boincuser', |
|
38 | - 'arguments' => rules_events_hook_boincuser_consenttype_argument(), |
|
36 | + 'label' => bts('Error dealing with missing consent type.', array(), NULL, 'boinc:rule-event'), |
|
37 | + 'module' => 'Boincuser', |
|
38 | + 'arguments' => rules_events_hook_boincuser_consenttype_argument(), |
|
39 | 39 | ), |
40 | - ); |
|
40 | + ); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
44 | 44 | * Arguments suitable for boincuser |
45 | 45 | **/ |
46 | 46 | function rules_events_hook_boincuser_chemail_arguments() { |
47 | - return array( |
|
47 | + return array( |
|
48 | 48 | 'new_email_addr' => array( |
49 | - 'type' => 'string', |
|
50 | - 'label' => 'New email address', |
|
51 | - 'required' => TRUE, |
|
49 | + 'type' => 'string', |
|
50 | + 'label' => 'New email address', |
|
51 | + 'required' => TRUE, |
|
52 | 52 | ), |
53 | - ) + rules_events_hook_boincuser_adminnotify_argument(); |
|
53 | + ) + rules_events_hook_boincuser_adminnotify_argument(); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | function rules_events_hook_boincuser_consenttype_argument() { |
57 | - return array( |
|
57 | + return array( |
|
58 | 58 | 'consent_type' => array( |
59 | - 'type' => 'string', |
|
60 | - 'label' => 'Consent type id that caused the error', |
|
61 | - 'required' => TRUE, |
|
59 | + 'type' => 'string', |
|
60 | + 'label' => 'Consent type id that caused the error', |
|
61 | + 'required' => TRUE, |
|
62 | 62 | ), |
63 | - ) + rules_events_hook_boincuser_adminnotify_argument(); |
|
63 | + ) + rules_events_hook_boincuser_adminnotify_argument(); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | function rules_events_hook_boincuser_adminnotify_argument() { |
67 | - return array( |
|
67 | + return array( |
|
68 | 68 | 'subject_tag' => array( |
69 | - 'type' => 'string', |
|
70 | - 'label' => 'Subject tag for email filtering', |
|
71 | - 'required' => TRUE, |
|
69 | + 'type' => 'string', |
|
70 | + 'label' => 'Subject tag for email filtering', |
|
71 | + 'required' => TRUE, |
|
72 | 72 | ), |
73 | - ) + rules_events_global_user_argument(); |
|
73 | + ) + rules_events_global_user_argument(); |
|
74 | 74 | } |
75 | 75 | \ No newline at end of file |
@@ -20,15 +20,15 @@ discard block |
||
20 | 20 | * Implementation of hook_perm(). |
21 | 21 | */ |
22 | 22 | function boincuser_delete_perm() { |
23 | - return array('delete own account'); |
|
23 | + return array('delete own account'); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Implementation of hook_menu(). |
28 | 28 | */ |
29 | 29 | function boincuser_delete_menu() { |
30 | - $items = array(); |
|
31 | - $items['admin/boinc/user_delete'] = array( |
|
30 | + $items = array(); |
|
31 | + $items['admin/boinc/user_delete'] = array( |
|
32 | 32 | 'title' => t('Preferences: BOINC user delete'), |
33 | 33 | 'description' => t('Configure the BOINC user delete action.'), |
34 | 34 | 'page callback' => 'drupal_get_form', |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | 'access arguments' => array('administer users'), |
37 | 37 | 'type' => MENU_NORMAL_ITEM, |
38 | 38 | 'file' => 'boincuser_delete.admin.inc', |
39 | - ); |
|
39 | + ); |
|
40 | 40 | |
41 | - $items['admin/boinc/user_delete/%'] = array( |
|
41 | + $items['admin/boinc/user_delete/%'] = array( |
|
42 | 42 | 'title' => t('Admin delete user'), |
43 | 43 | 'description' => t('Deletes a user as an admin'), |
44 | 44 | 'page callback' => 'drupal_get_form', |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | 'access arguments' => array('administer users'), |
47 | 47 | 'type' => MENU_CALLBACK, |
48 | 48 | 'file' => 'boincuser_delete.admin.inc', |
49 | - ); |
|
49 | + ); |
|
50 | 50 | |
51 | - $items['user/%user/deleteconfirm/%'] = array( |
|
51 | + $items['user/%user/deleteconfirm/%'] = array( |
|
52 | 52 | 'title' => t('Final confirmation for account deletion'), |
53 | 53 | 'description' => t('Final confirmation for account deletion'), |
54 | 54 | 'page callback' => 'drupal_get_form', |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | 'access callback' => 'boincuser_delete_access', |
57 | 57 | 'access arguments' => array(1), |
58 | 58 | 'type' => MENU_CALLBACK, |
59 | - ); |
|
59 | + ); |
|
60 | 60 | |
61 | - $items['user/%user/odeleteconfirm/%'] = array( |
|
61 | + $items['user/%user/odeleteconfirm/%'] = array( |
|
62 | 62 | 'title' => t('Final confirmation for account deletion'), |
63 | 63 | 'description' => t('Final confirmation for account deletion'), |
64 | 64 | 'page callback' => 'drupal_get_form', |
@@ -66,204 +66,204 @@ discard block |
||
66 | 66 | 'access callback' => 'boincuser_delete_access', |
67 | 67 | 'access arguments' => array(1), |
68 | 68 | 'type' => MENU_CALLBACK, |
69 | - ); |
|
69 | + ); |
|
70 | 70 | |
71 | - return $items; |
|
71 | + return $items; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
75 | 75 | * Checks whether a user can delete an account. |
76 | 76 | */ |
77 | 77 | function boincuser_delete_access($account) { |
78 | - global $user; |
|
79 | - return ((user_access('administer users') || (user_access('delete own account') && $account->uid == $user->uid)) && $account->uid > 0); |
|
78 | + global $user; |
|
79 | + return ((user_access('administer users') || (user_access('delete own account') && $account->uid == $user->uid)) && $account->uid > 0); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
83 | 83 | * Implementation of hook_menu_alter(). |
84 | 84 | */ |
85 | 85 | function boincuser_delete_menu_alter(&$callbacks) { |
86 | - $callbacks['user/%user/delete']['access callback'] = 'boincuser_delete_access'; |
|
87 | - $callbacks['user/%user/delete']['access arguments'] = array(1); |
|
88 | - $callbacks['user/%user/delete']['type'] = MENU_CALLBACK; |
|
86 | + $callbacks['user/%user/delete']['access callback'] = 'boincuser_delete_access'; |
|
87 | + $callbacks['user/%user/delete']['access arguments'] = array(1); |
|
88 | + $callbacks['user/%user/delete']['type'] = MENU_CALLBACK; |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
92 | 92 | * Implementation of hook_form_alter(). |
93 | 93 | */ |
94 | 94 | function boincuser_delete_form_alter(&$form, $form_state, $form_id) { |
95 | - global $user; |
|
95 | + global $user; |
|
96 | 96 | |
97 | - switch($form_id) { |
|
97 | + switch($form_id) { |
|
98 | 98 | case 'user_profile_form': |
99 | 99 | if ( user_access('delete own account') AND ($form['#uid'] == $user->uid) AND (arg(3)=='') ) { |
100 | 100 | $form['delete'] = array( |
101 | - '#type' => 'submit', |
|
102 | - '#value' => bts('Delete Account', array(), null, 'boinc:delete-user-account'), |
|
103 | - '#weight' => 1009, |
|
104 | - '#submit' => array('user_edit_delete_submit'), |
|
105 | - '#prefix' => '<li class="tab">', |
|
106 | - '#suffix' => '</li>', |
|
101 | + '#type' => 'submit', |
|
102 | + '#value' => bts('Delete Account', array(), null, 'boinc:delete-user-account'), |
|
103 | + '#weight' => 1009, |
|
104 | + '#submit' => array('user_edit_delete_submit'), |
|
105 | + '#prefix' => '<li class="tab">', |
|
106 | + '#suffix' => '</li>', |
|
107 | 107 | ); |
108 | - } |
|
109 | - else if ( user_access('administer users') ) { |
|
108 | + } |
|
109 | + else if ( user_access('administer users') ) { |
|
110 | 110 | $form['delete'] = array( |
111 | - '#type' => 'submit', |
|
112 | - '#value' => bts('Delete Account', array(), null, 'boinc:delete-user-account'), |
|
113 | - '#weight' => 1009, |
|
114 | - '#submit' => array('_boincuser_delete_goto_admindelete'), |
|
115 | - '#prefix' => '<li class="tab">', |
|
116 | - '#suffix' => '</li>', |
|
111 | + '#type' => 'submit', |
|
112 | + '#value' => bts('Delete Account', array(), null, 'boinc:delete-user-account'), |
|
113 | + '#weight' => 1009, |
|
114 | + '#submit' => array('_boincuser_delete_goto_admindelete'), |
|
115 | + '#prefix' => '<li class="tab">', |
|
116 | + '#suffix' => '</li>', |
|
117 | 117 | ); |
118 | - } |
|
119 | - else { |
|
118 | + } |
|
119 | + else { |
|
120 | 120 | unset($form['delete']); |
121 | - } |
|
122 | - break; |
|
121 | + } |
|
122 | + break; |
|
123 | 123 | case 'user_confirm_delete': |
124 | 124 | |
125 | 125 | $disable_delete = FALSE; |
126 | - // If email address was changed less than 7 days (7 * 86400 s) |
|
127 | - // ago, it cannot be changed again. |
|
128 | - $duration = TOKEN_DURATION_ONE_WEEK; |
|
129 | - if (($form['_account']['#value']->boincuser_email_addr_change_time + $duration) > time()) { |
|
126 | + // If email address was changed less than 7 days (7 * 86400 s) |
|
127 | + // ago, it cannot be changed again. |
|
128 | + $duration = TOKEN_DURATION_ONE_WEEK; |
|
129 | + if (($form['_account']['#value']->boincuser_email_addr_change_time + $duration) > time()) { |
|
130 | 130 | drupal_set_message( |
131 | - bts("INFO: Your email address was changed within the past seven (7) days. You may not delete your account until after !time.", |
|
131 | + bts("INFO: Your email address was changed within the past seven (7) days. You may not delete your account until after !time.", |
|
132 | 132 | array( |
133 | - '!time' => date('F j, Y \a\t G:i T', $form['_account']['#value']->boincuser_email_addr_change_time + $duration), |
|
133 | + '!time' => date('F j, Y \a\t G:i T', $form['_account']['#value']->boincuser_email_addr_change_time + $duration), |
|
134 | 134 | ), NULL, 'boinc:account-credentials-change') |
135 | 135 | , 'info'); |
136 | 136 | $disable_delete = TRUE; |
137 | - } |
|
137 | + } |
|
138 | 138 | |
139 | - // Configure radio options |
|
140 | - $common_acts = bts("All your posts and comments will be attributed to the Anonymous User. Your user profile will be deleted. Your host information will be deleted. And you will be removed from any team you are a member of.", array(), NULL, 'boinc:delete-user-account'); |
|
139 | + // Configure radio options |
|
140 | + $common_acts = bts("All your posts and comments will be attributed to the Anonymous User. Your user profile will be deleted. Your host information will be deleted. And you will be removed from any team you are a member of.", array(), NULL, 'boinc:delete-user-account'); |
|
141 | 141 | |
142 | - $deleteoptions = array( |
|
142 | + $deleteoptions = array( |
|
143 | 143 | 'boincuser_delete_softdelete' => bts('<b>Soft delete</b> your account. Your account will be disabled. ', array(), NULL, 'boinc:delete-user-account'), |
144 | 144 | 'boincuser_delete_delete' => bts('<b>Delete</b> your account. ', array(), NULL, 'boinc:delete-user-account'), |
145 | - ); |
|
145 | + ); |
|
146 | 146 | |
147 | - $dtypes = variable_get('boincuser_delete_type', 'user_decides'); |
|
148 | - // Unset the other option if dtype is set. i.e., if dtype is set |
|
149 | - // to soft delete, unset the hard delete option. Likewise, add |
|
150 | - // the 'common_acts' sentences to the option that remains. |
|
151 | - switch ($dtypes) { |
|
147 | + $dtypes = variable_get('boincuser_delete_type', 'user_decides'); |
|
148 | + // Unset the other option if dtype is set. i.e., if dtype is set |
|
149 | + // to soft delete, unset the hard delete option. Likewise, add |
|
150 | + // the 'common_acts' sentences to the option that remains. |
|
151 | + switch ($dtypes) { |
|
152 | 152 | case 'soft_obfuscate': |
153 | 153 | unset($deleteoptions['boincuser_delete_delete']); |
154 | - $deleteoptions['boincuser_delete_softdelete'] .= $common_acts; |
|
155 | - break; |
|
154 | + $deleteoptions['boincuser_delete_softdelete'] .= $common_acts; |
|
155 | + break; |
|
156 | 156 | case 'hard_wipe': |
157 | 157 | unset($deleteoptions['boincuser_delete_softdelete']); |
158 | - $deleteoptions['boincuser_delete_delete'] .= $common_acts; |
|
159 | - break; |
|
160 | - } |
|
158 | + $deleteoptions['boincuser_delete_delete'] .= $common_acts; |
|
159 | + break; |
|
160 | + } |
|
161 | 161 | |
162 | - $question = 'Are you sure you want to delete the account <em>' . htmlspecialchars($form['_account']['#value']->boincuser_name) . '</em>?'; |
|
163 | - drupal_set_title($question); |
|
162 | + $question = 'Are you sure you want to delete the account <em>' . htmlspecialchars($form['_account']['#value']->boincuser_name) . '</em>?'; |
|
163 | + drupal_set_title($question); |
|
164 | 164 | |
165 | - unset($form['description']); |
|
165 | + unset($form['description']); |
|
166 | 166 | |
167 | - $form['main'] = array( |
|
167 | + $form['main'] = array( |
|
168 | 168 | '#type' => 'fieldset', |
169 | 169 | '#weight' => 1, |
170 | - ); |
|
170 | + ); |
|
171 | 171 | |
172 | - $form['main']['fs1'] = array( |
|
172 | + $form['main']['fs1'] = array( |
|
173 | 173 | '#type' => 'fieldset', |
174 | 174 | '#title' => bts('Instructions', array(), NULL, 'boinc:delete-user-account'), |
175 | 175 | '#weight' => 10, |
176 | 176 | '#collapsible' => TRUE, |
177 | 177 | '#collapsed' => TRUE, |
178 | - ); |
|
179 | - $form['main']['fs1']['help'] = array( |
|
178 | + ); |
|
179 | + $form['main']['fs1']['help'] = array( |
|
180 | 180 | '#value' => bts( |
181 | - "<p>In order to delete your account, you must provide your password below. You will then be sent an email to the email address on record, with a one-time token that expires in 24-hours. Clicking on this link will bring you to a second form where you must enter your password again. After doing so your account will be deleted.</p>" . |
|
182 | - "<p>If necessary, you may !link first before deleting your account. But you must wait <b>seven (7) days</b> after an email address change before you may delete your account.</p>", |
|
183 | - array( |
|
181 | + "<p>In order to delete your account, you must provide your password below. You will then be sent an email to the email address on record, with a one-time token that expires in 24-hours. Clicking on this link will bring you to a second form where you must enter your password again. After doing so your account will be deleted.</p>" . |
|
182 | + "<p>If necessary, you may !link first before deleting your account. But you must wait <b>seven (7) days</b> after an email address change before you may delete your account.</p>", |
|
183 | + array( |
|
184 | 184 | '!link' => l(bts('change your email address', array(), NULL, 'boinc:delete-user-account'), '/account/info/edit'), |
185 | - ), NULL, 'boinc:delete-user-account'), |
|
185 | + ), NULL, 'boinc:delete-user-account'), |
|
186 | 186 | '#weight' => 11, |
187 | 187 | '#prefix' => "<div id='delete-instructions'>", |
188 | 188 | '#suffix' => "</div>", |
189 | - ); |
|
189 | + ); |
|
190 | 190 | |
191 | - if ($dtypes == 'user_decides') { |
|
191 | + if ($dtypes == 'user_decides') { |
|
192 | 192 | $form['main']['common'] = array( |
193 | - '#value' => bts('All choices: ', array(), NULL, 'boinc:delete-user-account') . $common_acts . '<p>' . bts('Disabled means some of your personal data, such as your username and email address, are kept on our systems. Choose \'delete your account\' if you want all personal data to be removed.', array(), NULL, 'boinc:delete-user-account'), |
|
194 | - '#prefix' => "<div id='delete-instructions'>", |
|
195 | - '#suffix' => "</div>", |
|
196 | - '#weight' => 20, |
|
193 | + '#value' => bts('All choices: ', array(), NULL, 'boinc:delete-user-account') . $common_acts . '<p>' . bts('Disabled means some of your personal data, such as your username and email address, are kept on our systems. Choose \'delete your account\' if you want all personal data to be removed.', array(), NULL, 'boinc:delete-user-account'), |
|
194 | + '#prefix' => "<div id='delete-instructions'>", |
|
195 | + '#suffix' => "</div>", |
|
196 | + '#weight' => 20, |
|
197 | 197 | ); |
198 | - } |
|
198 | + } |
|
199 | 199 | |
200 | - $form['main']['user_delete_action'] = array( |
|
200 | + $form['main']['user_delete_action'] = array( |
|
201 | 201 | '#type' => 'radios', |
202 | 202 | '#options' => $deleteoptions, |
203 | 203 | '#weight' => 21, |
204 | - ); |
|
205 | - if ($disable_delete) { |
|
204 | + ); |
|
205 | + if ($disable_delete) { |
|
206 | 206 | $form['main']['user_delete_action']['#disabled'] = TRUE; |
207 | - } |
|
207 | + } |
|
208 | 208 | |
209 | - // Password field |
|
210 | - if (!$disable_delete) { |
|
209 | + // Password field |
|
210 | + if (!$disable_delete) { |
|
211 | 211 | $form['main']['current_pass'] = array( |
212 | - '#type' => 'password', |
|
213 | - '#title' => bts('Enter your password to delete your account', array(), NULL, 'boinc:delete-user-account'), |
|
214 | - '#size' => 17, |
|
215 | - '#attributes' => array( |
|
212 | + '#type' => 'password', |
|
213 | + '#title' => bts('Enter your password to delete your account', array(), NULL, 'boinc:delete-user-account'), |
|
214 | + '#size' => 17, |
|
215 | + '#attributes' => array( |
|
216 | 216 | 'autocomplete' => 'off', |
217 | - ), |
|
218 | - '#prefix' => "<div id='delete-password-field'>", |
|
219 | - '#suffix' => "</div>", |
|
220 | - '#weight' => 25, |
|
217 | + ), |
|
218 | + '#prefix' => "<div id='delete-password-field'>", |
|
219 | + '#suffix' => "</div>", |
|
220 | + '#weight' => 25, |
|
221 | 221 | ); |
222 | - } |
|
222 | + } |
|
223 | 223 | |
224 | - $form['separator_bottom'] = array( |
|
224 | + $form['separator_bottom'] = array( |
|
225 | 225 | '#value' => '<div class="separator buttons"></div>', |
226 | 226 | '#weight' => 999, |
227 | - ); |
|
227 | + ); |
|
228 | 228 | |
229 | - // Configure the action buttons |
|
230 | - $uid = $form['_account']['#value']->uid; |
|
231 | - $form['actions']['#weight'] = 1000; |
|
232 | - $form['actions']['form control tabs prefix'] = array( |
|
229 | + // Configure the action buttons |
|
230 | + $uid = $form['_account']['#value']->uid; |
|
231 | + $form['actions']['#weight'] = 1000; |
|
232 | + $form['actions']['form control tabs prefix'] = array( |
|
233 | 233 | '#value' => '<ul class="form-control tab-list">', |
234 | 234 | '#weight' => 1001, |
235 | - ); |
|
236 | - |
|
237 | - unset($form['actions']['#prefix']); |
|
238 | - unset($form['actions']['#suffix']); |
|
239 | - $form['actions']['submit']['#prefix'] = '<li class="first tab">'; |
|
240 | - $form['actions']['submit']['#suffix'] = '</li>'; |
|
241 | - $form['actions']['submit']['#value'] = bts('Submit', array(), NULL, 'boinc:form-submit'); |
|
242 | - $form['actions']['submit']['#weight'] = 1002; |
|
243 | - if ($disable_delete) { |
|
235 | + ); |
|
236 | + |
|
237 | + unset($form['actions']['#prefix']); |
|
238 | + unset($form['actions']['#suffix']); |
|
239 | + $form['actions']['submit']['#prefix'] = '<li class="first tab">'; |
|
240 | + $form['actions']['submit']['#suffix'] = '</li>'; |
|
241 | + $form['actions']['submit']['#value'] = bts('Submit', array(), NULL, 'boinc:form-submit'); |
|
242 | + $form['actions']['submit']['#weight'] = 1002; |
|
243 | + if ($disable_delete) { |
|
244 | 244 | $form['actions']['submit']['#disabled'] = TRUE; |
245 | 245 | $form['actions']['submit']['#value'] = ''; |
246 | - } |
|
246 | + } |
|
247 | 247 | |
248 | - $form['actions']['cancel']['#prefix'] = '<li class="tab">'; |
|
249 | - $form['actions']['cancel']['#suffix'] = '</li>'; |
|
250 | - $form['actions']['cancel']['#weight'] = 1003; |
|
251 | - $form['actions']['cancel']['#value'] = l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), 'account/info/edit'); |
|
252 | - if ($disable_delete) { |
|
248 | + $form['actions']['cancel']['#prefix'] = '<li class="tab">'; |
|
249 | + $form['actions']['cancel']['#suffix'] = '</li>'; |
|
250 | + $form['actions']['cancel']['#weight'] = 1003; |
|
251 | + $form['actions']['cancel']['#value'] = l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), 'account/info/edit'); |
|
252 | + if ($disable_delete) { |
|
253 | 253 | $form['actions']['cancel']['#prefix'] = '<li class="first tab">'; |
254 | - } |
|
254 | + } |
|
255 | 255 | |
256 | - $form['actions']['form control tabs suffix'] = array( |
|
256 | + $form['actions']['form control tabs suffix'] = array( |
|
257 | 257 | '#value' => '</ul>', |
258 | 258 | '#weight' => 1010, |
259 | - ); |
|
259 | + ); |
|
260 | 260 | |
261 | - $form['#redirect'] = 'account/' . $uid; |
|
262 | - $form['#validate'] = array('boincuser_delete_validate'); |
|
263 | - $form['#submit'] = array('boincuser_delete_submit'); |
|
264 | - break; |
|
261 | + $form['#redirect'] = 'account/' . $uid; |
|
262 | + $form['#validate'] = array('boincuser_delete_validate'); |
|
263 | + $form['#submit'] = array('boincuser_delete_submit'); |
|
264 | + break; |
|
265 | 265 | |
266 | - } // switch |
|
266 | + } // switch |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | |
@@ -274,29 +274,29 @@ discard block |
||
274 | 274 | * password. |
275 | 275 | */ |
276 | 276 | function boincuser_delete_validate($form, &$form_state) { |
277 | - require_boinc('boinc_db'); |
|
277 | + require_boinc('boinc_db'); |
|
278 | 278 | |
279 | - if ($form_state['values']['user_delete_action'] == '') { |
|
279 | + if ($form_state['values']['user_delete_action'] == '') { |
|
280 | 280 | form_set_error('user_delete_action', bts('Please select an action to perform using the radio buttons.', array(), NULL, 'boinc:delete-user-account')); |
281 | - } |
|
281 | + } |
|
282 | 282 | |
283 | - // check BOINC user exists |
|
284 | - $account = $form_state['values']['_account']; |
|
285 | - $boinc_user = boincuser_load($account->uid, TRUE); |
|
286 | - if (!$boinc_user) { |
|
283 | + // check BOINC user exists |
|
284 | + $account = $form_state['values']['_account']; |
|
285 | + $boinc_user = boincuser_load($account->uid, TRUE); |
|
286 | + if (!$boinc_user) { |
|
287 | 287 | rules_invoke_event('boincuser_delete_general_error', variable_get('boinc_admin_mailing_list_subject_tag', '')); |
288 | 288 | return form_set_error('current_pass', |
289 | - bts('There was a problem deleting your account. The @project administrators have been contacted.', |
|
290 | - array( |
|
289 | + bts('There was a problem deleting your account. The @project administrators have been contacted.', |
|
290 | + array( |
|
291 | 291 | '@project' => variable_get('site_name', 'Drupal-BOINC'), |
292 | - ) |
|
293 | - , NULL, 'boinc:delete-user-account') |
|
292 | + ) |
|
293 | + , NULL, 'boinc:delete-user-account') |
|
294 | 294 | ); |
295 | - } |
|
295 | + } |
|
296 | 296 | |
297 | - if (_boincuser_delete_validatepasswd($boinc_user, $form_state['values']['current_pass'])) { |
|
297 | + if (_boincuser_delete_validatepasswd($boinc_user, $form_state['values']['current_pass'])) { |
|
298 | 298 | return true; |
299 | - } |
|
299 | + } |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | /** |
@@ -307,46 +307,46 @@ discard block |
||
307 | 307 | * to delete the account. |
308 | 308 | */ |
309 | 309 | function boincuser_delete_submit($form, &$form_state) { |
310 | - require_boinc('token'); |
|
311 | - global $user; |
|
310 | + require_boinc('token'); |
|
311 | + global $user; |
|
312 | 312 | |
313 | - $uid = $form_state['values']['_account']->uid; |
|
314 | - $account = user_load(array('uid' => $uid)); |
|
313 | + $uid = $form_state['values']['_account']->uid; |
|
314 | + $account = user_load(array('uid' => $uid)); |
|
315 | 315 | |
316 | - if (!$account) { |
|
316 | + if (!$account) { |
|
317 | 317 | rules_invoke_event('boincuser_delete_uid_invalid_error', variable_get('boinc_admin_mailing_list_subject_tag', '')); |
318 | 318 | drupal_set_message( |
319 | - bts('ERROR: The user account @uid does not exist. The @project administrators have been notified.', |
|
319 | + bts('ERROR: The user account @uid does not exist. The @project administrators have been notified.', |
|
320 | 320 | array( |
321 | - '@uid' => $uid, |
|
322 | - '@project' => variable_get('site_name', 'Drupal-BOINC'), |
|
321 | + '@uid' => $uid, |
|
322 | + '@project' => variable_get('site_name', 'Drupal-BOINC'), |
|
323 | 323 | ), NULL, 'delete-user-account'), |
324 | - 'error'); |
|
324 | + 'error'); |
|
325 | 325 | watchdog('user', 'Attempted to cancel non-existing user account UID: %uid.', array('%uid' => $uid), WATCHDOG_ERROR); |
326 | 326 | return; |
327 | - } |
|
328 | - |
|
329 | - global $base_url; |
|
330 | - global $base_path; |
|
331 | - module_load_include('inc', 'rules', 'modules/system.rules'); |
|
332 | - $site_name = variable_get('site_name', 'Drupal-BOINC'); |
|
333 | - $site_url = $base_url . $base_path . "user/login"; |
|
334 | - |
|
335 | - // Perform the requested operation |
|
336 | - $op = $form_state['values']['user_delete_action']; |
|
337 | - // create token with 1 day/24 hour expiration |
|
338 | - $mytoken = create_token($account->boincuser_id, 'D', 24*60*60); |
|
339 | - switch ($op) { |
|
327 | + } |
|
328 | + |
|
329 | + global $base_url; |
|
330 | + global $base_path; |
|
331 | + module_load_include('inc', 'rules', 'modules/system.rules'); |
|
332 | + $site_name = variable_get('site_name', 'Drupal-BOINC'); |
|
333 | + $site_url = $base_url . $base_path . "user/login"; |
|
334 | + |
|
335 | + // Perform the requested operation |
|
336 | + $op = $form_state['values']['user_delete_action']; |
|
337 | + // create token with 1 day/24 hour expiration |
|
338 | + $mytoken = create_token($account->boincuser_id, 'D', 24*60*60); |
|
339 | + switch ($op) { |
|
340 | 340 | case 'boincuser_delete_softdelete': |
341 | 341 | $myurl = "${base_url}/user/{$account->uid}/odeleteconfirm/$mytoken"; |
342 | - break; |
|
342 | + break; |
|
343 | 343 | case 'boincuser_delete_delete': |
344 | 344 | $myurl = "${base_url}/user/{$account->uid}/deleteconfirm/$mytoken"; |
345 | - break; |
|
346 | - } |
|
345 | + break; |
|
346 | + } |
|
347 | 347 | |
348 | - $mysubject = "Instructions for account deletion at {$site_name}"; |
|
349 | - $mymessage = '' |
|
348 | + $mysubject = "Instructions for account deletion at {$site_name}"; |
|
349 | + $mymessage = '' |
|
350 | 350 | . "{$account->boincuser_name},\n" |
351 | 351 | . "\n" |
352 | 352 | . "We have received a request to DELETE your user account at " |
@@ -368,25 +368,25 @@ discard block |
||
368 | 368 | . "\n" |
369 | 369 | . "{$site_name} support team"; |
370 | 370 | |
371 | - // Create array for sending email to user to notify account is being |
|
372 | - // disabled/deleted. Then send email. |
|
373 | - $settings = array( |
|
371 | + // Create array for sending email to user to notify account is being |
|
372 | + // disabled/deleted. Then send email. |
|
373 | + $settings = array( |
|
374 | 374 | 'from' => '', |
375 | 375 | 'subject' => $mysubject, |
376 | 376 | 'message' => $mymessage, |
377 | - ); |
|
378 | - rules_action_mail_to_user($account, $settings); |
|
377 | + ); |
|
378 | + rules_action_mail_to_user($account, $settings); |
|
379 | 379 | |
380 | - drupal_set_message(bts("INFO: You have requested account deletion. Please check your email for further instructions.", array(), NULL, 'boinc:delete-user-account'),'info'); |
|
380 | + drupal_set_message(bts("INFO: You have requested account deletion. Please check your email for further instructions.", array(), NULL, 'boinc:delete-user-account'),'info'); |
|
381 | 381 | |
382 | - $redirect = variable_get('boincuser_delete_redirect', '<front>'); |
|
383 | - // Redirect |
|
384 | - if (!empty($redirect)) { |
|
382 | + $redirect = variable_get('boincuser_delete_redirect', '<front>'); |
|
383 | + // Redirect |
|
384 | + if (!empty($redirect)) { |
|
385 | 385 | drupal_goto($redirect); |
386 | - } |
|
387 | - else { |
|
386 | + } |
|
387 | + else { |
|
388 | 388 | drupal_goto(); |
389 | - } |
|
389 | + } |
|
390 | 390 | } |
391 | 391 | |
392 | 392 | |
@@ -398,88 +398,88 @@ discard block |
||
398 | 398 | * The final confirmation form for the user to delete their account. |
399 | 399 | */ |
400 | 400 | function boincuser_delete_finalconfirmation(&$form_state, $token) { |
401 | - require_boinc('token'); |
|
401 | + require_boinc('token'); |
|
402 | 402 | |
403 | - global $user; |
|
404 | - $form = array(); |
|
403 | + global $user; |
|
404 | + $form = array(); |
|
405 | 405 | |
406 | - // check BOINC user exists |
|
407 | - $account = user_load(array('uid' => $user->uid)); |
|
408 | - $uid = $user->uid; |
|
409 | - $boincid = $account->boincuser_id; |
|
410 | - // check $token is valid |
|
411 | - if (!is_valid_token($boincid, $token, 'D')) { |
|
406 | + // check BOINC user exists |
|
407 | + $account = user_load(array('uid' => $user->uid)); |
|
408 | + $uid = $user->uid; |
|
409 | + $boincid = $account->boincuser_id; |
|
410 | + // check $token is valid |
|
411 | + if (!is_valid_token($boincid, $token, 'D')) { |
|
412 | 412 | drupal_set_message(bts('ERROR: You have supplied an incorrect (most likely expired) token. Please obtain a new token by !link your account be deleted.', |
413 | 413 | array( |
414 | - '!link' => l(bts('re-requesting', array(), NULL, 'boinc:delete-user-account'), "/user/${uid}/delete"), |
|
414 | + '!link' => l(bts('re-requesting', array(), NULL, 'boinc:delete-user-account'), "/user/${uid}/delete"), |
|
415 | 415 | ), |
416 | 416 | NULL, 'boinc:delete-user-account'), 'error'); |
417 | 417 | drupal_goto(); |
418 | - } |
|
418 | + } |
|
419 | 419 | |
420 | - // Attach account to this form. |
|
421 | - $form['_account'] = array('#type' => 'value', '#value' => $account); |
|
420 | + // Attach account to this form. |
|
421 | + $form['_account'] = array('#type' => 'value', '#value' => $account); |
|
422 | 422 | |
423 | - // This form is for hard/wipe delete |
|
424 | - $form['_action'] = array('#type' => 'value', '#value' => 'hard_wipe'); |
|
423 | + // This form is for hard/wipe delete |
|
424 | + $form['_action'] = array('#type' => 'value', '#value' => 'hard_wipe'); |
|
425 | 425 | |
426 | - // Instructions |
|
427 | - $form['main']['fs1'] = array( |
|
426 | + // Instructions |
|
427 | + $form['main']['fs1'] = array( |
|
428 | 428 | '#type' => 'fieldset', |
429 | 429 | '#title' => bts('Instructions', array(), NULL, 'boinc:delete-user-account'), |
430 | 430 | '#weight' => 10, |
431 | 431 | '#collapsible' => TRUE, |
432 | 432 | '#collapsed' => TRUE, |
433 | - ); |
|
434 | - $form['main']['fs1']['instructions1'] = array( |
|
433 | + ); |
|
434 | + $form['main']['fs1']['instructions1'] = array( |
|
435 | 435 | '#value' => '<p>'. |
436 | 436 | bts('You are one-step away from deleting your account. Enter your password in the textbox below and click submit. This action is irreversable: once you delete your account, there is no way un-delete.', array(), NULL, 'boinc:delete-user-account'). |
437 | 437 | '</p>', |
438 | 438 | '#prefix' => "<div id='delete-instructions'>", |
439 | 439 | '#suffix' => "</div>", |
440 | - ); |
|
440 | + ); |
|
441 | 441 | |
442 | - $form['main']['fs1']['instructions2'] = array( |
|
442 | + $form['main']['fs1']['instructions2'] = array( |
|
443 | 443 | '#value' => '<p>'. |
444 | 444 | bts('If you wish to cancel, click cancel and you will be taken to your account dashboard.', array(), NULL, 'boinc:delete-user-account'). |
445 | 445 | '</p>', |
446 | 446 | '#prefix' => "<div id='delete-instructions'>", |
447 | 447 | '#suffix' => "</div>", |
448 | - ); |
|
448 | + ); |
|
449 | 449 | |
450 | - // Password field |
|
451 | - $form['main']['current_pass'] = array( |
|
450 | + // Password field |
|
451 | + $form['main']['current_pass'] = array( |
|
452 | 452 | '#type' => 'password', |
453 | 453 | '#title' => bts('Enter your password to delete your account', array(), NULL, 'boinc:delete-user-account'), |
454 | 454 | '#size' => 17, |
455 | 455 | '#attributes' => array( |
456 | - 'autocomplete' => 'off', |
|
456 | + 'autocomplete' => 'off', |
|
457 | 457 | ), |
458 | 458 | '#weight' => 25, |
459 | - ); |
|
459 | + ); |
|
460 | 460 | |
461 | - // Form control |
|
462 | - $form['form control tabs prefix'] = array( |
|
461 | + // Form control |
|
462 | + $form['form control tabs prefix'] = array( |
|
463 | 463 | '#value' => '<ul class="form-control tab-list">', |
464 | 464 | '#weight' => 1001, |
465 | - ); |
|
466 | - $form['submit'] = array( |
|
465 | + ); |
|
466 | + $form['submit'] = array( |
|
467 | 467 | '#prefix' => '<li class="first tab">', |
468 | 468 | '#type' => 'submit', |
469 | 469 | '#value' => bts('Submit', array(), NULL, 'boinc:form-submit'), |
470 | 470 | '#suffix' => '</li>', |
471 | 471 | '#weight' => 1002, |
472 | - ); |
|
473 | - $form['form control tabs'] = array( |
|
472 | + ); |
|
473 | + $form['form control tabs'] = array( |
|
474 | 474 | '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "account/") . '</li>', |
475 | 475 | '#weight' => 1003, |
476 | - ); |
|
477 | - $form['form control tabs suffix'] = array( |
|
476 | + ); |
|
477 | + $form['form control tabs suffix'] = array( |
|
478 | 478 | '#value' => '</ul>', |
479 | 479 | '#weight' => 1004, |
480 | - ); |
|
480 | + ); |
|
481 | 481 | |
482 | - return $form; |
|
482 | + return $form; |
|
483 | 483 | } |
484 | 484 | |
485 | 485 | /** |
@@ -487,133 +487,133 @@ discard block |
||
487 | 487 | * the soft/obfuscate method. |
488 | 488 | */ |
489 | 489 | function boincuser_delete_softdelconfirmation(&$form_state, $token) { |
490 | - require_boinc('token'); |
|
490 | + require_boinc('token'); |
|
491 | 491 | |
492 | - global $user; |
|
493 | - $form = array(); |
|
492 | + global $user; |
|
493 | + $form = array(); |
|
494 | 494 | |
495 | - // check BOINC user exists |
|
496 | - $account = user_load(array('uid' => $user->uid)); |
|
497 | - $uid = $user->uid; |
|
498 | - $boincid = $account->boincuser_id; |
|
495 | + // check BOINC user exists |
|
496 | + $account = user_load(array('uid' => $user->uid)); |
|
497 | + $uid = $user->uid; |
|
498 | + $boincid = $account->boincuser_id; |
|
499 | 499 | |
500 | - // check $token is valid |
|
501 | - if (!is_valid_token($boincid, $token, 'D')) { |
|
500 | + // check $token is valid |
|
501 | + if (!is_valid_token($boincid, $token, 'D')) { |
|
502 | 502 | drupal_set_message(bts('ERROR: You have supplied an incorrect (most likely expired) token. Please obtain a new token by !link your account be deleted.', |
503 | 503 | array( |
504 | - '!link' => l(bts('re-requesting', array(), NULL, 'boinc:delete-user-account'), "/user/${uid}/delete"), |
|
504 | + '!link' => l(bts('re-requesting', array(), NULL, 'boinc:delete-user-account'), "/user/${uid}/delete"), |
|
505 | 505 | ), |
506 | 506 | NULL, 'boinc:delete-user-account'), 'error'); |
507 | 507 | drupal_goto(); |
508 | - } |
|
508 | + } |
|
509 | 509 | |
510 | - // Attach account to this form. |
|
511 | - $form['_account'] = array('#type' => 'value', '#value' => $account); |
|
510 | + // Attach account to this form. |
|
511 | + $form['_account'] = array('#type' => 'value', '#value' => $account); |
|
512 | 512 | |
513 | - // This form is for hard/wipe delete |
|
514 | - $form['_action'] = array('#type' => 'value', '#value' => 'soft_obfuscate'); |
|
513 | + // This form is for hard/wipe delete |
|
514 | + $form['_action'] = array('#type' => 'value', '#value' => 'soft_obfuscate'); |
|
515 | 515 | |
516 | - // Instructions |
|
517 | - $form['main']['fs1'] = array( |
|
516 | + // Instructions |
|
517 | + $form['main']['fs1'] = array( |
|
518 | 518 | '#type' => 'fieldset', |
519 | 519 | '#title' => bts('Instructions', array(), NULL, 'boinc:delete-user-account'), |
520 | 520 | '#weight' => 10, |
521 | 521 | '#collapsible' => TRUE, |
522 | 522 | '#collapsed' => TRUE, |
523 | - ); |
|
524 | - $form['main']['fs1']['instructions1'] = array( |
|
523 | + ); |
|
524 | + $form['main']['fs1']['instructions1'] = array( |
|
525 | 525 | '#value' => '<p>'. |
526 | 526 | bts('You are one-step away from deleting your account. Enter your password in the textbox below and click submit. This action is irreversable: once you delete your account, there is no way un-delete.', array(), NULL, 'boinc:delete-user-account'). |
527 | 527 | '</p>', |
528 | 528 | '#prefix' => "<div id='delete-instructions'>", |
529 | 529 | '#suffix' => "</div>", |
530 | - ); |
|
530 | + ); |
|
531 | 531 | |
532 | - $form['main']['fs1']['instructions2'] = array( |
|
532 | + $form['main']['fs1']['instructions2'] = array( |
|
533 | 533 | '#value' => '<p>'. |
534 | 534 | bts('If you wish to cancel, click cancel and you will be taken to your account dashboard.', array(), NULL, 'boinc:delete-user-account'). |
535 | 535 | '</p>', |
536 | 536 | '#prefix' => "<div id='delete-instructions'>", |
537 | 537 | '#suffix' => "</div>", |
538 | - ); |
|
538 | + ); |
|
539 | 539 | |
540 | - // Password field |
|
541 | - $form['main']['current_pass'] = array( |
|
540 | + // Password field |
|
541 | + $form['main']['current_pass'] = array( |
|
542 | 542 | '#type' => 'password', |
543 | 543 | '#title' => bts('Enter your password to delete your account', array(), NULL, 'boinc:delete-user-account'), |
544 | 544 | '#size' => 17, |
545 | 545 | '#attributes' => array( |
546 | - 'autocomplete' => 'off', |
|
546 | + 'autocomplete' => 'off', |
|
547 | 547 | ), |
548 | 548 | '#weight' => 25, |
549 | - ); |
|
549 | + ); |
|
550 | 550 | |
551 | - // Form control |
|
552 | - $form['form control tabs prefix'] = array( |
|
551 | + // Form control |
|
552 | + $form['form control tabs prefix'] = array( |
|
553 | 553 | '#value' => '<ul class="form-control tab-list">', |
554 | 554 | '#weight' => 1001, |
555 | - ); |
|
556 | - $form['submit'] = array( |
|
555 | + ); |
|
556 | + $form['submit'] = array( |
|
557 | 557 | '#prefix' => '<li class="first tab">', |
558 | 558 | '#type' => 'submit', |
559 | 559 | '#value' => bts('Submit', array(), NULL, 'boinc:form-submit'), |
560 | 560 | '#suffix' => '</li>', |
561 | 561 | '#weight' => 1002, |
562 | - ); |
|
563 | - $form['form control tabs'] = array( |
|
562 | + ); |
|
563 | + $form['form control tabs'] = array( |
|
564 | 564 | '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "account/") . '</li>', |
565 | 565 | '#weight' => 1003, |
566 | - ); |
|
567 | - $form['form control tabs suffix'] = array( |
|
566 | + ); |
|
567 | + $form['form control tabs suffix'] = array( |
|
568 | 568 | '#value' => '</ul>', |
569 | 569 | '#weight' => 1004, |
570 | - ); |
|
570 | + ); |
|
571 | 571 | |
572 | - //set validation and submit to the functions below |
|
573 | - $form['#validate'][] = 'boincuser_delete_finalconfirmation_validate'; |
|
574 | - $form['#submit'][] = 'boincuser_delete_finalconfirmation_submit'; |
|
575 | - return $form; |
|
572 | + //set validation and submit to the functions below |
|
573 | + $form['#validate'][] = 'boincuser_delete_finalconfirmation_validate'; |
|
574 | + $form['#submit'][] = 'boincuser_delete_finalconfirmation_submit'; |
|
575 | + return $form; |
|
576 | 576 | } |
577 | 577 | |
578 | 578 | /** |
579 | 579 | * Validation for final confirmation |
580 | 580 | */ |
581 | 581 | function boincuser_delete_finalconfirmation_validate($form, &$form_state) { |
582 | - $account = $form_state['values']['_account']; |
|
583 | - $boinc_user = BoincUser::lookup_id($account->boincuser_id); |
|
582 | + $account = $form_state['values']['_account']; |
|
583 | + $boinc_user = BoincUser::lookup_id($account->boincuser_id); |
|
584 | 584 | |
585 | - if (_boincuser_delete_validatepasswd($boinc_user, $form_state['values']['current_pass'])) { |
|
585 | + if (_boincuser_delete_validatepasswd($boinc_user, $form_state['values']['current_pass'])) { |
|
586 | 586 | return true; |
587 | - } |
|
587 | + } |
|
588 | 588 | } |
589 | 589 | |
590 | 590 | /** |
591 | 591 | * Submit for final confirmation |
592 | 592 | */ |
593 | 593 | function boincuser_delete_finalconfirmation_submit($form, &$form_state) { |
594 | - global $user; |
|
594 | + global $user; |
|
595 | 595 | |
596 | - // Delete the user |
|
597 | - $account = $form_state['values']['_account']; |
|
598 | - $action = $form_state['values']['_action']; |
|
599 | - _boincuser_delete_deleteuser($account, $action); |
|
596 | + // Delete the user |
|
597 | + $account = $form_state['values']['_account']; |
|
598 | + $action = $form_state['values']['_action']; |
|
599 | + _boincuser_delete_deleteuser($account, $action); |
|
600 | 600 | |
601 | - // Destroy the current session: |
|
602 | - session_destroy(); |
|
603 | - // Only variables can be passed by reference workaround. |
|
604 | - $null = NULL; |
|
605 | - user_module_invoke('logout', $null, $user); |
|
601 | + // Destroy the current session: |
|
602 | + session_destroy(); |
|
603 | + // Only variables can be passed by reference workaround. |
|
604 | + $null = NULL; |
|
605 | + user_module_invoke('logout', $null, $user); |
|
606 | 606 | |
607 | - // Load the anonymous user |
|
608 | - $user = drupal_anonymous_user(); |
|
607 | + // Load the anonymous user |
|
608 | + $user = drupal_anonymous_user(); |
|
609 | 609 | |
610 | - $redirect = variable_get('boincuser_delete_redirect', '<front>'); |
|
611 | - // Redirect |
|
612 | - if (!empty($redirect)) { |
|
610 | + $redirect = variable_get('boincuser_delete_redirect', '<front>'); |
|
611 | + // Redirect |
|
612 | + if (!empty($redirect)) { |
|
613 | 613 | drupal_goto($redirect); |
614 | - } |
|
615 | - else { |
|
614 | + } |
|
615 | + else { |
|
616 | 616 | drupal_goto(); |
617 | - } |
|
617 | + } |
|
618 | 618 | |
619 | 619 | } |
@@ -16,18 +16,18 @@ |
||
16 | 16 | */ |
17 | 17 | |
18 | 18 | function boincuser_delete_rules_event_info() { |
19 | - return array( |
|
19 | + return array( |
|
20 | 20 | 'boincuser_delete_general_error' => array( |
21 | - 'label' => bts('Error from user deleting own account.', array(), NULL, 'boinc:rule-event'), |
|
22 | - 'module' => 'Boincuser_Delete', |
|
23 | - 'arguments' => rules_events_hook_boincuser_adminnotify_argument(), |
|
21 | + 'label' => bts('Error from user deleting own account.', array(), NULL, 'boinc:rule-event'), |
|
22 | + 'module' => 'Boincuser_Delete', |
|
23 | + 'arguments' => rules_events_hook_boincuser_adminnotify_argument(), |
|
24 | 24 | ), |
25 | 25 | 'boincuser_delete_uid_invalid_error' => array( |
26 | - 'label' => bts('Error from user deleting own account. User ID is invalid', array(), NULL, 'boinc:rule-event'), |
|
27 | - 'module' => 'Boincuser_Delete', |
|
28 | - 'arguments' => rules_events_hook_boincuser_adminnotify_argument(), |
|
26 | + 'label' => bts('Error from user deleting own account. User ID is invalid', array(), NULL, 'boinc:rule-event'), |
|
27 | + 'module' => 'Boincuser_Delete', |
|
28 | + 'arguments' => rules_events_hook_boincuser_adminnotify_argument(), |
|
29 | 29 | ), |
30 | - ); |
|
30 | + ); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | // function rules_events_hook_boincuser_adminnotify_argument is located in boincuser_rules.inc |
34 | 34 | \ No newline at end of file |
@@ -16,44 +16,44 @@ |
||
16 | 16 | */ |
17 | 17 | |
18 | 18 | function boincwork_rules_event_info() { |
19 | - return array( |
|
19 | + return array( |
|
20 | 20 | 'boincwork_circular_merge_error' => array( |
21 | - 'label' => bts('A circular merge of hosts was attempted with error.', array(), NULL, 'boinc:rule-event'), |
|
22 | - 'module' => 'BOINCwork', |
|
23 | - 'arguments' => rules_events_hook_boincwork_arguments(), |
|
21 | + 'label' => bts('A circular merge of hosts was attempted with error.', array(), NULL, 'boinc:rule-event'), |
|
22 | + 'module' => 'BOINCwork', |
|
23 | + 'arguments' => rules_events_hook_boincwork_arguments(), |
|
24 | 24 | ), |
25 | 25 | 'boincwork_zombie_merge_error' => array( |
26 | - 'label' => bts('A host merge into a zombie host was attempted with error.', array(), NULL, 'boinc:rule-event'), |
|
27 | - 'module' => 'BOINCwork', |
|
28 | - 'arguments' => rules_events_hook_boincwork_arguments(), |
|
26 | + 'label' => bts('A host merge into a zombie host was attempted with error.', array(), NULL, 'boinc:rule-event'), |
|
27 | + 'module' => 'BOINCwork', |
|
28 | + 'arguments' => rules_events_hook_boincwork_arguments(), |
|
29 | 29 | ), |
30 | - ); |
|
30 | + ); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Arguments suitable for boincwork |
35 | 35 | **/ |
36 | 36 | function rules_events_hook_boincwork_arguments() { |
37 | - return array( |
|
37 | + return array( |
|
38 | 38 | 'oldhost_id' => array( |
39 | - 'type' => 'number', |
|
40 | - 'label' => 'old host id', |
|
41 | - 'required' => TRUE, |
|
39 | + 'type' => 'number', |
|
40 | + 'label' => 'old host id', |
|
41 | + 'required' => TRUE, |
|
42 | 42 | ), |
43 | 43 | 'targethost_id' => array( |
44 | - 'type' => 'number', |
|
45 | - 'label' => 'target host id', |
|
46 | - 'required' => TRUE, |
|
44 | + 'type' => 'number', |
|
45 | + 'label' => 'target host id', |
|
46 | + 'required' => TRUE, |
|
47 | 47 | ), |
48 | - ) + rules_events_hook_boincwork_adminnotify_argument(); |
|
48 | + ) + rules_events_hook_boincwork_adminnotify_argument(); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | function rules_events_hook_boincwork_adminnotify_argument() { |
52 | - return array( |
|
52 | + return array( |
|
53 | 53 | 'subject_tag' => array( |
54 | - 'type' => 'string', |
|
55 | - 'label' => 'Subject tag for email filtering', |
|
56 | - 'required' => TRUE, |
|
54 | + 'type' => 'string', |
|
55 | + 'label' => 'Subject tag for email filtering', |
|
56 | + 'required' => TRUE, |
|
57 | 57 | ), |
58 | - ) + rules_events_global_user_argument(); |
|
58 | + ) + rules_events_global_user_argument(); |
|
59 | 59 | } |
60 | 60 | \ No newline at end of file |
@@ -286,11 +286,11 @@ |
||
286 | 286 | |
287 | 287 | require_once("../inc/account_ownership.inc"); |
288 | 288 | if (file_exists($account_ownership_private_key_file_path)) { |
289 | - // If the server has keys configured show the account ownership form |
|
290 | - row2( |
|
291 | - tra("Account Ownership"), |
|
292 | - "<a href=\"account_ownership.php?$url_tokens\">Generate ownership proof</a>" |
|
293 | - ); |
|
289 | + // If the server has keys configured show the account ownership form |
|
290 | + row2( |
|
291 | + tra("Account Ownership"), |
|
292 | + "<a href=\"account_ownership.php?$url_tokens\">Generate ownership proof</a>" |
|
293 | + ); |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | } |
@@ -16,29 +16,29 @@ discard block |
||
16 | 16 | */ |
17 | 17 | |
18 | 18 | function flag_abuse_reason_flag_default_flags() { |
19 | - $flags = array(); |
|
20 | - module_load_include('inc', 'flag_abuse_reason', 'includes/flag_abuse_reason.flag_default'); |
|
21 | - _flag_abuse_reason_abuse_node_flags($flags); |
|
22 | - _flag_abuse_reason_abuse_comment_flags($flags); |
|
23 | - _flag_abuse_reason_abuse_user_flags($flags); |
|
24 | - return $flags; |
|
19 | + $flags = array(); |
|
20 | + module_load_include('inc', 'flag_abuse_reason', 'includes/flag_abuse_reason.flag_default'); |
|
21 | + _flag_abuse_reason_abuse_node_flags($flags); |
|
22 | + _flag_abuse_reason_abuse_comment_flags($flags); |
|
23 | + _flag_abuse_reason_abuse_user_flags($flags); |
|
24 | + return $flags; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
28 | 28 | * Implementation of hook_views_api(). |
29 | 29 | */ |
30 | 30 | function flag_abuse_reason_views_api() { |
31 | - return array( |
|
31 | + return array( |
|
32 | 32 | 'api' => 2.0, |
33 | 33 | 'path' => drupal_get_path('module', 'flag_abuse_reason') . '/includes', |
34 | - ); |
|
34 | + ); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
38 | 38 | * Implementation of hook_perm(). |
39 | 39 | */ |
40 | 40 | function flag_abuse_reason_perm() { |
41 | - return array('reset abuse flags'); |
|
41 | + return array('reset abuse flags'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -47,14 +47,14 @@ discard block |
||
47 | 47 | * Here we change our flag event/action to 'reset'. |
48 | 48 | */ |
49 | 49 | function flag_abuse_reason_preprocess_flag(&$vars) { |
50 | - drupal_add_js(drupal_get_path('module', 'flag_abuse_reason') . "/includes/flag_abuse_reason.js"); |
|
51 | - drupal_add_css(drupal_get_path('module', 'flag_abuse_reason') . "/css/flag_abuse_reason.css"); |
|
52 | - $myuser = $vars['user']; |
|
53 | - $metaflags = array('abuse_node_meta', 'abuse_comment_meta', 'abuse_user_meta'); |
|
50 | + drupal_add_js(drupal_get_path('module', 'flag_abuse_reason') . "/includes/flag_abuse_reason.js"); |
|
51 | + drupal_add_css(drupal_get_path('module', 'flag_abuse_reason') . "/css/flag_abuse_reason.css"); |
|
52 | + $myuser = $vars['user']; |
|
53 | + $metaflags = array('abuse_node_meta', 'abuse_comment_meta', 'abuse_user_meta'); |
|
54 | 54 | |
55 | - // permmission check instead of a role |
|
56 | - // Is this one of our abuse flags? |
|
57 | - if (in_array($vars['flag']->name, $metaflags)) { |
|
55 | + // permmission check instead of a role |
|
56 | + // Is this one of our abuse flags? |
|
57 | + if (in_array($vars['flag']->name, $metaflags)) { |
|
58 | 58 | |
59 | 59 | // count the number of flags on this content |
60 | 60 | $count = db_result(db_query("SELECT COUNT(*) FROM {flag_content} WHERE content_id=%d AND fid=%d", $vars['content_id'], $vars['flag']->fid)); |
@@ -62,41 +62,41 @@ discard block |
||
62 | 62 | // If the variable <flagname>-<contentid> is set, then Reset |
63 | 63 | // completely. |
64 | 64 | if (variable_get($vars['flag']->name.'-'.$vars['content_id'], FALSE)) { |
65 | - if (user_access('reset abuse flags', $myuser)) { |
|
65 | + if (user_access('reset abuse flags', $myuser)) { |
|
66 | 66 | $vars['action'] = 'none'; |
67 | 67 | $vars['link_text'] = t('Reset Completely'); |
68 | 68 | $vars['link_title'] = t('Reset everying, allows users to re-flag content.'); |
69 | - } |
|
70 | - else { |
|
69 | + } |
|
70 | + else { |
|
71 | 71 | $vars['action'] = 'none'; |
72 | 72 | $vars['link_text'] = t('Locked'); |
73 | 73 | $vars['link_title'] = t('Reporting locked by moderator.'); |
74 | 74 | $vars['link'] = array(); |
75 | 75 | $vars['link_href'] = ''; |
76 | 76 | $vars['flag_classes'] = 'flag style-like-link'; |
77 | - } |
|
77 | + } |
|
78 | 78 | } |
79 | 79 | else { |
80 | - // If there are flags on this content, clear the flags and |
|
81 | - // lock the content. |
|
82 | - if (user_access('reset abuse flags', $myuser)) { |
|
80 | + // If there are flags on this content, clear the flags and |
|
81 | + // lock the content. |
|
82 | + if (user_access('reset abuse flags', $myuser)) { |
|
83 | 83 | if ($count>0) { |
84 | - $vars['action'] = 'reset'; |
|
85 | - $vars['link_text'] = t('Clear Reports and Lock'); |
|
86 | - $vars['link_title'] = t('Remove all flags on this content and prevent any new flagging.'); |
|
84 | + $vars['action'] = 'reset'; |
|
85 | + $vars['link_text'] = t('Clear Reports and Lock'); |
|
86 | + $vars['link_title'] = t('Remove all flags on this content and prevent any new flagging.'); |
|
87 | 87 | } |
88 | 88 | // Otherwise the link is shown but has no effect. |
89 | 89 | else { |
90 | - $vars['action'] = 'none'; |
|
91 | - $vars['link_text'] = t('No abuse reports'); |
|
92 | - $vars['link_title'] = t('This content has no abuse reports. Link does nothing.'); |
|
90 | + $vars['action'] = 'none'; |
|
91 | + $vars['link_text'] = t('No abuse reports'); |
|
92 | + $vars['link_title'] = t('This content has no abuse reports. Link does nothing.'); |
|
93 | 93 | $vars['link'] = array(); |
94 | 94 | $vars['link_href'] = ''; |
95 | 95 | $vars['flag_classes'] = 'flag style-like-link'; |
96 | 96 | } |
97 | - } |
|
97 | + } |
|
98 | + } |
|
98 | 99 | } |
99 | - } |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
@@ -106,72 +106,72 @@ discard block |
||
106 | 106 | * we want to remove all flags. http://drupal.org/node/327901#comment-1085685 |
107 | 107 | */ |
108 | 108 | function flag_abuse_reason_flag($event, $flag, $content_id, $account) { |
109 | - $metaflags = array('abuse_node_meta', 'abuse_comment_meta', 'abuse_user_meta'); |
|
109 | + $metaflags = array('abuse_node_meta', 'abuse_comment_meta', 'abuse_user_meta'); |
|
110 | 110 | |
111 | - // For privileged users, check permissions and reset flags |
|
112 | - // permission check instead of a role. |
|
113 | - if (user_access('reset abuse flags', $account)) { |
|
111 | + // For privileged users, check permissions and reset flags |
|
112 | + // permission check instead of a role. |
|
113 | + if (user_access('reset abuse flags', $account)) { |
|
114 | 114 | // Is this one of our abuse flags? |
115 | 115 | if (in_array($flag->name, $metaflags)) { |
116 | 116 | |
117 | - // Reset the flags completely. |
|
118 | - if (variable_get($flag->name.'-'.$content_id, FALSE)) { |
|
117 | + // Reset the flags completely. |
|
118 | + if (variable_get($flag->name.'-'.$content_id, FALSE)) { |
|
119 | 119 | // Since the user flags the content again, we need to unflag it. |
120 | 120 | flag_reset_flag($flag, $content_id); |
121 | 121 | drupal_set_message(bts('INFO: Reset everything. Users may reflag this content.', array(), NULL, 'boinc:flag-abuse-reset'), 'info'); |
122 | 122 | // unlock flag; effectively resets flags for this content |
123 | 123 | variable_del($flag->name.'-'.$content_id); |
124 | - } |
|
125 | - else { |
|
124 | + } |
|
125 | + else { |
|
126 | 126 | // Clear and Lock all flags on this content. |
127 | 127 | $dbresult = db_query("SELECT DISTINCT fid FROM {flag_content} WHERE content_id = %d", $content_id); |
128 | 128 | $rows = 0; |
129 | 129 | while ($myfid = db_fetch_array($dbresult)) { |
130 | - $myflag = flag_get_flag(NULL, array_pop($myfid)); |
|
131 | - $rows += flag_reset_flag($myflag, $content_id); |
|
130 | + $myflag = flag_get_flag(NULL, array_pop($myfid)); |
|
131 | + $rows += flag_reset_flag($myflag, $content_id); |
|
132 | 132 | } |
133 | 133 | if ($rows) { |
134 | - // This user actually flags the content as well, so it may |
|
135 | - // confuse the user if they reset what they thought was one |
|
136 | - // flag and we report two. |
|
137 | - $rows--; |
|
138 | - drupal_set_message(bts('INFO: Cleared !rows flags. Content is now locked and may not be reflagged.', array('!rows' => $rows), NULL, 'boinc:flag-abuse-reset'), 'info'); |
|
139 | - |
|
140 | - // This is the line which sets a Drupal variable which |
|
141 | - // prevents the flag link from showing again for all |
|
142 | - // users. Effectively preventing the content from being |
|
143 | - // flagged again. |
|
144 | - variable_set($flag->name.'-'.$content_id, TRUE); |
|
134 | + // This user actually flags the content as well, so it may |
|
135 | + // confuse the user if they reset what they thought was one |
|
136 | + // flag and we report two. |
|
137 | + $rows--; |
|
138 | + drupal_set_message(bts('INFO: Cleared !rows flags. Content is now locked and may not be reflagged.', array('!rows' => $rows), NULL, 'boinc:flag-abuse-reset'), 'info'); |
|
139 | + |
|
140 | + // This is the line which sets a Drupal variable which |
|
141 | + // prevents the flag link from showing again for all |
|
142 | + // users. Effectively preventing the content from being |
|
143 | + // flagged again. |
|
144 | + variable_set($flag->name.'-'.$content_id, TRUE); |
|
145 | + } |
|
145 | 146 | } |
146 | - } |
|
147 | 147 | |
148 | 148 | } |
149 | - } |
|
150 | - // Normal users may cancel their all their reported flags on this |
|
151 | - // content. |
|
152 | - else { |
|
149 | + } |
|
150 | + // Normal users may cancel their all their reported flags on this |
|
151 | + // content. |
|
152 | + else { |
|
153 | 153 | if ( ($event=='unflag') && (in_array($flag->name, $metaflags)) ) { |
154 | - $allflags = flag_get_user_flags($flag->content_type, $content_id, $account->uid); |
|
155 | - foreach ($allflags as $subflag) { |
|
154 | + $allflags = flag_get_user_flags($flag->content_type, $content_id, $account->uid); |
|
155 | + foreach ($allflags as $subflag) { |
|
156 | 156 | $myflag = flag_get_flag(NULL, $subflag->fid); |
157 | 157 | $rc = $myflag->flag('unflag', $content_id, $account); |
158 | - } |
|
158 | + } |
|
159 | + } |
|
159 | 160 | } |
160 | - } |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
164 | 164 | * Implementation of hook_form_FORM_ID_alter(). |
165 | 165 | */ |
166 | 166 | function flag_abuse_reason_form_flag_confirm_alter(&$form, &$form_state) { |
167 | - // Permmission check instead of a role. |
|
168 | - if (user_access('reset abuse flags', $account)) { |
|
167 | + // Permmission check instead of a role. |
|
168 | + if (user_access('reset abuse flags', $account)) { |
|
169 | 169 | $flag_name = $form['flag_name']['#value']; |
170 | 170 | // Is this one of our abuse flags? |
171 | 171 | if (in_array($flag_name, array('abuse_node_meta', 'abuse_comment_meta', 'abuse_user_meta'))) { |
172 | - drupal_set_title(t('Flag reset')); |
|
173 | - $form['description']['#value'] = t('Are you sure you want to reset all offensive flag on this content? Once doing so, users will not be able to flag this content again.'); |
|
174 | - $form['actions']['submit']['#value'] = t('Reset flags'); |
|
172 | + drupal_set_title(t('Flag reset')); |
|
173 | + $form['description']['#value'] = t('Are you sure you want to reset all offensive flag on this content? Once doing so, users will not be able to flag this content again.'); |
|
174 | + $form['actions']['submit']['#value'] = t('Reset flags'); |
|
175 | + } |
|
175 | 176 | } |
176 | - } |
|
177 | 177 | } |
@@ -23,15 +23,15 @@ discard block |
||
23 | 23 | * Node Flags |
24 | 24 | * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
25 | 25 | function _flag_abuse_reason_abuse_node_flags(&$flags) { |
26 | - // Exported flag: "Node Abuse 1 SPAM". |
|
27 | - $flags['abuse_node_1'] = array( |
|
26 | + // Exported flag: "Node Abuse 1 SPAM". |
|
27 | + $flags['abuse_node_1'] = array( |
|
28 | 28 | 'content_type' => 'node', |
29 | 29 | 'title' => 'Node Abuse 1 SPAM', |
30 | 30 | 'global' => FALSE, |
31 | 31 | 'types' => array( |
32 | - '0' => 'forum', |
|
33 | - '1' => 'news', |
|
34 | - '2' => 'team_forum', |
|
32 | + '0' => 'forum', |
|
33 | + '1' => 'news', |
|
34 | + '2' => 'team_forum', |
|
35 | 35 | ), |
36 | 36 | 'flag_short' => 'Flag as SPAM', |
37 | 37 | 'flag_long' => 'Flag this content SPAM.', |
@@ -42,12 +42,12 @@ discard block |
||
42 | 42 | 'unflag_denied_text' => '', |
43 | 43 | 'link_type' => 'toggle', |
44 | 44 | 'roles' => array( |
45 | - 'flag' => array( |
|
45 | + 'flag' => array( |
|
46 | 46 | '0' => 2, |
47 | - ), |
|
48 | - 'unflag' => array( |
|
47 | + ), |
|
48 | + 'unflag' => array( |
|
49 | 49 | '0' => 2, |
50 | - ), |
|
50 | + ), |
|
51 | 51 | ), |
52 | 52 | 'weight' => 0, |
53 | 53 | 'show_on_page' => 0, |
@@ -57,19 +57,19 @@ discard block |
||
57 | 57 | 'i18n' => '0', |
58 | 58 | 'module' => 'boinc_standard', |
59 | 59 | 'locked' => array( |
60 | - '0' => 'name', |
|
60 | + '0' => 'name', |
|
61 | 61 | ), |
62 | 62 | 'api_version' => 2, |
63 | - ); |
|
64 | - // Exported flag: "Node Abuse 2 Link". |
|
65 | - $flags['abuse_node_2'] = array( |
|
63 | + ); |
|
64 | + // Exported flag: "Node Abuse 2 Link". |
|
65 | + $flags['abuse_node_2'] = array( |
|
66 | 66 | 'content_type' => 'node', |
67 | 67 | 'title' => 'Node Abuse 2 Link', |
68 | 68 | 'global' => FALSE, |
69 | 69 | 'types' => array( |
70 | - '0' => 'forum', |
|
71 | - '1' => 'news', |
|
72 | - '2' => 'team_forum', |
|
70 | + '0' => 'forum', |
|
71 | + '1' => 'news', |
|
72 | + '2' => 'team_forum', |
|
73 | 73 | ), |
74 | 74 | 'flag_short' => 'Report as abusive link', |
75 | 75 | 'flag_long' => 'Flag this content as abusive link.', |
@@ -80,12 +80,12 @@ discard block |
||
80 | 80 | 'unflag_denied_text' => '', |
81 | 81 | 'link_type' => 'toggle', |
82 | 82 | 'roles' => array( |
83 | - 'flag' => array( |
|
83 | + 'flag' => array( |
|
84 | 84 | '0' => 2, |
85 | - ), |
|
86 | - 'unflag' => array( |
|
85 | + ), |
|
86 | + 'unflag' => array( |
|
87 | 87 | '0' => 2, |
88 | - ), |
|
88 | + ), |
|
89 | 89 | ), |
90 | 90 | 'weight' => 0, |
91 | 91 | 'show_on_page' => 0, |
@@ -95,19 +95,19 @@ discard block |
||
95 | 95 | 'i18n' => '0', |
96 | 96 | 'module' => 'boinc_standard', |
97 | 97 | 'locked' => array( |
98 | - '0' => 'name', |
|
98 | + '0' => 'name', |
|
99 | 99 | ), |
100 | 100 | 'api_version' => 2, |
101 | - ); |
|
102 | - // Exported flag: "Node Abuse 3 Hostile". |
|
103 | - $flags['abuse_node_3'] = array( |
|
101 | + ); |
|
102 | + // Exported flag: "Node Abuse 3 Hostile". |
|
103 | + $flags['abuse_node_3'] = array( |
|
104 | 104 | 'content_type' => 'node', |
105 | 105 | 'title' => 'Node Abuse 3 Hostile', |
106 | 106 | 'global' => FALSE, |
107 | 107 | 'types' => array( |
108 | - '0' => 'forum', |
|
109 | - '1' => 'news', |
|
110 | - '2' => 'team_forum', |
|
108 | + '0' => 'forum', |
|
109 | + '1' => 'news', |
|
110 | + '2' => 'team_forum', |
|
111 | 111 | ), |
112 | 112 | 'flag_short' => 'Flag as hostile', |
113 | 113 | 'flag_long' => 'Flag this content as hostile.', |
@@ -118,12 +118,12 @@ discard block |
||
118 | 118 | 'unflag_denied_text' => '', |
119 | 119 | 'link_type' => 'toggle', |
120 | 120 | 'roles' => array( |
121 | - 'flag' => array( |
|
121 | + 'flag' => array( |
|
122 | 122 | '0' => 2, |
123 | - ), |
|
124 | - 'unflag' => array( |
|
123 | + ), |
|
124 | + 'unflag' => array( |
|
125 | 125 | '0' => 2, |
126 | - ), |
|
126 | + ), |
|
127 | 127 | ), |
128 | 128 | 'weight' => 0, |
129 | 129 | 'show_on_page' => 0, |
@@ -133,19 +133,19 @@ discard block |
||
133 | 133 | 'i18n' => '0', |
134 | 134 | 'module' => 'boinc_standard', |
135 | 135 | 'locked' => array( |
136 | - '0' => 'name', |
|
136 | + '0' => 'name', |
|
137 | 137 | ), |
138 | 138 | 'api_version' => 2, |
139 | - ); |
|
140 | - // Exported flag: "Node Abuse 4 Not Kid Friendly". |
|
141 | - $flags['abuse_node_4'] = array( |
|
139 | + ); |
|
140 | + // Exported flag: "Node Abuse 4 Not Kid Friendly". |
|
141 | + $flags['abuse_node_4'] = array( |
|
142 | 142 | 'content_type' => 'node', |
143 | 143 | 'title' => 'Node Abuse 4 Not Kid Friendly', |
144 | 144 | 'global' => FALSE, |
145 | 145 | 'types' => array( |
146 | - '0' => 'forum', |
|
147 | - '1' => 'news', |
|
148 | - '2' => 'team_forum', |
|
146 | + '0' => 'forum', |
|
147 | + '1' => 'news', |
|
148 | + '2' => 'team_forum', |
|
149 | 149 | ), |
150 | 150 | 'flag_short' => 'Flag as not kid-friendly', |
151 | 151 | 'flag_long' => 'Flag this content as not kid-friendly.', |
@@ -156,12 +156,12 @@ discard block |
||
156 | 156 | 'unflag_denied_text' => '', |
157 | 157 | 'link_type' => 'toggle', |
158 | 158 | 'roles' => array( |
159 | - 'flag' => array( |
|
159 | + 'flag' => array( |
|
160 | 160 | '0' => 2, |
161 | - ), |
|
162 | - 'unflag' => array( |
|
161 | + ), |
|
162 | + 'unflag' => array( |
|
163 | 163 | '0' => 2, |
164 | - ), |
|
164 | + ), |
|
165 | 165 | ), |
166 | 166 | 'weight' => 0, |
167 | 167 | 'show_on_page' => 0, |
@@ -171,19 +171,19 @@ discard block |
||
171 | 171 | 'i18n' => '0', |
172 | 172 | 'module' => 'boinc_standard', |
173 | 173 | 'locked' => array( |
174 | - '0' => 'name', |
|
174 | + '0' => 'name', |
|
175 | 175 | ), |
176 | 176 | 'api_version' => 2, |
177 | - ); |
|
178 | - // Exported flag: "Node Abuse 5 Other". |
|
179 | - $flags['abuse_node_5'] = array( |
|
177 | + ); |
|
178 | + // Exported flag: "Node Abuse 5 Other". |
|
179 | + $flags['abuse_node_5'] = array( |
|
180 | 180 | 'content_type' => 'node', |
181 | 181 | 'title' => 'Node Abuse 5 Other', |
182 | 182 | 'global' => FALSE, |
183 | 183 | 'types' => array( |
184 | - '0' => 'forum', |
|
185 | - '1' => 'news', |
|
186 | - '2' => 'team_forum', |
|
184 | + '0' => 'forum', |
|
185 | + '1' => 'news', |
|
186 | + '2' => 'team_forum', |
|
187 | 187 | ), |
188 | 188 | 'flag_short' => 'Flag as other', |
189 | 189 | 'flag_long' => 'Flag this content - other reason.', |
@@ -194,12 +194,12 @@ discard block |
||
194 | 194 | 'unflag_denied_text' => '', |
195 | 195 | 'link_type' => 'toggle', |
196 | 196 | 'roles' => array( |
197 | - 'flag' => array( |
|
197 | + 'flag' => array( |
|
198 | 198 | '0' => 2, |
199 | - ), |
|
200 | - 'unflag' => array( |
|
199 | + ), |
|
200 | + 'unflag' => array( |
|
201 | 201 | '0' => 2, |
202 | - ), |
|
202 | + ), |
|
203 | 203 | ), |
204 | 204 | 'weight' => 0, |
205 | 205 | 'show_on_page' => 0, |
@@ -209,19 +209,19 @@ discard block |
||
209 | 209 | 'i18n' => '0', |
210 | 210 | 'module' => 'boinc_standard', |
211 | 211 | 'locked' => array( |
212 | - '0' => 'name', |
|
212 | + '0' => 'name', |
|
213 | 213 | ), |
214 | 214 | 'api_version' => 2, |
215 | - ); |
|
216 | - // Exported flag: "Node Abuse meta". |
|
217 | - $flags['abuse_node_meta'] = array( |
|
215 | + ); |
|
216 | + // Exported flag: "Node Abuse meta". |
|
217 | + $flags['abuse_node_meta'] = array( |
|
218 | 218 | 'content_type' => 'node', |
219 | 219 | 'title' => 'Node Abuse meta', |
220 | 220 | 'global' => FALSE, |
221 | 221 | 'types' => array( |
222 | - '0' => 'forum', |
|
223 | - '1' => 'news', |
|
224 | - '2' => 'team_forum', |
|
222 | + '0' => 'forum', |
|
223 | + '1' => 'news', |
|
224 | + '2' => 'team_forum', |
|
225 | 225 | ), |
226 | 226 | 'flag_short' => 'Report', |
227 | 227 | 'flag_long' => 'Report content', |
@@ -232,12 +232,12 @@ discard block |
||
232 | 232 | 'unflag_denied_text' => '', |
233 | 233 | 'link_type' => 'toggle', |
234 | 234 | 'roles' => array( |
235 | - 'flag' => array( |
|
235 | + 'flag' => array( |
|
236 | 236 | '0' => 2, |
237 | - ), |
|
238 | - 'unflag' => array( |
|
237 | + ), |
|
238 | + 'unflag' => array( |
|
239 | 239 | '0' => 2, |
240 | - ), |
|
240 | + ), |
|
241 | 241 | ), |
242 | 242 | 'weight' => 0, |
243 | 243 | 'show_on_page' => 1, |
@@ -247,27 +247,27 @@ discard block |
||
247 | 247 | 'i18n' => '0', |
248 | 248 | 'module' => 'boinc_standard', |
249 | 249 | 'locked' => array( |
250 | - '0' => 'name', |
|
250 | + '0' => 'name', |
|
251 | 251 | ), |
252 | 252 | 'api_version' => 2, |
253 | - ); |
|
253 | + ); |
|
254 | 254 | |
255 | - return $flags; |
|
255 | + return $flags; |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
259 | 259 | * Comment Flags |
260 | 260 | * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
261 | 261 | function _flag_abuse_reason_abuse_comment_flags(&$flags) { |
262 | - // Exported flag: "Comment Abuse 1 SPAM". |
|
263 | - $flags['abuse_comment_1'] = array( |
|
262 | + // Exported flag: "Comment Abuse 1 SPAM". |
|
263 | + $flags['abuse_comment_1'] = array( |
|
264 | 264 | 'content_type' => 'comment', |
265 | 265 | 'title' => 'Comment Abuse 1 SPAM', |
266 | 266 | 'global' => FALSE, |
267 | 267 | 'types' => array( |
268 | - '0' => 'forum', |
|
269 | - '1' => 'news', |
|
270 | - '2' => 'team_forum', |
|
268 | + '0' => 'forum', |
|
269 | + '1' => 'news', |
|
270 | + '2' => 'team_forum', |
|
271 | 271 | ), |
272 | 272 | 'flag_short' => 'Flag as SPAM', |
273 | 273 | 'flag_long' => 'Flag this comment as SPAM.', |
@@ -278,31 +278,31 @@ discard block |
||
278 | 278 | 'unflag_denied_text' => '', |
279 | 279 | 'link_type' => 'toggle', |
280 | 280 | 'roles' => array( |
281 | - 'flag' => array( |
|
281 | + 'flag' => array( |
|
282 | 282 | '0' => 2, |
283 | - ), |
|
284 | - 'unflag' => array( |
|
283 | + ), |
|
284 | + 'unflag' => array( |
|
285 | 285 | '0' => 2, |
286 | - ), |
|
286 | + ), |
|
287 | 287 | ), |
288 | 288 | 'weight' => 0, |
289 | 289 | 'access_author' => '', |
290 | 290 | 'show_on_comment' => 0, |
291 | 291 | 'module' => 'boinc_standard', |
292 | 292 | 'locked' => array( |
293 | - '0' => 'name', |
|
293 | + '0' => 'name', |
|
294 | 294 | ), |
295 | 295 | 'api_version' => 2, |
296 | - ); |
|
297 | - // Exported flag: "Comment Abuse 2 LINK". |
|
298 | - $flags['abuse_comment_2'] = array( |
|
296 | + ); |
|
297 | + // Exported flag: "Comment Abuse 2 LINK". |
|
298 | + $flags['abuse_comment_2'] = array( |
|
299 | 299 | 'content_type' => 'comment', |
300 | 300 | 'title' => 'Comment Abuse 2 LINK', |
301 | 301 | 'global' => FALSE, |
302 | 302 | 'types' => array( |
303 | - '0' => 'forum', |
|
304 | - '1' => 'news', |
|
305 | - '2' => 'team_forum', |
|
303 | + '0' => 'forum', |
|
304 | + '1' => 'news', |
|
305 | + '2' => 'team_forum', |
|
306 | 306 | ), |
307 | 307 | 'flag_short' => 'Flag as abusive link', |
308 | 308 | 'flag_long' => 'Flag this comment with abusive link.', |
@@ -313,31 +313,31 @@ discard block |
||
313 | 313 | 'unflag_denied_text' => '', |
314 | 314 | 'link_type' => 'toggle', |
315 | 315 | 'roles' => array( |
316 | - 'flag' => array( |
|
316 | + 'flag' => array( |
|
317 | 317 | '0' => 2, |
318 | - ), |
|
319 | - 'unflag' => array( |
|
318 | + ), |
|
319 | + 'unflag' => array( |
|
320 | 320 | '0' => 2, |
321 | - ), |
|
321 | + ), |
|
322 | 322 | ), |
323 | 323 | 'weight' => 0, |
324 | 324 | 'access_author' => '', |
325 | 325 | 'show_on_comment' => 0, |
326 | 326 | 'module' => 'boinc_standard', |
327 | 327 | 'locked' => array( |
328 | - '0' => 'name', |
|
328 | + '0' => 'name', |
|
329 | 329 | ), |
330 | 330 | 'api_version' => 2, |
331 | - ); |
|
332 | - // Exported flag: "Comment Abuse 3 Hostile". |
|
333 | - $flags['abuse_comment_3'] = array( |
|
331 | + ); |
|
332 | + // Exported flag: "Comment Abuse 3 Hostile". |
|
333 | + $flags['abuse_comment_3'] = array( |
|
334 | 334 | 'content_type' => 'comment', |
335 | 335 | 'title' => 'Comment Abuse 3 Hostile', |
336 | 336 | 'global' => FALSE, |
337 | 337 | 'types' => array( |
338 | - '0' => 'forum', |
|
339 | - '1' => 'news', |
|
340 | - '2' => 'team_forum', |
|
338 | + '0' => 'forum', |
|
339 | + '1' => 'news', |
|
340 | + '2' => 'team_forum', |
|
341 | 341 | ), |
342 | 342 | 'flag_short' => 'Flag as hostile', |
343 | 343 | 'flag_long' => 'Flag this comment as hostile.', |
@@ -348,31 +348,31 @@ discard block |
||
348 | 348 | 'unflag_denied_text' => '', |
349 | 349 | 'link_type' => 'toggle', |
350 | 350 | 'roles' => array( |
351 | - 'flag' => array( |
|
351 | + 'flag' => array( |
|
352 | 352 | '0' => 2, |
353 | - ), |
|
354 | - 'unflag' => array( |
|
353 | + ), |
|
354 | + 'unflag' => array( |
|
355 | 355 | '0' => 2, |
356 | - ), |
|
356 | + ), |
|
357 | 357 | ), |
358 | 358 | 'weight' => 0, |
359 | 359 | 'access_author' => '', |
360 | 360 | 'show_on_comment' => 0, |
361 | 361 | 'module' => 'boinc_standard', |
362 | 362 | 'locked' => array( |
363 | - '0' => 'name', |
|
363 | + '0' => 'name', |
|
364 | 364 | ), |
365 | 365 | 'api_version' => 2, |
366 | - ); |
|
367 | - // Exported flag: "Comment Abuse 4 Not Kid Friendly". |
|
368 | - $flags['abuse_comment_4'] = array( |
|
366 | + ); |
|
367 | + // Exported flag: "Comment Abuse 4 Not Kid Friendly". |
|
368 | + $flags['abuse_comment_4'] = array( |
|
369 | 369 | 'content_type' => 'comment', |
370 | 370 | 'title' => 'Comment Abuse 4 Not Kid Friendly', |
371 | 371 | 'global' => FALSE, |
372 | 372 | 'types' => array( |
373 | - '0' => 'forum', |
|
374 | - '1' => 'news', |
|
375 | - '2' => 'team_forum', |
|
373 | + '0' => 'forum', |
|
374 | + '1' => 'news', |
|
375 | + '2' => 'team_forum', |
|
376 | 376 | ), |
377 | 377 | 'flag_short' => 'Flag as not kid-friendly', |
378 | 378 | 'flag_long' => 'Flag this comment as not kid-friendly.', |
@@ -383,31 +383,31 @@ discard block |
||
383 | 383 | 'unflag_denied_text' => '', |
384 | 384 | 'link_type' => 'toggle', |
385 | 385 | 'roles' => array( |
386 | - 'flag' => array( |
|
386 | + 'flag' => array( |
|
387 | 387 | '0' => 2, |
388 | - ), |
|
389 | - 'unflag' => array( |
|
388 | + ), |
|
389 | + 'unflag' => array( |
|
390 | 390 | '0' => 2, |
391 | - ), |
|
391 | + ), |
|
392 | 392 | ), |
393 | 393 | 'weight' => 0, |
394 | 394 | 'access_author' => '', |
395 | 395 | 'show_on_comment' => 0, |
396 | 396 | 'module' => 'boinc_standard', |
397 | 397 | 'locked' => array( |
398 | - '0' => 'name', |
|
398 | + '0' => 'name', |
|
399 | 399 | ), |
400 | 400 | 'api_version' => 2, |
401 | - ); |
|
402 | - // Exported flag: "Comment Abuse 5 Other". |
|
403 | - $flags['abuse_comment_5'] = array( |
|
401 | + ); |
|
402 | + // Exported flag: "Comment Abuse 5 Other". |
|
403 | + $flags['abuse_comment_5'] = array( |
|
404 | 404 | 'content_type' => 'comment', |
405 | 405 | 'title' => 'Comment Abuse 5 Other', |
406 | 406 | 'global' => FALSE, |
407 | 407 | 'types' => array( |
408 | - '0' => 'forum', |
|
409 | - '1' => 'news', |
|
410 | - '2' => 'team_forum', |
|
408 | + '0' => 'forum', |
|
409 | + '1' => 'news', |
|
410 | + '2' => 'team_forum', |
|
411 | 411 | ), |
412 | 412 | 'flag_short' => 'Flag as other', |
413 | 413 | 'flag_long' => 'Flag this comment - other reason', |
@@ -418,31 +418,31 @@ discard block |
||
418 | 418 | 'unflag_denied_text' => '', |
419 | 419 | 'link_type' => 'toggle', |
420 | 420 | 'roles' => array( |
421 | - 'flag' => array( |
|
421 | + 'flag' => array( |
|
422 | 422 | '0' => 2, |
423 | - ), |
|
424 | - 'unflag' => array( |
|
423 | + ), |
|
424 | + 'unflag' => array( |
|
425 | 425 | '0' => 2, |
426 | - ), |
|
426 | + ), |
|
427 | 427 | ), |
428 | 428 | 'weight' => 0, |
429 | 429 | 'access_author' => '', |
430 | 430 | 'show_on_comment' => 0, |
431 | 431 | 'module' => 'boinc_standard', |
432 | 432 | 'locked' => array( |
433 | - '0' => 'name', |
|
433 | + '0' => 'name', |
|
434 | 434 | ), |
435 | 435 | 'api_version' => 2, |
436 | - ); |
|
437 | - // Exported flag: "Comment Abuse meta". |
|
438 | - $flags['abuse_comment_meta'] = array( |
|
436 | + ); |
|
437 | + // Exported flag: "Comment Abuse meta". |
|
438 | + $flags['abuse_comment_meta'] = array( |
|
439 | 439 | 'content_type' => 'comment', |
440 | 440 | 'title' => 'Comment Abuse meta', |
441 | 441 | 'global' => '0', |
442 | 442 | 'types' => array( |
443 | - '0' => 'forum', |
|
444 | - '1' => 'news', |
|
445 | - '2' => 'team_forum', |
|
443 | + '0' => 'forum', |
|
444 | + '1' => 'news', |
|
445 | + '2' => 'team_forum', |
|
446 | 446 | ), |
447 | 447 | 'flag_short' => 'Report', |
448 | 448 | 'flag_long' => 'Report comment.', |
@@ -453,32 +453,32 @@ discard block |
||
453 | 453 | 'unflag_denied_text' => '', |
454 | 454 | 'link_type' => 'toggle', |
455 | 455 | 'roles' => array( |
456 | - 'flag' => array( |
|
456 | + 'flag' => array( |
|
457 | 457 | '0' => 2, |
458 | - ), |
|
459 | - 'unflag' => array( |
|
458 | + ), |
|
459 | + 'unflag' => array( |
|
460 | 460 | '0' => 2, |
461 | - ), |
|
461 | + ), |
|
462 | 462 | ), |
463 | 463 | 'weight' => 0, |
464 | 464 | 'access_author' => '', |
465 | 465 | 'show_on_comment' => 1, |
466 | 466 | 'module' => 'boinc_standard', |
467 | 467 | 'locked' => array( |
468 | - '0' => 'name', |
|
468 | + '0' => 'name', |
|
469 | 469 | ), |
470 | 470 | 'api_version' => 2, |
471 | - ); |
|
471 | + ); |
|
472 | 472 | |
473 | - return $flags; |
|
473 | + return $flags; |
|
474 | 474 | } |
475 | 475 | |
476 | 476 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
477 | 477 | * User Flags |
478 | 478 | * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
479 | 479 | function _flag_abuse_reason_abuse_user_flags(&$flags) { |
480 | - // Exported flag: "User Abuse 1 SPAM". |
|
481 | - $flags['abuse_user_1'] = array( |
|
480 | + // Exported flag: "User Abuse 1 SPAM". |
|
481 | + $flags['abuse_user_1'] = array( |
|
482 | 482 | 'content_type' => 'user', |
483 | 483 | 'title' => 'User Abuse 1 SPAM', |
484 | 484 | 'global' => FALSE, |
@@ -492,24 +492,24 @@ discard block |
||
492 | 492 | 'unflag_denied_text' => '', |
493 | 493 | 'link_type' => 'toggle', |
494 | 494 | 'roles' => array( |
495 | - 'flag' => array( |
|
495 | + 'flag' => array( |
|
496 | 496 | '0' => 2, |
497 | - ), |
|
498 | - 'unflag' => array( |
|
497 | + ), |
|
498 | + 'unflag' => array( |
|
499 | 499 | '0' => 2, |
500 | - ), |
|
500 | + ), |
|
501 | 501 | ), |
502 | 502 | 'weight' => 0, |
503 | 503 | 'show_on_profile' => 0, |
504 | 504 | 'access_uid' => '', |
505 | 505 | 'module' => 'boinc_standard', |
506 | 506 | 'locked' => array( |
507 | - '0' => 'name', |
|
507 | + '0' => 'name', |
|
508 | 508 | ), |
509 | 509 | 'api_version' => 2, |
510 | - ); |
|
511 | - // Exported flag: "User Abuse 2 Link". |
|
512 | - $flags['abuse_user_2'] = array( |
|
510 | + ); |
|
511 | + // Exported flag: "User Abuse 2 Link". |
|
512 | + $flags['abuse_user_2'] = array( |
|
513 | 513 | 'content_type' => 'user', |
514 | 514 | 'title' => 'User Abuse 2 Link', |
515 | 515 | 'global' => FALSE, |
@@ -523,24 +523,24 @@ discard block |
||
523 | 523 | 'unflag_denied_text' => '', |
524 | 524 | 'link_type' => 'toggle', |
525 | 525 | 'roles' => array( |
526 | - 'flag' => array( |
|
526 | + 'flag' => array( |
|
527 | 527 | '0' => 2, |
528 | - ), |
|
529 | - 'unflag' => array( |
|
528 | + ), |
|
529 | + 'unflag' => array( |
|
530 | 530 | '0' => 2, |
531 | - ), |
|
531 | + ), |
|
532 | 532 | ), |
533 | 533 | 'weight' => 0, |
534 | 534 | 'show_on_profile' => 0, |
535 | 535 | 'access_uid' => '', |
536 | 536 | 'module' => 'boinc_standard', |
537 | 537 | 'locked' => array( |
538 | - '0' => 'name', |
|
538 | + '0' => 'name', |
|
539 | 539 | ), |
540 | 540 | 'api_version' => 2, |
541 | - ); |
|
542 | - // Exported flag: "User Abuse 3 Not Kid Friendly". |
|
543 | - $flags['abuse_user_3'] = array( |
|
541 | + ); |
|
542 | + // Exported flag: "User Abuse 3 Not Kid Friendly". |
|
543 | + $flags['abuse_user_3'] = array( |
|
544 | 544 | 'content_type' => 'user', |
545 | 545 | 'title' => 'User Abuse 3 Not Kid Friendly', |
546 | 546 | 'global' => FALSE, |
@@ -554,24 +554,24 @@ discard block |
||
554 | 554 | 'unflag_denied_text' => '', |
555 | 555 | 'link_type' => 'toggle', |
556 | 556 | 'roles' => array( |
557 | - 'flag' => array( |
|
557 | + 'flag' => array( |
|
558 | 558 | '0' => 2, |
559 | - ), |
|
560 | - 'unflag' => array( |
|
559 | + ), |
|
560 | + 'unflag' => array( |
|
561 | 561 | '0' => 2, |
562 | - ), |
|
562 | + ), |
|
563 | 563 | ), |
564 | 564 | 'weight' => 0, |
565 | 565 | 'show_on_profile' => 0, |
566 | 566 | 'access_uid' => '', |
567 | 567 | 'module' => 'boinc_standard', |
568 | 568 | 'locked' => array( |
569 | - '0' => 'name', |
|
569 | + '0' => 'name', |
|
570 | 570 | ), |
571 | 571 | 'api_version' => 2, |
572 | - ); |
|
573 | - // Exported flag: "User Abuse 4 Other". |
|
574 | - $flags['abuse_user_4'] = array( |
|
572 | + ); |
|
573 | + // Exported flag: "User Abuse 4 Other". |
|
574 | + $flags['abuse_user_4'] = array( |
|
575 | 575 | 'content_type' => 'user', |
576 | 576 | 'title' => 'User Abuse 4 Other', |
577 | 577 | 'global' => FALSE, |
@@ -585,24 +585,24 @@ discard block |
||
585 | 585 | 'unflag_denied_text' => '', |
586 | 586 | 'link_type' => 'toggle', |
587 | 587 | 'roles' => array( |
588 | - 'flag' => array( |
|
588 | + 'flag' => array( |
|
589 | 589 | '0' => 2, |
590 | - ), |
|
591 | - 'unflag' => array( |
|
590 | + ), |
|
591 | + 'unflag' => array( |
|
592 | 592 | '0' => 2, |
593 | - ), |
|
593 | + ), |
|
594 | 594 | ), |
595 | 595 | 'weight' => 0, |
596 | 596 | 'show_on_profile' => 0, |
597 | 597 | 'access_uid' => '', |
598 | 598 | 'module' => 'boinc_standard', |
599 | 599 | 'locked' => array( |
600 | - '0' => 'name', |
|
600 | + '0' => 'name', |
|
601 | 601 | ), |
602 | 602 | 'api_version' => 2, |
603 | - ); |
|
604 | - // Exported flag: "User Abuse Meta". |
|
605 | - $flags['abuse_user_meta'] = array( |
|
603 | + ); |
|
604 | + // Exported flag: "User Abuse Meta". |
|
605 | + $flags['abuse_user_meta'] = array( |
|
606 | 606 | 'content_type' => 'user', |
607 | 607 | 'title' => 'User Abuse Meta', |
608 | 608 | 'global' => FALSE, |
@@ -616,22 +616,22 @@ discard block |
||
616 | 616 | 'unflag_denied_text' => '', |
617 | 617 | 'link_type' => 'toggle', |
618 | 618 | 'roles' => array( |
619 | - 'flag' => array( |
|
619 | + 'flag' => array( |
|
620 | 620 | '0' => 2, |
621 | - ), |
|
622 | - 'unflag' => array( |
|
621 | + ), |
|
622 | + 'unflag' => array( |
|
623 | 623 | '0' => 2, |
624 | - ), |
|
624 | + ), |
|
625 | 625 | ), |
626 | 626 | 'weight' => 0, |
627 | 627 | 'show_on_profile' => 1, |
628 | 628 | 'access_uid' => '', |
629 | 629 | 'module' => 'boinc_standard', |
630 | 630 | 'locked' => array( |
631 | - '0' => 'name', |
|
631 | + '0' => 'name', |
|
632 | 632 | ), |
633 | 633 | 'api_version' => 2, |
634 | - ); |
|
634 | + ); |
|
635 | 635 | |
636 | - return $flags; |
|
636 | + return $flags; |
|
637 | 637 | } |