LDAP restricting some users

Issue #556 resolved
Micky Arter created an issue

Hi, We are just in the phase of Testing piler to use as our company's archiving solution. We have configured LDAP authentication and this is working well. However we have had a request from management that some users need to be Prevented from logging in to mailpiler ( is it possible to prevent a group users logging in via LDAP and if so can you please guide me to how this can be achieved.

Thanks

Micky

Comments (8)

  1. Janos SUTO repo owner

    By default the gui doesn't restrict a valid user to log in. However a custom authentication hook is possible. To enable it add the following to config-site.php. The idea is to destroy his session data thus preventing him to login. I'll revise it tomorrow in case it doesn't work.

    $config['CUSTOM_EMAIL_QUERY_FUNCTION'] = 'akakaak';
    
    function akakaak($username = '') {
       $session = Registry::get('session');
    
       if(username == 'you@are.not.welcome.com')  {
          $session->set("auth_data", array());
       }
    }
    
  2. Micky Arter reporter

    I have tried this but cannot seem to get this working. I am not very experienced with PHP but understand what we are trying to achieve.

  3. Janos SUTO repo owner

    OK, can we arrange a remote session via team viewer? Then I'd edit then custom function based on real data.

  4. Micky Arter reporter

    Hi,

    I am happy to arrange for you to be able to access our system. We are in between 9 and 5:30 BST (GMT+1) Please PM me suitable time and date and I shall get you connected. If the time need to be later in the day I can arrange to stay late.

    Regards

    Micky

  5. Micky Arter reporter

    That sound good to me I will PM you with the connection ID and password in the morning.

    Thanks

    Micky

  6. Micky Arter reporter

    Thank you for your time this morning. Please find the files as requested.

    Thanks

    Micky

  7. Log in to comment