mirror of
https://github.com/ulfgebhardt/system.git
synced 2025-12-13 09:35:49 +00:00
fixed saimod_sys_security, renamed saimod_sys_error -> saimod_sys_log fixed all Menu entries saimod right_right should return true when public!
40 lines
1.9 KiB
PHP
40 lines
1.9 KiB
PHP
<?php
|
|
namespace SYSTEM\SAI;
|
|
|
|
class saimod_sys_security extends \SYSTEM\SAI\SaiModule {
|
|
public static function html_content(){
|
|
$con = new \SYSTEM\DB\Connection(\SYSTEM\system::getSystemDBInfo());
|
|
$res = $con->query('SELECT id,username,email,joindate,locale,last_active,account_flag FROM system.user ORDER BY last_active DESC;');
|
|
|
|
|
|
$now = microtime(true);
|
|
|
|
$result = '<table class="table table-hover table-condensed" style="overflow: auto;">'.
|
|
'<tr>'.'<th>'.'ID'.'</th>'.'<th>'.'Username'.'</th>'.'<th>'.'EMail'.'</th>'.'<th>'.'JoinDate'.'</th>'.'<th>'.'Locale'.'</th>'.'<th>'.'Last Active'.'</th>'.'<th>'.'Flag'.'</th>'.'<th>'.'Rights'.'</th>'.'</tr>';
|
|
while($r = $res->next()){
|
|
$result .= '<tr class="'.self::tablerow_class($r['last_active']).'">'.'<td>'.$r['id'].'</td>'.'<td>'.$r['username'].'</td>'.'<td>'.$r['email'].'</td>'.'<td>'.$r['joindate'].'</td>'.'<td>'.$r['locale'].'</td>'.'<td>'.$r['last_active'].'</td>'.'<td>'.$r['account_flag'].'</td>'.'<td>'.'BUTTON'.'</td>'.'</tr>';
|
|
}
|
|
$result .= '</table>';
|
|
return $result;
|
|
}
|
|
|
|
private static function tablerow_class($last_active){
|
|
$time = time() - strtotime($last_active);
|
|
|
|
if($time <= 60*60){
|
|
return 'success';}
|
|
if($time <= 60*60*24){
|
|
return 'info';}
|
|
if($time <= 60*60*24*7){
|
|
return 'warning';}
|
|
|
|
return 'error';
|
|
}
|
|
|
|
public static function html_li_menu(){return '<li><a href="#" id=".SYSTEM.SAI.saimod_sys_security">Security</a></li>';}
|
|
public static function right_public(){return false;}
|
|
public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\system::getSystemDBInfo(), \SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
|
|
|
|
public static function src_css(){}
|
|
public static function src_js(){}
|
|
} |