Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: chrome/browser/chromeos/login/existing_user_controller.cc

Issue 17546004: Added policy for disabling locally managed users. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge conflict resolved. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/policy/policy_templates.json ('k') | chrome/browser/chromeos/login/mock_user_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/existing_user_controller.cc
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc
index 505746bb46f2bdca1bcd576c46d83d701346384d..aa9b0eadf23caa0c3cbdfeb60747c2d743c55dc4 100644
--- a/chrome/browser/chromeos/login/existing_user_controller.cc
+++ b/chrome/browser/chromeos/login/existing_user_controller.cc
@@ -181,8 +181,13 @@ void ExistingUserController::UpdateLoginDisplay(const UserList& users) {
if (show_users_on_signin) {
for (UserList::const_iterator it = users.begin(); it != users.end(); ++it) {
// TODO(xiyuan): Clean user profile whose email is not in whitelist.
- if (LoginUtils::IsWhitelisted((*it)->email()) ||
- (*it)->GetType() != User::USER_TYPE_REGULAR) {
+ bool meets_locally_managed_requirements =
+ (*it)->GetType() != User::USER_TYPE_LOCALLY_MANAGED ||
+ UserManager::Get()->AreLocallyManagedUsersAllowed();
+ bool meets_whitelist_requirements =
+ LoginUtils::IsWhitelisted((*it)->email()) ||
+ (*it)->GetType() != User::USER_TYPE_REGULAR;
+ if (meets_locally_managed_requirements && meets_whitelist_requirements) {
filtered_users.push_back(*it);
}
}
@@ -438,6 +443,11 @@ void ExistingUserController::PerformLogin(
is_login_in_progress_ = true;
if (gaia::ExtractDomainName(user_context.username) ==
UserManager::kLocallyManagedUserDomain) {
+ if (!UserManager::Get()->AreLocallyManagedUsersAllowed()) {
+ LOG(ERROR) << "Login attempt of locally managed user detected.";
+ login_display_->SetUIEnabled(true);
+ return;
+ }
login_performer_->LoginAsLocallyManagedUser(
UserContext(user_context.username,
user_context.password,
« no previous file with comments | « chrome/app/policy/policy_templates.json ('k') | chrome/browser/chromeos/login/mock_user_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698