MDL-85576 cli: add noreply email option to cli install.
This commit is contained in:
@@ -58,6 +58,7 @@ Options:
|
||||
--shortname=STRING Name of the site
|
||||
--summary=STRING The summary to be displayed on the front page
|
||||
--supportemail=STRING Email address for support and help.
|
||||
--noreplyemail=STRING Email address used for noreply.
|
||||
-h, --help Print out this help
|
||||
|
||||
Example:
|
||||
@@ -100,6 +101,7 @@ list($options, $unrecognized) = cli_get_params(
|
||||
'shortname' => '',
|
||||
'summary' => '',
|
||||
'supportemail' => '',
|
||||
'noreplyemail' => '',
|
||||
'agree-license' => false,
|
||||
'help' => false
|
||||
),
|
||||
@@ -147,6 +149,12 @@ if (!empty($options['supportemail']) && !validate_email($options['supportemail']
|
||||
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
|
||||
}
|
||||
|
||||
// Validate that the noreply address provided is valid.
|
||||
if (!empty($options['noreplyemail']) && !validate_email($options['noreplyemail'])) {
|
||||
$a = (object)['option' => 'noreplyemail', 'value' => $options['noreplyemail']];
|
||||
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
|
||||
}
|
||||
|
||||
$options['lang'] = clean_param($options['lang'], PARAM_SAFEDIR);
|
||||
if (!file_exists($CFG->dirroot.'/install/lang/'.$options['lang'])) {
|
||||
$options['lang'] = 'en';
|
||||
|
||||
Reference in New Issue
Block a user