Jump to content

Recommended Posts

The code change should probably be made in create_account.php and/or checkout_process.php, depending on the ban level. In the checkout_process.php, where there is code like this

if ($blacklisted['entry_street_address'] === $order->delivery['street_address'] &&

it would need to be changed to something that would check the various parts. For example (this is just being typed here and may not work)

$streetBL = explode($blacklisted' ',['entry_street_address']);
$street = expload(' ', $order->delivery['street_address']);
$notBL = false;
for ($i - 0; $i < count($streetBL); ++$i)
{
if (strpos($streetBL[$i], $street[$i]) === FALSE)  //no match was found 
{
  $notBL = true;			
  break;
}
}

if ($notBL)
echo 'This customer is OK';
else
echo 'This customer should be blacklisted.';

The other parts would have to be checked too.

 

Jack

Share this post


Link to post
Share on other sites

here is what i tried:

$streetBL = explode($blacklisted['entry_street_address']);

$street = explode(' ', $order->delivery['street_address']);

$notBL = false;

for ($i - 0; $i < count($streetBL); ++$i)

{

if (strpos($streetBL[$i], $street[$i]) === FALSE) //no match was found

{

$notBL = true;

break;

}

}

 

if ($notBL){

#this customer is OK

}else{

tep_redirect(index.php);

break;

}

it seemed to work, but it interpreted everyone as blacklisted. can you spot my errors?

 

(i was getting an error for:

$streetBL = explode($blacklisted' ',['entry_street_address']);

..so i moved things around. not sure if my edits there is what may have messed it up.)

Share this post


Link to post
Share on other sites

That should have been

$streetBL = explode("",$blacklisted['entry_street_address']);

 

Jack

Share this post


Link to post
Share on other sites

still interpreting everybody as blacklisted. any other bugs?:

$streetBL = explode("",$blacklisted['entry_street_address']);
$street = explode(' ', $order->delivery['street_address']);
$notBL = false;
for ($i - 0; $i < count($streetBL); ++$i)
{
if (strpos($streetBL[$i], $street[$i]) === FALSE) //no match was found
{
$notBL = true;
break;
}
}

if ($notBL){
#this customer is OK
}else{
tep_redirect(index.php);
break;
}

Share this post


Link to post
Share on other sites

You will have to print out each result in the loop to see why it is failing. The code will most liekly not work correctly as it is anyway though since it is assuming the addresses contain the same number of items, which they won't in every case. So one address might 123 Apple and another might be 234 Pear Apt C.

 

Jack

Share this post


Link to post
Share on other sites

Hi, i know this thread is old.

 

How can I input a search-function into the blacklist, that allows me to search a customer in the shop.

My plan: I whrite a Lastname into a textfield, after I klicked a button, the names listed in the dropdown menü.

 

is it possible?

Share this post


Link to post
Share on other sites

I don't understand what it is you are asking for. There is already a list of names in the Blacklist section in admin. Is that not what you want?

Share this post


Link to post
Share on other sites

I know, sure i want this

 

but I need a searchfunction for customers, i want to insert an extra field into the blacklist like a textfield or simething, that searching for customer wich I wrote in this textfield, and show him in the Drop down menu.

 

sry for that english ._.

Share this post


Link to post
Share on other sites

I'm sorry but I'm still not following. But it doesn't matter since what you are asking for is new code, which I don't provide in support threads due to the amount of time it would take.

Share this post


Link to post
Share on other sites

Hi Jack!

 

Installed your contrib as it looks very useful. Didn't know if I missed a lang file or update? I checked in your admin/incl/lang/eng/blacklist.php and couldn't find theme.

 

(In the Admin Blacklist Controllers Screen) all language is defined correctly except:

 

TEXT_INFO_DATE_BAN05/18/2011

 

TEXT_INFO_DATE_BAN_MEMBER

 

 

Thanks Jack, hope all has been going well w you and your family :)

 

KJ


define('PROJECTS', 'Something that goes on forever!');

Share this post


Link to post
Share on other sites

*Plus*

