From 25d75bd4a2d2da78e30d6b0109cfa8f7d4cc78ba Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Thu, 14 Oct 2010 18:36:11 +0200 Subject: [PATCH] Added login URL posting. --- config/linkcheckerrc | 15 +- debian/control | 2 +- doc/changelog.txt | 5 +- doc/de.po | 304 ++++++++++++++++----------- doc/de/linkcheckerrc.5 | 17 +- doc/en/linkcheckerrc.5 | 15 ++ doc/install.txt | 18 +- doc/linkchecker.doc.pot | 265 +++++++++++++---------- doc/todo.txt | 2 +- linkcheck/configuration/__init__.py | 37 ++++ linkcheck/configuration/confparse.py | 18 ++ linkcheck/cookies.py | 77 +++++++ linkcheck/director/__init__.py | 86 +++++++- tests/configuration/data/config0.ini | 7 + tests/configuration/test_config.py | 6 + 15 files changed, 630 insertions(+), 244 deletions(-) diff --git a/config/linkcheckerrc b/config/linkcheckerrc index be609ac8..1ee36fff 100644 --- a/config/linkcheckerrc +++ b/config/linkcheckerrc @@ -169,6 +169,7 @@ #internlinks=^http://www\.my(other)?domain\.net/ +[authentication] # You can provide different user/password pairs for different link types. # Entries are a triple (link regular expression, username, password), # separated by whitespace. @@ -176,7 +177,19 @@ # for authentication. The commandline options -u,-p match every link # and therefore override the entries given here. The first match wins. # At the moment, authentication is used/needed for http[s] and ftp links. -[authentication] #entry= # ^http://treasure\.calvinsplayground\.de/~calvin/isnichmehr/ lebowski lebowski # ^ftp://void.cs.uni-sb.de calvin hutzli + +# if the website requires a login the URL and optionally the user and +# password CGI fieldnames can be provided. +#loginurl=http://www.example.com/ + +# The name of the user and password CGI field +#loginuserfield=login +#loginpasswordfield=password +# Optionally any additional CGI name/value pairs. Note that the default +# values are submitted automatically. +#loginextrafields= +# name1:value1 +# name 2:value 2 diff --git a/debian/control b/debian/control index 79daa7a0..85160e5a 100644 --- a/debian/control +++ b/debian/control @@ -16,7 +16,7 @@ XB-Python-Version: ${python:Versions} Provides: ${python:Provides} Suggests: apache2 | httpd, python-optcomplete (>= 1.2-5), python-geoip (>= 1.2.1-2), clamav-daemon, python-utidylib, - python-cssutils, python-pysqlite2 + python-cssutils, python-pysqlite2, python-twill Description: check websites and HTML documents for broken links Provides a command line program and web interface to check links of websites and HTML documents. diff --git a/doc/changelog.txt b/doc/changelog.txt index 905e2823..7f28421d 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -1,4 +1,4 @@ -5.4 "" (released xx.xx.2010) +5.4 "" (released xx.10.2010) Fixes: - gui: Enable the cancel button again after it has been clicked and @@ -21,6 +21,9 @@ Features: Closes: SF bug #2931320 - config: Added configuration file option for the --cookies command line option. +- http: Allow specifying a login URL in the configuration file which + gets visited before checking submits login data. + Closes: SF bug #3041527 5.3 "Inception" (released 29.9.2010) diff --git a/doc/de.po b/doc/de.po index 8beb75b2..8d0944de 100644 --- a/doc/de.po +++ b/doc/de.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: linkchecker 3.4\n" -"POT-Creation-Date: 2010-10-12 00:31+0300\n" -"PO-Revision-Date: 2010-10-12 00:18+0100\n" +"POT-Creation-Date: 2010-10-14 18:25+0300\n" +"PO-Revision-Date: 2010-10-14 18:29+0100\n" "Last-Translator: Bastian Kleineidam \n" "Language-Team: de \n" "Language: \n" @@ -249,7 +249,7 @@ msgstr "B<-I>, B<--interactive>" # type: Plain text #. type: Plain text -#: en/linkchecker.1:65 en/linkcheckerrc.5:137 +#: en/linkchecker.1:65 en/linkcheckerrc.5:152 msgid "Ask for URL if none are given on the commandline." msgstr "Frage nach URLs, falls keine auf der Kommandozeile eingegeben wurden." @@ -520,7 +520,7 @@ msgstr "B<-o>I[BI], B<--output=>I[BI]" # type: Plain text #. type: Plain text -#: en/linkchecker.1:130 en/linkcheckerrc.5:158 +#: en/linkchecker.1:130 en/linkcheckerrc.5:173 msgid "" "Specify output type as B, B, B, B, B, B, " "B, B or B. Default type is B. The various " @@ -532,7 +532,7 @@ msgstr "" # type: Plain text #. type: Plain text -#: en/linkchecker.1:134 en/linkcheckerrc.5:162 +#: en/linkchecker.1:134 en/linkcheckerrc.5:177 msgid "" "The I specifies the output encoding, the default is that of your " "locale. Valid encodings are listed at B(5)" # type: SH #. type: SH -#: en/linkchecker.1:533 en/linkcheckerrc.5:412 en/linkchecker-gui.1:14 +#: en/linkchecker.1:533 en/linkcheckerrc.5:427 en/linkchecker-gui.1:14 #, no-wrap msgid "AUTHOR" msgstr "AUTHOR" # type: Plain text #. type: Plain text -#: en/linkchecker.1:535 en/linkcheckerrc.5:414 en/linkchecker-gui.1:16 +#: en/linkchecker.1:535 en/linkcheckerrc.5:429 en/linkchecker-gui.1:16 msgid "Bastian Kleineidam Ecalvin@users.sourceforge.netE" msgstr "Bastian Kleineidam Ecalvin@users.sourceforge.netE" # type: SH #. type: SH -#: en/linkchecker.1:536 en/linkcheckerrc.5:415 en/linkchecker-gui.1:17 +#: en/linkchecker.1:536 en/linkcheckerrc.5:430 en/linkchecker-gui.1:17 #, no-wrap msgid "COPYRIGHT" msgstr "COPYRIGHT" # type: Plain text #. type: Plain text -#: en/linkchecker.1:537 en/linkcheckerrc.5:416 +#: en/linkchecker.1:537 en/linkcheckerrc.5:431 msgid "Copyright \\(co 2000-2010 Bastian Kleineidam" msgstr "Copyright \\(co 2000-2010 Bastian Kleineidam" @@ -2065,7 +2065,7 @@ msgstr "Dateiname von B Konfigurationsdatei." # type: Plain text #. type: Plain text #: en/linkcheckerrc.5:90 en/linkcheckerrc.5:113 en/linkcheckerrc.5:119 -#: en/linkcheckerrc.5:212 en/linkcheckerrc.5:228 +#: en/linkcheckerrc.5:227 en/linkcheckerrc.5:243 msgid "Command line option: none" msgstr "Kommandozeilenoption: keine" @@ -2183,7 +2183,7 @@ msgstr "[authentication]" #: en/linkcheckerrc.5:120 #, no-wrap msgid "BI I I (MULTILINE)" -msgstr "BI I I (MULTILINE)" +msgstr "BI I I (MULTILINE)" # type: Plain text #. type: Plain text @@ -2218,36 +2218,94 @@ msgstr "" msgid "Command line option: B<-u>, B<-p>" msgstr "Kommandozeilenoption: B<-u>, B<-p>" +# type: TP +#. type: TP +#: en/linkcheckerrc.5:133 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: en/linkcheckerrc.5:138 +msgid "" +"A login URL to be visited before checking. Also needs authentication data " +"set for it, and implies using cookies because most logins use cookies " +"nowadays." +msgstr "" +"Eine Anmelde-URL, die vor der Prüfung besucht wird. Benötigt einen Eintrag " +"zur Authentifizierung und impliziert die Benutzung von Cookies, weil die " +"meisten Anmeldungen heutzutage Cookies benutzen." + +# type: TP +#. type: TP +#: en/linkcheckerrc.5:138 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: en/linkcheckerrc.5:141 +msgid "The name of the user CGI field. Default name is B." +msgstr "Der Name für das Benutzer CGI-Feld. Der Standardname ist B." + +# type: TP +#. type: TP +#: en/linkcheckerrc.5:141 +#, no-wrap +msgid "BI" +msgstr "BI" + +#. type: Plain text +#: en/linkcheckerrc.5:144 +msgid "The name of the password CGI field. Default name is B." +msgstr "Der Name für das Passwort CGI-Feld. Der Standardname ist B." + +# type: TP +#. type: TP +#: en/linkcheckerrc.5:144 +#, no-wrap +msgid "BIB<:>I (MULTILINE)" +msgstr "BIB<:>I (MULTILINE)" + +#. type: Plain text +#: en/linkcheckerrc.5:148 +msgid "" +"Optionally any additional CGI name/value pairs. Note that the default values " +"are submitted automatically." +msgstr "" +"Optional zusätzliche CGI Namen/Werte-Paare. Die Default-Werte werden " +"automatisch übermittelt." + # type: SS #. type: SS -#: en/linkcheckerrc.5:133 +#: en/linkcheckerrc.5:148 #, no-wrap msgid "[output]" msgstr "[output]" # type: TP #. type: TP -#: en/linkcheckerrc.5:134 +#: en/linkcheckerrc.5:149 #, no-wrap msgid "B[B<0>|B<1>]" msgstr "B[B<0>|B<1>]" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:139 +#: en/linkcheckerrc.5:154 msgid "Command line option: B<--interactive>" msgstr "Kommandozeilenoption: B<--interactive>" # type: TP #. type: TP -#: en/linkcheckerrc.5:139 +#: en/linkcheckerrc.5:154 #, no-wrap msgid "BI[B<,>I...]" msgstr "BI[B<,>I...]" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:145 +#: en/linkcheckerrc.5:160 msgid "" "Print debugging output for the given loggers. Available loggers are " "B, B, B, B, B, B and B. " @@ -2259,52 +2317,52 @@ msgstr "" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:147 +#: en/linkcheckerrc.5:162 msgid "Command line option: B<--debug>" msgstr "[output]" # type: TP #. type: TP -#: en/linkcheckerrc.5:147 +#: en/linkcheckerrc.5:162 #, no-wrap msgid "B[B<0>|B<1>]" msgstr "B[B<0>|B<1>]" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:150 +#: en/linkcheckerrc.5:165 msgid "Control printing check status messages. Default is 1." msgstr "Kontrolle der Statusmeldungen. Standard ist 1." # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:152 +#: en/linkcheckerrc.5:167 msgid "Command line option: B<--no-status>" msgstr "Kommandozeilenoption: B<--no-status>" # type: TP #. type: TP -#: en/linkcheckerrc.5:152 +#: en/linkcheckerrc.5:167 #, no-wrap msgid "BI[BI]" msgstr "BI[BI]" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:164 +#: en/linkcheckerrc.5:179 msgid "Command line option: B<--output>" msgstr "Kommandozeilenoption: B<--output>" # type: TP #. type: TP -#: en/linkcheckerrc.5:164 +#: en/linkcheckerrc.5:179 #, no-wrap msgid "B[B<0>|B<1>]" msgstr "B[B<0>|B<1>]" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:167 +#: en/linkcheckerrc.5:182 msgid "" "If set log all checked URLs once. Default is to log only errors and warnings." msgstr "" @@ -2313,20 +2371,20 @@ msgstr "" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:169 en/linkcheckerrc.5:186 +#: en/linkcheckerrc.5:184 en/linkcheckerrc.5:201 msgid "Command line option: B<--verbose>" msgstr "Kommandozeilenoption: B<--verbose>" # type: TP #. type: TP -#: en/linkcheckerrc.5:169 +#: en/linkcheckerrc.5:184 #, no-wrap msgid "B[B<0>|B<1>]" msgstr "B[B<0>|B<1>]" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:173 +#: en/linkcheckerrc.5:188 msgid "" "If set log all checked URLs, even duplicates. Default is to log duplicate " "URLs only once." @@ -2336,20 +2394,20 @@ msgstr "" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:175 +#: en/linkcheckerrc.5:190 msgid "Command line option: B<--complete>" msgstr "Kommandozeilenoption: B<--complete>" # type: TP #. type: TP -#: en/linkcheckerrc.5:175 +#: en/linkcheckerrc.5:190 #, no-wrap msgid "B[B<0>|B<1>]" msgstr "B[B<0>|B<1>]" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:178 +#: en/linkcheckerrc.5:193 msgid "If set log warnings. Default is to log warnings." msgstr "" "Falls gesetzt, gebe keine Warnungen aus. Standard ist die Ausgabe von " @@ -2357,20 +2415,20 @@ msgstr "" # type: TP #. type: Plain text -#: en/linkcheckerrc.5:180 +#: en/linkcheckerrc.5:195 msgid "Command line option: B<--no-warnings>" msgstr "Kommandozeilenoption: B<--no-warnings>" # type: TP #. type: TP -#: en/linkcheckerrc.5:180 +#: en/linkcheckerrc.5:195 #, no-wrap msgid "B[B<0>|B<1>]" msgstr "B[B<0>|B<1>]" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:184 +#: en/linkcheckerrc.5:199 msgid "" "If set, operate quiet. An alias for B. This is only useful with " "B." @@ -2380,14 +2438,14 @@ msgstr "" # type: TP #. type: TP -#: en/linkcheckerrc.5:186 +#: en/linkcheckerrc.5:201 #, no-wrap msgid "BI[B<,>I...]" msgstr "BI[B<,>I...]" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:191 +#: en/linkcheckerrc.5:206 msgid "" "Output to a files BI, B<$HOME/.linkchecker/" "blacklist> for B output." @@ -2397,7 +2455,7 @@ msgstr "" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:197 +#: en/linkcheckerrc.5:212 msgid "" "Valid file output types are B, B, B, B, B, " "B, B, B or B Default is no file output. The " @@ -2411,29 +2469,29 @@ msgstr "" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:199 +#: en/linkcheckerrc.5:214 msgid "Command line option: B<--file-output>" msgstr "Kommandozeilenoption: B<--file-output>" # type: TP #. type: SS -#: en/linkcheckerrc.5:199 +#: en/linkcheckerrc.5:214 #, no-wrap msgid "[text]" msgstr "[text]" # type: TP #. type: TP -#: en/linkcheckerrc.5:200 en/linkcheckerrc.5:262 en/linkcheckerrc.5:272 -#: en/linkcheckerrc.5:282 en/linkcheckerrc.5:298 en/linkcheckerrc.5:314 -#: en/linkcheckerrc.5:345 en/linkcheckerrc.5:352 en/linkcheckerrc.5:362 +#: en/linkcheckerrc.5:215 en/linkcheckerrc.5:277 en/linkcheckerrc.5:287 +#: en/linkcheckerrc.5:297 en/linkcheckerrc.5:313 en/linkcheckerrc.5:329 +#: en/linkcheckerrc.5:360 en/linkcheckerrc.5:367 en/linkcheckerrc.5:377 #, no-wrap msgid "BI" msgstr "BI" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:204 +#: en/linkcheckerrc.5:219 msgid "" "Specify output filename for text logging. Default filename is B." @@ -2443,22 +2501,22 @@ msgstr "" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:206 +#: en/linkcheckerrc.5:221 msgid "Command line option: B<--file-output=>" msgstr "Kommandozeilenoption: B<--file-output=>" # type: TP #. type: TP -#: en/linkcheckerrc.5:206 en/linkcheckerrc.5:265 en/linkcheckerrc.5:275 -#: en/linkcheckerrc.5:285 en/linkcheckerrc.5:301 en/linkcheckerrc.5:317 -#: en/linkcheckerrc.5:355 en/linkcheckerrc.5:365 +#: en/linkcheckerrc.5:221 en/linkcheckerrc.5:280 en/linkcheckerrc.5:290 +#: en/linkcheckerrc.5:300 en/linkcheckerrc.5:316 en/linkcheckerrc.5:332 +#: en/linkcheckerrc.5:370 en/linkcheckerrc.5:380 #, no-wrap msgid "BI" msgstr "BI" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:210 +#: en/linkcheckerrc.5:225 msgid "" "Comma-separated list of parts that have to be logged. See B " "below." @@ -2468,16 +2526,16 @@ msgstr "" # type: TP #. type: TP -#: en/linkcheckerrc.5:212 en/linkcheckerrc.5:268 en/linkcheckerrc.5:278 -#: en/linkcheckerrc.5:288 en/linkcheckerrc.5:304 en/linkcheckerrc.5:320 -#: en/linkcheckerrc.5:348 en/linkcheckerrc.5:358 en/linkcheckerrc.5:368 +#: en/linkcheckerrc.5:227 en/linkcheckerrc.5:283 en/linkcheckerrc.5:293 +#: en/linkcheckerrc.5:303 en/linkcheckerrc.5:319 en/linkcheckerrc.5:335 +#: en/linkcheckerrc.5:363 en/linkcheckerrc.5:373 en/linkcheckerrc.5:383 #, no-wrap msgid "BI" msgstr "BI" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:217 +#: en/linkcheckerrc.5:232 msgid "" "Valid encodings are listed in B. Default encoding is B." @@ -2488,14 +2546,14 @@ msgstr "" # type: TP #. type: TP -#: en/linkcheckerrc.5:217 +#: en/linkcheckerrc.5:232 #, no-wrap msgid "I" msgstr "I" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:226 +#: en/linkcheckerrc.5:241 msgid "" "Color settings for the various log parts, syntax is I or IB<;" ">I. The I can be B, B, B, B. The " @@ -2511,363 +2569,363 @@ msgstr "" # type: TP #. type: TP -#: en/linkcheckerrc.5:228 +#: en/linkcheckerrc.5:243 #, no-wrap msgid "BI" msgstr "BI" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:231 +#: en/linkcheckerrc.5:246 msgid "Set parent color. Default is B." msgstr "Setze Farbe des Vaters. Standard ist B." # type: TP #. type: TP -#: en/linkcheckerrc.5:231 +#: en/linkcheckerrc.5:246 #, no-wrap msgid "BI" msgstr "BI" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:234 +#: en/linkcheckerrc.5:249 msgid "Set URL color. Default is B." msgstr "Setze URL Farbe. Standard ist B." # type: TP #. type: TP -#: en/linkcheckerrc.5:234 +#: en/linkcheckerrc.5:249 #, no-wrap msgid "BI" msgstr "BI" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:237 +#: en/linkcheckerrc.5:252 msgid "Set name color. Default is B." msgstr "Kommandozeilenoption: B<--file-output=>" # type: TP #. type: TP -#: en/linkcheckerrc.5:237 +#: en/linkcheckerrc.5:252 #, no-wrap msgid "BI" msgstr "BI" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:240 +#: en/linkcheckerrc.5:255 msgid "Set real URL color. Default is B." msgstr "Setze Farbe für tatsächliche URL. Default ist B." # type: TP #. type: TP -#: en/linkcheckerrc.5:240 +#: en/linkcheckerrc.5:255 #, no-wrap msgid "BI" msgstr "BI" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:243 +#: en/linkcheckerrc.5:258 msgid "Set base URL color. Default is B." msgstr "Setzt Basisurl Farbe. Standard ist B." # type: TP #. type: TP -#: en/linkcheckerrc.5:243 +#: en/linkcheckerrc.5:258 #, no-wrap msgid "BI" msgstr "BI" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:246 +#: en/linkcheckerrc.5:261 msgid "Set valid color. Default is B." msgstr "Setze gültige Farbe. Standard ist B." # type: TP #. type: TP -#: en/linkcheckerrc.5:246 +#: en/linkcheckerrc.5:261 #, no-wrap msgid "BI" msgstr "BI" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:249 +#: en/linkcheckerrc.5:264 msgid "Set invalid color. Default is B." msgstr "Setze ungültige Farbe. Standard ist B." # type: TP #. type: TP -#: en/linkcheckerrc.5:249 +#: en/linkcheckerrc.5:264 #, no-wrap msgid "BI" msgstr "BI" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:252 +#: en/linkcheckerrc.5:267 msgid "Set info color. Default is B." msgstr "Setzt Informationsfarbe. Standard ist B." # type: TP #. type: TP -#: en/linkcheckerrc.5:252 +#: en/linkcheckerrc.5:267 #, no-wrap msgid "BI" msgstr "BI" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:255 +#: en/linkcheckerrc.5:270 msgid "Set warning color. Default is B." msgstr "Setze Warnfarbe. Standard ist B." # type: TP #. type: TP -#: en/linkcheckerrc.5:255 +#: en/linkcheckerrc.5:270 #, no-wrap msgid "BI" msgstr "BI" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:258 +#: en/linkcheckerrc.5:273 msgid "Set download time color. Default is B." msgstr "Setze Downloadzeitfarbe. Standard ist B." # type: TP #. type: TP -#: en/linkcheckerrc.5:258 +#: en/linkcheckerrc.5:273 #, no-wrap msgid "BI" msgstr "BI" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:261 +#: en/linkcheckerrc.5:276 msgid "Set reset color. Default is B." msgstr "Setze Reset Farbe. Standard ist B." # type: SS #. type: SS -#: en/linkcheckerrc.5:261 +#: en/linkcheckerrc.5:276 #, no-wrap msgid "[gml]" msgstr "[gml]" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:265 en/linkcheckerrc.5:268 en/linkcheckerrc.5:271 -#: en/linkcheckerrc.5:275 en/linkcheckerrc.5:278 en/linkcheckerrc.5:281 -#: en/linkcheckerrc.5:285 en/linkcheckerrc.5:288 en/linkcheckerrc.5:291 -#: en/linkcheckerrc.5:301 en/linkcheckerrc.5:304 en/linkcheckerrc.5:307 -#: en/linkcheckerrc.5:317 en/linkcheckerrc.5:320 en/linkcheckerrc.5:323 -#: en/linkcheckerrc.5:348 en/linkcheckerrc.5:351 en/linkcheckerrc.5:355 -#: en/linkcheckerrc.5:358 en/linkcheckerrc.5:361 en/linkcheckerrc.5:365 -#: en/linkcheckerrc.5:368 en/linkcheckerrc.5:371 +#: en/linkcheckerrc.5:280 en/linkcheckerrc.5:283 en/linkcheckerrc.5:286 +#: en/linkcheckerrc.5:290 en/linkcheckerrc.5:293 en/linkcheckerrc.5:296 +#: en/linkcheckerrc.5:300 en/linkcheckerrc.5:303 en/linkcheckerrc.5:306 +#: en/linkcheckerrc.5:316 en/linkcheckerrc.5:319 en/linkcheckerrc.5:322 +#: en/linkcheckerrc.5:332 en/linkcheckerrc.5:335 en/linkcheckerrc.5:338 +#: en/linkcheckerrc.5:363 en/linkcheckerrc.5:366 en/linkcheckerrc.5:370 +#: en/linkcheckerrc.5:373 en/linkcheckerrc.5:376 en/linkcheckerrc.5:380 +#: en/linkcheckerrc.5:383 en/linkcheckerrc.5:386 msgid "See [text] section above." msgstr "Siehe [text] Sektion weiter oben." # type: SS #. type: SS -#: en/linkcheckerrc.5:271 +#: en/linkcheckerrc.5:286 #, no-wrap msgid "[dot]" msgstr "[dot]" # type: SS #. type: SS -#: en/linkcheckerrc.5:281 +#: en/linkcheckerrc.5:296 #, no-wrap msgid "[csv]" msgstr "[csv]" # type: TP #. type: TP -#: en/linkcheckerrc.5:291 en/linkcheckerrc.5:310 +#: en/linkcheckerrc.5:306 en/linkcheckerrc.5:325 #, no-wrap msgid "BI" msgstr "BI" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:294 +#: en/linkcheckerrc.5:309 msgid "Set CSV separator. Default is a comma (B<,>)." msgstr "Das CSV Trennzeichen. Standard ist Komma (B<,>)." # type: TP #. type: TP -#: en/linkcheckerrc.5:294 +#: en/linkcheckerrc.5:309 #, no-wrap msgid "BI" msgstr "BI" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:297 +#: en/linkcheckerrc.5:312 msgid "Set CSV quote character. Default is a double quote (B<\">)." msgstr "" "Setze CSV Quotezeichen. Standard ist das doppelte Anführungszeichen (B<\">)." # type: SS #. type: SS -#: en/linkcheckerrc.5:297 +#: en/linkcheckerrc.5:312 #, no-wrap msgid "[sql]" msgstr "[sql]" # type: TP #. type: TP -#: en/linkcheckerrc.5:307 +#: en/linkcheckerrc.5:322 #, no-wrap msgid "BI" msgstr "BI" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:310 +#: en/linkcheckerrc.5:325 msgid "Set database name to store into. Default is B." msgstr "Setze Datenbankname zum Speichern. Standard ist B." # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:313 +#: en/linkcheckerrc.5:328 msgid "Set SQL command separator character. Default is a semicolor (B<;>)." msgstr "Setze SQL Kommandotrennzeichen. Standard ist ein Strichpunkt (B<;>)." # type: TP #. type: SS -#: en/linkcheckerrc.5:313 +#: en/linkcheckerrc.5:328 #, no-wrap msgid "[html]" msgstr "[html]" # type: TP #. type: TP -#: en/linkcheckerrc.5:323 +#: en/linkcheckerrc.5:338 #, no-wrap msgid "BI" msgstr "BI" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:326 +#: en/linkcheckerrc.5:341 msgid "Set HTML background color. Default is B<#fff7e5>." msgstr "Setze Reset Farbe. Standard ist B." # type: TP #. type: TP -#: en/linkcheckerrc.5:326 +#: en/linkcheckerrc.5:341 #, no-wrap msgid "B" msgstr "B" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:329 +#: en/linkcheckerrc.5:344 msgid "Set HTML URL color. Default is B<#dcd5cf>." msgstr "Setze HTML URL Farbe. Standard ist B<#dcd5cf>." # type: TP #. type: TP -#: en/linkcheckerrc.5:329 +#: en/linkcheckerrc.5:344 #, no-wrap msgid "B" msgstr "B" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:332 +#: en/linkcheckerrc.5:347 msgid "Set HTML border color. Default is B<#000000>." msgstr "Setze HTML Rahmenfarbe. Standard ist B<#000000>." # type: TP #. type: TP -#: en/linkcheckerrc.5:332 +#: en/linkcheckerrc.5:347 #, no-wrap msgid "B" msgstr "B" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:335 +#: en/linkcheckerrc.5:350 msgid "Set HTML link color. Default is B<#191c83>." msgstr "Setze HTML Verknüpfungsfarbe. Standard ist B<#191c83>." # type: TP #. type: TP -#: en/linkcheckerrc.5:335 +#: en/linkcheckerrc.5:350 #, no-wrap msgid "B" msgstr "B" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:338 +#: en/linkcheckerrc.5:353 msgid "Set HTML warning color. Default is B<#e0954e>." msgstr "Setze HTML Warnfarbe. Standard ist B<#e0954e>." # type: TP #. type: TP -#: en/linkcheckerrc.5:338 +#: en/linkcheckerrc.5:353 #, no-wrap msgid "B" msgstr "B" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:341 +#: en/linkcheckerrc.5:356 msgid "Set HTML error color. Default is B<#db4930>." msgstr "Setze HTML Fehlerfarbe. Standard ist B<#db4930>." # type: TP #. type: TP -#: en/linkcheckerrc.5:341 +#: en/linkcheckerrc.5:356 #, no-wrap msgid "B" msgstr "B" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:344 +#: en/linkcheckerrc.5:359 msgid "Set HTML valid color. Default is B<#3ba557>." msgstr "Setze HTML Gültigkeitsfarbe. Standard ist B<#3ba557>." # type: TP #. type: SS -#: en/linkcheckerrc.5:344 +#: en/linkcheckerrc.5:359 #, no-wrap msgid "[blacklist]" msgstr "[blacklist]" # type: SS #. type: SS -#: en/linkcheckerrc.5:351 +#: en/linkcheckerrc.5:366 #, no-wrap msgid "[xml]" msgstr "[xml]" # type: TP #. type: SS -#: en/linkcheckerrc.5:361 +#: en/linkcheckerrc.5:376 #, no-wrap msgid "[gxml]" msgstr "[gxml]" # type: SH #. type: SH -#: en/linkcheckerrc.5:372 +#: en/linkcheckerrc.5:387 #, no-wrap msgid "LOGGER PARTS" msgstr "AUSGABE PARTS" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:388 +#: en/linkcheckerrc.5:403 #, no-wrap msgid "" " B (for all parts)\n" @@ -2904,14 +2962,14 @@ msgstr "" # type: SH #. type: SH -#: en/linkcheckerrc.5:388 +#: en/linkcheckerrc.5:403 #, no-wrap msgid "MULTILINE" msgstr "MULTILINE" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:392 +#: en/linkcheckerrc.5:407 msgid "" "Some option values can span multiple lines. Each line has to be indented for " "that to work. Lines starting with a hash (B<#>) will be ignored, though they " @@ -2923,7 +2981,7 @@ msgstr "" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:398 +#: en/linkcheckerrc.5:413 #, no-wrap msgid "" " ignore=\n" @@ -2939,14 +2997,14 @@ msgstr "" # type: SH #. type: SH -#: en/linkcheckerrc.5:399 +#: en/linkcheckerrc.5:414 #, no-wrap msgid "EXAMPLE" msgstr "BEISPIEL" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:402 +#: en/linkcheckerrc.5:417 #, no-wrap msgid "" " [output]\n" @@ -2957,7 +3015,7 @@ msgstr "" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:405 +#: en/linkcheckerrc.5:420 #, no-wrap msgid "" " [checking]\n" @@ -2968,7 +3026,7 @@ msgstr "" # type: Plain text #. type: Plain text -#: en/linkcheckerrc.5:408 +#: en/linkcheckerrc.5:423 #, no-wrap msgid "" " [filtering]\n" @@ -2979,7 +3037,7 @@ msgstr "" # type: TH #. type: Plain text -#: en/linkcheckerrc.5:411 +#: en/linkcheckerrc.5:426 msgid "linkchecker(1)" msgstr "BEISPIEL" diff --git a/doc/de/linkcheckerrc.5 b/doc/de/linkcheckerrc.5 index 1e209b82..a50ddcb4 100644 --- a/doc/de/linkcheckerrc.5 +++ b/doc/de/linkcheckerrc.5 @@ -125,7 +125,7 @@ hinzuzufügen. Standard ist dass URLs der Kommandozeile als intern gelten. Kommandozeilenoption: keine .SS [authentication] .TP -\fBentry=\fP\fIREGEX\fP \fIUSER\fP \fIPASS\fP (MULTILINE) +\fBentry=\fP\fIREGEX\fP \fIBENUTZER\fP \fIPASSWORT\fP (MULTILINE) Erstelle verschiedene Benutzer/Passwort Parre für verschiedene Verknüpfungsarten. Einträge sind ein Tripel (Verknüpfung regulärer Ausdruck, Benutzername, Passwort), getrennt durch Leerzeichen. @@ -137,6 +137,21 @@ hier. Der erste Treffer gewinnt. Im Moment wird Authentifizierung für http[s] und ftp Verknüpfungen benutzt. .br Kommandozeilenoption: \fB\-u\fP, \fB\-p\fP +.TP +\fBloginurl=\fP\fIURL\fP +Eine Anmelde\-URL, die vor der Prüfung besucht wird. Benötigt einen Eintrag +zur Authentifizierung und impliziert die Benutzung von Cookies, weil die +meisten Anmeldungen heutzutage Cookies benutzen. +.TP +\fBloginuserfield=\fP\fINAME\fP +Der Name für das Benutzer CGI\-Feld. Der Standardname ist \fBlogin\fP. +.TP +\fBloginpasswordfield=\fP\fINAME\fP +Der Name für das Passwort CGI\-Feld. Der Standardname ist \fBpassword\fP. +.TP +\fBloginextrafields=\fP\fINAME\fP\fB:\fP\fIWERT\fP (MULTILINE) +Optional zusätzliche CGI Namen/Werte\-Paare. Die Default\-Werte werden +automatisch übermittelt. .SS [output] .TP \fBinteractive=\fP[\fB0\fP|\fB1\fP] diff --git a/doc/en/linkcheckerrc.5 b/doc/en/linkcheckerrc.5 index 6cb0e8ab..5273c845 100644 --- a/doc/en/linkcheckerrc.5 +++ b/doc/en/linkcheckerrc.5 @@ -130,6 +130,21 @@ match wins. At the moment, authentication is used/needed for http[s] and ftp links. .br Command line option: \fB\-u\fP, \fB\-p\fP +.TP +\fBloginurl=\fP\fIURL\fP +A login URL to be visited before checking. Also needs authentication +data set for it, and implies using cookies because most logins use +cookies nowadays. +.TP +\fBloginuserfield=\fP\fISTRING\fP +The name of the user CGI field. Default name is \fBlogin\fP. +.TP +\fBloginpasswordfield=\fP\fISTRING\fP +The name of the password CGI field. Default name is \fBpassword\fP. +.TP +\fBloginextrafields=\fP\fINAME\fP\fB:\fP\fIVALUE\fP (MULTILINE) +Optionally any additional CGI name/value pairs. Note that the default +values are submitted automatically. .SS \fB[output]\fP .TP \fBinteractive=\fP[\fB0\fP|\fB1\fP] diff --git a/doc/install.txt b/doc/install.txt index e9b101a2..e719a252 100644 --- a/doc/install.txt +++ b/doc/install.txt @@ -39,6 +39,9 @@ Requirements for Unix/Linux or Mac OS X 6. *Optional, used for Virus checking:* ClamAv from http://www.clamav.net/ +7. *Optional, used for login form submission:* + Twill from http://twill.idyll.org/ + Requirements for Windows ------------------------ @@ -113,22 +116,23 @@ Setup for Windows - compiling from source: ClamAv from http://www.sosdg.org/clamav-win32/ [http://clamav-sosdg.googlecode.com/files/clamav-0.95-1a.exe] -5. *Optional, for country code display:* +5. *Optional, for displaying country codes:* Pygeoip from http://code.google.com/p/pygeoip/ [http://pygeoip.googlecode.com/files/pygeoip-0.1.3-py2.6.egg] -6. The MinGW suite from http://mingw.sourceforge.net/ +6. *Optional, used for login form submission:* + Twill from http://twill.idyll.org/ + +7. The MinGW suite from http://mingw.sourceforge.net/ [http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/mingw-get-inst-20100909/mingw-get-inst-20100909.exe/download] -7. Install InnoSetup from http://www.jrsoftware.org/isinfo.php +8. Install InnoSetup from http://www.jrsoftware.org/isinfo.php [http://www.jrsoftware.org/download.php/is.exe] -8. Generate and execute the LinkChecker installer +9. Generate and execute the LinkChecker installer - Close the MSYS application (by typing ``exit``) and open a DOS command - prompt. Change to the ``linkchecker-X.Y`` directory and run - ``scripts\bdist.bat`` to build a binary installer. + ``dist.bat`` to build a binary installer. This generates a binary installer ``dist\LinkChecker-X.Y.exe`` which you just have to execute. diff --git a/doc/linkchecker.doc.pot b/doc/linkchecker.doc.pot index cfdbebe4..b34529a7 100644 --- a/doc/linkchecker.doc.pot +++ b/doc/linkchecker.doc.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2010-10-12 00:31+0300\n" +"POT-Creation-Date: 2010-10-14 18:25+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -194,7 +194,7 @@ msgid "B<-I>, B<--interactive>" msgstr "" #. type: Plain text -#: en/linkchecker.1:65 en/linkcheckerrc.5:137 +#: en/linkchecker.1:65 en/linkcheckerrc.5:152 msgid "Ask for URL if none are given on the commandline." msgstr "" @@ -405,7 +405,7 @@ msgid "B<-o>I[BI], B<--output=>I[BI]" msgstr "" #. type: Plain text -#: en/linkchecker.1:130 en/linkcheckerrc.5:158 +#: en/linkchecker.1:130 en/linkcheckerrc.5:173 msgid "" "Specify output type as B, B, B, B, B, B, " "B, B or B. Default type is B. The various " @@ -413,7 +413,7 @@ msgid "" msgstr "" #. type: Plain text -#: en/linkchecker.1:134 en/linkcheckerrc.5:162 +#: en/linkchecker.1:134 en/linkcheckerrc.5:177 msgid "" "The I specifies the output encoding, the default is that of your " "locale. Valid encodings are listed at " @@ -1399,7 +1399,7 @@ msgid "" msgstr "" #. type: SH -#: en/linkchecker.1:530 en/linkcheckerrc.5:409 en/linkchecker-gui.1:11 +#: en/linkchecker.1:530 en/linkcheckerrc.5:424 en/linkchecker-gui.1:11 #, no-wrap msgid "SEE ALSO" msgstr "" @@ -1410,24 +1410,24 @@ msgid "B(5)" msgstr "" #. type: SH -#: en/linkchecker.1:533 en/linkcheckerrc.5:412 en/linkchecker-gui.1:14 +#: en/linkchecker.1:533 en/linkcheckerrc.5:427 en/linkchecker-gui.1:14 #, no-wrap msgid "AUTHOR" msgstr "" #. type: Plain text -#: en/linkchecker.1:535 en/linkcheckerrc.5:414 en/linkchecker-gui.1:16 +#: en/linkchecker.1:535 en/linkcheckerrc.5:429 en/linkchecker-gui.1:16 msgid "Bastian Kleineidam Ecalvin@users.sourceforge.netE" msgstr "" #. type: SH -#: en/linkchecker.1:536 en/linkcheckerrc.5:415 en/linkchecker-gui.1:17 +#: en/linkchecker.1:536 en/linkcheckerrc.5:430 en/linkchecker-gui.1:17 #, no-wrap msgid "COPYRIGHT" msgstr "" #. type: Plain text -#: en/linkchecker.1:537 en/linkcheckerrc.5:416 +#: en/linkchecker.1:537 en/linkcheckerrc.5:431 msgid "Copyright \\(co 2000-2010 Bastian Kleineidam" msgstr "" @@ -1611,7 +1611,7 @@ msgid "Filename of B config file." msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:90 en/linkcheckerrc.5:113 en/linkcheckerrc.5:119 en/linkcheckerrc.5:212 en/linkcheckerrc.5:228 +#: en/linkcheckerrc.5:90 en/linkcheckerrc.5:113 en/linkcheckerrc.5:119 en/linkcheckerrc.5:227 en/linkcheckerrc.5:243 msgid "Command line option: none" msgstr "" @@ -1729,31 +1729,80 @@ msgstr "" msgid "Command line option: B<-u>, B<-p>" msgstr "" -#. type: SS +#. type: TP #: en/linkcheckerrc.5:133 #, no-wrap +msgid "BI" +msgstr "" + +#. type: Plain text +#: en/linkcheckerrc.5:138 +msgid "" +"A login URL to be visited before checking. Also needs authentication data " +"set for it, and implies using cookies because most logins use cookies " +"nowadays." +msgstr "" + +#. type: TP +#: en/linkcheckerrc.5:138 +#, no-wrap +msgid "BI" +msgstr "" + +#. type: Plain text +#: en/linkcheckerrc.5:141 +msgid "The name of the user CGI field. Default name is B." +msgstr "" + +#. type: TP +#: en/linkcheckerrc.5:141 +#, no-wrap +msgid "BI" +msgstr "" + +#. type: Plain text +#: en/linkcheckerrc.5:144 +msgid "The name of the password CGI field. Default name is B." +msgstr "" + +#. type: TP +#: en/linkcheckerrc.5:144 +#, no-wrap +msgid "BIB<:>I (MULTILINE)" +msgstr "" + +#. type: Plain text +#: en/linkcheckerrc.5:148 +msgid "" +"Optionally any additional CGI name/value pairs. Note that the default values " +"are submitted automatically." +msgstr "" + +#. type: SS +#: en/linkcheckerrc.5:148 +#, no-wrap msgid "[output]" msgstr "" #. type: TP -#: en/linkcheckerrc.5:134 +#: en/linkcheckerrc.5:149 #, no-wrap msgid "B[B<0>|B<1>]" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:139 +#: en/linkcheckerrc.5:154 msgid "Command line option: B<--interactive>" msgstr "" #. type: TP -#: en/linkcheckerrc.5:139 +#: en/linkcheckerrc.5:154 #, no-wrap msgid "BI[B<,>I...]" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:145 +#: en/linkcheckerrc.5:160 msgid "" "Print debugging output for the given loggers. Available loggers are " "B, B, B, B, B, B and B. " @@ -1761,117 +1810,117 @@ msgid "" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:147 +#: en/linkcheckerrc.5:162 msgid "Command line option: B<--debug>" msgstr "" #. type: TP -#: en/linkcheckerrc.5:147 +#: en/linkcheckerrc.5:162 #, no-wrap msgid "B[B<0>|B<1>]" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:150 +#: en/linkcheckerrc.5:165 msgid "Control printing check status messages. Default is 1." msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:152 +#: en/linkcheckerrc.5:167 msgid "Command line option: B<--no-status>" msgstr "" #. type: TP -#: en/linkcheckerrc.5:152 +#: en/linkcheckerrc.5:167 #, no-wrap msgid "BI[BI]" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:164 +#: en/linkcheckerrc.5:179 msgid "Command line option: B<--output>" msgstr "" #. type: TP -#: en/linkcheckerrc.5:164 +#: en/linkcheckerrc.5:179 #, no-wrap msgid "B[B<0>|B<1>]" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:167 +#: en/linkcheckerrc.5:182 msgid "" "If set log all checked URLs once. Default is to log only errors and " "warnings." msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:169 en/linkcheckerrc.5:186 +#: en/linkcheckerrc.5:184 en/linkcheckerrc.5:201 msgid "Command line option: B<--verbose>" msgstr "" #. type: TP -#: en/linkcheckerrc.5:169 +#: en/linkcheckerrc.5:184 #, no-wrap msgid "B[B<0>|B<1>]" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:173 +#: en/linkcheckerrc.5:188 msgid "" "If set log all checked URLs, even duplicates. Default is to log duplicate " "URLs only once." msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:175 +#: en/linkcheckerrc.5:190 msgid "Command line option: B<--complete>" msgstr "" #. type: TP -#: en/linkcheckerrc.5:175 +#: en/linkcheckerrc.5:190 #, no-wrap msgid "B[B<0>|B<1>]" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:178 +#: en/linkcheckerrc.5:193 msgid "If set log warnings. Default is to log warnings." msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:180 +#: en/linkcheckerrc.5:195 msgid "Command line option: B<--no-warnings>" msgstr "" #. type: TP -#: en/linkcheckerrc.5:180 +#: en/linkcheckerrc.5:195 #, no-wrap msgid "B[B<0>|B<1>]" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:184 +#: en/linkcheckerrc.5:199 msgid "" "If set, operate quiet. An alias for B. This is only useful with " "B." msgstr "" #. type: TP -#: en/linkcheckerrc.5:186 +#: en/linkcheckerrc.5:201 #, no-wrap msgid "BI[B<,>I...]" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:191 +#: en/linkcheckerrc.5:206 msgid "" "Output to a files BI, " "B<$HOME/.linkchecker/blacklist> for B output." msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:197 +#: en/linkcheckerrc.5:212 msgid "" "Valid file output types are B, B, B, B, B, " "B, B, B or B Default is no file output. The " @@ -1880,55 +1929,55 @@ msgid "" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:199 +#: en/linkcheckerrc.5:214 msgid "Command line option: B<--file-output>" msgstr "" #. type: SS -#: en/linkcheckerrc.5:199 +#: en/linkcheckerrc.5:214 #, no-wrap msgid "[text]" msgstr "" #. type: TP -#: en/linkcheckerrc.5:200 en/linkcheckerrc.5:262 en/linkcheckerrc.5:272 en/linkcheckerrc.5:282 en/linkcheckerrc.5:298 en/linkcheckerrc.5:314 en/linkcheckerrc.5:345 en/linkcheckerrc.5:352 en/linkcheckerrc.5:362 +#: en/linkcheckerrc.5:215 en/linkcheckerrc.5:277 en/linkcheckerrc.5:287 en/linkcheckerrc.5:297 en/linkcheckerrc.5:313 en/linkcheckerrc.5:329 en/linkcheckerrc.5:360 en/linkcheckerrc.5:367 en/linkcheckerrc.5:377 #, no-wrap msgid "BI" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:204 +#: en/linkcheckerrc.5:219 msgid "" "Specify output filename for text logging. Default filename is " "B." msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:206 +#: en/linkcheckerrc.5:221 msgid "Command line option: B<--file-output=>" msgstr "" #. type: TP -#: en/linkcheckerrc.5:206 en/linkcheckerrc.5:265 en/linkcheckerrc.5:275 en/linkcheckerrc.5:285 en/linkcheckerrc.5:301 en/linkcheckerrc.5:317 en/linkcheckerrc.5:355 en/linkcheckerrc.5:365 +#: en/linkcheckerrc.5:221 en/linkcheckerrc.5:280 en/linkcheckerrc.5:290 en/linkcheckerrc.5:300 en/linkcheckerrc.5:316 en/linkcheckerrc.5:332 en/linkcheckerrc.5:370 en/linkcheckerrc.5:380 #, no-wrap msgid "BI" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:210 +#: en/linkcheckerrc.5:225 msgid "" "Comma-separated list of parts that have to be logged. See B " "below." msgstr "" #. type: TP -#: en/linkcheckerrc.5:212 en/linkcheckerrc.5:268 en/linkcheckerrc.5:278 en/linkcheckerrc.5:288 en/linkcheckerrc.5:304 en/linkcheckerrc.5:320 en/linkcheckerrc.5:348 en/linkcheckerrc.5:358 en/linkcheckerrc.5:368 +#: en/linkcheckerrc.5:227 en/linkcheckerrc.5:283 en/linkcheckerrc.5:293 en/linkcheckerrc.5:303 en/linkcheckerrc.5:319 en/linkcheckerrc.5:335 en/linkcheckerrc.5:363 en/linkcheckerrc.5:373 en/linkcheckerrc.5:383 #, no-wrap msgid "BI" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:217 +#: en/linkcheckerrc.5:232 msgid "" "Valid encodings are listed in " "B. Default " @@ -1936,13 +1985,13 @@ msgid "" msgstr "" #. type: TP -#: en/linkcheckerrc.5:217 +#: en/linkcheckerrc.5:232 #, no-wrap msgid "I" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:226 +#: en/linkcheckerrc.5:241 msgid "" "Color settings for the various log parts, syntax is I or " "IB<;>I. The I can be B, B, B, " @@ -1952,302 +2001,302 @@ msgid "" msgstr "" #. type: TP -#: en/linkcheckerrc.5:228 +#: en/linkcheckerrc.5:243 #, no-wrap msgid "BI" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:231 +#: en/linkcheckerrc.5:246 msgid "Set parent color. Default is B." msgstr "" #. type: TP -#: en/linkcheckerrc.5:231 +#: en/linkcheckerrc.5:246 #, no-wrap msgid "BI" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:234 +#: en/linkcheckerrc.5:249 msgid "Set URL color. Default is B." msgstr "" #. type: TP -#: en/linkcheckerrc.5:234 +#: en/linkcheckerrc.5:249 #, no-wrap msgid "BI" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:237 +#: en/linkcheckerrc.5:252 msgid "Set name color. Default is B." msgstr "" #. type: TP -#: en/linkcheckerrc.5:237 +#: en/linkcheckerrc.5:252 #, no-wrap msgid "BI" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:240 +#: en/linkcheckerrc.5:255 msgid "Set real URL color. Default is B." msgstr "" #. type: TP -#: en/linkcheckerrc.5:240 +#: en/linkcheckerrc.5:255 #, no-wrap msgid "BI" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:243 +#: en/linkcheckerrc.5:258 msgid "Set base URL color. Default is B." msgstr "" #. type: TP -#: en/linkcheckerrc.5:243 +#: en/linkcheckerrc.5:258 #, no-wrap msgid "BI" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:246 +#: en/linkcheckerrc.5:261 msgid "Set valid color. Default is B." msgstr "" #. type: TP -#: en/linkcheckerrc.5:246 +#: en/linkcheckerrc.5:261 #, no-wrap msgid "BI" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:249 +#: en/linkcheckerrc.5:264 msgid "Set invalid color. Default is B." msgstr "" #. type: TP -#: en/linkcheckerrc.5:249 +#: en/linkcheckerrc.5:264 #, no-wrap msgid "BI" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:252 +#: en/linkcheckerrc.5:267 msgid "Set info color. Default is B." msgstr "" #. type: TP -#: en/linkcheckerrc.5:252 +#: en/linkcheckerrc.5:267 #, no-wrap msgid "BI" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:255 +#: en/linkcheckerrc.5:270 msgid "Set warning color. Default is B." msgstr "" #. type: TP -#: en/linkcheckerrc.5:255 +#: en/linkcheckerrc.5:270 #, no-wrap msgid "BI" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:258 +#: en/linkcheckerrc.5:273 msgid "Set download time color. Default is B." msgstr "" #. type: TP -#: en/linkcheckerrc.5:258 +#: en/linkcheckerrc.5:273 #, no-wrap msgid "BI" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:261 +#: en/linkcheckerrc.5:276 msgid "Set reset color. Default is B." msgstr "" #. type: SS -#: en/linkcheckerrc.5:261 +#: en/linkcheckerrc.5:276 #, no-wrap msgid "[gml]" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:265 en/linkcheckerrc.5:268 en/linkcheckerrc.5:271 en/linkcheckerrc.5:275 en/linkcheckerrc.5:278 en/linkcheckerrc.5:281 en/linkcheckerrc.5:285 en/linkcheckerrc.5:288 en/linkcheckerrc.5:291 en/linkcheckerrc.5:301 en/linkcheckerrc.5:304 en/linkcheckerrc.5:307 en/linkcheckerrc.5:317 en/linkcheckerrc.5:320 en/linkcheckerrc.5:323 en/linkcheckerrc.5:348 en/linkcheckerrc.5:351 en/linkcheckerrc.5:355 en/linkcheckerrc.5:358 en/linkcheckerrc.5:361 en/linkcheckerrc.5:365 en/linkcheckerrc.5:368 en/linkcheckerrc.5:371 +#: en/linkcheckerrc.5:280 en/linkcheckerrc.5:283 en/linkcheckerrc.5:286 en/linkcheckerrc.5:290 en/linkcheckerrc.5:293 en/linkcheckerrc.5:296 en/linkcheckerrc.5:300 en/linkcheckerrc.5:303 en/linkcheckerrc.5:306 en/linkcheckerrc.5:316 en/linkcheckerrc.5:319 en/linkcheckerrc.5:322 en/linkcheckerrc.5:332 en/linkcheckerrc.5:335 en/linkcheckerrc.5:338 en/linkcheckerrc.5:363 en/linkcheckerrc.5:366 en/linkcheckerrc.5:370 en/linkcheckerrc.5:373 en/linkcheckerrc.5:376 en/linkcheckerrc.5:380 en/linkcheckerrc.5:383 en/linkcheckerrc.5:386 msgid "See [text] section above." msgstr "" #. type: SS -#: en/linkcheckerrc.5:271 +#: en/linkcheckerrc.5:286 #, no-wrap msgid "[dot]" msgstr "" #. type: SS -#: en/linkcheckerrc.5:281 +#: en/linkcheckerrc.5:296 #, no-wrap msgid "[csv]" msgstr "" #. type: TP -#: en/linkcheckerrc.5:291 en/linkcheckerrc.5:310 +#: en/linkcheckerrc.5:306 en/linkcheckerrc.5:325 #, no-wrap msgid "BI" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:294 +#: en/linkcheckerrc.5:309 msgid "Set CSV separator. Default is a comma (B<,>)." msgstr "" #. type: TP -#: en/linkcheckerrc.5:294 +#: en/linkcheckerrc.5:309 #, no-wrap msgid "BI" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:297 +#: en/linkcheckerrc.5:312 msgid "Set CSV quote character. Default is a double quote (B<\">)." msgstr "" #. type: SS -#: en/linkcheckerrc.5:297 +#: en/linkcheckerrc.5:312 #, no-wrap msgid "[sql]" msgstr "" #. type: TP -#: en/linkcheckerrc.5:307 +#: en/linkcheckerrc.5:322 #, no-wrap msgid "BI" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:310 +#: en/linkcheckerrc.5:325 msgid "Set database name to store into. Default is B." msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:313 +#: en/linkcheckerrc.5:328 msgid "Set SQL command separator character. Default is a semicolor (B<;>)." msgstr "" #. type: SS -#: en/linkcheckerrc.5:313 +#: en/linkcheckerrc.5:328 #, no-wrap msgid "[html]" msgstr "" #. type: TP -#: en/linkcheckerrc.5:323 +#: en/linkcheckerrc.5:338 #, no-wrap msgid "BI" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:326 +#: en/linkcheckerrc.5:341 msgid "Set HTML background color. Default is B<#fff7e5>." msgstr "" #. type: TP -#: en/linkcheckerrc.5:326 +#: en/linkcheckerrc.5:341 #, no-wrap msgid "B" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:329 +#: en/linkcheckerrc.5:344 msgid "Set HTML URL color. Default is B<#dcd5cf>." msgstr "" #. type: TP -#: en/linkcheckerrc.5:329 +#: en/linkcheckerrc.5:344 #, no-wrap msgid "B" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:332 +#: en/linkcheckerrc.5:347 msgid "Set HTML border color. Default is B<#000000>." msgstr "" #. type: TP -#: en/linkcheckerrc.5:332 +#: en/linkcheckerrc.5:347 #, no-wrap msgid "B" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:335 +#: en/linkcheckerrc.5:350 msgid "Set HTML link color. Default is B<#191c83>." msgstr "" #. type: TP -#: en/linkcheckerrc.5:335 +#: en/linkcheckerrc.5:350 #, no-wrap msgid "B" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:338 +#: en/linkcheckerrc.5:353 msgid "Set HTML warning color. Default is B<#e0954e>." msgstr "" #. type: TP -#: en/linkcheckerrc.5:338 +#: en/linkcheckerrc.5:353 #, no-wrap msgid "B" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:341 +#: en/linkcheckerrc.5:356 msgid "Set HTML error color. Default is B<#db4930>." msgstr "" #. type: TP -#: en/linkcheckerrc.5:341 +#: en/linkcheckerrc.5:356 #, no-wrap msgid "B" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:344 +#: en/linkcheckerrc.5:359 msgid "Set HTML valid color. Default is B<#3ba557>." msgstr "" #. type: SS -#: en/linkcheckerrc.5:344 +#: en/linkcheckerrc.5:359 #, no-wrap msgid "[blacklist]" msgstr "" #. type: SS -#: en/linkcheckerrc.5:351 +#: en/linkcheckerrc.5:366 #, no-wrap msgid "[xml]" msgstr "" #. type: SS -#: en/linkcheckerrc.5:361 +#: en/linkcheckerrc.5:376 #, no-wrap msgid "[gxml]" msgstr "" #. type: SH -#: en/linkcheckerrc.5:372 +#: en/linkcheckerrc.5:387 #, no-wrap msgid "LOGGER PARTS" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:388 +#: en/linkcheckerrc.5:403 #, no-wrap msgid "" " B (for all parts)\n" @@ -2269,13 +2318,13 @@ msgid "" msgstr "" #. type: SH -#: en/linkcheckerrc.5:388 +#: en/linkcheckerrc.5:403 #, no-wrap msgid "MULTILINE" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:392 +#: en/linkcheckerrc.5:407 msgid "" "Some option values can span multiple lines. Each line has to be indented for " "that to work. Lines starting with a hash (B<#>) will be ignored, though they " @@ -2283,7 +2332,7 @@ msgid "" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:398 +#: en/linkcheckerrc.5:413 #, no-wrap msgid "" " ignore=\n" @@ -2294,13 +2343,13 @@ msgid "" msgstr "" #. type: SH -#: en/linkcheckerrc.5:399 +#: en/linkcheckerrc.5:414 #, no-wrap msgid "EXAMPLE" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:402 +#: en/linkcheckerrc.5:417 #, no-wrap msgid "" " [output]\n" @@ -2308,7 +2357,7 @@ msgid "" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:405 +#: en/linkcheckerrc.5:420 #, no-wrap msgid "" " [checking]\n" @@ -2316,7 +2365,7 @@ msgid "" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:408 +#: en/linkcheckerrc.5:423 #, no-wrap msgid "" " [filtering]\n" @@ -2324,7 +2373,7 @@ msgid "" msgstr "" #. type: Plain text -#: en/linkcheckerrc.5:411 +#: en/linkcheckerrc.5:426 msgid "linkchecker(1)" msgstr "" diff --git a/doc/todo.txt b/doc/todo.txt index 25767c26..525d4d25 100644 --- a/doc/todo.txt +++ b/doc/todo.txt @@ -1,4 +1,4 @@ -- [HTTP] Allow sending POST data for login at beginning of check. +- [GUI] Allow login URL to be configured. - [GUI] Move the debug tab someplace else. Perhaps make a separate debug window out of it that gets displayed only on demand. - [GUI] Show detailed URL properties diff --git a/linkcheck/configuration/__init__.py b/linkcheck/configuration/__init__.py index bd436226..e4463856 100644 --- a/linkcheck/configuration/__init__.py +++ b/linkcheck/configuration/__init__.py @@ -22,6 +22,7 @@ import sys import os import logging.config import urllib +import urlparse import shutil import _LinkChecker_configdata as configdata from .. import (log, LOG_CHECK, LOG_ROOT, ansicolor, lognames, clamav, @@ -77,6 +78,10 @@ class Configuration (dict): self["interactive"] = False # on ftp, password is set by Pythons ftplib self["authentication"] = [] + self["loginurl"] = None + self["loginuserfield"] = "login" + self["loginpasswordfield"] = "password" + self["loginextrafields"] = {} self["proxy"] = urllib.getproxies() self["recursionlevel"] = -1 self["wait"] = 0 @@ -260,6 +265,8 @@ class Configuration (dict): self.sanitize_scanvirus() if self['storecookies']: self.sanitize_cookies() + if self['loginurl']: + self.sanitize_loginurl() def sanitize_anchors (self): if not self["warnings"]: @@ -307,6 +314,36 @@ class Configuration (dict): "because storecookies is active.")) self['sendcookies'] = True + def sanitize_loginurl (self): + url = self["loginurl"] + disable = False + if not self["loginpasswordfield"]: + log.warn(LOG_CHECK, + _("warning: no CGI password fieldname given for login URL.")) + disable = True + if not self["loginuserfield"]: + log.warn(LOG_CHECK, + _("warning: no CGI user fieldname given for login URL.")) + disable = True + if self.get_user_password(url) == (None, None): + log.warn(LOG_CHECK, + _("warning: no user/password authentication data found for login URL.")) + disable = True + if not url.lower().startswith(("http:", "https:")): + log.warn(LOG_CHECK, _("warning: login URL is not a HTTP URL.")) + disable = True + urlparts = urlparse.urlsplit(url) + if not urlparts[0] or not urlparts[1] or not urlparts[2]: + log.warn(LOG_CHECK, _("warning: login URL is incomplete.")) + disable = True + if disable: + log.warn(LOG_CHECK, + _("warning: disabling login URL %(url)s.") % {"url": url}) + self["loginurl"] = None + elif not self['storecookies']: + # login URL implies storing and sending cookies + self['storecookies'] = self['sendcookies'] = True + def copy_sys_config (syspath, userpath): """Try to copy the system configuration to the user configuration diff --git a/linkcheck/configuration/confparse.py b/linkcheck/configuration/confparse.py index 8ac9a650..3c5834bf 100644 --- a/linkcheck/configuration/confparse.py +++ b/linkcheck/configuration/confparse.py @@ -185,6 +185,24 @@ class LCConfigParser (ConfigParser.RawConfigParser, object): 'user': auth[1], 'password': auth[2]}) i += 1 + # read login URL and field names + if self.has_option(section, "loginurl"): + val = self.get(section, "loginurl").strip() + if not (val.lower().startswith("http:") or + val.lower().startswith("https:")): + raise LinkCheckerError(LOG_CHECK, + _("Invalid login URL `%s'. Only " \ + "HTTP and HTTPS URLs are supported.") % val) + self.config["loginurl"] = val + self.config["storecookies"] = self.config["sendcookies"] = True + for key in ("loginuserfield", "loginpasswordfield"): + if self.has_option(section, key): + self.config[key] = self.get(section, key) + # read login extra fields + if self.has_option(section, "loginextrafields"): + for val in read_multiline(self.get(section, "loginextrafields")): + name, value = val.split(":", 1) + self.config["loginextrafields"][name] = value def read_filtering_config (self): """ diff --git a/linkcheck/cookies.py b/linkcheck/cookies.py index f9a48c10..e221c6bf 100644 --- a/linkcheck/cookies.py +++ b/linkcheck/cookies.py @@ -351,3 +351,80 @@ def from_headers (strheader): scheme = headers.get("Scheme", "http") path= headers.get("Path", "/") return (headers, scheme, host, path) + + +## Taken and adpated from the _mechanize package included in Twill. + +def cookie_str(cookie): + """Return string representation of Cookie.""" + h = [(cookie.name, unquote(cookie.value)), + ("path", cookie.path), + ("domain", cookie.domain)] + if cookie.port is not None: h.append(("port", cookie.port)) + #if cookie.path_specified: h.append(("path_spec", None)) + #if cookie.port_specified: h.append(("port_spec", None)) + #if cookie.domain_initial_dot: h.append(("domain_dot", None)) + if cookie.secure: h.append(("secure", None)) + if cookie.expires: h.append(("expires", + time2isoz(float(cookie.expires)))) + if cookie.discard: h.append(("discard", None)) + if cookie.comment: h.append(("comment", cookie.comment)) + if cookie.comment_url: h.append(("commenturl", cookie.comment_url)) + #if cookie.rfc2109: h.append(("rfc2109", None)) + + keys = cookie.nonstandard_attr_keys() + keys.sort() + for k in keys: + h.append((k, str(cookie.get_nonstandard_attr(k)))) + + h.append(("version", str(cookie.version))) + + return join_header_words([h]) + + +def time2isoz(t=None): + """Return a string representing time in seconds since epoch, t. + + If the function is called without an argument, it will use the current + time. + + The format of the returned string is like "YYYY-MM-DD hh:mm:ssZ", + representing Universal Time (UTC, aka GMT). An example of this format is: + + 1994-11-24 08:49:37Z + + """ + if t is None: t = time.time() + year, mon, mday, hour, min, sec = time.gmtime(t)[:6] + return "%04d-%02d-%02d %02d:%02d:%02dZ" % ( + year, mon, mday, hour, min, sec) + + +join_escape_re = re.compile(r"([\"\\])") +def join_header_words(lists): + """Do the inverse of the conversion done by split_header_words. + + Takes a list of lists of (key, value) pairs and produces a single header + value. Attribute values are quoted if needed. + + >>> join_header_words([[("text/plain", None), ("charset", "iso-8859/1")]]) + 'text/plain; charset="iso-8859/1"' + >>> join_header_words([[("text/plain", None)], [("charset", "iso-8859/1")]]) + 'text/plain, charset="iso-8859/1"' + + """ + headers = [] + for pairs in lists: + attr = [] + for k, v in pairs: + if v is not None: + if not re.search(r"^\w+$", v): + v = join_escape_re.sub(r"\\\1", v) # escape " and \ + v = '"%s"' % v + if k is None: # Netscape cookies may have no name + k = v + else: + k = "%s=%s" % (k, v) + attr.append(k) + if attr: headers.append("; ".join(attr)) + return ", ".join(headers) diff --git a/linkcheck/director/__init__.py b/linkcheck/director/__init__.py index 1b418665..1a8fc327 100644 --- a/linkcheck/director/__init__.py +++ b/linkcheck/director/__init__.py @@ -20,9 +20,87 @@ Management of checking a queue of links with several threads. import time import os import thread -from .. import log, LOG_CHECK, LinkCheckerInterrupt +import urlparse +from cStringIO import StringIO +from .. import log, LOG_CHECK, LinkCheckerInterrupt, cookies, dummy from ..cache import urlqueue, robots_txt, cookie, connection from . import aggregator, console +from ..httplib2 import HTTPMessage + + +def visit_loginurl (aggregate): + """Check for a login URL and visit it.""" + config = aggregate.config + url = config["loginurl"] + if not url: + return + try: + from twill import commands as tc + except ImportError: + log.warn(LOG_CHECK, _("Could not import twill for login URL visit")) + return + log.debug(LOG_CHECK, u"Visiting login URL %s", url) + configure_twill(tc) + tc.go(url) + if tc.get_browser().get_code() != 200: + log.warn(LOG_CHECK, _("Error visiting login URL %(url)s.") % \ + {"url": url}) + return + submit_login_form(config, url, tc) + if tc.get_browser().get_code() != 200: + log.warn(LOG_CHECK, _("Error posting form at login URL %(url)s.") % \ + {"url": url}) + return + store_cookies(tc.get_browser().cj, aggregate.cookies, url) + resulturl = tc.get_browser().get_url() + log.debug(LOG_CHECK, u"URL after POST is %s" % resulturl) + # add URL to check list + if config["checkloginresult"]: + from ..checker import get_url_from + aggregate.urlqueue.put(get_url_from(resulturl, 0, aggregate)) + + +def configure_twill (tc): + """Configure twill to be used by LinkChecker. + Note that there is no need to set a proxy since twill uses the same + ones (provided from urllib) as LinkChecker does. + """ + # make sure readonly controls are writeable (might be needed) + tc.config("readonly_controls_writeable", True) + # fake IE 6.0 to talk sense into some sites (eg. SourceForge) + tc.agent("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)") + # tell twill to shut up + tc.OUT = dummy.Dummy() + from twill import browser + browser.OUT = dummy.Dummy() + # set debug level + if log.is_debug(LOG_CHECK): + tc.debug("http", 1) + + +def submit_login_form (config, url, tc): + """Fill and submit login form.""" + user, password = config.get_user_password(url) + cgiuser = config["loginuserfield"] + cgipassword = config["loginpasswordfield"] + formname = "" + tc.formvalue(formname, cgiuser, user) + tc.formvalue(formname, cgipassword, password) + for key, value in config["loginextrafields"].items(): + tc.formvalue(formname, key, value) + tc.submit() + + +def store_cookies (cookiejar, cookiecache, url): + """Store cookies in cookiejar into the cookiecache.""" + cookielst = [] + for c in cookiejar: + cookielst.append("Set-Cookie2: %s" % cookies.cookie_str(c)) + log.debug(LOG_CHECK, "Store cookies %s", cookielst) + headers = HTTPMessage(StringIO("\r\n".join(cookielst))) + urlparts = urlparse.urlsplit(url) + scheme, host, path = urlparts[0:3] + cookiecache.add(headers, scheme, host, path) def check_urls (aggregate): @@ -30,6 +108,12 @@ def check_urls (aggregate): with Ctrl-C. @return: None """ + try: + visit_loginurl(aggregate) + except Exception, msg: + log.warn(LOG_CHECK, _("Error using login URL: %(msg)s.") % \ + {'msg': str(msg)}) + raise try: aggregate.logger.start_log_output() if not aggregate.urlqueue.empty(): diff --git a/tests/configuration/data/config0.ini b/tests/configuration/data/config0.ini index 6375190b..1b0242ec 100644 --- a/tests/configuration/data/config0.ini +++ b/tests/configuration/data/config0.ini @@ -29,8 +29,15 @@ entry= imadoofus1 user1 pass1 # IMADOOFUS imadoofus2 user2 pass2 + http://www.example.com/ user3 pass3 entry1=oldimadoofus1 user1 pass1 entry2=oldimadoofus2 user2 pass2 +loginurl=http://www.example.com/ +loginuserfield=mylogin +loginpasswordfield=mypassword +loginextrafields= + name1:value1 + name 2:value 2 [output] interactive=1 diff --git a/tests/configuration/test_config.py b/tests/configuration/test_config.py index b862befa..96fb890d 100644 --- a/tests/configuration/test_config.py +++ b/tests/configuration/test_config.py @@ -63,6 +63,12 @@ class TestConfig (unittest.TestCase): for suffix in ("1", "2"): key = "%simadoofus%s" % (prefix, suffix) self.assertTrue(key in patterns) + self.assertEqual(config["loginurl"], "http://www.example.com/") + self.assertEqual(config["loginuserfield"], "mylogin") + self.assertEqual(config["loginpasswordfield"], "mypassword") + self.assertEqual(config["loginextrafields"]["name1"], "value1") + self.assertEqual(config["loginextrafields"]["name 2"], "value 2") + self.assertEqual(len(config["loginextrafields"]), 2) # output section self.assertTrue(config["interactive"]) self.assertTrue(linkcheck.log.is_debug(linkcheck.LOG_THREAD))