Jump to content
  • 0
Sign in to follow this  
Snaehild

FluxCP Registration/Email redirection

Question

Hi,

I know this question has been asked a few times already (here and here) but I had no luck finding a working solution so far.

I'm using purple theme by Skyzone, and registration redirects us to homepage w/o any message after registration.

Any help is greatly appreciated.

 

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

You are missing this definition on the theme

<?php if ($message=$session->getMessage()): ?>

The line above shows the message. If its a custom theme, make sure that you have a space for it or add a modal that will show once condition is met.

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)
1 hour ago, Foob said:

You are missing this definition on the theme

<?php if ($message=$session->getMessage()): ?>

The line above shows the message. If its a custom theme, make sure that you have a space for it or add a modal that will show once condition is met.

Hi @Foob

Thank you for your response.

Is this supposed to go on /account/create.php ?

<?php if (!defined('FLUX_ROOT')) exit; ?>

<h3><?php echo htmlspecialchars(Flux::message('AccountCreateHeading')) ?></h3>

		<p><?php printf(htmlspecialchars(Flux::message('AccountCreateInfo')), '<a href="'.$this->url('service', 'tos').'">'.Flux::message('AccountCreateTerms').'</a>') ?></p>

		<?php if (isset($errorMessage)): ?>
		<p class="red" style="font-weight: bold"><?php echo htmlspecialchars($errorMessage) ?></p>
		<?php endif ?>
		
	<div class="row">
		<div class="col col-lg-6">
			<form action="<?php echo $this->url ?>" method="post"  class="generic-form">
				<?php if (count($serverNames) === 1): ?>
				<input type="hidden" name="server" value="<?php echo htmlspecialchars($session->loginAthenaGroup->serverName) ?>">
				<?php endif ?>
				
				<?php if (count($serverNames) > 1): ?>
				<div class="form-group">
					<label for="register_server"><?php echo htmlspecialchars(Flux::message('AccountServerLabel')) ?></label>
					<select name="server" id="register_server"<?php if (count($serverNames) === 1) echo ' disabled="disabled"' ?>>
					<?php foreach ($serverNames as $serverName): ?>
						<option value="<?php echo htmlspecialchars($serverName) ?>"<?php if ($params->get('server') == $serverName) echo ' selected="selected"' ?>><?php echo htmlspecialchars($serverName) ?></option>
					<?php endforeach ?>
					</select>
				</div>
				<?php endif ?>
				
				<div class="form-group">
					<label for="register_username"><?php echo htmlspecialchars(Flux::message('AccountUsernameLabel')) ?></label>
					<input required class="text-primary form-control" type="text" name="username" id="register_username" value="<?php echo htmlspecialchars($params->get('username')) ?>" />
				</div>
				
				<div class="form-group">
					<label for="register_password"><?php echo htmlspecialchars(Flux::message('AccountPasswordLabel')) ?></label>
					<input required class="text-primary form-control" type="password" name="password" id="register_password" />
				</div>
				
				<div class="form-group">
					<label for="register_confirm_password"><?php echo htmlspecialchars(Flux::message('AccountPassConfirmLabel')) ?></label>
					<input required class="text-primary form-control" type="password" name="confirm_password" id="register_confirm_password" />
				</div>
				
				<div class="form-group">
					<label for="register_email_address"><?php echo htmlspecialchars(Flux::message('AccountEmailLabel')) ?></label>
					<input required class="text-primary form-control" type="text" name="email_address" id="register_email_address" value="<?php echo htmlspecialchars($params->get('email_address')) ?>" />
				</div>
							
				<div class="form-group">
					<label for="register_email_address"><?php echo htmlspecialchars(Flux::message('AccountEmailLabel2')) ?></label>
					<input required class="text-primary form-control" type="text" name="email_address2" id="register_email_address2" value="<?php echo htmlspecialchars($params->get('email_address2')) ?>" />				
				</div>
				
				<div class="form-group gender">
					<label><?php echo htmlspecialchars(Flux::message('AccountGenderLabel')) ?></label>
					<div class="gender-m" style="display:inline-block; width:45%; text-align:center;"><label><input checked class="text-primary form-control" type="radio" name="gender" id="register_gender_m" value="M"<?php if ($params->get('gender') === 'M') echo ' checked="checked"' ?> /> <?php echo $this->genderText('M') ?></label></div>
					<div class="gender-f" style="display:inline-block; width:45%; text-align:center;"><label><input class="text-primary form-control" type="radio" name="gender" id="register_gender_f" value="F"<?php if ($params->get('gender') === 'F') echo ' checked="checked"' ?> /> <?php echo $this->genderText('F') ?></label></div>
					<strong title="<?php echo htmlspecialchars(Flux::message('AccountCreateGenderInfo')) ?>"></strong>
				</div>
				
				<div class="form-group" style="display:none;">
					<label><?php echo htmlspecialchars(Flux::message('AccountBirthdateLabel')) ?></label>
					<?php echo $this->dateField('birthdate',null,0) ?>
				</div>
				
				
				<?php if (Flux::config('UseCaptcha')): ?>
					<?php if (Flux::config('EnableReCaptcha')): ?>
					<div class="form-group">
						<label for="register_security_code"><?php echo htmlspecialchars(Flux::message('AccountSecurityLabel')) ?></label>
						<div class="g-recaptcha" data-theme = "<?php echo $theme;?>" data-sitekey="<?php echo $recaptcha ?>"></div>
					</div>
				<?php else: ?>				
					<div class="form-group">
						<label for=""><?php echo htmlspecialchars(Flux::message('AccountSecurityLabel')) ?></label>
						<div class="security-code">
							<img src="<?php echo $this->url('captcha') ?>" />
						</div>					
					</div>
					
					<div class="form-group">
						<input required class="text-primary form-control" type="text" name="security_code" id="register_security_code">
					</div>
				
					<div class="form-group">
						<strong>
							<a href="javascript:refreshSecurityCode('.security-code img')">
								<?php echo htmlspecialchars(Flux::message('RefreshSecurityCode')) ?>
							</a>
						</strong> 
					</div>
				<?php endif ?>			
				<?php endif ?>
				
				<div class="form-group">
					<div style="margin-bottom:;">
						<?php printf(htmlspecialchars(Flux::message('AccountCreateInfo2')), '<a href="'.$this->url('service', 'tos').'">'.Flux::message('AccountCreateTerms').'</a>') ?>
					</div>
				</div>
							
				<div class="form-group">
					<button class="button button-primary btn-block" type="submit">
						<strong><?php echo htmlspecialchars(Flux::message('AccountCreateButton')) ?></strong>
					</button>
				</div>
			</form>		
		</div>
		
		<div class="col col-lg-6">
			<p><?php printf(htmlspecialchars(Flux::message('AccountCreateInfo')), '<a href="'.$this->url('service', 'tos').'">'.Flux::message('AccountCreateTerms').'</a>') ?></p>
			<?php if (Flux::config('RequireEmailConfirm')): ?>
			<p><strong>Note:</strong> You will need to provide a working e-mail address to confirm your account before you can log-in.</p>
			<?php endif ?>
			<p><strong>Note:</strong> Your forum account will be tied to your e-mail address. For your security, you can change your forums display name on your <a href="https://roslayers.com/forums/settings/username/" target="_blank">forums' account settings</a> once every 60 days.</p>
			<p><strong>Note:</strong> <?php echo sprintf("Your password must be between %d and %d characters.", Flux::config('MinPasswordLength'), Flux::config('MaxPasswordLength')) ?></p>
			<?php if (Flux::config('PasswordMinUpper') > 0): ?>
			<p><strong>Note:</strong> <?php echo sprintf(Flux::message('PasswordNeedUpper'), Flux::config('PasswordMinUpper')) ?></p>
			<?php endif ?>
			<?php if (Flux::config('PasswordMinLower') > 0): ?>
			<p><strong>Note:</strong> <?php echo sprintf(Flux::message('PasswordNeedLower'), Flux::config('PasswordMinLower')) ?></p>
			<?php endif ?>
			<?php if (Flux::config('PasswordMinNumber') > 0): ?>
			<p><strong>Note:</strong> <?php echo sprintf(Flux::message('PasswordNeedNumber'), Flux::config('PasswordMinNumber')) ?></p>
			<?php endif ?>
			<?php if (Flux::config('PasswordMinSymbol') > 0): ?>
			<p><strong>Note:</strong> <?php echo sprintf(Flux::message('PasswordNeedSymbol'), Flux::config('PasswordMinSymbol')) ?></p>
			<?php endif ?>
			<?php if (!Flux::config('AllowUserInPassword')): ?>
			<p><strong>Note:</strong> <?php echo Flux::message('PasswordContainsUser') ?></p>
			<?php endif ?>

		</div>
	</div>

 

