merged element 1.8.10

This commit is contained in:
Arnfried Griesert
2022-05-03 12:48:01 +02:00
1235 changed files with 50869 additions and 23132 deletions
@@ -90,6 +90,10 @@
*/
@property (nonatomic) MXIdentityService *identityService;
@property (nonatomic) AnalyticsScreenTracker *screenTracker;
@property (nonatomic) BOOL isViewVisible;
@end
@implementation MXKAuthenticationViewController
@@ -166,14 +170,14 @@
[self updateRESTClient];
// Localize labels
_homeServerLabel.text = [MatrixKitL10n loginHomeServerTitle];
_homeServerTextField.placeholder = [MatrixKitL10n loginServerUrlPlaceholder];
_homeServerInfoLabel.text = [MatrixKitL10n loginHomeServerInfo];
_identityServerLabel.text = [MatrixKitL10n loginIdentityServerTitle];
_identityServerTextField.placeholder = [MatrixKitL10n loginServerUrlPlaceholder];
_identityServerInfoLabel.text = [MatrixKitL10n loginIdentityServerInfo];
[_cancelAuthFallbackButton setTitle:[MatrixKitL10n cancel] forState:UIControlStateNormal];
[_cancelAuthFallbackButton setTitle:[MatrixKitL10n cancel] forState:UIControlStateHighlighted];
_homeServerLabel.text = [VectorL10n loginHomeServerTitle];
_homeServerTextField.placeholder = [VectorL10n loginServerUrlPlaceholder];
_homeServerInfoLabel.text = [VectorL10n loginHomeServerInfo];
_identityServerLabel.text = [VectorL10n loginIdentityServerTitle];
_identityServerTextField.placeholder = [VectorL10n loginServerUrlPlaceholder];
_identityServerInfoLabel.text = [VectorL10n loginIdentityServerInfo];
[_cancelAuthFallbackButton setTitle:[VectorL10n cancel] forState:UIControlStateNormal];
[_cancelAuthFallbackButton setTitle:[VectorL10n cancel] forState:UIControlStateHighlighted];
}
- (void)didReceiveMemoryWarning
@@ -187,6 +191,9 @@
[super viewWillAppear:animated];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onTextFieldChange:) name:UITextFieldTextDidChangeNotification object:nil];
self.isViewVisible = YES;
[self.screenTracker trackScreen];
}
- (void)viewWillDisappear:(BOOL)animated
@@ -206,6 +213,13 @@
[[NSNotificationCenter defaultCenter] removeObserver:self name:UITextFieldTextDidChangeNotification object:nil];
}
- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
self.isViewVisible = NO;
}
#pragma mark - Override MXKViewController
- (void)onKeyboardShowAnimationComplete
@@ -215,6 +229,8 @@
// and report the inputAccessoryView.superview of the firstResponder in self.keyboardView.
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
- (void)setKeyboardHeight:(CGFloat)keyboardHeight
{
// Deduce the bottom inset for the scroll view (Don't forget the potential tabBar)
@@ -229,6 +245,7 @@
insets.bottom = scrollViewInsetBottom;
self.authenticationScrollView.contentInset = insets;
}
#pragma clang diagnostic pop
- (void)destroy
{
@@ -302,25 +319,29 @@
if (authType == MXKAuthenticationTypeLogin)
{
_subTitleLabel.hidden = YES;
[_submitButton setTitle:[MatrixKitL10n login] forState:UIControlStateNormal];
[_submitButton setTitle:[MatrixKitL10n login] forState:UIControlStateHighlighted];
[_authSwitchButton setTitle:[MatrixKitL10n createAccount] forState:UIControlStateNormal];
[_authSwitchButton setTitle:[MatrixKitL10n createAccount] forState:UIControlStateHighlighted];
[_submitButton setTitle:[VectorL10n login] forState:UIControlStateNormal];
[_submitButton setTitle:[VectorL10n login] forState:UIControlStateHighlighted];
[_authSwitchButton setTitle:[VectorL10n createAccount] forState:UIControlStateNormal];
[_authSwitchButton setTitle:[VectorL10n createAccount] forState:UIControlStateHighlighted];
// Update supported authentication flow and associated information (defined in authentication session)
[self refreshAuthenticationSession];
self.screenTracker = [[AnalyticsScreenTracker alloc] initWithScreen:AnalyticsScreenLogin];
}
else if (authType == MXKAuthenticationTypeRegister)
{
_subTitleLabel.hidden = NO;
_subTitleLabel.text = [MatrixKitL10n loginCreateAccount];
[_submitButton setTitle:[MatrixKitL10n signUp] forState:UIControlStateNormal];
[_submitButton setTitle:[MatrixKitL10n signUp] forState:UIControlStateHighlighted];
[_authSwitchButton setTitle:[MatrixKitL10n back] forState:UIControlStateNormal];
[_authSwitchButton setTitle:[MatrixKitL10n back] forState:UIControlStateHighlighted];
_subTitleLabel.text = [VectorL10n loginCreateAccount];
[_submitButton setTitle:[VectorL10n signUp] forState:UIControlStateNormal];
[_submitButton setTitle:[VectorL10n signUp] forState:UIControlStateHighlighted];
[_authSwitchButton setTitle:[VectorL10n back] forState:UIControlStateNormal];
[_authSwitchButton setTitle:[VectorL10n back] forState:UIControlStateHighlighted];
// Update supported authentication flow and associated information (defined in authentication session)
[self refreshAuthenticationSession];
self.screenTracker = [[AnalyticsScreenTracker alloc] initWithScreen:AnalyticsScreenRegister];
}
else if (authType == MXKAuthenticationTypeForgotPassword)
{
@@ -328,21 +349,28 @@
if (isPasswordReseted)
{
[_submitButton setTitle:[MatrixKitL10n back] forState:UIControlStateNormal];
[_submitButton setTitle:[MatrixKitL10n back] forState:UIControlStateHighlighted];
[_submitButton setTitle:[VectorL10n back] forState:UIControlStateNormal];
[_submitButton setTitle:[VectorL10n back] forState:UIControlStateHighlighted];
}
else
{
[_submitButton setTitle:[MatrixKitL10n submit] forState:UIControlStateNormal];
[_submitButton setTitle:[MatrixKitL10n submit] forState:UIControlStateHighlighted];
[_submitButton setTitle:[VectorL10n submit] forState:UIControlStateNormal];
[_submitButton setTitle:[VectorL10n submit] forState:UIControlStateHighlighted];
[self refreshForgotPasswordSession];
}
[_authSwitchButton setTitle:[MatrixKitL10n back] forState:UIControlStateNormal];
[_authSwitchButton setTitle:[MatrixKitL10n back] forState:UIControlStateHighlighted];
[_authSwitchButton setTitle:[VectorL10n back] forState:UIControlStateNormal];
[_authSwitchButton setTitle:[VectorL10n back] forState:UIControlStateHighlighted];
self.screenTracker = [[AnalyticsScreenTracker alloc] initWithScreen:AnalyticsScreenForgotPassword];
}
if (self.isViewVisible)
{
[self.screenTracker trackScreen];
}
[self checkIdentityServer];
}
@@ -758,7 +786,7 @@
}
else
{
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[MatrixKitL10n notSupportedYet]}]];
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[VectorL10n notSupportedYet]}]];
_externalRegistrationParameters = nil;
@@ -783,23 +811,23 @@
// Notify user that no flow is supported
if (_authType == MXKAuthenticationTypeLogin)
{
_noFlowLabel.text = [MatrixKitL10n loginErrorDoNotSupportLoginFlows];
_noFlowLabel.text = [VectorL10n loginErrorDoNotSupportLoginFlows];
}
else
{
_noFlowLabel.text = [MatrixKitL10n loginErrorRegistrationIsNotSupported];
_noFlowLabel.text = [VectorL10n loginErrorRegistrationIsNotSupported];
}
MXLogDebug(@"[MXKAuthenticationVC] Warning: %@", _noFlowLabel.text);
if (authenticationFallback.length)
{
[_retryButton setTitle:[MatrixKitL10n loginUseFallback] forState:UIControlStateNormal];
[_retryButton setTitle:[MatrixKitL10n loginUseFallback] forState:UIControlStateNormal];
[_retryButton setTitle:[VectorL10n loginUseFallback] forState:UIControlStateNormal];
[_retryButton setTitle:[VectorL10n loginUseFallback] forState:UIControlStateNormal];
}
else
{
[_retryButton setTitle:[MatrixKitL10n retry] forState:UIControlStateNormal];
[_retryButton setTitle:[MatrixKitL10n retry] forState:UIControlStateNormal];
[_retryButton setTitle:[VectorL10n retry] forState:UIControlStateNormal];
[_retryButton setTitle:[VectorL10n retry] forState:UIControlStateNormal];
}
_noFlowLabel.hidden = NO;
@@ -988,7 +1016,10 @@
{
// Trigger here a register request in order to associate the filled userId and password to the current session id
// This will check the availability of the userId at the same time
NSDictionary *parameters = @{@"auth": @{},
NSDictionary *parameters = @{@"auth": @{
@"session": self.authInputsView.authSession.session,
@"type": kMXLoginFlowTypeDummy
},
@"username": self.authInputsView.userId,
@"password": self.authInputsView.password,
@"bind_email": @(NO),
@@ -1007,7 +1038,7 @@
// Sanity check
if (!credentials.userId || !credentials.accessToken)
{
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[MatrixKitL10n notSupportedYet]}]];
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[VectorL10n notSupportedYet]}]];
}
else
{
@@ -1068,7 +1099,7 @@
if (isUserNameInUse)
{
MXLogDebug(@"[MXKAuthenticationVC] User name is already use");
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[MatrixKitL10n authUsernameInUse]}]];
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[VectorL10n authUsernameInUse]}]];
}
else
{
@@ -1115,7 +1146,7 @@
else
{
MXLogDebug(@"[MXKAuthenticationVC] User name is missing");
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[MatrixKitL10n authInvalidUserName]}]];
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[VectorL10n authInvalidUserName]}]];
}
}
else if (_authType == MXKAuthenticationTypeForgotPassword)
@@ -1230,15 +1261,15 @@
{
if (self.authType == MXKAuthenticationTypeLogin)
{
title = [MatrixKitL10n loginErrorTitle];
title = [VectorL10n loginErrorTitle];
}
else if (self.authType == MXKAuthenticationTypeRegister)
{
title = [MatrixKitL10n registerErrorTitle];
title = [VectorL10n registerErrorTitle];
}
else
{
title = [MatrixKitL10n error];
title = [VectorL10n error];
}
}
NSString* message = error.localizedDescription;
@@ -1259,31 +1290,31 @@
{
if ([errCode isEqualToString:kMXErrCodeStringForbidden])
{
message = [MatrixKitL10n loginErrorForbidden];
message = [VectorL10n loginErrorForbidden];
}
else if ([errCode isEqualToString:kMXErrCodeStringUnknownToken])
{
message = [MatrixKitL10n loginErrorUnknownToken];
message = [VectorL10n loginErrorUnknownToken];
}
else if ([errCode isEqualToString:kMXErrCodeStringBadJSON])
{
message = [MatrixKitL10n loginErrorBadJson];
message = [VectorL10n loginErrorBadJson];
}
else if ([errCode isEqualToString:kMXErrCodeStringNotJSON])
{
message = [MatrixKitL10n loginErrorNotJson];
message = [VectorL10n loginErrorNotJson];
}
else if ([errCode isEqualToString:kMXErrCodeStringLimitExceeded])
{
message = [MatrixKitL10n loginErrorLimitExceeded];
message = [VectorL10n loginErrorLimitExceeded];
}
else if ([errCode isEqualToString:kMXErrCodeStringUserInUse])
{
message = [MatrixKitL10n loginErrorUserInUse];
message = [VectorL10n loginErrorUserInUse];
}
else if ([errCode isEqualToString:kMXErrCodeStringLoginEmailURLNotYet])
{
message = [MatrixKitL10n loginErrorLoginEmailNotYet];
message = [VectorL10n loginErrorLoginEmailNotYet];
}
else if ([errCode isEqualToString:kMXErrCodeStringResourceLimitExceeded])
{
@@ -1305,7 +1336,7 @@
alert = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
@@ -1348,20 +1379,20 @@
adminContact = [NSURL URLWithString:adminContactString];
}
NSString *title = [MatrixKitL10n loginErrorResourceLimitExceededTitle];
NSString *title = [VectorL10n loginErrorResourceLimitExceededTitle];
// Build the message content
NSMutableString *message = [NSMutableString new];
if ([limitType isEqualToString:kMXErrorResourceLimitExceededLimitTypeMonthlyActiveUserValue])
{
[message appendString:[MatrixKitL10n loginErrorResourceLimitExceededMessageMonthlyActiveUser]];
[message appendString:[VectorL10n loginErrorResourceLimitExceededMessageMonthlyActiveUser]];
}
else
{
[message appendString:[MatrixKitL10n loginErrorResourceLimitExceededMessageDefault]];
[message appendString:[VectorL10n loginErrorResourceLimitExceededMessageDefault]];
}
[message appendString:[MatrixKitL10n loginErrorResourceLimitExceededMessageContact]];
[message appendString:[VectorL10n loginErrorResourceLimitExceededMessageContact]];
// Build the alert
alert = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
@@ -1369,7 +1400,7 @@
MXWeakify(self);
if (adminContact && onAdminContactTapped)
{
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n loginErrorResourceLimitExceededContactButton]
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n loginErrorResourceLimitExceededContactButton]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
@@ -1382,7 +1413,7 @@
}]];
}
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
@@ -1424,9 +1455,9 @@
[alert dismissViewControllerAnimated:NO completion:nil];
}
alert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n loginErrorAlreadyLoggedIn] message:nil preferredStyle:UIAlertControllerStyleAlert];
alert = [UIAlertController alertControllerWithTitle:[VectorL10n loginErrorAlreadyLoggedIn] message:nil preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
@@ -1545,9 +1576,9 @@
}
#if TARGET_OS_IPHONE
NSString *deviceName = [[UIDevice currentDevice].model isEqualToString:@"iPad"] ? [MatrixKitL10n loginTabletDevice] : [MatrixKitL10n loginMobileDevice];
NSString *deviceName = [[UIDevice currentDevice].model isEqualToString:@"iPad"] ? [VectorL10n loginTabletDevice] : [VectorL10n loginMobileDevice];
#elif TARGET_OS_OSX
NSString *deviceName = [MatrixKitL10n loginDesktopDevice];
NSString *deviceName = [VectorL10n loginDesktopDevice];
#endif
return deviceName;
@@ -1592,7 +1623,7 @@
// Remove the potential auth inputs view
self.authInputsView = nil;
_noFlowLabel.text = [MatrixKitL10n loginErrorForgotPasswordIsNotSupported];
_noFlowLabel.text = [VectorL10n loginErrorForgotPasswordIsNotSupported];
MXLogDebug(@"[MXKAuthenticationVC] Warning: %@", _noFlowLabel.text);
@@ -1621,12 +1652,12 @@
__block BOOL isTrusted;
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
NSString *title = [MatrixKitL10n sslCouldNotVerify];
NSString *homeserverURLStr = [MatrixKitL10n sslHomeserverUrl:homeserverURL];
NSString *fingerprint = [MatrixKitL10n sslFingerprintHash:@"SHA256"];
NSString *title = [VectorL10n sslCouldNotVerify];
NSString *homeserverURLStr = [VectorL10n sslHomeserverUrl:homeserverURL];
NSString *fingerprint = [VectorL10n sslFingerprintHash:@"SHA256"];
NSString *certFingerprint = [certificate mx_SHA256AsHexString];
NSString *msg = [NSString stringWithFormat:@"%@\n\n%@\n\n%@\n\n%@\n\n%@\n\n%@", [MatrixKitL10n sslCertNotTrust], [MatrixKitL10n sslCertNewAccountExpl], homeserverURLStr, fingerprint, certFingerprint, [MatrixKitL10n sslOnlyAccept]];
NSString *msg = [NSString stringWithFormat:@"%@\n\n%@\n\n%@\n\n%@\n\n%@\n\n%@", [VectorL10n sslCertNotTrust], [VectorL10n sslCertNewAccountExpl], homeserverURLStr, fingerprint, certFingerprint, [VectorL10n sslOnlyAccept]];
if (self->alert)
{
@@ -1635,7 +1666,7 @@
self->alert = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
[self->alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
[self->alert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
@@ -1645,7 +1676,7 @@
}]];
[self->alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n sslTrust]
[self->alert addAction:[UIAlertAction actionWithTitle:[VectorL10n sslTrust]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
@@ -1704,7 +1735,7 @@
// Sanity check
if (!credentials.userId || !credentials.accessToken)
{
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[MatrixKitL10n notSupportedYet]}]];
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[VectorL10n notSupportedYet]}]];
}
else
{
@@ -1746,7 +1777,7 @@
// Sanity check
if (!credentials.userId || !credentials.accessToken)
{
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[MatrixKitL10n notSupportedYet]}]];
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[VectorL10n notSupportedYet]}]];
}
else
{
@@ -1812,7 +1843,7 @@
return;
}
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[MatrixKitL10n notSupportedYet]}]];
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[VectorL10n notSupportedYet]}]];
}
else
{
@@ -1863,9 +1894,9 @@
[self->alert dismissViewControllerAnimated:NO completion:nil];
}
self->alert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n error] message:[MatrixKitL10n authResetPasswordErrorUnauthorized] preferredStyle:UIAlertControllerStyleAlert];
self->alert = [UIAlertController alertControllerWithTitle:[VectorL10n error] message:[VectorL10n authResetPasswordErrorUnauthorized] preferredStyle:UIAlertControllerStyleAlert];
[self->alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
[self->alert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
@@ -1889,7 +1920,7 @@
{
userInfo = [NSMutableDictionary dictionary];
}
userInfo[NSLocalizedDescriptionKey] = [MatrixKitL10n authResetPasswordErrorNotFound];
userInfo[NSLocalizedDescriptionKey] = [VectorL10n authResetPasswordErrorNotFound];
[self onFailureDuringAuthRequest:[NSError errorWithDomain:kMXNSErrorDomain code:0 userInfo:userInfo]];
}
@@ -1923,7 +1954,7 @@
NSString *title = [error.userInfo valueForKey:NSLocalizedFailureReasonErrorKey];
if (!title)
{
title = [MatrixKitL10n error];
title = [VectorL10n error];
}
NSString *msg = [error.userInfo valueForKey:NSLocalizedDescriptionKey];
@@ -1934,7 +1965,7 @@
alert = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n dismiss]
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n dismiss]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
@@ -1980,10 +2011,10 @@
_noFlowLabel.text = [error.userInfo valueForKey:NSLocalizedDescriptionKey];
if (!_noFlowLabel.text.length)
{
_noFlowLabel.text = [MatrixKitL10n loginErrorNoLoginFlow];
_noFlowLabel.text = [VectorL10n loginErrorNoLoginFlow];
}
[_retryButton setTitle:[MatrixKitL10n retry] forState:UIControlStateNormal];
[_retryButton setTitle:[MatrixKitL10n retry] forState:UIControlStateNormal];
[_retryButton setTitle:[VectorL10n retry] forState:UIControlStateNormal];
[_retryButton setTitle:[VectorL10n retry] forState:UIControlStateNormal];
_retryButton.hidden = NO;
}
}
@@ -2001,7 +2032,7 @@
}
else if (status == AFNetworkReachabilityStatusNotReachable)
{
_noFlowLabel.text = [MatrixKitL10n networkErrorNotReachable];
_noFlowLabel.text = [VectorL10n networkErrorNotReachable];
}
}
@@ -2114,7 +2145,7 @@
{
if (!cancelFallbackBarButton)
{
cancelFallbackBarButton = [[UIBarButtonItem alloc] initWithTitle:[MatrixKitL10n loginLeaveFallback] style:UIBarButtonItemStylePlain target:self action:@selector(hideRegistrationFallbackView)];
cancelFallbackBarButton = [[UIBarButtonItem alloc] initWithTitle:[VectorL10n loginLeaveFallback] style:UIBarButtonItemStylePlain target:self action:@selector(hideRegistrationFallbackView)];
}
// Add cancel button in right bar items