]> andersk Git - moira.git/commitdiff
Add support for setting and displaying a user's Windows shell.
authorzacheiss <zacheiss>
Fri, 21 Apr 2000 19:48:57 +0000 (19:48 +0000)
committerzacheiss <zacheiss>
Fri, 21 Apr 2000 19:48:57 +0000 (19:48 +0000)
clients/moira/user.c

index ebbcb97a94cc2703e28ca8cd7f3a764f786e5b0a..61973a406cdf7ee55188d1726540c8df5b14f9c0 100644 (file)
@@ -46,6 +46,7 @@ struct mqelem *GetUserInfo(int type, char *name1, char *name2);
 #endif
 #define DEFAULT_CLASS "?"
 
+#define DEFAULT_WINCONSOLESHELL "cmd"
 
 /*     Function Name: UserState
  *     Description: Convert a numeric state into a descriptive string.
@@ -106,10 +107,12 @@ static void PrintUserInfo(char **info)
   sprintf(name, "%s, %s %s", info[U_LAST], info[U_FIRST], info[U_MIDDLE]);
   sprintf(buf, "Login name: %-20s Full name: %s", info[U_NAME], name);
   Put_message(buf);
-  sprintf(buf, "User id: %-23s Login shell %-10s Class: %s",
-         info[U_UID], info[U_SHELL], info[U_CLASS]);
+  sprintf(buf, "User id: %-23s Login shell: %-10s",
+         info[U_UID], info[U_SHELL]);
+  Put_message(buf);
+  sprintf(buf, "Class: %-25s Windows Console Shell: %-10s",
+         info[U_CLASS], info[U_WINCONSOLESHELL]);
   Put_message(buf);
-
   sprintf(buf, "Account is: %-20s MIT ID number: %s",
          UserState(atoi(info[U_STATE])), info[U_MITID]);
   Put_message(buf);
@@ -137,6 +140,7 @@ static char **SetUserDefaults(char **info)
   info[U_NAME] = strdup(UNIQUE_LOGIN);
   info[U_UID] = strdup(UNIQUE_UID);
   info[U_SHELL] = strdup(DEFAULT_SHELL);
+  info[U_WINCONSOLESHELL] = strdup(DEFAULT_WINCONSOLESHELL);
   info[U_LAST] = strdup(DEFAULT_NONE);
   info[U_FIRST] = strdup(DEFAULT_NONE);
   info[U_MIDDLE] = strdup(DEFAULT_NONE);
@@ -252,6 +256,9 @@ char **AskUserInfo(char **info, Bool name)
 
   if (GetValueFromUser("User's shell", &info[U_SHELL]) == SUB_ERROR)
     return NULL;
+  if (GetValueFromUser("Windows console shell", &info[U_WINCONSOLESHELL])
+      == SUB_ERROR)
+    return NULL;
   if (name)
     {
       if (GetValueFromUser("User's last name", &info[U_LAST]) == SUB_ERROR)
This page took 0.041158 seconds and 5 git commands to generate.