[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] Restricting access to CGI Scripts



Hi Francis,


One solution would be to:

copy the [EPRINTS_ROOT]/cgi/register file into [EPRINTS_ROOT]/archives/[ARCHIVEID]/cgi/


The archive version of the file will be used in preference to the global one.

Edit this file, adding a test for the IP address e.g.

if( $repo->remote_ip =~ m/^10\.11\.22\./ )

{

#do the normal registration stuff already in the cgi script

}

else

{

# generate a 'you cannot register' page (or a 'you must be on the intranet to register' page)

}


Another way to do what you want would be to sub-class the Screen::Register plugin, and alter the 'allow_register' method - and use the same test as above - based on $repo->remote_ip.


If it's useful, there is an option 'allow_web_signup' in [EPRINTS_ROOT]/archives/[ARCHIVEID]/cfg/cfg.d/registration.pl which turns the ability to register via the web interface on or off - but I don;t think you want this - as it would stop all registrations, not just external ones.


If that doesn't provide enough information, let me know and I'll provide some more details.


Cheers,

John



________________________________
From: eprints-tech-bounces at ecs.soton.ac.uk <eprints-tech-bounces at ecs.soton.ac.uk> on behalf of Francis Jayakanth via Eprints-tech <eprints-tech at ecs.soton.ac.uk>
Sent: 29 September 2018 17:55:14
To: eprints-tech at ecs.soton.ac.uk
Subject: [EP-tech] Restricting access to CGI Scripts

Hi, I would like to restrict access to the 'Create Account' link of
our repository to the intranet users only. Can Someone who has
implemented it, share the details, please?

Thanks and regards, Francis
*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C5b4b31da5a214f55c88f08d626598e76%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=kg%2BWS5v9ZaacrsWal5tLQ4P0ZVRzt1NtA5CL5S%2B%2BY9A%3D&amp;reserved=0
*** EPrints community wiki: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C5b4b31da5a214f55c88f08d626598e76%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=dilIqw2tl5zAAjTFBbSHSu2oKSuHhORKgef6JJjUP%2Bo%3D&amp;reserved=0
*** EPrints developers Forum: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C5b4b31da5a214f55c88f08d626598e76%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=AduBP%2F5b8rn0YZjhBUiWarCpyHQkYDL3iLOCE1snxbc%3D&amp;reserved=0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20180929/8a21272e/attachment-0001.html