(Simple) How to integrate login form into your website using only forms (Simple) How to integrate login form into your website using only forms
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

(Simple) How to integrate login form into your website using only forms

Started by skullz, August 17, 2007, 11:23:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

skullz

OK, so I kept trying to find out how I could integrate login process of coppermine into my website without installing mods, plugins etc... allowing me to do so.

here is what I came up with...

when you click login on your gallery you can view the source and hunt for the login box form and stuff...

to get things to work with your website ( not gallery but your root site or where ever you want to display it on.... )

it goes something like;
                    <form action="login.php?referer=index.php" method="post" name="loginbox">
<!-- Start standard table -->
<table align="center" width="600" cellspacing="1" cellpadding="0" class="maintable">
        <tr>
                <td class="tableh1" colspan="2">Enter your username and password to login</td>
        </tr>
                 
                 
                  <tr>
                        <td class="tableb" width="40%">Username</td>

                        <td class="tableb" width="60%"><input type="text" class="textinput" name="username" style="width: 100%" tabindex="1" /></td>
                  </tr>
                  <tr>
                          <td class="tableb">Password</td>
                        <td class="tableb"><input type="password" class="textinput" name="password" style="width: 100%" tabindex="2" /></td>
                  </tr>
                  <tr>
                    <td colspan="2" align="center" class="tableb">Remember me <input name="remember_me" type="checkbox" class="checkbox" value="1" tabindex="3" /></td>

                  </tr>
                  <tr>
                    <td align="center" class="tablef"><a href="forgot_passwd.php" class="topmenu">I forgot my password</a></td>
                    <td align="left" class="tablef"><input name="submitted" type="submit" class="button" value="Login" tabindex="4" /></td>
                  </tr>
</table>
<!-- End standard table -->

</form>


The above code isn't modified part... this is the one that login form uses within coppermine gallery itself..^


here is what I did to include it into my main site;

<form action="[folder you installed coppermine to goes here]/login.php?referer=index.php" method="post" name="loginbox"><input type="text" class="textinput" name="username" size="13" />
  <input type="password" class="textinput" name="password" size="13" />
  <input name="submitted" type="submit" class="button" value="Login" />
            </center></td>
</form>

You can add or modify it as you see fit, I've yet to find out how captcha works, once I find that out I may try to implement it as well...
Then find a way to output if you are logged in already or not on the main site...

chris.h

Works a treat!

Many thnakd for this, was searching for anoter problem but this was something I wanted to do also.

Did notice theres some code form a table in the script that most people might not need, I think it should read...

<form action="login.php?referer=index.php" method="post" name="loginbox"><input type="text" class="textinput" name="username" size="13" />
  <input type="password" class="textinput" name="password" size="13" />
  <input name="submitted" type="submit" class="button" value="Login" />           
</form>


Thanks

Joachim Müller

1) Not related to bridging
2) How to come up with a custom login form on non-coppermine-driven pages has been discussed many times over
3) Main drawback: the login form will display even if the user is already logged in. Not recommended.

Moving from bridging sub-board.

chris.h