File: admin_blog_domain_setup.vsp

package info (click to toggle)
virtuoso-opensource 6.1.6%2Bdfsg2-4
  • links: PTS, VCS
  • area: main
  • in suites: buster, 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 (220 lines) | stat: -rw-r--r-- 9,402 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
<?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
--  

  declare akey, bid, id varchar;
  declare userid, ownid, tz, cont, reg, comm, filt, cnot, addblog int;
  declare tit, own, home, copy, disc, email, about, ping, hpage, kwd, photo, phome, rssver varchar;
  declare domains, dom any;

  adm_pre_page(lines);

if (http_dav_uid () <> (userid := adm_dav_check_auth (lines, 1)))
  {
    http_request_status ('HTTP/1.1 401 Unauthorized');
    http ( concat ('<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">',
	  '<HTML><HEAD>',
	  '<TITLE>401 Unauthorized</TITLE>',
	  '</HEAD><BODY><H1>Unauthorized</H1>',
          'Access to page is forbidden.</BODY></HTML>'));
    return (0);
  }

  akey := 'appKey';
  bid := {?'bid'};
  dom := {?'dom'};
  tz := 0; cont := 1; reg := 1; filt := '*default*'; hpage := '/blog/';

  if (dom is null or bid is null or bid = '' or {?'cncl'} = 'Back')
    {
      http_request_status ('HTTP/1.1 302 Found');
      http_header (sprintf ('Location: admin_blog_2.vsp?bid=%s\r\n', bid));
      return;
    }

  if ({?'post'} is not null)
    {
      tit := {?'tit'};
      copy := {?'copy'};
      disc := {?'disc'};
      email := {?'email'};
      about := {?'about'};
      ping := {?'ping'};
      cont := coalesce (atoi({?'cont'}), 0);
      reg := coalesce (atoi({?'reg'}), 0);
      comm := coalesce (atoi({?'comm'}), 0);
      filt := {?'filt'};
      hpage := {?'hpage'};
      phome := {?'phome'};
      photo := {?'photo'};
      kwd := {?'kwd'};
      cnot := coalesce (atoi({?'cnot'}), 0);
      addblog := coalesce (atoi({?'addblog'}), 0);
      rssver := {?'rssver'};
      update SYS_BLOG_DOMAINS set BD_TITLE = tit, BD_COPYRIGHTS = copy, BD_DISCLAIMER = disc,
	  	BD_ABOUT = about, BD_E_MAIL = email, BD_PINGS = ping, BD_TZ = atoi ({?'tz'}),
		BD_SHOW_CONTACT = cont, BD_SHOW_REGIST = reg, BD_COMMENTS = comm, BD_FILTER = filt,
		BD_HOME_PAGE = hpage, BD_PHOTO = photo, BD_KEYWORDS = kwd, BD_COMMENTS_NOTIFY = cnot,
		BD_ADD_YOUR_BLOG = addblog, BD_RSS_VERSION = rssver
	where BD_BLOG_ID = bid and BD_DOMAIN = dom;
      if ({?'uphoto'} <> '')
	{
	  declare cnt, nam any;
	  cnt := {?'uphoto'};
	  nam := photo;
	  if (nam = '')
       	    nam := get_keyword ('filename', get_keyword ('attr-uphoto', params, vector ('filename', 'photo.gif')));
	  DAV_RES_UPLOAD_STRSES_INT (phome||nam, cnt,'','110100100N', {?'owner'}, null, null, null, 0);
	}
    }

  declare blog_name varchar;

  whenever not found goto ef;
  select BI_TITLE, BI_HOME, BI_COPYRIGHTS, BI_DISCLAIMER, U_NAME, coalesce (BI_E_MAIL, U_E_MAIL), BI_ABOUT, BI_OWNER, BI_PINGS, coalesce(BI_TZ,0), BI_SHOW_CONTACT, BI_SHOW_REGIST, BI_COMMENTS, BI_FILTER, BI_HOME_PAGE, BI_PHOTO, BI_KEYWORDS, BI_P_HOME, BI_COMMENTS_NOTIFY, BI_ADD_YOUR_BLOG, BI_RSS_VERSION
    	into tit, home, copy, disc, own, email, about, ownid, ping, tz, cont, reg, comm, filt, hpage, photo, kwd, phome, cnot, addblog, rssver
  	from SYS_BLOG_DOMAIN_INFO, SYS_USERS where
 	BI_BLOG_ID = bid and BI_OWNER = U_ID and BI_DOMAIN = dom;

  blog_name := tit;

ef:

?>

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">

<html>
  <head>
    <link rel="stylesheet" type="text/css" href="<?=adm_what_css()?>">
    <title>BLOG Administration</title>
    <meta name="AUTHOR" content="OpenLink Software">
    <meta name="DESCRIPTION" content="BLOG Management for Virtuoso DB">
  </head>
