Increase max username length to 20.

Length is now enforced by sqlickrypt.
This commit is contained in:
John "Elwin" Edwards 2014-03-30 20:42:48 -07:00
parent 0c75cdca4a
commit c818646ef6
2 changed files with 5 additions and 1 deletions

View file

@ -118,7 +118,7 @@
</div> </div>
<div class="modal" id="register"> <div class="modal" id="register">
<div class="formtable"> <div class="formtable">
<div><div>Name:</div><div><input type="text" name="name" id="regin_name" maxlength="10"></div></div> <div><div>Name:</div><div><input type="text" name="name" id="regin_name" maxlength="20"></div></div>
<div><div>Password:</div><div><input type="password" name="pw" id="regin_pw"></div></div> <div><div>Password:</div><div><input type="password" name="pw" id="regin_pw"></div></div>
<div><div>E-mail (optional):</div><div><input type="text" name="email" id="regin_email"></div></div> <div><div>E-mail (optional):</div><div><input type="text" name="email" id="regin_email"></div></div>
<div> <div>

View file

@ -118,6 +118,10 @@ int insertuser(char *uname, char *pw, char *email) {
sqlite3_stmt *qstmt; sqlite3_stmt *qstmt;
char salt[20]; char salt[20];
if (strlen(uname) > 20) {
return 4;
}
opendb(&db, &qstmt, checkquery); opendb(&db, &qstmt, checkquery);
/* Check for existing account in the same transaction with creating it. */ /* Check for existing account in the same transaction with creating it. */
status = sqlite3_exec(db, "BEGIN;", NULL, NULL, NULL); status = sqlite3_exec(db, "BEGIN;", NULL, NULL, NULL);