function shib_auth_edit_form in Shibboleth Authentication 7.4
Same name and namespace in other branches
- 6.4 shib_auth_roles_forms.inc \shib_auth_edit_form()
- 6.3 shib_auth.module \shib_auth_edit_form()
Generates the shibboleth rule adding form.
@returns The edit form, with the fields already filled in with the elements of the options array.
Parameters
array $options: Contains the data, we want to fill the form with.
2 calls to shib_auth_edit_form()
- shib_auth_edit_rule in ./
shib_auth_roles_forms.inc - Constructor of the rule edit form.
- shib_auth_new_rule in ./
shib_auth_roles_forms.inc - Creates a new rule by calling universal create/edit form.
File
- ./
shib_auth_roles_forms.inc, line 164 - Roles manager forms.
Code
function shib_auth_edit_form(array $options) {
$form = array();
$form['shib_auth_new_id'] = array(
'#title' => t('Entry id'),
'#type' => 'hidden',
'#default_value' => $options[0],
);
$form['shib_auth_new_attrib'] = array(
'#title' => t('Shibboleth attribute name'),
'#type' => 'textfield',
'#default_value' => $options[1],
'#require' => TRUE,
'#description' => t("More properly: <b>@server</b> field name; enable DEBUG mode to list available fields. <br/>Note that it might differ from your users' fields.", array(
'@server' => '$_SERVER',
)),
);
$form['shib_auth_new_regexp'] = array(
'#title' => t('Value (regexp)'),
'#type' => 'textfield',
'#default_value' => $options[2],
'#require' => TRUE,
);
$roles = user_roles(TRUE);
$form['shib_auth_roles'] = array(
'#type' => 'checkboxes',
'#title' => t('Roles'),
'#default_value' => count($options[3]) > 1 || count($options[3]) == 1 && $options[3] != "" ? $options[3] : array(),
'#options' => $roles,
);
$form['sticky_markup'] = array(
'#value' => '<b>Role type:</b>',
);
$form['shib_auth_new_sticky'] = array(
'#type' => 'checkbox',
'#title' => t('Sticky'),
'#default_value' => $options[5],
'#description' => t("Set the rule to be sticky if you want to save the role(s) permanently to the user's profile."),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => $options[4],
);
return $form;
}