Skip to content

Commit

Permalink
Added moduser to use htaccess class
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/phpsurveyor@1914 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
David Olivier committed Aug 13, 2006
1 parent 57cc60c commit 35191d9
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions admin/usercontrol.php
Expand Up @@ -34,7 +34,7 @@
#############################################################
*/

include("classes/core/htaccess.class.php");
include_once("classes/core/htaccess.class.php");

if (empty($homedir)) {die("Cannot run this script directly");}
if ($accesscontrol <> 1) {exit;}
Expand Down Expand Up @@ -130,18 +130,9 @@
$pass=preg_replace("/\W/","",$pass);
if ($user && $pass)
{
//$addsummary .= "Modifying user $user with password $pass<br />\n";
if ($htpasswddir) {$htpasswd = "\"$htpasswddir/htpasswd\"";} else {$htpasswd = "htpasswd";}
$command="$htpasswd -b .htpasswd $user $pass 2>&1";
exec($command, $CommandResult, $CommandStatus);
if ($CommandStatus) //0=success, for other possibilities see http://httpd.apache.org/docs/programs/htpasswd.html
{
$addsummary .= "<pre>";
$addsummary .= "\$CommandStatus = $CommandStatus\n";
$addsummary .= "\$CommandResult = \n";
foreach ($CommandResult as $Line) {$addsummary .= "$Line\n";}
$addsummary .= "</pre>\n";
}
$ht = new htaccess("$homedir/.htaccess","$homedir/.htpasswd");
$ht->setPasswd($user,$pass);

$uquery = "UPDATE ".db_table_name('users')." SET password='$pass', security='{$_POST['level']}' WHERE user='$user'";
$uresult = $connect->Execute($uquery);

Expand Down

0 comments on commit 35191d9

Please sign in to comment.