Merge lp:~flscogna/ubuntu-terminal-app/fix-add-forceAuth into lp:ubuntu-terminal-app

Proposed by Filippo Scognamiglio
Status: Rejected
Rejected by: Nicholas Skaggs
Proposed branch: lp:~flscogna/ubuntu-terminal-app/fix-add-forceAuth
Merge into: lp:ubuntu-terminal-app
Diff against target: 58 lines (+23/-1)
2 files modified
src/app/main.cpp (+22/-0)
src/app/qml/AuthenticationService.qml (+1/-1)
To merge this branch: bzr merge lp:~flscogna/ubuntu-terminal-app/fix-add-forceAuth
Reviewer Review Type Date Requested Status
Nicholas Skaggs (community) Disapprove
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Alan Pope 🍺🐧🐱 🦄 Pending
Review via email: mp+235537@code.launchpad.net

Commit message

Add the --forceAuth flag to terminal-app

Description of the change

This should add the --forceAuth flag to launch the application bypassing the authentication.
Sadly tonight the emulator is not working for me so I could only check that the code actually compiles, so please use extra care.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

This is rolled into https://code.launchpad.net/~ubuntu-terminal-dev/ubuntu-terminal-app/fix-add-forceAuth/+merge/235711 so everyone can work on it. Carla is going to add tests.

Thanks for the changes!

review: Disapprove
Revision history for this message
Filippo Scognamiglio (flscogna) wrote :

Ok, very well the other proposal is also fixing tests!

Unmerged revisions

150. By Filippo Scognamiglio

Add fake --forceAuth flag (needed for autopilot tests).

149. By Launchpad Translations on behalf of ubuntu-terminal-dev

Launchpad automatic translations update.

148. By Launchpad Translations on behalf of ubuntu-terminal-dev

Launchpad automatic translations update.

147. By Kill Animals

Update lib version imports.

Approved by Alan Pope ʕ•͡ᴥ•ʔ, Ubuntu Phone Apps Jenkins Bot.

146. By Victor Thompson

Clear password field when OK is pressed. Fixes: https://bugs.launchpad.net/bugs/1366387.

Approved by Alan Pope ʕ•͡ᴥ•ʔ, Ubuntu Phone Apps Jenkins Bot.

145. By Benjamin Zeller

Make terminal app cmake project useable out of the Box with QtCreator
(after dependencies are installed)
- Enable click mode by default
- Disable click mode in debian rules file
- Add variable UBUNTU_MANIFEST_PATH variable so QtC knows where to look
for the manifest file
- Rename apparmor.json to terminal.apparmor (editor support)
- Rename manifest.json => manifest.json.in so insource builds won't
override it.

Approved by Alan Pope ʕ•͡ᴥ•ʔ, Ubuntu Phone Apps Jenkins Bot.

144. By Filippo Scognamiglio

Fix: terminal starts in application directory instead of home. Fixes: https://bugs.launchpad.net/bugs/1365602.

Approved by Alan Pope ʕ•͡ᴥ•ʔ, Ubuntu Phone Apps Jenkins Bot.

143. By Launchpad Translations on behalf of ubuntu-terminal-dev

Launchpad automatic translations update.

142. By Launchpad Translations on behalf of ubuntu-terminal-dev

Launchpad automatic translations update.

141. By Michael Sheldon

Set input hint to disable predictive text and auto capitalisation in custom terminal input implementation. Fixes: https://bugs.launchpad.net/bugs/1302870, https://bugs.launchpad.net/bugs/1307386, https://bugs.launchpad.net/bugs/1331354.

Approved by Ubuntu Phone Apps Jenkins Bot, Alan Pope ㋛, Filippo Scognamiglio.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/main.cpp'
2--- src/app/main.cpp 2014-04-27 20:38:52 +0000
3+++ src/app/main.cpp 2014-09-22 21:32:42 +0000
4@@ -47,12 +47,23 @@
5 qDebug() << "usage: " + args.at(0) + " [-p|--phone] [-t|--tablet] [-h|--help] [-I <path>]";
6 qDebug() << " -p|--phone If running on Desktop, start in a phone sized window.";
7 qDebug() << " -t|--tablet If running on Desktop, start in a tablet sized window.";
8+ qDebug() << " --forceAuth <true|false> Force authentication on or off.";
9 qDebug() << " -h|--help Print this help.";
10 qDebug() << " -I <path> Give a path for an additional QML import directory. May be used multiple times.";
11 qDebug() << " -q <qmlfile> Give an alternative location for the main qml file.";
12 return 0;
13 }
14
15+ // Desktop doesn't have yet Unity8 and so no unity greeter either. Consequently it doesn't
16+ // also have any "PIN code" or "Password" extra authentication. Don't require any extra
17+ // authentication there by default
18+ if (qgetenv("QT_QPA_PLATFORM") != "ubuntumirclient") {
19+ qDebug() << Q_FUNC_INFO << "Running on non-MIR desktop, not requiring authentication by default";
20+ view.engine()->rootContext()->setContextProperty("noAuthentication", QVariant(true));
21+ } else {
22+ view.engine()->rootContext()->setContextProperty("noAuthentication", QVariant(false));
23+ }
24+
25 QString qmlfile;
26 for (int i = 0; i < args.count(); i++) {
27 if (args.at(i) == "-I" && args.count() > i + 1) {
28@@ -64,6 +75,17 @@
29 importPathList.append(addedPath);
30 } else if (args.at(i) == "-q" && args.count() > i + 1) {
31 qmlfile = args.at(i+1);
32+ } else if (args.at(i) == "--forceAuth" && args.count() > i + 1) {
33+ QString value = args.at(i+1);
34+ if (value == "true") {
35+ qDebug() << Q_FUNC_INFO << "Forcing authentication on";
36+ view.engine()->rootContext()->setContextProperty("noAuthentication", QVariant(false));
37+ } else if (value == "false") {
38+ qDebug() << Q_FUNC_INFO << "Forcing authentication off";
39+ view.engine()->rootContext()->setContextProperty("noAuthentication", QVariant(true));
40+ } else {
41+ qWarning() << Q_FUNC_INFO << "Invalid forceAuth option '" << value << "', keeping default";
42+ }
43 }
44 }
45
46
47=== modified file 'src/app/qml/AuthenticationService.qml'
48--- src/app/qml/AuthenticationService.qml 2014-08-26 18:48:18 +0000
49+++ src/app/qml/AuthenticationService.qml 2014-09-22 21:32:42 +0000
50@@ -30,7 +30,7 @@
51 signal denied()
52
53 Component.onCompleted: {
54- if ( systemAuthentication.requireAuthentication() ) {
55+ if ( systemAuthentication.requireAuthentication() && !noAuthentication) {
56 displayLoginDialog();
57 }
58 }

Subscribers

People subscribed via source and target branches