Changeset 477

Show
Ignore:
Timestamp:
10/04/07 17:16:55 (4 years ago)
Author:
andi
Message:

owi updates

Location:
trunk/openmct/packages/system/owi/src
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • trunk/openmct/packages/system/owi/src/group.c

    r465 r477  
    8989 
    9090   /* Start form / external table / scroll area / internal table*/ 
    91    printf("<form action=\"%s\" method=\"post\">\n" 
     91   printf("<h3>%s</h3>\n" 
     92          "<form action=\"%s\" method=\"post\">\n" 
    9293          "<input type=\"hidden\" name=\"module\" value=\"%s\" />\n" 
    9394          "<input type=\"hidden\" name=\"command\" value=\"\" />\n" 
    94           "<table class=\"%s\">\n" 
     95          "<table class=\"outside\">\n" 
    9596          "<tr>\n" 
    9697          "<td>\n" 
    97           "<h1>%s</h1>\n" 
    98           "<br />%s<br /><br />\n" 
    99           "<table width=\"100%%\">\n" 
    100           "<tr>\n" 
    101           "<td align=\"right\">" 
    102           "<div class=\"searchbar\">\n" 
    103           "<input class=\"searchbox\" type=\"text\" name=\"search\" value=\"%s\" /><a href=\"#\" onclick=\"javascript:document.forms[0].reset()\" class=\"searchreset\" title=\"L&ouml;schen\"><img src=\"images/reset.gif\" id=\"searchreset\" border=\"0\" alt=\"\" /></a>\n" 
    104           "</div>\n" 
    105           "</td>\n" 
    106           "</tr>\n" 
    107           "</table>\n" 
    108           "<table class=\"%s\" cellpadding=\"0\" cellspacing=\"0\">\n" 
     98          "<table class=\"list\">\n" 
    10999          "<thead>\n" 
    110100          "<tr>\n" 
     
    112102          "<th>%s</th>\n" 
    113103          "<th>%s</th>\n" 
    114           "<th>%s</th>\n" 
    115104          "</tr>\n" 
    116105          "</thead>\n" 
    117106          "<tbody>", 
     107          GROUP_HEADLINE, 
    118108          getenv("SCRIPT_NAME"), 
    119109          variable_get("module"), 
    120           CONTENT_TABLE_CLASS, 
    121           GROUP_HEADLINE, 
    122           GROUP_DESCRIPTION, 
    123           variable_get("search"), 
    124           CONTENT_TABLE_LIST_CLASS, 
    125110          GROUP_TABLE_DESCRIPTION, 
    126           GROUP_TABLE_GID, 
    127111          GROUP_TABLE_MEMBERS, 
    128112          GROUP_TABLE_ACTION); 
     
    136120            strstr(argument_get_part(group, 1), search)))) { 
    137121         /* Print entry */ 
    138          printf("<tr onmouseover=\"this.style.backgroundColor='%s';\"" 
    139                      " onmouseout=\"this.style.backgroundColor='%s';\">\n" 
    140                 "<td>%s</td>\n" 
    141                 "<td>%s</td>\n" 
    142                 "<td>%s</td>\n" 
    143                 "<td><input type=\"button\" onClick=\"location='%s?module=%s&command=detail&id=%s'\" value=\"%s\" />&nbsp;<input type=\"button\" onClick=\"location='%s?command=delete&id=%s'\" value=\"%s\" /></td>\n" 
     122         printf("<tr onmouseover=\"this.className='mover';\"" 
     123                     " onmouseout=\"this.className='mout';\">\n" 
     124                "<td width=\"200\">%s</td>\n" 
     125                "<td width=\"212\">%s</td>\n" 
     126                "<td width=\"100\"><input type=\"button\" onClick=\"location='%s?module=%s&command=detail&id=%s'\" value=\"%s\" />&nbsp;<input type=\"button\" onClick=\"location='%s?module=%s&amp;command=delete&amp;id=%s'\" value=\"%s\" /></td>\n" 
    144127                "</tr>\n", 
    145                 CONTENT_TABLE_CLASS_MOUSEOVER, 
    146                 CONTENT_TABLE_CLASS_MOUSEOUT, 
    147                 argument_get_part(group, 0), 
    148                 argument_get_part(group, 2), 
     128                argument_get_part(group, 0), 
    149129                argument_get_part(group, 3), 
    150130                getenv("SCRIPT_NAME"), 
     
    153133                GROUP_BUTTON_MODIFY, 
    154134                getenv("SCRIPT_NAME"), 
     135                variable_get("module"), 
    155136                argument_get_part(group, 0), 
    156137                GROUP_BUTTON_DELETE); 
     
    167148          "<tr>\n" 
    168149          "<td colspan=\"7\" align=\"right\">\n" 
    169           "<a class=\"%s\" href=\"#\" onClick=\"location='%s?module=%s&command=new'\"><div class=\"%s\">%s</div></a>\n" 
     150          "<input type=\"button\" onClick=\"location='%s?module=%s&command=new'\" value=\"%s\" />\n" 
    170151          "</td>\n" 
    171152          "</tr>\n" 
     
    175156          "</table>\n" 
    176157          "</form>\n", 
    177           CONTENT_LINK_AQUA_CLASS, 
    178158          getenv("SCRIPT_NAME"), 
    179159          variable_get("module"), 
    180           CONTENT_BUTTON_AQUA_CLASS, 
    181160          GROUP_BUTTON_NEW); 
    182161} 
     
    192171 
    193172   /* Print external table for design */ 
    194    printf("<table class=\"%s\">\n" 
    195           "<tr>\n" 
    196           "<td>\n" 
    197           "<h1>%s</h1>\n" 
    198           "<br />%s<br /><br />\n", 
    199           CONTENT_TABLE_CLASS, 
    200           GROUP_HEADLINE, 
    201           GROUP_DETAIL); 
     173   printf("<h3>%s</h3>\n", 
     174          GROUP_HEADLINE); 
    202175 
    203176   /* Loop through passwd database */ 
     
    211184                "<input type=\"hidden\" name=\"command\" value=\"update\">\n" 
    212185                "<input type=\"hidden\" name=\"id\" value=\"%s\">\n" 
    213                 "<table class=\"%s\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%%\">\n" 
     186                "<table class=\"detail\">\n" 
    214187                "<tr>\n" 
    215188                "<td>%s</td>\n" 
    216189                "<td>%s</td>\n" 
    217                 "</tr>\n" 
    218                 "<tr>\n" 
    219                 "<td>%s</td>\n" 
    220                 "<td><input type=\"group_password\" /></td>\n" 
    221                 "</tr>\n" 
    222                 "<tr>\n" 
    223                 "<td>%s</td>\n" 
    224                 "<td>%s</td>\n" 
    225                 "</tr>\n" 
    226190                "<tr>\n" 
    227191                "<td>%s</td>\n" 
     
    232196                "<tr>\n" 
    233197                "<td colspan=\"2\" align=\"right\">\n" 
    234                 "<a class=\"%s\" href=\"#\" onClick=\"javascript:document.forms[0].submit()\"><div class=\"%s\">%s</div></a>\n" 
     198                "<input type=\"button\" onClick=\"javascript:document.forms[0].submit()\" value=\"%s\" />\n" 
    235199                "</td>\n" 
    236200                "</table>\n" 
     
    240204                variable_get("module"), 
    241205                argument_get_part(group, 0), 
    242                 CONTENT_TABLE_BOX_CLASS, 
    243206                GROUP_TABLE_DESCRIPTION, 
    244207                argument_get_part(group, 0), 
    245                 GROUP_TABLE_NEW_PASSWORD, 
    246                 GROUP_TABLE_GID, 
    247                 argument_get_part(group, 2), 
    248208                GROUP_TABLE_MEMBERS, 
    249209                argument_get_part(group, 3), 
    250                 CONTENT_LINK_AQUA_CLASS, 
    251                 CONTENT_BUTTON_AQUA_CLASS, 
    252210                GROUP_BUTTON_UPDATE); 
    253211 
     
    265223   if (!group_found) { 
    266224      /* Print information screen */ 
    267       owi_headline(2, "Group not found"); 
     225      owi_headline(2, GROUP_NOT_FOUND); 
    268226   } 
    269227 
     
    304262   file_save(GROUP_FILE); 
    305263 
    306    /* Display group */ 
    307    group_detail(groupname); 
     264   /* Display group list */ 
     265   group_list(); 
    308266} 
    309267 
     
    332290   file_save(GROUP_FILE); 
    333291 
    334    /* Display user */ 
     292   /* Display group list */ 
    335293   group_list(); 
    336294} 
     
    394352void group_new() { 
    395353   /* Print external table for design */ 
    396    printf("<table class=\"%s\">\n" 
     354   printf("<h3>%s</h3>\n" 
     355          "<table class=\"outside\">\n" 
    397356          "<tr>\n" 
    398357          "<td>\n" 
    399           "<h1>%s</h1>" 
    400           "<br />%s<br /><br />\n" 
    401358          "<form action=\"%s\" method=\"post\">\n" 
    402359          "<input type=\"hidden\" name=\"module\" value=\"%s\" />\n" 
    403360          "<input type=\"hidden\" name=\"command\" value=\"add\" />\n" 
    404           "<table class=\"%s\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%%\">\n" 
    405           "<tr>\n" 
    406           "<td width=\"250\">%s</td>\n" 
    407           "<td><input type=\"text\" name=\"id\" /></td>\n" 
    408           "</tr>\n" 
    409           "<tr>\n" 
    410           "<td>%s</td>\n" 
    411           "<td><input type=\"password\" /></td>\n" 
    412           "</tr>\n" 
    413           "<tr>\n" 
    414           "<td>%s</td>\n" 
    415           "<td><input type=\"text\" name=\"members\" /></td>\n" 
    416           "</tr>\n" 
    417           "</table>\n" 
    418           "<table width=\"100%%\">\n" 
    419           "<tr>\n" 
    420           "<td colspan=\"2\" align=\"right\">\n" 
    421           "<a class=\"%s\" href=\"#\" onClick=\"javascript:document.forms[0].submit()\"><div class=\"%s\">%s</div></a>\n" 
     361          "<table class=\"detail\">\n" 
     362          "<tr>\n" 
     363          "<td class=\"description\">%s</td>\n" 
     364          "<td class=\"value\"><input type=\"text\" name=\"id\" /></td>\n" 
     365          "</tr>\n" 
     366          "<tr>\n" 
     367          "<td class=\"description\">%s</td>\n" 
     368          "<td class=\"value\"><input type=\"text\" name=\"members\" /></td>\n" 
     369          "</tr>\n" 
     370          "<tr>\n" 
     371          "<td></td>\n" 
     372          "<td>\n" 
     373          "<input type=\"button\" onClick=\"javascript:document.forms[0].submit()\" value=\"%s\" />\n" 
    422374          "</td>\n" 
    423375          "</table>\n" 
     
    426378          "</tr>\n" 
    427379          "</table>\n", 
    428           CONTENT_TABLE_CLASS, 
    429380          GROUP_HEADLINE, 
    430           GROUP_NEW, 
    431381          getenv("SCRIPT_NAME"), 
    432382          variable_get("module"), 
    433           CONTENT_TABLE_BOX_CLASS, 
    434383          GROUP_TABLE_DESCRIPTION, 
    435           GROUP_TABLE_NEW_PASSWORD, 
    436384          GROUP_TABLE_MEMBERS, 
    437           CONTENT_LINK_AQUA_CLASS, 
    438           CONTENT_BUTTON_AQUA_CLASS, 
    439385          GROUP_BUTTON_ADD); 
    440386} 
  • trunk/openmct/packages/system/owi/src/includes/language.h

    r468 r477  
    33/* user */ 
    44 
    5 #define  USER_TABLE_DESCRIPTION              "Kennung" 
    6 #define  USER_TABLE_NEW_PASSWORD             "Neues Passwort" 
    7 #define  USER_TABLE_UID                      "User ID" 
    8 #define  USER_TABLE_GID                      "Gruppen ID" 
    9 #define  USER_TABLE_GECOS                    "Bemerkung" 
    10 #define  USER_TABLE_DIRECTORY                "Heimatverzeichnis" 
    11 #define  USER_TABLE_SHELL                    "Loginprogramm" 
    12 #define  USER_TABLE_ACTION                   "Aktion" 
    13 #define  USER_HEADLINE                       "Benutzerverwaltung" 
    14 #define  USER_DESCRIPTION                    "Die nachfolgende Liste f&uuml;hrt Ihre System Kennungen an. Hier k&ouml;nnen Sie alle Kennungen (auch das Administrator Konto) einsehen und &Auml;nderungen durchf&uuml;hren. F&uuml;r mehr Informationen zu einer Kennung verwenden Sie bitte den <i>Bearbeiten</i> Button in der entsprechenden Zeile." 
    15 #define  USER_DETAIL                         "Sie befinden Sich nun im Detailbereich f&uuml;r eine Kennung. Hier k&ouml;nnen Sie sowohl das Kennwort als auch das Heimatverzeichnis sowies diverse andere Einstellungen (Beschreibung, Loginprogramm) aktualisieren. Die Einstellungen werden mit dem Bet&auml;tigen des <i>Speichern</i> Buttons sofort &uuml;bernommen." 
    16 #define  USER_NEW                            "In diesem Bereich k&ouml;nnen Sie eine neue System Kennung erstellen. Bitte geben Sie dazu alle Felder an um sicherzustellen, dass die Kennung dann ordnungsgem&auml;&szlig; funktioniert. Sobald alle Daten eingegeben worden sind kann die Aktion mit dem Klicken auf den <i>Neu</i> Button abgeschlossen werden." 
    17 #define  USER_FILE_FAILED                    "Benutzerdatenbank konnte nicht ge&ouml;ffnet werden" 
    18 #define  USER_NOT_FOUND                      "Kennung konnte nicht gefunden werden" 
    19 #define  USER_BUTTON_NEW                     "Neu" 
    20 #define  USER_BUTTON_DELETE                  "Entfernen" 
    21 #define  USER_BUTTON_MODIFY                  "Bearbeiten" 
    22 #define  USER_BUTTON_UPDATE                  "Speichern" 
    23 #define  USER_BUTTON_ADD                     "Anlegen" 
    24 #define  USER_NAV_DESCRIPTION                "Kennung" 
     5#define  USER_TABLE_DESCRIPTION              "Login" 
     6#define  USER_TABLE_NEW_PASSWORD             "Password" 
     7#define  USER_TABLE_GECOS                    "Full Name" 
     8#define  USER_TABLE_ACTION                   "Action" 
     9#define  USER_HEADLINE                       "Access: Users" 
     10#define  USER_FILE_FAILED                    "Can't open user database" 
     11#define  USER_NOT_FOUND                      "Can't find user" 
     12#define  USER_BUTTON_NEW                     "New" 
     13#define  USER_BUTTON_DELETE                  "Delete" 
     14#define  USER_BUTTON_MODIFY                  "Edit" 
     15#define  USER_BUTTON_UPDATE                  "Save" 
     16#define  USER_BUTTON_ADD                     "Add" 
     17#define  USER_NAV_DESCRIPTION                "User" 
     18#define  USER_LOGIN_DESCRIPTION              "Unique login name of user." 
     19#define  USER_GECOS_DESCRIPTION              "User full name." 
     20#define  USER_PASSWORD_DESCRIPTION           "User password." 
     21#define  USER_ALREADY_EXISTS                 "User already exists" 
     22#define  USER_TABLE_SHELL                    "Full Shell" 
     23#define  USER_SHELL_DESCRIPTION              "Give full shell to user" 
    2524 
    2625/* group */ 
    2726 
    28 #define  GROUP_TABLE_DESCRIPTION             "Gruppe" 
    29 #define  GROUP_TABLE_NEW_PASSWORD            "Neues Passwort" 
    30 #define  GROUP_TABLE_GID                     "Gruppen ID" 
    31 #define  GROUP_TABLE_MEMBERS                 "Mitglieder" 
    32 #define  GROUP_TABLE_ACTION                  "Aktion" 
    33 #define  GROUP_BUTTON_DELETE                 "Entfernen" 
    34 #define  GROUP_BUTTON_NEW                    "Neu" 
    35 #define  GROUP_BUTTON_MODIFY                 "Bearbeiten" 
    36 #define  GROUP_BUTTON_ADD                    "Anlegen" 
    37 #define  GROUP_BUTTON_UPDATE                 "Speichern" 
    38 #define  GROUP_HEADLINE                      "Gruppenverwaltung" 
    39 #define  GROUP_FILE_FAILED                   "Gruppendatenbank konnte nicht ge&ouml;ffnet werden" 
    40 #define  GROUP_DESCRIPTION                    "Die nachfolgende Liste f&uuml;hrt Ihre System Gruppen an. Hier k&ouml;nnen Sie alle Gruppen einsehen und &Auml;nderungen durchf&uuml;hren. F&uuml;r mehr Informationen zu einer Gruppe verwenden Sie bitte den <i>Bearbeiten</i> Button in der entsprechenden Zeile." 
    41 #define  GROUP_DETAIL                         "Sie befinden Sich nun im Detailbereich f&uuml;r eine Gruppe. Hier k&ouml;nnen Sie sowohl das Kennwort als auch die Mitglieder dieser Gruppe anpassen. Die Einstellungen werden mit dem Bet&auml;tigen des <i>Speichern</i> Buttons sofort &uuml;bernommen." 
    42 #define  GROUP_NEW                            "In diesem Bereich k&ouml;nnen Sie eine neue System Gruppe erstellen. Bitte geben Sie dazu alle Felder an um sicherzustellen, dass die Gruppe dann ordnungsgem&auml;&szlig; funktioniert. Sobald alle Daten eingegeben worden sind kann die Aktion mit dem Klicken auf den <i>Neu</i> Button abgeschlossen werden." 
    43 #define  GROUP_NAV_DESCRIPTION               "Gruppe" 
     27#define  GROUP_TABLE_DESCRIPTION             "Group" 
     28#define  GROUP_TABLE_MEMBERS                 "Members" 
     29#define  GROUP_TABLE_ACTION                  "Action" 
     30#define  GROUP_BUTTON_DELETE                 "Delete" 
     31#define  GROUP_BUTTON_NEW                    "New" 
     32#define  GROUP_BUTTON_MODIFY                 "Edit" 
     33#define  GROUP_BUTTON_ADD                    "Add" 
     34#define  GROUP_BUTTON_UPDATE                 "Save" 
     35#define  GROUP_HEADLINE                      "Access: Groups" 
     36#define  GROUP_NAV_DESCRIPTION               "Group" 
     37#define  GROUP_FILE_FAILED                   "Can't open group database" 
     38#define  GROUP_NOT_FOUND                     "Can't find group" 
    4439 
    4540/* sysinfo */ 
     
    4843#define  SYSINFO_NAV_SYSTEM                  "System" 
    4944#define  SYSINFO_NAV_DESCRIPTION             "DESC" 
     45#define  SYSINFO_PROCESS_HEADLINE            "Status: Processes" 
     46#define  SYSTEM_NAV_DESCRIPTION              "System" 
     47#define  STATUS_NAV_DESCRIPTION              "Status" 
     48#define  PROCESS_NAV_DESCRIPTION             "Process" 
    5049 
    5150/* nfs */ 
     
    121120#define  INTERFACE_NAV_DESCRIPTION                "Netzwerk" 
    122121 
     122#define  ACCESS_NAV_DESCRIPTION                   "System" 
     123 
    123124#endif 
  • trunk/openmct/packages/system/owi/src/includes/modules.h

    r468 r477  
    1616   int  level; 
    1717} modules[] = { 
     18/* 
    1819   { "system", NULL, SYSINFO_NAV_SYSTEM, 0 }, 
    1920   { "sysinfo", sysinfo_main, SYSINFO_NAV_DESCRIPTION, 1}, 
     
    2526#ifdef SECURITY 
    2627   { "shell", shell_main, SHELL_NAV_DESCRIPTION, 1 }, 
    27 #endif    
     28#endif   */ 
     29   { "access", NULL, ACCESS_NAV_DESCRIPTION, 0 }, 
     30   { "user", user_main, USER_NAV_DESCRIPTION, 1 }, 
     31   { "group", group_main, GROUP_NAV_DESCRIPTION, 1 }, 
     32   { "status", NULL, STATUS_NAV_DESCRIPTION, 0 }, 
     33   { "system", sysinfo_main, SYSTEM_NAV_DESCRIPTION, 1 }, 
     34   { "system&amp;command=process", sysinfo_main, PROCESS_NAV_DESCRIPTION, 1 }, 
    2835   { NULL, NULL, NULL, 0 } 
    2936}; 
  • trunk/openmct/packages/system/owi/src/includes/sysinfo.h

    r419 r477  
    11int sysinfo_main(int argc, char **); 
    22void sysinfo_list(); 
     3void sysinfo_process(); 
    34void sysinfo_general(); 
    45void sysinfo_filesystems(); 
  • trunk/openmct/packages/system/owi/src/includes/user.h

    r423 r477  
    11#define USER_FILE       "/etc/passwd" 
     2 
     3#define USER_SHELL_FALSE "/bin/false" 
     4#define USER_SHELL_DEFAULT "/bin/sh" 
    25 
    36int user_main(int argc, char **arv); 
  • trunk/openmct/packages/system/owi/src/owi.c

    r468 r477  
    3434   /* Loop counter */ 
    3535   int i = 0; 
     36   int j = 0; 
    3637 
    3738   printf("Content-Type: text/html\n\n"); 
     
    5859   for (i = 0; modules[i].description != NULL; i++) { 
    5960      printf("<tr><td>\n"); 
     61      for (j = 0; j < modules[i].level * 5; j++) { 
     62         printf("&nbsp;"); 
     63      } 
    6064      if (modules[i].main) { 
    6165         printf("<a href=\"%s?module=%s\">%s</a>\n", 
     
    102106 
    103107   if (!strcmp(module, "")) { 
    104       variable_set("module", "sysinfo"); 
     108      variable_set("module", "user"); 
    105109      module =  variable_get("module"); 
    106110   } 
  • trunk/openmct/packages/system/owi/src/sysinfo.c

    r468 r477  
    5858      /* Just print user list */ 
    5959      sysinfo_list(); 
     60   } else if (!strcmp(command, "process")) { 
     61      sysinfo_process(); 
    6062   } 
    6163 
     
    134136          "0"); 
    135137} 
     138 
     139/* \fn sysinfo_process() 
     140 * Show process 
     141 */ 
     142void sysinfo_process() { 
     143   int i = 0; 
     144 
     145   printf("<h3>%s</h3>\n" 
     146          "<table class=\"box\">\n" 
     147          "<tr>\n" 
     148          "<td>\n" 
     149          "<pre>\n", 
     150          SYSINFO_PROCESS_HEADLINE); 
     151 
     152   /* Execute command now */ 
     153   proc_open("/bin/ps"); 
     154   /* Loop through results */ 
     155   for (i = 0; i < file_line_counter; i++) { 
     156      printf("%s\n", file_line_get(i)); 
     157   } 
     158   file_free(); 
     159 
     160   printf("</pre>\n" 
     161          "</td>\n" 
     162          "</tr>\n" 
     163          "</table>\n"); 
     164 
     165 
     166    
     167} 
  • trunk/openmct/packages/system/owi/src/user.c

    r468 r477  
    8989 
    9090   /* Start form / external table / scroll area / internal table*/ 
    91    printf("<form action=\"%s\" method=\"post\">\n" 
     91   printf("<h3>%s</h3>\n" 
     92          "<form action=\"%s\" method=\"post\">\n" 
    9293          "<input type=\"hidden\" name=\"module\" value=\"%s\" />\n" 
    9394          "<input type=\"hidden\" name=\"command\" value=\"\" />\n" 
    94           "<table class=\"%s\">\n" 
    95           "<tr>\n" 
     95          "<table class=\"outside\">\n" 
     96          "<tr>\n" 
    9697          "<td>\n" 
    97           "<h1>%s</h1>\n" 
    98           "<br />%s<br /><br />\n" 
    99           "<table width=\"100%%\">\n" 
    100           "<tr>\n" 
    101           "<td align=\"right\">" 
    102           "<div class=\"searchbar\">\n" 
    103           "<input class=\"searchbox\" type=\"text\" name=\"search\" value=\"%s\" /><a href=\"#\" onclick=\"javascript:document.forms[0].reset()\" class=\"searchreset\" title=\"L&ouml;schen\"><img src=\"images/reset.gif\" id=\"searchreset\" border=\"0\" alt=\"\" /></a>\n" 
    104           "</div>\n" 
    105           "</td>\n" 
    106           "</tr>\n" 
    107           "</table>\n" 
    108           "<table class=\"%s\" cellpadding=\"0\" cellspacing=\"0\">\n" 
     98          "<table class=\"list\">\n" 
    10999          "<thead>\n" 
    110100          "<tr>\n" 
    111101          "<th>%s</th>\n" 
    112102          "<th>%s</th>\n" 
     103          "<th>%s</th>\n" 
    113104          "</tr>\n" 
    114105          "</thead>\n" 
    115106          "<tbody>", 
     107          USER_HEADLINE, 
    116108          getenv("SCRIPT_NAME"), 
    117109          variable_get("module"), 
    118           CONTENT_TABLE_CLASS, 
    119           USER_HEADLINE, 
    120           USER_DESCRIPTION, 
    121           variable_get("search"), 
    122           CONTENT_TABLE_LIST_CLASS, 
    123110          USER_TABLE_DESCRIPTION, 
     111          USER_TABLE_GECOS, 
    124112          USER_TABLE_ACTION); 
    125113 
     
    138126            strstr(argument_get_part(passwd, 5), search)))) { 
    139127         /* Print entry */ 
    140          printf("<tr onmouseover=\"this.className='%s';\"" 
    141                 " onmouseout=\"this.className='%s';\">\n" 
    142                 "<td width=\"80\">%s</td>\n" 
    143                 "<td width=\"160\">" 
    144                 "<input type=\"button\" onClick=\"location='%s?module=%s&command=detail&amp;id=%s'\" value=\"%s\" />&nbsp;" 
    145                 "<input type=\"button\" onClick=\"location='%s?module=%s&command=delete&amp;id=%s'\" value=\"%s\" />" 
     128         printf("<tr onmouseover=\"this.className='mover';\"" 
     129                " onmouseout=\"this.className='mout';\">\n" 
     130                "<td width=\"200\">%s</td>\n" 
     131                "<td width=\"212\">%s</td>\n" 
     132                "<td width=\"100\">" 
     133                "<input type=\"button\" onClick=\"location='%s?module=%s&amp;command=detail&amp;id=%s'\" value=\"%s\" />&nbsp;" 
     134                "<input type=\"button\" onClick=\"location='%s?module=%s&amp;command=delete&amp;id=%s'\" value=\"%s\" />" 
    146135                "</td>\n" 
    147136                "</tr>\n", 
    148                 CONTENT_TABLE_CLASS_MOUSEOVER, 
    149                 CONTENT_TABLE_CLASS_MOUSEOUT, 
    150137                argument_get_part(passwd, 0), 
     138                argument_get_part(passwd, 4), 
    151139                getenv("SCRIPT_NAME"), 
    152140                variable_get("module"), 
     
    169157          "<tr>\n" 
    170158          "<td colspan=\"7\" align=\"right\">\n" 
    171           "<a class=\"%s\" href=\"#\" onClick=\"location='%s?module=%s&command=new'\"><div class=\"%s\">%s</div></a>\n" 
     159          "<input type=\"button\" onClick=\"location='%s?module=%s&amp;command=new'\" value=\"%s\" />\n" 
    172160          "</td>\n" 
    173161          "</tr>\n" 
    174162          "</table>\n" 
    175           "</td>\n" 
    176           "</tr>\n" 
     163          "</td>\n" 
     164          "</tr>\n" 
    177165          "</table>\n" 
    178166          "</form>\n", 
    179           CONTENT_LINK_AQUA_CLASS, 
    180167          getenv("SCRIPT_NAME"), 
    181168          variable_get("module"), 
    182           CONTENT_BUTTON_AQUA_CLASS, 
    183169          USER_BUTTON_NEW); 
    184170} 
     
    195181 
    196182   /* Print external table for design */ 
    197    printf("<table class=\"%s\">\n" 
    198           "<tr>\n" 
    199           "<td>\n" 
    200           "<h1>%s</h1>\n" 
    201           "<br />%s<br /><br />\n", 
    202           CONTENT_TABLE_CLASS, 
    203           USER_HEADLINE, 
    204           USER_DETAIL); 
     183   printf("<h3>%s</h3>\n" 
     184          "<table class=\"outside\">\n" 
     185          "<tr>\n" 
     186          "<td>\n", 
     187          USER_HEADLINE); 
    205188 
    206189   /* Loop through all user entries in /etc/passwd */ 
     
    214197                "<input type=\"hidden\" name=\"command\" value=\"update\" />\n" 
    215198                "<input type=\"hidden\" name=\"id\" value=\"%s\" />\n" 
    216                 "<table class=\"%s\" width=\"100%%\">\n" 
     199                "<table class=\"detail\">\n" 
    217200                "<tr>\n" 
    218                 "<td width=\"250\">%s</td>\n" 
    219                 "<td>%s</td>\n" 
     201                "<td width=\"200\" class=\"description\">%s</td>\n" 
     202                "<td width=\"312\" class=\"value\">%s</td>\n" 
    220203                "</tr>\n" 
    221204                "<tr>\n" 
    222                 "<td>%s</td>\n" 
    223                 "<td><input type=\"password\" /></td>\n" 
     205                "<td class=\"description\">%s</td>\n" 
     206                "<td class=\"value\"><input type=\"password\" name=\"password\" /><br />%s</td>\n" 
    224207                "</tr>\n" 
    225208                "<tr>\n" 
    226                 "<td>%s</td>\n" 
    227                 "<td>%s</td>\n" 
     209                "<td class=\"description\">%s</td>\n" 
     210                "<td class=\"value\"><input type=\"text\" name=\"gecos\" value=\"%s\" /><br />%s</td>\n" 
    228211                "</tr>\n" 
    229212                "<tr>\n" 
    230                 "<td>%s</td>\n" 
    231                 "<td>%s</td>\n" 
     213                "<td class=\"description\">%s</td>\n" 
     214                "<td class=\"value\"><input type=\"checkbox\" name=\"shell\" value=\"y\" %s /><br />%s</td>\n" 
    232215                "</tr>\n" 
    233216                "<tr>\n" 
    234                 "<td>%s</td>\n" 
    235                 "<td><input type=\"text\" name=\"gecos\" value=\"%s\" /></td>\n" 
    236                 "</tr>\n" 
    237                 "<tr>\n" 
    238                 "<td>%s</td>\n" 
    239                 "<td><input type=\"text\" name=\"directory\" value=\"%s\" /></td>\n" 
    240                 "</tr>\n" 
    241                 "<tr>\n" 
    242                 "<td>%s</td>\n" 
    243                 "<td><input type=\"text\" name=\"shell\" value=\"%s\" /></td>\n" 
    244                 "</tr>\n" 
    245                 "</table>\n" 
    246                 "<table width=\"100%%\">\n" 
    247                 "<tr>\n" 
    248                 "<td colspan=\"2\" align=\"right\">\n" 
    249                 "<a href=\"#\" onClick=\"javascript:document.forms[0].submit()\" class=\"%s\"><div class=\"%s\">%s</div></a>\n" 
     217                "<td></td>\n" 
     218                "<td>\n" 
     219                "<input type=\"button\" onClick=\"javascript:document.forms[0].submit()\" value=\"%s\" />\n" 
    250220                "</td>\n" 
    251221                "</tr>\n" 
     
    256226                variable_get("module"), 
    257227                argument_get_part(passwd, 0), 
    258                 CONTENT_TABLE_BOX_CLASS, 
    259228                USER_TABLE_DESCRIPTION, 
    260229                argument_get_part(passwd, 0), 
    261230                USER_TABLE_NEW_PASSWORD, 
    262                 USER_TABLE_UID, 
    263                 argument_get_part(passwd, 2), 
    264                 USER_TABLE_GID, 
    265                 argument_get_part(passwd, 3), 
     231                USER_PASSWORD_DESCRIPTION, 
    266232                USER_TABLE_GECOS, 
    267233                argument_get_part(passwd, 4), 
    268                 USER_TABLE_DIRECTORY, 
    269                 argument_get_part(passwd, 5), 
     234                USER_GECOS_DESCRIPTION, 
    270235                USER_TABLE_SHELL, 
    271                 argument_get_part(passwd, 6), 
    272                 CONTENT_LINK_AQUA_CLASS, 
    273                 CONTENT_BUTTON_AQUA_CLASS, 
     236                strcmp(argument_get_part(passwd, 6), USER_SHELL_FALSE) == 0 ? "" : "checked",               
     237                USER_SHELL_DESCRIPTION, 
    274238                USER_BUTTON_UPDATE); 
    275239 
     
    290254   } 
    291255 
    292    /* Close external table */ 
    293256   printf("</td>\n" 
    294257          "</tr>\n" 
     
    317280                          argument_get_part(passwd, 2), 
    318281                          argument_get_part(passwd, 3), 
    319                           variable_ltrim(variable_filter(variable_get("gecos"), ":")), 
    320                           variable_ltrim(variable_filter(variable_get("directory"), ":")), 
    321                           variable_ltrim(variable_filter(variable_get("shell"), ":"))); 
     282                          variable_get("gecos"), 
     283                          argument_get_part(passwd, 5), 
     284                          argument_get_part(passwd, 6)); 
    322285      } 
    323286      /* Free passwd entry */ 
     
    328291   file_save(USER_FILE); 
    329292 
    330    /* Display user */ 
    331    user_detail(username); 
     293   /* Display user list */ 
     294   user_list(); 
    332295} 
    333296 
     
    372335      /* Add new passwd line in memory */ 
    373336      file_line_action(FILE_LINE_ADD, i, 
    374                        "%s:%s:%d:%d:%s:%s:%s", 
     337                       "%s:%s:%d:%d:%s:/home/%s:%s", 
    375338                       variable_ltrim(variable_filter(username, ":")), 
    376339                       crypt(variable_get("password"), "OM"), 
     
    378341                       start_uid, 
    379342                       variable_ltrim(variable_filter(variable_get("gecos"), ":")), 
    380                        variable_ltrim(variable_filter(variable_get("directory"), ":")), 
    381                        variable_ltrim(variable_filter(variable_get("shell"), ":"))); 
     343                       variable_ltrim(variable_filter(username, ":")), 
     344                       strcmp(variable_get("shell"), "y") == 0 ? USER_SHELL_DEFAULT : USER_SHELL_FALSE); 
    382345      /* Save result in user file */ 
    383346      file_save(USER_FILE); 
    384    } 
    385  
    386    /* Display new user*/ 
    387    user_detail(username); 
     347      /* Display user list */ 
     348      user_list(); 
     349   } else { 
     350      variable_set("error", USER_ALREADY_EXISTS); 
     351      /* Display user add page with error */ 
     352      user_new(); 
     353   } 
    388354} 
    389355 
     
    412378   file_save(USER_FILE); 
    413379 
    414    /* Display user */ 
     380   /* Display user list */ 
    415381   user_list(); 
    416382} 
     
    421387void user_new() { 
    422388   /* Print external table for design */ 
    423    printf("<table class=\"%s\">\n" 
    424           "<tr>\n" 
    425           "<td>\n" 
    426           "<h1>%s</h1>" 
    427           "<br />%s<br /><br />\n" 
    428           "<form action=\"%s\" method=\"post\">\n" 
     389   printf("<h3>%s</h3>", 
     390          USER_HEADLINE); 
     391 
     392   if (strcmp(variable_get("error"), "")) {        
     393      printf("<div class=\"error\">%s</div>\n", 
     394             variable_get("error")); 
     395   }          
     396           
     397   printf("<form action=\"%s\" method=\"post\">\n" 
    429398          "<input type=\"hidden\" name=\"module\" value=\"%s\" />\n" 
    430399          "<input type=\"hidden\" name=\"command\" value=\"add\" />\n" 
    431           "<table class=\"%s\" width=\"100%%\">\n" 
    432           "<tr>\n" 
    433           "<td width=\"250\">%s</td>\n" 
    434           "<td><input type=\"text\" name=\"id\" /></td>\n" 
    435           "</tr>\n" 
    436           "<tr>\n" 
    437           "<td>%s</td>\n" 
    438           "<td><input type=\"password\" /></td>\n" 
    439           "</tr>\n" 
    440           "<tr>\n" 
    441           "<td>%s</td>\n" 
    442           "<td><input type=\"text\" name=\"gecos\" /></td>\n" 
    443           "</tr>\n" 
    444           "<tr>\n" 
    445           "<td>%s</td>\n" 
    446           "<td><input type=\"text\" name=\"directory\" /></td>\n" 
    447           "</tr>\n" 
    448           "<tr>\n" 
    449           "<td>%s</td>\n" 
    450           "<td><input type=\"text\" name=\"shell\" /></td>\n" 
    451           "</tr>\n" 
    452           "</table>\n" 
    453           "<table width=\"100%%\">\n" 
    454           "<tr>\n" 
    455           "<td colspan=\"2\" align=\"right\">\n" 
    456           "<a href=\"#\" onClick=\"javascript:document.forms[0].submit()\" class=\"%s\"><div class=\"%s\">%s</div></a>\n" 
     400          "<table class=\"outside\">\n" 
     401          "<tr>\n" 
     402          "<td>\n" 
     403          "<table class=\"detail\">\n" 
     404          "<tr>\n" 
     405          "<td class=\"description\">%s</td>\n" 
     406          "<td class=\"value\"><input type=\"text\" name=\"id\" value=\"%s\" /><br />%s</td>\n" 
     407          "</tr>\n" 
     408          "<tr>\n" 
     409          "<td class=\"description\">%s</td>\n" 
     410          "<td class=\"value\"><input type=\"password\" name=\"password\" value=\"%s\" /><br />%s</td>\n" 
     411          "</tr>\n" 
     412          "<tr>\n" 
     413          "<td class=\"description\">%s</td>\n" 
     414          "<td class=\"value\"><input type=\"text\" name=\"gecos\" value=\"%s\" /><br />%s</td>\n" 
     415          "</tr>\n" 
     416          "<tr>\n" 
     417          "<td class=\"description\">%s</td>\n" 
     418          "<td class=\"value\"><input type=\"checkbox\" name=\"shell\" value=\"y\" %s /><br />%s</td>\n" 
     419          "</tr>\n" 
     420          "<tr>\n" 
     421          "<td></td>\n" 
     422          "<td>\n" 
     423          "<input type=\"button\" onClick=\"javascript:document.forms[0].submit()\" value=\"%s\" />\n" 
    457424          "</td>\n" 
    458425          "</tr>\n" 
    459426          "</table>\n" 
    460           "</form>\n" 
    461           "</td>\n" 
    462           "</tr>\n" 
    463           "</table>\n", 
    464           CONTENT_TABLE_CLASS, 
    465           USER_HEADLINE, 
    466           USER_NEW, 
     427          "</form>\n", 
    467428          getenv("SCRIPT_NAME"), 
    468429          variable_get("module"), 
    469           CONTENT_TABLE_BOX_CLASS, 
    470430          USER_TABLE_DESCRIPTION, 
     431          variable_get("id"), 
     432          USER_LOGIN_DESCRIPTION, 
    471433          USER_TABLE_NEW_PASSWORD, 
     434          variable_get("password"), 
     435          USER_PASSWORD_DESCRIPTION, 
    472436          USER_TABLE_GECOS, 
    473           USER_TABLE_DIRECTORY, 
    474           USER_TABLE_SHELL, 
    475           CONTENT_LINK_AQUA_CLASS, 
    476           CONTENT_BUTTON_AQUA_CLASS, 
     437          variable_get("gecos"), 
     438          USER_GECOS_DESCRIPTION, 
     439          USER_TABLE_SHELL, 
     440          strcmp(variable_get("shell"), "y") == 0 ? "checked" : "", 
     441          USER_SHELL_DESCRIPTION, 
    477442          USER_BUTTON_ADD); 
    478443}