Changeset 1026


Ignore:
Timestamp:
01/01/10 23:21:13 (12 years ago)
Author:
alno
Message:

WebIf:

  • implement a functionality to clone a user. You can now go to edit a user and use "Save" OR "Save As"
Location:
branches/monitor-improvement
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/monitor-improvement/oscam-http.c

    r1024 r1026  
    726726void send_oscam_user_config_edit(struct templatevars *vars, FILE *f, struct uriparams *params){
    727727    struct s_auth *account, *ptr;
    728     char *user = getParam(params, "user");
     728    char *user;// = getParam(params, "user");
     729
     730    if (strcmp(getParam(params, "action"), "Save As") == 0) {
     731        user = getParam(params, "newuser");
     732        printf("%s\n",user);
     733    }
     734    else user = getParam(params, "user");
     735
    729736    int i, j;
    730737
     
    743750      }
    744751      memset(account, 0, sizeof(struct s_auth));
    745       strncpy((char *)account->usr, user, sizeof(account->usr)-1);
     752            strncpy((char *)account->usr, user, sizeof(account->usr)-1);
    746753      account->au=(-1);
    747754      account->monlvl=cfg->mon_level;
     
    752759      account->ac_users=cfg->ac_users;
    753760      account->ac_penalty=cfg->ac_penalty;
    754       account->ac_idx = account->ac_idx + 1;
     761            account->ac_idx = account->ac_idx + 1;
    755762#endif
    756763        tpl_addVar(vars, 1, "MESSAGE", "<b>New user has been added with default settings</b><BR>");
     
    761768    }
    762769
    763     if(strcmp(getParam(params, "action"), "execute") == 0){
     770    if((strcmp(getParam(params, "action"), "Save") == 0) || (strcmp(getParam(params, "action"), "Save As") == 0)){
    764771    char servicelabels[255]="";
    765772    //clear group
  • branches/monitor-improvement/oscam-http.h

    r1024 r1026  
    156156  <form action=\"user_edit.html\" method=\"get\">\n\
    157157  <input name=\"user\" type=\"hidden\" value=\"##USERNAME##\">\n\
    158   <input name=\"action\" type=\"hidden\" value=\"execute\">\n\
    159158  <TABLE cellspacing=\"0\">\n\
    160159    <TR>\n\
     
    228227    ##TPLUSEREDITANTICASC##\
    229228    <TR>\n\
    230       <TD>&nbsp;</TD>\n\
    231       <TD align=\"right\"><input type=\"submit\" value=\"Save Settings\" title=\"Save settings and reload users\"></TD>\n\
     229      <TD align=\"center\"><input type=\"submit\" name=\"action\" value=\"Save\" title=\"Save settings and reload users\"></TD>\n\
     230      <TD align=\"center\"><input name=\"newuser\" type=\"text\" size=\"20\" maxlength=\"20\" title=\"Enter new username if you want to clone this user\">&nbsp;&nbsp;&nbsp;<input type=\"submit\" name=\"action\" value=\"Save As\" title=\"Save as new user and reload users\"></TD>\n\
    232231    </TR>\n\
    233232  </TABLE>\n\
Note: See TracChangeset for help on using the changeset viewer.