mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-24 04:40:13 +01:00
added generic ldap support
This commit is contained in:
parent
dd2ea801bf
commit
c859b93096
@ -20,3 +20,9 @@ create unique index `entry` on archiving_rule (`domain`,`from`,`to`,`subject`,`_
|
||||
alter table retention_rule drop index `entry`;
|
||||
create unique index `entry` on retention_rule (`domain`,`from`,`to`,`subject`,`_size`,`size`,`attachment_name`,`attachment_type`,`_attachment_size`,`attachment_size`,`spam`);
|
||||
|
||||
|
||||
alter table ldap add column ldap_mail_attr varchar(128) default null;
|
||||
alter table ldap add column ldap_account_objectclass varchar(128) default null;
|
||||
alter table ldap add column ldap_distributionlist_attr varchar(128) default null;
|
||||
alter table ldap add column ldap_distributionlist_objectclass varchar(128) default null;
|
||||
|
||||
|
@ -379,6 +379,8 @@ define('GOOGLE_REDIRECT_URL', SITE_URL . 'google.php');
|
||||
define('HEALTH_URL', SITE_URL . 'index.php?route=health/health');
|
||||
define('HEALTH_WORKER_URL', SITE_URL . 'index.php?route=health/worker');
|
||||
|
||||
define('LDAP_TYPE_GENERIC', 'generic_ldap');
|
||||
|
||||
define('ACTION_ALL', 0);
|
||||
define('ACTION_UNKNOWN', 1);
|
||||
define('ACTION_LOGIN', 2);
|
||||
|
@ -82,8 +82,10 @@ class ControllerLdapList extends Controller {
|
||||
|
||||
if ( isset($this->data['errorstring']) ) {
|
||||
// use posted values if they differ from database values (ie - form was submitted but failed validation)
|
||||
if (isset($this->request->post['ldap_type'])) { $this->data['a']['ldap_type'] = $this->request->post['ldap_type'];}
|
||||
if (isset($this->request->post['description'])) { $this->data['a']['description'] = $this->request->post['description'];}
|
||||
/*if (isset($this->request->post['ldap_type'])) { $this->data['a']['ldap_type'] = $this->request->post['ldap_type'];}
|
||||
if (isset($this->request->post['description'])) { $this->data['a']['description'] = $this->request->post['description'];}*/
|
||||
|
||||
$this->data['a'] = $this->request->post;
|
||||
}
|
||||
|
||||
}
|
||||
@ -119,6 +121,23 @@ class ControllerLdapList extends Controller {
|
||||
$this->error['ldap_bind_pw'] = $this->data['text_field_required'];
|
||||
}
|
||||
|
||||
if(isset($this->request->post['ldap_type']) && $this->request->post['ldap_type'] == LDAP_TYPE_GENERIC) {
|
||||
|
||||
if(!isset($this->request->post['ldap_mail_attr']) || strlen($this->request->post['ldap_mail_attr']) < 3) {
|
||||
$this->error['ldap_mail_attr'] = $this->data['text_field_required'];
|
||||
}
|
||||
if(!isset($this->request->post['ldap_account_objectclass']) || strlen($this->request->post['ldap_account_objectclass']) < 3) {
|
||||
$this->error['ldap_account_objectclass'] = $this->data['text_field_required'];
|
||||
}
|
||||
if(!isset($this->request->post['ldap_distributionlist_attr']) || strlen($this->request->post['ldap_distributionlist_attr']) < 3) {
|
||||
$this->error['ldap_distributionlist_attr'] = $this->data['text_field_required'];
|
||||
}
|
||||
if(!isset($this->request->post['ldap_distributionlist_objectclass']) || strlen($this->request->post['ldap_distributionlist_objectclass']) < 3) {
|
||||
$this->error['ldap_distributionlist_objectclass'] = $this->data['text_field_required'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!$this->error) {
|
||||
return true;
|
||||
} else {
|
||||
|
@ -58,7 +58,7 @@ Registry::set('langs', $langs);
|
||||
Registry::set('paging', $paging);
|
||||
Registry::set('themes', $themes);
|
||||
Registry::set('letters', $letters);
|
||||
Registry::set('ldap_types', array("AD", "iredmail", "lotus", "zimbra"));
|
||||
Registry::set('ldap_types', array("AD", "iredmail", "lotus", "zimbra", LDAP_TYPE_GENERIC));
|
||||
Registry::set('health_smtp_servers', $health_smtp_servers);
|
||||
Registry::set('partitions_to_monitor', $partitions_to_monitor);
|
||||
Registry::set('actions', $actions);
|
||||
|
@ -6,7 +6,7 @@ class ModelSaasLdap extends Model
|
||||
public function get($id = -1) {
|
||||
|
||||
if(is_numeric($id) && $id >= 0) {
|
||||
$query = $this->db->query("SELECT id, description, ldap_type, ldap_host, ldap_base_dn, ldap_bind_dn, ldap_bind_pw, ldap_auditor_member_dn FROM " . TABLE_LDAP . " WHERE id=?", array($id));
|
||||
$query = $this->db->query("SELECT * FROM " . TABLE_LDAP . " WHERE id=?", array($id));
|
||||
if($query->num_rows > 0) { return $query->row; }
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ class ModelSaasLdap extends Model
|
||||
public function add($arr = array()) {
|
||||
if(!isset($arr['description']) || !isset($arr['ldap_host'])) { return 0; }
|
||||
|
||||
$query = $this->db->query("INSERT INTO " . TABLE_LDAP . " (description, ldap_host, ldap_base_dn, ldap_bind_dn, ldap_bind_pw, ldap_type, ldap_auditor_member_dn) VALUES (?,?,?,?,?,?,?)", array($arr['description'], $arr['ldap_host'], $arr['ldap_base_dn'], $arr['ldap_bind_dn'], $arr['ldap_bind_pw'], $arr['ldap_type'], $arr['ldap_auditor_member_dn']));
|
||||
$query = $this->db->query("INSERT INTO " . TABLE_LDAP . " (description, ldap_host, ldap_base_dn, ldap_bind_dn, ldap_bind_pw, ldap_type, ldap_auditor_member_dn, ldap_mail_attr, ldap_account_objectclass, ldap_distributionlist_attr, ldap_distributionlist_objectclass) VALUES (?,?,?,?,?,?,?,?,?,?,?)", array($arr['description'], $arr['ldap_host'], $arr['ldap_base_dn'], $arr['ldap_bind_dn'], $arr['ldap_bind_pw'], $arr['ldap_type'], $arr['ldap_auditor_member_dn'], $arr['ldap_mail_attr'], $arr['ldap_account_objectclass'], $arr['ldap_distributionlist_attr'], $arr['ldap_distributionlist_objectclass']));
|
||||
|
||||
$rc = $this->db->countAffected();
|
||||
|
||||
@ -58,7 +58,7 @@ class ModelSaasLdap extends Model
|
||||
public function update($arr = array()) {
|
||||
if(!isset($arr['id']) || !isset($arr['description']) || !isset($arr['ldap_host'])) { return 0; }
|
||||
|
||||
$query = $this->db->query("UPDATE " . TABLE_LDAP . " SET description=?, ldap_host=?, ldap_base_dn=?, ldap_bind_dn=?, ldap_bind_pw=?, ldap_type=?, ldap_auditor_member_dn=? WHERE id=?", array($arr['description'], $arr['ldap_host'], $arr['ldap_base_dn'], $arr['ldap_bind_dn'], $arr['ldap_bind_pw'], $arr['ldap_type'], $arr['ldap_auditor_member_dn'], $arr['id']));
|
||||
$query = $this->db->query("UPDATE " . TABLE_LDAP . " SET description=?, ldap_host=?, ldap_base_dn=?, ldap_bind_dn=?, ldap_bind_pw=?, ldap_type=?, ldap_auditor_member_dn=?, ldap_mail_attr=?, ldap_account_objectclass=?, ldap_distributionlist_attr=?, ldap_distributionlist_objectclass=? WHERE id=?", array($arr['description'], $arr['ldap_host'], $arr['ldap_base_dn'], $arr['ldap_bind_dn'], $arr['ldap_bind_pw'], $arr['ldap_type'], $arr['ldap_auditor_member_dn'], $arr['ldap_mail_attr'], $arr['ldap_account_objectclass'], $arr['ldap_distributionlist_attr'], $arr['ldap_distributionlist_objectclass'], $arr['id']));
|
||||
|
||||
return $this->db->countAffected();
|
||||
}
|
||||
@ -71,9 +71,9 @@ class ModelSaasLdap extends Model
|
||||
|
||||
list($l,$d) = explode("@", $email);
|
||||
|
||||
$query = $this->db->query("SELECT ldap_type, ldap_host, ldap_base_dn, ldap_bind_dn, ldap_bind_pw, ldap_auditor_member_dn FROM " . TABLE_DOMAIN . " as d, " . TABLE_LDAP . " as l where d.ldap_id=l.id and d.domain=?", array($d));
|
||||
$query = $this->db->query("SELECT d.*, l.* FROM " . TABLE_DOMAIN . " as d, " . TABLE_LDAP . " as l where d.ldap_id=l.id and d.domain=?", array($d));
|
||||
|
||||
if($query->num_rows > 0) { return array($query->row['ldap_type'], $query->row['ldap_host'], $query->row['ldap_base_dn'], $query->row['ldap_bind_dn'], $query->row['ldap_bind_pw'], $query->row['ldap_auditor_member_dn']); }
|
||||
if($query->num_rows > 0) { return $query->row; }
|
||||
|
||||
return array();
|
||||
}
|
||||
|
@ -85,16 +85,23 @@ class ModelUserAuth extends Model {
|
||||
$a = $this->model_saas_ldap->get_ldap_params_by_email($username);
|
||||
|
||||
if(count($a) >= 6) {
|
||||
$ldap_type = $a[0];
|
||||
$ldap_host = $a[1];
|
||||
$ldap_base_dn = $a[2];
|
||||
$ldap_helper_dn = $a[3];
|
||||
$ldap_helper_password = $a[4];
|
||||
$ldap_auditor_member_dn = $a[5];
|
||||
$ldap_type = $a['ldap_type'];
|
||||
$ldap_host = $a['ldap_host'];
|
||||
$ldap_base_dn = $a['ldap_base_dn'];
|
||||
$ldap_helper_dn = $a['ldap_bind_dn'];
|
||||
$ldap_helper_password = $a['ldap_bind_pw'];
|
||||
$ldap_auditor_member_dn = $a['ldap_auditor_member_dn'];
|
||||
|
||||
$ldap_mail_attr = $a['ldap_mail_attr'];
|
||||
$ldap_account_objectclass = $a['ldap_account_objectclass'];
|
||||
$ldap_distributionlist_attr = $a['ldap_distributionlist_attr'];
|
||||
$ldap_distributionlist_objectclass = $a['ldap_distributionlist_objectclass'];
|
||||
}
|
||||
}
|
||||
|
||||
list($ldap_mail_attr, $ldap_account_objectclass, $ldap_distributionlist_attr, $ldap_distributionlist_objectclass) = get_ldap_attribute_names($ldap_type);
|
||||
if($ldap_type != LDAP_TYPE_GENERIC) {
|
||||
list($ldap_mail_attr, $ldap_account_objectclass, $ldap_distributionlist_attr, $ldap_distributionlist_objectclass) = get_ldap_attribute_names($ldap_type);
|
||||
}
|
||||
|
||||
if($ldap_mail_attr == 'proxyAddresses') { $username_prefix = 'smtp:'; }
|
||||
|
||||
|
@ -1096,6 +1096,28 @@ var Piler =
|
||||
},
|
||||
|
||||
|
||||
fix_ldap_display: function()
|
||||
{
|
||||
if($('#ldap_type').val() == '<?php print LDAP_TYPE_GENERIC; ?>') {
|
||||
$('#ldap_mail_attr_id').show();
|
||||
$('#ldap_account_objectclass_id').show();
|
||||
$('#ldap_distributionlist_attr_id').show();
|
||||
$('#ldap_distributionlist_objectclass_id').show();
|
||||
}
|
||||
else {
|
||||
$('#ldap_mail_attr').val('');
|
||||
$('#ldap_account_objectclass').val('');
|
||||
$('#ldap_distributionlist_attr').val('');
|
||||
$('#ldap_distributionlist_objectclass').val('');
|
||||
|
||||
$('#ldap_mail_attr_id').hide();
|
||||
$('#ldap_account_objectclass_id').hide();
|
||||
$('#ldap_distributionlist_attr_id').hide();
|
||||
$('#ldap_distributionlist_objectclass_id').hide();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
fix_page: function()
|
||||
{
|
||||
<?php if(OUTLOOK == 1) { ?>
|
||||
|
@ -35,7 +35,7 @@
|
||||
<div class="control-group<?php if(isset($errors['ldap_type'])){ print " error"; } ?>">
|
||||
<label class="control-label" for="ldap_type"><?php print $text_ldap_type; ?>:</label>
|
||||
<div class="controls">
|
||||
<select name="ldap_type" id="ldap_type">
|
||||
<select name="ldap_type" id="ldap_type" onchange="Piler.fix_ldap_display();" class="span4">
|
||||
<?php while(list($k, $v) = each($ldap_types)) { ?>
|
||||
<option value="<?php print $v; ?>"<?php if(isset($a['ldap_type']) && $a['ldap_type'] == $v) { ?> selected="selected"<?php } ?>><?php print $v; ?></option>
|
||||
<?php } ?>
|
||||
@ -43,48 +43,78 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group<?php if(isset($errors['description'])){ print " error"; } ?>">
|
||||
<label class="control-label" for="description"><?php print $text_description; ?>:</label>
|
||||
<label class="control-label" for="description"><?php print $text_description; ?>:</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="text" name="description" id="description" placeholder="" value="<?php if(isset($a['description'])) { print $a['description']; } ?>" />
|
||||
<input type="text" class="text span4" name="description" id="description" placeholder="" value="<?php if(isset($a['description'])) { print $a['description']; } ?>" />
|
||||
<?php if ( isset($errors['description']) ) { ?><span class="help-inline"><?php print $errors['description']; ?></span><?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group<?php if(isset($errors['ldap_host'])){ print " error"; } ?>">
|
||||
<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="" value="<?php if(isset($a['ldap_host'])) { print $a['ldap_host']; } ?>" />
|
||||
<input type="text" class="text span4" name="ldap_host" id="ldap_host" placeholder="" value="<?php if(isset($a['ldap_host'])) { print $a['ldap_host']; } ?>" />
|
||||
<?php if ( isset($errors['ldap_host']) ) { ?><span class="help-inline"><?php print $errors['ldap_host']; ?></span><?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group<?php if(isset($errors['ldap_base_dn'])){ print " error"; } ?>">
|
||||
<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="" value="<?php if(isset($a['ldap_base_dn'])) { print $a['ldap_base_dn']; } ?>" />
|
||||
<input type="text" class="text span4" name="ldap_base_dn" id="ldap_base_dn" placeholder="" value="<?php if(isset($a['ldap_base_dn'])) { print $a['ldap_base_dn']; } ?>" />
|
||||
<?php if ( isset($errors['ldap_base_dn']) ) { ?><span class="help-inline"><?php print $errors['ldap_base_dn']; ?></span><?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group<?php if(isset($errors['ldap_bind_dn'])){ print " error"; } ?>">
|
||||
<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="" value="<?php if(isset($a['ldap_bind_dn'])) { print $a['ldap_bind_dn']; } ?>" />
|
||||
<input type="text" class="text span4" name="ldap_bind_dn" id="ldap_bind_dn" placeholder="" value="<?php if(isset($a['ldap_bind_dn'])) { print $a['ldap_bind_dn']; } ?>" />
|
||||
<?php if ( isset($errors['ldap_bind_dn']) ) { ?><span class="help-inline"><?php print $errors['ldap_bind_dn']; ?></span><?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group<?php if(isset($errors['ldap_bind_pw'])){ print " error"; } ?>">
|
||||
<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="" value="<?php if(isset($a['ldap_bind_pw'])) { print $a['ldap_bind_pw']; } ?>" /> <input type="button" value="<?php print $text_test_connection; ?>" class="btn btn-danger" onclick="Piler.test_ldap_connection(); return false;" /> <span id="LDAPTEST"></span>
|
||||
<input type="password" class="password span4" name="ldap_bind_pw" id="ldap_bind_pw" placeholder="" value="<?php if(isset($a['ldap_bind_pw'])) { print $a['ldap_bind_pw']; } ?>" /> <input type="button" value="<?php print $text_test_connection; ?>" class="btn btn-danger" onclick="Piler.test_ldap_connection(); return false;" /> <span id="LDAPTEST"></span>
|
||||
<?php if ( isset($errors['ldap_bind_pw']) ) { ?><span class="help-inline"><?php print $errors['ldap_bind_pw']; ?></span><?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group<?php if(isset($errors['ldap_auditor_member_dn'])){ print " error"; } ?>">
|
||||
<label class="control-label" for="ldap_auditor_member_dn"><?php print $text_ldap_auditor_member_dn; ?>:</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="text" name="ldap_auditor_member_dn" id="ldap_auditor_member_dn" placeholder="" value="<?php if(isset($a['ldap_auditor_member_dn'])) { print $a['ldap_auditor_member_dn']; } ?>" />
|
||||
<input type="text" class="text span4" name="ldap_auditor_member_dn" id="ldap_auditor_member_dn" placeholder="" value="<?php if(isset($a['ldap_auditor_member_dn'])) { print $a['ldap_auditor_member_dn']; } ?>" />
|
||||
<?php if ( isset($errors['ldap_auditor_member_dn']) ) { ?><span class="help-inline"><?php print $errors['ldap_auditor_member_dn']; ?></span><?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="ldap_mail_attr_id" class="ui-helper-hidden control-group<?php if(isset($errors['ldap_mail_attr'])){ print " error"; } ?>">
|
||||
<label class="control-label" for="ldap_mail_attr"></label>
|
||||
<div class="controls">
|
||||
<input type="text" class="text span4" name="ldap_mail_attr" id="ldap_mail_attr" placeholder="LDAP_MAIL_ATTR" value="<?php if(isset($a['ldap_mail_attr'])) { print $a['ldap_mail_attr']; } ?>" />
|
||||
<?php if ( isset($errors['ldap_mail_attr']) ) { ?><span class="help-inline"><?php print $errors['ldap_mail_attr']; ?></span><?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ldap_account_objectclass_id" class="ui-helper-hidden control-group<?php if(isset($errors['ldap_account_objectclass'])){ print " error"; } ?>">
|
||||
<label class="control-label" for="ldap_account_objectclass"></label>
|
||||
<div class="controls">
|
||||
<input type="text" class="text span4" name="ldap_account_objectclass" id="ldap_account_objectclass" placeholder="LDAP_ACCOUNT_OBJECTCLASS" value="<?php if(isset($a['ldap_account_objectclass'])) { print $a['ldap_account_objectclass']; } ?>" />
|
||||
<?php if ( isset($errors['ldap_account_objectclass']) ) { ?><span class="help-inline"><?php print $errors['ldap_account_objectclass']; ?></span><?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ldap_distributionlist_attr_id" class="ui-helper-hidden control-group<?php if(isset($errors['ldap_distributionlist_attr'])){ print " error"; } ?>">
|
||||
<label class="control-label" for="ldap_distributionlist_attr"></label>
|
||||
<div class="controls">
|
||||
<input type="text" class="text span4" name="ldap_distributionlist_attr" id="ldap_distributionlist_attr" placeholder="LDAP_DISTRIBUTIONLIST_ATTR" value="<?php if(isset($a['ldap_distributionlist_attr'])) { print $a['ldap_distributionlist_attr']; } ?>" />
|
||||
<?php if ( isset($errors['ldap_distributionlist_attr']) ) { ?><span class="help-inline"><?php print $errors['ldap_distributionlist_attr']; ?></span><?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ldap_distributionlist_objectclass_id" class="ui-helper-hidden control-group<?php if(isset($errors['ldap_distributionlist_objectclass'])){ print " error"; } ?>">
|
||||
<label class="control-label" for="ldap_distributionlist_objectclass"></label>
|
||||
<div class="controls">
|
||||
<input type="text" class="text span4" name="ldap_distributionlist_objectclass" id="ldap_distributionlist_objectclass" placeholder="LDAP_DISTRIBUTIONLIST_OBJECTCLASS" value="<?php if(isset($a['ldap_distributionlist_objectclass'])) { print $a['ldap_distributionlist_objectclass']; } ?>" />
|
||||
<?php if ( isset($errors['ldap_distributionlist_objectclass']) ) { ?><span class="help-inline"><?php print $errors['ldap_distributionlist_objectclass']; ?></span><?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-actions">
|
||||
<input type="submit" value="<?php if(isset($id) && ($id > 0)) { print $text_modify; } else { print $text_add; } ?>" class="btn btn-primary" />
|
||||
<?php if(isset($id) && ($id > 0)) { ?>
|
||||
@ -96,6 +126,11 @@
|
||||
|
||||
</form>
|
||||
|
||||
<?php if(isset($a['ldap_type']) && $a['ldap_type'] == LDAP_TYPE_GENERIC) { ?>
|
||||
<script>Piler.fix_ldap_display();</script>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php if($id == -1) { ?>
|
||||
|
||||
<h4><?php print $text_existing_entries; ?></h4>
|
||||
@ -109,9 +144,9 @@
|
||||
<th><?php print $text_description; ?></th>
|
||||
<th><?php print $text_ldap_type; ?></th>
|
||||
<th><?php print $text_ldap_host; ?></th>
|
||||
<th><?php print $text_ldap_base_dn; ?></td>
|
||||
<th><?php print $text_ldap_bind_dn; ?></td>
|
||||
<th><?php print $text_ldap_auditor_member_dn; ?></td>
|
||||
<th><?php print $text_ldap_base_dn; ?></th>
|
||||
<th><?php print $text_ldap_bind_dn; ?></th>
|
||||
<th><?php print $text_ldap_auditor_member_dn; ?></th>
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
|
@ -179,6 +179,7 @@
|
||||
|
||||
|
||||
|
||||
.ui-helper-hidden { display: none; }
|
||||
|
||||
.btn-file{position:relative;overflow:hidden;vertical-align:middle;}
|
||||
.btn-file>input{position:absolute;top:0;right:0;margin:0;font-size:23px;cursor:pointer;opacity:0;filter:alpha(opacity=0);transform:translate(-300px, 0) scale(4);direction:ltr;}
|
||||
|
@ -34,7 +34,7 @@
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="ldap_type"><?php print $text_ldap_type; ?>:</label>
|
||||
<div class="controls">
|
||||
<select name="ldap_type" id="ldap_type">
|
||||
<select name="ldap_type" id="ldap_type" onchange="Piler.fix_ldap_display();" class="span4">
|
||||
<?php while(list($k, $v) = each($ldap_types)) { ?>
|
||||
<option value="<?php print $v; ?>"<?php if(isset($a['ldap_type']) && $a['ldap_type'] == $v) { ?> selected="selected"<?php } ?>><?php print $v; ?></option>
|
||||
<?php } ?>
|
||||
@ -42,39 +42,69 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="description"><?php print $text_description; ?>:</label>
|
||||
<label class="control-label" for="description"><?php print $text_description; ?>:</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="text" name="description" id="description" placeholder="" value="<?php if(isset($a['description'])) { print $a['description']; } ?>" />
|
||||
<input type="text" class="text span4" name="description" id="description" placeholder="" value="<?php if(isset($a['description'])) { print $a['description']; } ?>" />
|
||||
</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="" value="<?php if(isset($a['ldap_host'])) { print $a['ldap_host']; } ?>" />
|
||||
<input type="text" class="text span4" name="ldap_host" id="ldap_host" placeholder="" value="<?php if(isset($a['ldap_host'])) { print $a['ldap_host']; } ?>" />
|
||||
</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="" value="<?php if(isset($a['ldap_base_dn'])) { print $a['ldap_base_dn']; } ?>" />
|
||||
<input type="text" class="text span4" name="ldap_base_dn" id="ldap_base_dn" placeholder="" value="<?php if(isset($a['ldap_base_dn'])) { print $a['ldap_base_dn']; } ?>" />
|
||||
</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="" value="<?php if(isset($a['ldap_bind_dn'])) { print $a['ldap_bind_dn']; } ?>" />
|
||||
<input type="text" class="text span4" name="ldap_bind_dn" id="ldap_bind_dn" placeholder="" value="<?php if(isset($a['ldap_bind_dn'])) { print $a['ldap_bind_dn']; } ?>" />
|
||||
</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="" value="<?php if(isset($a['ldap_bind_pw'])) { print $a['ldap_bind_pw']; } ?>" /> <input type="button" value="<?php print $text_test_connection; ?>" class="btn btn-danger" onclick="Piler.test_ldap_connection(); return false;" /> <span id="LDAPTEST"></span>
|
||||
<input type="password" class="password span4" name="ldap_bind_pw" id="ldap_bind_pw" placeholder="" value="<?php if(isset($a['ldap_bind_pw'])) { print $a['ldap_bind_pw']; } ?>" /> <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="control-group">
|
||||
<label class="control-label" for="ldap_auditor_member_dn"><?php print $text_ldap_auditor_member_dn; ?>:</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="text" name="ldap_auditor_member_dn" id="ldap_auditor_member_dn" placeholder="" value="<?php if(isset($a['ldap_auditor_member_dn'])) { print $a['ldap_auditor_member_dn']; } ?>" />
|
||||
<input type="text" class="text span4" name="ldap_auditor_member_dn" id="ldap_auditor_member_dn" placeholder="" value="<?php if(isset($a['ldap_auditor_member_dn'])) { print $a['ldap_auditor_member_dn']; } ?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="ldap_mail_attr_id" class="ui-helper-hidden control-group<?php if(isset($errors['ldap_mail_attr'])){ print " error"; } ?>">
|
||||
<label class="control-label" for="ldap_mail_attr"></label>
|
||||
<div class="controls">
|
||||
<input type="text" class="text span4" name="ldap_mail_attr" id="ldap_mail_attr" placeholder="LDAP_MAIL_ATTR" value="<?php if(isset($a['ldap_mail_attr'])) { print $a['ldap_mail_attr']; } ?>" />
|
||||
<?php if ( isset($errors['ldap_mail_attr']) ) { ?><span class="help-inline"><?php print $errors['ldap_mail_attr']; ?></span><?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ldap_account_objectclass_id" class="ui-helper-hidden control-group<?php if(isset($errors['ldap_account_objectclass'])){ print " error"; } ?>">
|
||||
<label class="control-label" for="ldap_account_objectclass"></label>
|
||||
<div class="controls">
|
||||
<input type="text" class="text span4" name="ldap_account_objectclass" id="ldap_account_objectclass" placeholder="LDAP_ACCOUNT_OBJECTCLASS" value="<?php if(isset($a['ldap_account_objectclass'])) { print $a['ldap_account_objectclass']; } ?>" />
|
||||
<?php if ( isset($errors['ldap_account_objectclass']) ) { ?><span class="help-inline"><?php print $errors['ldap_account_objectclass']; ?></span><?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ldap_distributionlist_attr_id" class="ui-helper-hidden control-group<?php if(isset($errors['ldap_distributionlist_attr'])){ print " error"; } ?>">
|
||||
<label class="control-label" for="ldap_distributionlist_attr"></label>
|
||||
<div class="controls">
|
||||
<input type="text" class="text span4" name="ldap_distributionlist_attr" id="ldap_distributionlist_attr" placeholder="LDAP_DISTRIBUTIONLIST_ATTR" value="<?php if(isset($a['ldap_distributionlist_attr'])) { print $a['ldap_distributionlist_attr']; } ?>" />
|
||||
<?php if ( isset($errors['ldap_distributionlist_attr']) ) { ?><span class="help-inline"><?php print $errors['ldap_distributionlist_attr']; ?></span><?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ldap_distributionlist_objectclass_id" class="ui-helper-hidden control-group<?php if(isset($errors['ldap_distributionlist_objectclass'])){ print " error"; } ?>">
|
||||
<label class="control-label" for="ldap_distributionlist_objectclass"></label>
|
||||
<div class="controls">
|
||||
<input type="text" class="text span4" name="ldap_distributionlist_objectclass" id="ldap_distributionlist_objectclass" placeholder="LDAP_DISTRIBUTIONLIST_OBJECTCLASS" value="<?php if(isset($a['ldap_distributionlist_objectclass'])) { print $a['ldap_distributionlist_objectclass']; } ?>" />
|
||||
<?php if ( isset($errors['ldap_distributionlist_objectclass']) ) { ?><span class="help-inline"><?php print $errors['ldap_distributionlist_objectclass']; ?></span><?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user