00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __OPIE_LOGINAPPLICATION_H__
00029 #define __OPIE_LOGINAPPLICATION_H__
00030
00031 #include <sys/types.h>
00032 #include <qstringlist.h>
00033 #include <qpe/qpeapplication.h>
00034
00035 #ifdef USEPAM
00036 struct pam_message;
00037 struct pam_response;
00038 #endif
00039
00040 class LoginApplication : public QPEApplication {
00041 public:
00042 LoginApplication ( int &argc, char **argv, pid_t parentpid );
00043
00044 static bool checkPassword ( const char *user, const char *password );
00045
00046 static const char *loginAs ( );
00047 static void setLoginAs ( const char *user );
00048
00049 static bool changeIdentity ( );
00050 static bool login ( );
00051 static void logout ( );
00052
00053 static QStringList allUsers ( );
00054
00055 void quitToConsole ( );
00056
00057 static bool runRootScript ( const char *base, const char *script, const char *param = 0 );
00058 static void execUserScript ( const char *base, const char *script );
00059
00060 private:
00061 static const char *s_username;
00062
00063 #ifdef USEPAM
00064 static int pam_helper ( int num_msg, const struct pam_message **msg, struct pam_response **resp, void * );
00065 static const char *s_pam_password;
00066 #endif
00067
00068 private:
00069 pid_t m_parentpid;
00070 };
00071
00072 extern LoginApplication *lApp;
00073
00074 #endif