public function executeConfirmation() { $key = $this->getRequestParameter('key'); if ($key) { $user_profile = UserProfilePeer::retrieveByConfirmation($key); if ($user_profile) { $user = sfGuardUserPeer::retrieveByPK($user_profile->getUserId()); $user->setIsActive(true); $user->save(); $this->setFlash('info', 'Your account has been activated.'); $this->forward('site', 'message'); } } $this->setFlash('error', 'Activation link is not valid.'); $this->forward('site', 'message'); }