[NET]: Whitespace fixes only.
[reactos.git] / reactos / base / applications / network / net / cmdAccounts.c
index 456ac4c..792831d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS net command
- * FILE:
+ * FILE:            base/applications/network/net/cmdAccounts.c
  * PURPOSE:
  *
  * PROGRAMMERS:     Eric Kohl
@@ -24,7 +24,10 @@ cmdAccounts(
     ULONG value;
     INT i;
     BOOL Modified = FALSE;
-//    BOOL Domain = FALSE;
+#if 0
+    BOOL Domain = FALSE;
+#endif
+    INT nPaddedLength = 58;
     NET_API_STATUS Status;
     INT result = 0;
 
@@ -33,23 +36,24 @@ cmdAccounts(
         if (_wcsicmp(argv[i], L"help") == 0)
         {
             /* Print short syntax help */
-            PrintResourceString(IDS_ACCOUNTS_SYNTAX);
+            ConResPuts(StdOut, IDS_ACCOUNTS_SYNTAX);
             return 0;
         }
 
         if (_wcsicmp(argv[i], L"/help") == 0)
         {
             /* Print full help text*/
-            PrintResourceString(IDS_ACCOUNTS_HELP);
+            ConResPuts(StdOut, IDS_ACCOUNTS_HELP);
             return 0;
         }
 
-/*
         if (_wcsicmp(argv[i], L"/domain") == 0)
         {
+            ConResPrintf(StdErr, IDS_ERROR_OPTION_NOT_SUPPORTED, L"/DOMAIN");
+#if 0
             Domain = TRUE;
+#endif
         }
-*/
     }
 
     Status = NetUserModalsGet(NULL, 0, (LPBYTE*)&Info0);
@@ -71,7 +75,7 @@ cmdAccounts(
                 value = wcstoul(p, &endptr, 10);
                 if (*endptr != 0)
                 {
-                    printf("You entered an invalid value for the /FORCELOGOFF option.\n");
+                    ConResPrintf(StdErr, IDS_ERROR_INVALID_OPTION_VALUE, L"/FORCELOGOFF");
                     result = 1;
                     goto done;
                 }
@@ -86,9 +90,9 @@ cmdAccounts(
             value = wcstoul(p, &endptr, 10);
             if (*endptr != 0)
             {
-                    printf("You entered an invalid value for the /MINPWLEN option.\n");
-                    result = 1;
-                    goto done;
+                ConResPrintf(StdErr, IDS_ERROR_INVALID_OPTION_VALUE, L"/MINPWLEN");
+                result = 1;
+                goto done;
             }
 
             Info0->usrmod0_min_passwd_len = value;
@@ -108,7 +112,7 @@ cmdAccounts(
                 value = wcstoul(p, &endptr, 10);
                 if (*endptr != 0)
                 {
-                    printf("You entered an invalid value for the /MAXPWAGE option.\n");
+                    ConResPrintf(StdErr, IDS_ERROR_INVALID_OPTION_VALUE, L"/MAXPWLEN");
                     result = 1;
                     goto done;
                 }
@@ -123,7 +127,7 @@ cmdAccounts(
             value = wcstoul(p, &endptr, 10);
             if (*endptr != 0)
             {
-                printf("You entered an invalid value for the /MINPWAGE option.\n");
+                ConResPrintf(StdErr, IDS_ERROR_INVALID_OPTION_VALUE, L"/MINPWAGE");
                 result = 1;
                 goto done;
             }
@@ -137,7 +141,7 @@ cmdAccounts(
             value = wcstoul(p, &endptr, 10);
             if (*endptr != 0)
             {
-                printf("You entered an invalid value for the /UNIQUEPW option.\n");
+                ConResPrintf(StdErr, IDS_ERROR_INVALID_OPTION_VALUE, L"/UNIQUEPW");
                 result = 1;
                 goto done;
             }
@@ -165,52 +169,63 @@ cmdAccounts(
 
         RtlGetNtProductType(&ProductType);
 
-        printf("Force logoff after: ");
+        PrintPaddedResourceString(IDS_ACCOUNTS_FORCE_LOGOFF, nPaddedLength);
         if (Info0->usrmod0_force_logoff == TIMEQ_FOREVER)
-            printf("Never\n");
+            ConResPuts(StdOut, IDS_GENERIC_NEVER);
         else
-            printf("%lu seconds\n", Info0->usrmod0_force_logoff);
+            ConResPrintf(StdOut, IDS_ACCOUNTS_LOGOFF_SECONDS, Info0->usrmod0_force_logoff);
+        ConPuts(StdOut, L"\n");
+
+        PrintPaddedResourceString(IDS_ACCOUNTS_MIN_PW_AGE, nPaddedLength);
+        ConPrintf(StdOut, L"%lu\n", Info0->usrmod0_min_passwd_age / 86400);
+
+        PrintPaddedResourceString(IDS_ACCOUNTS_MAX_PW_AGE, nPaddedLength);
+        ConPrintf(StdOut, L"%lu\n", Info0->usrmod0_max_passwd_age / 86400);
 
-        printf("Minimum password age (in days): %lu\n", Info0->usrmod0_min_passwd_age / 86400);
-        printf("Maximum password age (in days): %lu\n", Info0->usrmod0_max_passwd_age / 86400);
-        printf("Minimum password length: %lu\n", Info0->usrmod0_min_passwd_len);
+        PrintPaddedResourceString(IDS_ACCOUNTS_MIN_PW_LENGTH, nPaddedLength);
+        ConPrintf(StdOut, L"%lu\n", Info0->usrmod0_min_passwd_len);
 
-        printf("Password history length: ");
+        PrintPaddedResourceString(IDS_ACCOUNTS_PW_HIST_LENGTH, nPaddedLength);
         if (Info0->usrmod0_password_hist_len == 0)
-            printf("None\n");
+            ConResPuts(StdOut, IDS_GENERIC_NONE);
         else
-            printf("%lu\n", Info0->usrmod0_password_hist_len);
+            ConPrintf(StdOut, L"%lu", Info0->usrmod0_password_hist_len);
+        ConPuts(StdOut, L"\n");
 
-        printf("Lockout threshold: ");
+        PrintPaddedResourceString(IDS_ACCOUNTS_LOCKOUT_THRESHOLD, nPaddedLength);
         if (Info3->usrmod3_lockout_threshold == 0)
-            printf("Never\n");
+            ConResPuts(StdOut, IDS_GENERIC_NEVER);
         else
-            printf("%lu\n", Info3->usrmod3_lockout_threshold);
+            ConPrintf(StdOut, L"%lu", Info3->usrmod3_lockout_threshold);
+        ConPuts(StdOut, L"\n");
 
-        printf("Lockout duration (in minutes): %lu\n", Info3->usrmod3_lockout_duration / 60);
-        printf("Lockout observation window (in minutes): %lu\n", Info3->usrmod3_lockout_observation_window / 60);
+        PrintPaddedResourceString(IDS_ACCOUNTS_LOCKOUT_DURATION, nPaddedLength);
+        ConPrintf(StdOut, L"%lu\n", Info3->usrmod3_lockout_duration / 60);
 
-        printf("Computer role: ");
+        PrintPaddedResourceString(IDS_ACCOUNTS_LOCKOUT_WINDOW, nPaddedLength);
+        ConPrintf(StdOut, L"%lu\n", Info3->usrmod3_lockout_observation_window / 60);
 
+        PrintPaddedResourceString(IDS_ACCOUNTS_COMPUTER_ROLE, nPaddedLength);
         if (Info1->usrmod1_role == UAS_ROLE_PRIMARY)
         {
             if (ProductType == NtProductLanManNt)
             {
-                printf("Primary server\n");
+                ConResPuts(StdOut, IDS_ACCOUNTS_PRIMARY_SERVER);
             }
             else if (ProductType == NtProductServer)
             {
-                printf("Standalone server\n");
+                ConResPuts(StdOut, IDS_ACCOUNTS_STANDALONE_SERVER);
             }
             else
             {
-                printf("Workstation\n");
+                ConResPuts(StdOut, IDS_ACCOUNTS_WORKSTATION);
             }
         }
         else
         {
-            printf("Backup server\n");
+            ConResPuts(StdOut, IDS_ACCOUNTS_BACKUP_SERVER);
         }
+        ConPuts(StdOut, L"\n");
     }
 
 done: