pathes) == 0) $this->pathes = array($path); else $this->pathes[] = $path; } function removeRight($path){ for($i=0; i < count($this->pathes); $i++): if($this->pathes[$i] == $path){ unset($this->pathes[$i]); break; } endfor; } function ammount(){ return sizeof($this->pathes); } function isForMembersOnly($path){ foreach($this->pathes as $current){ if(strpos($path, $current) !== false){ return true; } } return false; } function printRights(){ foreach ($this->pathes as $path) echo $path . "
"; } function save(){ $s = serialize($this->pathes); $fp = fopen("rights.data", "w"); fputs($fp, $s); fclose($fp); } function open(){ if($lines = file("rights.data")){ $s = implode("", $lines); $this->pathes = unserialize($s); return true; } $this->pathes = array(); return false; } } } ?> accounts) == 0) $this->accounts = array($username=>$password); else $this->accounts[$username] = $password; } function removeAccount($username){ foreach ($this->accounts as $user => $passwd) if($user == $username) unset($this->accounts[$username]); } function ammount(){ return sizeof($this->accounts); } function getPassword($username){ return $this->accounts[$username]; } function setPassword($username, $password){ addAccount($username, $password); } function printAccounts(){ echo "
"; foreach ($this->accounts as $user => $passwd) echo $user . ": " . $passwd . "
"; echo "
"; } function save(){ $s = serialize($this->accounts); $fp = fopen("users.data", "w"); fputs($fp, $s); fclose($fp); } function open(){ if($lines = file("users.data")){ $s = implode("", $lines); $this->accounts = unserialize($s); return true; } $this->accounts = array(); return false; } } } ?> bjoern-mayer.de