|
31 | 31 | #----------------------------------------------------------------------# |
32 | 32 | NAME = 'sqliteboy' |
33 | 33 | APP_DESC = 'Simple web-based management tool for SQLite database (with form, report, website, and many other features)' |
34 | | -VERSION = '1.70' |
| 34 | +VERSION = '1.71' |
35 | 35 | WSITE = 'http://sqliteboy.com' |
36 | 36 | TITLE = NAME + ' ' + VERSION |
37 | 37 | TITLE_DEFAULT = NAME |
|
330 | 330 | 'log_init', |
331 | 331 | 0, |
332 | 332 | ), |
| 333 | + ( |
| 334 | + 'x_log', |
| 335 | + 'x_log_override', |
| 336 | + 'log.override.', |
| 337 | + 'log.override..%s' %(''), |
| 338 | + '', |
| 339 | + str, |
| 340 | + 1, |
| 341 | + ), |
333 | 342 | ( |
334 | 343 | 'x_users', |
335 | 344 | 'x_user_defined_profile_ref', |
@@ -1939,6 +1948,7 @@ def _render_option(self, arg, indent=' '): |
1939 | 1948 | 'x_not_avail_pdf': 'not available, PDF output will be disabled', |
1940 | 1949 | 'x_log': 'logs', |
1941 | 1950 | 'x_log_access': 'access log path (absolute, forward slash / for separator, will be verified on save or empty string if verification failed, use current database might impact the database)', |
| 1951 | + 'x_log_override': 'log only specific URLs (please start each URL with /, separate URLs with whitespace, will discard everything else)', |
1942 | 1952 | 'x_link': 'links', |
1943 | 1953 | 'x_link_login': 'additional/custom links at login page (please read Link Code Reference)', |
1944 | 1954 | 'x_url': 'url', |
@@ -3436,16 +3446,30 @@ def proc_log(handle): |
3436 | 3446 | # |
3437 | 3447 | env = web.ctx.env |
3438 | 3448 | # |
3439 | | - dbtest.insert( |
3440 | | - LOG_TABLE, |
3441 | | - a=env.get('REMOTE_ADDR', ''), |
3442 | | - b=env.get('HTTP_X_FORWARDED_FOR', ''), |
3443 | | - c=env.get('HTTP_USER_AGENT', ''), |
3444 | | - d=user(), |
3445 | | - e=web.ctx.method, |
3446 | | - f=web.ctx.path, |
3447 | | - g=web.ctx.query, |
3448 | | - ) |
| 3449 | + save = True |
| 3450 | + path = web.ctx.path |
| 3451 | + # |
| 3452 | + override = s_select('log.override..') |
| 3453 | + if override: |
| 3454 | + override = override[0]['d'].split() |
| 3455 | + if override: |
| 3456 | + override = [x.strip() for x in override if x.strip()] |
| 3457 | + if override: |
| 3458 | + save = False |
| 3459 | + if path in override: |
| 3460 | + save = True |
| 3461 | + # |
| 3462 | + if save: |
| 3463 | + dbtest.insert( |
| 3464 | + LOG_TABLE, |
| 3465 | + a=env.get('REMOTE_ADDR', ''), |
| 3466 | + b=env.get('HTTP_X_FORWARDED_FOR', ''), |
| 3467 | + c=env.get('HTTP_USER_AGENT', ''), |
| 3468 | + d=user(), |
| 3469 | + e=web.ctx.method, |
| 3470 | + f=path, |
| 3471 | + g=web.ctx.query, |
| 3472 | + ) |
3449 | 3473 | except: |
3450 | 3474 | pass |
3451 | 3475 | # |
|
0 commit comments