Advertisement:

Author Topic: cURL login broke after upgrade to 2.0.15  (Read 4445 times)

Offline voidfaction

  • Newbie
  • *
  • Posts: 4
cURL login broke after upgrade to 2.0.15
« on: November 03, 2018, 08:13:05 PM »
My gaming friends use a SMF forum to chat and was using smf 2.0.13 but recently upgraded to 2.0.15 and it breaks my php cURL login I had to help get basic updates without actually going to the site. Prefer my own homepage that receives posts from multiple locations/sites in a format that suits me

with 2.0.13 I could use curl_setopt($ch, CURLOPT_POSTFIELDS, "user=user&passwrd=password&cookielength=-1);
now with 2.0.15 login no longer works.
Did something change that i need to hash the password using the sessionVar and SessionId now or just include the sessionVar/Id to the end of the CURLOPT_POSTFIELDS?

Online vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,557
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: cURL login broke after upgrade to 2.0.15
« Reply #1 on: November 04, 2018, 01:40:33 AM »
yes the session variable is now required in order to login it is now passed and verified.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline voidfaction

  • Newbie
  • *
  • Posts: 4
Re: cURL login broke after upgrade to 2.0.15
« Reply #2 on: November 04, 2018, 03:44:58 AM »
Thank you very much.
Your reply saved me a bit of time and got it working again.
I was working on hash password route in php and hit a wall getting the hash to match what the sha1.js would get. Even though it is now working I am still going to figure out the sha1 for the learning experience.
You have a paypal.me or a way I can give you a tip for your help?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,452
    • StoryBB/StoryBB on GitHub
Re: cURL login broke after upgrade to 2.0.15
« Reply #3 on: November 04, 2018, 04:08:50 AM »
Don’t bother with the SHA1 part, this is going away in SMF 2.1.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline voidfaction

  • Newbie
  • *
  • Posts: 4
Re: cURL login broke after upgrade to 2.0.15
« Reply #4 on: November 04, 2018, 01:44:02 PM »
Good to know thanks. I guess I should probably start playing around with 2.1 beta now to help push my host member to upgrade and be ready for anything it might break with my curl script when it is out of beta. Was a big surprise when he upgraded to 2.0.15 without warning.

My searches for curl help keeps taking me to answers to use ssi.php but as far as i know only works on same domain/server and if it didn't would probably require the host to give me more admin rights than he would probably be comfortable with. As an amature hobby programmer I guess doing things the curl way is a nice learning experience but still has me far away from having my own personal site that shows all my social media and forums in 1 place (Lord of the Websites: One site to view them all) lol. A big plan for an amature hobby programmer that gets scared with anything OOP

Online vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,557
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: cURL login broke after upgrade to 2.0.15
« Reply #5 on: November 04, 2018, 01:49:45 PM »
Example SSI remote function call simplemachines.org/community/SSI.php?ssi_function=recentPosts

If enabled you can pull data in this way.

OOP isn't really needed for most projects. I function find without it and using it when working with certain classes. I tend to find it makes projects more complicated and it is a different way of thinking.

Attached screenshot of my overview of my sites that I manage
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline voidfaction

  • Newbie
  • *
  • Posts: 4
Re: cURL login broke after upgrade to 2.0.15
« Reply #6 on: November 04, 2018, 02:39:51 PM »
Looks like you got plenty to keep you busy. lol
I will definitely look into ssi.php more.
Does the host have to give me more admin rights to be able to use if enabled? He knows I use scripts to scrape data but doubt he would up my admin rights to do it easier with less bandwidth for the both of us (not like our little gaming community is putting a dent on bandwidth usage) but would be nice to have my site much faster using ssi.php than the slow curl way.

Online vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,557
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: cURL login broke after upgrade to 2.0.15
« Reply #7 on: November 04, 2018, 02:42:36 PM »
SSI is normally enabled by default but it can be disabled on the forum.

It is based on your session when connected to SSI as well. If you want to see other data then it would have to be your user that is logged in.
If just want general data that is publicly accessible then SSI would work for that.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro