Index: trunk/extensions/ConfirmEdit/QuestyCaptcha.i18n.php |
— | — | @@ -9,20 +9,20 @@ |
10 | 10 | |
11 | 11 | /** English */ |
12 | 12 | $messages['en'] = array( |
13 | | - 'questycaptcha-desc' => 'Questy captcha generator for Confirm Edit', |
14 | | - 'questycaptcha-addurl' => 'Your edit includes new external links. |
| 13 | + 'questycaptcha-desc' => 'Questy captcha generator for Confirm Edit', |
| 14 | + 'questycaptcha-addurl' => 'Your edit includes new external links. |
15 | 15 | To help protect against automated spam, please answer the question that appears below ([[Special:Captcha/help|more info]]):', |
16 | | - 'questycaptcha-badlogin' => 'To help protect against automated password cracking, please answer the question that appears below ([[Special:Captcha/help|more info]]):', |
| 16 | + 'questycaptcha-badlogin' => 'To help protect against automated password cracking, please answer the question that appears below ([[Special:Captcha/help|more info]]):', |
17 | 17 | 'questycaptcha-createaccount' => 'To help protect against automated account creation, please answer the question that appears below ([[Special:Captcha/help|more info]]):', |
18 | | - 'questycaptcha-create' => 'To create the page, please answer the question that appears below ([[Special:Captcha/help|more info]]):', |
19 | | - 'questycaptcha-edit' => 'To edit this page, please answer the question that appears below ([[Special:Captcha/help|more info]]):', |
20 | | - 'questycaptchahelp-text' => "Web sites that accept postings from the public, like this wiki, are often abused by spammers who use automated tools to post their links to many sites. |
| 18 | + 'questycaptcha-create' => 'To create the page, please answer the question that appears below ([[Special:Captcha/help|more info]]):', |
| 19 | + 'questycaptcha-edit' => 'To edit this page, please answer the question that appears below ([[Special:Captcha/help|more info]]):', |
| 20 | + 'questycaptchahelp-text' => "Web sites that accept contributions from the public, like this wiki, are often abused by spammers who use automated tools to add their links to many sites. |
21 | 21 | While these spam links can be removed, they are a significant nuisance. |
22 | 22 | |
23 | 23 | Sometimes, especially when adding new web links to a page, the wiki may ask you to answer a question. |
24 | | -Since this is a task that's hard to automate, it will allow most real humans to make their posts while stopping most spammers and other robotic attackers. |
| 24 | +Since this is a task that is hard to automate, it will allow most real humans to make their contributions while stopping most spammers and other robotic attackers. |
25 | 25 | |
26 | | -Please contact the [[{{MediaWiki:Grouppage-sysop}}|site administrators]] for assistance if this is unexpectedly preventing you from making legitimate posts. |
| 26 | +Please contact the [[{{MediaWiki:Grouppage-sysop}}|site administrators]] for assistance if this is unexpectedly preventing you from making legitimate contributions. |
27 | 27 | |
28 | | -Hit the 'back' button in your browser to return to the page editor.", |
29 | | -); |
\ No newline at end of file |
| 28 | +Click the 'back' button in your browser to return to the page editor.", |
| 29 | +); |
Property changes on: trunk/extensions/ConfirmEdit/QuestyCaptcha.i18n.php |
___________________________________________________________________ |
Name: svn:executable |
30 | 30 | - * |
Index: trunk/extensions/ConfirmEdit/MathCaptcha.php |
— | — | @@ -10,9 +10,9 @@ |
11 | 11 | * @licence GNU General Public Licence 2.0 |
12 | 12 | */ |
13 | 13 | |
14 | | -if( !defined( 'MEDIAWIKI' ) ) { |
| 14 | +if ( !defined( 'MEDIAWIKI' ) ) { |
15 | 15 | echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" ); |
16 | 16 | die( 1 ); |
17 | 17 | } |
| 18 | + |
18 | 19 | $wgAutoloadClasses['MathCaptcha'] = dirname( __FILE__ ) . '/MathCaptcha.class.php'; |
19 | | - |
Index: trunk/extensions/ConfirmEdit/QuestyCaptcha.php |
— | — | @@ -29,11 +29,10 @@ |
30 | 30 | |
31 | 31 | global $wgCaptchaQuestions; |
32 | 32 | $wgCaptchaQuestions = array(); |
33 | | -//$wgCaptchaQuestions[] = array( 'question' => "A question?", 'answer' => "An answer!" ); |
34 | | -//$wgCaptchaQuestions[] = array( 'question' => 'How much wood would a woodchuck chuck if a woodchuck could chuck wood?', 'answer' => 'as much wood as...' ); |
35 | | -//$wgCaptchaQuestions[] = array( 'question' => "What is this wiki's name?", 'answer' => "$wgSitename" ); |
36 | | -//add your questions in LocalSettings.php using this format |
| 33 | +// $wgCaptchaQuestions[] = array( 'question' => "A question?", 'answer' => "An answer!" ); |
| 34 | +// $wgCaptchaQuestions[] = array( 'question' => 'How much wood would a woodchuck chuck if a woodchuck could chuck wood?', 'answer' => 'as much wood as...' ); |
| 35 | +// $wgCaptchaQuestions[] = array( 'question' => "What is this wiki's name?", 'answer' => "$wgSitename" ); |
| 36 | +// add your questions in LocalSettings.php using this format |
37 | 37 | |
38 | | -$wgExtensionMessagesFiles['QuestyCaptcha'] = dirname(__FILE__).'/QuestyCaptcha.i18n.php'; |
| 38 | +$wgExtensionMessagesFiles['QuestyCaptcha'] = dirname( __FILE__ ) . '/QuestyCaptcha.i18n.php'; |
39 | 39 | $wgAutoloadClasses['QuestyCaptcha'] = dirname( __FILE__ ) . '/QuestyCaptcha.class.php'; |
40 | | - |
Property changes on: trunk/extensions/ConfirmEdit/QuestyCaptcha.php |
___________________________________________________________________ |
Name: svn:executable |
41 | 40 | - * |
Index: trunk/extensions/ConfirmEdit/ConfirmEdit_body.php |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | static function confirmEditMerged( $editPage, $newtext ) { |
24 | 24 | return self::getInstance()->confirmEditMerged( $editPage, $newtext ); |
25 | 25 | } |
26 | | - |
| 26 | + |
27 | 27 | static function confirmEditAPI( &$editPage, $newtext, &$resultArr ) { |
28 | 28 | return self::getInstance()->confirmEditAPI( $editPage, $newtext, $resultArr ); |
29 | 29 | } |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | $instance = ConfirmEditHooks::getInstance(); |
56 | 56 | switch( $par ) { |
57 | 57 | case "image": |
58 | | - if( method_exists($instance,'showImage') ) |
| 58 | + if ( method_exists( $instance, 'showImage' ) ) |
59 | 59 | return $instance->showImage(); |
60 | 60 | case "help": |
61 | 61 | default: |
— | — | @@ -63,24 +63,23 @@ |
64 | 64 | } |
65 | 65 | } |
66 | 66 | |
67 | | - |
68 | 67 | class SimpleCaptcha { |
69 | 68 | function SimpleCaptcha() { |
70 | 69 | global $wgCaptchaStorageClass; |
71 | 70 | $this->storage = new $wgCaptchaStorageClass; |
72 | 71 | } |
73 | | - |
| 72 | + |
74 | 73 | function getCaptcha() { |
75 | | - $a = mt_rand(0, 100); |
76 | | - $b = mt_rand(0, 10); |
77 | | - $op = mt_rand(0, 1) ? '+' : '-'; |
| 74 | + $a = mt_rand( 0, 100 ); |
| 75 | + $b = mt_rand( 0, 10 ); |
| 76 | + $op = mt_rand( 0, 1 ) ? '+' : '-'; |
78 | 77 | |
79 | 78 | $test = "$a $op $b"; |
80 | | - $answer = ($op == '+') ? ($a + $b) : ($a - $b); |
81 | | - return array('question' => $test, 'answer' => $answer); |
| 79 | + $answer = ( $op == '+' ) ? ( $a + $b ) : ( $a - $b ); |
| 80 | + return array( 'question' => $test, 'answer' => $answer ); |
82 | 81 | } |
83 | | - |
84 | | - function addCaptchaAPI(&$resultArr) { |
| 82 | + |
| 83 | + function addCaptchaAPI( &$resultArr ) { |
85 | 84 | $captcha = $this->getCaptcha(); |
86 | 85 | $index = $this->storeCaptcha( $captcha ); |
87 | 86 | $resultArr['captcha']['type'] = 'simple'; |
— | — | @@ -88,7 +87,7 @@ |
89 | 88 | $resultArr['captcha']['id'] = $index; |
90 | 89 | $resultArr['captcha']['question'] = $captcha['question']; |
91 | 90 | } |
92 | | - |
| 91 | + |
93 | 92 | /** |
94 | 93 | * Insert a captcha prompt into the edit form. |
95 | 94 | * This sample implementation generates a simple arithmetic operation; |
— | — | @@ -147,8 +146,8 @@ |
148 | 147 | */ |
149 | 148 | function injectUserCreate( &$template ) { |
150 | 149 | global $wgCaptchaTriggers, $wgOut, $wgUser; |
151 | | - if( $wgCaptchaTriggers['createaccount'] ) { |
152 | | - if( $wgUser->isAllowed( 'skipcaptcha' ) ) { |
| 150 | + if ( $wgCaptchaTriggers['createaccount'] ) { |
| 151 | + if ( $wgUser->isAllowed( 'skipcaptcha' ) ) { |
153 | 152 | wfDebug( "ConfirmEdit: user group allows skipping captcha on account creation\n" ); |
154 | 153 | return true; |
155 | 154 | } |
— | — | @@ -169,7 +168,7 @@ |
170 | 169 | * @return bool true to keep running callbacks |
171 | 170 | */ |
172 | 171 | function injectUserLogin( &$template ) { |
173 | | - if( $this->isBadLoginTriggered() ) { |
| 172 | + if ( $this->isBadLoginTriggered() ) { |
174 | 173 | global $wgOut; |
175 | 174 | $template->set( 'header', |
176 | 175 | "<div class='captcha'>" . |
— | — | @@ -179,7 +178,7 @@ |
180 | 179 | } |
181 | 180 | return true; |
182 | 181 | } |
183 | | - |
| 182 | + |
184 | 183 | /** |
185 | 184 | * When a bad login attempt is made, increment an expiring counter |
186 | 185 | * in the memcache cloud. Later checks for this may trigger a |
— | — | @@ -191,17 +190,17 @@ |
192 | 191 | */ |
193 | 192 | function triggerUserLogin( $user, $password, $retval ) { |
194 | 193 | global $wgCaptchaTriggers, $wgCaptchaBadLoginExpiration, $wgMemc; |
195 | | - if( $retval == LoginForm::WRONG_PASS && $wgCaptchaTriggers['badlogin'] ) { |
| 194 | + if ( $retval == LoginForm::WRONG_PASS && $wgCaptchaTriggers['badlogin'] ) { |
196 | 195 | $key = $this->badLoginKey(); |
197 | 196 | $count = $wgMemc->get( $key ); |
198 | | - if( !$count ) { |
| 197 | + if ( !$count ) { |
199 | 198 | $wgMemc->add( $key, 0, $wgCaptchaBadLoginExpiration ); |
200 | 199 | } |
201 | 200 | $count = $wgMemc->incr( $key ); |
202 | 201 | } |
203 | 202 | return true; |
204 | 203 | } |
205 | | - |
| 204 | + |
206 | 205 | /** |
207 | 206 | * Check if a bad login has already been registered for this |
208 | 207 | * IP address. If so, require a captcha. |
— | — | @@ -212,13 +211,13 @@ |
213 | 212 | global $wgMemc, $wgCaptchaBadLoginAttempts; |
214 | 213 | return intval( $wgMemc->get( $this->badLoginKey() ) ) >= $wgCaptchaBadLoginAttempts; |
215 | 214 | } |
216 | | - |
| 215 | + |
217 | 216 | /** |
218 | 217 | * Check if the IP is allowed to skip captchas |
219 | 218 | */ |
220 | 219 | function isIPWhitelisted() { |
221 | 220 | global $wgCaptchaWhitelistIP; |
222 | | - if( $wgCaptchaWhitelistIP ) { |
| 221 | + if ( $wgCaptchaWhitelistIP ) { |
223 | 222 | $ip = wfGetIp(); |
224 | 223 | foreach ( $wgCaptchaWhitelistIP as $range ) { |
225 | 224 | if ( IP::isInRange( $ip, $range ) ) { |
— | — | @@ -228,7 +227,7 @@ |
229 | 228 | } |
230 | 229 | return false; |
231 | 230 | } |
232 | | - |
| 231 | + |
233 | 232 | /** |
234 | 233 | * Internal cache key for badlogin checks. |
235 | 234 | * @return string |
— | — | @@ -237,7 +236,7 @@ |
238 | 237 | function badLoginKey() { |
239 | 238 | return wfMemcKey( 'captcha', 'badlogin', 'ip', wfGetIP() ); |
240 | 239 | } |
241 | | - |
| 240 | + |
242 | 241 | /** |
243 | 242 | * Check if the submitted form matches the captcha session data provided |
244 | 243 | * by the plugin when the form was generated. |
— | — | @@ -259,16 +258,15 @@ |
260 | 259 | * @param string $action (edit/create/addurl...) |
261 | 260 | * @return bool true if action triggers captcha on editPage's namespace |
262 | 261 | */ |
263 | | - function captchaTriggers( &$editPage, $action) { |
264 | | - global $wgCaptchaTriggers, $wgCaptchaTriggersOnNamespace; |
265 | | - //Special config for this NS? |
266 | | - if (isset( $wgCaptchaTriggersOnNamespace[$editPage->mTitle->getNamespace()][$action] ) ) |
| 262 | + function captchaTriggers( &$editPage, $action ) { |
| 263 | + global $wgCaptchaTriggers, $wgCaptchaTriggersOnNamespace; |
| 264 | + // Special config for this NS? |
| 265 | + if ( isset( $wgCaptchaTriggersOnNamespace[$editPage->mTitle->getNamespace()][$action] ) ) |
267 | 266 | return $wgCaptchaTriggersOnNamespace[$editPage->mTitle->getNamespace()][$action]; |
268 | 267 | |
269 | | - return ( !empty( $wgCaptchaTriggers[$action] ) ); //Default |
| 268 | + return ( !empty( $wgCaptchaTriggers[$action] ) ); // Default |
270 | 269 | } |
271 | 270 | |
272 | | - |
273 | 271 | /** |
274 | 272 | * @param EditPage $editPage |
275 | 273 | * @param string $newtext |
— | — | @@ -280,22 +278,22 @@ |
281 | 279 | $title = $editPage->mArticle->getTitle(); |
282 | 280 | |
283 | 281 | global $wgUser; |
284 | | - if( $wgUser->isAllowed( 'skipcaptcha' ) ) { |
| 282 | + if ( $wgUser->isAllowed( 'skipcaptcha' ) ) { |
285 | 283 | wfDebug( "ConfirmEdit: user group allows skipping captcha\n" ); |
286 | 284 | return false; |
287 | 285 | } |
288 | | - if( $this->isIPWhitelisted() ) |
| 286 | + if ( $this->isIPWhitelisted() ) |
289 | 287 | return false; |
290 | 288 | |
291 | 289 | |
292 | 290 | global $wgEmailAuthentication, $ceAllowConfirmedEmail; |
293 | | - if( $wgEmailAuthentication && $ceAllowConfirmedEmail && |
| 291 | + if ( $wgEmailAuthentication && $ceAllowConfirmedEmail && |
294 | 292 | $wgUser->isEmailConfirmed() ) { |
295 | 293 | wfDebug( "ConfirmEdit: user has confirmed mail, skipping captcha\n" ); |
296 | 294 | return false; |
297 | 295 | } |
298 | 296 | |
299 | | - if( $this->captchaTriggers( $editPage, 'edit' ) ) { |
| 297 | + if ( $this->captchaTriggers( $editPage, 'edit' ) ) { |
300 | 298 | // Check on all edits |
301 | 299 | global $wgUser; |
302 | 300 | $this->trigger = sprintf( "edit trigger by '%s' at [[%s]]", |
— | — | @@ -306,8 +304,8 @@ |
307 | 305 | return true; |
308 | 306 | } |
309 | 307 | |
310 | | - if( $this->captchaTriggers( $editPage, 'create' ) && !$editPage->mTitle->exists() ) { |
311 | | - //Check if creating a page |
| 308 | + if ( $this->captchaTriggers( $editPage, 'create' ) && !$editPage->mTitle->exists() ) { |
| 309 | + // Check if creating a page |
312 | 310 | global $wgUser; |
313 | 311 | $this->trigger = sprintf( "Create trigger by '%s' at [[%s]]", |
314 | 312 | $wgUser->getName(), |
— | — | @@ -317,7 +315,7 @@ |
318 | 316 | return true; |
319 | 317 | } |
320 | 318 | |
321 | | - if( $this->captchaTriggers( $editPage, 'addurl' ) ) { |
| 319 | + if ( $this->captchaTriggers( $editPage, 'addurl' ) ) { |
322 | 320 | // Only check edits that add URLs |
323 | 321 | if ( $merged ) { |
324 | 322 | // Get links from the database |
— | — | @@ -336,7 +334,7 @@ |
337 | 335 | $addedLinks = array_diff( $unknownLinks, $oldLinks ); |
338 | 336 | $numLinks = count( $addedLinks ); |
339 | 337 | |
340 | | - if( $numLinks > 0 ) { |
| 338 | + if ( $numLinks > 0 ) { |
341 | 339 | global $wgUser; |
342 | 340 | $this->trigger = sprintf( "%dx url trigger by '%s' at [[%s]]: %s", |
343 | 341 | $numLinks, |
— | — | @@ -349,20 +347,20 @@ |
350 | 348 | } |
351 | 349 | |
352 | 350 | global $wgCaptchaRegexes; |
353 | | - if( $wgCaptchaRegexes ) { |
| 351 | + if ( $wgCaptchaRegexes ) { |
354 | 352 | // Custom regex checks |
355 | 353 | $oldtext = $this->loadText( $editPage, $section ); |
356 | 354 | |
357 | | - foreach( $wgCaptchaRegexes as $regex ) { |
| 355 | + foreach ( $wgCaptchaRegexes as $regex ) { |
358 | 356 | $newMatches = array(); |
359 | | - if( preg_match_all( $regex, $newtext, $newMatches ) ) { |
| 357 | + if ( preg_match_all( $regex, $newtext, $newMatches ) ) { |
360 | 358 | $oldMatches = array(); |
361 | 359 | preg_match_all( $regex, $oldtext, $oldMatches ); |
362 | 360 | |
363 | 361 | $addedMatches = array_diff( $newMatches[0], $oldMatches[0] ); |
364 | 362 | |
365 | 363 | $numHits = count( $addedMatches ); |
366 | | - if( $numHits > 0 ) { |
| 364 | + if ( $numHits > 0 ) { |
367 | 365 | global $wgUser; |
368 | 366 | $this->trigger = sprintf( "%dx %s at [[%s]]: %s", |
369 | 367 | $numHits, |
— | — | @@ -390,7 +388,7 @@ |
391 | 389 | global $wgCaptchaWhitelist; |
392 | 390 | $source = wfMsgForContent( 'captcha-addurl-whitelist' ); |
393 | 391 | |
394 | | - $whitelist = wfEmptyMsg( 'captcha-addurl-whitelist', $source ) |
| 392 | + $whitelist = wfEmptyMsg( 'captcha-addurl-whitelist', $source ) |
395 | 393 | ? false |
396 | 394 | : $this->buildRegexes( explode( "\n", $source ) ); |
397 | 395 | |
— | — | @@ -419,29 +417,29 @@ |
420 | 418 | } else { |
421 | 419 | # Make regex |
422 | 420 | # It's faster using the S modifier even though it will usually only be run once |
423 | | - //$regex = 'http://+[a-z0-9_\-.]*(' . implode( '|', $lines ) . ')'; |
424 | | - //return '/' . str_replace( '/', '\/', preg_replace('|\\\*/|', '/', $regex) ) . '/Si'; |
| 421 | + // $regex = 'http://+[a-z0-9_\-.]*(' . implode( '|', $lines ) . ')'; |
| 422 | + // return '/' . str_replace( '/', '\/', preg_replace('|\\\*/|', '/', $regex) ) . '/Si'; |
425 | 423 | $regexes = ''; |
426 | 424 | $regexStart = '/^https?:\/\/+[a-z0-9_\-.]*('; |
427 | 425 | $regexEnd = ')/Si'; |
428 | 426 | $regexMax = 4096; |
429 | 427 | $build = false; |
430 | | - foreach( $lines as $line ) { |
| 428 | + foreach ( $lines as $line ) { |
431 | 429 | // FIXME: not very robust size check, but should work. :) |
432 | | - if( $build === false ) { |
| 430 | + if ( $build === false ) { |
433 | 431 | $build = $line; |
434 | | - } elseif( strlen( $build ) + strlen( $line ) > $regexMax ) { |
| 432 | + } elseif ( strlen( $build ) + strlen( $line ) > $regexMax ) { |
435 | 433 | $regexes .= $regexStart . |
436 | | - str_replace( '/', '\/', preg_replace('|\\\*/|', '/', $build) ) . |
| 434 | + str_replace( '/', '\/', preg_replace( '|\\\*/|', '/', $build ) ) . |
437 | 435 | $regexEnd; |
438 | 436 | $build = $line; |
439 | 437 | } else { |
440 | 438 | $build .= '|' . $line; |
441 | 439 | } |
442 | 440 | } |
443 | | - if( $build !== false ) { |
| 441 | + if ( $build !== false ) { |
444 | 442 | $regexes .= $regexStart . |
445 | | - str_replace( '/', '\/', preg_replace('|\\\*/|', '/', $build) ) . |
| 443 | + str_replace( '/', '\/', preg_replace( '|\\\*/|', '/', $build ) ) . |
446 | 444 | $regexEnd; |
447 | 445 | } |
448 | 446 | return $regexes; |
— | — | @@ -454,7 +452,7 @@ |
455 | 453 | function getLinksFromTracker( $title ) { |
456 | 454 | $dbr =& wfGetDB( DB_SLAVE ); |
457 | 455 | $id = $title->getArticleId(); // should be zero queries |
458 | | - $res = $dbr->select( 'externallinks', array( 'el_to' ), |
| 456 | + $res = $dbr->select( 'externallinks', array( 'el_to' ), |
459 | 457 | array( 'el_from' => $id ), __METHOD__ ); |
460 | 458 | $links = array(); |
461 | 459 | while ( $row = $dbr->fetchObject( $res ) ) { |
— | — | @@ -462,14 +460,14 @@ |
463 | 461 | } |
464 | 462 | return $links; |
465 | 463 | } |
466 | | - |
| 464 | + |
467 | 465 | /** |
468 | 466 | * Backend function for confirmEdit() and confirmEditAPI() |
469 | 467 | * @return bool false if the CAPTCHA is rejected, true otherwise |
470 | 468 | */ |
471 | 469 | private function doConfirmEdit( $editPage, $newtext, $section, $merged = false ) { |
472 | | - if( $this->shouldCheck( $editPage, $newtext, $section, $merged ) ) { |
473 | | - if( $this->passCaptcha() ) { |
| 470 | + if ( $this->shouldCheck( $editPage, $newtext, $section, $merged ) ) { |
| 471 | + if ( $this->passCaptcha() ) { |
474 | 472 | return true; |
475 | 473 | } else { |
476 | 474 | return false; |
— | — | @@ -489,12 +487,12 @@ |
490 | 488 | * @return bool true to continue saving, false to abort and show a captcha form |
491 | 489 | */ |
492 | 490 | function confirmEdit( $editPage, $newtext, $section, $merged = false ) { |
493 | | - if( defined('MW_API') ) { |
| 491 | + if ( defined( 'MW_API' ) ) { |
494 | 492 | # API mode |
495 | | - # The CAPTCHA was already checked and approved |
| 493 | + # The CAPTCHA was already checked and approved |
496 | 494 | return true; |
497 | 495 | } |
498 | | - if( !$this->doConfirmEdit( $editPage, $newtext, $section, $merged ) ) { |
| 496 | + if ( !$this->doConfirmEdit( $editPage, $newtext, $section, $merged ) ) { |
499 | 497 | $editPage->showEditForm( array( &$this, 'editCallback' ) ); |
500 | 498 | return false; |
501 | 499 | } |
— | — | @@ -509,11 +507,11 @@ |
510 | 508 | function confirmEditMerged( $editPage, $newtext ) { |
511 | 509 | return $this->confirmEdit( $editPage, $newtext, false, true ); |
512 | 510 | } |
513 | | - |
514 | | - |
515 | | - function confirmEditAPI( &$editPage, $newtext, &$resultArr) { |
516 | | - if( !$this->doConfirmEdit( $editPage, $newtext, false, false ) ) { |
517 | | - $this->addCaptchaAPI($resultArr); |
| 511 | + |
| 512 | + |
| 513 | + function confirmEditAPI( &$editPage, $newtext, &$resultArr ) { |
| 514 | + if ( !$this->doConfirmEdit( $editPage, $newtext, false, false ) ) { |
| 515 | + $this->addCaptchaAPI( $resultArr ); |
518 | 516 | return false; |
519 | 517 | } |
520 | 518 | return true; |
— | — | @@ -527,23 +525,23 @@ |
528 | 526 | */ |
529 | 527 | function confirmUserCreate( $u, &$message ) { |
530 | 528 | global $wgCaptchaTriggers, $wgUser; |
531 | | - if( $wgCaptchaTriggers['createaccount'] ) { |
532 | | - if( $wgUser->isAllowed( 'skipcaptcha' ) ) { |
| 529 | + if ( $wgCaptchaTriggers['createaccount'] ) { |
| 530 | + if ( $wgUser->isAllowed( 'skipcaptcha' ) ) { |
533 | 531 | wfDebug( "ConfirmEdit: user group allows skipping captcha on account creation\n" ); |
534 | 532 | return true; |
535 | 533 | } |
536 | | - if( $this->isIPWhitelisted() ) |
| 534 | + if ( $this->isIPWhitelisted() ) |
537 | 535 | return true; |
538 | | - |
| 536 | + |
539 | 537 | $this->trigger = "new account '" . $u->getName() . "'"; |
540 | | - if( !$this->passCaptcha() ) { |
| 538 | + if ( !$this->passCaptcha() ) { |
541 | 539 | $message = wfMsg( 'captcha-createaccount-fail' ); |
542 | 540 | return false; |
543 | 541 | } |
544 | 542 | } |
545 | 543 | return true; |
546 | 544 | } |
547 | | - |
| 545 | + |
548 | 546 | /** |
549 | 547 | * Hook for user login form submissions. |
550 | 548 | * @param User $u |
— | — | @@ -551,12 +549,12 @@ |
552 | 550 | * @return bool true to continue, false to abort user creation |
553 | 551 | */ |
554 | 552 | function confirmUserLogin( $u, $pass, &$retval ) { |
555 | | - if( $this->isBadLoginTriggered() ) { |
556 | | - if( $this->isIPWhitelisted() ) |
| 553 | + if ( $this->isBadLoginTriggered() ) { |
| 554 | + if ( $this->isIPWhitelisted() ) |
557 | 555 | return true; |
558 | | - |
| 556 | + |
559 | 557 | $this->trigger = "post-badlogin login '" . $u->getName() . "'"; |
560 | | - if( !$this->passCaptcha() ) { |
| 558 | + if ( !$this->passCaptcha() ) { |
561 | 559 | $message = wfMsg( 'captcha-badlogin-fail' ); |
562 | 560 | // Emulate a bad-password return to confuse the shit out of attackers |
563 | 561 | $retval = LoginForm::WRONG_PASS; |
— | — | @@ -573,9 +571,9 @@ |
574 | 572 | */ |
575 | 573 | function passCaptcha() { |
576 | 574 | $info = $this->retrieveCaptcha(); |
577 | | - if( $info ) { |
| 575 | + if ( $info ) { |
578 | 576 | global $wgRequest; |
579 | | - if( $this->keyMatch( $wgRequest->getVal('wpCaptchaWord'), $info ) ) { |
| 577 | + if ( $this->keyMatch( $wgRequest->getVal( 'wpCaptchaWord' ), $info ) ) { |
580 | 578 | $this->log( "passed" ); |
581 | 579 | $this->clearCaptcha( $info ); |
582 | 580 | return true; |
— | — | @@ -610,7 +608,7 @@ |
611 | 609 | * @return string captcha ID key |
612 | 610 | */ |
613 | 611 | function storeCaptcha( $info ) { |
614 | | - if( !isset( $info['index'] ) ) { |
| 612 | + if ( !isset( $info['index'] ) ) { |
615 | 613 | // Assign random index if we're not udpating |
616 | 614 | $info['index'] = strval( mt_rand() ); |
617 | 615 | } |
— | — | @@ -645,11 +643,11 @@ |
646 | 644 | */ |
647 | 645 | function loadText( $editPage, $section ) { |
648 | 646 | $rev = Revision::newFromTitle( $editPage->mTitle ); |
649 | | - if( is_null( $rev ) ) { |
| 647 | + if ( is_null( $rev ) ) { |
650 | 648 | return ""; |
651 | 649 | } else { |
652 | 650 | $text = $rev->getText(); |
653 | | - if( $section != '' ) { |
| 651 | + if ( $section != '' ) { |
654 | 652 | return Article::getSection( $text, $section ); |
655 | 653 | } else { |
656 | 654 | return $text; |
— | — | @@ -683,22 +681,21 @@ |
684 | 682 | $wgOut->addWikiText( wfMsg( 'captchahelp-cookies-needed' ) ); |
685 | 683 | } |
686 | 684 | } |
687 | | - |
688 | 685 | } |
689 | 686 | |
690 | 687 | class CaptchaSessionStore { |
691 | 688 | function store( $index, $info ) { |
692 | 689 | $_SESSION['captcha' . $info['index']] = $info; |
693 | 690 | } |
694 | | - |
| 691 | + |
695 | 692 | function retrieve( $index ) { |
696 | | - if( isset( $_SESSION['captcha' . $index] ) ) { |
| 693 | + if ( isset( $_SESSION['captcha' . $index] ) ) { |
697 | 694 | return $_SESSION['captcha' . $index]; |
698 | 695 | } else { |
699 | 696 | return false; |
700 | 697 | } |
701 | 698 | } |
702 | | - |
| 699 | + |
703 | 700 | function clear( $index ) { |
704 | 701 | unset( $_SESSION['captcha' . $index] ); |
705 | 702 | } |
— | — | @@ -718,13 +715,13 @@ |
719 | 716 | function retrieve( $index ) { |
720 | 717 | global $wgMemc; |
721 | 718 | $info = $wgMemc->get( wfMemcKey( 'captcha', $index ) ); |
722 | | - if( $info ) { |
| 719 | + if ( $info ) { |
723 | 720 | return $info; |
724 | 721 | } else { |
725 | 722 | return false; |
726 | 723 | } |
727 | 724 | } |
728 | | - |
| 725 | + |
729 | 726 | function clear( $index ) { |
730 | 727 | global $wgMemc; |
731 | 728 | $wgMemc->delete( wfMemcKey( 'captcha', $index ) ); |
— | — | @@ -734,4 +731,3 @@ |
735 | 732 | return false; |
736 | 733 | } |
737 | 734 | } |
738 | | - |
Index: trunk/extensions/ConfirmEdit/ConfirmEdit.i18n.php |
— | — | @@ -209,7 +209,7 @@ |
210 | 210 | 'captcha-create' => 'এই পৃষ্ঠাটো তৈয়াৰ কৰিবলৈ, তলৰ সহজ অংকটো কৰি উত্তৰতো বাকছৰ ভিতৰত লিখক |
211 | 211 | ([[Special:Captcha/help|অধিক তথ্য]]):', |
212 | 212 | 'captchahelp-cookies-needed' => 'এই কামতো সম্পন্ন কৰিবলৈ, আপোনাৰ ব্রাউজাৰত কুকী সক্রীয় থাকিব লাগিব', |
213 | | - 'captchahelp-text' => "যিবোৰ ৱেবচাইটত জনতাই পাঠ্য ভৰাব পাৰে, যেনে এই ৱিকি, সেইবোৰক প্রায়ে দুস্ক্রিতিকাৰি স্পেমাৰবোৰে স্বয়ংক্রীয় আহিলাৰ দ্বাৰা তেওলোকৰ চাইটলৈ সংযোগ ভৰাই আক্রমন কৰে। |
| 213 | + 'captchahelp-text' => "যিবোৰ ৱেবচাইটত জনতাই পাঠ্য ভৰাব পাৰে, যেনে এই ৱিকি, সেইবোৰক প্রায়ে দুস্ক্রিতিকাৰি স্পেমাৰবোৰে স্বয়ংক্রীয় আহিলাৰ দ্বাৰা তেওলোকৰ চাইটলৈ সংযোগ ভৰাই আক্রমন কৰে। |
214 | 214 | যদিও তেনে স্পাম সংযোগ গুচাব পাৰি, পিছে এয়া এক ডাঙৰ উপদ্রৱ। |
215 | 215 | |
216 | 216 | কেতিয়াবা, সাধাৰণতে যেতিয়া কোনো পৃষ্ঠালৈ নতুন সংযোগ সৃষ্টি কৰা হয়, তেতিয়া ৱিকিয়ে এটা ৰঙীন বা বিকৃত চবি দেখুৱাই তাত থকা শব্দখিনি আপোনাক টাইপ কৰিব কব পাৰে। |
— | — | @@ -410,7 +410,7 @@ |
411 | 411 | 'captcha-addurl-whitelist' => " #<!-- laoskit al linenn-mañ tre evel m'emañ --> <pre> |
412 | 412 | # Setu penaos emañ an ereadur : |
413 | 413 | # * Kement tra war-lerc'h an arouezenn \"#\" zo un urzhiad, betek penn all al linenn |
414 | | -# * Kement linenn n'eo ket goullo zo ur c'hod regex a vo implijet e diabarzh al liammoù gourdskrid hepken |
| 414 | +# * Kement linenn n'eo ket goullo zo ur c'hod regex a vo implijet e diabarzh al liammoù gourdskrid hepken |
415 | 415 | #</pre> <!-- laoskit al linenn-mañ tre evel m'emañ -->", |
416 | 416 | 'right-skipcaptcha' => 'Lañsañ a ra an oberoù captcha hep bezañ rediet da dremen drezañ', |
417 | 417 | ); |
— | — | @@ -542,20 +542,20 @@ |
543 | 543 | 'captcha-create' => "Er mwyn gallu creu'r dudalen, gwnewch y swm isod a gosodwch y canlyniad yn y blwch ([[Special:Captcha/help|rhagor o wybodaeth]]):", |
544 | 544 | 'captchahelp-title' => 'Cymorth "captcha"', |
545 | 545 | 'captchahelp-cookies-needed' => "Er mwyn i hyn weithio mae'n rhaid bod cookies wedi eu galluogi ar eich gwe-lywiwr.", |
546 | | - 'captchahelp-text' => "Yn anffodus, mae safleoedd gwe fel y wici hon, sy'n caniatau i'r cyhoedd ysgrifennu iddi, yn darged beunyddiol i sbamwyr sy'n defnyddio rhaglenni arbennig i bostio eu cysylltiadau ar wefannau lu. Gellir dileu'r dolenni o'r tudalennau, ond byddai hynny'n waith trafferthus. |
| 546 | + 'captchahelp-text' => "Yn anffodus, mae safleoedd gwe fel y wici hon, sy'n caniatau i'r cyhoedd ysgrifennu iddi, yn darged beunyddiol i sbamwyr sy'n defnyddio rhaglenni arbennig i bostio eu cysylltiadau ar wefannau lu. Gellir dileu'r dolenni o'r tudalennau, ond byddai hynny'n waith trafferthus. |
547 | 547 | |
548 | | -O dro i dro, yn enwedig wrth ychwanegu dolenni at safleoedd gwe eraill, fe fydd y safle hon yn dangos delwedd o destun, ac fe fydd yn rhaid i chi deipio'r geiriau a ddangosir. Mae hyn yn dasg anodd iawn i raglenni cyfrifiadurol, felly dylai'r rhan fwyaf o olygwyr go iawn gyflawni'r dasg yn ddi-drafferth, yn wahanol i'r rhaglenni sbam. |
| 548 | +O dro i dro, yn enwedig wrth ychwanegu dolenni at safleoedd gwe eraill, fe fydd y safle hon yn dangos delwedd o destun, ac fe fydd yn rhaid i chi deipio'r geiriau a ddangosir. Mae hyn yn dasg anodd iawn i raglenni cyfrifiadurol, felly dylai'r rhan fwyaf o olygwyr go iawn gyflawni'r dasg yn ddi-drafferth, yn wahanol i'r rhaglenni sbam. |
549 | 549 | |
550 | | -Yn anffodus, mae hyn yn creu trafferthion i'r rhai sydd yn defnyddio porwyr testun neu borwyr sain, neu sydd yn colli eu golwg. |
551 | | -Ar hyn o bryd nid oes fersiwn sain ar gael. |
552 | | -Cysylltwch â [[{{MediaWiki:Grouppage-sysop}}|gweinyddwyr y safle]] os ydi'r nodwedd hon yn eich rhwystro rhag ychwanegu golygiadau dilys. |
| 550 | +Yn anffodus, mae hyn yn creu trafferthion i'r rhai sydd yn defnyddio porwyr testun neu borwyr sain, neu sydd yn colli eu golwg. |
| 551 | +Ar hyn o bryd nid oes fersiwn sain ar gael. |
| 552 | +Cysylltwch â [[{{MediaWiki:Grouppage-sysop}}|gweinyddwyr y safle]] os ydi'r nodwedd hon yn eich rhwystro rhag ychwanegu golygiadau dilys. |
553 | 553 | |
554 | 554 | Gwasgwch botwm 'nôl' eich porwr er mwyn dychwelyd at y dudalen golygu.", |
555 | 555 | 'captcha-addurl-whitelist' => '#<!-- leave this line exactly as it is --> <pre> |
556 | 556 | # |
557 | 557 | # Dyma\'r gystrawen: |
558 | 558 | # * Mae popeth o nod "#" hyd at ddiwedd y llinell yn sylwad |
559 | | -# * Mae pob llinell nad yw\'n wag yn ddarn regex sydd ddim ond yn cydweddu |
| 559 | +# * Mae pob llinell nad yw\'n wag yn ddarn regex sydd ddim ond yn cydweddu |
560 | 560 | # * gwesteiwyr tu mewn i gyfeiriadau URL |
561 | 561 | |
562 | 562 | #</pre> <!-- leave this line exactly as it is -->', |
— | — | @@ -626,8 +626,8 @@ |
627 | 627 | */ |
628 | 628 | $messages['de-formal'] = array( |
629 | 629 | 'captcha-edit' => 'Zur Bearbeitung der Seite lösen Sie die nachfolgende Rechenaufgabe und tragen Sie das Ergebnis in das Feld unten ein [[Special:Captcha/help|(Fragen oder Probleme?)]].', |
630 | | - 'captcha-addurl' => 'Ihre Bearbeitung enthält neue externe Links. |
631 | | -Zum Schutz vor automatisiertem Spamming lösen Sie die nachfolgende Rechenaufgabe und tragen Sie das Ergebnis in das Feld unten ein. |
| 630 | + 'captcha-addurl' => 'Ihre Bearbeitung enthält neue externe Links. |
| 631 | +Zum Schutz vor automatisiertem Spamming lösen Sie die nachfolgende Rechenaufgabe und tragen Sie das Ergebnis in das Feld unten ein. |
632 | 632 | Klicken Sie dann erneut auf „Seite speichern“ [[Special:Captcha/help|(Fragen oder Probleme?)]].', |
633 | 633 | 'captcha-badlogin' => 'Zum Schutz vor einer Kompromittierung Ihres Benutzerkontos lösen Sie die nachfolgende Rechenaufgabe und tragen Sie das Ergebnis in das Feld unten ein [[Special:Captcha/help|(Fragen oder Probleme?)]]:', |
634 | 634 | 'captcha-createaccount' => 'Zum Schutz vor automatisierter Anlage von Benutzerkonten lösen Sie die nachfolgende Rechenaufgabe und tragen Sie das Ergebnis in das Feld unten ein [[Special:Captcha/help|(Fragen oder Probleme?)]].', |
— | — | @@ -702,8 +702,8 @@ |
703 | 703 | Πατήστε το κουμπί 'πίσω' στη μηχανή αναζήτησης σας για να επιστρέψετε στο συντάκτη σελίδων.", |
704 | 704 | 'captcha-addurl-whitelist' => ' #<!-- αφήστε αυτή την γραμμή ακριβώς όπως είναι --> <pre> |
705 | 705 | # Η σύνταξη είναι όπως παρακάτω: |
706 | | -# * Οτιδήποτε από ένα χαρακτήρα "#" ως το τέλος της γραμμής είναι ένα σχόλιο |
707 | | -# * Κάθε μη κενή γραμμή είναι μια έκφραση regex που θα ταιριάζει μόνο hosts μέσα σε URL |
| 706 | +# * Οτιδήποτε από ένα χαρακτήρα "#" ως το τέλος της γραμμής είναι ένα σχόλιο |
| 707 | +# * Κάθε μη κενή γραμμή είναι μια έκφραση regex που θα ταιριάζει μόνο hosts μέσα σε URL |
708 | 708 | #</pre> <!-- αφήστε αυτή την γραμμή ακριβώς όπως είναι -->', |
709 | 709 | 'right-skipcaptcha' => 'Πραγματοποίηση ενεργειών που ενεργοποιούν captcha χωρίς να χρειάζεται πέρασμα από το captcha', |
710 | 710 | ); |
— | — | @@ -792,11 +792,11 @@ |
793 | 793 | 'captcha-create' => 'Teie muudatuses on uusi linke; kaitseks spämmi vastu peate sisestama järgneval pildil olevad sõnad:<br /> ([[Special:Captcha/help|Mis see on?]])', |
794 | 794 | 'captchahelp-title' => 'Mis on Captcha?', |
795 | 795 | 'captchahelp-cookies-needed' => 'Selle toimimiseks peab veebibrauser lubama küpsiseid.', |
796 | | - 'captchahelp-text' => 'Internetisaite, mis lubavad külastajatel sisu muuta (nagu ka see Viki), kasutavad sageli spämmerid ära, postitades reklaamlinke — spämmi. Kuigi neid linke saab alati ära võtta, on nad ikkagi üpris tülikad. |
| 796 | + 'captchahelp-text' => 'Internetisaite, mis lubavad külastajatel sisu muuta (nagu ka see Viki), kasutavad sageli spämmerid ära, postitades reklaamlinke — spämmi. Kuigi neid linke saab alati ära võtta, on nad ikkagi üpris tülikad. |
797 | 797 | |
798 | | -Omale kasutajakontot registreerides või mõnele lehele uusi internetiaadresse postitades näidatakse teile moonutatud tekstiga pilti ning palutakse teil sisestada seal näidatud sõnad. Kuna selliselt pildilt on arvutil raske teksti välja lugeda, on see efektiivseks kaitseks spämmirobotite vastu, samas lubades tavainimestel oma muudatusi rahus teha. |
| 798 | +Omale kasutajakontot registreerides või mõnele lehele uusi internetiaadresse postitades näidatakse teile moonutatud tekstiga pilti ning palutakse teil sisestada seal näidatud sõnad. Kuna selliselt pildilt on arvutil raske teksti välja lugeda, on see efektiivseks kaitseks spämmirobotite vastu, samas lubades tavainimestel oma muudatusi rahus teha. |
799 | 799 | |
800 | | -Kahjuks võib see tekitada ebamugavusi nägemisraskustega inimestele või neile, kes kasutavad kõnesüntesaatorit või tekstipõhist brauserit. Hetkel pole meil helipõhist alternatiivi. Kui teil tekib ootamatult raskusi oma muudatuste tegemisel, siis võtke ühendust selle saidi administraatoritega. |
| 800 | +Kahjuks võib see tekitada ebamugavusi nägemisraskustega inimestele või neile, kes kasutavad kõnesüntesaatorit või tekstipõhist brauserit. Hetkel pole meil helipõhist alternatiivi. Kui teil tekib ootamatult raskusi oma muudatuste tegemisel, siis võtke ühendust selle saidi administraatoritega. |
801 | 801 | |
802 | 802 | Konto registreerimise lehele või lehe redigeerimisele tagasi jõudmiseks vajutage oma brauseri tagasi-nuppu.', |
803 | 803 | ); |
— | — | @@ -816,12 +816,12 @@ |
817 | 817 | 'captcha-create' => 'Orrialde hau sortzeko, mesedez, beheko batuketa erraz hau ebatzi eta erantzuna kutxan idatzi ([[Special:Captcha/help|argibide gehiago]]):', |
818 | 818 | 'captchahelp-title' => 'Captcha laguntza', |
819 | 819 | 'captchahelp-cookies-needed' => 'Beharrezkoa da nabigatzailean cookieak gaituta izatea honek funtzionatzeko.', |
820 | | - 'captchahelp-text' => "Publikoki aldaketak egiteko aukerak dituzten webguneetan, wiki honetan bezalaxe, spam testuak gehitzen dira sarritan tresna automatikoak erabiliz. |
| 820 | + 'captchahelp-text' => "Publikoki aldaketak egiteko aukerak dituzten webguneetan, wiki honetan bezalaxe, spam testuak gehitzen dira sarritan tresna automatikoak erabiliz. |
821 | 821 | Lotura horiek ezabatu egin daitezkeen arren, traba dira. |
822 | 822 | |
823 | | -Batzuetan, eta bereziki webgune berri bateko loturak gehitzen dituzunean, hitz batzuk dituen irudi bat agertuko zaizu, eta bertan ageri den testua idazteko eskatuko zaizu. Lan hori automatizatzeko zaila da, eta pertsonei ezer kostatzen ez zaigunez, spam testuak saihesteko lagungarria da. |
| 823 | +Batzuetan, eta bereziki webgune berri bateko loturak gehitzen dituzunean, hitz batzuk dituen irudi bat agertuko zaizu, eta bertan ageri den testua idazteko eskatuko zaizu. Lan hori automatizatzeko zaila da, eta pertsonei ezer kostatzen ez zaigunez, spam testuak saihesteko lagungarria da. |
824 | 824 | |
825 | | -Zoritxarrez, ikusmen mugatua edo testu bidezko nabigatzaileak erabiltzen dituzten erabiltzeek arazoak izan ditzakete. Horrelako zerbait gertatzen bazaizu, mesedez, jarri [[{{MediaWiki:Grouppage-sysop}}|administratzaileekin]] harremanetan. |
| 825 | +Zoritxarrez, ikusmen mugatua edo testu bidezko nabigatzaileak erabiltzen dituzten erabiltzeek arazoak izan ditzakete. Horrelako zerbait gertatzen bazaizu, mesedez, jarri [[{{MediaWiki:Grouppage-sysop}}|administratzaileekin]] harremanetan. |
826 | 826 | |
827 | 827 | Zure nabigatzaileko 'atzera' lotura erabili aldaketen orrialdera itzultzeko.", |
828 | 828 | ); |
— | — | @@ -983,11 +983,11 @@ |
984 | 984 | 'captcha-createaccount-fail' => 'It antwurd op de som kloppet net.', |
985 | 985 | 'captcha-create' => 'Om de side oan te meitsjen wurdt jo frege it antwurd op de ûndersteande som te jaan ([[Special:Captcha/help|meer ynformaasje]]).', |
986 | 986 | 'captchahelp-title' => 'Lettertoets-help', |
987 | | - 'captchahelp-text' => "Websteeën dêr't it publyk op skriuwe kin, lykas dizze {{SITENAME}}-wiki, kinne lêst hawwe fan lju dy't automatysk keppelings oan de websiden tafoegje. Op dizze wiki kinne sokke feroarings maklik weromset wurde, mar dat nimt al tiid dy't ek oars brûkt wurde kin. |
| 987 | + 'captchahelp-text' => "Websteeën dêr't it publyk op skriuwe kin, lykas dizze {{SITENAME}}-wiki, kinne lêst hawwe fan lju dy't automatysk keppelings oan de websiden tafoegje. Op dizze wiki kinne sokke feroarings maklik weromset wurde, mar dat nimt al tiid dy't ek oars brûkt wurde kin. |
988 | 988 | |
989 | | -By it oanmelden as meidogger, en fierders benammen at jo keppelings om utens oan in side tafoegje, kinne jo fan de wiki in lettertoets krije. De wiki lit dan kleurde of ferwrongen letters sjen, en jo wurdt frege dy oer te tikken. Om't dit net maklik automatisearre wurde kin, hâldt dit it automatysk tafoegjen tsjin. It spitegernôch ek in lytse lêst foar de meidoggers. |
| 989 | +By it oanmelden as meidogger, en fierders benammen at jo keppelings om utens oan in side tafoegje, kinne jo fan de wiki in lettertoets krije. De wiki lit dan kleurde of ferwrongen letters sjen, en jo wurdt frege dy oer te tikken. Om't dit net maklik automatisearre wurde kin, hâldt dit it automatysk tafoegjen tsjin. It spitegernôch ek in lytse lêst foar de meidoggers. |
990 | 990 | |
991 | | -In probleem dêr't noch gjin oplossing foar is it dat it in tûkelteam is foar minsken dy't net goed sjen kinne of dy't in tekst-blêder of lûd-blêder brûke. Hjir soe in lûd-ferzje foar komme moatte, mar dy is der noch net. Oerlis mei in behearder at dit foar jo problemen jout. |
| 991 | +In probleem dêr't noch gjin oplossing foar is it dat it in tûkelteam is foar minsken dy't net goed sjen kinne of dy't in tekst-blêder of lûd-blêder brûke. Hjir soe in lûd-ferzje foar komme moatte, mar dy is der noch net. Oerlis mei in behearder at dit foar jo problemen jout. |
992 | 992 | |
993 | 993 | Gean tebek mei de tebek-knop fan jo blêder.", |
994 | 994 | ); |
— | — | @@ -1056,9 +1056,9 @@ |
1057 | 1057 | 'captcha-create' => 'Zum d Syten aalege lees die Rächenufgab un trag s Ergebnis in s Fäld unten yy. [[Special:Captcha/help|(Frogen oder Probläm?)]]', |
1058 | 1058 | 'captchahelp-title' => 'Captcha-Hilf', |
1059 | 1059 | 'captchahelp-cookies-needed' => "'''Wichtiger Hiiwyys:''' Im Browser mien Cookiers erlaubt syy.", |
1060 | | - 'captchahelp-text' => 'Internetaagebot, wu uf sin fir Byytreg vu jedem, wie z. B. des Wiki, wäre vyylmol vu Spammer missbruucht, wu ihri Gleicher automatisch uf vyylene Netzsyte platziere. Die Spam-Gleicher cha mer wider useneh, si stere aber zimli un nämme Arbetszyt in Aaspruch. |
| 1060 | + 'captchahelp-text' => 'Internetaagebot, wu uf sin fir Byytreg vu jedem, wie z. B. des Wiki, wäre vyylmol vu Spammer missbruucht, wu ihri Gleicher automatisch uf vyylene Netzsyte platziere. Die Spam-Gleicher cha mer wider useneh, si stere aber zimli un nämme Arbetszyt in Aaspruch. |
1061 | 1061 | |
1062 | | -In e Teil Fäll, v. a. wänn neiji Netzgleicher in e Syte dryygfiegt wäre, cha s syy, ass des Wiki derno ne Bild mit eme farbige un verzerrte Täxt aazeigt un dezue ufforderet, di aazeigte Werte yyzgee. Wel sonigi Ufgabe nit automatische chenne usgfiert wäre, cha mer eso di meischte Spammer, wu mit automatische Wärchzyyg schaffe, ufhalte, aber normali Benutzer chenne ihri Byytreg einewäg yygee. |
| 1062 | +In e Teil Fäll, v. a. wänn neiji Netzgleicher in e Syte dryygfiegt wäre, cha s syy, ass des Wiki derno ne Bild mit eme farbige un verzerrte Täxt aazeigt un dezue ufforderet, di aazeigte Werte yyzgee. Wel sonigi Ufgabe nit automatische chenne usgfiert wäre, cha mer eso di meischte Spammer, wu mit automatische Wärchzyyg schaffe, ufhalte, aber normali Benutzer chenne ihri Byytreg einewäg yygee. |
1063 | 1063 | |
1064 | 1064 | Leider cha des derzue fiere, ass Lyt Probläm iberchemme, wu ne yygschränkti Sähfähigkeit oder e Browser bruche, wu täxt- oder sprochbasiert isch. |
1065 | 1065 | Im Momänt hän mir kei Audioalternative z Verfiegig. |
— | — | @@ -1096,7 +1096,7 @@ |
1097 | 1097 | |
1098 | 1098 | લેખમા ફેરફાર કરવાના પાના ઉપર પાછા ફરવા માટે આપના બ્રાઉઝરના 'બેક' બટન ઉપર ક્લિક કરો.", |
1099 | 1099 | 'captcha-addurl-whitelist' => ' #<!-- આ લીટીને જેમ છે તેમ જ રહેવા દો --> <pre> |
1100 | | -# સીન્ટેક્સ (Syntax) આ પ્રમાણે છે : |
| 1100 | +# સીન્ટેક્સ (Syntax) આ પ્રમાણે છે : |
1101 | 1101 | # * "#" સંજ્ઞાથી શરૂ કરીને લીટીના અંત સુધીનું વર્ણન એક ટીપ્પણી છે |
1102 | 1102 | # * ખાલી ન હોય તેવી દરેક લીટી રેજેક્સનો ભાગ છે, જે ફક્ત URLsમાંના હોસ્ટ સાથે જ મેળ ખાશે |
1103 | 1103 | #</pre> <!-- આ લીટીને જેમ છે તેમ જ રહેવા દો -->', |
— | — | @@ -1190,7 +1190,7 @@ |
1191 | 1191 | Ponekad se dogodi da wiki prikaže sliku čudnog tekstualnog sadržaja uz koju morate unijeti prikazana slova. |
1192 | 1192 | Budući da je takvu radnju teško automatizirati, većina se napadača obeshrabri, a pravi suradnici bez većih smetnji nastavljaju pridonositi. |
1193 | 1193 | |
1194 | | -Na žalost, ovo može biti nepristupačno za suradnike koji koriste tekstualne klijene ili one glasovno bazirane. Trenutačno nemamo glasovnu podršku za ovo. |
| 1194 | +Na žalost, ovo može biti nepristupačno za suradnike koji koriste tekstualne klijene ili one glasovno bazirane. Trenutačno nemamo glasovnu podršku za ovo. |
1195 | 1195 | Molimo da se obratite administratorima, ukoliko vas ovo ometa pri dodavanju važećih sadržaja. |
1196 | 1196 | |
1197 | 1197 | Pritisnite u svom pregledniku 'nazad' kako bi se vratili na stranicu.", |
— | — | @@ -1693,7 +1693,7 @@ |
1694 | 1694 | |
1695 | 1695 | Heiandsdo, besonnesch wann nei Internet-Linkën op eng Säit derbäigesat ginn, weist dës Wiki iech e Bild mat farwegëm oder verzerrtëm Text a freet iech fir déi gewise Wierder anzetipppen. Well dëst eng Aufgab ass déi schwéier ze automatiséieren ass, erlaabt dëst dat Mënschen hir Ännerunge kënnen agi wärend déi meescht Spammer an aner Roboter-Attacken kënnen ofgewiert ginn. |
1696 | 1696 | |
1697 | | -Leider kann dëst zu Schwierigkeete féiere fir Persounen déi net esou gutt gesinn oder déi text-baséiert oder sprooch-baséiert Browser benotzen. |
| 1697 | +Leider kann dëst zu Schwierigkeete féiere fir Persounen déi net esou gutt gesinn oder déi text-baséiert oder sprooch-baséiert Browser benotzen. |
1698 | 1698 | Zu dësem Zäitpunkt hu mir leider keng audio-Alternativ zu eiser Verfügung. |
1699 | 1699 | Kontaktéiert w.e.g. [[{{MediaWiki:Grouppage-sysop}}|een Administrateur]] fir Hëllef wann dëst iech onerwarter Wäis vu legitimen Editen ofhält. |
1700 | 1700 | |
— | — | @@ -1808,7 +1808,7 @@ |
1809 | 1809 | हे काम संगणकाकरवी करून घेण्यास अवघड असल्याने, फक्त खरी माणसेच संपादने करू शकतील व स्पॅमर्सना आळा बसू शकेल. |
1810 | 1810 | |
1811 | 1811 | पण खेदाची गोष्ट अशी की ह्यामुळे अर्धांध व्यक्ती तसेच ज्या व्यक्ती फक्त मजकूर दाखविणारा न्याहाळक वापरतात, अशांना असुविधा होऊ शकते. |
1812 | | -सध्या आमच्याकडे आवाज ऐकण्याची सुविधा नाही. |
| 1812 | +सध्या आमच्याकडे आवाज ऐकण्याची सुविधा नाही. |
1813 | 1813 | कृपया विकिवरील प्रबंधकांशी या बाबतीत संपर्क करावा. |
1814 | 1814 | |
1815 | 1815 | पृष्ठ संपादनाकडे परत जाण्यासाठी आपल्या ब्राउझरची ’Back' ही कळ दाबा.", |
— | — | @@ -1913,11 +1913,11 @@ |
1914 | 1914 | 'captcha-badlogin' => "Los disse eenvoudige rekensomme op en voer 't antwoord in bie 't invoervienster in ter bescharming tegen 't autematisch kraken van wachwoorden ([[Special:Captcha/help|meer infermasie]]):", |
1915 | 1915 | 'captcha-createaccount' => "Voer ter bescharming tegen autematische ongewunste reclame 't antwoord op disse eenvoudige rekensomme in bie invoervienster ([[Special:Captcha/help|meer informatie]]):", |
1916 | 1916 | 'captcha-createaccount-fail' => 'Verkeerde of ontbrekende bevestigingscode.', |
1917 | | - 'captcha-create' => "Je bin een nieje pagina an 't maken. |
| 1917 | + 'captcha-create' => "Je bin een nieje pagina an 't maken. |
1918 | 1918 | Voer 't antwoord van disse eenvoudige rekensomme in bie 't invoervienster |
1919 | 1919 | ([[Special:Captcha/help|meer infermasie]]).", |
1920 | | - 'captcha-addurl-whitelist' => ' #<!-- laot disse regel zoas e is --> <pre> |
1921 | | -# De syntaxis is as volg: |
| 1920 | + 'captcha-addurl-whitelist' => ' #<!-- laot disse regel zoas e is --> <pre> |
| 1921 | +# De syntaxis is as volg: |
1922 | 1922 | # * Alle tekse vanof \'t kerakter "#" tot \'t einde van de regels wonnen ezien as opmarking |
1923 | 1923 | # * Alle regels dee neet leeg bin, wonnen ezien as een regeliere uutdrokking dee veur delen van de domein staon. |
1924 | 1924 | #</pre> <!-- laot disse regel zoas e is -->', |
— | — | @@ -1951,8 +1951,8 @@ |
1952 | 1952 | Vraag assistentie van de [[{{MediaWiki:Grouppage-sysop}}|sitebeheerders]] als dit proces u verhindert een nuttige bijdrage te leveren. |
1953 | 1953 | |
1954 | 1954 | Klik op de knop 'terug' in uw browser om terug te gaan naar het tekstbewerkingsscherm.", |
1955 | | - 'captcha-addurl-whitelist' => ' #<!-- laat deze regel zoals hij is --> <pre> |
1956 | | -# De syntaxis is als volgt: |
| 1955 | + 'captcha-addurl-whitelist' => ' #<!-- laat deze regel zoals hij is --> <pre> |
| 1956 | +# De syntaxis is als volgt: |
1957 | 1957 | # * Alle tekst vanaf het karakter "#" tot het einde van de regels wordt gezien als opmerking |
1958 | 1958 | # * Iedere niet-lege regel is een fragment van een reguliere uitdrukking die alleen van toepassing is op hosts binnen URL\'s |
1959 | 1959 | #</pre> <!-- laat deze regel zoals hij is -->', |
— | — | @@ -2108,7 +2108,7 @@ |
2109 | 2109 | * @author Bèrto 'd Sèra |
2110 | 2110 | */ |
2111 | 2111 | $messages['pms'] = array( |
2112 | | - 'captcha-edit' => "Për fe-ie dle modìfiche ansima a st'artìcol-sì, për piasì ch'a fasa ël total ambelessì sota |
| 2112 | + 'captcha-edit' => "Për fe-ie dle modìfiche ansima a st'artìcol-sì, për piasì ch'a fasa ël total ambelessì sota |
2113 | 2113 | e ch'a buta l'arzulta ant ël quadrèt ([[Special:Captcha/help|për savejne dë pì]]):", |
2114 | 2114 | 'captcha-addurl' => "Soa modìfica a la gionta dj'anliure esterne. Për giutene a vardesse da la reclam aotomatisà, për piasì ch'a fasa ël total ambelessì sota e ch'a buta l'arzultà ant ël quadrèt ([[Special:Captcha/help|për savejne dë pì]]):", |
2115 | 2115 | 'captcha-badlogin' => "Për giutene a vardesse da 'nt ij programa ch'a fan ciav fàosse n'aotomàtich, për piasì ch'a fasa ël total ambelessì sota e ch'a buta l'arzultà ant ël quadrèt ([[Special:Captcha/help|për savejne dë pì]]):", |
— | — | @@ -2189,13 +2189,13 @@ |
2190 | 2190 | 'captcha-create' => 'Para criar a página, por favor resolva a simples soma abaixo e entre com a resposta no respectivo campo ([[Special:Captcha/help|o que é isto?]])', |
2191 | 2191 | 'captchahelp-title' => 'Ajuda com o Captcha', |
2192 | 2192 | 'captchahelp-cookies-needed' => 'Você precisa ter cookies habilitados em seu navegador para que possa funcionar', |
2193 | | - 'captchahelp-text' => "Sítios abertos a inserções públicas, como é o caso deste wiki, são vulneráveis a abusos por spammers que utilizam ferramentas automatizadas para inserir seus links em diversos locais. |
| 2193 | + 'captchahelp-text' => "Sítios abertos a inserções públicas, como é o caso deste wiki, são vulneráveis a abusos por spammers que utilizam ferramentas automatizadas para inserir seus links em diversos locais. |
2194 | 2194 | Apesar de remover tais links posteriormente ser possível, eles são um significativo incômodo. |
2195 | 2195 | |
2196 | | -Algumas vezes, especialmente ao adicionar novos links externos em uma página, o sistema exibirá uma imagem com uma imagem de um texto colorido ou distorcido e pedirá que você digite as palavras exibidas. |
| 2196 | +Algumas vezes, especialmente ao adicionar novos links externos em uma página, o sistema exibirá uma imagem com uma imagem de um texto colorido ou distorcido e pedirá que você digite as palavras exibidas. |
2197 | 2197 | Uma vez que essa é uma tarefa um tanto difícil de ser automatizada, ela possibilita que vários humanos façam as suas inserções ao mesmo tempo que inibe as que forem feitas por spammers e mecanismos automatizados. |
2198 | 2198 | |
2199 | | -Infelizmente, isso pode ser dificultoso a utilizadores com limitações visuais ou que naveguem através de mecanismos baseados em texto ou baseados em voz. No momento não há uma alternativa em áudio. |
| 2199 | +Infelizmente, isso pode ser dificultoso a utilizadores com limitações visuais ou que naveguem através de mecanismos baseados em texto ou baseados em voz. No momento não há uma alternativa em áudio. |
2200 | 2200 | Por gentileza, contacte os administradores do sítio em casos que seja necessária a assistência de alguém para que você possa fazer as suas inserções legítimas. |
2201 | 2201 | |
2202 | 2202 | Pressione o botão 'voltar' de seu navegador para retornar à página de edição.", |
— | — | @@ -2234,7 +2234,7 @@ |
2235 | 2235 | |
2236 | 2236 | Uneori, mai ales la adăugarea de legături web noi într-o pagină, situl wiki vă poate arăta o imagine cu un text colorat sau distorsionat şi veţi fi rugat să introduceţi cuvintele indicate. Deoarece aceasta este o sarcină greu de automatizat, ea permite majorităţii persoanelor reale să posteze şi va opri majoritatea atacatorilor. |
2237 | 2237 | |
2238 | | -Din nefericire, această metodă îi poate deranja pe utilizatorii cu probleme vizuale sau care folosesc browsere bazate pe text sau sunet. În acest moment nu avem o alternativă audio disponibilă. |
| 2238 | +Din nefericire, această metodă îi poate deranja pe utilizatorii cu probleme vizuale sau care folosesc browsere bazate pe text sau sunet. În acest moment nu avem o alternativă audio disponibilă. |
2239 | 2239 | Vă rugăm, contactaţi [[{{MediaWiki:Grouppage-sysop}}|administratorii sitului]] pentru asistenţă dacă metoda vă opreşte de la a face postări legitime. |
2240 | 2240 | |
2241 | 2241 | Apasă butonul 'Înapoi' al browserului pentru a te reîntoarce la pagina de editare.", |
— | — | @@ -2259,14 +2259,14 @@ |
2260 | 2260 | 'captcha-create' => 'Чтобы создать страницу, решите простой пример и введите ответ в текстовое поле ([[Special:Captcha/help|что это?]]):', |
2261 | 2261 | 'captchahelp-title' => 'Справка о CAPTCHA', |
2262 | 2262 | 'captchahelp-cookies-needed' => 'Вам нужно включить куки в браузере, чтобы эта функция заработала.', |
2263 | | - 'captchahelp-text' => 'Веб-сайты, позволяющие добавлять и изменять своё содержимое, в том числе эта вики, часто становятся целью спамеров, использующих программы для автоматического добавления ссылок на многие сайты. |
| 2263 | + 'captchahelp-text' => 'Веб-сайты, позволяющие добавлять и изменять своё содержимое, в том числе эта вики, часто становятся целью спамеров, использующих программы для автоматического добавления ссылок на многие сайты. |
2264 | 2264 | Хотя такие ссылки могут быть впоследствии удалены, они являются существенной помехой. |
2265 | 2265 | |
2266 | | -При некоторых действиях — например, при добавлении на страницу новой веб-ссылки — вы можете увидеть специальную картинку с цветным или искажённым текстом, и вам будет предложено ввести этот искажённый текст. |
| 2266 | +При некоторых действиях — например, при добавлении на страницу новой веб-ссылки — вы можете увидеть специальную картинку с цветным или искажённым текстом, и вам будет предложено ввести этот искажённый текст. |
2267 | 2267 | Так как распознавание искажённого текста является сложной задачей для программ, то большинство спамерских и вандальных программ не могут с ней справиться, в то время как люди справляются легко. |
2268 | 2268 | |
2269 | | -К сожалению, подобная защита может причинить неудобства людям с ограничениями по зрению или тем, кто использует текстовые или читающие браузеры. |
2270 | | -В настоящее время у нас нет звуковой альтернативы данной проверке. |
| 2269 | +К сожалению, подобная защита может причинить неудобства людям с ограничениями по зрению или тем, кто использует текстовые или читающие браузеры. |
| 2270 | +В настоящее время у нас нет звуковой альтернативы данной проверке. |
2271 | 2271 | Пожалуйста, обратитесь за помощью к [[{{MediaWiki:Grouppage-sysop}}|администраторам]], если подобная проверка мешает вам добросовестно работать с сайтом. |
2272 | 2272 | |
2273 | 2273 | Нажмите кнопку «Назад» в вашем браузере, чтобы вернуться к редактированию.', |
— | — | @@ -2591,7 +2591,7 @@ |
2592 | 2592 | కొన్నిసార్లు, ముఖ్యంగా ఏదైనా పేజీ నుండి బయటకు లింకులు ఇచ్చేటపుడు, వంకర్లు తిరిగిపోయి ఉన్న పదాల బొమ్మను చూపించి ఆ పదాన్ని టైపు చెయ్యమని వికీ మిమ్మల్ని అడగవచ్చు. దీన్ని ఆటోమాటిక్ టూల్సుతో చెయ్యడం చాలా కష్టం కాబట్టి, స్పాము జిత్తులు చెల్లవు; మనుష్యులు మాత్రం మామూలుగానే చెయ్యగలరు. |
2593 | 2593 | |
2594 | 2594 | దురదృష్టవశాత్తూ, చూపు సరిగా లేనివారికి, టెక్స్టు బ్రౌజర్లు మాత్రమే వాడేవారికి ఇది అసౌకర్యం కలిగిస్తుంది. ప్రస్తుతానికి శబ్దం వినిపించే వెసులుబాటు మాకు లేదు. మీరు రచనలు చెయ్యకుండా ఇది అడ్డుపడుతుంటే, సహాయం కోసం సైటు నిర్వాహకుణ్ణి సంప్రదించండి. |
2595 | | -మీరు చెసే విలువయిన, సమ్మతమయిన వ్యాస మార్పులు భద్రపరచటము కుదరకపొతె, దయచేసి [[{{MediaWiki:Grouppage-sysop}}|సైటు నిర్వహణాధికారి]]కి లేఖ రాయండి |
| 2595 | +మీరు చెసే విలువయిన, సమ్మతమయిన వ్యాస మార్పులు భద్రపరచటము కుదరకపొతె, దయచేసి [[{{MediaWiki:Grouppage-sysop}}|సైటు నిర్వహణాధికారి]]కి లేఖ రాయండి |
2596 | 2596 | మీ బ్రౌజర్లోని బ్యాక్(back) మీటను నొక్కి ఇంతకు ముందరి పేజీకి వెళ్ళండి.', |
2597 | 2597 | 'captcha-addurl-whitelist' => ' #<!-- ఈ వాఖ్యాన్ని మొత్తం ఉన్నదున్నట్లు ఇలాగే వదిలేయండి --> <pre> |
2598 | 2598 | # ఇక్కడ రాయాల్సిన విధానం ఇదీ: |
— | — | @@ -2618,7 +2618,7 @@ |
2619 | 2619 | |
2620 | 2620 | Дар пораи аз маворид, ба вижа замоне, ки як пайванди интернетии ҷадид ба саҳифа изофа мешавад, вики метавонад, як тасвир аз ҳуруфи рангӣ ё матни бенурро ба шумо нишон бидиҳад ва аз шумо ворид кардани калимаи нишондодашударо пурсон мешавад. Ба хотири ин ки анҷоми ин кор ба шакли худкор душвор аст, ин амал ба аксари инсонҳое иҷозат медиҳад, ки ба ирсоли матолиб бипардозанд, дар ҳоле ки бештар роботҳои ҳамлакунанда ва ҳаразнигорҳоро мутавақиф мекунад. |
2621 | 2621 | |
2622 | | -Мутассифона ин равиш мумкин аст, корбароне, ки қувваи босираашон суст ё аз мурургарҳои матнӣ ё овозӣ истифода мекунанд, дучори маҳдудиятҳое бикунад. Дар ҳоли ҳозир ҳеҷ чойгузини савтӣ барои ин равиш мавҷуд нест. Чунончи ин масъала шуморо дучори маҳдудияте дур аз интизор дар ирсоли навиштаҳои миҷоз мекунад, бо мудирони сомона оиди кӯмак тамос бигиред. |
| 2622 | +Мутассифона ин равиш мумкин аст, корбароне, ки қувваи босираашон суст ё аз мурургарҳои матнӣ ё овозӣ истифода мекунанд, дучори маҳдудиятҳое бикунад. Дар ҳоли ҳозир ҳеҷ чойгузини савтӣ барои ин равиш мавҷуд нест. Чунончи ин масъала шуморо дучори маҳдудияте дур аз интизор дар ирсоли навиштаҳои миҷоз мекунад, бо мудирони сомона оиди кӯмак тамос бигиред. |
2623 | 2623 | |
2624 | 2624 | Дар муругаратон тугмаи 'бозгашт'-ро бо пахш кардан ба саҳифаи вироишгар баргардед.", |
2625 | 2625 | 'captcha-addurl-whitelist' => ' #<!—ин сатрро ҳамон гуна, ки ҳаст раҳо кунед --> <pre> |
— | — | @@ -2788,7 +2788,7 @@ |
2789 | 2789 | 'captchahelp-text' => 'Những website cho phép bất kỳ ai cũng có thể gửi thông tin, như wiki này, thường bị các tay spam dùng công cụ tự động để gửi các liên kết của họ tới rất nhiều trang. |
2790 | 2790 | Tuy chúng ta có thể xóa các liên kết này khỏi trang, chúng vẫn gây nhiều phiền toái. |
2791 | 2791 | |
2792 | | -Đôi khi, nhất là khi bạn bổ sung liên kết mới vào trang, wiki có thể hiển thị một hình có chữ dạng màu mè và méo mó rồi yêu cầu bạn gõ lại các chữ trong hình này. |
| 2792 | +Đôi khi, nhất là khi bạn bổ sung liên kết mới vào trang, wiki có thể hiển thị một hình có chữ dạng màu mè và méo mó rồi yêu cầu bạn gõ lại các chữ trong hình này. |
2793 | 2793 | Do các phần mềm tự động khó đọc những hình này, nên mọi người bình thường có thể tiếp tục gửi thông tin, mà vẫn chặn được các spam và robot phá hoại. |
2794 | 2794 | |
2795 | 2795 | Tuy vậy, tính năng này có thể bất tiện đối với những độc giả có thị giác yếu hay đang sử dụng trình duyệt bằng văn bản thuần hay trình duyệt bằng tiếng nói. |
Index: trunk/extensions/ConfirmEdit/MathCaptcha.class.php |
— | — | @@ -7,26 +7,26 @@ |
8 | 8 | return (int)$answer == (int)$info['answer']; |
9 | 9 | } |
10 | 10 | |
11 | | - function addCaptchaAPI(&$resultArr) { |
| 11 | + function addCaptchaAPI( &$resultArr ) { |
12 | 12 | list( $sum, $answer ) = $this->pickSum(); |
13 | | - $index = $this->storeCaptcha( array('answer' => $answer ) ); |
| 13 | + $index = $this->storeCaptcha( array( 'answer' => $answer ) ); |
14 | 14 | $resultArr['captcha']['type'] = 'math'; |
15 | 15 | $resultArr['captcha']['mime'] = 'text/tex'; |
16 | 16 | $resultArr['captcha']['id'] = $index; |
17 | 17 | $resultArr['captcha']['question'] = $sum; |
18 | 18 | } |
19 | | - |
| 19 | + |
20 | 20 | /** Produce a nice little form */ |
21 | 21 | function getForm() { |
22 | 22 | list( $sum, $answer ) = $this->pickSum(); |
23 | 23 | $index = $this->storeCaptcha( array( 'answer' => $answer ) ); |
24 | | - |
| 24 | + |
25 | 25 | $form = '<table><tr><td>' . $this->fetchMath( $sum ) . '</td>'; |
26 | 26 | $form .= '<td>' . Xml::input( 'wpCaptchaWord', false, false, array( 'tabindex' => '1' ) ) . '</td></tr></table>'; |
27 | 27 | $form .= Xml::hidden( 'wpCaptchaId', $index ); |
28 | 28 | return $form; |
29 | 29 | } |
30 | | - |
| 30 | + |
31 | 31 | /** Pick a random sum */ |
32 | 32 | function pickSum() { |
33 | 33 | $a = mt_rand( 0, 100 ); |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | $ans = $op == '+' ? ( $a + $b ) : ( $a - $b ); |
38 | 38 | return array( $sum, $ans ); |
39 | 39 | } |
40 | | - |
| 40 | + |
41 | 41 | /** Fetch the math */ |
42 | 42 | function fetchMath( $sum ) { |
43 | 43 | $math = new MathRenderer( $sum ); |
— | — | @@ -44,6 +44,4 @@ |
45 | 45 | $html = $math->render(); |
46 | 46 | return preg_replace( '/alt=".*?"/', '', $html ); |
47 | 47 | } |
48 | | - |
49 | 48 | } |
50 | | -?> |
Index: trunk/extensions/ConfirmEdit/FancyCaptcha.i18n.php |
— | — | @@ -536,7 +536,7 @@ |
537 | 537 | * @author Atabek |
538 | 538 | */ |
539 | 539 | $messages['kaa'] = array( |
540 | | - 'fancycaptcha-createaccount' => "Jan'a akkauntlardın' avtomatik jaratılıwının' aldın alıw ushın, to'mendegi |
| 540 | + 'fancycaptcha-createaccount' => "Jan'a akkauntlardın' avtomatik jaratılıwının' aldın alıw ushın, to'mendegi |
541 | 541 | ko'rsetilgen so'zlerdi kiritin'([[{{ns:special}}:Captcha/help|ko'birek mag'lıwmat]]):", |
542 | 542 | ); |
543 | 543 | |
Index: trunk/extensions/ConfirmEdit/QuestyCaptcha.class.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | return strtolower( $answer ) == strtolower( $info['answer'] ); |
16 | 16 | } |
17 | 17 | |
18 | | - function addCaptchaAPI(&$resultArr) { |
| 18 | + function addCaptchaAPI( &$resultArr ) { |
19 | 19 | $captcha = $this->getCaptcha(); |
20 | 20 | $index = $this->storeCaptcha( $captcha ); |
21 | 21 | $resultArr['captcha']['type'] = 'question'; |
— | — | @@ -22,15 +22,15 @@ |
23 | 23 | $resultArr['captcha']['id'] = $index; |
24 | 24 | $resultArr['captcha']['question'] = $captcha['question']; |
25 | 25 | } |
26 | | - |
| 26 | + |
27 | 27 | function getCaptcha() { |
28 | 28 | global $wgCaptchaQuestions; |
29 | | - return $wgCaptchaQuestions[mt_rand( 0, count( $wgCaptchaQuestions )-1 )]; //pick a question, any question |
| 29 | + return $wgCaptchaQuestions[mt_rand( 0, count( $wgCaptchaQuestions ) - 1 )]; // pick a question, any question |
30 | 30 | } |
31 | | - |
| 31 | + |
32 | 32 | function getForm() { |
33 | 33 | $captcha = $this->getCaptcha(); |
34 | | - if(!$captcha) { |
| 34 | + if ( !$captcha ) { |
35 | 35 | die( "No questions found; set some in LocalSettings.php using the format from QuestyCaptcha.php." ); |
36 | 36 | } |
37 | 37 | $index = $this->storeCaptcha( $captcha ); |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | 'id' => 'wpCaptchaId', |
48 | 48 | 'value' => $index ) ); |
49 | 49 | } |
50 | | - |
| 50 | + |
51 | 51 | function getMessage( $action ) { |
52 | 52 | $name = 'questycaptcha-' . $action; |
53 | 53 | $text = wfMsg( $name ); |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | # the default for edits |
56 | 56 | return wfEmptyMsg( $name, $text ) ? wfMsg( 'questycaptcha-edit' ) : $text; |
57 | 57 | } |
58 | | - |
| 58 | + |
59 | 59 | function showHelp() { |
60 | 60 | global $wgOut, $ceAllowConfirmedEmail; |
61 | 61 | $wgOut->setPageTitle( wfMsg( 'captchahelp-title' ) ); |
— | — | @@ -63,5 +63,4 @@ |
64 | 64 | $wgOut->addWikiText( wfMsg( 'captchahelp-cookies-needed' ) ); |
65 | 65 | } |
66 | 66 | } |
67 | | - |
68 | | -} |
\ No newline at end of file |
| 67 | +} |
Property changes on: trunk/extensions/ConfirmEdit/QuestyCaptcha.class.php |
___________________________________________________________________ |
Name: svn:executable |
69 | 68 | - * |
Index: trunk/extensions/ConfirmEdit/ConfirmEdit.php |
— | — | @@ -95,7 +95,7 @@ |
96 | 96 | |
97 | 97 | /** |
98 | 98 | * You may wish to apply special rules for captcha triggering on some namespaces. |
99 | | - * $wgCaptchaTriggersOnNamespace[<namespace id>][<trigger>] forces an always on / |
| 99 | + * $wgCaptchaTriggersOnNamespace[<namespace id>][<trigger>] forces an always on / |
100 | 100 | * always off configuration with that trigger for the given namespace. |
101 | 101 | * Leave unset to use the global options ($wgCaptchaTriggers). |
102 | 102 | * |
— | — | @@ -103,9 +103,9 @@ |
104 | 104 | */ |
105 | 105 | $wgCaptchaTriggersOnNamespace = array(); |
106 | 106 | |
107 | | -#Example: |
108 | | -#$wgCaptchaTriggersOnNamespace[NS_TALK]['create'] = false; //Allow creation of talk pages without captchas. |
109 | | -#$wgCaptchaTriggersOnNamespace[NS_PROJECT]['edit'] = true; //Show captcha whenever editing Project pages. |
| 107 | +# Example: |
| 108 | +# $wgCaptchaTriggersOnNamespace[NS_TALK]['create'] = false; //Allow creation of talk pages without captchas. |
| 109 | +# $wgCaptchaTriggersOnNamespace[NS_PROJECT]['edit'] = true; //Show captcha whenever editing Project pages. |
110 | 110 | |
111 | 111 | /** |
112 | 112 | * Indicate how to store per-session data required to match up the |
— | — | @@ -148,7 +148,7 @@ |
149 | 149 | global $ceAllowConfirmedEmail; |
150 | 150 | $ceAllowConfirmedEmail = false; |
151 | 151 | |
152 | | -/** |
| 152 | +/** |
153 | 153 | * Number of bad login attempts before triggering the captcha. 0 means the |
154 | 154 | * captcha is presented on the first login. |
155 | 155 | */ |
— | — | @@ -194,8 +194,8 @@ |
195 | 195 | # Register API hook |
196 | 196 | $wgHooks['APIEditBeforeSave'][] = 'ConfirmEditHooks::confirmEditAPI'; |
197 | 197 | |
198 | | -$wgAutoloadClasses['ConfirmEditHooks'] |
199 | | - = $wgAutoloadClasses['SimpleCaptcha'] |
| 198 | +$wgAutoloadClasses['ConfirmEditHooks'] |
| 199 | + = $wgAutoloadClasses['SimpleCaptcha'] |
200 | 200 | = $wgAutoloadClasses['CaptchaSessionStore'] |
201 | 201 | = $wgAutoloadClasses['CaptchaCacheStore'] |
202 | 202 | = $wgAutoloadClasses['CaptchaSpecialPage'] |
— | — | @@ -206,7 +206,7 @@ |
207 | 207 | */ |
208 | 208 | function confirmEditSetup() { |
209 | 209 | global $wgGroupPermissions, $wgCaptchaTriggers; |
210 | | - if( !$wgGroupPermissions['*']['read'] && $wgCaptchaTriggers['badlogin'] ) { |
| 210 | + if ( !$wgGroupPermissions['*']['read'] && $wgCaptchaTriggers['badlogin'] ) { |
211 | 211 | // We need to ensure that the captcha interface is accessible |
212 | 212 | // so that unauthenticated users can actually get in after a |
213 | 213 | // mistaken password typing. |
— | — | @@ -217,5 +217,3 @@ |
218 | 218 | $wgWhitelistRead[] = $help->getPrefixedText(); |
219 | 219 | } |
220 | 220 | } |
221 | | - |
222 | | - |
Index: trunk/extensions/ConfirmEdit/FancyCaptcha.php |
— | — | @@ -37,6 +37,5 @@ |
38 | 38 | global $wgCaptchaSecret; |
39 | 39 | $wgCaptchaSecret = "CHANGE_THIS_SECRET!"; |
40 | 40 | |
41 | | -$wgExtensionMessagesFiles['FancyCaptcha'] = dirname(__FILE__).'/FancyCaptcha.i18n.php'; |
| 41 | +$wgExtensionMessagesFiles['FancyCaptcha'] = dirname( __FILE__ ) . '/FancyCaptcha.i18n.php'; |
42 | 42 | $wgAutoloadClasses['FancyCaptcha'] = dirname( __FILE__ ) . '/FancyCaptcha.class.php'; |
43 | | - |
Index: trunk/extensions/ConfirmEdit/MathCaptcha |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | require_once( 'extensions/ConfirmEdit.php' ); |
41 | 41 | require_once( 'extensions/MathCaptcha.php' ); |
42 | 42 | $wgCaptchaClass = 'MathCaptcha'; |
43 | | - |
| 43 | + |
44 | 44 | This installs ConfirmEdit and instructs it to use the MathCaptcha plugin. |
45 | 45 | The default settings for ConfirmEdit are used. At this point, no further |
46 | 46 | action is required to have the plugin work for user registration or edits |
— | — | @@ -73,4 +73,4 @@ |
74 | 74 | i. http://en.wikipedia.org/wiki/Captcha |
75 | 75 | ii. http://meta.wikimedia.org/wiki/ConfirmEdit |
76 | 76 | iii. http://meta.wikimedia.org/wiki/Enable_TeX |
77 | | -iv. http://www.mediawiki.org/wiki/Subversion |
\ No newline at end of file |
| 77 | +iv. http://www.mediawiki.org/wiki/Subversion |
Index: trunk/extensions/ConfirmEdit/FancyCaptcha.class.php |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | $digest = $wgCaptchaSecret . $info['salt'] . $answer . $wgCaptchaSecret . $info['salt']; |
17 | 17 | $answerHash = substr( md5( $digest ), 0, 16 ); |
18 | 18 | |
19 | | - if( $answerHash == $info['hash'] ) { |
| 19 | + if ( $answerHash == $info['hash'] ) { |
20 | 20 | wfDebug( "FancyCaptcha: answer hash matches expected {$info['hash']}\n" ); |
21 | 21 | return true; |
22 | 22 | } else { |
— | — | @@ -24,9 +24,9 @@ |
25 | 25 | } |
26 | 26 | } |
27 | 27 | |
28 | | - function addCaptchaAPI(&$resultArr) { |
| 28 | + function addCaptchaAPI( &$resultArr ) { |
29 | 29 | $info = $this->pickImage(); |
30 | | - if( !$info ) { |
| 30 | + if ( !$info ) { |
31 | 31 | $resultArr['captcha']['error'] = 'Out of images'; |
32 | 32 | return; |
33 | 33 | } |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | $resultArr['captcha']['type'] = 'image'; |
37 | 37 | $resultArr['captcha']['mime'] = 'image/png'; |
38 | 38 | $resultArr['captcha']['id'] = $index; |
39 | | - $resultArr['captcha']['url'] = $title->getLocalUrl( 'wpCaptchaId=' . urlencode( $index ) ); |
| 39 | + $resultArr['captcha']['url'] = $title->getLocalUrl( 'wpCaptchaId=' . urlencode( $index ) ); |
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | */ |
45 | 45 | function getForm() { |
46 | 46 | $info = $this->pickImage(); |
47 | | - if( !$info ) { |
| 47 | + if ( !$info ) { |
48 | 48 | die( "out of captcha images; this shouldn't happen" ); |
49 | 49 | } |
50 | 50 | |
— | — | @@ -87,27 +87,27 @@ |
88 | 88 | $wgCaptchaDirectory, |
89 | 89 | $wgCaptchaDirectoryLevels ); |
90 | 90 | } |
91 | | - |
| 91 | + |
92 | 92 | function pickImageDir( $directory, $levels ) { |
93 | | - if( $levels ) { |
| 93 | + if ( $levels ) { |
94 | 94 | $dirs = array(); |
95 | | - |
| 95 | + |
96 | 96 | // Check which subdirs are actually present... |
97 | 97 | $dir = opendir( $directory ); |
98 | | - while( false !== ($entry = readdir( $dir ) ) ) { |
99 | | - if( ctype_xdigit( $entry ) && strlen( $entry ) == 1 ) { |
| 98 | + while ( false !== ( $entry = readdir( $dir ) ) ) { |
| 99 | + if ( ctype_xdigit( $entry ) && strlen( $entry ) == 1 ) { |
100 | 100 | $dirs[] = $entry; |
101 | 101 | } |
102 | 102 | } |
103 | 103 | closedir( $dir ); |
104 | | - |
| 104 | + |
105 | 105 | $place = mt_rand( 0, count( $dirs ) - 1 ); |
106 | 106 | // In case all dirs are not filled, |
107 | 107 | // cycle through next digits... |
108 | | - for( $j = 0; $j < count( $dirs ); $j++ ) { |
109 | | - $char = $dirs[($place + $j) % count( $dirs )]; |
| 108 | + for ( $j = 0; $j < count( $dirs ); $j++ ) { |
| 109 | + $char = $dirs[( $place + $j ) % count( $dirs )]; |
110 | 110 | $return = $this->pickImageDir( "$directory/$char", $levels - 1 ); |
111 | | - if( $return ) { |
| 111 | + if ( $return ) { |
112 | 112 | return $return; |
113 | 113 | } |
114 | 114 | } |
— | — | @@ -117,9 +117,9 @@ |
118 | 118 | return $this->pickImageFromDir( $directory ); |
119 | 119 | } |
120 | 120 | } |
121 | | - |
| 121 | + |
122 | 122 | function pickImageFromDir( $directory ) { |
123 | | - if( !is_dir( $directory ) ) { |
| 123 | + if ( !is_dir( $directory ) ) { |
124 | 124 | return false; |
125 | 125 | } |
126 | 126 | $n = mt_rand( 0, $this->countFiles( $directory ) - 1 ); |
— | — | @@ -129,9 +129,9 @@ |
130 | 130 | |
131 | 131 | $entry = readdir( $dir ); |
132 | 132 | $pick = false; |
133 | | - while( false !== $entry ) { |
| 133 | + while ( false !== $entry ) { |
134 | 134 | $entry = readdir( $dir ); |
135 | | - if( preg_match( '/^image_([0-9a-f]+)_([0-9a-f]+)\\.png$/', $entry, $matches ) ) { |
| 135 | + if ( preg_match( '/^image_([0-9a-f]+)_([0-9a-f]+)\\.png$/', $entry, $matches ) ) { |
136 | 136 | $size = getimagesize( "$directory/$entry" ); |
137 | 137 | $pick = array( |
138 | 138 | 'salt' => $matches[1], |
— | — | @@ -140,7 +140,7 @@ |
141 | 141 | 'height' => $size[1], |
142 | 142 | 'viewed' => false, |
143 | 143 | ); |
144 | | - if( $count++ == $n ) { |
| 144 | + if ( $count++ == $n ) { |
145 | 145 | break; |
146 | 146 | } |
147 | 147 | } |
— | — | @@ -156,8 +156,8 @@ |
157 | 157 | function countFiles( $dirname ) { |
158 | 158 | $dir = opendir( $dirname ); |
159 | 159 | $count = 0; |
160 | | - while( false !== ($entry = readdir( $dir ) ) ) { |
161 | | - if( $entry != '.' && $entry != '..' ) { |
| 160 | + while ( false !== ( $entry = readdir( $dir ) ) ) { |
| 161 | + if ( $entry != '.' && $entry != '..' ) { |
162 | 162 | $count++; |
163 | 163 | } |
164 | 164 | } |
— | — | @@ -171,7 +171,7 @@ |
172 | 172 | $wgOut->disable(); |
173 | 173 | |
174 | 174 | $info = $this->retrieveCaptcha(); |
175 | | - if( $info ) { |
| 175 | + if ( $info ) { |
176 | 176 | /* |
177 | 177 | // Be a little less restrictive for now; in at least some circumstances, |
178 | 178 | // Konqueror tries to reload the image even if you haven't navigated |
— | — | @@ -189,7 +189,7 @@ |
190 | 190 | $hash = $info['hash']; |
191 | 191 | $file = $this->imagePath( $salt, $hash ); |
192 | 192 | |
193 | | - if( file_exists( $file ) ) { |
| 193 | + if ( file_exists( $file ) ) { |
194 | 194 | global $IP; |
195 | 195 | require_once "$IP/includes/StreamFile.php"; |
196 | 196 | header( "Cache-Control: private, s-maxage=0, max-age=3600" ); |
— | — | @@ -200,13 +200,13 @@ |
201 | 201 | wfHttpError( 500, 'Internal Error', 'Requested bogus captcha image' ); |
202 | 202 | return false; |
203 | 203 | } |
204 | | - |
| 204 | + |
205 | 205 | function imagePath( $salt, $hash ) { |
206 | 206 | global $wgCaptchaDirectory, $wgCaptchaDirectoryLevels; |
207 | 207 | $file = $wgCaptchaDirectory; |
208 | 208 | $file .= DIRECTORY_SEPARATOR; |
209 | | - for( $i = 0; $i < $wgCaptchaDirectoryLevels; $i++ ) { |
210 | | - $file .= $hash{$i}; |
| 209 | + for ( $i = 0; $i < $wgCaptchaDirectoryLevels; $i++ ) { |
| 210 | + $file .= $hash { $i } ; |
211 | 211 | $file .= DIRECTORY_SEPARATOR; |
212 | 212 | } |
213 | 213 | $file .= "image_{$salt}_{$hash}.png"; |
— | — | @@ -227,5 +227,4 @@ |
228 | 228 | # the default for edits |
229 | 229 | return wfEmptyMsg( $name, $text ) ? wfMsg( 'fancycaptcha-edit' ) : $text; |
230 | 230 | } |
231 | | - |
232 | 231 | } |
Index: trunk/extensions/Translate/groups/mediawiki-defines.txt |
— | — | @@ -191,6 +191,11 @@ |
192 | 192 | descmsg = fancycaptcha-desc |
193 | 193 | optional = fancycaptcha-desc |
194 | 194 | |
| 195 | +ConfirmEdit Questy Captcha |
| 196 | +file = ConfirmEdit/QuestyCaptcha.i18n.php |
| 197 | +descmsg = questycaptcha-desc |
| 198 | +optional = questycaptcha-desc |
| 199 | + |
195 | 200 | Contact Page |
196 | 201 | |
197 | 202 | Contribution Reporting |