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

[EP-tech] Static Page - Log In



Hi James,

I think the way to do this is unfortunately a bit of a hack you want to 
create a simple Screen Plugin like the one below:

package EPrints::Plugin::Screen::PrivateNotice;
use EPrints::Plugin::Screen;
@ISA = ( 'EPrints::Plugin::Screen' );
use strict;
sub new
{
 ??????? my( $class, %params ) = @_;

 ??????? my $self = $class->SUPER::new(%params);
 ??????? return $self;
}
sub can_be_viewed
{
 ??????? my( $self ) = @_;
 ??????? return $self->allow( "general" );
}
sub render_title
{
 ??????? my( $self ) = @_;
 ??????? my $name = "User";
 ??????? return $self->html_phrase( "title" );
}
sub render
{
 ??????? my( $self ) = @_;
 ??????? return $self->html_phrase( "content" );
}
1;

Then create a cgi page called private_notice:

use EPrints;
use strict;
my $eprints = EPrints->new;
my $repository = $eprints->current_repository();
exit( 0 ) unless( defined $repository );
EPrints::ScreenProcessor->process(
 ??? session => $repository,
 ??? screenid => "PrivateNotice",
);
exit( 0 );

Then create the phrases in a local phrase file.? I think they will be 
under Plugin/Screen/PrivateNotice:title and 
Plugin/Screen/PrivateNotice:content.? The reason for the cgi page as 
well as the screen plugin is to give a more user-friendly URL but you 
could just link to the Screen plugin URL.? You could create additional 
private notice pages by extending the Screen plugin with just something 
like:

package EPrints::Plugin::Screen::NewPrivateNotice;
use EPrints::Plugin::Screen::PrivateNotice;
@ISA = ( 'EPrints::Plugin::Screen::PrivateNotice' );
use strict;
sub new
{
 ??????? my( $class, %params ) = @_;

 ??????? my $self = $class->SUPER::new(%params);
 ??????? return $self;
}

and then setting some more local phrases for title and content for this 
Screen Plugin.

Regards

David Newman

On 25/01/2021 09:17, James Kerwin via Eprints-tech wrote:
> *CAUTION:* This e-mail originated outside the University of Southampton.
> Hi All,
>
> Hope we're all happy and healthy.
>
> I've been given a task and one option to complete it is to display 
> information on a static page in EPrints. Due to the potentially 
> sensitive nature of the data I was wondering if it's possible to have 
> a static page in EPrints that requires the user to be logged in to 
> EPrints to see it?
>
> I've had a quick look around and looked at all my ".xpage" files and I 
> have no examples. I feel like it isn't possible, but thought it would 
> be best to ask.
>
> If it isn't possible I have some other approaches?to take. They will 
> just take longer and my brain is already a bit scrambled after working 
> out the LibCal API.
>
> Thanks,
> James
>
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Caf4f1fd30912414d2df408d8c116f6d6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637471651668381140%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=q5%2BAP601DH2HFglefjXqKRAdifLBt0ae27ya2AYSzjo%3D&reserved=0
> *** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Caf4f1fd30912414d2df408d8c116f6d6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637471651668381140%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=K1Km8aVsL4S4njWif33i5%2FuLb9CFJFKFuYa%2Fln7US5I%3D&reserved=0


-- 
This email has been checked for viruses by AVG.
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.avg.com%2F&data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Caf4f1fd30912414d2df408d8c116f6d6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637471651668381140%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=DCcYvVHU7hXWR3nz2V4D4gH07FLFBUXiuw69vhj7%2F7A%3D&reserved=0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20210125/b48282b8/attachment.html