Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-28513

Allow specification of admin user email in CLI installer

    Details

    • Database:
      Any
    • Testing Instructions:
      Hide
      1. Move your config.php to a new location and open it for reference
      2. Run the CLI installer without options. This should put it into interactive mode
      3. Add all of the info from your previous config changing:
        1. DB prefix to t1_
        2. dataroot to /tmp/t1
      4. Do not specify the admin email address when asked
      5. After installation, log in
        • Confirm that you are shown the admin profile editing page
      6. Remove the config.php
      7. Run the CLI installer again, changing:
        1. DB prefix to t2_
        2. dataroot to /tmp/t2
      8. Specify an invalid email address when asked (FYI, Moodle incorrectly regards addresses without an @ sign as invalid - try that)
        • Confirm that the installation bailed
      9. Run the CLI installer again, changing:
        1. DB prefix to t2_
        2. dataroot to /tmp/t2
      10. Specify the admin email address when asked and provide a valid address
      11. After installation, log in
      12. View the admin profile
        • Confirm that the specified e-mail address was set
      13. Remove the config.php
      14. Run the CLI installer again, specifying CLI all relevant arguments including an invalid adminemail and non-interactive
        • Confirm that the installation bailed
      15. Run the CLI installer again, specifying CLI all relevant arguments including adminemail and non-interactive
      16. After installation, log in
      17. View the admin profile
        • Confirm that the specified e-mail address was set
      Show
      Move your config.php to a new location and open it for reference Run the CLI installer without options. This should put it into interactive mode Add all of the info from your previous config changing: DB prefix to t1_ dataroot to /tmp/t1 Do not specify the admin email address when asked After installation, log in Confirm that you are shown the admin profile editing page Remove the config.php Run the CLI installer again, changing: DB prefix to t2_ dataroot to /tmp/t2 Specify an invalid email address when asked (FYI, Moodle incorrectly regards addresses without an @ sign as invalid - try that) Confirm that the installation bailed Run the CLI installer again, changing: DB prefix to t2_ dataroot to /tmp/t2 Specify the admin email address when asked and provide a valid address After installation, log in View the admin profile Confirm that the specified e-mail address was set Remove the config.php Run the CLI installer again, specifying CLI all relevant arguments including an invalid adminemail and non-interactive Confirm that the installation bailed Run the CLI installer again, specifying CLI all relevant arguments including adminemail and non-interactive After installation, log in View the admin profile Confirm that the specified e-mail address was set
    • Workaround:
      Hide

      Install using the CLI, then configure admin profile using the interface

      Show
      Install using the CLI, then configure admin profile using the interface
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull Master Branch:
      MDL-28513-master

      Description

      It would make life easier for developers regularly installing fresh copies of moodle if it were possible to specify the required admin settings in the CLI installer.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              dobedobedoh Andrew Nicols added a comment -

              I've written a patch for this which can be cherry-picked to master, MOODLE_20_STABLE, and MOODLE_21_STABLE.

              Repository: git://git.luns.net.uk/moodle.git
              Commit: 8b70068451cfcf2a08f24754aeb0a7696f334ee5

              Show
              dobedobedoh Andrew Nicols added a comment - I've written a patch for this which can be cherry-picked to master, MOODLE_20_STABLE, and MOODLE_21_STABLE. Repository: git://git.luns.net.uk/moodle.git Commit: 8b70068451cfcf2a08f24754aeb0a7696f334ee5
              Hide
              dobedobedoh Andrew Nicols added a comment -

              Can also be cherry-picked onto 2.0 and 2.1 if required

              Show
              dobedobedoh Andrew Nicols added a comment - Can also be cherry-picked onto 2.0 and 2.1 if required
              Hide
              dobedobedoh Andrew Nicols added a comment -

              Added a missed case – install.php should also support this argument

              Show
              dobedobedoh Andrew Nicols added a comment - Added a missed case – install.php should also support this argument
              Hide
              skodak Petr Skoda added a comment -

              Hello,

              the installer is supposed to only install moodle, nothing else. I think that this functionality should be implemented in a separate CLI script that allows you to add/edit any user account. I never understood why city and country were required, I suppose it was like that because Martin wanted this on the moodle.org site.

              Petr

              Show
              skodak Petr Skoda added a comment - Hello, the installer is supposed to only install moodle, nothing else. I think that this functionality should be implemented in a separate CLI script that allows you to add/edit any user account. I never understood why city and country were required, I suppose it was like that because Martin wanted this on the moodle.org site. Petr
              Hide
              skodak Petr Skoda added a comment -

              Hmm, thinking a bit about the email, it might be useful when you forget the password used during the installation. Quit recently there was a heated discussion on moodle.org related to the defaults in the user edit form, it might be better to allow configuration of defaults, required/locked fields on some special admin page...

              Show
              skodak Petr Skoda added a comment - Hmm, thinking a bit about the email, it might be useful when you forget the password used during the installation. Quit recently there was a heated discussion on moodle.org related to the defaults in the user edit form, it might be better to allow configuration of defaults, required/locked fields on some special admin page...
              Hide
              skodak Petr Skoda added a comment -

              The admin email might be used as some default contact email too.

              My +1 to include admin mail
              My -1 to include other info
              My +1 to make the country and city requirement configurable in 2.2

              Show
              skodak Petr Skoda added a comment - The admin email might be used as some default contact email too. My +1 to include admin mail My -1 to include other info My +1 to make the country and city requirement configurable in 2.2
              Hide
              skodak Petr Skoda added a comment -

              Thanks for the patch!

              Show
              skodak Petr Skoda added a comment - Thanks for the patch!
              Hide
              marina Marina Glancy added a comment -

              What a nice issue! Andrew, city and country are not mandatory for a long time already, it's just email left. Patch will be about 7 lines after it. Can we push it forward for 2.9?

              Show
              marina Marina Glancy added a comment - What a nice issue! Andrew, city and country are not mandatory for a long time already, it's just email left. Patch will be about 7 lines after it. Can we push it forward for 2.9?
              Hide
              dobedobedoh Andrew Nicols added a comment -

              I am un-assigning myself from this issue as I am not currently working on this and it will give the opportunity for someone else to work on it.

              Show
              dobedobedoh Andrew Nicols added a comment - I am un-assigning myself from this issue as I am not currently working on this and it will give the opportunity for someone else to work on it.
              Hide
              dobedobedoh Andrew Nicols added a comment -

              Would be nice to get this in. I'll keep a note of it as a nice one to fill a few minutes

              Show
              dobedobedoh Andrew Nicols added a comment - Would be nice to get this in. I'll keep a note of it as a nice one to fill a few minutes
              Hide
              cibot CiBoT added a comment -

              Code verified against automated checks.

              Checked MDL-28513 using repository: git://github.com/andrewnicols/moodle.git

              More information about this report

              Show
              cibot CiBoT added a comment - Code verified against automated checks. Checked MDL-28513 using repository: git://github.com/andrewnicols/moodle.git master (0 errors / 0 warnings) [branch: MDL-28513-master | CI Job ] More information about this report
              Hide
              ankit_frenz Ankit Agarwal added a comment - - edited

              Hi Andrew,

              The patch looks good. I don't see that the email address being validated anywhere. Shouldn't we validate the email address to see if it is in correct format? If we don't later when someone tries to edit the profile of the admin user, this email address won't be accepted.

              Rest looks good.

              Cheers

              Show
              ankit_frenz Ankit Agarwal added a comment - - edited Hi Andrew, The patch looks good. I don't see that the email address being validated anywhere. Shouldn't we validate the email address to see if it is in correct format? If we don't later when someone tries to edit the profile of the admin user, this email address won't be accepted. Rest looks good. Cheers
              Hide
              dobedobedoh Andrew Nicols added a comment -

              Thanks Ankit,

              Sounds good - have added validation. Submitting for integration.

              Andrew

              Show
              dobedobedoh Andrew Nicols added a comment - Thanks Ankit, Sounds good - have added validation. Submitting for integration. Andrew
              Hide
              cibot CiBoT added a comment -

              Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!

              Show
              cibot CiBoT added a comment - Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!
              Hide
              cibot CiBoT added a comment -

              Code verified against automated checks.

              Checked MDL-28513 using repository: git://github.com/andrewnicols/moodle.git

              More information about this report

              Show
              cibot CiBoT added a comment - Code verified against automated checks. Checked MDL-28513 using repository: git://github.com/andrewnicols/moodle.git master (0 errors / 0 warnings) [branch: MDL-28513-master | CI Job ] More information about this report
              Hide
              dmonllao David Monllaó added a comment -

              Hi Andrew, thanks for working on this, it looks good; I don't see any adminemail argument in admin/cli/install_database.php though, there is any good reason for that? We should also add it there to keep both scripts consistent.

              Show
              dmonllao David Monllaó added a comment - Hi Andrew, thanks for working on this, it looks good; I don't see any adminemail argument in admin/cli/install_database.php though, there is any good reason for that? We should also add it there to keep both scripts consistent.
              Hide
              marina Marina Glancy added a comment -

              just linking to an interesting issue MDL-48904 reported recently

              Show
              marina Marina Glancy added a comment - just linking to an interesting issue MDL-48904 reported recently
              Hide
              dobedobedoh Andrew Nicols added a comment -

              David Monllaó, because I'm a turnip and forgot about it. It was on my original brain-scan.
              Pushed an update adding this for the database-only installer now.

              Andrew

              Show
              dobedobedoh Andrew Nicols added a comment - David Monllaó , because I'm a turnip and forgot about it. It was on my original brain-scan. Pushed an update adding this for the database-only installer now. Andrew
              Hide
              dmonllao David Monllaó added a comment -

              Thanks Andrew, integrated to master. Please, add some testing instructions covering install_database.php too.

              Show
              dmonllao David Monllaó added a comment - Thanks Andrew, integrated to master. Please, add some testing instructions covering install_database.php too.
              Hide
              damyon Damyon Wiese added a comment -

              Test passed - I tested install_database.php too and it worked fine.

              Thanks Andrew!

              Show
              damyon Damyon Wiese added a comment - Test passed - I tested install_database.php too and it worked fine. Thanks Andrew!
              Hide
              dobedobedoh Andrew Nicols added a comment -

              Thank you for your contribution. This change is now a part of Moodle and is available from git.moodle.org. It will shortly be available at https://downlaod.moodle.org too!

              A diamond is merely a lump of coal that did well under pressure.
              – Unknown

              Show
              dobedobedoh Andrew Nicols added a comment - Thank you for your contribution. This change is now a part of Moodle and is available from git.moodle.org. It will shortly be available at https://downlaod.moodle.org too! A diamond is merely a lump of coal that did well under pressure. – Unknown
              Hide
              dobedobedoh Andrew Nicols added a comment -

              Removing dev_docs_required as this does not require developer doumentaiton.

              Show
              dobedobedoh Andrew Nicols added a comment - Removing dev_docs_required as this does not require developer doumentaiton.

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    11/May/15