Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 07-02-2007, 04:01 AM   #1
Donkey Punch
Confirmed User
 
Join Date: Jun 2007
Location: :: PUNCH ::
Posts: 1,260
removing user from htpasswd via php

anyone have a snippet of code I could borrow to do this?

or at least point me in the right direction?

Thanks
__________________
ICQ:407-837-607
Hosting a Problem? Phat Servers = Answer
Donkey Punch is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 04:19 AM   #2
tomud
Confirmed User
 
Join Date: Jun 2002
Location: $$$
Posts: 7,993
sure

http://www.scriptsearch.com/details/964.html

Tomud
__________________


AFF – up to $1.50 per free join, $130 per order ! NASTYDOLLARS - 35$ PPS ! Free hosted galleries !
ADULTDATELINK$42 PPS, 50% REV ! DATINGGOLD - 100% !!! REV, $4 per email !
Adult Sponsors Reviews – take a look at the best adult programs !
Epassporte Sponsors

ICQ: 160168237
tomud is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 04:21 AM   #3
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,372
30$ for a script like that? could code one quicker
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 04:29 AM   #4
Donkey Punch
Confirmed User
 
Join Date: Jun 2007
Location: :: PUNCH ::
Posts: 1,260
that's a little over my .20 cent budget
__________________
ICQ:407-837-607
Hosting a Problem? Phat Servers = Answer
Donkey Punch is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 04:40 AM   #5
tomud
Confirmed User
 
Join Date: Jun 2002
Location: $$$
Posts: 7,993
:2cents

Quote:
Originally Posted by Donkey Punch View Post
that's a little over my .20 cent budget


Tomud
__________________


AFF – up to $1.50 per free join, $130 per order ! NASTYDOLLARS - 35$ PPS ! Free hosted galleries !
ADULTDATELINK$42 PPS, 50% REV ! DATINGGOLD - 100% !!! REV, $4 per email !
Adult Sponsors Reviews – take a look at the best adult programs !
Epassporte Sponsors

ICQ: 160168237
tomud is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 05:15 AM   #6
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
steal / use the ccbill or epoch one that everyone has.
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 05:29 AM   #7
Donkey Punch
Confirmed User
 
Join Date: Jun 2007
Location: :: PUNCH ::
Posts: 1,260
Quote:
Originally Posted by quantum-x View Post
steal / use the ccbill or epoch one that everyone has.
is it php or cgi ?

and where can I get it ?

:\
__________________
ICQ:407-837-607
Hosting a Problem? Phat Servers = Answer
Donkey Punch is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 05:32 AM   #8
Wolfy
Confirmed User
 
Wolfy's Avatar
 
Industry Role:
Join Date: Dec 2003
Location: Wisconsin
Posts: 3,574
Quote:
Originally Posted by Fris View Post
30$ for a script like that? could code one quicker

I bet you $60 you can't code even a hello script faster than I can swipe my VISA for $30.

Tell me when you want to fire the gun :D
Wolfy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 05:42 AM   #9
Donkey Punch
Confirmed User
 
Join Date: Jun 2007
Location: :: PUNCH ::
Posts: 1,260
shit, got everything working..

sign up, recover pass and cancel (remove from db) except for the removing from htpasswd part

ima go crazy
__________________
ICQ:407-837-607
Hosting a Problem? Phat Servers = Answer
Donkey Punch is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 06:37 AM   #10
Donkey Punch
Confirmed User
 
Join Date: Jun 2007
Location: :: PUNCH ::
Posts: 1,260
If anyone cares... I found a solution. Now to integrate it into my script

http://www.thewebmasters.net/php/Htpasswd.phtml

;)

Thanks to everyone who tried to help me. I appreciate it.
__________________
ICQ:407-837-607
Hosting a Problem? Phat Servers = Answer
Donkey Punch is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 08:17 AM   #11
budz
Disruptive Innovator
 
budz's Avatar
 
Industry Role:
Join Date: Sep 2003
Location: Vegas
Posts: 4,230
Thanks for the "LINK" haha ;)
__________________
C:\Code\
C:\Code\Run\
budz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 09:50 AM   #12
takaya
Confirmed User
 
Join Date: Mar 2003
Posts: 50
A simple version

