Exemplo n.º 1
0
  * 1. validate user submitted data
  * 2. if there are errors, display the add user form updated with error messages
  * 3. if there aren't errors, add this user to the common database and to
  *    the tester databases associated with this user.
  */
 /*
  * Validazione dati
  */
 $errorsAr = array();
 if ($_POST['user_tester'] == 'none') {
     $errorsAr['user_tester'] = true;
 }
 if (DataValidator::is_uinteger($_POST['user_type']) === FALSE) {
     $errorsAr['user_type'] = true;
 }
 if (DataValidator::validate_firstname($_POST['user_firstname']) === FALSE) {
     $errorsAr['user_firstname'] = true;
 }
 if (DataValidator::validate_lastname($_POST['user_lastname']) === FALSE) {
     $errorsAr['user_lastname'] = true;
 }
 if (DataValidator::validate_email($_POST['user_email']) === FALSE) {
     $errorsAr['user_email'] = true;
 }
 if (DataValidator::validate_username($_POST['user_username']) === FALSE) {
     $errorsAr['user_username'] = true;
 }
 if (DataValidator::validate_password($_POST['user_password'], $_POST['user_passwordcheck']) === FALSE) {
     $errorsAr['user_password'] = true;
 }
 if (DataValidator::validate_string($_POST['user_address']) === FALSE) {