Forum 

Forum AspNuke.it - Il tuo Portale OpenSource in ASP

db forum

Autore Messaggio
excess

Eliminato
Eliminato
0 Discussione



Profilo - excess
17 gennaio 2004 alle 12:12:53 Profilo - excessInvia un messaggio privato Rispondi quotando
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? (?) (?) (?)
djveleno

Amministratore

Esperto
Esperto
1025 Discussioni



Profilo - djveleno
17 gennaio 2004 alle 12:18:43 Profilo - djvelenoInvia un messaggio privato Rispondi quotando
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!

http://aspnuke208.somee.com/Default.asp

Log in

Login
Password
Memorizza i tuoi dati:

Cerca

 

Sostieni AspNuke

Un piccolo gesto per aiutarci a mantenere AspNuke.it online

Promo

MusicWebItalia.it
Video Testi Traduzioni Spot Colonne sonore Accordi e Spartiti gratis.

Visitatori

Visitatori Correnti : 147
Membri : 0 offline Anna

Iscritti

 Utenti: 18940
Ultimo iscritto : glauco
Lista iscritti
Messaggi privati: 3373 Commenti: 2210 Immagini: 39 Downloads: 144 Articoli: 49 Pagine: 101 Siti web: 558 Notizie: 180 Sondaggi: 11 Preferiti: 5684689 Post sui forum: 51195 Libro degli ospiti: 4 Eventi: 7

Versioni

Temi