132 lines
2.9 KiB
PHP
132 lines
2.9 KiB
PHP
<?php
|
|
|
|
if (! defined('BASE_DIR'))
|
|
exit;
|
|
|
|
function mod_login ()
|
|
{
|
|
global $AVE_Template;
|
|
|
|
require_once(BASE_DIR . '/modules/login/class/login.php');
|
|
|
|
new Login;
|
|
|
|
// Если прошли по ссылке, для показа формы, убираем вывод тега
|
|
if (isset($_REQUEST['module']) && $_REQUEST['module'] == 'login' && $_REQUEST['action'] == 'form')
|
|
return false;
|
|
|
|
$tpl_dir = BASE_DIR . '/modules/login/public/';
|
|
$lang_file = BASE_DIR . '/modules/login/lang/' . $_SESSION['user_language'] . '.txt';
|
|
|
|
if (isset($_SESSION['user_id']) && isset($_SESSION['user_pass']))
|
|
{
|
|
$avatar = getAvatar($_SESSION['user_id'],180);
|
|
|
|
$AVE_Template->assign('avatar', $avatar);
|
|
$AVE_Template->config_load($lang_file, 'displaypanel');
|
|
$AVE_Template->display($tpl_dir . 'panel.tpl');
|
|
}
|
|
else
|
|
{
|
|
$active = Login::settings('login_status');
|
|
|
|
$AVE_Template->config_load($lang_file, 'loginform');
|
|
$AVE_Template->assign('active', $active);
|
|
$AVE_Template->display($tpl_dir . 'form.tpl');
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
|
|
//=======================================================
|
|
// Public functions
|
|
//=======================================================
|
|
if (! defined('ACP') && isset($_REQUEST['module']) && $_REQUEST['module'] == 'login' && ! empty($_REQUEST['action']))
|
|
{
|
|
require_once(BASE_DIR . '/modules/login/class/login.php');
|
|
|
|
new Login;
|
|
|
|
Login::$_tpl_dir = BASE_DIR . '/modules/login/public/';
|
|
|
|
Login::$_lang_file = BASE_DIR . '/modules/login/lang/' . $_SESSION['user_language'] . '.txt';
|
|
|
|
switch ($_REQUEST['action'])
|
|
{
|
|
case 'form':
|
|
Login::form();
|
|
break;
|
|
|
|
case 'authorize':
|
|
Login::authorize();
|
|
break;
|
|
|
|
case 'logout':
|
|
Login::logout();
|
|
break;
|
|
|
|
case 'register':
|
|
Login::register();
|
|
break;
|
|
|
|
case 'reminder':
|
|
Login::reminder();
|
|
break;
|
|
|
|
case 'change':
|
|
Login::change();
|
|
break;
|
|
|
|
case 'delete':
|
|
Login::delete();
|
|
break;
|
|
|
|
case 'profile':
|
|
Login::profile();
|
|
break;
|
|
|
|
case 'info':
|
|
Login::info();
|
|
break;
|
|
|
|
case 'checkusername':
|
|
Login::checkusername();
|
|
break;
|
|
|
|
case 'checkemail':
|
|
Login::checkemail();
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
//=======================================================
|
|
// The control module in the admin panel
|
|
//=======================================================
|
|
if (
|
|
defined('ACP')
|
|
&& (isset($_REQUEST['moduleaction']) && !empty($_REQUEST['moduleaction']))
|
|
&& (isset($_REQUEST['mod']) && $_REQUEST['mod'] == 'login')
|
|
)
|
|
{
|
|
require_once(BASE_DIR . '/modules/login/class/login.php');
|
|
|
|
new Login;
|
|
|
|
Login::$_tpl_dir = BASE_DIR . '/modules/login/admin/';
|
|
|
|
$lang_file = BASE_DIR . '/modules/login/lang/' . $_SESSION['admin_language'] . '.txt';
|
|
|
|
$AVE_Template->config_load($lang_file, 'showconfig');
|
|
$AVE_Template->assign('config_vars', $AVE_Template->get_config_vars());
|
|
|
|
switch($_REQUEST['moduleaction'])
|
|
{
|
|
case '1':
|
|
Login::admin();
|
|
break;
|
|
}
|
|
}
|
|
|
|
?>
|