Added user profile editing support
This commit is contained in:
		
							
								
								
									
										13
									
								
								TODO
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								TODO
									
									
									
									
									
								
							| @@ -2,19 +2,6 @@ Article | ||||
| 	public | ||||
| 	roles who can access it | ||||
|  | ||||
| UserData | ||||
| 	user id | ||||
| 	real name | ||||
| 	real name public? | ||||
| 	self description | ||||
| 	email public? | ||||
| 	msn address | ||||
| 	msn address public? | ||||
| 	google talk address | ||||
| 	google talk address public? | ||||
| 	skype | ||||
| 	skype public? | ||||
|  | ||||
| UserForumViewed | ||||
| 	it should contain records that show the last viewed post in each forum topic | ||||
|  | ||||
|   | ||||
| @@ -3,8 +3,38 @@ | ||||
| 	<head> | ||||
| 		<title>Kék Rózsák{% block title %}{% endblock %}</title> | ||||
| 		<link rel="stylesheet" type="text/css" href="{{ asset('css/kekrozsak_front.css') }}" /> | ||||
| 		<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | ||||
| 	</head> | ||||
| 	<body> | ||||
| 		<div id="top-line-wrapper"> | ||||
| 			<div id="top-line"> | ||||
| {% if app.user %} | ||||
| 				<div id="profil-gomb"> | ||||
| 					<span id="profil-mutato">[avatar] {{ app.user.displayName }}</span> | ||||
| 					<div id="profil-box"> | ||||
| 						<div id="profil-belso"> | ||||
| 							[avatar] | ||||
| 							{{ app.user.displayName }}<br /> | ||||
| 							Jogosultság<br /> | ||||
| 							<dl> | ||||
| 								<dt>Csoportjaim</dt> | ||||
|  | ||||
| 								<dt>Kedvenc Fórum-témáim</dt> | ||||
|  | ||||
| 								<dt>Üzenetek</dt> | ||||
| 							</dl> | ||||
| 						</div> | ||||
| 						<div id="profil-szerkesztes"><a href="{{ path('KekRozsakFrontBundle_profile_edit') }}">Profil szerkesztése</a></div> | ||||
| 					</div> | ||||
| 				</div> | ||||
| {% endif %} | ||||
| 				<div id="search-box"> | ||||
| 					<input type="text" /> | ||||
| 					<button type="submit">Keresés</button> | ||||
| 				</div> | ||||
| 			</div> | ||||
| 			<div id="top-line-padding"></div> | ||||
| 		</div> | ||||
| 		<div id="wrapper"> | ||||
| 			<div id="menu"> | ||||
| 				<ul> | ||||
| @@ -42,8 +72,25 @@ | ||||
| 					</div> | ||||
| {% endfor %} | ||||
| 				</div> | ||||
| 			</div>{# div#content-wrapper #} | ||||
| 		</div>{# div#wrapper #} | ||||
| 		<div id="bottom-line-wrapper"> | ||||
| 			<div id="bottom-line-padding"></div> | ||||
| 			<div id="bottom-line"{% if app.environment == 'dev' %} style="bottom: 40px;"{% endif %}> | ||||
| 			</div> | ||||
| 		</div> | ||||
| 		<script type="text/javascript"> | ||||
| 			$('#profil-mutato').click(function() { | ||||
| 				if ($('#profil-box').is(':visible')) | ||||
| 				{ | ||||
| 					$('#profil-box').hide(); | ||||
| 				} | ||||
| 				else | ||||
| 				{ | ||||
| 					$('#profil-box').show(); | ||||
| 				} | ||||
| 			}); | ||||
| 		</script> | ||||
| 	</body> | ||||
| </html> | ||||
|  | ||||
|   | ||||
| @@ -4,6 +4,8 @@ namespace KekRozsak\FrontBundle\Controller; | ||||
|  | ||||
| use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||||
|  | ||||
| use KekRozsak\FrontBundle\Form\Type\UserType; | ||||
|  | ||||
| class DefaultController extends Controller | ||||
| { | ||||
| 	public function homepageAction() | ||||
| @@ -26,4 +28,42 @@ class DefaultController extends Controller | ||||
| 			'article' => $article | ||||
| 		)); | ||||
| 	} | ||||
|  | ||||
| 	public function profileEditAction() | ||||
| 	{ | ||||
| 		$user = $this->get('security.context')->getToken()->getUser(); | ||||
| 		$oldPassword = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:User')->findOneById($user->getId())->getPassword(); | ||||
| 		$form = $this->createForm(new UserType(), $user); | ||||
|  | ||||
| 		$saveSuccess = false; | ||||
| 		$request = $this->getRequest(); | ||||
| 		if ($request->getMethod() == 'POST') | ||||
| 		{ | ||||
| 			$form->bindRequest($request); | ||||
| 			if ($form->isValid()) | ||||
| 			{ | ||||
| 				if ($user->getPassword() != '') | ||||
| 				{ | ||||
| 					$user->setPassword($this->get('security.encoder_factory')->getEncoder($user)->encodePassword($user->getPassword(), $user->getSalt())); | ||||
| 				} | ||||
| 				else | ||||
| 				{ | ||||
| 					$user->setPassword($oldPassword); | ||||
| 				} | ||||
| 				if ($user->getUserData()->getUserId() === null) | ||||
| 				{ | ||||
| 					$user->getUserData()->setUser($user); | ||||
| 				} | ||||
| 				$em = $this->getDoctrine()->getEntityManager(); | ||||
| 				$em->persist($user); | ||||
| 				$em->flush(); | ||||
| 				// $saveSuccess = true | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		return $this->render('KekRozsakFrontBundle:Default:userprofile.html.twig', array( | ||||
| 			'form'        => $form->createView(), | ||||
| 			'saveSuccess' => $saveSuccess, | ||||
| 		)); | ||||
| 	} | ||||
| } | ||||
|   | ||||
| @@ -334,4 +334,31 @@ class User implements UserInterface, AdvancedUserInterface | ||||
|     { | ||||
|         return $this->last_login_at; | ||||
|     } | ||||
|     /** | ||||
|      * @var KekRozsak\FrontBundle\Entity\UserData | ||||
|      */ | ||||
|     private $user_data; | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * Set user_data | ||||
|      * | ||||
|      * @param KekRozsak\FrontBundle\Entity\UserData $userData | ||||
|      * @return User | ||||
|      */ | ||||
|     public function setUserData(\KekRozsak\FrontBundle\Entity\UserData $userData = null) | ||||
|     { | ||||
|         $this->user_data = $userData; | ||||
|         return $this; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get user_data | ||||
|      * | ||||
|      * @return KekRozsak\FrontBundle\Entity\UserData  | ||||
|      */ | ||||
|     public function getUserData() | ||||
|     { | ||||
|         return $this->user_data; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										391
									
								
								src/KekRozsak/FrontBundle/Entity/UserData.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										391
									
								
								src/KekRozsak/FrontBundle/Entity/UserData.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,391 @@ | ||||
| <?php | ||||
|  | ||||
| namespace KekRozsak\FrontBundle\Entity; | ||||
|  | ||||
| use Doctrine\ORM\Mapping as ORM; | ||||
|  | ||||
| /** | ||||
|  * KekRozsak\FrontBundle\Entity\UserData | ||||
|  */ | ||||
| class UserData | ||||
| { | ||||
|     /** | ||||
|      * @var KekRozsak\FrontBundle\Entity\User | ||||
|      */ | ||||
|     private $user; | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * Set user | ||||
|      * | ||||
|      * @param KekRozsak\FrontBundle\Entity\User $user | ||||
|      * @return UserData | ||||
|      */ | ||||
|     public function setUser(\KekRozsak\FrontBundle\Entity\User $user = null) | ||||
|     { | ||||
|         $this->user = $user; | ||||
| 	$this->user_id = $user->getId(); | ||||
|         return $this; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get user | ||||
|      * | ||||
|      * @return KekRozsak\FrontBundle\Entity\User  | ||||
|      */ | ||||
|     public function getUser() | ||||
|     { | ||||
|         return $this->user; | ||||
|     } | ||||
|     /** | ||||
|      * @var integer $user_id | ||||
|      */ | ||||
|     private $user_id; | ||||
|  | ||||
|     /** | ||||
|      * @var string $realName | ||||
|      */ | ||||
|     private $realName; | ||||
|  | ||||
|     /** | ||||
|      * @var boolean $realNamePublic | ||||
|      */ | ||||
|     private $realNamePublic; | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * Set user_id | ||||
|      * | ||||
|      * @param integer $userId | ||||
|      * @return UserData | ||||
|      */ | ||||
|     public function setUserId($userId) | ||||
|     { | ||||
|         $this->user_id = $userId; | ||||
|         return $this; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get user_id | ||||
|      * | ||||
|      * @return integer  | ||||
|      */ | ||||
|     public function getUserId() | ||||
|     { | ||||
|         return $this->user_id; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Set realName | ||||
|      * | ||||
|      * @param string $realName | ||||
|      * @return UserData | ||||
|      */ | ||||
|     public function setRealName($realName) | ||||
|     { | ||||
|         $this->realName = $realName; | ||||
|         return $this; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get realName | ||||
|      * | ||||
|      * @return string  | ||||
|      */ | ||||
|     public function getRealName() | ||||
|     { | ||||
|         return $this->realName; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Set realNamePublic | ||||
|      * | ||||
|      * @param boolean $realNamePublic | ||||
|      * @return UserData | ||||
|      */ | ||||
|     public function setRealNamePublic($realNamePublic) | ||||
|     { | ||||
|         $this->realNamePublic = $realNamePublic; | ||||
|         return $this; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get realNamePublic | ||||
|      * | ||||
|      * @return boolean  | ||||
|      */ | ||||
|     public function getRealNamePublic() | ||||
|     { | ||||
|         return $this->realNamePublic; | ||||
|     } | ||||
|     /** | ||||
|      * @var text $selfDescription | ||||
|      */ | ||||
|     private $selfDescription; | ||||
|  | ||||
|     /** | ||||
|      * @var boolean $emailPublic | ||||
|      */ | ||||
|     private $emailPublic; | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * Set selfDescription | ||||
|      * | ||||
|      * @param text $selfDescription | ||||
|      * @return UserData | ||||
|      */ | ||||
|     public function setSelfDescription($selfDescription) | ||||
|     { | ||||
|         $this->selfDescription = $selfDescription; | ||||
|         return $this; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get selfDescription | ||||
|      * | ||||
|      * @return text  | ||||
|      */ | ||||
|     public function getSelfDescription() | ||||
|     { | ||||
|         return $this->selfDescription; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Set emailPublic | ||||
|      * | ||||
|      * @param boolean $emailPublic | ||||
|      * @return UserData | ||||
|      */ | ||||
|     public function setEmailPublic($emailPublic) | ||||
|     { | ||||
|         $this->emailPublic = $emailPublic; | ||||
|         return $this; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get emailPublic | ||||
|      * | ||||
|      * @return boolean  | ||||
|      */ | ||||
|     public function getEmailPublic() | ||||
|     { | ||||
|         return $this->emailPublic; | ||||
|     } | ||||
|     /** | ||||
|      * @var string $msnAddress | ||||
|      */ | ||||
|     private $msnAddress; | ||||
|  | ||||
|     /** | ||||
|      * @var boolean $msnAddressPublic | ||||
|      */ | ||||
|     private $msnAddressPublic; | ||||
|  | ||||
|     /** | ||||
|      * @var string $googleTalk | ||||
|      */ | ||||
|     private $googleTalk; | ||||
|  | ||||
|     /** | ||||
|      * @var boolean $googleTalkPublic | ||||
|      */ | ||||
|     private $googleTalkPublic; | ||||
|  | ||||
|     /** | ||||
|      * @var string $skype | ||||
|      */ | ||||
|     private $skype; | ||||
|  | ||||
|     /** | ||||
|      * @var boolean $skypePublic | ||||
|      */ | ||||
|     private $skypePublic; | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * Set msnAddress | ||||
|      * | ||||
|      * @param string $msnAddress | ||||
|      * @return UserData | ||||
|      */ | ||||
|     public function setMsnAddress($msnAddress) | ||||
|     { | ||||
|         $this->msnAddress = $msnAddress; | ||||
|         return $this; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get msnAddress | ||||
|      * | ||||
|      * @return string  | ||||
|      */ | ||||
|     public function getMsnAddress() | ||||
|     { | ||||
|         return $this->msnAddress; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Set msnAddressPublic | ||||
|      * | ||||
|      * @param boolean $msnAddressPublic | ||||
|      * @return UserData | ||||
|      */ | ||||
|     public function setMsnAddressPublic($msnAddressPublic) | ||||
|     { | ||||
|         $this->msnAddressPublic = $msnAddressPublic; | ||||
|         return $this; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get msnAddressPublic | ||||
|      * | ||||
|      * @return boolean  | ||||
|      */ | ||||
|     public function getMsnAddressPublic() | ||||
|     { | ||||
|         return $this->msnAddressPublic; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Set googleTalk | ||||
|      * | ||||
|      * @param string $googleTalk | ||||
|      * @return UserData | ||||
|      */ | ||||
|     public function setGoogleTalk($googleTalk) | ||||
|     { | ||||
|         $this->googleTalk = $googleTalk; | ||||
|         return $this; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get googleTalk | ||||
|      * | ||||
|      * @return string | ||||
|      */ | ||||
|     public function getGoogleTalk() | ||||
|     { | ||||
|         return $this->googleTalk; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Set googleTalkPublic | ||||
|      * | ||||
|      * @param boolean $googleTalkPublic | ||||
|      * @return UserData | ||||
|      */ | ||||
|     public function setGoogleTalkPublic($googleTalkPublic) | ||||
|     { | ||||
|         $this->googleTalkPublic = $googleTalkPublic; | ||||
|         return $this; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get googleTalkPublic | ||||
|      * | ||||
|      * @return boolean  | ||||
|      */ | ||||
|     public function getGoogleTalkPublic() | ||||
|     { | ||||
|         return $this->googleTalkPublic; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Set skype | ||||
|      * | ||||
|      * @param string $skype | ||||
|      * @return UserData | ||||
|      */ | ||||
|     public function setSkype($skype) | ||||
|     { | ||||
|         $this->skype = $skype; | ||||
|         return $this; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get skype | ||||
|      * | ||||
|      * @return string  | ||||
|      */ | ||||
|     public function getSkype() | ||||
|     { | ||||
|         return $this->skype; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Set skypePublic | ||||
|      * | ||||
|      * @param boolean $skypePublic | ||||
|      * @return UserData | ||||
|      */ | ||||
|     public function setSkypePublic($skypePublic) | ||||
|     { | ||||
|         $this->skypePublic = $skypePublic; | ||||
|         return $this; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get skypePublic | ||||
|      * | ||||
|      * @return boolean  | ||||
|      */ | ||||
|     public function getSkypePublic() | ||||
|     { | ||||
|         return $this->skypePublic; | ||||
|     } | ||||
|     /** | ||||
|      * @var string $phoneNumber | ||||
|      */ | ||||
|     private $phoneNumber; | ||||
|  | ||||
|     /** | ||||
|      * @var boolean $phoneNumberPublic | ||||
|      */ | ||||
|     private $phoneNumberPublic; | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * Set phoneNumber | ||||
|      * | ||||
|      * @param string $phoneNumber | ||||
|      * @return UserData | ||||
|      */ | ||||
|     public function setPhoneNumber($phoneNumber) | ||||
|     { | ||||
|         $this->phoneNumber = $phoneNumber; | ||||
|         return $this; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get phoneNumber | ||||
|      * | ||||
|      * @return string  | ||||
|      */ | ||||
|     public function getPhoneNumber() | ||||
|     { | ||||
|         return $this->phoneNumber; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Set phoneNumberPublic | ||||
|      * | ||||
|      * @param boolean $phoneNumberPublic | ||||
|      * @return UserData | ||||
|      */ | ||||
|     public function setPhoneNumberPublic($phoneNumberPublic) | ||||
|     { | ||||
|         $this->phoneNumberPublic = $phoneNumberPublic; | ||||
|         return $this; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get phoneNumberPublic | ||||
|      * | ||||
|      * @return boolean  | ||||
|      */ | ||||
|     public function getPhoneNumberPublic() | ||||
|     { | ||||
|         return $this->phoneNumberPublic; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										79
									
								
								src/KekRozsak/FrontBundle/Form/Type/UserDataType.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										79
									
								
								src/KekRozsak/FrontBundle/Form/Type/UserDataType.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,79 @@ | ||||
| <?php | ||||
| namespace KekRozsak\FrontBundle\Form\Type; | ||||
|  | ||||
| use Symfony\Component\Form\AbstractType; | ||||
| use Symfony\Component\Form\FormBuilderInterface; | ||||
|  | ||||
| class UserDataType extends AbstractType | ||||
| { | ||||
| 	public function buildForm(FormBuilderInterface $builder, array $options) | ||||
| 	{ | ||||
| 		$builder->add('emailPublic', null, array( | ||||
| 			'label'    => 'Publikus legyen az e-mail címed?', | ||||
| 			'help'     => 'Ha bejelölöd, a kör többi tagja láthatja az e-mail címedet.', | ||||
| 			'required' => false, | ||||
| 		)); | ||||
| 		$builder->add('realName', null, array( | ||||
| 			'label' => 'Valódi neved', | ||||
| 			'help'  => 'A valódi, polgári neved. Nem kötelező mező, akkor érdemes megadni, ha szeretnéd, hogy a többi tag megtalálhasson különféle közösségi oldalakon.', | ||||
| 		)); | ||||
| 		$builder->add('realNamePublic', null, array( | ||||
| 			'label' => 'Publikus legyen a valódi neved?', | ||||
| 			'help'  => 'Ha bejelölöd, a kör többi tagja láthatja a valódi neved.', | ||||
| 			'required' => false, | ||||
| 		)); | ||||
| 		$builder->add('selfDescription', null, array( | ||||
| 			'label' => 'Rövid leírás Magadról', | ||||
| 			'help'  => 'Írj ide egy rövid leírást saját magadról. Ez mindenképpen megjelenik majd a profilodon, így a többiek tudhatják, hogy mivel is foglalkozol.', | ||||
| 		)); | ||||
| 		$builder->add('msnAddress', null, array( | ||||
| 			'label' => 'MSN címed', | ||||
| 			'help'  => 'Egy MSN cím, amin elérhető vagy.' | ||||
| 		)); | ||||
| 		$builder->add('msnAddressPublic', null, array( | ||||
| 			'label' => 'Publikus legyen az MSN címed?', | ||||
| 			'help'  => 'Ha bejelölöd, a kör többi tagja láthatja az MSN címedet.', | ||||
| 			'required' => false, | ||||
| 		)); | ||||
| 		$builder->add('googleTalk', null, array( | ||||
| 			'label' => 'Google Talk címed', | ||||
| 			'help'  => 'Itt egy olyan GMail-es e-mail címet adhatsz meg, amin elérhető vagy a GMail csevegőben.', | ||||
| 		)); | ||||
| 		$builder->add('googleTalkPublic', null, array( | ||||
| 			'label' => 'Publikus legyen a Google Talk címed?', | ||||
| 			'help'  => 'Ha bejelölöd, a kör többi tagja láthatja a Google Talk címedet.', | ||||
| 			'required' => false, | ||||
| 		)); | ||||
| 		$builder->add('skype', null, array( | ||||
| 			'label' => 'Skype neved', | ||||
| 			'help'  => 'Egy Skype név, amin elérhető vagy.', | ||||
| 		)); | ||||
| 		$builder->add('skypePublic', null, array( | ||||
| 			'label' => 'Publikus legyen a Skype neved?', | ||||
| 			'help'  => 'Ha bejelölöd, a kör többi tagja láthatja a Skype nevedet.', | ||||
| 			'required' => false, | ||||
| 		)); | ||||
| 		$builder->add('phoneNumber', null, array( | ||||
| 			'label' => 'Telefonszámod', | ||||
| 			'help'  => 'Egy telefonszám, amin elérhető vagy. Programszervezéseknél jól jöhet.', | ||||
| 		)); | ||||
| 		$builder->add('phoneNumberPublic', null, array( | ||||
| 			'label' => 'Publikus legyen a telefonszámod?', | ||||
| 			'help'  => 'Ha bejelölöd, a kör többi tagja láthatja a telefonszámodat.', | ||||
| 			'required' => false, | ||||
| 		)); | ||||
| 	} | ||||
|  | ||||
| 	public function getName() | ||||
| 	{ | ||||
| 		return 'user_data'; | ||||
| 	} | ||||
|  | ||||
| 	public function getDefaultOptions() | ||||
| 	{ | ||||
| 		return array( | ||||
| 			'data_class' => 'KekRozsak\FrontBundle\Entity\UserData' | ||||
| 		); | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @@ -4,11 +4,13 @@ namespace KekRozsak\FrontBundle\Form\Type; | ||||
| use Symfony\Component\Form\AbstractType; | ||||
| use Symfony\Component\Form\FormBuilderInterface; | ||||
|  | ||||
| use KekRozsak\FrontBundle\Form\Type\UserDataType; | ||||
|  | ||||
| class UserType extends AbstractType | ||||
| { | ||||
| 	protected $_registration; | ||||
|  | ||||
| 	public function __construct($registration) | ||||
| 	public function __construct($registration = false) | ||||
| 	{ | ||||
| 		$this->_registration = $registration; | ||||
| 	} | ||||
| @@ -17,12 +19,14 @@ class UserType extends AbstractType | ||||
| 	{ | ||||
| 		$builder->add('username', null, array( | ||||
| 			'label' => 'Felhasználónév', | ||||
| 			'read_only' => (!$this->_registration), | ||||
| 			'help'  => 'Ezt fogod használni az oldalra való bejelentkezéshez. Jelszavadhoz hasonlóan kezeld bizalmasan! Jelentkezés után nem lehet megváltoztatni!', | ||||
| 		)); | ||||
| 		$builder->add('password', 'repeated', array( | ||||
| 			'type'            => 'password', | ||||
| 			'second_name'     => 'confirm', | ||||
| 			'invalid_message' => 'A két jelszó nem egyezik meg!', | ||||
| 			'required'        => ($this->_registration), | ||||
| 			'options'         => array( | ||||
| 						'label' => 'Jelszó', | ||||
| 						'help'  => 'Ezt fogod használni az oldalra való bejelentkezéshez. Soha ne add meg senkinek!', | ||||
| @@ -30,16 +34,26 @@ class UserType extends AbstractType | ||||
| 		)); | ||||
| 		$builder->add('email', null, array( | ||||
| 			'label' => 'E-mail cím', | ||||
| 			'help'  => 'Ezen az e-mail címen értesítünk majd, ha felvételt nyersz a körbe.', | ||||
| 		)); | ||||
| 		$builder->add('displayName', null, array( | ||||
| 			'label' => 'Név', | ||||
| 			'help'  => 'Ezen a néven fog szólítani a közösség. Bármikor megváltoztathatod, de az egyértelműség kedvéért ezt mindig jelezd a többiek felé!', | ||||
| 		)); | ||||
| 		$builder->add('agree', 'checkbox', array( | ||||
| 			'property_path' => false, | ||||
| 			'label'         => ' ', | ||||
| 			'help'          => 'A Jelentkezés gomb megnyomásával kijelentem, hogy a Kék Rózsa okkultista kör Házirendjét elolvastam, és azt felvételem esetén magamra nézve teljes mértékben elfogadom.', | ||||
| 		)); | ||||
| 		if (!$this->_registration) | ||||
| 		{ | ||||
| 			$builder->add('user_data', new UserDataType(), array( | ||||
| 				'label' => 'Egyéb adatok', | ||||
| 			)); | ||||
| 		} | ||||
| 		else | ||||
| 		{ | ||||
| 			$builder->add('agree', 'checkbox', array( | ||||
| 				'property_path' => false, | ||||
| 				'label'         => ' ', | ||||
| 				'help'          => 'A Jelentkezés gomb megnyomásával kijelentem, hogy a Kék Rózsa okkultista kör Házirendjét elolvastam, és azt felvételem esetén magamra nézve teljes mértékben elfogadom.', | ||||
| 			)); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	public function getName() | ||||
|   | ||||
| @@ -41,3 +41,11 @@ KekRozsak\FrontBundle\Entity\User: | ||||
|         manyToMany: | ||||
|                 roles: | ||||
|                         targetEntity: Role | ||||
|         oneToOne: | ||||
|                 user_data: | ||||
|                         targetEntity: UserData | ||||
|                         mappedBy: user | ||||
|                         joinColumns: | ||||
|                                 id: | ||||
|                                         referencedColumnName: user_id | ||||
|                         cascade: [ 'persist' ] | ||||
|   | ||||
| @@ -0,0 +1,71 @@ | ||||
| KekRozsak\FrontBundle\Entity\UserData: | ||||
|         type: entity | ||||
|         table: user_data | ||||
|         id: | ||||
|                 user_id: | ||||
|                         type: integer | ||||
|         fields: | ||||
|                 emailPublic: | ||||
|                         type: boolean | ||||
|                         nullable: false | ||||
|                         default: false | ||||
|                 realName: | ||||
|                         name: real_name | ||||
|                         type: string(100) | ||||
|                         nullable: true | ||||
|                         default: null | ||||
|                 realNamePublic: | ||||
|                         name: real_name_public | ||||
|                         type: boolean | ||||
|                         nullable: true | ||||
|                         default: false | ||||
|                 selfDescription: | ||||
|                         name: self_description_public | ||||
|                         type: text | ||||
|                         nullable: true | ||||
|                         default: null | ||||
|                 msnAddress: | ||||
|                         name: msn | ||||
|                         type: string(100) | ||||
|                         nullable: true | ||||
|                         default: null | ||||
|                 msnAddressPublic: | ||||
|                         name: msn_public | ||||
|                         type: boolean | ||||
|                         nullable: false | ||||
|                         default: false | ||||
|                 googleTalk: | ||||
|                         name: google_talk | ||||
|                         type: string(100) | ||||
|                         nullable: true | ||||
|                         default: null | ||||
|                 googleTalkPublic: | ||||
|                         name: goole_talk_public | ||||
|                         type: boolean | ||||
|                         nullable: false | ||||
|                         default: false | ||||
|                 skype: | ||||
|                         type: string(100) | ||||
|                         nullable: true | ||||
|                         default: null | ||||
|                 skypePublic: | ||||
|                         name: skype_public | ||||
|                         type: boolean | ||||
|                         nullable: false | ||||
|                         default: false | ||||
|                 phoneNumber: | ||||
|                         name: phone_number | ||||
|                         type: string(30) | ||||
|                         nullable: true | ||||
|                 phoneNumberPublic: | ||||
|                         name: phone_number_public | ||||
|                         type: boolean | ||||
|                         nullable: false | ||||
|                         default: false | ||||
|         oneToOne: | ||||
|                 user: | ||||
|                         targetEntity: User | ||||
|                         inversedBy: user_data | ||||
|                         joinColumns: | ||||
|                                 user_id: | ||||
|                                         referencedColumnName: id | ||||
| @@ -31,3 +31,8 @@ KekRozsakFrontBundle_forum_new_post: | ||||
|                 _controller: KekRozsakFrontBundle:Forum:postList | ||||
|         requirements: | ||||
|                 _method: POST | ||||
|  | ||||
| KekRozsakFrontBundle_profile_edit: | ||||
|         pattern:  /profil | ||||
|         defaults: | ||||
|                 _controller: KekRozsakFrontBundle:Default:profileEdit | ||||
|   | ||||
| @@ -0,0 +1,14 @@ | ||||
| {% extends '::main_template.html.twig' %} | ||||
| {% form_theme form 'KekRozsakFrontBundle:Form:user_form.html.twig' %} | ||||
| {% block title %} - Profil szerkesztése{% endblock %} | ||||
| {% block content %} | ||||
| <h3>Felhasználói profil</h3> | ||||
| <p>Az itt megadott adataidat szigorúan kezeljük, azt más számára kizárólag hatósági felszólításra adjuk ki.</p> | ||||
| <p>A publikusnak megjelölt adataidat csak a kör tagjai láthatják, míg a nem publikusnak megjelölteket kizárólag az oldal adminisztrátorai.</p> | ||||
| <form method="post" action="{{ path('KekRozsakFrontBundle_profile_edit') }}"> | ||||
| 	<table> | ||||
| {{ form_widget(form) }} | ||||
| 	</table> | ||||
| 	<button type="submit">Mentés</button> | ||||
| </form> | ||||
| {% endblock content %} | ||||
| @@ -4,7 +4,7 @@ | ||||
| } | ||||
|  | ||||
| body { | ||||
| 	margin: 15px 0 0 0; | ||||
| 	margin: 0; | ||||
| 	background-color: black; | ||||
| 	background-image: url('../images/rose_bg.png'); | ||||
| 	background-repeat: no-repeat; | ||||
| @@ -12,9 +12,77 @@ body { | ||||
| 	background-position: right bottom; | ||||
| } | ||||
|  | ||||
| #top-line { | ||||
| 	position: fixed; | ||||
| 	left: 0; | ||||
| 	top: 0; | ||||
| 	width: 100%; | ||||
| 	background-color: #152967; | ||||
| 	color: #c4d3ff; | ||||
| 	height: 32px; | ||||
| 	border-bottom: 1px solid #1b3586; | ||||
| } | ||||
|  | ||||
| #top-line-padding { | ||||
| 	height: 33px; | ||||
| 	clear: both; | ||||
| } | ||||
|  | ||||
| #top-line #search-box { | ||||
| 	float: right; | ||||
| 	padding: 5px; | ||||
| } | ||||
|  | ||||
| #top-line #profil-gomb { | ||||
| 	float: left; | ||||
| 	padding: 5px; | ||||
| } | ||||
|  | ||||
| #bottom-line-padding { | ||||
| 	height: 33px; | ||||
| } | ||||
|  | ||||
| #profil-box { | ||||
| 	position: fixed; | ||||
| 	left: 5px; | ||||
| 	top: 32px; | ||||
| 	width: 300px; | ||||
| 	height: 400px; | ||||
| 	background-color: #c4d3ff; | ||||
| 	border: 2px solid #152967; | ||||
| 	color: #152967; | ||||
| 	display: none; | ||||
| } | ||||
|  | ||||
| #profil-belso { | ||||
| 	position: relative; | ||||
| 	padding: 5px; | ||||
| } | ||||
|  | ||||
| #profil-box dt { | ||||
| 	font-weight: bold; | ||||
| } | ||||
|  | ||||
| #profil-szerkesztes { | ||||
| 	position: absolute; | ||||
| 	bottom: 5px; | ||||
| 	right: 5px; | ||||
| } | ||||
|  | ||||
| #bottom-line { | ||||
| 	position: fixed; | ||||
| 	left: 0; | ||||
| 	bottom: 0; | ||||
| 	width: 100%; | ||||
| 	background-color: #152967; | ||||
| 	color: #c4d3ff; | ||||
| 	height: 32px; | ||||
| 	border-top: 1px solid #1b3586; | ||||
| } | ||||
|  | ||||
| #wrapper { | ||||
| 	background-color: #000000; | ||||
| 	width: 900px; | ||||
| 	width: 960px; | ||||
| 	margin-left: auto; | ||||
| 	margin-right: auto; | ||||
| } | ||||
| @@ -68,8 +136,8 @@ body { | ||||
| #content-outline { | ||||
| 	color:#3366ff; | ||||
| 	text-align: justify; | ||||
| 	width: 680px; | ||||
| 	float: right; | ||||
| 	width: 740px; | ||||
| 	float: left; | ||||
| } | ||||
|  | ||||
| #content { | ||||
| @@ -77,7 +145,7 @@ body { | ||||
| } | ||||
|  | ||||
| #hirek { | ||||
| 	float: left; | ||||
| 	float: right; | ||||
| 	color: #aaaacc; | ||||
| 	width: 215px; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user