This repository has been archived by the owner on Oct 22, 2020. It is now read-only.
/
act_edit_security.php
executable file
·85 lines (75 loc) · 3.78 KB
/
act_edit_security.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
global $conf;
$username = $user->getUserName();
?>
<h2><?php echo _t('EDIT_USER') . " : <span class='red'> $username </span>" ?></h2>
<br />
<?php $fields = shn_form_get_html_fields($change_password_form); ?>
<div>
<ul class="nav nav-tabs tabnav">
<li><a href="<?php get_url('admin', 'edit_user', null, array('uid' => $username)); ?> " ><?php echo _t('EDIT_PROFILE') ?></a>
</li>
<li><a href="<?php get_url('admin', 'edit_password', null, array('uid' => $username)); ?> " ><?php echo _t('CHANGE_PASSWORD') ?></a>
</li>
<li class="active"><a href="<?php get_url('admin', 'edit_security', null, array('uid' => $username)); ?> " ><?php echo _t('Security') ?></a>
</li>
</ul></div>
<div class='panel'>
<div class="form-container">
<h2><?php echo _t('Google Authenticator') ?></h2>
<form class="form-horizontal" action='<?php echo get_url('admin', 'edit_security', null, array('uid' => $username)) ?>' method='post'>
<?php if ($enabled) {
if($changed){
?>
<div class="alert alert-success">
<div><b><?php echo _t('Enabled successfully.') ?></b></div>
</div>
<?php
}
?>
<button type="submit" class="btn" name="disable" ><i class="icon-remove-circle"></i> <?php echo _t('Disable') ?></button>
<?php
} else {
?>
<div class="control-group">
<p class="fwB"> Install the Google Authenticator app for your phone</p>
<ol class="ol p10">
<li> On your phone, open a web browser. </li>
<li> Go to <span class="fwB">m.google.com/authenticator</span>. </li>
<li> Download and install the Google Authenticator application. </li>
</ol>
<p class="fwB"> Now open and configure Google Authenticator. </p>
<br /><p>Scan following Barcode to register the application automaticly:<p>
<div class="taC p10">
<img src="<?php echo $url ?>" width="100" height="100" />
</div>
<p> Or use the following secret key to register the application manually:</p>
<div class="alert alert-info">
<div><b><?php echo $secret ?></b></div>
</div><br />
<p> Once you manually entered and saved your key, enter the 6-digit verification code generated<br /> by the Authenticator app. </p>
</div>
<div class='control-group <?php if ($wrongcode) {
echo ' error';
} ?>'>
<label class="control-label" for="code"><?php echo _t('Code') ?></label>
<div class="controls">
<input type="text" name="code" value="" class='input-large <?php if ($wrongcode) {
echo ' error';
} ?>' />
<div class="help-inline">
<span class="label label-important"><?php echo _t('IS_REQUIRED') ?></span>
<?php if ($wrongcode) { ?> <span class="help-inline">The code is incorrect. Try again</span><?php } ?>
</div>
</div>
</div>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary" name="save" ><i class="icon-ok icon-white"></i> <?php echo _t('SAVE') ?></button>
</div></div>
<?php
}
?>
</form>
</div>
</div>