// Arquivo pwfile.req class PwFile { var $fp; var $filename; function PwFile($filename) { $this->fp = fopen ($filename,"r+"); $this->filename = $filename; } function existsUser ($usr_ID) { rewind($this->fp); while (feof($this->fp) == 0) { $line = chop(fgets($this->fp,1000));] $arr = split(":", $line); if ($arr[0] == $usr_ID) { return 1; } else { return 0; } } } function getFileSize() { return (filesize($this->filename)); } function write_temp ($contents) { echo "
$contents"; $temp_filename = tempnam ("/tmp", "php_"); echo "
bevor $contents"; $contents .= "$usr_ID:".crypt($usr_passwd)."\n"; echo "
danach $contents"; $this->write_temp($contents); } function deleteUser ($usr_ID) { $contents = ""; rewind($this->fp); while (feof($this->fp) == 0) { $line = ""; $line = chop(fgets($this->fp,1000)); $arr = split(":", $line); if ($arr[0] != $usr_ID) { echo $arr[0] ." ist nicht gleich ". $usr_ID; $contents .= $line . "\n"; } } echo "