Exemplo n.º 1
0
}
$userSetting = eZUserSetting::fetch($UserID);
if ($http->hasPostVariable("UpdateSettingButton")) {
    $isEnabled = 0;
    if ($http->hasPostVariable('max_login')) {
        $maxLogin = $http->postVariable('max_login');
    } else {
        $maxLogin = $userSetting->attribute('max_login');
    }
    if ($http->hasPostVariable('is_enabled')) {
        $isEnabled = 1;
    }
    if (eZOperationHandler::operationIsAvailable('user_setsettings')) {
        $operationResult = eZOperationHandler::execute('user', 'setsettings', array('user_id' => $UserID, 'is_enabled' => $isEnabled, 'max_login' => $maxLogin));
    } else {
        eZUserOperationCollection::setSettings($UserID, $isEnabled, $maxLogin);
    }
    $Module->redirectTo('/content/view/full/' . $userObject->attribute('main_node_id'));
    return;
}
if ($http->hasPostVariable("CancelSettingButton")) {
    $Module->redirectTo('/content/view/full/' . $userObject->attribute('main_node_id'));
    return;
}
if ($http->hasPostVariable("ResetFailedLoginButton")) {
    // Reset number of failed login attempts
    eZUser::setFailedLoginAttempts($UserID, 0, true);
}
$failedLoginAttempts = $user->failedLoginAttempts();
$maxFailedLoginAttempts = eZUser::maxNumberOfFailedLogin();
$Module->setTitle("Edit user settings");