Example #1
0
 public function configure_specific()
 {
     parent::configure_specific();
     unset($this['created_at'], $this['updated_at'], $this['login'], $this['nt_password'], $this['lm_password'], $this['crypt_password'], $this['unix_password'], $this['email_local_part'], $this['gid'], $this['uid'], $this['domainname_id']);
     if (!$this->isNew()) {
         $user = $this->getObject();
         foreach ($user->getSambaAccounts() as $samba_account) {
             $this->embedForm('samba_account-' . $samba_account->getId(), new EmbeddedSambaAccountForm($samba_account));
             // form
         }
         $new_sambaaccount_form = new EmbeddedSambaAccountForm();
         $new_sambaaccount_form->setDefault('user_id', $user->getId());
         $this->embedForm('new_samba_account', $new_sambaaccount_form);
         foreach ($user->getFtpAccounts() as $ftp_account) {
             $this->embedForm('ftp_account-' . $ftp_account->getId(), new FtpAccountForm($ftp_account));
             // form
         }
         if (count($user->getFtpAccounts()) == 0) {
             $new_ftpaccount_form = new FtpAccountForm();
             $new_ftpaccount_form->setDefault('user_id', $user->getId());
             $this->embedForm('new_ftp_account', $new_ftpaccount_form);
         }
     }
 }
Example #2
0
 function configure()
 {
     parent::configure();
     unset($this['created_at'], $this['updated_at']);
     $this->widgetSchema['user_id'] = new sfWidgetFormInputHidden();
 }