Initial version with functionality to log into the component using frontend
This commit is contained in:
7
src/site/views/clubs/tmpl/default.php
Normal file
7
src/site/views/clubs/tmpl/default.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
?>
|
||||
asd
|
||||
10
src/site/views/clubs/view.html.php
Normal file
10
src/site/views/clubs/view.html.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
class ClubsViewClubs extends HtmlView
|
||||
{
|
||||
}
|
||||
22
src/site/views/login/tmpl/default.php
Normal file
22
src/site/views/login/tmpl/default.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
use Joomla\CMS\Factory;
|
||||
|
||||
if($this->state === "failed")
|
||||
{
|
||||
?>
|
||||
<p class='error'>Benutzername oder Passwort sind falsch.</p>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<form method="post" action="?option=com_clubs&task=login.login">
|
||||
<p>
|
||||
Username:<br />
|
||||
<input name="user" type="text">
|
||||
</p>
|
||||
<p>
|
||||
Passwort:<br />
|
||||
<input name="password" type="password">
|
||||
</p>
|
||||
<p><input type="checkbox" name='keep' value='true' <?php if(Factory::getApplication()->input->cookie->get('clubsLoginKeepLoggedIn','') === 'true') echo "checked";?>> Keep me logged in</p>
|
||||
<p><input type="submit" value="Einloggen"></p>
|
||||
</form>
|
||||
7
src/site/views/login/tmpl/logout.php
Normal file
7
src/site/views/login/tmpl/logout.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
?>
|
||||
<a href='?option=com_clubs&task=login.logout'>Logout</a>
|
||||
30
src/site/views/login/view.html.php
Normal file
30
src/site/views/login/view.html.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
use Joomla\CMS\Factory;
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
JLoader::register("ClubsHelperAuth", JPATH_ROOT . "/components/com_clubs/helpers/auth.php");
|
||||
|
||||
class ClubsViewLogin extends HtmlView
|
||||
{
|
||||
|
||||
public function display($tpl = null)
|
||||
{
|
||||
$helper = new ClubsHelperAuth();
|
||||
if($helper->checkCookie())
|
||||
{
|
||||
// we are logged in
|
||||
$this->setLayout('logout');
|
||||
parent::display(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->state = Factory::getApplication()->input->get("state", "");
|
||||
parent::display($tpl);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user