This module helps to addup multisite environment without human intervention however it requires host file to be write mode enabled.

Git repository link

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/madhusudanmca/2054335.git sn_quick_multisite

Project Page Link
https://drupal.org/sandbox/madhusudanmca/2054335

Manual reviews of other projects:

https://drupal.org/node/2071551#comment-7805031
https://drupal.org/node/2048135#comment-7804919
https://drupal.org/node/2070535#comment-7777973
https://drupal.org/node/2063215#comment-7778727

Adding more manual reviews of other projects:

https://drupal.org/node/2054613#comment-7861435
https://drupal.org/node/2081395#comment-7861385
https://drupal.org/node/2079817#comment-7861335

Comments

madhusudanmca’s picture

Status: Active » Needs review
PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxmadhusudanmca2054335git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

garnett2125’s picture

Hi,

Manual review :

  1. Remove $host_string = ''; sn_quick_multiple.inc line 65
  2. Undefined variable $default_data sn_quick_multiple.inc line 154
  3. Why do you set $output = ''; before adding string in it ?
  4. $site_values, $cloning_values, $hostfile_values are not used sn_quick_multisite_form.inc
madhusudanmca’s picture

Status: Needs work » Needs review

Hi All,

I have incorporated all the suggestions.
Please review again.

Thanks

ajesh’s picture

Hi,

I have created a module and looking someone who can review my modules.
https://drupal.org/node/2063215

Thanks,
Ajesh

pgautam’s picture

Hi

Please find some of my quick review comments.

1) Please give one space gap between each loop and condition and each function declaration.
2) Remove $sitename parameter use $domain_name instead in function sn_quick_multisite_prepare_baseurl($sitename) as it is multiple assignment in line 194.
3) Remove commented code from function sn_quick_multisite_clone_table_populate($from_db, $to_db) in sn_quick_multisite.inc
4) Remove two returns from function sn_quick_multisite_get_dbdata_by_folder($folder) on line 586, 591 in sn_quick_multisite.inc
5) Remove condition if (!strstr($url, 'http://')) use parse_url instead on line 672 in sn_quick_multisite.inc
6) Unwanted variable $tld on line 645, 686 in sn_quick_multisite.inc
7) Error scenario handling missing in public function makeWorldReadable(&$filetransfer, $path, $recursive = TRUE) for sn_quick_multisite_copy_dir.inc

Thanks,
Paritosh Gautam

madhusudanmca’s picture

Hi Paritosh,

I have incorporated all the suggestion as suggested by you.
Request you and other members to review for further suggestions.

Thanks

gaurav.pahuja’s picture

Status: Needs review » Needs work

sn_quick_multisite.module
Line # 33: Incorrect 'access arguments'. This feature will not work for user other than superadmin.

vyasneetesh’s picture

Category: task » bug
Priority: Normal » Major

1) Spelling of Domain in link (Create quick multisite with sub domians).
2) Usually in Production enviroment, IT Infrastructure team does not share the path of the Host file,
instead, you should ask for confirmation if Valid Subdomain is configured in your infrastructure or not. If it is available , no need for the host file path.
3) Space (package[]) to be removed from .info file.
4) if condition in sn_quick_multisite_form_hostfilevalidate() – sn_quick_multisite_form.inc
should be re written to check if file exists and inside the if block if check for Write permission. At present these are two separate condition ( if and else if)
5) Directory separator to be used to take care multiple platforms/os issues in file paths.

vyasneetesh’s picture

Title: [D7]SN Quick Multisite » [D7]SN Quick Multisite - Confirm Subdomain confguration and Host File path
Category: bug » feature

At present you are asking for the Host file path which May or may not be available to admin due to Infrastructure securities on production/staging environment. But for Development environment We might need to add host entries to make multisite work.

you can ask
1) Confirmation from user if subdomains are configured if it is prod/staging kind of environment.
2) If subdomain are not configured ( probably a dev enviroment) ask for the file path.

madhusudanmca’s picture

Title: [D7]SN Quick Multisite - Confirm Subdomain confguration and Host File path » [D7]SN Quick Multisite
Category: feature » task
Status: Needs work » Needs review

Hello All,

Thanks a lot for your valuable feedback's, I have incorporated all the suggestions given.
I request you to review it again.

Thanks

ajesh’s picture

HI,

I have review modules and find one observation on files sn_quick_multisite.inc

at line # 670 to 674
// URL from which domain info to be fetched.
  $url = $_SERVER['HTTP_HOST'];

  if (!strstr($url, 'http://')) {
    $url = 'http://' . $url;
  }

you are comparing only for http:// if the website have ssl enable then this condition fails.
Overall it seem to good modules and working as expected.

Thanks,
Ajesh

madhusudanmca’s picture

Hello Ajesh,

Thanks for your valuable inputs, actually I have used "$_SERVER['HTTP_HOST']", and just checked and added the "http://" for parsing URL with parse_url() function.

Please let me know If I am not clear.

Thanks

madhusudanmca’s picture

Issue tags: +PAreview: review bonus

Adding review bonus tag.

madhusudanmca’s picture

Issue summary: View changes

Manual reviewed projects added!!

klausi’s picture

Priority: Major » Normal
Status: Needs review » Needs work

manual review:

  1. The project page should have a big fat warning that this module should never be used on a production site, as it is a security risk to have a writable sites folder.
  2. sn_quick_multisite_menu(): why the permission "administer users"? Shouldn't it be "administer site configuration"?
  3. If I test this on http://simplytest.me/project/2054335 and I submit the config form nothing happens, no error message, no success message.
  4. What is the host file? /etc/hosts on linux systems? Please add a description.
  5. An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?render=overlay&id=2&op=do StatusText: Service unavailable (with message) ResponseText: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user 'drupal-7'@'localhost' to database 'foo': DROP DATABASE IF EXISTS foo; Array ( ) in sn_quick_multisite_create_db() (line 261 of sn_quick_multisite.inc). Of course my Drupal site has only access to its own database on the database server, this is another security best practice and another risk if arbitrary database can be dropped.

