Example #1
0
 public function executeApproved()
 {
     $this->blog = BlogPeer::retrieveByPK($this->getRequestParameter('id'));
     $this->mail = new sfMail();
     $this->mail->addAddress($this->blog->getEmail());
     $this->mail->setFrom('Planeta PHP.pl <*****@*****.**>');
     $this->mail->setSubject('Zatwierdzenie bloga');
     $this->mail->setPriority(1);
 }
Example #2
0
 public function executeVerification()
 {
     $this->redirectIf($this->getUser()->isAuthenticated(), 'ucp/index');
     if ($this->getRequest()->getMethod() == sfRequest::POST) {
         $blogId = $this->getRequestParameter('blog_id');
         $blog = BlogPeer::retrieveByPK($blogId);
         if (!$blog->getVerified()) {
             $blog->setMid($this->getRequestParameter('mid'));
             $blog->setEmail($this->getRequestParameter('email'));
             if ($blog->getFile() == '') {
                 $blog->setFile(substr(md5(rand()), 0, 16));
             }
             $blog->save();
             $this->blog = $blog;
             return 'Done';
         } else {
             $this->redirect('@homepage');
         }
     } else {
         return $this->displayVerificationForm();
     }
 }
Example #3
0
 /**
  * Get the associated Blog object
  *
  * @param      Connection Optional Connection object.
  * @return     Blog The associated Blog object.
  * @throws     PropelException
  */
 public function getBlog($con = null)
 {
     // include the related Peer class
     include_once 'lib/model/om/BaseBlogPeer.php';
     if ($this->aBlog === null && $this->blog_id !== null) {
         $this->aBlog = BlogPeer::retrieveByPK($this->blog_id, $con);
         /* The following can be used instead of the line above to
         		   guarantee the related object contains a reference
         		   to this object, but this level of coupling
         		   may be undesirable in many circumstances.
         		   As it can lead to a db query with many results that may
         		   never be used.
         		   $obj = BlogPeer::retrieveByPK($this->blog_id, $con);
         		   $obj->addBlogs($this);
         		 */
     }
     return $this->aBlog;
 }
Example #4
0
 public function handleErrorReject()
 {
     $this->blog = BlogPeer::retrieveByPK($this->getRequestParameter('id'));
     $this->forward404Unless($this->blog);
     return sfView::SUCCESS;
 }
Example #5
0
 public function getBlog($con = null)
 {
     include_once 'lib/model/om/BaseBlogPeer.php';
     if ($this->aBlog === null && $this->blog_id !== null) {
         $this->aBlog = BlogPeer::retrieveByPK($this->blog_id, $con);
     }
     return $this->aBlog;
 }