Example #1
0
File: User.php Project: habtom/uas
 public function save(PropelPDO $con = null)
 {
     if (!$this->getId()) {
         $this->setUid(UserPeer::getMaxUid() + 1);
         $password = new Password();
         $this->generated_password = $password->getPassword();
         $this->setNtPassword($password->getNtHash());
         $this->setUnixPassword($password->getNtHash());
         $this->setCryptPassword($password->getCryptHash());
         $this->setLmPassword($password->getLmHash());
     }
     if (!$this->getDomainnameId()) {
         // get the default domainname
         $domainname = DomainnamePeer::getDefaultDomainname();
         $this->setDomainnameId($domainname->getId());
     }
     if (!$this->getLogin()) {
         $this->generateLogin();
     }
     if (!$this->getEmailLocalPart()) {
         $this->generateEmailLocalPart();
     }
     return parent::save();
 }