Skip to content
Snippets Groups Projects
Commit 76a6844e authored by Mohammed Razem's avatar Mohammed Razem
Browse files

Misc updated to installer to enforce standrd username and site email

parent ca7e0a4d
No related branches found
No related tags found
No related merge requests found
...@@ -3,4 +3,4 @@ core = 8.x ...@@ -3,4 +3,4 @@ core = 8.x
; Drupal Core ; Drupal Core
projects[drupal][type] = "core" projects[drupal][type] = "core"
projects[drupal][version] = "8.0.1" projects[drupal][version] = "8.1.1"
...@@ -5,11 +5,16 @@ core = 8.x ...@@ -5,11 +5,16 @@ core = 8.x
;; Utilities contrib modules ;; Utilities contrib modules
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;
projects[config_update][type] = "module" projects[config_update][type] = module
projects[config_update][version] = "1.x-dev" projects[config_update][download][type] = git
projects[config_update][download][url] = https://git.drupal.org/project/config_update.git
projects[config_update][download][tag] = 8.x-1.1
projects[config_update][subdir] = "contrib/utilities" projects[config_update][subdir] = "contrib/utilities"
projects[config_update][download][type] = "git"
projects[config_update][download][branch] = "8.x-1.x" projects[ctools][type] = module
projects[ctools][download][type] = git
projects[ctools][download][url] = https://git.drupal.org/project/ctools
projects[ctools][download][tag] = 8.x-3.0-alpha26
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;
;; Development contrib modules ;; Development contrib modules
......
...@@ -3,7 +3,12 @@ type: profile ...@@ -3,7 +3,12 @@ type: profile
description: 'Varbase is an enhanced Drupal distribution with a lot of necessities.' description: 'Varbase is an enhanced Drupal distribution with a lot of necessities.'
version: 8.x-4.x version: 8.x-4.x
core: 8.x core: 8.x
distribution:
name: Varbase
# Required modules
dependencies: dependencies:
# core
- node - node
- block - block
- breakpoint - breakpoint
...@@ -25,6 +30,13 @@ dependencies: ...@@ -25,6 +30,13 @@ dependencies:
- file - file
- rdf - rdf
- views - views
# contrib
- metatag
# Our own core functionality.
themes: themes:
- bartik - bartik
- seven - seven
...@@ -13,13 +13,32 @@ use Drupal\Core\Form\FormStateInterface; ...@@ -13,13 +13,32 @@ use Drupal\Core\Form\FormStateInterface;
* Allows the profile to alter the site configuration form. * Allows the profile to alter the site configuration form.
*/ */
function varbase_form_install_configure_form_alter(&$form, FormStateInterface $form_state) { function varbase_form_install_configure_form_alter(&$form, FormStateInterface $form_state) {
// Add a placeholder as example that one can choose an arbitrary site name. // Add a placeholder as example that one can choose an arbitrary site name.
$form['site_information']['site_name']['#attributes']['placeholder'] = t('My site'); $form['site_information']['site_name']['#attributes']['placeholder'] = t('My Official Site Name');
// Default email to start with noreply@ (the site can not send emails back). // Default email to start with noreply@ (the site can not send emails back).
$form['site_information']['site_mail']['#default_value'] = 'noreply@' . $_SERVER['SERVER_NAME']; $form['site_information']['site_mail']['#field_prefix'] = 'noreply@';
$form['site_information']['site_mail']['#attributes']['style'] = 'width: 25em;';
//die(print_r($form['site_information']));
$form['site_information']['site_mail']['#type'] = 'textfield';
$form['site_information']['site_mail']['#default_value'] = $_SERVER['SERVER_NAME'];
$form['site_information']['site_mail']['#element_validate'] = array('_varbase_install_configure_sitemail_validate');
// Default user 1 username should be 'webmaster'. // Default user 1 username should be 'webmaster'.
$form['admin_account']['account']['name']['#default_value'] = 'webmaster'; $form['admin_account']['account']['name']['#default_value'] = 'webmaster';
$form['admin_account']['account']['mail']['#default_value'] = 'webmaster@' . $_SERVER['SERVER_NAME']; $form['admin_account']['account']['name']['#attributes']['disabled'] = TRUE;
$form['admin_account']['account']['mail']['#default_value'] = 'webmaster@vardot.com';
$form['admin_account']['account']['mail']['#description'] = t('In most case, and for <a target="_blank" href="@link">Vardot</a> specific use, we recommend this to always be <em>webmaster@vardot.com</em>.', array('@link' => 'http://vardot.com'));
} }
/**
* Validate handler to validate site email address.
*/
function _varbase_install_configure_sitemail_validate($element, &$form_state, $form) {
$form_state->setValue('site_mail', 'noreply@' . $form_state->getValue('site_mail'));
$site_email = $form_state->getValue('site_mail');
if (!\Drupal::service('email.validator')->isValid($site_email)) {
$form_state->setError($element, t('Please enter a valid format for site email address.'));
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment