dpvhv66448 2016-11-16 09:24
浏览 35

我有这个ldap代码,我只希望来自特定组(cn)的用户能够登录

Here is my code

    if ($bind) {
        $_SESSION['user'] = $username['username'];
        header("Location: /Login/Homepage.php");

        //@ldap_close($ldap);
    }else {
   $errMSG = "Wrong Credentials, Try again...";
  }

can you please help me what to add in my code to only let users from a specific group (cn) to access the homepage. thanks!

  • 写回答

1条回答 默认 最新

  • doutuichan2681 2016-11-16 13:49
    关注

    You are not doing anything with the result (exept of sorting which you shouldn't use ldap_sort for anymore). You have a result-handle in $result and that's it… Perhaps you should check out https://gist.github.com/heiglandreas/5689592 and see whether that helps you a bit more.

    评论

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号