[dev] Bugs in imp/fetchmailprefs.php (patch)

Jan Kuipers jrkuipers@lauwerscollege.nl
Mon, 22 Jul 2002 09:40:59 +0200


This message is in MIME format.

---------------------- multipart/mixed attachment
There are two bugs in fetchmailprefs:
1. When you have only 1 account, this account can't be deleted.
2. When editing this account, a second account with the same name is added.

This patch solves this problems (it's a reversal of some changes made earlier)

-- 
Jan Kuipers
Systeembeheer Lauwers College
---------------------- multipart/mixed attachment
SW5kZXg6IGZldGNobWFpbHByZWZzLnBocAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxlOiAvcmVwb3NpdG9y
eS9pbXAvZmV0Y2htYWlscHJlZnMucGhwLHYKcmV0cmlldmluZyByZXZpc2lvbiAxLjEwCmRpZmYg
LXUgLXIxLjEwIGZldGNobWFpbHByZWZzLnBocAotLS0gZmV0Y2htYWlscHJlZnMucGhwCTEyIEp1
bCAyMDAyIDE3OjA4OjU3IC0wMDAwCTEuMTAKKysrIGZldGNobWFpbHByZWZzLnBocAkyMiBKdWwg
MjAwMiAwNzoyOTo0MyAtMDAwMApAQCAtNDYsMTUgKzQ2LDE4IEBACiAgICAgYnJlYWs7CiAKIGNh
c2UgQUNDT1VOVF9TQVZFOgotICAgIGlmICghKCRlZGl0X2FjY291bnQgPSBIb3JkZTo6Z2V0Rm9y
bURhdGEoJ2VkaXRfYWNjb3VudCcpKSkgewotICAgICAgICRlZGl0X2FjY291bnQgPSAkYWNjb3Vu
dC0+YWRkKCk7CisgICAgJGVkaXRfYWNjb3VudCA9IEhvcmRlOjpnZXRGb3JtRGF0YSgnZWRpdF9h
Y2NvdW50Jyk7CisgICAgJGlkID0gSG9yZGU6OmdldEZvcm1EYXRhKCdpZCcpOworCisgICAgaWYg
KCFpc3NldCgkZWRpdF9hY2NvdW50KSB8fCAkZWRpdF9hY2NvdW50ID09ICcnKSB7CisgICAgICAg
ICRlZGl0X2FjY291bnQgPSAk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