I use it, not sure that is totaly secure but it works !
I suppose the login need to be DIGEST !
<?php
if (empty($SERVER['PHPAUTH_DIGEST'])) {
} else {
$auth = $SERVER['PHPAUTH_DIGEST'];
}
$data = array();
preg_match("/username=\"([^\"]+)\"/i", $auth, $match);
if (isset($match[1])) {
$data['username'] = $match[1];
}
if (($data['username'] == "USER_NAME1") || ($data['username'] == "USER_NAME2")) {
echo "<div id='username'>".$data['username']."<div>"; ?>
<script>
$("html").addClass("logged");
</script>