1) Any reason why I have a name on the banned list twice? I looked and the customer only has one acct setup.

2) (in the Banned customer right side box) "Attempted Use: (If checked, trying to connect)" does not seem to work for me. If checked it won't stay. Also shouldn't this be on the other side when you create the banned person. (ie) you may only want to be notified if the person tries to login but not ban him?

 

I edited the lang file to define the above...

TEXT_INFO_DATE_BAN05/18/2011

TEXT_INFO_DATE_BAN_MEMBER

 

define('TEXT_INFO_DATE_BAN', 'Date: ');

define('TEXT_INFO_DATE_BAN_MEMBER', 'Date Banned: ');

 

^^ But not sure on you verbiage you wanted ^^

Thanks Jack :)

Edited by Top_Speed

define('PROJECTS', 'Something that goes on forever!');

Share this post


Link to post
Share on other sites

*Plus*

1) Any reason why I have a name on the banned list twice? I looked and the customer only has one acct setup.

2) (in the Banned customer right side box) "Attempted Use: (If checked, trying to connect)" does not seem to work for me. If checked it won't stay. Also shouldn't this be on the other side when you create the banned person. (ie) you may only want to be notified if the person tries to login but not ban him?

 

I edited the lang file to define the above...

TEXT_INFO_DATE_BAN05/18/2011

TEXT_INFO_DATE_BAN_MEMBER

 

define('TEXT_INFO_DATE_BAN', 'Date: ');

define('TEXT_INFO_DATE_BAN_MEMBER', 'Date Banned: ');

 

^^ But not sure on you verbiage you wanted ^^

Thanks Jack :)

I haven't upgraded this conribution is six years so there are problably problems such as you found. It still works though and I do have plans to upgrade it but I can't seem to find the time for it rihgt now.

Share this post


Link to post
Share on other sites

 

 

1) Any reason why I have a name on the banned list twice? I looked and the customer only has one acct setup.

 

I've recently installed this in my 2.3.1, and also noticed the multiple appearances of the same name.  It's because of multiple address book entries for the customer.  It really threw me at first, because I'd entered some customers' addresses as my own for testing.  I couldn't figure out where it was getting them, until I looked closer.

 

I know the thread is old, but someone (such as myself) may also run into this.

Share this post


Link to post
Share on other sites

Thanks for posting that. Yes, the entries from the address book table are added to the ban list and that would generate duplicate names. There probably should be something added to show they are different addresses for the same person.

Share this post


Link to post
Share on other sites

A new version has been uploaded with these changes:

  •  
  • Now compatible with all 2.3 shops.
  • Changed many aspects of the GUI.
  • Fixed a problem where customers with three or more names failed.
  • Fixed problem where comments would not show up when blacklisting a customer if he were the frist customer.
  • Added Index to SQL table.

Share this post


Link to post
Share on other sites

@@Jack_mcs

 

Just got the new version up and running and 3+ part names works beautifully.  I have one minor(?) problem:  Once you add someone to the ban list, their name no longer appears in the "all customers" list.

 

If I blacklist, but do not ban completely, and later decide to ban completely, I have to remove them from the 'blacklist' before I can edit their status.  

 

I changed the query from :

 

  $customers_query = tep_db_query("SELECT customers_id, customers_lastname FROM customers where customers_id NOT IN (select customers_id from blacklist) ORDER by " . $sort_order . " ASC");
 
to:
 
  $customers_query = tep_db_query("SELECT customers_id, customers_lastname FROM customers ORDER by " . $sort_order . " ASC");
 
It appears to work this way, but I wanted to make sure this wouldn't cause a problem I'm not immediately seeing...?
 

Share this post


Link to post
Share on other sites

That is the correct change for what you want. It was that way in the last version but I added the code to only load those not in the blacklist since I thought it would be less confusing. If you see a name in the customer list and thought you had blacklisted that customer, you may need to look at the blacklist to be sure you did. 

 

A better way to go might be to leave the blacklisted customers in the customers list but highlight them to show they have been blacklisted. But that is not a quick change so maybe I'll add it in the next version.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×