From d65e1397dfd679c44f2dcd4da3604bd05f0c2c75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sun, 20 Apr 2008 00:14:58 +0000 Subject: [PATCH] - hide the password - fix beos build, for testing. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25062 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/login/Jamfile | 6 +++++- src/apps/login/LoginApp.cpp | 13 +++++++++++-- src/apps/login/LoginApp.h | 2 +- src/apps/login/LoginView.cpp | 1 + 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/apps/login/Jamfile b/src/apps/login/Jamfile index 87cc5fc0bb..a5d8989137 100644 --- a/src/apps/login/Jamfile +++ b/src/apps/login/Jamfile @@ -5,6 +5,10 @@ SetSubDirSupportedPlatformsBeOSCompatible ; #UsePrivateHeaders shared ; #UsePrivateHeaders tracker ; #SubDirHdrs $(HAIKU_TOP) src kits tracker ; +local mu_libs ; +if $(TARGET_PLATFORM_HAIKU_COMPATIBLE) { + mu_libs = libmultiuser_utils.a ; +} UseHeaders [ FDirName $(HAIKU_TOP) src bin multiuser ] ; @@ -13,7 +17,7 @@ Application Login : LoginWindow.cpp LoginView.cpp main.cpp - : be tracker libmultiuser_utils.a + : be tracker $(mu_libs) : Login.rdef ; diff --git a/src/apps/login/LoginApp.cpp b/src/apps/login/LoginApp.cpp index 48df221c8c..2b85d00ccb 100644 --- a/src/apps/login/LoginApp.cpp +++ b/src/apps/login/LoginApp.cpp @@ -3,12 +3,14 @@ #include #include #include -#include #include "LoginApp.h" #include "LoginWindow.h" +#ifdef __HAIKU__ +#include #include "multiuser_utils.h" +#endif const char *kLoginAppSig = "application/x-vnd.Haiku-Login"; @@ -41,7 +43,7 @@ void LoginApp::MessageReceived(BMessage *message) { switch (message->what) { - case kMsgOpenFilePanel: + case kAttemptLogin: break; default: BApplication::MessageReceived(message); @@ -102,8 +104,15 @@ LoginApp::ValidateLogin(const char *login, const char *password/*, bool force = return B_OK; } +#ifdef __HAIKU__ if (verify_password(pwd, getspnam(login), password)) return B_OK; +#else + // for testing + if (strcmp(crypt(password, pwd->pw_passwd), pwd->pw_passwd)) + return B_NOT_ALLOWED; +#endif + return B_NOT_ALLOWED; } diff --git a/src/apps/login/LoginApp.h b/src/apps/login/LoginApp.h index 66e82645a0..ecac850a0a 100644 --- a/src/apps/login/LoginApp.h +++ b/src/apps/login/LoginApp.h @@ -1,7 +1,7 @@ #include /* try loging in a user */ -const uint32 kMsgOpenFilePanel = 'logi'; +const uint32 kAttemptLogin = 'logi'; class LoginApp : public BApplication { public: diff --git a/src/apps/login/LoginView.cpp b/src/apps/login/LoginView.cpp index 10fe4169c5..90f2cbff8f 100644 --- a/src/apps/login/LoginView.cpp +++ b/src/apps/login/LoginView.cpp @@ -22,6 +22,7 @@ LoginView::LoginView(BRect frame) AddChild(fLoginControl); r.OffsetBySelf(0, CSEP + CSEP); fPasswordControl = new BTextControl(r, "password", "password:", "", new BMessage(kPasswordEdited)); + fPasswordControl->TextView()->HideTyping(true); AddChild(fPasswordControl); }