I was wondering if there is any way to stop people from creating sites. I have a personal site using OpenScholar and on the login page, a big button shows "Get your we site". I wish to disable this feature as I do not want anyone to create a site under my domain.

Thanks in advance.

Comments

sfsiegel’s picture

More generally, is there a way to require authentication, so that only members of my department (who have a username and password) can create sites, and not anyone in the world? Right now, anyone in the world can push the button and add a site.

ferdi’s picture

You can disable scholarregister module. Then create sites yourself by adding "web site" type of nodes as usual i.e. node/add/vsite
Or, write a simple module that alter the submit handler of the site registration form. Have a look at iqss_pinserver_register module for an example. That's what we use on our own installations.

rolando.isidoro’s picture

Hi, I'm working on a Portuguese University and we are really considering deploying OpenScholar to handle all teachers' websites but we are still hesitant, specially regarding this topic: how to limit site creation to teachers only?

We use LDAP here, are there any plans to include an out-of-the box LDAP integration in OpenScholar in a future release? Alternatively would it be easy to use the current LDAP integrations modules available for Drupal to achieve this goal?

Thanks in advance,
Rolando Isidoro

stattler’s picture

Thanks. This helps.

rolando.isidoro’s picture

Priority: Normal » Major

Hi,

I've been experimenting with Drupal Permissions in order to limit the access to the OpenScholar site creation form, but I can't seem to be able get it right.

Starting where the #2 comment left, I've decided to keep the scholarregister module enabled and remove the permission for anonymous user to "create vsite content" instead.

The result was not quite what I expected, which was to disallow anonymous users from creating websites via the form.

I've looked into the scholarregister.module code and the $create_site_access value doesn't seem to be used correctly in the scholarregister_form_process function. Shouldn't the user be redirected if it doesn't have the $create_site_access privilege?

Thanks in advance,
Rolando

/**
* Determine whether to redirect user or load form when trying to access registration form
*/
function scholarregister_form_process(){
  global $user;
  //check if user has create site permission
  $create_site_access = node_access('create', variable_get('scholar_content_type', 'vsite'));

  //check if user should be re-directed somewhere
  if ($vsites = vsite_get_vsite_by_owner($user->uid)){
    if (!scholarregister_vsite_exists_access($vsites) && !$create_site_access){
      return drupal_goto(_scholarregister_get_redirect($vsites));  //redirect user away from the form
    }
  }
  return drupal_get_form('scholarregister_signup_form'); //load the form
}
jreifler’s picture

Hi! I am like the first poster who is using OpenScholar for a personal website and I want to disable the "create your web site" function. I followed the advice above and disabled the scholarregister module, but now get the following error message:

warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'scholarregister_form_access' was given in /.../public_html/includes/menu.inc on line 452.

Any guidance people could give on what to do next would be greatly appreciated. Thanks!

gsaha’s picture

The harvard university openscholar site has done this well.

http://scholar.harvard.edu/

When you click on "create your website" it takes the user to the ldap authenticationpage. So only authorized users can create a site.
This is exactly what we need to do .
Would love to find out how they did this.

ferdi’s picture

@jreifler There is probably a caching issue there. Try to clear the cache.
@gsaha The module that does this for Harvard is included in the distribution (pinserver_register)

It's hard to come up with a solution that works for everyone. We are working on LDAP and CAS integration right now.

thanks!

jreifler’s picture

Cache clearing worked! Thank for performing this wonderful service to the academic community.

lemasney’s picture

@ferdi is pinserver_register documented?