Differences From:
File
src/timeline.c
part of check-in
[1a4dd313a8]
- Show the user who make the change on the timeline, both on the www interface
and in the cli.
by
drh on
2007-07-30 17:24:47.
[view]
To:
File
src/timeline.c
part of check-in
[fd36718ad9]
- Add the new "history" permission. Merge in changes that require
permissions to view the timeline.
by
drh on
2007-07-31 23:33:15.
[view]
@@ -32,19 +32,25 @@
*/
void hyperlink_to_uuid(const char *zUuid){
char zShortUuid[UUID_SIZE+1];
sprintf(zShortUuid, "%.10s", zUuid);
- @ <a href="%s(g.zBaseURL)/vinfo/%s(zUuid)">[%s(zShortUuid)]</a>
+ if( g.okHistory ){
+ @ <a href="%s(g.zBaseURL)/vinfo/%s(zUuid)">[%s(zShortUuid)]</a>
+ }else{
+ @ <b>[%s(zShortUuid)]</b>
+ }
}
/*
** Generate a hyperlink to a diff between two versions.
*/
void hyperlink_to_diff(const char *zV1, const char *zV2){
- if( zV2==0 ){
- @ <a href="%s(g.zBaseURL)/diff?v2=%s(zV1)">[diff]</a>
- }else{
- @ <a href="%s(g.zBaseURL)/diff?v1=%s(zV1)&v2=%s(zV2)">[diff]</a>
+ if( g.okHistory ){
+ if( zV2==0 ){
+ @ <a href="%s(g.zBaseURL)/diff?v2=%s(zV1)">[diff]</a>
+ }else{
+ @ <a href="%s(g.zBaseURL)/diff?v1=%s(zV1)&v2=%s(zV2)">[diff]</a>
+ }
}
}
@@ -53,8 +59,14 @@
*/
void page_timeline(void){
Stmt q;
char zPrevDate[20];
+
+ /* To view the timeline, must have permission to read project data.
+ */
+ login_check_credentials();
+ if( !g.okRead ){ login_needed(); return; }
+
style_header("Timeline");
zPrevDate[0] = 0;
db_prepare(&q,
"SELECT uuid, datetime(event.mtime,'localtime'), comment, user"