forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: skullz on August 17, 2007, 11:23:58 pm

Title: (Simple) How to integrate login form into your website using only forms
Post by: skullz on August 17, 2007, 11:23:58 pm
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;
Code: [Select]
                    <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...
Title: Re: (Simple) How to integrate login form into your website using only forms
Post by: chris.h on September 05, 2007, 01:32:31 pm
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...

Code: [Select]
<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
Title: Re: (Simple) How to integrate login form into your website using only forms
Post by: Joachim Müller on September 05, 2007, 01:58:26 pm
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.
Title: Re: (Simple) How to integrate login form into your website using only forms
Post by: chris.h on September 27, 2007, 11:58:12 am
After installing this I found this thread, which offed a much better solution for myself...

http://forum.coppermine-gallery.net/index.php?topic=37311.0

 ;D