Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
midoks committed Feb 2, 2025
1 parent dcb8e69 commit 9e581d8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
9 changes: 9 additions & 0 deletions plugins/ldap/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,13 @@ def submitRedisConf():
reload()
return mw.returnJson(True, '设置成功')

def installPreInspection():
slapd_path = '/etc/ldap/slapd.d'
if not os.path.exists(slapd_path):
return "需要手动执行:apt install -y slapd ldap-utils"
return 'ok'


if __name__ == "__main__":
func = sys.argv[1]
if func == 'status':
Expand All @@ -320,6 +327,8 @@ def submitRedisConf():
print(initdInstall())
elif func == 'initd_uninstall':
print(initdUinstall())
elif func == 'install_pre_inspection':
print(installPreInspection())
elif func == 'run_info':
print(runInfo())
elif func == 'conf':
Expand Down
1 change: 1 addition & 0 deletions plugins/ldap/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"shell": "install.sh",
"versions":["1.0"],
"tip": "soft",
"install_pre_inspection":true,
"checks": "server/ldap",
"path": "server/ldap",
"display": 1,
Expand Down
3 changes: 3 additions & 0 deletions plugins/ldap/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ Install_App()

Uninstall_App()
{
apt remove -y slapd ldap-utils
rm -rf $serverPath/ldap/version.pl
rm -rf $serverPath/ldap
rm -rf /etc/ldap
echo "卸载ldap成功"
}

Expand Down
2 changes: 1 addition & 1 deletion web/templates/default/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
var data = 'username='+username+'&password='+password+'&code='+code;
var loadT = layer.msg("正在登录中...",{icon:16,time:0,shade: [0.3, '#000']});
$.post('/do_login',data,function(rdata){
console.log('do_login',rdata);
// console.log('do_login',rdata);
layer.close(loadT);
if(!rdata.status || rdata.status < 0){
if(username == 'admin' && rdata.msg.indexOf('用户名') != -1){
Expand Down

0 comments on commit 9e581d8

Please sign in to comment.