Fossil SCM
Simplify the skip-pending-moderation check in attachment_list().
Commit
c72ac2aac740bde6f35a280b5a0e5fdb981af5b7cbca4b77443f46b6ea97f570
Parent
686057e0e6b6d7e…
1 file changed
+1
-6
+1
-6
| --- src/attach.c | ||
| +++ src/attach.c | ||
| @@ -817,16 +817,11 @@ | ||
| 817 | 817 | const char *zTypeArg = 0; /* URL arg name for /attachdownload */ |
| 818 | 818 | const int aid = db_column_int(&q, 6); |
| 819 | 819 | const int iAType = attachment_target_type(zTarget); |
| 820 | 820 | if( (flags & ATTACHLIST_HIDE_UNAPPROVED) |
| 821 | 821 | && moderation_pending(aid) |
| 822 | - && !(g.perm.Admin | |
| 823 | - || (g.perm.ModForum && CFTYPE_FORUM==iAType) | |
| 824 | - || (g.perm.ModTkt && CFTYPE_TICKET==iAType) | |
| 825 | - || (g.perm.ModWiki && CFTYPE_WIKI==iAType) | |
| 826 | - || 0==fossil_strcmp(login_name(), zUser) | |
| 827 | - ) ){ | |
| 822 | + && !moderation_user_could(aid, 1, 0) ){ | |
| 828 | 823 | continue; |
| 829 | 824 | } |
| 830 | 825 | if( cnt==0 ){ |
| 831 | 826 | @ <section class='attachlist'> |
| 832 | 827 | if( flags & ATTACHLIST_HRULE_ABOVE ){ |
| 833 | 828 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -817,16 +817,11 @@ | |
| 817 | const char *zTypeArg = 0; /* URL arg name for /attachdownload */ |
| 818 | const int aid = db_column_int(&q, 6); |
| 819 | const int iAType = attachment_target_type(zTarget); |
| 820 | if( (flags & ATTACHLIST_HIDE_UNAPPROVED) |
| 821 | && moderation_pending(aid) |
| 822 | && !(g.perm.Admin |
| 823 | || (g.perm.ModForum && CFTYPE_FORUM==iAType) |
| 824 | || (g.perm.ModTkt && CFTYPE_TICKET==iAType) |
| 825 | || (g.perm.ModWiki && CFTYPE_WIKI==iAType) |
| 826 | || 0==fossil_strcmp(login_name(), zUser) |
| 827 | ) ){ |
| 828 | continue; |
| 829 | } |
| 830 | if( cnt==0 ){ |
| 831 | @ <section class='attachlist'> |
| 832 | if( flags & ATTACHLIST_HRULE_ABOVE ){ |
| 833 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -817,16 +817,11 @@ | |
| 817 | const char *zTypeArg = 0; /* URL arg name for /attachdownload */ |
| 818 | const int aid = db_column_int(&q, 6); |
| 819 | const int iAType = attachment_target_type(zTarget); |
| 820 | if( (flags & ATTACHLIST_HIDE_UNAPPROVED) |
| 821 | && moderation_pending(aid) |
| 822 | && !moderation_user_could(aid, 1, 0) ){ |
| 823 | continue; |
| 824 | } |
| 825 | if( cnt==0 ){ |
| 826 | @ <section class='attachlist'> |
| 827 | if( flags & ATTACHLIST_HRULE_ABOVE ){ |
| 828 |