- hide the password
- fix beos build, for testing. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25062 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
0ab2d7407c
commit
d65e1397df
@ -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
|
||||
;
|
||||
|
||||
|
@ -3,12 +3,14 @@
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <pwd.h>
|
||||
#include <shadow.h>
|
||||
|
||||
#include "LoginApp.h"
|
||||
#include "LoginWindow.h"
|
||||
|
||||
#ifdef __HAIKU__
|
||||
#include <shadow.h>
|
||||
#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;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include <Application.h>
|
||||
|
||||
/* try loging in a user */
|
||||
const uint32 kMsgOpenFilePanel = 'logi';
|
||||
const uint32 kAttemptLogin = 'logi';
|
||||
|
||||
class LoginApp : public BApplication {
|
||||
public:
|
||||
|
@ -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);
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user