function configureAppForUser(UserAccountModel $user = null)
{
    global $app;
    # ////////////// 12 or 24 hour clock
    $clock12Hour = true;
    if ($user) {
        $clock12Hour = $user->getIsClock12Hour();
    }
    $app['currentUserClock12Hour'] = $clock12Hour;
    $app['twig']->addGlobal('currentUserClock12Hour', $clock12Hour);
}
 public function editPreferences(UserAccountModel $user)
 {
     global $DB;
     $stat = $DB->prepare("UPDATE user_account_information SET  is_clock_12hour=:is_clock_12hour " . "WHERE id =:id");
     $stat->execute(array('id' => $user->getId(), 'is_clock_12hour' => $user->getIsClock12Hour() ? 1 : 0));
 }