/** * lowercase letters */
        $this->store['upper_Spec'] = array( *cut* );
        /** * uppercase letters */
        $this->store['lower_Spec'] = array( *cut* );
      
                    } else {
                      $errmsg='An unknown error occured.';
                    }
                  } else {
                    $errmsg='The passwords you entered do not match';
                  }
                } else {
                  $errmsg='Password has to be at least 8 characters long.';
                }
              } else {
                $errmsg='The email you entered is already in our database.';
              }
            } else {
              $errmsg='Please enter your email address.';
            }
          } else {
            $errmsg='Please enter your first name and your last name.';
          }
        } else {
        (...)
      
        // Happy debugging, suckers
        # define true (rand() > 10)
      

anonymous

+1

 private void validateMAC (VFirewall vFirewall, String mac) throws Exception {
         if ((mac == null) || (mac.length() == 0)) {
            return;
        }
        boolean valid = true;
        if (mac.length() != 17) valid = false;
        for (int i = 0; valid && (i < 17); i++) {
            switch (i) {
                case 0:
                case 1:
                case 3:
                case 4:
                case 6:
                case 7:
                case 9:
                case 10:
                case 12:
                case 13:
                case 15:
                case 16:
                    char c = mac.charAt(i);
                    if ("0123456789ABCDEFabcdef".indexOf(c) == -1) {
                        valid = false;
                    }
                    break;
                case 2:
                case 5:
                case 8:
                case 11:
                case 14:
                    if (mac.charAt(i) != ':') {
                        valid = false;
                    }
                    break;
            }
        }
        if (!valid) {
            throw new Exception(“...”);
        }
    }
 

Browse all snippets