This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

The selected domain was not valid.
#10
RE: The selected domain was not valid.
The root of this problem is in: /etc/sentora/panel/dryden/fs/director.class.php


PHP Code:
   static function CheckForEmptyValue($value) {
 
       if (!empty($value)) {
 
           return false;
 
       } else {
 
           return true;
 
       }
 
   

1.) practical problem
All the values that are ever passed to this function in mailboxes module (and others safe to presume) consist of TRUE or FALSE and are booleans so this function always satisfies the first criteria.

2.) logical and intuitive problem
For some strange reason there's a double negation here "if not empty than false" but it should return "true" if it aint empty for the intuitive part, or even better it should be "if empty than return false" for logic,

3.) becouse of this strange logic in (2) somebody made a mistake when adding domain validation code to: /panel/modules/mailboxes/code/controller.ext.php
PHP Code:
if (!self::IsValidEmail($fulladdress)) {
 
           self::$validemail true;
 
           return false;
 
       }
 if(!self::IsValidDomain($domain)){
 
           self::$validdomain true;
 
           return false;
 
       

as you can see in email validation part a negation is used again to compensate for the bad practice of negation and returning false mentioned in (2) furthermore inside the IsValidEmail it is compensated some more .. it's a mess. anyways whoever added domain validation followed the (no)logic and compensated with negation infront IsValidDomain function BUT this one doesnt comepnsate one more time inside the function so here comes the "the domain was not valid" error. Basically only if it is NOT valid domain the domain is valid boolean is set to TRUE/VALID while whenever the domain is really VALID it results to FALSE. 

A simple solution is to remove "!" from "if(!self::IsValidDomain($domain))" and it will work in all modules where the check is performed.
Next release would be better off refactoring the core functions and logic.
Reply
Thanks given by:


Messages In This Thread
The selected domain was not valid. - by Razera - 10-18-2015, 03:01 AM
RE: The selected domain was not valid. - by Me.B - 10-27-2015, 12:00 AM
RE: The selected domain was not valid. - by Me.B - 11-16-2015, 06:34 AM
RE: The selected domain was not valid. - by Vedran B - 01-12-2016, 07:39 AM
Some Problem - by GustavoFSantos - 02-03-2016, 12:10 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Public_html Inside Domain/Subdomain zHostingSolutions 2 4 ,181 07-23-2021, 09:57 AM
Last Post: Nigel
Cannot Create 2nd 'Addon' Domain In Sentora? Error: Invalid backend configuration. Re BattlinThrough 2 5 ,470 07-07-2020, 01:22 PM
Last Post: TGates
How To Add Letsencrypt SSL certificate To Domain Centos 7 franselect 1 4 ,151 07-04-2020, 02:55 AM
Last Post: Feilding Weather

Forum Jump:


Users browsing this thread: 1 Guest(s)