added login statistics
This commit is contained in:
parent
09b18ed86c
commit
8bb1b90d81
@ -147,6 +147,8 @@
|
||||
*/
|
||||
$opt['session']['check_referer'] = true;
|
||||
|
||||
$opt['session']['login_statistics'] = false;
|
||||
|
||||
/* Debug level (combine with OR | )
|
||||
* DEBUG_NO = productive use
|
||||
* DEBUG_DEVELOPER = developer system
|
||||
|
8
htdocs/doc/sql/tables/sys_login_stat.sql
Normal file
8
htdocs/doc/sql/tables/sys_login_stat.sql
Normal file
@ -0,0 +1,8 @@
|
||||
SET NAMES 'utf8';
|
||||
DROP TABLE IF EXISTS `sys_login_stat`;
|
||||
CREATE TABLE `sys_login_stat` (
|
||||
`day` date NOT NULL,
|
||||
`type` char(10) NOT NULL,
|
||||
`count` int(11) NOT NULL,
|
||||
UNIQUE KEY `day` (`day`,`type`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
|
@ -29,6 +29,7 @@
|
||||
<form action="login.php" method="post" enctype="application/x-www-form-urlencoded" name="login_form" dir="ltr" style="display: inline;">
|
||||
<input type="hidden" name="target" value="{target}" />
|
||||
<input type="hidden" name="action" value="login" />
|
||||
<input type="hidden" name="source" value="loginpage" />
|
||||
<table class="table">
|
||||
<tr><td class="spacer" colspan="2"></td></tr>
|
||||
{message_start}<tr><td colspan="2" class="message">{message}</td></tr><tr><td class="spacer" colspan="2"></td></tr>{message_end}
|
||||
@ -44,8 +45,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="header-small" colspan="2">
|
||||
<input type="reset" name="reset" value="{t}Reset{/t}" class="formbuttons" />
|
||||
<input type="submit" name="LogMeIn" value="{t}Login{/t}" class="formbuttons" />
|
||||
<input type="reset" name="reset" value="{t}Reset{/t}" class="formbutton" />
|
||||
<input type="submit" name="LogMeIn" value="{t}Login{/t}" class="formbutton" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
tpl_set_var('runtime', '');
|
||||
|
||||
//set up main template specific string
|
||||
$sLoggedOut = '<form action="login.php" method="post" enctype="application/x-www-form-urlencoded" name="login" dir="ltr" style="display: inline;"><b>' . t('User') . ':</b> <input name="email" size="10" type="text" class="textboxes" value="" /> <b>' . t('Password') . ':</b> <input name="password" size="10" type="password" class="textboxes" value="" /> <input type="hidden" name="action" value="login" /><input type="hidden" name="target" value="{target}" /> <input type="submit" name="LogMeIn" value="' . t('Login') . '" class="formbuttons" style="width: 65px;" /></form>';
|
||||
$sLoggedOut = '<form action="login.php" method="post" enctype="application/x-www-form-urlencoded" name="login" dir="ltr" style="display: inline;"><b>' . t('User') . ':</b> <input name="email" size="10" type="text" class="textboxes" value="" /> <b>' . t('Password') . ':</b> <input name="password" size="10" type="password" class="textboxes" value="" /> <input type="hidden" name="action" value="login" /><input type="hidden" name="target" value="{target}" /><input type="hidden" name="source" value="titlebar" /> <input type="submit" name="LogMeIn" value="' . t('Login') . '" class="formbutton" style="width: 65px;" /></form>';
|
||||
$sLoggedIn = "<b>" . t('Logged in as') . ' <a href="myhome.php">{username}</a></b> - <a href="login.php?action=logout">' . t('Logout') . '</a>';
|
||||
|
||||
// target in Loginbox setzen
|
||||
|
@ -12,6 +12,13 @@
|
||||
$tpl->name = 'login';
|
||||
$tpl->menuitem = MNU_LOGIN;
|
||||
|
||||
if (isset($_REQUEST['source']) && $opt['session']['login_statistics'])
|
||||
{
|
||||
sql("INSERT INTO `sys_login_stat` (`day`,`type`,`count`) VALUES (NOW(),'&1',1)
|
||||
ON DUPLICATE KEY UPDATE `count`=`count`+1",
|
||||
$_REQUEST['source']);
|
||||
}
|
||||
|
||||
$login->verify();
|
||||
|
||||
$tpl->assign('error', LOGIN_OK);
|
||||
|
@ -12,6 +12,7 @@
|
||||
<form action="login.php" method="post" enctype="application/x-www-form-urlencoded" style="display: inline;">
|
||||
<input type="hidden" name="target" value="{$target|escape}" />
|
||||
<input type="hidden" name="action" value="login" />
|
||||
<input type="hidden" name="source" value="loginpage" />
|
||||
{if $error!=LOGIN_OK}
|
||||
<div class="content-txtbox-noshade">
|
||||
<p style="line-height: 1.6em;">
|
||||
|
@ -112,7 +112,7 @@
|
||||
{nocache}
|
||||
|
||||
{if $login.userid==0}
|
||||
<b><form action="login.php" method="post" enctype="application/x-www-form-urlencoded" name="login" dir="ltr" style="display: inline;">{t}User{/t}: <input name="email" size="10" type="text" class="textboxes" value="" /> {t}Password{/t}: <input name="password" size="10" type="password" class="textboxes" value="" /> <input type="hidden" name="action" value="login" /><input type="hidden" name="target" value="{$opt.page.target|escape}" /> <input name="LogMeIn" value="{t}Login{/t}" class="formbuttons" style="width: 65px;" type="submit"></form></b>
|
||||
<b><form action="login.php" method="post" enctype="application/x-www-form-urlencoded" name="login" dir="ltr" style="display: inline;">{t}User{/t}: <input name="email" size="10" type="text" class="textboxes" value="" /> {t}Password{/t}: <input name="password" size="10" type="password" class="textboxes" value="" /> <input type="hidden" name="action" value="login" /><input type="hidden" name="target" value="{$opt.page.target|escape}" /><input type="hidden" name="source" value="titlebar" /> <input name="LogMeIn" value="{t}Login{/t}" class="formbuttons" style="width: 65px;" type="submit"></form></b>
|
||||
{else} {* Ocprop: <a href="myhome.php">(.*?)<\/a>.*?<a href="login.php
|
||||
<a href="myhome.php">.*?<a href="login.php\?action=logout"> *}
|
||||
<b>{t}Logged in as{/t} <a href="myhome.php">{$login.username|escape}</a></b> - <a href="login.php?action=logout">{t}Logout{/t}</a>
|
||||
|
Loading…
x
Reference in New Issue
Block a user