[EP-tech] Re: restricting account creation

Alan.Stiles Alan.Stiles at open.ac.uk
Thu Oct 11 09:21:22 BST 2012


Hi Malcolm,

You could either add another line after the first "return 1 if..."
ie
...
  # registration allowed
  return 1 if $email =~ /\@westminster\.ac\.uk$/;
  return 1 if $email =~/\@wmin\.ac\.uk$/;

  return 0; # registration denied
...

or, using the joys of regex, change the existing line to something like:

   return 1 if $email =~ /\@w(est)?min(ster)?\.ac\.uk$/;

Hope that helps
--

Alan Stiles

Digital Repository Developer, Library Services

The Open University Library

Walton Hall, Milton Keynes, MK7 6AA, United Kingdom.

________________________________
From: Malcolm Bodger [mailto:M.Bodger at westminster.ac.uk]
Sent: 11 October 2012 08:57
To: eprints-tech at ecs.soton.ac.uk
Subject: [EP-tech] Re: restricting account creation


Hi Jose,



Many thanks, I'll give it a try, but how can I change that to include an alias of 'wmin.ac.uk' ?



Regards,

Malcolm.

________________________________
From: eprints-tech-bounces at ecs.soton.ac.uk [eprints-tech-bounces at ecs.soton.ac.uk] on behalf of Jose Martin [J.Martin at ulcc.ac.uk]
Sent: 10 October 2012 16:28
To: eprints-tech at ecs.soton.ac.uk
Subject: [EP-tech] Re: restricting account creation

Check cfg.d/registration.pl:

# This function allows you to allow/deny sign-ups from
# particular email domains
$c->{check_registration_email} = sub
{
  my( $repository, $email ) = @_;

  # registration allowed
  return 1 if $email =~ /\@westminster\.ac\.uk$/;

  return 0; # registration denied
}

Best,

                Jose.


From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Malcolm Bodger
Sent: 10 October 2012 15:53
To: eprints-tech at ecs.soton.ac.uk
Subject: [EP-tech] restricting account creation


Hi,



We use local accounts, not LDAP accounts, and would like to restrict requests for new accounts to users with a 'westminster.ac.uk' email address. I'm sure this possible, but how - and is it easy to do?



Regards,

Malcolm.

The University of Westminster is a charity and a company limited by guarantee. Registration number: 977818 England. Registered Office: 309 Regent Street, London W1B 2UW.

The University of Westminster is a charity and a company limited by guarantee. Registration number: 977818 England. Registered Office: 309 Regent Street, London W1B 2UW.

-- 
The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England & Wales and a charity registered in Scotland (SC 038302).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20121011/cabb85f3/attachment-0001.html 


More information about the Eprints-tech mailing list