Merge pull request #786 from romainneutron/fix-1572

[3.8] Fix #1572 : Add configuration customization
This commit is contained in:
Romain Neutron
2013-11-14 08:51:19 -08:00
3 changed files with 42 additions and 1 deletions

View File

@@ -1334,11 +1334,27 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
}
}
if (isset($this->app['phraseanet.configuration']['user-settings'])) {
$this->_prefs = array_replace(
$this->_prefs,
// remove keys that are not defined in default values
array_intersect_key(
$this->app['phraseanet.configuration']['user-settings'],
self::$def_values
)
);
}
$this->preferences_loaded = true;
return $this;
}
public function purgePreferences()
{
$this->notifications_preferences_loaded = $this->preferences_loaded = false;
}
protected function load_notifications_preferences(Application $app)
{
$this->load_preferences();
@@ -1352,7 +1368,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
}
}
}
$this->notification_preferences_loaded = true;
$this->notifications_preferences_loaded = true;
}
public function get_notifications_preference(Application $app, $notification_id)