[EP-tech] disable login for users

Yuri yurj at alfa.it
Mon Jan 31 14:45:57 GMT 2022


CAUTION: This e-mail originated outside the University of Southampton.

Hi!

  sorry for the noise, I've solved with

$c->{check_user_password} = sub {
    my( $session, $username, $password ) = @_;

    my $user = EPrints::DataObj::User::user_with_username( $session,
$username );
    return 0 unless $user;

    my $user_type = $user->get_type;
    if( $user_type eq "admin" || $user_type eq "editor" )
    {
       # internal authentication for "admin" type
       return $session->get_database->valid_login( $username, $password );
    }

    return 0;
}

in <archive>/cfg/cfg.d/user_login.pl

Il 31/01/22 15:34, Yuri via Eprints-tech ha scritto:
> CAUTION: This e-mail originated outside the University of Southampton.
>
> Hi!
>
>    I'm migrating an Eprints repository and I would like no user (but
> editor and admin yes) could login or do anything. I've disabled creating
> logins but also I would like to stop existing users.
>
>    What is the simplest way? Remove permissions to the user role?
>
>
> *** 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&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2d6ee929dee04fc6c49a08d9e4c864cd%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637792371598071920%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&amp;sdata=CyI%2FyGFyoy1At4XfEQ9StiykXqg4Qyy2Lii5jYl%2Bba8%3D&amp;reserved=0
> *** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2d6ee929dee04fc6c49a08d9e4c864cd%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637792371598071920%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&amp;sdata=CPTQe%2BXDYlLfKxW%2BwMx%2BGT%2FTJ8k8TbwyggauFxbO%2F4A%3D&amp;reserved=0



More information about the Eprints-tech mailing list