summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/l10n/gl.js
diff options
context:
space:
mode:
authorNextcloud bot <bot@nextcloud.com>2023-06-28 00:31:00 +0000
committerNextcloud bot <bot@nextcloud.com>2023-06-28 00:31:00 +0000
commit2c9ef176f62ff93152437274788cb1574834e1d3 (patch)
tree47bd0077c0547714019968da3fecdc35c045f900 /apps/user_ldap/l10n/gl.js
parent13d9fb1ad700d0c913588251bf43ab9bd2e767ca (diff)
downloadnextcloud-server-2c9ef176f62ff93152437274788cb1574834e1d3.tar.gz
nextcloud-server-2c9ef176f62ff93152437274788cb1574834e1d3.zip
Fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
Diffstat (limited to 'apps/user_ldap/l10n/gl.js')
-rw-r--r--apps/user_ldap/l10n/gl.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/user_ldap/l10n/gl.js b/apps/user_ldap/l10n/gl.js
index 3747d2e5f92..32ca55b2bab 100644
--- a/apps/user_ldap/l10n/gl.js
+++ b/apps/user_ldap/l10n/gl.js
@@ -168,7 +168,7 @@ OC.L10N.register(
"Paging chunksize" : "Tamaño dos fragmentos paxinados",
"Chunksize used for paged LDAP searches that may return bulky results like user or group enumeration. (Setting it 0 disables paged LDAP searches in those situations.)" : "Tamaño dos fragmentos utilizados para as buscas LDAP paxinadas, que poden devolver resultados voluminosos como usuario ou enumeración de grupo. (Se se estabelece a 0, desactívanse as buscas LDAP paxinadas nesas situacións.)",
"Enable LDAP password changes per user" : "Activar os cambios no contrasinal LDAP polo usuario",
- "Allow LDAP users to change their password and allow Super Administrators and Group Administrators to change the password of their LDAP users. Only works when access control policies are configured accordingly on the LDAP server. As passwords are sent in plaintext to the LDAP server, transport encryption must be used and password hashing should be configured on the LDAP server." : "Permítelle aos usuarios LDAP cambiar o seu contrasinal e permite que os administradores e administradores de grupos, cambiar o contrasinal dos seus usuarios LDAP. Só funciona cando as directivas de control de acceso están configuradas conforme coas do servidor LDAP. Xa que os contrasinais son enviados en texto simple ao servidor, LDAP, debe empregarse o cifrado no transporte e o «hash» dos contrasinais debe ser configurado no servidor LDAP.",
+ "Allow LDAP users to change their password and allow Super Administrators and Group Administrators to change the password of their LDAP users. Only works when access control policies are configured accordingly on the LDAP server. As passwords are sent in plaintext to the LDAP server, transport encryption must be used and password hashing should be configured on the LDAP server." : "Permítelle aos usuarios LDAP cambiar o seu contrasinal e permite que os administradores e administradores de grupos, cambiar o contrasinal dos seus usuarios LDAP. Só funciona cando as directivas de control de acceso están configuradas conforme coas do servidor LDAP. Xa que os contrasinais son enviados en texto simple ao servidor, LDAP, debe empregarse o cifrado no transporte e o «resumo criptográfico dos contrasinais debe ser configurado no servidor LDAP.",
"(New password is sent as plain text to LDAP)" : "(O novo contrasinal envíase como un texto simple para LDAP)",
"Default password policy DN" : "DN da directiva de contrasinal predeterminado",
"The DN of a default password policy that will be used for password expiry handling. Works only when LDAP password changes per user are enabled and is only supported by OpenLDAP. Leave empty to disable password expiry handling." : "O DN dunha directiva de contrasinais predeterminados que será usado para o control da caducidade dos contrasinais. Só funciona cando está activado o cambio do contrasinal LDAP polos usuarios e só está aceptado por OpenLDAP. Déixea baleira para desactivar o control da caducidade dos contrasinais.",
al.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
<?php
/**
 * ownCloud
 *
 * @author Joas Schilling
 * @copyright 2014 Joas Schilling nickvergessen@owncloud.com
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */

namespace OC;


use OCP\IConfig;
use OCP\IDateTimeZone;
use OCP\ISession;

class DateTimeZone implements IDateTimeZone {
	/** @var IConfig */
	protected $config;

	/** @var ISession */
	protected $session;

	/**
	 * Constructor
	 *
	 * @param IConfig $config
	 * @param ISession $session
	 */
	public function __construct(IConfig $config, ISession $session) {
		$this->config = $config;
		$this->session = $session;
	}

	/**
	 * Get the timezone of the current user, based on his session information and config data
	 *
	 * @return \DateTimeZone
	 */
	public function getTimeZone() {
		$timeZone = $this->config->getUserValue($this->session->get('user_id'), 'core', 'timezone', null);
		if ($timeZone === null) {
			if ($this->session->exists('timezone')) {
				return $this->guessTimeZoneFromOffset($this->session->get('timezone'));
			}
			$timeZone = $this->getDefaultTimeZone();
		}

		try {
			return new \DateTimeZone($timeZone);
		} catch (\Exception $e) {
			\OCP\Util::writeLog('datetimezone', 'Failed to created DateTimeZone "' . $timeZone . "'", \OCP\Util::DEBUG);
			return new \DateTimeZone($this->getDefaultTimeZone());
		}
	}

	/**
	 * Guess the DateTimeZone for a given offset
	 *
	 * We first try to find a Etc/GMT* timezone, if that does not exist,
	 * we try to find it manually, before falling back to UTC.
	 *
	 * @param mixed $offset
	 * @return \DateTimeZone
	 */
	protected function guessTimeZoneFromOffset($offset) {
		try {
			// Note: the timeZone name is the inverse to the offset,
			// so a positive offset means negative timeZone
			// and the other way around.
			if ($offset > 0) {
				$timeZone = 'Etc/GMT-' . $offset;
			} else {
				$timeZone = 'Etc/GMT+' . abs($offset);
			}

			return new \DateTimeZone($timeZone);
		} catch (\Exception $e) {
			// If the offset has no Etc/GMT* timezone,
			// we try to guess one timezone that has the same offset
			foreach (\DateTimeZone::listIdentifiers() as $timeZone) {
				$dtz = new \DateTimeZone($timeZone);
				$dtOffset = $dtz->getOffset(new \DateTime());
				if ($dtOffset == 3600 * $offset) {
					return $dtz;
				}
			}

			// No timezone found, fallback to UTC
			\OCP\Util::writeLog('datetimezone', 'Failed to find DateTimeZone for offset "' . $offset . "'", \OCP\Util::DEBUG);
			return new \DateTimeZone($this->getDefaultTimeZone());
		}
	}

	/**
	 * Get the default timezone of the server
	 *
	 * Falls back to UTC if it is not yet set.
	 * 
	 * @return string
	 */
	protected function getDefaultTimeZone() {
		$serverTimeZone = date_default_timezone_get();
		return $serverTimeZone ?: 'UTC';
	}
}