validateSpeech() public static method

public static validateSpeech ( )
Example #1
0
if (erLhcoreClassUser::instance()->hasAccessTo('lhuser', 'allowtochoosependingmode') && isset($_POST['UpdatePending_account'])) {
    if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
        erLhcoreClassModule::redirect('user/account');
        exit;
    }
    $showAllPending = erLhcoreClassUserValidator::validateShowAllPendingOption();
    erLhcoreClassModelUserSetting::setSetting('show_all_pending', $showAllPending);
    $tpl->set('account_updated', 'done');
    $tpl->set('tab', 'tab_pending');
}
if (erLhcoreClassUser::instance()->hasAccessTo('lhspeech', 'changedefaultlanguage') && isset($_POST['UpdateSpeech_account'])) {
    if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
        erLhcoreClassModule::redirect('user/account');
        exit;
    }
    $validateSpeechData = erLhcoreClassUserValidator::validateSpeech();
    erLhcoreClassModelUserSetting::setSetting('speech_language', $validateSpeechData['speech_language']);
    erLhcoreClassModelUserSetting::setSetting('speech_dialect', $validateSpeechData['speech_dialect']);
    $tpl->set('account_updated', 'done');
    $tpl->set('tab', 'tab_speech');
}
if (erLhcoreClassUser::instance()->hasAccessTo('lhuser', 'change_visibility_list') && isset($_POST['UpdateTabsSettings_account'])) {
    if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
        erLhcoreClassModule::redirect('user/account');
        exit;
    }
    $validateVisibilityListData = erLhcoreClassUserValidator::validateVisibilityList();
    erLhcoreClassModelUserSetting::setSetting('enable_pending_list', $validateVisibilityListData['enable_pending_list']);
    erLhcoreClassModelUserSetting::setSetting('enable_active_list', $validateVisibilityListData['enable_active_list']);
    erLhcoreClassModelUserSetting::setSetting('enable_close_list', $validateVisibilityListData['enable_close_list']);
    erLhcoreClassModelUserSetting::setSetting('enable_unread_list', $validateVisibilityListData['enable_unread_list']);