]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Adding password within USRTYP
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Thu, 26 Jun 2025 10:26:22 +0000 (06:26 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Thu, 26 Jun 2025 10:26:22 +0000 (06:26 -0400)
lib/devsql.c
lib/unisql.c
lib/unisql.h

index 25ca7d9484a438ab7551ec8496e35967bdc989c7..862cbf1ee355a15be40d38196f0097faf86c6cd9 100644 (file)
@@ -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       :
index c1722008ae28d39943230c7e434823eb33aedb6d..3c63376783ad5ec096cb7c9d9841cb53ac7456ff 100644 (file)
@@ -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;
index 59c3f8df7b8ef54b64a7d4be7f119c1d5891310b..d0da83908542d21f2601373ed47f48456f638e65 100644 (file)
@@ -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;