Announcement

Collapse
No announcement yet.

LDAP problem!!

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • LDAP problem!!

    Hello, i really hope you can help me!

    i create my security module for LDAP connection, to make a successfull connection i have to add our domain before the user (domain\user), and only like that the connection was successfull.

    Now when i tried to loggin every user send me a message that the user is not activated, even when it is!.
    In the table sec_users the column "active" = Y , i cannot make the log not even when the user who make the connection.

    another question, i need to upload to the database all the users? i though that when a new user log in the application will insert it on the database.

    Thank you for your help!!

  • #2
    You have to make a choice in how you want the security to act. We use ldap just for user authentication, but the rights within sc are maintained by the default security. In fact, we generated the standard security modules and changed the login code to use our own ldap. In fact that is only a few lines of code.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      I want the security manage the access on the application because some of it are validations that the normal users cant perform.

      But i understand what you are saying, i have generated both the default security and the LDAP security with total control if i well understand you, i should create an LDAP with only authentication and linked to the default security?

      Sorry im not an expert on php, actually this is kind of new for me.

      Thank you for your help.

      Comment


      • #4
        We have implemented LDAP a long time ago and we haven't been looking into the current LDAP implementation. Cause is that all our corporate systems use a security model of their own. The only thing our university wants is a single-sign-on. Therefore we use LDAP to check if the user is a valid employee or student and then use the scriptcase security model. The only thing to change is the user logon where we don't test the usertable for id and password, but use ldap for it.
        Albert Drent
        aducom software netherlands
        scriptcase partner, reseller, support and (turn-key) development
        www.scriptcase.eu / www.scriptcase.nl

        Comment


        • #5
          did you insert the user in some table?.

          I not only need the user login, also need some data of AD like the complete name of the user, email and area. this information is used in some reports of the application.
          right now i made the simple login application only to authentication.

          But i dont know how save this information on the database.

          Comment


          • #6
            With the default ldap statements available in your php environment you can do anything you like with your ldap environment within the restrictions of access of course. You need to feed your sc system with the primary user id to allow SC to function with it's own security model. If you generate a security module then all necessary is generated to insert new users etc. ONly the registration page is not needed (as users are in your ldap obviously) and the logon procedure using the database needs to be changed to your ldap call.
            Albert Drent
            aducom software netherlands
            scriptcase partner, reseller, support and (turn-key) development
            www.scriptcase.eu / www.scriptcase.nl

            Comment


            • #7
              sorry im to new in this, could you explain me step by step what to do.

              Right now i have generated a security module of groups, and an LDAP conecction only to authentificate, but neither of them insert the user on the table.

              Please im lost!

              Comment


              • #8
                Originally posted by steph07 View Post
                sorry im to new in this, could you explain me step by step what to do.

                Right now i have generated a security module of groups, and an LDAP conecction only to authentificate, but neither of them insert the user on the table.

                Please im lost!
                No, but on the logon page there's a link to add a user. Look into that module and you see what you need to do. It's not logical that you would add a user after logon ;-)
                But to be honest, I don't quite see where your problem is. Just look into the generated security applications and you will find the app that is adding users...
                Albert Drent
                aducom software netherlands
                scriptcase partner, reseller, support and (turn-key) development
                www.scriptcase.eu / www.scriptcase.nl

                Comment


                • #9
                  Yes, i see the application to add users, but i dont want someone need to use it every time a new user came.

                  What i want is the login with LDAP authentication and after the login successfull insert the user information on a table automatically.

                  I tried in the event OnValidateSuccessfull put the insert using global variables of session but dont send me any errors and dont insert the information.
                  Last edited by steph07; 09-11-2015, 10:36 AM.

                  Comment


                  • #10
                    This is the code i used on the event

                    PHP Code:
                    $arr_users = array();
                    $str_sql "SELECT login FROM sec_users WHERE login = []";
                    $user = [usr_login];
                    $mail = [usr_email];
                    $name = [usr_name];

                    sc_select(rs$str_sql);

                    if({
                    rs} !== FALSE)
                    {
                        while(!
                    $rs->EOF)
                        {
                            
                    $arr_users$rs->fields[0] ] = $rs->fields[0];
                            
                    $rs->MoveNext();
                        }
                        
                    $rs->Close();
                    }
                    else
                    {
                    /**
                     * Insert a record on another table
                     */

                    // SQL statement parameters
                    $insert_table  'sec_users';      // Table name
                    $insert_fields = array(   // Field list, add as many as needed
                         
                    'login' => [usr_login],
                         
                    'name' => [usr_name],
                         
                    'email' => [usr_email],
                         
                    'active' => "'Y'"
                     
                    );

                    // Insert record
                    $insert_sql 'INSERT INTO ' $insert_table
                        
                    ' ('   implode(', 'array_keys($insert_fields))   . ')'
                        
                    ' VALUES ('    implode(', 'array_values($insert_fields)) . ')';

                    sc_exec_sql($insert_sql);

                    Comment

                    Working...
                    X