在index.php/admin上使用Apache LDAP身份验证
我正试图找到一个解决方案,为我的LimeSurvey 2.0安装设置第一阶段LDAP身份验证。现在我面临的问题是,我只能指定应该得到保护的目录,但是LimeSurvey使用index.php/admin作为管理接口。是否有可能从我的vhost.conf中为这个确切的文件指定下面的代码+“/admin”?或者你知道更好的解决办法吗。如果有人能帮我就好了 已经非常感谢了在index.php/admin上使用Apache LDAP身份验证,php,linux,apache,ldap,limesurvey,Php,Linux,Apache,Ldap,Limesurvey,我正试图找到一个解决方案,为我的LimeSurvey 2.0安装设置第一阶段LDAP身份验证。现在我面临的问题是,我只能指定应该得到保护的目录,但是LimeSurvey使用index.php/admin作为管理接口。是否有可能从我的vhost.conf中为这个确切的文件指定下面的代码+“/admin”?或者你知道更好的解决办法吗。如果有人能帮我就好了 已经非常感谢了 <Directory /> AuthLDAPUrl ldap://ldap.mydomain.com
<Directory />
AuthLDAPUrl ldap://ldap.mydomain.com
/ou=users,[...]
AuthLDAPBindDN [...]
AuthLDAPBindPassword [...]
AuthBasicProvider ldap
AuthType Basic
AuthName [...]
Require valid-user
[...]
Satisfy any
</Directory>
AuthLDAPUrlldap://ldap.mydomain.com
/ou=用户,[…]
AuthLDAPBindDN[…]
AuthLDAPBindPassword[…]
AuthBasicProvider ldap
AuthType Basic
AuthName[…]
需要有效用户
[...]
满足任何
为什么不将apache basic auth与PHP LDAP系统相结合
<?php
// Check username and password:
if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])){
//store user
$Username = $_SERVER['PHP_AUTH_USER'];
//store password
$Password = $_SERVER['PHP_AUTH_PW'];
//Here the LDAP auth should be in place. $ldap is the ldap connection protocol object
if ($ldap->doAuth($Username,$Password)) {
//perform XML data output, based on $ldap->userinformation
} else {
// The text inside the realm section will be visible for the
// user in the login box
header('WWW-Authenticate: Basic realm="Mobile Feed"');
header('HTTP/1.0 401 Unauthorized');
echo '<?xml version="1.0" encoding="UTF-8"?>
<x protocolversion="1" lang="nl">
<x code="1">fail</fout>
</x>
';
}
}
?>
用户信息
}否则{
//领域部分中的文本将在
//登录框中的用户
标题('WWW-Authenticate:Basic realm=“Mobile Feed”);
标题(“HTTP/1.0 401未经授权”);
回声'
失败
';
}
}
?>
并将其与以下库相结合:
上面的库有一个名为protectsinglepage.php的include。您可以将其包含在主项目中。对于管理系统,只需省略它,这样它就不会受到LDAP的保护。一个可能的解决方案是通过编辑使LimeSurvey在URL中没有index.php /application/config/config.php 和背景
'showScriptName' => false,
这样,URL看起来更像
http://yourdomain/limesurvey/admin/authentication/sa/login
LDAP可能会起作用。祝你好运,朋友,请随便留言!