MISP/app/View/Users/admin_add.ctp

98 lines
3.3 KiB
Plaintext
Raw Normal View History

<div class="users form">
<?php echo $this->Form->create('User', array('novalidate'=>true));?>
<fieldset>
<legend><?php echo __('Admin Add User'); ?></legend>
<?php
echo $this->Form->input('email');
?>
<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
if ($isSiteAdmin) {
echo $this->Form->input('org_id', array(
2015-03-21 14:27:53 +01:00
'options' => $orgs,
'label' => 'Organisation',
'empty' => 'Choose organisation',
));
}
echo $this->Form->input('role_id', array('label' => 'Role'));
echo $this->Form->input('authkey', array('value' => $authkey, 'readonly' => 'readonly', 'div' => 'input clear'));
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'));
?>
<div class="clear"><span onClick="lookupPGPKey('UserEmail');" class="btn btn-inverse" style="margin-bottom:10px;">Fetch GPG key</span></div>
2016-04-04 19:24:58 +02:00
<?php
if (Configure::read('SMIME.enabled')) echo $this->Form->input('certif_public', array('label' => 'Public certificate (Encryption -- PEM format)', 'div' => 'clear', 'class' => 'input-xxlarge'));
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'));
?>
<div class="clear"></div>
<?php
echo $this->Form->input('disabled', array('label' => 'Disable this user account'));
2013-05-31 15:42:53 +02: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>
<?php
echo $this->element('side_menu', array('menuList' => 'admin', 'menuItem' => 'addUser'));
?>
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();
});
checkUserPasswordEnabled();
checkUserExternalAuth();
$('#UserEnablePassword').change(function() {
checkUserPasswordEnabled();
});
$('#UserExternalAuthRequired').change(function() {
checkUserExternalAuth();
});
2015-08-03 14:12:20 +02:00
});
2016-04-04 19:24:58 +02:00
</script>