jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@adobe.com>
Subject Re: New information about my last email...
Date Mon, 17 Jan 2011 17:11:54 GMT
On 17.01.11 17:52, "Javier Arias" <jarias@ujaen.es> wrote:

>I have achieved change the admin password by this Java code:
>
>Repository repository = new TransientRepository(new
>          File(_repositoryToConnect));
>
>Session session = repository.login(new
>SimpleCredentials("admin","admin");
>
>UserManager userManager = ((JackrabbitSession)
>session).getUserManager();
>
>Authorizable authorizable = userManager.getAuthorizable("admin");
>            
>boolean admin = ((User) authorizable).isAdmin();
>
>if (admin)
>     {
>           authorizable = userManager.getAuthorizable(user);
>           ((User) authorizable).changePassword(newPassword);
>     }
>
>session.save();
>session.logout();

Hmm, looks good to me.

> I am using the JackRabbit standalone.

I am not too knowledgable about that one, maybe the login there has an
issue...

Regards,
Alex

-- 
Alexander Klimetschek
Developer // Adobe (Day) // Berlin - Basel


Mime
View raw message