~ubuntu-branches/ubuntu/vivid/wordpress-shibboleth/vivid

« back to all changes in this revision

Viewing changes to options-admin.php

  • Committer: Bazaar Package Importer
  • Author(s): Dominic Hargreaves
  • Date: 2010-09-15 16:58:08 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100915165808-kiyzbk6oxp079doe
Tags: 1.4-1
* New upstream release
* Relax dependency on wordpress version to 2.8, as stated in upstream
  readme.txt

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
                <li><a href="https://spaces.internet2.edu/display/SHIB2/" target="_blank">' . __('Shibboleth 2 Wiki', 'shibboleth') . '</a></li>
33
33
                <li><a href="http://shibboleth.internet2.edu/lists.html" target="_blank">' . __('Shibboleth Mailing Lists', 'shibboleth') . '</a></li>
34
34
        </ul>';
 
35
        
 
36
        return apply_filters( 'shibboleth_help_text_filter', $text );
35
37
 
36
 
        return $text;
37
38
}
38
39
 
39
40
 
50
51
 
51
52
                $shib_headers = (array) shibboleth_get_option('shibboleth_headers');
52
53
                $shib_headers = array_merge($shib_headers, $_POST['headers']);
 
54
                /**
 
55
                 * filter shibboleth_form_submit_headers
 
56
                 * @param $shib_headers array
 
57
                 * @since 1.4
 
58
                 * Hint: access $_POST within the filter.
 
59
                 */
 
60
                $shib_headers = apply_filters( 'shibboleth_form_submit_headers', $shib_headers );
53
61
                shibboleth_update_option('shibboleth_headers', $shib_headers);
54
62
 
55
63
                $shib_roles = (array) shibboleth_get_option('shibboleth_roles');
56
64
                $shib_roles = array_merge($shib_roles, $_POST['shibboleth_roles']);
 
65
                /**
 
66
                 * filter shibboleth_form_submit_roles
 
67
                 * @param $shib_roles array
 
68
                 * @since 1.4
 
69
                 * Hint: access $_POST within the filter.
 
70
                 */
 
71
                $shib_roles = apply_filters( 'shibboleth_form_submit_roles', $shib_roles );
57
72
                shibboleth_update_option('shibboleth_roles', $shib_roles);
58
73
 
59
74
                shibboleth_update_option('shibboleth_login_url', $_POST['login_url']);
63
78
                shibboleth_update_option('shibboleth_default_login', (boolean) $_POST['default_login']);
64
79
                shibboleth_update_option('shibboleth_update_users', (boolean) $_POST['update_users']);
65
80
                shibboleth_update_option('shibboleth_update_roles', (boolean) $_POST['update_roles']);
 
81
                
 
82
                /**
 
83
                 * action shibboleth_form_submit
 
84
                 * @since 1.4
 
85
                 * Hint: use global $_POST within the action.
 
86
                 */
 
87
                do_action( 'shibboleth_form_submit' );
66
88
        }
67
89
 
68
90
        $shib_headers = shibboleth_get_option('shibboleth_headers');
133
155
                                                        . ' initiated from the WordPress login form by clicking the "Login with Shibboleth" link.', 'shibboleth'); ?></p>
134
156
                                        </td>
135
157
                                </tr>
 
158
<?php
 
159
        /**
 
160
         * action shibboleth_options_table
 
161
         * Add your own Shibboleth options items to the Shibboleth options table.
 
162
         * Note: This is in a <table> so add a <tr> with appropriate styling.
 
163
         * 
 
164
         * @param $shib_headers array
 
165
         * @param $shib_roles array
 
166
         * @since 1.4
 
167
         */
 
168
        do_action( 'shibboleth_options_table', $shib_headers, $shib_roles );
 
169
?>
136
170
                        </table>
137
171
 
138
172
                        <br class="clear" />
202
236
 
203
237
                        <h3><?php _e('User Role Mappings', 'shibboleth') ?></h3>
204
238
 
 
239
<?php
 
240
/**
 
241
 * filter shibboleth_role_mapping_override
 
242
 * Return true to override the default user role mapping form
 
243
 * 
 
244
 * @param boolean - default value false
 
245
 * @return boolean - true if override
 
246
 * @since 1.4
 
247
 * 
 
248
 * Use in conjunction with shibboleth_role_mapping_form action below
 
249
 */
 
250
if ( apply_filters('shibboleth_role_mapping_override',false) === false ):
 
251
?>
 
252
 
205
253
                        <p><?php _e('Users can be placed into one of WordPress\'s internal roles based on any'
206
254
                                . ' attribute.  For example, you could define a special eduPersonEntitlement value'
207
255
                                . ' that designates the user as a WordPress Administrator.  Or you could automatically'
288
336
                                </tr>
289
337
                        </table>
290
338
 
 
339
<?php
 
340
else: 
 
341
        /**
 
342
         * action shibboleth_role_mapping_form
 
343
         * Roll your own custom Shibboleth role mapping admin UI
 
344
         * 
 
345
         * @param $shib_headers array
 
346
         * @param $shib_roles array
 
347
         * @since 1.4
 
348
         * 
 
349
         * Use in conjunction with shibboleth_role_mapping_override filter
 
350
         */
 
351
        do_action( 'shibboleth_role_mapping_form', $shib_headers, $shib_roles );
 
352
endif; // if ( form override )
 
353
?>
291
354
 
292
355
                        <?php wp_nonce_field('shibboleth_update_options') ?>
293
356
                        <p class="submit"><input type="submit" name="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /></p>