You are here

function authcache_user_form_alter in Authenticated User Page Caching (Authcache) 7.2

Implements hook_form_alter().

File

modules/authcache_user/authcache_user.module, line 36
Provide profile data of logged in user as personalized setting.

Code

function authcache_user_form_alter(&$form, &$form_state, $form_id) {
  global $user;
  if ($user->uid && authcache_page_is_cacheable()) {
    switch ($form_id) {
      case 'contact_site_form':
      case 'contact_personal_form':
        if (isset($form['name'])) {
          authcache_user_attach_property($form['name'], 'name');
        }
        if (isset($form['mail'])) {
          authcache_user_attach_property($form['mail'], 'mail');
        }
        break;
    }
  }
}