mirror of https://github.com/itflow-org/itflow
Only show extension options if tech/admin
This commit is contained in:
parent
edcdf9a0a8
commit
dcd772c5f6
|
|
@ -26,10 +26,10 @@ $sql_recent_logs = mysqli_query($mysqli,"SELECT * FROM logs
|
||||||
|
|
||||||
<center class="mb-3 p-4">
|
<center class="mb-3 p-4">
|
||||||
<?php if(empty($session_avatar)){ ?>
|
<?php if(empty($session_avatar)){ ?>
|
||||||
<i class="fas fa-user-circle fa-8x text-secondary"></i>
|
<i class="fas fa-user-circle fa-8x text-secondary"></i>
|
||||||
<?php }else{ ?>
|
<?php }else{ ?>
|
||||||
<img src="<?php echo "uploads/users/$session_user_id/$session_avatar"; ?>" class="img-fluid">
|
<img src="<?php echo "uploads/users/$session_user_id/$session_avatar"; ?>" class="img-fluid">
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<h4 class="text-secondary mt-2"><?php echo $session_user_role_display; ?></h4>
|
<h4 class="text-secondary mt-2"><?php echo $session_user_role_display; ?></h4>
|
||||||
</center>
|
</center>
|
||||||
|
|
||||||
|
|
@ -73,17 +73,21 @@ $sql_recent_logs = mysqli_query($mysqli,"SELECT * FROM logs
|
||||||
<input type="file" class="form-control-file" accept="image/*;capture=camera" name="file">
|
<input type="file" class="form-control-file" accept="image/*;capture=camera" name="file">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<?php if($session_user_role > 1){ ?>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input type="checkbox" class="form-check-input" name="extension" id="extension" value="Yes" <?php if(isset($_COOKIE['user_extension_key'])) {echo "checked";} ?>>
|
<input type="checkbox" class="form-check-input" name="extension" id="extension" value="Yes" <?php if(isset($_COOKIE['user_extension_key'])) {echo "checked";} ?>>
|
||||||
<label class="form-check-label" for="extension">Extension access enabled?</label>
|
<label class="form-check-label" for="extension">Extension access enabled?</label>
|
||||||
<p>Note: You must log out and back in again for these changes take effect.</p>
|
<p>Note: You must log out and back in again for these changes take effect.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<button type="submit" name="edit_profile" class="btn btn-primary mt-3"><i class="fa fa-fw fa-check"></i> Save</button>
|
<button type="submit" name="edit_profile" class="btn btn-primary mt-3"><i class="fa fa-fw fa-check"></i> Save</button>
|
||||||
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
@ -91,54 +95,54 @@ $sql_recent_logs = mysqli_query($mysqli,"SELECT * FROM logs
|
||||||
<h3>2-Factor Authentication</h3>
|
<h3>2-Factor Authentication</h3>
|
||||||
|
|
||||||
<form class="p-3" action="post.php" method="post" autocomplete="off">
|
<form class="p-3" action="post.php" method="post" autocomplete="off">
|
||||||
|
|
||||||
<?php if(empty($session_token)){ ?>
|
<?php if(empty($session_token)){ ?>
|
||||||
<p>You have not setup 2FA, click on enable to setup 2FA.</p>
|
<p>You have not setup 2FA, click on enable to setup 2FA.</p>
|
||||||
<button type="submit" name="enable_2fa" class="btn btn-primary mt-3"><i class="fa fa-fw fa-lock"></i> Enable 2FA</button>
|
<button type="submit" name="enable_2fa" class="btn btn-primary mt-3"><i class="fa fa-fw fa-lock"></i> Enable 2FA</button>
|
||||||
<?php }else{ ?>
|
<?php }else{ ?>
|
||||||
<p>You have setup 2FA. Your QR code is below.</p>
|
<p>You have setup 2FA. Your QR code is below.</p>
|
||||||
<button type="submit" name="disable_2fa" class="btn btn-danger mt-3"><i class="fa fa-fw fa-unlock"></i> Disable 2FA</button>
|
<button type="submit" name="disable_2fa" class="btn btn-danger mt-3"><i class="fa fa-fw fa-unlock"></i> Disable 2FA</button>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<center>
|
<center>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once('rfc6238.php');
|
|
||||||
|
|
||||||
//Generate a base32 Key
|
require_once('rfc6238.php');
|
||||||
$secretkey = key32gen();
|
|
||||||
|
|
||||||
if(!empty($session_token)){
|
|
||||||
|
|
||||||
//Generate QR Code based off the generated key
|
//Generate a base32 Key
|
||||||
print sprintf('<img src="%s"/>',TokenAuth6238::getBarCodeUrl($session_name,' ',$session_token,$_SERVER['SERVER_NAME']));
|
$secretkey = key32gen();
|
||||||
|
|
||||||
echo "<p class='text-secondary'>$session_token</p>";
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
</center>
|
|
||||||
|
|
||||||
<input type="hidden" name="token" value="<?php echo $secretkey; ?>">
|
|
||||||
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<?php if(!empty($session_token)){ ?>
|
if(!empty($session_token)){
|
||||||
<form class="p-3" action="post.php" method="post" autocomplete="off">
|
|
||||||
<div class="form-group">
|
//Generate QR Code based off the generated key
|
||||||
<div class="input-group">
|
print sprintf('<img src="%s"/>',TokenAuth6238::getBarCodeUrl($session_name,' ',$session_token,$_SERVER['SERVER_NAME']));
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
echo "<p class='text-secondary'>$session_token</p>";
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</center>
|
||||||
|
|
||||||
|
<input type="hidden" name="token" value="<?php echo $secretkey; ?>">
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<?php if(!empty($session_token)){ ?>
|
||||||
|
<form class="p-3" action="post.php" method="post" autocomplete="off">
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-key"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="code" placeholder="Verify 2FA Code" required>
|
||||||
|
<div class="input-group-append">
|
||||||
|
<button type="submit" name="verify" class="btn btn-primary">Verify</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" name="code" placeholder="Verify 2FA Code" required>
|
|
||||||
<div class="input-group-append">
|
</form>
|
||||||
<button type="submit" name="verify" class="btn btn-primary">Verify</button>
|
<?php } ?>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
<?php } ?>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -151,22 +155,22 @@ $sql_recent_logs = mysqli_query($mysqli,"SELECT * FROM logs
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
while($row = mysqli_fetch_array($sql_recent_logins)){
|
while($row = mysqli_fetch_array($sql_recent_logins)){
|
||||||
$log_id = $row['log_id'];
|
$log_id = $row['log_id'];
|
||||||
$log_ip = $row['log_ip'];
|
$log_ip = $row['log_ip'];
|
||||||
$log_user_agent = $row['log_user_agent'];
|
$log_user_agent = $row['log_user_agent'];
|
||||||
$log_created_at = $row['log_created_at'];
|
$log_created_at = $row['log_created_at'];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><i class="fa fa-fw fa-sign-in-alt text-secondary"></i> <?php echo "$log_ip - $log_user_agent"; ?></td>
|
<td><i class="fa fa-fw fa-sign-in-alt text-secondary"></i> <?php echo "$log_ip - $log_user_agent"; ?></td>
|
||||||
<td><i class="fa fa-fw fa-clock text-secondary"></i> <?php echo $log_created_at; ?></td>
|
<td><i class="fa fa-fw fa-clock text-secondary"></i> <?php echo $log_created_at; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
|
|
@ -183,34 +187,34 @@ $sql_recent_logs = mysqli_query($mysqli,"SELECT * FROM logs
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
while($row = mysqli_fetch_array($sql_recent_logs)){
|
|
||||||
$log_id = $row['log_id'];
|
|
||||||
$log_type = $row['log_type'];
|
|
||||||
$log_action = $row['log_action'];
|
|
||||||
$log_description = $row['log_description'];
|
|
||||||
$log_created_at = $row['log_created_at'];
|
|
||||||
|
|
||||||
if($log_action == 'Create'){
|
while($row = mysqli_fetch_array($sql_recent_logs)){
|
||||||
$log_icon = "plus text-success";
|
$log_id = $row['log_id'];
|
||||||
}elseif($log_action == 'Modify'){
|
$log_type = $row['log_type'];
|
||||||
$log_icon = "edit text-info";
|
$log_action = $row['log_action'];
|
||||||
}elseif($log_action == 'Delete'){
|
$log_description = $row['log_description'];
|
||||||
$log_icon = "trash-alt text-danger";
|
$log_created_at = $row['log_created_at'];
|
||||||
}else{
|
|
||||||
$log_icon = "pencil";
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
if($log_action == 'Create'){
|
||||||
|
$log_icon = "plus text-success";
|
||||||
<tr>
|
}elseif($log_action == 'Modify'){
|
||||||
<td><i class="fa fa-fw text-secondary fa-<?php echo $log_icon; ?>"></i> <?php echo $log_type; ?></td>
|
$log_icon = "edit text-info";
|
||||||
<td><?php echo $log_description; ?></td>
|
}elseif($log_action == 'Delete'){
|
||||||
<td><i class="fa fa-fw fa-clock text-secondary"></i> <?php echo $log_created_at; ?></td>
|
$log_icon = "trash-alt text-danger";
|
||||||
</tr>
|
}else{
|
||||||
<?php
|
$log_icon = "pencil";
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><i class="fa fa-fw text-secondary fa-<?php echo $log_icon; ?>"></i> <?php echo $log_type; ?></td>
|
||||||
|
<td><?php echo $log_description; ?></td>
|
||||||
|
<td><i class="fa fa-fw fa-clock text-secondary"></i> <?php echo $log_created_at; ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue