gdm: Make the smartcard and service status fields private

We don't need to export these publicly any more.
This commit is contained in:
Jasper St. Pierre 2014-03-07 19:16:24 -05:00
parent fb824131ae
commit 67fe376564
2 changed files with 17 additions and 25 deletions

View File

@ -44,8 +44,6 @@ const AuthPrompt = new Lang.Class({
this._userVerifier.connect('show-message', Lang.bind(this, this._onShowMessage)); this._userVerifier.connect('show-message', Lang.bind(this, this._onShowMessage));
this._userVerifier.connect('verification-failed', Lang.bind(this, this._onVerificationFailed)); this._userVerifier.connect('verification-failed', Lang.bind(this, this._onVerificationFailed));
this._userVerifier.connect('reset', Lang.bind(this, this._onReset)); this._userVerifier.connect('reset', Lang.bind(this, this._onReset));
this._userVerifier.connect('smartcard-status-changed', Lang.bind(this, this._onSmartcardStatusChanged));
this.smartcardDetected = this._userVerifier.smartcardDetected;
this.connect('next', Lang.bind(this, function() { this.connect('next', Lang.bind(this, function() {
this.updateSensitivity(false); this.updateSensitivity(false);
@ -218,10 +216,6 @@ const AuthPrompt = new Lang.Class({
this.emit('prompted'); this.emit('prompted');
}, },
_onSmartcardStatusChanged: function() {
this.smartcardDetected = this._userVerifier.smartcardDetected;
},
_onShowMessage: function(userVerifier, message, type) { _onShowMessage: function(userVerifier, message, type) {
this.setMessage(message, type); this.setMessage(message, type);
this.emit('prompted'); this.emit('prompted');

View File

@ -181,9 +181,9 @@ const ShellUserVerifier = new Lang.Class({
// The user is constant at the unlock screen, so it will immediately // The user is constant at the unlock screen, so it will immediately
// respond to the request with the username // respond to the request with the username
needsUsername = true; needsUsername = true;
} else if (this.serviceIsForeground(GdmUtil.OVIRT_SERVICE_NAME) || } else if (this._serviceIsForeground(GdmUtil.OVIRT_SERVICE_NAME) ||
(this.smartcardDetected && (this._smartcardDetected &&
this.serviceIsForeground(GdmUtil.SMARTCARD_SERVICE_NAME))) { this._serviceIsForeground(GdmUtil.SMARTCARD_SERVICE_NAME))) {
// We don't need to know the username if the user preempted the login screen // We don't need to know the username if the user preempted the login screen
// with a smartcard or with preauthenticated oVirt credentials // with a smartcard or with preauthenticated oVirt credentials
needsUsername = false; needsUsername = false;
@ -340,10 +340,10 @@ const ShellUserVerifier = new Lang.Class({
else else
smartcardDetected = this._smartcardManager.hasInsertedTokens(); smartcardDetected = this._smartcardManager.hasInsertedTokens();
if (this.smartcardDetected == smartcardDetected) if (this._smartcardDetected == smartcardDetected)
return; return;
this.smartcardDetected = smartcardDetected; this._smartcardDetected = smartcardDetected;
// Most of the time we want to reset if the user inserts or removes // Most of the time we want to reset if the user inserts or removes
// a smartcard. Smartcard insertion "preempts" what the user was // a smartcard. Smartcard insertion "preempts" what the user was
@ -354,13 +354,11 @@ const ShellUserVerifier = new Lang.Class({
// the user is getting logged in. // the user is getting logged in.
if (this._serviceIsDefault(SMARTCARD_SERVICE_NAME) && if (this._serviceIsDefault(SMARTCARD_SERVICE_NAME) &&
this.verificationStatus == VerificationStatus.VERIFYING && this.verificationStatus == VerificationStatus.VERIFYING &&
this.smartcardDetected) this._smartcardDetected)
return; return;
if (this.verificationStatus != VerificationStatus.VERIFICATION_SUCCEEDED) if (this.verificationStatus != VerificationStatus.VERIFICATION_SUCCEEDED)
this._reset(); this._reset();
this.emit('smartcard-status-changed');
}, },
_reportInitError: function(where, error) { _reportInitError: function(where, error) {
@ -419,24 +417,24 @@ const ShellUserVerifier = new Lang.Class({
_getForegroundService: function() { _getForegroundService: function() {
if (this._oVirtCredentialsManager.hasToken()) if (this._oVirtCredentialsManager.hasToken())
return OVIRT_SERVICE_NAME; return OVIRT_SERVICE_NAME;
if (this.smartcardDetected) if (this._smartcardDetected)
return SMARTCARD_SERVICE_NAME; return SMARTCARD_SERVICE_NAME;
return this._defaultService; return this._defaultService;
}, },
serviceIsForeground: function(serviceName) { _serviceIsForeground: function(serviceName) {
return serviceName == this._getForegroundService(); return serviceName == this._getForegroundService();
}, },
serviceIsDefault: function(serviceName) { _serviceIsDefault: function(serviceName) {
return serviceName == this._defaultService; return serviceName == this._defaultService;
}, },
_updateDefaultService: function() { _updateDefaultService: function() {
if (this._settings.get_boolean(PASSWORD_AUTHENTICATION_KEY)) if (this._settings.get_boolean(PASSWORD_AUTHENTICATION_KEY))
this._defaultService = PASSWORD_SERVICE_NAME; this._defaultService = PASSWORD_SERVICE_NAME;
else if (this.smartcardDetected) else if (this._smartcardDetected)
this._defaultService = SMARTCARD_SERVICE_NAME; this._defaultService = SMARTCARD_SERVICE_NAME;
else if (this._haveFingerprintReader) else if (this._haveFingerprintReader)
this._defaultService = FINGERPRINT_SERVICE_NAME; this._defaultService = FINGERPRINT_SERVICE_NAME;
@ -476,12 +474,12 @@ const ShellUserVerifier = new Lang.Class({
_beginVerification: function() { _beginVerification: function() {
this._startService(this._getForegroundService()); this._startService(this._getForegroundService());
if (this._userName && this._haveFingerprintReader && !this.serviceIsForeground(FINGERPRINT_SERVICE_NAME)) if (this._userName && this._haveFingerprintReader && !this._serviceIsForeground(FINGERPRINT_SERVICE_NAME))
this._startService(FINGERPRINT_SERVICE_NAME); this._startService(FINGERPRINT_SERVICE_NAME);
}, },
_onInfo: function(client, serviceName, info) { _onInfo: function(client, serviceName, info) {
if (this.serviceIsForeground(serviceName)) { if (this._serviceIsForeground(serviceName)) {
this._queueMessage(info, MessageType.INFO); this._queueMessage(info, MessageType.INFO);
} else if (serviceName == FINGERPRINT_SERVICE_NAME && } else if (serviceName == FINGERPRINT_SERVICE_NAME &&
this._haveFingerprintReader) { this._haveFingerprintReader) {
@ -496,21 +494,21 @@ const ShellUserVerifier = new Lang.Class({
}, },
_onProblem: function(client, serviceName, problem) { _onProblem: function(client, serviceName, problem) {
if (!this.serviceIsForeground(serviceName)) if (!this._serviceIsForeground(serviceName))
return; return;
this._queueMessage(problem, MessageType.ERROR); this._queueMessage(problem, MessageType.ERROR);
}, },
_onInfoQuery: function(client, serviceName, question) { _onInfoQuery: function(client, serviceName, question) {
if (!this.serviceIsForeground(serviceName)) if (!this._serviceIsForeground(serviceName))
return; return;
this.emit('ask-question', serviceName, question, ''); this.emit('ask-question', serviceName, question, '');
}, },
_onSecretInfoQuery: function(client, serviceName, secretQuestion) { _onSecretInfoQuery: function(client, serviceName, secretQuestion) {
if (!this.serviceIsForeground(serviceName)) if (!this._serviceIsForeground(serviceName))
return; return;
if (serviceName == OVIRT_SERVICE_NAME) { if (serviceName == OVIRT_SERVICE_NAME) {
@ -555,7 +553,7 @@ const ShellUserVerifier = new Lang.Class({
// If the login failed with the preauthenticated oVirt credentials // If the login failed with the preauthenticated oVirt credentials
// then discard the credentials and revert to default authentication // then discard the credentials and revert to default authentication
// mechanism. // mechanism.
if (this.serviceIsForeground(OVIRT_SERVICE_NAME)) { if (this._serviceIsForeground(OVIRT_SERVICE_NAME)) {
this._oVirtCredentialsManager.resetToken(); this._oVirtCredentialsManager.resetToken();
this._verificationFailed(false); this._verificationFailed(false);
return; return;
@ -564,7 +562,7 @@ const ShellUserVerifier = new Lang.Class({
// if the password service fails, then cancel everything. // if the password service fails, then cancel everything.
// But if, e.g., fingerprint fails, still give // But if, e.g., fingerprint fails, still give
// password authentication a chance to succeed // password authentication a chance to succeed
if (this.serviceIsForeground(serviceName)) { if (this._serviceIsForeground(serviceName)) {
this._verificationFailed(true); this._verificationFailed(true);
} }
}, },