Browse Source

Merge branch 'feature/user-auth-log' into feature/user-roles

Kristan Kenney 5 years ago
parent
commit
63192fa146

+ 44 - 34
bin/v-list-user-auth-log

@@ -23,19 +23,23 @@ json_list() {
     objects=$(echo "$logs" |wc -l)
     echo "{"
     for str in $logs; do
-        IP=$(echo "$str" |cut -f 2 -d \')
-        FINGERPRINT=$(echo "$str" |cut -f 4 -d \')
-        STATUS=$(echo "$str" |cut -f 6 -d \')
-        DATE=$(echo "$str" |cut -f 8 -d \')
-        TIME=$(echo "$str" |cut -f 10 -d \')
-        ACTIVE=$(echo "$str" |cut -f 12 -d \')
+        DATE=$(echo "$str" |cut -f 2 -d \')
+        TIME=$(echo "$str" |cut -f 4 -d \')
+        IP=$(echo "$str" |cut -f 6 -d \')
+        ACTION=$(echo "$str" |cut -f 8 -d \')
+        STATUS=$(echo "$str" |cut -f 10 -d \')
+        USER_AGENT=$(echo "$str" |cut -f 12 -d \')
+        SESSION=$(echo "$str" |cut -f 14 -d \')
+        ACTIVE=$(echo "$str" |cut -f 16 -d \')
         echo -n '    "'$i'": {
-            "IP": "'$IP'",
-            "FINGERPRINT": "'$FINGERPRINT'",
-            "TIME": "'$TIME'",
             "DATE": "'$DATE'",
-            "ACTIVE": "'$ACTIVE'",
-            "STATUS": "'$STATUS'"
+            "TIME": "'$TIME'",
+            "IP": "'$IP'",
+            "ACTION": "'$ACTION'",
+            "STATUS": "'$STATUS'",
+            "USER_AGENT": "'$USER_AGENT'",
+            "SESSION": "'$SESSION'",
+            "ACTIVE": "'$ACTIVE'"
         }'
         if [ "$i" -lt "$objects" ]; then
             echo ','
@@ -49,16 +53,18 @@ json_list() {
 
 shell_list() {
     IFS=$'\n'
-    echo "DATE~TIME~IP~FINGERPRINT~ACTIVE~STATUS"
+    echo "DATE~TIME~IP~SESSION~ACTIVE~STATUS"
     echo "----~----~--~-----------~------"
     for str in $logs; do
-        IP=$(echo "$str" |cut -f 2 -d \')
-        FINGERPRINT=$(echo "$str" |cut -f 4 -d \')
-        STATUS=$(echo "$str" |cut -f 6 -d \')
-        DATE=$(echo "$str" |cut -f 8 -d \')
-        TIME=$(echo "$str" |cut -f 10 -d \')
-        ACTIVE=$(echo "$str" |cut -f 12 -d \')
-        echo "$DATE~$TIME~$IP~$FINGERPRINT~$ACTIVE~$STATUS"
+        DATE=$(echo "$str" |cut -f 2 -d \')
+        TIME=$(echo "$str" |cut -f 4 -d \')
+        IP=$(echo "$str" |cut -f 6 -d \')
+        ACTION=$(echo "$str" |cut -f 8 -d \')
+        STATUS=$(echo "$str" |cut -f 10 -d \')
+        USER_AGENT=$(echo "$str" |cut -f 12 -d \')
+        SESSION=$(echo "$str" |cut -f 14 -d \')
+        ACTIVE=$(echo "$str" |cut -f 16 -d \')
+        echo "$DATE~$TIME~$IP~$ACTION~$STATUS~$USER_AGENT~$SESSION~$ACTIVE"
     done
 }
 
@@ -66,28 +72,32 @@ shell_list() {
 plain_list() {
     IFS=$'\n'
     for str in $logs; do
-        IP=$(echo "$str" |cut -f 2 -d \')
-        FINGERPRINT=$(echo "$str" |cut -f 4 -d \')
-        STATUS=$(echo "$str" |cut -f 6 -d \')
-        DATE=$(echo "$str" |cut -f 8 -d \')
-        TIME=$(echo "$str" |cut -f 10 -d \')
-        ACTIVE=$(echo "$str" |cut -f 12 -d \')
-        echo -e "$DATE\t$TIME\t$IP\t$FINGERPRINT\t$ACTIVE\t$STATUS"
+        DATE=$(echo "$str" |cut -f 2 -d \')
+        TIME=$(echo "$str" |cut -f 4 -d \')
+        IP=$(echo "$str" |cut -f 6 -d \')
+        ACTION=$(echo "$str" |cut -f 8 -d \')
+        STATUS=$(echo "$str" |cut -f 10 -d \')
+        USER_AGENT=$(echo "$str" |cut -f 12 -d \')
+        SESSION=$(echo "$str" |cut -f 14 -d \')
+        ACTIVE=$(echo "$str" |cut -f 16 -d \')
+        echo -e "$DATE\t$TIME\t$IP\t$ACTION\t$STATUS\t$USER_AGENT\t$SESSION\t$ACTIVE"
     done
 }
 
 # CSV list function
 csv_list() {
     IFS=$'\n'
-    echo "DATE,TIME,IP,FINGERPRINT,ACTIVE,STATUS"
+    echo "DATE,TIME,IP,ACTION,STATUS,USER_AGENT,SESSION,ACTIVE"
     for str in $logs; do
-        IP=$(echo "$str" |cut -f 2 -d \')
-        FINGERPRINT=$(echo "$str" |cut -f 4 -d \')
-        STATUS=$(echo "$str" |cut -f 6 -d \')
-        DATE=$(echo "$str" |cut -f 8 -d \')
-        TIME=$(echo "$str" |cut -f 10 -d \')
-        ACTIVE=$(echo "$str" |cut -f 12 -d \')
-        echo "$DATE,$TIME,$IP,$FINGERPRINT,$ACTIVE,$STATUS"
+        DATE=$(echo "$str" |cut -f 2 -d \')
+        TIME=$(echo "$str" |cut -f 4 -d \')
+        IP=$(echo "$str" |cut -f 6 -d \')
+        ACTION=$(echo "$str" |cut -f 8 -d \')
+        STATUS=$(echo "$str" |cut -f 10 -d \')
+        USER_AGENT=$(echo "$str" |cut -f 12 -d \')
+        SESSION=$(echo "$str" |cut -f 14 -d \')
+        ACTIVE=$(echo "$str" |cut -f 16 -d \')
+        echo "$DATE,$TIME,$IP,$ACTION,$STATUS,$USER_AGENT,$SESSION,$ACTIVE"
 
     done
 }

+ 6 - 7
bin/v-log-user-login

@@ -6,10 +6,11 @@
 user=$1
 ip=$2
 status=$3
-fingerprint=${4}
+session_id=$4
+user_agent=$5
 
 active="yes"
-if [ $status = "failed" ]; then
+if [ "$status" = "failed" ]; then
     active="no"
 fi
 
@@ -21,7 +22,7 @@ source $HESTIA/conf/hestia.conf
 #                    Verifications                         #
 #----------------------------------------------------------#
 
-check_args '2' "$#" 'USER IP [FINGERPRINT]'
+check_args '2' "$#" 'USER IP SESSION_ID USER_AGENT'
 is_format_valid 'user' 'ip'
 is_object_valid 'user' 'USER' "$user"
 
@@ -31,16 +32,14 @@ time=$(echo "$time_n_date" |cut -f 1 -d \ )
 date=$(echo "$time_n_date" |cut -f 2 -d \ )
 
 if [ ! -f $USER_DATA/auth.log ]; then
-    touch  $USER_DATA/auth.log
+    touch $USER_DATA/auth.log
 fi
 
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
 
-awk -i inplace -v finger="FINGERPRINT='$fingerprint'" -v active="ACTIVE='no'" '$2 == TIME {$5=ACTIVE}1' $USER_DATA/auth.log   
-
-echo "IP='$ip' FINGERPRINT='$fingerprint' STATUS='$status' DATE='$date' TIME='$time' ACTIVE='$active'" >> $USER_DATA/auth.log
+echo "DATE='$date' TIME='$time' IP='$ip' ACTION='login' STATUS='$status' USER_AGENT='$user_agent' SESSION='$session_id' ACTIVE='$active'" >> $USER_DATA/auth.log
 
 #----------------------------------------------------------#
 #                       Hestia                             #

+ 4 - 4
bin/v-log-user-logout

@@ -4,7 +4,7 @@
 
 # Argument definition
 user=$1
-fingerprint=$2
+session_id=$2
 
 # Includes
 source $HESTIA/func/main.sh
@@ -14,19 +14,19 @@ source $HESTIA/conf/hestia.conf
 #                    Verifications                         #
 #----------------------------------------------------------#
 
-check_args '2' "$#" 'USER FINGERPRINT'
+check_args '2' "$#" 'USER SESSION_ID'
 is_format_valid 'user'
 is_object_valid 'user' 'USER' "$user"
 
 if [ ! -f $USER_DATA/auth.log ]; then
-    touch  $USER_DATA/auth.log
+    touch $USER_DATA/auth.log
 fi
 
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
 
-awk -i inplace -v finger="FINGERPRINT='$fingerprint'" -v active="ACTIVE='no'" '$2 == TIME  {$5=active}1' $USER_DATA/auth.log 
+sed -i "s/SESSION='$session_id' ACTIVE='yes'/SESSION='$session_id' ACTIVE='no'/g" $USER_DATA/auth.log
 
 #----------------------------------------------------------#
 #                       Hestia                             #

+ 11 - 11
web/delete/log/auth/index.php

@@ -13,8 +13,8 @@ if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
 // Clear log
 $v_username = escapeshellarg($user);
 exec (HESTIA_CMD."v-delete-user-auth-log ".$v_username, $output, $return_var);
-//check_return_code($return_var,$output);
-//unset($output);
+check_return_code($return_var,$output);
+unset($output);
 
 
 $ip = $_SERVER['REMOTE_ADDR'];
@@ -24,21 +24,21 @@ if(isset($_SERVER['HTTP_CF_CONNECTING_IP'])){
     }
 } 
 $v_ip = escapeshellarg($ip);
+$user_agent = $_SERVER['HTTP_USER_AGENT'];
+$v_user_agent = escapeshellarg($user_agent);
     
-$v_murmur = escapeshellarg($_SESSION['MURMUR']);
-exec(HESTIA_CMD."v-log-user-login ".$v_username." ".$v_ip." success ".$v_murmur, $output, $return_var);
+$v_session_id = escapeshellarg($_SESSION['token']);
 
-// Render page
-//render_page($user, $TAB, 'list_auth');
+// Add current user session back to log unless impersonating another user
+if (!isset($_SESSION['look'])) {
+    exec(HESTIA_CMD."v-log-user-login ".$v_username." ".$v_ip." success ".$v_session_id." ".$v_user_agent, $output, $return_var);
+}
 
 // Flush session messages
 unset($_SESSION['error_msg']);
 unset($_SESSION['ok_msg']);
 
-if (($_SESSION['userContext'] === 'admin') && (isset($_SESSION['look']))) {
-    header("Location: /list/log/auth/?user=".$_SESSION['look']);
-} else {
-    header("Location: /list/log/auth/?user=".$_SESSION['user']);
-}
+// Return to authentication history
+header("Location: /list/log/auth/");
 
 exit;

+ 4 - 4
web/inc/main.php

@@ -39,8 +39,8 @@ if (!isset($_SESSION['user_combined_ip'])){
 // Checking user to use session from the same IP he has been logged in
 if ($_SESSION['user_combined_ip'] != $user_combined_ip && $_SERVER['REMOTE_ADDR'] != '127.0.0.1'){
     $v_user = escapeshellarg($_SESSION['user']);
-    $v_murmur = escapeshellarg($_SESSION['MURMUR']);
-    exec(HESTIA_CMD."v-log-user-logout ".$v_user." ".$v_murmur, $output, $return_var);
+    $v_session_id = escapeshellarg($_SESSION['token']);
+    exec(HESTIA_CMD."v-log-user-logout ".$v_user." ".$v_session_id, $output, $return_var);
     session_destroy();
     session_start();
     $_SESSION['request_uri'] = $_SERVER['REQUEST_URI'];
@@ -80,8 +80,8 @@ if (!defined('NO_AUTH_REQUIRED')){
         header("Location: /login/");
     } else if ($_SESSION['INACTIVE_SESSION_TIMEOUT'] * 60 + $_SESSION['LAST_ACTIVITY'] < time()) {
         $v_user = escapeshellarg($_SESSION['user']);
-        $v_murmur = escapeshellarg($_SESSION['MURMUR']);
-        exec(HESTIA_CMD."v-log-user-logout ".$v_user." ".$v_murmur, $output, $return_var);
+        $v_session_id = escapeshellarg($_SESSION['token']);
+        exec(HESTIA_CMD."v-log-user-logout ".$v_user." ".$v_session_id, $output, $return_var);
         session_destroy();
         header("Location: /login/");
     } else {

+ 9 - 6
web/login/index.php

@@ -92,12 +92,15 @@ function authenticate_user($user, $password, $twofa = ''){
     if(isset($_SESSION['token']) && isset($_POST['token']) && $_POST['token'] == $_SESSION['token']) {
     $v_user = escapeshellarg($user);
     $ip = $_SERVER['REMOTE_ADDR'];
+    $user_agent = $_SERVER['HTTP_USER_AGENT'];
     if(isset($_SERVER['HTTP_CF_CONNECTING_IP'])){
         if(!empty($_SERVER['HTTP_CF_CONNECTING_IP'])){
             $ip = $_SERVER['HTTP_CF_CONNECTING_IP'];
         }
     }
     $v_ip = escapeshellarg($ip);
+    $v_user_agent = escapeshellarg($user_agent);
+
      // Get user's salt
     $output = '';
     exec (HESTIA_CMD."v-get-user-salt ".$v_user." ".$v_ip." json" , $output, $return_var);
@@ -137,8 +140,8 @@ function authenticate_user($user, $password, $twofa = ''){
             if ( $return_var > 0 ) {
                 sleep(2);
                 $error = "<a class=\"error\">"._('Invalid username or password')."</a>";
-                $v_murmur = escapeshellarg($_POST['murmur']);
-                exec(HESTIA_CMD."v-log-user-login ".$v_user." ".$v_ip." failed ".$v_murmur, $output, $return_var);
+                $v_session_id = escapeshellarg($_POST['token']);
+                exec(HESTIA_CMD."v-log-user-login ".$v_user." ".$v_ip." failed ".$v_session_id." ".$v_user_agent, $output, $return_var);
 
                 return $error;
             } else {
@@ -161,8 +164,8 @@ function authenticate_user($user, $password, $twofa = ''){
                                 $error = "<a class=\"error\">"._('Invalid or missing 2FA token')."</a>";
                                 $_SESSION['login']['username'] = $user;
                                 $_SESSION['login']['password'] = $password;
-                                $v_murmur = escapeshellarg($_POST['murmur']);
-                                exec(HESTIA_CMD."v-log-user-login ".$v_user." ".$v_ip." failed ".$v_murmur, $output, $return_var);
+                                $v_session_id = escapeshellarg($_POST['token']);
+                                exec(HESTIA_CMD."v-log-user-login ".$v_user." ".$v_ip." failed ".$v_session_id." ".$v_user_agent, $output, $return_var);
                                 return $error;
                                 unset($_POST['twofa']);
                             }
@@ -175,8 +178,8 @@ function authenticate_user($user, $password, $twofa = ''){
                 $_SESSION['user'] = key($data);
                 $v_user = $_SESSION['user'];
                 //log successfull login attempt
-                $v_murmur = escapeshellarg($_POST['murmur']);
-                exec(HESTIA_CMD."v-log-user-login ".$v_user." ".$v_ip." success ".$v_murmur, $output, $return_var);
+                $v_session_id = escapeshellarg($_POST['token']);
+                exec(HESTIA_CMD."v-log-user-login ".$v_user." ".$v_ip." success ".$v_session_id." ".$v_user_agent, $output, $return_var);
 
                 $_SESSION['LAST_ACTIVITY'] = time();
                 $_SESSION['MURMUR'] = $_POST['murmur'];

+ 3 - 3
web/logout/index.php

@@ -12,10 +12,10 @@ if (!empty($_SESSION['look'])) {
     unset($_SESSION['_sf2_meta']);
     header("Location: /");
 } else {
-    if($_SESSION['MURMUR'] && $_SESSION['user']){
+    if($_SESSION['token'] && $_SESSION['user']){
         $v_user = escapeshellarg($_SESSION['user']);
-        $v_murmur = escapeshellarg($_SESSION['MURMUR']);
-        exec(HESTIA_CMD."v-log-user-logout ".$v_user." ".$v_murmur, $output, $return_var);
+        $v_session_id = escapeshellarg($_SESSION['token']);
+        exec(HESTIA_CMD."v-log-user-logout ".$v_user." ".$v_session_id, $output, $return_var);
     }
     
     session_destroy();

+ 33 - 12
web/templates/admin/list_log_auth.html

@@ -5,6 +5,15 @@
     </div>
     <div class="l-unit-toolbar__buttonstrip float-right">
       <a href="javascript:location.reload();" class="ui-button cancel" dir="ltr"><i class="fas fa-redo status-icon green"></i><?=_('Refresh')?></a>
+      <div class="actions-panel display-inline-block" key-action="js">
+        <a class="data-controls do_delete ui-button danger cancel">
+          <i class="do_delete fas fa-times-circle status-icon red"></i><?=_('Delete')?>
+          <input type="hidden" name="delete_url" value="/delete/log/auth/?token=<?=$_SESSION['token']?>" />
+            <div class="confirmation-text-delete hidden" title="<?=_('Confirmation')?>">
+              <p class="confirmation"><?=_('DELETE_LOGS_CONFIRMATION')?></p>
+            </div>
+        </a>
+      </div>
     </div>
   </div>
 </div>
@@ -14,13 +23,16 @@
 <div class="l-center units">
 <div class="header table-header">     
     <div class="l-unit__col l-unit__col--right">
-      <div class="clearfix l-unit__stat-col--left super-compact">
-        &nbsp;
-      </div>       
-      <div class="clearfix l-unit__stat-col--left small"><b><?php print _('Date');?></b></div>
-      <div class="clearfix l-unit__stat-col--left"><b><?php print _('Time');?></b></div>
+      <div class="clearfix l-unit__stat-col--left super-compact text-center">
+        <b><?php print _('Active');?></b>
+      </div>
+      <div class="clearfix l-unit__stat-col--left compact text-center">
+        <b><?php print _('Status');?></b>
+      </div>
+      <div class="clearfix l-unit__stat-col--left"><b><?php print _('Date');?></b></div>
+      <div class="clearfix l-unit__stat-col--left compact"><b><?php print _('Time');?></b></div>
       <div class="clearfix l-unit__stat-col--left"><b><?php print _('IP address');?></b></div>
-      <div class="clearfix l-unit__stat-col--left"><b><?php print _('Active');?></b></div>
+      <div class="clearfix l-unit__stat-col--left wide-6"><b><?php print _('Browser');?></b></div>
     </div>
   </div> 
 <?php
@@ -29,17 +41,26 @@
   ?>
   <div class="l-unit header animated fadeIn">
     <div class="l-unit__col l-unit__col--right">
-      <div class="clearfix l-unit__stat-col--left super-compact">
+      <div class="clearfix l-unit__stat-col--left super-compact text-center">
+        <? if ($data[$key]['ACTION'] == 'login') { ?>
+          <? if ($data[$key]['ACTIVE'] === 'yes') {?>
+            <i class="fas fa-sign-in-alt status-icon maroon icon-pad-right" title="<?=_('Login')?>"></i>
+          <? } else {?>
+            <i class="fas fa-sign-in-alt status-icon dim icon-pad-right" title="<?=_('Login')?>"></i>
+          <? } ?>
+        <? } ?>
+      </div>
+      <div class="clearfix l-unit__stat-col--left compact text-center">
         <? if ($data[$key]['STATUS'] == 'success') { ?>
-          <i class="fas fa-check-circle status-icon green icon-pad-right"></i>
+          <i class="fas fa-check-circle status-icon green icon-pad-right" title="<?=_('Success')?>"></i>
         <? } else {?>
-          <i class="fas fa-minus-circle status-icon red icon-pad-right"></i>
+          <i class="fas fa-minus-circle status-icon red icon-pad-right" title="<?=_('Failed')?>"></i>
         <? } ?>
       </div>
-      <div class="clearfix l-unit__stat-col--left small"><b><?=translate_date($data[$key]['DATE'])?></b></div>
-      <div class="clearfix l-unit__stat-col--left"><b><?=$data[$key]['TIME']?></b></div>
+      <div class="clearfix l-unit__stat-col--left"><b><?=translate_date($data[$key]['DATE'])?></b></div>
+      <div class="clearfix l-unit__stat-col--left compact"><b><?=$data[$key]['TIME']?></b></div>
       <div class="clearfix l-unit__stat-col--left"><?=$data[$key]['IP']?></div>
-      <div class="clearfix l-unit__stat-col--left"><?=$data[$key]['ACTIVE']?></div>
+      <div class="clearfix l-unit__stat-col--left wide-7"><?=$data[$key]['USER_AGENT']?></b></div>
     </div>
   </div>
 <?}?>

+ 1 - 1
web/templates/login_1.html

@@ -11,7 +11,7 @@
                                     <form method="post" action="/login/" id="form_login">
                                     <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">
                                     <input type="hidden" name="user" value="<?php echo $_POST['user']; ?>">
-                                    <input type="hidden" name="murmur" value="<?php echo $_POST['murmur']; ?>" id="murmur">    
+                                    <input type="hidden" name="murmur" value="<?php echo $_SESSION['token']; ?>" id="murmur">    
                                     <table class="login-box">
                                         <tr>
                                             <td style="padding: 12px 0 0 2px;" class="login-welcome">

+ 36 - 13
web/templates/user/list_log_auth.html

@@ -4,43 +4,66 @@
       <a href="/list/log/" id="btn-back" class="ui-button cancel" dir="ltr"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
     </div>
     <div class="l-unit-toolbar__buttonstrip float-right">
-      <a href="javascript:location.reload();" class="ui-button cancel" dir="ltr"><i class="fas fa-redo status-icon green"></i> <?=_('Refresh')?></a>
+      <a href="javascript:location.reload();" class="ui-button cancel" dir="ltr"><i class="fas fa-redo status-icon green"></i><?=_('Refresh')?></a>
     </div>
   </div>
 </div>
+
 <div class="l-separator"></div>
 
-<div class="l-center units animated fadeIn">
+<div class="l-center units">
 <div class="header table-header">     
     <div class="l-unit__col l-unit__col--right">
       <div class="clearfix l-unit__stat-col--left super-compact">
         &nbsp;
-      </div>       
+      </div>
+      <div class="clearfix l-unit__stat-col--left super-compact">
+        &nbsp;
+      </div>
+      <div class="clearfix l-unit__stat-col--left super-compact">
+        &nbsp;
+      </div>
       <div class="clearfix l-unit__stat-col--left small"><b><?php print _('Date');?></b></div>
       <div class="clearfix l-unit__stat-col--left"><b><?php print _('Time');?></b></div>
       <div class="clearfix l-unit__stat-col--left"><b><?php print _('IP address');?></b></div>
-      <div class="clearfix l-unit__stat-col--left"><b><?php print _('Status');?></b></div>
-      <div class="clearfix l-unit__stat-col--left"><b><?php print _('Active');?></b></div>
-      <div class="clearfix l-unit__stat-col--left wide-4"><b><?php print _('Browser Fingerprint');?></b></div>
+      <div class="clearfix l-unit__stat-col--left wide-6"><b><?php print _('Browser');?></b></div>
     </div>
   </div> 
 <?php
   foreach ($data as $key => $value) {
     ++$i;
   ?>
-  <div class="l-unit header">
+  <div class="l-unit header animated fadeIn">
     <div class="l-unit__col l-unit__col--right">
       <div class="clearfix l-unit__stat-col--left super-compact">
-        <i class="fas fa-info-circle status-icon dim"></i>
+        <? if ($data[$key]['ACTION'] == 'login') { ?>
+          <i class="fas fa-sign-in-alt status-icon dim icon-pad-right" title="<?=_('Login')?>"></i>
+        <? } ?>
+      </div>
+      <div class="clearfix l-unit__stat-col--left super-compact">
+        <? if ($data[$key]['STATUS'] == 'success') { ?>
+          <i class="fas fa-check-circle status-icon green icon-pad-right" title="<?=_('Success')?>"></i>
+        <? } else {?>
+          <i class="fas fa-minus-circle status-icon red icon-pad-right" title="<?=_('Failed')?>"></i>
+        <? } ?>
+      </div>
+      <div class="clearfix l-unit__stat-col--left super-compact">
+        <? if ($data[$key]['STATUS'] === 'failed') {?>
+          <!-- Do not display session status as login was never active-->
+          &nbsp;
+          <? } else {?>
+            <? if ($data[$key]['ACTIVE'] === 'yes') {?>
+              <i class="fas fa-user-circle status-icon dim icon-pad-right" title="<?=_('Active Session')?>"></i>
+            <? } else {?>
+              <!-- Do not display indicator for non-active sessions -- note: whitespace char required to pad cell at this time -->
+              &nbsp;
+            <? } ?>
+          <? } ?>
       </div>
       <div class="clearfix l-unit__stat-col--left small"><b><?=translate_date($data[$key]['DATE'])?></b></div>
       <div class="clearfix l-unit__stat-col--left"><b><?=$data[$key]['TIME']?></b></div>
       <div class="clearfix l-unit__stat-col--left"><?=$data[$key]['IP']?></div>
-      <div class="clearfix l-unit__stat-col--left"><?=$data[$key]['STATUS']?></div>
-      <div class="clearfix l-unit__stat-col--left"><?=$data[$key]['ACTIVE']?></div>
-      <div class="clearfix l-unit__stat-col--left"><?=$data[$key]['FINGERPRINT']?></div>
-      
-      
+      <div class="clearfix l-unit__stat-col--left wide-6"><?=$data[$key]['USER_AGENT']?></b></div>
     </div>
   </div>
 <?}?>