Own user login for own software

Discussion in 'Integration' started by cleerclouds, Oct 11, 2012.

  1. cleerclouds

    cleerclouds Member

    Joined:
    Nov 30, 2011
    Messages:
    42
    Hello,

    in our software there we can add own user, which are not in amember table.
    Is it possible to make an own login for such user in the amember software?

    When yes, how can I do this?

    Many thanks
    Andy
  2. alex

    alex Administrator Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,020
    Hi Andy, it is possible. Existing integration plugins implements it with onAuthTryLogin hook. It does the following - if user enters username/password that is not exists in aMember, but known to be valid for third-party software, a plugin can auto-create user account in aMember and user will instantly authenticated into aMember.

    Please let me know if you need implementation details, or if you need something different.
  3. cleerclouds

    cleerclouds Member

    Joined:
    Nov 30, 2011
    Messages:
    42
    Sounds good, but I only want to login into our software without creating an account in amember itself.
    Is this also possible?

    Many thanks
    Andy
  4. cleerclouds

    cleerclouds Member

    Joined:
    Nov 30, 2011
    Messages:
    42
    Hi,

    I hear nothing since 1 week, but i need this solution.
    Is there a way?

    Many thanks
    Andy
  5. alex

    alex Administrator Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,020
    Sorry, but it is a bit unclear. Could you please explain in details how must all the system work?
  6. cleerclouds

    cleerclouds Member

    Joined:
    Nov 30, 2011
    Messages:
    42
    Hi,

    Ok I try to explain the situation.

    In our system User can create accounts for his worker, but this accounts should not be display in amember.
    So I want to make a seperate login for this worker in amember, which works on my table and not from amember.
    Is this possible?
    If not how would it work with amember and the management of this accounts in amember.

    I hope you understand me now.

    Many thanks
    Andy
  7. alex

    alex Administrator Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,020
    Everything is possible to implement, but it will definitely require customization to aMember Pro source. If you are interested, we can discuss it in the helpdesk.
  8. cleerclouds

    cleerclouds Member

    Joined:
    Nov 30, 2011
    Messages:
    42
    Hi,

    I create now an "Integration Plugin".
    after that I go to "go to aMember Cp -> Setup -> Plugins and enable this plugin".
    After save I got this error message:

    Code:
    exception 'Zend_Session_Exception' with message 'Session must be started before any output has been sent to the browser; output started in /home/mysite/public_html/member/application/default/plugins/protect/cleeruser.php/1' in /home/mysite/public_html/member/library/Zend/Session.php:454 Stack trace: #0 /home/mysite/public_html/member/library/Zend/Session/Namespace.php(143): Zend_Session::start(true) #1 /home/mysite/public_html/member/library/Am/Di.php(249): Zend_Session_Namespace->__construct('amember_auth') #2 /home/mysite/public_html/member/library/sf/sfServiceContainer.php(184): Am_Di->getAuthService() #3 /home/mysite/public_html/member/library/sf/sfServiceContainerBuilder.php(66): sfServiceContainer->getService('auth') #4 /home/mysite/public_html/member/library/Am/Di.php(236): sfServiceContainerBuilder->getService('auth') #5 /home/mysite/public_html/member/library/sf/sfServiceContainer.php(276): Am_Di->getService('auth') #6 /home/mysite/public_html/member/application/default/views/_top.phtml(3): sfServiceContainer->__get('auth') #7 /home/mysite/public_html/member/application/default/views/layout.phtml(27): include('/home/mysite/...') #8 /home/mysite/public_html/member/library/Am/View.php(352): include('/home/mysite/...') #9 /home/mysite/public_html/member/library/Zend/View/Abstract.php(888): Am_View->_run('/home/mysite/...') #10 /home/mysite/public_html/member/library/Am/View.php(326): Zend_View_Abstract->render('error.phtml') #11 /home/mysite/public_html/member/library/Am/App.php(1640): Am_View->display('error.phtml') #12 [internal function]: Am_App->__exception(Object(Zend_Session_Exception)) #13 {main} thrown within the exception handler. Message: Session must be started before any output has been sent to the browser; output started in /home/mysite/public_html/member/application/default/plugins/protect/cleeruser.php/1 on line 454
    Now nowone can login anymore.

    PLEASE HELPPPPPP.

    Many thanks
    Andy
  9. cleerclouds

    cleerclouds Member

    Joined:
    Nov 30, 2011
    Messages:
    42
    I solve it now by delete of this plugin.
    But How can i enable now "Integration Plugin" so that it run?

    Many thanks
    Andy
  10. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
    Andy,
    You get that error because there were unnecessary html code or any other output in your plugin.
    if you can attach your plugin code, I will check what is wrong exactly.
  11. cleerclouds

    cleerclouds Member

    Joined:
    Nov 30, 2011
    Messages:
    42
    Hi,

    here the file.

    Many thanks
    Andy

    Attached Files:

  12. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
    Andy,
    You have one space in first line before <?php tag.
    Remove it and try to enable plugin again.
  13. cleerclouds

    cleerclouds Member

    Joined:
    Nov 30, 2011
    Messages:
    42
    Hi Alex,

    now all run fine, but when I want to login with our test-user amember told me that the login was wrong.

    Must I do something else or make I something wrong?

    Many thanks
    Andy
  14. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
    Andy,
    Not sure I have understood this. Did you try to login using login/password from third-party DB into aMember?
  15. cleerclouds

    cleerclouds Member

    Joined:
    Nov 30, 2011
    Messages:
    42
    Hi Alex,

    yes I try it, because I got the inforamtion that this plugin should give me this option to use my own user/login table.

    Or I am wrong?

    Many thanks
    Andy
  16. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
    Add this method to your plugin class:
    PHP:
    function canAutoCreate(){
    return 
    true
    }
    Then enable autocreate in plugin configuration and test again.
  17. cleerclouds

    cleerclouds Member

    Joined:
    Nov 30, 2011
    Messages:
    42
    Hi Alex,

    I do it and I configure the plugin.

    I enable this
    Remove Users
    when user record removed from aMember
    must the related record be removed from Cleeruser
    and
    Create aMember Users By Demand
    silently create customer in aMember if
    user tries to login into aMember with
    the same username and password as for Cleeruser
    Also the test connection was ok, but I can still not login.


    On the top I got this

    Cleeruser Configuration
    Once the plugin configuration is finished on this page, do not forget to add a record on aMember CP -> Protect Content -> Integrations page
    But the link "aMember CP -> Protect Content -> Integrations" redirect to the same page.
    Make I something wrong?
    Many thanks
    Andy
  18. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
  19. cleerclouds

    cleerclouds Member

    Joined:
    Nov 30, 2011
    Messages:
    42
    Hi Alex,

    when I integrate the cleeruser plugin I got a configuration site for this cleeruser plugin.
    And on this configuration site I got this infos.

    I hope you understand now.

    Many thanks.
    Andy
  20. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
    Andy,
    Sorruy still not clear enough. Please post a screenshot of aMember CP -> Protect Content -> Integrations -> New Record page.

Share This Page