<?vsp adm_page_header('BLOG Administration', ''); ?>
<script type="text/javascript">
<!--
function getFileName()
{
  var S = document.forms[0].uphoto.value;
  var N;
  var fname;
  if (S.lastIndexOf('\\') > 0)
    N = S.lastIndexOf('\\')+1;
  else
    N = S.lastIndexOf('/')+1;
  fname = S.substr(N,S.length);
  document.forms[0].photo.value = fname;
}
// -->
</script>
    <H4>Settings for "<?=dom?>"</H4>
    <TABLE class="genlist" BORDER="0" CELLPADDING="0" CELLSPACING="2">
      <TR><TD class="genhead" COLSPAN="2">Domain Blog Settings</TD></TR>
      <TR><TD CLASS="AdmBorders" COLSPAN="2"><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="2" ALT=""></TD></TR>
      <form method="POST" action="<?= http_path () ?>" enctype="multipart/form-data">
      <input type="hidden" name="bid" value="<?=bid?>">
      <input type="hidden" name="dom" value="<?=dom?>">
      <input type="hidden" name="id" value="<?=id?>">
      <input type="hidden" name="owner" value="<?=own?>">
      <input type="hidden" name="phome" value="<?=phome?>">
      <input type="hidden" name="hdomains" value="<?=encode_base64 (serialize(domains))?>">
      <tr><td class="geninput">Title</td> <td class="geninput"><input type="text" name="tit" value="<?=tit?>" size="70%"/></td></tr>
      <tr><td class="geninput">Description</td> <td class="geninput"><input type="text" name="about" value="<?=about?>" size="70%"/></td></tr>
      <tr><td class="geninput">Author's e-mail</td> <td class="geninput"><input type="text" name="email" value="<?=email?>" size="70%"/></td></tr>
      <tr><td class="geninput">Owner</td> <td class="geninput"><input type="text" name="own" value="<?=own?>" disabled size="70%"/></td></tr>
      <tr><td class="geninput">Home page URL</td> <td class="geninput"><input type="text" name="hpage" value="<?=hpage?>" size="70%"/></td></tr>
      <tr><td class="geninput">Copyrights</td> <td class="geninput"><input type="text" name="copy" value="<?=copy?>"  size="70%"/></td></tr>
      <tr><td class="geninput">Disclaimer</td> <td class="geninput"><input type="text" name="disc" value="<?=disc?>"  size="70%"/></td></tr>
      <tr><td class="geninput">Keywords</td> <td class="geninput"><input type="text" name="kwd" value="<?=kwd?>" size="70%"/></td></tr>
      <tr><td class="geninput">Upload Photo Image</td> <td class="geninput"><input type="file" name="uphoto" size="60%" onBlur="javascript: getFileName();"/></td></tr>
      <tr><td class="geninput">Photo</td> <td class="geninput"><input type="text" name="photo" value="<?=photo?>" size="70%"/></td></tr>
      <tr><td class="geninput">XSL-T filter for posts</td> <td class="geninput"><input type="text" name="filt" value="<?=filt?>"  size="70%"/></td></tr>

      <tr><td class="geninput">Weblogs ping</td> <td class="geninput">
      	<select name="ping">
		<option value="">*disabled*
		<option value="xmlrpc" <?V select_if ('xmlrpc', ping) ?>>XML-RPC
		<option value="soap" <?V select_if ('soap', ping) ?>>SOAP
		<option value="xml-rpc:http://ping.blo.gs/" <?V select_if ('xml-rpc:http://ping.blo.gs/', ping) ?>>blo.gs XML-RPC
		<option value="xml-rpc:http://rpc.technorati.com/rpc/ping" <?V select_if ('xml-rpc:http://rpc.technorati.com/rpc/ping', ping) ?>>technorati XML-RPC
	</select>
      </td></tr>

      <?vsp if (bid <> '*weblog-root*') { ?>
      <tr><td class="geninput">Enable Contacts</td> <td class="geninput">
      <input type="checkbox" name="cont" <?V check_if (cont, 1) ?> value="1" />
      </td></tr>
      <tr><td class="geninput">RSS file version</td> <td class="geninput">
      	<select name="rssver">
		<option value="2.0" <?V select_if ('2.0', rssver) ?>>2.0
		<option value="0.92" <?V select_if ('0.92', rssver) ?>>0.92
		<option value="0.91" <?V select_if ('0.91', rssver) ?>>0.91
	</select>
      </td></tr>
      <?vsp } ?>

      <?vsp if (bid = '*weblog-root*') { ?>
      <tr><td class="geninput">Enable Register URL</td> <td class="geninput">
      <input type="checkbox" name="reg" <?V check_if (reg, 1) ?> value="1" />
      </td></tr>
      <tr><td class="geninput">Enable Add Your Blog URL</td> <td class="geninput">
      <input type="checkbox" name="addblog" <?V check_if (addblog, 1) ?> value="1" />
      </td></tr>
      <?vsp } ?>

      <tr><td class="geninput">Enable Comments</td> <td class="geninput">
      <input type="checkbox" name="comm" <?V check_if (comm, 1) ?> value="1" />
      </td></tr>
      <tr><td class="geninput">Enable Comment Post Notification via E-mail</td> <td class="geninput">
      <input type="checkbox" name="cnot" <?V check_if (cnot, 1) ?> value="1" />
      </td></tr>
      <tr><td class="geninput">Time-zone</td> <td class="geninput">
      	<select name="tz">
	<?vsp
	{
	   declare i int;
	   i := -12;
	   while (i <= 12)
    	     {
	?>
		<option value="<?V i ?>" <?V select_if (i, tz) ?>>GMT <?V case when i < 0 then '-' else '+' end ?><?V sprintf ('%02d', abs(i)) ?>:00</option>
	<?vsp
		i := i + 1;
       	     }
	}
	?>
	</select>
      </td></tr>
      <tr>
        <td class="geninput" COLSPAN="2">
	<input type="submit" name="post" value="Post" />
	<input type="submit" name="cncl" value="Back" />
	</td>
      </tr>
      </form>
    </TABLE>

</TABLE>
<?vsp adm_page_footer(); ?>
</html>