Edit: Renamed the /theme/account folder to something else , assuming the default registration script will work but same result.

Edited by Snaehild

Share this post


Link to post
Share on other sites
  • 0

Check default theme and under header, you can find the line. 

Since its custom I don't know where to put it. But ideally, I would put it like a modal so that it will appear in-front of the theme.

Share this post


Link to post
Share on other sites
  • 0
6 minutes ago, Foob said:

Check default theme and under header, you can find the line. 

Since its custom I don't know where to put it. But ideally, I would put it like a modal so that it will appear in-front of the theme.

Found it. This is actually on the header file

<?php if ($message=$session->getMessage()): ?>
	<p class="message"><?php echo htmlspecialchars($message) ?></p>
<?php endif ?>

Do you have any sample on the modal approach?

Share this post


Link to post
Share on other sites
  • 0

Try this (Reference Bootstrap)

<div class="modal" id="testModal" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">Modal title</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">×</span>
        </button>
      </div>
      <div class="modal-body">
        <p><?php echo htmlspecialchars($message) ?></p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>

on header.php

		<?php if ($message=$session->getMessage()): ?>
			<script type="text/javascript">
				$(document).ready(function(){
					$("#testModal").delay(2000).modal('show');
				});
			</script>		
		<?php endif ?>

The message will appear 2seconds after the document is ready.

