code: public function handleUserProfile(Contao\DataContainer $dc)
  	{
  		if (Contao\Input::get('do') != 'login')
  		{
  			return;
  		}
  
  		// Should not happen because of the redirect but better safe than sorry
  		if (Contao\BackendUser::getInstance()->id != Contao\Input::get('id') || Contao\Input::get('act') != 'edit')
  		{
  			throw new Contao\CoreBundle\Exception\AccessDeniedException('Not allowed to edit this page.');
  		}
  
  		$GLOBALS['TL_DCA'][$dc->table]['config']['closed'] = true;
  		$GLOBALS['TL_DCA'][$dc->table]['config']['hideVersionMenu'] = true;
  
  		$GLOBALS['TL_DCA'][$dc->table]['palettes'] = array
  		(
  			'__selector__' => $GLOBALS['TL_DCA'][$dc->table]['palettes']['__selector__'],
  			'default' => $GLOBALS['TL_DCA'][$dc->table]['palettes']['login']
  		);
  
  		$arrFields = Contao\StringUtil::trimsplit('[,;]', $GLOBALS['TL_DCA'][$dc->table]['palettes']['default']);
  
  		foreach ($arrFields as $strField)
  		{
  			$GLOBALS['TL_DCA'][$dc->table]['fields'][$strField]['exclude'] = false;
  		}
  	}
docs: Handle the profile page.
  
  @param Contao\DataContainer $dc