getNumberOfUsers()>0) $ht->printHtaccess(); elseif($_GET['active']==1 && $ht->getNumberOfUsers()==0){ $msg = _pfc("At least one user must be declare to activate authentication."); header('Location: '.$_SERVER['PHP_SELF'].'?msg='.rawurlencode($msg)); exit; } elseif($_GET['active']==2 && file_exists($ht->get_file_Htaccess())) $ht->delHtaccess(); } # Delete a user if(!empty($_GET['del']) && !empty($_GET['username']) ) { if($ht->getNumberOfUsers()==1){ $msg = _pfc("It is not possible to delete the last user."); header('Location: '.$_SERVER['PHP_SELF'].'?msg='.rawurlencode($msg)); exit; } else{ $username = $_GET['username']; $ht->delUser($username); $groups = $ht->getGroupOfUser($username); if ($groups!=0){ #User is not in a group for($i=0;$idelUserFromGroup($username,$groups[$i]); } } $msg = _pfc("User %s deleted.",$username); header('Location: '.$_SERVER['PHP_SELF'].'?msg='.rawurlencode($msg)); exit; } } # Modification or Creation of a user if(!empty($_POST['username'])){ $username = $_POST['username']; $password = $_POST['password']; $create=0; if(!$ht->isUser($username)){ #Add User if(!empty($password)) { $ht->addUser($username,$password); $create=1; } } else{ #Modify User if(!empty($password)) $ht->setPasswd($username,$password); } $groups= $ht->getGroups(); for($j=0;$jaddUserInGroup($username,$groups[$j]); else $ht->delUserFromGroup($username,$groups[$j]); } if($create==1) $msg = _pfc("User %s added.", $username); else $msg = _pfc("User %s edited.", $username); header('Location: '.$_SERVER['PHP_SELF'].'?msg='.rawurlencode($msg)); exit; } ?>

get_file_Htaccess())) echo "

\""._pfc("Authentication "._pfc("Authentication disable")." - "._pfc("Enable here")."

"; else{ echo "

\""._pfc("Authentication "._pfc("Authentication enable")." - "._pfc("Disable here")."

"; } if(!empty($_GET['msg'])) echo "

".$_GET['msg']."

"; $users= $ht->getUsers(); if($users!=0) { for($i=0;$i"; echo "

".$users[$i]; echo " [ "._pfc("Edit")." - "._pfc("Delete")." ]

"; echo "

"; echo "
"; echo "
"; echo " "; echo "

"; echo "

"; echo "

"; echo "
"; echo "
"; echo "
"; } } echo "
"; echo "

"._pfc("Add a new user")."

"; echo "
"; echo "

"; echo "

"; echo "

"; echo "

"; echo "
"; echo "
"; ?>