} else {
         $upf->setEnableEmailNotificationException(FALSE);
     }
     if (isset($pref_data['enable_email_notification_message'])) {
         $upf->setEnableEmailNotificationMessage(TRUE);
     } else {
         $upf->setEnableEmailNotificationMessage(FALSE);
     }
     if (isset($pref_data['enable_email_notification_home'])) {
         $upf->setEnableEmailNotificationHome(TRUE);
     } else {
         $upf->setEnableEmailNotificationHome(FALSE);
     }
     if ($upf->isValid()) {
         $upf->Save(FALSE);
         if ($current_user->getId() == $upf->getUser()) {
             TTi18n::setLocaleCookie($pref_data['language'] . '_' . $current_user->getCountry());
         }
         Redirect::Page(URLBuilder::getURL(array('user_id' => $pref_data['user_id'], 'data_saved' => 1), Environment::getBaseURL() . '/users/EditUserPreference.php'));
         unset($upf);
         break;
     }
 default:
     if (!isset($user_id) or isset($user_id) and $user_id == '') {
         $user_id = $current_user->getId();
     }
     $ulf->getByIdAndCompanyId($user_id, $current_company->getId());
     if ($ulf->getRecordCount() > 0) {
         $user_obj = $ulf->getCurrent();
     }
     if (!isset($action)) {