Exemplo n.º 1
0
 protected function doSave($con = null)
 {
     $this->object->setIsMember(false);
     $result = parent::doSave($con);
     $this->object->autoSetLogin();
     $this->object->autoCorrectNames();
     $this->object->save();
     return $result;
 }
Exemplo n.º 2
0
 protected function doSave($con = null)
 {
     $password = $this->getValue('password');
     if (!empty($password)) {
         $this->getObject()->setPassword($password);
     }
     $result = parent::doSave($con);
     return $result;
 }
Exemplo n.º 3
0
 protected function doSave($con = null)
 {
     $password = $this->getValue('password');
     if (!empty($password)) {
         $this->getObject()->setPassword($password);
     }
     $login = $this->getValue('login');
     $is_new = $this->getObject()->isNew();
     $auto_login = empty($login) && $is_new;
     $result = parent::doSave($con);
     if ($auto_login) {
         $this->getObject()->autoSetLogin();
     }
     if ($is_new) {
         $this->getObject()->autoCorrectNames();
         $this->getObject()->save();
     }
     return $result;
 }
Exemplo n.º 4
0
 protected function doSave($con = null)
 {
     $this->object->setIsMember(true);
     return parent::doSave($con);
 }
Exemplo n.º 5
0
 public function configure()
 {
     parent::configure();
     $this->configure_specific();
 }
Exemplo n.º 6
0
 public function save($con = null)
 {
     if ($this->getObject()->isNew()) {
         $signup = true;
     } else {
         $signup = false;
     }
     $object = parent::save();
     // update profile
     $values = $this->getValues();
     $profile = $object->getProfile();
     // save and remove photo from values
     $photo = $values["profile"]["photo"];
     unset($values["profile"]["photo"]);
     // update profile object
     $profile->fromArray($values["profile"], BasePeer::TYPE_FIELDNAME);
     $profile->setUser($object);
     // new photo??
     if ($photo) {
         $fileName = $profile->getPhoto(false);
         if (!$fileName) {
             $fileName = $profile->generateAvatarName() . '.jpg';
         }
         $photo->save(sfConfig::get('sf_userimage_dir') . DIRECTORY_SEPARATOR . $fileName);
         $profile->setPhoto($fileName);
     }
     if ($values["profile"]["remove_photo"]) {
         $fileName = $profile->getPhoto(false);
         if ($fileName) {
             $profile->setPhoto(null);
             $profile->save();
             // remove from filesystem
             unlink(sfConfig::get('sf_userimage_dir') . DIRECTORY_SEPARATOR . $fileName);
         } else {
             $profile->save();
         }
     } else {
         $profile->save();
     }
     // if creating, setup email and permanent jotag
     if ($signup) {
         // setup email
         $email = new Email();
         $email->setEmail($this->getValue('email'));
         $email->setIsConfirmed(true);
         $email->setIsPrimary(true);
         $email->setType(ContactPeer::TP_PERSONAL);
         $email->setUser($object);
         $email->save();
         // generate JOTAG.
         $tag = new Tag();
         $tag->setJotag($object->generateRandomJOTAG());
         $tag->setIsPrimary(true);
         $tag->setStatus(TagPeer::ST_ACTIVE);
         $tag->setUser($object);
         // link primary email to tag
         $tm = new TagEmail();
         $tm->setEmail($email);
         $tag->addTagEmail($tm);
         // save new tag
         $tag->save();
     }
     return $object;
 }
Exemplo n.º 7
0
 public function save($con = null)
 {
     $this->updatesfGuardUser();
     parent::save();
     return $this->object;
 }