Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: How to send my custom sign-in details through login.php for successful sign-in?  (Read 2862 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.023 seconds with 20 queries.