From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:31:03 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:31:03 +0900
Subject: [Slashdotjp-dev 321] CVS update: slashjp/Slash/Client
Message-ID: <20060712113103.12DBC2AC08C@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:31:03 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:31:03 +0900
Subject: [Slashdotjp-dev 322] CVS update: slashjp/Slash/XML/Atom
Message-ID: <20060712113103.C913A2AC08C@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:31:02 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:31:02 +0900
Subject: [Slashdotjp-dev 322] CVS update: slashjp/tagboxes
Message-ID: <20060712113102.4B94E2AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:31:07 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:31:07 +0900
Subject: [Slashdotjp-dev 322] CVS update: slashjp/plugins/Ajax
Message-ID: <20060712113107.9BF732AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:31:08 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:31:08 +0900
Subject: [Slashdotjp-dev 323] CVS update: slashjp/plugins/BlockProxyNet
Message-ID: <20060712113108.5AC132AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:31:09 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:31:09 +0900
Subject: [Slashdotjp-dev 324] CVS update: slashjp/plugins/Bookmark
Message-ID: <20060712113109.1C5962AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:31:09 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:31:09 +0900
Subject: [Slashdotjp-dev 325] CVS update: slashjp/plugins/Console
Message-ID: <20060712113109.D61A62AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:31:10 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:31:10 +0900
Subject: [Slashdotjp-dev 326] CVS update: slashjp/plugins/Daypass
Message-ID: <20060712113110.AD9542AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:31:11 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:31:11 +0900
Subject: [Slashdotjp-dev 327] CVS update: slashjp/plugins/OAI
Message-ID: <20060712113111.6A87D2AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:31:12 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:31:12 +0900
Subject: [Slashdotjp-dev 328] CVS update: slashjp/plugins/Remarks
Message-ID: <20060712113112.29C362AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:31:13 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:31:13 +0900
Subject: [Slashdotjp-dev 329] CVS update: slashjp/plugins/ResKey
Message-ID: <20060712113113.036122AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:31:13 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:31:13 +0900
Subject: [Slashdotjp-dev 330] CVS update: slashjp/plugins/ScheduleShifts
Message-ID: <20060712113113.BE7DE2AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:31:14 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:31:14 +0900
Subject: [Slashdotjp-dev 331] CVS update: slashjp/plugins/SearchToo
Message-ID: <20060712113114.83E0D2AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:31:15 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:31:15 +0900
Subject: [Slashdotjp-dev 330] CVS update: slashjp/plugins/Tags
Message-ID: <20060712113115.58DBD2AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:31:16 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:31:16 +0900
Subject: [Slashdotjp-dev 331] CVS update: slashjp/plugins/Unsubscribe
Message-ID: <20060712113116.1C43A2AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:31:16 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:31:16 +0900
Subject: [Slashdotjp-dev 332] CVS update: slashjp/plugins/Validator
Message-ID: <20060712113116.E079E2AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:35:54 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:35:54 +0900
Subject: [Slashdotjp-dev 333] CVS update: slashjp/Slash/Client/lib
Message-ID: <20060712113554.A0FCE2AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:35:55 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:35:55 +0900
Subject: [Slashdotjp-dev 334] CVS update: slashjp/Slash/Client/t
Message-ID: <20060712113555.5E2432AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:36:02 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:36:02 +0900
Subject: [Slashdotjp-dev 335] CVS update: slashjp/plugins/Ajax/htdocs
Message-ID: <20060712113602.C19592AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:36:05 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:36:05 +0900
Subject: [Slashdotjp-dev 336] CVS update: slashjp/plugins/Ajax/templates
Message-ID: <20060712113605.9F9992AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:36:21 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:36:21 +0900
Subject: [Slashdotjp-dev 337] CVS update: slashjp/plugins/Bookmark/templates
Message-ID: <20060712113621.AA5102AC09E@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:36:27 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:36:27 +0900
Subject: [Slashdotjp-dev 338] CVS update: slashjp/plugins/Console/templates
Message-ID: <20060712113627.B0AB92AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:36:34 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:36:34 +0900
Subject: [Slashdotjp-dev 339] CVS update: slashjp/plugins/Daypass/templates
Message-ID: <20060712113634.9E5B12AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:36:51 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:36:51 +0900
Subject: [Slashdotjp-dev 340] CVS update: slashjp/Slash/Client/lib/Slash
Message-ID: <20060712113651.B149F2AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:36:51 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:36:51 +0900
Subject: [Slashdotjp-dev 341] CVS update: slashjp/plugins/Ajax/htdocs/images
Message-ID: <20060712113651.D59152AC0A1@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:36:52 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:36:52 +0900
Subject: [Slashdotjp-dev 342] CVS update: slashjp/plugins/Remarks/templates
Message-ID: <20060712113652.05DC72AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:36:52 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:36:52 +0900
Subject: [Slashdotjp-dev 343] CVS update: slashjp/plugins/ResKey/ResKey
Message-ID: <20060712113652.29C002AC0A1@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:36:52 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:36:52 +0900
Subject: [Slashdotjp-dev 344] CVS update: slashjp/plugins/ResKey/tasks
Message-ID: <20060712113652.4EA492AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:36:52 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:36:52 +0900
Subject: [Slashdotjp-dev 345] CVS update: slashjp/plugins/ResKey/templates
Message-ID: <20060712113652.736292AC0A1@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:36:52 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:36:52 +0900
Subject: [Slashdotjp-dev 346] CVS update:
slashjp/plugins/ScheduleShifts/templates
Message-ID: <20060712113652.9818E2AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:36:52 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:36:52 +0900
Subject: [Slashdotjp-dev 347] CVS update: slashjp/plugins/SearchToo/SearchToo
Message-ID: <20060712113652.BD7212AC0A1@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:36:52 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:36:52 +0900
Subject: [Slashdotjp-dev 348] CVS update: slashjp/plugins/SearchToo/templates
Message-ID: <20060712113652.E13882AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:36:53 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:36:53 +0900
Subject: [Slashdotjp-dev 349] CVS update: slashjp/plugins/Tags/templates
Message-ID: <20060712113653.120422AC0A2@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:36:53 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:36:53 +0900
Subject: [Slashdotjp-dev 350] CVS update: slashjp/plugins/Unsubscribe/templates
Message-ID: <20060712113653.36A142AC0A1@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:36:53 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:36:53 +0900
Subject: [Slashdotjp-dev 351] CVS update: slashjp/plugins/Validator/templates
Message-ID: <20060712113653.5B8ED2AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:36:53 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:36:53 +0900
Subject: [Slashdotjp-dev 352] CVS update: slashjp/plugins/Validator/validator
Message-ID: <20060712113653.7F6BA2AC0A2@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:36:53 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:36:53 +0900
Subject: [Slashdotjp-dev 353] CVS update: slashjp/tagboxes/TagCountUser
Message-ID: <20060712113653.A48CC2AC0A3@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:36:53 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:36:53 +0900
Subject: [Slashdotjp-dev 354] CVS update: slashjp/tagboxes/Top
Message-ID: <20060712113653.C98EE2AC0A1@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:17 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:17 +0900
Subject: [Slashdotjp-dev 355] CVS update: slashjp/Slash/Client/lib/Slash/Client
Message-ID: <20060712113717.744892AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:17 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:17 +0900
Subject: [Slashdotjp-dev 356] CVS update: slashjp/plugins/ResKey/ResKey/Checks
Message-ID: <20060712113717.988032AC0B1@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:17 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:17 +0900
Subject: [Slashdotjp-dev 357] CVS update:
slashjp/plugins/Validator/validator/htdocs
Message-ID: <20060712113717.C71522AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:23 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:23 +0900
Subject: [Slashdotjp-dev 358] CVS update:
slashjp/plugins/ResKey/ResKey/Checks/AL2
Message-ID: <20060712113723.5CAF82AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:23 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:23 +0900
Subject: [Slashdotjp-dev 359] CVS update:
slashjp/plugins/Validator/validator/htdocs/config
Message-ID: <20060712113723.82E132AC0B2@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:23 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:23 +0900
Subject: [Slashdotjp-dev 360] CVS update:
slashjp/plugins/Validator/validator/htdocs/sgml-lib
Message-ID: <20060712113723.A9C2B2AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:27 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:27 +0900
Subject: [Slashdotjp-dev 361] CVS update:
slashjp/plugins/Validator/validator/htdocs/sgml-lib/ISO-HTML
Message-ID: <20060712113727.9BFB02AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:27 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:27 +0900
Subject: [Slashdotjp-dev 362] CVS update:
slashjp/plugins/Validator/validator/htdocs/sgml-lib/REC-MathML2-20010221
Message-ID: <20060712113727.C24762AC0B5@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:27 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:27 +0900
Subject: [Slashdotjp-dev 363] CVS update:
slashjp/plugins/Validator/validator/htdocs/sgml-lib/REC-SVG-20010904
Message-ID: <20060712113727.E98302AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:28 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:28 +0900
Subject: [Slashdotjp-dev 364] CVS update:
slashjp/plugins/Validator/validator/htdocs/sgml-lib/REC-SVG11-20030114
Message-ID: <20060712113728.194562AC0B5@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:28 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:28 +0900
Subject: [Slashdotjp-dev 365] CVS update:
slashjp/plugins/Validator/validator/htdocs/sgml-lib/REC-html40-19980424
Message-ID: <20060712113728.3DF132AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:28 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:28 +0900
Subject: [Slashdotjp-dev 366] CVS update:
slashjp/plugins/Validator/validator/htdocs/sgml-lib/REC-html40-971218
Message-ID: <20060712113728.6285E2AC0B5@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:28 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:28 +0900
Subject: [Slashdotjp-dev 367] CVS update:
slashjp/plugins/Validator/validator/htdocs/sgml-lib/REC-html401-19991224
Message-ID: <20060712113728.874002AC0B7@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:28 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:28 +0900
Subject: [Slashdotjp-dev 368] CVS update:
slashjp/plugins/Validator/validator/htdocs/sgml-lib/REC-smil-19980615
Message-ID: <20060712113728.ABDE22AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:28 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:28 +0900
Subject: [Slashdotjp-dev 369] CVS update:
slashjp/plugins/Validator/validator/htdocs/sgml-lib/REC-xhtml-basic-20001219
Message-ID: <20060712113728.D06522AC0B5@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:28 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:28 +0900
Subject: [Slashdotjp-dev 370] CVS update:
slashjp/plugins/Validator/validator/htdocs/sgml-lib/REC-xhtml1-20000126
Message-ID: <20060712113729.00EDC2AC0B7@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:29 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:29 +0900
Subject: [Slashdotjp-dev 371] CVS update:
slashjp/plugins/Validator/validator/htdocs/sgml-lib/REC-xhtml11-20010531
Message-ID: <20060712113729.4A0B82AC0B5@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:29 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:29 +0900
Subject: [Slashdotjp-dev 372] CVS update:
slashjp/plugins/Validator/validator/htdocs/sgml-lib/REC-xhtml1-20020801
Message-ID: <20060712113729.257902AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:29 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:29 +0900
Subject: [Slashdotjp-dev 373] CVS update:
slashjp/plugins/Validator/validator/htdocs/sgml-lib/UPD-MathML2-20021015
Message-ID: <20060712113729.6F2AC2AC0B7@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:33 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:33 +0900
Subject: [Slashdotjp-dev 374] CVS update:
slashjp/plugins/Validator/validator/htdocs/sgml-lib/UPD-MathML2-20021015/iso8879
Message-ID: <20060712113733.F032D2AC0C3@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:34 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:34 +0900
Subject: [Slashdotjp-dev 375] CVS update:
slashjp/plugins/Validator/validator/htdocs/sgml-lib/UPD-MathML2-20021015/iso9573-13
Message-ID: <20060712113734.27E3D2AC011@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:37:34 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:37:34 +0900
Subject: [Slashdotjp-dev 376] CVS update:
slashjp/plugins/Validator/validator/htdocs/sgml-lib/UPD-MathML2-20021015/mathml
Message-ID: <20060712113734.4F8D72AC0C7@users.sourceforge.jp>
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:36 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:36 +0900
Subject: [Slashdotjp-dev 378] CVS update: slashjp/Bundle
Message-ID: <20060712114136.55E832AC0D3@users.sourceforge.jp>
Index: slashjp/Bundle/.cvsignore
diff -u slashjp/Bundle/.cvsignore:1.1.1.1 slashjp/Bundle/.cvsignore:1.2
--- slashjp/Bundle/.cvsignore:1.1.1.1 Wed Jan 28 06:53:50 2004
+++ slashjp/Bundle/.cvsignore Wed Jul 12 20:41:36 2006
@@ -1 +1,2 @@
Bundle-Slash-*
+.lwpcookies
Index: slashjp/Bundle/README
diff -u slashjp/Bundle/README:1.2 slashjp/Bundle/README:1.3
--- slashjp/Bundle/README:1.2 Wed Dec 22 05:54:52 2004
+++ slashjp/Bundle/README Wed Jul 12 20:41:36 2006
@@ -1,4 +1,4 @@
-# $Id: README,v 1.2 2004/12/21 20:54:52 oliver Exp $
+# $Id: README,v 1.3 2006/07/12 11:41:36 sugi Exp $
This is a Bundle file for Slash, the code that runs Slashdot. See
http://slashcode.com/ for more information. It is geared toward Slash
2.2.x and later versions, but should work fine for older versions of
Index: slashjp/Bundle/Slash.pm
diff -u slashjp/Bundle/Slash.pm:1.3 slashjp/Bundle/Slash.pm:1.4
--- slashjp/Bundle/Slash.pm:1.3 Fri Dec 31 21:35:42 2004
+++ slashjp/Bundle/Slash.pm Wed Jul 12 20:41:36 2006
@@ -1,10 +1,10 @@
package Bundle::Slash;
#
-# $Id: Slash.pm,v 1.3 2004/12/31 12:35:42 oliver Exp $
+# $Id: Slash.pm,v 1.4 2006/07/12 11:41:36 sugi Exp $
#
-$Bundle::Slash::VERSION = '2.34';
+$Bundle::Slash::VERSION = '2.51';
1;
@@ -109,6 +109,15 @@
Lingua::Stem
+URI::Find
+
+Config::General - HTML validator
+
+Set::IntSpan - HTML validator
+
+Text::Iconv - HTML validator
+
+Data::JavaScript::Anon - perl2js data structures
=head1 DESCRIPTION
@@ -119,6 +128,6 @@
and thus not installed by default, but which may become required as
you edit your site configuration, are: Cache::Memcached Silly::Werder
GD GD::Text GD::Graph Apache::SSI Apache::RegistryFilter GraphViz
-Net::IRC Proc::ProcessTable
+Net::IRC Proc::ProcessTable Net::Jabber IO::Socket::SSL
=cut
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:36 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:36 +0900
Subject: [Slashdotjp-dev 377] CVS update: slashjp
Message-ID: <20060712114136.31F9E2AC011@users.sourceforge.jp>
Index: slashjp/AUTHORS
diff -u slashjp/AUTHORS:1.2 slashjp/AUTHORS:1.3
--- slashjp/AUTHORS:1.2 Wed Dec 22 05:54:52 2004
+++ slashjp/AUTHORS Wed Jul 12 20:41:35 2006
@@ -2,8 +2,8 @@
Rob Malda malda ¡÷ slashdot.org
Jonathon Pater pater ¡÷ slashdot.org
- Patrick Galbraith patg ¡÷ osdn.com
- Chris Nandor pudge ¡÷ osdn.com
+ Patrick Galbraith patg ¡÷ patg.net
+ Chris Nandor pudge ¡÷ ostg.com
Brian Aker brian ¡÷ tangent.org
Cliff Wood cliff ¡÷ slashdot.org
Jamie McCarthy jamie ¡÷ mccarthy.vg
@@ -15,10 +15,10 @@
rectify it.)
Dave Aiello dave_aiello ¡÷ ctdata.com
- Daniel "Yazz" Atlas yazz ¡÷ osdn.com
+ Daniel "Yazz" Atlas yazz ¡÷ ostg.com
Alessio Bragadini alessio ¡÷ albourne.com
Atif Ghaffar atif ¡÷ developer.ch
- Dave Olszewski dave.olszewski ¡÷ osdn.com
+ Dave Olszewski dave.olszewski ¡÷ ostg.com
Nathan Vonnahme nathan ¡÷ thethirdsector.com
Bernard de Rubinat bernard ¡÷ netgames.org
Steinar H. Gunderson sgunderson ¡÷ bigfoot.com
@@ -36,5 +36,5 @@
chromatic chromatic ¡÷ rmci.net
Dan Stahlke dans ¡÷ infoinsights.com
-# $Id: AUTHORS,v 1.2 2004/12/21 20:54:52 oliver Exp $
+# $Id: AUTHORS,v 1.3 2006/07/12 11:41:35 sugi Exp $
Index: slashjp/CHANGES
diff -u slashjp/CHANGES:1.2 slashjp/CHANGES:1.3
--- slashjp/CHANGES:1.2 Wed Dec 22 05:54:52 2004
+++ slashjp/CHANGES Wed Jul 12 20:41:36 2006
@@ -1,4 +1,4 @@
-# $Id: CHANGES,v 1.2 2004/12/21 20:54:52 oliver Exp $
+# $Id: CHANGES,v 1.3 2006/07/12 11:41:36 sugi Exp $
(We should update this file before we release a 2.3.0 -- there have been
six versions since 2.2.0. I believe 2.2.1 thru 2.2.6 were all bugfix
Index: slashjp/INSTALL
diff -u slashjp/INSTALL:1.3 slashjp/INSTALL:1.4
--- slashjp/INSTALL:1.3 Fri Dec 31 21:35:42 2004
+++ slashjp/INSTALL Wed Jul 12 20:41:36 2006
@@ -76,8 +76,9 @@
1. Install MySQL.
- Please refer to MySQL documentation for compilation and/or
- installation notes for any questions with this process.
+ If it is already installed, doublecheck that its version is at least
+ the minimum required (see "REQUIREMENTS"). If you have questions
+ about the installation process, please refer to MySQL documentation.
Slash requires that your MySQL server run in the GMT timezome. Find
your global my.cnf file (probably "/etc/my.cnf" or
@@ -86,8 +87,8 @@
timezone = GMT
- Start MySQL (it must be running for the installation of Perl modules
- and Slash).
+ Start, or restart, MySQL (it must be running for the installation of
+ Perl modules and Slash).
Create a database to be used by Slash.
@@ -99,8 +100,8 @@
2. Install perl.
- perl is likely already installed on your machine; make sure its
- version is at least the minimum required (see "REQUIREMENTS").
+ perl is likely already installed on your machine; doublecheck that
+ its version is at least the minimum required (see "REQUIREMENTS").
3. Install Apache and mod_perl.
@@ -133,13 +134,7 @@
are not yet installed. However, some Perl modules will not install
without Apache and mod_perl installed. If you wish, come back and
run "make test" after installing here, and then installing the Perl
- modules, to make sure everything is OK. Also, as of January 2002, a
- "make test" has thrown spurious errors for several months because of
- a persistent minor bug; if you see "Can't locate object method 'new'
- via package 'URI::URL'", read this:
-
-
+ modules, to make sure everything is OK.
NOTE: If you know what you're doing, Slash will work with a DSO
Apache. Be sure you're on the latest versions of Apache and mod_perl
@@ -207,7 +202,7 @@
---- Unsatisfied dependencies detected during [FOO/Bar-1.23.tar.gz] -----
Foobar::Baz
Shall I follow them and prepend them to the queue
- of modules we are processing right now? [yes]
+ of modules we are processing right now? [yes]
That's normal; just hit return.
@@ -412,8 +407,9 @@
7. Start it up.
After installation of the site is done, and Apache has been stopped
- and started (do NOT try to restart Apache, but do a full stop and
- start), run slashd. This should be done via the init script:
+ and started (do not try to "restart" Apache, but rather do a full
+ stop and start), then run slashd. This should be done via the init
+ script:
/etc/init.d/slash start
@@ -496,11 +492,11 @@
RAM or 5 MB?
Slashdot, and some other Slash sites we're hosting, are currently using
- boa 0.94.14rc17 () for images. Boa is fast and has
- a small footprint. It's easy to build ("./configure && make") but you
- have to install it yourself by copying the binary and mkdir'ing a little
- tree wherever you want it. We did roughly this. Your mileage may vary.
- This sets up an alternate server just for images on port 8080, and sets
+ boa 0.94.14rc17 (http://www.boa.org/) for images. Boa is fast and has a
+ small footprint. It's easy to build ("./configure && make") but you have
+ to install it yourself by copying the binary and mkdir'ing a little tree
+ wherever you want it. We did roughly this. Your mileage may vary. This
+ sets up an alternate server just for images on port 8080, and sets
Slash's imagedir var to point to it. Your apache will still serve images
at the old URLs if anyone requests them, but nobody will, because your
site's pages will all point to boa:
@@ -540,6 +536,17 @@
before beginning. We are not responsible for any loss of data or
functionality.
+ Slash 1.0 -> Slash 2.2
+ You've got a site running Slash 1.0, from 2001? We're so sorry to hear
+ that.
+
+ Please read the complete documentation of utils/slash1toslash2.2. We
+ believe it will convert your database from Slash 1.0 to a new Slash 2.2
+ database, but it hasn't been tested in some time. The program
+ documentation (which can be read with perldoc) details exactly what
+ process it follows to do the conversion, so you can attempt to do it by
+ hand if you prefer.
+
Slash 2.0 -> Slash 2.2
Slash 2.2 is a major upgrade from Slash 2.0. It takes a little bit of
work to get it going.
@@ -707,51 +714,59 @@
% template-tool -u VIRTUAL_USER -s LIST
Slash 2.2.6 -> Slash CVS
- Use the sql/mysql/upgrades file; see "VERSIONS", "CVS tags", below.
-
- Slash 1.0 -> Slash 2.2
- Please read the complete documentation of utils/slash1toslash2.2. It is
- a program that will convert your database from Slash 1.0 to a new Slash
- 2.2 database. The program documentation (which can be read with perldoc)
- details exactly what process it follows to do the conversion, so you can
- attempt to do it by hand if you prefer.
+ Use the sql/mysql/upgrades file; see "VERSIONS", "CVS tags", below. This
+ file is human-readable and very long. You can upgrade a 2.2.6 to the
+ latest CVS by methodically applying every step in this file, but it is
+ tedious and requires an engaged human brain reading the comments (i.e.,
+ don't "mysql slash < upgrades", that will fail miserably).
+
+ Slash CVS -> later Slash CVS
+ Again, use the sql/mysql/upgrades file (and the caveat just mentioned
+ still applies). Start from the CVS tag you left off at, and proceed to
+ the CVS tag you upgraded to (which should be the end of the file). If
+ you're not sure which tag you left off at, you might check the var
+ 'cvs_tag_currentcode', which will contain the right value if you last
+ updated after September 2005.
+
+ In general, you should stop apache and slashd, do a "make install",
+ apply the upgrades file a line at a time for each Slash site, run
+ "template-tool -U -u virtusename" and "symlink-tool -U -u virtusername"
+ for each Slash site, and then start slashd and apache back up.
REQUIREMENTS
Software Requirements
Below, we list the main software components needed. The recommended
version is noted, along with the earliest version that has been tested
- (or is expected) to work. The earliest versions are not necessarily
- supported, but should work. perl 5.6.0 is supported, but MySQL 3.22 is
- not.
+ (or is expected) to work. The earliest versions are not recommended or
+ supported, but should work.
perl
- Version 5.6.1 (5.6.0). [NOTE: perl 5.6.0 may have some problems.
- 5.6.1 is recommended.]
+ Version 5.8.6 (5.6.1).
http://www.cpan.org/
- We believe everything works fine with perl 5.8.x, x >= 1, and have
- several small Slash installations on it, but we have not tested
- Unicode thoroughly, nor have we run Slashdot on it yet.
-
MySQL
- Version 4.0.12 (4.0.4).
+ Version 4.1.18 (4.0.12).
http://www.mysql.com/
MySQL 3.23.x is no longer supported, as of CVS tag T_2_5_0_33
- (October 18, 2004).
+ (October 18, 2004). Slashdot has been running on MySQL 4.1.x with no
+ problems, so we now recommend that, but 4.0.x works as well. We have
+ been testing 5.0.x for months but currently, no production sites run
+ it.
Apache
- Version 1.3.29 (1.3.6).
+ Version 1.3.33.
http://httpd.apache.org/
- Do not use Apache 1.3.28. It has a nasty bug in it that causes Slash
- to talk to the web browser as though it is the database server.
+ Since most of Apache 1.3.x's recent releases included security
+ fixes, we wouldn't recommend running an earlier version. As far as
+ we know, Slash is not compatible with Apache 2.x.
mod_perl
- Version 1.29 (1.21).
+ Version 1.29.
http://perl.apache.org/
@@ -979,8 +994,8 @@
fully understand MySQL permissions, don't guess; start your
reading here:
-
+ http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_
+ Database_Administration.html#Privilege_system
* mod_gzip
@@ -1084,5 +1099,5 @@
/usr/local/slash/site/yoursitename".
VERSION
- $Id: INSTALL,v 1.3 2004/12/31 12:35:42 oliver Exp $
+ $Id: INSTALL,v 1.4 2006/07/12 11:41:36 sugi Exp $
Index: slashjp/INSTALL.debian
diff -u slashjp/INSTALL.debian:1.2 slashjp/INSTALL.debian:1.3
--- slashjp/INSTALL.debian:1.2 Wed Dec 22 05:54:52 2004
+++ slashjp/INSTALL.debian Wed Jul 12 20:41:36 2006
@@ -55,5 +55,5 @@
DateManip libdate-manip-perl
VERSION
- $Id: INSTALL.debian,v 1.2 2004/12/21 20:54:52 oliver Exp $
+ $Id: INSTALL.debian,v 1.3 2006/07/12 11:41:36 sugi Exp $
Index: slashjp/INSTALL.rpm
diff -u slashjp/INSTALL.rpm:1.2 slashjp/INSTALL.rpm:1.3
--- slashjp/INSTALL.rpm:1.2 Wed Dec 22 05:54:52 2004
+++ slashjp/INSTALL.rpm Wed Jul 12 20:41:36 2006
@@ -32,5 +32,5 @@
3. Restart Apache.
VERSION
- $Id: INSTALL.rpm,v 1.2 2004/12/21 20:54:52 oliver Exp $
+ $Id: INSTALL.rpm,v 1.3 2006/07/12 11:41:36 sugi Exp $
Index: slashjp/INSTALL.solaris
diff -u slashjp/INSTALL.solaris:1.2 slashjp/INSTALL.solaris:1.3
--- slashjp/INSTALL.solaris:1.2 Wed Dec 22 05:54:52 2004
+++ slashjp/INSTALL.solaris Wed Jul 12 20:41:36 2006
@@ -40,6 +40,6 @@
Continue the installation as suggestion in the main INSTALL documentation.
VERSION
- $Id: INSTALL.solaris,v 1.2 2004/12/21 20:54:52 oliver Exp $
+ $Id: INSTALL.solaris,v 1.3 2006/07/12 11:41:36 sugi Exp $
__END__
Index: slashjp/MANIFEST
diff -u slashjp/MANIFEST:1.3 slashjp/MANIFEST:1.4
--- slashjp/MANIFEST:1.3 Fri Dec 31 21:35:42 2004
+++ slashjp/MANIFEST Wed Jul 12 20:41:36 2006
@@ -435,7 +435,6 @@
themes/slashcode/templates/mainmenu;misc;default
themes/slashcode/templates/messages;users;default
themes/slashcode/templates/metaModerate;metamod;default
-themes/slashcode/templates/miniAdminMenu;users;default
themes/slashcode/templates/modCommentLog;misc;default
themes/slashcode/templates/mod_footer;comments;default
themes/slashcode/templates/mod_header;comments;default
Index: slashjp/Makefile
diff -u slashjp/Makefile:1.3 slashjp/Makefile:1.4
--- slashjp/Makefile:1.3 Fri Dec 31 21:35:42 2004
+++ slashjp/Makefile Wed Jul 12 20:41:36 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2003 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Makefile,v 1.3 2004/12/31 12:35:42 oliver Exp $
+# $Id: Makefile,v 1.4 2006/07/12 11:41:36 sugi Exp $
##
## Makefile -- Current one for Slash
@@ -37,14 +37,15 @@
UNAME = `uname`
MAKE = make -s
-# Plugins (any directory in plugins/)
-PLUGINS = `find . -name CVS -prune -o -type d -name [a-zA-Z]\* -maxdepth 1 -print`
+# Subdirectories excl. CVS in the current directory (like plugins/ or tagboxes/)
+SUBDIRS = `find . -maxdepth 1 -name CVS -prune -o -type d -name [a-zA-Z]\* -print`
# Perl scripts, grouped by directory.
BINFILES = `find bin -name CVS -prune -o -name [a-zA-Z]\* -type f -print`
SBINFILES = `find sbin -name CVS -prune -o -name [a-zA-Z]\* -type f -print`
THEMEFILES = `find themes -name CVS -prune -o -name [a-zA-z]\*.pl -print`
PLUGINFILES = `find plugins -name CVS -prune -o -name [a-zA-Z]\*.pl -print`
+TAGBOXFILES = `find tagboxes -name CVS -prune -o -name [a-zA-Z]\*.pl -print`
# What do we use to invoke perl?
REPLACEWITH = `$(PERL) -MConfig -e 'print quotemeta($$Config{startperl})' | sed 's/@/\\@/g'`
@@ -58,7 +59,7 @@
INSTALLSITELIB=`$(PERL) -MConfig -e 'print "$(BUILDROOT)/$$Config{installsitelib}"'`
INSTALLMAN3DIR=`$(PERL) -MConfig -e 'print "$(BUILDROOT)/$$Config{installman3dir}"'`
-.PHONY : all plugins slash install
+.PHONY : all plugins tagboxes slash install
# install the shared object file into Apache
# We should run a script on the binaries to get the right
@@ -76,7 +77,25 @@
plugins:
@echo "=== INSTALLING SLASH PLUGINS ==="
@(cd plugins; \
- for a in $(PLUGINS); do \
+ for a in $(SUBDIRS); do \
+ (cd $$a; \
+ echo == $$PWD; \
+ if [ -f Makefile.PL ]; then \
+ if [ ! "$(RPM)" ] ; then \
+ $(PERL) Makefile.PL; \
+ $(MAKE) install UNINST=1;\
+ else \
+ echo " - Performing an RPM build."; \
+ $(PERL) Makefile.PL INSTALLSITEARCH=$(INSTALLSITEARCH) INSTALLSITELIB=$(INSTALLSITELIB) INSTALLMAN3DIR=$(INSTALLMAN3DIR); \
+ $(MAKE) install UNINST=1; \
+ fi; \
+ fi); \
+ done)
+
+tagboxes:
+ @echo "=== INSTALLING SLASH TAGBOXES ==="
+ @(cd tagboxes; \
+ for a in $(SUBDIRS); do \
(cd $$a; \
echo == $$PWD; \
if [ -f Makefile.PL ]; then \
@@ -93,7 +112,7 @@
all: install
-install: slash plugins
+install: slash plugins tagboxes
# Create all necessary directories.
$(INSTALL) -d \
@@ -101,6 +120,7 @@
$(SLASH_PREFIX)/httpd/ \
$(SLASH_PREFIX)/themes/ \
$(SLASH_PREFIX)/plugins/ \
+ $(SLASH_PREFIX)/tagboxes/ \
$(SLASH_PREFIX)/sbin \
$(SLASH_PREFIX)/sql/ \
$(SLASH_PREFIX)/sql/mysql/
@@ -111,13 +131,15 @@
# section of the Makefile would need to be rewritten to do this sanely
# and there just isn't the time for that right now.
#
- # Install the plugins...(will also install kruft like CVS/ and blib/
- # directories if they are around. Maybe a smarter copying procedure
- # is called for, here?)
+ # Install the plugins and tagboxes. Will also install kruft like CVS/
+ # and blib/ directories if they are around. Maybe a smarter copying
+ # procedure is called for, here?)
#
# Note: Many users of Slash have taken to symlinking the plugins and themes
# directories into $(SLASH_PREFIX) from their checked-out CVS trees. We
# should try to check for this in the future and behave accordingly.
+ # (Update, 2006-05-06: no, we're not going to check for that. Editing a
+ # CVS checkout is great, but push it live with a 'make install' please.)
#
# OpenBSD needs "-R" here instead of "-rv". Its manpage notes:
# Historic versions of the cp utility had a -r option. This implementation
@@ -126,7 +148,9 @@
#
(cd plugins; $(MAKE) clean)
$(CP) -r plugins/* $(SLASH_PREFIX)/plugins
- # Now all other themes
+ (cd tagboxes; $(MAKE) clean)
+ $(CP) -r tagboxes/* $(SLASH_PREFIX)/tagboxes
+ # Now all the themes
$(CP) -r themes/* $(SLASH_PREFIX)/themes
# Insure we use the proper Perl interpreter and prefix in all scripts that
@@ -137,13 +161,14 @@
sbinfiles=$(SBINFILES); \
themefiles=$(THEMEFILES); \
pluginfiles=$(PLUGINFILES); \
+ tagboxfiles=$(TAGBOXFILES); \
if [ "$$replacewith" != "\#\!\/usr\/bin\/perl" ]; then \
replace=1; \
replacestr='(using $(PERL))'; \
else \
replace=0; \
fi; \
- for f in $$binfiles $$sbinfiles $$themefiles $$pluginfiles; do \
+ for f in $$binfiles $$sbinfiles $$themefiles $$pluginfiles $$tagboxfiles; do \
n=$(SLASH_PREFIX)/$$f; \
$(INSTALL) -d $(SLASH_PREFIX)/$$d; \
if [ $$replace ]; then \
@@ -232,6 +257,7 @@
chown -R $(USER):$(GROUP) $(SLASH_PREFIX)/bin
chown -R $(USER):$(GROUP) $(SLASH_PREFIX)/sql
chown -R $(USER):$(GROUP) $(SLASH_PREFIX)/plugins
+ chown -R $(USER):$(GROUP) $(SLASH_PREFIX)/tagboxes
# Add a @ to suppress output of the echo's
@echo "+--------------------------------------------------------+"; \
echo "| All done. |"; \
@@ -246,7 +272,6 @@
echo "| Thanks for installing Slash. |"; \
echo "+--------------------------------------------------------+"; \
-
reload: install
apachectl stop
apachectl start
@@ -256,6 +281,7 @@
(cd Slash; if [ ! -f Makefile ]; then perl Makefile.PL; fi; $(MAKE) clean)
(rm Slash/Apache/Apache.xs Slash/Apache/User/User.xs)
(cd plugins; $(MAKE) clean)
+ (cd tagboxes; $(MAKE) clean)
find ./ | grep \# | xargs rm
dist: $(DISTVNAME).tar$(SUFFIX)
Index: slashjp/Makefile.NEW
diff -u slashjp/Makefile.NEW:1.2 slashjp/Makefile.NEW:1.3
--- slashjp/Makefile.NEW:1.2 Wed Dec 22 05:54:52 2004
+++ slashjp/Makefile.NEW Wed Jul 12 20:41:36 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Makefile.NEW,v 1.2 2004/12/21 20:54:52 oliver Exp $
+# $Id: Makefile.NEW,v 1.3 2006/07/12 11:41:36 sugi Exp $
##
## Makefile -- Current one for Slash
@@ -32,7 +32,7 @@
CP = cp
# Plugins (any directory in plugins/)
-PLUGINS = `find . -name CVS -prune -o -type d -maxdepth 1 -print`
+PLUGINS = `find . -maxdepth 1 -name CVS -prune -o -type d -print`
# Perl scripts, grouped by directory.
BINFILES = `find bin -name CVS -prune -o -type f -print`
Index: slashjp/README
diff -u slashjp/README:1.2 slashjp/README:1.3
--- slashjp/README:1.2 Wed Dec 22 05:54:52 2004
+++ slashjp/README Wed Jul 12 20:41:36 2006
@@ -131,9 +131,9 @@
The information below applies to everything in this distribution, except
where noted.
- Copyright 1997-2004 by Open Source Development Network.
+ Copyright 1997-2005 by Open Source Technology Group.
- http://www.osdn.com/
+ http://www.ostg.com/
Slash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
@@ -151,5 +151,5 @@
02111-1307, USA.
VERSION
- $Id: README,v 1.2 2004/12/21 20:54:52 oliver Exp $
+ $Id: README,v 1.3 2006/07/12 11:41:36 sugi Exp $
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:36 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:36 +0900
Subject: [Slashdotjp-dev 379] CVS update: slashjp/Slash/Apache
Message-ID: <20060712114136.A64722AC0D3@users.sourceforge.jp>
Index: slashjp/Slash/Apache/Apache.pm
diff -u slashjp/Slash/Apache/Apache.pm:1.4 slashjp/Slash/Apache/Apache.pm:1.5
--- slashjp/Slash/Apache/Apache.pm:1.4 Tue Apr 26 19:40:44 2005
+++ slashjp/Slash/Apache/Apache.pm Wed Jul 12 20:41:36 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Apache.pm,v 1.4 2005/04/26 10:40:44 oliver Exp $
+# $Id: Apache.pm,v 1.5 2006/07/12 11:41:36 sugi Exp $
package Slash::Apache;
@@ -18,16 +18,17 @@
require DynaLoader;
require AutoLoader;
-use vars qw($REVISION $VERSION @ISA $USER_MATCH);
+use vars qw($REVISION $VERSION @ISA $USER_MATCH $DAYPASS_MATCH);
@ISA = qw(DynaLoader);
$VERSION = '2.003000'; # v2.3.0
-($REVISION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($REVISION) = ' $Revision: 1.5 $ ' =~ /\$Revision:\s+([^\s]+)/;
$USER_MATCH = qr{ \buser=(?! # must have user, but NOT ...
(?: nobody | %[20]0 )? # nobody or space or null or nothing ...
(?: \s | ; | $ ) # followed by whitespace, ;, or EOS
)}x;
+$DAYPASS_MATCH = qr{\bdaypassconfcode=};
bootstrap Slash::Apache $VERSION;
@@ -241,6 +242,8 @@
$slashdb->{_dbh}->disconnect;
}
+# This handler is called in the first Apache phase, post-read-request.
+#
# This can be used in conjunction with mod_proxy_add_forward or somesuch,
# if you use a frontend/backend Apache setup, where all requests come
# from 127.0.0.1 or some other predictable IP number(s). For speed, we
@@ -287,16 +290,18 @@
# That probably didn't work so let's get that data the hard way.
my $r = Apache->request;
+ return 0 if !$r;
my $subr = $r->lookup_uri($r->uri);
- my $https_on = ($subr && $subr->subprocess_env('HTTPS') eq 'on')
- ? 1 : 0;
- return 1 if $https_on;
+ if ($subr) {
+ my $se = $subr->subprocess_env('HTTPS');
+ return 1 if $se && $se eq 'on'; # https is on
+ }
- return 1
- if $r->header_in('X-SSL-On') eq 'yes';
+ my $x = $r->header_in('X-SSL-On');
+ return 1 if $x && $x eq 'yes';
- # Nope, it's not SSL. We're out of ideas, if the above didn't
- # work we must not be on SSL.
+ # We're out of ideas. If the above didn't work we must not be
+ # on SSL.
return 0;
}
@@ -335,13 +340,19 @@
my $gSkin = getCurrentSkin();
my $uri = $r->uri;
- my $is_user = $r->header_in('Cookie') =~ $USER_MATCH;
+ my $cookie = $r->header_in('Cookie');
+ my $is_user = $cookie =~ $USER_MATCH;
+ my $has_daypass = 0;
+ if (!$is_user) {
+ if ($constants->{daypass} && $cookie =~ $DAYPASS_MATCH) {
+ $has_daypass = 1;
+ }
+ }
- # harmful if deciding skin on directory
- #if ($gSkin->{rootdir}) {
- # my $path = URI->new($gSkin->{rootdir})->path;
- # $uri =~ s/^\Q$path//;
- #}
+ if ($gSkin->{rootdir}) {
+ my $path = URI->new($gSkin->{rootdir})->path;
+ $uri =~ s/^\Q$path//;
+ }
# Comment this in if you want to try having this do the right
# thing dynamically
@@ -349,17 +360,13 @@
# my $dbon = $slashdb->sqlConnect();
my $dbon = dbAvailable();
- # URI ends with a slash and is equal to the skin's rootdir
- if ($uri =~ m|(.*)/$| && URI->new($gSkin->{rootdir})->path eq $1
- && $gSkin->{index_handler} ne 'IGNORE') {
+ if ($uri eq '/' && $gSkin->{index_handler} ne 'IGNORE') {
my $basedir = $constants->{basedir};
# $USER_MATCH defined above
- if ($dbon && $is_user) {
- $r->uri( $uri . $gSkin->{index_handler} );
+ if ($dbon && ($is_user || $has_daypass)) {
+ $r->uri("/$gSkin->{index_handler}");
$r->filename("$basedir/$gSkin->{index_handler}");
- # URI->filname conversion done, don't continue
- $r->set_handlers(PerlTransHandler => undef);
return OK;
} elsif (!$dbon) {
# no db (you may wish to symlink index.shtml to your real
@@ -386,6 +393,64 @@
}
}
+ # match /section/ or /section
+ if ($uri =~ m|^/(\w+)/?$|) {
+ my $key = $1;
+
+ if (!$dbon) {
+ $r->uri('/index.shtml');
+ return DECLINED;
+ }
+
+ my $slashdb = getCurrentDB();
+ my $new_skin = $slashdb->getSkin($key);
+ my $new_skid = $new_skin->{skid} || $constants->{mainpage_skid};
+#print STDERR scalar(localtime) . " $$ IndexHandler B new_skid=$new_skid\n";
+ setCurrentSkin($new_skid);
+ $gSkin = getCurrentSkin();
+
+ my $index_handler = $gSkin->{index_handler};
+ if ($index_handler ne 'IGNORE') {
+ my $basedir = $constants->{basedir};
+
+ # $USER_MATCH defined above
+ if ($dbon && ($is_user || $has_daypass)) {
+ $r->args("section=$key");
+ # For any directory which can be accessed by a
+ # logged-in user in the URI form /foo or /foo/,
+ # but which is not a skin's directory, there
+ # is a problem; we cannot simply bounce the uri
+ # back to /index.pl or whatever, since the
+ # index handler will not recognize the section
+ # key argument above and will just present the
+ # ordinary homepage. I don't know the best way
+ # to handle this situation at the moment, so
+ # instead I'm hardcoding in the solution for the
+ # most common problem. - Jamie 2004/07/17
+ if ($key eq "faq" || $key eq "palm") {
+ $r->uri("/$key/index.shtml");
+ } elsif ($key eq "docs"
+ || $key eq "privaterss") {
+ $r->uri("/$key/");
+ } else {
+ $r->uri("/$index_handler");
+ }
+ $r->filename("$basedir/$index_handler");
+ return OK;
+ } else {
+ # user not logged in
+
+ # consider using File::Basename::basename() here
+ # for more robustness, if it ever matters -- pudge
+ my($base) = split(/\./, $index_handler);
+ $r->uri("/$key/$base.shtml");
+ $r->filename("$basedir/$key/$base.shtml");
+ writeLog('shtml');
+ return OK;
+ }
+ }
+ }
+
if ($uri eq '/authors.pl') {
my $filename = $r->filename;
my $basedir = $constants->{basedir};
@@ -407,13 +472,17 @@
return OK;
}
- # redirect to static if not a user, and
+ # redirect to static if
+ # * not a user, nor a daypass holder,
+ # and
# * var is on
# * is article.pl
# * no page number > 1 specified
# * sid specified
# * referrer exists AND is external to our site
- if ($constants->{referrer_external_static_redirect} && !$is_user && $uri eq '/article.pl') {
+ if ($constants->{referrer_external_static_redirect}
+ && !$is_user && !$has_daypass
+ && $uri eq '/article.pl') {
my $referrer = $r->header_in("Referer");
my $referrer_domain = $constants->{referrer_domain} || $gSkin->{basedomain};
my $the_request = $r->the_request;
@@ -434,14 +503,6 @@
}
}
- # .pl in section dirs are served by scripts in basedir
- if( $uri =~ m|^.+/(\w+\.pl)$| ){
- my $basedir = $constants->{basedir};
- $r->filename("$basedir/$1");
- $r->set_handlers(PerlTransHandler => undef);
- return OK;
- }
-
if (!$dbon && $uri !~ /\.(?:shtml|html|jpg|gif|png|rss|rdf|xml|txt|css)$/) {
# if db is off we don't necessarily have access to constants
# this means we change the URI and return DECLINED which lets
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:36 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:36 +0900
Subject: [Slashdotjp-dev 380] CVS update: slashjp/Slash/Apache/Banlist
Message-ID: <20060712114136.CE8C52AC011@users.sourceforge.jp>
Index: slashjp/Slash/Apache/Banlist/Banlist.pm
diff -u slashjp/Slash/Apache/Banlist/Banlist.pm:1.2 slashjp/Slash/Apache/Banlist/Banlist.pm:1.3
--- slashjp/Slash/Apache/Banlist/Banlist.pm:1.2 Wed Dec 22 18:13:31 2004
+++ slashjp/Slash/Apache/Banlist/Banlist.pm Wed Jul 12 20:41:36 2006
@@ -1,13 +1,14 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Banlist.pm,v 1.2 2004/12/22 09:13:31 oliver Exp $
+# $Id: Banlist.pm,v 1.3 2006/07/12 11:41:36 sugi Exp $
+
+# This handler is called in the fourth Apache phase, access control.
package Slash::Apache::Banlist;
use strict;
use Apache::Constants qw(:common);
-use Digest::MD5 'md5_hex';
use Slash;
use Slash::Display;
@@ -16,7 +17,7 @@
use vars qw($VERSION);
-($VERSION) = ' $Revision: 1.2 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
sub handler {
my($r) = @_;
@@ -27,32 +28,35 @@
# Ok, this will make it so that we can reliably use Apache->request
Apache->request($r);
- my $hostip = $r->connection->remote_ip;
- my($cur_ip, $cur_subnet) = get_ipids($hostip, 1);
- my($cur_ipid, $cur_subnetid) = get_ipids($hostip);
+ # Get some information about the IP this request is coming from.
+ my $hostip = $r->connection->remote_ip;
+ my($cur_ip, $cur_subnet) = get_srcids({ ip => $hostip },
+ { no_md5 => 1, return_only => [qw( ip subnet )] });
+ my($cur_srcid_ip, $cur_srcid_subnet) = get_srcids({ ip => $hostip },
+ { return_only => [qw( ip subnet )] });
+#print STDERR scalar(localtime) . " hostip='$hostip' cur_ip='$cur_ip' cur_subnet='$cur_subnet' cur_srcid_ip='$cur_srcid_ip' cur_srcid_subnet='$cur_srcid_subnet'\n";
+ # Set up DB objects.
my $slashdb = getCurrentDB();
my $reader_user = $slashdb->getDB('reader');
-
my $reader = getObject('Slash::DB', { virtual_user => $reader_user });
- $reader->sqlConnect();
-
- my $is_rss = $r->uri =~ m{(
- \.(?:xml|rss|rdf)$
- |
- content_type=rss
- )}x; # also check for content_type in POST?
+ $reader->sqlConnect;
- my $is_palm = $r->uri =~ /^\/palm/;
-
- # check for ban
- my $banlist = $reader->getBanList();
- if ($banlist->{$cur_ipid} || $banlist->{$cur_subnetid}) {
+ # Check what kind of access this is.
+
+ my($is_rss, $is_palm, $feed_type) = _check_rss_and_palm($r);
+
+ # Abort this Apache request if this IP address is outright banned.
+
+ my $banlist = $reader->getBanList;
+#use Data::Dumper; $Data::Dumper::Sortkeys=1;
+#print STDERR "cur_srcid_ip='$cur_srcid_ip' cur_srcid_subnet='$cur_srcid_subnet' banlist: " . Dumper($banlist);
+ if ($banlist->{$cur_srcid_ip} || $banlist->{$cur_srcid_subnet}) {
+ _create_banned_user($hostip);
# Send a special "you are banned" page if the user is
# hitting RSS.
-print STDERR scalar(localtime) . " Banlist.pm $$ $hostip " . $r->method . " " . $r->uri . " returning FORBIDDEN for ipid '$banlist->{$cur_ipid}'\n";
- return _send_rss($r, 'ban') if $is_rss;
+ return _send_rss($r, 'ban', $cur_srcid_ip, $feed_type) if $is_rss;
# Send our usual "you are banned" page, whether the user
# is on palm or not. It's mostly text so palm users
# should not have a problem with it.
@@ -65,33 +69,75 @@
return FORBIDDEN;
}
- # check for RSS abuse
- my $rsslist = $reader->getNorssList();
- if ($is_rss && ($rsslist->{$cur_ipid} || $rsslist->{$cur_subnet})) {
- return _send_rss($r, 'abuse', $cur_ipid);
+ # Send a special "RSS banned" page if this IP address is banned
+ # from reading RSS.
+ if ($is_rss) {
+ my $rsslist = $reader->getNorssList;
+ if ($rsslist->{$cur_srcid_ip} || $rsslist->{$cur_srcid_subnet}) {
+ _create_banned_user($hostip);
+ return _send_rss($r, 'abuse', $cur_srcid_ip, $feed_type);
+ }
}
- # check for Palm abuse
- my $palmlist = $reader->getNopalmList();
- if ($is_palm && ($palmlist->{$cur_ipid} || $palmlist->{$cur_subnet})) {
- $r->custom_response(FORBIDDEN,
- slashDisplay('bannedtext_palm',
- { ip => $cur_ip },
- { Return => 1 }
- )
- );
- return FORBIDDEN;
+ # Send a special "Palm banned" page if this IP addresss is banned
+ # from reading Palm pages.
+ if ($is_palm) {
+ my $palmlist = $reader->getNopalmList;
+ if ($palmlist->{$cur_srcid_ip} || $palmlist->{$cur_subnet}) {
+ _create_banned_user($hostip);
+ $r->custom_response(FORBIDDEN,
+ slashDisplay('bannedtext_palm',
+ { ip => $cur_ip },
+ { Return => 1 }
+ )
+ );
+ return FORBIDDEN;
+ }
}
+ # The IP address is not banned and can proceed.
return OK;
}
+# Now we need to create a user hashref for that global
+# current user, so these fields of accesslog get written
+# correctly when we log this attempted hit. We do this
+# dummy hashref with the bare minimum of values that we need,
+# instead of going through prepareUser(), because this is
+# much, much faster.
+sub _create_banned_user {
+ my($hostip) = @_;
+ my($ipid, $subnetid) = get_ipids($hostip);
+ my $user = {
+ uid => getCurrentStatic('anonymous_coward_uid'),
+ ipid => $ipid,
+ subnetid => $subnetid,
+ };
+ createCurrentUser($user);
+}
+
+
+sub _check_rss_and_palm {
+ my($r) = @_;
+ my $is_rss = $r->uri =~ m{(
+ \.(xml|rss|rdf|atom)$
+ |
+ content_type=(rss|atom)
+ )}x;
+ my $feed_type = $1 || $2 || 'rss';
+ $feed_type = 'rss' unless $feed_type eq 'atom';
+
+ # XXX Should we also check for content_type in POST?
+ my $is_palm = $r->uri =~ /^\/palm/;
+ return($is_rss, $is_palm, $feed_type);
+}
+
sub _send_rss {
- my($r, $type, $ipid) = @_;
+ my($r, $type, $srcid_ip, $feed_type) = @_;
http_send({
content_type => 'text/xml',
status => 202,
- content => _get_rss_msg($type, $ipid),
+ content => _get_rss_msg($type, $srcid_ip, $feed_type),
});
return DONE;
@@ -101,27 +147,34 @@
# templates don't work with Slash::XML right now,
# and redirecting will cause *more* traffic than
# just spitting it out here; so cache it in $RSS_*
+# XXX that really should be a cache that eventually expires
my(%RSS);
sub _get_rss_msg {
- my($type, $ipid) = @_;
+ my($type, $srcid_ip, $feed_type) = @_;
$type ||= 'abuse';
- $ipid ||= '(unknown)';
+ $srcid_ip ||= '(unknown)';
+ $feed_type ||= 'rss';
- return $RSS{$type} if exists $RSS{$type};
+ return $RSS{$type}{$srcid_ip} if exists $RSS{$type}{$srcid_ip};
# template puts data in $items
my $items = [];
slashDisplay('bannedtext_rss', {
- items => $items,
- type => $type,
- ipid => $ipid,
+ items => $items,
+ type => $type,
+ srcid_ip => $srcid_ip,
}, { Return => 1 });
- return $RSS{$type} = xmlDisplay(rss => {
+ $RSS{$type}{$srcid_ip} = xmlDisplay($feed_type => {
rdfitemdesc => 1,
items => $items,
}, { Return => 1 } );
+ if (!$RSS{$type}{$srcid_ip}) {
+ # Just a quick sanity error check.
+ errorLog("xmlDisplay for type='$type' srcid_ip='$srcid_ip' empty");
+ }
+ return $RSS{$type}{$srcid_ip};
}
}
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:36 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:36 +0900
Subject: [Slashdotjp-dev 381] CVS update: slashjp/Slash/Apache/Log
Message-ID: <20060712114136.EF0942AC0D3@users.sourceforge.jp>
Index: slashjp/Slash/Apache/Log/Log.pm
diff -u slashjp/Slash/Apache/Log/Log.pm:1.3 slashjp/Slash/Apache/Log/Log.pm:1.4
--- slashjp/Slash/Apache/Log/Log.pm:1.3 Fri Dec 31 21:35:43 2004
+++ slashjp/Slash/Apache/Log/Log.pm Wed Jul 12 20:41:36 2006
@@ -1,17 +1,16 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Log.pm,v 1.3 2004/12/31 12:35:43 oliver Exp $
+# $Id: Log.pm,v 1.4 2006/07/12 11:41:36 sugi Exp $
package Slash::Apache::Log;
use strict;
use Slash::Utility;
use Apache::Constants qw(:common);
-use File::Spec::Functions; # for clampe_stats, remove when done
use vars qw($VERSION);
-($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
# AMY: Leela's gonna kill me.
# BENDER: Naw, she'll probably have me do it.
@@ -34,17 +33,8 @@
my $uri = $r->uri;
my $dat = $r->err_header_out('SLASH_LOG_DATA');
- # Added this so that small sites would not have admin logins
- # recorded in their stats. -Brian
-
- # so it will still log it if the admin DOES request
- # to admin.pl? i thought you wanted it to NOT log
- # requests to admin.pl? should the !~ be =~ ?
- # or am i just not thinking clearly? -- pudge
-
- if (!$constants->{log_admin} && $uri !~ /admin\.pl/ ) {
- return OK if getCurrentUser('is_admin');
- }
+ # There used to be some (broken) logic here involving the
+ # log_admin var, but that's been moved to createLog().
createLog($uri, $dat, $r->status);
@@ -64,11 +54,12 @@
my($r) = @_;
my $user = getCurrentUser();
+ my $constants = getCurrentStatic();
+
return if !$user || !$user->{uid} || $user->{is_anon};
my $user_update = undef;
my $slashdb = getCurrentDB();
- my $constants = getCurrentStatic();
# First check to see if this is an admin who sent a password
# in cleartext. If so and if we want to flag that, flag it
@@ -88,13 +79,15 @@
# this is an admin who just sent a password in the clear.
# There are other less-important things that might get updated
# but none of them matters enough to continue processing.
- if ($op eq 'image' and !$user_update->{admin_clearpass}) {
+ if ($op eq 'image' && !$user_update->{admin_clearpass}) {
# print STDERR scalar(gmtime) . " $$ UserLog short-circuit image\n";
return ;
}
# For the below logic, note that if we're on an image hit,
# page_buying will be false.
+ # Err, and that doesn't matter since if we're on an image,
+ # we already returned. So I'm not sure why I wrote that.
if ($constants->{subscribe}
&& ($user->{is_subscriber} || !$constants->{subscribe_hits_only})
) {
@@ -106,6 +99,9 @@
my @gmt = gmtime;
my $today = sprintf("%04d%02d%02d",
$gmt[5]+1900, $gmt[4]+1, $gmt[3]);
+ # See the code near the end of MySQL.pm _getUser_do_selects()
+ # which forces $user->{lastclick} to be in the numeric format
+ # originally used by the MySQL 4.0 TIMESTAMP column type.
if ($today eq substr($user->{lastclick}, 0, 8)) {
# User may or may not be a subscriber, and may or may not
# be buying this page. The day has not rolled over.
@@ -145,13 +141,6 @@
}
$slashdb->setUser($user->{uid}, $user_update) if $user_update && %$user_update;
- # stats for clampe
- if ($constants->{clampe_stats} && $user->{uid} > 827000 && $user->{uid} < 832000) {
- my $fname = catfile('clampe', $user->{uid});
- my $comlog = "URL: $ENV{REQUEST_URI} IPID: $user->{ipid} UID: $user->{uid} Dispmode: $user->{mode} Thresh: $user->{threshold} Karma: $user->{karma}";
- doClampeLog($fname, [$comlog]);
- }
-
return OK;
}
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:37 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:37 +0900
Subject: [Slashdotjp-dev 382] CVS update: slashjp/Slash/Apache/TemplatePages
Message-ID: <20060712114137.1A04B2AC011@users.sourceforge.jp>
Index: slashjp/Slash/Apache/TemplatePages/TemplatePages.pm
diff -u slashjp/Slash/Apache/TemplatePages/TemplatePages.pm:1.3 slashjp/Slash/Apache/TemplatePages/TemplatePages.pm:1.4
--- slashjp/Slash/Apache/TemplatePages/TemplatePages.pm:1.3 Fri Dec 31 21:35:43 2004
+++ slashjp/Slash/Apache/TemplatePages/TemplatePages.pm Wed Jul 12 20:41:36 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: TemplatePages.pm,v 1.3 2004/12/31 12:35:43 oliver Exp $
+# $Id: TemplatePages.pm,v 1.4 2006/07/12 11:41:36 sugi Exp $
package Slash::Apache::TemplatePages;
@@ -11,7 +11,7 @@
use Apache::Constants qw(:common);
use vars qw($VERSION);
-($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
# AMY: Leela's gonna kill me.
# BENDER: Naw, she'll probably have me do it.
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:37 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:37 +0900
Subject: [Slashdotjp-dev 383] CVS update: slashjp/Slash/Apache/User
Message-ID: <20060712114137.3BA752AC0D6@users.sourceforge.jp>
Index: slashjp/Slash/Apache/User/User.pm
diff -u slashjp/Slash/Apache/User/User.pm:1.4 slashjp/Slash/Apache/User/User.pm:1.5
--- slashjp/Slash/Apache/User/User.pm:1.4 Fri Dec 31 21:35:44 2004
+++ slashjp/Slash/Apache/User/User.pm Wed Jul 12 20:41:37 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: User.pm,v 1.4 2004/12/31 12:35:44 oliver Exp $
+# $Id: User.pm,v 1.5 2006/07/12 11:41:37 sugi Exp $
package Slash::Apache::User;
@@ -24,7 +24,7 @@
@ISA = qw(DynaLoader);
$VERSION = '2.003000'; # v2.3.0
-($REVISION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($REVISION) = ' $Revision: 1.5 $ ' =~ /\$Revision:\s+([^\s]+)/;
bootstrap Slash::Apache::User $VERSION;
@@ -52,6 +52,13 @@
return DECLINED unless $r->is_main;
+ my $uri = $r->uri;
+
+ # Exclude any URL that matches the environment variable regex
+ if ($ENV{SLASH_EXCLUDE_URL_USERHANDLER}) {
+ return OK if $uri =~ /$ENV{SLASH_EXCLUDE_URL_USERHANDLER}/;
+ }
+
$request_start_time ||= Time::HiRes::time;
# Ok, this will make it so that we can reliably use Apache->request
@@ -64,11 +71,21 @@
my $apr = Apache::Request->new($r);
my $gSkin = getCurrentSkin();
- $r->header_out('X-Powered-By' => "Slash $Slash::VERSION");
- random($r);
+ my $reader_user = $slashdb->getDB('reader');
+ my $reader = getObject('Slash::DB', { virtual_user => $reader_user });
+
+ my $version_code = "Slash";
+ $version_code .= " $Slash::VERSION";
+ if ($constants->{cvs_tag_currentcode_emit}
+ && $constants->{cvs_tag_currentcode}
+ && $constants->{cvs_tag_currentcode} =~ /_(\d+)$/) {
+ $version_code .= sprintf("%03d", $1);
+ }
+ $r->header_out('X-Powered-By' => $version_code);
+
+ add_random_quote($r);
# let pass unless / or .pl
- my $uri = $r->uri;
if ($gSkin->{rootdir}) {
my $path = URI->new($gSkin->{rootdir})->path;
$uri =~ s/^\Q$path//;
@@ -77,6 +94,7 @@
my $is_ssl = Slash::Apache::ConnectionIsSSL();
$slashdb->sqlConnect;
+ $reader->sqlConnect;
##################################################
# Don't remove this. This solves a known bug in Apache -- brian
@@ -129,7 +147,8 @@
# want to save one bit of information there, and retrieve it
# later -- pudge
my $user_temp = getCurrentUser();
- $user_temp->{state}{login_temp} = 'no';
+ $user_temp->{state}{login_public} = 'no';
+ $user_temp->{state}{login_temp} = 'no';
$user_temp->{state}{login_failed_reason} = 0;
if ((($op eq 'userlogin' || $form->{rlogin}) && length($form->{upasswd}) > 1)
@@ -147,21 +166,18 @@
$logtoken = $form->{logtoken};
}
- # Don't allow login attempts from IPIDs that have been marked
- # as "nopost" -- those are mostly open proxies. Check both
- # the ipid and the subnetid (we can't use values in $user
- # because that doesn't get set up until prepareUser is called,
- # later in this function). Note we don't have to MD5 the
- # values, checkReadOnly() knows how to do that.
+ # Don't allow login attempts from IPIDs that have been
+ # marked as "nopost" or "nopostanon" -- those are mostly
+ # open proxies. Check both the ipid and the subnetid (we
+ # can't use values in $user because that doesn't get set
+ # up until prepareUser is called, later in this function).
+ # XXXSRCID: really should have a separate 'openproxy'
+ # attribute instead of piggybacking off 'nopost'.
my $read_only = 0;
my $hostip = $r->connection->remote_ip;
- my($ip, $subnet) = get_ipids($hostip, 1);
- if ($slashdb->checkReadOnly('nopost', { ipid => $ip })) {
- $read_only = 1;
- } else {
- $read_only = 1 if $slashdb->checkReadOnly('nopost', {
- subnetid => $subnet });
- }
+ my $srcids = get_srcids({ ip => $hostip });
+ $read_only = 1 if $reader->checkAL2($srcids, 'nopost')
+ || $reader->checkAL2($srcids, 'nopostanon');
my $newpass;
if ($read_only || !$tmpuid) {
@@ -222,13 +238,26 @@
# only allow this for certain pages/ops etc.
# and that page must doublecheck for permissions etc., still,
# redirecting user back to a main page upon failure
+ # ... it would be nice to have a way to set this in a table
+ # or vars or somesuch, but how? is there danger in
+ # opening it up to everything instead of closing it off?
+ # NOTE: this is only for "public" logtokens that are
+ # separate from regular login logtokens right now;
+ # it can be changed if necessary, it just happens that
+ # way, so we use it to set login_public
if (
- ($constants->{rss_allow_index} && $form->{content_type} eq 'rss' && $uri =~ m{^/index\.pl$})
+ ($constants->{rss_allow_index} && $form->{content_type} =~ $constants->{feed_types} && $uri =~ m{^/index\.pl$})
+ ||
+ ($constants->{plugin}{ScheduleShifts} && $uri =~ m{^/shifts\.pl$})
||
# hmmm ... journal.pl no work, because can be called as /journal/
- ($constants->{journal_rdfitemdesc_html} && $form->{content_type} eq 'rss' && $uri =~ m{\bjournal\b})
+ ($constants->{journal_rdfitemdesc_html}
+ && $form->{content_type} =~ $constants->{feed_types}
+ && $uri =~ m{\b(?:journal|messages|inbox)\b}
+ )
) {
$logtoken = $form->{logtoken};
+ $user_temp->{state}{login_public} = 'yes';
} else {
delete $form->{logtoken};
}
@@ -237,51 +266,50 @@
my($tmpuid, $value) = eatUserCookie($logtoken || ($cookies->{user} && $cookies->{user}->value));
my $cookvalue;
if ($tmpuid && $tmpuid > 0 && $tmpuid != $constants->{anonymous_coward_uid}) {
+ my $kind = $user_temp->{state}{login_public} eq 'yes' ? 4 : 0;
($uid, $cookvalue) =
- $slashdb->getUserAuthenticate($tmpuid, $value, 0, 1);
+ $slashdb->getUserAuthenticate($tmpuid, $value, $kind, 1);
}
# we don't want to set a cookie etc. if user is using a $logtoken,
# as that is just for RSS etc.
- if (!$logtoken && $uid && $op ne 'userclose') {
- # set cookie every time, in case session_login
- # value changes, or time is almost expired on
- # saved cookie, or password changes, or ...
-
- # can't set it every time, it upsets people.
- # we need to set it only if password or
- # session_login changes. -- pudge
-
- # if existing cookie is not a logtoken cookie, make it one
- if ($value !~ m|^[A-Za-z0-9/+]{22}$|) {
- setCookie('user', bakeUserCookie($uid, $cookvalue),
- $slashdb->getUser($uid, 'session_login')
- );
-
- # always set cookie for "temp" logins, on every request
- } elsif ($user_temp->{state}{login_temp} eq 'yes') {
- setCookie('user', bakeUserCookie($uid, $cookvalue), 2);
- }
-
- # blank out user cookie and make anon if user wants to log out, or
- # uses a bad cookie
- } elsif (!$logtoken && dbAvailable()) {
- if ($op eq 'userclose') {
- $slashdb->deleteLogToken($uid);
- }
+ if (!$logtoken) {
+ if ($uid && $op ne 'userclose') {
+ # set cookie every time, in case session_login
+ # value changes, or time is almost expired on
+ # saved cookie, or password changes, or ...
+
+ # can't set it every time, it upsets people.
+ # we need to set it only if password or
+ # session_login changes. -- pudge
+
+ # if existing cookie is not a logtoken cookie, make it one
+ if ($value !~ m|^[A-Za-z0-9/+]{22}$|) {
+ setCookie('user', bakeUserCookie($uid, $cookvalue),
+ $slashdb->getUser($uid, 'session_login')
+ );
+
+ # always set cookie for "temp" logins, on every request
+ } elsif ($user_temp->{state}{login_temp} eq 'yes') {
+ setCookie('user', bakeUserCookie($uid, $cookvalue), 2);
+ }
+
+ # blank out user cookie and make anon if user wants
+ # to log out, or uses a bad cookie
+ } elsif (dbAvailable()) {
+ if ($op eq 'userclose' && $uid) {
+ $slashdb->deleteLogToken($uid);
+ }
- $uid = $constants->{anonymous_coward_uid};
- delete $cookies->{user};
- # if you are here, chances are your cookie is bad,
- # so we blank it out for you. you're welcome.
- setCookie('user', '');
+ $uid = $constants->{anonymous_coward_uid};
+ delete $cookies->{user};
+ # if you are here, chances are your cookie is bad,
+ # so we blank it out for you. you're welcome.
+ setCookie('user', '');
+ }
}
} elsif ($op eq 'userclose') {
- # When did we comment out this? This means that even
- # if an author logs out, the other authors will
- # not know about it. Bad....
- #$slashdb->deleteSession(); # if $slashdb->getUser($uid, 'seclev') >= 99;
delete $cookies->{user};
setCookie('user', '');
}
@@ -324,7 +352,7 @@
$srand_called ||= 1;
# If this uid is marked as banned, deny them access.
- my $banlist = $slashdb->getBanList();
+ my $banlist = $reader->getBanList;
if ($banlist->{$uid}) {
# The global current user hasn't been created yet, so the
# template expects uid just passed in as the var named "uid".
@@ -332,7 +360,7 @@
slashDisplay('bannedtext_uid', { uid => $uid }, { Return => 1 } )
);
# Now we need to create a user hashref for that global
- # current user, so the "uid" field of accesslog gets written
+ # current user, so these fields of accesslog get written
# correctly when we log this attempted hit. We do this
# dummy hashref with the bare minimum of values that we need,
# instead of going through prepareUser(), because this is
@@ -354,12 +382,20 @@
if ($uri =~ /\.pl$/ || $uri =~ /\.tmpl$/) {
$user->{state}{_dynamic_page} = 1;
}
- $user->{state}{login_temp} = $user_temp->{state}{login_temp};
+ $user->{state}{login_public} = $user_temp->{state}{login_public};
+ $user->{state}{login_temp} = $user_temp->{state}{login_temp};
$user->{state}{login_failed_reason} = $user_temp->{state}{login_failed_reason};
$user->{state}{ssl} = $is_ssl;
createCurrentUser($user);
createCurrentForm($form);
+ if ($gSkin->{require_acl} && !$user->{acl}{$gSkin->{require_acl}}) {
+ $r->err_header_out(Location =>
+ URI->new_abs('/', $constants->{absolutedir})
+ );
+ return REDIRECT;
+ }
+
# If the user is connecting over SSL, make sure this is allowed.
# If allow_nonadmin_ssl is 0, then only admins are allowed in.
# If allow_nonadmin_ssl is 1, then anyone is allowed in.
@@ -417,7 +453,7 @@
createCurrentCookie($cookies);
createEnv($r) if $cfg->{env};
- authors($r) if $form->{'slashcode_authors'};
+ add_author_quotes($r) if $form->{slashcode_authors};
# a special test mode for getting a new template
# object (hence, fresh cache) for each request
@@ -457,15 +493,15 @@
}
########################################################
-# These are very import, do not delete these
-sub random {
+# These are very important, do not delete these
+sub add_random_quote {
my($r) = @_;
my $quote = $QUOTES[int(rand(@QUOTES))];
(my($who), $quote) = split(/: */, $quote, 2);
$r->header_out("X-$who" => $quote);
}
-sub authors {
+sub add_author_quotes {
my($r) = @_;
$r->header_out('X-Author-Krow' => "You can't grep a dead tree.");
$r->header_out('X-Author-Pudge' => "Bite me.");
@@ -477,6 +513,7 @@
sub userLogin {
my($uid_try, $passwd, $logtoken) = @_;
my $slashdb = getCurrentDB();
+ my($user) = getCurrentUser();
# only allow plain text passwords, unless logtoken is passed,
# then only allow that
@@ -490,7 +527,10 @@
if (!isAnon($uid)) {
setCookie('user', bakeUserCookie($uid, $cookvalue),
- $slashdb->getUser($uid, 'session_login'));
+ $user->{state}{login_temp} eq 'yes'
+ ? 2
+ : $slashdb->getUser($uid, 'session_login')
+ );
return($uid, $newpass);
} else {
my $gSkin = getCurrentSkin();
@@ -501,6 +541,10 @@
}
########################################################
+# XXX May want to rename this, since it's being used for a user's
+# prefs/info pages (/my/foo) and for the global handlers too (/foo).
+# Of course renaming requires editing a .conf file (see
+# bin/install-slashsite PerlTransHandler).
sub userdir_handler {
my($r) = @_;
@@ -516,6 +560,12 @@
$uri =~ s/^\S+\s+//;
$uri =~ s/\s+\S+$//;
$uri =~ s/\+/ /g;
+
+ my $logtoken;
+ if ($uri =~ s{(?:^|/)?(\d+(?::|%3[aA]){2}\w+)$}{}) {
+ $logtoken = $1;
+ }
+
my $saveuri = $uri;
$uri =~ s/%([a-fA-F0-9]{2})/pack('C', hex($1))/ge;
@@ -524,103 +574,156 @@
$uri =~ s/^\Q$path//;
}
+ # URIs like /tags and /tags/foo and /tags/foo?type=bar are special cases.
+ if ($uri =~ m[^/tags (?: /([^?]*) | /? ) (?: \?(.*) )? $]x) {
+ my($word, $query) = ($1, $2);
+ my @args = ( );
+ if ($word =~ /^(active|recent|all)$/) {
+ push @args, "type=$word";
+ } else {
+ push @args, "tagname=$word";
+ }
+ push @args, $query if defined $query;
+ $r->args(join('&', @args));
+ $r->uri('/tags.pl');
+ $r->filename($constants->{basedir} . '/tags.pl');
+ return OK;
+ }
+
# for self-references (/~/ and /my/)
if (($saveuri =~ m[^/(?:%7[eE]|~)] && $uri =~ m[^/~ (?: /(.*) | /? ) $]x)
# /my/ or /my can match, but not /mything
- or ($uri =~ m[^/my (?: /(.*) | /? ) $]x)
+ || $uri =~ m[^/my (?: /(.*) | /? ) $]x
) {
- my $match = $1;
- if ($r->header_in('Cookie') =~ $USER_MATCH) {
- my($op, $extra) = split /\//, $match, 2;
- if ($op eq 'journal') {
- my $args;
- if ($extra && $extra =~ /^\d+$/) {
- $args = "id=$extra&op=edit";
- } elsif ($extra && $extra eq 'friends') {
- $args = "op=friendview";
- } else {
- $args = "op=list";
+ my($string, $query) = ($1, '');
+ if ($string =~ s/\?(.+)$//) {
+ # This seems to have no effect, right? since $query
+ # is redeclared in a different scope below -Jamie
+ # This is in case something in this scope wants it -- pudge
+ $query = $1;
+ }
+
+ my($op, $extra) = split /\//, $string, 2;
+
+ my $logged_in = $r->header_in('Cookie') =~ $USER_MATCH;
+ my $try_login = !$logged_in && $logtoken;
+
+ my $found_the_op = 0;
+ if ($logged_in || $try_login) {
+ if ($op eq 'inbox') {
+ $found_the_op = 1;
+ my $args = 'op=list';
+ if ($extra =~ m{^ (rss|atom) /? $}x) {
+ $args .= '_rss';
+ $args .= "&logtoken=$logtoken" if $try_login;
+ $args .= "&content_type=$1";
}
+
$r->args($args);
- $r->uri('/journal.pl');
- $r->filename($constants->{basedir} . '/journal.pl');
- } elsif ($op eq 'discussions') {
- $r->args("op=personal_index");
- $r->uri('/comments.pl');
- $r->filename($constants->{basedir} . '/comments.pl');
- } elsif ($op eq 'inbox') {
- $r->args("op=list");
- $r->uri('/messages.pl');
- $r->filename($constants->{basedir} . '/messages.pl');
- } elsif ($op eq 'messages') { # XXX change to be same as /inbox, move this to /my/preferences/messages
- $r->args("op=display_prefs");
$r->uri('/messages.pl');
$r->filename($constants->{basedir} . '/messages.pl');
- } elsif ($op eq 'friends') {
- if ($extra eq 'friends') {
- $r->args("op=fof");
- $r->uri('/zoo.pl');
- $r->filename($constants->{basedir} . '/zoo.pl');
- } elsif ($extra eq 'foes') {
- $r->args("op=eof");
+ } elsif ($logged_in) {
+ $found_the_op = 1;
+ if ($op eq 'journal') {
+ my $args;
+ if ($extra && $extra =~ /^\d+$/) {
+ $args = "id=$extra&op=edit";
+ } elsif ($extra && $extra eq 'friends') {
+ $args = "op=friendview";
+ } else {
+ $args = "op=list";
+ }
+ $r->args($args);
+ $r->uri('/journal.pl');
+ $r->filename($constants->{basedir} . '/journal.pl');
+
+ } elsif ($op eq 'discussions') {
+ $r->args("op=personal_index");
+ $r->uri('/comments.pl');
+ $r->filename($constants->{basedir} . '/comments.pl');
+
+
+ } elsif ($op eq 'messages') { # XXX change to be same as /inbox, move this to /my/preferences/messages
+ $r->args("op=display_prefs");
+ $r->uri('/messages.pl');
+ $r->filename($constants->{basedir} . '/messages.pl');
+
+ } elsif ($op =~ /^(?:friends|fans|freaks|foes|zoo)$/) {
+ my $args = "op=$op";
+ $extra .= '/';
+
+ if ($op eq 'friends' && $extra =~ s/^friends\///) {
+ $args =~ s/friends/fof/;
+ } elsif ($op eq 'friends' && $extra =~ s/^foes\///) {
+ $args =~ s/friends/eof/;
+ } elsif ($op eq 'zoo') {
+ $args =~ s/zoo/all/;
+ }
+
+ $r->args($args);
$r->uri('/zoo.pl');
$r->filename($constants->{basedir} . '/zoo.pl');
+
+ } elsif ($op eq 'comments') {
+ $r->args("op=editcomm");
+ $r->uri('/users.pl');
+ $r->filename($constants->{basedir} . '/users.pl');
+
+ } elsif ($op eq 'homepage') {
+ $r->args("op=edithome");
+ $r->uri('/users.pl');
+ $r->filename($constants->{basedir} . '/users.pl');
+
+ } elsif ($op eq 'password') {
+ $r->args("op=changeprefs");
+ $r->uri('/login.pl');
+ $r->filename($constants->{basedir} . '/login.pl');
+
+ } elsif ($op eq 'logout') {
+ $r->args("op=userclose");
+ $r->uri('/login.pl');
+ $r->filename($constants->{basedir} . '/login.pl');
+
+ } elsif ($op eq 'misc') {
+ $r->args("op=editmiscopts");
+ $r->uri('/users.pl');
+ $r->filename($constants->{basedir} . '/users.pl');
+
+ } elsif ($op eq 'amigos') {
+ $r->args("op=friendview");
+ $r->uri('/journal.pl');
+ $r->filename($constants->{basedir} . '/journal.pl');
+
+ } elsif ($op eq 'tags') {
+ $r->args("op=showtags");
+ $r->uri('/users.pl');
+ $r->filename($constants->{basedir} . '/users.pl');
+
+ } elsif ($op eq 'bookmarks') {
+ $r->args("op=showbookmarks");
+ $r->uri('/users.pl');
+ $r->filename($constants->{basedir} . '/users.pl');
+
} else {
- $r->args("op=friends");
- $r->uri('/zoo.pl');
- $r->filename($constants->{basedir} . '/zoo.pl');
+ $r->args("op=edituser");
+ $r->uri('/users.pl');
+ $r->filename($constants->{basedir} . '/users.pl');
}
- } elsif ($op eq 'foes') {
- $r->args("op=foes");
- $r->uri('/zoo.pl');
- $r->filename($constants->{basedir} . '/zoo.pl');
- } elsif ($op eq 'fans') {
- $r->args("op=fans");
- $r->uri('/zoo.pl');
- $r->filename($constants->{basedir} . '/zoo.pl');
- } elsif ($op eq 'freaks') {
- $r->args("op=freaks");
- $r->uri('/zoo.pl');
- $r->filename($constants->{basedir} . '/zoo.pl');
- } elsif ($op eq 'zoo') {
- $r->args("op=all");
- $r->uri('/zoo.pl');
- $r->filename($constants->{basedir} . '/zoo.pl');
- } elsif ($op eq 'comments') {
- $r->args("op=editcomm");
- $r->uri('/users.pl');
- $r->filename($constants->{basedir} . '/users.pl');
- } elsif ($op eq 'homepage') {
- $r->args("op=edithome");
- $r->uri('/users.pl');
- $r->filename($constants->{basedir} . '/users.pl');
- } elsif ($op eq 'password') {
- $r->args("op=changeprefs");
- $r->uri('/login.pl');
- $r->filename($constants->{basedir} . '/login.pl');
- } elsif ($op eq 'logout') {
- $r->args("op=userclose");
- $r->uri('/login.pl');
- $r->filename($constants->{basedir} . '/login.pl');
- } elsif ($op eq 'misc') {
- $r->args("op=editmiscopts");
- $r->uri('/users.pl');
- $r->filename($constants->{basedir} . '/users.pl');
- } elsif ($op eq 'amigos') {
- $r->args("op=friendview");
- $r->uri('/journal.pl');
- $r->filename($constants->{basedir} . '/journal.pl');
- } else {
- $r->args("op=edituser");
- $r->uri('/users.pl');
- $r->filename($constants->{basedir} . '/users.pl');
}
- return OK;
- } else {
+
+ }
+ if (!$found_the_op) {
$r->uri('/login.pl');
$r->filename($constants->{basedir} . '/login.pl');
- return OK;
}
+
+ return OK;
+
+ } elsif ($uri =~ m[^/bookmarks (?: /(.*) | /? ) $]x) {
+ $r->args('op=showbookmarks');
+ $r->uri('/bookmark.pl');
+ $r->filename($constants->{basedir} . '/bookmark.pl');
+ return OK;
}
# assuming Apache/mod_perl is decoding the URL in ->uri before
@@ -638,7 +741,9 @@
}
my $slashdb = getCurrentDB();
- my $uid = $slashdb->getUserUID($nick);
+ my $reader_user = $slashdb->getDB('reader');
+ my $reader = getObject('Slash::DB', { virtual_user => $reader_user });
+ my $uid = $reader->getUserUID($nick);
$nick = fixparam($nick); # make safe to pass back to script
# maybe we should refactor this code a bit ...
@@ -664,12 +769,9 @@
if ($extra =~ s/^friends\///) {
$args =~ s/display/friendview/;
}
- if ($extra =~ /^rss(\/(\d+::\w+)?)?$/) {
- if ($2) {
- (my $logtoken = $2) =~ s/::/%3A%3A/;
- $args .= "&logtoken=$logtoken";
- }
- $args .= "&content_type=rss";
+ if ($extra =~ m{^ (rss|atom) / ? $}x) {
+ $args .= "&logtoken=$logtoken" if $logtoken;
+ $args .= "&content_type=$1";
}
}
$args .= "&$query";
@@ -697,42 +799,23 @@
$r->uri('/users.pl');
$r->filename($constants->{basedir} . '/users.pl');
- } elsif ($op eq 'friends') {
- if ($extra eq 'friends') {
- $r->args("op=fof&nick=$nick&uid=$uid");
- $r->uri('/zoo.pl');
- $r->filename($constants->{basedir} . '/zoo.pl');
- } elsif ($extra eq 'foes') {
- $r->args("op=eof&nick=$nick&uid=$uid");
- $r->uri('/zoo.pl');
- $r->filename($constants->{basedir} . '/zoo.pl');
- } else {
- $r->args("op=friends&nick=$nick&uid=$uid");
- $r->uri('/zoo.pl');
- $r->filename($constants->{basedir} . '/zoo.pl');
- }
- } elsif ($op eq 'friends.rdf') {
- $r->args("op=friends&nick=$nick&uid=$uid&content_type=foaf");
- $r->uri('/zoo.pl');
- $r->filename($constants->{basedir} . '/zoo.pl');
-
- } elsif ($op eq 'fans') {
- $r->args("op=fans&nick=$nick&uid=$uid");
- $r->uri('/zoo.pl');
- $r->filename($constants->{basedir} . '/zoo.pl');
+ } elsif ($op =~ /^(?:friends|fans|freaks|foes|zoo)$/) {
+ my $args = "op=$op&nick=$nick&uid=$uid";
+ $extra .= '/' . $more;
- } elsif ($op eq 'freaks') {
- $r->args("op=freaks&nick=$nick&uid=$uid");
- $r->uri('/zoo.pl');
- $r->filename($constants->{basedir} . '/zoo.pl');
+ if ($op eq 'friends' && $extra =~ s/^friends\///) {
+ $args =~ s/friends/fof/;
+ } elsif ($op eq 'friends' && $extra =~ s/^foes\///) {
+ $args =~ s/friends/eof/;
+ } elsif ($op eq 'zoo') {
+ $args =~ s/zoo/all/;
+ }
- } elsif ($op eq 'foes') {
- $r->args("op=foes&nick=$nick&uid=$uid");
- $r->uri('/zoo.pl');
- $r->filename($constants->{basedir} . '/zoo.pl');
+ if ($extra =~ m{^ (rss|atom) /?$}x) {
+ $args .= "&content_type=$1";
+ }
- } elsif ($op eq 'foes.rdf') {
- $r->args("op=foes&nick=$nick&uid=$uid&content_type=foaf");
+ $r->args($args);
$r->uri('/zoo.pl');
$r->filename($constants->{basedir} . '/zoo.pl');
@@ -741,10 +824,15 @@
$r->uri('/journal.pl');
$r->filename($constants->{basedir} . '/journal.pl');
- } elsif ($op eq 'foaf.rdf') {
- $r->args("op=foaf&nick=$nick&uid=$uid");
- $r->uri('/zoo.pl');
- $r->filename($constants->{basedir} . '/zoo.pl');
+ } elsif ($op eq 'tags') {
+ $r->args("op=showtags&nick=$nick&uid=$uid");
+ $r->uri('/users.pl');
+ $r->filename($constants->{basedir} . '/users.pl');
+
+ } elsif ($op eq 'bookmarks') {
+ $r->args("op=showbookmarks&nick=$nick&uid=$uid");
+ $r->uri('/users.pl');
+ $r->filename($constants->{basedir} . '/users.pl');
} else {
$r->args("nick=$nick&uid=$uid");
@@ -811,6 +899,8 @@
Bender:Boy, who knew a cooler could also make a handy wang coffin?
Bender:I'm so embarrassed. I wish everybody else was dead.
Bender:Professor! Make a woman out of me!
+Bender:Would we have donkeys?
+Bender:Emotions are dumb and should be hated.
Bender:An upgrade? I thought we all agreed I was perfect.
Bender:Curse you, merciful Poseidon!
Bender:I am a hideous triumph of form and function.
@@ -826,9 +916,20 @@
Bender:I choose to not understand these signs!
Bender:Aw, this bends!
Bender:Farewell, big blue ball of idiots!
-Bender:This guy's not making any sense. Can I kill him? Please?
+Bender:This guy's not making any sense. Can I kill him? Please?
Bender:Hooray, we don't have to do anything!
Bender:I only speak enough binary to ask where the bathroom is.
+Bender:nogoodlawsprotectingtheinnocent--
+Bender:Senseless death! The folk singer's best friend!
+Bender:Alright! Closure!
+Bender:You just lost five dollars.
+Bender:That's not my gold-plated 25-pin connector.
+Bender:I only know enough binary to ask where the bathroom is.
+Bender:Why would God think in binary?
+Bender:You can't count on God for jack! He pretty much told me so himself.
+Bender:Stop doing the right thing, you jerk!
+Bender:Are you familiar with the old robot saying "does not compute"?
+Bender:The sparks keep me warm.
Fry:There's a lot about my face you don't know.
Fry:These new hands are great. I'm gonna break them in tonight.
Fry:I refuse to testify on the grounds that my organs will be chopped up into a patty.
@@ -838,6 +939,7 @@
Fry:People said I was dumb but I proved them!
Fry:It's like a party in my mouth and everyone's throwing up.
Fry:I don't regret this, but I both rue and lament it.
+Fry:You'll barely regret this.
Fry:I'm never gonna get used to the thirty-first century. Caffeinated bacon?
Fry:They're great! They're like sex except I'm having them.
Fry:No, no, I was just picking my nose.
@@ -860,9 +962,28 @@
Fry:The butter in my pocket is melting!
Fry:Stop abducting me!
Fry:What kind of bozos would start a Bender protest group?
-Fry:I can burp the alphabet. A, B, D ... no, wait ...
+Fry:I can burp the alphabet. A, B, D ... no, wait ...
Fry:Why use my own legs like an idiot when I can use a Chickenwalker?
Fry:Hooray, we don't have to do anything!
+Fry:Prepare to be thought at!
+Fry:I did it! And it's all thanks to the books at my local library.
+Fry:Existing is basically all I do!
+Fry:It's a widely-believed fact!
+Fry:My hands! My horrible, human hands!
+Fry:How about me? I'm human, and I've always wanted to see the future!
+Fry:The less fortunate get all the breaks!
+Fry:Please, Mr. Nixon! We're appealing to your sense of decency!
+Fry:I have more important things to do today than laugh and clap my hands.
+Fry:I'll be whatever I wanna do.
+Fry:There's a political debate on. Quick, change the channel!
+Leela:There's a political debate on. Quick, change the channel!
+Leela:You did the best you could, I guess, and some of these gorillas are okay.
+Leela:This wangs chung.
+Leela:This toads the wet sprocket.
+Leela:He opened up relations with China. He doesn't want to hear about your ding-dong.
+Leela:This is by a wide margin the least likely thing that has ever happened.
+Leela:I'm a millionaire! Suddenly I have an opinion about the capital gains tax.
+Leela:Do you have idiots on your planet?
EOT
1;
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:37 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:37 +0900
Subject: [Slashdotjp-dev 384] CVS update: slashjp/Slash/Client
Message-ID: <20060712114137.61AC82AC011@users.sourceforge.jp>
Index: slashjp/Slash/Client/.cvsignore
diff -u /dev/null slashjp/Slash/Client/.cvsignore:1.1
--- /dev/null Wed Jul 12 20:41:37 2006
+++ slashjp/Slash/Client/.cvsignore Wed Jul 12 20:41:37 2006
@@ -0,0 +1,2 @@
+Slash-Client-*
+.lwpcookies
Index: slashjp/Slash/Client/.releaserc
diff -u /dev/null slashjp/Slash/Client/.releaserc:1.1
--- /dev/null Wed Jul 12 20:41:37 2006
+++ slashjp/Slash/Client/.releaserc Wed Jul 12 20:41:37 2006
@@ -0,0 +1,6 @@
+cpan_user=CNANDOR
+sf_user=pudge
+sf_group_id=4421
+sf_package_id=170031
+sf_release_match=^.+-([\d.]+)$
+sf_release_replace=$1
Index: slashjp/Slash/Client/MANIFEST
diff -u /dev/null slashjp/Slash/Client/MANIFEST:1.1
--- /dev/null Wed Jul 12 20:41:37 2006
+++ slashjp/Slash/Client/MANIFEST Wed Jul 12 20:41:37 2006
@@ -0,0 +1,7 @@
+lib/Slash/Client.pm
+lib/Slash/Client/Journal.pm
+Makefile.PL
+MANIFEST
+README
+t/journal.t
+t/pod.t
Index: slashjp/Slash/Client/Makefile.PL
diff -u /dev/null slashjp/Slash/Client/Makefile.PL:1.1
--- /dev/null Wed Jul 12 20:41:37 2006
+++ slashjp/Slash/Client/Makefile.PL Wed Jul 12 20:41:37 2006
@@ -0,0 +1,13 @@
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+ 'NAME' => 'Slash::Client',
+ 'VERSION_FROM' => 'lib/Slash/Client.pm',
+ 'clean' => {
+ 'FILES' => 'Slash-Client-*'
+ },
+ 'NO_META' => 1,
+ 'PREREQ_PM' => {
+ 'SOAP::Lite' => 0,
+ },
+);
Index: slashjp/Slash/Client/README
diff -u /dev/null slashjp/Slash/Client/README:1.1
--- /dev/null Wed Jul 12 20:41:37 2006
+++ slashjp/Slash/Client/README Wed Jul 12 20:41:37 2006
@@ -0,0 +1,4 @@
+# $Id: README,v 1.1 2006/07/12 11:41:37 sugi Exp $
+
+This is an API for writing Slash clients. Read the POD for more information.
+Right now, it is only useful for writing SOAP clients for Slash journals.
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:37 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:37 +0900
Subject: [Slashdotjp-dev 385] CVS update: slashjp/Slash/Client/lib/Slash
Message-ID: <20060712114137.80BE02AC0D3@users.sourceforge.jp>
Index: slashjp/Slash/Client/lib/Slash/Client.pm
diff -u /dev/null slashjp/Slash/Client/lib/Slash/Client.pm:1.1
--- /dev/null Wed Jul 12 20:41:37 2006
+++ slashjp/Slash/Client/lib/Slash/Client.pm Wed Jul 12 20:41:37 2006
@@ -0,0 +1,207 @@
+# This code is a part of Slash, and is released under the GPL.
+# Copyright 1997-2005 by Open Source Technology Group. See README
+# and COPYING for more information, or see http://slashcode.com/.
+# $Id: Client.pm,v 1.1 2006/07/12 11:41:37 sugi Exp $
+
+package Slash::Client;
+
+use strict;
+use warnings;
+
+use Digest::MD5 'md5_hex';
+use File::Spec::Functions;
+
+our $VERSION = 0.01;
+
+sub new {
+ my($class, $opts) = @_;
+
+ my $self = {};
+ $self->{host} = $opts->{host} or return;
+ $self->{http} = $opts->{ssl} ? 'https' : 'http';
+
+ $self->{uid} = $opts->{uid};
+ $self->{pass} = $opts->{pass};
+ $self->{logtoken} = $opts->{logtoken};
+ $self->{cookie_file} = $opts->{cookie_file};
+
+ bless $self, $class;
+ return $self;
+}
+
+sub soap {
+ my($self) = @_;
+ my $uri = $self->{soap}{uri} or return;
+ my $proxy = $self->{soap}{proxy} or return;
+
+ return $self->{soap}{cache} if $self->{soap}{cache};
+
+ require HTTP::Cookies;
+ require SOAP::Lite;
+
+ my $cookies = HTTP::Cookies->new;
+
+ if ($self->{logtoken}) {
+ $cookies->set_cookie(0, user => $self->{logtoken}, '/', $self->{host});
+
+ } elsif ($self->{uid} && $self->{pass}) {
+ my $cookie = bakeUserCookie($self->{uid}, $self->{pass});
+ $cookies->set_cookie(0, user => $cookie, '/', $self->{host});
+
+ } else {
+ my $cookie_file = $self->{cookie_file} || find_cookie_file();
+ if ($cookie_file) {
+ $cookies = HTTP::Cookies::Netscape->new;
+ $cookies->load($cookie_file);
+ }
+ }
+
+ my $soap = SOAP::Lite->uri($uri)->proxy($proxy, cookie_jar => $cookies);
+ $self->{soap}{cache} = $soap;
+ return $soap;
+}
+
+
+sub find_cookie_file {
+ my $app = shift || 'Firefox';
+ my $file;
+ if ($^O eq 'MacOS' || $^O eq 'darwin') {
+ require Mac::Files;
+ Mac::Files->import(':DEFAULT');
+
+ my($dir, $vref, $type);
+ if ($^O eq 'darwin') {
+ $vref = &kUserDomain;
+ if ($app eq 'Chimera' || $app eq 'Firefox') {
+ $type = &kApplicationSupportFolderType;
+ } elsif ($app eq 'Mozilla') {
+ $type = &kDomainLibraryFolderType;
+ }
+ } elsif ($^O eq 'MacOS') {
+ $vref = &kOnSystemDisk;
+ $type = &kDocumentsFolderType;
+ }
+
+ $dir = FindFolder($vref, $type, &kDontCreateFolder);
+ $dir = catdir($dir, $app, 'Profiles');
+ for (0, 1) {
+ last if -e catfile($dir, 'cookies.txt');
+ opendir(my $dh, $dir) or die "Can't open $dir: $!";
+ $dir = catdir($dir, (grep !/^\./, readdir($dh))[0]);
+ closedir($dh);
+ }
+ $file = catfile($dir, 'cookies.txt');
+ }
+ return $file;
+}
+
+sub bakeUserCookie {
+ my($uid, $pass) = @_;
+ my $cookie = $uid . '::' . md5_hex($pass);
+ $cookie =~ s/(.)/sprintf("%%%02x", ord($1))/ge;
+ $cookie =~ s/%/%25/g;
+ return $cookie;
+}
+
+sub literal {
+ my($str) = @_;
+ $str =~ s/&/&/g;
+ $str =~ s/</og;
+ $str =~ s/>/>/og;
+ return $str;
+}
+
+sub fixparam {
+ my($str) = @_;
+ $str =~ s/([^$URI::unreserved ])/$URI::Escape::escapes{$1}/og;
+ $str =~ s/ /+/g;
+ return $str;
+}
+
+1;
+
+__END__
+
+=head1 NAME
+
+Slash::Client - Write clients for Slash
+
+=head1 SYNOPSIS
+
+ my $client = Slash::Client::Journal->new({
+ host => 'use.perl.org',
+ });
+ my $entry = $client->get_entry(10_000);
+
+=head1 DESCRIPTION
+
+Slash::Client allows writing clients to access Slash. So far, only one
+client is implemented: accessing journals, which is done via SOAP. See
+L for more information.
+
+=head2 Constructor
+
+You create an object with the C constructor, which takes a hashref
+of options.
+
+=over 4
+
+=item host
+
+The Slash site's host name.
+
+=item ssl
+
+Boolean, true if the Slash site can be accessed via SSL.
+
+=item uid
+
+=item pass
+
+If uid and pass have true values, they are used to construct the cookie
+for authentication purposes. See L.
+
+=item logtoken
+
+Logtoken is used for the cookie if it is passed.
+
+=item cookie_file
+
+Path to the file in Netscape format containing a cookie.
+
+=back
+
+=head2 Authentication
+
+Some methods require authentication; others may require authentication,
+depending on the site.
+
+There are three ways to authenticate. The first that's tried is uid/pass.
+If those are not supplied, logtoken is used: this is the value actually
+stored in the browser cookie (and used in the query string for some
+user-authenticated feed URLS). The third is to just try to load the cookie
+from a cookie file, either passing in a path in cookie_file, or trying to
+find the file automatically.
+
+I've only tested the cookie authentication recently with Firefox on Mac OS X.
+Feel free to submit patches for other browsers and platforms.
+
+If the given authentication method fails, others are not attempted, and the
+method will attempt to execute anyway.
+
+
+=head1 TODO
+
+Work on error handling.
+
+Other platforms for finding/reading cookies.
+
+
+=head1 SEE ALSO
+
+Slash::Client::Journal(3).
+
+
+=head1 VERSION
+
+$Id: Client.pm,v 1.1 2006/07/12 11:41:37 sugi Exp $
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:37 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:37 +0900
Subject: [Slashdotjp-dev 386] CVS update: slashjp/Slash/Client/lib/Slash/Client
Message-ID: <20060712114137.A74E02AC0D6@users.sourceforge.jp>
Index: slashjp/Slash/Client/lib/Slash/Client/Journal.pm
diff -u /dev/null slashjp/Slash/Client/lib/Slash/Client/Journal.pm:1.1
--- /dev/null Wed Jul 12 20:41:37 2006
+++ slashjp/Slash/Client/lib/Slash/Client/Journal.pm Wed Jul 12 20:41:37 2006
@@ -0,0 +1,189 @@
+# This code is a part of Slash, and is released under the GPL.
+# Copyright 1997-2005 by Open Source Technology Group. See README
+# and COPYING for more information, or see http://slashcode.com/.
+# $Id: Journal.pm,v 1.1 2006/07/12 11:41:37 sugi Exp $
+
+package Slash::Client::Journal;
+
+use strict;
+use warnings;
+
+use base 'Slash::Client';
+
+our $VERSION = 0.01;
+
+sub new {
+ my($class, $opts) = @_;
+
+ my $self = $class->SUPER::new($opts);
+ $self->{soap}{uri} = "$self->{http}://$self->{host}/Slash/Journal/SOAP";
+ $self->{soap}{proxy} = "$self->{http}://$self->{host}/journal.pl";
+
+ return $self;
+}
+
+sub _return_from_entry {
+ my($self, $id, $list) = @_;
+
+ if ($list) {
+ my $entry = $self->get_entry($id);
+ return($id, $entry->{url}) if $entry && $entry->{url};
+ } else {
+ return $id;
+ }
+
+ return;
+}
+
+sub add_entry {
+ my($self, $data) = @_;
+
+ $data->{body} =~ s/\n/\012/g; # Local to Unix newlines, JIC
+
+ my $id = 0;
+ if ($data->{subject} && $data->{body}) {
+ $id = $self->soap->add_entry($data)->result;
+ }
+
+ return $self->_return_from_entry($id, wantarray());
+}
+
+sub modify_entry {
+ my($self, $id, $data) = @_;
+
+ $data->{body} =~ s/\n/\012/g; # Local to Unix newlines, JIC
+
+ my $newid = 0;
+ if ($data->{subject} && $data->{body} && $id) {
+ $newid = $self->soap->modify_entry($id, $data)->result;
+ }
+
+ return $self->_return_from_entry($id, wantarray());
+}
+
+sub delete_entry {
+ my($self, $id) = @_;
+
+ return $self->soap->delete_entry($id)->result;
+}
+
+sub get_entry {
+ my($self, $id) = @_;
+
+ return $self->soap->get_entry($id)->result;
+}
+
+sub get_entries {
+ my($self, $uid, $limit) = @_;
+
+ return $self->soap->get_entries($uid, $limit)->result;
+}
+
+1;
+
+# http://use.perl.org/~pudge/journal/3294
+
+__END__
+
+=head1 NAME
+
+Slash::Client::Journal - Write journal clients for Slash
+
+=head1 SYNOPSIS
+
+ my $client = Slash::Client::Journal->new({
+ host => 'use.perl.org',
+ });
+ my $entry = $client->get_entry(10_000);
+
+=head1 DESCRIPTION
+
+Slash::Client::Journal provides an API for writing clients for Slash journals.
+
+See L for details on authentication and for more information.
+
+=head2 Methods
+
+=over 4
+
+=item add_entry(HASHREF)
+
+Add an entry. Must be authenticated.
+
+Pass key-value pairs for C and C (both required). Other optional
+keys are C, C, and C.
+
+C is a boolean for turning on discussions. If false, comments
+are not turned on. If true, the user's prefs on the site are used (which
+is also the default).
+
+C is an integer defining the post types. This is subject to change,
+but is currently: 1 = Plain Old Text, 2 = HTML Formatted,
+3 = Extrans (html tags to text), 4 = Code. Again, default is to simply use
+the user's preferences.
+
+C is a topic ID. This varies widely between Slash sites. To get a list,
+view the source of the journal editing page and look for the "tid" form values.
+
+In scalar context, returns the unique ID of the new entry, or false if failure.
+
+In list context, on success, returns the URL to the new journal entry as
+the second list element.
+
+
+=item modify_entry(ID, HASHREF)
+
+Modify an existing entry. Must be authenticated.
+
+Parameters are just like C. (Note: C cannot be modified
+if a discussion had already been created for the entry.)
+
+In scalar context, returns the unique ID of the modified entry, or false if
+failure.
+
+In list context, on success, returns the URL to the modified journal entry as
+the second list element.
+
+
+=item delete_entry(ID)
+
+Deletes an existing entry. Must be authenticated.
+
+Returns true on success, false on error.
+
+
+=item get_entries(UID [, LIMIT])
+
+Gets the entries for a given user. If LIMIT is not supplied, a site-defined
+LIMIT is used.
+
+Returns an arrayref of hashrefs, where each hashref is an entry, with the keys
+being the entry's id, URL, and subject.
+
+Returns false on error.
+
+
+=item get_entry(ID)
+
+Get an entry. Returns lots of information about the entry, including uid,
+nickname, date, subject, discussion ID, tid, body, URL, id, posttype,
+and discussion URL.
+
+Returns false on error.
+
+=back
+
+
+=head1 TODO
+
+Work on error handling.
+
+
+=head1 SEE ALSO
+
+Slash::Client(3).
+
+
+=head1 VERSION
+
+$Id: Journal.pm,v 1.1 2006/07/12 11:41:37 sugi Exp $
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:37 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:37 +0900
Subject: [Slashdotjp-dev 387] CVS update: slashjp/Slash/Client/t
Message-ID: <20060712114137.CF80C2AC011@users.sourceforge.jp>
Index: slashjp/Slash/Client/t/journal.t
diff -u /dev/null slashjp/Slash/Client/t/journal.t:1.1
--- /dev/null Wed Jul 12 20:41:37 2006
+++ slashjp/Slash/Client/t/journal.t Wed Jul 12 20:41:37 2006
@@ -0,0 +1,40 @@
+#!/usr/bin/perl -w
+use Test::More;
+use strict;
+
+BEGIN {
+ $|++;
+ plan tests => 10;
+ use_ok('Slash::Client');
+ use_ok('Slash::Client::Journal');
+}
+
+my $id = 10_000;
+my $host = 'use.perl.org';
+
+my %checks = (
+ id => $id,
+ discussion_id => 10676,
+ uid => 44,
+ nickname => 'brian_d_foy',
+ subject => '10,000th post',
+);
+
+
+my $client = Slash::Client::Journal->new({
+ host => $host,
+ uid => '-', # NOTE: setting uid/pass to bad values ensures
+ pass => '-' # we don't get logged in, which is what we want,
+ # to ensure we don't delete anything by accident
+});
+ok($client, 'Create object');
+
+my $result = $client->get_entry($id);
+ok($result, 'Get entry');
+
+for (sort keys %checks) {
+ is($checks{$_}, $result->{$_}, "Check return value for $_");
+}
+
+ok(!$client->delete_entry($id), "Can't delete, we aren't logged in");
+
Index: slashjp/Slash/Client/t/pod.t
diff -u /dev/null slashjp/Slash/Client/t/pod.t:1.1
--- /dev/null Wed Jul 12 20:41:37 2006
+++ slashjp/Slash/Client/t/pod.t Wed Jul 12 20:41:37 2006
@@ -0,0 +1,22 @@
+#!/usr/bin/perl -w
+use strict;
+use Test::More;
+use File::Spec;
+use File::Find;
+
+eval "use Test::Pod 0.95";
+
+if ($@) {
+ plan skip_all => "Test::Pod v0.95 required for testing POD";
+} else {
+ Test::Pod->import;
+ my @files;
+ my $blib = File::Spec->catfile(qw(blib lib));
+ find( sub {push @files, $File::Find::name if /\.p(l|m|od)$/}, $blib);
+ plan tests => scalar @files;
+ foreach my $file (@files) {
+ pod_file_ok($file);
+ }
+}
+
+__END__
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:37 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:37 +0900
Subject: [Slashdotjp-dev 388] CVS update: slashjp/Slash/Constants
Message-ID: <20060712114137.F0EC82AC0D3@users.sourceforge.jp>
Index: slashjp/Slash/Constants/Constants.pm
diff -u slashjp/Slash/Constants/Constants.pm:1.2 slashjp/Slash/Constants/Constants.pm:1.3
--- slashjp/Slash/Constants/Constants.pm:1.2 Wed Dec 22 18:13:32 2004
+++ slashjp/Slash/Constants/Constants.pm Wed Jul 12 20:41:37 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Constants.pm,v 1.2 2004/12/22 09:13:32 oliver Exp $
+# $Id: Constants.pm,v 1.3 2006/07/12 11:41:37 sugi Exp $
package Slash::Constants;
@@ -29,7 +29,7 @@
use base 'Exporter';
use vars qw(@ISA $VERSION @EXPORT @EXPORT_OK %EXPORT_TAGS %CONSTANTS);
-($VERSION) = ' $Revision: 1.2 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
constants();
@EXPORT = qw();
@@ -111,10 +111,14 @@
MSG_CODE_ZOO_CHANGE
MSG_CODE_BADPASSWORD
MSG_CODE_MODSTATS
+ MSG_CODE_SUBSCRIPTION_LOW
+ MSG_CODE_SUBSCRIPTION_OUT
+ MSG_CODE_SCHEDULECHG
+ MSG_CODE_HTML_INVALID
=cut
-# -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
+# -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
=pod
@@ -137,6 +141,19 @@
# 0 1
+=head2 reskey
+
+These constants are used for resource keys.
+
+ RESKEY_NOOP
+ RESKEY_SUCCESS
+ RESKEY_FAILURE
+ RESKEY_DEATH
+
+=cut
+
+# -1 0 1 2
+
=head2 strip
These constants are used to define the modes passed to stripByMode(). Only
@@ -199,4 +216,4 @@
=head1 VERSION
-$Id: Constants.pm,v 1.2 2004/12/22 09:13:32 oliver Exp $
+$Id: Constants.pm,v 1.3 2006/07/12 11:41:37 sugi Exp $
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:38 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:38 +0900
Subject: [Slashdotjp-dev 389] CVS update: slashjp/Slash/Custom/ApacheCompress
Message-ID: <20060712114138.249442AC0D6@users.sourceforge.jp>
Index: slashjp/Slash/Custom/ApacheCompress/ApacheCompress.pm
diff -u slashjp/Slash/Custom/ApacheCompress/ApacheCompress.pm:1.1 slashjp/Slash/Custom/ApacheCompress/ApacheCompress.pm:1.2
--- slashjp/Slash/Custom/ApacheCompress/ApacheCompress.pm:1.1 Wed Dec 22 18:13:32 2004
+++ slashjp/Slash/Custom/ApacheCompress/ApacheCompress.pm Wed Jul 12 20:41:37 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: ApacheCompress.pm,v 1.1 2004/12/22 09:13:32 oliver Exp $
+# $Id: ApacheCompress.pm,v 1.2 2006/07/12 11:41:37 sugi Exp $
# this merely overrides a "broken" method in Apache::SSI,
# where include directives don't work for mixing with Apache::Compress
@@ -20,12 +20,13 @@
use Apache::File;
use Apache::Constants qw(:common);
-($VERSION) = ' $Revision: 1.1 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.2 $ ' =~ /\$Revision:\s+([^\s]+)/;
sub handler {
my $r = shift;
+
+ my $can_gzip = can_gzip($r);
- my $can_gzip = $r->header_in('Accept-Encoding') =~ /gzip/;
my $filter = lc $r->dir_config('Filter') eq 'on';
#warn "can_gzip=$can_gzip, filter=$filter";
return DECLINED unless $can_gzip or $filter;
@@ -33,8 +34,8 @@
# Other people's eyes need to check this 1.1 stuff.
if ($r->protocol =~ /1\.1/) {
my %vary = map {$_,1} qw(Accept-Encoding User-Agent);
- if (my @vary = $r->header_out('Vary')) {
- @vary{@vary} = ();
+ if (my $vary = $r->header_out('Vary')||0) {
+ $vary{$vary} = 1;
}
$r->header_out('Vary' => join ',', keys %vary);
}
@@ -56,8 +57,8 @@
if ($can_gzip) {
$r->content_encoding('gzip');
$r->send_http_header;
- local $/;
- print Compress::Zlib::memGzip(<$fh>);
+# $r->print( Compress::Zlib::memGzip(do {local $/; <$fh>}) );
+ print( Compress::Zlib::memGzip(do {local $/; <$fh>}) );
} else {
$r->send_http_header;
$r->send_fd($fh);
@@ -66,8 +67,47 @@
return OK;
}
-1;
+sub can_gzip {
+ my $r = shift;
+
+ my $how_decide = $r->dir_config('CompressDecision');
+ if (!defined($how_decide) || lc($how_decide) eq 'header') {
+ return +($r->header_in('Accept-Encoding')||'') =~ /gzip/;
+ } elsif (lc($how_decide) eq 'user-agent') {
+ return guess_by_user_agent($r->header_in('User-Agent'));
+ }
+
+ die "Unrecognized value '$how_decide' specified for CompressDecision";
+}
+
+sub guess_by_user_agent {
+ # This comes from Andreas' Apache::GzipChain. It's very out of
+ # date, though, I'd like it if someone sent me a better regex.
+
+ my $ua = shift;
+ return $ua =~ m{
+ ^Mozilla/ # They all start with Mozilla...
+ \d+\.\d+ # Version string
+ [\s\[\]\w\-]+ # Language
+ (?:
+ \(X11 # Any unix browser should work
+ |
+ Macint.+PPC,\sNav # Does this match anything??
+ )
+ }x;
+}
+
1;
+
+# Verbose version:
+# my $content = do {local $/; <$fh>};
+# my $content_size = length($content);
+# $content = Compress::Zlib::memGzip(\$content);
+# my $compressed_size = length($content);
+# my $ratio = int(100*$compressed_size/$content_size) if $content_size;
+# print STDERR "GzipCompression $content_size/$compressed_size ($ratio%)\n";
+# print $content;
+
__END__
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:38 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:38 +0900
Subject: [Slashdotjp-dev 390] CVS update:
slashjp/Slash/Custom/ApacheRegistryFilter
Message-ID: <20060712114138.43AC72AC011@users.sourceforge.jp>
Index: slashjp/Slash/Custom/ApacheRegistryFilter/ApacheRegistryFilter.pm
diff -u slashjp/Slash/Custom/ApacheRegistryFilter/ApacheRegistryFilter.pm:1.1 slashjp/Slash/Custom/ApacheRegistryFilter/ApacheRegistryFilter.pm:1.2
--- slashjp/Slash/Custom/ApacheRegistryFilter/ApacheRegistryFilter.pm:1.1 Wed Dec 22 18:13:32 2004
+++ slashjp/Slash/Custom/ApacheRegistryFilter/ApacheRegistryFilter.pm Wed Jul 12 20:41:38 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: ApacheRegistryFilter.pm,v 1.1 2004/12/22 09:13:32 oliver Exp $
+# $Id: ApacheRegistryFilter.pm,v 1.2 2006/07/12 11:41:38 sugi Exp $
# this merely overrides a "broken" method in Apache::SSI,
# where include directives don't work for mixing with Apache::Compress
@@ -18,7 +18,7 @@
use Apache::Constants qw(:common);
-($VERSION) = ' $Revision: 1.1 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.2 $ ' =~ /\$Revision:\s+([^\s]+)/;
sub handler ($$) {
my ($class, $r) = @_ > 1 ? (shift, shift) : (__PACKAGE__, shift);
@@ -39,13 +39,11 @@
# We temporarily override the header-sending routines to make them
# noops. This lets people leave these methods in their scripts.
- my $warn = $^W;
- undef $^W;
+ no warnings 'redefine';
local *Apache::send_http_header = sub {
$r->content_type($_[0]) if @_;
};
local *Apache::send_cgi_header = sub {};
- $^W = $warn;
$pr->SUPER::run(@_);
}
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:38 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:38 +0900
Subject: [Slashdotjp-dev 391] CVS update: slashjp/Slash/Custom/ApacheSSI
Message-ID: <20060712114138.61F242AC0D3@users.sourceforge.jp>
Index: slashjp/Slash/Custom/ApacheSSI/ApacheSSI.pm
diff -u slashjp/Slash/Custom/ApacheSSI/ApacheSSI.pm:1.1 slashjp/Slash/Custom/ApacheSSI/ApacheSSI.pm:1.2
--- slashjp/Slash/Custom/ApacheSSI/ApacheSSI.pm:1.1 Wed Dec 22 18:13:33 2004
+++ slashjp/Slash/Custom/ApacheSSI/ApacheSSI.pm Wed Jul 12 20:41:38 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: ApacheSSI.pm,v 1.1 2004/12/22 09:13:33 oliver Exp $
+# $Id: ApacheSSI.pm,v 1.2 2006/07/12 11:41:38 sugi Exp $
# this merely overrides a "broken" method in Apache::SSI,
# where include directives don't work for mixing with Apache::Compress
@@ -16,9 +16,25 @@
use base 'Apache::SSI';
use vars qw($VERSION);
-use Apache::Constants qw(:common OPT_INCNOEXEC);
+use Apache::Constants qw(:common :http OPT_INCNOEXEC);
-($VERSION) = ' $Revision: 1.1 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.2 $ ' =~ /\$Revision:\s+([^\s]+)/;
+
+sub output {
+ my $self = shift;
+
+ my @parts = split m/()/s, $self->{'text'};
+ while (@parts) {
+# $self->{_r}->print( ('', shift @parts)[1-$self->{'suspend'}[0]] );
+ print( ('', shift @parts)[1-$self->{'suspend'}[0]] );
+ last unless @parts;
+ my $ssi = shift @parts;
+ if ($ssi =~ m/^$/s) {
+# $self->{_r}->print( $self->output_ssi($1) );
+ print( $self->output_ssi($1) );
+ } else { die 'Parse error' }
+ }
+}
sub ssi_perl {
my($self, $args, $margs) = @_;
@@ -41,17 +57,16 @@
$self->error("Include of ", $subr->filename, " failed: $!");
}
} else {
- unless ($subr->run == OK) {
- $self->error("Include of '@{[$subr->filename()]}' failed: $!");
+ if ( $subr->status == HTTP_OK ) {
+ # Subrequests can fuck up %ENV, make sure it's restored upon exit.
+ # Unfortunately 'local(%ENV)=%ENV' reportedly causes segfaults.
+ my %save_ENV = %ENV;
+ $subr->run == OK
+ or $self->error("Include of '@{[$subr->filename()]}' failed: $!");
+ %ENV = %save_ENV;
}
}
- ## Make sure that all of the variables set in the include are present here.
- #my $env = $subr->subprocess_env();
- #foreach ( keys %$env ) {
- # $self->{_r}->subprocess_env($_, $env->{$_});
- #}
-
return '';
}
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:38 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:38 +0900
Subject: [Slashdotjp-dev 392] CVS update: slashjp/Slash/Custom/ParUserAgent
Message-ID: <20060712114138.808C72AC0D6@users.sourceforge.jp>
Index: slashjp/Slash/Custom/ParUserAgent/ParUserAgent.pm
diff -u slashjp/Slash/Custom/ParUserAgent/ParUserAgent.pm:1.1 slashjp/Slash/Custom/ParUserAgent/ParUserAgent.pm:1.2
--- slashjp/Slash/Custom/ParUserAgent/ParUserAgent.pm:1.1 Wed Dec 22 18:13:33 2004
+++ slashjp/Slash/Custom/ParUserAgent/ParUserAgent.pm Wed Jul 12 20:41:38 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: ParUserAgent.pm,v 1.1 2004/12/22 09:13:33 oliver Exp $
+# $Id: ParUserAgent.pm,v 1.2 2006/07/12 11:41:38 sugi Exp $
# This overrides LWP::Parallel::UserAgent to allow multiple
# proxies to be used with a single scheme, indeed with a
@@ -19,7 +19,7 @@
use LWP::Parallel::UserAgent;
-($VERSION) = ' $Revision: 1.1 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.2 $ ' =~ /\$Revision:\s+([^\s]+)/;
sub _need_proxy {
my($self, $url) = @_;
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:38 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:38 +0900
Subject: [Slashdotjp-dev 393] CVS update: slashjp/Slash/DB
Message-ID: <20060712114138.A0A762AC011@users.sourceforge.jp>
Index: slashjp/Slash/DB/DB.pm
diff -u slashjp/Slash/DB/DB.pm:1.3 slashjp/Slash/DB/DB.pm:1.4
--- slashjp/Slash/DB/DB.pm:1.3 Fri Dec 31 21:35:44 2004
+++ slashjp/Slash/DB/DB.pm Wed Jul 12 20:41:38 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: DB.pm,v 1.3 2004/12/31 12:35:44 oliver Exp $
+# $Id: DB.pm,v 1.4 2006/07/12 11:41:38 sugi Exp $
package Slash::DB;
@@ -10,7 +10,7 @@
use Slash::DB::Utility;
use vars qw($VERSION);
-($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
# FRY: Would you cram a sock in it, Bender?
@@ -41,9 +41,9 @@
$self->sqlConnect();
return $self;
} elsif ($dsn) {
- die "Database $dsn unsupported! (virtual user: $user)";
+ die "Database $dsn unsupported! (virtual user '$user')";
} else {
- die "DBIx::Password returned *nothing* for virtual user $user DSN (is the username correct?)";
+ die "DBIx::Password has no information about the virtual user '$user'. Most likely either you mistyped it (maybe in slash.sites or your SlashVirtualUser directive?), or DBIx::Password is misconfigured somehow";
}
}
@@ -895,28 +895,6 @@
=back
-=head2 deleteAuthor(KEY)
-
-I am the default documentation, short and stout.
-
-=over 4
-
-=item Parameters
-
-=over 4
-
-=item KEY
-
-Key, as in the KEY
-
-=back
-
-=item Return value
-
-Fixed KEY.
-
-=back
-
=head2 deleteTopic(KEY)
I am the default documentation, short and stout.
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:39 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:39 +0900
Subject: [Slashdotjp-dev 394] CVS update: slashjp/Slash/DB/PostgreSQL
Message-ID: <20060712114139.2373A2AC0D3@users.sourceforge.jp>
Index: slashjp/Slash/DB/PostgreSQL/PostgreSQL.pm
diff -u slashjp/Slash/DB/PostgreSQL/PostgreSQL.pm:1.2 slashjp/Slash/DB/PostgreSQL/PostgreSQL.pm:1.3
--- slashjp/Slash/DB/PostgreSQL/PostgreSQL.pm:1.2 Wed Dec 22 18:13:34 2004
+++ slashjp/Slash/DB/PostgreSQL/PostgreSQL.pm Wed Jul 12 20:41:39 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: PostgreSQL.pm,v 1.2 2004/12/22 09:13:34 oliver Exp $
+# $Id: PostgreSQL.pm,v 1.3 2006/07/12 11:41:39 sugi Exp $
package Slash::DB::PostgreSQL;
use strict;
@@ -13,7 +13,7 @@
use base 'Slash::DB::Utility';
use base 'Slash::DB::MySQL';
-($VERSION) = ' $Revision: 1.2 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
# BENDER: I hate people who love me. And they hate me.
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:39 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:39 +0900
Subject: [Slashdotjp-dev 395] CVS update: slashjp/Slash/DB/Oracle
Message-ID: <20060712114139.044172AC011@users.sourceforge.jp>
Index: slashjp/Slash/DB/Oracle/Oracle.pm
diff -u slashjp/Slash/DB/Oracle/Oracle.pm:1.2 slashjp/Slash/DB/Oracle/Oracle.pm:1.3
--- slashjp/Slash/DB/Oracle/Oracle.pm:1.2 Wed Dec 22 18:13:34 2004
+++ slashjp/Slash/DB/Oracle/Oracle.pm Wed Jul 12 20:41:38 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Oracle.pm,v 1.2 2004/12/22 09:13:34 oliver Exp $
+# $Id: Oracle.pm,v 1.3 2006/07/12 11:41:38 sugi Exp $
package Slash::DB::Oracle;
@@ -9,7 +9,7 @@
use vars qw($VERSION @ISA);
@ISA = qw( Slash::DB::Utility );
-($VERSION) = ' $Revision: 1.2 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
1;
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:39 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:39 +0900
Subject: [Slashdotjp-dev 396] CVS update: slashjp/Slash/DB/Static/Oracle
Message-ID: <20060712114139.6F1002AC0D3@users.sourceforge.jp>
Index: slashjp/Slash/DB/Static/Oracle/Oracle.pm
diff -u slashjp/Slash/DB/Static/Oracle/Oracle.pm:1.2 slashjp/Slash/DB/Static/Oracle/Oracle.pm:1.3
--- slashjp/Slash/DB/Static/Oracle/Oracle.pm:1.2 Wed Dec 22 18:13:35 2004
+++ slashjp/Slash/DB/Static/Oracle/Oracle.pm Wed Jul 12 20:41:39 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Oracle.pm,v 1.2 2004/12/22 09:13:35 oliver Exp $
+# $Id: Oracle.pm,v 1.3 2006/07/12 11:41:39 sugi Exp $
package Slash::DB::Static::Oracle;
use strict;
@@ -11,7 +11,7 @@
use URI ();
use vars qw($VERSION);
-($VERSION) = ' $Revision: 1.2 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
1;
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:39 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:39 +0900
Subject: [Slashdotjp-dev 397] CVS update: slashjp/Slash/DB/Static/MySQL
Message-ID: <20060712114139.49E0C2AC011@users.sourceforge.jp>
Index: slashjp/Slash/DB/Static/MySQL/MySQL.pm
diff -u slashjp/Slash/DB/Static/MySQL/MySQL.pm:1.3 slashjp/Slash/DB/Static/MySQL/MySQL.pm:1.4
--- slashjp/Slash/DB/Static/MySQL/MySQL.pm:1.3 Fri Dec 31 21:35:45 2004
+++ slashjp/Slash/DB/Static/MySQL/MySQL.pm Wed Jul 12 20:41:39 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: MySQL.pm,v 1.3 2004/12/31 12:35:45 oliver Exp $
+# $Id: MySQL.pm,v 1.4 2006/07/12 11:41:39 sugi Exp $
package Slash::DB::Static::MySQL;
@@ -19,7 +19,7 @@
use vars qw($VERSION);
use base 'Slash::DB::MySQL';
-($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
# FRY: Hey, thinking hurts 'em! Maybe I can think of a way to use that.
@@ -72,10 +72,14 @@
# For rss, rdf etc feeds, basically used by tasks.
# Ultimately this should be subsumed into
# getStoriesEssentials since they serve the same purpose.
-# XXXSECTIONTOPICS let's get the NOW() out of here
+# XXXSECTIONTOPICS let's get the NOW() out of here.
+# This is much slower than getStoriesEssentials but fortunately
+# is not called very often. Its calling code really should be
+# rewritten to use getStoriesEssentials.
sub getBackendStories {
my($self, $options) = @_;
+ my $limit = $options->{limit} || 10;
my $topic = $options->{topic} || getCurrentStatic('mainpage_nexus_tid');
my $select = "stories.stoid AS stoid, sid, title, stories.tid AS tid, primaryskid, time,
@@ -88,7 +92,7 @@
AND stories.stoid = story_topics_rendered.stoid
AND story_topics_rendered.tid=$topic";
- my $other = "ORDER BY time DESC LIMIT 10";
+ my $other = "ORDER BY time DESC LIMIT $limit";
my $returnable = $self->sqlSelectAllHashrefArray($select, $from, $where, $other);
@@ -105,6 +109,11 @@
for my $key (qw( image width height )) {
$story->{image}{$key} = $topic_hr->{$key};
}
+
+ # so we can assign proper "creator" if story was posted
+ # originally as a journal
+ my $journal_id = $self->getStory($story->{stoid}, 'journal_id');
+ $story->{journal_id} = $journal_id if $journal_id;
}
return $returnable;
@@ -157,8 +166,8 @@
my $topics = $self->getTopics;
for my $topic (@$ar) {
- @{ $topic }{qw(alttext image width height)} =
- @{ $topics->{$topic->{tid}} }{qw(alttext image width height)};
+ @{ $topic }{qw(textname image width height)} =
+ @{ $topics->{$topic->{tid}} }{qw(textname image width height)};
}
return $ar;
@@ -223,6 +232,55 @@
return $returnable;
}
+########################################################
+# For dbsparklines.pl
+# This is a bit tricky because some moments may not have rows in
+# the table, and times may not be exactly $resolution apart.
+# We get the key-value hashref and walk it looking for
+# appropriate rows.
+sub getSparklineData {
+ my($self, $dbid, $col, $now, $resolution, $secs_back, $max, $multiplier) = @_;
+ $multiplier ||= 1;
+
+ my $now_ut = timeCalc($now, "%s", 0);
+ my $start_ut = $now_ut - $secs_back;
+ my $now_q = $self->sqlQuote($now);
+ my $kv_hr = $self->sqlSelectAllKeyValue(
+ "UNIX_TIMESTAMP(ts) AS ut, $col",
+ "dbs_readerstatus",
+ "dbid=$dbid
+ AND ts >= DATE_SUB($now_q, INTERVAL $secs_back SECOND)");
+ return [ ] unless %$kv_hr;
+
+ my @ut = sort { $a <=> $b } keys %$kv_hr;
+ my @quantized = ( );
+ my $t = $start_ut;
+ T: while ($t < $now_ut) {
+ my @q = ( );
+ for my $t1 ($t .. $t + $resolution-1) {
+ push @q, $kv_hr->{$t1} * $multiplier if defined $kv_hr->{$t1};
+ }
+
+ # If nothing was found, no value for this quantized
+ # time value, push undef (GD::Graph knows what to
+ # do with that). Otherwise push the mean of the
+ # value(s) found.
+ my $q = undef;
+ for my $val (@q) {
+ $q ||= 0;
+ $q += $val;
+ }
+ if (defined $q) {
+ $q /= scalar @q;
+ $q = $max if $q > $max;
+ }
+ push @quantized, $q;
+
+ $t += $resolution;
+ }
+
+ return \@quantized;
+}
########################################################
# For balance_readers.pl
@@ -241,6 +299,8 @@
"dbid",
"dbid,
MIN(IF(was_alive='yes',1,0)) AS was_alive,
+ MIN(IF(was_reachable='yes',1,0)) AS was_reachable,
+ MIN(IF(was_running='yes',1,0)) AS was_running,
AVG(slave_lag_secs) AS lag,
AVG(query_bog_secs) AS bog",
"dbs_readerstatus",
@@ -324,7 +384,9 @@
my $days_back = $constants->{freshenup_text_render_daysback} || 7;
return $self->sqlUpdate(
"story_text, stories",
- { rendered => undef },
+ { rendered => undef,
+ -last_update => 'last_update'
+ },
"story_text.stoid = stories.stoid
AND rendered IS NOT NULL
AND time < DATE_SUB(NOW(), INTERVAL $days_back DAY)");
@@ -335,8 +397,9 @@
sub forgetUsersLogtokens {
my($self) = @_;
+ # delete logtokens if they have been expired for a month
return $self->sqlDelete("users_logtokens",
- "DATE_ADD(expires, INTERVAL 1 MONTH) < NOW()");
+ "public = 'no' AND DATE_ADD(expires, INTERVAL 1 MONTH) < NOW()");
}
########################################################
@@ -347,7 +410,8 @@
my $reader = getObject('Slash::DB', { db_type => "reader" });
my $min_lastlooktime = time - ($constants->{lastlookmemory} + 86400*7);
my $uids = $reader->sqlSelectColArrayref("uid", "users_param",
- "name='lastlooktime' AND value < '$min_lastlooktime'");
+ "name='lastlooktime' AND value < '$min_lastlooktime'") || [ ];
+ my $count = scalar @$uids;
my $splice_count = 2000;
while (@$uids) {
@@ -356,6 +420,7 @@
$self->sqlDelete("users_param",
"name IN ('lastlooktime', 'lastlookuid') AND uid IN ($uids_in)");
}
+ return $count;
}
########################################################
@@ -367,7 +432,8 @@
my $max_hrs = $constants->{mailpass_max_hours} || 48;
my $min_mailpass_last_ts = time - ($max_hrs*3600 + 86400*7);
my $uids = $reader->sqlSelectColArrayref("uid", "users_param",
- "name='mailpass_last_ts' AND value < '$min_mailpass_last_ts'");
+ "name='mailpass_last_ts' AND value < '$min_mailpass_last_ts'") || [ ];
+ my $count = scalar @$uids;
my $splice_count = 2000;
while (@$uids) {
@@ -376,6 +442,7 @@
$self->sqlDelete("users_param",
"name IN ('mailpass_last_ts', 'mailpass_num') AND uid IN ($uids_in)");
}
+ return $count;
}
########################################################
@@ -515,7 +582,7 @@
sub forgetRemarks {
my($self) = @_;
return $self->sqlDelete("remarks",
- "time < DATE_SUB(NOW(), INTERVAL 365 DAY)");
+ "time < DATE_SUB(NOW(), INTERVAL 90 DAY)");
}
########################################################
@@ -524,29 +591,68 @@
my($self) = @_;
my $constants = getCurrentStatic();
-# This is now done more efficiently, throughout the day, by the
-# counthits.pl task.
-# $self->updateStoriesCounts();
-
$self->sqlDelete('badpasswords', "TO_DAYS(NOW()) - TO_DAYS(ts) > 2");
-
$self->sqlDelete('pollvoters');
+ $self->sqlDelete('discussions', "type='recycle' AND commentcount=0")
+ unless $constants->{noflush_empty_discussions};
+ return 0;
+}
+########################################################
+# For run_moderatord.pl
+# Pass in option "sleep_between" of a few seconds, maybe up to a
+# minute, if for some reason the deletion still makes slave
+# replication lag... (but it shouldn't, anymore) - 2005/01/06
+sub deleteOldModRows {
+ my($self, $options) = @_;
+
+ my $reader = getObject('Slash::DB', { db_type => "reader" });
+ my $constants = getCurrentStatic();
+ my $max_rows = $constants->{mod_delete_maxrows} || 1000;
my $archive_delay_mod =
$constants->{archive_delay_mod}
|| $constants->{archive_delay}
|| 14;
- $self->sqlDelete('moderatorlog',
- "TO_DAYS(NOW()) - TO_DAYS(ts) > $archive_delay_mod");
- $self->sqlDelete('metamodlog',
- "TO_DAYS(NOW()) - TO_DAYS(ts) > $archive_delay_mod");
-
-# This is now done by the flush_formkeys task.
-# my $delete_time = time() - $constants->{formkey_timeframe};
-# $self->sqlDelete('formkeys', "ts < $delete_time");
+ my $sleep_between = $options->{sleep_between} || 0;
- $self->sqlDelete('discussions', "type='recycle' AND commentcount=0")
- unless $constants->{noflush_empty_discussions};
+ # Find the minimum ID in these tables that should remain, then
+ # delete everything before it. We do it this way to keep the
+ # slave DBs tied up on the replication of the deletion query as
+ # little as possible. Turning off foreign key checking here is
+ # just pretty lame, I know...
+
+ $self->sqlDo("SET FOREIGN_KEY_CHECKS=0");
+
+ # First delete from the bottom up for the moderatorlog.
+
+ my $junk_bottom = $reader->sqlSelect('MIN(id)', 'moderatorlog');
+ my $need_bottom = $reader->sqlSelectNumericKeyAssumingMonotonic(
+ 'moderatorlog', 'min', 'id',
+ "ts >= DATE_SUB(NOW(), INTERVAL $archive_delay_mod DAY)");
+ while ($need_bottom && $junk_bottom < $need_bottom) {
+ $junk_bottom += $max_rows;
+ $junk_bottom = $need_bottom if $need_bottom < $junk_bottom;
+ $self->sqlDelete('moderatorlog', "id < $junk_bottom");
+ sleep $sleep_between
+ if $sleep_between;
+ }
+
+ # Now delete from the bottom up for the metamodlog.
+
+ $junk_bottom = $reader->sqlSelect('MIN(id)', 'metamodlog');
+ $need_bottom = $reader->sqlSelectNumericKeyAssumingMonotonic(
+ 'metamodlog', 'min', 'id',
+ "ts >= DATE_SUB(NOW(), INTERVAL $archive_delay_mod DAY)");
+ while ($need_bottom && $junk_bottom < $need_bottom) {
+ $junk_bottom += $max_rows;
+ $junk_bottom = $need_bottom if $need_bottom < $junk_bottom;
+ $self->sqlDelete('metamodlog', "id < $junk_bottom");
+ sleep $sleep_between
+ if $sleep_between && $junk_bottom < $need_bottom;
+ }
+
+ $self->sqlDo("SET FOREIGN_KEY_CHECKS=1");
+ return 0;
}
########################################################
@@ -569,16 +675,24 @@
my $splice_count = 200;
if ($constants->{subscribe} && !$constants->{subscribe_hits_only}) {
my @gmt = gmtime();
- my $today = sprintf "%4d%02d%02d", $gmt[5] + 1900, $gmt[4] + 1, $gmt[3];
- my $ar = $self->sqlSelectAll(
+ my $hr = $self->sqlSelectAllKeyValue(
"uid, lastclick",
"users_hits",
"TO_DAYS(NOW()) - TO_DAYS(lastclick) <= 1"
);
my %uids_day = ( );
- for my $uid_ar (@$ar) {
- my($uid, $lastclick) = @$uid_ar;
- my $lastclick_day = substr($lastclick, 0, 8);
+ for my $uid (keys %$hr) {
+ my $lastclick = $hr->{$uid};
+ if ($lastclick =~ /^(\d{4})(\d{2})(\d{2})/) {
+ # Timestamp field users_hits.lastclick is
+ # being given to us in MySQL 4.0 format
+ # of YYYYMMDDhhmmss. Convert it to the
+ # MySQL 4.1 and later format of
+ # YYYY-MM-DD. See also getUser and
+ # _getUser_do_selects.
+ $lastclick = "$1-$2-$3";
+ }
+ my $lastclick_day = substr($lastclick, 0, 10);
$uids_day{$lastclick_day}{$uid} = 1;
}
for my $day (keys %uids_day) {
@@ -593,12 +707,12 @@
);
# If there is more to do, sleep for a moment so we don't
# hit the DB too hard.
- sleep 2 if @uids;
+ sleep int($splice_count/20+0.5) if @uids;
}
}
} else {
my @gmt = gmtime(time-86400);
- my $yesterday = sprintf "%4d%02d%02d", $gmt[5] + 1900, $gmt[4] + 1, $gmt[3];
+ my $yesterday = sprintf "%4d-%02d-%02d", $gmt[5] + 1900, $gmt[4] + 1, $gmt[3];
my $uids_ar = $self->sqlSelectColArrayref(
"uid",
"accesslog",
@@ -617,7 +731,7 @@
);
# If there is more to do, sleep for a moment so we don't
# hit the DB too hard.
- Time::HiRes::sleep(0.2) if @uids;
+ sleep int($splice_count/20+0.5) if @uids;
}
}
}
@@ -642,16 +756,24 @@
"(lastaccess < DATE_SUB(NOW(), INTERVAL $days DAY) OR karma < $min_k)
AND tokens > 0"
);
- my $uids_in = join(",", sort @$uids_ar);
- my $rows = 0;
- if ($uids_in) {
- $rows = $self->sqlUpdate(
- "users_info",
- { -tokens => "GREATEST(0, tokens - $perday)" },
- "uid IN ($uids_in) AND tokens > 0"
- );
+ my $decayed = 0;
+ my $splice_count = 200;
+ while (@$uids_ar) {
+ my @uid_chunk = splice @$uids_ar, 0, $splice_count;
+ my $uids_in = join(",", @uid_chunk);
+ my $rows = 0;
+ if ($uids_in) {
+ $rows = $self->sqlUpdate(
+ "users_info",
+ { -tokens => "GREATEST(0, tokens - $perday)" },
+ "uid IN ($uids_in)"
+ );
+ }
+ $decayed += $rows * $perday;
+ # If there is more to do, sleep for a moment so we don't
+ # hit the DB too hard.
+ sleep int($splice_count/20+0.5) if @$uids_ar;
}
- my $decayed = $rows * $perday;
return $decayed;
}
@@ -940,10 +1062,15 @@
my $skinname = $skins->{ $tree->{$tid}{skid} }{name};
my $mp_tid = $constants->{mainpage_nexus_tid};
- for my $child_tid (sort { lc $tree->{$a}{textname} cmp lc $tree->{$b}{textname} } keys %{$tree->{$tid}{child}}) {
+ my @children =
+ sort { lc $tree->{$a}{textname} cmp lc $tree->{$b}{textname} }
+ grep { $tree->{$tid}{child}{$_} > 0 } # poisoned children don't count
+ keys %{$tree->{$tid}{child}};
+ for my $child_tid (@children) {
next unless $tree->{$child_tid}{nexus} && $tree->{$child_tid}{skid};
+ $index{$skinname} ||= [ ];
if ($children{$child_tid}) {
- push @{$index{$skinname}{$child_tid}}, $children{$child_tid};
+ push @{$index{$skinname}}, $children{$child_tid};
next;
}
@@ -1000,13 +1127,15 @@
sub convert_tokens_to_points {
my($self, $n_wanted) = @_;
+ my $reader = getObject("Slash::DB", { db_type => 'reader' });
+
my $constants = getCurrentStatic();
my %granted = ( );
return unless $n_wanted;
# Sanity check.
- my $n_users = $self->countUsers();
+ my $n_users = $reader->countUsers();
$n_wanted = int($n_users/10) if $n_wanted > int($n_users)/10;
my $maxtokens = $constants->{maxtokens} || 60;
@@ -1017,7 +1146,7 @@
$tokentrade = $maxtokens if $tokentrade > $maxtokens; # sanity check
my $half_tokentrade = int($tokentrade/2); # another sanity check
- my $uids = $self->sqlSelectColArrayref(
+ my $uids = $reader->sqlSelectColArrayref(
"uid",
"users_info",
"tokens >= $half_tokentrade",
@@ -1044,16 +1173,30 @@
# and seclev < 100. These aren't meaningful limitations, so these
# updates should work as well. - Jamie 2002/08/08
# Actually I don't think these are needed at all. - Jamie 2003/09/09
- $self->sqlUpdate(
- "users_comments",
- { points => $maxpoints },
- "points > $maxpoints"
- );
- $self->sqlUpdate(
- "users_info",
- { tokens => $maxtokens },
- "tokens > $maxtokens"
- );
+ #
+ # 2006/02/09: I still don't think they're needed, and they are
+ # causing lags in replication...
+ # Searching rows for update:
+ # The thread is doing a first phase to find all matching
+ # rows before updating them. This has to be done if the UPDATE
+ # is changing the index that is used to find the involved rows.
+ # ...so I'm removing these. I believe wherever the existing code
+ # increases points or tokens, it updates the oldvalue to
+ # LEAST(newvalue, maxvalue), so these adjustments should never
+ # change anything.
+ # 2006/02/12: The lag is due to a MySQL bug in 4.1.16 that is
+ # fixed in 4.1.18.
+ # Still, we shouldn't need these.
+# $self->sqlUpdate(
+# "users_comments",
+# { points => $maxpoints },
+# "points > $maxpoints"
+# );
+# $self->sqlUpdate(
+# "users_info",
+# { tokens => $maxtokens },
+# "tokens > $maxtokens"
+# );
return \%granted;
}
@@ -1138,7 +1281,7 @@
return if $lastmaxid > $newmaxid;
my $ac_uid = getCurrentStatic('anonymous_coward_uid');
$self->sqlDo("INSERT INTO accesslog_artcom (uid, ts, c)"
- . " SELECT uid, AVG(ts) AS ts, COUNT(*) AS c"
+ . " SELECT uid, FROM_UNIXTIME(FLOOR(AVG(UNIX_TIMESTAMP(ts)))) AS ts, COUNT(*) AS c"
. " FROM accesslog"
. " WHERE id BETWEEN $lastmaxid AND $newmaxid"
. " AND (op='article' OR op='comments')"
@@ -1623,7 +1766,7 @@
# Lampe, C. and Resnick, P. "Slash(dot) and Burn: Moderation in a
# Large Scale Conversation Space." Proceedings of the Conference on
# Computer Human Interaction (SIGCHI). April 2004. Vienna, Austria.
- # ACM Press. (Forthcoming.)
+ # ACM Press.
#
# The goal of _csq_bonuses is to reward moderators who take
# a little extra effort, by giving them their next set of
@@ -1656,21 +1799,23 @@
# conversation and 7% for late comments [fifth quintile]."
# Here, quintile 5 is the latest 20% of the discussion, and
# quintile 1 is the earliest 20%.
- if ($mod_hr->{cid_percentile} > 80) {
- $num *= $constants->{m2_consequences_bonus_quintile_5} || 1;
- push @applied, 'quintile_5';
- } elsif ($mod_hr->{cid_percentile} > 60) {
- $num *= $constants->{m2_consequences_bonus_quintile_4} || 1;
- push @applied, 'quintile_4';
- } elsif ($mod_hr->{cid_percentile} > 40) {
- $num *= $constants->{m2_consequences_bonus_quintile_3} || 1;
- push @applied, 'quintile_3';
- } elsif ($mod_hr->{cid_percentile} > 20) {
- $num *= $constants->{m2_consequences_bonus_quintile_2} || 1;
- push @applied, 'quintile_2';
- } else {
- $num *= $constants->{m2_consequences_bonus_quintile_1} || 1;
- push @applied, 'quintile_1';
+ if (defined $mod_hr->{cid_percentile}) {
+ if ($mod_hr->{cid_percentile} > 80) {
+ $num *= $constants->{m2_consequences_bonus_quintile_5} || 1;
+ push @applied, 'quintile_5';
+ } elsif ($mod_hr->{cid_percentile} > 60) {
+ $num *= $constants->{m2_consequences_bonus_quintile_4} || 1;
+ push @applied, 'quintile_4';
+ } elsif ($mod_hr->{cid_percentile} > 40) {
+ $num *= $constants->{m2_consequences_bonus_quintile_3} || 1;
+ push @applied, 'quintile_3';
+ } elsif ($mod_hr->{cid_percentile} > 20) {
+ $num *= $constants->{m2_consequences_bonus_quintile_2} || 1;
+ push @applied, 'quintile_2';
+ } else {
+ $num *= $constants->{m2_consequences_bonus_quintile_1} || 1;
+ push @applied, 'quintile_1';
+ }
}
# If a Fair moderation was applied to a comment that was
@@ -1770,6 +1915,13 @@
}
}
+# XXXSRCID This needs to actually be, like, written.
+sub recalcAL2 {
+ my($self, $srcid) = @_;
+ my $log = $self->getAL2Log($srcid);
+ # remember to delete from memcached
+}
+
########################################################
# For dailyStuff
# This should only be run once per day, if this isn't
@@ -2011,10 +2163,25 @@
# files rewritten (which mainly means they have a row present
# in the story_dirty table), starting with the most recent.
sub getStoriesToRefresh {
- my($self, $limit, $tid) = @_;
+ my($self, $limit, $tid, $options) = @_;
+ $options ||= {};
$limit ||= 10;
my $tid_clause = "";
$tid_clause = " AND story_topics_rendered.tid = $tid" if $tid;
+ my $stoid_clause = "";
+
+ if ($options->{stoid}) {
+ my @stoids = ( );
+ if (ref $options->{stoid} eq "ARRAY") {
+ @stoids = @{$options->{stoid}}
+ } elsif (!ref $options->{stoid}) {
+ push @stoids, $options->{stoid};
+ }
+ if (@stoids) {
+ my $stoid_in = join ',', map { $self->sqlQuote($_) } @stoids;
+ $stoid_clause = " AND stories.stoid IN ($stoid_in) ";
+ }
+ }
# Include story_topics_rendered in this select just to make
# sure there is at least one topic assigned to such stories.
@@ -2022,14 +2189,15 @@
# don't include neverdisplay stories.
my $retval = $self->sqlSelectAllHashrefArray(
"DISTINCT stories.stoid AS stoid, sid, primaryskid, title, time",
- "stories, story_text, story_topics_rendered
- LEFT JOIN story_dirty ON stories.stoid=story_dirty.stoid",
+ "story_text, story_topics_rendered,
+ stories LEFT JOIN story_dirty ON stories.stoid=story_dirty.stoid",
"time < NOW()
AND stories.primaryskid > 0
AND stories.stoid = story_text.stoid
AND story_dirty.stoid IS NOT NULL
AND stories.stoid = story_topics_rendered.stoid
- $tid_clause",
+ $tid_clause
+ $stoid_clause",
"ORDER BY time DESC LIMIT $limit");
return [ ] if !@$retval;
@@ -2101,7 +2269,17 @@
story_topics_chosen story_topics_rendered )) {
$rows += $self->sqlDelete($table, "stoid=$stoid");
}
- $self->deleteDiscussion($discussion_id) if $discussion_id;
+
+ if ($discussion_id && $story->{journal_id}) {
+ # journal_fix.pl task will revert discussion data later
+ # (although maybe better to make this happen immediately)
+ $self->sqlUpdate('journal_transfer', {
+ stoid => 0,
+ }, 'id=' . $self->sqlQuote($story->{journal_id}));
+ } elsif ($discussion_id) {
+ $self->deleteDiscussion($discussion_id);
+ }
+
$self->sqlDo("COMMIT");
$self->sqlDo("SET AUTOCOMMIT=1");
return $rows;
@@ -2115,8 +2293,12 @@
my($self) = @_;
my $sql;
$sql = "REPLACE INTO authors_cache ";
- $sql .= "SELECT users.uid, nickname, GREATEST(fakeemail, ''),
- GREATEST(homepage, ''), 0, GREATEST(bio, ''), author ";
+ $sql .= "SELECT users.uid, nickname,
+ GREATEST(IF(fakeemail IS NULL, '', fakeemail), ''),
+ GREATEST(IF(homepage IS NULL, '', homepage), ''),
+ 0,
+ GREATEST(IF(bio IS NULL, '', bio), ''),
+ author ";
$sql .= "FROM users, users_info ";
$sql .= "WHERE users.author=1 ";
$sql .= "AND users.uid=users_info.uid";
@@ -2124,9 +2306,12 @@
$self->sqlDo($sql);
$sql = "REPLACE INTO authors_cache ";
- $sql .= "SELECT users.uid, nickname, GREATEST(fakeemail, ''),
- GREATEST(homepage, ''), count(stories.uid),
- GREATEST(bio, ''), author ";
+ $sql .= "SELECT users.uid, nickname,
+ GREATEST(IF(fakeemail IS NULL, '', fakeemail), ''),
+ GREATEST(IF(homepage IS NULL, '', homepage), ''),
+ COUNT(stories.uid),
+ GREATEST(IF(bio IS NULL, '', bio), ''),
+ author ";
$sql .= "FROM users, stories, users_info ";
$sql .= "WHERE stories.uid=users.uid ";
$sql .= "AND users.uid=users_info.uid GROUP BY stories.uid";
@@ -2213,11 +2398,13 @@
@uncommon_words = split / /, $uncommon_words;
$self->sqlDo("LOCK TABLES uncommonstorywords LOW_PRIORITY WRITE");
+ $self->sqlDo("SET AUTOCOMMIT=0");
$self->sqlDelete("uncommonstorywords");
for my $word (@uncommon_words) {
- $self->sqlInsert("uncommonstorywords", { word => $word },
- { delayed => 1 });
+ $self->sqlInsert("uncommonstorywords", { word => $word });
}
+ $self->sqlDo("COMMIT");
+ $self->sqlDo("SET AUTOCOMMIT=1");
$self->sqlDo("UNLOCK TABLES");
}
@@ -2259,12 +2446,6 @@
}
########################################################
-sub countAccesslogDaily {
- my($self) = @_;
- return $self->sqlCount("accesslog", "TO_DAYS(NOW()) - TO_DAYS(ts)=1");
-}
-
-########################################################
# For tasks/run_moderatord.pl
sub countM2M1Ratios {
my($self, $longterm) = @_;
@@ -2288,6 +2469,13 @@
}
########################################################
+# For tasks/topic_tree_draw.pl
+sub countStoriesWithTopic {
+ my($self, $tid) = @_;
+ return $self->sqlCount('story_topics_rendered', "tid=$tid");
+}
+
+########################################################
# For portald
sub createRSS {
my($self, $bid, $item) = @_;
@@ -2458,14 +2646,12 @@
$yesterday = substr($yesterday, 0, 10);
my $where = '';
if ($where) {
- $where = "created_at < DATE_SUB('$yesterday 00:00',INTERVAL $num_days DAY)";
+ $where = "created_at < DATE_SUB('$yesterday 00:00', INTERVAL $num_days DAY)";
} else {
$where = "created_at < '$yesterday 00:00'";
}
- return $self->sqlSelect(
- "MAX(uid)",
- "users_info",
- $where);
+ return $self->sqlSelectNumericKeyAssumingMonotonic(
+ 'users_info', 'max', 'uid', $where);
}
########################################################
@@ -2503,9 +2689,9 @@
my $num = $options->{num_wanted} || 10;
my $min_uid = $self->getLastUIDCreatedBeforeDaysBack($daysback, $yesterday);
- my $newaccounts = $self->sqlSelect('max(uid)','users') - $min_uid;
- my $newnicks = {};
return [ ] unless $min_uid;
+ my $newaccounts = $self->countUsers({ max => 1 }) - $min_uid;
+ my $newnicks = {};
my $domains = $self->sqlSelectAllHashrefArray(
"initdomain, COUNT(*) AS c",
"users_info",
@@ -2513,14 +2699,21 @@
"GROUP BY initdomain ORDER BY c DESC, initdomain LIMIT $num");
foreach my $domain (@$domains) {
- my $nicks = $self->sqlSelectAll('nickname','users, users_info',"users.uid=users_info.uid AND users_info.uid >= $min_uid AND initdomain=".$self->sqlQuote($domain->{initdomain}),'ORDER BY users.uid DESC');
- my $length = 5 + length($domain->{initdomain});
+ my $dom = $domain->{initdomain};
+ my $dom_q = $self->sqlQuote($dom);
+ my $nicks = $self->sqlSelectAll(
+ 'nickname',
+ 'users, users_info',
+ "users.uid=users_info.uid AND users_info.uid >= $min_uid
+ AND initdomain=$dom_q",
+ 'ORDER BY users.uid DESC');
+ my $length = 5 + length($dom);
my $i = 0;
- $newnicks->{$domain->{initdomain}} = "";
+ $newnicks->{$dom} = '';
- while ($length + length($nicks->[$i][0]) + 2 < 78) {
- $newnicks->{$domain->{initdomain}} .= ', ' unless !$i;
- $newnicks->{$domain->{initdomain}} .= $nicks->[$i][0];
+ while ($nicks->[$i] && $length + length($nicks->[$i][0]) + 2 < 78) {
+ $newnicks->{$dom} .= ', ' unless !$i;
+ $newnicks->{$dom} .= $nicks->[$i][0];
$length += length($nicks->[$i][0]) + 2;
$i++;
}
@@ -2577,21 +2770,22 @@
my ($self, $options) = @_;
my $ac_uid = getCurrentStatic('anonymous_coward_uid');
$options ||= {};
- my @where;
- push @where, "ts > date_sub(NOW(),INTERVAL $options->{days_back} DAY)" if $options->{days_back};
+
+ my @where = ( );
+ push @where, "ts > DATE_SUB(NOW(), INTERVAL $options->{days_back} DAY)" if $options->{days_back};
push @where, "cuid != $ac_uid" if $options->{no_anon_comments};
push @where, "id >= $options->{start_at_id}" if $options->{start_at_id};
push @where, "id <= $options->{end_at_id}" if $options->{end_at_id};
- push @where, "ipid is not null and ipid!=''" if $options->{need_defined_ipid};
+ push @where, "ipid IS NOT NULL AND ipid != ''" if $options->{need_ipid};
my $where = join(" AND ", @where);
my $mods = $self->sqlSelectAllHashref(
[qw(uid cuid)],
- "uid,cuid,count(*) as count",
+ "uid, cuid, COUNT(*) AS count",
"moderatorlog",
$where,
- "group by uid, cuid");
+ "GROUP BY uid, cuid");
return $mods;
}
@@ -2601,21 +2795,24 @@
my ($self, $options) = @_;
my $ac_uid = getCurrentStatic('anonymous_coward_uid');
$options ||= {};
- my @where = ("moderatorlog.cid=comments.cid");
+
+ my @where = ( "moderatorlog.cid=comments.cid" );
push @where, "ts > date_sub(NOW(),INTERVAL $options->{days_back} DAY)" if $options->{days_back};
push @where, "cuid != $ac_uid" if $options->{no_anon_comments};
push @where, "cuid = $ac_uid" if $options->{only_anon_comments};
push @where, "id >= $options->{start_at_id}" if $options->{start_at_id};
push @where, "id <= $options->{end_at_id}" if $options->{end_at_id};
- push @where, "ipid is not null and ipid!=''" if $options->{need_defined_ipid};
+ push @where, "comments.ipid IS NOT NULL AND comments.ipid!=''" if $options->{need_ipid};
+
my $where = join(" AND ", @where);
+
my $mods = $self->sqlSelectAllHashref(
[qw(uid ipid)],
- "moderatorlog.uid as uid, comments.ipid as ipid, count(*) as count",
- "moderatorlog,comments",
+ "moderatorlog.uid AS uid, comments.ipid AS ipid, COUNT(*) AS count",
+ "moderatorlog, comments",
$where,
- "group by uid, comments.ipid");
-
+ "GROUP BY uid, comments.ipid");
+
return $mods;
}
@@ -2730,6 +2927,24 @@
);
}
+sub getUrlsNeedingFirstCheck {
+ my($self) = @_;
+ return $self->sqlSelectAllHashrefArray("*", "urls", "last_attempt IS NULL", "ORDER BY url_id ASC");
+}
+
+sub getUrlsNeedingRefresh {
+ my($self, $limit) = @_;
+ $limit ||= 50;
+ return $self->sqlSelectAllHashrefArray(
+ "*",
+ "urls",
+ "last_attempt IS NOT NULL
+ AND believed_fresh_until IS NOT NULL
+ AND believed_fresh_until < NOW()",
+ "ORDER BY believed_fresh_until ASC LIMIT $limit"
+ );
+}
+
1;
__END__
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:39 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:39 +0900
Subject: [Slashdotjp-dev 398] CVS update: slashjp/Slash/DB/Static/PostgreSQL
Message-ID: <20060712114139.90D062AC0D6@users.sourceforge.jp>
Index: slashjp/Slash/DB/Static/PostgreSQL/PostgreSQL.pm
diff -u slashjp/Slash/DB/Static/PostgreSQL/PostgreSQL.pm:1.2 slashjp/Slash/DB/Static/PostgreSQL/PostgreSQL.pm:1.3
--- slashjp/Slash/DB/Static/PostgreSQL/PostgreSQL.pm:1.2 Wed Dec 22 18:13:35 2004
+++ slashjp/Slash/DB/Static/PostgreSQL/PostgreSQL.pm Wed Jul 12 20:41:39 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: PostgreSQL.pm,v 1.2 2004/12/22 09:13:35 oliver Exp $
+# $Id: PostgreSQL.pm,v 1.3 2006/07/12 11:41:39 sugi Exp $
package Slash::DB::Static::PostgreSQL;
use strict;
@@ -11,7 +11,7 @@
use base 'Slash::DB::PostgreSQL';
use base 'Slash::DB::Static::MySQL';
-($VERSION) = ' $Revision: 1.2 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
# FRY: Whoa, slow down. You're going a mile a minute.
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:39 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:39 +0900
Subject: [Slashdotjp-dev 399] CVS update: slashjp/Slash/DB/Utility
Message-ID: <20060712114139.B4DA52AC0D7@users.sourceforge.jp>
Index: slashjp/Slash/DB/Utility/Utility.pm
diff -u slashjp/Slash/DB/Utility/Utility.pm:1.3 slashjp/Slash/DB/Utility/Utility.pm:1.4
--- slashjp/Slash/DB/Utility/Utility.pm:1.3 Fri Dec 31 21:35:45 2004
+++ slashjp/Slash/DB/Utility/Utility.pm Wed Jul 12 20:41:39 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Utility.pm,v 1.3 2004/12/31 12:35:45 oliver Exp $
+# $Id: Utility.pm,v 1.4 2006/07/12 11:41:39 sugi Exp $
package Slash::DB::Utility;
@@ -12,12 +12,13 @@
use Time::HiRes;
use vars qw($VERSION);
-($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
# FRY: Bender, if this is some kind of scam, I don't get it. You already
# have my power of attorney.
my $timeout = 30; # This should eventualy be a parameter that is configurable
+my $query_ref_regex = qr{(HASH|ARRAY|SCALAR|GLOB|CODE|LVALUE|IO|REF)\(0x[0-9a-f]{3,16}\)}; # this too
########################################################
# Generic methods for libraries.
@@ -286,6 +287,45 @@
return $id;
}
+
+#######################################################
+# set a system variable if necessary. this will only be
+# good for the current session. don't forget to set it
+# back anyway.
+sub sqlSetVar {
+ my($self, $var, $value) = @_;
+ return if $ENV{GATEWAY_INTERFACE} && !getCurrentUser('is_admin');
+
+ # can't use sqlQuote for this, can't be quoted
+ $var =~ s/\W+//; # just in case
+ $value =~ s/\D+//; # ditto (any non-numeric vars we might adjust?)
+
+ $self->sqlDo("SET $var = $value");
+}
+
+#######################################################
+# get the value of a named system variable
+sub sqlGetVar {
+ my($self, $var) = @_;
+
+ # to mirror what we do in sqlSetVar
+ $var =~ s/\W+//;
+
+ my $sql = "SHOW VARIABLES LIKE '$var'";
+ my $sth = $self->{_dbh}->prepare($sql);
+
+ if (!$sth->execute) {
+ $self->sqlErrorLog($sql);
+ $self->sqlConnect;
+ return undef;
+ }
+
+ my($name, $value) = $sth->fetchrow;
+ $sth->finish;
+ return $value;
+}
+
+
########################################################
# The SQL query logging methods
#
@@ -419,8 +459,17 @@
# Useful SQL Wrapper Functions
########################################################
+sub _refCheck {
+ my($self, $where) = @_;
+ return if !$where || $where !~ $query_ref_regex;
+ my @c = caller(1);
+ my $w2 = $where; $w2 =~ s/\s+/ /g;
+ warn scalar(gmtime) . " query text contains ref string ($c[0] $c[1] $c[2] $c[3]): $w2\n";
+}
+
sub sqlSelectMany {
my($self, $select, $from, $where, $other, $options) = @_;
+ $self->_refCheck($where);
my $distinct = ($options && $options->{distinct}) ? "DISTINCT" : "";
my $sql = "SELECT $distinct $select ";
@@ -444,6 +493,7 @@
# $options is a hash, add optional pieces here.
sub sqlSelect {
my($self, $select, $from, $where, $other, $options) = @_;
+ $self->_refCheck($where);
my $distinct = ($options && $options->{distinct}) ? "DISTINCT" : "";
my $sql = "SELECT $distinct $select ";
$sql .= "FROM $from " if $from;
@@ -473,6 +523,7 @@
########################################################
sub sqlSelectArrayRef {
my($self, $select, $from, $where, $other) = @_;
+ $self->_refCheck($where);
my $sql = "SELECT $select ";
$sql .= "FROM $from " if $from;
$sql .= "WHERE $where " if $where;
@@ -502,6 +553,7 @@
##########################################################
sub sqlCount {
my($self, $table, $where) = @_;
+ $self->_refCheck($where);
my $sql = "SELECT COUNT(*) AS count FROM $table";
$sql .= " WHERE $where" if $where;
@@ -519,6 +571,7 @@
########################################################
sub sqlSelectHashref {
my($self, $select, $from, $where, $other) = @_;
+ $self->_refCheck($where);
my $sql = "SELECT $select ";
$sql .= "FROM $from " if $from;
@@ -543,6 +596,7 @@
########################################################
sub sqlSelectColArrayref {
my($self, $select, $from, $where, $other, $options) = @_;
+ $self->_refCheck($where);
my $distinct = ($options && $options->{distinct}) ? "DISTINCT" : "";
my $sql = "SELECT $distinct $select ";
@@ -586,6 +640,7 @@
# array ref of all records
sub sqlSelectAll {
my($self, $select, $from, $where, $other) = @_;
+ $self->_refCheck($where);
my $sql = "SELECT $select ";
$sql .= "FROM $from " if $from;
@@ -619,7 +674,8 @@
# returns:
# hash ref of all records
sub sqlSelectAllHashref {
- my($self, $id, $select, $from, $where, $other) = @_;
+ my($self, $id, $select, $from, $where, $other, $options) = @_;
+ $self->_refCheck($where);
# Yes, if $id is not in $select things will be bad
# Allow $id to be an arrayref to collect multiple rows of results
@@ -643,6 +699,11 @@
$reference = \%{$reference->{$row->{$next_id}}};
}
%$reference = %$row;
+ if ($options->{thin}) {
+ for my $next_id (@$id) {
+ delete $reference->{$next_id};
+ }
+ }
}
$sth->finish;
$self->_querylog_finish($qlid);
@@ -664,6 +725,7 @@
# array ref of all records
sub sqlSelectAllHashrefArray {
my($self, $select, $from, $where, $other) = @_;
+ $self->_refCheck($where);
my $sql = "SELECT $select ";
$sql .= "FROM $from " if $from;
@@ -673,7 +735,7 @@
my $qlid = $self->_querylog_start("SELECT", $from);
my $sth = $self->sqlSelectMany($select, $from, $where, $other);
return undef unless $sth;
- my @returnable;
+ my @returnable = ( );
while (my $row = $sth->fetchrow_hashref) {
push @returnable, $row;
}
@@ -699,12 +761,15 @@
# hashref, keys first column, values the second
sub sqlSelectAllKeyValue {
my($self, $select, $from, $where, $other) = @_;
+ $self->_refCheck($where);
my $sql = "SELECT $select ";
$sql .= "FROM $from " if $from;
$sql .= "WHERE $where " if $where;
$sql .= "$other" if $other;
+ $self->sqlConnect() or return undef;
+
my $qlid = $self->_querylog_start("SELECT", $from);
my $H = $self->{_dbh}->selectall_arrayref($sql);
unless ($H) {
@@ -722,8 +787,116 @@
}
########################################################
+# This is a little different from the other sqlSelect* methods.
+#
+# Its reason for existing is that sometimes, for performance reasons,
+# you want to do a select on a large table that is limited by a key
+# that differs from the column you actually want to limit by, though
+# both of them increase (or decrease) together. For example, perhaps
+# you want to do a SELECT on an accesslog table with millions of rows
+# based on a range of accesslog.ts, but to make sure the query optimizer
+# restricts by primary key, you'd prefer to determine the range of
+# accesslog.id that spans the rows in question, and offer that as
+# part of the WHERE clause as well. The optimizer doesn't know that
+# the columns id and ts increase together, but you do. Telling the
+# optimizer that it can restrict by the numeric key may not make your
+# query faster, but it might, and in non-pathological situations it
+# won't make it slower.
+#
+# This method will return a boundary value of a numeric key column
+# based on an inequality test for a different column that must be
+# approximately monotonic with the key. It will always return quickly,
+# since it uses a binary search to narrow down the value sought, and
+# all its SELECTs are primary key lookups.
+#
+# Note that there must not be "holes" in the table where a value of the
+# numeric key is missing even though there are values present both above
+# and below it, or the answer may impose an incorrectly strict limitation
+# (this bug may be fixed in the future). This includes "holes" in the
+# values for that key in the rows returned by the where clause.
+#
+# For example, if you wanted to count the number of distinct uids in
+# a very large accesslog table in several hours, the easy way is:
+#
+# $c = $slashdb->sqlSelect("COUNT(DISTINCT uid)", "accesslog",
+# "ts BETWEEN '2001-01-01 01:00:00' AND '2001-01-01 03:00:00'");
+#
+# but it may be faster, and certainly won't be significantly slower,
+# to do:
+#
+# $minid = $slashdb->sqlSelectNumericKeyAssumingMonotonic("accesslog", "min", "id", "ts >= '2001-01-01 01:00:00'");
+# $maxid = $slashdb->sqlSelectNumericKeyAssumingMonotonic("accesslog", "max", "id", "ts <= '2001-01-01 03:00:00'");
+# $c = $slashdb->sqlSelect("COUNT(DISTINCT uid)", "accesslog",
+# "id BETWEEN $minid AND $maxid AND ts BETWEEN '2001-01-01 01:00:00' AND '2001-01-01 03:00:00'");
+
+sub sqlSelectNumericKeyAssumingMonotonic {
+ my($self, $table, $minmax, $keycol, $clause) = @_;
+ $self->_refCheck($clause);
+
+ # Set up $minmax appropriately.
+ $minmax = uc($minmax);
+ if ($minmax !~ /^(MIN|MAX)$/) {
+ die "sqlSelectNumericKeyAssumingMonotonic called with minmax='$minmax'";
+ }
+ # In MixedCaps to avoid typo bugs and make the code perhaps
+ # a bit clearer. This is the opposite of $minmax.
+ my $MaxMin = $minmax eq 'MIN' ? 'MAX' : 'MIN';
+
+ # We pretend the "left" end of the table is the end pointed to
+ # by whichever direction $minmax points, and the "right" end
+ # is the end $MaxMin points to.
+ # First, seed the leftmost variable with the id at the left end
+ # of the table.
+ my $leftmost = $self->sqlSelect("$minmax($keycol)", $table);
+ # If no such id, the table is empty.
+ return undef unless $leftmost;
+ # If the test actually passes for that id, then it's not a
+ # failure at all, and we know our answer already.
+ return $leftmost if $self->sqlSelect($keycol, $table, "$keycol=$leftmost AND ($clause)");
+
+ # Next, seed the rightmost with the id at the right end.
+ my $rightmost = $self->sqlSelect("$MaxMin($keycol)", $table);
+ # If that test fails, then there are no rows satisfying the
+ # desired condition, so we know our answer.
+ return undef if !$self->sqlSelect($keycol, $table, "$keycol=$rightmost AND ($clause)");
+
+ # Now iterate a binary search into the table.
+ my $answer = undef;
+ while (!$answer) {
+ # If we're really close, just do the SELECT.
+ if (abs($leftmost - $rightmost) < 100) {
+ my($min, $max);
+ if ($minmax eq 'MIN') { $min = $leftmost; $max = $rightmost }
+ else { $min = $rightmost; $max = $leftmost }
+ $answer = $self->sqlSelect("$minmax($keycol)", $table,
+ "$keycol BETWEEN $min AND $max
+ AND ($clause)");
+ if (!$answer) {
+ # Table may have changed, that's one of
+ # the risks of using this method. Return
+ # the approximately correct answer that
+ # was, at least at one time, valid.
+ $answer = $leftmost;
+ }
+ }
+ last if $answer;
+ # If we're not that close, narrow it down.
+ my $middle = int(($leftmost + $rightmost) / 2);
+ my $hit = $self->sqlSelect($keycol, $table,
+ "$keycol=$middle AND ($clause)");
+ if ($hit) {
+ $rightmost = $middle;
+ } else {
+ $leftmost = $middle;
+ }
+ }
+ return $answer;
+}
+
+########################################################
sub sqlUpdate {
my($self, $tables, $data, $where, $options) = @_;
+ $self->_refCheck($where);
# If no changes were passed in, there's nothing to do.
# (And if we tried to proceed we'd generate an SQL error.)
@@ -791,6 +964,7 @@
########################################################
sub sqlDelete {
my($self, $table, $where, $limit) = @_;
+ $self->_refCheck($where);
return unless $table;
my $sql = "DELETE FROM $table";
$sql .= " WHERE $where" if $where;
@@ -805,7 +979,6 @@
sub sqlInsert {
my($self, $table, $data, $options) = @_;
my($names, $values);
- # Hmmmmm... we can trust getCurrentStatic here? - Jamie
# What's inside /*! */ will be treated as a comment by most
# other SQL servers, but MySQL will parse it. Kinda pointless
# since we've basically given up on ever supporting DBs other
@@ -852,6 +1025,7 @@
#################################################################
sub sqlDo {
my($self, $sql) = @_;
+ $self->_refCheck($sql);
$self->sqlConnect() or return undef;
my $rows = $self->{_dbh}->do($sql);
unless ($rows) {
@@ -871,7 +1045,7 @@
my($self, $sql) = @_;
my $error = $self->sqlError || 'no error string';
- my @return = ("DB='$self->{virtual_user}'", "hostinfo='$self->{_dbh}->{mysql_hostinfo}'", $error);
+ my @return = ("virtuser='$self->{virtual_user}'", "hostinfo='$self->{_dbh}->{mysql_hostinfo}'", $error);
push @return, $sql if $sql;
errorLog(join ' -- ', @return);
}
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:39 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:39 +0900
Subject: [Slashdotjp-dev 400] CVS update: slashjp/Slash/Display
Message-ID: <20060712114139.E30EB2AC0D3@users.sourceforge.jp>
Index: slashjp/Slash/Display/Display.pm
diff -u slashjp/Slash/Display/Display.pm:1.3 slashjp/Slash/Display/Display.pm:1.4
--- slashjp/Slash/Display/Display.pm:1.3 Fri Dec 31 21:35:46 2004
+++ slashjp/Slash/Display/Display.pm Wed Jul 12 20:41:39 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Display.pm,v 1.3 2004/12/31 12:35:46 oliver Exp $
+# $Id: Display.pm,v 1.4 2006/07/12 11:41:39 sugi Exp $
package Slash::Display;
@@ -50,7 +50,7 @@
use base 'Exporter';
use vars qw($VERSION @EXPORT @EXPORT_OK $CONTEXT %FILTERS $TEMPNAME);
-($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
@EXPORT = qw(slashDisplay slashDisplayName);
@EXPORT_OK = qw(get_template);
my(%objects);
@@ -184,6 +184,15 @@
# and this is the only good way to get the actual name,
# page, skin, we bite the bullet and do it
$tempdata ||= $reader->getTemplateByName($name, [qw(tpid page skin)]);
+
+ # might as well bail here if we can't find the template
+ if (!$tempdata) {
+ # restore our original values
+ $user->{currentSkin} = $origSkin;
+ $user->{currentPage} = $origPage;
+ return;
+ }
+
$TEMPNAME = "ID $tempdata->{tpid}, " .
"$name;$tempdata->{page};$tempdata->{skin}";
}
@@ -197,7 +206,8 @@
# we only populate $err if !$ret ... still, if $err
# is false, then we assume everything is OK
- my($err, $ret, $out);
+ my($err, $ret);
+ my $out = '';
{
local $SIG{__WARN__} = \&tempWarn;
@@ -250,14 +260,11 @@
# allow slashDisplay(NAME, DATA, RETURN) syntax
if (! ref $opt) {
- $opt = $opt == 1 ? { Return => 1 } : {};
+ $opt = ($opt && $opt == 1) ? { Return => 1 } : {};
}
if ($opt->{Skin} && $opt->{Skin} eq 'NONE') {
$user->{currentSkin} = 'default';
- # light is a special case
- } elsif ($user->{light}) {
- $user->{currentSkin} = 'light';
} elsif ($opt->{Skin}) {
$user->{currentSkin} = $opt->{Skin};
}
@@ -333,22 +340,23 @@
# for a template and you don't want your tags running
# up against each other. - Cliff 8/1/01
%FILTERS = (
- decode_entities => \&decode_entities,
- fixparam => \&fixparam,
- fixurl => \&fixurl,
- fudgeurl => \&fudgeurl,
- strip_paramattr => \&strip_paramattr,
- strip_urlattr => \&strip_urlattr,
- strip_anchor => \&strip_anchor,
- strip_attribute => \&strip_attribute,
- strip_code => \&strip_code,
- strip_extrans => \&strip_extrans,
- strip_html => \&strip_html,
- strip_literal => \&strip_literal,
- strip_nohtml => \&strip_nohtml,
- strip_notags => \&strip_notags,
- strip_plaintext => \&strip_plaintext,
- strip_mode => [ $strip_mode, 1 ],
+ decode_entities => \&decode_entities,
+ fixparam => \&fixparam,
+ fixurl => \&fixurl,
+ fudgeurl => \&fudgeurl,
+ strip_paramattr => \&strip_paramattr,
+ strip_paramattr_nonhttp => \&strip_paramattr_nonhttp,
+ strip_urlattr => \&strip_urlattr,
+ strip_anchor => \&strip_anchor,
+ strip_attribute => \&strip_attribute,
+ strip_code => \&strip_code,
+ strip_extrans => \&strip_extrans,
+ strip_html => \&strip_html,
+ strip_literal => \&strip_literal,
+ strip_nohtml => \&strip_nohtml,
+ strip_notags => \&strip_notags,
+ strip_plaintext => \&strip_plaintext,
+ strip_mode => [ $strip_mode, 1 ],
%FILTERS
);
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:40 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:40 +0900
Subject: [Slashdotjp-dev 401] CVS update: slashjp/Slash/Display/Plugin
Message-ID: <20060712114140.126A62AC011@users.sourceforge.jp>
Index: slashjp/Slash/Display/Plugin/Plugin.pm
diff -u slashjp/Slash/Display/Plugin/Plugin.pm:1.3 slashjp/Slash/Display/Plugin/Plugin.pm:1.4
--- slashjp/Slash/Display/Plugin/Plugin.pm:1.3 Fri Dec 31 21:35:46 2004
+++ slashjp/Slash/Display/Plugin/Plugin.pm Wed Jul 12 20:41:39 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Plugin.pm,v 1.3 2004/12/31 12:35:46 oliver Exp $
+# $Id: Plugin.pm,v 1.4 2006/07/12 11:41:39 sugi Exp $
package Slash::Display::Plugin;
@@ -12,7 +12,6 @@
=head1 SYNOPSIS
- [% USE Slash %]
[% Slash.someFunction('some data') %]
[% Slash.db.someMethod(var1, var2) %]
@@ -22,7 +21,7 @@
Call available exported functions from Slash and Slash::Utility
from within your template. Also call methods from Slash::DB
with the C method. Constants from Slash::Constants are
-available. Invoke with C<[% USE Slash %]>.
+available.
C<[% Slash.version %]> gives the version of Slash.
C<[% Slash.VERSION %]> (note case) gives the version
@@ -64,7 +63,7 @@
use Slash::Utility ();
use base qw(Template::Plugin);
-($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
# BENDER: Forget your stupid theme park! I'm gonna make my own!
# With hookers! And blackjack! In fact, forget the theme park!
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:40 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:40 +0900
Subject: [Slashdotjp-dev 402] CVS update: slashjp/Slash/Display/Provider
Message-ID: <20060712114140.348C12AC0D6@users.sourceforge.jp>
Index: slashjp/Slash/Display/Provider/Provider.pm
diff -u slashjp/Slash/Display/Provider/Provider.pm:1.3 slashjp/Slash/Display/Provider/Provider.pm:1.4
--- slashjp/Slash/Display/Provider/Provider.pm:1.3 Fri Dec 31 21:35:46 2004
+++ slashjp/Slash/Display/Provider/Provider.pm Wed Jul 12 20:41:40 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Provider.pm,v 1.3 2004/12/31 12:35:46 oliver Exp $
+# $Id: Provider.pm,v 1.4 2006/07/12 11:41:40 sugi Exp $
package Slash::Display::Provider;
@@ -35,7 +35,7 @@
use File::Spec::Functions;
use Slash::Utility::Environment;
-($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
$DEBUG = $Template::Provider::DEBUG || 0 unless defined $DEBUG;
# BENDER: Oh, no room for Bender, huh? Fine. I'll go build my own lunar
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:40 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:40 +0900
Subject: [Slashdotjp-dev 403] CVS update: slashjp/Slash/Hook
Message-ID: <20060712114140.523802AC0D7@users.sourceforge.jp>
Index: slashjp/Slash/Hook/Hook.pm
diff -u slashjp/Slash/Hook/Hook.pm:1.2 slashjp/Slash/Hook/Hook.pm:1.3
--- slashjp/Slash/Hook/Hook.pm:1.2 Wed Dec 22 18:13:37 2004
+++ slashjp/Slash/Hook/Hook.pm Wed Jul 12 20:41:40 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Hook.pm,v 1.2 2004/12/22 09:13:37 oliver Exp $
+# $Id: Hook.pm,v 1.3 2006/07/12 11:41:40 sugi Exp $
package Slash::Hook;
use strict;
@@ -16,7 +16,7 @@
use base 'Exporter';
use vars qw($VERSION @EXPORT);
-($VERSION) = ' $Revision: 1.2 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
@EXPORT = qw(slashHook);
my %classes;
@@ -25,40 +25,23 @@
my($param, $options) = @_;
my $slashdb = getCurrentDB();
+ my $retval = undef;
my $hooks = $slashdb->getHooksByParam($param);
for my $hook (@$hooks) {
- my $class = $hook->{class};
- my $function = $class . '::' . $hook->{subroutine};
+ my $function = $hook->{class} . '::' . $hook->{subroutine};
- if ($classes{$class}) { # already require'd
- if ($classes{$class} eq 'NA') { # already failed
- next;
- }
- } else {
- eval "require $class"; # we cache because this is expensive,
- # even if it has already succeeded or
- # failed, just by doing the eval -- pudge
- if ($@) { # failed
- $classes{$class} = 'NA';
- next;
- } else { # success!
- $classes{$class} = 1;
- }
- }
-
- my $code;
- {
- no strict 'refs';
- $code = \&{ $function };
- }
- if (defined (&$code)) {
- unless ($code->($options)) {
- errorLog("Failed executing hook ($param) - $function");
+ my $code = loadCoderef($hook->{class}, $hook->{subroutine});
+ if ($code) {
+ $retval = $code->($options);
+ if (! defined $retval) {
+ errorLog("Failed executing hook ($param) - $function: no return value");
}
} else {
errorLog("Failed trying to do hook ($param) - $function");
}
}
+
+ $retval;
}
1;
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:40 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:40 +0900
Subject: [Slashdotjp-dev 404] CVS update: slashjp/Slash/Hook/Sample
Message-ID: <20060712114140.76C612AC0DE@users.sourceforge.jp>
Index: slashjp/Slash/Hook/Sample/Sample.pm
diff -u slashjp/Slash/Hook/Sample/Sample.pm:1.2 slashjp/Slash/Hook/Sample/Sample.pm:1.3
--- slashjp/Slash/Hook/Sample/Sample.pm:1.2 Wed Dec 22 18:13:37 2004
+++ slashjp/Slash/Hook/Sample/Sample.pm Wed Jul 12 20:41:40 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Sample.pm,v 1.2 2004/12/22 09:13:37 oliver Exp $
+# $Id: Sample.pm,v 1.3 2006/07/12 11:41:40 sugi Exp $
package Slash::Hook::Sample;
use strict;
@@ -13,7 +13,7 @@
# Shake well, serve warm.
-($VERSION) = ' $Revision: 1.2 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
sub sample {
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:40 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:40 +0900
Subject: [Slashdotjp-dev 405] CVS update: slashjp/Slash/Install
Message-ID: <20060712114140.A1C552AC0D3@users.sourceforge.jp>
Index: slashjp/Slash/Install/Install.pm
diff -u slashjp/Slash/Install/Install.pm:1.3 slashjp/Slash/Install/Install.pm:1.4
--- slashjp/Slash/Install/Install.pm:1.3 Fri Dec 31 21:35:46 2004
+++ slashjp/Slash/Install/Install.pm Wed Jul 12 20:41:40 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Install.pm,v 1.3 2004/12/31 12:35:46 oliver Exp $
+# $Id: Install.pm,v 1.4 2006/07/12 11:41:40 sugi Exp $
package Slash::Install;
use strict;
@@ -17,7 +17,7 @@
# BENDER: Like most of life's problems, this one can be solved with bending.
-($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
sub new {
my($class, $user) = @_;
@@ -144,7 +144,7 @@
my($self, $answer, $themes, $symlink) = @_;
$themes ||= $self->{'_themes'};
- $self->_install($themes->{$answer}, $symlink);
+ $self->_install($themes->{$answer}, $symlink, 'theme');
}
sub installThemes {
@@ -153,8 +153,8 @@
for my $answer (@$answers) {
for (keys %$themes) {
- if ($answer eq $themes->{$_}{installorder}) {
- $self->_install($themes->{$_}, $symlink, 0);
+ if ($answer eq $themes->{$_}{order}) {
+ $self->_install($themes->{$_}, $symlink, 'theme');
}
}
}
@@ -164,7 +164,7 @@
my($self, $answer, $plugins, $symlink) = @_;
$plugins ||= $self->{'_plugins'};
- $self->_install($plugins->{$answer}, $symlink, 1);
+ $self->_install($plugins->{$answer}, $symlink, 'plugin');
}
sub installPlugins {
@@ -174,12 +174,32 @@
for my $answer (@$answers) {
for (keys %$plugins) {
if ($answer eq $plugins->{$_}{order}) {
- $self->_install($plugins->{$_}, $symlink, 1);
+ $self->_install($plugins->{$_}, $symlink, 'plugin');
}
}
}
}
+sub installTagbox {
+ my($self, $answer, $tagboxes, $symlink) = @_;
+ $tagboxes ||= $self->{'_tagboxes'};
+
+ $self->_install($tagboxes->{$answer}, $symlink, 'tagbox');
+}
+
+sub installTagboxes {
+ my($self, $answers, $tagboxes, $symlink) = @_;
+ $tagboxes ||= $self->{'_tagboxes'};
+
+ for my $answer (@$answers) {
+ for (keys %$tagboxes) {
+ if ($answer eq $tagboxes->{$_}{order}) {
+ $self->_install($tagboxes->{$_}, $symlink, 'tagbox');
+ }
+ }
+ }
+}
+
# Used internally by the _process_fh_into_sql method (which in
# turn is used internally by the _install method).
@@ -227,14 +247,16 @@
};
sub _install {
- my($self, $hash, $symlink, $is_plugin) = @_;
+ my($self, $hash, $symlink, $type) = @_;
+
# Yes, performance wise this is questionable, if getValue() was
# cached.... who cares this is the install. -Brian
if ($self->exists('hash', $hash->{name})) {
print STDERR "Plugin $hash->{name} has already been installed\n";
return;
}
- if ($is_plugin) {
+
+ if ($type eq 'plugin') {
return if $self->exists('plugin', $hash->{name});
$self->create({
@@ -247,7 +269,9 @@
value => $symlink ? 1 : 0,
description => "$hash->{name} plugin files installed symlink?"
});
- } else {
+ }
+
+ if ($type eq 'theme') {
# not sure if this is what we want, but leave it
# in until someone complains. really, we should
# have reinstall theme/plugin methods or
@@ -259,20 +283,32 @@
return if $self->exists('theme', $hash->{name});
$self->create({
- name => 'theme',
- value => $hash->{'name'},
- description => $hash->{'description'},
+ name => 'theme',
+ value => $hash->{'name'},
+ description => $hash->{'description'},
});
$self->create({
- name => 'theme_' . $hash->{name} . '_symlink',
- value => $symlink ? 1 : 0,
- description => "$hash->{name} theme files installed symlink?"
+ name => 'theme_' . $hash->{name} . '_symlink',
+ value => $symlink ? 1 : 0,
+ description => "$hash->{name} theme files installed symlink?"
});
}
+
+ if ($type eq 'tagbox') {
+ return if $self->exists('tagbox', $hash->{name});
+
+ $self->create({
+ name => 'tagbox',
+ value => $hash->{'name'},
+ description => $hash->{'description'},
+ });
+ }
+
my $driver = $self->getValue('db_driver');
my $prefix_site = $self->getValue('site_install_directory');
my %stuff = ( # [relative directory, executable]
+ css => ["htdocs", 1],
htdoc => ["htdocs", 1],
htdoc_code => ["htdocs/code", 0],
htdoc_faq => ["htdocs/faq", 0],
@@ -381,7 +417,7 @@
}
}
- unless ($is_plugin) {
+ if ($type eq "theme") {
my(%templates, @no_templates);
for my $name (@{$hash->{'include_theme'}}) {
my $slash_prefix = $self->get('base_install_directory')->{value};
@@ -455,7 +491,7 @@
}
}
- unless ($is_plugin) {
+ if ($type eq "theme") {
# This is where we cleanup any templates that don't belong
for (@{$hash->{'no-template'}}) {
my($name, $page, $skin) = split /;/, $_;
@@ -484,6 +520,13 @@
return $theme_list;
}
+sub getTagboxList {
+ my $tagbox_list = _getList(@_, 'tagboxes', 'TAGBOX');
+ setListOrder($tagbox_list);
+ setListInstallOrder($tagbox_list);
+ return $tagbox_list;
+}
+
sub getSiteTemplates {
my($self) = @_;
my (%templates, @no_templates, @final);
@@ -575,7 +618,7 @@
my($key, $val) = split(/=/, $_, 2);
$key = lc $key;
if ($key =~ /^(
- htdoc | htdoc_code | htdoc_faq |
+ css | htdoc | htdoc_code | htdoc_faq |
image | image_award | image_banner | image_faq |
no-template | include_theme | task | template | sbin | misc | topic
)s?$/x) {
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:40 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:40 +0900
Subject: [Slashdotjp-dev 406] CVS update: slashjp/Slash/Test
Message-ID: <20060712114140.C1BAF2AC0D6@users.sourceforge.jp>
Index: slashjp/Slash/Test/Test.pm
diff -u slashjp/Slash/Test/Test.pm:1.3 slashjp/Slash/Test/Test.pm:1.4
--- slashjp/Slash/Test/Test.pm:1.3 Fri Dec 31 21:35:47 2004
+++ slashjp/Slash/Test/Test.pm Wed Jul 12 20:41:40 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Test.pm,v 1.3 2004/12/31 12:35:47 oliver Exp $
+# $Id: Test.pm,v 1.4 2006/07/12 11:41:40 sugi Exp $
package Slash::Test;
@@ -56,7 +56,13 @@
Will export everything from Slash, Slash::Utility, Slash::Display,
Slash::Constants, Slash::XML, and Data::Dumper into the current namespace.
Will export $user, $anon, $form, $constants, $slashdb, and $gSkin as global
-variables into the current namespace.
+variables into the current namespace, along with a few other useful
+variables: $self (alias to $slashdb), $reader_db, $log_db, $writer_db,
+and $search_db.
+
+Also the name of each plugin will be a global variable referencing its
+object (e.g., C<$journal> is automatically created as a L
+object).
So use it one of three ways (use the default Virtual User,
or pass it in via the import list, or pass in with slashTest()), and then
@@ -94,7 +100,7 @@
use base 'Exporter';
use vars qw($VERSION @EXPORT);
-($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
@EXPORT = (
@Slash::EXPORT,
@Slash::Constants::EXPORT_OK,
@@ -146,7 +152,8 @@
=item Side effects
Set up the environment with createEnvironment(), export $user, $anon,
-$form, $constants, $slashdb, and $gSkin into current namespace.
+$form, $constants, $slashdb, and $gSkin into current namespace. $self
+is an alias to $slashdb.
=back
@@ -163,7 +170,7 @@
setCurrentSkin(determineCurrentSkin());
- $::slashdb = getCurrentDB();
+ $::self = $::slashdb = getCurrentDB();
$::constants = getCurrentStatic();
$::user = getCurrentUser();
$::anon = getCurrentAnonymousCoward();
@@ -279,4 +286,4 @@
=head1 VERSION
-$Id: Test.pm,v 1.3 2004/12/31 12:35:47 oliver Exp $
+$Id: Test.pm,v 1.4 2006/07/12 11:41:40 sugi Exp $
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:40 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:40 +0900
Subject: [Slashdotjp-dev 407] CVS update: slashjp/Slash/Utility
Message-ID: <20060712114140.E0C9B2AC0D7@users.sourceforge.jp>
Index: slashjp/Slash/Utility/Utility.pm
diff -u slashjp/Slash/Utility/Utility.pm:1.2 slashjp/Slash/Utility/Utility.pm:1.3
--- slashjp/Slash/Utility/Utility.pm:1.2 Wed Dec 22 18:13:38 2004
+++ slashjp/Slash/Utility/Utility.pm Wed Jul 12 20:41:40 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Utility.pm,v 1.2 2004/12/22 09:13:38 oliver Exp $
+# $Id: Utility.pm,v 1.3 2006/07/12 11:41:40 sugi Exp $
package Slash::Utility;
@@ -38,7 +38,7 @@
use base 'Exporter';
use vars qw($VERSION @EXPORT);
-($VERSION) = ' $Revision: 1.2 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
@EXPORT = (
@Slash::Utility::Access::EXPORT,
@Slash::Utility::Anchor::EXPORT,
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:41 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:41 +0900
Subject: [Slashdotjp-dev 408] CVS update: slashjp/Slash/Utility/Access
Message-ID: <20060712114141.0D0922AC0D3@users.sourceforge.jp>
Index: slashjp/Slash/Utility/Access/Access.pm
diff -u slashjp/Slash/Utility/Access/Access.pm:1.3 slashjp/Slash/Utility/Access/Access.pm:1.4
--- slashjp/Slash/Utility/Access/Access.pm:1.3 Fri Dec 31 21:35:47 2004
+++ slashjp/Slash/Utility/Access/Access.pm Wed Jul 12 20:41:40 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Access.pm,v 1.3 2004/12/31 12:35:47 oliver Exp $
+# $Id: Access.pm,v 1.4 2006/07/12 11:41:40 sugi Exp $
package Slash::Utility::Access;
@@ -30,12 +30,12 @@
use Slash::Utility::Data;
use Slash::Utility::Environment;
use Slash::Utility::System;
-use Slash::Constants qw(:web :people);
+use Slash::Constants qw(:web :people :messages);
use base 'Exporter';
use vars qw($VERSION @EXPORT);
-($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
@EXPORT = qw(
checkFormPost
formkeyError
@@ -393,11 +393,13 @@
if ($slashdb->checkTimesPosted($formname, $max, $id, $formkey_earliest)) {
undef $formkey unless $formkey =~ /^\w{10}$/;
- unless ($formkey && $slashdb->checkFormkey($formkey_earliest, $formname, $id, $formkey)) {
- $slashdb->createAbuse("invalid form key", $formname, $ENV{QUERY_STRING});
- $$err_message = Slash::getData('invalidformkey', '', '');
- return;
- }
+# wtf? no method checkFormkey exists ...
+# of course, checkFormPost is never even called ...
+# unless ($formkey && $slashdb->checkFormkey($formkey_earliest, $formname, $id, $formkey)) {
+# $slashdb->createAbuse("invalid form key", $formname, $ENV{QUERY_STRING});
+# $$err_message = Slash::getData('invalidformkey', '', '');
+# return;
+# }
if (submittedAlready($formkey, $formname, $err_message)) {
$slashdb->createAbuse("form already submitted", $formname, $ENV{QUERY_STRING});
@@ -520,6 +522,12 @@
my($formname, $field, $content, $wsfactor) = @_;
$wsfactor ||= 1;
+ # If no content (or I suppose the single char '0') is passed in,
+ # just report that it passes the test. Hopefully the caller is
+ # performing other checks to make sure that boundary condition
+ # is addresses.
+ return 1 if !$content;
+
my $slashdb = getCurrentDB();
my $constants = getCurrentStatic();
my $user = getCurrentUser();
@@ -732,8 +740,7 @@
my $reg_subj = Slash::getData('rereg_email_subject', '', '');
- # Send the message (message code == -2)
- doEmail($uid, $reg_subj, $reg_msg, -2);
+ doEmail($uid, $reg_subj, $reg_msg, MSG_CODE_REGISTRATION);
} else {
# We only need to clear these.
$slashdb->setUser($uid, {
@@ -811,4 +818,4 @@
=head1 VERSION
-$Id: Access.pm,v 1.3 2004/12/31 12:35:47 oliver Exp $
+$Id: Access.pm,v 1.4 2006/07/12 11:41:40 sugi Exp $
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:41 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:41 +0900
Subject: [Slashdotjp-dev 422] CVS update: slashjp/Slash/Utility/Anchor
Message-ID: <20060712114141.2F5672AC0D6@users.sourceforge.jp>
Index: slashjp/Slash/Utility/Anchor/Anchor.pm
diff -u slashjp/Slash/Utility/Anchor/Anchor.pm:1.6 slashjp/Slash/Utility/Anchor/Anchor.pm:1.7
--- slashjp/Slash/Utility/Anchor/Anchor.pm:1.6 Tue Oct 18 20:01:04 2005
+++ slashjp/Slash/Utility/Anchor/Anchor.pm Wed Jul 12 20:41:41 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Anchor.pm,v 1.6 2005/10/18 11:01:04 tach Exp $
+# $Id: Anchor.pm,v 1.7 2006/07/12 11:41:41 sugi Exp $
package Slash::Utility::Anchor;
@@ -28,7 +28,6 @@
use Apache;
use Apache::Constants ':http';
use Digest::MD5 'md5_hex';
-use Encode 'encode_utf8';
use Slash::Display;
use Slash::Utility::Data;
use Slash::Utility::Display;
@@ -37,7 +36,7 @@
use base 'Exporter';
use vars qw($VERSION @EXPORT);
-($VERSION) = ' $Revision: 1.6 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.7 $ ' =~ /\$Revision:\s+([^\s]+)/;
@EXPORT = qw(
http_send
header
@@ -143,9 +142,6 @@
# $r->header_out('Cache-Control', 'private');
# }
- $options->{last_modified} &&
- $r->header_out('Last-Modified', $options->{last_modified});
-
$r->send_http_header;
return if $r->header_only;
}
@@ -195,6 +191,7 @@
# Should we also pass thru {page} here or is that outdated?
#print STDERR "header(options->page) defined: '$options->{page}' for title '$data->{title}'\n" if defined($options->{page});
$data->{tab_selected} = $options->{tab_selected} if $options->{tab_selected};
+ $data->{nopageid} = $options->{nopageid};
if ($options->{admin} && $user->{is_admin}) {
$user->{state}{adminheader} = 1;
@@ -269,7 +266,7 @@
if ($opt->{etag} || $opt->{do_etag}) {
if ($opt->{do_etag} && $opt->{content}) {
- $opt->{etag} = md5_hex(encode_utf8($opt->{content}));
+ $opt->{etag} = md5_hex($opt->{content});
}
$r->header_out('ETag', $opt->{etag});
@@ -284,13 +281,18 @@
if ($opt->{filename}) {
$opt->{filename} =~ s/[^\w_.-]/_/g;
my $val = "filename=$opt->{filename}";
- $val = "attachment; $val" if $opt->{attachment};
+ # none by default, MSIE etc. had problems?
+ if ($opt->{dis_type}) {
+ $opt->{dis_type} =~ s/\W+//;
+ $val = "$opt->{dis_type}; $val";
+ }
$r->header_out('Content-Disposition', $val);
}
$r->status($opt->{status});
$r->send_http_header;
$r->rflush;
+#print STDERR "http_send sent, header_only='" . ($r->header_only) . "' length(content)='" . length($opt->{content}) ."'\n";
return 1 if $r->header_only;
if ($opt->{content}) {
@@ -343,7 +345,7 @@
my $display;
if ($form->{ssi} && $form->{ssi} eq 'yes') {
- ssiHeadFoot('footer', $options);
+ ssiHeadFoot('footer', $options);
return 1;
}
@@ -432,10 +434,15 @@
# if there's a special .inc header for this page, use it, else it's
# business as usual.
- $page = '' unless ($page ne 'misc' && $slashdb->existsTemplate({
- name => $headorfoot,
- skin => $gSkin->{name},
- page => $user->{currentPage} }));
+ $page = '' unless ($page ne 'misc' &&
+ $slashdb->existsTemplate({
+ name => $headorfoot,
+ skin => $gSkin->{name},
+ page => $user->{currentPage}
+ })
+
+ );
+
my $ssiheadorfoot = 'ssi' . substr($headorfoot, 0, 4);
@@ -626,7 +633,7 @@
# sometimes, when this is called from shtml, the section is not
# in $user like we'd like it to be. This attempts to remedy this.
# --Pater
- $user->{currentSection} = $constants->{static_section} if $user->{currentSection} eq '';
+ $user->{currentSection} = $constants->{static_section} if !defined($user->{currentSection}) || $user->{currentSection} eq '';
unless ($ENV{SCRIPT_NAME}) {
# When run from a slashd task (or from the command line in
@@ -641,10 +648,9 @@
# If this is the first time that getAd() is being called, we have
# to set up all the ad data at once before we can return anything.
if (!defined $user->{state}{ad}) {
- if ($constants->{use_minithin} && $constants->{plugin}{MiniThin}) {
- # new way
- my $minithin = getObject('Slash::MiniThin', { db_type => 'reader' });
- $minithin->minithin;
+ if ($constants->{use_falk} && $constants->{plugin}{Falk}) {
+ my $falk = getObject('Slash::Falk', { db_type => 'reader' });
+ $falk->falk;
} else {
# old way
prepAds();
@@ -654,17 +660,18 @@
if ($num == 2 && $need_box) {
# we need the ad wrapped in a fancybox
if (defined $user->{state}{ad}{$num}
+ && $user->{state}{ad}{$num} =~ /\S/
&& $user->{state}{ad}{$num} !~ /^
[%
@@ -69,4 +69,4 @@
-%]
__version__
-$Id: data;email;default,v 1.3 2004/12/31 12:35:53 oliver Exp $
+$Id: data;email;default,v 1.4 2006/07/12 11:41:48 sugi Exp $
Index: slashjp/plugins/Email/templates/dispStory;email;default
diff -u slashjp/plugins/Email/templates/dispStory;email;default:1.3 slashjp/plugins/Email/templates/dispStory;email;default:1.4
--- slashjp/plugins/Email/templates/dispStory;email;default:1.3 Fri Dec 31 21:35:53 2004
+++ slashjp/plugins/Email/templates/dispStory;email;default Wed Jul 12 20:41:48 2006
@@ -32,9 +32,7 @@
IF constants.use_dept;
box(" from the $story.dept dept.");
END;
- thisurl = Slash.url2abs(
- Slash.db.getSection(story.section, 'rootdir'), gSkin.absolutedir) ||
- gSkin.absolutedir;
+ thisurl = Slash.url2abs(Slash.db.getSection(story.primaryskid, 'rootdir'), absolutedir) || absolutedir;
stime = Slash.timeCalc(story.time, "%A %B %d, @%H:%M");
box(" posted by $author on $stime ($topicname)");
@@ -58,7 +56,7 @@
To opt-out of further emailings:
[% thisurl %]/email.pl?op=optout_form
-Copyright 1997-2004 [% constants.sitepublisher %]. All rights reserved.
+Copyright 1997-2005 [% constants.sitepublisher %]. All rights reserved.
__version__
-$Id: dispStory;email;default,v 1.3 2004/12/31 12:35:53 oliver Exp $
+$Id: dispStory;email;default,v 1.4 2006/07/12 11:41:48 sugi Exp $
Index: slashjp/plugins/Email/templates/emailOptoutForm;email;default
diff -u slashjp/plugins/Email/templates/emailOptoutForm;email;default:1.2 slashjp/plugins/Email/templates/emailOptoutForm;email;default:1.3
--- slashjp/plugins/Email/templates/emailOptoutForm;email;default:1.2 Fri Dec 31 21:35:53 2004
+++ slashjp/plugins/Email/templates/emailOptoutForm;email;default Wed Jul 12 20:41:48 2006
@@ -21,17 +21,17 @@
width="99%"
title="Opt-Out of Story Mailings" -%]
-
+Enter email address to be removed from further story mailings:
+
+
+Enter email address to be removed from the opt-out list:
+
+
+
+
__version__
-$Id: removeOptoutForm;email;default,v 1.2 2004/12/31 12:35:53 oliver Exp $
+$Id: removeOptoutForm;email;default,v 1.3 2006/07/12 11:41:48 sugi Exp $
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:49 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:49 +0900
Subject: [Slashdotjp-dev 441] CVS update: slashjp/plugins/Hof
Message-ID: <20060712114149.3C5092AC103@users.sourceforge.jp>
Index: slashjp/plugins/Hof/Hof.pm
diff -u slashjp/plugins/Hof/Hof.pm:1.3 slashjp/plugins/Hof/Hof.pm:1.4
--- slashjp/plugins/Hof/Hof.pm:1.3 Fri Dec 31 21:36:48 2004
+++ slashjp/plugins/Hof/Hof.pm Wed Jul 12 20:41:49 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Hof.pm,v 1.3 2004/12/31 12:36:48 oliver Exp $
+# $Id: Hof.pm,v 1.4 2006/07/12 11:41:49 sugi Exp $
package Slash::Hof;
@@ -11,7 +11,7 @@
use vars qw($VERSION);
use base 'Slash::DB::Utility';
-($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
# FRY: And where would a giant nerd be? THE LIBRARY!
@@ -120,8 +120,8 @@
my($self) = @_;
my $stories = $self->sqlSelectAll(
'stories.sid, title, primaryskid, hits, users.nickname',
- "stories, story_text, users
- LEFT JOIN story_param
+ "story_text, users,
+ stories LEFT JOIN story_param
ON stories.stoid=story_param.stoid AND story_param.name='neverdisplay'",
'stories.stoid=story_text.stoid
AND story_param.name IS NULL
Index: slashjp/plugins/Hof/PLUGIN
diff -u slashjp/plugins/Hof/PLUGIN:1.2 slashjp/plugins/Hof/PLUGIN:1.3
--- slashjp/plugins/Hof/PLUGIN:1.2 Fri Dec 24 05:13:37 2004
+++ slashjp/plugins/Hof/PLUGIN Wed Jul 12 20:41:49 2006
@@ -1,4 +1,4 @@
-# $Id: PLUGIN,v 1.2 2004/12/23 20:13:37 oliver Exp $
+# $Id: PLUGIN,v 1.3 2006/07/12 11:41:49 sugi Exp $
name=Hof
description="High score stuff"
htdoc=hof.pl
Index: slashjp/plugins/Hof/hof.pl
diff -u slashjp/plugins/Hof/hof.pl:1.3 slashjp/plugins/Hof/hof.pl:1.4
--- slashjp/plugins/Hof/hof.pl:1.3 Fri Dec 31 21:36:48 2004
+++ slashjp/plugins/Hof/hof.pl Wed Jul 12 20:41:49 2006
@@ -1,8 +1,8 @@
#!/usr/bin/perl -w
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: hof.pl,v 1.3 2004/12/31 12:36:48 oliver Exp $
+# $Id: hof.pl,v 1.4 2006/07/12 11:41:49 sugi Exp $
use strict;
use Slash;
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:49 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:49 +0900
Subject: [Slashdotjp-dev 442] CVS update: slashjp/plugins/HumanConf
Message-ID: <20060712114149.899D92AC105@users.sourceforge.jp>
Index: slashjp/plugins/HumanConf/HumanConf.pm
diff -u slashjp/plugins/HumanConf/HumanConf.pm:1.3 slashjp/plugins/HumanConf/HumanConf.pm:1.4
--- slashjp/plugins/HumanConf/HumanConf.pm:1.3 Fri Dec 31 21:36:48 2004
+++ slashjp/plugins/HumanConf/HumanConf.pm Wed Jul 12 20:41:49 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: HumanConf.pm,v 1.3 2004/12/31 12:36:48 oliver Exp $
+# $Id: HumanConf.pm,v 1.4 2006/07/12 11:41:49 sugi Exp $
package Slash::HumanConf;
@@ -16,7 +16,7 @@
use base 'Slash::DB::Utility';
use base 'Slash::DB::MySQL';
-($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
sub new {
my($class, $user) = @_;
@@ -191,7 +191,7 @@
# wasted by previous incorrect answers.
return 'invalidhc';
}
- if ($form->{hcanswer} && $form->{hcanswer} eq $answer) {
+ if ($form->{hcanswer} && lc($form->{hcanswer}) eq lc($answer)) {
# Correct answer submitted.
return 'ok';
}
Index: slashjp/plugins/HumanConf/INSTALL-NOTES
diff -u slashjp/plugins/HumanConf/INSTALL-NOTES:1.1.1.1 slashjp/plugins/HumanConf/INSTALL-NOTES:1.2
--- slashjp/plugins/HumanConf/INSTALL-NOTES:1.1.1.1 Wed Jan 28 06:54:58 2004
+++ slashjp/plugins/HumanConf/INSTALL-NOTES Wed Jul 12 20:41:49 2006
@@ -14,7 +14,7 @@
If you're on Debian, install these packages:
- libfreetype6 libfreetype6-dev freetype2
+ libfreetype6 libfreetype6-dev libttf2
libjpeg62 libjpeg62-dev
libgd2-xpm libgd2-xpm-dev libgd-tools
@@ -33,7 +33,7 @@
install GD GD::Text GD::Text::Align
-You'll be asked about whether you want to build it with JPEG, FreeType and
+You may be asked about whether you want to build it with JPEG, FreeType and
XPM support; answer yes, yes, and I don't think XPM matters either way.
If you have compile problems during the make, check which version of libgd
you have installed and compare against the library version that the perl
Index: slashjp/plugins/HumanConf/PLUGIN
diff -u slashjp/plugins/HumanConf/PLUGIN:1.2 slashjp/plugins/HumanConf/PLUGIN:1.3
--- slashjp/plugins/HumanConf/PLUGIN:1.2 Fri Dec 24 05:13:37 2004
+++ slashjp/plugins/HumanConf/PLUGIN Wed Jul 12 20:41:49 2006
@@ -1,4 +1,4 @@
-# $Id: PLUGIN,v 1.2 2004/12/23 20:13:37 oliver Exp $
+# $Id: PLUGIN,v 1.3 2006/07/12 11:41:49 sugi Exp $
name=HumanConf
description="Human Confirmation"
mysql_dump=mysql_dump
Index: slashjp/plugins/HumanConf/hc_maintain_pool.pl
diff -u slashjp/plugins/HumanConf/hc_maintain_pool.pl:1.2 slashjp/plugins/HumanConf/hc_maintain_pool.pl:1.3
--- slashjp/plugins/HumanConf/hc_maintain_pool.pl:1.2 Fri Dec 24 05:13:37 2004
+++ slashjp/plugins/HumanConf/hc_maintain_pool.pl Wed Jul 12 20:41:49 2006
@@ -1,13 +1,13 @@
#!/usr/bin/perl -w
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: hc_maintain_pool.pl,v 1.2 2004/12/23 20:13:37 oliver Exp $
+# $Id: hc_maintain_pool.pl,v 1.3 2006/07/12 11:41:49 sugi Exp $
use strict;
use Slash::Utility;
-use vars qw( %task $me );
+use vars qw( %task $me $task_exit_flag );
$task{$me}{timespec} = '10,40 * * * *';
$task{$me}{timespec_panic_1} = '';
@@ -24,6 +24,7 @@
my($deleted, $inserted, $cursize, $hcoff) = (0, 0, 0, '');
if ($constants->{hc}) {
$deleted = $humanconf->deleteOldFromPool() || 0;
+ return "del $deleted, aborted after deleteOldFromPool" if $task_exit_flag;
$inserted = $humanconf->fillPool() || 0;
$cursize = $humanconf->getPoolSize() || 0;
} else {
Index: slashjp/plugins/HumanConf/mysql_dump
diff -u slashjp/plugins/HumanConf/mysql_dump:1.3 slashjp/plugins/HumanConf/mysql_dump:1.4
--- slashjp/plugins/HumanConf/mysql_dump:1.3 Fri Dec 31 21:36:48 2004
+++ slashjp/plugins/HumanConf/mysql_dump Wed Jul 12 20:41:49 2006
@@ -1,23 +1,29 @@
#
-# $Id: mysql_dump,v 1.3 2004/12/31 12:36:48 oliver Exp $
+# $Id: mysql_dump,v 1.4 2006/07/12 11:41:49 sugi Exp $
#
INSERT INTO humanconf_questions (hcqid, filedir, urlprefix, question) VALUES (1, '/usr/local/slash/site/www.example.com/htdocs/images/hc', 'http://www.example.com/images/hc', 'To confirm you\'re not a script, please type the text shown in this image:');
INSERT INTO vars (name, value, description) VALUES ('hc', '0', 'HumanConf master switch, 0=off, 1=on');
+INSERT INTO vars (name, value, description) VALUES ('hc_fontpath', '/usr/share/fonts/truetype', 'GD::Text font_path');
INSERT INTO vars (name, value, description) VALUES ('hc_formname_regex', '^(?:comments|(?:login|users)/(?:nu|mp))$', 'Formnames which (may) require HumanConf');
INSERT INTO vars (name, value, description) VALUES ('hc_maxkarma', '25', 'Maximum karma at which users need HumanConf (beyond this we assume they are human) - set large negative to exempt all logged-in users, set large positive if all users must comply');
-INSERT INTO vars (name, value, description) VALUES ('hc_q1_prefnumpixels', '1000', 'For question 1 (images), preferred number of pixels');
+INSERT INTO vars (name, value, description) VALUES ('hc_q1_lettersomit', 'hlou', 'For question 1 (images), which letters should never appear?');
+INSERT INTO vars (name, value, description) VALUES ('hc_q1_linethick', '2', 'For question 1 (images), thickness of the lines that are drawn to confuse OCR');
+INSERT INTO vars (name, value, description) VALUES ('hc_q1_linecloseness', '8', 'For question 1 (images), closeness of the lines drawn over the letters, higher means more density');
INSERT INTO vars (name, value, description) VALUES ('hc_q1_margin', '6', 'For question 1 (images), margin around the image in pixels');
INSERT INTO vars (name, value, description) VALUES ('hc_q1_maxrad', '0.2', 'For question 1 (images), maximum number of radians to rotate (positive or negative, so the range is twice this)');
INSERT INTO vars (name, value, description) VALUES ('hc_q1_numchars', '3', 'For question 1 (images), number of chars of text in the answer');
-INSERT INTO vars (name, value, description) VALUES ('hc_fontpath', '/usr/share/fonts/truetype', 'GD::Text font_path');
+INSERT INTO vars (name, value, description) VALUES ('hc_q1_prefnumpixels', '1000', 'For question 1 (images), preferred number of pixels');
+INSERT INTO vars (name, value, description) VALUES ('hc_q1_usedict', '', 'For question 1 (images), use words from a dictionary? if blank, no; otherwise, value is the absolute path to the newline-delimited file e.g. /usr/dict/words and hc_q1_lettersomit is ignored');
+INSERT INTO vars (name, value, description) VALUES ('hc_q1_usedict_excl', 'shiny$ metal ^daffodil', 'If hc_q1_usedict is set, space-sep list of regexes to exclude from words to use');
INSERT INTO vars (name, value, description) VALUES ('hc_poolsize', '20000', 'Number of entries desired for the HumanConf pool');
INSERT INTO vars (name, value, description) VALUES ('hc_poolmaxfill', '2000', 'Number of entries at a time to fill the pool with');
INSERT INTO vars (name, value, description) VALUES ('hc_pool_secs_before_del', '21600', 'Number of seconds after a pool entry last used before it will be deleted');
INSERT INTO vars (name, value, description) VALUES ('hc_pool_secs_before_use', '10', 'Number of seconds after a pool entry created before it will be used');
INSERT INTO vars (name, value, description) VALUES ('hc_possible_fonts', '', 'Possible fonts to use (space-separated, empty for the default)');
-INSERT INTO vars (name, value, description) VALUES ('hc_sw_comments', '0', 'HumanConf switch for posting comments');
+INSERT INTO vars (name, value, description) VALUES ('hc_sw_comments', '0', 'HumanConf switch for posting comments: 0=off, 1=anon only, 2=also logged-in with low karma');
INSERT INTO vars (name, value, description) VALUES ('hc_sw_mailpasswd', '1', 'HumanConf switch for mailing a password');
INSERT INTO vars (name, value, description) VALUES ('hc_sw_newuser', '1', 'HumanConf switch for creating a new user');
INSERT INTO vars (name, value, description) VALUES ('hc_image_format','jpeg','Format for HC images (png, jpeg, etc.)');
+
Index: slashjp/plugins/HumanConf/mysql_schema
diff -u slashjp/plugins/HumanConf/mysql_schema:1.2 slashjp/plugins/HumanConf/mysql_schema:1.3
--- slashjp/plugins/HumanConf/mysql_schema:1.2 Fri Dec 24 05:13:37 2004
+++ slashjp/plugins/HumanConf/mysql_schema Wed Jul 12 20:41:49 2006
@@ -1,5 +1,5 @@
#
-# $Id: mysql_schema,v 1.2 2004/12/23 20:13:37 oliver Exp $
+# $Id: mysql_schema,v 1.3 2006/07/12 11:41:49 sugi Exp $
#
DROP TABLE IF EXISTS humanconf;
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:49 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:49 +0900
Subject: [Slashdotjp-dev 443] CVS update: slashjp/plugins/HumanConf/templates
Message-ID: <20060712114149.D741B2AC0EB@users.sourceforge.jp>
Index: slashjp/plugins/HumanConf/templates/data;humanconf;default
diff -u slashjp/plugins/HumanConf/templates/data;humanconf;default:1.2 slashjp/plugins/HumanConf/templates/data;humanconf;default:1.3
--- slashjp/plugins/HumanConf/templates/data;humanconf;default:1.2 Fri Dec 24 05:13:38 2004
+++ slashjp/plugins/HumanConf/templates/data;humanconf;default Wed Jul 12 20:41:49 2006
@@ -15,16 +15,16 @@
[% CASE 'nomorechances' %]
[% returnme.data_constant = 1 %]
- Sorry, you failed to prove your humanity. To try again,
- you have to start over.
+ Sorry, you failed to prove your humanity. To try again,
+ you have to start over.
[% CASE 'imgalttext' %]
[% returnme.data_constant = 1 %]
- [% "random letters - if you are visually impaired, please email us at "
+ [% "verification text - if you are visually impaired, please email us at "
_ constants.adminmail | strip_attribute %]
[% END %]
__seclev__
500
__version__
-$Id: data;humanconf;default,v 1.2 2004/12/23 20:13:38 oliver Exp $
+$Id: data;humanconf;default,v 1.3 2006/07/12 11:41:49 sugi Exp $
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:49 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:49 +0900
Subject: [Slashdotjp-dev 444] CVS update: slashjp/plugins/HumanConf/Static
Message-ID: <20060712114149.B55A22AC106@users.sourceforge.jp>
Index: slashjp/plugins/HumanConf/Static/Static.pm
diff -u slashjp/plugins/HumanConf/Static/Static.pm:1.3 slashjp/plugins/HumanConf/Static/Static.pm:1.4
--- slashjp/plugins/HumanConf/Static/Static.pm:1.3 Fri Dec 31 21:36:49 2004
+++ slashjp/plugins/HumanConf/Static/Static.pm Wed Jul 12 20:41:49 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Static.pm,v 1.3 2004/12/31 12:36:49 oliver Exp $
+# $Id: Static.pm,v 1.4 2006/07/12 11:41:49 sugi Exp $
package Slash::HumanConf::Static;
@@ -18,7 +18,7 @@
use base 'Slash::DB::Utility';
use base 'Slash::DB::MySQL';
-($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
sub new {
my($class, $user) = @_;
@@ -35,30 +35,11 @@
$self->{imagemargin} = $constants->{hc_q1_margin} || 6;
- # Use a bit of randomness and fallback to find a font we like.
- my @possible_fonts = @{$constants->{hc_possible_fonts}};
- @possible_fonts = ( gdMediumBoldFont, gdLargeFont, gdGiantFont ) if !@possible_fonts;
- @possible_fonts = sort { int(rand(3))-1 } @possible_fonts;
-
- $self->{prefnumpixels} = $constants->{hc_q1_prefnumpixels} || 1000;
- my $gdtext = new GD::Text();
- $gdtext->font_path($constants->{hc_fontpath} || '/usr/share/fonts/truetype');
- $gdtext->set_text($self->shortRandText());
- my $smallest_diff = 2**31;
- for my $font (@possible_fonts) {
- @{$self->{set_font_args}} = ( $font );
- if ($font =~ m{^(\w+)/(\d+)$}) {
- @{$self->{set_font_args}} = ($1, $2);
- }
- $gdtext->set_font(@{$self->{set_font_args}});
- my($tempw, $temph) = ($gdtext->get("width"), $gdtext->get("height"));
- my $pixels = ($tempw+$self->{imagemargin}) * ($temph+$self->{imagemargin});
- my $diff = $pixels - $self->{prefnumpixels};
- $diff = -$diff if $diff < 0;
- if ($diff < $smallest_diff) {
- $self->{font} = $font;
- $smallest_diff = $diff;
- }
+ # Set the list of possible fonts.
+ if ($constants->{hc_possible_fonts} && @{$constants->{hc_possible_fonts}}) {
+ @{ $self->{possible_fonts} } = @{$constants->{hc_possible_fonts}};
+ } else {
+ @{ $self->{possible_fonts} } = ( gdMediumBoldFont, gdLargeFont, gdGiantFont );
}
return $self;
@@ -112,7 +93,10 @@
my $delrows = 0;
my $loop_num = 1;
my $remaining_to_delete = $want_delete;
+ my $successfully_deleted = 0;
my $secs = $constants->{hc_pool_secs_before_del} || 21600;
+ my $lastused_max_secs = $secs * 2;
+ $lastused_max_secs = 86400*3 if $lastused_max_secs < 86400*3;
my $q_hr = $self->sqlSelectAllHashref(
"hcqid",
"hcqid, filedir",
@@ -136,7 +120,7 @@
"humanconf_pool",
{ inuse => 2, -lastused => "lastused" },
"lastused < DATE_SUB(NOW(), INTERVAL $secs SECOND)
- AND inuse = 0
+ AND (inuse = 0 OR lastused < DATE_SUB(NOW(), INTERVAL $lastused_max_secs SECOND))
$hcpid_clause"
);
next if !$rows;
@@ -192,17 +176,9 @@
"humanconf_pool",
"hcpid IN ($hcpids_list)"
);
- if ($new_delrows != $remaining_to_delete) {
- warn "HumanConf warning: deleted number"
- . " of rows '$new_delrows'"
- . " not equal to attempted number to delete"
- . " '$remaining_to_delete'";
- }
+ $successfully_deleted += $new_delrows;
$remaining_to_delete -= $new_delrows;
$delrows += $new_delrows;
- } else {
- warn "HumanConf warning: no rows to delete; attempted"
- . " '$remaining_to_delete'";
}
# Pass 5:
@@ -216,6 +192,10 @@
++$loop_num;
}
+
+ if ($loop_num > 2) {
+ warn scalar(gmtime) . " hc_maintain_pool.pl deleteOldFromPool looped $loop_num times, deleted $successfully_deleted of $want_delete";
+ }
# Return the number of rows successfully deleted. This
# should also be the number of files deleted.
@@ -285,11 +265,11 @@
# (Collisions should only occur one time in a zillion, but
# it's always a good idea to check.)
my $encoded_name = $self->encode_hcpid($hcpid + $randomfactor);
- $filename = sprintf("%02d/%s$extension", $hcpid%100, $encoded_name);
+ $filename = sprintf("%02d/%s%s", $hcpid % 100, $encoded_name, $extension);
$full_filename = "$dir/$filename";
if (-e $full_filename) {
$filename = "";
- $randomfactor = rand(1000);
+ $randomfactor = int(rand(1000));
}
}
my $full_dir = $full_filename;
@@ -332,6 +312,155 @@
}, "hcpid=$hcpid");
}
+sub get_sizediff {
+ my($self, $gdtext, $pixels_wanted, $font, $fontsize) = @_;
+ $gdtext->set_font($font, $fontsize);
+ my($tempw, $temph) = ($gdtext->get("width"), $gdtext->get("height"));
+ my $pixels = ($tempw+$self->{imagemargin}) * ($temph+$self->{imagemargin});
+ my $diff = abs($pixels - $pixels_wanted);
+ return $diff;
+}
+
+sub get_new_gdtext {
+ my($self, $text) = @_;
+ my $constants = getCurrentStatic();
+
+ my $gdtext = new GD::Text();
+ $gdtext->font_path($constants->{hc_fontpath} || '/usr/share/fonts/truetype');
+ $gdtext->set_text($text);
+
+ return $gdtext;
+}
+
+sub get_font_args {
+ my($self, $text) = @_;
+ my $constants = getCurrentStatic();
+
+ my $gdtext = $self->get_new_gdtext($text);
+
+ $self->{prefnumpixels} = $constants->{hc_q1_prefnumpixels} || 1000;
+
+ my @pf = @{ $self->{possible_fonts} };
+ my $font = @pf[rand @pf] || '';
+ my $first_fontsize_try = 30; # default first guess
+ if ( $font =~ m{^(\w+)/(\d+)$} ) {
+ $font = $1;
+ $first_fontsize_try = $2;
+ }
+
+ # "pixels wanted"
+ my $pw = $self->{prefnumpixels};
+
+ # We are looking for the minimum of the pixel difference. Since
+ # image size increases monotonically with font size, there is
+ # guaranteed to be exactly 1 or 2 values at which the pixel diff
+ # is at a minimum. We begin with one guess, then check the
+ # diffs immediately above and below it to see which is headed in
+ # the right direction.
+ my $i = $first_fontsize_try - 1;
+ my $j = $first_fontsize_try; # first guess
+ my $k = $first_fontsize_try + 1;
+ my $di = $self->get_sizediff($gdtext, $pw, $font, $i);
+ my $dj = $self->get_sizediff($gdtext, $pw, $font, $j);
+ my $dk = $self->get_sizediff($gdtext, $pw, $font, $k);
+ if ($di == $dj || $dj == $dk) {
+ # Two values being equal means that they are both the
+ # minimum, so we can return either one. We got lucky!
+ return ($font, $j);
+ }
+ if ($di > $dj && $dj < $dk) {
+ # The center value being smaller than the other two
+ # means that it is the one minimum. We got lucky!
+ return ($font, $j);
+ }
+
+ # Either i or k is a better choice than j. Figure out which,
+ # then set up the vars so we walk up or down sizes starting
+ # from there.
+ my @vals = ( $j );
+ my $start = $j;
+ my $multiplier;
+ if ($di < $dj) {
+ # i is a better direction, so we walk down.
+ $multiplier = 5/6;
+ push @vals, $i;
+ } else {
+ # k is a better direction, so we walk up.
+ $multiplier = 6/5;
+ push @vals, $k;
+ }
+
+ # Walk up or down until we bridge the minimum. We'll know
+ # that happens when we find a value that _increases_ from
+ # the minimum seen so far. We want to save the last 3
+ # values found, at that point.
+ my $min_so_far = $dj;
+ my $best_size = $j;
+ my $found_min = 0;
+ my $next_try = $start;
+ my($fontsize_smallest, $fontsize_largest) = (5, 100);
+ while (!$found_min) {
+ my $old_try = $next_try;
+ $next_try = int($old_try * $multiplier + 0.5);
+ if ($next_try == $old_try) {
+ # Must change by at least one point size
+ if ($multiplier < 1) {
+ $next_try = $old_try - 1;
+ } else {
+ $next_try = $old_try + 1;
+ }
+ }
+ push @vals, $next_try;
+ my $new_d = $self->get_sizediff($gdtext, $pw, $font, $next_try);
+ if ($new_d < $min_so_far) {
+ # That beats the old record.
+ $min_so_far = $new_d;
+ $best_size = $next_try;
+ } else {
+ # OK, we've crossed the minimum and come back up.
+ $found_min = 1;
+ }
+ if ($next_try < $fontsize_smallest || $next_try > $fontsize_largest) {
+ # We're out of bounds, that's bad.
+ $found_min = 1;
+ print STDERR scalar(gmtime) . " Font size out of bounds: $font $next_try $new_d\n";
+ }
+ }
+
+ # The answer we want is somewhere in the range of the last
+ # 3 values we checked.
+ my($left, $right);
+ if ($multiplier < 1) {
+ $left = $vals[-1];
+ $right = $vals[-3];
+ } else {
+ $left = $vals[-3];
+ $right = $vals[-1];
+ }
+#print STDERR "font=$font left=$left right=$right vals=@vals\n";
+
+ # Hopefully this is a narrow range so we can just check values
+ # within it to find the answer we want. (This could be better
+ # optimized, but at this point, image generation happens very
+ # quickly, so I'm satisfied so far.)
+ $min_so_far = 2**31 - 1;
+ $best_size = undef;
+ DO_TRY: for $next_try ($left .. $right) {
+ my $new_d = $self->get_sizediff($gdtext, $pw, $font, $next_try);
+ if ($new_d < $min_so_far) {
+ $min_so_far = $new_d;
+ $best_size = $next_try;
+ } else {
+#print STDERR "font=$font next_try=$next_try new_d=$new_d min_so_far=$min_so_far done\n";
+ # We've just gone past the minimum, we're done.
+ last DO_TRY;
+ }
+#print STDERR "font=$font next_try=$next_try new_d=$new_d min_so_far=$min_so_far best_size=$best_size\n";
+ }
+
+ return($font, $best_size);
+}
+
sub drawImage {
my($self) = @_;
my $constants = getCurrentStatic();
@@ -347,13 +476,13 @@
# Set up the text object (this could probably be cached in $self,
# but it hardly takes any time to do it over and over).
- my $gdtext = new GD::Text();
- $gdtext->font_path($constants->{hc_fontpath} || '/usr/share/fonts/truetype');
+ my $answer = $self->shortRandText();
+ my @font_args = $self->get_font_args($answer);
+ my $gdtext = $self->get_new_gdtext($answer);
+ $gdtext->set_font(@font_args);
- # Set up the text, and set up the image.
- my $answer = shortRandText();
- $gdtext->set_text($answer);
- $gdtext->set_font(@{$self->{set_font_args}});
+ # Based on the font size for this word, and the resulting size
+ # of the drawn text, set up the image object.
my($width, $height) = ($gdtext->get("width")+$self->{imagemargin},
$gdtext->get("height")+$self->{imagemargin});
my $image = new GD::Image($width, $height);
@@ -376,10 +505,15 @@
# Paint the white background.
$image->filledRectangle(0, 0, $width, $height, $background);
+ if ($image->can('setThickness')) {
+ # I don't think GD prior to 2.07 has setThickness().
+ $image->setThickness($constants->{hc_q1_linethick} || 1);
+ }
my $poly = new GD::Polygon;
if ($width+$height > 100) {
# Draw a grid of lines on the image, same color as the text.
- my $pixels_between = ($width+$height)/8;
+ my $lc = $constants->{hc_q1_linecloseness} || 8;
+ my $pixels_between = ($width+$height)/$lc;
$pixels_between = 20 if $pixels_between < 20;
my $offset = int(rand($pixels_between));
my $x = int(rand($pixels_between));
@@ -425,17 +559,53 @@
$image->setPixel($px, $py, @dotcolor[rand($n_dotcolors)]);
}
- # Superimpose the text over the random stuff.
- my $gdtextalign = new GD::Text::Align(
+ # Set up an alignment box so we can determine where to put the
+ # text on the image.
+ my $gdtextalign_bbox = new GD::Text::Align(
$image,
- halign=>"center", valign=>"center",
- color => $textcolor
+ halign => 'center', valign => 'center',
+ text => $answer,
);
- $gdtextalign->set(text => $gdtext->get("text"));
- $gdtextalign->set_font($gdtext->get("font") , $gdtext->get("ptsize"));
+ $gdtextalign_bbox->set_font(@font_args);
+ my($center_x, $center_y) = (int($width/2), int($height/2));
+ # Pick an angle between $max_angle/4 and $max_angle, randomly
+ # positive or negative.
my $max_angle = $constants->{hc_q1_maxrad} || 0.2;
- my $angle = (rand(1)*2-1) * $max_angle;
- $gdtextalign->draw(int($width/2), int($height/2), $angle);
+ my $angle = (rand(1)*0.75)*$max_angle + $max_angle/4;
+ $angle *= -1 if rand(1) < 0.5;
+ # The variable names stand for lower left x coordinate, etc.
+ my($ll_x, $ll_y, $lr_x, $lr_y, $ur_x, $ur_y, $ul_x, $ul_y) =
+ $gdtextalign_bbox->bounding_box($center_x, $center_y, 0);
+#print STDERR "aligned $answer center=$center_x, $center_y angle=$angle bb: $ll_x, $ll_y, $lr_x, $lr_y, $ur_x, $ur_y, $ul_x, $ul_y\n";
+
+ # We're done with the alignment box now. Place the text on the
+ # image according to the bounding box. Split the string into a
+ # left and right half and draw them separately.
+ my $string_break = int(rand(length($answer)-2))+1;
+ my $answer_left = substr($answer, 0, $string_break);
+ my $angle_left = $angle;
+ my $gdtextalign_left = new GD::Text::Align(
+ $image,
+ halign => 'left', valign => 'center',
+ colour => $textcolor, # apparently Australians prefer a 'u'
+ text => $answer_left,
+ );
+ $gdtextalign_left->set_font(@font_args);
+ my $cl_y = int(($ll_y+$ul_y)/2);
+ my @bb = $gdtextalign_left->draw(int($ul_x), $cl_y, $angle);
+#printf STDERR "gdta_left drew left-top $answer_left at ul_x=$ul_x,cl_y=$cl_y angle=%.4f, bb: @bb\n", $angle;
+ my $answer_right = substr($answer, $string_break);
+ my $angle_right = rand(1) < 0.5 ? $angle : -$angle;
+ my $gdtextalign_right = new GD::Text::Align(
+ $image,
+ halign => 'right', valign => 'center',
+ colour => $textcolor, # apparently Australians prefer a 'u'
+ text => $answer_right,
+ );
+ $gdtextalign_right->set_font(@font_args);
+ my $cr_y = int(($lr_y+$ur_y)/2);
+ @bb = $gdtextalign_right->draw(int($lr_x), $cr_y, $angle_right);
+#printf STDERR "gdta_right drew right-bottom $answer_right at lr_x=$lr_x,cr_y$cr_y angle=%.4f, bb: @bb\n", $angle;
return($answer, $image);
}
@@ -443,19 +613,36 @@
sub shortRandText {
my($self) = @_;
my $constants = getCurrentStatic();
- my $num_chars = $constants->{hc_q1_numchars} || 3;
- my @c = ('a'..'g', 'i'..'k',
- # Noel, Noel
- # (we don't use letters that could be confused
- # with numbers or other letters)
- 'm', 'n', 'p'..'t', 'v'..'z');
+
my $text = "";
+ if ($constants->{hc_q1_usedict} && $constants->{hc_q1_numchars} > 2) {
+ $text = $self->shortRandText_dict();
+ }
+ return $text if $text;
+
+ my $omit = $constants->{hc_q1_lettersomit} || 'hlou';
+ my $omit_regex = qr{[^$omit]};
+ my $num_chars = $constants->{hc_q1_numchars} || 3;
+ my @c = grep /$omit_regex/, ('a' .. 'z');
while (!$text) {
for (1..$num_chars) {
$text .= $c[rand(@c)];
}
}
- $text;
+ return $text;
+}
+
+sub shortRandText_dict {
+ my $constants = getCurrentStatic();
+ my $filename = $constants->{hc_q1_usedict};
+ return "" if !$filename || !-r $filename;
+ my $options = {
+ min_chars => $constants->{hc_q1_numchars} - 1,
+ max_chars => $constants->{hc_q1_numchars} + 1,
+ excl_regexes => [ split / /, ($constants->{hc_q1_usedict_excl} || "") ],
+ };
+ $options->{min_chars} = 3 if $options->{min_chars} < 3;
+ return getRandomWordFromDictFile($filename, $options);
}
# To prevent attackers from pulling down all the images and manually
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:48 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:48 +0900
Subject: [Slashdotjp-dev 445] CVS update: slashjp/plugins/FAQSlashdot
Message-ID: <20060712114148.CF5542AC101@users.sourceforge.jp>
Index: slashjp/plugins/FAQSlashdot/PLUGIN
diff -u slashjp/plugins/FAQSlashdot/PLUGIN:1.3 slashjp/plugins/FAQSlashdot/PLUGIN:1.4
--- slashjp/plugins/FAQSlashdot/PLUGIN:1.3 Fri Dec 31 21:36:47 2004
+++ slashjp/plugins/FAQSlashdot/PLUGIN Wed Jul 12 20:41:48 2006
@@ -1,4 +1,4 @@
-# $Id: PLUGIN,v 1.3 2004/12/31 12:36:47 oliver Exp $
+# $Id: PLUGIN,v 1.4 2006/07/12 11:41:48 sugi Exp $
name=FAQSlashdot
description="Slashdot FAQ"
htdoc_faq=faq/UI.shtml
@@ -7,6 +7,7 @@
htdoc_faq=faq/com-mod.shtml
htdoc_faq=faq/editorial.shtml
htdoc_faq=faq/faq-meta.shtml
+htdoc_faq=faq/feeds.shtml
htdoc_faq=faq/friends.shtml
htdoc_faq=faq/index.shtml
htdoc_faq=faq/interviews.shtml
@@ -15,6 +16,7 @@
htdoc_faq=faq/subscriptions.shtml
htdoc_faq=faq/suggestions.shtml
htdoc_faq=faq/tech.shtml
+htdoc_faq=faq/tags.shtml
image_faq=images/faq/foe.gif
image_faq=images/faq/friend.gif
image_faq=images/faq/neutral.gif
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:50 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:50 +0900
Subject: [Slashdotjp-dev 446] CVS update: slashjp/plugins/Login
Message-ID: <20060712114150.963672AC0EB@users.sourceforge.jp>
Index: slashjp/plugins/Login/PLUGIN
diff -u slashjp/plugins/Login/PLUGIN:1.1 slashjp/plugins/Login/PLUGIN:1.2
--- slashjp/plugins/Login/PLUGIN:1.1 Fri Dec 31 21:36:50 2004
+++ slashjp/plugins/Login/PLUGIN Wed Jul 12 20:41:50 2006
@@ -1,4 +1,4 @@
-# $Id: PLUGIN,v 1.1 2004/12/31 12:36:50 oliver Exp $
+# $Id: PLUGIN,v 1.2 2006/07/12 11:41:50 sugi Exp $
name=Login
description="Login system for users"
htdoc=login.pl
Index: slashjp/plugins/Login/login.pl
diff -u slashjp/plugins/Login/login.pl:1.2 slashjp/plugins/Login/login.pl:1.3
--- slashjp/plugins/Login/login.pl:1.2 Fri Dec 31 21:36:50 2004
+++ slashjp/plugins/Login/login.pl Wed Jul 12 20:41:50 2006
@@ -1,8 +1,8 @@
#!/usr/bin/perl -w
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: login.pl,v 1.2 2004/12/31 12:36:50 oliver Exp $
+# $Id: login.pl,v 1.3 2006/07/12 11:41:50 sugi Exp $
use strict;
use Slash 2.003;
@@ -12,7 +12,7 @@
use Slash::XML;
use vars qw($VERSION);
-($VERSION) = ' $Revision: 1.2 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
sub main {
my $slashdb = getCurrentDB();
@@ -91,8 +91,8 @@
$error = 1;
} elsif ($matchname ne '' && $form->{newusernick} ne '') {
if ($constants->{newuser_portscan}) {
- my $is_trusted = $slashdb->checkIsTrusted($user->{ipid});
- if ($is_trusted ne 'yes') {
+ my $is_trusted = $slashdb->checkAL2($user->{srcids}, 'trusted');
+ if (!$is_trusted) {
my $is_proxy = $slashdb->checkForOpenProxy($user->{hostip});
if ($is_proxy) {
push @note, getData('new_user_open_proxy', {
@@ -216,7 +216,19 @@
my $user_send = $reader->getUser($uid);
if (!$error) {
- if ($reader->checkReadOnly(nopost => { ipid => $user->{ipid} })) {
+ # A user coming from a srcid that's been marked as not
+ # acceptable for posting from also does not get to
+ # mail a password to anyone.
+
+ ## XXX: we added uid to srcids, so now this is broken;
+ ## anywhere else we need to address this?
+ my %srcids;
+ @srcids{keys %{$user->{srcids}}} = values %{$user->{srcids}};
+ delete $srcids{uid};
+
+ if ($reader->checkAL2(\%srcids, 'nopost')
+ || $reader->checkAL2(\%srcids, 'nopostanon')
+ ) {
push @note, getData('mail_readonly');
$error = 1;
@@ -242,7 +254,7 @@
my $uid = $user_send->{uid};
my $newpasswd = $slashdb->getNewPasswd($uid);
- my $tempnick = fixparam($user_send->{nickname});
+ my $tempnick = $user_send->{nickname};
my $subject = getData('mail_subject', { nickname => $user_send->{nickname} });
# Pull out some data passed in with the request. Only the IP
@@ -355,7 +367,6 @@
$slashdb->setUser($user->{uid}, $user_save);
$note = getData('passchanged');
- my $value = $slashdb->getLogToken($uid, 1);
my $cookie = bakeUserCookie($uid, $slashdb->getLogToken($uid, 1));
setCookie('user', $cookie, $user_save->{session_login});
}
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:49 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:49 +0900
Subject: [Slashdotjp-dev 447] CVS update: slashjp/plugins/Hof/templates
Message-ID: <20060712114149.5CD262AC104@users.sourceforge.jp>
Index: slashjp/plugins/Hof/templates/data;hof;default
diff -u slashjp/plugins/Hof/templates/data;hof;default:1.1.1.1 slashjp/plugins/Hof/templates/data;hof;default:1.2
--- slashjp/plugins/Hof/templates/data;hof;default:1.1.1.1 Wed Jan 28 06:54:57 2004
+++ slashjp/plugins/Hof/templates/data;hof;default Wed Jul 12 20:41:49 2006
@@ -26,4 +26,4 @@
__seclev__
10000
__version__
-$Id: data;hof;default,v 1.1.1.1 2004/01/27 21:54:57 oliver Exp $
+$Id: data;hof;default,v 1.2 2006/07/12 11:41:49 sugi Exp $
Index: slashjp/plugins/Hof/templates/main;hof;default
diff -u slashjp/plugins/Hof/templates/main;hof;default:1.2 slashjp/plugins/Hof/templates/main;hof;default:1.3
--- slashjp/plugins/Hof/templates/main;hof;default:1.2 Fri Dec 31 21:36:48 2004
+++ slashjp/plugins/Hof/templates/main;hof;default Wed Jul 12 20:41:49 2006
@@ -18,54 +18,53 @@
__name__
main
__template__
-[% USE Slash %]
-
[% PROCESS titlebar title => 'Most Active Stories' %]
+
[% PROCESS titlebar title => 'Most Active Stories' %]
[% FOREACH item = actives %]
-[% item.3 %]
+[% item.3 %]
[% storylinks = Slash.linkStory({ link => item.1, section => item.2, sid => item.0 }) %]
-[% storylinks.1 %]
-by [% item.4 %]
-[% END %]
[% PROCESS titlebar title => 'Most Active Poll Topics' %]
+
[% PROCESS titlebar title => 'Most Active Poll Topics' %]
[% FOREACH item = activep %]
-[% item.0 %][% item.1 %]
-[% END %]
+[% item.0 %][% item.1 %]
+[% END %]
[% IF topcomments.size > 0 %]
-
[% PROCESS titlebar title => 'Top 10 Comments' %]
+
[% PROCESS titlebar title => 'Top 10 Comments' %]
[% FOREACH top = topcomments %]
-[% top.score %]
- [% top.subj %]
- by [% top.nickname | strip_literal %] on [% top.cdate %]
-
- attached to [% storylinks = Slash.linkStory({ link => top.title, section => top.section, sid => top.sid }) %]
-[% storylinks.1 %]
- posted on [% top.sdate %] by [% top.anickname %]
-[% END %]
+[% top.score %]
+ [% top.subj %]
+ by [% top.nickname | strip_literal %] on [% top.cdate %]
+
+ attached to [% storylinks = Slash.linkStory({ link => top.title, section => top.section, sid => top.sid }) %]
+[% storylinks.1 %]
+ posted on [% top.sdate %] by [% top.anickname %]
+[% END %]
[% END %]
-
generated on [% currtime %]
+
generated on [% currtime %]
__seclev__
10000
__version__
-$Id: main;hof;default,v 1.2 2004/12/31 12:36:48 oliver Exp $
+$Id: main;hof;default,v 1.3 2006/07/12 11:41:49 sugi Exp $
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:51 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:51 +0900
Subject: [Slashdotjp-dev 448] CVS update: slashjp/plugins/Messages
Message-ID: <20060712114151.092EB2AC0EB@users.sourceforge.jp>
Index: slashjp/plugins/Messages/Messages.pm
diff -u slashjp/plugins/Messages/Messages.pm:1.3 slashjp/plugins/Messages/Messages.pm:1.4
--- slashjp/plugins/Messages/Messages.pm:1.3 Fri Dec 31 21:36:50 2004
+++ slashjp/plugins/Messages/Messages.pm Wed Jul 12 20:41:50 2006
@@ -1,7 +1,7 @@
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: Messages.pm,v 1.3 2004/12/31 12:36:50 oliver Exp $
+# $Id: Messages.pm,v 1.4 2006/07/12 11:41:50 sugi Exp $
package Slash::Messages;
@@ -41,7 +41,7 @@
use Slash::Display;
use Slash::Utility;
-($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
#========================================================================
@@ -59,7 +59,7 @@
=item TO_ID
The UID of the user the message is sent to. Must match a valid
-uid in the users table.
+uid in the users table. Can be an arrayref of UIDs.
=item TYPE
@@ -95,7 +95,7 @@
=item Return value
-The created message's "id" in the message_drop table.
+The created message's "id" (or multiple ids) in the message_drop table.
=item Dependencies
@@ -122,19 +122,30 @@
return 0;
}
+ $uid = [$uid] unless ref $uid;
+ my @users;
+
if (!$altto) {
# check for $uid existence
- my $slashdb = getCurrentDB();
- unless ($slashdb->getUser($uid)) {
- messagedLog(getData("user not found", { uid => $uid }, "messages"));
- return 0;
+ my $reader = getObject('Slash::Journal', { db_type => 'reader' });
+ for my $u (@$uid) {
+ if ($reader->existsUid($u)) {
+ push @users, $u;
+ } else {
+ messagedLog(getData("user not found", { uid => $u }, "messages"));
+ }
}
} else {
- if (!defined($uid) || $uid =~ /\D/) {
- $uid = 0;
+ for my $u (@$uid) {
+ if (!defined($uid) || $uid =~ /\D/) {
+ $u = 0;
+ }
+ push @users, $u;
}
}
+ return 0 unless @users;
+
if (!ref $data) {
$message = $data;
} elsif (ref $data eq 'HASH') {
@@ -183,10 +194,15 @@
return 0;
}
- my($msg_id) = $self->_create($uid, $code, $message, $fid, $altto, $send);
- return $msg_id;
+ my @msg_ids;
+ for my $u (@users) {
+ my($msg_id) = $self->_create($u, $code, $message, $fid, $altto, $send);
+ push @msg_ids, $msg_id if $msg_id;
+ }
+ return @msg_ids > 1 ? @msg_ids : $msg_ids[0];
}
+
#========================================================================
=head2 create_web(MESSAGE)
@@ -500,6 +516,7 @@
my $slashdb = getCurrentDB();
return unless $tuser;
+ $code = -1 unless defined $code;
($code, my($type)) = $self->getDescription('messagecodes', $code);
$code = -1 unless defined $code;
@@ -558,7 +575,7 @@
my $subject = $self->callTemplate('msg_email_subj', $msg);
if (bulkEmail($addrs, $subject, $content)) {
- $self->log($msg, MSG_MODE_EMAIL);
+ $self->log($msg, MSG_MODE_EMAIL, scalar @$addrs);
return 1;
} else {
messagedLog(getData("send mail error", {
@@ -580,7 +597,7 @@
sub getWebByUID {
my($self, $uid) = @_;
- $uid ||= $ENV{SLASH_USER};
+ $uid ||= getCurrentUser('uid');
my $msguser = $self->getUser($uid);
my $msgs = $self->_get_web_by_uid($uid) or return 0;
@@ -968,10 +985,16 @@
sub getDescription {
my($self, $codetype, $key) = @_;
+if (!defined($key) || !length($key)) {
+my $codetype_str = defined($codetype) ? $codetype : '(undef)';
+my $key_str = defined($key) ? $key : '(undef)';
+print STDERR "Message.pm getDescription called with codetype='$codetype_str' key='$key_str'\n";
+return;
+}
my $codes = $self->getDescriptions($codetype);
- if ($key =~ /^\d+$/) {
+ if ($key =~ /^-?\d+$/) {
unless (exists $codes->{$key}) {
return;
}
@@ -1094,4 +1117,4 @@
=head1 VERSION
-$Id: Messages.pm,v 1.3 2004/12/31 12:36:50 oliver Exp $
+$Id: Messages.pm,v 1.4 2006/07/12 11:41:50 sugi Exp $
Index: slashjp/plugins/Messages/PLUGIN
diff -u slashjp/plugins/Messages/PLUGIN:1.2 slashjp/plugins/Messages/PLUGIN:1.3
--- slashjp/plugins/Messages/PLUGIN:1.2 Fri Dec 24 05:13:39 2004
+++ slashjp/plugins/Messages/PLUGIN Wed Jul 12 20:41:50 2006
@@ -1,4 +1,4 @@
-# $Id: PLUGIN,v 1.2 2004/12/23 20:13:39 oliver Exp $
+# $Id: PLUGIN,v 1.3 2006/07/12 11:41:50 sugi Exp $
name=Messages
description="Messaging system"
mysql_schema=mysql_schema
@@ -16,6 +16,8 @@
template=templates/display_prefs;messages;default
template=templates/emailsponsor;messages;default
template=templates/footer;messages;default
+template=templates/html_invalid;misc;default
+template=templates/html_invalid_subj;misc;default
template=templates/journrep;comments;default
template=templates/journrep_subj;comments;default
template=templates/journuserboxes;misc;default
Index: slashjp/plugins/Messages/dump
diff -u slashjp/plugins/Messages/dump:1.3 slashjp/plugins/Messages/dump:1.4
--- slashjp/plugins/Messages/dump:1.3 Fri Dec 31 21:36:50 2004
+++ slashjp/plugins/Messages/dump Wed Jul 12 20:41:50 2006
@@ -1,5 +1,5 @@
#
-# $Id: dump,v 1.3 2004/12/31 12:36:50 oliver Exp $
+# $Id: dump,v 1.4 2006/07/12 11:41:50 sugi Exp $
#
INSERT INTO code_param (type, code, name) VALUES ('deliverymodes', -1, 'No Messages');
@@ -24,6 +24,7 @@
INSERT INTO message_codes (code, type, seclev, modes, send, subscribe) VALUES (12, 'Relationship Change', 1, '', 'collective', 1);
INSERT INTO message_codes (code, type, seclev, modes, send, subscribe) VALUES (13, 'Bad login attempt warnings', 1, 1, 'now', 0);
INSERT INTO message_codes (code, type, seclev, modes, acl) VALUES (14, 'Daily Moderation Stats', 100, 0, 'stats');
+INSERT INTO message_codes (code, type, seclev) VALUES (18, 'Invalid HTML Input', 100);
INSERT INTO menus (menu, label, value, seclev, menuorder) VALUES ('messages','Inbox','[% gSkin.rootdir %]/my/inbox',1,13);
INSERT INTO menus (menu, label, value, seclev, menuorder) VALUES ('messages','Message Preferences','[% gSkin.rootdir %]/my/messages',1,2);
Index: slashjp/plugins/Messages/message_delete.pl
diff -u slashjp/plugins/Messages/message_delete.pl:1.2 slashjp/plugins/Messages/message_delete.pl:1.3
--- slashjp/plugins/Messages/message_delete.pl:1.2 Fri Dec 24 05:13:39 2004
+++ slashjp/plugins/Messages/message_delete.pl Wed Jul 12 20:41:50 2006
@@ -1,8 +1,8 @@
#!/usr/bin/perl -w
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: message_delete.pl,v 1.2 2004/12/23 20:13:39 oliver Exp $
+# $Id: message_delete.pl,v 1.3 2006/07/12 11:41:50 sugi Exp $
use strict;
use File::Spec::Functions;
Index: slashjp/plugins/Messages/message_delivery.pl
diff -u slashjp/plugins/Messages/message_delivery.pl:1.3 slashjp/plugins/Messages/message_delivery.pl:1.4
--- slashjp/plugins/Messages/message_delivery.pl:1.3 Fri Dec 31 21:36:50 2004
+++ slashjp/plugins/Messages/message_delivery.pl Wed Jul 12 20:41:50 2006
@@ -1,8 +1,8 @@
#!/usr/bin/perl -w
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: message_delivery.pl,v 1.3 2004/12/31 12:36:50 oliver Exp $
+# $Id: message_delivery.pl,v 1.4 2006/07/12 11:41:50 sugi Exp $
use strict;
use File::Spec::Functions;
@@ -20,7 +20,8 @@
my($virtual_user, $constants, $slashdb, $user) = @_;
my $messages = getObject('Slash::Messages');
- unless ($messages) {
+ my $messages_reader = getObject('Slash::Messages', { db_type => 'reader' });
+ unless ($messages && $messages_reader) {
slashdLog("$me: could not instantiate Slash::Messages object");
return;
}
@@ -39,10 +40,10 @@
my $msgs;
if ($constants->{task_options}{all} || $last_deferred ne $now) {
- $msgs = $messages->gets(); # do it all, baby
+ $msgs = $messages_reader->gets(); # do it all, baby
$slashdb->setVar('message_last_deferred', $now);
} else {
- $msgs = $messages->gets($count, { 'send' => 'now' });
+ $msgs = $messages_reader->gets($count, { 'send' => 'now' });
}
# handle collective msgs
@@ -50,7 +51,7 @@
my $c = 0;
for my $msg (@$msgs) {
my $code = $msg->{code};
- $codes{$code} ||= $messages->getMessageCode($code);
+ $codes{$code} ||= $messages_reader->getMessageCode($code);
if ($codes{$code}{'send'} eq 'collective') {
push @{ $collective{ $code }{ $msg->{user}{uid} } }, $msg;
$msgs->[$c] = undef;
@@ -59,12 +60,12 @@
}
for my $code (keys %collective) {
- my $type = $messages->getDescription('messagecodes', $code);
+ my $type = $messages_reader->getDescription('messagecodes', $code);
for my $uid (keys %{$collective{ $code }}) {
my $coll = $collective{ $code }{ $uid };
my $msg = $coll->[0];
- my $mode = $messages->getMode($msg);
+ my $mode = $messages_reader->getMode($msg);
my $message;
# perhaps put these formatting things in templates?
Index: slashjp/plugins/Messages/messages.pl
diff -u slashjp/plugins/Messages/messages.pl:1.4 slashjp/plugins/Messages/messages.pl:1.5
--- slashjp/plugins/Messages/messages.pl:1.4 Wed Jan 12 18:20:53 2005
+++ slashjp/plugins/Messages/messages.pl Wed Jul 12 20:41:50 2006
@@ -1,8 +1,8 @@
#!/usr/bin/perl -w
# This code is a part of Slash, and is released under the GPL.
-# Copyright 1997-2004 by Open Source Development Network. See README
+# Copyright 1997-2005 by Open Source Technology Group. See README
# and COPYING for more information, or see http://slashcode.com/.
-# $Id: messages.pl,v 1.4 2005/01/12 09:20:53 oliver Exp $
+# $Id: messages.pl,v 1.5 2006/07/12 11:41:50 sugi Exp $
# this program does some really cool stuff.
# so i document it here. yay for me!
@@ -12,10 +12,11 @@
use Slash::Constants qw(:web :messages);
use Slash::Display;
use Slash::Utility;
+use Slash::XML;
use Time::HiRes;
use vars qw($VERSION);
-($VERSION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
+($VERSION) = ' $Revision: 1.5 $ ' =~ /\$Revision:\s+([^\s]+)/;
sub main {
my $start_time = Time::HiRes::time;
@@ -38,6 +39,8 @@
delete_message => [ $user_ok, \&delete_message ],
deletemsgs => [ $user_ok, \&delete_messages ],
+ list_rss => [ !$user->{is_anon}, \&list_messages_rss ],
+
# send_message => [ $user_ok, \&send_message ],
# edit_message => [ !$user->{is_anon}, \&edit_message ],
@@ -203,25 +206,26 @@
header(getData('header')) or return;
print createMenu('users', {
- style => 'tabbed',
- justify => 'right',
- color => 'colored',
- tab_selected => 'preferences',
- });
- slashDisplay('prefs_titlebar', {
- nickname => $user->{nickname},
- uid => $user->{uid},
- tab_selected => 'messages',
- title => getData( 'prefshead' )
+ style => 'tabbed',
+ justify => 'right',
+ color => 'colored',
+ tab_selected => 'preferences',
});
- print createMenu('messages');
slashDisplay('journuserboxes');
+ my $prefs_titlebar = slashDisplay('prefs_titlebar', {
+ nickname => $user->{nickname},
+ uid => $user->{uid},
+ tab_selected => 'messages'
+ }, { Return => 1 });
+ my $messages_menu = createMenu('messages');
slashDisplay('display_prefs', {
userm => $userm,
prefs => $prefs,
note => $note,
messagecodes => $messagecodes,
deliverymodes => $deliverymodes,
+ prefs_titlebar => $prefs_titlebar,
+ messages_menu => $messages_menu
});
footer();
}
@@ -267,29 +271,58 @@
header(getData('header')) or return;
# Spank me, this won't be here for long (aka Pater's cleanup will remove it) -Brian
print createMenu('users', {
- style => 'tabbed',
- justify => 'right',
- color => 'colored',
- tab_selected => 'me',
+ style => 'tabbed',
+ justify => 'right',
+ color => 'colored',
+ tab_selected => 'me',
});
- slashDisplay('user_titlebar', {
- nickname => $user->{nickname},
- uid => $user->{uid},
- tab_selected => 'messages'
- });
- print createMenu('messages'); # [ Message Preferences | Inbox ]
slashDisplay('journuserboxes');
+ my $user_titlebar = slashDisplay('user_titlebar', {
+ nickname => $user->{nickname},
+ uid => $user->{uid},
+ tab_selected => 'messages'
+ }, { Return => 1} );
+ my $messages_menu = createMenu('messages'); # [ Message Preferences | Inbox ]
slashDisplay('list_messages', {
note => $note,
messagecodes => $messagecodes,
message_list => $message_list,
+ messages_menu => $messages_menu,
+ user_titlebar => $user_titlebar,
});
footer();
}
-sub list_message_rss {
+sub list_messages_rss {
my($messages, $constants, $user, $form) = @_;
- # ...
+
+ my @items;
+ my $message_list = $messages->getWebByUID();
+ for my $message (@$message_list) {
+ my $title = "Message #$message->{id}";
+ $title .= ": $message->{subject}" if $message->{subject};
+
+ push @items, {
+ story => {
+ 'time' => $message->{date}
+ },
+ title => $title,
+ description => $message->{message} || '',
+ 'link' => root2abs() . "/messages.pl?op=display&id=$message->{id}",
+ };
+ }
+
+ xmlDisplay($form->{content_type} => {
+ channel => {
+ title => "$constants->{sitename} Messages",
+ description => "$constants->{sitename} Messages",
+ 'link' => root2abs() . '/my/inbox/',
+ },
+ image => 1,
+ items => \@items,
+ rdfitemdesc => 1,
+ rdfitemdesc_html => 1,
+ });
}
sub display_message {
Index: slashjp/plugins/Messages/mysql_schema
diff -u slashjp/plugins/Messages/mysql_schema:1.2 slashjp/plugins/Messages/mysql_schema:1.3
--- slashjp/plugins/Messages/mysql_schema:1.2 Fri Dec 24 05:13:39 2004
+++ slashjp/plugins/Messages/mysql_schema Wed Jul 12 20:41:50 2006
@@ -1,5 +1,5 @@
#
-# $Id: mysql_schema,v 1.2 2004/12/23 20:13:39 oliver Exp $
+# $Id: mysql_schema,v 1.3 2006/07/12 11:41:50 sugi Exp $
#
# As of July 2003 we don't have any reason I can see to ever want
Index: slashjp/plugins/Messages/populate_message_log_stats.plx
diff -u slashjp/plugins/Messages/populate_message_log_stats.plx:1.2 slashjp/plugins/Messages/populate_message_log_stats.plx:1.3
--- slashjp/plugins/Messages/populate_message_log_stats.plx:1.2 Fri Dec 24 05:13:39 2004
+++ slashjp/plugins/Messages/populate_message_log_stats.plx Wed Jul 12 20:41:50 2006
@@ -6,7 +6,7 @@
# you probably only want to run it once, but running it multiple times
# shouldn't hurt anything
#
-# $Id: populate_message_log_stats.plx,v 1.2 2004/12/23 20:13:39 oliver Exp $
+# $Id: populate_message_log_stats.plx,v 1.3 2006/07/12 11:41:50 sugi Exp $
use strict;
use Slash::Test shift;
From sugi ¡÷ users.sourceforge.jp Wed Jul 12 20:41:50 2006
From: sugi ¡÷ users.sourceforge.jp (Tatsuki SUGIURA)
Date: Wed, 12 Jul 2006 20:41:50 +0900
Subject: [Slashdotjp-dev 449] CVS update: slashjp/plugins/Login/templates
Message-ID: <20060712114150.C68AE2AC102@users.sourceforge.jp>
Index: slashjp/plugins/Login/templates/changePasswd;login;default
diff -u slashjp/plugins/Login/templates/changePasswd;login;default:1.2 slashjp/plugins/Login/templates/changePasswd;login;default:1.3
--- slashjp/plugins/Login/templates/changePasswd;login;default:1.2 Fri Dec 31 21:36:50 2004
+++ slashjp/plugins/Login/templates/changePasswd;login;default Wed Jul 12 20:41:50 2006
@@ -12,26 +12,30 @@
__name__
changePasswd
__template__
-
[% IF form.note == "Please change your password now!";
- "Please change your password now! ";
-END; note %]
-
-[% title = "Change password for $user.nickname ($user.uid)" %]
-[% PROCESS prefs_titlebar tab_selected='password' %]
-
-
-
-
+
+ [% PROCESS userboxes %]
+
+[% thisnickname = user.nickname | strip_literal;
+ title = "Change password for $thisnickname ($user.uid)" %]
+
+ [% PROCESS prefs_titlebar tab_selected='password' %]
+
+[% IF form.note == "Please change your password now!";
+ "Please change your password now! ";
+END; note %]
+
[% IF constants.offer_insecure_login_link -%]
You can automatically log in by clicking
- This Link and Bookmarking the resulting page.
+ This Link and Bookmarking the resulting page.
This is totally insecure, but very convenient.
[%- END %]
-
-
-
-
-
-
-
-
+
+
+ To change your password, enter your current password.
+
+
+
+
+
+
+ Enter your new password twice, must be 6-20 chars long.
+
+
+[%# for ResKeys %]
+[% CASE 'anon' %]
+ [% returnme.data_constant = 1 %]
+ You may not vote anonymously. Please
+ log in.
+
+[% CASE 'no qid' %]
+ [% returnme.data_constant = 1 %]
+ The poll ID is missing.
+
+[% CASE 'already voted' %]
+ [% returnme.data_constant = 1 %]
+ You've already voted.
+
[% END %]
__seclev__
10000
__version__
-$Id: data;pollBooth;default,v 1.3 2004/12/31 12:37:12 oliver Exp $
+$Id: data;pollBooth;default,v 1.4 2006/07/12 11:41:53 sugi Exp $
Index: slashjp/plugins/PollBooth/templates/detachpoll;pollBooth;default
diff -u slashjp/plugins/PollBooth/templates/detachpoll;pollBooth;default:1.2 slashjp/plugins/PollBooth/templates/detachpoll;pollBooth;default:1.3
--- slashjp/plugins/PollBooth/templates/detachpoll;pollBooth;default:1.2 Fri Dec 31 21:37:12 2004
+++ slashjp/plugins/PollBooth/templates/detachpoll;pollBooth;default Wed Jul 12 20:41:53 2006
@@ -17,17 +17,17 @@
__template__
[% PROCESS titlebar width='100%' %]
[% IF warning.no_sid %]
- No story sid given--could not complete operation.
+ No story sid given--could not complete operation.
[% ELSIF warning.no_sid_qid_match %]
- Warning: The poll qid you specified ('[% qid %]') does not appear to be currently attached to the story sid specified ('[% sid %]'). This could mean that the story doesn't have a poll attached to it or is linked to a different poll.
If you're sure you want to detach any polls currently connected to this story click continue.
+ Warning: The poll qid you specified ('[% qid %]') does not appear to be currently attached to the story sid specified ('[% sid %]'). This could mean that the story doesn't have a poll attached to it or is linked to a different poll.
If you're sure you want to detach any polls currently connected to this story click continue.
[% ELSE %]
- Poll detached from story successfully.
- You can now edit or view the story.
+ Poll detached from story successfully.
+ You can now edit or view the story.
[% IF qid %]
- You can also continue on edit or view the poll that was attached to this story.
+ You can also continue on edit or view the poll that was attached to this story.
[% END %]
[% END %]
__version__
-$Id: detachpoll;pollBooth;default,v 1.2 2004/12/31 12:37:12 oliver Exp $
+$Id: detachpoll;pollBooth;default,v 1.3 2006/07/12 11:41:53 sugi Exp $
Index: slashjp/plugins/PollBooth/templates/editpoll;pollBooth;default
diff -u slashjp/plugins/PollBooth/templates/editpoll;pollBooth;default:1.3 slashjp/plugins/PollBooth/templates/editpoll;pollBooth;default:1.4
--- slashjp/plugins/PollBooth/templates/editpoll;pollBooth;default:1.3 Fri Dec 31 21:37:12 2004
+++ slashjp/plugins/PollBooth/templates/editpoll;pollBooth;default Wed Jul 12 20:41:53 2006
@@ -18,77 +18,86 @@
__name__
editpoll
__template__
-[% PROCESS titlebar width='100%' %]
-[% USE Slash %]
-
-
- [% IF warning.invalid_sid %]Story ID specified does not exist invalid [% END %]
- [% IF warning.attached_to_other %]Story is already attached to another poll -- detach poll from that story before attaching this one [% END %]
+[% IF pollbooth %]
+
Click the correct link to choose which poll you would like to attach to the story you've selected. You
+
Click the correct link to choose which poll you would like to attach to the story you've selected. You
can also use the form below to select the poll qid you like to attach the story to.
-
Don't complain about lack of options. You've got to pick a few
- when you do multiple choice. Those are the breaks.
-
-
Feel free to suggest poll ideas if you're feeling creative.
- I'd strongly suggest reading the past polls first.
-
-
This whole thing is wildly inaccurate. Rounding errors,
- ballot stuffers, dynamic IPs, firewalls. If you're using these
- numbers to do anything important, you're insane.
-
-
-
-
+
+
+
Don't complain about lack of options. You've got to pick a few when you do multiple choice. Those are the breaks.
+
Feel free to suggest poll ideas if you're feeling creative. I'd strongly suggest reading the past polls first.
+
This whole thing is wildly inaccurate. Rounding errors, ballot stuffers, dynamic IPs, firewalls. If you're using these numbers to do anything important, you're insane.