Fossil SCM

Fix errors in the permission checking for email notification.

drh 2018-07-30 19:34 UTC forum-v2
Commit c286157cc9546a7c519a74ef376d61a76fc81c3b25fb43806dd4d8d8412b1760
1 file changed +2 -2
+2 -2
--- src/email.c
+++ src/email.c
@@ -2051,21 +2051,21 @@
20512051
const char *zEmail = db_column_text(&q, 1);
20522052
const char *zCap = db_column_text(&q, 3);
20532053
int nHit = 0;
20542054
for(p=pEvents; p; p=p->pNext){
20552055
if( strchr(zSub,p->type)==0 ) continue;
2056
- if( strchr(zSub,'s')!=0 || strchr(zSub,'a')!=0 ){
2056
+ if( strchr(zCap,'s')!=0 || strchr(zCap,'a')!=0 ){
20572057
/* Setup and admin users can get any notification */
20582058
}else{
20592059
char xType = '*';
20602060
switch( p->type ){
20612061
case 'c': xType = 'o'; break;
20622062
case 'f': xType = '2'; break;
20632063
case 't': xType = 'r'; break;
20642064
case 'w': xType = 'j'; break;
20652065
}
2066
- if( strchr(zSub,xType)==0 ) continue;
2066
+ if( strchr(zCap,xType)==0 ) continue;
20672067
}
20682068
if( nHit==0 ){
20692069
blob_appendf(&hdr,"To: <%s>\r\n", zEmail);
20702070
blob_appendf(&hdr,"Subject: %s activity alert\r\n", zRepoName);
20712071
blob_appendf(&body,
20722072
--- src/email.c
+++ src/email.c
@@ -2051,21 +2051,21 @@
2051 const char *zEmail = db_column_text(&q, 1);
2052 const char *zCap = db_column_text(&q, 3);
2053 int nHit = 0;
2054 for(p=pEvents; p; p=p->pNext){
2055 if( strchr(zSub,p->type)==0 ) continue;
2056 if( strchr(zSub,'s')!=0 || strchr(zSub,'a')!=0 ){
2057 /* Setup and admin users can get any notification */
2058 }else{
2059 char xType = '*';
2060 switch( p->type ){
2061 case 'c': xType = 'o'; break;
2062 case 'f': xType = '2'; break;
2063 case 't': xType = 'r'; break;
2064 case 'w': xType = 'j'; break;
2065 }
2066 if( strchr(zSub,xType)==0 ) continue;
2067 }
2068 if( nHit==0 ){
2069 blob_appendf(&hdr,"To: <%s>\r\n", zEmail);
2070 blob_appendf(&hdr,"Subject: %s activity alert\r\n", zRepoName);
2071 blob_appendf(&body,
2072
--- src/email.c
+++ src/email.c
@@ -2051,21 +2051,21 @@
2051 const char *zEmail = db_column_text(&q, 1);
2052 const char *zCap = db_column_text(&q, 3);
2053 int nHit = 0;
2054 for(p=pEvents; p; p=p->pNext){
2055 if( strchr(zSub,p->type)==0 ) continue;
2056 if( strchr(zCap,'s')!=0 || strchr(zCap,'a')!=0 ){
2057 /* Setup and admin users can get any notification */
2058 }else{
2059 char xType = '*';
2060 switch( p->type ){
2061 case 'c': xType = 'o'; break;
2062 case 'f': xType = '2'; break;
2063 case 't': xType = 'r'; break;
2064 case 'w': xType = 'j'; break;
2065 }
2066 if( strchr(zCap,xType)==0 ) continue;
2067 }
2068 if( nHit==0 ){
2069 blob_appendf(&hdr,"To: <%s>\r\n", zEmail);
2070 blob_appendf(&hdr,"Subject: %s activity alert\r\n", zRepoName);
2071 blob_appendf(&body,
2072

Keyboard Shortcuts

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