- 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:
@@ -5,6 +5,10 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
|
|||||||
#UsePrivateHeaders shared ;
|
#UsePrivateHeaders shared ;
|
||||||
#UsePrivateHeaders tracker ;
|
#UsePrivateHeaders tracker ;
|
||||||
#SubDirHdrs $(HAIKU_TOP) src kits 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 ] ;
|
UseHeaders [ FDirName $(HAIKU_TOP) src bin multiuser ] ;
|
||||||
|
|
||||||
@@ -13,7 +17,7 @@ Application Login :
|
|||||||
LoginWindow.cpp
|
LoginWindow.cpp
|
||||||
LoginView.cpp
|
LoginView.cpp
|
||||||
main.cpp
|
main.cpp
|
||||||
: be tracker libmultiuser_utils.a
|
: be tracker $(mu_libs)
|
||||||
: Login.rdef
|
: Login.rdef
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,14 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <shadow.h>
|
|
||||||
|
|
||||||
#include "LoginApp.h"
|
#include "LoginApp.h"
|
||||||
#include "LoginWindow.h"
|
#include "LoginWindow.h"
|
||||||
|
|
||||||
|
#ifdef __HAIKU__
|
||||||
|
#include <shadow.h>
|
||||||
#include "multiuser_utils.h"
|
#include "multiuser_utils.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
const char *kLoginAppSig = "application/x-vnd.Haiku-Login";
|
const char *kLoginAppSig = "application/x-vnd.Haiku-Login";
|
||||||
@@ -41,7 +43,7 @@ void
|
|||||||
LoginApp::MessageReceived(BMessage *message)
|
LoginApp::MessageReceived(BMessage *message)
|
||||||
{
|
{
|
||||||
switch (message->what) {
|
switch (message->what) {
|
||||||
case kMsgOpenFilePanel:
|
case kAttemptLogin:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
BApplication::MessageReceived(message);
|
BApplication::MessageReceived(message);
|
||||||
@@ -102,8 +104,15 @@ LoginApp::ValidateLogin(const char *login, const char *password/*, bool force =
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __HAIKU__
|
||||||
if (verify_password(pwd, getspnam(login), password))
|
if (verify_password(pwd, getspnam(login), password))
|
||||||
return B_OK;
|
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;
|
return B_NOT_ALLOWED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
|
||||||
/* try loging in a user */
|
/* try loging in a user */
|
||||||
const uint32 kMsgOpenFilePanel = 'logi';
|
const uint32 kAttemptLogin = 'logi';
|
||||||
|
|
||||||
class LoginApp : public BApplication {
|
class LoginApp : public BApplication {
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ LoginView::LoginView(BRect frame)
|
|||||||
AddChild(fLoginControl);
|
AddChild(fLoginControl);
|
||||||
r.OffsetBySelf(0, CSEP + CSEP);
|
r.OffsetBySelf(0, CSEP + CSEP);
|
||||||
fPasswordControl = new BTextControl(r, "password", "password:", "", new BMessage(kPasswordEdited));
|
fPasswordControl = new BTextControl(r, "password", "password:", "", new BMessage(kPasswordEdited));
|
||||||
|
fPasswordControl->TextView()->HideTyping(true);
|
||||||
AddChild(fPasswordControl);
|
AddChild(fPasswordControl);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user