Author: jfthomps
Date: Fri Jun  1 18:07:07 2012
New Revision: 1345292

URL: http://svn.apache.org/viewvc?rev=1345292&view=rev
Log:
VCL-576
Finalizing for 2.3 release

VCL-463
add ability to deploy images as servers

serverprofiles.php: modified serverProfiles - allow users with serverCheckOut 
but without ServerProfileAdmin to only see the deploy part

requests.php: modified AJsubmitEditRequest - added underscores to what is 
allowed in servername

utils.php:
-modified checkAccess and getNavMenu - allow access to server profiles section 
if user has serverCheckOut
-modified getUserRequests - do not set useraccountready to 0 for clusters when 
the owner is viewing the site
-modified requestIsReady - return 1 if request is in state servermodified and 
computer is in state reserved
-modified getSelectLanguagePulldown - added id="localeform" to form

Modified:
    incubator/vcl/trunk/web/.ht-inc/requests.php
    incubator/vcl/trunk/web/.ht-inc/serverprofiles.php
    incubator/vcl/trunk/web/.ht-inc/utils.php

Modified: incubator/vcl/trunk/web/.ht-inc/requests.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/requests.php?rev=1345292&r1=1345291&r2=1345292&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/requests.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/requests.php Fri Jun  1 18:07:07 2012
@@ -2633,7 +2633,7 @@ function AJsubmitEditRequest() {
                        $testlogingroupid != $request['logingroupid'])
                        $updategroups = 1;
                $servername = processInputVar('servername', ARG_STRING);
-               if(! preg_match('/^([-a-zA-Z0-9\.\(\) ]){3,255}$/', 
$servername)) {
+               if(! preg_match('/^([-a-zA-Z0-9\.\(\)_ ]){3,255}$/', 
$servername)) {
                        $cdata = getContinuationVar();
                        $cont = addContinuationsEntry('AJsubmitEditRequest', 
$cdata, SECINDAY, 1, 0);
                        sendJSON(array('status' => 'error',

Modified: incubator/vcl/trunk/web/.ht-inc/serverprofiles.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/serverprofiles.php?rev=1345292&r1=1345291&r2=1345292&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/serverprofiles.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/serverprofiles.php Fri Jun  1 18:07:07 2012
@@ -28,24 +28,29 @@
 ///
 
////////////////////////////////////////////////////////////////////////////////
 function serverProfiles() {
+       global $user;
        print "<div dojoType=\"dojo.data.ItemFileWriteStore\" 
jsId=\"profilesstore\" ";
        print "data=\"profilesstoredata\"></div>\n";
-       print "<div id=\"mainTabContainer\" 
dojoType=\"dijit.layout.TabContainer\"\n";
-       print "     style=\"width:630px;height:600px\">\n";
+       if(in_array("serverProfileAdmin", $user["privileges"])) {
+               print "<div id=\"mainTabContainer\" 
dojoType=\"dijit.layout.TabContainer\"\n";
+               print "     style=\"width:630px;height:600px\">\n";
+       }
        print "<div id=\"deploytab\" dojoType=\"dijit.layout.ContentPane\" 
title=\"Deploy Server\" selected=\"true\">\n";
        $data = deployHTML();
        print $data['html'];
        print "</div>\n"; # deploy tab
 
-       print "<div id=\"manageprofiles\" dojoType=\"dijit.layout.ContentPane\" 
title=\"Manage Profiles\">\n";
-       $data = manageProfilesHTML();
-       print $data['html'];
-       print "</div>\n"; # manageprofiles tab
-
-       print "<div id=\"grouping\" dojoType=\"dijit.layout.ContentPane\" 
title=\"Manage Grouping\">\n";
-       $data = manageGroupingHTML();
-       print $data['html'];
-       print "</div>\n"; # grouping tab
+       if(in_array("serverProfileAdmin", $user["privileges"])) {
+               print "<div id=\"manageprofiles\" 
dojoType=\"dijit.layout.ContentPane\" title=\"Manage Profiles\">\n";
+               $data = manageProfilesHTML();
+               print $data['html'];
+               print "</div>\n"; # manageprofiles tab
+
+               print "<div id=\"grouping\" 
dojoType=\"dijit.layout.ContentPane\" title=\"Manage Grouping\">\n";
+               $data = manageGroupingHTML();
+               print $data['html'];
+               print "</div>\n"; # grouping tab
+       }
 
        print "</div>\n"; # tab container
 }

Modified: incubator/vcl/trunk/web/.ht-inc/utils.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/utils.php?rev=1345292&r1=1345291&r2=1345292&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/utils.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/utils.php Fri Jun  1 18:07:07 2012
@@ -527,7 +527,8 @@ function checkAccess() {
                                                }
                                                break;
                                        case 'serverProfiles':
-                                               if(! 
in_array("serverProfileAdmin", $user["privileges"])) {
+                                               if(! 
in_array("serverProfileAdmin", $user["privileges"]) &&
+                                                  ! in_array("serverCheckOut", 
$user["privileges"])) {
                                                        $mode = "";
                                                        $actionFunction = 
"main";
                                                        return;
@@ -5410,7 +5411,7 @@ function getUserRequests($type, $id=0) {
                                'password' => $row['password'],
                                'resacctuserid' => $row['resacctuserid']
                        );
-                       if(empty($row['resacctuserid']))
+                       if($row['userid'] != $id && 
empty($row['resacctuserid']))
                                $data[$count]['useraccountready'] = 0;
                        continue;
                }
@@ -7906,6 +7907,8 @@ function requestIsReady($request) {
           $request["computerstateid"] == 8) ||   //   and computer state inuse
           ($request["currstateid"] == 29 &&      // request current state 
servermodified
           $request["computerstateid"] == 8) ||   //   and computer state inuse
+          ($request["currstateid"] == 29 &&      // request current state 
servermodified
+          $request["computerstateid"] == 3) ||   //   and computer state 
reserved
           ($request["currstateid"] == 14 &&      // request current state 
pending
           $request["laststateid"] == 8 &&        //   and last state inuse and
           $request["computerstateid"] == 8) ||   //   computer inuse
@@ -10397,7 +10400,8 @@ function getNavMenu($inclogout, $inchome
                $rt .= "<a href=\"" . BASEURL . SCRIPT;
                $rt .= _("?mode=selectMgmtnodeOption\">Management 
Nodes</a></li>\n");
        }
-       if(in_array("serverProfileAdmin", $user["privileges"])) {
+       if(in_array("serverProfileAdmin", $user["privileges"]) ||
+          in_array("serverCheckOut", $user["privileges"])) {
                $rt .= menulistLI('serverProfiles');
                $rt .= "<a href=\"" . BASEURL . SCRIPT;
                $rt .= "?mode=serverProfiles\">" . _("Server Profiles") . 
"</a></li>\n";
@@ -11325,7 +11329,7 @@ function getSelectLanguagePulldown() {
        if(! is_array($user))
                $user['id'] = 0;
 
-       $rt  = "<form name=\"localeform\" action=\"" . BASEURL . SCRIPT . "\" 
method=post>\n";
+       $rt  = "<form name=\"localeform\" id=\"localeform\" action=\"" . 
BASEURL . SCRIPT . "\" method=post>\n";
        $rt .= "<select name=\"continuation\" 
onChange=\"document.localeform.submit();\">\n";
        $cdata = array('IP' => $remoteIP, 'oldmode' => $mode);
        if($mode == 'selectauth') {


Reply via email to