Index: main/workspace-repository/src/org/ametys/workspaces/repository/ExecuteScriptGenerator.java =================================================================== --- main/workspace-repository/src/org/ametys/workspaces/repository/ExecuteScriptGenerator.java (revision 26702) +++ main/workspace-repository/src/org/ametys/workspaces/repository/ExecuteScriptGenerator.java (working copy) @@ -89,6 +89,7 @@ // get current repository Session session = null; + Session liveSession = null; try { // Create a session local to the script execution. @@ -96,11 +97,13 @@ Credentials credentials = _repositoryProvider.getCredentials(); session = repository.login(credentials, "default"); + liveSession = repository.login(credentials, "live"); //create bindings SimpleBindings sb = new SimpleBindings(); sb.put("repository", new RepositoryWrapper(repository)); sb.put("session", session); + sb.put("liveSession", liveSession); //execute script Object result = engine.eval(script, sb); @@ -141,6 +144,11 @@ { session.logout(); } + + if (liveSession != null) + { + liveSession.logout(); + } } }