<?php
// Xinfeng Chen, 2002.11.06
// require_once('base_memo_file.php');
// require_once('class_forum_base.php');

class CUser extends CBaseMemoFile {
 var $name, $password, $email, $homepage, $ims, $icon, $desc;
 var $signature, $gender, $career, $location, $hobby, $firsttime, $lasttime;
 var $numpost, $numreply, $birthday, $levelname, $level, $msg, $oldmsg;
 var $resv1, $resv2;

 function _explodeRecord($a_line){
  if($a_line==''){
   unset($this->name, $this->password, $this->email, $this->homepage, $this->ims,
    $this->icon, $this->desc, $this->signature, $this->gender, $this->career,
    $this->location, $this->hobby, $this->firsttime, $this->lasttime,
    $this->numpost, $this->numreply, $this->birthday,$this->levelname,
    $this->level, $this->msg, $this->oldmsg, $this->resv1, $this->resv2);
  }else{
   list($this->name, $this->password, $this->email, $this->homepage, $this->ims,
    $this->icon, $this->desc, $this->signature, $this->gender, $this->career,
    $this->location, $this->hobby, $this->firsttime, $this->lasttime,
    $this->numpost, $this->numreply, $this->birthday,$this->levelname,
    $this->level, $this->msg, $this->oldmsg, $this->resv1, $this->resv2)=explode(SP, $a_line);
  }
 }

 function _composeRecord($a_line){
  $a_line=$this->name.SP.$this->password.SP.$this->email.SP.$this->homepage
   .SP.$this->ims.SP.$this->icon.SP.$this->desc.SP.$this->signature
   .SP.$this->gender.SP.$this->career.SP.$this->location.SP.$this->hobby
   .SP.$this->firsttime.SP.$this->lasttime.SP.$this->numpost
   .SP.$this->numreply.SP.$this->birthday.SP.$this->levelname
   .SP.$this->level.SP.$this->msg.SP.$this->oldmsg.SP.$this->resv1.SP.$this->resv2;
 }

 function load($a_name){
  $fname=CForumBase::getFilePath('USER',$a_name);
  return $this->readFile($fname);
 }

 function store($a_name){
  if($a_name!=$this->name){die('CUSER:INTERNAL STORE ERROR');}
  $fname=CForumBase::getFilePath('USER',$a_name);
  return $this->writeFile($fname);
 }

 function isRegistered($a_name){
  $fname=CForumBase::getFilePath('USER',$a_name);
  return file_exists($fname);
 }

}
?>