More work on axwin, and slight changes in othe places
[tpg/acess2.git] / Usermode / Applications / login_src / database_tpl.c
index de903d5..ddead96 100644 (file)
@@ -25,6 +25,8 @@ int ValidateUser(char *Username, char *Password)
        if(Username == NULL)    return -1;
        if(Password == NULL)    return -1;
        if(strcmp(Username, "root") == 0)       return 0;
+       if(strcmp(Username, "tpg") == 0)        return 1;
+       if(strcmp(Username, "gui") == 0)        return 2;
        return -1;
 }
 
@@ -33,13 +35,27 @@ int ValidateUser(char *Username, char *Password)
  * \brief Gets a users information
  */
 tUserInfo *GetUserInfo(int UID)
-{
-       if(UID != 0)    return NULL;
-       
-       gUserInfo.UID = 0;
-       gUserInfo.GID = 0;
+{      
+       gUserInfo.UID = UID;
+       gUserInfo.GID = UID;
        gUserInfo.Shell = "/Acess/Bin/CLIShell";
-       gUserInfo.Home = "/Acess/Root";
+       switch(UID)
+       {
+       case 0:
+               gUserInfo.Home = "/Acess/Root";
+               break;
+       case 1:
+               gUserInfo.Home = "/Acess/Users/tpg";
+               break;
+       case 2:
+               gUserInfo.UID = 0;      //HACK!
+               gUserInfo.Home = "/Acess/Users/gui";
+               gUserInfo.Shell = "/Acess/Apps/AxWin/1.0/AxWinWM";
+               break;
+       default:
+               gUserInfo.Home = "/Acess/Users/Guest";
+               break;
+       }
        return &gUserInfo;
 }
 

UCC git Repository :: git.ucc.asn.au