DeveloperSide.NET Forums
July 07, 2020, 05:52:40 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: User/Password protected areas -- Guide  (Read 8860 times)
0 Members and 1 Guest are viewing this topic.
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« on: June 29, 2004, 08:55:58 PM »

http://www.devside.net/articles/windows/password
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
cprox
Member
*
Posts: 4

foxley666@hotmail.com
View Profile
« Reply #1 on: June 30, 2004, 04:05:03 PM »

thanks alot this is all i ever needed in one easy to read tutorial worked first time thanks agian on a job well done



cprox
Logged
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #2 on: July 03, 2004, 02:37:56 AM »

I have made some important changes to the guide, to take out the private directory out of webroot.
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
Jorge
Customer, Basic Support
Guru
*****
Posts: 544

jorge_schrauwen@msn.com
View Profile WWW
« Reply #3 on: July 04, 2004, 06:53:57 PM »

much better like this(if it on the main page)
Logged

Demoric
Jr. Member
**
Posts: 34

64788622 jaydiumsoftware
View Profile WWW
« Reply #4 on: November 20, 2005, 04:27:19 PM »

I wrote a batch script that assists me in this. (it was written for a different apache disto, but should work just fine)

You need to have your apache bin file as part of your operating system

start->control panel->system->advanced tab->enviroment variables
and make sure that you have the apache bin file located in the system variables

Copy the following code into notepad and save it as a2tpwd.cmd  (or whatever you want just make sure it has a cmd or bat extension)

you can now run the command, or drag and drop folders to the command.

I like to add it to my right-click sendto menu in windows.
start -> run -> sendto
and then copy the file there.



Code:
@Echo off
If '%1%'=='/?' goto help
If '%1%'=='-h' goto help
if NOT Exist "%1%" goto menu
cd %1%

:menu
If '%1%'=='/?' goto help
Title Apache2Triad .htpasswd Menu
if Exist ".\.htpasswd" (color 0a) Else (color 0e)
if Not Exist ".\.htaccess" (color 0c)
cls
ECHO.
echo 浜様様様様様様様様様様様様様様融
echo Apache2Triad .htpasswd Menu  
echo Version 0.2b                
echo Release: October 25, 2005    
echo By: Joshua Meadows          
echo admin@jaydium.servehttp.com  
echo 藩様様様様様様様様様様様様様様夕
echo.
ECHO Current Directory is: %cd%
echo.
if Exist ".\.htpasswd" (Echo .htpasswd file is present) Else (Echo .htpasswd file is Absent!!!)
if Exist ".\.htaccess" (Echo .htaccess file is present) Else (Echo .htaccess file is Absent!!!)
ECHO.
ECHo ============================================================================
ECHO Create or Edit .htaccess (F)ile
ECHO (C)reate a .htpasswd file
ECHO (A)dd a User
ECHO (D)elete a user
ECHO (E)dit the .htpasswd file using notepad
Echo (CD) Change Directory
Echo (B)rowse Folder
ECHO E(x)it this menu
ECHo ============================================================================
set choice=
set /p choice=What do you want to do? Type (c,a,d,e,f,cd,b,x):
if '%choice%'=='c' goto create
if '%choice%'=='C' goto create
if '%choice%'=='a' goto adduser
if '%choice%'=='A' goto adduser
if '%choice%'=='d' goto deluser
if '%choice%'=='D' goto deluser
if '%choice%'=='e' goto edit
if '%choice%'=='E' goto edit
if '%choice%'=='f' goto access
if '%choice%'=='F' goto access
if '%choice%'=='cd' goto changedir
if '%choice%'=='CD' goto changedir
if '%choice%'=='b' goto browse
if '%choice%'=='B' goto browse
if '%choice%'=='x' goto exit
if '%choice%'=='X' goto exit
goto menu

:create
If NOT Exist ".\htpasswd" Echo. >> .htpasswd
pause
goto menu

:adduser
set user=
set /p user=Enter username:
htpasswd.exe -c .htpasswd %user%
pause
Goto menu

:deluser
set user=
set /p user=Enter username:
htpasswd.exe -D .htpasswd %user%
pause
Goto menu

:changedir
Echo Type the full pathway
Echo E.G.  C:\Program Files
set chgdir=
set /p chgdir=Enter pathway:
cd "%chgdir%"
pause
Goto menu

:access
if Exist ".\.htaccess" (goto accessexist) Else (goto accesscreate)
goto menu

:accessexist
notepad ".\.htaccess"
goto menu

:accesscreate
Echo #Access File Automatically Created By Script. >> .htaccess
Echo #You can require specific users with the following
Echo #Require user USERNAME>>.htaccess
Echo require valid-user >>.htaccess
Echo AuthType Basic >> .htaccess
Echo AuthName "Password Protected Area">> .htaccess
Echo AuthUserFile "%cd%\.htpasswd">> .htaccess
notepad ".\.htaccess"
goto menu

:edit
notepad ".\.htpasswd"
goto menu

:browse
start explorer %cd%
goto menu

:help
cls
ECHO You may use A2TPwd simply by typing A2TPwd
ECHO You may also specify the starting directory by typing:
ECHO A2TPwd "folder pathway goes inside quotes here"
pause>nul
pause
exit

:exit
cls
ECHO A2TPwd Command By Joshua Meadows at http://jaydium.servehttp.com
echo.
Pause
cls


*Note: you will need to have the following enabled in your httpd.conf
LoadModule access_module modules/mod_access.so
Logged

ttp://jaydium.servehttp.com
http://jaydium.selfhost.com
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!