Advanced search  

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]

Pages: [1]   Go Down

Author Topic: How to send my custom sign-in details through login.php for successful sign-in?  (Read 2863 times)

0 Members and 1 Guest are viewing this topic.

matheso

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 91

My gallery has a custom sign-in form, and I'm trying to send values (email/password) submitted in my custom form, into login.php.

The site is here: http://taskbasket.net/gallery   and the upper-right corner is the Sign-In link. (Sign-up works fine)
When I try to log in, it simply redirects me to login.php, but doesn't apply e-mail/password.

Maybe it's because login.php calls for the username not the email, so do I have to change part of this code in login.php?

Code: [Select]
if ($superCage->post->keyExists('submitted')) {

    if ($USER_DATA = $cpg_udb->login($superCage->post->getEscaped('username'), $superCage->post->getEscaped('password'))) {
        //$referer=preg_replace("'&'","&",$referer);

        // Write the log entry
        if ($CONFIG['log_mode'] == CPG_LOG_ALL) {
            log_write('The user ' . $USER_DATA['user_name'] . ' (user ID ' . $USER_DATA['user_id'] . ") logged in.", CPG_ACCESS_LOG);
        }

        // Set the language preference
        $sql = "UPDATE {$CONFIG['TABLE_USERS']} SET user_language = '{$USER['lang']}' WHERE user_id = {$USER_DATA['user_id']}";
        $result = cpg_db_query($sql);
.....

or something like that? My sign-up link works perfectly because I altered register.php ... but login.php seems different.

Thanks for any help!!
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764

Maybe it's because login.php calls for the username not the email, so do I have to change part of this code in login.php?

Coppermine checks later if login is allowed via user name and/or email address. The form field name remains "username". Make sure that you submit the same parameters as the Coppermine login form via HTTP POST: submitted, username, password, remember_me.
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.