File_Passwd::staticAuth

File_Passwd::staticAuth()

File_Passwd::staticAuth() -- Fast authentication

Description

Static user autentication.

Though this approach should be reasonable fast, it is NOT with APR compatible MD5 encryption used for htpasswd style password files encrypted in MD5.

Generating one MD5 password takes about 0.25 seconds!

Depending on $type, $opt should be:

  • Smb:

    encryption method (NT or LM)

  • Unix:

    encryption method (des or md5)

  • Authbasic:

    encryption method (des, sha or md5)

  • Authdigest:

    the realm the user is in

  • Cvs:

    n/a (empty)

  • Custom:

    array of 2 elements: encryption function and delimiter

Parameter

string $type

Unix, Cvs, Smb, Authbasic or Authdigest

string $file

path to passwd file

string $user

the user to authenticate

string $pass

the plaintext password

mixed $opt

  • Smb:

    nt | lm

  • Unix:

    des | md5

  • Authbasic:

    des | sha | md5

  • Authdigest:

    the realm the user is in

  • Cvs:

    n/a (empty)

  • Custom:

    array of 2 elements: encryption function and delimiter

Note

This function should be called statically.

© Copyright 2003-2023 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.