Changeset 465

Show
Ignore:
Timestamp:
10/03/07 14:04:56 (4 years ago)
Author:
andi
Message:

use module parameter instead of binary name for module lookup

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

Legend:

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

    r429 r465  
    104104          "<br />%s<br /><br />\n" 
    105105          "<form action=\"%s\" method=\"post\">\n" 
     106          "<input type=\"hidden\" name=\"module\" value=\"%s\" />\n" 
    106107          "<input type=\"hidden\" name=\"command\" value=\"update\" />\n" 
    107108          "<table class=\"%s\" width=\"100%%\" cellspacing=\"0\" cellpading=\"0\">\n" 
     
    115116          FTP_DETAIL, 
    116117          getenv("SCRIPT_NAME"), 
     118          variable_get("module"), 
    117119          CONTENT_TABLE_BOX_CLASS); 
    118120 
  • trunk/openmct/packages/system/owi/src/group.c

    r430 r465  
    9090   /* Start form / external table / scroll area / internal table*/ 
    9191   printf("<form action=\"%s\" method=\"post\">\n" 
     92          "<input type=\"hidden\" name=\"module\" value=\"%s\" />\n" 
    9293          "<input type=\"hidden\" name=\"command\" value=\"\" />\n" 
    9394          "<table class=\"%s\">\n" 
     
    116117          "<tbody>", 
    117118          getenv("SCRIPT_NAME"), 
     119          variable_get("module"), 
    118120          CONTENT_TABLE_CLASS, 
    119121          GROUP_HEADLINE, 
     
    139141                "<td>%s</td>\n" 
    140142                "<td>%s</td>\n" 
    141                 "<td><input type=\"button\" onClick=\"location='%s?command=detail&id=%s'\" value=\"%s\" />&nbsp;<input type=\"button\" onClick=\"location='%s?command=delete&id=%s'\" value=\"%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" 
    142144                "</tr>\n", 
    143145                CONTENT_TABLE_CLASS_MOUSEOVER, 
     
    147149                argument_get_part(group, 3), 
    148150                getenv("SCRIPT_NAME"), 
     151                variable_get("module"), 
    149152                argument_get_part(group, 0), 
    150153                GROUP_BUTTON_MODIFY, 
     
    164167          "<tr>\n" 
    165168          "<td colspan=\"7\" align=\"right\">\n" 
    166           "<a class=\"%s\" href=\"#\" onClick=\"location='%s?command=new'\"><div class=\"%s\">%s</div></a>\n" 
     169          "<a class=\"%s\" href=\"#\" onClick=\"location='%s?module=%s&command=new'\"><div class=\"%s\">%s</div></a>\n" 
    167170          "</td>\n" 
    168171          "</tr>\n" 
     
    174177          CONTENT_LINK_AQUA_CLASS, 
    175178          getenv("SCRIPT_NAME"), 
     179          variable_get("module"), 
    176180          CONTENT_BUTTON_AQUA_CLASS, 
    177181          GROUP_BUTTON_NEW); 
     
    204208      if (!strcmp(argument_get_part(group, 0), groupname)) { 
    205209         printf("<form action=\"%s\" method=\"POST\">\n" 
     210                "<input type=\"hidden\" name=\"module\" value=\"%s\">\n" 
    206211                "<input type=\"hidden\" name=\"command\" value=\"update\">\n" 
    207212                "<input type=\"hidden\" name=\"id\" value=\"%s\">\n" 
     
    233238                , 
    234239                getenv("SCRIPT_NAME"), 
     240                variable_get("module"), 
    235241                argument_get_part(group, 0), 
    236242                CONTENT_TABLE_BOX_CLASS, 
     
    394400          "<br />%s<br /><br />\n" 
    395401          "<form action=\"%s\" method=\"post\">\n" 
     402          "<input type=\"hidden\" name=\"module\" value=\"%s\" />\n" 
    396403          "<input type=\"hidden\" name=\"command\" value=\"add\" />\n" 
    397404          "<table class=\"%s\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%%\">\n" 
     
    423430          GROUP_NEW, 
    424431          getenv("SCRIPT_NAME"), 
     432          variable_get("module"), 
    425433          CONTENT_TABLE_BOX_CLASS, 
    426434          GROUP_TABLE_DESCRIPTION, 
  • trunk/openmct/packages/system/owi/src/interface.c

    r429 r465  
    9393   /* Start form / external table / scroll area / internal table*/ 
    9494   printf("<form action=\"%s\" method=\"post\">\n" 
     95          "<input type=\"hidden\" name=\"module\" value=\"%s\" />\n" 
    9596          "<input type=\"hidden\" name=\"command\" value=\"\" />\n" 
    9697          "<table class=\"%s\">\n" 
     
    118119          "<tbody>", 
    119120          getenv("SCRIPT_NAME"), 
     121          variable_get("module"), 
    120122          CONTENT_TABLE_CLASS, 
    121123          INTERFACE_HEADLINE, 
     
    159161                "<td width=\"160\">%s</td>\n" 
    160162                "<td width=\"160\">" 
    161                 "<input type=\"button\" onClick=\"location='%s?command=detail&amp;id=%s'\" value=\"%s\" />&nbsp;" 
    162                 "<input type=\"button\" onClick=\"location='%s?command=delete&amp;id=%s'\" value=\"%s\" />" 
     163                "<input type=\"button\" onClick=\"location='%s?module=%s&command=detail&amp;id=%s'\" value=\"%s\" />&nbsp;" 
     164                "<input type=\"button\" onClick=\"location='%s?module=%s&command=delete&amp;id=%s'\" value=\"%s\" />" 
    163165                "</td>\n" 
    164166                "</tr>\n", 
     
    170172                interface_ini[2].current ? interface_ini[2].current[1] : "", 
    171173                getenv("SCRIPT_NAME"), 
     174                variable_get("module"), 
    172175                current_interface, 
    173176                INTERFACE_BUTTON_MODIFY, 
    174177                getenv("SCRIPT_NAME"), 
     178                variable_get("module"), 
    175179                current_interface, 
    176180                INTERFACE_BUTTON_DELETE); 
     
    226230          "<tr>\n" 
    227231          "<td colspan=\"7\" align=\"right\">\n" 
    228           "<input type=\"button\" onClick=\"location='%s?command=new'\" value=\"%s\" />" 
     232          "<input type=\"button\" onClick=\"location='%s?module=%s&command=new'\" value=\"%s\" />" 
    229233          "</td>\n" 
    230234          "</tr>\n" 
     
    235239          "</form>\n", 
    236240          getenv("SCRIPT_NAME"), 
     241          variable_get("module"), 
    237242          INTERFACE_BUTTON_NEW); 
    238243} 
     
    279284            /* Print network interface */ 
    280285            printf("<form action=\"%s\" method=\"post\">\n" 
     286                   "<input type=\"hidden\" name=\"module\" value=\"%s\" />\n" 
    281287                   "<input type=\"hidden\" name=\"command\" value=\"update\" />\n" 
    282288                   "<input type=\"hidden\" name=\"id\" value=\"%s\" />\n" 
     
    309315                   , 
    310316                   getenv("SCRIPT_NAME"), 
     317                   variable_get("module"), 
    311318                   current_interface, 
    312319                   CONTENT_TABLE_BOX_CLASS, 
  • trunk/openmct/packages/system/owi/src/nfs.c

    r430 r465  
    9292   /* Start form / external table / scroll area / internal table*/ 
    9393   printf("<form action=\"%s\" method=\"post\">\n" 
     94          "<input type=\"hidden\" name=\"module\" value=\"%s\" />\n" 
    9495          "<input type=\"hidden\" name=\"command\" value=\"\" />\n" 
    9596          "<table class=\"%s\">\n" 
     
    115116          "<tbody>", 
    116117          getenv("SCRIPT_NAME"), 
     118          variable_get("module"), 
    117119          CONTENT_TABLE_CLASS, 
    118120          NFS_HEADLINE, 
     
    147149                   "<td width=\"480\">%s</td>\n" 
    148150                   "<td width=\"160\">\n" 
    149                    "<input type=\"button\" onClick=\"location='%s?command=detail&amp;id=%s'\" value=\"%s\" />&nbsp;" 
    150                    "<input type=\"button\" onClick=\"location='%s?command=delete&amp;id=%s'\" value=\"%s\" />" 
     151                   "<input type=\"button\" onClick=\"location='%s?module=%s&command=detail&amp;id=%s'\" value=\"%s\" />&nbsp;" 
     152                   "<input type=\"button\" onClick=\"location='%s?module=%s&command=delete&amp;id=%s'\" value=\"%s\" />" 
    151153                   "</td>\n" 
    152154                   "</tr>\n", 
     
    156158                   options, 
    157159                   getenv("SCRIPT_NAME"), 
     160                   variable_get("module"), 
    158161                   argument_get_part(nfs, 0), 
    159162                   NFS_BUTTON_MODIFY, 
    160163                   getenv("SCRIPT_NAME"), 
     164                   variable_get("module"), 
    161165                   argument_get_part(nfs, 0), 
    162166                   NFS_BUTTON_DELETE); 
     
    178182          "<tr>\n" 
    179183          "<td colspan=\"7\" align=\"right\">\n" 
    180           "<input type=\"button\" onClick=\"location='%s?command=new'\" value=\"%s\" />" 
     184          "<input type=\"button\" onClick=\"location='%s?module=%s&command=new'\" value=\"%s\" />" 
    181185          "</td>\n" 
    182186          "</tr>\n" 
     
    187191          "</form>\n", 
    188192          getenv("SCRIPT_NAME"), 
     193          variable_get("module"), 
    189194          NFS_BUTTON_NEW); 
    190195} 
     
    222227            /* Print data */ 
    223228            printf("<form action=\"%s\" method=\"post\">\n" 
     229                   "<input type=\"hidden\" name=\"module\" value=\"%s\" />\n" 
    224230                   "<input type=\"hidden\" name=\"command\" value=\"update\" />\n" 
    225231                   "<input type=\"hidden\" name=\"id\" value=\"%s\" />\n" 
     
    243249                   , 
    244250                   getenv("SCRIPT_NAME"), 
     251                   variable_get("module"), 
    245252                   argument_get_part(nfs, 0), 
    246253                   CONTENT_TABLE_BOX_CLASS, 
     
    367374          "<br />%s<br /><br />\n" 
    368375          "<form action=\"%s\" method=\"post\">\n" 
     376          "<input type=\"hidden\" name=\"module\" value=\"%s\" />\n" 
    369377          "<input type=\"hidden\" name=\"command\" value=\"add\" />\n" 
    370378          "<table class=\"%s\" width=\"100%%\">\n" 
     
    392400          NFS_NEW, 
    393401          getenv("SCRIPT_NAME"), 
     402          variable_get("module"), 
    394403          CONTENT_TABLE_BOX_CLASS, 
    395404          NFS_TABLE_DESCRIPTION, 
  • trunk/openmct/packages/system/owi/src/owi.c

    r463 r465  
    5050          "<ul id=\"navigation\">\n", title); 
    5151   for (i = 0; modules[i].name != NULL; i++) { 
    52       printf("<li class=\"navigation %s\"><a href=\"%s\">%s</a></li>\n", 
     52      printf("<li class=\"navigation %s\"><a href=\"%s?module=%s\">%s</a></li>\n", 
    5353             modules[i].style, 
     54             getenv("SCRIPT_NAME"), 
    5455             modules[i].name, 
    5556             modules[i].description); 
     
    8586int main(int argc, char **argv) { 
    8687   int i; 
    87    char *p = strrchr(argv[0], '/'); 
    8888   char *module = NULL; 
    89    struct rlimit rlimit; 
    90  
    91    getrlimit(RLIMIT_CORE, &rlimit); 
    92  
    93    rlimit.rlim_max = 20000; 
    94  
    95    setrlimit(RLIMIT_CORE, &rlimit); 
    96  
    97    if (p) { 
    98       module = p + 1; 
    99    } else { 
    100       module = argv[0]; 
    101    } 
    10289 
    10390   owi_request(); 
     
    10693 
    10794   if (!strcmp(module, "")) { 
    108       module = "sysinfo.cgi"; 
     95      variable_set("module", "sysinfo"); 
     96      module =  variable_get("module"); 
    10997   } 
    11098 
  • trunk/openmct/packages/system/owi/src/shell.c

    r425 r465  
    5656   /* Print table head */ 
    5757   printf("<form action=\"%s\" method=\"post\">\n" 
     58          "<input type=\"hidden\" name=\"module\" value=\"%s\" />\n" 
    5859          "<input type=\"hidden\" name=\"command\" value=\"execute\" />\n" 
    5960          "<table class=\"%s\" width=\"100%%\">\n" 
     
    6162          "<td>\n", 
    6263          getenv("SCRIPT_NAME"), 
     64          variable_get("module"), 
    6365          CONTENT_TABLE_CLASS); 
    6466 
  • trunk/openmct/packages/system/owi/src/user.c

    r430 r465  
    9090   /* Start form / external table / scroll area / internal table*/ 
    9191   printf("<form action=\"%s\" method=\"post\">\n" 
     92          "<input type=\"hidden\" name=\"module\" value=\"%s\" />\n" 
    9293          "<input type=\"hidden\" name=\"command\" value=\"\" />\n" 
    9394          "<table class=\"%s\">\n" 
     
    117118          "<tbody>", 
    118119          getenv("SCRIPT_NAME"), 
     120          variable_get("module"), 
    119121          CONTENT_TABLE_CLASS, 
    120122          USER_HEADLINE, 
     
    149151                "<td width=\"160\">%s</td>\n" 
    150152                "<td width=\"160\">" 
    151                 "<input type=\"button\" onClick=\"location='%s?command=detail&amp;id=%s'\" value=\"%s\" />&nbsp;" 
    152                 "<input type=\"button\" onClick=\"location='%s?command=delete&amp;id=%s'\" value=\"%s\" />" 
     153                "<input type=\"button\" onClick=\"location='%s?module=%s&command=detail&amp;id=%s'\" value=\"%s\" />&nbsp;" 
     154                "<input type=\"button\" onClick=\"location='%s?module=%s&command=delete&amp;id=%s'\" value=\"%s\" />" 
    153155                "</td>\n" 
    154156                "</tr>\n", 
     
    160162                argument_get_part(passwd, 6), 
    161163                getenv("SCRIPT_NAME"), 
     164                variable_get("module"), 
    162165                argument_get_part(passwd, 0), 
    163166                USER_BUTTON_MODIFY, 
    164167                getenv("SCRIPT_NAME"), 
     168                variable_get("module"), 
    165169                argument_get_part(passwd, 0), 
    166170                USER_BUTTON_DELETE); 
     
    177181          "<tr>\n" 
    178182          "<td colspan=\"7\" align=\"right\">\n" 
    179           "<a class=\"%s\" href=\"#\" onClick=\"location='%s?command=new'\"><div class=\"%s\">%s</div></a>\n" 
     183          "<a class=\"%s\" href=\"#\" onClick=\"location='%s?module=%s&command=new'\"><div class=\"%s\">%s</div></a>\n" 
    180184          "</td>\n" 
    181185          "</tr>\n" 
     
    187191          CONTENT_LINK_AQUA_CLASS, 
    188192          getenv("SCRIPT_NAME"), 
     193          variable_get("module"), 
    189194          CONTENT_BUTTON_AQUA_CLASS, 
    190195          USER_BUTTON_NEW); 
     
    218223      if (!strcmp(argument_get_part(passwd, 0), username)) { 
    219224         printf("<form action=\"%s\" method=\"post\">\n" 
     225                "<input type=\"hidden\" name=\"module\" value=\"%s\" />\n" 
    220226                "<input type=\"hidden\" name=\"command\" value=\"update\" />\n" 
    221227                "<input type=\"hidden\" name=\"id\" value=\"%s\" />\n" 
     
    260266                , 
    261267                getenv("SCRIPT_NAME"), 
     268                variable_get("module"), 
    262269                argument_get_part(passwd, 0), 
    263270                CONTENT_TABLE_BOX_CLASS, 
     
    432439          "<br />%s<br /><br />\n" 
    433440          "<form action=\"%s\" method=\"post\">\n" 
     441          "<input type=\"hidden\" name=\"module\" value=\"%s\" />\n" 
    434442          "<input type=\"hidden\" name=\"command\" value=\"add\" />\n" 
    435443          "<table class=\"%s\" width=\"100%%\">\n" 
     
    470478          USER_NEW, 
    471479          getenv("SCRIPT_NAME"), 
     480          variable_get("module"), 
    472481          CONTENT_TABLE_BOX_CLASS, 
    473482          USER_TABLE_DESCRIPTION,