Repository: incubator-milagro-mfa-sdk-ios
Updated Branches:
  refs/heads/master 4d1ed10b9 -> 4b4c745b4


Add ListUsers per backend and ListBackends methods


Project: 
http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/commit/c151174d
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/tree/c151174d
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/diff/c151174d

Branch: refs/heads/master
Commit: c151174d64506fdedb07c61af88cfefb3278729e
Parents: 4d1ed10
Author: georgi.georgiev <georgi.georg...@certivox.com>
Authored: Thu Mar 31 15:10:02 2016 +0300
Committer: georgi.georgiev <georgi.georg...@certivox.com>
Committed: Thu Mar 31 15:10:02 2016 +0300

----------------------------------------------------------------------
 mpin-sdk-core |  2 +-
 src/MPin.h    |  3 +++
 src/MPin.mm   | 22 ++++++++++++++++++++++
 3 files changed, 26 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/c151174d/mpin-sdk-core
----------------------------------------------------------------------
diff --git a/mpin-sdk-core b/mpin-sdk-core
index fc0f623..0c54c01 160000
--- a/mpin-sdk-core
+++ b/mpin-sdk-core
@@ -1 +1 @@
-Subproject commit fc0f623294108141b0053092578116d3f5e9689d
+Subproject commit 0c54c01e71f33438e4aba6c6f329e8f423087934

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/c151174d/src/MPin.h
----------------------------------------------------------------------
diff --git a/src/MPin.h b/src/MPin.h
index 9e4104e..6298b58 100644
--- a/src/MPin.h
+++ b/src/MPin.h
@@ -55,6 +55,9 @@
 + (Boolean)CanLogout:(const id<IUser>)user;
 
 + (NSMutableArray*)listUsers;
++ (NSMutableArray*) listUsers:( NSString *) backendURL;
++ (NSMutableArray*) listBackends;
+
 + ( id<IUser> ) getIUserById:(NSString *) userId;
 + (void) DeleteUser:(const id<IUser>)user;
 

http://git-wip-us.apache.org/repos/asf/incubator-milagro-mfa-sdk-ios/blob/c151174d/src/MPin.mm
----------------------------------------------------------------------
diff --git a/src/MPin.mm b/src/MPin.mm
index 3a50651..78d6a04 100644
--- a/src/MPin.mm
+++ b/src/MPin.mm
@@ -248,4 +248,26 @@ typedef sdk_non_tee::Context Context;
     return nil;
 }
 
++ (NSMutableArray*) listUsers:( NSString *) backendURL {
+    if (backendURL == nil || backendURL.length == 0 ) return nil;
+    
+    NSMutableArray * users = [NSMutableArray array];
+    std::vector<UserPtr> vUsers;
+    mpin.ListUsers(vUsers, [backendURL UTF8String]);
+    for (int i = 0; i<vUsers.size(); i++) {
+        [users addObject:[[User alloc] initWith:vUsers[i]]];
+    }
+    return users;
+}
+
++ (NSMutableArray*) listBackends {
+    NSMutableArray * backends = [NSMutableArray array];
+    std::vector<String> vBackends;
+    mpin.ListBackends(vBackends);
+    for (int i = 0; i<vBackends.size(); i++) {
+        [backends addObject:[NSString 
stringWithUTF8String:vBackends[i].c_str()]];
+    }
+    return backends;
+}
+
 @end

Reply via email to