XFileSharing Pro - Database payment rows

Message
Author
Ziggy
Posts: 4
Joined: Aug 11, 2012 3:15 pm

Database payment rows

#1 Postby Ziggy » Aug 11, 2012 3:17 pm

Hello, I need to integrate a new payment system. Here is my question. What tables and rows I have to change to give somebody Premium account ?

Greetings.

PowerChaos
Posts: 521
Joined: Dec 19, 2009 5:12 pm

#2 Postby PowerChaos » Aug 11, 2012 4:19 pm

it does not work with database/rows in first place

it works with the script itself and the callback ( payment overview) get stored in the database

you need to edit index.cgi and some other files to be able to get it working

but i can not say what files as i coulnd get it working (need to spend more time on the script to figure out what place i forgot to edit )

Greetings From PowerChaos

Ziggy
Posts: 4
Joined: Aug 11, 2012 3:15 pm

#3 Postby Ziggy » Aug 11, 2012 4:25 pm

Hmm, I thought that I will edit suitable rows in Database using PHP. I can't do this ?

Thanks for your reply.
Greetings.

PowerChaos
Posts: 521
Joined: Dec 19, 2009 5:12 pm

#4 Postby PowerChaos » Aug 11, 2012 4:29 pm

The script is not php based
the script is cgi based

premium members can be edited in the databasee to add premium time if you like

in the database it is the table called user
and there search for the row usr_premium_expire

there you can change the setting to what you like , but you got 1 problem and that is that php will not work in cgi-bin

so you need to create a page outside of the cgi-bin directory like i dit with this youtube script

http://boosterking.com/pages/youtube.html

then it can work the way you like to have it working
else you need to edit the cgi files to get it working

Greetings From PowerChaos

Ziggy
Posts: 4
Joined: Aug 11, 2012 3:15 pm

#5 Postby Ziggy » Aug 11, 2012 4:39 pm

Ok, I have one more problem. How can I get nick of user who is logged now and who just bought premium ?

PowerChaos
Posts: 521
Joined: Dec 19, 2009 5:12 pm

#6 Postby PowerChaos » Aug 11, 2012 4:48 pm

with php ?
that going be a problem

you need to get the sesion from the cgi file to the php file

i got it working with my own cooky , but not sure how you can do that with there sesion

i neeeded to rewrite my proxy script to get custom cookie's to login and get the user sesion , but i got no idea how you should do that with the xfilesharing script

in case of wondering , here is a usefull code to get a cooky from php in cgi , or to get a cooky from cgi in php

php code to set cookie

Code: Select all

setcookie("cookie",1, time()+300);


cgi code to grab cookie

Code: Select all

my $check = new CGI;
my $theCookie = $check->cookie('cookie');


hopely this can help
seems my script works with sesions and i just put the seison into the a cookie so my cgi script can read the cookie as it does not support taking over sesions from php to cgi

Greetings From PowerChaos

Ziggy
Posts: 4
Joined: Aug 11, 2012 3:15 pm

#7 Postby Ziggy » Aug 12, 2012 3:09 pm

Hmm. I saw that xfilesharing script has saved login cookie. I would like to use this, but I have a problem.
For example login name is: "Ziggy"
When I wrote in console: javascript:document.cookie;
it displayed: "lang=polish; login=Ziggy; xfss=...

but when I compare in this way:
if($_COOKIE["login"] == "Ziggy")
echo "It works";

And unfortunatelly it doesn't work (are different) ;/

Does anyone have any idea?

Greetings.

PowerChaos
Posts: 521
Joined: Dec 19, 2009 5:12 pm

#8 Postby PowerChaos » Aug 12, 2012 4:33 pm

maybe try to get the cookie with javascript ?
as you can grab the cookie with the javascript console , so probaly you can also grab it in the file with javascript

doesnt cookie's get encoded with cgi ?
maybe thats why you can not get the cookie

i would suggest to first see what cookie's are set in the header with the following command

Code: Select all

<?php
$cookie=$_COOKIE;
foreach ($cookie as $key=>$val)
echo "<br>$key--> $val";
?>


that part seems to work if you login using php
but i do not get any variable from xfs

more info about cookie's in perl can be found here
http://www.devdaily.com/perl/edu/articles/pl010012

also you can use this page to see what cookie's are set
http://powerglype.com/cgi-bin/test.cgi
http://powerglype.com/12proxy.php

the first link is cgi , checks if cgi finds the cookie ( based on above example link)

The second in the php file based on the example code i provided

Greetings From PowerChaos


Return to “XFileSharing Pro”