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
Timezone not set when user created through oidc-login #229
Comments
This has nothing to do with this plugin. You need to set the correct timezone on your server (e.g. php.ini). |
Hello pulsejet, This issue exist only with the activity sent to our user in the body of the email. the process who send activity's email try to get the timezone in the oc_preferences table. If user has no timezone configkey set so it consider time is set to UTC. and we lost 2 hours in the activity email notification because we are from 'Europe/Paris' The standard login form from nextcloud add this value in the table oc_preferences INSERT INTO oc_preferences (userid,appid,configkey,configvalue) VALUES ('---USERID---','core','timezone','Europe/Paris'); as described here : nextcloud/server#2560 So If we do not use the standard form from nextcloud but the plugin redirect login to keycloak form for example. The value will be never add in the table oc_preferences. For solve this issue, I was forced to add this trigger in the database : DELIMITER $$
CREATE TRIGGER addtimezone AFTER INSERT ON oc_ldap_user_mapping FOR EACH ROW
BEGIN
IF NOT EXISTS (SELECT 1 FROM oc_preferences WHERE userid = NEW.owncloud_name and configkey =‘timezone’) THEN
INSERT INTO oc_preferences VALUES (NEW.owncloud_name,‘core’,‘timezone’,‘Europe/Paris’);
END IF;
END $$
DELIMITER ; Delete my existing users from oc_accounts and oc_ldap_user_mapping, force a new sync users with command : sudo -u www-data php /var/www/html/nextcloud/occ user:list. Please, check if in your table oc_preference, all of your users who sync from an AD and who log in with keycloak had a configkey timezone set |
Hello, I have mitigate this in my environnment by adding this trigger in mariadb : USE NEXTCLOUD;
DELIMITER $$
CREATE TRIGGER addtimezone AFTER INSERT ON oc_accounts FOR EACH ROW
BEGIN
IF NOT EXISTS (SELECT 1 FROM oc_preferences WHERE userid = NEW.uid and configkey = 'timezone') THEN
INSERT INTO oc_preferences (userid,appid,configkey,configvalue) VALUES (NEW.uid,'core','timezone','Europe/Paris');
END IF;
END $$
DELIMITER ; Thanks @davtheultimate for your help. |
Hello,
I have a problem with the automatic creation of users via the Azure connection. When the user is created, the timezone entry in the oc_preferences table of the nextcloud database is not created.
The default timezone for the account is UTC.
When the user receives activity notifications by e-mail, the time of the event is out of sync with French time in my case.
To correct this bug, all you have to do is manually add the entry to the database using the commands below:
Would it be possible to correct this in code and add a modifiable parameter to the configuration?
For example: oidc_login_client_id_timezone
Thank by advance for your help.
Have a good day.
The text was updated successfully, but these errors were encountered: