Revision ef2de83f

View differences:

src/sunstone/public/app/tabs/settings-tab/panels/user-config.js
7 7
  var Locale = require('utils/locale');
8 8
  var Config = require('sunstone-config');
9 9
  var OpenNebula = require('opennebula');
10
  var TemplateUtils = require('utils/template-utils');
10 11
  var Sunstone = require('sunstone');
11 12
  var Notifier = require('utils/notifier');
12 13

  
......
99 100
        return false;
100 101
      }
101 102

  
102
      var template_str = 'SSH_PUBLIC_KEY = "'+keypair+'"';
103
      var template_str = 'SSH_PUBLIC_KEY = "'+TemplateUtils.escapeDoubleQuotes(keypair)+'"';
103 104

  
104 105
      Sunstone.runAction("User.append_template", "-1", template_str);
105 106

  
src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/context.js
124 124
    if ($("#ssh_context", context).is(":checked")) {
125 125
      var public_key = $("#ssh_public_key", context).val();
126 126
      if (public_key) {
127
        contextJSON["SSH_PUBLIC_KEY"] = public_key;
127
        contextJSON["SSH_PUBLIC_KEY"] = TemplateUtils.escapeDoubleQuotes(public_key);
128 128
      } else {
129 129
        contextJSON["SSH_PUBLIC_KEY"] = '$USER[SSH_PUBLIC_KEY]';
130 130
      }
src/sunstone/public/app/tabs/users-tab/panels/info.js
6 6
  var TemplateInfo = require('hbs!./info/html');
7 7
  var TemplateChgrpTr = require('hbs!./info/chgrp-tr');
8 8
  var ResourceSelect = require('utils/resource-select');
9
  var TemplateUtils = require('utils/template-utils');
9 10
  var Locale = require('utils/locale');
10 11
  var OpenNebulaUser = require('opennebula/user');
11 12
  var Sunstone = require('sunstone');
......
148 149

  
149 150
    context.off("change", "#user_ssh_public_key_textarea");
150 151
    context.on("change", "#user_ssh_public_key_textarea", function() {
151
      var template_str = 'SSH_PUBLIC_KEY = "'+$(this).val()+'"';
152
      var template_str = 'SSH_PUBLIC_KEY = "'+TemplateUtils.escapeDoubleQuotes($(this).val())+'"';
152 153

  
153 154
      Sunstone.runAction("User.append_template", that.element.ID, template_str);
154 155
    });

Also available in: Unified diff