PHP Classes

Minor fixes

Recommend this page to a friend!

      htaccess  >  All threads  >  Minor fixes  >  (Un) Subscribe thread alerts  
Subject:Minor fixes
Summary:Fix deluser method and other minor changes
Author:Tom Klawsuc
Date:2007-02-23 21:48:11


  1. Minor fixes   Reply   Report abuse  
Picture of Tom Klawsuc Tom Klawsuc - 2007-02-23 21:48:11
The current deluser method has a couple minor flaws:

1. Newline issue with passwords do either:
a. Trim the password $lineArr[1] so it does not have a newline in it, or
b. remove "\n" when saving names back to file.

2. wrong index being used for password (end up with username for password):
should be

3. in the example you instantiate the htaccess object with some parameters (htaccess and htpasswd) but the constructor is empty. I changed the constructor to be:

function htaccess($hta='', $htp='', $htg=''){
$this->fHtaccess = $hta;
$this->fPasswd = $htp;
$this->fHtgroup = $htg;

4. I'll assume that you just didn't get a chance to complete the groups methods. You have an addGroup meth but nothing ot add users to the group or to use the group for access levels. I'll be adding my own if I get around to it and I'll post it here to add to this great little class.

Other than that...THANKS for the great work!!!