added support for multiple AD

This commit is contained in:
SJ
2013-07-08 11:31:17 +02:00
parent d3073dd444
commit bc16df8778
24 changed files with 636 additions and 95 deletions

View File

@ -876,9 +876,37 @@ var Piler =
$('#fldr_' + id).hide();
$('#fldr_collapse_' + id).hide();
$('#fldr_open_' + id).show();
},
test_ldap_connection:function()
{
Piler.log("[test_ldap_connection]");
jQuery.ajax('index.php?route=ldap/test', {
data: {
description: $('#description').val(),
ldap_host: $('#ldap_host').val(),
ldap_base_dn: $('#ldap_base_dn').val(),
ldap_bind_dn: $('#ldap_bind_dn').val(),
ldap_bind_pw: $('#ldap_bind_pw').val()
},
type: "POST"
})
.done( function(a) {
$('#LDAPTEST').html(a);
})
.fail(function(a, b) { alert("Problem retrieving XML data:" + b) });
},
clear_ldap_test: function()
{
$('#LDAPTEST').html('');
}
}

View File

@ -1,55 +0,0 @@
<?php if(Registry::get('username')) { ?>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<!-- <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a> -->
<a class="brand" href="/index.php?route=health/health" title="<?php print SITE_NAME; ?>"><img src="<?php print SITE_LOGO_SM; ?>" alt="<?php print SITE_NAME; ?>" /></a>
<!-- <div class="nav-collapse"> -->
<ul class="nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-desktop"></i>&nbsp;<?php print $text_monitor; ?>&nbsp;<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="index.php?route=stat/stat&timespan=daily"><i class="icon-bar-chart"></i>&nbsp;Statistics</a></li>
<li><a href="index.php?route=accounting/accounting&view=email"><i class="icon-tasks"></i>&nbsp;Accounting</a></li>
<li><a href="index.php?route=health/health"><i class="icon-medkit"></i>&nbsp;Health</a></li>
<?php if(ENABLE_AUDIT == 1) { ?>
<li><a href="index.php?route=audit/audit"><i class="icon-book"></i>&nbsp;<?php print $text_audit; ?></a></li>
<?php } ?>
</ul>
</li>
<li class="dropdown"<?php if(strstr($_SERVER['QUERY_STRING'], "domain/") || ($_SERVER['QUERY_STRING'] != "route=user/settings" && strstr($_SERVER['QUERY_STRING'], "user/")) || strstr($_SERVER['QUERY_STRING'], "policy/") || strstr($_SERVER['QUERY_STRING'], "import/")) { ?> id="active"<?php } ?>>
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-cogs"></i>&nbsp;<?php print $text_administration; ?>&nbsp;<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="index.php?route=user/list"><i class="icon-user"></i>&nbsp;<?php print $text_users; ?></a></li>
<li><a href="index.php?route=group/list"><i class="icon-group"></i>&nbsp;<?php print $text_groups; ?></a></li>
<li><a href="index.php?route=domain/domain"><i class="icon-globe"></i>&nbsp;<?php print $text_domain; ?></a></li>
<li><a href="index.php?route=policy/archiving"><i class="icon-folder-open"></i>&nbsp;<?php print $text_archiving_rules; ?></a></li>
<li><a href="index.php?route=policy/retention"><i class="icon-time"></i>&nbsp;<?php print $text_retention_rules; ?></a></li>
</ul>
</li>
</ul>
<ul class="nav pull-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-user icon-white"></i>&nbsp;<?php if(isset($_SESSION['realname'])) { print $_SESSION['realname']; ?>&nbsp;<?php } ?><b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="settings.php"><i class="icon-cog"></i>&nbsp;Settings</a></li>
<li class="divider"></li>
<li><a href="logout.php"><i class="icon-off"></i>&nbsp;<?php print $text_logout; ?></a></li>
</ul>
</li>
</ul>
<!-- </div><!--/.nav-collapse -->
</div>
</div>
</div>
<?php } ?>

View File

