Changeset 2750


Ignore:
Timestamp:
2001-09-24T16:46:17+12:00 (23 years ago)
Author:
kjm18
Message:

can now have spaces after the commas in the groups field of add user form -
these are removed before the entry is written to the db

Location:
trunk/gsdl/src/recpt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/userdb.cpp

    r1402 r2750  
    233233}
    234234
     235// removes spaces from user groups
     236text_t format_user_groups(const text_t user_groups){
     237
     238  text_t new_groups = "";
     239  text_t::const_iterator here = user_groups.begin();
     240  text_t::const_iterator end = user_groups.end();
     241  while (here != end) {
     242    if (*here != ' '&& *here != '\t' && *here != '\n') {
     243      new_groups.push_back(*here);
     244    }
     245    here++;
     246  }
     247  return new_groups;
     248}
    235249
    236250// functions dealing with databases of temporary keys
  • trunk/gsdl/src/recpt/userdb.h

    r1285 r2750  
    101101bool check_passwd (const userinfo_t &thisuser, const text_t &password);
    102102
     103// removes spaces from user groups
     104text_t format_user_groups(const text_t user_groups);
    103105
    104106// functions dealing with databases of temporary keys
  • trunk/gsdl/src/recpt/usersaction.cpp

    r2212 r2750  
    331331      userinfo.password = crypt_text(args["umpw"]);
    332332    }
    333     userinfo.enabled = (args["umus"] == "enabled");
    334     userinfo.groups = args["umug"];
     333    userinfo.enabled = (args["umus"] == "enabled");   
     334    userinfo.groups = format_user_groups(args["umug"]);
    335335    userinfo.comment = args["umc"];
    336336   
Note: See TracChangeset for help on using the changeset viewer.