Commit be92da6c authored by Jos Schellevis's avatar Jos Schellevis

Fixed some issue with user manager and enhanced gui parts

parent 6000388b
......@@ -474,7 +474,7 @@ function select_clicked() {
<td width="22%" valign="top" class="vncellreq"><?=gettext("Type");?></td>
<td width="78%" class="vtable">
<?php if (!isset($id)): ?>
<select name='type' id='type' class="formselect" onchange='server_typechange()'>
<select name='type' id='type' class="formselect selectpicker" data-style="btn-default" onchange='server_typechange()'>
<?php
foreach ($auth_server_types as $typename => $typedesc ):
$selected = "";
......@@ -518,7 +518,7 @@ function select_clicked() {
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Transport");?></td>
<td width="78%" class="vtable">
<select name='ldap_urltype' id='ldap_urltype' class="formselect" onchange='ldap_urlchange()'>
<select name='ldap_urltype' id='ldap_urltype' class="formselect selectpicker" data-style="btn-default" onchange='ldap_urlchange()'>
<?php
foreach ($ldap_urltypes as $urltype => $urlport):
$selected = "";
......@@ -534,7 +534,7 @@ function select_clicked() {
<td width="22%" valign="top" class="vncell"><?=gettext("Peer Certificate Authority"); ?></td>
<td width="78%" class="vtable">
<?php if (count($a_ca)): ?>
<select id='ldap_caref' name='ldap_caref' class="formselect">
<select id='ldap_caref' name='ldap_caref' class="formselect selectpicker" data-style="btn-default">
<?php
foreach ($a_ca as $ca):
$selected = "";
......@@ -554,7 +554,7 @@ function select_clicked() {
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Protocol version");?></td>
<td width="78%" class="vtable">
<select name='ldap_protver' id='ldap_protver' class="formselect">
<select name='ldap_protver' id='ldap_protver' class="formselect selectpicker" data-style="btn-default">
<?php
foreach ($ldap_protvers as $version):
$selected = "";
......@@ -571,9 +571,9 @@ function select_clicked() {
<td width="78%" class="vtable">
<table border="0" cellspacing="0" cellpadding="2" summary="search scope">
<tr>
<td><?=gettext("Level:");?> &nbsp;</td>
<td><?=gettext("Level:");?></td>
<td>
<select name='ldap_scope' id='ldap_scope' class="formselect">
<select name='ldap_scope' id='ldap_scope' class="formselect selectpicker" data-style="btn-default">
<?php
foreach ($ldap_scopes as $scopename => $scopedesc):
$selected = "";
......@@ -586,7 +586,7 @@ function select_clicked() {
</td>
</tr>
<tr>
<td><?=gettext("Base DN:");?> &nbsp;</td>
<td><?=gettext("Base DN:");?></td>
<td>
<input name="ldap_basedn" type="text" class="formfld unknown" id="ldap_basedn" size="40" value="<?=htmlspecialchars($pconfig['ldap_basedn']);?>"/>
</td>
......@@ -672,7 +672,7 @@ function select_clicked() {
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Initial Template");?></td>
<td width="78%" class="vtable">
<select name='ldap_tmpltype' id='ldap_tmpltype' class="formselect" onchange='ldap_tmplchange()'>
<select name='ldap_tmpltype' id='ldap_tmpltype' class="formselect selectpicker" data-style="btn-default" onchange='ldap_tmplchange()'>
<?php
foreach ($ldap_templates as $tmplname => $tmpldata):
$selected = "";
......@@ -757,7 +757,7 @@ function select_clicked() {
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Services offered");?></td>
<td width="78%" class="vtable">
<select name='radius_srvcs' id='radius_srvcs' class="formselect" onchange='radius_srvcschange()'>
<select name='radius_srvcs' id='radius_srvcs' class="formselect selectpicker" data-style="btn-default" onchange='radius_srvcschange()'>
<?php
foreach ($radius_srvcs as $srvcname => $srvcdesc):
$selected = "";
......
......@@ -166,7 +166,7 @@ include("head.inc");
?>
<body link="#000000" vlink="#000000" alink="#000000" onload="<?= $jsevents["body"]["onload"] ?>">
<body onload="<?= $jsevents["body"]["onload"] ?>">
<?php include("fbegin.inc"); ?>
<script type="text/javascript">
//<![CDATA[
......@@ -360,13 +360,13 @@ function presubmit() {
endif;
if ($act != "new"):
?>
<th colspan="2" valign="top" class="vncell"><?=gettext("Assigned Privileges");?></th>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Assigned Privileges");?></td>
<td width="78%" class="vtable">
<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="privileges">
<td colspan="2" class="vtable">
<table class="tabcont table table-striped" width="100%" border="0" cellpadding="0" cellspacing="0" summary="privileges">
<tr>
<td width="40%" class="listhdrr"><?=gettext("Name");?></td>
<td width="60%" class="listhdrr"><?=gettext("Description");?></td>
<td width="40%" class="listhdrr"><b><?=gettext("Name");?></b></td>
<td width="60%" class="listhdrr"><b><?=gettext("Description");?></b></td>
<td class="list"></td>
</tr>
<?php
......@@ -388,7 +388,7 @@ function presubmit() {
document.getElementById('groupid').value='<?=$id;?>';
document.getElementById('act').value='<?php echo "delpriv";?>';
return confirm('<?=gettext("Do you really want to delete this privilege?");?>');"
title="<?=gettext("delete privilege");?>"><span class="glyphicon glyphicon-remove"></span></button>
title="<?=gettext("delete privilege");?>" data-toggle="tooltip" data-placement="left" ><span class="glyphicon glyphicon-remove"></span></button>
</td>
</tr>
<?php
......@@ -400,7 +400,7 @@ function presubmit() {
<td class="list" colspan="2"></td>
<td class="list">
<a href="system_groupmanager_addprivs.php?groupid=<?=htmlspecialchars($id)?>" class="btn btn-default btn-xs">
<span class="glyphicon glyphicon-add"></span>
<span class="glyphicon glyphicon-plus"></span>
</a>
</td>
......
......@@ -110,7 +110,7 @@ if(isAjax())
include("head.inc");
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
<body onload="<?= $jsevents["body"]["onload"] ?>">
<?php include("fbegin.inc"); ?>
<script type="text/javascript">
//<![CDATA[
......@@ -141,88 +141,83 @@ function update_description() {
//]]>
</script>
<?php
if ($input_errors)
print_input_errors($input_errors);
if ($savemsg)
print_info_box($savemsg);
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="group manager add priveleges">
<tr>
<td>
<?php
$tab_array = array();
$tab_array[] = array(gettext("Users"), false, "system_usermanager.php");
$tab_array[] = array(gettext("Groups"), true, "system_groupmanager.php");
$tab_array[] = array(gettext("Settings"), false, "system_usermanager_settings.php");
$tab_array[] = array(gettext("Servers"), false, "system_authservers.php");
display_top_tabs($tab_array);
?>
</td>
</tr>
<tr>
<td id="mainarea">
<div class="tabcont">
<form action="system_groupmanager_addprivs.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("System Privileges");?></td>
<td width="78%" class="vtable">
<table>
<tr><td>
<select name="sysprivs[]" id="sysprivs" class="formselect" onchange="update_description();" multiple="multiple" size="35">
<?php
foreach($priv_list as $pname => $pdata):
if (in_array($pname, $a_group['priv']))
continue;
?>
<option value="<?=$pname;?>"><?=$pdata['name'];?></option>
<?php endforeach; ?>
</select>
<br />
<?=gettext("Hold down CTRL (pc)/COMMAND (mac) key to select multiple items");?>
</td><td>
<a href='#'onClick="selectAll();">Select all</a>
<script type="text/javascript">
//<![CDATA[
function selectAll() {
var options = jQuery('select#sysprivs option');
var len = options.length;
for (var i = 0; i < len; i++) {
options[i].selected = true;
}
}
selectAll();
//]]>
</script>
<br />
</td>
<section class="page-content-main">
<div class="container-fluid">
<div class="row">
<?php
if ($input_errors)
print_input_errors($input_errors);
if ($savemsg)
print_info_box($savemsg);
?>
<section class="col-xs-12">
<?php
$tab_array = array();
$tab_array[] = array(gettext("Users"), false, "system_usermanager.php");
$tab_array[] = array(gettext("Groups"), true, "system_groupmanager.php");
$tab_array[] = array(gettext("Settings"), false, "system_usermanager_settings.php");
$tab_array[] = array(gettext("Servers"), false, "system_authservers.php");
display_top_tabs($tab_array);
?>
<div class="tab-content content-box col-xs-12">
<form action="system_groupmanager_addprivs.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area" class="table table-striped">
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("System Privileges");?><br /><a href='#' onClick="selectAll();">Select all</a></td>
<td width="78%" class="vtable">
<select name="sysprivs[]" id="sysprivs" class="formselect" onchange="update_description();" multiple="multiple" size="35">
<?php
foreach($priv_list as $pname => $pdata):
if (in_array($pname, $a_group['priv']))
continue;
?>
<option value="<?=$pname;?>"><?=$pdata['name'];?></option>
<?php endforeach; ?>
</select>
<br />
<?=gettext("Hold down CTRL (pc)/COMMAND (mac) key to select multiple items");?>
</td>
<script type="text/javascript">
//<![CDATA[
function selectAll() {
var options = jQuery('select#sysprivs option');
var len = options.length;
for (var i = 0; i < len; i++) {
options[i].selected = true;
}
}
//selectAll();
//]]>
</script>
</tr>
</table>
</td>
</tr>
<tr height="60">
<td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
<td width="78%" valign="top" class="vtable" id="pdesc">
<em><?=gettext("Select a privilege from the list above for a description");?></em>
</td>
</tr>
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<input id="submitt" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
<input id="cancelbutton" class="formbtn" type="button" value="<?=gettext("Cancel");?>" onclick="history.back()" />
<?php if (isset($groupid)): ?>
<input name="groupid" type="hidden" value="<?=htmlspecialchars($groupid);?>" />
<?php endif; ?>
</td>
</tr>
</table>
</form>
</div>
</td>
</tr>
</table>
<tr height="60">
<td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
<td width="78%" valign="top" class="vtable" id="pdesc">
<em><?=gettext("Select a privilege from the list above for a description");?></em>
</td>
</tr>
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<input id="submitt" name="Submit" type="submit" class="formbtn btn btn-primary" value="<?=gettext("Save");?>" />
<input id="cancelbutton" class="formbtn btn btn-default" type="button" value="<?=gettext("Cancel");?>" onclick="history.back()" />
<?php if (isset($groupid)): ?>
<input name="groupid" type="hidden" value="<?=htmlspecialchars($groupid);?>" />
<?php endif; ?>
</td>
</tr>
</table>
</form>
</div>
</section>
</div>
</div>
</section>
<?php include("fend.inc"); ?>
</body>
</html>
......@@ -558,11 +558,11 @@ function sshkeyClicked(obj) {
</td>
<td align="center" width="12%">
<br />
<a href="javascript:move_selected('notgroups','groups')" class="btn btn-default btn-xs" title="<?=gettext("Add Groups"); ?>">
<a href="javascript:move_selected('notgroups','groups')" class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="left" title="<?=gettext("Add Groups"); ?>">
<span class="glyphicon glyphicon-arrow-right"></span>
</a>
<br /><br />
<a href="javascript:move_selected('groups','notgroups')" class="btn btn-default btn-xs" title="<?=gettext("Remove Groups"); ?>">
<a href="javascript:move_selected('groups','notgroups')" class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="left" title="<?=gettext("Remove Groups"); ?>">
<span class="glyphicon glyphicon-arrow-left"></span>
</a>
</td>
......@@ -600,13 +600,17 @@ function sshkeyClicked(obj) {
if (isset($pconfig['uid'])):
?>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Effective Privileges");?></td>
<td width="78%" class="vtable">
<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="privileges">
<th colspan="2">
<?=gettext("Effective Privileges");?>
</th>
</tr>
<tr>
<td colspan="2" class="vtable">
<table class="table table-striped" width="100%" border="0" cellpadding="0" cellspacing="0" summary="privileges">
<tr>
<td width="20%" class="listhdrr"><?=gettext("Inherited From");?></td>
<td width="30%" class="listhdrr"><?=gettext("Name");?></td>
<td width="40%" class="listhdrr"><?=gettext("Description");?></td>
<td width="20%" class="listhdrr"><b><?=gettext("Inherited From");?></b></td>
<td width="30%" class="listhdrr"><b><?=gettext("Name");?></b></td>
<td width="40%" class="listhdrr"><b><?=gettext("Description");?></b></td>
<td class="list"></td>
</tr>
<?php
......@@ -630,13 +634,13 @@ function sshkeyClicked(obj) {
<?php
if (!$group):
?>
<input type="image" name="delpriv[]" width="17" height="17" border="0"
<button class="btn btn-default btn-xs" name="delpriv[]_x" width="17" height="17" border="0"
src="/themes/<?=$g['theme'];?>/images/icons/icon_x.gif"
onclick="document.getElementById('privid').value='<?=$i;?>';
document.getElementById('userid').value='<?=$id;?>';
document.getElementById('act').value='<?php echo "delpriv";?>';
return confirm('<?=gettext("Do you really want to delete this privilege?");?>');"
title="<?=gettext("delete privilege");?>" />
title="<?=gettext("delete privilege");?>" data-toggle="tooltip" data-placement="left"><span class="glyphicon glyphicon-remove"></span>
<?php
endif;
?>
......@@ -652,8 +656,8 @@ function sshkeyClicked(obj) {
<tr>
<td class="list" colspan="3"></td>
<td class="list">
<a href="system_usermanager_addprivs.php?userid=<?=$id?>" class="btn btn-default">
<span class="glyphicon glyphicon-add"></span>
<a href="system_usermanager_addprivs.php?userid=<?=$id?>" class="btn btn-xs btn-default">
<span class="glyphicon glyphicon-plus"></span>
</a>
</td>
</tr>
......@@ -697,20 +701,20 @@ function sshkeyClicked(obj) {
onclick="document.getElementById('certid').value='<?=$i;?>';
document.getElementById('userid').value='<?=$id;?>';
document.getElementById('act').value='<?php echo "expckey";?>';"
title="<?=gettext("export private key");?>"><span class="glyphicon glyphicon-arrow-down"></span></button>
title="<?=gettext("export private key");?>" data-toggle="tooltip" data-placement="left" ><span class="glyphicon glyphicon-arrow-down"></span></button>
<button type="submit" name="expcert[]"
class="btn btn-default btn-xs"
onclick="document.getElementById('certid').value='<?=$i;?>';
document.getElementById('userid').value='<?=$id;?>';
document.getElementById('act').value='<?php echo "expcert";?>';"
title="<?=gettext("export cert");?>"><span class="glyphicon glyphicon-arrow-down"></span></button>
title="<?=gettext("export cert");?>" data-toggle="tooltip" data-placement="left" ><span class="glyphicon glyphicon-arrow-down"></span></button>
<button type="submit" name="delcert[]"
class="btn btn-default btn-xs"
onclick="document.getElementById('certid').value='<?=$i;?>';
document.getElementById('userid').value='<?=$id;?>';
document.getElementById('act').value='<?php echo "delcert";?>';
return confirm('<?=gettext("Do you really want to remove this certificate association?") .'\n'. gettext("(Certificate will not be deleted)");?>')"
title="<?=gettext("delete cert");?>"><span class="glyphicon glyphicon-remove"></span></button>
title="<?=gettext("delete cert");?>" data-toggle="tooltip" data-placement="left" ><span class="glyphicon glyphicon-remove"></span></button>
</td>
</tr>
<?php
......@@ -880,7 +884,7 @@ function sshkeyClicked(obj) {
<button type="submit" name="addcert"
class="btn btn-default btn-xs"
onclick="document.getElementById('act').value='<?php echo "new";?>';"
title="<?=gettext("add user");?>"><span class="glyphicon glyphicon-plus"></span>
title="<?=gettext("add user");?>" data-toggle="tooltip" data-placement="left" ><span class="glyphicon glyphicon-plus"></span>
</button>
</td>
</tr>
......@@ -936,7 +940,7 @@ function sshkeyClicked(obj) {
<button type="submit" name="edituser[]" class="btn btn-default btn-xs"
onclick="document.getElementById('userid').value='<?=$i;?>';
document.getElementById('act').value='<?php echo "edit";?>';"
title="<?=gettext("edit user");?>" ><span class="glyphicon glyphicon-pencil"></span></button>
title="<?=gettext("edit user");?>" data-toggle="tooltip" data-placement="left" ><span class="glyphicon glyphicon-pencil"></span></button>
<?php
if($userent['scope'] != "system"):
?>
......@@ -947,7 +951,7 @@ function sshkeyClicked(obj) {
document.getElementById('username').value='<?=$userent['name'];?>';
document.getElementById('act').value='<?php echo "deluser";?>';
return confirm('<?=gettext("Do you really want to delete this user?");?>');"
title="<?=gettext("delete user");?>"><span class="glyphicon glyphicon-remove"></span></button>
title="<?=gettext("delete user");?>" data-toggle="tooltip" data-placement="left" ><span class="glyphicon glyphicon-remove"></span></button>
<?php
endif;
?>
......
......@@ -128,68 +128,70 @@ function update_description() {
//]]>
</script>
<?php
if ($input_errors)
print_input_errors($input_errors);
if ($savemsg)
print_info_box($savemsg);
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="user manager add priveleges">
<tr>
<td>
<?php
$tab_array = array();
$tab_array[] = array(gettext("Users"), true, "system_usermanager.php");
$tab_array[] = array(gettext("Groups"), false, "system_groupmanager.php");
$tab_array[] = array(gettext("Settings"), false, "system_usermanager_settings.php");
$tab_array[] = array(gettext("Servers"), false, "system_authservers.php");
display_top_tabs($tab_array);
?>
</td>
</tr>
<tr>
<td id="mainarea">
<div class="tabcont">
<form action="system_usermanager_addprivs.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("System Privileges");?></td>
<td width="78%" class="vtable">
<select name="sysprivs[]" id="sysprivs" class="formselect" onchange="update_description();" multiple="multiple" size="35">
<?php
foreach($priv_list as $pname => $pdata):
if (in_array($pname, $a_user['priv']))
continue;
?>
<option value="<?=$pname;?>"><?=$pdata['name'];?></option>
<?php endforeach; ?>
</select>
<br />
<?=gettext("Hold down CTRL (pc)/COMMAND (mac) key to select multiple items");?>
</td>
</tr>
<tr height="60">
<td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
<td width="78%" valign="top" class="vtable" id="pdesc">
<em><?=gettext("Select a privilege from the list above for a description"); ?></em>
</td>
</tr>
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<input id="submitt" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
<input id="cancelbutton" class="formbtn" type="button" value="<?=gettext("Cancel");?>" onclick="history.back()" />
<?php if (isset($userid)): ?>
<input name="userid" type="hidden" value="<?=htmlspecialchars($userid);?>" />
<?php endif; ?>
</td>
</tr>
</table>
</form>
</div>
</td>
</tr>
</table>
<section class="page-content-main">
<div class="container-fluid">
<div class="row">
<?php
if ($input_errors)
print_input_errors($input_errors);
if ($savemsg)
print_info_box($savemsg);
?>
<section class="col-xs-12">
<?php
$tab_array = array();
$tab_array[] = array(gettext("Users"), true, "system_usermanager.php");
$tab_array[] = array(gettext("Groups"), false, "system_groupmanager.php");
$tab_array[] = array(gettext("Settings"), false, "system_usermanager_settings.php");
$tab_array[] = array(gettext("Servers"), false, "system_authservers.php");
display_top_tabs($tab_array);
?>
<div class="tab-content content-box col-xs-12">
<form action="system_usermanager_addprivs.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area" class="table table-striped">
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("System Privileges");?></td>
<td width="78%" class="vtable">
<select name="sysprivs[]" id="sysprivs" class="formselect" onchange="update_description();" multiple="multiple" size="35">
<?php
foreach($priv_list as $pname => $pdata):
if (in_array($pname, $a_user['priv']))
continue;
?>
<option value="<?=$pname;?>"><?=$pdata['name'];?></option>
<?php endforeach; ?>
</select>
<br />
<?=gettext("Hold down CTRL (pc)/COMMAND (mac) key to select multiple items");?>
</td>
</tr>
<tr height="60">
<td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
<td width="78%" valign="top" class="vtable" id="pdesc">
<em><?=gettext("Select a privilege from the list above for a description"); ?></em>
</td>
</tr>
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<input id="submitt" name="Submit" type="submit" class="formbtn btn btn-primary" value="<?=gettext("Save");?>" />
<input id="cancelbutton" class="formbtn btn btn-default" type="button" value="<?=gettext("Cancel");?>" onclick="history.back()" />
<?php if (isset($userid)): ?>
<input name="userid" type="hidden" value="<?=htmlspecialchars($userid);?>" />
<?php endif; ?>
</td>
</tr>
</table>
</form>
</div>
</section>
</div>
</div>
</section>
<?php include("fend.inc"); ?>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment