17 gennaio 2004 alle 12:12:53 ciao regazz ho notato che quandop gli utenti cliccano sul link che arriva via email per confermare l'iscrizione nel db forum non viene aggiornato il campo UserValid nella tabella user...e di conseguenza non fa postare gli utenti nel forum...vi posto la funzione di conferma registrazione...date un occhiata per vedere se è corretta? tnx
' Confirm account registration if bAutoSignup is set to False ' IN : iUserId (int) : user's id (table users, field uID) ' : sUserLogin (string) : user's login (table users, field uLogin) ' : sUserPassword (string) : user's password (table users, field uPassword) Function ConfirmAccount(iUserID, sUserLogin, sUserPassword) Dim oCn, oCn2, oRs, rSQL, bDone
bDone = False
If iUserID <> "" Then Set oCn = DBConnexion(DB_MAIN)
rSQL = "SELECT uID FROM Users WHERE uID=" & iUserID & " AND uLogin='" & SQLEncrypt(sUserLogin) & "' AND uPassword='" & SQLEncrypt(sUserPassword) & "' AND uValid=0" Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then rSQL = "UPDATE Users SET uValid=1 WHERE uID=" & iUserID DBExecute oCn, rSQL
Set oCn2 = DBConnexion(DB_FORUM) rSQL = "UPDATE Users SET UserValid=1 WHERE UserLogin='" & SQLEncrypt(sUserLogin) & "'"
bDone = True
oCn2.Close Set oCn2 = Nothing End If
oCn.Close Set oCn = Nothing Set oRs = Nothing End If
ConfirmAccount = bDone End Function
io la modificherei in questo modo per far eseguire la query che ne dite?
Function ConfirmAccount(iUserID, sUserLogin, sUserPassword) Dim oCn, oCn2, oRs, rSQL, bDone
bDone = False
If iUserID <> "" Then Set oCn = DBConnexion(DB_MAIN)
rSQL = "SELECT uID FROM Users WHERE uID=" & iUserID & " AND uLogin='" & SQLEncrypt(sUserLogin) & "' AND uPassword='" & SQLEncrypt(sUserPassword) & "' AND uValid=0" Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then rSQL = "UPDATE Users SET uValid=1 WHERE uID=" & iUserID DBExecute oCn, rSQL
Set oCn2 = DBConnexion(DB_FORUM) rSQL = "UPDATE Users SET UserValid=1 WHERE UserLogin='" & SQLEncrypt(sUserLogin) & "'" DBExecute oCn2, rSQL bDone = True
oCn2.Close Set oCn2 = Nothing End If
oCn.Close Set oCn = Nothing Set oRs = Nothing End If
ConfirmAccount = bDone End Function
ho solo aggiunto un DBExecute oCn2, rSQL , è esatto o no?
17 gennaio 2004 alle 12:18:43 Mi sembra che ci sia stata una lunga serie di post su questo argomento, quindi non ti resta che cercare, eventualmente, prova ad inserire la tua modifica, facendo prima un back-up del file interessato. Ciauzz DJ
--------------- A lavare la testa ai somari, ci si rimette l'acqua e il sapone!