Honestly I don't see the point of such a module on site, you should use more mature and secure solutions such as Aegir.

Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

madhusudanmca’s picture

Status: Needs work » Needs review

Hi Klausi,

Thanks for your valuable inputs!!

1) Suggested warning has been added on project page:
https://drupal.org/sandbox/madhusudanmca/2054335
2) Permission has been changed.
3) I have tested this module on Windows, Linux and Mac servers, but didn't face any issue. I'm sorry to say but unable to understand why it's not working on http://simplytest.me/project/2054335.
Please suggest!!
4) Description has been added on both project page and in README.txt
5) Issue has been rectified.

NB: My main intention behind writing this module was to help users to setup their multisite environment (off course on development environment), because still there are people who doesn't know how to setup multisite environment.
For e.g. you may refer to: https://drupal.org/node/2063777

Thanks

Sean Buscay’s picture

Hello madhusudanmca.

I fixed a couple of spelling and grammar issues for your project's readme file. I have attached a patch. Please take a look to make sure I corrected the wording in a way that kept your intended meaning.

I hope this helps. Good luck with your module.

madhusudanmca’s picture

Hello Sean,

Thanks for your help!!

I have incorporated your suggestions.

tibezh’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: review bonus

Hi

Review of the 7.x-1.x branch

  1. Please, fix it https://drupal.org/node/2066777#comment-7762313
  2. sn_quick_multisite.inc (functions: sn_quick_multisite_create_db, sn_quick_multisite_clone_table_populate, ) - need use placeholders.
  3. sn_quick_multisite.inc (function sn_quick_multisite_copy_dir_batch) - contains duplicate code. Recommend create and use separate function for set arguments of theme or module.
  4. sn_quick_multisite.inc (function sn_quick_multisite_get_host_details) - unnecessary use the str_replace function (recomment to write comments in the function).
  5. sn_quick_multisite.module (function sn_quick_multisite_help) - need use placeholders and wrap to one t() function.
  6. file sn_quick_multisite_copy_dir.inc - need to be included via .info file.
  7. file sn_quick_multisite_form.inc (line 168) - missed placeholder.
  8. Please, define settings page in the .info file.

Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

vivdrupal’s picture

Title: [D7]SN Quick Multisite » [D7]SN Quick Multisite vs OpenScholar

How does SN Quick Multisite compare with the OpenScholar project?
https://drupal.org/project/openscholar

madhusudanmca’s picture

Title: [D7]SN Quick Multisite vs OpenScholar » [D7]SN Quick Multisite
Status: Needs work » Needs review

Hello All,

Thanks for your inputs!!
All review comments have been incorporated.

Please ignore one warning from http://pareview.sh/pareview/httpgitdrupalorgsandboxmadhusudanmca2054335git , as this variable is populated from included file on line #561 in file "sn_quick_multisite.inc".

Thanks

madhusudanmca’s picture

Hi vivdrupal,

OpenScholar doesn't seems to be a separate module in fact looks like an complete package, which is quite different from SN Quick Multisite.

Thanks

madhusudanmca’s picture

Issue summary: View changes

fixed link

madhusudanmca’s picture

Issue tags: +PAReview

Adding PAReview tag...

kscheirer’s picture

Title: [D7]SN Quick Multisite » [D7] SN Quick Multisite
Status: Needs review » Needs work
  • Instead of using ajax callbackx in sn_quick_multisite_action_form() to modify elements on the fly, use the State API, see https://api.drupal.org/api/drupal/developer%21topics%21forms_api_referen... and https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_....
  • In sn_quick_multisite_form_validate_sitename() should you allow underscores and dashes in a site name? Those are valid as far as I know.
  • The function sn_quick_multisite_make_host_enrty() should be sn_quick_multisite_make_host_entry().
  • In sn_quick_multisite_clone_table_populate(), don't use backticks (`) around the db and table names, not all mysql server are configured that way.
  • How does sn_quick_multisite_generate_dbname() know it has generated a unique name? I think you need a while loop instead of an if statement. You're just hoping the same random number doesn't get generated twice.

Seems like a useful module, obviously lots of security concerns. Could you add something to the project page warning that installing this module allows all users with "administer site configuration" quite a lot of power.

----
Top Shelf Modules - Crafted, Curated, Contributed.

madhusudanmca’s picture

Status: Needs work » Needs review

Hi kscheirer,

Thank you so much for your valuable comments and suggestions!!

I have incorporated all of your suggestions except the number 1, as we have some server side validation for some of form fields and those should be validated when they are visible.
So, I can't opt for State API in this case.

Thanks for your understanding.

kscheirer’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for those updates. The whitespace on the do/while loop look off, but that's the only problem I see. You've documented that the db user will need very high level of access, so I can't think of anything more that's needed.

----
Top Shelf Modules - Crafted, Curated, Contributed.

klausi’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -PAReview

Sorry for the delay, but you forgot to add the "PAReview: review bonus" tag.

manual review:

  • "form_set_error('sitename', t('"!sitename" subdomain site already exists.'": the site name is user provided text, so you should use the "@" or "%" placeholder with t() which will sanitize the variable with check_plain() for you. See https://drupal.org/node/28984 . This is not an XSS security blocker now because you need the high level "administer site configuration" permission to exploit this, which is listed as exception on https://drupal.org/security-advisory-policy

Otherwise this looks good, so ...

Thanks for your contribution, madhusudanmca!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

manual reviews added