Maaf mas, ada yang kurang, encrypt itu kalau tidak ada informasi salt akan diambil
secara otomatis dari info waktu, coba kalau anda menggunakan fungsi password() atau
md5()
Silakan dicek lagi, semacam ini :
mysql> create table pengguna (nama varchar(20), password varchar(50));
Query OK, 0 rows affected (0.08 sec)
mysql> insert into pengguna values ('Test1',password('password1'));
Query OK, 1 row affected (0.00 sec)
mysql> insert into pengguna values ('Test2',md5('password1'));
Query OK, 1 row affected (0.77 sec)
mysql> create temporary table tmpTableku1 select password from pengguna where
nama='Test1';
Query OK, 1 row affected (0.02 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> create temporary table tmpTableku2 select password from pengguna where
nama='Test2';
Query OK, 1 row affected (0.00 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> # Misalnya user Test1 memasukkan password 'password2' -> yang jelas SALAH
mysql> update tmpTableku1 set password=password('password2');
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select a.password, b.password from pengguna a, tmpTableku1 b where
a.password=b.password and a.nama='Test1';
Empty set (0.00 sec)
mysql> # Misalnya user Test1 memasukkan password 'password1' -> yang jelas BENAR
mysql> update tmpTableku1 set password=password('password1');
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select a.password, b.password from pengguna a, tmpTableku1 b where
a.password=b.password and a.nama='Test1';
+------------------+------------------+
| password | password |
+------------------+------------------+
| 7337f77a739e7fe1 | 7337f77a739e7fe1 |
+------------------+------------------+
1 row in set (0.00 sec)
mysql> # Misalnya user Test2 memasukkan password 'password1' -> yang jelas BENAR
mysql> update tmpTableku2 set password=md5('password1');
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0
mysql> select a.password, b.password from pengguna a, tmpTableku2 b where
a.password=b.password and a.nama='Test2';
+----------------------------------+----------------------------------+
| password | password |
+----------------------------------+----------------------------------+
| 7c6a180b36896a0a8c02787eeafb0e4c | 7c6a180b36896a0a8c02787eeafb0e4c |
+----------------------------------+----------------------------------+
1 row in set (0.00 sec)
Thanks
>>> Arman<[EMAIL PROTECTED]> Wrote:
>>>
On Thursday 28 March 2002 11:24, Ady Wicaksono wrote:
>>> Coba anda pake ini
>>> create temporary table tmpTableku select pw_passwd from vpopmail where
>>> pw_name='arman';
>>> Trus, untuk pengecekan - misal user memasukkan password "kakek"
>>> nah anda jalanin
>>> update tmpTableku set pw_passwd=encrypt('kakek');
>>> nah akhirtnya tinggal dibandingin semacam ini
>>> select a.pw_passwd, b.pw_passwd from vpopmail a, tmpTableku b where
>>> a.pw_passwd = b.pw_passwd and a.pw_name='arman';
>>> Kalau ada row yang dikembalikan dari select berarti user itu
>>passwordnya
>>> bener
>>
>>masih tidak ada row.
>>thx. mo nyoba cara lain...
>>--
>>salam,
>>arman
>>
--
Utk berhenti langganan, kirim email ke [EMAIL PROTECTED]
Informasi arsip di http://www.linux.or.id/milis.php3