mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-21 04:12:37 +09:00
Bug #847 - #918: Add password to one.user.chauth method, this way the driver and the auth driver are changed atomically
This commit is contained in:
1 parent
319e170ea5
commit
303d17b260
6 files changed
+46
-15
No files matched your search
@@ -146,16 +146,20 @@ public class User extends PoolElement{
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the auth driver of the given user
|
||||
* Changes the auth driver and the password of the given user
|
||||
*
|
||||
* @param client XML-RPC Client.
|
||||
* @param id The user id (uid) of the target user we want to modify.
|
||||
* @param auth The new auth driver.
|
||||
* @param password The new password.
|
||||
* @return If an error occurs the error message contains the reason.
|
||||
*/
|
||||
public static OneResponse chauth(Client client, int id, String auth)
|
||||
public static OneResponse chauth(Client client,
|
||||
int id,
|
||||
String auth,
|
||||
String password)
|
||||
{
|
||||
return client.call(CHAUTH, id, auth);
|
||||
return client.call(CHAUTH, id, auth, password);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -222,14 +226,15 @@ public class User extends PoolElement{
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the auth driver of the given user
|
||||
* Changes the auth driver and the password of the given user
|
||||
*
|
||||
* @param auth The new auth driver.
|
||||
* @param password The new password.
|
||||
* @return If an error occurs the error message contains the reason.
|
||||
*/
|
||||
public OneResponse chauth(String auth)
|
||||
public OneResponse chauth(String auth, String password)
|
||||
{
|
||||
return chauth(client, id, auth);
|
||||
return chauth(client, id, auth, password);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -121,7 +121,7 @@ public class UserTest
|
||||
|
||||
assertTrue( user.xpath("AUTH_DRIVER").equals("core") );
|
||||
|
||||
res = user.chauth("new_driver");
|
||||
res = user.chauth("new_driver", password);
|
||||
|
||||
res = user.info();
|
||||
assertTrue( res.getErrorMessage(), !res.isError() );
|
||||
|
||||
Reference in new issue
Block a user