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.
Parameter
mixed $require - value the requre property to be set to. Can be given as a string or an array. If given as a string separate multiple values with a space.
<?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(); ?>
Deliver First Class Web Sites: 101 Essential Checklists Want to learn how to make your web sites usable and accessible? Want to ensure that your sites meet current best practice, without spending hours trawling through incomprehensible specifications and recommendations from dozens of different books, research papers, and web sites? Want to make sure that the sites you build are "right the first time," requiring no costly redevelopments?