Fossil SCM

Fix incorrect redirects to "/home" when there is an ambiguous name on the artifact webpage. Ticket [901936cf06df1b9b]. Still need to add code that will list all possible answers and let the user choose.

drh 2010-04-22 00:00 trunk
Commit f44a3f70beee4be29945788cfc0f4e64cca54af5
1 file changed +3 -3
+3 -3
--- src/info.c
+++ src/info.c
@@ -836,11 +836,11 @@
836836
837837
rid = name_to_rid(PD("name","0"));
838838
zMime = PD("m","application/x-fossil-artifact");
839839
login_check_credentials();
840840
if( !g.okRead ){ login_needed(); return; }
841
- if( rid==0 ){ cgi_redirect("/home"); }
841
+ if( rid==0 ) fossil_redirect_home();
842842
content_get(rid, &content);
843843
cgi_set_content_type(zMime);
844844
cgi_set_content(&content);
845845
}
846846
@@ -909,11 +909,11 @@
909909
char *zUuid;
910910
911911
rid = name_to_rid(PD("name","0"));
912912
login_check_credentials();
913913
if( !g.okRead ){ login_needed(); return; }
914
- if( rid==0 ){ cgi_redirect("/home"); }
914
+ if( rid==0 ) fossil_redirect_home();
915915
if( g.okAdmin ){
916916
const char *zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid);
917917
if( db_exists("SELECT 1 FROM shun WHERE uuid='%s'", zUuid) ){
918918
style_submenu_element("Unshun","Unshun", "%s/shun?uuid=%s&sub=1",
919919
g.zTop, zUuid);
@@ -956,11 +956,11 @@
956956
const char *zUuid;
957957
958958
rid = name_to_rid(PD("name","0"));
959959
login_check_credentials();
960960
if( !g.okRead ){ login_needed(); return; }
961
- if( rid==0 ){ cgi_redirect("/home"); }
961
+ if( rid==0 ) fossil_redirect_home();
962962
if( g.okAdmin ){
963963
const char *zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid);
964964
if( db_exists("SELECT 1 FROM shun WHERE uuid='%s'", zUuid) ){
965965
style_submenu_element("Unshun","Unshun", "%s/shun?uuid=%s&sub=1",
966966
g.zTop, zUuid);
967967
--- src/info.c
+++ src/info.c
@@ -836,11 +836,11 @@
836
837 rid = name_to_rid(PD("name","0"));
838 zMime = PD("m","application/x-fossil-artifact");
839 login_check_credentials();
840 if( !g.okRead ){ login_needed(); return; }
841 if( rid==0 ){ cgi_redirect("/home"); }
842 content_get(rid, &content);
843 cgi_set_content_type(zMime);
844 cgi_set_content(&content);
845 }
846
@@ -909,11 +909,11 @@
909 char *zUuid;
910
911 rid = name_to_rid(PD("name","0"));
912 login_check_credentials();
913 if( !g.okRead ){ login_needed(); return; }
914 if( rid==0 ){ cgi_redirect("/home"); }
915 if( g.okAdmin ){
916 const char *zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid);
917 if( db_exists("SELECT 1 FROM shun WHERE uuid='%s'", zUuid) ){
918 style_submenu_element("Unshun","Unshun", "%s/shun?uuid=%s&sub=1",
919 g.zTop, zUuid);
@@ -956,11 +956,11 @@
956 const char *zUuid;
957
958 rid = name_to_rid(PD("name","0"));
959 login_check_credentials();
960 if( !g.okRead ){ login_needed(); return; }
961 if( rid==0 ){ cgi_redirect("/home"); }
962 if( g.okAdmin ){
963 const char *zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid);
964 if( db_exists("SELECT 1 FROM shun WHERE uuid='%s'", zUuid) ){
965 style_submenu_element("Unshun","Unshun", "%s/shun?uuid=%s&sub=1",
966 g.zTop, zUuid);
967
--- src/info.c
+++ src/info.c
@@ -836,11 +836,11 @@
836
837 rid = name_to_rid(PD("name","0"));
838 zMime = PD("m","application/x-fossil-artifact");
839 login_check_credentials();
840 if( !g.okRead ){ login_needed(); return; }
841 if( rid==0 ) fossil_redirect_home();
842 content_get(rid, &content);
843 cgi_set_content_type(zMime);
844 cgi_set_content(&content);
845 }
846
@@ -909,11 +909,11 @@
909 char *zUuid;
910
911 rid = name_to_rid(PD("name","0"));
912 login_check_credentials();
913 if( !g.okRead ){ login_needed(); return; }
914 if( rid==0 ) fossil_redirect_home();
915 if( g.okAdmin ){
916 const char *zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid);
917 if( db_exists("SELECT 1 FROM shun WHERE uuid='%s'", zUuid) ){
918 style_submenu_element("Unshun","Unshun", "%s/shun?uuid=%s&sub=1",
919 g.zTop, zUuid);
@@ -956,11 +956,11 @@
956 const char *zUuid;
957
958 rid = name_to_rid(PD("name","0"));
959 login_check_credentials();
960 if( !g.okRead ){ login_needed(); return; }
961 if( rid==0 ) fossil_redirect_home();
962 if( g.okAdmin ){
963 const char *zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid);
964 if( db_exists("SELECT 1 FROM shun WHERE uuid='%s'", zUuid) ){
965 style_submenu_element("Unshun","Unshun", "%s/shun?uuid=%s&sub=1",
966 g.zTop, zUuid);
967

Keyboard Shortcuts

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