forked from dzdevteam/mod_steamlogin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod_steamlogin.php
executable file
·41 lines (36 loc) · 1.35 KB
/
mod_steamlogin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* @version 1.0.0
* @package mod_steamlogin
* @copyright Copyright (C) 2013. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author DZ Team <[email protected]> - dezign.vn
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
require_once __DIR__ . '/helper.php';
$user = JFactory::getUser();
$layout = $params->get('layout', 'default');
$type = ModSteamLoginHelper::getType();
$return = ModSteamLoginHelper::getReturnURL($params, $type);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'));
// Logged users must load the logout sublayout
if (!$user->guest) {
// Profile link
$profile_query = 'index.php?option=com_users&view=profile';
$profile_item = JFactory::getApplication()->getMenu()->getItems('link', $profile_query, true);
if ($profile_item) {
$profile_url = JRoute::_('index.php?Itemid=' . $profile_item->id);
} else {
$profile_url = JRoute::_($profile_query);
}
$layout .= '_logout';
}
// Do not display module if already in view login
// $view = JRequest::getCmd('view');
// $option = JRequest::getCmd('option');
// if ($view == 'login' && ($option == 'com_users' || $option == 'com_steamid')) {
// return;
// }
// Display template
require JModuleHelper::getLayoutPath('mod_steamlogin',$layout);