How to determine login username or group name.

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
fhutt
-


Joined: 14 Jul 2019
Posts: 31

PostPosted: Mon Aug 05, 2019 10:33 pm    Post subject: How to determine login username or group name. Reply with quote

Is there a way in HTML or CSS in the index file to determine which username or group name has logged into the my website?
Back to top View user's profile Send private message
admin
Site Admin


Joined: 03 Mar 2002
Posts: 963

PostPosted: Sun Aug 11, 2019 11:53 am    Post subject: Re: How to determine login username or group name. Reply with quote

fhutt wrote:
Is there a way in HTML or CSS in the index file to determine which username or group name has logged into the my website?


You can use SSI to include the logged user name in the actual file served by the file.

For that declare the .html and .css file name extensions as handled by the XSSI engine in Abyss Web Server (by default only .shtml and .shtm are handled).

Next, edit the files and in the location where the logged user name should be inserted use the following syntax:

Code:
<!-- #echo var="AUTH_USER" -->


Note that this variable is empty when no user is logged so it may be useful to use an XSSI conditional syntax to insert a block of text relevant to that situation or not.

More about XSSI is available in https://aprelium.com/abyssws/articles/xssi-introduction.html and https://aprelium.com/data/doc/2/abyssws-win-doc-html/ssi.html .
_________________
Follow @abyssws on Twitter
Subscribe to our newsletter
_________________
Forum Administrator
Aprelium - https://aprelium.com
Back to top View user's profile Send private message
fhutt
-


Joined: 14 Jul 2019
Posts: 31

PostPosted: Sun Aug 11, 2019 1:09 pm    Post subject: Reply with quote

Thank you so much.
I will look into this further.
Back to top View user's profile Send private message
fhutt
-


Joined: 14 Jul 2019
Posts: 31

PostPosted: Mon Aug 12, 2019 1:15 am    Post subject: Reply with quote

I have looked into the XSSI and tried to implament some actions as follows:

I tried
<!-- #echo var="AUTH_USER" -->
This works file with a display of 'family'

Then I tried a more complicated line:
<!--#if expr="$(AUTH_USER) = /family/" -->
I copied and modified this from your reference at the Aprelium website.
I get an error as follows:
Error at token '(AUTH_USER) = /family/'

I have tried the 'family' with and without the forward slashes with the same result.

I know that this is more of a software question but i've looked on the internet and couldn't find anything helpful.
Could you give me an idea of how I could fix this line?

EDIT: Found the problem - must use curly braces as shown here:
<!--#if expr="${AUTH_USER} = /family/" -->
Incorrectly shown at:
https://aprelium.com/abyssws/articles/xssi-introduction.html
Back to top View user's profile Send private message
fhutt
-


Joined: 14 Jul 2019
Posts: 31

PostPosted: Mon Aug 12, 2019 8:15 am    Post subject: Reply with quote

I have worked out most of my requirements now.

One thing I still need help with is some code to be able to write a notice on the web page if XSSI is disabled for any reason.

I would appreciate any help with this.
Back to top View user's profile Send private message
fhutt
-


Joined: 14 Jul 2019
Posts: 31

PostPosted: Wed Aug 14, 2019 11:52 pm    Post subject: Reply with quote

Now that I am able to access the AUTH_USER name I found a need for the Group name as well.
I tried:
<!-- #echo var="AUTH_GROUP" -->
Unfortunately there is no output, therefore it is not recognised.
Is there some way to access the Group name of the logged in user using XSSI?
Thanks
Back to top View user's profile Send private message
admin
Site Admin


Joined: 03 Mar 2002
Posts: 963

PostPosted: Thu Aug 15, 2019 5:57 pm    Post subject: Reply with quote

fhutt wrote:
Now that I am able to access the AUTH_USER name I found a need for the Group name as well.
I tried:
<!-- #echo var="AUTH_GROUP" -->
Unfortunately there is no output, therefore it is not recognised.
Is there some way to access the Group name of the logged in user using XSSI?
Thanks


The CGI protocol has no notion of groups of users. So there is unfortunately no such variable.

It would make a nice addition but one has to take into consideration the case where a single user belongs to several groups. In such a case, should the variable contain all the groups or only the group that was resolved to allow the access?
_________________
Follow @abyssws on Twitter
Subscribe to our newsletter
_________________
Forum Administrator
Aprelium - https://aprelium.com
Back to top View user's profile Send private message
fhutt
-


Joined: 14 Jul 2019
Posts: 31

PostPosted: Thu Aug 15, 2019 10:32 pm    Post subject: Reply with quote

Thank you.
I will have to work around it.
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group