on xenial help sign in
drop maxFailedLogins and showLastChance() from Greeter
commitac6f7e23e218cc6e0f1141234a84dde428d4461c authorLukáš Tinkl <lukas.tinkl@canonical.com> dateWed 22 Mar 2017, 21:14 (10 years ago) parent944783e
6 files changed−52
qml/Greeter/Greeter.qml−8 qml/Greeter/NarrowView.qml−14 qml/Greeter/WideView.qml−4 tests/qmltests/Greeter/TestView.qml−5 tests/qmltests/Greeter/tst_Greeter.qml−7 tests/qmltests/tst_ShellWithPin.qml−14
qml/Greeter/Greeter.qml−8
@@ -55,7 +55,6 @@ Showable {
5555 property bool tabletMode
5656 property url viewSource // only used for testing
5757
58− property int maxFailedLogins: -1 // disabled by default for now, will enable via settings in future
5958 property int failedLoginsDelayAttempts: 7 // number of failed logins
6059 property real failedLoginsDelayMinutes: 5 // minutes of forced waiting
6160 property int failedFingerprintLoginsDisableAttempts: 3 // number of failed fingerprint logins
@@ -468,13 +467,6 @@ Showable {
468467 if (!automatic) {
469468 AccountsService.failedLogins++;
470469
471− // Check if we should initiate a factory reset
472− if (maxFailedLogins >= 2) { // require at least a warning
473− if (AccountsService.failedLogins === maxFailedLogins - 1) {
474− loader.item.showLastChance();
475− }
476− }
477−
478470 // Check if we should initiate a forced login delay
479471 if (failedLoginsDelayAttempts > 0
480472 && AccountsService.failedLogins > 0
qml/Greeter/NarrowView.qml−14
@@ -48,20 +48,6 @@ FocusScope {
4848 signal tease()
4949 signal emergencyCall()
5050
51− function showLastChance() {
52− /* TODO: when we finish support for resetting device after too many
53− failed logins, we should re-add this popup.
54− var title = lockscreen.alphaNumeric ?
55− i18n.tr("Sorry, incorrect passphrase.") :
56− i18n.tr("Sorry, incorrect passcode.");
57− var text = i18n.tr("This will be your last attempt.") + " " +
58− (lockscreen.alphaNumeric ?
59− i18n.tr("If passphrase is entered incorrectly, your phone will conduct a factory reset and all personal data will be deleted.") :
60− i18n.tr("If passcode is entered incorrectly, your phone will conduct a factory reset and all personal data will be deleted."));
61− lockscreen.showInfoPopup(title, text);
62− */
63− }
64−
6551 function hide() {
6652 lockscreen.hide();
6753 coverPage.hide();
qml/Greeter/WideView.qml−4
@@ -80,10 +80,6 @@ FocusScope {
8080 loginList.showFakePassword();
8181 }
8282
83− function showLastChance() {
84− // TODO
85− }
86−
8783 Rectangle {
8884 anchors.fill: parent
8985 color: "black"
tests/qmltests/Greeter/TestView.qml−5
@@ -46,7 +46,6 @@ Item {
4646 signal tease()
4747 signal emergencyCall()
4848
49− signal _showLastChanceCalled()
5049 signal _hideCalled()
5150 signal _showFakePasswordCalled()
5251 signal _notifyAuthenticationFailedCalled()
@@ -54,10 +53,6 @@ Item {
5453 signal _forceShowCalled()
5554 signal _tryToUnlockCalled(bool toTheRight)
5655
57− function showLastChance() {
58− _showLastChanceCalled();
59− }
60−
6156 function hide() {
6257 _hideCalled();
6358 _required = false;
tests/qmltests/Greeter/tst_Greeter.qml−7
@@ -94,12 +94,6 @@ Item {
9494 property Item greeter: loader.status === Loader.Ready ? loader.item : null
9595 property Item view
9696
97− SignalSpy {
98− id: viewShowLastChanceSpy
99− target: testCase.view
100− signalName: "_showLastChanceCalled"
101− }
102−
10397 SignalSpy {
10498 id: viewHideSpy
10599 target: testCase.view
@@ -147,7 +141,6 @@ Item {
147141 Biometryd.available = true;
148142 AccountsService.enableFingerprintIdentification = true;
149143 AccountsService.failedFingerprintLogins = 0;
150− viewShowLastChanceSpy.clear();
151144 viewHideSpy.clear();
152145 viewShowFakePasswordSpy.clear();
153146 viewAuthenticationFailedSpy.clear();
tests/qmltests/tst_ShellWithPin.qml−14
@@ -89,19 +89,6 @@ Item {
8989 text: "Show Greeter"
9090 onClicked: LightDM.Greeter.showGreeter()
9191 }
92−
93− Label {
94− text: "Max retries:"
95− color: "black"
96− }
97− TextField {
98− id: maxRetriesTextField
99− text: "-1"
100− onTextChanged: {
101− var greeter = testCase.findChild(shellLoader.item, "greeter");
102− greeter.maxFailedLogins = text;
103− }
104− }
10592 }
10693 }
10794 }
@@ -143,7 +130,6 @@ Item {
143130 sessionSpy.target = greeter;
144131 swipeAwayGreeter(true);
145132 greeter.failedLoginsDelayAttempts = -1;
146− greeter.maxFailedLogins = -1;
147133
148134 var launcher = findChild(shell, "launcher");
149135 var panel = findChild(launcher, "launcherPanel");