@ -35,6 +35,9 @@
<li><a href="index.php?route=user/list"><i class="icon-user"></i>&nbsp;<?php print $text_users; ?></a></li>
<li><a href="index.php?route=group/list"><i class="icon-group"></i>&nbsp;<?php print $text_groups; ?></a></li>
<li><a href="index.php?route=domain/domain"><i class="icon-globe"></i>&nbsp;<?php print $text_domain; ?></a></li>
<?php if(ENABLE_SAAS == 1) { ?>
<li><a href="index.php?route=ldap/list"><i class="icon-key"></i>&nbsp;<?php print $text_ldap; ?></a></li>
<?php } ?>
<li><a href="index.php?route=policy/archiving"><i class="icon-folder-open"></i>&nbsp;<?php print $text_archiving_rules; ?></a></li>
<li><a href="index.php?route=policy/retention"><i class="icon-time"></i>&nbsp;<?php print $text_retention_rules; ?></a></li>
</ul>

View File

@ -13,11 +13,25 @@
</div>
</div>
<div class="control-group">
<label class="control-label" for="mapped"><?php print $text_mapped_domain; ?>:</label>
<div class="controls">
<input type="text" class="text" name="mapped" placeholder="Mapped Domain" />
</div>
<label class="control-label" for="mapped"><?php print $text_mapped_domain; ?>:</label>
<div class="controls">
<input type="text" class="text" name="mapped" placeholder="Mapped Domain" />
</div>
</div>
<?php if(ENABLE_SAAS == 1) { ?>
<div class="control-group">
<label class="control-label" for="ldap_id"><?php print $text_ldap; ?>:</label>
<div class="controls">
<select name="ldap_id" id="ldap_id">
<?php foreach ($ldap as $l) { ?>
<option value="<?php print $l['id']; ?>"><?php print $l['description']; ?></option>
<?php } ?>
</select>
</div>
</div>
<?php } ?>
<div class="form-actions">
<input type="submit" value="<?php print $text_add; ?>" class="btn btn-primary" />
<input type="reset" value="<?php print $text_clear; ?>" class="btn" />
@ -35,6 +49,9 @@
<tr>
<th class="domaincell"><?php print $text_domain; ?></th>
<th class="domaincell"><?php print $text_mapped_domain; ?></th>
<?php if(ENABLE_SAAS == 1) { ?>
<th class="domaincell"><?php print $text_ldap; ?></th>
<?php } ?>
<th class="domaincell">&nbsp;</th>
</tr>
@ -42,6 +59,9 @@
<tr>
<td class="domaincell"><a href="index.php?route=user/list&search=@<?php print $domain['domain']; ?>"><?php print $domain['domain']; ?></a></td>
<td class="domaincell"><?php print $domain['mapped']; ?></td>
<?php if(ENABLE_SAAS == 1) { ?>
<td class="domaincell"><?php print $domain['ldap']; ?></td>
<?php } ?>
<td class="domaincell"><a href="index.php?route=domain/remove&amp;domain=<?php print urlencode($domain['domain']); ?>" onclick="javascript:confirm('Delete Domain','Delete','Cancel','<?php print urlencode($domain['domain']); ?>')"><?php print $text_remove; ?></a></td>
</tr>
<?php } ?>

View File

@ -0,0 +1,19 @@
<?php foreach($domains as $domain) { ?>
<a href="#" onclick="append_value_from_slider('domains', '<?php print $domain['domain']; ?>');"><?php print $domain['domain']; ?></a><br />
<?php } ?>
<div id="pagenav">
<?php if($page > 0){ ?><a href="index.php?route=domain/domains&amp;page=0&amp;term=<?php print $search; ?>&amp;sort=<?php print $sort; ?>&amp;order=<?php print $order; ?>" class="navlink"><?php } ?> &laquo; <?php if($page > 0){ ?></a><?php } ?>
&nbsp;
<?php if($page > 0){ ?><a href="index.php?route=domain/domains&amp;page=<?php print $prev_page; ?>&amp;term=<?php print $search; ?>&amp;sort=<?php print $sort; ?>&amp;order=<?php print $order; ?>" class="navlink"><?php } ?> &lsaquo; <?php if($page > 0){ ?></a><?php } ?>
&nbsp;
<?php if(count($domains) > 0) { print $domains[0][$sort]; ?> - <?php print $domains[count($domains)-1][$sort]; } ?>
&nbsp;
<?php if($total >= $page_len*($page+1) && $total > $page_len){ ?><a href="index.php?route=domain/domains&amp;page=<?php print $next_page; ?>&amp;term=<?php print $search; ?>&amp;sort=<?php print $sort; ?>&amp;order=<?php print $order; ?>" class="navlink"><?php } ?> &rsaquo; <?php if($total >= $page_len*($page+1) && $total > $page_len){ ?></a><?php } ?>
&nbsp;
<?php if($page < $total_pages){ ?><a href="index.php?route=domain/domains&amp;page=<?php print $total_pages; ?>&amp;term=<?php print $search; ?>&amp;sort=<?php print $sort; ?>&amp;order=<?php print $order; ?>" class="navlink"><?php } ?> &raquo; <?php if($page < $total_pages){ ?></a><?php } ?>
</div>
<div class="top20px"><a href="#" onclick="window.close();">close</a></div>

