Skip to content

Commit

Permalink
fix #154
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobuzzi committed Jan 25, 2019
1 parent 7a55955 commit fafb8fe
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 5 deletions.
Binary file modified lastVM.uvm
Binary file not shown.
20 changes: 17 additions & 3 deletions sources/aida/AIDA for UML Live Engine.pax
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package classNames
add: #AIDAUMLObjectWebPageDescription;
add: #AIDAUMLSelectableItemsTable;
add: #UMLAbsoluteRedirectWebButton;
add: #UMLAbstractWebStyle;
add: #UMLActionWebButton;
add: #UMLInstanceApp;
add: #UMLRedirectWebButton;
Expand Down Expand Up @@ -195,12 +196,17 @@ WebGridColumn subclass: #UMLWebGridColumn
classVariableNames: ''
poolDictionaries: ''
classInstanceVariableNames: ''!
DefaultWebStyle subclass: #UMLVerticalWebStyle
DefaultWebStyle subclass: #UMLAbstractWebStyle
instanceVariableNames: 'loginErrorText'
classVariableNames: ''
poolDictionaries: ''
classInstanceVariableNames: ''!
UMLAbstractWebStyle subclass: #UMLVerticalWebStyle
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
classInstanceVariableNames: ''!
DefaultWebStyle subclass: #UMLWebStyle
UMLAbstractWebStyle subclass: #UMLWebStyle
instanceVariableNames: 'tabsPadding'
classVariableNames: ''
poolDictionaries: ''
Expand Down Expand Up @@ -252,6 +258,7 @@ actionLogin

webUser := self findLoggingUser.

self style loginErrorText: nil.
self password: ''.
webUser notNil
ifTrue: [self session user: webUser. self reportLogin]
Expand All @@ -263,7 +270,13 @@ actionLogin
umlModel selected isEmpty ifTrue: [self error: 'error message from WebStyle!!'. self session logout. ^self].

umlUser := self getUserRootObjectsFor: webUser model: umlModel selected last.
(umlUser class == UMLInstance) ifFalse: [self error: 'Login Error'. self session logout. ^self].
(umlUser class == UMLInstance)
ifFalse: [| loginError |
loginError := 'Login Error: [it should answer an UML object instead of: ', umlUser smalltalkObject class printString, ']'.
self style loginErrorText: loginError.
self error: loginError.
self session logout.
^self].
^self redirectTo: umlUser.!

getUserRootObjectsFor: aWebUser model: anUMLModel
Expand Down Expand Up @@ -292,6 +305,7 @@ viewLogin
e addText: self style loginWelcomeMessage.
l := (WebFieldSet newId: #login) legend: self style loginText.
l style: 'margin-left:auto; margin-right:auto; width:40%;'.

self inError ifTrue:
[l cell colspan: 2; addText: self style loginErrorText. self error: nil.
l newRow. l cell addNbSp. l newRow].
Expand Down
24 changes: 24 additions & 0 deletions sources/aida/UMLAbstractWebStyle.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"Filed out from Dolphin Smalltalk 7"!

DefaultWebStyle subclass: #UMLAbstractWebStyle
instanceVariableNames: 'loginErrorText'
classVariableNames: ''
poolDictionaries: ''
classInstanceVariableNames: ''!
UMLAbstractWebStyle guid: (GUID fromString: '{71701171-4737-4dd9-a3ca-4e5d13506e05}')!
UMLAbstractWebStyle comment: ''!
!UMLAbstractWebStyle categoriesForClass!Unclassified! !
!UMLAbstractWebStyle methodsFor!

loginErrorText

(loginErrorText isNil or: [loginErrorText isEmpty]) ifTrue: [^super loginErrorText].

^'<b>', loginErrorText, '</b>'!

loginErrorText: anObject

loginErrorText := anObject! !
!UMLAbstractWebStyle categoriesFor: #loginErrorText!accessing!private! !
!UMLAbstractWebStyle categoriesFor: #loginErrorText:!accessing!private! !

2 changes: 1 addition & 1 deletion sources/aida/UMLVerticalWebStyle.cls
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"Filed out from Dolphin Smalltalk 7"!

DefaultWebStyle subclass: #UMLVerticalWebStyle
UMLAbstractWebStyle subclass: #UMLVerticalWebStyle
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
Expand Down
2 changes: 1 addition & 1 deletion sources/aida/UMLWebStyle.cls
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"Filed out from Dolphin Smalltalk 7"!

DefaultWebStyle subclass: #UMLWebStyle
UMLAbstractWebStyle subclass: #UMLWebStyle
instanceVariableNames: 'tabsPadding'
classVariableNames: ''
poolDictionaries: ''
Expand Down
1 change: 1 addition & 0 deletions sources/aida/WebStyle.cls
Original file line number Diff line number Diff line change
Expand Up @@ -4418,6 +4418,7 @@ loginButton
^'Login'!

loginErrorText

^'<b style={color:red}>Login failed!! Please check your entry and try again!!</b>'!

loginErrorTextSecondary
Expand Down

0 comments on commit fafb8fe

Please sign in to comment.