WordPress.org

Ready to get started?Download WordPress

Forums

External DB authentication
[resolved] Integration WordPress and NopCommerce (2 posts)

  1. krimos
    Member
    Posted 3 years ago #

    I have updated the plugin script to fix :
    1) MS SQL Server query bug
    2) Support NopCommerce Encryption.

    Here is my changes :

    Line 176 // Add NopCommerce 1.80 Encryption option

    <?php
                        switch(get_option('ext_db_enc')) {
                        case "SHA1" :
                            echo '<option selected="selected">SHA1</option><option>MD5</option><option>NopCommerce 1.80</option><option>Other</option>';
                            break;
                        case "MD5" :
                            echo '<option>SHA1</option><option selected="selected">MD5</option><option>NopCommerce 1.80</option><option>Other</option>';
                            break;
                        //START Support for NopCommerce 1.80
    					case "NopCommerce 1.80":
    						echo '<option>SHA1</option><option>MD5</option><option selected="selected">NopCommerce 1.80</option><option>Other</option>';
                            break;
    					//END
    					case "Other" :
                            echo '<option>SHA1</option><option>MD5</option><option>NopCommerce 1.80</option><option selected="selected">Other</option>';
                            break;
                        default :
                            echo '<option selected="selected">SHA1</option><option>MD5</option><option>NopCommerce 1.80</option><option>Other</option>';
                            break;
                        }
                    ?>

    Line 369 // Add the password hash for NopCommerce comparing password

    //START Support for NopCommerce 1.80
    		case "NopCommerce 1.80" :
    			// Hashing Password for the NopCOmmerce Store
    			$sqlSaltKeyfield = 'SaltKey' ;
    			$query = "SELECT [$sqlSaltKeyfield] FROM " . get_option('ext_db_table') . " WHERE ".get_option('ext_db_namefield')." = '$username'";
    			$result = db_functions($driver,"query",$resource,$query);
    			$numrows = db_functions($driver,"numrows",$result,"");
    			if ($numrows == 1)
    			{
    				$SaltKey = db_functions($driver,"fetch",$result,"");
    				$SaltKey = $SaltKey[strtolower($sqlSaltKeyfield)];
    
    				$nopcryptedpassword = sha1($password.$SaltKey);
    			}
    			$password2 = strtoupper($nopcryptedpassword) ;
    			break;
    		//END

    Thank you Charlene for this plugin ;)

  2. f.freckle
    Member
    Posted 3 years ago #

    Krimos,

    Thanks for the post. I will use this to integrate with my Django application which also stores a salted, sha1 password. As a temporary work around, I stored a simple sha1 password in my external db to prove that I could authenticate with this plugin. Although I appear to succeed in matching user and password, I am seeing a warning that suggests that the auth cookies cannot be correctly set. I have not made any changes to the plugin source. Have you seen anything like this?

    Warning: Cannot modify header information - headers already sent by (output started at /usr/share/wordpress/wp-content/plugins/ext_db_auth.php:436) in /usr/share/wordpress/wp-includes/pluggable.php on line 649

    Thanks in advance for any help you can provide.

    -Bob

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic