Hi all,
first of all thank you for the add-on, this is just what I need.
Is anyone here know how to show the predefined user attributes in settings.php?PostBackAction=Applicants page, you know the page where you're gonna approve or decline membership applicants?
Thank you.
I am trying to add another function for SaveIdentity. I found that if another extension calls SaveIdentity the Predefined Attributes field gets emptied.
Here are the two functions I created:
/*////////////////////////////////
// @name: SaveIdentity
// @description: Adds Predefined Attributes to SqlBuilder in UserManagers SaveIdentity
// @param: $UserManager (Reference to the UserManager Object)
// @return: -
*/
function SaveIdentity($UserManager) {
$this->GetAttributesFromDatabase();
$s = &$UserManager->DelegateParameters['SqlBuilder'];
$s->AddFieldNameValue($this->ColumnName, $this->Attributes);
}
/*////////////////////////////////
// @name: PredefinedAttributes_SaveIdentity
// @description: called by delegation and 'redirects' to function in class
// @param: Object UserManager
// @return: -
*/
function PredefinedAttributes_SaveIdentity($UserManager) {
$pa = new PredefinedAttributes($UserManager->Context, $UserManager->User);
$pa->SaveIdentity($UserManager);
}
$Context->AddToDelegate('UserManager', 'PreIdentityUpdate', 'PredefinedAttributes_SaveIdentity');
# djcrazysk8er It works, but you have to add to the People.Class.User.Manager.php this line in the function SaveIdentity, of course before Database->Update. $this->CallDelegate('PreIdentityUpdate');
Index in the appg/database.php is required too. $DatabaseColumns['User']['PredefinedAttributes'] = 'PredefinedAttributes';
Comments
Here are the two functions I created:
/*//////////////////////////////// // @name: SaveIdentity // @description: Adds Predefined Attributes to SqlBuilder in UserManagers SaveIdentity // @param: $UserManager (Reference to the UserManager Object) // @return: - */ function SaveIdentity($UserManager) { $this->GetAttributesFromDatabase(); $s = &$UserManager->DelegateParameters['SqlBuilder']; $s->AddFieldNameValue($this->ColumnName, $this->Attributes); } /*//////////////////////////////// // @name: PredefinedAttributes_SaveIdentity // @description: called by delegation and 'redirects' to function in class // @param: Object UserManager // @return: - */ function PredefinedAttributes_SaveIdentity($UserManager) { $pa = new PredefinedAttributes($UserManager->Context, $UserManager->User); $pa->SaveIdentity($UserManager); } $Context->AddToDelegate('UserManager', 'PreIdentityUpdate', 'PredefinedAttributes_SaveIdentity');
It works, but you have to add to the People.Class.User.Manager.php
this line in the function SaveIdentity, of course before Database->Update.
$this->CallDelegate('PreIdentityUpdate');
Index in the appg/database.php is required too.
$DatabaseColumns['User']['PredefinedAttributes'] = 'PredefinedAttributes';