Thanks for your answer Clemens,
My problem is : I cannot control what the final user can do with its
Firefox
So I would like to solve the problem directly with web2py
Because
1) I'm in native language : it works perfectly. User is Utilisateur in
French
2) I put English, german etc ... on a french Firefox installation :
Utilisateur become sUser but when i'm login into my application : it does
not work
3° I choose French : it's works again
So Firefox change is correct on my side
but queries of lastUserLoggued are not ...
Maybe i make something wrong in
lastUserLogged = db(db.auth_event.description.contains('connect'
)).select(orderby=~db.auth_event.time_stamp,limitby=(0, 1)).first().user_id
or
lastUserName = db(db.auth_user.id ==
lastUserLogged).select(db.auth_user.username).first().username
Regards
Nicolas
Le jeudi 10 septembre 2020 à 10:59:51 UTC+2, Clemens a écrit :
> From
> https://blog.mozilla.org/l10n/2019/04/02/changing-the-language-of-firefox-directly-from-the-browser/
>
>
>
> *Language SettingsIn Firefox there are two main user facing settings
> related to languages:*
>
> - *Web content: when you visit a web page, the browser will
> communicate to the server which languages you’d like to see content in.
> Technically, this is done by sending an Accept-Language HTTP header, which
> contains a list of locale codes in the user’s preferred order.*
> - *User interface: the language in which you want to see the browser
> (menus, preferences, etc.).*
>
> *The difference between the two is not as intuitive as it might seem. A
> lot of users change the web content settings, and expect the user interface
> to change.*
>
> There you can see how to handle this. Hope, it helps!
>
>
> On Thursday, September 10, 2020 at 10:37:40 AM UTC+2 [email protected]
> wrote:
>
>> Hello All,
>>
>> I will try to present my problem simply :
>> I have a web2py application with a very simply homepage user.html
>>
>> User and Password labels & Login Button are automatically translatedby
>> Firefox
>> in Firefox the detected langage
>>
>> If a user enter login / password
>> I check user permissions and I show HTML page according to its
>> permissions
>> by using some code already test as :
>>
>> lastUserLogged = db(db.auth_event.description.contains('connect'
>> )).select(orderby=~db.auth_event.time_stamp,limitby=(0, 1
>> )).first().user_id
>>
>> and
>>
>> lastUserName = db(db.auth_user.id ==
>> lastUserLogged).select(db.auth_user.username).first().username
>>
>>
>> In a native Firefox langage it's OK
>> But if I download new langage for Firefox restarts firefox and retry
>> all the permissions are allowed even if the user is not allowed to see
>> HTML pages
>>
>> Why ??
>> I don't know but if you can help me I appreciate ... sincerly
>>
>>
>> The HTML Page for the user.html
>>
>>
>> <body>
>> <style type="text/css">
>> body {
>> overflow:hidden;
>> }
>> #fond {
>> position:absolute;
>> top:0;
>> left:0;
>> }
>> #web2py_user_form {
>> position:absolute;
>> top:50px;
>> left:50px;
>> }
>> #auth_user_username__label{color:white;}
>> #auth_user_password__label{color:white;}
>> #auth_user_first_name__label{color:white;}
>> #auth_user_last_name__label{color:white;}
>> #auth_user_email__label{color:white;}
>> #auth_user_password_two__row{color:white;}
>>
>> #fond,#fond img {
>> width:100%;
>> height:100%;
>> }
>> </style>
>> <div id="fond">
>> <img src='/me/static/theme/images/WALLPAPERS/wallpaper.jpg' alt="fond" />
>> </div>
>> <div id="web2py_user_form">
>> {{
>> =form
>> }}
>> </div>
>>
>> <script language="javascript"><!--
>> jQuery("#web2py_user_form input:visible:enabled:first").focus();
>> {{if request.args(0)=='register':}}
>> web2py_validate_entropy(jQuery('#auth_user_password'),100);
>> {{elif request.args(0) in ('change_password','reset_password'):}}
>> web2py_validate_entropy(jQuery('#no_table_new_password'),100);
>> {{pass}}
>> //--></script>
>>
>> </body>
>>
>>
>>
>>
>>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/f7533a12-9d4f-4d5d-9bcb-b186155281e9n%40googlegroups.com.