Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Using SaveUserCustomization in add-on
Hi there,
I'm having some trouble accessing the SaveUserCustomization function, which I believe should be in the ObjectFactory called UserManager. I've written my add-on and am at the step to simply append the value to the user's account but it aint working too well. This is what I've got:
class GeoBoatingPrefForm extends PostBackControl {
function GeoBoatingPrefForm(&$Context) {
$this->Name = 'GeoBoatingPrefForm';
$this->ValidActions = array('SaveBoatDetails', 'BoatDetails');
$this->Constructor($Context);
$PostBackAction = ForceIncomingString('PostBackAction', '');
if ($PostBackAction == 'BoatDetails') {
$this->Context->BodyAttributes = ' onload="load();" onunload="GUnload()"';
} else if ($PostBackAction == 'SaveBoatDetails') {
$this->UserManager->SaveUserCustomization("GEO_BOATING_BOAT_MODEL", ForceIncomingString('GEO_BOATING_BOAT_MODEL', ''));
$this->UserManager->SaveUserCustomization("GEO_BOATING_BOAT_COLOUR", ForceIncomingString('GEO_BOATING_BOAT_COLOUR', ''));
$this->UserManager->SaveUserCustomization("GEO_BOATING_BOAT_MODEL", ForceIncomingString('GEO_BOATING_BOAT_MODEL', ''));
}
}
Am I doing that right? I'm assuming that UserManager is accessible within the class...if Context is why wouldn't UserManager not be?
The next hurdle I have to meet is iterating through all users and extracting these customised fields. Sounds like a challenge - but fun. :-p
Thanks in advance,
Dave
0