PHP Classes available again

POSTED BY on Jun 11 under PHP

All the old PHP stuff is available again. Have fun.

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)

Website

Comments

13 Comments so far
  1. Bob Pearcy September 11, 2008 8:32 am

    How can a windows user open the tar.gz files?
    I have not found a way.
    Bob

  2. Lynx September 20, 2008 1:16 am

    Thank you for making this available again!

    I’m a student and was going through an interactive tutorial that cites these templates as a starting point, and I was worried that they were no longer available since the tutorial was dated (5 years old).

    I read about your issues with your former employer and am glad that you’re past that.

    More power to you!

  3. Manoj Sterex September 23, 2008 6:43 am

    Use Winrar. :)

  4. Craig September 23, 2008 11:25 pm

    WinRar will open gziped tar files

  5. liuchunyu September 24, 2008 8:32 am

    use winrar in windows

  6. marcinkk September 30, 2008 2:45 am

    I’ve made soma modifications to support SHA and MD5 passwords by class.htpasswd. Diff looks like below:

    [code]

    27a28,53
    > Rev 0.9a +cryptMD5Pass()
    >
    > Added recognition of SHA and MD5 passwords
    > as generated by htpasswd program:
    > - "{SHA}" - htpasswd -s
    > - "$apr1$" - htpasswd -m
    >
    > Functions: cryptPass(), changePass(),
    > addUser() and assignPass()extended by $hash
    > parameter to change default CRYPT algorithm
    > to SHA or MD5/APR1
    >
    > example:
    >
    > cryptPass($pass,$salt,"sha")
    > changePass($user,$pass,$oldpass,"md5")
    > ...
    >
    > 0.9 can be safely changed to 0.9a, all
    > functiond without additional $hash parameter
    > works like in 0.9
    >
    > **************************************************************
    >
    > **************************************************************
    >
    169c195
    var $VERSION = 'Revision 0.9a 2008/09/30 10:20:00 cdi@thewebmasters.net';
    463c491
    function cryptPass ($passwd, $salt = "", $hash = "crypt")
    479,480c507,523
    <

    > if (($hash == "sha") || ($hash == "md5")) {
    >
    > if ($hash == "sha") {
    >
    > return ("{SHA}".base64_encode(pack("H*",sha1($passwd))));
    >
    > }
    >
    > if ($hash == "md5") {
    >
    > return ($this->cryptMD5Pass($passwd,$salt));
    >
    > }
    >
    > }
    > else // if $hash != (crypt || sha || md5) then $hash = crypt ...
    481a525,527
    >
    > if (!empty($salt))
    > {
    485,487c531,533
    < }
    < else
    }
    > else
    > {
    491c537
    }
    493c539,541
    return (crypt($passwd, $salt));
    >
    > }
    586,587c634,651
    < $salt = substr($pass,0,2);
    cryptPass($Pass,$salt);
    ---
    >
    > if (substr($pass,0,5) == "{SHA}") // SHA ?
    > {
    > $Pass = $this->cryptPass($Pass,"","sha");
    > }
    > else
    > {
    > if (substr($pass,0,6) == '$apr1$') // MD5 ?
    > {
    > $salt = substr($pass,6,8);
    > $Pass = $this->cryptPass($Pass,$salt,"md5");
    > }
    > else // ...so we think that the Crypt is used
    > {
    > $salt = substr($pass,0,2);
    > $Pass = $this->cryptPass($Pass,$salt,"crypt");
    > }
    > }
    611c675
    function changePass ($UserID, $newPass, $oldPass = "", $hash = "crypt")
    680,681c744,746
    USERS[$usernum]["pass"] = $this->cryptPass($newPass);

    > $this->USERS[$usernum]["pass"] = $this->cryptPass($newPass,"",$hash);
    >
    871c936
    function addUser ($UserID, $newPass, $hash = "crypt")
    902,903c967,968
    <
    USERS[$count]["pass"] = $this->cryptPass($newPass);
    ---
    >
    > $this->USERS[$count]["pass"] = $this->cryptPass($newPass,"",$hash);
    923c988
    function assignPass ($UserID, $hash = "crypt")
    951c1016
    USERS[$count]["pass"] = $this->cryptPass($pass);
    ---
    > $this->USERS[$count]["pass"] = $this->cryptPass($pass,"",$hash);
    1081a1147,1196
    > // **************************************************************
    > // Generates the password as a result of an Apache-specific algorithm
    > // using an iterated (1,000 times) MD5 digest of various combinations
    > // of a random 32-bit salt and the password.
    >
    >
    > function cryptMD5Pass($plainpasswd,$salt="") {
    >
    > if ($salt == "")
    > {
    > // if no $salt is given...
    > $salt = substr(str_shuffle("./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"), 0, 8);
    > }
    >
    > $len = strlen($plainpasswd);
    > $text = $plainpasswd.'$apr1$'.$salt;
    > $bin = pack("H32", md5($plainpasswd.$salt.$plainpasswd));
    >
    > for($i = $len; $i > 0; $i -= 16) {
    > $text .= substr($bin, 0, min(16, $i));
    > }
    >
    > for($i = $len; $i > 0; $i >>= 1) {
    > $text .= ($i & 1) ? chr(0) : $plainpasswd{0};
    > }
    >
    > $bin = pack("H32", md5($text));
    >
    > for($i = 0; $i $new = ($i & 1) ? $plainpasswd : $bin;
    > if ($i % 3) $new .= $salt;
    > if ($i % 7) $new .= $plainpasswd;
    > $new .= ($i & 1) ? $bin : $plainpasswd;
    > $bin = pack("H32", md5($new));
    > }
    >
    > for ($i = 0; $i $k = $i + 6;
    > $j = $i + 12;
    > if ($j == 16) $j = 5;
    > $tmp = $bin[$i].$bin[$k].$bin[$j].$tmp;
    > }
    >
    > $tmp = chr(0).chr(0).$bin[11].$tmp;
    > $tmp = strtr(strrev(substr(base64_encode($tmp), 2)),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/","./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
    > return "$"."apr1"."$".$salt."$".$tmp;
    >
    > }
    >

    [/code]

  7. Eric November 9, 2008 4:10 pm

    Try ZipGenius. It’ll do about everything.

  8. Abhishek December 30, 2008 5:56 am

    Try going open source.
    Use 7-zip, it will open anything.

  9. Jaime M-F February 10, 2009 11:22 pm

    Hi!

    I’m interested in the Htpasswd class, but the file is a .php3, it will work under php 4 or 5?

    Thanks!

  10. Hasitha Liyanage April 27, 2009 11:52 pm

    Dear Sir,

    Where Can I find How to use class.POP3.php

  11. [...] this part of the project, we will use FastTemplate to help us put everything together quickly. There are better PHP template frameworks out there, [...]

  12. Tamer Elsaghir June 11, 2010 4:43 am

    Thank you for making this available again!

  13. [...] this part of the project, we will use FastTemplate to help us put everything together quickly. There are better PHP template frameworks out there, [...]

Copyright The WebMaster’s Net | Powered by WordPress | Using the GreenTech Theme