$code = Horde_Util::getGet('code');
if (empty($code)) {
$notification->push(_("You must supply a confirmation code."));
- header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
- exit;
+ Horde_Auth::authenticateFailure('folks');
}
// Get supplied username
$user = Horde_Util::getGet('user');
if (empty($code)) {
$notification->push(_("You must supply a username."));
- header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
- exit;
+ Horde_Auth::authenticateFailure('folks');
}
// Get user profile
$profile = $folks_driver->getProfile($user);
if ($profile instanceof PEAR_Error) {
$notification->push($profile);
- header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
- exit;
+ Horde_Auth::authenticateFailure('folks');
}
// This pages is only to activate users
if ($profile['user_status'] != 'inactive') {
$notification->push(_("User \"%s\" was already activated."));
- header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
- exit;
+ Horde_Auth::authenticateFailure('folks');
}
// Get internal confirmation code
$internal_code = $folks_driver->getConfirmationCode($user, 'activate');
if ($internal_code instanceof PEAR_Error) {
$notification->push($internal_code);
- header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
- exit;
+ Horde_Auth::authenticateFailure('folks');
}
// Check code
$notification->push(_("The code is not right. If you copy and paste the link from your email, please check if you copied the whole string."), 'horde.warning');
}
-header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
-exit;
+Horde_Auth::authenticateFailure('folks');
$code = Horde_Util::getGet('code');
if (empty($code)) {
$notification->push(_("You must supply a confirmation code."));
- header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
- exit;
+ Horde_Auth::authenticateFailure('folks');
}
// Get supplied username
$user = Horde_Util::getGet('user');
if (empty($code)) {
$notification->push(_("You must supply a username."));
- header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
- exit;
+ Horde_Auth::authenticateFailure('folks');
}
// Get user profile
$profile = $folks_driver->getProfile($user);
if ($profile instanceof PEAR_Error) {
$notification->push($profile);
- header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
- exit;
+ Horde_Auth::authenticateFailure('folks');
}
// This pages is only to activate users
if ($profile['user_status'] != 'deleted') {
$notification->push(_("User \"%s\" is not market to be in the removal process."));
- header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
- exit;
+ Horde_Auth::authenticateFailure('folks');
}
-
+
// Get internal confirmation code
$internal_code = $folks_driver->getConfirmationCode($user, 'renew');
if ($internal_code instanceof PEAR_Error) {
$notification->push($internal_code);
- header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
- exit;
+ Horde_Auth::authenticateFailure('folks');
}
// Check code
$notification->push(_("The code is not right. If you copy and paste the link from your email, please check if you copied the whole string."), 'horde.warning');
}
-header('Location: ' . Horde_Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
-exit;
+Horde_Auth::authenticateFailure('folks');
$auth = Horde_Auth::singleton($conf['auth']['driver']);
if (!$auth->hasCapability('resetpassword')) {
$notification->push(_("Cannot reset password automatically, contact your administrator."), 'horde.error');
- header('Location: ' . Horde_Auth::getLoginScreen('', Horde_Util::getFormData('url')));
- exit;
+ Horde_Auth::authenticateFailure('folks');
}
$vars = Horde_Variables::getDefaultVariables();
$email = Folks::getUserEmail($info['username']);
if ($email instanceof PEAR_Error) {
$notification->push($email);
- header('Location: ' . Horde_Auth::getLoginScreen('', $info['url']));
- exit;
+ Horde_Auth::authenticateFailure('folks');
}
/* Check the given values with the prefs stored ones. */
$password = $auth->resetPassword($info['username']);
if ($password instanceof PEAR_Error) {
$notification->push($password);
- header('Location: ' . Horde_Auth::getLoginScreen('', $info['url']));
- exit;
+ Horde_Auth::authenticateFailure('folks');
}
$body = sprintf(_("Your new password for %s is: %s. \n\n It was requested by %s on %s"),
Folks::sendMail($email, _("Your password has been reset"), $body);
$notification->push(sprintf(_("Your password has been reset, check your email (%s) and log in with your new password."), $email), 'horde.success');
- header('Location: ' . Horde_Auth::getLoginScreen('', $info['url']));
- exit;
+ Horde_Auth::authenticateFailure('folks');
} else {
/* Info submitted does not match what is in prefs, redirect user back
* to login. */
if ($conf['signup']['allow'] !== true ||
!$auth->hasCapability('add')) {
$notification->push(_("User Registration has been disabled for this site."), 'horde.error');
- header('Location: ' . Horde_Auth::getLoginScreen());
- exit;
+ Horde_Auth::authenticateFailure('folks');
}
$vars = Horde_Variables::getDefaultVariables();
if ($form->validate()) {
$form->getInfo(null, $info);
- $signup = new Auth_Signup();
+ $signup = new Horde_Auth_Signup();
$success_message = null;
if (!$conf['signup']['approve']) {
$notification->push(sprintf(_("There was a problem adding \"%s\" to the system: %s"), $info['user_name'], $success->getMessage()), 'horde.error');
} else {
$notification->push($success_message, 'horde.success');
- $url = Horde_Auth::getLoginScreen('', $info['url']);
- header('Location: ' . $url);
- exit;
+ Horde_Auth::authenticateFailure('folks');
}
}
Folks::sendMail($info['email'], _("Your username was requested"), $body);
$notification->push(sprintf(_("Your username was sent, check your email (%s)."), $users['user_email']), 'horde.success');
- header('Location: ' . Horde_Auth::getLoginScreen('', $info['url']));
- exit;
+ Horde_Auth::authenticateFailure('folks');
}
}
$auth = Horde_Auth::singleton($conf['auth']['driver']);
if (!$auth->hasCapability('resetpassword')) {
$notification->push(_("Cannot update password, contact your administrator."), 'horde.error');
- header('Location: ' . Horde_Auth::getLoginScreen('', Horde_Util::getFormData('url')));
- exit;
+ Horde_Auth::authenticateFailure('folks');
}
$title = _("Change Your Password");
<?php
echo '<li><img src="' . $registry->getImageDir('horde') . '/alerts/success.png">'
. _("Click here to login.")
- . ' <a href="' . Horde_Auth::getLoginScreen('letter', Horde_Util::addParameter(Horde::applicationUrl('user.php'), 'user', $user)) . '">' . _("Click here to login.") . '</a>'
+ . ' <a href="' . Hode::getServiceLink('login', 'folks') . '">' . _("Click here to login.") . '</a>'
. '</li>';
?>
</ul>