Page 1 of 1

(Solved) FEU Change settings submit, shows empty content

Posted: Tue Oct 22, 2013 8:41 am
by Publisher
Hello everybody

When i am logged in, and want to change my account settings at the front page, after submitting the form unfortunally then i only see the Website with a "Logout" Button. In the same URL. But the changes are saved if i click again on 'my account'.
How can i be redirected to the same and show the form again with an success or error message?

Thanks in advice for your help!

My datas:
Link: http://sboj.ch.28.twcloud.ch/
CMSMS 1.11.5
CGExtensions 1.36
CGUserDirectory 1.3
CMSMailer 5.2.1
CMSPrinting 1.0.4
CustomContent 1.9
FEUSearch 0.0.0.1
FileManager 1.4.3
FormBrowser 0.4.2
FormBuilder 0.7.2
FrontEndUsers 1.21.16
JQueryFU 1.0.5
MenuManager 1.8.5
MicroTiny 1.2.5
MleCMS 1.11.4
ModuleManager 1.5.5
News 2.12.12
Search 1.7.8
SelfRegistration 1.7.8
ThemeManager 1.1.8

Implemented Changesettings Form like

Code: Select all

{FrontEndUsers form="changesettings"}
The Problem came with the default Change settings Template:

Code: Select all

<!-- change settings template -->
{$title}
{if isset($message) && $message != ''}
  {if isset($error) && $error != ''}
    <p><font color="red">{$message}</font></p>
  {else}
    <p>{$message}</p>
  {/if}
{/if}
{$startform}
 {if $controlcount > 0}
  <center>
  <table width="75%">
     {foreach from=$controls item=control}
  <tr>
     <td>{if isset($control->hidden)}{$control->hidden}{/if}<font color="{$control->color}">{$control->prompt}{$control->marker}</font></td>
     <td>
       {if isset($control->image)}{$control->image}<br/>{/if}
       {$control->control}{$control->addtext|default:''}
       {if isset($control->control2)}{$control->prompt2}&nbsp;{$control->control2}<br/>{/if}
     </td>
  </tr>
 {/foreach}
  </table>
  </center>
 {/if}
 {$hidden|default:''}{$hidden2|default:''}{$submit}
{$endform}
<!-- change settings template -->
Happening Template:

Code: Select all

{MleCMS action="init"}{process_pagedata}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<__html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
	<head>

		<title>{sitename} - {title}</title>
		{metadata}
		{cms_stylesheet}
	</head>
	</__body>

		<div id="header">
			<div class="wrapping">
				<h1>{global_content name='logo'}</h1>
				<div id="navig">
					{menu start_level='2'}
				</div>
				

				<div id="login">
					{if $ccuser->loggedin()}
                        {cms_module module=FrontEndUsers form=logout} 
					{else}
					<p class="head_login_button">
						<a href="/my-account">Login</a>
					</p>
					{/if}
					{global_content name='loginbutton'}
				</div>

			</div>
<div id="lang">{MleCMS action="langs"}</div>
			<div class="clear"></div>
		</div>

		<div id="banner">
			<div class="wrapping">
				<div id="bannertext">
					{global_content name='Bannertext'}
<div id="quicksearch">
<div id="quicksearch_title">{MleCMS name="block_banner_schnellsuche"}</div>
{MleCMS name="block_quicksearch"}
<div id="quicksearch_foot"></div>
</div>
					<div id="banner_two_blocks">
						<div class="left">
							<div class="additional_bg">
								{global_content name='BannerArbeitnehmer'}
							</div>
						</div>
						<div class="right">
							<div class="additional_bg">
								{global_content name='BannerArbeitgeber'}
							</div>
						</div>
						<div class="clear"></div>
					</div>
				</div>
			</div>
		</div>

		<div class="wrapping">
			<div id="leftbar">
{if $ccuser->memberof('Arbeitgeber')}
{menu childrenof='logged'}
{menu childrenof='employer'}
{else}
{menu childrenof='logged'}
{/if}
			</div>

			<div id="content">
<h2>{title}</h2>




				
{if $ccuser->loggedin()}
{content}
{else}
{cms_module module=FrontEndUsers form=login} 
{/if}

			</div>

                        <div class="clear"></div>

		</div>
<div id="footer">
<div class="wrapping">
{global_content name='footer'}
</div>
</div>
	<__body>
</__html>

Re: FEU Change settings submit, shows empty content page.

Posted: Tue Oct 22, 2013 3:28 pm
by Dr.CSS
Check the 'after log in' template to see if it is blank, check to see if a 'redirect to after log in' page has been set or not or if it is pointing to a non existent page...

Re: FEU Change settings submit, shows empty content page.

Posted: Wed Oct 23, 2013 8:35 am
by Publisher
Dr.CSS wrote:Check the 'after log in' template to see if it is blank, check to see if a 'redirect to after log in' page has been set or not or if it is pointing to a non existent page...
Hi Dr.CSS

Thanks a lot to this. I didn't see the configuration site for redirection to an site alias (explicit) after change tue user settings.
But i could only type in one alias, that means for the default language. To let this redirect to the specific alias because of using MLE i solved this with a little smart PHP script from me :-) as user defined tag:

Code: Select all

// Initialize vars
$s_prev_site 					= '';
$s_prev_site_wot_http_host 		= '';
$s_prev_site_lang 				= '';
$s_alias_my_account				= 'my-account';
$s_alias_my_account_de			= 'my-account-en';
$s_alias_calculated				= '';
$a_langs						= array( 'de' => 'de',
										 'en' => 'en'
										);

// Get prev site url
$s_prev_site = $_SERVER['HTTP_REFERER'];

// Strip host
$s_prev_site_wot_http_host = str_replace('http://' . $_SERVER['HTTP_HOST'] . '/', '', $s_prev_site);

// Get only lang shorty. Returns string like 'en', or 'de'
$s_prev_site_lang = substr($s_prev_site_wot_http_host, 0, 2);

// Set the correct alias
switch($s_prev_site_lang) {
	case $a_langs['de']:
		$s_alias_calculated = $s_alias_my_account;
	break;
	case $a_langs['en']:
		$s_alias_calculated = $s_alias_my_account_de;
	break;
}

// Built the to redirect url
$s_final_redirect_url = 'http://' . $_SERVER['HTTP_HOST'] . '/' . $s_prev_site_lang . '/' . $s_alias_calculated;

// Gratis redirection
header('Location: ' . $s_final_redirect_url);