File: admin_virtini.vsp

package info (click to toggle)
virtuoso-opensource 6.1.6+dfsg2-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 260,992 kB
  • ctags: 125,220
  • sloc: ansic: 652,748; sql: 458,419; xml: 282,834; java: 61,031; sh: 40,031; cpp: 36,890; cs: 25,240; php: 12,692; yacc: 9,523; lex: 7,018; makefile: 6,157; jsp: 4,484; awk: 1,643; perl: 1,013; ruby: 1,003; python: 326
file content (233 lines) | stat: -rw-r--r-- 7,681 bytes parent folder | download | duplicates (2)
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
<?vsp 
--  
--  $Id$
--  
--  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
--  project.
--  
--  Copyright (C) 1998-2012 OpenLink Software
--  
--  This project is free software; you can redistribute it and/or modify it
--  under the terms of the GNU General Public License as published by the
--  Free Software Foundation; only version 2 of the License, dated June 1991.
--  
--  This program 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
--  General Public License for more details.
--  
--  You should have received a copy of the GNU General Public License along
--  with this program; if not, write to the Free Software Foundation, Inc.,
--  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--  
--  

 adm_pre_page(lines);
?>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
  <HEAD>
    <link rel="stylesheet" type="text/css" href="<?=adm_what_css()?>">
    <title>Virtuoso Configuration Editor</title>
    <meta name="AUTHOR" content="OpenLink Software">
    <meta name="DESCRIPTION" content="Virtuoso.ini Configuration Editor">
  </HEAD>

  <BODY>

<?vsp

declare sect, item, item_value, new_item, t_g varchar;
declare items, sections, i, j, idx, _pos integer;

if (not adm_check_auth (lines))
  {
    adm_tell_unauth(lines);
    return (0);
  }

if (not adm_check_auth (lines))
  {
    adm_tell_unauth(lines);
    return (0);
  }

_pos := atoi (get_keyword('dd_sect', params, '0'));
sect := cfg_section_name(virtuoso_ini_path(), _pos);

if (isinteger (sect))
  sect := cast (sect as varchar);
if ('' <> get_keyword('really_delete', params, ''))
{
-- remove one
	cfg_write(virtuoso_ini_path(), sect, get_keyword('to_go', params, ''), '');
}

if ('' <> get_keyword('update_ini', params, ''))
{
-- perform the update to the ini file

	idx :=0;
	while (idx < length(params))
	{
		item := aref(params, idx);
		if ('_ini_'  = left(item, 5))
		{	item := ltrim(item, '_ini_');
		        new_item := get_keyword (concat('n_',item), params, item);
			item_value := aref(params, idx +1);
                        if (new_item <> item)
			  cfg_write(virtuoso_ini_path(), sect, item, '');
			cfg_write(virtuoso_ini_path(), sect, new_item, item_value);
		}
		idx := idx +2;
	}

	if ('' <> get_keyword('_new_item', params, ''))
	{	item := get_keyword('_new_item', params, NULL);
		item_value := get_keyword('_new_value', params, '');
	 	cfg_write(virtuoso_ini_path(), sect, item, item_value);
	}
}

sections := cfg_section_count(virtuoso_ini_path());
items := cfg_item_count(virtuoso_ini_path(), sect);

    if ('' <> get_keyword ('delete', params, ''))
    {
      goto comf_page;
    }
-- view the current section
?>

<?vsp adm_page_header('Virtuoso Configuration Editor', NULL); ?>
<FORM NAME="virtini" ACTION="admin_virtini.vsp" METHOD="post">
<TABLE CLASS="genlist" CELLPADDING="0" CELLSPACING="2" BORDER="0">
<TR><TD CLASS="genhead" COLSPAN="3">Virtuoso Configuration File</TD></TR>
<TR><TD CLASS="AdmBorders" COLSPAN="3"><IMG SRC="../images/1x1.gif" WIDTH="1" HEIGHT="2" ALT=""></TD></TR>
<TR><TD CLASS="genlisthead">&nbsp;</TD><TD COLSPAN="2" class="gendata"><?= adm_get_init_name ()?></TD></TR>
<TR><TD COLSPAN="3"><IMG SRC="../images/1x1.gif" WIDTH="1" HEIGHT="15" ALT=""></TD></TR>

<TR><TD ALIGN="right" VALIGN="top">
<TABLE class="genlist" CELLPADDING="0" CELLSPACING="2" BORDER="0">
<TR><TD class="genhead">Section</TD></TR>
<TR><TD CLASS="AdmBorders"><IMG SRC="../images/1x1.gif" WIDTH="1" HEIGHT="2" ALT=""></TD></TR>
<TR><TD>

<?vsp
	i := 0;
	http('<SELECT SIZE="10" NAME="dd_sect" onChange="javascript:document.virtini.submit();">');
	while (i < sections)
	{
		http('<OPTION '); http(select_if(cfg_section_name(virtuoso_ini_path(), i),sect));
			http(' VALUE="'); http(cast(i as varchar)); http('">');
			http(cfg_section_name(virtuoso_ini_path(), i)); http('</OPTION>');
		i := i + 1;
	}
	http('</SELECT>');
