-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove automagic timezone changing #32371
Conversation
c6aaba3
to
0ef1b17
Compare
Codestyle and unit tests need to be updated - can do if this is the way we want to go... @PVince81 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, see comments.
I wonder if we need a "default" choice or "auto" which would fall back to the old behavior.
@@ -58,7 +56,7 @@ | |||
<?php p($_['user_autofocus'] ? '' : 'autofocus'); ?> | |||
autocomplete="on" autocapitalize="off" autocorrect="off" required> | |||
<label for="password" class="infield"><?php p($l->t('Password')); ?></label> | |||
<input type="submit" id="submit" class="login primary icon-confirm" title="<?php p($l->t('Log in')); ?>" value="" disabled="disabled"/> | |||
<input type="submit" id="submit" class="login primary icon-confirm" title="<?php p($l->t('Log in')); ?>" value=""/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove the disabled property ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it was enabled when the timezone was set - so without removing this it is always disabled
settings/Application.php
Outdated
@@ -152,6 +153,15 @@ public function __construct(array $urlParams=[]) { | |||
$c->query('Config') | |||
); | |||
}); | |||
$container->registerService('SetTimezoneController', function (IContainer $c) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
call it just "TimezoneController maybe, who knows what future methods it will have like for example querying all supported timezones ?
namespace OC\Settings\Controller; | ||
|
||
use OC\AppFramework\Http; | ||
use \OCP\AppFramework\Controller; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove leading backslash for consistency ?
IConfig $config, | ||
IL10N $l, | ||
IUserSession $session) { | ||
parent::__construct($appName, $request); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting is weird, not really readable.
I think you should move the ) {
on the next line
public function set() { | ||
|
||
$available = \DateTimeZone::listIdentifiers(); | ||
if (!in_array($this->request->getParam('timezoneInput'), $available)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
always add true
in in_array
to make it strict (doesn't PHPStorm mention this?)
'core', | ||
'timezone', | ||
null)); | ||
$timezoneSelector->assign('timezones', \DateTimeZone::listIdentifiers()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is ok for now.
will not work for Phoenix, so we'll later need to add a get method on the TimezoneController
so Phoenix knows what values to use to populate. this is only to push my aadvice to rename SetTimezoneController
to TimezoneController
@@ -230,12 +230,25 @@ $(document).ready(function () { | |||
location.reload(); | |||
} | |||
else { | |||
$('#passworderror').text(data.data.message); | |||
OC.Notification.showTemporary(t('settings', 'Error saving language: {message}', { message: data.data.message })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error saving timezone, not language ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, this is language - see whole file. The language save error handler was piggy backing on the password error div for its error message 🙈 which gets worse, when I was testing with LDAP so there was no password change box.
} | ||
}); | ||
return false; | ||
}); | ||
|
||
$("#timezoneInput").change(function () { | ||
// Serialize the data | ||
var post = $("#timezoneInput").serialize(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohhhh, never saw this serialize method before
@pmaier1 FYI |
👍 Maybe you want to rename the default timezone simply to "Default" (instead of "Server default" which I find unnecessary technical :) ) |
Actually talked to @DeepDiver1975 and he pointed out the solution for timezone addition in shibboleth. So maybe we keep it, but allow manual setting of it? |
unless I finally understand the need to remove the auto-setting of timezone from the login page I prefer to keep it. We recently fixed it to solve some customer time zone issues. Having an manual select option is fine. |
0ef1b17
to
4059ab4
Compare
Codecov Report
@@ Coverage Diff @@
## master #32371 +/- ##
=============================================
- Coverage 64.01% 48.02% -15.99%
=============================================
Files 1176 109 -1067
Lines 70233 10394 -59839
Branches 1267 1267
=============================================
- Hits 44961 4992 -39969
+ Misses 24902 5032 -19870
Partials 370 370
Continue to review full report at Codecov.
|
Pushed to address comments. @pmaier1 to decide if we want only automagic, automagic+manual option, or only manual? I can update this PR accoridingly |
4059ab4
to
634fba6
Compare
Well, I agree a lot with #32165 (comment) and #32165 (comment) so I would tend to only go for the manual option. Still I want to respect @DeepDiver1975 in #32371 (comment). @DeepDiver1975 does the reasoning in the first two comments make sense to you or why would you want to keep automagic? Depending on @DeepDiver1975's answer I'd say we either:
Question for the compromise way: When users set the manual option, would that imply disabling automagic then? |
In this case, I would suggest an 'option' in the dropdown is 'auto'. If you select 'uk/london' you automatically unselect auto. |
Nice, I think that's the way to go 👌 |
Okay - so to open the can of worms completly:
This way the client will always get the time right - thinking about the traveling use case. The only reason why the user needs to specify the timezone in the server is for server side generated content - like emails. In this case one does not know the timezone of the client. ^ all this applies to language exactly the same way - with one additional feature: there is a http header Accept-Language which the client is sending to the server to tell the desired language. This was the server can generate content in the correct language. There is no Accept-TimeZone header ... just in case you are asking ;-) |
The server can do that still, right? If I'm not mistaken the only question to answer here is: Do I want to set a fixed timezone on the server or do I want it to dynamically change on login. Clients can then still convert it as they wish to. Not sure if I get all implications right.
I'm missing some examples to get a better understanding of the implications. |
Hmmm, is the web UI even affected by the timezone change ? I'm not sure. Maybe the setting could be called "Timezone to use in email communication" or something related to server-only things ? |
By this point, we are creating a mess for end users...... |
Closing this as this only affects users of custom user backends - and their specific implementations. |
Description
No automagic timezone set on login, which doesnt work when using SSO, in favour of selector in personal settings. Later, we could add the auto detection to flag up that you are in a different timezone, and maybe you want to change your settings to your current timezone.
Related Issue
Motivation and Context
Automagic timezone changing when you travel affects everything you see in ownCloud, including activity emails. If you don't 'login' then this wont happen, so it is unreliable. AND this only happens when using the login form, SSO does not use this.
How Has This Been Tested?
Screenshots (if appropriate):
Nothing set, default when you login:

When you have a timezone set, or preset by your admin (oc_preferences table, app=core, configkey=timezone)

Types of changes
Checklist:
Open tasks:
package.json
?SetTimezoneController