Skip to content

Commit 22a8846

Browse files
committed
Clean code
1 parent 13f10f3 commit 22a8846

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Owncloud iOs Client/Login/Login/LoginViewController.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ - (void)viewWillAppear:(BOOL)animated {
130130
((CheckAccessToServer *)[CheckAccessToServer sharedManager]).delegate = self;
131131

132132

133-
if (self.urlTextField.text.length > 0 && (isConnectionToServer == NO) && !self.alreadyHaveValidSAMLCredentials) {
133+
if (self.urlTextField.text.length > 0 && (!isConnectionToServer) && !self.alreadyHaveValidSAMLCredentials) {
134134
DLog(@"_login view appear and no connection to server and no valid SAML credentials auto recheck server manually_");
135135
[self checkUrlManually];
136136
}
@@ -1631,7 +1631,7 @@ - (void)textFieldDidEndEditing:(UITextField *)textField {
16311631
[refreshTestServerButton setHidden:NO];
16321632
}
16331633

1634-
if ((self.urlTextField.text.length > 0 && self.passwordTextField.text.length > 0 && self.passwordTextField.text.length > 0 && isConnectionToServer==YES && hasInvalidAuth == NO) || (isConnectionToServer && (k_is_oauth_active || k_is_sso_active))) {
1634+
if ((self.urlTextField.text.length > 0 && self.passwordTextField.text.length > 0 && self.passwordTextField.text.length > 0 && isConnectionToServer && !hasInvalidAuth) || (isConnectionToServer && (k_is_oauth_active || k_is_sso_active))) {
16351635
//[loginButton setEnabled:YES];
16361636
isLoginButtonEnabled = YES;
16371637
[self.tableView reloadData];
@@ -1800,7 +1800,7 @@ -(void)updateInterfaceWithConnectionToTheServer:(BOOL)isConnection{
18001800
dispatch_async(dispatch_get_main_queue(), ^{
18011801
if(isConnection) {
18021802
isConnectionToServer = YES;
1803-
if (self.urlTextField.text.length > 0 && self.usernameTextField.text.length > 0 && self.passwordTextField.text.length > 0 && hasInvalidAuth == NO) {
1803+
if (self.urlTextField.text.length > 0 && self.usernameTextField.text.length > 0 && self.passwordTextField.text.length > 0 && !hasInvalidAuth) {
18041804
//[loginButton setEnabled:YES];
18051805
isLoginButtonEnabled = YES;
18061806
}
@@ -1989,7 +1989,7 @@ - (void) checkIfServerAutentificationIsNormalFromURL {
19891989

19901990
BOOL isInvalid = NO;
19911991

1992-
if (k_is_sso_active == NO) {
1992+
if (!k_is_sso_active) {
19931993
//Get header related with autentication type
19941994
NSString *autenticationType = [[response allHeaderFields] valueForKey:@"Www-Authenticate"];
19951995

@@ -1999,7 +1999,7 @@ - (void) checkIfServerAutentificationIsNormalFromURL {
19991999
isInvalid = NO;
20002000
} else if ([autenticationType hasPrefix:@"Bearer"]) {
20012001
//Autentication type oauth
2002-
if (k_is_oauth_active == YES) {
2002+
if (k_is_oauth_active) {
20032003
//Check if is activate oauth
20042004
isInvalid = NO;
20052005
} else {

0 commit comments

Comments
 (0)