Re: Auth and File Container

From: Date: Sat, 30 Oct 2004 08:18:49 +0000
Subject: Re: Auth and File Container
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-15235@lists.php.net to get a copy of this message
Hi Jason Ferguson, you wrote: > However, here is my problem: I need to create a basic password file > with "admin:(password for)" it to authenticate against so I can > actually log in to my application. I can't create the file until I can > log in, but I cant log in without the file! This doesn't work on Win32: $ htpasswd -bcd mypasswdfile admin secret PHP, sould work anywhere: <?php require_once 'File/Passwd.php'; $pw = &File_Passwd::factory('CVS'); $pw->setFile('mypasswdfile'); $pw->addUser('admin', 'secret'); $pw->save(); ?> HTH, -- Michael - < mike(@)php.net >

Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.pear.general (#15235) next »