Logged In: NO

The code you're looking at is to reset the password when
you've forgotten it.

$passwd1 = substr($hash, 0, 8); # new password

This line only takes the first 8 characters of the md5
generated password.