install.inc

Installation settings common across different versions of Drupal.

Functions

Namesort descending Description
install_validate_client_email Validate client email and throw a helpful error message if it is invalid.

Constants

File

platform/drupal/install.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Installation settings common across different versions of Drupal.
  5. */
  6. define('PROVISION_DEFAULT_ADMIN_USER', 'admin');
  7. /**
  8. * Validate client email and throw a helpful error message if it is invalid.
  9. */
  10. function install_validate_client_email($client_email) {
  11. if (!$client_email || !filter_var($client_email, FILTER_VALIDATE_EMAIL)) {
  12. $invalid_email = 'this.email@is.invalid';
  13. $user = function_exists('l') ? l(dt('user account'), 'user') : 'user account';
  14. drush_log(dt('Error validating client email `!email`. Please check your !user email. To allow the site installation to proceed, the email `!invalid` has been used instead. Please use the `login` link to change the site admin email to a proper valid address.',
  15. array(
  16. '!email' => $client_email,
  17. '!user' => $user,
  18. '!invalid' => $invalid_email,
  19. )),
  20. 'warning'
  21. );
  22. return $invalid_email;
  23. }
  24. else {
  25. return $client_email;
  26. }
  27. }