View File

@ -0,0 +1,81 @@
<h4><?php print $text_add_new_entry; ?></h4>
<?php if(isset($x)){ ?>
<div class="alert alert-info"><?php print $x; ?></div>
<?php } ?>
<form method="post" name="add1" action="index.php?route=ldap/list" class="form-horizontal">
<div class="control-group">
<label class="control-label" for="description"><?php print $text_description; ?>:</label>
<div class="controls">
<input type="text" class="text" name="description" id="description" placeholder="" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="ldap_host"><?php print $text_ldap_host; ?>:</label>
<div class="controls">
<input type="text" class="text" name="ldap_host" id="ldap_host" placeholder="" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="ldap_base_dn"><?php print $text_ldap_base_dn; ?>:</label>
<div class="controls">
<input type="text" class="text" name="ldap_base_dn" id="ldap_base_dn" placeholder="" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="ldap_bind_dn"><?php print $text_ldap_bind_dn; ?>:</label>
<div class="controls">
<input type="text" class="text" name="ldap_bind_dn" id="ldap_bind_dn" placeholder="" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="ldap_bind_pw"><?php print $text_ldap_bind_pw; ?>:</label>
<div class="controls">
<input type="password" class="password" name="ldap_bind_pw" id="ldap_bind_pw" placeholder="" /> <input type="button" value="<?php print $text_test_connection; ?>" class="btn btn-danger" onclick="Piler.test_ldap_connection(); return false;" /> <span id="LDAPTEST"></span>
</div>
</div>
<div class="form-actions">
<input type="submit" value="<?php print $text_add; ?>" class="btn btn-primary" />
<input type="reset" value="<?php print $text_clear; ?>" class="btn" onclick="Piler.clear_ldap_test();" />
</div>
</form>
<h4><?php print $text_existing_entries; ?></h4>
<div class="listarea">
<?php if(isset($entries)){ ?>
<table id="ss1" class="table table-striped table-condensed">
<tr>
<th class="domaincell"><?php print $text_description; ?></th>
<th class="domaincell"><?php print $text_ldap_host; ?></th>
<td class="domaincell"><?php print $text_ldap_base_dn; ?></td>
<td class="domaincell"><?php print $text_ldap_bind_dn; ?></td>
<th class="domaincell">&nbsp;</th>
</tr>
<?php foreach($entries as $e) { ?>
<tr>
<td class="domaincell"><?php print $e['description']; ?></td>
<td class="domaincell"><?php print $e['ldap_host']; ?></td>
<td class="domaincell"><?php print $e['ldap_base_dn']; ?></td>
<td class="domaincell"><?php print $e['ldap_bind_dn']; ?></td>
<td class="domaincell"><a href="index.php?route=ldap/remove&amp;id=<?php print $e['id']; ?>&amp;description=<?php print urlencode($e['description']); ?>&amp;confirmed=1" onclick="if(confirm('<?php print $text_remove; ?>: ' + '\'<?php print $e['description']; ?>\'')) return true; return false;"><?php print $text_remove; ?></a></td>
</tr>
<?php } ?>
</div>
<?php } else { ?>
<div class="alert alert-error lead">
<?php print $text_not_found; ?>
</div>
<?php } ?>
</div>

View File

@ -0,0 +1,11 @@
<p>
<?php if($confirmed){ ?>
<?php print $x; ?>. <a href="index.php?route=ldap/list"><?php print $text_back; ?></a>
<?php } ?>
</p>