78 foreach (array(
'filename') as $param) {
79 if (isset($extra_args[$param])) {
80 $this->$param = $extra_args[$param];
82 throw new KumbiaException(
"Debe especificar el par�metro '$param' en los par�metros");
85 foreach (array(
'username',
'password') as $param) {
86 if (isset($extra_args[$param])) {
87 $this->$param = $extra_args[$param];
98 $identity = array(
"username" => $this->username,
"realm" => $this->realm);
109 $this->resource = @fopen($this->filename,
"r");
110 if ($this->resource ===
false) {
111 throw new KumbiaException(
"No existe o no se puede cargar el archivo '{$this->filename}'");
114 $exists_user =
false;
115 while (!feof($this->resource)) {
116 $line = fgets($this->resource);
117 $data = explode(
":", $line);
119 if ($data[0] == $this->username) {
120 if (trim($data[2]) == md5($this->password)) {
121 $this->realm = $data[1];
137 foreach (array(
'filename',
'username',
'password') as $param) {
138 if (isset($extra_args[$param])) {
139 $this->$param = $extra_args[$param];
150 @fclose($this->resource);