How to send my custom sign-in details through login.php for successful sign-in? How to send my custom sign-in details through login.php for successful sign-in?
 

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

Main Menu

How to send my custom sign-in details through login.php for successful sign-in?

Started by matheso, February 13, 2015, 05:21:45 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

matheso

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?


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!!

ΑndrĂ©

Quote from: matheso on February 13, 2015, 05:21:45 AM
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.