2013-02-04 17:55:35 +01:00
|
|
|
<div class="users form">
|
2013-05-13 14:27:40 +02:00
|
|
|
<?php echo $this->Form->create('User', array('novalidate'=>true));?>
|
2013-02-04 17:55:35 +01:00
|
|
|
<fieldset>
|
|
|
|
<legend><?php echo __('Admin Edit User'); ?></legend>
|
|
|
|
<?php
|
|
|
|
echo $this->Form->input('email');
|
2016-03-15 23:04:20 +01:00
|
|
|
?>
|
|
|
|
<div class="clear"></div>
|
|
|
|
<?php
|
|
|
|
$password = true;
|
|
|
|
if (Configure::read('Plugin.CustomAuth_enable')):
|
|
|
|
if (Configure::read('Plugin.CustomAuth_required')):
|
|
|
|
$password = false;
|
|
|
|
else:
|
|
|
|
$userType = Configure::read('Plugin.CustomAuth_name') ? Configure::read('Plugin.CustomAuth_name') : 'External authentication';
|
|
|
|
echo $this->Form->input('external_auth_required', array('type' => 'checkbox', 'label' => $userType . ' user'));
|
|
|
|
endif;
|
|
|
|
|
|
|
|
?>
|
|
|
|
<div class="clear"></div>
|
|
|
|
<div id="externalAuthDiv">
|
|
|
|
<?php
|
|
|
|
echo $this->Form->input('external_auth_key', array('type' => 'text'));
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
endif;
|
|
|
|
?>
|
|
|
|
<div class="clear"></div>
|
|
|
|
<div id="passwordDivDiv">
|
|
|
|
<?php
|
|
|
|
echo $this->Form->input('enable_password', array('type' => 'checkbox', 'label' => 'Set password'));
|
|
|
|
?>
|
|
|
|
<div id="PasswordDiv">
|
|
|
|
<div class="clear"></div>
|
|
|
|
<?php
|
|
|
|
echo $this->Form->input('password');
|
|
|
|
echo $this->Form->input('confirm_password', array('type' => 'password', 'div' => array('class' => 'input password required')));
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="clear"></div>
|
|
|
|
<?php
|
2013-10-03 11:45:27 +02:00
|
|
|
if ($isSiteAdmin) {
|
2015-04-14 17:51:38 +02:00
|
|
|
echo $this->Form->input('org_id', array(
|
2015-04-08 13:10:52 +02:00
|
|
|
'options' => $orgs,
|
|
|
|
'label' => 'Organisation',
|
|
|
|
));
|
2013-03-06 11:34:22 +01:00
|
|
|
}
|
2016-03-15 23:04:20 +01:00
|
|
|
echo $this->Form->input('role_id', array('label' => 'Role')); // TODO ACL, User edit role_id.
|
|
|
|
echo $this->Form->input('authkey', array('disabled' => 'disabled', 'label' => 'Authentication key', 'div' => 'input clear'));
|
2013-02-04 17:55:35 +01:00
|
|
|
echo $this->Form->input('nids_sid');
|
2015-08-03 14:12:20 +02:00
|
|
|
?>
|
|
|
|
<div id = "syncServers" class="hidden">
|
|
|
|
<?php
|
|
|
|
echo $this->Form->input('server_id', array('label' => 'Sync user for', 'div' => 'clear', 'options' => $servers));
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<?php
|
2013-05-31 15:42:53 +02:00
|
|
|
echo $this->Form->input('gpgkey', array('label' => 'GPG key', 'div' => 'clear', 'class' => 'input-xxlarge'));
|
2015-08-03 14:12:20 +02:00
|
|
|
?>
|
2015-05-13 17:01:56 +02:00
|
|
|
<div class="clear"><span onClick="lookupPGPKey('UserEmail');" class="btn btn-inverse" style="margin-bottom:10px;">Fetch GPG key</span></div>
|
2016-04-04 19:26:25 +02:00
|
|
|
<?php
|
2016-04-26 16:40:12 +02:00
|
|
|
if (Configure::read('SMIME.enabled')) echo $this->Form->input('certif_public', array('label' => 'SMIME Public certificate (PEM format)', 'div' => 'clear', 'class' => 'input-xxlarge'));
|
2013-03-06 11:34:22 +01:00
|
|
|
echo $this->Form->input('termsaccepted', array('label' => 'Terms accepted'));
|
2013-02-04 17:55:35 +01:00
|
|
|
echo $this->Form->input('change_pw', array('type' => 'checkbox', 'label' => 'Change Password'));
|
2013-05-31 15:42:53 +02:00
|
|
|
echo $this->Form->input('autoalert', array('label' => 'Receive alerts when events are published'));
|
|
|
|
echo $this->Form->input('contactalert', array('label' => 'Receive alerts from "contact reporter" requests'));
|
|
|
|
|
|
|
|
echo $this->Html->link('Reset Auth Key', array('controller' => 'users', 'action' => 'resetauthkey', $currentId));
|
2015-12-09 23:47:19 +01:00
|
|
|
?>
|
|
|
|
<div class="clear"></div>
|
|
|
|
<?php
|
|
|
|
echo $this->Form->input('disabled', array('label' => 'Disable this user account'));
|
2016-06-04 01:08:16 +02:00
|
|
|
|
2013-02-04 17:55:35 +01:00
|
|
|
?>
|
|
|
|
</fieldset>
|
2013-05-31 15:42:53 +02:00
|
|
|
<?php
|
|
|
|
echo $this->Form->button(__('Submit'), array('class' => 'btn btn-primary'));
|
|
|
|
echo $this->Form->end();?>
|
|
|
|
</div>
|
2013-10-24 16:41:42 +02:00
|
|
|
<?php
|
|
|
|
echo $this->element('side_menu', array('menuList' => 'admin', 'menuItem' => 'editUser'));
|
|
|
|
?>
|
2013-06-01 08:13:18 +02:00
|
|
|
|
2015-08-03 14:12:20 +02:00
|
|
|
<script type="text/javascript">
|
|
|
|
var syncRoles = <?php echo json_encode($syncRoles); ?>;
|
|
|
|
$(document).ready(function() {
|
|
|
|
syncUserSelected();
|
|
|
|
$('#UserRoleId').change(function() {
|
|
|
|
syncUserSelected();
|
|
|
|
});
|
2016-03-15 23:04:20 +01:00
|
|
|
checkUserPasswordEnabled();
|
|
|
|
checkUserExternalAuth();
|
|
|
|
$('#UserEnablePassword').change(function() {
|
|
|
|
checkUserPasswordEnabled();
|
|
|
|
});
|
|
|
|
$('#UserExternalAuthRequired').change(function() {
|
|
|
|
checkUserExternalAuth();
|
|
|
|
});
|
2015-08-03 14:12:20 +02:00
|
|
|
});
|
|
|
|
</script>
|