summaryrefslogtreecommitdiffstats
path: root/dogtag/tps-ui/shared/docroot/tokendb/editConfig.template
blob: a4091870a8eebb04a9fce42ef06945ec7b9c9582 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<!-- --- BEGIN COPYRIGHT BLOCK ---
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     License as published by the Free Software Foundation.
     
     This library is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     Lesser General Public License for more details.
     
     You should have received a copy of the GNU Lesser General Public
     License along with this library; if not, write to the Free Software
     Foundation, Inc., 51 Franklin Street, Fifth Floor,
     Boston, MA  02110-1301  USA 
     
     Copyright (C) 2010 Red Hat, Inc.
     All rights reserved.
     --- END COPYRIGHT BLOCK --- -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
<link rel="shortcut icon" href="/pki/images/favicon.ico" />
<HEAD>
<TITLE>TPS</Title>
</HEAD>

<table border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="#000000">
  <tr>
    <td> 
      <table border="0" cellspacing="12" cellpadding="0">
        <tr>
          <td><img src="/pki/images/logo_header.gif"></td>
          <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
          <td><font size="+1" face="PrimaSans BT, Verdana, sans-serif" color="white">Red Hat<sup><font color="#999999" size="-2">&reg;</font></sup> TPS Services</font></td>
        </tr>
      </table>
    </td> 
  </tr>
</table>
<p>

<BODY>

<CMS_TEMPLATE>

<SCRIPT type="text/JavaScript">
<!--
var uri0 = "";
if (typeof(uriBase) == "undefined") {
    uri0 += "/tus";
} else {
    uri0 += uriBase;
}

String.prototype.htmlEntities = function () {
   return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
};

String.prototype.unescapeEntry = function () {
   return this.replace(/&dbquote/g,'\"').replace(/&singlequote/g,'\'').replace(/&lessthan/g,'<').replace(/&greaterthan/g, '>');
};

String.prototype.escapeEntry = function () {
   return this.replace(/\"/g,'&dbquote').replace(/\'/g,'&singlequote').replace(/</g,'&lessthan').replace(/>/g, '&greaterthan');
};

document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"+1\">"+
               "<a href=\""+uri0+"\">Main Menu</a> : Administrator Operations : " + disp_conf_type + " Configuration </font>\n");

if ((typeof(flash) != "undefined") && (flash != "")) {
    document.write("<table width=\"100%\"><tr><td align=\"left\">" +
        "<font color=\"#ff0000\"><b>" + flash.replace(/\+/g, " ") + "</b><font>" +
        "</td></tr></table>\n");
}

document.write("<table width=\"100%\"><tr><td align=\"right\">" +
                "<b>UID:</b>" + userid
                + "</td></tr></table>\n");
document.write("<HR NOSHADE SIZE=1>\n");

function validate_required(field,alerttxt) {
    with (field) {
        if (value==null||value=="") {
            alert(alerttxt);
            return false;
        }
        else {
            return true;
        }
    }
}

// validate according to the pattern
function validate_form(s) {
    var s_array = s.split("\n");
    var reg = new RegExp(conf_pattern.replace(/\$name/g, conf_name));

    for (var i=0; i< s_array.length ; i++) {
        var key_value = s_array[i].split("=");
        if (! reg.test(key_value[0])) {
            alert(key_value[0] + " is not a valid parameter.\nValid parameters have the format " + conf_pattern.replace(/\$name/g, conf_name));
            return false;
        }
    }
    return true;
}

function doUpdateConfig(form) {
        var uri = "";
        var s = document.editConfigForm.pvalues.value;
        if (typeof(uriBase) == "undefined") {
            uri += "/tus";
        } else {
            uri += uriBase;
        }
        if (validate_form(s)) {
            document.editConfigForm.pvalues.value = s.escapeEntry().replace(/\n/g, "&&");
            this.action = uri;
            return true;
        } else {
            return false;
        }
}

function doCancel() {
    var uri = "";
    if (typeof(uriBase) == "undefined") {
        uri += "/tus";
    } else {
        uri += uriBase;
    }
    location.href = uri;
}

