🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.php
Article #382

Re: htpasswd i PHP

#382
From: Grzegorz R. Gryczka
Date: Mon, 20 Aug 2001 19:07
63 lines
3094 bytes
On Mon, 20 Aug 2001 19:41:33 +0200, Tom <sunnytom@poczta.onet.pl> wrote:
> czy ktos jest w stanie mi powiedziec jak mozna za pomaca php dodac usera i
> haslo do pliku .htpasswd
> 
> ja zrobilem cos takiego i chyba nie bardzo dziala :
> 
> htpasswd /home/mojadomena.com/pass/.htpasswd $user $pass

grzesiek:~# htpasswd --help
Usage:
        htpasswd [-cmdps] passwordfile username
        htpasswd -b[cmdps] passwordfile username password
                 ^^                              ^^^^^^^^		 
        htpasswd -n[mdps] username
        htpasswd -nb[mdps] username password
	         ^^^                ^^^^^^^^
 -c  Create a new file.
 -n  Don't update file; display results on stdout.
 -m  Force MD5 encryption of the password.
 -d  Force CRYPT encryption of the password (default).
 -p  Do not encrypt the password (plaintext).
 -s  Force SHA encryption of the password.
 -b  Use the password from the command line rather than prompting for it.
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
On Windows, TPF and NetWare systems the '-m' flag is used by default.
On all other systems, the '-p' flag will probably not work.

> dane $user i $pass sa przesylane do skryptu z formularza jesli to cos
> zmienia

grzesiek:~# lynx /usr/share/doc/php3-doc/html/ref.exec.html

#                                                 Program Execution functions
 
    #PHP Manual Function Reference pg_untrace escapeshellarg
     
    PHP Manual
    Prev  Next
    ____________________________________________________________________
	       
LII. Program Execution functions
	        
   Table of Contents
   escapeshellarg -- escape a string to be used as a shell argument
   escapeshellcmd -- escape shell metacharacters
   exec -- Execute an external program
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   passthru -- Execute an external program and display raw output
   system -- Execute an external program and display output
   ____________________________________________________________________
       
   Prev       Home           Next
   pg_untrace  Up  escapeshellarg


[...]
  string exec (string command [, string array [, int return_var]])   
[...]


-- 
Grzegorz R. Gryczka
grg@tg.onet.pl
Technical Details
Message-ID: <9lrn4o$1tl$1@grzesiek.pc172.nisko.sdi.tpnet.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!mat.uni.torun.pl!news.man.torun.pl!news.icm.edu.pl!news.tpi.pl!nnrpd
References: <9lri4e$p9j$1@news.tpi.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!mat.uni.torun.pl!news.man.torun.pl!news.icm.edu.pl!news.tpi.pl!nnrpd
From: grg@tg.onet.pl (Grzegorz R. Gryczka)
Newsgroups: pl.comp.lang.php
Subject: Re: htpasswd i PHP
Date: Mon, 20 Aug 2001 19:07:04 +0000 (UTC)
Organization: :-)
Lines: 63
Message-ID: <9lrn4o$1tl$1@grzesiek.pc172.nisko.sdi.tpnet.pl>
References: <9lri4e$p9j$1@news.tpi.pl>
NNTP-Posting-Host: pc172.nisko.sdi.tpnet.pl
X-Trace: news.tpi.pl 998334248 24544 217.97.30.172 (20 Aug 2001 19:04:08 GMT)
X-Complaints-To: usenet@tpi.pl
NNTP-Posting-Date: 20 Aug 2001 19:04:08 GMT
X-Path-Notice: Path line has been filtered
X-Original-Path: grzesiek!not-for-mail
User-Agent: slrn/0.9.7.1 (Linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit