Support » Plugin: External DB authentication » [Plugin: External DB authentication] Integration WordPress and NopCommerce

  • Resolved krimos


    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

                        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>';
                        case "MD5" :
                            echo '<option>SHA1</option><option selected="selected">MD5</option><option>NopCommerce 1.80</option><option>Other</option>';
                        //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>';
    					case "Other" :
                            echo '<option>SHA1</option><option>MD5</option><option>NopCommerce 1.80</option><option selected="selected">Other</option>';
                        default :
                            echo '<option selected="selected">SHA1</option><option>MD5</option><option>NopCommerce 1.80</option><option>Other</option>';

    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) ;

    Thank you Charlene for this plugin 😉

Viewing 1 replies (of 1 total)
  • 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.


Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: External DB authentication] Integration WordPress and NopCommerce’ is closed to new replies.