import common
import controllers
import logging
import optparse

_logger = logging.getLogger(__name__)

class Options(object):
    pass

def wsgi_postload():
    import openerp
    import os
    import tempfile
    _logger.info("embedded mode")
    o = Options()
    o.dbfilter = openerp.tools.config['dbfilter']
    o.server_wide_modules = openerp.conf.server_wide_modules or ['web']
    o.session_storage = os.path.join(tempfile.gettempdir(), "oe-sessions")
    o.addons_path = openerp.modules.module.ad_paths
    o.serve_static = True
    o.backend = 'local'

    app = common.http.Root(o)
    openerp.wsgi.register_wsgi_handler(app)


@@ -204,16 +204,35 @@
 empfile%0A
+    import getpass%0A
     _log
@@ -257,16 +257,16 @@
  mode%22)%0A
-
     o = 
@@ -397,16 +397,113 @@
 %5B'web'%5D%0A
+    try:%0A        username = getpass.getuser()%0A    except Exception:%0A        username = %22unknown%22%0A
     o.se
@@ -566,17 +566,29 @@
 sessions
-%22
+-%22 + username
 )%0A    o.

append username in session directory