View previous topic :: View next topic |
Author |
Message |
fhutt -
Joined: 14 Jul 2019 Posts: 43
|
Posted: Mon Aug 05, 2019 10:33 pm Post subject: How to determine login username or group name. |
|
|
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 |
|
|
admin Site Admin
Joined: 03 Mar 2002 Posts: 1296
|
Posted: Sun Aug 11, 2019 11:53 am Post subject: Re: How to determine login username or group name. |
|
|
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 |
|
|
fhutt -
Joined: 14 Jul 2019 Posts: 43
|
Posted: Sun Aug 11, 2019 1:09 pm Post subject: |
|
|
Thank you so much.
I will look into this further. |
|
Back to top |
|
|
fhutt -
Joined: 14 Jul 2019 Posts: 43
|
Posted: Mon Aug 12, 2019 1:15 am Post subject: |
|
|
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 |
|
|
fhutt -
Joined: 14 Jul 2019 Posts: 43
|
Posted: Mon Aug 12, 2019 8:15 am Post subject: |
|
|
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 |
|
|
fhutt -
Joined: 14 Jul 2019 Posts: 43
|
Posted: Wed Aug 14, 2019 11:52 pm Post subject: |
|
|
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 |
|
|
admin Site Admin
Joined: 03 Mar 2002 Posts: 1296
|
Posted: Thu Aug 15, 2019 5:57 pm Post subject: |
|
|
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 |
|
|
fhutt -
Joined: 14 Jul 2019 Posts: 43
|
Posted: Thu Aug 15, 2019 10:32 pm Post subject: |
|
|
Thank you.
I will have to work around it. |
|
Back to top |
|
|
|