From c03c9f8b886c0e8eca5a701c0ca941e05e0b6285 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Fri, 21 Nov 2025 22:20:10 +0100 Subject: Add pharo tiny blog --- .../src/TinyBlog-Components/TBSession.class.st | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 pharo-mooc/tiny-blog/src/TinyBlog-Components/TBSession.class.st (limited to 'pharo-mooc/tiny-blog/src/TinyBlog-Components/TBSession.class.st') diff --git a/pharo-mooc/tiny-blog/src/TinyBlog-Components/TBSession.class.st b/pharo-mooc/tiny-blog/src/TinyBlog-Components/TBSession.class.st new file mode 100644 index 0000000..f56c40b --- /dev/null +++ b/pharo-mooc/tiny-blog/src/TinyBlog-Components/TBSession.class.st @@ -0,0 +1,33 @@ +Class { + #name : 'TBSession', + #superclass : 'WASession', + #instVars : [ + 'currentAdmin' + ], + #category : 'TinyBlog-Components', + #package : 'TinyBlog-Components' +} + +{ #category : 'accessing' } +TBSession >> currentAdmin [ + + ^ currentAdmin +] + +{ #category : 'accessing' } +TBSession >> currentAdmin: anObject [ + + currentAdmin := anObject +] + +{ #category : 'testing' } +TBSession >> isLogged [ + ^ self currentAdmin notNil +] + +{ #category : 'initialization' } +TBSession >> reset [ + currentAdmin := nil. + self requestContext redirectTo: self application url. + self unregister +] -- cgit v1.2.3