switched over old auth links to the new url system

This commit is contained in:
JT Smith 2005-03-05 02:34:20 +00:00
parent a3a335486a
commit 12ea0cf6fa
8 changed files with 24 additions and 56 deletions

View file

@ -16,6 +16,9 @@
Matt Wilson for inspiration.
- Thumbnails will now be generated a little sharper. Thanks to Nuba.
- SSL is now more strictly enforced.
- Deleted the long since deprecated authentication methods (logout, login,
displayAccount, displayLogin, recoverPassword). If you don't understand
this, don't worry about it, you'll still be able to log in to your site. =)
- Fixed resetting votes on Poll would crash it.
- Fixed not being able to set display title and other yes no questions to no.
- Fixed a bug where URLs would become unreachable when using SSL.

View file

@ -400,7 +400,7 @@ sub displayLogin {
$vars->{'login.form.submit'} = WebGUI::Form::submit({"value"=>WebGUI::International::get(52)});
$vars->{'login.form.footer'} = WebGUI::Form::formFooter();
$vars->{'anonymousRegistration.isAllowed'} = ($session{setting}{anonymousRegistration});
$vars->{'createAccount.url'} = WebGUI::URL::page('op=createAccount');
$vars->{'createAccount.url'} = WebGUI::URL::page('op=auth&method=createAccount');
$vars->{'createAccount.label'} = WebGUI::International::get(67);
return WebGUI::Asset::Template->new($self->getLoginTemplateId)->process($vars);
}

View file

