MyBB Community Forums

Full Version: How do you make a program that logs into the forum
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to make a program that i can log into my forum.

Sort of like
spotify
Horizen
Modio
RSbot

All of these website have a program that logs into their forum.

I know this can take some time to make an will be quite hard
What is goal of this ?
Would you like to describe with more details and give step by step example how you imagine it ?

Also do "i want to make" meant "i know how to code, give me an idea" or "i have idea, could you make it for me" ?

Assuming that you know how to code the process would look like

1. create some php file in your site which your program will call to control your site.
2. this file will receive calls and parameters which then it will be "processed in site context" so you can do everything you want like login user, delete user, return any data, do everything and whatever you want.
3. parameters may be like "cmd" which wil define what you want to do and route to function which have to do this like cmd="login" will execute your login function, cmd="getUsersOnline" will route to function which return count of logedin users ect ect ect. Additionaly if cmd need more parameters you can send them too.
4. in php youll get them simply by $param1 = $_GET['paramName'];
5. very important - you MUST include some protection system within this php file that ensure its-your-program-calling-it and not user trying to manualy input commands. (or you may be very sorry)
6. you can return data to caling program with header("Content-type: text/plain"); die ($yourReturnData);
7. On application side you can simply call your php script in many ways. eg. use URLDownloadToFile function which is within urlmon.dll. So you will URLDownloadToFile,0,"http://yourSite/yourInterface.php?cmd='dosomething'&param1='aaaa'&param2='bbbb'&param3='whatever'",szFileNameWhichReceiveReply,0,0 and youll get contents of your site reply in file (you can find any other similar function or way if you want it directly in memory)
8. if you have something big that exceed lenght of command line (eg. large amount of sql data / binary stuff, ect) your application may send it to FTP and then request by cmd line to process it. (then php should delete it after processed ofcourse)

This guideline is not assumptions nor theory it is actualy part of working methods which i use to interface my sites with my applications so they can interact with each other.

I say it again because its important, if you do this in such way you MUST include some protection mechanism which will ensure that connection is from your application and not manually inserted by someone who discovered your interface link.
If its not verified as send by your application then this interface php file should simply ignore request.

Some simple protection/verification can be for example like this
1. application request from site random key by sending cmd="getRandomKey"
2. site generate random key like "ttryweuyetrhgfsdmnbvxcv", remember it and send as reply.
3. application make some math on this key then add this as parameter to main call cmd="usrLogin"&user="test"&pass="blah"&key="tyyeruityuierytuiyeruiteter"
4. server remember last key send so he do same math on his key and compare with received key, if equal it execute cmd if not then ignore call and discard key
Therefore if someone try to input it manualy it will not work because of key, even if he capture valid command line with key that was send before it will not work twice because key is one time use and is generated every time when new call is made.

ect ect... theres maaaaaany ways to do this.
You just gota master techniques of handling http requests and replies, (and optionally FTP access) from application side,
and 'doing stuff' with mybb and its objects / functions from mybb side.

Quote:quite hard
actually, creating interaction betwin application and site is very easy.
Quite hard may be protecting if from unauthorised access.
I think good idea is limit commands available to normal users application to stuff that cant harm site
(eg. login to own account does not do bad things anyway)
in case someone would be smart enought to pull key routine from his app and make 'own application' with it.