1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Twitter login project

Discussion in 'Modules / Plugins / Modifications' started by markstanden, Mar 25, 2015.

  1. markstanden Customer

    Hi Guys,

    Seems pretty quiet around here :)

    Ive embarked on a project to integrate a Twitter login system with my 68C website, but have come up against a few problems, which i believe to be session related... Is there anybody who would be interested in helping to complete this project? i have it 90% working but with my limited knowledge of the 68C system ive hit a brick wall..... you can view the website here http://www.ukfollow.com

    I have it talking to the Twitter API ok and you can login ok, but the session problems arise when trying to add a new listing.... without going into to much detail here, if anybody would like to talk further on this please do get in touch... Thanks

    Mark
  2. Mike-N-Tosh Owner

    Can you give some specific examples of what you are referring to? Also are you actually using the 5 year old version 4.1.10 which is also end of life support?
  3. markstanden Customer

    Hi Mike,

    Thanks for replying :) Im using V4.2.5 Developer, ill update my signature :)

    Im trying to integrate a Twitter login process as my website is going to be a directory of Twitter profiles, it makes sense for users to be able to login and register with just one click...with no username and password to remember.

    If you visit the website http://www.ukfollow.com at the top is a Sign in with Twitter button, when it is clicked it does the following

    1./ Calls the Twitter APi and gets the users Twitter ID (unique) and Screen name
    2./ Goes back to the website and updates the users table > if a new user it adds a record and retrieves id > if returning user, gets the id (column 1)
    3./ Creates sessions for username and id (this is where i have problems)

    The problems im having i believe are session related, what i need to know is what sessions are created when a user logs in the normal way?

    Looking at the userindex.php page its creating SESSIONS - logged and uid (i presume uid is the id column in the users table, which is there userid)

    The main problems are

    1./ When you try and modify registration from the useraccountmodify.php - im getting the error below, so the function modifySignup() is causing issues

    Fatal error: Call to a member function modifySignup() on a non-object in /home/ukfol3zr/public_html/useraccountmodify.php on line 202

    2./ Im also getting problems on usercheckout.php, again im missing a session value, it gets to Verify the information and im missing the package details and options, if i click continue im getting - We are sorry but an error occured. Please contact support.

    Im sure if i can sort out the initial sessions these errors will go away!!

    Thanks for any help

    Regards
    Mark
  4. Mike-N-Tosh Owner

    Actually, a session is created when you visit ANY page. Subsequent pages may add data into the existing Session data array.

    This actually sounds more like an issue with how and what you are doing on the callback from the twitter API. If you are simply using the twitter API to enable "login". How are you implementing this feature? Is this a module, smarty plug-in or are you modifying actual core ".php" files?

    Typically getting an error like that means that you don't actually have all of the required classes for the function call. As the useraccountmodify.php file has NO functions in it, that is most likely the issue. The file is simply a go between to call functions in the appropriate class files (e.g. Users.php, Register.php, etc.).

    You might actually be better off simply creating your own custom php file such as twitter.php, have your button/link go to that file on your site. From that file, you call the twitter API and receive the call back. The way you are setup right now, if I click on the login with twitter button, I go to twitter and leave your site, therefore, destroying the session.
  5. markstanden Customer

    Hi Mike,

    Thats what i have done, i have a file twitter_login.php, which does the APi callback, when you click sign in, it has to go to twitter to login, and back again (that all works fine), then it queries my users table to see if you exist or not, then it creates my sessions..

    By the sounds of it im missing a few includes, what files would i have include at the top of my twitter_login.php file??

    Yes, ive been modifying a few core files, just to try and get it working, ill re upload what i have changed and give it another go. PHP has moved on a whole lot since i was last coding

    I could let you have ftp access if you wanted to look at my files :) understand if you don't have time

    Thanks for the info
    Mark
  6. markstanden Customer

    Hi Mike,

    If you have a Twitter account, try logging in....... ill delete your details later on

    Cheers
    Mark
  7. Mike-N-Tosh Owner

    Mark,

    I never heard back from you. Did you get this sorted out?
  8. markstanden Customer

    Hi Mike,

    No i haven't got it sorted yet, cant get round the session problems!! not sure what to do next??

    Cheers
    Mark
  9. Mike-N-Tosh Owner

    Please check your private messages (Conversations)

Share This Page