Share this post


Link to post
Share on other sites
  • 0

Tried it on theme/purple_themes/header.php

No luck.

Tried the other skyzone theme as well and it works exactly the same.

I guess, i'll just switch to other themes

<?php if (!defined('FLUX_ROOT')) exit; ?>
<?php require_once (FLUX_THEME_DIR."/purple_themes/skyzone_config.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="description" content="">
		<meta name="author" content="">

		<?php if (isset($metaRefresh)): ?>
		<meta http-equiv="refresh" content="<?php echo $metaRefresh['seconds'] ?>; URL=<?php echo $metaRefresh['location'] ?>" />
		<?php endif ?>
		<title><?php echo Flux::config('SiteTitle'); if (isset($title)) echo ": $title" ?></title>
        <!-- favicons -->
		<link rel="shortcut icon" href="<?php echo $this->themePath('favicon.ico') ?>" type="image/x-icon">
		<link rel="icon" href="<?php echo $this->themePath('favicon.ico') ?>" type="image/x-icon">

		<link rel="stylesheet" href="<?php echo $this->themePath('css/flux.css') ?>" type="text/css" media="screen" title="" charset="utf-8" />
		<link href="<?php echo $this->themePath('css/flux/unitip.css') ?>" rel="stylesheet" type="text/css" media="screen" title="" charset="utf-8" />
		<?php if (Flux::config('EnableReCaptcha')): ?>
			<script src='https://www.google.com/recaptcha/api.js'></script>
		<?php endif ?>

		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

		<!-- CSS -->
		<link rel="stylesheet" href="<?php echo $this->themePath('css/base.css') ?>">
		<link rel="stylesheet" href="<?php echo $this->themePath('css/vendor.css') ?>">
		<link rel="stylesheet" href="<?php echo $this->themePath('css/main.css') ?>">
		<link rel="stylesheet" href="<?php echo $this->themePath('css/choco_main.css') ?>">
		
		<!-- script -->
		<script src="<?php echo $this->themePath('js/modernizr.js') ?>"></script>
		<script src="<?php echo $this->themePath('js/pace.min.js') ?>"></script>

	</head>

	<body id="top">
	<div id="fb-root"></div>
	<script async defer crossorigin="anonymous" src="https://connect.facebook.net/pt_EN/sdk.js#xfbml=1&version=v3.3"></script>

    <!-- Fixed navbar -->
	<?php //include $this->themePath('main/navbar.php', true) ?>

	<!-- header -->
   <header id="header" class="row" style="">
   		<div class="header-logo">
			<a href="<?php echo $this->url('main'); ?>"><img src="img/logo-min.svg" alt="" title="" /></a>
			<a class="hide-ros" href="<?php echo $this->url('main'); ?>"><?php echo $config['server_name'];?></a>
	    </div>

	   	<nav id="header-nav-wrap">
			<ul class="header-main-nav">
				<?php foreach($config['nav_index'] as $navi): ?>
				<li class="<?php echo $navi[0]; ?>">
					<a class="<?php echo $navi[1]; ?>" href="<?php echo $navi[2]; ?>"> <?php echo $navi[3]; ?> </a>
				</li>
				<?php endforeach; ?>
			</ul>

			<div class="btn-group text-left">
				<a type="button" class="button button-primary cta dropdown-toggle" data-toggle = "dropdown">
				 Control Panel
				 <span class = "caret"></span>
				</a>
				<ul class="dropdown-menu pull-right">
					<?php foreach($config['nav_panel'] as $cp): ?>
					<li>
						<a href="<?php echo $cp[2]; ?>" title="<?php echo $cp[0]; ?>" class="text-primary"><?php echo $cp[0]; ?></a>
					</li>
					<?php endforeach; ?>
				</ul>
			</div>

			<?php $adminMenuItems = $this->getAdminMenuItems(); ?>
			<?php if (!empty($adminMenuItems) && Flux::config('AdminMenuNewStyle')): ?>
			<div class="btn-group text-left">
			  <a type="button" class="button button-primary cta dropdown-toggle" data-toggle = "dropdown">
				 Admin Panel
				 <span class = "caret"></span>
			  </a>
			  <ul class="dropdown-menu pull-right">
					<?php foreach ($adminMenuItems as $menuItem): ?>
					<li>
						<a href="<?php echo $this->url($menuItem['module'], $menuItem['action']) ?>"><?php echo htmlspecialchars(Flux::message($menuItem['name'])) ?></a>
					</li>
					<?php endforeach; ?>
			  </ul>
		   </div>
		   <?php endif ?>
		</nav>

		<a class="header-menu-toggle" href="#"><span>Menu</span></a>

   </header>
   <!-- /header -->

		<?php  if(!($params->get('module') == 'main' && $params->get('action') == 'index')){ ?>
		<section id="home" style="padding-top:100px; padding-button:100px;">
			<div class="container" style="background-color:#FFF; border-radius:10px; padding:10px;">
				<?php if (Flux::config('DebugMode') && @gethostbyname(Flux::config('ServerAddress')) == '127.0.0.1'): ?>
					<p class="notice">Please change your <strong>ServerAddress</strong> directive in your application config to your server's real address (e.g., myserver.com).</p>
				<?php endif ?>
					<!-- Messages -->
					<?php if ($message=$session->getMessage()): ?>
						<p class="message"><?php echo htmlspecialchars($message) ?></p>
					<?php endif ?>
					
					<div class="modal" id="testModal" tabindex="-1" role="dialog">
					  <div class="modal-dialog" role="document">
						<div class="modal-content">
						  <div class="modal-header">
							<h5 class="modal-title">Modal title</h5>
							<button type="button" class="close" data-dismiss="modal" aria-label="Close">
							  <span aria-hidden="true">×</span>
							</button>
						  </div>
						  <div class="modal-body">
							<p><?php echo htmlspecialchars($message) ?></p>
						  </div>
						  <div class="modal-footer">
							<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
							<button type="button" class="btn btn-primary">Save changes</button>
						  </div>
						</div>
					  </div>
					</div>
					
					<?php if ($message=$session->getMessage()): ?>
						<script type="text/javascript">
							$(document).ready(function(){
								$("#testModal").delay(2000).modal('show');
							});
						</script>		
					<?php endif ?>

					<!-- Sub menu -->
					<?php include $this->themePath('main/submenu.php', true) ?>

					<!-- Page menu -->
					<?php include $this->themePath('main/pagemenu.php', true) ?>


					<!-- Credit balance -->
					<?php //if (in_array($params->get('module'), array('donate', 'purchase'))) include 'main/balance.php' ?>

		<?php } ?>

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.