From: Jean-Marc Pigeon (Delson) Date: Thu, 26 Jun 2025 10:26:22 +0000 (-0400) Subject: Adding password within USRTYP X-Git-Tag: tag-0.10~21 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=0dee0e26eb8566c7ae16765ee0d3f15b3e42c442;p=jmp%2Fmailleur Adding password within USRTYP --- diff --git a/lib/devsql.c b/lib/devsql.c index 25ca7d9..862cbf1 100644 --- a/lib/devsql.c +++ b/lib/devsql.c @@ -437,6 +437,7 @@ PUBLIC USRTYP *sql_getusr(SQLPTR *sqlptr,char *email) //field avalable in table "EMAILS" const char *usrfield[]={ "email", + "passwd", "space", "mxspace", (char *)0 @@ -525,13 +526,16 @@ while (proceed==true) { if ((locval=getvalue(sql,rs,0,usrfield[i]))==(char *)0) continue; switch (i) { - case 0 : + case 0 : //user email usr->email=strdup(locval); break; - case 1 : + case 1 : //user passwd + usr->passwd=strdup(locval); + break; + case 2 : //user used space usr->space=atoi(locval); break; - case 2 : + case 3 : //user max space available usr->mxspace=atoi(locval); break; default : diff --git a/lib/unisql.c b/lib/unisql.c index c172200..3c63376 100644 --- a/lib/unisql.c +++ b/lib/unisql.c @@ -103,6 +103,7 @@ PUBLIC USRTYP *sql_freeusr(USRTYP *usr) { if (usr!=(USRTYP *)0) { + usr->passwd=rou_freestr(usr->passwd); usr->email=rou_freestr(usr->email); (void) free(usr); usr=(USRTYP *)0; diff --git a/lib/unisql.h b/lib/unisql.h index 59c3f8d..d0da839 100644 --- a/lib/unisql.h +++ b/lib/unisql.h @@ -12,7 +12,8 @@ //structure about user within the database typedef struct { char *email; //user emails - u_long space; //user space used; + char *passwd; //user password + u_long space; //user space used u_long mxspace; //user maximun space }USRTYP;