?>

</TD></TR></TABLE></TD><TD VALIGN="top">
<TABLE class="genlist" CELLPADDING="0" CELLSPACING="2" BORDER="0">
<TR><TD class="genhead" COLSPAN="3"><?=sect?></TD></TR>
<TR><TD CLASS="AdmBorders" COLSPAN="3"><IMG SRC="../images/1x1.gif" WIDTH="1" HEIGHT="2" ALT=""></TD></TR>
<TR>
     <TH class="genlistheadt">Name</TH>
     <TH class="genlistheadt">Value</TH>
     <TH class="genlistheadt">Action</TH>
</TR>

<?vsp
	j := 0;
	while (j < items)
	{
		item := cfg_item_name(virtuoso_ini_path(), sect, j);
		item_value := cfg_item_value(virtuoso_ini_path(), sect, item);
                if (item <> 'DirsAllowed' and item <> 'DirsDenied'
		    and item <> 'SafeExecutables' and item <> 'DbaExecutables')
		  {
		http(sprintf('<TR><TD class="gendata"><INPUT TYPE="hidden" NAME="n_%V" VALUE="%V">%V</TD>',
		      item, item, item));
		http(sprintf('<TD><INPUT TYPE="text" SIZE="40" NAME="_ini_%V" VALUE="%V" /></TD>', item, item_value));
		http(sprintf('<TD class="gendata"><a class="tablelistaction" href="admin_virtini.vsp?to_go=%s&delete=1&dd_sect=%i&update_ini=1">Remove</a></TD></TR>', item, _pos));
		  }
		else
		  {
		http(sprintf('<TR><TD class="genlisthead">%V</TD>', item));
		http(sprintf('<TD>%V</TD>', item_value));
		http(sprintf('<TD>&nbsp;</TD></TR>', item));
		  }
		j := j + 1;
	}

if ('' <> get_keyword('add', params, ''))
{
	http('<TR><TD COLSPAN="3" class="genlistheadt">New:</TD></TR>');
	http('<TR><TD><INPUT TYPE="text" NAME="_new_item" VALUE="" /></TD>');
	http('<TD><INPUT TYPE="text" SIZE="40" NAME="_new_value" VALUE="" /></TD></TR>');
}
?>


<TR><TD COLSPAN="2" ALIGN="right">
	<INPUT TYPE="submit" FOCUSED NAME="update_ini" VALUE="Update File" />
	<?vsp if ('' = get_keyword('add', params, '')) http('<INPUT TYPE="submit" NAME="add" VALUE="Add" />'); ?>
</TD></TR>
</TABLE></TD></TR>
<TR><TD ALIGN="middle">
<?vsp

if ('' <> get_keyword('delete', params, ''))
{
-- remove one question
	http(sprintf('<TABLE><TR><TD class="genlisthead">Remove "%V", Are you sure? ', get_keyword('to_go', params, '')));
	http(sprintf('<INPUT TYPE="hidden" NAME="to_go" VALUE="%V">', get_keyword('to_go', params, '')));
	http('<INPUT TYPE="submit" NAME="really_delete" VALUE="Yes"><INPUT TYPE="submit" NAME="nope" VALUE="No">');
	http('</TD></TR></TABLE>');
}
?>
</TD></TR></TABLE>
</FORM>

 <div style="margin-left: 40px; margin-right: 40px; text-align: left;"><a name="info"><b><i>Important:</i></b></a>
    Changes will take effect upon server restart.
 </div>

<?vsp adm_page_footer(); ?>
</HTML>
<?vsp
  return;
comf_page:;

--  declare t_g varchar;

  t_g := get_keyword('to_go', params, '');
?>
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="<?=adm_what_css()?>">
    <title>Confirmation</title>
    <meta name="AUTHOR" content="OpenLink Software">
    <meta name="DESCRIPTION" content="Deleting Database User">
  </head>
  <BODY>
<?vsp adm_page_header(concat ('Removing Configuration Parameter ', t_g), NULL); ?>
    <form method="POST" action="admin_virtini.vsp" name="delete_ini_prm">
    <table border="0" width="60%">
      <tr><td>You are about to remove the parameter <?= t_g ?>.
      This removal cannot be undone. Do you wish to continue?</td></tr>
      <tr>
      <td align="center">
	 <INPUT TYPE="hidden" NAME="to_go" VALUE="<?= t_g ?>">
	 <INPUT TYPE="hidden" NAME="dd_sect" VALUE="<?= _pos ?>">
         <INPUT TYPE="submit" NAME="really_delete" VALUE="Remove">&nbsp;
	 <INPUT TYPE="submit" NAME="proceed" VALUE="Cancel"></td>
      </tr>
    </form>
    </table>
</TD></TR>
<TR><TD CLASS="ctrlmain" COLSPAN="2"><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="15" ALT=""></TD></TR>
</TABLE>
<?include admin_footer.vsp ?>
  </body>
</html>