Commit eac5f807 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Turn on multisite for STUDLY() users.

parent c03ce42b
......@@ -693,6 +693,8 @@ function SPITFORM($formfields, $newuser, $errors)
}
$isadmin = (isset($this_user) && ISADMIN() ? 1 : 0);
echo " window.ISADMIN = $isadmin;\n";
$multisite = (isset($this_user) && (ISADMIN() || STUDLY()) ? 1 : 0);
echo " window.MULTISITE = $multisite;\n";
echo "</script>\n";
echo "<script src='js/lib/jquery-2.0.3.min.js?nocache=asdfasdf'></script>\n";
echo "<script src='js/lib/bootstrap.js?nocache=asdfasdf'></script>\n";
......
......@@ -16,6 +16,7 @@ function (_, Constraints, sup, ppstart, JacksEditor, aboutaptString, aboutcloudS
var ispprofile = 0;
var webonly = 0;
var isadmin = 0;
var multisite = 0;
var portal = null;
var registered = false;
var JACKS_NS = "http://www.protogeni.net/resources/rspec/ext/jacks/1";
......@@ -42,6 +43,7 @@ function (_, Constraints, sup, ppstart, JacksEditor, aboutaptString, aboutcloudS
registered = window.REGISTERED;
webonly = window.WEBONLY;
isadmin = window.ISADMIN;
multisite = window.MULTISITE;
portal = window.PORTAL;
ajaxurl = window.AJAXURL;
......@@ -365,7 +367,7 @@ function (_, Constraints, sup, ppstart, JacksEditor, aboutaptString, aboutcloudS
var continuation = function(rspec, description, name, amdefault, ispp) {
$('#showtopo_title').html("<h3>" + name + "</h3>");
$('#showtopo_description').html(description);
sup.maketopmap('#showtopo_div', rspec, false, !isadmin);
sup.maketopmap('#showtopo_div', rspec, false, !multisite);
};
GetProfile($(selectedElement).attr('value'), continuation);
}
......@@ -373,7 +375,7 @@ function (_, Constraints, sup, ppstart, JacksEditor, aboutaptString, aboutcloudS
// Used to generate the topology on Tab 3 of the wizard for non-pp profiles
function ShowProfileSelectionInline(selectedElement, root, selectionPane) {
editor = new JacksEditor(root, true, true,
selectionPane, true, !isadmin);
selectionPane, true, !multisite);
var continuation = function(rspec, description, name, amdefault, ispp) {
editor.show(rspec);
};
......@@ -529,7 +531,7 @@ function (_, Constraints, sup, ppstart, JacksEditor, aboutaptString, aboutcloudS
sites[siteid] = siteid;
});
if (!isadmin || Object.keys(sites).length <= 1) {
if (!multisite || Object.keys(sites).length <= 1) {
$("#site_selector").addClass("hidden");
$("#nosite_selector").removeClass("hidden");
// Clear the form data.
......
......@@ -33,6 +33,7 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, ppstart,
var genilibwarned= false;
var isppprofile = false;
var isadmin = 0;
var multisite = 0;
var APT_NS = "http://www.protogeni.net/resources/rspec/ext/apt-tour/1";
var manageTemplate = _.template(manageString);
var waitwaitTemplate = _.template(waitwaitString);
......@@ -54,6 +55,7 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, ppstart,
ajaxurl = window.AJAXURL;
isppprofile = window.ISPPPROFILE;
isadmin = window.ISADMIN;
multisite = window.MULTISITE;
var fields = JSON.parse(_.unescape($('#form-json')[0].textContent));
var errors = JSON.parse(_.unescape($('#error-json')[0].textContent));
......@@ -119,7 +121,7 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, ppstart,
var showtopo_html = showtopoTemplate({});
$('#showtopomodal_div').html(showtopo_html);
editor = new JacksEditor($('#editmodal_div'),
false, false, false, false, !isadmin);
false, false, false, false, !multisite);
var renderer_html = rendererTemplate({});
$('#renderer_div').html(renderer_html);
var oops_html = oopsTemplate({});
......
......@@ -17,7 +17,7 @@ function(_, sup, JacksEditor, ppmodalString, ppbodyString, chooserString)
var defaults = null;
var uuid = "";
var registered = true;
var isadmin = 0;
var multisite = 0;
var RSPEC = null;
var configuredone_callback = null;
......@@ -199,7 +199,7 @@ function(_, sup, JacksEditor, ppmodalString, ppbodyString, chooserString)
function StartPP(args) {
uuid = args.uuid;
registered = args.registered;
isadmin = args.isadmin;
multisite = args.multisite;
if (bodyTemplate) {
GenerateModalBody(defaults, null);
......@@ -208,7 +208,7 @@ function(_, sup, JacksEditor, ppmodalString, ppbodyString, chooserString)
}
// Caller might already have an editor instance.
editor = new JacksEditor($('#inline_jacks'), true, true,
true, true, !isadmin);
true, true, !multisite);
configuredone_callback = args.callback;
/*
......
......@@ -67,6 +67,7 @@ function SPITFORM($formfields, $errors)
$activity = 0;
$ispp = 0;
$isadmin = (ISADMIN() ? 1 : 0);
$multisite = (ISADMIN() || STUDLY() ? 1 : 0);
$version_uuid = "null";
$profile_uuid = "null";
......@@ -165,6 +166,7 @@ function SPITFORM($formfields, $errors)
echo " window.CANMODIFY= $canmodify;\n";
echo " window.CANPUBLISH= $canpublish;\n";
echo " window.ISADMIN = $isadmin;\n";
echo " window.MULTISITE = $multisite;\n";
echo " window.HISTORY = $history;\n";
echo " window.ACTIVITY = $activity;\n";
echo " window.TITLE = '$title';\n";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment