Skip to content

Commit

Permalink
always allow remembered login
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <[email protected]>
  • Loading branch information
ChristophWurst authored and rullzer committed Jan 11, 2017
1 parent 6f84eb8 commit 140555b
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 32 deletions.
1 change: 0 additions & 1 deletion apps/encryption/appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<user>user-encryption</user>
<admin>admin-encryption</admin>
</documentation>
<rememberlogin>false</rememberlogin>
<version>1.5.0</version>
<types>
<filesystem/>
Expand Down
1 change: 0 additions & 1 deletion apps/files_external/appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<documentation>
<admin>admin-external-storage</admin>
</documentation>
<rememberlogin>false</rememberlogin>
<version>1.2.0</version>
<types>
<filesystem/>
Expand Down
1 change: 0 additions & 1 deletion core/Controller/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ public function showLoginForm($user, $redirect_url, $remember_login) {
}

$parameters['alt_login'] = OC_App::getAlternativeLogIns();
$parameters['rememberLoginAllowed'] = OC_Util::rememberLoginAllowed();
$parameters['rememberLoginState'] = !empty($remember_login) ? $remember_login : 0;

if (!is_null($user) && $user !== '') {
Expand Down
2 changes: 0 additions & 2 deletions core/templates/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
<input type="submit" id="submit" class="login primary icon-confirm-white" title="" value="<?php p($l->t('Log in')); ?>" disabled="disabled" />

<div class="login-additional">
<?php if ($_['rememberLoginAllowed'] === true) : ?>
<div class="remember-login-container">
<?php if ($_['rememberLoginState'] === 0) { ?>
<input type="checkbox" name="remember_login" value="1" id="remember_login" class="checkbox checkbox--white">
Expand All @@ -77,7 +76,6 @@
<?php } ?>
<label for="remember_login"><?php p($l->t('Stay logged in')); ?></label>
</div>
<?php endif; ?>
</div>

<input type="hidden" name="timezone_offset" id="timezone_offset"/>
Expand Down
21 changes: 0 additions & 21 deletions lib/private/legacy/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -1001,27 +1001,6 @@ public static function checkAdminUser() {
}
}

/**
* Check if it is allowed to remember login.
*
* @note Every app can set 'rememberlogin' to 'false' to disable the remember login feature
*
* @return bool
*/
public static function rememberLoginAllowed() {

$apps = OC_App::getEnabledApps();

foreach ($apps as $app) {
$appInfo = OC_App::getAppInfo($app);
if (isset($appInfo['rememberlogin']) && $appInfo['rememberlogin'] === 'false') {
return false;
}

}
return true;
}

/**
* Check if the user is a subadmin, redirects to home if not
*
Expand Down
3 changes: 0 additions & 3 deletions tests/Core/Controller/LoginControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ public function testShowLoginFormWithErrorsInSession() {
'user_autofocus' => true,
'canResetPassword' => true,
'alt_login' => [],
'rememberLoginAllowed' => \OC_Util::rememberLoginAllowed(),
'rememberLoginState' => 0,
'resetPasswordLink' => null,
],
Expand Down Expand Up @@ -238,7 +237,6 @@ public function testShowLoginFormWithPasswordResetOption($canChangePassword,
'user_autofocus' => false,
'canResetPassword' => $expectedResult,
'alt_login' => [],
'rememberLoginAllowed' => \OC_Util::rememberLoginAllowed(),
'rememberLoginState' => 0,
'resetPasswordLink' => false,
],
Expand Down Expand Up @@ -277,7 +275,6 @@ public function testShowLoginFormForUserNamedNull() {
'user_autofocus' => false,
'canResetPassword' => false,
'alt_login' => [],
'rememberLoginAllowed' => \OC_Util::rememberLoginAllowed(),
'rememberLoginState' => 0,
'resetPasswordLink' => false,
],
Expand Down
1 change: 0 additions & 1 deletion tests/data/app/expected-info.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"user": "user-encryption",
"admin": "admin-encryption"
},
"rememberlogin": "false",
"types": ["filesystem"],
"ocsid": "166047",
"dependencies": {
Expand Down
1 change: 0 additions & 1 deletion tests/data/app/invalid-info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<user>user-encryption</user>
<admin>admin-encryption</admin>
</documentation>
<rememberlogin>false</rememberlogin>
<types>
<filesystem/>
</types>
Expand Down
1 change: 0 additions & 1 deletion tests/data/app/valid-info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<user>user-encryption</user>
<admin>admin-encryption</admin>
</documentation>
<rememberlogin>false</rememberlogin>
<types>
<filesystem/>
</types>
Expand Down

0 comments on commit 140555b

Please sign in to comment.