Hi!
I am looking for a way to share user specific data between connected users. For example, all participants should know each other IDs(our own system IDs, not LCCS).
User's custom fields looks the best solution for this, but I can't find a way to register one using PHP, while creating room.
How to register User's custom field using PHP? Or may be there are better solution to make such things?
Solved! Go to Solution.
Views
Replies
Total Likes
Got it, just need to add new node to UserManager collection.
const USER_MANAGER_COLLECTION = 'UserManager';
static private $USER_MANAGER_CUSTOM_FIELD_CONFIGURATION = array(
'accessModel'=>self::ROLE_VIEWER,
'publishModel'=>self::ROLE_VIEWER,
'persistItems'=>true,
'modifyAnyItem'=>false,
'userDependentItems'=>true,
'sessionDependentItems'=>false,
'itemStorageScheme'=>self::STORAGE_SCHEME_MANUAL,
'allowPrivateMessages'=>true,
'lazySubscription'=>false,
'p2pDataMessaging'=>false
);
const USER_INVITE_ID_CUSTOM_FIELD = 'inviteId';
static private function createUserManagerCustomFields($room){
$account = self::init();
$collection = self::USER_MANAGER_COLLECTION;
$account->subscribeCollection($room, $collection);
$account->createNode($room, $collection, self::USER_INVITE_ID_CUSTOM_FIELD, self::$USER_MANAGER_CUSTOM_FIELD_CONFIGURATION);
}
Views
Replies
Total Likes
Got it, just need to add new node to UserManager collection.
const USER_MANAGER_COLLECTION = 'UserManager';
static private $USER_MANAGER_CUSTOM_FIELD_CONFIGURATION = array(
'accessModel'=>self::ROLE_VIEWER,
'publishModel'=>self::ROLE_VIEWER,
'persistItems'=>true,
'modifyAnyItem'=>false,
'userDependentItems'=>true,
'sessionDependentItems'=>false,
'itemStorageScheme'=>self::STORAGE_SCHEME_MANUAL,
'allowPrivateMessages'=>true,
'lazySubscription'=>false,
'p2pDataMessaging'=>false
);
const USER_INVITE_ID_CUSTOM_FIELD = 'inviteId';
static private function createUserManagerCustomFields($room){
$account = self::init();
$collection = self::USER_MANAGER_COLLECTION;
$account->subscribeCollection($room, $collection);
$account->createNode($room, $collection, self::USER_INVITE_ID_CUSTOM_FIELD, self::$USER_MANAGER_CUSTOM_FIELD_CONFIGURATION);
}
Views
Replies
Total Likes