ispCP - Board - Support
[BUG] mix-up when deleting alias-/subdomain - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Development Area (/forum-1.html)
+--- Forum: General discussion (/forum-11.html)
+--- Thread: [BUG] mix-up when deleting alias-/subdomain (/thread-4655.html)



[BUG] mix-up when deleting alias-/subdomain - push - 10-10-2008 08:46 AM

-----------------------
Actually this belongs in the ticket system, but that complains about the ticket being possible spam and rejects submission. Maybe one of the admins can move it over and delete this thread afterwards!?
-----------------------

Alright this is a bit complicate to explain, but i'll give it a try:

There's a problem when deleting alias domains with e.g. als_id=1 when there also exists a subdomain in the system with the same id (e.g. sub_id=1) which also has related e-mail accounts (e.g. mail@sub.domain.tld). This probably also happens the other way around, e.g. deleting subdomains when there are alias domain with the same id and having e-mail adresses.

Trying to delete the alias/(subdomain?) will result in the error: 'Domain alias you are trying to remove has email accounts !<br>First remove them!'.

The problem is that the alias delete script checks the sub_id field in mail_users, and since this field will be used by both alias domains and sub domains when adding new mail accounts this will lead to a mix up.

There probably should be an extra field in the mail_users table (e.g. "als_id") which is used when adding an alias email address (instead of using sub_id). Then the alias delete script should check for the existence of als_id in the mail_users table (instead of checking sub_id).


RE: [BUG] mix-up when deleting alias-/subdomain - kilburn - 10-12-2008 04:28 AM

You got an ugly bug here: sub_id should be handled as "alias id" or "subodmain id" based on the "mail_type" value (see this ticket).

I won't fix your bug right now though because sci2tech is completely rewriting the mail accounts handling code to clean it up (it's a real mess) so hopefully it'll get fixed when he commits his work Smile