Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37e18df8 authored by Ronak Patel's avatar Ronak Patel
Browse files

Merge branch 'dev/configfixes' into 'main'

Fixes for common services and (dark mode) input fields

See merge request !93
parents 148f3cc9 4eb4e958
Loading
Loading
Loading
Loading
Loading
+22 −16
Original line number Diff line number Diff line
@@ -48,10 +48,16 @@ class UserService {
		$this->defaults = $defaults;
		$this->l10nFactory = $l10nFactory;
		$this->LDAPConnectionService = $LDAPConnectionService;
		$commonServiceURL = $this->config->getSystemValue('common_services_url', '');

		if (!empty($commonServiceURL)) {
			$commonServiceURL = rtrim($commonServiceURL, '/') . '/';
		}

		$this->apiConfig = [
			'mainDomain' => $this->config->getSystemValue('main_domain', ''),
			'commonApiUrl' => rtrim($this->config->getSystemValue('common_services_url', ''), '/') . '/',
			'commonServiceToken' => $this->config->getSystemValue('common_service_token', ''),
			'commonServicesURL' => $commonServiceURL,
			'commonServicesToken' => $this->config->getSystemValue('common_services_token', ''),
			'aliasDomain' => $this->config->getSystemValue('alias_domain', ''),
			'commonApiVersion' => $this->config->getSystemValue('common_api_version', ''),
			'userCluserId' => $this->config->getSystemValue('user_cluser_id', ''),
@@ -315,13 +321,13 @@ class UserService {
	 * @return void
	 */
	public function createHMEAlias(string $username, string $resultmail): void {
		$commonApiUrl = $this->apiConfig['commonApiUrl'];
		$commonServicesURL = $this->apiConfig['commonServicesURL'];
		$aliasDomain = $this->apiConfig['aliasDomain'];
		$token = $this->apiConfig['commonServiceToken'];
		$token = $this->apiConfig['commonServicesToken'];
		$commonApiVersion = $this->apiConfig['commonApiVersion'];
		
		$endpoint = $commonApiVersion . '/aliases/hide-my-email/';
		$url = $commonApiUrl . $endpoint . $resultmail;
		$url = $commonServicesURL . $endpoint . $resultmail;
		$data = array(
			"domain" => $aliasDomain
		);
@@ -348,14 +354,14 @@ class UserService {
	 * @return mixed The result of the domain alias creation request, decoded from JSON.
	 */
	public function createNewDomainAlias(string $username, string $userEmail): mixed {
		$commonApiUrl = $this->apiConfig['commonApiUrl'];
		$commonServicesURL = $this->apiConfig['commonServicesURL'];
		$commonApiVersion = $this->config->getSystemValue('commonApiVersion', '');
		$domain = $this->apiConfig['mainDomain'];
		$token = $this->apiConfig['commonServiceToken'];
		$token = $this->apiConfig['commonServicesToken'];
		$commonApiVersion = $this->apiConfig['commonApiVersion'];

		$endpoint = $commonApiVersion . '/aliases/';
		$url = $commonApiUrl . $endpoint . $userEmail;
		$url = $commonServicesURL . $endpoint . $userEmail;

		$data = array(
			"alias" => $username,
@@ -395,16 +401,16 @@ class UserService {
	}

	public function isUsernameTaken(string $username) : bool {
		$commonApiUrl = $this->apiConfig['commonApiUrl'];
		$commonServicesURL = $this->apiConfig['commonServicesURL'];
		$commonApiVersion = $this->apiConfig['commonApiVersion'];

		if (!isset($commonApiUrl) || empty($commonApiUrl)) {
		if (!isset($commonServicesURL) || empty($commonServicesURL)) {
			return false;
		}
		$endpoint = $commonApiVersion . '/users/';
		$url = $commonApiUrl . $endpoint . $username;
		$url = $commonServicesURL . $endpoint . $username;

		$token = $this->apiConfig['commonServiceToken'];
		$token = $this->apiConfig['commonServicesToken'];
		$headers = [
			"Authorization: Bearer $token"
		];
@@ -424,20 +430,20 @@ class UserService {
	}

	public function addUsernameToCommonDataStore(string $username) : void {
		$commonApiUrl = $this->apiConfig['commonApiUrl'];
		$commonServicesURL = $this->apiConfig['commonServicesURL'];
		$commonApiVersion = $this->apiConfig['commonApiVersion'];

		if (!isset($commonApiUrl) || empty($commonApiUrl)) {
		if (!isset($commonServicesURL) || empty($commonServicesURL)) {
			return;
		}
		$endpoint = $commonApiVersion . '/users/';
		$url = $commonApiUrl . $endpoint ;
		$url = $commonServicesURL . $endpoint ;
		
		$params = [
			'username' => $username
		];

		$token = $this->apiConfig['commonServiceToken'];
		$token = $this->apiConfig['commonServicesToken'];
		$headers = [
			"Authorization: Bearer $token"
		];
+5 −2
Original line number Diff line number Diff line
@@ -27,9 +27,12 @@ html {
	margin: 0 auto;
}

.password-group #password {
	height: 58px !important;
#registrationForm .password-group #password {
	height: 62px;
	margin-left: 0;
	background-color: var(--input-background-color);
	color: var(--color-main-text);
	border: 1px solid #E6E8E9;
}

@media only screen and (max-width: 768px) {
+3 −3
Original line number Diff line number Diff line
@@ -165,10 +165,10 @@ export default {
	margin-top: 10px;
	margin-bottom: 10px;
}
#fields input {
	background-color: var(--color-secondary-element);
#captchaForm #fields input {
	background-color: var(--input-background-color);
	margin-bottom: 0;
	color: rgba(0, 0, 0, 0.8);
	color: var(--color-main-text);
	display: block;
	width: 100%;
	font-size: 16px;
+3 −3
Original line number Diff line number Diff line
@@ -159,10 +159,10 @@ export default {
	margin-bottom: 10px;
}

#fields input{
	background-color: var(--color-secondary-element);
#recoveryEmailForm #fields input{
	background-color: var(--input-background-color);
	margin-bottom: 0;
	color: rgba(0, 0, 0, 0.8);
	color: var(--color-main-text);
	display: block;
	width: 100%;
	font-size: 16px;
+7 −5
Original line number Diff line number Diff line
@@ -349,13 +349,15 @@ export default {
.fields input#username {
	width: 50%;
}
.fields input,
.fields input[type="password"] {
	background-color: var(--color-secondary-element);
.fields input{
	width: 100%;
}
#registrationForm .fields input,
#registrationForm .fields input[type="password"] {
	background-color: var(--input-background-color);
	margin-bottom: 0;
	color: rgba(0, 0, 0, 0.8);
	color: var(--color-main-text);
	display: block;
	width: 100%;
	font-size: 16px;
	line-height: 1.3em;
	transition: all 0.5s linear;