Skip to content

Commit

Permalink
* Convert LDAP port to string.
Browse files Browse the repository at this point in the history
  • Loading branch information
wangjianhua committed Oct 21, 2022
1 parent 474f909 commit 45c8d2d
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 6 deletions.
9 changes: 9 additions & 0 deletions frontend/module/system/js/editldap.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ $(function()
settings.bindDN = $('input[name="extra[bindDN]"]').val();
settings.bindPass = $('input[name="extra[bindPass]"]').val();
settings.baseDN = $('input[name="extra[baseDN]"]').val();
if(!settings.host || !settings.port || !settings.bindDN || !settings.bindPass || !settings.baseDN)
{
bootbox.alert(
{
title: notices.attention,
message: notices.fillAllRequiredFields,
});
return;
}

$.post(createLink('system', 'testLDAPConnection'), settings).done(function(response)
{
Expand Down
9 changes: 9 additions & 0 deletions frontend/module/system/js/installldap.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ $(function()
settings.bindDN = $('input[name="extra[bindDN]"]').val();
settings.bindPass = $('input[name="extra[bindPass]"]').val();
settings.baseDN = $('input[name="extra[baseDN]"]').val();
if(!settings.host || !settings.port || !settings.bindDN || !settings.bindPass || !settings.baseDN)
{
bootbox.alert(
{
title: notices.attention,
message: notices.fillAllRequiredFields,
});
return;
}

$.post(createLink('system', 'testLDAPConnection'), settings).done(function(response)
{
Expand Down
12 changes: 7 additions & 5 deletions frontend/module/system/lang/zh-cn.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@
$lang->system->ldapTypeList['extra'] = '外部映射';

$lang->system->notices = new stdclass;
$lang->system->notices->noLDAP = '找不到LDAP配置数据';
$lang->system->notices->ldapUsed = '已经有服务关联了LDAP';
$lang->system->notices->ldapInstallSuccess = 'LDAP安装成功';
$lang->system->notices->ldapUpdateSuccess = 'LDAP更新成功';
$lang->system->notices->verifyLDAPSuccess = '校验LDAP成功!';
$lang->system->notices->attention = '注意';
$lang->system->notices->noLDAP = '找不到LDAP配置数据';
$lang->system->notices->ldapUsed = '已经有服务关联了LDAP';
$lang->system->notices->ldapInstallSuccess = 'LDAP安装成功';
$lang->system->notices->ldapUpdateSuccess = 'LDAP更新成功';
$lang->system->notices->verifyLDAPSuccess = '校验LDAP成功!';
$lang->system->notices->fillAllRequiredFields = '请填写全部必填项!';

$lang->system->errors = new stdclass;
$lang->system->errors->notFoundDB = '找不到该数据库';
Expand Down
2 changes: 1 addition & 1 deletion frontend/module/system/model.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function installExtraLDAP($settings, $action='install')
$snippetSettings->values->auth->ldap->enabled = true;
$snippetSettings->values->auth->ldap->type = 'ldap';
$snippetSettings->values->auth->ldap->host = $settings->host;
$snippetSettings->values->auth->ldap->port = intval($settings->port);
$snippetSettings->values->auth->ldap->port = strval($settings->port);
$snippetSettings->values->auth->ldap->bindDN = "cn={$settings->bindDN},{$settings->baseDN}";
$snippetSettings->values->auth->ldap->bindPass = $settings->bindPass;
$snippetSettings->values->auth->ldap->baseDN = $settings->baseDN;
Expand Down
1 change: 1 addition & 0 deletions frontend/module/system/view/editldap.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
<?php $ldapLinked = $this->loadModel('instance')->countLDAP();?>
<?php js::set('errors', $lang->system->errors);?>
<?php js::set('notices', $lang->system->notices);?>
<?php js::set('disableEdit', ($ldapLinked ? true : false));?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
Expand Down
1 change: 1 addition & 0 deletions frontend/module/system/view/installldap.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
<?php $ldapLinked = $this->loadModel('instance')->countLDAP();?>
<?php js::set('errors', $lang->system->errors);?>
<?php js::set('notices', $lang->system->notices);?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<?php echo html::a($this->createLink('system', 'index'), "<i class='icon icon-back icon-sm'></i>" . $lang->goback, '', "class='btn btn-secondary'");?>
Expand Down

0 comments on commit 45c8d2d

Please sign in to comment.