on xenial help sign in
drop maxFailedLogins and showLastChance() from Greeter
ac6f7e2Lukáš Tinkl
qml/Greeter/Greeter.qml−8
@@ -55,7 +55,6 @@ Showable {
55 property bool tabletMode
55 property bool tabletMode
56 property url viewSource // only used for testing
56 property url viewSource // only used for testing
57
57
58− property int maxFailedLogins: -1 // disabled by default for now, will enable via settings in future
59 property int failedLoginsDelayAttempts: 7 // number of failed logins
58 property int failedLoginsDelayAttempts: 7 // number of failed logins
60 property real failedLoginsDelayMinutes: 5 // minutes of forced waiting
59 property real failedLoginsDelayMinutes: 5 // minutes of forced waiting
61 property int failedFingerprintLoginsDisableAttempts: 3 // number of failed fingerprint logins
60 property int failedFingerprintLoginsDisableAttempts: 3 // number of failed fingerprint logins
@@ -468,13 +467,6 @@ Showable {
468 if (!automatic) {
467 if (!automatic) {
469 AccountsService.failedLogins++;
468 AccountsService.failedLogins++;
470
469
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−
478 // Check if we should initiate a forced login delay
470 // Check if we should initiate a forced login delay
479 if (failedLoginsDelayAttempts > 0
471 if (failedLoginsDelayAttempts > 0
480 && AccountsService.failedLogins > 0
472 && AccountsService.failedLogins > 0
qml/Greeter/NarrowView.qml−14
@@ -48,20 +48,6 @@ FocusScope {
48 signal tease()
48 signal tease()
49 signal emergencyCall()
49 signal emergencyCall()
50
50
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−
65 function hide() {
51 function hide() {
66 lockscreen.hide();
52 lockscreen.hide();
67 coverPage.hide();
53 coverPage.hide();
qml/Greeter/WideView.qml−4
@@ -80,10 +80,6 @@ FocusScope {
80 loginList.showFakePassword();
80 loginList.showFakePassword();
81 }
81 }
82
82
83− function showLastChance() {
84− // TODO
85− }
86−
87 Rectangle {
83 Rectangle {
88 anchors.fill: parent
84 anchors.fill: parent
89 color: "black"
85 color: "black"
tests/qmltests/Greeter/TestView.qml−5
@@ -46,7 +46,6 @@ Item {
46 signal tease()
46 signal tease()
47 signal emergencyCall()
47 signal emergencyCall()
48
48
49− signal _showLastChanceCalled()
50 signal _hideCalled()
49 signal _hideCalled()
51 signal _showFakePasswordCalled()
50 signal _showFakePasswordCalled()
52 signal _notifyAuthenticationFailedCalled()
51 signal _notifyAuthenticationFailedCalled()
@@ -54,10 +53,6 @@ Item {
54 signal _forceShowCalled()
53 signal _forceShowCalled()
55 signal _tryToUnlockCalled(bool toTheRight)
54 signal _tryToUnlockCalled(bool toTheRight)
56
55
57− function showLastChance() {
58− _showLastChanceCalled();
59− }
60−
61 function hide() {
56 function hide() {
62 _hideCalled();
57 _hideCalled();
63 _required = false;
58 _required = false;
tests/qmltests/Greeter/tst_Greeter.qml−7
@@ -94,12 +94,6 @@ Item {
94 property Item greeter: loader.status === Loader.Ready ? loader.item : null
94 property Item greeter: loader.status === Loader.Ready ? loader.item : null
95 property Item view
95 property Item view
96
96
97− SignalSpy {
98− id: viewShowLastChanceSpy
99− target: testCase.view
100− signalName: "_showLastChanceCalled"
101− }
102−
103 SignalSpy {
97 SignalSpy {
104 id: viewHideSpy
98 id: viewHideSpy
105 target: testCase.view
99 target: testCase.view
@@ -147,7 +141,6 @@ Item {
147 Biometryd.available = true;
141 Biometryd.available = true;
148 AccountsService.enableFingerprintIdentification = true;
142 AccountsService.enableFingerprintIdentification = true;
149 AccountsService.failedFingerprintLogins = 0;
143 AccountsService.failedFingerprintLogins = 0;
150− viewShowLastChanceSpy.clear();
151 viewHideSpy.clear();
144 viewHideSpy.clear();
152 viewShowFakePasswordSpy.clear();
145 viewShowFakePasswordSpy.clear();
153 viewAuthenticationFailedSpy.clear();
146 viewAuthenticationFailedSpy.clear();
tests/qmltests/tst_ShellWithPin.qml−14
@@ -89,19 +89,6 @@ Item {
89 text: "Show Greeter"
89 text: "Show Greeter"
90 onClicked: LightDM.Greeter.showGreeter()
90 onClicked: LightDM.Greeter.showGreeter()
91 }
91 }
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− }
105 }
92 }
106 }
93 }
107 }
94 }
@@ -143,7 +130,6 @@ Item {
143 sessionSpy.target = greeter;
130 sessionSpy.target = greeter;
144 swipeAwayGreeter(true);
131 swipeAwayGreeter(true);
145 greeter.failedLoginsDelayAttempts = -1;
132 greeter.failedLoginsDelayAttempts = -1;
146− greeter.maxFailedLogins = -1;
147
133
148 var launcher = findChild(shell, "launcher");
134 var launcher = findChild(shell, "launcher");
149 var panel = findChild(launcher, "launcherPanel");
135 var panel = findChild(launcher, "launcherPanel");