Support > cpg1.5 bridging
Login via POST
blueshack:
Hi
When I strip down the loginpage to
--- Code: ---<form action="login.php?" method="post">
<!-- Start standard table -->
<table>
<tr>
<td><input type="text" name="username" /></td>
</tr>
<tr>
<td><input type="password" name="password" /></td>
</tr>
<tr>
<td >
<button type="submit" name="submitted" value="OK" >OK</button>
</td>
</tr>
</table>
</form>
--- End code ---
put this as a new html file on the server, call this file,
fill in my username, pwd, send ->
everything works fine.
I can go to the login.php and see, I'm logged in!
But when I try the same with cURL
--- Code: ---$url = 'http://my_domain/_coppermine/login.php?referer=index.php';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, array('username' => 'user', 'password' => 'somePWD','submitted' => 'OK'));
$response = curl_exec($ch);
curl_close($ch);
--- End code ---
It dosn't work.
If I catch the $_POST response in the login.php file both request bring the same $_POST-array
So the login should work, but it does not.
What did I miss?
Thank you
gmc:
Not really a Coppermine issue - but I have played with CURL a bit for other uses...
--- Quote ---It dosn't work.
--- End quote ---
A little more information is needed to be able to help though...
Where are you expecting the output to go?
By default the response is output...
If you want the response assigned to the variable $response - you need to set CURLOPT_RETURNTRANSFER to TRUE
If that isn't the issue, what messages/status codes are returned?
Inserting this after your curl_exec will get the status code... 200 is normal.
--- Code: ---$status = curl_getinfo($request, CURLINFO_HTTP_CODE);
--- End code ---
One or more of these curl options may help debug:
--- Code: ---CURLOPT_FAILONERROR
CURLOPT_VERBOSE (you can route the output with CURLOPT_STDERR
--- End code ---
blueshack:
Thank you GMC
I will insert your code an post the debug messages.
The whole idea behind that is, to login (only login) from a foreign software to use the gallery with the same user.
So I just started to test how I could 'remote' login.
The usersync is a seperate thing ( in fact it is allready working)
what I have found ist something like tunelling
I will also look at this possibility. ( http://forum.coppermine-gallery.net/index.php/topic,76302.0.html )
thank you,
andi
gmc:
Don't know which software you're using...
In addition ti the 'tunnel' plugin, CPG supports 'bridging' - where it uses the user (and optionally group) information from the other software package...
Forums like and mybb are supported... And you can always write your own bridge script following the examples of the existing scripts.
If that helps...
blueshack:
Thank you, thats a big help!
could you please give a short link for the eample?
I've looked arround a lot, but there so many examples, mostly no working ;) arround there.
Some of them seem to be old...
What I'm realy looking for is to bridge joomla, but I found no simple solution, which works with joomla3.
So I thought, it should be possible just to login remote ;) - and that could be used for every foreign software. So......
lets see, if we will get it backed.
thank you, andi
Navigation
[0] Message Index
[#] Next page
Go to full version