Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu item "Create Topic" is inaccessible #5055 #5056

Merged
merged 1 commit into from Nov 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,99 @@
<?php
/**
* Kunena Component
* @package Kunena.Template.Crypsis
* @subpackage Layout.Widget
*
* @copyright (C) 2008 - 2016 Kunena Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link https://www.kunena.org
**/
defined('_JEXEC') or die;
?>
<div class="kloginform center">
<h1><?php echo JText::_('COM_KUNENA_LOGIN_FORUM');?></h1>
<form action="<?php echo JRoute::_('index.php?option=com_kunena'); ?>" method="post" class="form-inline">
<input type="hidden" name="view" value="user" />
<input type="hidden" name="task" value="login" />
<?php echo JHtml::_('form.token'); ?>

<div id="form-login-username" class="control-group center">
<div class="controls">
<div class="input-prepend input-append">
<span class="add-on">
<?php echo KunenaIcons::user();?>
<label for="login-username" class="element-invisible">
<?php echo JText::_('JGLOBAL_USERNAME'); ?>
</label>
</span>
<input id="login-username" type="text" name="username" class="input-small" tabindex="1"
size="18" placeholder="<?php echo JText::_('JGLOBAL_USERNAME'); ?>" />
</div>
</div>
</div>

<div id="form-login-password" class="control-group center">
<div class="controls">
<div class="input-prepend input-append">
<span class="add-on">
<?php echo KunenaIcons::lock();?>
<label for="login-passwd" class="element-invisible">
<?php echo JText::_('JGLOBAL_PASSWORD'); ?>
</label>
</span>
<input id="login-passwd" type="password" name="password" class="input-small" tabindex="2"
size="18" placeholder="<?php echo JText::_('JGLOBAL_PASSWORD'); ?>" />
</div>
</div>
</div>

<?php $login = KunenaLogin::getInstance(); ?>
<?php if ($login->getTwoFactorMethods() > 1) : ?>
<div id="form-login-tfa" class="control-group center">
<div class="controls">
<div class="input-prepend input-append">
<span class="add-on">
<?php echo KunenaIcons::star();?>
<label for="k-lgn-secretkey" class="element-invisible">
<?php echo JText::_('COM_KUNENA_LOGIN_SECRETKEY'); ?>
</label>
</span>
<input id="k-lgn-secretkey" type="text" name="secretkey" class="input-small" tabindex="3"
size="18" placeholder="<?php echo JText::_('COM_KUNENA_LOGIN_SECRETKEY'); ?>" />
</div>
</div>
</div>
<?php endif; ?>

<div id="form-login-submit" class="control-group center">
<p>
<button type="submit" tabindex="3" name="submit" class="btn btn-primary btn">
<?php echo JText::_('JLOGIN'); ?>
</button>
</p>

<p>
<?php if ($login->getResetUrl()) : ?>
<a href="<?php echo $login->getResetUrl(); ?>" rel="nofollow">
<?php echo JText::_('COM_KUNENA_PROFILEBOX_FORGOT_PASSWORD'); ?>
</a>
<br />
<?php endif ?>

<?php if ($login->getRemindUrl()) : ?>
<a href="<?php echo $login->getRemindUrl(); ?>" rel="nofollow">
<?php echo JText::_('COM_KUNENA_PROFILEBOX_FORGOT_USERNAME'); ?>
</a>
<br />
<?php endif ?>

<?php if ($login->getRegistrationUrl()) : ?>
<a href="<?php echo $login->getRegistrationUrl(); ?>" rel="nofollow">
<?php echo JText::_('COM_KUNENA_PROFILEBOX_CREATE_ACCOUNT'); ?>
</a>
<?php endif ?>

</p>
</div>
</form>
</div>
18 changes: 16 additions & 2 deletions src/libraries/kunena/controller/application/display.php
Expand Up @@ -124,8 +124,22 @@ public function execute()
}
catch (KunenaExceptionAuthorise $e)
{
$app = JFactory::getApplication();
$app->redirect(JRoute::_('index.php?option=com_kunena', false));
if (JFactory::getUser()->guest)
{
$this->output->setLayout('login');
$this->content = KunenaLayout::factory('Widget/Login/Login')->setLayout('login');
$this->document->setTitle(JText::_('COM_KUNENA_LOGIN_FORUM'));
}
else
{
$this->setResponseStatus($e->getResponseCode());
$this->output->setLayout('unauthorized');
$this->document->setTitle($e->getResponseStatus());

$this->content = KunenaLayout::factory('Widget/Error')
->set('header', $e->getResponseStatus());

}
}
catch (Exception $e)
{
Expand Down