| | @@ -212,20 +212,34 @@ |
| 212 | 212 | if( zHttpAuth && zHttpAuth[0] ){ |
| 213 | 213 | g.zHttpAuth = mprintf("%s", zHttpAuth); |
| 214 | 214 | } |
| 215 | 215 | if( fRemember ){ |
| 216 | 216 | if( g.zHttpAuth && g.zHttpAuth[0] ){ |
| 217 | | - db_set("http-auth", obscure(g.zHttpAuth), 0); |
| 217 | + set_httpauth(g.zHttpAuth); |
| 218 | 218 | }else if( zUrl && zUrl[0] ){ |
| 219 | 219 | db_unset("http-auth", 0); |
| 220 | 220 | }else{ |
| 221 | | - g.zHttpAuth = unobscure(db_get("http-auth",0)); |
| 221 | + g.zHttpAuth = get_httpauth(); |
| 222 | 222 | } |
| 223 | 223 | }else if( g.zHttpAuth==0 && zUrl==0 ){ |
| 224 | | - g.zHttpAuth = unobscure(db_get("http-auth",0)); |
| 224 | + g.zHttpAuth = get_httpauth(); |
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | + |
| 228 | +/* |
| 229 | +** Get the HTTP Authorization preference from db. |
| 230 | +*/ |
| 231 | +char *get_httpauth(void){ |
| 232 | + return unobscure(db_get("http-auth", 0)); |
| 233 | +} |
| 234 | + |
| 235 | +/* |
| 236 | +** Set the HTTP Authorization preference in db. |
| 237 | +*/ |
| 238 | +void set_httpauth(const char *zHttpAuth){ |
| 239 | + db_set("http-auth", obscure(zHttpAuth), 0); |
| 240 | +} |
| 227 | 241 | |
| 228 | 242 | /* |
| 229 | 243 | ** Look for SSH clone command line options and setup in globals. |
| 230 | 244 | */ |
| 231 | 245 | void clone_ssh_find_options(void){ |
| 232 | 246 | |