Fossil SCM

Merge changes from trunk.

drh 2019-05-17 12:05 graph-improvements merge
Commit 49f8f9e1fb3a5da0c1457a6dabe8f2f61b99355ed86ceeaa45b1e119d8aafbaf
--- skins/bootstrap/footer.txt
+++ skins/bootstrap/footer.txt
@@ -7,11 +7,11 @@
77
<div id="push"></div>
88
</div>
99
<footer id="footer">
1010
<p>&#169; Copyright $<project_name>. All right reserved. Fossil $release_version &#183; <a href="$home/timeline.rss">RSS</a></p>
1111
</footer>
12
-<script>
12
+<script nonce="$<nonce>">
1313
var tables = document.querySelectorAll('table');
1414
for (var i = 0; i < tables.length; i++) {
1515
if (tables[i].id !== "timelineTable")
1616
tables[i].classList.add('table');
1717
};
1818
--- skins/bootstrap/footer.txt
+++ skins/bootstrap/footer.txt
@@ -7,11 +7,11 @@
7 <div id="push"></div>
8 </div>
9 <footer id="footer">
10 <p>&#169; Copyright $<project_name>. All right reserved. Fossil $release_version &#183; <a href="$home/timeline.rss">RSS</a></p>
11 </footer>
12 <script>
13 var tables = document.querySelectorAll('table');
14 for (var i = 0; i < tables.length; i++) {
15 if (tables[i].id !== "timelineTable")
16 tables[i].classList.add('table');
17 };
18
--- skins/bootstrap/footer.txt
+++ skins/bootstrap/footer.txt
@@ -7,11 +7,11 @@
7 <div id="push"></div>
8 </div>
9 <footer id="footer">
10 <p>&#169; Copyright $<project_name>. All right reserved. Fossil $release_version &#183; <a href="$home/timeline.rss">RSS</a></p>
11 </footer>
12 <script nonce="$<nonce>">
13 var tables = document.querySelectorAll('table');
14 for (var i = 0; i < tables.length; i++) {
15 if (tables[i].id !== "timelineTable")
16 tables[i].classList.add('table');
17 };
18
--- skins/bootstrap/header.txt
+++ skins/bootstrap/header.txt
@@ -5,11 +5,11 @@
55
<title>$<project_name>: $<title></title>
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data:; script-src 'self' 'nonce-$<nonce>'; style-src 'self' 'unsafe-inline'"/>
88
<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="$home/timeline.rss" />
99
<link rel="stylesheet" href="$home/style.css?default" type="text/css" media="screen" />
10
- <script>
10
+ <script nonce="$<nonce>">
1111
function gebi(x){
1212
if(/^#/.test(x)) x = x.substr(1);
1313
var e = document.getElementById(x);
1414
if(!e) throw new Error("Expecting element with ID "+x);
1515
else return e;
1616
--- skins/bootstrap/header.txt
+++ skins/bootstrap/header.txt
@@ -5,11 +5,11 @@
5 <title>$<project_name>: $<title></title>
6 <meta name="viewport" content="width=device-width, initial-scale=1.0">
7 <meta http-equiv="Content-Security-Policy" content="default-src 'self' data:; script-src 'self' 'nonce-$<nonce>'; style-src 'self' 'unsafe-inline'"/>
8 <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="$home/timeline.rss" />
9 <link rel="stylesheet" href="$home/style.css?default" type="text/css" media="screen" />
10 <script>
11 function gebi(x){
12 if(/^#/.test(x)) x = x.substr(1);
13 var e = document.getElementById(x);
14 if(!e) throw new Error("Expecting element with ID "+x);
15 else return e;
16
--- skins/bootstrap/header.txt
+++ skins/bootstrap/header.txt
@@ -5,11 +5,11 @@
5 <title>$<project_name>: $<title></title>
6 <meta name="viewport" content="width=device-width, initial-scale=1.0">
7 <meta http-equiv="Content-Security-Policy" content="default-src 'self' data:; script-src 'self' 'nonce-$<nonce>'; style-src 'self' 'unsafe-inline'"/>
8 <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="$home/timeline.rss" />
9 <link rel="stylesheet" href="$home/style.css?default" type="text/css" media="screen" />
10 <script nonce="$<nonce>">
11 function gebi(x){
12 if(/^#/.test(x)) x = x.substr(1);
13 var e = document.getElementById(x);
14 if(!e) throw new Error("Expecting element with ID "+x);
15 else return e;
16
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -1165,10 +1165,11 @@
11651165
BLDTARGETS = zlib
11661166
endif
11671167
11681168
openssl: $(BLDTARGETS)
11691169
cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) $(SSLCONFIG)
1170
+ sed -i -e 's/^PERL=C:\\.*$$/PERL=perl.exe/i' $(OPENSSLLIBDIR)/Makefile
11701171
$(MAKE) -C $(OPENSSLLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) build_libs
11711172
11721173
clean-openssl:
11731174
$(MAKE) -C $(OPENSSLLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) clean
11741175
11751176
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -1165,10 +1165,11 @@
1165 BLDTARGETS = zlib
1166 endif
1167
1168 openssl: $(BLDTARGETS)
1169 cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) $(SSLCONFIG)
 
1170 $(MAKE) -C $(OPENSSLLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) build_libs
1171
1172 clean-openssl:
1173 $(MAKE) -C $(OPENSSLLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) clean
1174
1175
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -1165,10 +1165,11 @@
1165 BLDTARGETS = zlib
1166 endif
1167
1168 openssl: $(BLDTARGETS)
1169 cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) $(SSLCONFIG)
1170 sed -i -e 's/^PERL=C:\\.*$$/PERL=perl.exe/i' $(OPENSSLLIBDIR)/Makefile
1171 $(MAKE) -C $(OPENSSLLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) build_libs
1172
1173 clean-openssl:
1174 $(MAKE) -C $(OPENSSLLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) clean
1175
1176
--- src/moderate.c
+++ src/moderate.c
@@ -189,5 +189,38 @@
189189
www_print_timeline(&q, 0, 0, 0, 0, 0);
190190
db_finalize(&q);
191191
}
192192
style_footer();
193193
}
194
+
195
+/*
196
+** Disapproves any entries in the modreq table which belong to any
197
+** user whose name is no longer found in the user table. This is only
198
+** intended to be called after user deletion via /setup_uedit.
199
+**
200
+** To figure out whether a name exists it cross-references
201
+** coalesce(event.euser, event.user) with user.login, limiting the
202
+** selection to event entries where objid matches an entry in the
203
+** modreq table.
204
+**
205
+** This is a no-op if called without g.perm.Admin permissions or if
206
+** moderation_table_exists() returns false.
207
+*/
208
+void moderation_disapprove_for_missing_users(){
209
+ Stmt q;
210
+ if( !g.perm.Admin || !moderation_table_exists() ){
211
+ return;
212
+ }
213
+ db_begin_transaction();
214
+ db_prepare(&q,
215
+ "SELECT objid FROM event WHERE objid IN "
216
+ "(SELECT objid FROM modreq) "
217
+ "AND coalesce(euser,user) NOT IN "
218
+ "(SELECT login FROM user)"
219
+ );
220
+ while( db_step(&q)==SQLITE_ROW ){
221
+ int const objid = db_column_int(&q, 0);
222
+ moderation_disapprove(objid);
223
+ }
224
+ db_finalize(&q);
225
+ db_end_transaction(0);
226
+}
194227
--- src/moderate.c
+++ src/moderate.c
@@ -189,5 +189,38 @@
189 www_print_timeline(&q, 0, 0, 0, 0, 0);
190 db_finalize(&q);
191 }
192 style_footer();
193 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
--- src/moderate.c
+++ src/moderate.c
@@ -189,5 +189,38 @@
189 www_print_timeline(&q, 0, 0, 0, 0, 0);
190 db_finalize(&q);
191 }
192 style_footer();
193 }
194
195 /*
196 ** Disapproves any entries in the modreq table which belong to any
197 ** user whose name is no longer found in the user table. This is only
198 ** intended to be called after user deletion via /setup_uedit.
199 **
200 ** To figure out whether a name exists it cross-references
201 ** coalesce(event.euser, event.user) with user.login, limiting the
202 ** selection to event entries where objid matches an entry in the
203 ** modreq table.
204 **
205 ** This is a no-op if called without g.perm.Admin permissions or if
206 ** moderation_table_exists() returns false.
207 */
208 void moderation_disapprove_for_missing_users(){
209 Stmt q;
210 if( !g.perm.Admin || !moderation_table_exists() ){
211 return;
212 }
213 db_begin_transaction();
214 db_prepare(&q,
215 "SELECT objid FROM event WHERE objid IN "
216 "(SELECT objid FROM modreq) "
217 "AND coalesce(euser,user) NOT IN "
218 "(SELECT login FROM user)"
219 );
220 while( db_step(&q)==SQLITE_ROW ){
221 int const objid = db_column_int(&q, 0);
222 moderation_disapprove(objid);
223 }
224 db_finalize(&q);
225 db_end_transaction(0);
226 }
227
--- src/setupuser.c
+++ src/setupuser.c
@@ -297,10 +297,13 @@
297297
if( P("delete") && cgi_csrf_safe(1) ){
298298
int n;
299299
if( P("verifydelete") ){
300300
/* Verified delete user request */
301301
db_multi_exec("DELETE FROM user WHERE uid=%d", uid);
302
+ moderation_disapprove_for_missing_users();
303
+ admin_log("Deleted user [%s] (uid %d).",
304
+ PD("login","???")/*safe-for-%s*/, uid);
302305
cgi_redirect(cgi_referer("setup_ulist"));
303306
return;
304307
}
305308
n = db_int(0, "SELECT count(*) FROM event"
306309
" WHERE user=%Q AND objid NOT IN private",
307310
--- src/setupuser.c
+++ src/setupuser.c
@@ -297,10 +297,13 @@
297 if( P("delete") && cgi_csrf_safe(1) ){
298 int n;
299 if( P("verifydelete") ){
300 /* Verified delete user request */
301 db_multi_exec("DELETE FROM user WHERE uid=%d", uid);
 
 
 
302 cgi_redirect(cgi_referer("setup_ulist"));
303 return;
304 }
305 n = db_int(0, "SELECT count(*) FROM event"
306 " WHERE user=%Q AND objid NOT IN private",
307
--- src/setupuser.c
+++ src/setupuser.c
@@ -297,10 +297,13 @@
297 if( P("delete") && cgi_csrf_safe(1) ){
298 int n;
299 if( P("verifydelete") ){
300 /* Verified delete user request */
301 db_multi_exec("DELETE FROM user WHERE uid=%d", uid);
302 moderation_disapprove_for_missing_users();
303 admin_log("Deleted user [%s] (uid %d).",
304 PD("login","???")/*safe-for-%s*/, uid);
305 cgi_redirect(cgi_referer("setup_ulist"));
306 return;
307 }
308 n = db_int(0, "SELECT count(*) FROM event"
309 " WHERE user=%Q AND objid NOT IN private",
310
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -1095,10 +1095,11 @@
10951095
BLDTARGETS = zlib
10961096
endif
10971097
10981098
openssl: $(BLDTARGETS)
10991099
cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) $(SSLCONFIG)
1100
+ sed -i -e 's/^PERL=C:\\.*$$/PERL=perl.exe/i' $(OPENSSLLIBDIR)/Makefile
11001101
$(MAKE) -C $(OPENSSLLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) build_libs
11011102
11021103
clean-openssl:
11031104
$(MAKE) -C $(OPENSSLLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) clean
11041105
11051106
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -1095,10 +1095,11 @@
1095 BLDTARGETS = zlib
1096 endif
1097
1098 openssl: $(BLDTARGETS)
1099 cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) $(SSLCONFIG)
 
1100 $(MAKE) -C $(OPENSSLLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) build_libs
1101
1102 clean-openssl:
1103 $(MAKE) -C $(OPENSSLLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) clean
1104
1105
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -1095,10 +1095,11 @@
1095 BLDTARGETS = zlib
1096 endif
1097
1098 openssl: $(BLDTARGETS)
1099 cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) $(SSLCONFIG)
1100 sed -i -e 's/^PERL=C:\\.*$$/PERL=perl.exe/i' $(OPENSSLLIBDIR)/Makefile
1101 $(MAKE) -C $(OPENSSLLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) build_libs
1102
1103 clean-openssl:
1104 $(MAKE) -C $(OPENSSLLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) clean
1105
1106
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -1095,10 +1095,11 @@
10951095
BLDTARGETS = zlib
10961096
endif
10971097
10981098
openssl: $(BLDTARGETS)
10991099
cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) $(SSLCONFIG)
1100
+ sed -i -e 's/^PERL=C:\\.*$$/PERL=perl.exe/i' $(OPENSSLLIBDIR)/Makefile
11001101
$(MAKE) -C $(OPENSSLLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) build_libs
11011102
11021103
clean-openssl:
11031104
$(MAKE) -C $(OPENSSLLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) clean
11041105
11051106
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -1095,10 +1095,11 @@
1095 BLDTARGETS = zlib
1096 endif
1097
1098 openssl: $(BLDTARGETS)
1099 cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) $(SSLCONFIG)
 
1100 $(MAKE) -C $(OPENSSLLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) build_libs
1101
1102 clean-openssl:
1103 $(MAKE) -C $(OPENSSLLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) clean
1104
1105
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -1095,10 +1095,11 @@
1095 BLDTARGETS = zlib
1096 endif
1097
1098 openssl: $(BLDTARGETS)
1099 cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) $(SSLCONFIG)
1100 sed -i -e 's/^PERL=C:\\.*$$/PERL=perl.exe/i' $(OPENSSLLIBDIR)/Makefile
1101 $(MAKE) -C $(OPENSSLLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) build_libs
1102
1103 clean-openssl:
1104 $(MAKE) -C $(OPENSSLLIBDIR) PREFIX=$(PREFIX) CC=$(PREFIX)$(TCCEXE) clean
1105
1106

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button