Merge branch 'master' into 8-merge
Conflicts: docs/gotcha.txt lib/WebGUI.pm lib/WebGUI/Asset.pm lib/WebGUI/Asset/File/GalleryFile/Photo.pm lib/WebGUI/Asset/Post.pm lib/WebGUI/Asset/Story.pm lib/WebGUI/Asset/Template.pm lib/WebGUI/Asset/Wobject/Calendar.pm lib/WebGUI/Asset/Wobject/GalleryAlbum.pm lib/WebGUI/Asset/Wobject/Navigation.pm lib/WebGUI/AssetLineage.pm lib/WebGUI/AssetTrash.pm lib/WebGUI/Config.pm lib/WebGUI/Form/Template.pm lib/WebGUI/Group.pm lib/WebGUI/Inbox.pm lib/WebGUI/Workflow/Activity/DeleteExpiredSessions.pm lib/WebGUI/Workflow/Activity/TrashExpiredEvents.pm sbin/testEnvironment.pl t/AdSpace.t t/AdSpace/Ad.t t/Asset/Asset.t t/Asset/AssetExportHtml.t t/Asset/AssetLineage.t t/Asset/EMSSubmissionForm.t t/Asset/Event.t t/Asset/File/GalleryFile/Photo/00base.t t/Asset/File/GalleryFile/Photo/comment.t t/Asset/File/GalleryFile/Photo/download.t t/Asset/File/GalleryFile/Photo/edit.t t/Asset/File/GalleryFile/Photo/exif.t t/Asset/File/GalleryFile/Photo/makeResolutions.t t/Asset/File/GalleryFile/Photo/makeShortcut.t t/Asset/File/Image/setfile.t t/Asset/File/setfile.t t/Asset/Post.t t/Asset/Post/Thread/getAdjacentThread.t t/Asset/Sku.t t/Asset/Sku/ProductCollateral.t t/Asset/Story.t t/Asset/Template.t t/Asset/Template/HTMLTemplateExpr.t t/Asset/Wobject/Gallery/00base.t t/Asset/Wobject/GalleryAlbum/00base.t t/Asset/Wobject/GalleryAlbum/ajax.t t/Asset/Wobject/GalleryAlbum/delete.t t/Asset/Wobject/Matrix.t t/Asset/Wobject/StoryArchive.t t/Asset/Wobject/Survey/ExpressionEngine.t t/Asset/Wobject/Survey/Reports.t t/AssetAspect/RssFeed.t t/Auth/mech.t t/Config.t t/Group.t t/Help/isa.t t/International.t t/Mail/Send.t t/Operation/AdSpace.t t/Operation/Auth.t t/Pluggable.t t/Session.t t/Session/DateTime.t t/Session/ErrorHandler.t t/Session/Scratch.t t/Session/Stow.t t/Shop/Cart.t t/Shop/Pay.t t/Shop/PayDriver/ITransact.t t/Shop/PayDriver/PayPalStd.t t/Shop/Ship.t t/Shop/ShipDriver.t t/Shop/TaxDriver/EU.t t/Shop/TaxDriver/Generic.t t/Shop/Transaction.t t/Shop/Vendor.t t/VersionTag.t t/Workflow/Activity/ArchiveOldStories.t t/Workflow/Activity/ExpireIncompleteSurveyResponses.t t/lib/WebGUI/Test.pm
This commit is contained in:
commit
babfa74209
238 changed files with 4557 additions and 1287 deletions
|
|
@ -14,6 +14,7 @@ package WebGUI::Operation::Auth;
|
|||
# logic that defines how Authentication should happen
|
||||
|
||||
use strict qw(vars subs);
|
||||
use List::MoreUtils qw( any );
|
||||
use URI;
|
||||
use WebGUI::Operation::Shared;
|
||||
use WebGUI::Pluggable;
|
||||
|
|
@ -33,9 +34,16 @@ Get the instance of this object or create a new instance if none exists
|
|||
sub getInstance {
|
||||
my $session = shift;
|
||||
#Get Auth Settings
|
||||
my $authMethod = $session->user->authMethod || $session->setting->get("authMethod");
|
||||
$authMethod = $session->setting->get("authMethod") if($session->user->isVisitor);
|
||||
$authMethod = $_[0] if($_[0] && isIn($_[0], @{$session->config->get("authMethods")}));
|
||||
my $authMethod = $_[0]
|
||||
|| ( !$session->user->isVisitor && $session->user->authMethod ) # Visitor has no authType
|
||||
|| $session->form->get('authType')
|
||||
|| $session->setting->get("authMethod")
|
||||
;
|
||||
# Verify is in auth method list
|
||||
if ( !any { $_ eq $authMethod } @{$session->config->get('authMethods')} ) {
|
||||
$authMethod = $session->setting->get('authMethod');
|
||||
}
|
||||
|
||||
my $userId = $_[1];
|
||||
#Create Auth Object
|
||||
my $auth = eval { WebGUI::Pluggable::instanciate("WebGUI::Auth::".$authMethod, "new", [ $session, $authMethod, $userId ] ) };
|
||||
|
|
@ -68,11 +76,15 @@ sub www_auth {
|
|||
my $authMethod = getInstance($session,$auth);
|
||||
my $methodCall = shift || $session->form->process("method") || "init";
|
||||
if(!$authMethod->isCallable($methodCall)){
|
||||
$session->errorHandler->security("access uncallable auth method");
|
||||
$session->errorHandler->security("access uncallable auth method: $methodCall");
|
||||
my $i18n = WebGUI::International->new($session);
|
||||
return $i18n->get(1077);
|
||||
}
|
||||
my $out = $authMethod->$methodCall;
|
||||
|
||||
# Determine if we have a www_ method
|
||||
my $method = $authMethod->can( 'www_' . $methodCall )
|
||||
|| $authMethod->can( $methodCall );
|
||||
my $out = $method->( $authMethod );
|
||||
if (substr($session->http->getMimeType(),0,9) eq "text/html") {
|
||||
return $session->style->userStyle($out);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -308,7 +308,6 @@ sub www_runCronJob {
|
|||
# Run the instance
|
||||
my $error = $instance->start( 1 );
|
||||
if ($error) {
|
||||
$task->delete(1);
|
||||
return "error";
|
||||
}
|
||||
$task->delete( 1 ) if ( $task->get("runOnce") );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue