forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: matheso on February 13, 2015, 05:21:45 am

Title: How to send my custom sign-in details through login.php for successful sign-in?
Post by: matheso on February 13, 2015, 05:21:45 am
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 (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!!
Title: Re: How to send my custom sign-in details through login.php for successful sign-in?
Post by: Αndré on February 13, 2015, 08:30:52 pm
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.