mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-09-20 12:48:32 +00:00
@@ -72,6 +72,11 @@
|
||||
|
||||
/* accessors */
|
||||
|
||||
- (NSString *) modulePath
|
||||
{
|
||||
return @"";
|
||||
}
|
||||
|
||||
//- (NSString *) connectURL
|
||||
//{
|
||||
// return [NSString stringWithFormat: @"%@/connect", [self applicationPath]];
|
||||
@@ -525,6 +530,11 @@
|
||||
return item;
|
||||
}
|
||||
|
||||
- (NSString *) language
|
||||
{
|
||||
return [[context resourceLookupLanguages] objectAtIndex: 0];
|
||||
}
|
||||
|
||||
- (NSArray *) languages
|
||||
{
|
||||
return [[SOGoSystemDefaults sharedSystemDefaults] supportedLanguages];
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
>
|
||||
<script type="text/javascript">
|
||||
var cookieUsername = '<var:string var:value="cookieUsername" const:escapeHTML="NO"/>';
|
||||
var language = '<var:string var:value="language" const:escapeHTML="NO"/>';
|
||||
</script>
|
||||
|
||||
<!--
|
||||
@@ -56,7 +57,7 @@
|
||||
<md-icon>language</md-icon>
|
||||
<md-input-container class="md-flex">
|
||||
<label><var:string label:value="choose"/></label>
|
||||
<md-select ng-model="app.creds.language">
|
||||
<md-select ng-model="app.creds.language" ng-change="app.changeLanguage($event)">
|
||||
<var:foreach list="languages" item="item">
|
||||
<md-option var:value="item">
|
||||
<var:string value="languageText"/>
|
||||
|
||||
@@ -13,20 +13,21 @@
|
||||
function LoginController($scope, $window, $timeout, Dialog, $mdDialog, Authentication) {
|
||||
var vm = this;
|
||||
|
||||
vm.creds = {
|
||||
username: $window.cookieUsername,
|
||||
password: null,
|
||||
rememberLogin: angular.isDefined($window.cookieUsername) && $window.cookieUsername.length > 0
|
||||
this.$onInit = function() {
|
||||
this.creds = {
|
||||
username: $window.cookieUsername,
|
||||
password: null,
|
||||
language: $window.language,
|
||||
rememberLogin: angular.isDefined($window.cookieUsername) && $window.cookieUsername.length > 0
|
||||
};
|
||||
this.loginState = false;
|
||||
|
||||
// Show login once everything is initialized
|
||||
this.showLogin = false;
|
||||
$timeout(function() { vm.showLogin = true; }, 100);
|
||||
};
|
||||
vm.login = login;
|
||||
vm.loginState = false;
|
||||
vm.showAbout = showAbout;
|
||||
|
||||
// Show login once everything is initialized
|
||||
vm.showLogin = false;
|
||||
$timeout(function() { vm.showLogin = true; }, 100);
|
||||
|
||||
function login() {
|
||||
this.login = function() {
|
||||
vm.loginState = 'authenticating';
|
||||
Authentication.login(vm.creds)
|
||||
.then(function(data) {
|
||||
@@ -45,9 +46,9 @@
|
||||
vm.errorMessage = msg.error;
|
||||
});
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
function showAbout($event) {
|
||||
this.showAbout = function($event) {
|
||||
$mdDialog.show({
|
||||
targetEvent: $event,
|
||||
templateUrl: 'aboutBox.html',
|
||||
@@ -60,7 +61,12 @@
|
||||
$mdDialog.hide();
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.changeLanguage = function($event) {
|
||||
// Reload page
|
||||
$window.location.href = ApplicationBaseURL + 'login?language=' + this.creds.language;
|
||||
};
|
||||
}
|
||||
|
||||
angular
|
||||
|
||||
Reference in New Issue
Block a user