File_HtAccess::setRequire() -- set the value of require property
Description
Sets the value of require property.This overwrites the previous
value. If you need to add a value (user) to require use
File_HtAccess::addRequire() instead. Using this
method you can control which users will be able to access
the protected resources.
Note
This function can not be called
statically.
Example
Example 30-1. Using File_HtAccess::setRequire() <?php
require_once('File_HtAccess.php');
/* let any valid user access the resource */
$fh = new File_HtAccess('.htaccess');
$fh->load();
$fh->setRequire('valid-user');
$fh->save();
/* let user tuupola or panula access the resource */
$fh = new File_HtAccess('.htaccess');
$fh->load();
$fh->setRequire(array('user', 'tuupola', 'panula'););
$fh->save();
/* let anyone from group admins to access the resource */
$fh = new File_HtAccess('.htaccess');
$fh->load();
$fh->setRequire(array('group', 'admins'););
$fh->save();
?> |
|