<form action=<?=$PHP_SELF?> method=post>
Username <input name=username><p>
Password <input name=password></p>
| Add <input type=radio name=do_what value=Add> | Modify <input type=radio name=do_what value=Modify> | Delete <input type=radio name=do_what value=Delete> |<br>
<input type=submit value=submit>
</form>
<?
// find path and filename in .htaccess
// change access permission of filename to to allow write
$htaccess_file = "path_of_file/filename";
$username = trim($_POST["username"]); // from yout post form
$password = trim($_POST["password"]); // from your post form
$action = $_POST["do_what"]; // from your post form
$user_string = $username . ":" . crypt($password) ."\n";

if($action == "Add") {
$fp=fopen($htaccess_file, "a+");
if ($fp) {
while (!feof($fp)) {
$htpassinfo = fgets($fp, 4096);
list($ht_username, $ht_password) = explode(":", $htpassinfo);
if(trim($username) == trim($ht_username)) {
echo "Username $username is already existed";
exit;
}
}
if (fwrite($fp, $user_string) === FALSE) {
echo "FAIL to Add";
fclose($fp);
exit;
}
fclose($fp);
echo "Add Successful";
}
} else {
$fp=fopen($htaccess_file, "r");
if ($fp) {
$i=0;
while (!feof($fp)) {
$htpassinfo = fgets($fp, 4096);
list($ht_username, $ht_password) = explode(":", $htpassinfo);
if(trim($username) == trim($ht_username)) {
if($action == "Delete") {
$htlist[$i] = "";
$msg = "Deleted";
} else if($action == "Modify") {
$htlist[$i] = $user_string;
$msg = "Modified";
} else {
$htlist[$i] = $htpassinfo;
}
} else {
$htlist[$i] = $htpassinfo;
}
$i++;
}
fclose($fp);
} else {
echo "fail to open file";
exit;
}
$fp=fopen($htaccess_file, "w");
if ($fp) {
for($i=0;$i<count($htlist);$i++) {
fputs($fp, $htlist[$i]);
}
echo $msg;
}
}
?>
takaya is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 09:53 AM   #13
Donkey Punch
Confirmed User
 
Join Date: Jun 2007
Location: :: PUNCH ::
Posts: 1,260
include("class.Htpasswd.php3");

$UserID = "$user";

$Htpasswd = new Htpasswd;
$Htpasswd->initialize("/home/topsecretdomainbeforewebdirectory/.htpasswd");

if(!($Htpasswd->EXISTS))
{
#O KNOEZ !!
exit;
}

if($Htpasswd->deleteUser($UserID))
__________________
ICQ:407-837-607
Hosting a Problem? Phat Servers = Answer
Donkey Punch is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 10:48 AM   #14
J.P.
Confirmed User
 
Join Date: Jun 2004
Posts: 689
grep -Ev "^desired_username:" .htpasswd > .htpasswd.tmp;mv -f .htpasswd.tmp .htpasswd

you can use PHP's exec() function to execute this shell command... you will have to use full paths of course
__________________
Webmasters! Looking for new affiliate programs to promote?
Affiliate Program Search <-- Search for programs with FHGs, RSS feed, specific niche sponsors, ...
J.P. is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 10:49 AM   #15
Donkey Punch
Confirmed User
 
Join Date: Jun 2007
Location: :: PUNCH ::
Posts: 1,260
Quote:
Originally Posted by J.P. View Post
grep -Ev "^desired_username:" .htpasswd > .htpasswd.tmp;mv -f .htpasswd.tmp .htpasswd

you can use PHP's exec() function to execute this shell command... you will have to use full paths of course
lol, I had the command line earlier and I gave up trying to get it to work!

Thanks for the post though )
__________________
ICQ:407-837-607
Hosting a Problem? Phat Servers = Answer
Donkey Punch is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 11:21 AM   #16
takaya
Confirmed User
 
Join Date: Mar 2003
Posts: 50
ok, people asked about code.

The code above I posted is a working code, you need to change the path and htaccess file permission, easy way is in command line -- chmod 666 filename

that's it
takaya is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-03-2007, 03:36 AM   #17
J.P.
Confirmed User
 
Join Date: Jun 2004
Posts: 689
Quote:
Originally Posted by Donkey Punch View Post
lol, I had the command line earlier and I gave up trying to get it to work!

Thanks for the post though )
No problem, anytime
__________________
Webmasters! Looking for new affiliate programs to promote?
Affiliate Program Search <-- Search for programs with FHGs, RSS feed, specific niche sponsors, ...
J.P. is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-03-2007, 05:59 AM   #18
rowan
Too lazy to set a custom title
 
Join Date: Mar 2002
Location: Australia
Posts: 17,393
Just be careful you don't end up with two processes writing the password file at the same time. None of the methods posted in here use locking.
rowan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.