function doDelete() {
    var uri = "";
    if (typeof(uriBase) == "undefined") {
        uri += "/tus";
    } else {
        uri += uriBase;
    }
    location.href = uri;
}


    document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0 width=100%>\n");
    document.write("<tr><td align=left width=20% bgcolor=#e5e5e5>" + disp_conf_type + ": </td>\n");
    document.write("<td align=left width=20% colspan=4>" + conf_name + "</td></tr>");

    document.write("<tr><td align=left width=20% bgcolor=#e5e5e5> Status: </td>\n");
    document.write("<td align=left width=20% colspan=4>" + conf_state.replace(/_/g, " ") + "</td></tr>");

    document.write("<form NAME =\"editConfigForm\" METHOD=POST onSubmit=\"return doUpdateConfig(this);\">\n");
    document.write("<input TYPE=hidden NAME=query VALUE=\"op=confirm_config_changes\">");
    document.write("<input TYPE=hidden NAME=ptype VALUE=\"" + conf_type + "\">");
    document.write("<input TYPE=hidden NAME=pname VALUE=\"" + conf_name + "\">");
    document.write("<input TYPE=hidden NAME=ptimestamp VALUE=\"" + conf_tstamp + "\">");

    document.write("<tr><td align=left width=20% bgcolor=#e5e5e5> Contents: </td>\n");
    document.write("<td align=left colspan=4>\n");
    if ((typeof(conf_values) == "undefined") || (conf_values.length == 0) ) {
        if ((conf_state == "Disabled") || (agent_must_approve != "true")) {
            document.write("<textarea name=pvalues cols=100 rows=40>\n");
            document.write("</textarea>\n");
        } else {
            document.write("<textarea name=pvalues style=\"color:#000000\" cols=100 rows=40 disabled=disabled>\n");
            document.write("</textarea>\n");
        }
    } else {
        if ((conf_state == "Disabled") || (agent_must_approve != "true")) {
            document.write("<textarea name=pvalues cols=100 rows=40>\n");
            document.write(conf_values.unescapeEntry().replace(/&&/g, "\r\n"));
            document.write("</textarea>\n");
        } else {
            document.write("<textarea name=pvalues cols=100 style=\"color:#000000\" rows=40 disabled=disabled>\n");
            document.write(conf_values.unescapeEntry().replace(/&&/g, "\r\n"));
            document.write("</textarea>\n");
        }
    }
    document.write("</td></tr>\n");
    document.write("</table>\n");

    document.write("<HR NOSHADE SIZE=1>");
    document.write("<DIV ALIGN=RIGHT>");

    document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=4>\n");

    document.write("<tr>\n");
    document.write("<td align=left>\n");
    if ((conf_state == "Disabled") || (agent_must_approve != "true")) {
        document.write("<input name=choice TYPE=submit VALUE=Save>");
    } else {
        document.write("<input name=choice TYPE=submit VALUE=Save disabled=disabled>");
    }
    document.write("</td>\n");

    document.write("<td align=left>\n");
    document.write("<input TYPE=button VALUE=Cancel onClick=\"doCancel();\">");
    document.write("</td>\n");

    if (agent_must_approve == "true") {
        document.write("<td align=left>\n");
        if (conf_state == "Disabled") {
            document.write("<input name=choice TYPE=submit VALUE=\"Submit For Approval\">");
        } else {
            document.write("<input name=choice TYPE=submit VALUE=\"Submit For Approval\" disabled=disabled>");
        }
        document.write("</td>\n");
    }

    document.write("</form>\n");

    if (conf_type != "Generals") {
        document.write("<td align=left>\n");
        document.write("<form name=deleteConfig method=POST onSubmit=\"return doDelete(this);\">\n");
        document.write("<input type=hidden name=query value=\"op=confirm_delete_config\">");
        document.write("<input type=hidden name=pname value=\"" + conf_name + "\">");
        document.write("<input type=hidden name=ptype value=\"" + conf_type + "\">");
        document.write("<input type=hidden name=pvalues value=\"" + conf_values.escapeEntry() + "\">");
        document.write("<input type=hidden name=pstate value=\"" + conf_state + "\">");
        document.write("<input TYPE=hidden NAME=ptimestamp VALUE=\"" + conf_tstamp + "\">");
        if ((conf_state == "Disabled")|| (agent_must_approve != "true")) {
            document.write("<input TYPE=submit VALUE=\"Delete\">");
        } else {
            document.write("<input TYPE=submit VALUE=\"Delete\" disabled=disabled>");
        }
        document.write("</form>");
        document.write("</td>\n");
    }
    document.write("</tr>\n");
    document.write("</table>\n");

//-->
</SCRIPT>

</BODY>
</HTML>