Fossil SCM
Corrected incorrect access rights check (did require Setup rights). Documentation corrections/additions. A few style conformance formatting changes.
Commit
b81e93f576cbddf770771c6835864bfc3e6061c9
Parent
649dd8a6afa59ab…
1 file changed
+29
-27
+29
-27
| --- src/tagview.c | ||
| +++ src/tagview.c | ||
| @@ -28,21 +28,19 @@ | ||
| 28 | 28 | #include <assert.h> |
| 29 | 29 | #include "config.h" |
| 30 | 30 | #include "tagview.h" |
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | -tagview_strxform_f is a typedef for funcs with | |
| 34 | -the following policy: | |
| 35 | - | |
| 36 | -The accept a string which they then transform into | |
| 37 | -some other form. They return a transformed copy, | |
| 38 | -which the caller is responsible for freeing. | |
| 39 | - | |
| 40 | -The intention of this is to provide a way for | |
| 41 | -a generic query routine to format specific column | |
| 42 | -data (e.g. transform an object ID into a link to | |
| 43 | -that object). | |
| 33 | +tagview_strxform_f is a typedef for funcs with the following policy: | |
| 34 | + | |
| 35 | +They accept a const string which they then transform into some other | |
| 36 | +form. They return a transformed copy, which the caller is responsible | |
| 37 | +for freeing. | |
| 38 | + | |
| 39 | +The intention of this is to provide a way for a generic query routine | |
| 40 | +to format specific column data (e.g. transform an object ID into a | |
| 41 | +link to that object). | |
| 44 | 42 | */ |
| 45 | 43 | typedef char * (*tagview_strxform_f)( char const * ); |
| 46 | 44 | |
| 47 | 45 | #if 0 |
| 48 | 46 | /** A no-op transformer which can be used as a placeholder. */ |
| @@ -57,30 +55,30 @@ | ||
| 57 | 55 | #endif |
| 58 | 56 | |
| 59 | 57 | /** Returns a hyperlink to uuid. */ |
| 60 | 58 | static char * tagview_xf_link_to_uuid( char const * uuid ) |
| 61 | 59 | { |
| 62 | - const int offset = 10; | |
| 63 | - char shortname[offset+1]; | |
| 64 | - shortname[offset] = '\0'; | |
| 65 | - memcpy( shortname, uuid, offset ); | |
| 66 | - return mprintf( "<tt><a href='%s/vinfo/%s'><strong>%s</strong>%s</a></tt>", | |
| 67 | - g.zBaseURL, uuid, shortname, uuid+offset ); | |
| 60 | + const int offset = 10; | |
| 61 | + char shortname[offset+1]; | |
| 62 | + shortname[offset] = '\0'; | |
| 63 | + memcpy( shortname, uuid, offset ); | |
| 64 | + return mprintf( "<tt><a href='%s/vinfo/%s'><strong>%s</strong>%s</a></tt>", | |
| 65 | + g.zBaseURL, uuid, shortname, uuid+offset ); | |
| 68 | 66 | } |
| 69 | 67 | |
| 70 | 68 | /** Returns a hyperlink to the given tag. */ |
| 71 | 69 | static char * tagview_xf_link_to_tagid( char const * tagid ) |
| 72 | 70 | { |
| 73 | 71 | return mprintf( "<a href='%s/tagview?tagid=%s'>%s</a>", |
| 74 | - g.zBaseURL, tagid, tagid ); | |
| 72 | + g.zBaseURL, tagid, tagid ); | |
| 75 | 73 | } |
| 76 | 74 | |
| 77 | 75 | /** Returns a hyperlink to the named tag. */ |
| 78 | 76 | static char * tagview_xf_link_to_tagname( char const * tagid ) |
| 79 | 77 | { |
| 80 | 78 | return mprintf( "<a href='%s/tagview/%s'>%s</a>", |
| 81 | - g.zBaseURL, tagid, tagid ); | |
| 79 | + g.zBaseURL, tagid, tagid ); | |
| 82 | 80 | } |
| 83 | 81 | |
| 84 | 82 | |
| 85 | 83 | |
| 86 | 84 | /** |
| @@ -90,21 +88,21 @@ | ||
| 90 | 88 | * results. |
| 91 | 89 | * |
| 92 | 90 | * The sql parameter should be a single, complete SQL statement. |
| 93 | 91 | * |
| 94 | 92 | * The coln parameter is optional (it may be 0). If it is 0 then the |
| 95 | -* column names using in the output will be taken directly from the | |
| 93 | +* column names used in the output will be taken directly from the | |
| 96 | 94 | * SQL. If it is not null then it must have as many entries as the SQL |
| 97 | 95 | * result has columns. Each entry is a column name for the SQL result |
| 98 | 96 | * column of the same index. Any given entry may be 0, in which case |
| 99 | 97 | * the column name from the SQL is used. |
| 100 | 98 | * |
| 101 | 99 | * The xform argument is an array of transformation functions (type |
| 102 | 100 | * tagview_strxform_f). The array, or any single entry, may be 0, but |
| 103 | 101 | * if the array is non-0 then it must have at least as many entries as |
| 104 | 102 | * colnames does. Each index corresponds directly to an entry in |
| 105 | -* colnames and the SQL results. Any given entry may be 0 If it has | |
| 103 | +* colnames and the SQL results. Any given entry may be 0. If it has | |
| 106 | 104 | * fewer, undefined behaviour results. If a column has an entry in |
| 107 | 105 | * xform, then the xform function will be called to transform the |
| 108 | 106 | * column data before rendering it. This function takes care of freeing |
| 109 | 107 | * the strings created by the xform functions. |
| 110 | 108 | * |
| @@ -154,11 +152,10 @@ | ||
| 154 | 152 | @ <td>%s(db_column_name(&st,i))</td> |
| 155 | 153 | } |
| 156 | 154 | } |
| 157 | 155 | @ </tr> |
| 158 | 156 | |
| 159 | - | |
| 160 | 157 | while( SQLITE_ROW == db_step(&st) ){ |
| 161 | 158 | @ <tr> |
| 162 | 159 | for( i = 0; i < colc; ++i ) { |
| 163 | 160 | char * xf = 0; |
| 164 | 161 | char const * xcf = 0; |
| @@ -189,17 +186,18 @@ | ||
| 189 | 186 | @ <h2>Tags matching [%s(likeclause)]:</h2> |
| 190 | 187 | } |
| 191 | 188 | else |
| 192 | 189 | { |
| 193 | 190 | limitstr = mprintf( "LIMIT %d", limit ); |
| 194 | - @ <h2>%d(limit) most recent tags:</h2> | |
| 191 | + @ <h2>%d(limit) most recent non-wiki tags:</h2> | |
| 195 | 192 | } |
| 196 | 193 | char * sql = mprintf( |
| 197 | 194 | "SELECT t.tagid, t.tagname, DATETIME(tx.mtime), b.uuid " |
| 198 | 195 | "FROM tag t, tagxref tx, blob b " |
| 199 | 196 | "WHERE (t.tagid=tx.tagid) and (tx.srcid=b.rid) " |
| 200 | 197 | "AND (tx.tagtype != 0) %s " |
| 198 | + "AND t.tagname NOT GLOB 'wiki-*' " | |
| 201 | 199 | "ORDER BY tx.mtime DESC %s", |
| 202 | 200 | likeclause ? likeclause : " ", |
| 203 | 201 | limitstr ? limitstr : " " |
| 204 | 202 | ); |
| 205 | 203 | /* " AND t.tagname NOT GLOB 'wiki-*'" // Do we want this?? */ |
| @@ -229,11 +227,13 @@ | ||
| 229 | 227 | @ <input type='submit'/> |
| 230 | 228 | @ </form> |
| 231 | 229 | @ </div> |
| 232 | 230 | } |
| 233 | 231 | |
| 234 | - | |
| 232 | +/** | |
| 233 | + tagview_page_default() renders the default page for tagview_page(). | |
| 234 | +*/ | |
| 235 | 235 | static void tagview_page_default(void){ |
| 236 | 236 | tagview_page_list_tags( 0 ); |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | /** |
| @@ -244,20 +244,21 @@ | ||
| 244 | 244 | @ <h2>Tag #%d(tagid):</h2> |
| 245 | 245 | char * sql = mprintf( |
| 246 | 246 | "SELECT DISTINCT (t.tagname), DATETIME(tx.mtime), b.uuid " |
| 247 | 247 | "FROM tag t, tagxref tx, blob b " |
| 248 | 248 | "WHERE (t.tagid=%d) AND (t.tagid=tx.tagid) AND (tx.srcid=b.rid) " |
| 249 | + "AND t.tagname NOT GLOB 'wiki-*' " | |
| 249 | 250 | "ORDER BY tx.mtime DESC", |
| 250 | 251 | tagid); |
| 251 | 252 | char const * const colnames[] = { |
| 252 | 253 | "Tag Name", "Timestamp", "Version" |
| 253 | - }; | |
| 254 | + }; | |
| 254 | 255 | tagview_strxform_f xf[] = { |
| 255 | 256 | tagview_xf_link_to_tagname, |
| 256 | 257 | 0, |
| 257 | 258 | tagview_xf_link_to_uuid |
| 258 | - }; | |
| 259 | + }; | |
| 259 | 260 | tagview_run_query( sql, colnames, xf ); |
| 260 | 261 | free(sql); |
| 261 | 262 | } |
| 262 | 263 | |
| 263 | 264 | /** |
| @@ -268,10 +269,11 @@ | ||
| 268 | 269 | @ <h2>Tag '%s(tagname)':</h2> |
| 269 | 270 | char * sql = mprintf( |
| 270 | 271 | "SELECT DISTINCT t.tagid, DATETIME(tx.mtime), b.uuid " |
| 271 | 272 | "FROM tag t, tagxref tx, blob b " |
| 272 | 273 | "WHERE (t.tagname='%q') AND (t.tagid=tx.tagid) AND (tx.srcid=b.rid) " |
| 274 | + "AND t.tagname NOT GLOB 'wiki-*' " | |
| 273 | 275 | "ORDER BY tx.mtime DESC", |
| 274 | 276 | tagname); |
| 275 | 277 | char const * const colnames[] = { |
| 276 | 278 | "Tag ID", "Timestamp", "Version" |
| 277 | 279 | }; |
| @@ -289,11 +291,11 @@ | ||
| 289 | 291 | ** WEBPAGE: /tagview |
| 290 | 292 | */ |
| 291 | 293 | void tagview_page(void){ |
| 292 | 294 | |
| 293 | 295 | login_check_credentials(); |
| 294 | - if( !g.okSetup ){ | |
| 296 | + if( !g.okRdWiki ){ | |
| 295 | 297 | login_needed(); |
| 296 | 298 | } |
| 297 | 299 | style_header("Tags"); |
| 298 | 300 | tagview_page_search_miniform(); |
| 299 | 301 | @ <hr/> |
| 300 | 302 |
| --- src/tagview.c | |
| +++ src/tagview.c | |
| @@ -28,21 +28,19 @@ | |
| 28 | #include <assert.h> |
| 29 | #include "config.h" |
| 30 | #include "tagview.h" |
| 31 | |
| 32 | /** |
| 33 | tagview_strxform_f is a typedef for funcs with |
| 34 | the following policy: |
| 35 | |
| 36 | The accept a string which they then transform into |
| 37 | some other form. They return a transformed copy, |
| 38 | which the caller is responsible for freeing. |
| 39 | |
| 40 | The intention of this is to provide a way for |
| 41 | a generic query routine to format specific column |
| 42 | data (e.g. transform an object ID into a link to |
| 43 | that object). |
| 44 | */ |
| 45 | typedef char * (*tagview_strxform_f)( char const * ); |
| 46 | |
| 47 | #if 0 |
| 48 | /** A no-op transformer which can be used as a placeholder. */ |
| @@ -57,30 +55,30 @@ | |
| 57 | #endif |
| 58 | |
| 59 | /** Returns a hyperlink to uuid. */ |
| 60 | static char * tagview_xf_link_to_uuid( char const * uuid ) |
| 61 | { |
| 62 | const int offset = 10; |
| 63 | char shortname[offset+1]; |
| 64 | shortname[offset] = '\0'; |
| 65 | memcpy( shortname, uuid, offset ); |
| 66 | return mprintf( "<tt><a href='%s/vinfo/%s'><strong>%s</strong>%s</a></tt>", |
| 67 | g.zBaseURL, uuid, shortname, uuid+offset ); |
| 68 | } |
| 69 | |
| 70 | /** Returns a hyperlink to the given tag. */ |
| 71 | static char * tagview_xf_link_to_tagid( char const * tagid ) |
| 72 | { |
| 73 | return mprintf( "<a href='%s/tagview?tagid=%s'>%s</a>", |
| 74 | g.zBaseURL, tagid, tagid ); |
| 75 | } |
| 76 | |
| 77 | /** Returns a hyperlink to the named tag. */ |
| 78 | static char * tagview_xf_link_to_tagname( char const * tagid ) |
| 79 | { |
| 80 | return mprintf( "<a href='%s/tagview/%s'>%s</a>", |
| 81 | g.zBaseURL, tagid, tagid ); |
| 82 | } |
| 83 | |
| 84 | |
| 85 | |
| 86 | /** |
| @@ -90,21 +88,21 @@ | |
| 90 | * results. |
| 91 | * |
| 92 | * The sql parameter should be a single, complete SQL statement. |
| 93 | * |
| 94 | * The coln parameter is optional (it may be 0). If it is 0 then the |
| 95 | * column names using in the output will be taken directly from the |
| 96 | * SQL. If it is not null then it must have as many entries as the SQL |
| 97 | * result has columns. Each entry is a column name for the SQL result |
| 98 | * column of the same index. Any given entry may be 0, in which case |
| 99 | * the column name from the SQL is used. |
| 100 | * |
| 101 | * The xform argument is an array of transformation functions (type |
| 102 | * tagview_strxform_f). The array, or any single entry, may be 0, but |
| 103 | * if the array is non-0 then it must have at least as many entries as |
| 104 | * colnames does. Each index corresponds directly to an entry in |
| 105 | * colnames and the SQL results. Any given entry may be 0 If it has |
| 106 | * fewer, undefined behaviour results. If a column has an entry in |
| 107 | * xform, then the xform function will be called to transform the |
| 108 | * column data before rendering it. This function takes care of freeing |
| 109 | * the strings created by the xform functions. |
| 110 | * |
| @@ -154,11 +152,10 @@ | |
| 154 | @ <td>%s(db_column_name(&st,i))</td> |
| 155 | } |
| 156 | } |
| 157 | @ </tr> |
| 158 | |
| 159 | |
| 160 | while( SQLITE_ROW == db_step(&st) ){ |
| 161 | @ <tr> |
| 162 | for( i = 0; i < colc; ++i ) { |
| 163 | char * xf = 0; |
| 164 | char const * xcf = 0; |
| @@ -189,17 +186,18 @@ | |
| 189 | @ <h2>Tags matching [%s(likeclause)]:</h2> |
| 190 | } |
| 191 | else |
| 192 | { |
| 193 | limitstr = mprintf( "LIMIT %d", limit ); |
| 194 | @ <h2>%d(limit) most recent tags:</h2> |
| 195 | } |
| 196 | char * sql = mprintf( |
| 197 | "SELECT t.tagid, t.tagname, DATETIME(tx.mtime), b.uuid " |
| 198 | "FROM tag t, tagxref tx, blob b " |
| 199 | "WHERE (t.tagid=tx.tagid) and (tx.srcid=b.rid) " |
| 200 | "AND (tx.tagtype != 0) %s " |
| 201 | "ORDER BY tx.mtime DESC %s", |
| 202 | likeclause ? likeclause : " ", |
| 203 | limitstr ? limitstr : " " |
| 204 | ); |
| 205 | /* " AND t.tagname NOT GLOB 'wiki-*'" // Do we want this?? */ |
| @@ -229,11 +227,13 @@ | |
| 229 | @ <input type='submit'/> |
| 230 | @ </form> |
| 231 | @ </div> |
| 232 | } |
| 233 | |
| 234 | |
| 235 | static void tagview_page_default(void){ |
| 236 | tagview_page_list_tags( 0 ); |
| 237 | } |
| 238 | |
| 239 | /** |
| @@ -244,20 +244,21 @@ | |
| 244 | @ <h2>Tag #%d(tagid):</h2> |
| 245 | char * sql = mprintf( |
| 246 | "SELECT DISTINCT (t.tagname), DATETIME(tx.mtime), b.uuid " |
| 247 | "FROM tag t, tagxref tx, blob b " |
| 248 | "WHERE (t.tagid=%d) AND (t.tagid=tx.tagid) AND (tx.srcid=b.rid) " |
| 249 | "ORDER BY tx.mtime DESC", |
| 250 | tagid); |
| 251 | char const * const colnames[] = { |
| 252 | "Tag Name", "Timestamp", "Version" |
| 253 | }; |
| 254 | tagview_strxform_f xf[] = { |
| 255 | tagview_xf_link_to_tagname, |
| 256 | 0, |
| 257 | tagview_xf_link_to_uuid |
| 258 | }; |
| 259 | tagview_run_query( sql, colnames, xf ); |
| 260 | free(sql); |
| 261 | } |
| 262 | |
| 263 | /** |
| @@ -268,10 +269,11 @@ | |
| 268 | @ <h2>Tag '%s(tagname)':</h2> |
| 269 | char * sql = mprintf( |
| 270 | "SELECT DISTINCT t.tagid, DATETIME(tx.mtime), b.uuid " |
| 271 | "FROM tag t, tagxref tx, blob b " |
| 272 | "WHERE (t.tagname='%q') AND (t.tagid=tx.tagid) AND (tx.srcid=b.rid) " |
| 273 | "ORDER BY tx.mtime DESC", |
| 274 | tagname); |
| 275 | char const * const colnames[] = { |
| 276 | "Tag ID", "Timestamp", "Version" |
| 277 | }; |
| @@ -289,11 +291,11 @@ | |
| 289 | ** WEBPAGE: /tagview |
| 290 | */ |
| 291 | void tagview_page(void){ |
| 292 | |
| 293 | login_check_credentials(); |
| 294 | if( !g.okSetup ){ |
| 295 | login_needed(); |
| 296 | } |
| 297 | style_header("Tags"); |
| 298 | tagview_page_search_miniform(); |
| 299 | @ <hr/> |
| 300 |
| --- src/tagview.c | |
| +++ src/tagview.c | |
| @@ -28,21 +28,19 @@ | |
| 28 | #include <assert.h> |
| 29 | #include "config.h" |
| 30 | #include "tagview.h" |
| 31 | |
| 32 | /** |
| 33 | tagview_strxform_f is a typedef for funcs with the following policy: |
| 34 | |
| 35 | They accept a const string which they then transform into some other |
| 36 | form. They return a transformed copy, which the caller is responsible |
| 37 | for freeing. |
| 38 | |
| 39 | The intention of this is to provide a way for a generic query routine |
| 40 | to format specific column data (e.g. transform an object ID into a |
| 41 | link to that object). |
| 42 | */ |
| 43 | typedef char * (*tagview_strxform_f)( char const * ); |
| 44 | |
| 45 | #if 0 |
| 46 | /** A no-op transformer which can be used as a placeholder. */ |
| @@ -57,30 +55,30 @@ | |
| 55 | #endif |
| 56 | |
| 57 | /** Returns a hyperlink to uuid. */ |
| 58 | static char * tagview_xf_link_to_uuid( char const * uuid ) |
| 59 | { |
| 60 | const int offset = 10; |
| 61 | char shortname[offset+1]; |
| 62 | shortname[offset] = '\0'; |
| 63 | memcpy( shortname, uuid, offset ); |
| 64 | return mprintf( "<tt><a href='%s/vinfo/%s'><strong>%s</strong>%s</a></tt>", |
| 65 | g.zBaseURL, uuid, shortname, uuid+offset ); |
| 66 | } |
| 67 | |
| 68 | /** Returns a hyperlink to the given tag. */ |
| 69 | static char * tagview_xf_link_to_tagid( char const * tagid ) |
| 70 | { |
| 71 | return mprintf( "<a href='%s/tagview?tagid=%s'>%s</a>", |
| 72 | g.zBaseURL, tagid, tagid ); |
| 73 | } |
| 74 | |
| 75 | /** Returns a hyperlink to the named tag. */ |
| 76 | static char * tagview_xf_link_to_tagname( char const * tagid ) |
| 77 | { |
| 78 | return mprintf( "<a href='%s/tagview/%s'>%s</a>", |
| 79 | g.zBaseURL, tagid, tagid ); |
| 80 | } |
| 81 | |
| 82 | |
| 83 | |
| 84 | /** |
| @@ -90,21 +88,21 @@ | |
| 88 | * results. |
| 89 | * |
| 90 | * The sql parameter should be a single, complete SQL statement. |
| 91 | * |
| 92 | * The coln parameter is optional (it may be 0). If it is 0 then the |
| 93 | * column names used in the output will be taken directly from the |
| 94 | * SQL. If it is not null then it must have as many entries as the SQL |
| 95 | * result has columns. Each entry is a column name for the SQL result |
| 96 | * column of the same index. Any given entry may be 0, in which case |
| 97 | * the column name from the SQL is used. |
| 98 | * |
| 99 | * The xform argument is an array of transformation functions (type |
| 100 | * tagview_strxform_f). The array, or any single entry, may be 0, but |
| 101 | * if the array is non-0 then it must have at least as many entries as |
| 102 | * colnames does. Each index corresponds directly to an entry in |
| 103 | * colnames and the SQL results. Any given entry may be 0. If it has |
| 104 | * fewer, undefined behaviour results. If a column has an entry in |
| 105 | * xform, then the xform function will be called to transform the |
| 106 | * column data before rendering it. This function takes care of freeing |
| 107 | * the strings created by the xform functions. |
| 108 | * |
| @@ -154,11 +152,10 @@ | |
| 152 | @ <td>%s(db_column_name(&st,i))</td> |
| 153 | } |
| 154 | } |
| 155 | @ </tr> |
| 156 | |
| 157 | while( SQLITE_ROW == db_step(&st) ){ |
| 158 | @ <tr> |
| 159 | for( i = 0; i < colc; ++i ) { |
| 160 | char * xf = 0; |
| 161 | char const * xcf = 0; |
| @@ -189,17 +186,18 @@ | |
| 186 | @ <h2>Tags matching [%s(likeclause)]:</h2> |
| 187 | } |
| 188 | else |
| 189 | { |
| 190 | limitstr = mprintf( "LIMIT %d", limit ); |
| 191 | @ <h2>%d(limit) most recent non-wiki tags:</h2> |
| 192 | } |
| 193 | char * sql = mprintf( |
| 194 | "SELECT t.tagid, t.tagname, DATETIME(tx.mtime), b.uuid " |
| 195 | "FROM tag t, tagxref tx, blob b " |
| 196 | "WHERE (t.tagid=tx.tagid) and (tx.srcid=b.rid) " |
| 197 | "AND (tx.tagtype != 0) %s " |
| 198 | "AND t.tagname NOT GLOB 'wiki-*' " |
| 199 | "ORDER BY tx.mtime DESC %s", |
| 200 | likeclause ? likeclause : " ", |
| 201 | limitstr ? limitstr : " " |
| 202 | ); |
| 203 | /* " AND t.tagname NOT GLOB 'wiki-*'" // Do we want this?? */ |
| @@ -229,11 +227,13 @@ | |
| 227 | @ <input type='submit'/> |
| 228 | @ </form> |
| 229 | @ </div> |
| 230 | } |
| 231 | |
| 232 | /** |
| 233 | tagview_page_default() renders the default page for tagview_page(). |
| 234 | */ |
| 235 | static void tagview_page_default(void){ |
| 236 | tagview_page_list_tags( 0 ); |
| 237 | } |
| 238 | |
| 239 | /** |
| @@ -244,20 +244,21 @@ | |
| 244 | @ <h2>Tag #%d(tagid):</h2> |
| 245 | char * sql = mprintf( |
| 246 | "SELECT DISTINCT (t.tagname), DATETIME(tx.mtime), b.uuid " |
| 247 | "FROM tag t, tagxref tx, blob b " |
| 248 | "WHERE (t.tagid=%d) AND (t.tagid=tx.tagid) AND (tx.srcid=b.rid) " |
| 249 | "AND t.tagname NOT GLOB 'wiki-*' " |
| 250 | "ORDER BY tx.mtime DESC", |
| 251 | tagid); |
| 252 | char const * const colnames[] = { |
| 253 | "Tag Name", "Timestamp", "Version" |
| 254 | }; |
| 255 | tagview_strxform_f xf[] = { |
| 256 | tagview_xf_link_to_tagname, |
| 257 | 0, |
| 258 | tagview_xf_link_to_uuid |
| 259 | }; |
| 260 | tagview_run_query( sql, colnames, xf ); |
| 261 | free(sql); |
| 262 | } |
| 263 | |
| 264 | /** |
| @@ -268,10 +269,11 @@ | |
| 269 | @ <h2>Tag '%s(tagname)':</h2> |
| 270 | char * sql = mprintf( |
| 271 | "SELECT DISTINCT t.tagid, DATETIME(tx.mtime), b.uuid " |
| 272 | "FROM tag t, tagxref tx, blob b " |
| 273 | "WHERE (t.tagname='%q') AND (t.tagid=tx.tagid) AND (tx.srcid=b.rid) " |
| 274 | "AND t.tagname NOT GLOB 'wiki-*' " |
| 275 | "ORDER BY tx.mtime DESC", |
| 276 | tagname); |
| 277 | char const * const colnames[] = { |
| 278 | "Tag ID", "Timestamp", "Version" |
| 279 | }; |
| @@ -289,11 +291,11 @@ | |
| 291 | ** WEBPAGE: /tagview |
| 292 | */ |
| 293 | void tagview_page(void){ |
| 294 | |
| 295 | login_check_credentials(); |
| 296 | if( !g.okRdWiki ){ |
| 297 | login_needed(); |
| 298 | } |
| 299 | style_header("Tags"); |
| 300 | tagview_page_search_miniform(); |
| 301 | @ <hr/> |
| 302 |