|
|
|
||||
|
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. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
Confirmed User
Join Date: Jun 2007
Location: :: PUNCH ::
Posts: 1,260
|
anyone have a snippet of code I could borrow to do this?
or at least point me in the right direction? Thanks |
|
|
|
|
|
#2 |
|
Confirmed User
Join Date: Jun 2002
Location: $$$
Posts: 7,993
|
__________________
![]() 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 |
|
|
|
|
|
#4 |
|
Confirmed User
Join Date: Jun 2007
Location: :: PUNCH ::
Posts: 1,260
|
that's a little over my .20 cent budget
|
|
|
|
|
|
#5 |
|
Confirmed User
Join Date: Jun 2002
Location: $$$
Posts: 7,993
|
__________________
![]() 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 |
|
|
|
|
|
#6 |
|
Confirmed User
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
|
steal / use the ccbill or epoch one that everyone has.
|
|
|
|
|
|
#7 |
|
Confirmed User
Join Date: Jun 2007
Location: :: PUNCH ::
Posts: 1,260
|
is it php or cgi ?
and where can I get it ? :\ |
|
|
|
|
|
#8 |
|
Confirmed User
Industry Role:
Join Date: Dec 2003
Location: Wisconsin
Posts: 3,574
|
|
|
|
|
|
|
#9 |
|
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 |
|
|
|
|
|
#10 |
|
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. |
|
|
|
|
|
#11 |
|
Disruptive Innovator
Industry Role:
Join Date: Sep 2003
Location: Vegas
Posts: 4,230
|
Thanks for the "LINK" haha ;)
__________________
C:\Code\ C:\Code\Run\ |
|
|
|
|
|
#12 |
|
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; } } ?> |
|
|
|
|
|
#13 |
|
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)) |
|
|
|
|
|
#14 |
|
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, ... |
|
|
|
|
|
#15 | |
|
Confirmed User
Join Date: Jun 2007
Location: :: PUNCH ::
Posts: 1,260
|
Quote:
Thanks for the post though |
|
|
|
|
|
|
#16 |
|
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 |
|
|
|
|
|
#17 | |
|
Confirmed User
Join Date: Jun 2004
Posts: 689
|
Quote:
__________________
Webmasters! Looking for new affiliate programs to promote? Affiliate Program Search <-- Search for programs with FHGs, RSS feed, specific niche sponsors, ... |
|
|
|
|
|
|
#18 |
|
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.
|
|
|
|