function userprotect_form_display_protections in User protect 7
Same name and namespace in other branches
- 6 userprotect.module \userprotect_form_display_protections()
Conditionally displays a user message on edit forms listing current protections.
Parameters
object $account: The user account object.
array $protected: An array of protections the current user is receiving.
2 calls to userprotect_form_display_protections()
- userprotect_form_alter in ./
userprotect.module - Implements hook_form_alter().
- userprotect_form_user_profile_form_alter in ./
userprotect.module - Implements hook_form_user_profile_form_alter().
File
- ./
userprotect.module, line 722 - Main module file for the userprotect module.
Code
function userprotect_form_display_protections($account, $protected) {
// If we're initially displaying an edit form, throw a message if
// there are any protected fields, so the editor has a clue.
if (!empty($protected) && !$_POST) {
drupal_set_message(userprotect_display_protections($account, $protected));
}
}