PHP Classes

File: examples_htaccess.php

Recommend this page to a friend!
  Classes of Sven Wagener  >  htaccess  >  examples_htaccess.php  >  Download  
File: examples_htaccess.php
Role: Example script
Content type: text/plain
Description: Examples for using the htaccess class
Class: htaccess
Management of htaccess files for Apache Web server
Author: By
Last change: Changed for modified function getUsers().
Date: 11 years ago
Size: 1,051 bytes


Class file image Download
// Here are some examples for the htaccess class
// (Groups are not implemented yet! Only Passwd and htaccess)


// Initializing class htaccess as $ht
$ht = new htaccess("/var/www/.htaccess","/var/www/htpasswd");

// Adding user

// Changing password for User

// Getting all usernames from set password file

foreach (
$users as $key => $value) {

// Deleting user

// Setting authenification type
// If you don't set, the default type will be "Basic"

// Setting authenification area name
// If you don't set, the default name will be "Internal Area"
$ht->setAuthName("My private Area");

// finally you have to process addLogin()
// to write out the .htaccess file

// To delete a Login use the delLogin function