| 290 | } |
| 291 | |
| 292 | void BZFSHTTPAuth::setupAuth(void) { |
| 293 | authPage = "<html><body><h4><a href=\"[$WebAuthURL]\">Please Login</a></h4></body></html>"; |
| 294 | |
| 295 | std::string returnURL; |
| 296 | if (!getBaseURL().size()) { |
| 297 | returnURL += format("http://localhost:%d/%s/", bz_getPublicPort(), getVDir()); |
| 298 | } |
| 299 | else { |
| 300 | returnURL += getBaseURL(); |
| 301 | } |
| 302 | returnURL += "?action=login&token=%TOKEN%&user=%USERNAME%"; |
| 303 | |
| 304 | tsCallback.URL = "http://my.bzflag.org/weblogin.php?action=weblogin&url="; |
| 305 | tsCallback.URL += url_encode(returnURL); |
| 306 | |
| 307 | templateSystem.addKey("WebAuthURL", &tsCallback); |
| 308 | } |
| 309 | |
| 310 | void BZFSHTTPAuth::TSURLCallback::keyCallback(std::string& data, const std::string& key) { |
| 311 | if (compare_nocase(key, "WebAuthURL") == 0) { |
nothing calls this directly
no test coverage detected