@ -179,7 +179,7 @@ sub createAccount {
$vars->{'create.form.passwordConfirm.label'} = WebGUI::International::get(2,'AuthWebGUI');
$vars->{'create.form.hidden'} = WebGUI::Form::hidden({"name"=>"confirm","value"=>$session{form}{confirm}});
$vars->{'recoverPassword.isAllowed'} = $self->getSetting("passwordRecovery");
$vars->{'recoverPassword.url'} = WebGUI::URL::page('op=recoverPassword');
$vars->{'recoverPassword.url'} = WebGUI::URL::page('op=auth&method=recoverPassword');
$vars->{'recoverPassword.label'} = WebGUI::International::get(59);
return $self->SUPER::createAccount("createAccountSave",$vars);
}
@ -286,7 +286,7 @@ sub displayLogin {
return $self->displayAccount($_[0]) if ($self->userId != 1);
$vars->{'login.message'} = $_[0] if ($_[0]);
$vars->{'recoverPassword.isAllowed'} = $self->getSetting("passwordRecovery");
$vars->{'recoverPassword.url'} = WebGUI::URL::page('op=recoverPassword');
$vars->{'recoverPassword.url'} = WebGUI::URL::page('op=auth&method=recoverPassword');
$vars->{'recoverPassword.label'} = WebGUI::International::get(59);
return $self->SUPER::displayLogin("login",$vars);
}
@ -501,7 +501,7 @@ sub recoverPassword {
$vars->{'login.label'} = WebGUI::International::get(58);
$vars->{'anonymousRegistration.isAllowed'} = ($session{setting}{anonymousRegistration});
$vars->{'createAccount.url'} = WebGUI::URL::page('op=createAccount');
$vars->{'createAccount.url'} = WebGUI::URL::page('op=auth=&method=createAccount');
$vars->{'createAccount.label'} = WebGUI::International::get(67);
$vars->{'recover.message'} = $_[0] if ($_[0]);
$vars->{'recover.form.email'} = WebGUI::Form::text({"name"=>"email"});

View file

@ -20,7 +20,7 @@ use WebGUI::URL;
#-------------------------------------------------------------------
sub _createURL {
return '<a href="'.WebGUI::URL::page("op=logout").'">'.$_[0].'</a>';
return '<a href="'.WebGUI::URL::page("op=auth&method=logout").'">'.$_[0].'</a>';
}
#-------------------------------------------------------------------
@ -32,8 +32,8 @@ sub process {
$var{'customText'} = $param[1];
$var{'customText'} =~ s/%(.*?)%/_createURL($1)/ge;
$var{'hello.label'} = WebGUI::International::get(48);
$var{'logout.url'} = WebGUI::URL::page("op=logout");
$var{'account.display.url'} = WebGUI::URL::page('op=displayAccount');
$var{'logout.url'} = WebGUI::URL::page("op=auth&method=logout");
$var{'account.display.url'} = WebGUI::URL::page('op=auth&method=displayAccount');
$var{'logout.label'} = WebGUI::International::get(49);
my $boxSize = $param[0];
$boxSize = 12 unless $boxSize;
@ -48,6 +48,10 @@ sub process {
$var{'form.header'} = WebGUI::Form::formHeader({action=>$action})
.WebGUI::Form::hidden({
name=>"op",
value=>"auth"
})
.WebGUI::Form::hidden({
name=>"method",
value=>"login"
});
$var{'username.label'} = WebGUI::International::get(50);
@ -66,7 +70,7 @@ sub process {
value=>WebGUI::International::get(52),
extras=>'class="loginBoxButton"'
});
$var{'account.create.url'} = WebGUI::URL::page('op=createAccount');
$var{'account.create.url'} = WebGUI::URL::page('op=auth&method=createAccount');
$var{'account.create.label'} = WebGUI::International::get(407);
$var{'form.footer'} = WebGUI::Form::formFooter();
return WebGUI::Asset::Template->new($templateId)->process(\%var);

View file

@ -24,12 +24,12 @@ sub process {
my $logout = $param[1] || WebGUI::International::get(717);
my %var;
if ($session{user}{userId} eq '1') {
return WebGUI::URL::page("op=displayLogin") if ($param[0] eq "linkonly");
$var{'toggle.url'} = WebGUI::URL::page('op=displayLogin');
return WebGUI::URL::page("op=auth&method=init") if ($param[0] eq "linkonly");
$var{'toggle.url'} = WebGUI::URL::page('op=auth&method=init');
$var{'toggle.text'} = $login;
} else {
return WebGUI::URL::page("op=logout") if ($param[0] eq "linkonly");
$var{'toggle.url'} = WebGUI::URL::page('op=logout');
return WebGUI::URL::page("op=auth&method=logout") if ($param[0] eq "linkonly");
$var{'toggle.url'} = WebGUI::URL::page('op=auth&method=logout');
$var{'toggle.text'} = $logout;
}
if ($param[3]) {

View file

@ -21,8 +21,8 @@ use WebGUI::URL;
sub process {
my %var;
my @param = WebGUI::Macro::getParams(shift);
return WebGUI::URL::page("op=displayAccount") if ($param[0] eq "linkonly");
$var{'account.url'} = WebGUI::URL::page('op=displayAccount');
return WebGUI::URL::page("op=auth&method=init") if ($param[0] eq "linkonly");
$var{'account.url'} = WebGUI::URL::page('op=auth&method=init');
$var{'account.text'} = $param[0] || WebGUI::International::get(46);
return WebGUI::Asset::Template->newByUrl($param[1]||"default_account_macro")->process(\%var);
}

View file

@ -61,45 +61,6 @@ sub www_auth {
return WebGUI::Operation::Shared::userStyle($authMethod->$methodCall);
}
#-------------------------------------------------------------------
sub www_createAccount {
return www_auth("createAccount");
}
#-------------------------------------------------------------------
sub www_deactivateAccount {
return www_auth("deactivateAccount");
}
#-------------------------------------------------------------------
sub www_displayAccount {
return www_auth("displayAccount");
}
#-------------------------------------------------------------------
sub www_displayLogin {
return www_auth("displayLogin");
}
#-------------------------------------------------------------------
sub www_init {
return www_auth("init");
}
#Deprecated. Kept for backwards compatibility. Use op=auth&method=login
#-------------------------------------------------------------------
sub www_login {
return www_auth("login");
}
#-------------------------------------------------------------------
sub www_logout {
return www_auth("logout");
}
#-------------------------------------------------------------------
sub www_recoverPassword {
return www_auth("recoverPassword");
}
1;

View file

@ -36,7 +36,7 @@ our @EXPORT = qw(&menuWrapper);
}
unless ($session{form}{op} eq "displayAccount"){
my %hash;
$hash{'options.display'} = '<a href="'.WebGUI::URL::page('op=displayAccount').'">'.WebGUI::International::get(342).'</a>';
$hash{'options.display'} = '<a href="'.WebGUI::URL::page('op=auth&method=init').'">'.WebGUI::International::get(342).'</a>';
push(@array,\%hash);
}
unless ($session{form}{op} eq "editProfile"){
@ -59,11 +59,11 @@ our @EXPORT = qw(&menuWrapper);
}
my %logout;
$logout{'options.display'} = '<a href="'.WebGUI::URL::page('op=logout').'">'.WebGUI::International::get(64).'</a>';
$logout{'options.display'} = '<a href="'.WebGUI::URL::page('op=auth&method=logout').'">'.WebGUI::International::get(64).'</a>';
push(@array,\%logout);
if ($session{setting}{selfDeactivation} && !WebGUI::Grouping::isInGroup(3)){
my %hash;
$hash{'options.display'} = '<a href="'.WebGUI::URL::page('op=deactivateAccount').'">'.WebGUI::International::get(65).'</a>';
$hash{'options.display'} = '<a href="'.WebGUI::URL::page('op=auth&method=deactivateAccount').'">'.WebGUI::International::get(65).'</a>';
push(@array,\%hash);
}
return \@array;