You can subscribe to this list here.
2012 |
Jan
|
Feb
(214) |
Mar
(139) |
Apr
(198) |
May
(187) |
Jun
(151) |
Jul
(210) |
Aug
(169) |
Sep
(58) |
Oct
(53) |
Nov
(54) |
Dec
(301) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2013 |
Jan
(348) |
Feb
(178) |
Mar
(219) |
Apr
(154) |
May
(117) |
Jun
(194) |
Jul
(61) |
Aug
(132) |
Sep
(121) |
Oct
(110) |
Nov
(11) |
Dec
(18) |
2014 |
Jan
(34) |
Feb
(50) |
Mar
(82) |
Apr
(98) |
May
(39) |
Jun
(111) |
Jul
(67) |
Aug
(36) |
Sep
(33) |
Oct
(26) |
Nov
(53) |
Dec
(44) |
2015 |
Jan
(29) |
Feb
(47) |
Mar
(25) |
Apr
(19) |
May
(23) |
Jun
(20) |
Jul
(49) |
Aug
(7) |
Sep
(10) |
Oct
(10) |
Nov
(4) |
Dec
(25) |
2016 |
Jan
(8) |
Feb
(7) |
Mar
(1) |
Apr
|
May
(3) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(7) |
Dec
(5) |
2017 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
(15) |
Jun
|
Jul
(18) |
Aug
(24) |
Sep
|
Oct
(14) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
(22) |
Mar
|
Apr
(11) |
May
(1) |
Jun
(17) |
Jul
(2) |
Aug
(2) |
Sep
|
Oct
(6) |
Nov
(5) |
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <wis...@us...> - 2014-12-08 21:04:28
|
Revision: 12895 http://sourceforge.net/p/xoops/svn/12895 Author: wishcraft Date: 2014-12-08 21:04:02 +0000 (Mon, 08 Dec 2014) Log Message: ----------- Self Signed Version 1.14 ~ MINOR FINAL RELEASE Added Paths: ----------- XoopsModules/signed/releases/1.14/ XoopsModules/signed/trunk/htaccess.dist XoopsModules/signed/trunk/modules/ XoopsModules/signed/trunk/modules/index.html XoopsModules/signed/trunk/modules/signed/ XoopsModules/signed/trunk/modules/signed/.htaccess XoopsModules/signed/trunk/modules/signed/admin/ XoopsModules/signed/trunk/modules/signed/admin/about.php XoopsModules/signed/trunk/modules/signed/admin/admin.php XoopsModules/signed/trunk/modules/signed/admin/admin_footer.php XoopsModules/signed/trunk/modules/signed/admin/admin_header.php XoopsModules/signed/trunk/modules/signed/admin/events.php XoopsModules/signed/trunk/modules/signed/admin/index.html XoopsModules/signed/trunk/modules/signed/admin/menu.php XoopsModules/signed/trunk/modules/signed/admin/signatures.php XoopsModules/signed/trunk/modules/signed/api/ XoopsModules/signed/trunk/modules/signed/api/banned/ XoopsModules/signed/trunk/modules/signed/api/banned/.htaccess XoopsModules/signed/trunk/modules/signed/api/banned/index.php XoopsModules/signed/trunk/modules/signed/api/classes/ XoopsModules/signed/trunk/modules/signed/api/classes/.htaccess XoopsModules/signed/trunk/modules/signed/api/classes/index.php XoopsModules/signed/trunk/modules/signed/api/descriptions/ XoopsModules/signed/trunk/modules/signed/api/descriptions/.htaccess XoopsModules/signed/trunk/modules/signed/api/descriptions/index.php XoopsModules/signed/trunk/modules/signed/api/enumerators/ XoopsModules/signed/trunk/modules/signed/api/enumerators/.htaccess XoopsModules/signed/trunk/modules/signed/api/enumerators/index.php XoopsModules/signed/trunk/modules/signed/api/fields/ XoopsModules/signed/trunk/modules/signed/api/fields/.htaccess XoopsModules/signed/trunk/modules/signed/api/fields/index.php XoopsModules/signed/trunk/modules/signed/api/fieldtypes/ XoopsModules/signed/trunk/modules/signed/api/fieldtypes/.htaccess XoopsModules/signed/trunk/modules/signed/api/fieldtypes/index.php XoopsModules/signed/trunk/modules/signed/api/identifications/ XoopsModules/signed/trunk/modules/signed/api/identifications/.htaccess XoopsModules/signed/trunk/modules/signed/api/identifications/index.php XoopsModules/signed/trunk/modules/signed/api/index.php XoopsModules/signed/trunk/modules/signed/api/language/ XoopsModules/signed/trunk/modules/signed/api/language/.htaccess XoopsModules/signed/trunk/modules/signed/api/language/index.php XoopsModules/signed/trunk/modules/signed/api/languages/ XoopsModules/signed/trunk/modules/signed/api/languages/.htaccess XoopsModules/signed/trunk/modules/signed/api/languages/index.php XoopsModules/signed/trunk/modules/signed/api/processes/ XoopsModules/signed/trunk/modules/signed/api/processes/.htaccess XoopsModules/signed/trunk/modules/signed/api/processes/index.php XoopsModules/signed/trunk/modules/signed/api/prompts/ XoopsModules/signed/trunk/modules/signed/api/prompts/.htaccess XoopsModules/signed/trunk/modules/signed/api/prompts/index.php XoopsModules/signed/trunk/modules/signed/api/providers/ XoopsModules/signed/trunk/modules/signed/api/providers/.htaccess XoopsModules/signed/trunk/modules/signed/api/providers/index.php XoopsModules/signed/trunk/modules/signed/api/request/ XoopsModules/signed/trunk/modules/signed/api/request/.htaccess XoopsModules/signed/trunk/modules/signed/api/request/index.php XoopsModules/signed/trunk/modules/signed/api/sign/ XoopsModules/signed/trunk/modules/signed/api/sign/.htaccess XoopsModules/signed/trunk/modules/signed/api/sign/index.php XoopsModules/signed/trunk/modules/signed/api/signatures/ XoopsModules/signed/trunk/modules/signed/api/signatures/.htaccess XoopsModules/signed/trunk/modules/signed/api/signatures/index.php XoopsModules/signed/trunk/modules/signed/api/sites/ XoopsModules/signed/trunk/modules/signed/api/sites/.htaccess XoopsModules/signed/trunk/modules/signed/api/sites/index.php XoopsModules/signed/trunk/modules/signed/api/states/ XoopsModules/signed/trunk/modules/signed/api/states/.htaccess XoopsModules/signed/trunk/modules/signed/api/states/index.php XoopsModules/signed/trunk/modules/signed/api/validate.php XoopsModules/signed/trunk/modules/signed/api/validations/ XoopsModules/signed/trunk/modules/signed/api/validations/.htaccess XoopsModules/signed/trunk/modules/signed/api/validations/index.php XoopsModules/signed/trunk/modules/signed/api/verification/ XoopsModules/signed/trunk/modules/signed/api/verification/.htaccess XoopsModules/signed/trunk/modules/signed/api/verification/index.php XoopsModules/signed/trunk/modules/signed/api/verify/ XoopsModules/signed/trunk/modules/signed/api/verify/.htaccess XoopsModules/signed/trunk/modules/signed/api/verify/index.php XoopsModules/signed/trunk/modules/signed/class/ XoopsModules/signed/trunk/modules/signed/class/cache/ XoopsModules/signed/trunk/modules/signed/class/cache/apc.php XoopsModules/signed/trunk/modules/signed/class/cache/file.php XoopsModules/signed/trunk/modules/signed/class/cache/index.html XoopsModules/signed/trunk/modules/signed/class/cache/memcache.php XoopsModules/signed/trunk/modules/signed/class/cache/model.php XoopsModules/signed/trunk/modules/signed/class/cache/signedcache.php XoopsModules/signed/trunk/modules/signed/class/cache/xcache.php XoopsModules/signed/trunk/modules/signed/class/captcha/ XoopsModules/signed/trunk/modules/signed/class/captcha/index.html XoopsModules/signed/trunk/modules/signed/class/captcha/signedcaptcha.php XoopsModules/signed/trunk/modules/signed/class/event_links.php XoopsModules/signed/trunk/modules/signed/class/events.php XoopsModules/signed/trunk/modules/signed/class/file/ XoopsModules/signed/trunk/modules/signed/class/file/index.html XoopsModules/signed/trunk/modules/signed/class/file/signedfile.php XoopsModules/signed/trunk/modules/signed/class/index.html XoopsModules/signed/trunk/modules/signed/class/mail/ XoopsModules/signed/trunk/modules/signed/class/mail/index.html XoopsModules/signed/trunk/modules/signed/class/mail/signedmultimailer.php XoopsModules/signed/trunk/modules/signed/class/mobile/ XoopsModules/signed/trunk/modules/signed/class/mobile/handlers/ XoopsModules/signed/trunk/modules/signed/class/mobile/handlers/index.html XoopsModules/signed/trunk/modules/signed/class/mobile/handlers/sms.cardboardfish.php XoopsModules/signed/trunk/modules/signed/class/mobile/index.html XoopsModules/signed/trunk/modules/signed/class/mobile/plugin/ XoopsModules/signed/trunk/modules/signed/class/mobile/plugin/index.html XoopsModules/signed/trunk/modules/signed/class/mobile/signedsmscontroller.php XoopsModules/signed/trunk/modules/signed/class/mobile/signedsmsmobile.php XoopsModules/signed/trunk/modules/signed/class/qcp/ XoopsModules/signed/trunk/modules/signed/class/qcp/index.html XoopsModules/signed/trunk/modules/signed/class/qcp/qcp.base.php XoopsModules/signed/trunk/modules/signed/class/qcp/qcp.class.php XoopsModules/signed/trunk/modules/signed/class/qcp/qcp.enumerator.php XoopsModules/signed/trunk/modules/signed/class/qcp/qcp.leaver-beaver.php XoopsModules/signed/trunk/modules/signed/class/signatures.php XoopsModules/signed/trunk/modules/signed/class/signedapi.php XoopsModules/signed/trunk/modules/signed/class/signedarrays.php XoopsModules/signed/trunk/modules/signed/class/signedcanvas.php XoopsModules/signed/trunk/modules/signed/class/signedciphers.php XoopsModules/signed/trunk/modules/signed/class/signededitor/ XoopsModules/signed/trunk/modules/signed/class/signededitor/index.html XoopsModules/signed/trunk/modules/signed/class/signededitor/readme.txt XoopsModules/signed/trunk/modules/signed/class/signededitor/signededitor.php XoopsModules/signed/trunk/modules/signed/class/signedform/ XoopsModules/signed/trunk/modules/signed/class/signedform/form.php XoopsModules/signed/trunk/modules/signed/class/signedform/formbutton.php XoopsModules/signed/trunk/modules/signed/class/signedform/formbuttontray.php XoopsModules/signed/trunk/modules/signed/class/signedform/formcaptcha.php XoopsModules/signed/trunk/modules/signed/class/signedform/formcheckbox.php XoopsModules/signed/trunk/modules/signed/class/signedform/formcolorpicker.php XoopsModules/signed/trunk/modules/signed/class/signedform/formdatetime.php XoopsModules/signed/trunk/modules/signed/class/signedform/formdhtmltextarea.php XoopsModules/signed/trunk/modules/signed/class/signedform/formeditor.php XoopsModules/signed/trunk/modules/signed/class/signedform/formelement.php XoopsModules/signed/trunk/modules/signed/class/signedform/formelementtray.php XoopsModules/signed/trunk/modules/signed/class/signedform/formfile.php XoopsModules/signed/trunk/modules/signed/class/signedform/formhidden.php XoopsModules/signed/trunk/modules/signed/class/signedform/formhiddentoken.php XoopsModules/signed/trunk/modules/signed/class/signedform/formlabel.php XoopsModules/signed/trunk/modules/signed/class/signedform/formpassword.php XoopsModules/signed/trunk/modules/signed/class/signedform/formradio.php XoopsModules/signed/trunk/modules/signed/class/signedform/formradioyn.php XoopsModules/signed/trunk/modules/signed/class/signedform/formselect.php XoopsModules/signed/trunk/modules/signed/class/signedform/formselectcheckgroup.php XoopsModules/signed/trunk/modules/signed/class/signedform/formselectcountry.php XoopsModules/signed/trunk/modules/signed/class/signedform/formselecteditor.php XoopsModules/signed/trunk/modules/signed/class/signedform/formselectenumerator.php XoopsModules/signed/trunk/modules/signed/class/signedform/formselectmatchoption.php XoopsModules/signed/trunk/modules/signed/class/signedform/formselectmonths.php XoopsModules/signed/trunk/modules/signed/class/signedform/formselecttimezone.php XoopsModules/signed/trunk/modules/signed/class/signedform/formselectyears.php XoopsModules/signed/trunk/modules/signed/class/signedform/formtext.php XoopsModules/signed/trunk/modules/signed/class/signedform/formtextarea.php XoopsModules/signed/trunk/modules/signed/class/signedform/formtextdateselect.php XoopsModules/signed/trunk/modules/signed/class/signedform/index.html XoopsModules/signed/trunk/modules/signed/class/signedform/simpleform.php XoopsModules/signed/trunk/modules/signed/class/signedform/tableform.php XoopsModules/signed/trunk/modules/signed/class/signedform/themeform.php XoopsModules/signed/trunk/modules/signed/class/signedformloader.php XoopsModules/signed/trunk/modules/signed/class/signedlists.php XoopsModules/signed/trunk/modules/signed/class/signedlogger.php XoopsModules/signed/trunk/modules/signed/class/signedmailer.php XoopsModules/signed/trunk/modules/signed/class/signedmobile.php XoopsModules/signed/trunk/modules/signed/class/signedobject.php XoopsModules/signed/trunk/modules/signed/class/signedpackages.php XoopsModules/signed/trunk/modules/signed/class/signedprocesses.php XoopsModules/signed/trunk/modules/signed/class/signedprompts.php XoopsModules/signed/trunk/modules/signed/class/signedsecurity.php XoopsModules/signed/trunk/modules/signed/class/signedsession.php XoopsModules/signed/trunk/modules/signed/class/signedstorage.php XoopsModules/signed/trunk/modules/signed/class/uploader.php XoopsModules/signed/trunk/modules/signed/class/wideimage/ XoopsModules/signed/trunk/modules/signed/class/wideimage/Canvas.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Coordinate.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Exception.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Font/ XoopsModules/signed/trunk/modules/signed/class/wideimage/Font/GDF.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Font/PS.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Font/TTF.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Image.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Mapper/ XoopsModules/signed/trunk/modules/signed/class/wideimage/Mapper/BMP.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Mapper/GD.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Mapper/GD2.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Mapper/GIF.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Mapper/JPEG.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Mapper/PNG.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Mapper/TGA.php XoopsModules/signed/trunk/modules/signed/class/wideimage/MapperFactory.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/ XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/AddNoise.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/ApplyConvolution.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/ApplyFilter.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/ApplyMask.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/AsGrayscale.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/AsNegative.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/AutoCrop.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/CopyChannelsPalette.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/CopyChannelsTrueColor.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/CorrectGamma.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/Crop.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/Flip.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/GetMask.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/Merge.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/Mirror.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/Resize.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/ResizeCanvas.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/Rotate.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/RoundCorners.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/Unsharp.php XoopsModules/signed/trunk/modules/signed/class/wideimage/OperationFactory.php XoopsModules/signed/trunk/modules/signed/class/wideimage/PaletteImage.php XoopsModules/signed/trunk/modules/signed/class/wideimage/TrueColorImage.php XoopsModules/signed/trunk/modules/signed/class/wideimage/WideImage.php XoopsModules/signed/trunk/modules/signed/class/wideimage/index.html XoopsModules/signed/trunk/modules/signed/class/wideimage/vendor/ XoopsModules/signed/trunk/modules/signed/class/wideimage/vendor/de77/ XoopsModules/signed/trunk/modules/signed/class/wideimage/vendor/de77/BMP.php XoopsModules/signed/trunk/modules/signed/class/wideimage/vendor/de77/TGA.php XoopsModules/signed/trunk/modules/signed/class/xmlarray.php XoopsModules/signed/trunk/modules/signed/class/xmlwrapper.php XoopsModules/signed/trunk/modules/signed/crons/ XoopsModules/signed/trunk/modules/signed/crons/.htaccess XoopsModules/signed/trunk/modules/signed/crons/callbacks.php XoopsModules/signed/trunk/modules/signed/crons/expires.php XoopsModules/signed/trunk/modules/signed/crons/expiry.php XoopsModules/signed/trunk/modules/signed/crons/index.html XoopsModules/signed/trunk/modules/signed/crons/request.php XoopsModules/signed/trunk/modules/signed/css/ XoopsModules/signed/trunk/modules/signed/css/calendar-blue.css XoopsModules/signed/trunk/modules/signed/css/index.html XoopsModules/signed/trunk/modules/signed/css/signed.css XoopsModules/signed/trunk/modules/signed/css/style.css XoopsModules/signed/trunk/modules/signed/docs/ XoopsModules/signed/trunk/modules/signed/docs/changelog.txt XoopsModules/signed/trunk/modules/signed/docs/credits.txt XoopsModules/signed/trunk/modules/signed/docs/index.html XoopsModules/signed/trunk/modules/signed/docs/install.txt XoopsModules/signed/trunk/modules/signed/docs/lang_diff.txt XoopsModules/signed/trunk/modules/signed/dojsonids.php XoopsModules/signed/trunk/modules/signed/dojsonoperations.php XoopsModules/signed/trunk/modules/signed/fonts/ XoopsModules/signed/trunk/modules/signed/fonts/COOPBL.eot XoopsModules/signed/trunk/modules/signed/fonts/COOPBL.otf XoopsModules/signed/trunk/modules/signed/fonts/COOPBL.svg XoopsModules/signed/trunk/modules/signed/fonts/COOPBL.ttf XoopsModules/signed/trunk/modules/signed/fonts/COOPBL.woff XoopsModules/signed/trunk/modules/signed/fonts/ERASMD.eot XoopsModules/signed/trunk/modules/signed/fonts/ERASMD.otf XoopsModules/signed/trunk/modules/signed/fonts/ERASMD.svg XoopsModules/signed/trunk/modules/signed/fonts/ERASMD.ttf XoopsModules/signed/trunk/modules/signed/fonts/ERASMD.woff XoopsModules/signed/trunk/modules/signed/fonts/index.html XoopsModules/signed/trunk/modules/signed/footer.php XoopsModules/signed/trunk/modules/signed/generator.php XoopsModules/signed/trunk/modules/signed/go/ XoopsModules/signed/trunk/modules/signed/go/.htaccess XoopsModules/signed/trunk/modules/signed/go/index.php XoopsModules/signed/trunk/modules/signed/header.php XoopsModules/signed/trunk/modules/signed/image/ XoopsModules/signed/trunk/modules/signed/image/icons/ XoopsModules/signed/trunk/modules/signed/image/icons/16/ XoopsModules/signed/trunk/modules/signed/image/icons/16/index.html XoopsModules/signed/trunk/modules/signed/image/icons/32/ XoopsModules/signed/trunk/modules/signed/image/icons/32/about.png XoopsModules/signed/trunk/modules/signed/image/icons/32/event.png XoopsModules/signed/trunk/modules/signed/image/icons/32/identity.png XoopsModules/signed/trunk/modules/signed/image/icons/32/index.html XoopsModules/signed/trunk/modules/signed/image/icons/32/security.png XoopsModules/signed/trunk/modules/signed/image/icons/index.html XoopsModules/signed/trunk/modules/signed/image/index.html XoopsModules/signed/trunk/modules/signed/image/signed.png XoopsModules/signed/trunk/modules/signed/image/watermark.gif XoopsModules/signed/trunk/modules/signed/image/watermark.php XoopsModules/signed/trunk/modules/signed/include/ XoopsModules/signed/trunk/modules/signed/include/common.php XoopsModules/signed/trunk/modules/signed/include/configs.php XoopsModules/signed/trunk/modules/signed/include/constants.php XoopsModules/signed/trunk/modules/signed/include/form-edit-object.php XoopsModules/signed/trunk/modules/signed/include/form-generic-edit-form.php XoopsModules/signed/trunk/modules/signed/include/form-generic-form.php XoopsModules/signed/trunk/modules/signed/include/form-identification-edit-form.php XoopsModules/signed/trunk/modules/signed/include/form-identification-form.php XoopsModules/signed/trunk/modules/signed/include/form-object.php XoopsModules/signed/trunk/modules/signed/include/functions.php XoopsModules/signed/trunk/modules/signed/include/index.html XoopsModules/signed/trunk/modules/signed/include/language.php XoopsModules/signed/trunk/modules/signed/index.php XoopsModules/signed/trunk/modules/signed/js/ XoopsModules/signed/trunk/modules/signed/js/calendar.js XoopsModules/signed/trunk/modules/signed/js/color-picker.js XoopsModules/signed/trunk/modules/signed/js/formdhtmltextarea.js XoopsModules/signed/trunk/modules/signed/js/index.html XoopsModules/signed/trunk/modules/signed/js/json.validation.js XoopsModules/signed/trunk/modules/signed/js/layersmenu.js XoopsModules/signed/trunk/modules/signed/js/signed.js XoopsModules/signed/trunk/modules/signed/language/ XoopsModules/signed/trunk/modules/signed/language/english/ XoopsModules/signed/trunk/modules/signed/language/english/admin.php XoopsModules/signed/trunk/modules/signed/language/english/calendar.php XoopsModules/signed/trunk/modules/signed/language/english/captcha.php XoopsModules/signed/trunk/modules/signed/language/english/content.php XoopsModules/signed/trunk/modules/signed/language/english/countries.php XoopsModules/signed/trunk/modules/signed/language/english/errors.php XoopsModules/signed/trunk/modules/signed/language/english/formdhtmltextarea.php XoopsModules/signed/trunk/modules/signed/language/english/global.php XoopsModules/signed/trunk/modules/signed/language/english/help/ XoopsModules/signed/trunk/modules/signed/language/english/help/help.html XoopsModules/signed/trunk/modules/signed/language/english/help/index.html XoopsModules/signed/trunk/modules/signed/language/english/index.html XoopsModules/signed/trunk/modules/signed/language/english/mail.php XoopsModules/signed/trunk/modules/signed/language/english/mail_template/ XoopsModules/signed/trunk/modules/signed/language/english/mail_template/html/ XoopsModules/signed/trunk/modules/signed/language/english/mail_template/html/expired-identification.html XoopsModules/signed/trunk/modules/signed/language/english/mail_template/html/expired-signature.html XoopsModules/signed/trunk/modules/signed/language/english/mail_template/html/index.html XoopsModules/signed/trunk/modules/signed/language/english/mail_template/html/signature-email.html XoopsModules/signed/trunk/modules/signed/language/english/mail_template/html/update-request.html XoopsModules/signed/trunk/modules/signed/language/english/mail_template/html/verify-email.html XoopsModules/signed/trunk/modules/signed/language/english/mail_template/index.html XoopsModules/signed/trunk/modules/signed/language/english/mail_template/text/ XoopsModules/signed/trunk/modules/signed/language/english/mail_template/text/expired-identification.txt XoopsModules/signed/trunk/modules/signed/language/english/mail_template/text/expired-signature.txt XoopsModules/signed/trunk/modules/signed/language/english/mail_template/text/index.html XoopsModules/signed/trunk/modules/signed/language/english/mail_template/text/signature-email.txt XoopsModules/signed/trunk/modules/signed/language/english/mail_template/text/update-request.txt XoopsModules/signed/trunk/modules/signed/language/english/mail_template/text/verify-email.txt XoopsModules/signed/trunk/modules/signed/language/english/main.php XoopsModules/signed/trunk/modules/signed/language/english/modinfo.php XoopsModules/signed/trunk/modules/signed/language/english/months.php XoopsModules/signed/trunk/modules/signed/language/english/signedmailerlocal.php XoopsModules/signed/trunk/modules/signed/language/english/signedmobilelocal.php XoopsModules/signed/trunk/modules/signed/language/english/sms_template/ XoopsModules/signed/trunk/modules/signed/language/english/sms_template/index.html XoopsModules/signed/trunk/modules/signed/language/english/sms_template/verify-mobile.txt XoopsModules/signed/trunk/modules/signed/language/english/style.css XoopsModules/signed/trunk/modules/signed/language/english/timezone.php XoopsModules/signed/trunk/modules/signed/language/english/titles.php XoopsModules/signed/trunk/modules/signed/language/english/uploader.php XoopsModules/signed/trunk/modules/signed/language/index.html XoopsModules/signed/trunk/modules/signed/preloads/ XoopsModules/signed/trunk/modules/signed/preloads/api.php XoopsModules/signed/trunk/modules/signed/preloads/index.html XoopsModules/signed/trunk/modules/signed/request.php XoopsModules/signed/trunk/modules/signed/reset.php XoopsModules/signed/trunk/modules/signed/sql/ XoopsModules/signed/trunk/modules/signed/sql/index.html XoopsModules/signed/trunk/modules/signed/sql/mysql.sql XoopsModules/signed/trunk/modules/signed/templates/ XoopsModules/signed/trunk/modules/signed/templates/admin/ XoopsModules/signed/trunk/modules/signed/templates/admin/index.html XoopsModules/signed/trunk/modules/signed/templates/admin/signed_events.html XoopsModules/signed/trunk/modules/signed/templates/admin/signed_signatures.html XoopsModules/signed/trunk/modules/signed/templates/common/ XoopsModules/signed/trunk/modules/signed/templates/common/api.php XoopsModules/signed/trunk/modules/signed/templates/common/canvas.php XoopsModules/signed/trunk/modules/signed/templates/common/index.html XoopsModules/signed/trunk/modules/signed/templates/common/no-url.php XoopsModules/signed/trunk/modules/signed/templates/common/reset.php XoopsModules/signed/trunk/modules/signed/templates/common/start.php XoopsModules/signed/trunk/modules/signed/templates/common/update-identification.php XoopsModules/signed/trunk/modules/signed/templates/common/verify-email.php XoopsModules/signed/trunk/modules/signed/templates/common/verify-mobile.php XoopsModules/signed/trunk/modules/signed/templates/deployed/ XoopsModules/signed/trunk/modules/signed/templates/deployed/entity/ XoopsModules/signed/trunk/modules/signed/templates/deployed/entity/index.html XoopsModules/signed/trunk/modules/signed/templates/deployed/entity/send-email.php XoopsModules/signed/trunk/modules/signed/templates/deployed/entity/update-email.php XoopsModules/signed/trunk/modules/signed/templates/deployed/index.html XoopsModules/signed/trunk/modules/signed/templates/deployed/personal/ XoopsModules/signed/trunk/modules/signed/templates/deployed/personal/index.html XoopsModules/signed/trunk/modules/signed/templates/deployed/personal/send-email.php XoopsModules/signed/trunk/modules/signed/templates/deployed/personal/update-email.php XoopsModules/signed/trunk/modules/signed/templates/fields/ XoopsModules/signed/trunk/modules/signed/templates/fields/entity/ XoopsModules/signed/trunk/modules/signed/templates/fields/entity/generic-edit-form.php XoopsModules/signed/trunk/modules/signed/templates/fields/entity/generic-form.php XoopsModules/signed/trunk/modules/signed/templates/fields/entity/index.html XoopsModules/signed/trunk/modules/signed/templates/fields/identification/ XoopsModules/signed/trunk/modules/signed/templates/fields/identification/identification-edit-form.php XoopsModules/signed/trunk/modules/signed/templates/fields/identification/identification-form.php XoopsModules/signed/trunk/modules/signed/templates/fields/identification/index.html XoopsModules/signed/trunk/modules/signed/templates/fields/index.html XoopsModules/signed/trunk/modules/signed/templates/fields/personal/ XoopsModules/signed/trunk/modules/signed/templates/fields/personal/generic-edit-form.php XoopsModules/signed/trunk/modules/signed/templates/fields/personal/generic-form.php XoopsModules/signed/trunk/modules/signed/templates/fields/personal/index.html XoopsModules/signed/trunk/modules/signed/templates/help/ XoopsModules/signed/trunk/modules/signed/templates/help/entity/ XoopsModules/signed/trunk/modules/signed/templates/help/entity/finished.php XoopsModules/signed/trunk/modules/signed/templates/help/entity/index.html XoopsModules/signed/trunk/modules/signed/templates/help/entity/introduction.php XoopsModules/signed/trunk/modules/signed/templates/help/identification/ XoopsModules/signed/trunk/modules/signed/templates/help/identification/finished-update.php XoopsModules/signed/trunk/modules/signed/templates/help/identification/index.html XoopsModules/signed/trunk/modules/signed/templates/help/identification/needed.php XoopsModules/signed/trunk/modules/signed/templates/help/index.html XoopsModules/signed/trunk/modules/signed/templates/help/personal/ XoopsModules/signed/trunk/modules/signed/templates/help/personal/finished.php XoopsModules/signed/trunk/modules/signed/templates/help/personal/index.html XoopsModules/signed/trunk/modules/signed/templates/help/personal/introduction.php XoopsModules/signed/trunk/modules/signed/templates/index.html XoopsModules/signed/trunk/modules/signed/templates/signed_wrapper.html XoopsModules/signed/trunk/modules/signed/templates/update/ XoopsModules/signed/trunk/modules/signed/templates/update/identification/ XoopsModules/signed/trunk/modules/signed/templates/update/identification/identification-form.php XoopsModules/signed/trunk/modules/signed/templates/update/identification/index.html XoopsModules/signed/trunk/modules/signed/templates/update/index.html XoopsModules/signed/trunk/modules/signed/updator.php XoopsModules/signed/trunk/modules/signed/verifor.php XoopsModules/signed/trunk/modules/signed/xoops_version.php XoopsModules/signed/trunk/xoops_data/ XoopsModules/signed/trunk/xoops_data/.htaccess XoopsModules/signed/trunk/xoops_data/caches/ XoopsModules/signed/trunk/xoops_data/caches/index.html XoopsModules/signed/trunk/xoops_data/caches/signed/ XoopsModules/signed/trunk/xoops_data/caches/signed/.htaccess XoopsModules/signed/trunk/xoops_data/caches/signed/index.html XoopsModules/signed/trunk/xoops_data/index.html XoopsModules/signed/trunk/xoops_data/readme.txt XoopsModules/signed/trunk/xoops_data/signed/ XoopsModules/signed/trunk/xoops_data/signed/calendar/ XoopsModules/signed/trunk/xoops_data/signed/calendar/.htaccess XoopsModules/signed/trunk/xoops_data/signed/calendar/expires/ XoopsModules/signed/trunk/xoops_data/signed/calendar/expires/index.html XoopsModules/signed/trunk/xoops_data/signed/calendar/expiry/ XoopsModules/signed/trunk/xoops_data/signed/calendar/expiry/index.html XoopsModules/signed/trunk/xoops_data/signed/calendar/generated/ XoopsModules/signed/trunk/xoops_data/signed/calendar/generated/index.html XoopsModules/signed/trunk/xoops_data/signed/calendar/index.html XoopsModules/signed/trunk/xoops_data/signed/logs/ XoopsModules/signed/trunk/xoops_data/signed/logs/.htaccess XoopsModules/signed/trunk/xoops_data/signed/logs/delivery/ XoopsModules/signed/trunk/xoops_data/signed/logs/delivery/index.html XoopsModules/signed/trunk/xoops_data/signed/logs/emails/ XoopsModules/signed/trunk/xoops_data/signed/logs/emails/index.html XoopsModules/signed/trunk/xoops_data/signed/logs/errors/ XoopsModules/signed/trunk/xoops_data/signed/logs/errors/index.html XoopsModules/signed/trunk/xoops_data/signed/logs/execution/ XoopsModules/signed/trunk/xoops_data/signed/logs/execution/index.html XoopsModules/signed/trunk/xoops_data/signed/logs/index.html XoopsModules/signed/trunk/xoops_data/signed/logs/polling/ XoopsModules/signed/trunk/xoops_data/signed/logs/polling/index.html XoopsModules/signed/trunk/xoops_data/signed/pathways/ XoopsModules/signed/trunk/xoops_data/signed/pathways/.htaccess XoopsModules/signed/trunk/xoops_data/signed/pathways/certificate/ XoopsModules/signed/trunk/xoops_data/signed/pathways/codes/ XoopsModules/signed/trunk/xoops_data/signed/pathways/dates/ XoopsModules/signed/trunk/xoops_data/signed/pathways/emails/ XoopsModules/signed/trunk/xoops_data/signed/pathways/index.html XoopsModules/signed/trunk/xoops_data/signed/pathways/names/ XoopsModules/signed/trunk/xoops_data/signed/pathways/request/ XoopsModules/signed/trunk/xoops_data/signed/pathways/serials/ XoopsModules/signed/trunk/xoops_data/signed/pathways/signed/ XoopsModules/signed/trunk/xoops_data/signed/respository/ XoopsModules/signed/trunk/xoops_data/signed/respository/.htaccess XoopsModules/signed/trunk/xoops_data/signed/respository/index.html XoopsModules/signed/trunk/xoops_data/signed/respository/signatures/ XoopsModules/signed/trunk/xoops_data/signed/respository/signatures/index.html XoopsModules/signed/trunk/xoops_data/signed/respository/signed/ XoopsModules/signed/trunk/xoops_data/signed/respository/signed/index.html XoopsModules/signed/trunk/xoops_data/signed/respository/validation/ XoopsModules/signed/trunk/xoops_data/signed/respository/validation/index.html XoopsModules/signed/trunk/xoops_data/signed/uploads/ XoopsModules/signed/trunk/xoops_data/signed/uploads/.htaccess XoopsModules/signed/trunk/xoops_data/signed/uploads/index.html XoopsModules/signed/trunk/xoops_data/signed/urls/ XoopsModules/signed/trunk/xoops_data/signed/urls/.htaccess XoopsModules/signed/trunk/xoops_data/signed/urls/index.html XoopsModules/signed/trunk/xoops_lib/ XoopsModules/signed/trunk/xoops_lib/.htaccess XoopsModules/signed/trunk/xoops_lib/index.html XoopsModules/signed/trunk/xoops_lib/modules/ XoopsModules/signed/trunk/xoops_lib/modules/index.html XoopsModules/signed/trunk/xoops_lib/modules/signed/ XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/ XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/.htaccess XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/api-calls.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/apis-and-sites-available.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/banned-hostnames-for-urls-and-emails.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/banned-ips-for-urls-and-emails.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/certificate.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/emails-bcc.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/emails-cc.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/ XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/class-entity.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/class-personal.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/descriptions-fields.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/email-template-types.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/enumerator-gender.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/enumerator-im-type.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/enumerator-suffix.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/enumerator-titled.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/fieldnames-countries.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/fieldnames-dates.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/fieldnames-emails.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/fieldnames-enumerators.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/fieldnames-images.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/fieldnames-logos.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/fieldnames-months.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/fieldnames-numeric.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/fieldnames-photos.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/fieldnames-strings.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/fieldnames-urls.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/fieldnames-years.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/fields-entity.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/fields-identification.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/fields-personal.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/identifications-entity.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/identifications-personal.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/language-files-entity.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/language-files-personal.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/prompts-entity.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/prompts-personal.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/prompts-request-entity.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/prompts-request-personal.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/provided-entity.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/provided-personal.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/request-states.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/resize-dimensions.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/signatures.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/upload-dimensions.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/validations-entity.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/validations-personal.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/english/watermark.gif XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/index.html XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/language-files.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/languages.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/paired-peer-review-services.txt XoopsModules/signed/trunk/xoops_lib/modules/signed/processes/si...@la....txt XoopsModules/signed/trunk/xoops_lib/readme.txt Added: XoopsModules/signed/trunk/htaccess.dist =================================================================== --- XoopsModules/signed/trunk/htaccess.dist (rev 0) +++ XoopsModules/signed/trunk/htaccess.dist 2014-12-08 21:04:02 UTC (rev 12895) @@ -0,0 +1,19 @@ + +RewriteEngine On +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d + +# Client Signature Service Mod Rewrite +RewriteRule ^signer/=([a-zA-Z0-9]+)=/?(.*?)$ modules/signed/$1.php?$2 +RewriteRule ^signer/index.html modules/signed/index.php +RewriteRule ^signer/=([a-zA-Z0-9]+)=/?(.*?)$ modules/signed/$1.php?$2 +RewriteRule ^signer/=([a-zA-Z0-9]+)=/index(.*?)?(.*?)$ modules/signed/$1.php?$3 +RewriteRule ^signer/=([a-zA-Z0-9]+)=/index(.*?)$ modules/signed/$1.php +RewriteRule ^signer modules/signed/index.php [L=301] + +# API Service Mod Rewrite +RewriteRule ^signing/(.*?)/(.*?)?(.*?)$ modules/signed/api/$1/$2.php?$3 +RewriteRule ^signing/(.*?)/(.*?)$ modules/signed/api/$1/$2.php +RewriteRule ^signing/(.*?)/$ modules/signed/api/$1/index.php +RewriteRule ^signing modules/signed/api/index.php [L=301] + Added: XoopsModules/signed/trunk/modules/index.html =================================================================== --- XoopsModules/signed/trunk/modules/index.html (rev 0) +++ XoopsModules/signed/trunk/modules/index.html 2014-12-08 21:04:02 UTC (rev 12895) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/signed/trunk/modules/signed/.htaccess =================================================================== --- XoopsModules/signed/trunk/modules/signed/.htaccess (rev 0) +++ XoopsModules/signed/trunk/modules/signed/.htaccess 2014-12-08 21:04:02 UTC (rev 12895) @@ -0,0 +1,10 @@ +<IfModule mod_rewrite.c> + + RewriteEngine On + RewriteRule ^=([a-zA-Z0-9]+)=/ $1.php + RewriteRule ^=([a-zA-Z0-9]+)=/finished/([a-zA-Z0-9]+).(.*?)$ $1.php?op=finished&serial=$2 + RewriteRule ^=([a-zA-Z0-9]+)=/index(.*?)?(.*?)$ $1.php?$3 + RewriteRule ^=([a-zA-Z0-9]+)=/index(.*?)$ $1.php + RewriteRule ^=([a-zA-Z0-9]+)=/?(.*?)$ $1.php?$2 + +</IfModule> Property changes on: XoopsModules/signed/trunk/modules/signed/.htaccess ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/admin/about.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/admin/about.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/admin/about.php 2014-12-08 21:04:02 UTC (rev 12895) @@ -0,0 +1,34 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.14 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage administration + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + include_once dirname(__FILE__) . '/../../../include/cp_header.php'; + include '../../../class/xoopsformloader.php'; + include_once dirname(__FILE__) . '/admin_header.php'; + xoops_cp_header(); + + $aboutAdmin = new ModuleAdmin(); + + echo $aboutAdmin->addNavigation('about.php'); + echo $aboutAdmin->renderabout('-------------', false); + + include_once dirname(__FILE__) . '/admin_footer.php'; +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/admin/about.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/admin/admin.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/admin/admin.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/admin/admin.php 2014-12-08 21:04:02 UTC (rev 12895) @@ -0,0 +1,77 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.14 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage administration + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + include_once dirname(__FILE__) . '/admin_header.php'; + xoops_cp_header(); + + $indexAdmin = new ModuleAdmin(); + + echo $indexAdmin->addNavigation('admin.php'); + $signaturesHandler = xoops_getmodulehandler('signatures', 'signed'); + + $indexAdmin->addInfoBox(_SIGNED_AM_DASHBOARD); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_TOTAL. "</infolabel>", $signaturesHandler->getCount(new Criteria('1', '1')), 'Green'); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_PROGRESS. "</infolabel>", $signaturesHandler->getCount(new Criteria('state', 'progress')), 'Purple'); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_ACTIVE. "</infolabel>", $signaturesHandler->getCount(new Criteria('state', 'active')), 'Blue'); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_INACTIVE. "</infolabel>", $signaturesHandler->getCount(new Criteria('state', 'inactive'))."</infotext>", 'Orange'); + $criteria = new CriteriaCompo(new Criteria('state', 'active')); + $criteria->add(new Criteria('expires', time(), '>=')); + $criteria->add(new Criteria('expires', time() + (3600 * 24 * 7), '<=')); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_EXPIRE_NEXT_WEEK. "</infolabel>", $signaturesHandler->getCount($criteria), 'Red'); + $criteria = new CriteriaCompo(new Criteria('state', 'active')); + $criteria->add(new Criteria('expires', time(), '>=')); + $criteria->add(new Criteria('expires', time() + (3600 * 24 * 14), '<=')); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_EXPIRE_NEXT_FORTNIGHT. "</infolabel>", $signaturesHandler->getCount($criteria), 'Red'); + $criteria = new CriteriaCompo(new Criteria('1', '1')); + $criteria->add(new Criteria('expires', 0, '>')); + $criteria->add(new Criteria('expires', time(), '<=')); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_EXPIRED. "</infolabel>", $signaturesHandler->getCount($criteria), 'Red'); + $criteria = new CriteriaCompo(new Criteria('1', '1')); + $criteria->add(new Criteria('issued', time(), '<=')); + $criteria->add(new Criteria('issued', time() - (3600 * 24 * 7), '>=')); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_ISSUED_LAST_WEEK. "</infolabel>", $signaturesHandler->getCount($criteria), 'Green'); + $criteria = new CriteriaCompo(new Criteria('1', '1')); + $criteria->add(new Criteria('saved', time(), '<=')); + $criteria->add(new Criteria('saved', time() - (3600 * 24 * 7), '>=')); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_CREATED_LAST_WEEK. "</infolabel>", $signaturesHandler->getCount($criteria), 'Cyan'); + $criteria = new CriteriaCompo(new Criteria('1', '1')); + $criteria->add(new Criteria('used', time(), '<=')); + $criteria->add(new Criteria('used', time() - (3600 * 24 * 7), '>=')); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_ACCESSED_LAST_WEEK. "</infolabel>", $signaturesHandler->getCount($criteria), 'Black'); + $criteria = new CriteriaCompo(new Criteria('1', '1')); + $criteria->add(new Criteria('issued', time(), '<=')); + $criteria->add(new Criteria('issued', time() - (3600 * 24 * 14), '>=')); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_ISSUED_LAST_FORTNIGHT. "</infolabel>", $signaturesHandler->getCount($criteria), 'Green'); + $criteria = new CriteriaCompo(new Criteria('1', '1')); + $criteria->add(new Criteria('saved', time(), '<=')); + $criteria->add(new Criteria('saved', time() - (3600 * 24 * 14), '>=')); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_CREATED_LAST_FORTNIGHT. "</infolabel>", $signaturesHandler->getCount($criteria), 'Cyan'); + $criteria = new CriteriaCompo(new Criteria('1', '1')); + $criteria->add(new Criteria('used', time(), '<=')); + $criteria->add(new Criteria('used', time() - (3600 * 24 * 14), '>=')); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_ACCESSED_LAST_FORTNIGHT. "</infolabel>", $signaturesHandler->getCount($criteria), 'Black'); + + echo $indexAdmin->renderIndex(); + + include_once dirname(__FILE__) . '/admin_footer.php'; + +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/admin/admin.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/admin/admin_footer.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/admin/admin_footer.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/admin/admin_footer.php 2014-12-08 21:04:02 UTC (rev 12895) @@ -0,0 +1,26 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.14 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage administration + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + echo "<div class='adminfooter'>\n" . _SIGNED_AM_ADMIN_FOOTER . "\n" ."</div>"; + + xoops_cp_footer(); +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/admin/admin_footer.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/admin/admin_header.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/admin/admin_header.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/admin/admin_header.php 2014-12-08 21:04:02 UTC (rev 12895) @@ -0,0 +1,65 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.14 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage administration + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + + $path = dirname(dirname(dirname(dirname(__FILE__)))); + include_once $path . '/mainfile.php'; + include_once $path . '/include/cp_functions.php'; + require_once $path . '/include/cp_header.php'; + + global $xoopsModule; + $thisModuleDir = $GLOBALS['xoopsModule']->getVar('dirname'); + + // Load language files + xoops_loadLanguage('admin', $thisModuleDir); + xoops_loadLanguage('modinfo', $thisModuleDir); + xoops_loadLanguage('main', $thisModuleDir); + + xoops_load('pagenav'); + + $pathIcon16 = '../'.$xoopsModule->getInfo('icons16'); + $pathIcon32 = '../'.$xoopsModule->getInfo('icons32'); + $pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin'); + + include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'); + + if ($xoopsUser) { + $moduleperm_handler =& xoops_gethandler('groupperm'); + if (!$moduleperm_handler->checkRight('module_admin', $xoopsModule->getVar('mid'), $xoopsUser->getGroups())) { + redirect_header(XOOPS_URL, 1, _NOPERM); + exit(); + } + } else { + redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM); + exit(); + } + + if (!isset($xoopsTpl) || !is_object($xoopsTpl)) { + include_once(XOOPS_ROOT_PATH."/class/template.php"); + $xoopsTpl = new XoopsTpl(); + } + + if (!isset($GLOBALS['xoopsTpl']) || !is_object($GLOBALS['xoopsTpl'])) { + include_once XOOPS_ROOT_PATH . '/class/template.php'; + $GLOBALS['xoopsTpl'] = new XoopsTpl(); + } +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/admin/admin_header.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/admin/events.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/admin/events.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/admin/events.php 2014-12-08 21:04:02 UTC (rev 12895) @@ -0,0 +1,39 @@ +<?php +/** + * Private message + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package pm + * @since 2.3.0 + * @author Jan Pedersen + * @author Taiwen Jiang <ph...@us...> + * @version $Id: prune.php 12593 2014-06-14 16:04:02Z beckmi $ + */ + + include_once dirname(__FILE__) . '/admin_header.php'; + xoops_cp_header(); + + $indexAdmin = new ModuleAdmin(); + echo $indexAdmin->addNavigation('events.php'); + + $start = intval(isset($_REQUEST['start']) ? $_REQUEST['start'] : "0"); + $limit = intval(isset($_REQUEST['limit']) ? $_REQUEST['limit'] : "42"); + + $eventsHandler = xoops_getmodulehandler('events', 'signed'); + $pageNav = new XoopsPageNav($eventsHandler->getCount(new Criteria("1","1")), $limit, $start, 'start', 'limit='.$limit); + + $GLOBALS['xoopsTpl']->assign('pagenav', $pageNav->renderNav(5)); + $GLOBALS['xoopsTpl']->append('signatures', $eventsHandler->getAdminTabled($start, $limit)); + $GLOBALS['xoopsTpl']->display($GLOBALS['xoops']->path('/modules/signed/templates/admin/signed_events.html')); + + include_once dirname(__FILE__) . '/admin_footer.php'; + +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/admin/events.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/admin/index.html =================================================================== --- XoopsModules/signed/trunk/modules/signed/admin/index.html (rev 0) +++ XoopsModules/signed/trunk/modules/signed/admin/index.html 2014-12-08 21:04:02 UTC (rev 12895) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/admin/index.html ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/admin/menu.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/admin/menu.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/admin/menu.php 2014-12-08 21:04:02 UTC (rev 12895) @@ -0,0 +1,58 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.14 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage administration + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + $path = dirname(dirname(dirname(dirname(__FILE__)))); + include_once $path . '/mainfile.php'; + + $dirname = basename(dirname(dirname(__FILE__))); + $module_handler = xoops_gethandler('module'); + $module = $module_handler->getByDirname($dirname); + $pathIcon32 = $module->getInfo('icons32'); + $pathModuleAdmin = $module->getInfo('dirmoduleadmin'); + $pathLanguage = $path . $pathModuleAdmin; + + if (!file_exists($fileinc = $pathLanguage . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/' . 'main.php')) { + $fileinc = $pathLanguage . '/language/english/main.php'; + } + + include_once $fileinc; + + $adminmenu = array(); + + $i = 1; + $adminmenu[$i]['title'] = _SIGNED_MI_INDEX; + $adminmenu[$i]['link'] = "admin/admin.php"; + $adminmenu[$i]['icon'] = $pathIcon32.'/security.png' ; + ++$i; + $adminmenu[$i]['title'] = _SIGNED_MI_SIGNATURES; + $adminmenu[$i]['link'] = "admin/signatures.php"; + $adminmenu[$i]['icon'] = $pathIcon32.'/identity.png' ; + ++$i; + $adminmenu[$i]['title'] = _SIGNED_MI_EVENTS; + $adminmenu[$i]['link'] = "admin/events.php"; + $adminmenu[$i]['icon'] = $pathIcon32.'/event.png' ; + ++$i; + $adminmenu[$i]['title'] = _SIGNED_MI_ABOUT; + $adminmenu[$i]['link'] = 'admin/about.php'; + $adminmenu[$i]['icon'] = $pathIcon32.'/about.png'; + +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/admin/menu.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/admin/signatures.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/admin/signatures.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/ad... [truncated message content] |
From: <wis...@us...> - 2014-12-08 20:59:44
|
Revision: 12894 http://sourceforge.net/p/xoops/svn/12894 Author: wishcraft Date: 2014-12-08 20:59:35 +0000 (Mon, 08 Dec 2014) Log Message: ----------- Fixing Trunk Removed Paths: ------------- XoopsModules/signed/trunk/modules/ XoopsModules/signed/trunk/xoops_data/ XoopsModules/signed/trunk/xoops_lib/ |
From: <wis...@us...> - 2014-12-08 20:57:09
|
Revision: 12893 http://sourceforge.net/p/xoops/svn/12893 Author: wishcraft Date: 2014-12-08 20:57:03 +0000 (Mon, 08 Dec 2014) Log Message: ----------- Fixing Trunk Added Paths: ----------- XoopsModules/signed/trunk/modules/signed/class/ XoopsModules/signed/trunk/modules/signed/class/cache/ XoopsModules/signed/trunk/modules/signed/class/cache/apc.php XoopsModules/signed/trunk/modules/signed/class/cache/file.php XoopsModules/signed/trunk/modules/signed/class/cache/index.html XoopsModules/signed/trunk/modules/signed/class/cache/memcache.php XoopsModules/signed/trunk/modules/signed/class/cache/model.php XoopsModules/signed/trunk/modules/signed/class/cache/signedcache.php XoopsModules/signed/trunk/modules/signed/class/cache/xcache.php XoopsModules/signed/trunk/modules/signed/class/captcha/ XoopsModules/signed/trunk/modules/signed/class/captcha/index.html XoopsModules/signed/trunk/modules/signed/class/captcha/signedcaptcha.php XoopsModules/signed/trunk/modules/signed/class/event_links.php XoopsModules/signed/trunk/modules/signed/class/events.php XoopsModules/signed/trunk/modules/signed/class/file/ XoopsModules/signed/trunk/modules/signed/class/file/index.html XoopsModules/signed/trunk/modules/signed/class/file/signedfile.php XoopsModules/signed/trunk/modules/signed/class/index.html XoopsModules/signed/trunk/modules/signed/class/mail/ XoopsModules/signed/trunk/modules/signed/class/mail/index.html XoopsModules/signed/trunk/modules/signed/class/mail/signedmultimailer.php XoopsModules/signed/trunk/modules/signed/class/mobile/ XoopsModules/signed/trunk/modules/signed/class/mobile/handlers/ XoopsModules/signed/trunk/modules/signed/class/mobile/handlers/index.html XoopsModules/signed/trunk/modules/signed/class/mobile/handlers/sms.cardboardfish.php XoopsModules/signed/trunk/modules/signed/class/mobile/index.html XoopsModules/signed/trunk/modules/signed/class/mobile/plugin/ XoopsModules/signed/trunk/modules/signed/class/mobile/plugin/index.html XoopsModules/signed/trunk/modules/signed/class/mobile/signedsmscontroller.php XoopsModules/signed/trunk/modules/signed/class/mobile/signedsmsmobile.php XoopsModules/signed/trunk/modules/signed/class/qcp/ XoopsModules/signed/trunk/modules/signed/class/qcp/index.html XoopsModules/signed/trunk/modules/signed/class/qcp/qcp.base.php XoopsModules/signed/trunk/modules/signed/class/qcp/qcp.class.php XoopsModules/signed/trunk/modules/signed/class/qcp/qcp.enumerator.php XoopsModules/signed/trunk/modules/signed/class/qcp/qcp.leaver-beaver.php XoopsModules/signed/trunk/modules/signed/class/signatures.php XoopsModules/signed/trunk/modules/signed/class/signedapi.php XoopsModules/signed/trunk/modules/signed/class/signedarrays.php XoopsModules/signed/trunk/modules/signed/class/signedcanvas.php XoopsModules/signed/trunk/modules/signed/class/signedciphers.php XoopsModules/signed/trunk/modules/signed/class/signededitor/ XoopsModules/signed/trunk/modules/signed/class/signededitor/index.html XoopsModules/signed/trunk/modules/signed/class/signededitor/readme.txt XoopsModules/signed/trunk/modules/signed/class/signededitor/signededitor.php XoopsModules/signed/trunk/modules/signed/class/signedform/ XoopsModules/signed/trunk/modules/signed/class/signedform/form.php XoopsModules/signed/trunk/modules/signed/class/signedform/formbutton.php XoopsModules/signed/trunk/modules/signed/class/signedform/formbuttontray.php XoopsModules/signed/trunk/modules/signed/class/signedform/formcaptcha.php XoopsModules/signed/trunk/modules/signed/class/signedform/formcheckbox.php XoopsModules/signed/trunk/modules/signed/class/signedform/formcolorpicker.php XoopsModules/signed/trunk/modules/signed/class/signedform/formdatetime.php XoopsModules/signed/trunk/modules/signed/class/signedform/formdhtmltextarea.php XoopsModules/signed/trunk/modules/signed/class/signedform/formeditor.php XoopsModules/signed/trunk/modules/signed/class/signedform/formelement.php XoopsModules/signed/trunk/modules/signed/class/signedform/formelementtray.php XoopsModules/signed/trunk/modules/signed/class/signedform/formfile.php XoopsModules/signed/trunk/modules/signed/class/signedform/formhidden.php XoopsModules/signed/trunk/modules/signed/class/signedform/formhiddentoken.php XoopsModules/signed/trunk/modules/signed/class/signedform/formlabel.php XoopsModules/signed/trunk/modules/signed/class/signedform/formpassword.php XoopsModules/signed/trunk/modules/signed/class/signedform/formradio.php XoopsModules/signed/trunk/modules/signed/class/signedform/formradioyn.php XoopsModules/signed/trunk/modules/signed/class/signedform/formselect.php XoopsModules/signed/trunk/modules/signed/class/signedform/formselectcheckgroup.php XoopsModules/signed/trunk/modules/signed/class/signedform/formselectcountry.php XoopsModules/signed/trunk/modules/signed/class/signedform/formselecteditor.php XoopsModules/signed/trunk/modules/signed/class/signedform/formselectenumerator.php XoopsModules/signed/trunk/modules/signed/class/signedform/formselectmatchoption.php XoopsModules/signed/trunk/modules/signed/class/signedform/formselectmonths.php XoopsModules/signed/trunk/modules/signed/class/signedform/formselecttimezone.php XoopsModules/signed/trunk/modules/signed/class/signedform/formselectyears.php XoopsModules/signed/trunk/modules/signed/class/signedform/formtext.php XoopsModules/signed/trunk/modules/signed/class/signedform/formtextarea.php XoopsModules/signed/trunk/modules/signed/class/signedform/formtextdateselect.php XoopsModules/signed/trunk/modules/signed/class/signedform/index.html XoopsModules/signed/trunk/modules/signed/class/signedform/simpleform.php XoopsModules/signed/trunk/modules/signed/class/signedform/tableform.php XoopsModules/signed/trunk/modules/signed/class/signedform/themeform.php XoopsModules/signed/trunk/modules/signed/class/signedformloader.php XoopsModules/signed/trunk/modules/signed/class/signedlists.php XoopsModules/signed/trunk/modules/signed/class/signedlogger.php XoopsModules/signed/trunk/modules/signed/class/signedmailer.php XoopsModules/signed/trunk/modules/signed/class/signedmobile.php XoopsModules/signed/trunk/modules/signed/class/signedobject.php XoopsModules/signed/trunk/modules/signed/class/signedpackages.php XoopsModules/signed/trunk/modules/signed/class/signedprocesses.php XoopsModules/signed/trunk/modules/signed/class/signedprompts.php XoopsModules/signed/trunk/modules/signed/class/signedsecurity.php XoopsModules/signed/trunk/modules/signed/class/signedsession.php XoopsModules/signed/trunk/modules/signed/class/signedstorage.php XoopsModules/signed/trunk/modules/signed/class/uploader.php XoopsModules/signed/trunk/modules/signed/class/wideimage/ XoopsModules/signed/trunk/modules/signed/class/wideimage/Canvas.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Coordinate.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Exception.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Font/ XoopsModules/signed/trunk/modules/signed/class/wideimage/Font/GDF.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Font/PS.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Font/TTF.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Image.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Mapper/ XoopsModules/signed/trunk/modules/signed/class/wideimage/Mapper/BMP.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Mapper/GD.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Mapper/GD2.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Mapper/GIF.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Mapper/JPEG.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Mapper/PNG.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Mapper/TGA.php XoopsModules/signed/trunk/modules/signed/class/wideimage/MapperFactory.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/ XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/AddNoise.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/ApplyConvolution.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/ApplyFilter.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/ApplyMask.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/AsGrayscale.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/AsNegative.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/AutoCrop.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/CopyChannelsPalette.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/CopyChannelsTrueColor.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/CorrectGamma.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/Crop.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/Flip.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/GetMask.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/Merge.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/Mirror.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/Resize.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/ResizeCanvas.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/Rotate.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/RoundCorners.php XoopsModules/signed/trunk/modules/signed/class/wideimage/Operation/Unsharp.php XoopsModules/signed/trunk/modules/signed/class/wideimage/OperationFactory.php XoopsModules/signed/trunk/modules/signed/class/wideimage/PaletteImage.php XoopsModules/signed/trunk/modules/signed/class/wideimage/TrueColorImage.php XoopsModules/signed/trunk/modules/signed/class/wideimage/WideImage.php XoopsModules/signed/trunk/modules/signed/class/wideimage/index.html XoopsModules/signed/trunk/modules/signed/class/wideimage/vendor/ XoopsModules/signed/trunk/modules/signed/class/wideimage/vendor/de77/ XoopsModules/signed/trunk/modules/signed/class/wideimage/vendor/de77/BMP.php XoopsModules/signed/trunk/modules/signed/class/wideimage/vendor/de77/TGA.php XoopsModules/signed/trunk/modules/signed/class/xmlarray.php XoopsModules/signed/trunk/modules/signed/class/xmlwrapper.php XoopsModules/signed/trunk/modules/signed/crons/ XoopsModules/signed/trunk/modules/signed/crons/.htaccess XoopsModules/signed/trunk/modules/signed/crons/callbacks.php XoopsModules/signed/trunk/modules/signed/crons/expires.php XoopsModules/signed/trunk/modules/signed/crons/expiry.php XoopsModules/signed/trunk/modules/signed/crons/index.html XoopsModules/signed/trunk/modules/signed/crons/request.php XoopsModules/signed/trunk/modules/signed/css/ XoopsModules/signed/trunk/modules/signed/css/calendar-blue.css XoopsModules/signed/trunk/modules/signed/css/index.html XoopsModules/signed/trunk/modules/signed/css/signed.css XoopsModules/signed/trunk/modules/signed/css/style.css XoopsModules/signed/trunk/modules/signed/docs/ XoopsModules/signed/trunk/modules/signed/docs/changelog.txt XoopsModules/signed/trunk/modules/signed/docs/credits.txt XoopsModules/signed/trunk/modules/signed/docs/index.html XoopsModules/signed/trunk/modules/signed/docs/install.txt XoopsModules/signed/trunk/modules/signed/docs/lang_diff.txt XoopsModules/signed/trunk/modules/signed/dojsonids.php XoopsModules/signed/trunk/modules/signed/dojsonoperations.php XoopsModules/signed/trunk/modules/signed/fonts/ XoopsModules/signed/trunk/modules/signed/fonts/COOPBL.eot XoopsModules/signed/trunk/modules/signed/fonts/COOPBL.otf XoopsModules/signed/trunk/modules/signed/fonts/COOPBL.svg XoopsModules/signed/trunk/modules/signed/fonts/COOPBL.ttf XoopsModules/signed/trunk/modules/signed/fonts/COOPBL.woff XoopsModules/signed/trunk/modules/signed/fonts/ERASMD.eot XoopsModules/signed/trunk/modules/signed/fonts/ERASMD.otf XoopsModules/signed/trunk/modules/signed/fonts/ERASMD.svg XoopsModules/signed/trunk/modules/signed/fonts/ERASMD.ttf XoopsModules/signed/trunk/modules/signed/fonts/ERASMD.woff XoopsModules/signed/trunk/modules/signed/fonts/index.html XoopsModules/signed/trunk/modules/signed/footer.php XoopsModules/signed/trunk/modules/signed/generator.php XoopsModules/signed/trunk/modules/signed/go/ XoopsModules/signed/trunk/modules/signed/go/.htaccess XoopsModules/signed/trunk/modules/signed/go/index.php XoopsModules/signed/trunk/modules/signed/header.php XoopsModules/signed/trunk/modules/signed/image/ XoopsModules/signed/trunk/modules/signed/image/icons/ XoopsModules/signed/trunk/modules/signed/image/icons/16/ XoopsModules/signed/trunk/modules/signed/image/icons/16/index.html XoopsModules/signed/trunk/modules/signed/image/icons/32/ XoopsModules/signed/trunk/modules/signed/image/icons/32/about.png XoopsModules/signed/trunk/modules/signed/image/icons/32/event.png XoopsModules/signed/trunk/modules/signed/image/icons/32/identity.png XoopsModules/signed/trunk/modules/signed/image/icons/32/index.html XoopsModules/signed/trunk/modules/signed/image/icons/32/security.png XoopsModules/signed/trunk/modules/signed/image/icons/index.html XoopsModules/signed/trunk/modules/signed/image/index.html XoopsModules/signed/trunk/modules/signed/image/signed.png XoopsModules/signed/trunk/modules/signed/image/watermark.gif XoopsModules/signed/trunk/modules/signed/image/watermark.php XoopsModules/signed/trunk/modules/signed/include/ XoopsModules/signed/trunk/modules/signed/include/common.php XoopsModules/signed/trunk/modules/signed/include/configs.php XoopsModules/signed/trunk/modules/signed/include/constants.php XoopsModules/signed/trunk/modules/signed/include/form-edit-object.php XoopsModules/signed/trunk/modules/signed/include/form-generic-edit-form.php XoopsModules/signed/trunk/modules/signed/include/form-generic-form.php XoopsModules/signed/trunk/modules/signed/include/form-identification-edit-form.php XoopsModules/signed/trunk/modules/signed/include/form-identification-form.php XoopsModules/signed/trunk/modules/signed/include/form-object.php XoopsModules/signed/trunk/modules/signed/include/functions.php XoopsModules/signed/trunk/modules/signed/include/index.html XoopsModules/signed/trunk/modules/signed/include/language.php XoopsModules/signed/trunk/modules/signed/index.php XoopsModules/signed/trunk/modules/signed/js/ XoopsModules/signed/trunk/modules/signed/js/calendar.js XoopsModules/signed/trunk/modules/signed/js/color-picker.js XoopsModules/signed/trunk/modules/signed/js/formdhtmltextarea.js XoopsModules/signed/trunk/modules/signed/js/index.html XoopsModules/signed/trunk/modules/signed/js/json.validation.js XoopsModules/signed/trunk/modules/signed/js/layersmenu.js XoopsModules/signed/trunk/modules/signed/js/signed.js XoopsModules/signed/trunk/modules/signed/language/ XoopsModules/signed/trunk/modules/signed/language/english/ XoopsModules/signed/trunk/modules/signed/language/english/admin.php XoopsModules/signed/trunk/modules/signed/language/english/calendar.php XoopsModules/signed/trunk/modules/signed/language/english/captcha.php XoopsModules/signed/trunk/modules/signed/language/english/content.php XoopsModules/signed/trunk/modules/signed/language/english/countries.php XoopsModules/signed/trunk/modules/signed/language/english/errors.php XoopsModules/signed/trunk/modules/signed/language/english/formdhtmltextarea.php XoopsModules/signed/trunk/modules/signed/language/english/global.php XoopsModules/signed/trunk/modules/signed/language/english/help/ XoopsModules/signed/trunk/modules/signed/language/english/help/help.html XoopsModules/signed/trunk/modules/signed/language/english/help/index.html XoopsModules/signed/trunk/modules/signed/language/english/index.html XoopsModules/signed/trunk/modules/signed/language/english/mail.php XoopsModules/signed/trunk/modules/signed/language/english/mail_template/ XoopsModules/signed/trunk/modules/signed/language/english/mail_template/html/ XoopsModules/signed/trunk/modules/signed/language/english/mail_template/html/expired-identification.html XoopsModules/signed/trunk/modules/signed/language/english/mail_template/html/expired-signature.html XoopsModules/signed/trunk/modules/signed/language/english/mail_template/html/index.html XoopsModules/signed/trunk/modules/signed/language/english/mail_template/html/signature-email.html XoopsModules/signed/trunk/modules/signed/language/english/mail_template/html/update-request.html XoopsModules/signed/trunk/modules/signed/language/english/mail_template/html/verify-email.html XoopsModules/signed/trunk/modules/signed/language/english/mail_template/index.html XoopsModules/signed/trunk/modules/signed/language/english/mail_template/text/ XoopsModules/signed/trunk/modules/signed/language/english/mail_template/text/expired-identification.txt XoopsModules/signed/trunk/modules/signed/language/english/mail_template/text/expired-signature.txt XoopsModules/signed/trunk/modules/signed/language/english/mail_template/text/index.html XoopsModules/signed/trunk/modules/signed/language/english/mail_template/text/signature-email.txt XoopsModules/signed/trunk/modules/signed/language/english/mail_template/text/update-request.txt XoopsModules/signed/trunk/modules/signed/language/english/mail_template/text/verify-email.txt XoopsModules/signed/trunk/modules/signed/language/english/main.php XoopsModules/signed/trunk/modules/signed/language/english/modinfo.php XoopsModules/signed/trunk/modules/signed/language/english/months.php XoopsModules/signed/trunk/modules/signed/language/english/signedmailerlocal.php XoopsModules/signed/trunk/modules/signed/language/english/signedmobilelocal.php XoopsModules/signed/trunk/modules/signed/language/english/sms_template/ XoopsModules/signed/trunk/modules/signed/language/english/sms_template/index.html XoopsModules/signed/trunk/modules/signed/language/english/sms_template/verify-mobile.txt XoopsModules/signed/trunk/modules/signed/language/english/style.css XoopsModules/signed/trunk/modules/signed/language/english/timezone.php XoopsModules/signed/trunk/modules/signed/language/english/titles.php XoopsModules/signed/trunk/modules/signed/language/english/uploader.php XoopsModules/signed/trunk/modules/signed/language/index.html XoopsModules/signed/trunk/modules/signed/preloads/ XoopsModules/signed/trunk/modules/signed/preloads/api.php XoopsModules/signed/trunk/modules/signed/preloads/index.html XoopsModules/signed/trunk/modules/signed/request.php XoopsModules/signed/trunk/modules/signed/reset.php XoopsModules/signed/trunk/modules/signed/sql/ XoopsModules/signed/trunk/modules/signed/sql/index.html XoopsModules/signed/trunk/modules/signed/sql/mysql.sql XoopsModules/signed/trunk/modules/signed/templates/ XoopsModules/signed/trunk/modules/signed/templates/admin/ XoopsModules/signed/trunk/modules/signed/templates/admin/index.html XoopsModules/signed/trunk/modules/signed/templates/admin/signed_events.html XoopsModules/signed/trunk/modules/signed/templates/admin/signed_signatures.html XoopsModules/signed/trunk/modules/signed/templates/common/ XoopsModules/signed/trunk/modules/signed/templates/common/api.php XoopsModules/signed/trunk/modules/signed/templates/common/canvas.php XoopsModules/signed/trunk/modules/signed/templates/common/index.html XoopsModules/signed/trunk/modules/signed/templates/common/no-url.php XoopsModules/signed/trunk/modules/signed/templates/common/reset.php XoopsModules/signed/trunk/modules/signed/templates/common/start.php XoopsModules/signed/trunk/modules/signed/templates/common/update-identification.php XoopsModules/signed/trunk/modules/signed/templates/common/verify-email.php XoopsModules/signed/trunk/modules/signed/templates/common/verify-mobile.php XoopsModules/signed/trunk/modules/signed/templates/deployed/ XoopsModules/signed/trunk/modules/signed/templates/deployed/entity/ XoopsModules/signed/trunk/modules/signed/templates/deployed/entity/index.html XoopsModules/signed/trunk/modules/signed/templates/deployed/entity/send-email.php XoopsModules/signed/trunk/modules/signed/templates/deployed/entity/update-email.php XoopsModules/signed/trunk/modules/signed/templates/deployed/index.html XoopsModules/signed/trunk/modules/signed/templates/deployed/personal/ XoopsModules/signed/trunk/modules/signed/templates/deployed/personal/index.html XoopsModules/signed/trunk/modules/signed/templates/deployed/personal/send-email.php XoopsModules/signed/trunk/modules/signed/templates/deployed/personal/update-email.php XoopsModules/signed/trunk/modules/signed/templates/fields/ XoopsModules/signed/trunk/modules/signed/templates/fields/entity/ XoopsModules/signed/trunk/modules/signed/templates/fields/entity/generic-edit-form.php XoopsModules/signed/trunk/modules/signed/templates/fields/entity/generic-form.php XoopsModules/signed/trunk/modules/signed/templates/fields/entity/index.html XoopsModules/signed/trunk/modules/signed/templates/fields/identification/ XoopsModules/signed/trunk/modules/signed/templates/fields/identification/identification-edit-form.php XoopsModules/signed/trunk/modules/signed/templates/fields/identification/identification-form.php XoopsModules/signed/trunk/modules/signed/templates/fields/identification/index.html XoopsModules/signed/trunk/modules/signed/templates/fields/index.html XoopsModules/signed/trunk/modules/signed/templates/fields/personal/ XoopsModules/signed/trunk/modules/signed/templates/fields/personal/generic-edit-form.php XoopsModules/signed/trunk/modules/signed/templates/fields/personal/generic-form.php XoopsModules/signed/trunk/modules/signed/templates/fields/personal/index.html XoopsModules/signed/trunk/modules/signed/templates/help/ XoopsModules/signed/trunk/modules/signed/templates/help/entity/ XoopsModules/signed/trunk/modules/signed/templates/help/entity/finished.php XoopsModules/signed/trunk/modules/signed/templates/help/entity/index.html XoopsModules/signed/trunk/modules/signed/templates/help/entity/introduction.php XoopsModules/signed/trunk/modules/signed/templates/help/identification/ XoopsModules/signed/trunk/modules/signed/templates/help/identification/finished-update.php XoopsModules/signed/trunk/modules/signed/templates/help/identification/index.html XoopsModules/signed/trunk/modules/signed/templates/help/identification/needed.php XoopsModules/signed/trunk/modules/signed/templates/help/index.html XoopsModules/signed/trunk/modules/signed/templates/help/personal/ XoopsModules/signed/trunk/modules/signed/templates/help/personal/finished.php XoopsModules/signed/trunk/modules/signed/templates/help/personal/index.html XoopsModules/signed/trunk/modules/signed/templates/help/personal/introduction.php XoopsModules/signed/trunk/modules/signed/templates/index.html XoopsModules/signed/trunk/modules/signed/templates/signed_wrapper.html XoopsModules/signed/trunk/modules/signed/templates/update/ XoopsModules/signed/trunk/modules/signed/templates/update/identification/ XoopsModules/signed/trunk/modules/signed/templates/update/identification/identification-form.php XoopsModules/signed/trunk/modules/signed/templates/update/identification/index.html XoopsModules/signed/trunk/modules/signed/templates/update/index.html XoopsModules/signed/trunk/modules/signed/updator.php XoopsModules/signed/trunk/modules/signed/verifor.php XoopsModules/signed/trunk/modules/signed/xoops_version.php Added: XoopsModules/signed/trunk/modules/signed/class/cache/apc.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/class/cache/apc.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/class/cache/apc.php 2014-12-08 20:57:03 UTC (rev 12893) @@ -0,0 +1,126 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage cache + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + +defined('_PATH_ROOT') or die('Restricted access'); + +/** + * APC storage engine for cache. + * + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.libs.cache + * @since CakePHP(tm) v 1.2.0.4933 + * @version $Revision: 8066 $ + * @modifiedby $LastChangedBy: beckmi $ + * @lastmodified $Date: 2011-11-06 01:09:33 -0400 (Sun, 06 Nov 2011) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +/** + * APC storage engine for cache + * + * @package cake + * @subpackage cake.cake.libs.cache + */ +class signedCacheApc extends signedCacheEngine +{ + /** + * Initialize the Cache Engine + * + * Called automatically by the cache frontend + * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array()); + * + * @param array $setting array of setting for the engine + * @return boolean True if the engine has been successfully initialized, false if not + * @see CacheEngine::__defaults + * @access public + */ + function init($settings = array()) + { + parent::init($settings); + return function_exists('apc_cache_info'); + } + + /** + * Write data for key into cache + * + * @param string $key Identifier for the data + * @param mixed $value Data to be cached + * @param integer $duration How long to cache the data, in seconds + * @return boolean True if the data was succesfully cached, false on failure + * @access public + */ + function write($key, &$value, $duration) + { + return apc_store($key, $value, $duration); + } + + /** + * Read a key from the cache + * + * @param string $key Identifier for the data + * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it + * @access public + */ + function read($key) + { + return apc_fetch($key); + } + + /** + * Delete a key from the cache + * + * @param string $key Identifier for the data + * @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed + * @access public + */ + function delete($key) + { + return apc_delete($key); + } + + /** + * Delete all keys from the cache + * + * @return boolean True if the cache was succesfully cleared, false otherwise + * @access public + */ + function clear() + { + return apc_clear_cache('user'); + } +} + +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/class/cache/apc.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/class/cache/file.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/class/cache/file.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/class/cache/file.php 2014-12-08 20:57:03 UTC (rev 12893) @@ -0,0 +1,317 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage cache + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + +defined('_PATH_ROOT') or die('Restricted access'); + +/** + * File Storage engine for cache + * + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.libs.cache + * @since CakePHP(tm) v 1.2.0.4933 + * @version $Revision: 10686 $ + * @modifiedby $LastChangedBy: beckmi $ + * @lastmodified $Date: 2013-01-06 14:07:24 -0500 (Sun, 06 Jan 2013) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +/** + * File Storage engine for cache + * + * @todo use the File and Folder classes (if it's not a too big performance hit) + * @package cake + * @subpackage cake.cake.libs.cache + */ +class signedCacheFile extends signedCacheEngine +{ + /** + * Instance of File class + * + * @var object + * @access private + */ + var $file = null; + + /** + * settings + * path = absolute path to cache directory, default => CACHE + * prefix = string prefix for filename, default => signed_ + * lock = enable file locking on write, default => false + * serialize = serialize the data, default => false + * + * @var array + * @see CacheEngine::__defaults + * @access public + */ + var $settings = array(); + + /** + * Set to true if FileEngine::init(); and FileEngine::active(); do not fail. + * + * @var boolean + * @access private + */ + var $active = false; + + /** + * True unless FileEngine::active(); fails + * + * @var boolean + * @access private + */ + var $init = true; + + /** + * Initialize the Cache Engine + * + * Called automatically by the cache frontend + * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array()); + * + * @param array $setting array of setting for the engine + * @return boolean True if the engine has been successfully initialized, false if not + * @access public + */ + function init($settings = array()) + { + parent::init($settings); + $defaults = array('path' => _PATH_CACHE , 'extension' => '.php' , 'prefix' => 'signed_' , 'lock' => false , 'serialize' => false , 'duration' => 31556926); + $this->settings = array_merge($defaults, $this->settings); + if (!isset($this->file)) { + include_once _PATH_ROOT . _DS_ . 'class' . _DS_ . 'file' . _DS_ . 'signedfile.php'; + $this->file = signedFile::getHandler('file', $this->settings['path'] . '/index.html', true); + } + $this->settings['path'] = $this->file->folder->cd($this->settings['path']); + if (empty($this->settings['path'])) { + return false; + } + return $this->active(); + } + + /** + * Garbage collection. Permanently remove all expired and deleted data + * + * @return boolean True if garbage collection was succesful, false on failure + * @access public + */ + function gc() + { + return $this->clear(true); + } + + /** + * Write data for key into cache + * + * @param string $key Identifier for the data + * @param mixed $data Data to be cached + * @param mixed $duration How long to cache the data, in seconds + * @return boolean True if the data was succesfully cached, false on failure + * @access public + */ + function write($key, $data = null, $duration = null) + { + if (!isset($data) || ! $this->init) { + return false; + } + + if ($this->setKey($key) === false) { + return false; + } + + if ($duration == null) { + $duration = $this->settings['duration']; + } + $windows = false; + $lineBreak = "\n"; + + if (substr(PHP_OS, 0, 3) == "WIN") { + $lineBreak = "\r\n"; + $windows = true; + } + $expires = time() + $duration; + if (!empty($this->settings['serialize'])) { + if ($windows) { + $data = str_replace('\\', '\\\\\\\\', serialize($data)); + } else { + $data = serialize($data); + } + $contents = $expires . $lineBreak . $data . $lineBreak; + } else { + $contents = $expires . $lineBreak . "return " . var_export($data, true) . ";" . $lineBreak; + } + + if ($this->settings['lock']) { + $this->file->lock = true; + } + $success = $this->file->write($contents); + if ($GLOBALS['logger'] = signedLogger::getInstance()) + $GLOBALS['logger']->logBytes(strlen($contents), 'cache-written'); + $this->file->close(); + return $success; + } + + /** + * Read a key from the cache + * + * @param string $key Identifier for the data + * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it + * @access public + */ + function read($key) + { + if ($this->setKey($key) === false || ! $this->init) { + return false; + } + if ($this->settings['lock']) { + $this->file->lock = true; + } + $cachetime = $this->file->read(11); + + if ($cachetime !== false && intval($cachetime) < time()) { + $this->file->close(); + $this->file->delete(); + return false; + } + + $data = $this->file->read(true); + if ($GLOBALS['logger'] = signedLogger::getInstance()) + $GLOBALS['logger']->logBytes(strlen($data), 'cache-read'); + if (!empty($data) && !empty($this->settings['serialize'])) { + $data = stripslashes($data); + $data = preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $data); + $data = unserialize($data); + if (is_array($data)) { + signedLoad::load('signedUtility'); + $data = signedUtility::recursive('stripslashes', $data); + } + } else if ($data && empty($this->settings['serialize'])) { + $data = eval($data); + } + $this->file->close(); + return $data; + } + + /** + * Delete a key from the cache + * + * @param string $key Identifier for the data + * @return boolean True if the value was successfully deleted, false if it didn't exist or couldn't be removed + * @access public + */ + function delete($key) + { + if ($this->setKey($key) === false || ! $this->init) { + return false; + } + return $this->file->delete(); + } + + /** + * Delete all values from the cache + * + * @param boolean $check Optional - only delete expired cache items + * @return boolean True if the cache was succesfully cleared, false otherwise + * @access public + */ + function clear($check = true) + { + if (!$this->init) { + return false; + } + $dir = dir($this->settings['path']); + if ($check) { + $now = time(); + $threshold = $now - $this->settings['duration']; + } + while (($entry = $dir->read()) !== false) { + if ($this->setKey(str_replace($this->settings['prefix'], '', $entry)) === false) { + continue; + } + if ($check) { + $mtime = $this->file->lastChange(); + + if ($mtime === false || $mtime > $threshold) { + continue; + } + + $expires = $this->file->read(11); + $this->file->close(); + + if ($expires > $now) { + continue; + } + } + $this->file->delete(); + } + $dir->close(); + return true; + } + + /** + * Get absolute file for a given key + * + * @param string $key The key + * @return mixed Absolute cache file for the given key or false if erroneous + * @access private + */ + function setKey($key) + { + $this->file->folder->cd($this->settings['path']); + $this->file->name = $this->settings['prefix'] . $key . $this->settings['extension']; + $this->file->handle = null; + $this->file->info = null; + if (!$this->file->folder->inPath($this->file->pwd(), true)) { + return false; + } + } + /** + * Determine is cache directory is writable + * + * @return boolean + * @access private + */ + function active() + { + if (!$this->active && $this->init && ! is_writable($this->settings['path'])) { + $this->init = false; + trigger_error(sprintf('%s is not writable', $this->settings['path']), E_USER_WARNING); + } else { + $this->active = true; + } + return true; + } +} + +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/class/cache/file.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/class/cache/index.html =================================================================== --- XoopsModules/signed/trunk/modules/signed/class/cache/index.html (rev 0) +++ XoopsModules/signed/trunk/modules/signed/class/cache/index.html 2014-12-08 20:57:03 UTC (rev 12893) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/class/cache/index.html ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/class/cache/memcache.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/class/cache/memcache.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/class/cache/memcache.php 2014-12-08 20:57:03 UTC (rev 12893) @@ -0,0 +1,183 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage cache + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + +defined('_PATH_ROOT') or die('Restricted access'); + +/** + * Memcache storage engine for cache + * + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.libs.cache + * @since CakePHP(tm) v 1.2.0.4933 + * @version $Revision: 8066 $ + * @modifiedby $LastChangedBy: beckmi $ + * @lastmodified $Date: 2011-11-06 01:09:33 -0400 (Sun, 06 Nov 2011) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Memcache storage engine for cache + * + * @package cake + * @subpackage cake.cake.libs.cache + */ +class signedCacheMemcache extends signedCacheEngine +{ + /** + * Memcache wrapper. + * + * @var object + * @access private + */ + var $memcache = null; + /** + * settings + * servers = string or array of memcache servers, default => 127.0.0.1 + * compress = boolean, default => false + * + * @var array + * @access public + */ + var $settings = array(); + /** + * Initialize the Cache Engine + * + * Called automatically by the cache frontend + * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array()); + * + * @param array $setting array of setting for the engine + * @return boolean True if the engine has been successfully initialized, false if not + * @access public + */ + function init($settings = array()) + { + if (!class_exists('Memcache')) { + return false; + } + parent::init($settings); + $defaults = array( + 'servers' => array( + '127.0.0.1') , + 'compress' => false); + $this->settings = array_merge($defaults, $this->settings); + + if (!$this->settings['compress']) { + $this->settings['compress'] = MEMCACHE_COMPRESSED; + } + if (!is_array($this->settings['servers'])) { + $this->settings['servers'] = array( + $this->settings['servers']); + } + $this->memcache = null; + $this->memcache = new Memcache(); + foreach ($this->settings['servers'] as $server) { + $parts = explode(':', $server); + $host = $parts[0]; + $port = 11211; + if (isset($parts[1])) { + $port = $parts[1]; + } + if ($this->memcache->addServer($host, $port)) { + return true; + } + } + return false; + } + /** + * Write data for key into cache + * + * @param string $key Identifier for the data + * @param mixed $value Data to be cached + * @param integer $duration How long to cache the data, in seconds + * @return boolean True if the data was succesfully cached, false on failure + * @access public + */ + function write($key, &$value, $duration) + { + return $this->memcache->set($key, $value, $this->settings['compress'], $duration); + } + /** + * Read a key from the cache + * + * @param string $key Identifier for the data + * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it + * @access public + */ + function read($key) + { + return $this->memcache->get($key); + } + /** + * Delete a key from the cache + * + * @param string $key Identifier for the data + * @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed + * @access public + */ + function delete($key) + { + return $this->memcache->delete($key); + } + /** + * Delete all keys from the cache + * + * @return boolean True if the cache was succesfully cleared, false otherwise + * @access public + */ + function clear() + { + return $this->memcache->flush(); + } + /** + * Connects to a server in connection pool + * + * @param string $host host ip address or name + * @param integer $port Server port + * @return boolean True if memcache server was connected + * @access public + */ + function connect($host, $port = 11211) + { + if ($this->memcache->getServerStatus($host, $port) === 0) { + if ($this->memcache->connect($host, $port)) { + return true; + } + return false; + } + return true; + } +} + +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/class/cache/memcache.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/class/cache/model.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/class/cache/model.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/class/cache/model.php 2014-12-08 20:57:03 UTC (rev 12893) @@ -0,0 +1,224 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage cache + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + +defined('_PATH_ROOT') or die('Restricted access'); + +/** + * Database Storage engine for cache + * + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.libs.cache + * @since CakePHP(tm) v 1.2.0.4933 + * @version $Revision: 8066 $ + * @modifiedby $LastChangedBy: beckmi $ + * @lastmodified $Date: 2011-11-06 01:09:33 -0400 (Sun, 06 Nov 2011) $ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Database Storage engine for cache + * + * @package cake + * @subpackage cake.cake.libs.cache + */ +class signedCacheModel extends signedCacheEngine +{ + /** + * settings + * className = name of the model to use, default => Cache + * fields = database fields that hold data and ttl, default => data, expires + * + * @var array + * @access public + */ + var $settings = array(); + + /** + * Model instance. + * + * @var object + * @access private + */ + var $model = null; + + /** + * Model instance. + * + * @var object + * @access private + */ + var $fields = array(); + + /** + * Initialize the Cache Engine + * + * Called automatically by the cache frontend + * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array()); + * + * @param array $setting array of setting for the engine + * @return boolean True if the engine has been successfully initialized, false if not + * @access public + */ + function init($settings) + { + $signedDB =& signedDatabaseFactory::getDatabaseConnection(); + + parent::init($settings); + $defaults = array('fields' => array('data' , 'expires')); + $this->settings = array_merge($defaults, $this->settings); + $this->fields = $this->settings['fields']; + $this->model = new signedCacheModelHandler($signedDB); + return true; + } + + /** + * Garbage collection. Permanently remove all expired and deleted data + * + * @access public + */ + function gc() + { + return $this->model->deleteAll(new Criteria($this->fields[1], time, '<= ')); + } + + /** + * Write data for key into cache + * + * @param string $key Identifier for the data + * @param mixed $data Data to be cached + * @param integer $duration How long to cache the data, in seconds + * @return boolean True if the data was succesfully cached, false on failure + * @access public + */ + function write($key, $data, $duration) + { + // if (isset($this->settings['serialize'])) { + $data = serialize($data); + // } + if (! $data) { + return false; + } + $cache_obj = $this->model->create(); + $cache_obj->setVar($this->model::KEYNAME, $key); + $cache_obj->setVar($this->fields[0], $data); + $cache_obj->setVar($this->fields[1], time() + $duration); + return $this->model->insert($cache_obj); + } + + /** + * Read a key from the cache + * + * @param string $key Identifier for the data + * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it + * @access public + */ + function read($key) + { + $criteria = new CriteriaCompo(new Criteria($this->model::KEYNAME, $key)); + $criteria->add(new Criteria($this->fields[1], time(), ">")); + $criteria->setLimit(1); + $data = $this->model->getAll($criteria); + if (!$data) { + return null; + } + return unserialize($data[0]); + } + + /** + * Delete a key from the cache + * + * @param string $key Identifier for the data + * @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed + * @access public + */ + function delete($key) + { + return $this->model->delete($key); + } + + /** + * Delete all keys from the cache + * + * @return boolean True if the cache was succesfully cleared, false otherwise + * @access public + */ + function clear() + { + return $this->model->deleteAll(); + } +} + +/** + * signedCacheModelObject + * + * @package + * @author John + * @copyright Copyright (c) 2009 + * @version $Id: model.php 8066 2011-11-06 05:09:33Z beckmi $ + * @access public + */ +class signedCacheModelObject extends signedObject +{ + function signedCacheModelObject() + { + $this->__construct(); + } + + function __construct() + { + parent::__construct(); + $this->initVar('key', XOBJ_DTYPE_TXTBOX); + $this->initVar('data', XOBJ_DTYPE_SOURCE); + $this->initVar('expires', XOBJ_DTYPE_INT); + } +} + +/** + * signedCacheModelHandler + * + * @package + * @author John + * @copyright Copyright (c) 2009 + * @version $Id: model.php 8066 2011-11-06 05:09:33Z beckmi $ + * @access public + */ +class signedCacheModelHandler extends signedPersistableObjectHandler +{ + const TABLE = 'cache_model'; + const CLASSNAME = 'signedCacheModelObject'; + const KEYNAME = 'key'; +} + +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/class/cache/model.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/class/cache/signedcache.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/class/cache/signedcache.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/class/cache/signedcache.php 2014-12-08 20:57:03 UTC (rev 12893) @@ -0,0 +1,495 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage cache + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + +defined('_PATH_ROOT') or die('Restricted access'); + +/** + * Caching for CakePHP. + * + * @package cake + * @subpackage cake.cake.libs + */ +class signedCache +{ + /** + * Cache engine to use + * + * @var object + * @access protected + */ + var $engine = null; + // static $engine = null; + + + /** + * Cache configuration stack + * + * @var array + * @access private + */ + var $configs = array(); + + /** + * Holds name of the current configuration being used + * + * @var array + * @access private + */ + var $name = null; + + /** + * signedCache::__construct() + */ + function __construct() + { + } + + /** + * Returns a singleton instance + * + * @return object + * @access public + */ + static function &getInstance() + { + static $instance; + if (!isset($instance)) { + $class = __CLASS__; + $instance = new $class(); + } + return $instance; + } + + /** + * Tries to find and include a file for a cache engine and returns object instance + * + * @param $name Name of the engine + * @return mixed $engine object or null + * @access private + */ + function loadEngine($name) + { + if (!class_exists('signedCache' . ucfirst($name))) { + if (file_exists($file = dirname(__FILE__) . '/' . strtolower($name) . '.php')) { + include $file; + } else { + trigger_error('File :' . $file . ' not found in file : ' . __FILE__ . ' at line: ' . __LINE__, E_USER_WARNING); + return false; + } + } + return true; + } + + /** + * Set the cache configuration to use + * + * @param string $name Name of the configuration + * @param array $settings Optional associative array of settings passed to the engine + * @return array (engine, settings) on success, false on failure + * @access public + */ + function config($name = 'default', $settings = array()) + { + $_this =& signedCache::getInstance(); + if (is_array($name)) { + extract($name); + } + + if (isset($_this->configs[$name])) { + $settings = array_merge($_this->configs[$name], $settings); + } else if (!empty($settings)) { + $_this->configs[$name] = $settings; + } else if ($_this->configs !== null && isset($_this->configs[$_this->name])) { + $name = $_this->name; + $settings = $_this->configs[$_this->name]; + } else { + $name = 'default'; + if (!empty($_this->configs['default'])) { + $settings = $_this->configs['default']; + } else { + $settings = array( + 'engine' => 'file'); + } + } + $engine = 'file'; + if (!empty($settings['engine'])) { + $engine = $settings['engine']; + } + + if ($name !== $_this->name) { + if ($_this->engine($engine, $settings) === false) { + trigger_error("Cache Engine {$engine} is not set", E_USER_WARNING); + return false; + } + $_this->name = $name; + $_this->configs[$name] = $_this->settings($engine); + } + + $settings = $_this->configs[$name]; + return compact('engine', 'settings'); + } + + /**... [truncated message content] |
From: <wis...@us...> - 2014-12-08 20:53:53
|
Revision: 12892 http://sourceforge.net/p/xoops/svn/12892 Author: wishcraft Date: 2014-12-08 20:53:40 +0000 (Mon, 08 Dec 2014) Log Message: ----------- Fixing Trunk Added Paths: ----------- XoopsModules/signed/trunk/modules/signed/api/ XoopsModules/signed/trunk/modules/signed/api/banned/ XoopsModules/signed/trunk/modules/signed/api/banned/.htaccess XoopsModules/signed/trunk/modules/signed/api/banned/index.php XoopsModules/signed/trunk/modules/signed/api/classes/ XoopsModules/signed/trunk/modules/signed/api/classes/.htaccess XoopsModules/signed/trunk/modules/signed/api/classes/index.php XoopsModules/signed/trunk/modules/signed/api/descriptions/ XoopsModules/signed/trunk/modules/signed/api/descriptions/.htaccess XoopsModules/signed/trunk/modules/signed/api/descriptions/index.php XoopsModules/signed/trunk/modules/signed/api/enumerators/ XoopsModules/signed/trunk/modules/signed/api/enumerators/.htaccess XoopsModules/signed/trunk/modules/signed/api/enumerators/index.php XoopsModules/signed/trunk/modules/signed/api/fields/ XoopsModules/signed/trunk/modules/signed/api/fields/.htaccess XoopsModules/signed/trunk/modules/signed/api/fields/index.php XoopsModules/signed/trunk/modules/signed/api/fieldtypes/ XoopsModules/signed/trunk/modules/signed/api/fieldtypes/.htaccess XoopsModules/signed/trunk/modules/signed/api/fieldtypes/index.php XoopsModules/signed/trunk/modules/signed/api/identifications/ XoopsModules/signed/trunk/modules/signed/api/identifications/.htaccess XoopsModules/signed/trunk/modules/signed/api/identifications/index.php XoopsModules/signed/trunk/modules/signed/api/index.php XoopsModules/signed/trunk/modules/signed/api/language/ XoopsModules/signed/trunk/modules/signed/api/language/.htaccess XoopsModules/signed/trunk/modules/signed/api/language/index.php XoopsModules/signed/trunk/modules/signed/api/languages/ XoopsModules/signed/trunk/modules/signed/api/languages/.htaccess XoopsModules/signed/trunk/modules/signed/api/languages/index.php XoopsModules/signed/trunk/modules/signed/api/processes/ XoopsModules/signed/trunk/modules/signed/api/processes/.htaccess XoopsModules/signed/trunk/modules/signed/api/processes/index.php XoopsModules/signed/trunk/modules/signed/api/prompts/ XoopsModules/signed/trunk/modules/signed/api/prompts/.htaccess XoopsModules/signed/trunk/modules/signed/api/prompts/index.php XoopsModules/signed/trunk/modules/signed/api/providers/ XoopsModules/signed/trunk/modules/signed/api/providers/.htaccess XoopsModules/signed/trunk/modules/signed/api/providers/index.php XoopsModules/signed/trunk/modules/signed/api/request/ XoopsModules/signed/trunk/modules/signed/api/request/.htaccess XoopsModules/signed/trunk/modules/signed/api/request/index.php XoopsModules/signed/trunk/modules/signed/api/sign/ XoopsModules/signed/trunk/modules/signed/api/sign/.htaccess XoopsModules/signed/trunk/modules/signed/api/sign/index.php XoopsModules/signed/trunk/modules/signed/api/signatures/ XoopsModules/signed/trunk/modules/signed/api/signatures/.htaccess XoopsModules/signed/trunk/modules/signed/api/signatures/index.php XoopsModules/signed/trunk/modules/signed/api/sites/ XoopsModules/signed/trunk/modules/signed/api/sites/.htaccess XoopsModules/signed/trunk/modules/signed/api/sites/index.php XoopsModules/signed/trunk/modules/signed/api/states/ XoopsModules/signed/trunk/modules/signed/api/states/.htaccess XoopsModules/signed/trunk/modules/signed/api/states/index.php XoopsModules/signed/trunk/modules/signed/api/validate.php XoopsModules/signed/trunk/modules/signed/api/validations/ XoopsModules/signed/trunk/modules/signed/api/validations/.htaccess XoopsModules/signed/trunk/modules/signed/api/validations/index.php XoopsModules/signed/trunk/modules/signed/api/verification/ XoopsModules/signed/trunk/modules/signed/api/verification/.htaccess XoopsModules/signed/trunk/modules/signed/api/verification/index.php XoopsModules/signed/trunk/modules/signed/api/verify/ XoopsModules/signed/trunk/modules/signed/api/verify/.htaccess XoopsModules/signed/trunk/modules/signed/api/verify/index.php Added: XoopsModules/signed/trunk/modules/signed/api/banned/.htaccess =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/banned/.htaccess (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/banned/.htaccess 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,6 @@ +<IfModule mod_rewrite.c> + + RewriteEngine On + RewriteRule ^$ index.php + +</IfModule> Property changes on: XoopsModules/signed/trunk/modules/signed/api/banned/.htaccess ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/banned/index.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/banned/index.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/banned/index.php 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,44 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage api + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + // Enables API Runtime Constant + define('_SIGNED_EVENT_SYSTEM', 'api'); + define('_SIGNED_EVENT_TYPE', basename(dirname(__FILE__))); + + define('_SIGNED_API_FUNCTION', basename(dirname(__FILE__))); + + require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'common.php'; + require dirname(dirname(__FILE__)) . _DS_ . 'validate.php'; + + // Checks if API Function is Enabled + if (!in_array(basename(dirname(__FILE__)), $GLOBALS['api']->callKeys())) { + header("Location: " . _URL_ROOT); + exit(0); + } + + if (function_exists('http_response_code')) + http_response_code(200); + echo $GLOBALS['api']->format(array('success'=> true, 'banned' => array('hostname' => signedSecurity::getInstance()->getBannedHostnames(), 'ip' => signedSecurity::getInstance()->getBannedIP()), 'when' => time())); + @$GLOBALS['logger']->logPolling('default', basename(dirname(__FILE__)), array('server' => $_SERVER, 'request' => $_REQUEST)); + exit(0); + +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/api/banned/index.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/classes/.htaccess =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/classes/.htaccess (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/classes/.htaccess 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,6 @@ +<IfModule mod_rewrite.c> + + RewriteEngine On + RewriteRule ^$ index.php + +</IfModule> Property changes on: XoopsModules/signed/trunk/modules/signed/api/classes/.htaccess ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/classes/index.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/classes/index.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/classes/index.php 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,50 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage api + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + // Enables API Runtime Constant + define('_SIGNED_EVENT_SYSTEM', 'api'); + define('_SIGNED_EVENT_TYPE', basename(dirname(__FILE__))); + define('_SIGNED_API_FUNCTION', basename(dirname(__FILE__))); + + require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'common.php'; + require dirname(dirname(__FILE__)) . _DS_ . 'validate.php'; + + // Checks if API Function is Enabled + if (!in_array(basename(dirname(__FILE__)), $GLOBALS['api']->callKeys())) { + header("Location: " . _URL_ROOT); + exit(0); + } + + if (isset($_GET['language'])&&!empty($_GET['language'])) { + if (function_exists('http_response_code')) + http_response_code(200); + echo $GLOBALS['api']->format(array('success'=> true, 'classes' => signedProcesses::getInstance()->getClassArray(), 'when' => time())); + @$GLOBALS['logger']->logPolling('default', basename(dirname(__FILE__)), array('server' => $_SERVER, 'request' => $_REQUEST)); + exit(0); + + } else { + if (function_exists('http_response_code')) + http_response_code(400); + echo $GLOBALS['api']->format(array('success'=> false, 'error'=> 'The corresponding field(s): '.implode(', ', array('language')) . ' ~ was not specified!', 'error-code' => '135')); + exit(0); + } +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/api/classes/index.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/descriptions/.htaccess =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/descriptions/.htaccess (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/descriptions/.htaccess 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,6 @@ +<IfModule mod_rewrite.c> + + RewriteEngine On + RewriteRule ^$ index.php + +</IfModule> Property changes on: XoopsModules/signed/trunk/modules/signed/api/descriptions/.htaccess ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/descriptions/index.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/descriptions/index.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/descriptions/index.php 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,50 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage api + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + // Enables API Runtime Constant + define('_SIGNED_EVENT_SYSTEM', 'api'); + define('_SIGNED_EVENT_TYPE', basename(dirname(__FILE__))); + define('_SIGNED_API_FUNCTION', basename(dirname(__FILE__))); + + require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'common.php'; + require dirname(dirname(__FILE__)) . _DS_ . 'validate.php'; + + // Checks if API Function is Enabled + if (!in_array(basename(dirname(__FILE__)), $GLOBALS['api']->callKeys())) { + header("Location: " . _URL_ROOT); + exit(0); + } + + if (isset($_GET['language'])&&!empty($_GET['language'])) { + if (function_exists('http_response_code')) + http_response_code(200); + echo $GLOBALS['api']->format(array('success'=> true, 'descriptions' => signedProcesses::getInstance()->getFieldDescriptions(), 'when' => time())); + @$GLOBALS['logger']->logPolling('default', basename(dirname(__FILE__)), array('server' => $_SERVER, 'request' => $_REQUEST)); + exit(0); + + } else { + if (function_exists('http_response_code')) + http_response_code(400); + echo $GLOBALS['api']->format(array('success'=> false, 'error'=> 'The corresponding field(s): '.implode(', ', array('language')) . ' ~ was not specified!', 'error-code' => '135')); + exit(0); + } +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/api/descriptions/index.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/enumerators/.htaccess =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/enumerators/.htaccess (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/enumerators/.htaccess 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,6 @@ +<IfModule mod_rewrite.c> + + RewriteEngine On + RewriteRule ^$ index.php + +</IfModule> Property changes on: XoopsModules/signed/trunk/modules/signed/api/enumerators/.htaccess ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/enumerators/index.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/enumerators/index.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/enumerators/index.php 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,49 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage api + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + // Enables API Runtime Constant + define('_SIGNED_API_FUNCTION', basename(dirname(__FILE__))); + define('_SIGNED_EVENT_SYSTEM', 'api'); + define('_SIGNED_EVENT_TYPE', basename(dirname(__FILE__))); + require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'common.php'; + require dirname(dirname(__FILE__)) . _DS_ . 'validate.php'; + + // Checks if API Function is Enabled + if (!in_array(basename(dirname(__FILE__)), $GLOBALS['api']->callKeys())) { + header("Location: " . _URL_ROOT); + exit(0); + } + + if (isset($_GET['language'])&&!empty($_GET['language'])) { + if (function_exists('http_response_code')) + http_response_code(200); + echo $GLOBALS['api']->format(array('success'=> true, 'enumerators' => signedProcesses::getInstance()->getEnumeratorsArray(), 'when' => time())); + @$GLOBALS['logger']->logPolling('default', basename(dirname(__FILE__)), array('server' => $_SERVER, 'request' => $_REQUEST)); + exit(0); + + } else { + if (function_exists('http_response_code')) + http_response_code(400); + echo $GLOBALS['api']->format(array('success'=> false, 'error'=> 'The corresponding field(s): '.implode(', ', array('language')) . ' ~ was not specified!', 'error-code' => '135')); + exit(0); + } +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/api/enumerators/index.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/fields/.htaccess =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/fields/.htaccess (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/fields/.htaccess 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,6 @@ +<IfModule mod_rewrite.c> + + RewriteEngine On + RewriteRule ^$ index.php + +</IfModule> Property changes on: XoopsModules/signed/trunk/modules/signed/api/fields/.htaccess ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/fields/index.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/fields/index.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/fields/index.php 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,49 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage api + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + // Enables API Runtime Constant + define('_SIGNED_API_FUNCTION', basename(dirname(__FILE__))); + define('_SIGNED_EVENT_SYSTEM', 'api'); + define('_SIGNED_EVENT_TYPE', basename(dirname(__FILE__))); + require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'common.php'; + require dirname(dirname(__FILE__)) . _DS_ . 'validate.php'; + + // Checks if API Function is Enabled + if (!in_array(basename(dirname(__FILE__)), $GLOBALS['api']->callKeys())) { + header("Location: " . _URL_ROOT); + exit(0); + } + + if (isset($_GET['language'])&&!empty($_GET['language'])) { + if (function_exists('http_response_code')) + http_response_code(200); + echo $GLOBALS['api']->format(array('success'=> true, 'fields' => signedProcesses::getInstance()->getFieldsArray(), 'when' => time())); + @$GLOBALS['logger']->logPolling('default', basename(dirname(__FILE__)), array('server' => $_SERVER, 'request' => $_REQUEST)); + exit(0); + + } else { + if (function_exists('http_response_code')) + http_response_code(400); + echo $GLOBALS['api']->format(array('success'=> false, 'error'=> 'The corresponding field(s): '.implode(', ', array('language')) . ' ~ was not specified!', 'error-code' => '135')); + exit(0); + } +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/api/fields/index.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/fieldtypes/.htaccess =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/fieldtypes/.htaccess (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/fieldtypes/.htaccess 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,6 @@ +<IfModule mod_rewrite.c> + + RewriteEngine On + RewriteRule ^$ index.php + +</IfModule> Property changes on: XoopsModules/signed/trunk/modules/signed/api/fieldtypes/.htaccess ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/fieldtypes/index.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/fieldtypes/index.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/fieldtypes/index.php 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,49 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage api + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + // Enables API Runtime Constant + define('_SIGNED_API_FUNCTION', basename(dirname(__FILE__))); + define('_SIGNED_EVENT_SYSTEM', 'api'); + define('_SIGNED_EVENT_TYPE', basename(dirname(__FILE__))); + require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'common.php'; + require dirname(dirname(__FILE__)) . _DS_ . 'validate.php'; + + // Checks if API Function is Enabled + if (!in_array(basename(dirname(__FILE__)), $GLOBALS['api']->callKeys())) { + header("Location: " . _URL_ROOT); + exit(0); + } + + if (isset($_GET['language'])&&!empty($_GET['language'])) { + if (function_exists('http_response_code')) + http_response_code(200); + echo $GLOBALS['api']->format(array('success'=> true, 'fieldtypes' => signedProcesses::getInstance()->getFieldnamesArray(), 'when' => time())); + @$GLOBALS['logger']->logPolling('default', basename(dirname(__FILE__)), array('server' => $_SERVER, 'request' => $_REQUEST)); + exit(0); + + } else { + if (function_exists('http_response_code')) + http_response_code(400); + echo $GLOBALS['api']->format(array('success'=> false, 'error'=> 'The corresponding field(s): '.implode(', ', array('language')) . ' ~ was not specified!', 'error-code' => '135')); + exit(0); + } +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/api/fieldtypes/index.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/identifications/.htaccess =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/identifications/.htaccess (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/identifications/.htaccess 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,6 @@ +<IfModule mod_rewrite.c> + + RewriteEngine On + RewriteRule ^$ index.php + +</IfModule> Property changes on: XoopsModules/signed/trunk/modules/signed/api/identifications/.htaccess ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/identifications/index.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/identifications/index.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/identifications/index.php 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,49 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage api + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + // Enables API Runtime Constant + define('_SIGNED_API_FUNCTION', basename(dirname(__FILE__))); + define('_SIGNED_EVENT_SYSTEM', 'api'); + define('_SIGNED_EVENT_TYPE', basename(dirname(__FILE__))); + require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'common.php'; + require dirname(dirname(__FILE__)) . _DS_ . 'validate.php'; + + // Checks if API Function is Enabled + if (!in_array(basename(dirname(__FILE__)), $GLOBALS['api']->callKeys())) { + header("Location: " . _URL_ROOT); + exit(0); + } + + if (isset($_GET['language'])&&!empty($_GET['language'])) { + if (function_exists('http_response_code')) + http_response_code(200); + echo $GLOBALS['api']->format(array('success'=> true, 'identifications' => signedProcesses::getInstance()->getIdentificationsArray(), 'when' => time())); + @$GLOBALS['logger']->logPolling('default', basename(dirname(__FILE__)), array('server' => $_SERVER, 'request' => $_REQUEST)); + exit(0); + + } else { + if (function_exists('http_response_code')) + http_response_code(400); + echo $GLOBALS['api']->format(array('success'=> false, 'error'=> 'The corresponding field(s): '.implode(', ', array('language')) . ' ~ was not specified!', 'error-code' => '135')); + exit(0); + } +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/api/identifications/index.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/index.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/index.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/index.php 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,29 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage api + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + +define('_SIGNED_EVENT_SYSTEM', 'api'); +define('_SIGNED_EVENT_TYPE', 'help'); +require dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'header.php'; +require dirname(__FILE__) . _DS_ . 'validate.php'; +require _PATH_TEMPLATES . _DS_ . 'common' . _DS_ . 'api.php'; +require dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'footer.php'; +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/api/index.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/language/.htaccess =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/language/.htaccess (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/language/.htaccess 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,6 @@ +<IfModule mod_rewrite.c> + + RewriteEngine On + RewriteRule ^$ index.php + +</IfModule> Property changes on: XoopsModules/signed/trunk/modules/signed/api/language/.htaccess ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/language/index.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/language/index.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/language/index.php 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,41 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage api + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + // Enables API Runtime Constant + define('_SIGNED_API_FUNCTION', basename(dirname(__FILE__))); + define('_SIGNED_EVENT_SYSTEM', 'api'); + define('_SIGNED_EVENT_TYPE', basename(dirname(__FILE__))); + require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'common.php'; + require dirname(dirname(__FILE__)) . _DS_ . 'validate.php'; + + // Checks if API Function is Enabled + if (!in_array(basename(dirname(__FILE__)), $GLOBALS['api']->callKeys())) { + header("Location: " . _URL_ROOT); + exit(0); + } + + if (function_exists('http_response_code')) + http_response_code(200); + echo $GLOBALS['api']->format(array('success'=> true, 'constants' => signedProcesses::getInstance()->getLanguageArray(), 'when' => time())); + @$GLOBALS['logger']->logPolling('default', basename(dirname(__FILE__)), array('server' => $_SERVER, 'request' => $_REQUEST)); + exit(0); +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/api/language/index.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/languages/.htaccess =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/languages/.htaccess (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/languages/.htaccess 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,6 @@ +<IfModule mod_rewrite.c> + + RewriteEngine On + RewriteRule ^$ index.php + +</IfModule> Property changes on: XoopsModules/signed/trunk/modules/signed/api/languages/.htaccess ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/languages/index.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/languages/index.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/languages/index.php 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,41 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage api + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + // Enables API Runtime Constant + define('_SIGNED_API_FUNCTION', basename(dirname(__FILE__))); + define('_SIGNED_EVENT_SYSTEM', 'api'); + define('_SIGNED_EVENT_TYPE', basename(dirname(__FILE__))); + require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'common.php'; + require dirname(dirname(__FILE__)) . _DS_ . 'validate.php'; + + // Checks if API Function is Enabled + if (!in_array(basename(dirname(__FILE__)), $GLOBALS['api']->callKeys())) { + header("Location: " . _URL_ROOT); + exit(0); + } + + if (function_exists('http_response_code')) + http_response_code(200); + echo $GLOBALS['api']->format(array('success'=> true, 'languages' => signedProcesses::getInstance()->getLanguages(), 'when' => time())); + @$GLOBALS['logger']->logPolling('default', basename(dirname(__FILE__)), array('server' => $_SERVER, 'request' => $_REQUEST)); + exit(0); +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/api/languages/index.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/processes/.htaccess =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/processes/.htaccess (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/processes/.htaccess 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,6 @@ +<IfModule mod_rewrite.c> + + RewriteEngine On + RewriteRule ^$ index.php + +</IfModule> Property changes on: XoopsModules/signed/trunk/modules/signed/api/processes/.htaccess ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/processes/index.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/processes/index.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/processes/index.php 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,49 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage api + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + // Enables API Runtime Constant + define('_SIGNED_API_FUNCTION', basename(dirname(__FILE__))); + define('_SIGNED_EVENT_SYSTEM', 'api'); + define('_SIGNED_EVENT_TYPE', basename(dirname(__FILE__))); + require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'common.php'; + require dirname(dirname(__FILE__)) . _DS_ . 'validate.php'; + + // Checks if API Function is Enabled + if (!in_array(basename(dirname(__FILE__)), $GLOBALS['api']->callKeys())) { + header("Location: " . _URL_ROOT); + exit(0); + } + + if (isset($_GET['language'])&&!empty($_GET['language'])) { + if (function_exists('http_response_code')) + http_response_code(200); + echo $GLOBALS['api']->format(array('success'=> true, 'processes' => signedProcesses::getInstance()->getProcessesArray(), 'when' => time())); + @$GLOBALS['logger']->logPolling('default', basename(dirname(__FILE__)), array('server' => $_SERVER, 'request' => $_REQUEST)); + exit(0); + + } else { + if (function_exists('http_response_code')) + http_response_code(400); + echo $GLOBALS['api']->format(array('success'=> false, 'error'=> 'The corresponding field(s): '.implode(', ', array('language')) . ' ~ was not specified!', 'error-code' => '135')); + exit(0); + } +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/api/processes/index.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/prompts/.htaccess =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/prompts/.htaccess (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/prompts/.htaccess 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,6 @@ +<IfModule mod_rewrite.c> + + RewriteEngine On + RewriteRule ^$ index.php + +</IfModule> Property changes on: XoopsModules/signed/trunk/modules/signed/api/prompts/.htaccess ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/prompts/index.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/prompts/index.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/prompts/index.php 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,49 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage api + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + // Enables API Runtime Constant + define('_SIGNED_API_FUNCTION', basename(dirname(__FILE__))); + define('_SIGNED_EVENT_SYSTEM', 'api'); + define('_SIGNED_EVENT_TYPE', basename(dirname(__FILE__))); + require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'common.php'; + require dirname(dirname(__FILE__)) . _DS_ . 'validate.php'; + + // Checks if API Function is Enabled + if (!in_array(basename(dirname(__FILE__)), $GLOBALS['api']->callKeys())) { + header("Location: " . _URL_ROOT); + exit(0); + } + + if (isset($_GET['language'])&&!empty($_GET['language'])) { + if (function_exists('http_response_code')) + http_response_code(200); + echo $GLOBALS['api']->format(array('success'=> true, 'prompts' => signedProcesses::getInstance()->getPromptsArray(), 'when' => time())); + @$GLOBALS['logger']->logPolling('default', basename(dirname(__FILE__)), array('server' => $_SERVER, 'request' => $_REQUEST)); + exit(0); + + } else { + if (function_exists('http_response_code')) + http_response_code(400); + echo $GLOBALS['api']->format(array('success'=> false, 'error'=> 'The corresponding field(s): '.implode(', ', array('language')) . ' ~ was not specified!', 'error-code' => '135')); + exit(0); + } +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/api/prompts/index.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/providers/.htaccess =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/providers/.htaccess (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/providers/.htaccess 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,6 @@ +<IfModule mod_rewrite.c> + + RewriteEngine On + RewriteRule ^$ index.php + +</IfModule> Property changes on: XoopsModules/signed/trunk/modules/signed/api/providers/.htaccess ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/providers/index.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/providers/index.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/providers/index.php 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,49 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage api + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + // Enables API Runtime Constant + define('_SIGNED_API_FUNCTION', basename(dirname(__FILE__))); + define('_SIGNED_EVENT_SYSTEM', 'api'); + define('_SIGNED_EVENT_TYPE', basename(dirname(__FILE__))); + require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'common.php'; + require dirname(dirname(__FILE__)) . _DS_ . 'validate.php'; + + // Checks if API Function is Enabled + if (!in_array(basename(dirname(__FILE__)), $GLOBALS['api']->callKeys())) { + header("Location: " . _URL_ROOT); + exit(0); + } + + if (isset($_GET['language'])&&!empty($_GET['language'])) { + if (function_exists('http_response_code')) + http_response_code(200); + echo $GLOBALS['api']->format(array('success'=> true, 'providers' => signedProcesses::getInstance()->getProvidedArray(), 'when' => time())); + @$GLOBALS['logger']->logPolling('default', basename(dirname(__FILE__)), array('server' => $_SERVER, 'request' => $_REQUEST)); + exit(0); + + } else { + if (function_exists('http_response_code')) + http_response_code(400); + echo $GLOBALS['api']->format(array('success'=> false, 'error'=> 'The corresponding field(s): '.implode(', ', array('language')) . ' ~ was not specified!', 'error-code' => '135')); + exit(0); + } +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/api/providers/index.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/request/.htaccess =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/request/.htaccess (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/request/.htaccess 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,6 @@ +<IfModule mod_rewrite.c> + + RewriteEngine On + RewriteRule ^$ index.php + +</IfModule> Property changes on: XoopsModules/signed/trunk/modules/signed/api/request/.htaccess ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/api/request/index.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/api/request/index.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/api/request/index.php 2014-12-08 20:53:40 UTC (rev 12892) @@ -0,0 +1,181 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage api + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + // Enables API Runtime Constant + define('_SIGNED_API_FUNCTION', basename(dirname(__FILE__))); + define('_SIGNED_EVENT_SYSTEM', 'api'); + define('_SIGNED_EVENT_TYPE', basename(dirname(__FILE__))); + + require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'common.php'; + require dirname(dirname(__FILE__)) . _DS_ . 'validate.php'; + + // Checks if API Function is Enabled + if (!in_array(basename(dirname(__FILE__)), $GLOBALS['api']->callKeys())) { + header("Location: " . _URL_ROOT); + exit(0); + } + + foreach($_REQUEST as $field => $value) { + if (!empty($value)||strlen(trim($value))!=0) + $data[$field] = $value; + } + + $GLOBALS['io'] = signedStorage::getInstance(_SIGNED_RESOURCES_STORAGE); + + $states = signedProcesses::getInstance()->getRequestStatesArray(); + $fields = signedProcesses::getInstance()->getFieldsArray(); + $identifications = signedProcesses::getInstance()->getIdentificationsArray(); + $signatures = signedProcesses::getInstance()->getSignatures(); + + if (signedAPI::getInstance()->verifyAPIFields(basename(dirname(__FILE__)), $data)==true) { + $servicekey = signedSecurity::getInstance()->extractServiceKey($data['code'], $data['certificate'], $data['verification-key']); + if (signedSecurity::getInstance()->getHostCode()==$servicekey) { + if ($signature = signedCiphers::getInstance()->getSignature($data['serial-number'], $data['code'], $data['certificate'], $data['any-name'], $data['any-email'], $data['any-date'], true)) { + $request = $GLOBALS['io']->load(_PATH_PATHWAYS_REQUEST, $signature['serial-number']); + $type = $signature['signature']['type']; + if ($request['sent']!=0 || $request['sent']<time()) { + if (function_exists('http_response_code')) + http_response_code(400); + echo $GLOBALS['api']->format(array('success'=> false, 'error'=> 'The corresponding request has been sent to the client, this means until it is resolved you will be not be able to request anymore changes to their signature!', 'error-code' => '302')); + exit(0); + } + if (!in_array($data['type-key'], $types = array_merge(array_key($identifications[$type]), array_key($signatures)))) { + if (function_exists('http_response_code')) + http_response_code(400); + echo $GLOBALS['api']->format(array('success'=> false, 'error'=> 'The corresponding \'type-key\' is not found ~ the only available options for this signature are: '.implode(', ', $types) . '!', 'error-code' => '303')); + exit(0); + } + if (!in_array($data['request-code'], array_key($states))) { + if (function_exists('http_response_code')) + http_response_code(400); + echo $GLOBALS['api']->format(array('success'=> false, 'error'=> 'The corresponding \'request-code\' is not found ~ the only available options for this signature are: '.implode(', ', array_key($states)) . '!', 'error-code' => '304')); + exit(0); + } + if (in_array($data['type-key'], array_key($identifications[$type]))) + { + $clause = 'identification'; + } else { + $clause = $data['type-key']; + } + foreach($data['fields'] as $key => $field) { + if (!in_array($field, array_key($fields[$clause]))) { + unset($data['fields'][$key]); + } + } + foreach($data['fields'] as $key => $field) { + if (in_array($data['type-key'], array_key($identifications[$type]))) + { + $request['request'][$type][$clause][$data['type-key']][$field] = $data['request-code']; + } else { + $request['request'][$type][$clause][$field] = $data['request-code']; + } + } + if (in_array($data['type-key'], array_key($identifications[$type]))) + { + $request['fields'][$data['type-key']] = array_keys($request['request'][$type][$clause][$data['type-key']][$field]); + } else { + $request['fields'][$clause] = array_keys($request['request'][$type][$clause][$field]); + } + if (isset($data['callback-url'])) { + $request['callback']['action'] = true; + $request['callback'][md5($data['callback-url'])]['url'] = $data['callback-url']; + $request['callback'][md5($data['callback-url'])]['fields']['signature-package'] = $data['signature-package-field']; + $request['callback'][md5($data['callback-url'])]['fields']['request-rejected'] = $data['request-rejected-field']; + $request['callback'][md5($data['callback-url'])]['fields']['signature-updated'] = $data['signature-updated-field']; + } else { + if (!isset($request['callback']['action'])) + $request['callback']['action'] = false; + } + + $uniqueid = (isset($data['polling-unique-id'])&&!empty($data['polling-unique-id'])?$data['polling-unique-id']:'TM-'.time()) . "--" . (count(array_keys($request['client'])) + 1); + if (in_array($uniqueid, array_keys($request['client']))) + $uniqueid .= ':--' . str_replace('.', '-', microtime(true)); + if (isset($data['client-name'])) + $request['calling'][$uniqueid]['client']['name'] = $data['client-name']; + if (isset($data['client-uname'])) + $request['calling'][$uniqueid]['client']['uname'] = $data['client-uname']; + if (isset($data['client-email'])) + $request['calling'][$uniqueid]['client']['email'] = $data['client-email']; + + if (isset($data['client-site-name'])) + $request['calling'][$uniqueid]['client']['sitename'] = $data['site-name']; + if (isset($data['client-site-uri'])) + $request['calling'][$uniqueid]['client']['uri'] = $data['site-uri']; + $request['calling'][$uniqueid]['client']['netbios'] = gethostbyaddr(signedSecurity::getInstance()->getIP(true)); + $request['calling'][$uniqueid]['client']['ip'] = json_decode(file_get_contents("http://lookups.labs.coop/v1/country/".signedSecurity::getInstance()->getIP(true)."/json.api"), true); + $request['calling'][$uniqueid]['instance'] = $_SESSION["signed"]['instance']['number']; + $request['calling-ids'] = array_keys($request['calling']); + + $GLOBALS['io']->save($request, _PATH_PATHWAYS_REQUEST, $signature['serial-number']); + + if (function_exists('http_response_code')) + http_response_code(200); + echo $GLOBALS['api']->format(array('success'=> true, 'queued-requests' => $request['request'], 'sending-request' => date('Y-m-d H:i:s', $request['reminder']), 'when' => time())); + @$GLOBALS['logger']->logPolling('default', basename(dirname(__FILE__)), array('server' => $_SERVER, 'request' => $_REQUEST)); + exit(0); + + } else { + if (function_exists('http_response_code')) + http_response_code(400); + echo $GLOBALS['api']->format(array('success'=> false, 'error'=> 'The corresponding field(s): '.implode(', ', array('serial-number', 'code', 'certificate')) . ' ~ did not correspond with the same signature or was wrong!', 'error-code' => '104')); + exit(0); + } + } else { + foreach(signedProcesses::getInstance()->getSites() as $key => $srv) { + if ($srv['code'] == $servicekey) { + $service = $srv; + continue; + } + } + + if (isset($service)) { + if (!$ch = curl_init($url = $service['protocol'] . '://' . $service['api-uri'] . '/' . basename(dirname(__FILE__)) . '/')) { + trigger_error('Could not intialise CURL file: '.$url); + return false; + } + $cookies = _PATH_CACHE.'/api-'.md5($url).'.cookie'; + + curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 190); + curl_setopt($ch, CURLOPT_TIMEOUT, 190); + curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); + $data = curl_exec($ch); + $info = curl_getinfo($ch); + curl_close($ch); + if (function_exists('http_response_code')) + http_response_code($info['http_code']); + echo $data; + exit(0); + } else { + if (function_exists('http_response_code')) + http_response_code(400); + echo $GLOBALS['api']->format(array('success'=> false, 'error'=> 'Service Key:~ '.$servicekey.' is unknown and not a trusted ensignator!', 'error-code' => '115')); + exit(0); + } + } + } +?> \ No newline at end of file Property changes on: XoopsModules/signed/tr... [truncated message content] |
From: <wis...@us...> - 2014-12-08 20:52:00
|
Revision: 12891 http://sourceforge.net/p/xoops/svn/12891 Author: wishcraft Date: 2014-12-08 20:51:51 +0000 (Mon, 08 Dec 2014) Log Message: ----------- Fixing Trunk Added Paths: ----------- XoopsModules/signed/trunk/modules/signed/admin/ XoopsModules/signed/trunk/modules/signed/admin/about.php XoopsModules/signed/trunk/modules/signed/admin/admin.php XoopsModules/signed/trunk/modules/signed/admin/admin_footer.php XoopsModules/signed/trunk/modules/signed/admin/admin_header.php XoopsModules/signed/trunk/modules/signed/admin/events.php XoopsModules/signed/trunk/modules/signed/admin/index.html XoopsModules/signed/trunk/modules/signed/admin/menu.php XoopsModules/signed/trunk/modules/signed/admin/signatures.php Added: XoopsModules/signed/trunk/modules/signed/admin/about.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/admin/about.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/admin/about.php 2014-12-08 20:51:51 UTC (rev 12891) @@ -0,0 +1,34 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage administration + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + include_once dirname(__FILE__) . '/../../../include/cp_header.php'; + include '../../../class/xoopsformloader.php'; + include_once dirname(__FILE__) . '/admin_header.php'; + xoops_cp_header(); + + $aboutAdmin = new ModuleAdmin(); + + echo $aboutAdmin->addNavigation('about.php'); + echo $aboutAdmin->renderabout('-------------', false); + + include_once dirname(__FILE__) . '/admin_footer.php'; +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/admin/about.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/admin/admin.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/admin/admin.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/admin/admin.php 2014-12-08 20:51:51 UTC (rev 12891) @@ -0,0 +1,77 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage administration + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + include_once dirname(__FILE__) . '/admin_header.php'; + xoops_cp_header(); + + $indexAdmin = new ModuleAdmin(); + + echo $indexAdmin->addNavigation('admin.php'); + $signaturesHandler = xoops_getmodulehandler('signatures', 'signed'); + + $indexAdmin->addInfoBox(_SIGNED_AM_DASHBOARD); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_TOTAL. "</infolabel>", $signaturesHandler->getCount(new Criteria('1', '1')), 'Green'); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_PROGRESS. "</infolabel>", $signaturesHandler->getCount(new Criteria('state', 'progress')), 'Purple'); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_ACTIVE. "</infolabel>", $signaturesHandler->getCount(new Criteria('state', 'active')), 'Blue'); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_INACTIVE. "</infolabel>", $signaturesHandler->getCount(new Criteria('state', 'inactive'))."</infotext>", 'Orange'); + $criteria = new CriteriaCompo(new Criteria('state', 'active')); + $criteria->add(new Criteria('expires', time(), '>=')); + $criteria->add(new Criteria('expires', time() + (3600 * 24 * 7), '<=')); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_EXPIRE_NEXT_WEEK. "</infolabel>", $signaturesHandler->getCount($criteria), 'Red'); + $criteria = new CriteriaCompo(new Criteria('state', 'active')); + $criteria->add(new Criteria('expires', time(), '>=')); + $criteria->add(new Criteria('expires', time() + (3600 * 24 * 14), '<=')); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_EXPIRE_NEXT_FORTNIGHT. "</infolabel>", $signaturesHandler->getCount($criteria), 'Red'); + $criteria = new CriteriaCompo(new Criteria('1', '1')); + $criteria->add(new Criteria('expires', 0, '>')); + $criteria->add(new Criteria('expires', time(), '<=')); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_EXPIRED. "</infolabel>", $signaturesHandler->getCount($criteria), 'Red'); + $criteria = new CriteriaCompo(new Criteria('1', '1')); + $criteria->add(new Criteria('issued', time(), '<=')); + $criteria->add(new Criteria('issued', time() - (3600 * 24 * 7), '>=')); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_ISSUED_LAST_WEEK. "</infolabel>", $signaturesHandler->getCount($criteria), 'Green'); + $criteria = new CriteriaCompo(new Criteria('1', '1')); + $criteria->add(new Criteria('saved', time(), '<=')); + $criteria->add(new Criteria('saved', time() - (3600 * 24 * 7), '>=')); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_CREATED_LAST_WEEK. "</infolabel>", $signaturesHandler->getCount($criteria), 'Cyan'); + $criteria = new CriteriaCompo(new Criteria('1', '1')); + $criteria->add(new Criteria('used', time(), '<=')); + $criteria->add(new Criteria('used', time() - (3600 * 24 * 7), '>=')); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_ACCESSED_LAST_WEEK. "</infolabel>", $signaturesHandler->getCount($criteria), 'Black'); + $criteria = new CriteriaCompo(new Criteria('1', '1')); + $criteria->add(new Criteria('issued', time(), '<=')); + $criteria->add(new Criteria('issued', time() - (3600 * 24 * 14), '>=')); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_ISSUED_LAST_FORTNIGHT. "</infolabel>", $signaturesHandler->getCount($criteria), 'Green'); + $criteria = new CriteriaCompo(new Criteria('1', '1')); + $criteria->add(new Criteria('saved', time(), '<=')); + $criteria->add(new Criteria('saved', time() - (3600 * 24 * 14), '>=')); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_CREATED_LAST_FORTNIGHT. "</infolabel>", $signaturesHandler->getCount($criteria), 'Cyan'); + $criteria = new CriteriaCompo(new Criteria('1', '1')); + $criteria->add(new Criteria('used', time(), '<=')); + $criteria->add(new Criteria('used', time() - (3600 * 24 * 14), '>=')); + $indexAdmin->addInfoBoxLine(_SIGNED_AM_DASHBOARD, "<infolabel>" ._SIGNED_AM_ACCESSED_LAST_FORTNIGHT. "</infolabel>", $signaturesHandler->getCount($criteria), 'Black'); + + echo $indexAdmin->renderIndex(); + + include_once dirname(__FILE__) . '/admin_footer.php'; + +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/admin/admin.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/admin/admin_footer.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/admin/admin_footer.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/admin/admin_footer.php 2014-12-08 20:51:51 UTC (rev 12891) @@ -0,0 +1,26 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage administration + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + echo "<div class='adminfooter'>\n" . _SIGNED_AM_ADMIN_FOOTER . "\n" ."</div>"; + + xoops_cp_footer(); +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/admin/admin_footer.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/admin/admin_header.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/admin/admin_header.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/admin/admin_header.php 2014-12-08 20:51:51 UTC (rev 12891) @@ -0,0 +1,65 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage administration + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + + $path = dirname(dirname(dirname(dirname(__FILE__)))); + include_once $path . '/mainfile.php'; + include_once $path . '/include/cp_functions.php'; + require_once $path . '/include/cp_header.php'; + + global $xoopsModule; + $thisModuleDir = $GLOBALS['xoopsModule']->getVar('dirname'); + + // Load language files + xoops_loadLanguage('admin', $thisModuleDir); + xoops_loadLanguage('modinfo', $thisModuleDir); + xoops_loadLanguage('main', $thisModuleDir); + + xoops_load('pagenav'); + + $pathIcon16 = '../'.$xoopsModule->getInfo('icons16'); + $pathIcon32 = '../'.$xoopsModule->getInfo('icons32'); + $pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin'); + + include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'); + + if ($xoopsUser) { + $moduleperm_handler =& xoops_gethandler('groupperm'); + if (!$moduleperm_handler->checkRight('module_admin', $xoopsModule->getVar('mid'), $xoopsUser->getGroups())) { + redirect_header(XOOPS_URL, 1, _NOPERM); + exit(); + } + } else { + redirect_header(XOOPS_URL . "/user.php", 1, _NOPERM); + exit(); + } + + if (!isset($xoopsTpl) || !is_object($xoopsTpl)) { + include_once(XOOPS_ROOT_PATH."/class/template.php"); + $xoopsTpl = new XoopsTpl(); + } + + if (!isset($GLOBALS['xoopsTpl']) || !is_object($GLOBALS['xoopsTpl'])) { + include_once XOOPS_ROOT_PATH . '/class/template.php'; + $GLOBALS['xoopsTpl'] = new XoopsTpl(); + } +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/admin/admin_header.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/admin/events.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/admin/events.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/admin/events.php 2014-12-08 20:51:51 UTC (rev 12891) @@ -0,0 +1,39 @@ +<?php +/** + * Private message + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package pm + * @since 2.3.0 + * @author Jan Pedersen + * @author Taiwen Jiang <ph...@us...> + * @version $Id: prune.php 12593 2014-06-14 16:04:02Z beckmi $ + */ + + include_once dirname(__FILE__) . '/admin_header.php'; + xoops_cp_header(); + + $indexAdmin = new ModuleAdmin(); + echo $indexAdmin->addNavigation('events.php'); + + $start = intval(isset($_REQUEST['start']) ? $_REQUEST['start'] : "0"); + $limit = intval(isset($_REQUEST['limit']) ? $_REQUEST['limit'] : "42"); + + $eventsHandler = xoops_getmodulehandler('events', 'signed'); + $pageNav = new XoopsPageNav($eventsHandler->getCount(new Criteria("1","1")), $limit, $start, 'start', 'limit='.$limit); + + $GLOBALS['xoopsTpl']->assign('pagenav', $pageNav->renderNav(5)); + $GLOBALS['xoopsTpl']->append('signatures', $eventsHandler->getAdminTabled($start, $limit)); + $GLOBALS['xoopsTpl']->display($GLOBALS['xoops']->path('/modules/signed/templates/admin/signed_events.html')); + + include_once dirname(__FILE__) . '/admin_footer.php'; + +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/admin/events.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/admin/index.html =================================================================== --- XoopsModules/signed/trunk/modules/signed/admin/index.html (rev 0) +++ XoopsModules/signed/trunk/modules/signed/admin/index.html 2014-12-08 20:51:51 UTC (rev 12891) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/admin/index.html ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/admin/menu.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/admin/menu.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/admin/menu.php 2014-12-08 20:51:51 UTC (rev 12891) @@ -0,0 +1,58 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage administration + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + $path = dirname(dirname(dirname(dirname(__FILE__)))); + include_once $path . '/mainfile.php'; + + $dirname = basename(dirname(dirname(__FILE__))); + $module_handler = xoops_gethandler('module'); + $module = $module_handler->getByDirname($dirname); + $pathIcon32 = $module->getInfo('icons32'); + $pathModuleAdmin = $module->getInfo('dirmoduleadmin'); + $pathLanguage = $path . $pathModuleAdmin; + + if (!file_exists($fileinc = $pathLanguage . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/' . 'main.php')) { + $fileinc = $pathLanguage . '/language/english/main.php'; + } + + include_once $fileinc; + + $adminmenu = array(); + + $i = 1; + $adminmenu[$i]['title'] = _SIGNED_MI_INDEX; + $adminmenu[$i]['link'] = "admin/admin.php"; + $adminmenu[$i]['icon'] = $pathIcon32.'/security.png' ; + ++$i; + $adminmenu[$i]['title'] = _SIGNED_MI_SIGNATURES; + $adminmenu[$i]['link'] = "admin/signatures.php"; + $adminmenu[$i]['icon'] = $pathIcon32.'/identity.png' ; + ++$i; + $adminmenu[$i]['title'] = _SIGNED_MI_EVENTS; + $adminmenu[$i]['link'] = "admin/events.php"; + $adminmenu[$i]['icon'] = $pathIcon32.'/event.png' ; + ++$i; + $adminmenu[$i]['title'] = _SIGNED_MI_ABOUT; + $adminmenu[$i]['link'] = 'admin/about.php'; + $adminmenu[$i]['icon'] = $pathIcon32.'/about.png'; + +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/admin/menu.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: XoopsModules/signed/trunk/modules/signed/admin/signatures.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/admin/signatures.php (rev 0) +++ XoopsModules/signed/trunk/modules/signed/admin/signatures.php 2014-12-08 20:51:51 UTC (rev 12891) @@ -0,0 +1,41 @@ +<?php +/** + * Chronolabs Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Cooperative http://labs.coop + * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) + * @package signed + * @since 1.13 + * @author Simon Roberts <wis...@us...> + * @author Antony Cipher <ci...@la...> + * @subpackage administration + * @description Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + * @link https://signed.labs.coop Digital Signature Generation & API Services (Psuedo-legal correct binding measure) + */ + + include_once dirname(__FILE__) . '/admin_header.php'; + xoops_cp_header(); + + $indexAdmin = new ModuleAdmin(); + echo $indexAdmin->addNavigation('signatures.php'); + + $start = intval(isset($_REQUEST['start']) ? $_REQUEST['start'] : "0"); + $limit = intval(isset($_REQUEST['limit']) ? $_REQUEST['limit'] : "42"); + + $signatureHandler = xoops_getmodulehandler('signatures', 'signed'); + $pageNav = new XoopsPageNav($signatureHandler->getCount(new Criteria("1","1")), $limit, $start, 'start', 'limit='.$limit); + + $GLOBALS['xoopsTpl']->assign('pagenav', $pageNav->renderNav(5)); + $GLOBALS['xoopsTpl']->append('signatures', $signatureHandler->getAdminTabled($start, $limit)); + $GLOBALS['xoopsTpl']->display($GLOBALS['xoops']->path('/modules/signed/templates/admin/signed_signatures.html')); + + include_once dirname(__FILE__) . '/admin_footer.php'; + +?> \ No newline at end of file Property changes on: XoopsModules/signed/trunk/modules/signed/admin/signatures.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property |
From: <zy...@us...> - 2014-12-08 20:21:41
|
Revision: 12890 http://sourceforge.net/p/xoops/svn/12890 Author: zyspec Date: 2014-12-08 20:21:32 +0000 (Mon, 08 Dec 2014) Log Message: ----------- include files missing in previous commit for v2.1 Beta 1 Added Paths: ----------- XoopsModules/randomquote/branches/zyspec/randomquote/assets/images/icons/quote.png XoopsModules/randomquote/branches/zyspec/randomquote/class/constants.php XoopsModules/randomquote/branches/zyspec/randomquote/include/action.module.php XoopsModules/randomquote/branches/zyspec/randomquote/include/plugin.tag.php XoopsModules/randomquote/branches/zyspec/randomquote/include/search.inc.php Added: XoopsModules/randomquote/branches/zyspec/randomquote/assets/images/icons/quote.png =================================================================== (Binary files differ) Index: XoopsModules/randomquote/branches/zyspec/randomquote/assets/images/icons/quote.png =================================================================== --- XoopsModules/randomquote/branches/zyspec/randomquote/assets/images/icons/quote.png 2014-12-08 20:18:04 UTC (rev 12889) +++ XoopsModules/randomquote/branches/zyspec/randomquote/assets/images/icons/quote.png 2014-12-08 20:21:32 UTC (rev 12890) Property changes on: XoopsModules/randomquote/branches/zyspec/randomquote/assets/images/icons/quote.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: XoopsModules/randomquote/branches/zyspec/randomquote/class/constants.php =================================================================== --- XoopsModules/randomquote/branches/zyspec/randomquote/class/constants.php (rev 0) +++ XoopsModules/randomquote/branches/zyspec/randomquote/class/constants.php 2014-12-08 20:21:32 UTC (rev 12890) @@ -0,0 +1,78 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ +/** + * RandomQuote module + * + * Class to define Random Quote module constant values. These constants are + * used to make the code easier to read and to keep values in central + * location if they need to be changed. These should not normally need + * to be modified. If they are to be modified it is recommended to change + * the value(s) before module installation. Additionally the module may not + * work correctly if trying to upgrade if these values have been changed. + * + * @category Module + * @package randomquote + * @copyright:: {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license:: {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License} + * @author:: zyspec <ow...@zy...> + * @since:: 2.11 + * @version:: $Id: $ + **/ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +interface RandomquoteConstants +{ +/**#@+ + * Constant definition + */ + /** + * indicates a quote is inactive + */ + const STATUS_OFFLINE = 0; + /** + * indicates a quote is active + */ + const STATUS_ONLINE = 1; + /** + * indicates a quote is waiting approval + */ + const STATUS_WAITING = 2; + /** + * indicates default quote ID + */ + const DEFAULT_ID = 0; + /** + * no delay XOOPS redirect delay (in seconds) + */ + const REDIRECT_DELAY_NONE = 0; + /** + * short XOOPS redirect delay (in seconds) + */ + const REDIRECT_DELAY_SHORT = 1; + /** + * medium XOOPS redirect delay (in seconds) + */ + const REDIRECT_DELAY_MEDIUM = 3; + /** + * long XOOPS redirect delay (in seconds) + */ + const REDIRECT_DELAY_LONG = 7; + /** + * confirm not ok to take action + */ + const CONFIRM_NOT_OK = 0; + /** + * confirm ok to take action + */ + const CONFIRM_OK = 1; +/**#@-*/ +} \ No newline at end of file Added: XoopsModules/randomquote/branches/zyspec/randomquote/include/action.module.php =================================================================== --- XoopsModules/randomquote/branches/zyspec/randomquote/include/action.module.php (rev 0) +++ XoopsModules/randomquote/branches/zyspec/randomquote/include/action.module.php 2014-12-08 20:21:32 UTC (rev 12890) @@ -0,0 +1,300 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/** + * XOOPS Randomquote management module + * + * @package randomquote + * @copyright The XOOPS project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @since 1.00 + * @author Taiwen Jiang <ph...@us...> + * @author ZySpec <ow...@zy...> + * @version $Id: $ + * */ + +/** + * @internal {Make sure you PROTECT THIS FILE + * + * This code has the potential to be extremely dangerous!!} + */ + +if ((!defined('XOOPS_ROOT_PATH')) + || !($GLOBALS['xoopsUser'] instanceof XoopsUser) + || !($GLOBALS['xoopsUser']->IsAdmin())) +{ + exit("Restricted access" . PHP_EOL); +} + +/** + * @param string $tablename + * + * @return bool + */ +function tableExists($tablename) +{ + $result = $GLOBALS['xoopsDB']->queryF("SHOW TABLES LIKE '$tablename'"); + return ($GLOBALS['xoopsDB']->getRowsNum($result) > 0) ? true : false; +} + +/** + * + * Verifies XOOPS version meets minimum requirements for this module + * @param obj $module {@link XoopsModule} + * + * @return bool true if meets requirements, false if not + */ +function randomquoteCheckXoopsVer(&$module) { + //check for minimum XOOPS version + $currentVer = substr(XOOPS_VERSION, 6); // get the numeric part of string + $currArray = explode('.', $currentVer); + $requiredVer = "" . $module->getInfo('min_xoops'); //making sure it's a string + $reqArray = explode('.', $requiredVer); + $success = true; + foreach ($reqArray as $k=>$v) { + if (isset($currArray[$k])) { + if ($currArray[$k] >= $v) { + continue; + } else { + $success = false; + break; + } + } else { + if ($v > 0) { + $success = false; + break; + } + } + } + + if (!$success) { + $module->setErrors(sprintf(_AM_RANDOMQUOTE_ERROR_BAD_XOOPS, $requiredVer, $currentVer)); + } + + return $success; +} + +/** + * + * Verifies PHP version meets minimum requirements for this module + * @param obj $module {@link XoopsModule} + * + * @return bool true if meets requirements, false if not + */ +function randomquoteCheckPHPVer(&$module) { + // check for minimum PHP version + $phpLen = strlen(PHP_VERSION); + $extraLen = strlen(PHP_EXTRA_VERSION); + $verNum = substr(PHP_VERSION, 0, ($phpLen-$extraLen)); + $reqVer = $module->getInfo('min_php'); + + $success = true; + if ($verNum >= $reqVer) { + $module->setErrors(sprintf(_AM_RANDOMQUOTE_ERROR_BAD_PHP, $reqVer, $verNum)); + $success = false; + } + + return $success; +} + +/** + * + * Performs tasks required during installation of the module + * @param obj $module {@link XoopsModule} + * + * @return bool true if installation successful, false if not + */ +function xoops_module_install_randomquote(&$module) { + return true; +} + +/** + * + * Prepares system prior to attempting to install module + * @param obj $module {@link XoopsModule} + * + * @return bool true if ready to install, false if not + */ +function xoops_module_pre_install_randomquote(&$module) +{ + //check for minimum XOOPS version + if (!randomquoteCheckXoopsVer($module)) { + return false; + } + + // check for minimum PHP version + if (!randomquoteCheckPHPVer($module)) { + return false; + } + return true; +} + +/** + * + * Prepares system prior to attempting to update module + * @param obj $module {@link XoopsModule} + */ +function xoops_module_pre_update_randomquote(&$module) +{ + //check for minimum XOOPS version + if (!randomquoteCheckXoopsVer($module)) { + return false; + } + + // check for minimum PHP version + if (!randomquoteCheckPHPVer($module)) { + return false; + } + return true; +} + + +function xoops_module_pre_uninstall_randomquote(&$module) +{ + /* Do some synchronization with tags to remove tags associated with this module + * + * @todo: write this code... + * + * pseudo code + * if (tag module installed) { + * get quote handler + * get all items with tags + * get tag handler + * delete all tags for this module + * } + */ + $success = true; + $tagModule =& XoopsModule::getByDirname('tag'); + if (($tagModule instanceof XoopsModule) && ($tagModule->isactive())) { + // first delete all quotes + $quotes_handler =& xoops_getmodulehandler('quotes', 'randomquote'); + $quoteObjs = $quotes_handler->deleteAll(); + //now 'unlink' the quote tags from Tag modules + include_once $GLOBALS['xoops']->path("/modules/tag/include/functions.recon.php"); + $success = tag_synchronization(); + if (!$success) { + $module->setErrors(_AM_RANDOMQUOTE_ERROR_TAG_REMOVAL); + } + } + + return $success; +} + +function xoops_module_uninstall_randomquote(&$module) +{ + return $success; +} + +/** + * + * Functions to upgrade from previous version of the module + * + * @param obj $module {@link XoopsModule} + * @param int $curr_version version number of module currently installed + * + * @return bool true if successfully updated module, false if not + */ +function xoops_module_update_randomquote(&$module, $curr_version = null) +{ + $errors = 0; + if (tableExists($GLOBALS['xoopsDB']->prefix('citas'))) { + + $sql = sprintf('ALTER TABLE ' + . $GLOBALS['xoopsDB']->prefix('citas') + . ' CHANGE `citas` `quote` TEXT' + ); + $result = $GLOBALS['xoopsDB']->queryF($sql); + if (!$result) { + $module->setErrors(_AM_RANDOMQUOTE_UPGRADEFAILED0); + ++$errors; + } + + $sql = sprintf('ALTER TABLE ' + . $GLOBALS['xoopsDB']->prefix('citas') + . " ADD COLUMN `quote_status` int (10) NOT NULL default '0'," + . " ADD COLUMN `quote_waiting` int (10) NOT NULL default '0'," + . " ADD COLUMN `quote_online` int (10) NOT NULL default '0';" + ); + $result = $GLOBALS['xoopsDB']->queryF($sql); + if (!$result) { + $module->setErrors(_AM_RANDOMQUOTE_UPGRADEFAILED1); + ++$errors; + } + + $sql = sprintf('ALTER TABLE ' + . $GLOBALS['xoopsDB']->prefix('citas') + . ' RENAME ' + . $GLOBALS['xoopsDB']->prefix('quotes') + ); + $result = $GLOBALS['xoopsDB']->queryF($sql); + if (!$result) { + $module->setErrors(_AM_RANDOMQUOTE_UPGRADEFAILED2); + ++$errors; + } + } elseif (tableExists($GLOBALS['xoopsDB']->prefix('randomquote_quotes'))) { + + // change status to indicate quote waiting approval + $sql = "UPDATE " . $GLOBALS['xoopsDB']->prefix('randomquote_quotes') . " SET quote_status=2 WHERE `quote_waiting` > 0"; + $result = $GLOBALS['xoopsDB']->queryF($sql); + if (!$result) { + $module->setErrors(_AM_RANDOMQUOTE_UPGRADEFAILED1); + ++$errors; + } + + // change status to indicate quote online + $sql = "UPDATE " . $GLOBALS['xoopsDB']->prefix('randomquote_quotes') . " SET quote_status=1 WHERE `quote_online` > 0"; + $result = $GLOBALS['xoopsDB']->queryF($sql); + if (!$result) { + $module->setErrors(_AM_RANDOMQUOTE_UPGRADEFAILED1); + ++$errors; + } + + // drop the waiting and online columns + $sql = sprintf('ALTER TABLE ' + . $GLOBALS['xoopsDB']->prefix('randomquote_quotes') + . " DROP COLUMN `quote_waiting`," + . " DROP COLUMN `quote_online`;" + ); + $result = $GLOBALS['xoopsDB']->queryF($sql); + if (!$result) { + $module->setErrors(_AM_RANDOMQUOTE_UPGRADEFAILED1); + ++$errors; + } + + // change the table name (drops the module name prefix) + $sql = sprintf('ALTER TABLE ' + . $GLOBALS['xoopsDB']->prefix('randomquote_quotes') + . ' RENAME ' + . $GLOBALS['xoopsDB']->prefix('quotes') + ); + $result = $GLOBALS['xoopsDB']->queryF($sql); + if (!$result) { + $module->setErrors(_AM_RANDOMQUOTE_UPGRADEFAILED2); + ++$errors; + } + } + + // add column for randomquote create_date for versions prior to 2.33 + if ($installedVersion < 233) { + $result = $db->queryF("SHOW COLUMNS FROM " . $db->prefix('quotes') . " LIKE 'create_date'"); + $foundColumn = $db->getRowsNum($result); + if (empty($foundColumn)) { + // column doesn't exist, so try and add it + $success = $db->queryF("ALTER TABLE " . $db->prefix('quotes') . " ADD create_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP AFTER quote_status"); + if (!$success) { + $module->setErrors(sprintf(_AM_RANDOMQUOTE_ERROR_COLUMN, 'create_date')); + ++$errors; + } + } + } + + return ($errors) ? false : true; +} Added: XoopsModules/randomquote/branches/zyspec/randomquote/include/plugin.tag.php =================================================================== --- XoopsModules/randomquote/branches/zyspec/randomquote/include/plugin.tag.php (rev 0) +++ XoopsModules/randomquote/branches/zyspec/randomquote/include/plugin.tag.php 2014-12-08 20:21:32 UTC (rev 12890) @@ -0,0 +1,112 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/** + * XOOPS tag management module + * + * @package randomquote + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @author Taiwen Jiang <ph...@us...> + * @author ZySpec <ow...@zy...> + * @since 2.11 + * @version $Id: $ + */ + +defined('XOOPS_ROOT_PATH') || exit('Restricted access'); + +XoopsLoad::load('XoopsFilterInput'); + +/** Get item fields: title, content, time, link, uid, tags + * + * Note that $items is "by reference" so modifying it in this + * routine in effect passes it back... + * + * @param array $items + * + * @return bool always returns true + **/ +function randomquote_tag_iteminfo(&$items) +{ + xoops_load('constants', 'randomquote'); + + $items_id = array(); + $cats_id = array(); + + foreach (array_keys($items) as $cat_id) { + $cats_id[] = intval($cat_id); + foreach (array_keys($items[$cat_id]) as $item_id) { + $items_id[] = intval($item_id); + } + } + + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria("id", "(" . implode(",", $items_id) . ")", "IN")); + $criteria->add(new Criteria('quote_status', RandomquoteConstants::STATUS_ONLINE)); + + $quote_handler =& xoops_getmodulehandler('quotes', 'randomquote'); + $quoteObjs = $quote_handler->getObjects($criteria, true); + + foreach ($cats_id as $cat_id) { + foreach ($items_id as $item_id) { + $quoteObj = $quoteObjs[$item_id]; + $items[$cat_id][$item_id] = array("title" => $quoteObj, +// "uid" => $quoteObj->getVar("uid"), + "link" => "index.php?id={$item_id}", + "time" => strtotime($quoteObj->getVar("create_date")), +// "tags" => tag_parse_tag($quoteObj->getVar("item_tag", "n")), // optional + "content" => "", + ); + } + } + + unset($items_obj); + return true; +} + +/** + * Remove orphan tag-item links + * + * @param int $mid module ID + */ +function mymodule_tag_synchronization($mid) +{ + xoops_load('constants', 'randomquote'); + $item_handler =& xoops_getmodulehandler('quotes', 'randomquote'); + $link_handler =& xoops_getmodulehandler('link', 'tag'); + + if (!$item_handler || !$link_handler) { + $result = false; + } else { + $mid = XoopsFilterInput::clean($mid, 'INT'); + $module_handler =& xoops_gethandler('module'); + $rqModule =& XoopsModule::getByDirname('randomquote'); + + // check to make sure module is active and trying to sync randomquote + if (($rqModule instanceof XoopsModule) && ($rqModule->isactive()) && ($rqModule->mid() == $mid)) { + // clear tag-item links + $sql = "DELETE FROM {$link_handler->table}" + . " WHERE tag_modid = {$mid}" + . " AND " + . " (tag_itemid NOT IN " + . " (SELECT DISTINCT {$item_handler->keyName} " + . " FROM {$item_handler->table} " + . " WHERE {$item_handler->table}.quote_status = " . RandomquoteConstants::STATUS_ONLINE + . " )" + . " )"; + $result = $link_handler->db->queryF($sql); + } else { + $result = false; + } + } + + return ($result) ? true : false; +} Added: XoopsModules/randomquote/branches/zyspec/randomquote/include/search.inc.php =================================================================== --- XoopsModules/randomquote/branches/zyspec/randomquote/include/search.inc.php (rev 0) +++ XoopsModules/randomquote/branches/zyspec/randomquote/include/search.inc.php 2014-12-08 20:21:32 UTC (rev 12890) @@ -0,0 +1,66 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/** + * Module: RandomQuote + * + * @category Module + * @package randomquote + * @author XOOPS Module Development Team + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @version $Id: admin_footer.php 12702 2014-07-11 17:18:50Z beckmi $ + * @link http://sourceforge.net/projects/xoops/ + * @since 2.0.0 + */ + +xoops_load('constants', 'randomquote'); + +function randomquote_search($queryarray, $andor, $limit, $offset, $userid) +{ + $ret = array(); + if (0 != (int) $userid) { + return $ret; + } + $quote_handler =& xoops_getmodulehandler('quotes', 'randomquote'); + $entryFields = array('id', 'quote', 'author', 'create_date'); + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('quote_status', RandomquoteConstants::STATUS_ONLINE)); + $criteria->setSort('create_date'); + $criteria->setOrder('DESC'); + $criteria->setLimit((int) $limit); + $criteria->setStart((int) $offset); + + if ((is_array($queryarray)) && !empty($queryarray)) { + $criteria->add(new Criteria('quote', "%{$queryarray[0]}%", 'LIKE')); + $criteria->add(new Criteria('author', "%{$queryarray[0]}%", 'LIKE'), 'OR'); + array_shift($queryarray); //get rid of first element + + foreach ($queryarray as $query) { + $criteria->add(new Criteria('quote', "%{$query}%", 'LIKE'), $andor); + $criteria->add(new Criteria('author', "%{$query}%", 'LIKE'), 'OR'); + } + } + $quoteObjs = $quote_handler->getAll($criteria, $entryFields); + foreach ($quoteObjs as $thisQuote) { + $ret[] = array ( + 'image' => 'assets/images/icons/quote.png', + 'link' => "index.php?id=" . $thisQuote->getVar('id'), + 'title' => (string) $thisQuote, //uses magic __toString() + 'time' => strtotime($thisQuote->getVar('create_date')), +// 'uid' => $entry['uid'] + ); + + } + + unset($quoteObjs); + return $ret; +} |
From: <zy...@us...> - 2014-12-08 20:18:19
|
Revision: 12889 http://sourceforge.net/p/xoops/svn/12889 Author: zyspec Date: 2014-12-08 20:18:04 +0000 (Mon, 08 Dec 2014) Log Message: ----------- - Require PHP 5.3 & XOOPS 2.5.7+ - Significant security improvements for all vars passed from forms - Replaced cleanVarsRandomquote with XoopsRequest - removed need for ./include/config.php - fixed typo in ./docs/licencs file name to license.txt - General code (& comment) cleanup - added module search capability - added support for XOOPS Tag module - added date quote was created to database - removed "day" block - can be accomplished setting quote cache Modified Paths: -------------- XoopsModules/randomquote/branches/zyspec/randomquote/admin/about.php XoopsModules/randomquote/branches/zyspec/randomquote/admin/admin_footer.php XoopsModules/randomquote/branches/zyspec/randomquote/admin/admin_header.php XoopsModules/randomquote/branches/zyspec/randomquote/admin/index.php XoopsModules/randomquote/branches/zyspec/randomquote/admin/main.php XoopsModules/randomquote/branches/zyspec/randomquote/admin/menu.php XoopsModules/randomquote/branches/zyspec/randomquote/blocks/views.php XoopsModules/randomquote/branches/zyspec/randomquote/class/quotes.php XoopsModules/randomquote/branches/zyspec/randomquote/docs/changelog.txt XoopsModules/randomquote/branches/zyspec/randomquote/docs/install.txt XoopsModules/randomquote/branches/zyspec/randomquote/header.php XoopsModules/randomquote/branches/zyspec/randomquote/include/config.php XoopsModules/randomquote/branches/zyspec/randomquote/include/functions.php XoopsModules/randomquote/branches/zyspec/randomquote/include/install.php XoopsModules/randomquote/branches/zyspec/randomquote/include/update.php XoopsModules/randomquote/branches/zyspec/randomquote/include/waiting.plugin.php XoopsModules/randomquote/branches/zyspec/randomquote/index.php XoopsModules/randomquote/branches/zyspec/randomquote/language/english/admin.php XoopsModules/randomquote/branches/zyspec/randomquote/language/english/blocks.php XoopsModules/randomquote/branches/zyspec/randomquote/language/english/help/help.html XoopsModules/randomquote/branches/zyspec/randomquote/language/english/main.php XoopsModules/randomquote/branches/zyspec/randomquote/language/english/modinfo.php XoopsModules/randomquote/branches/zyspec/randomquote/sql/mysql.sql XoopsModules/randomquote/branches/zyspec/randomquote/templates/admin/randomquote_admin_help.tpl XoopsModules/randomquote/branches/zyspec/randomquote/templates/blocks/randomquote_quotes_block_day.tpl XoopsModules/randomquote/branches/zyspec/randomquote/templates/blocks/randomquote_quotes_block_random.tpl XoopsModules/randomquote/branches/zyspec/randomquote/templates/blocks/randomquote_quotes_block_recent.tpl XoopsModules/randomquote/branches/zyspec/randomquote/templates/randomquote_header.tpl XoopsModules/randomquote/branches/zyspec/randomquote/templates/randomquote_index.tpl XoopsModules/randomquote/branches/zyspec/randomquote/xoops_version.php Added Paths: ----------- XoopsModules/randomquote/branches/zyspec/ XoopsModules/randomquote/branches/zyspec/randomquote/ XoopsModules/randomquote/branches/zyspec/randomquote/docs/license.txt Removed Paths: ------------- XoopsModules/randomquote/branches/zyspec/randomquote/class/forms/ XoopsModules/randomquote/branches/zyspec/randomquote/docs/licencs.txt Modified: XoopsModules/randomquote/branches/zyspec/randomquote/admin/about.php =================================================================== --- XoopsModules/randomquote/branches/mamba/randomquote/admin/about.php 2014-11-26 07:33:36 UTC (rev 12873) +++ XoopsModules/randomquote/branches/zyspec/randomquote/admin/about.php 2014-12-08 20:18:04 UTC (rev 12889) @@ -1,18 +1,23 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + /** * Module: RandomQuote * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * - * PHP version 5 - * * @category Module - * @package Randomquote - * @author XOOPS Development Team, Mamba - * @copyright 2001-2013 The XOOPS Project - * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) + * @package randomquote + * @author XOOPS Module Development Team + * @author Mamba + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} * @version $Id$ * @link http://sourceforge.net/projects/xoops/ * @since 2.0.0 Modified: XoopsModules/randomquote/branches/zyspec/randomquote/admin/admin_footer.php =================================================================== --- XoopsModules/randomquote/branches/mamba/randomquote/admin/admin_footer.php 2014-11-26 07:33:36 UTC (rev 12873) +++ XoopsModules/randomquote/branches/zyspec/randomquote/admin/admin_footer.php 2014-12-08 20:18:04 UTC (rev 12889) @@ -1,26 +1,36 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + /** * Module: RandomQuote * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * - * PHP version 5 - * * @category Module - * @package Randomquote - * @author XOOPS Development Team, Mamba - * @copyright 2001-2013 The XOOPS Project - * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) + * @package randomquote + * @author XOOPS Module Development Team + * @author Mamba + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} * @version $Id$ * @link http://sourceforge.net/projects/xoops/ * @since 2.0.0 */ -echo "<div align='center'><a href='http://www.xoops.org' target='_blank'> - <img src='" . $pathIcon32 . "/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a></div>"; -echo "<div class='center smallsmall italic pad5'> - <strong>" . $xoopsModule->getVar('name') . "</strong> " . _AM_RANDOMQUOTE_MAINTAINEDBY . " - <a href='http://xoops.org' title='Visit Support Forum' class='tooltip' rel='external'>Support Forum</a></div>"; +echo "<div class='adminfooter'>\n" + . " <div class='center'>\n" + . " <a href='" . $GLOBALS['xoopsModule']->getInfo('author_website_url') . "' target='_blank'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='" . $GLOBALS['xoopsModule']->getInfo('author_website_name') . "' title='" . $GLOBALS['xoopsModule']->getInfo('author_website_name') . "' /></a>\n" + . " </div>\n" + . " <div class='center smallsmall italic pad5'>\n" + . " " . _AM_RANDOMQUOTE_MAINTAINED_BY + . " <a class='tooltip' rel='external' href='http://" . $GLOBALS['xoopsModule']->getInfo('module_website_url') . "' " + . "title='" . _AM_RANDOMQUOTE_MAINTAINED_TITLE . "'>" . _AM_RANDOMQUOTE_MAINTAINED_TEXT . "</a>\n" + . " </div>\n" + . "</div>"; xoops_cp_footer(); Modified: XoopsModules/randomquote/branches/zyspec/randomquote/admin/admin_header.php =================================================================== --- XoopsModules/randomquote/branches/mamba/randomquote/admin/admin_header.php 2014-11-26 07:33:36 UTC (rev 12873) +++ XoopsModules/randomquote/branches/zyspec/randomquote/admin/admin_header.php 2014-12-08 20:18:04 UTC (rev 12889) @@ -1,53 +1,57 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + /** * Module: RandomQuote * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * - * PHP version 5 - * * @category Module - * @package Randomquote - * @author XOOPS Development Team, Mamba - * @copyright 2001-2013 The XOOPS Project - * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) + * @package randomquote + * @author XOOPS Module Development Team + * @author Mamba + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} * @version $Id$ * @link http://sourceforge.net/projects/xoops/ * @since 2.0.0 */ +$thisDirname = basename(dirname(__DIR__)); + include_once dirname(dirname(dirname(__DIR__))) . '/mainfile.php'; -include_once XOOPS_ROOT_PATH . '/include/cp_header.php'; -include_once '../include/config.php'; -include_once '../include/functions.php'; +include_once $GLOBALS['xoops']->path('/include/cp_header.php'); +//include_once $GLOBALS['xoops']->path("modules/{$thisDirname}/include/config.php"); +include_once $GLOBALS['xoops']->path("modules/{$thisDirname}/include/functions.php"); -$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname'); +XoopsLoad::load('xoopsrequest'); +XoopsLoad::load('quotes', $thisDirname); +XoopsLoad::load('constants', $thisDirname); -$pathIcon16 = '../' . $xoopsModule->getInfo('icons16'); -$pathIcon32 = '../' . $xoopsModule->getInfo('icons32'); -$pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin'); -//load handlers -$quotesHandler =& xoops_getModuleHandler('quotes', $thisDirname); +$pathIcon16 = $GLOBALS['xoops']->url('www/' . $GLOBALS['xoopsModule']->getInfo('icons16')); +$pathIcon32 = $GLOBALS['xoops']->url('www/' . $GLOBALS['xoopsModule']->getInfo('icons32')); +$pathModuleAdmin = $GLOBALS['xoops']->path('www/' . $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin')); +$quotesHandler =& xoops_getModuleHandler('quotes', $thisDirname); $myts =& MyTextSanitizer::getInstance(); -if (!isset($xoopsTpl) || !is_object($xoopsTpl)) { - include_once(XOOPS_ROOT_PATH . "/class/template.php"); +if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof XoopsTpl)) { + include_once $GLOBALS['xoops']->path("/class/template.php"); $xoopsTpl = new XoopsTpl(); } -$xoopsTpl->assign('pathIcon16', $pathIcon16); -$xoopsTpl->assign('pathIcon32', $pathIcon32); +$GLOBALS['xoopsTpl']->assign('pathIcon16', $pathIcon16); +$GLOBALS['xoopsTpl']->assign('pathIcon32', $pathIcon32); //Load languages xoops_loadLanguage('admin', $thisDirname); xoops_loadLanguage('modinfo', $thisDirname); xoops_loadLanguage('main', $thisDirname); -// Locad admin menu class -if (file_exists($GLOBALS['xoops']->path($pathModuleAdmin . '/moduleadmin.php'))) { - require_once $GLOBALS['xoops']->path($pathModuleAdmin . '/moduleadmin.php'); -} else { - redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false); -} +require_once "{$pathModuleAdmin}/moduleadmin/moduleadmin.php"; + xoops_cp_header(); $adminMenu = new ModuleAdmin(); Modified: XoopsModules/randomquote/branches/zyspec/randomquote/admin/index.php =================================================================== --- XoopsModules/randomquote/branches/mamba/randomquote/admin/index.php 2014-11-26 07:33:36 UTC (rev 12873) +++ XoopsModules/randomquote/branches/zyspec/randomquote/admin/index.php 2014-12-08 20:18:04 UTC (rev 12889) @@ -1,18 +1,23 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + /** * Module: RandomQuote * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * - * PHP version 5 - * * @category Module - * @package Randomquote - * @author XOOPS Development Team, Mamba - * @copyright 2001-2013 The XOOPS Project - * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) + * @package randomquote + * @author XOOPS Module Development Team + * @author Mamba + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} * @version $Id$ * @link http://sourceforge.net/projects/xoops/ * @since 2.0.0 @@ -26,6 +31,6 @@ // InfoBox citas $adminMenu->addInfoBoxLine(_AM_RANDOMQUOTE_STATISTICS, _AM_RANDOMQUOTE_THEREARE_CITAS, $count_quotes); // Render Index -echo $adminMenu->addNavigation("index.php"); +echo $adminMenu->addNavigation('index.php'); echo $adminMenu->renderIndex(); include_once __DIR__ . '/admin_footer.php'; Modified: XoopsModules/randomquote/branches/zyspec/randomquote/admin/main.php =================================================================== --- XoopsModules/randomquote/branches/mamba/randomquote/admin/main.php 2014-11-26 07:33:36 UTC (rev 12873) +++ XoopsModules/randomquote/branches/zyspec/randomquote/admin/main.php 2014-12-08 20:18:04 UTC (rev 12889) @@ -1,82 +1,96 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + /** * Module: RandomQuote * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * - * PHP version 5 - * * @category Module - * @package Randomquote - * @author XOOPS Development Team, Mamba - * @copyright 2001-2013 The XOOPS Project - * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) + * @package randomquote + * @author XOOPS Module Development Team + * @author Mamba + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} * @version $Id$ * @link http://sourceforge.net/projects/xoops/ * @since 2.0.0 */ include_once __DIR__ . '/admin_header.php'; -//It recovered the value of argument op in URL$ -$op = cleanVarsRandomquote($_REQUEST, 'op', 'list', 'string'); + +//xoops_load('xoopsrequest'); + +$op = XoopsRequest::getCmd('op', ''); +//$op = cleanVarsRandomquote($_REQUEST, 'op', '', 'string'); switch ($op) { case "list": default: echo $adminMenu->addNavigation('main.php'); $adminMenu->addItemButton(_AM_RANDOMQUOTE_NEWCITAS, 'main.php?op=new_quote', 'add'); - echo $adminMenu->renderButton('left'); + echo $adminMenu->renderButton('right'); $criteria = new CriteriaCompo(); - $criteria->setSort("id"); - $criteria->setOrder("ASC"); - $numrows = $quotesHandler->getCount(); - $quotes_arr = $quotesHandler->getall($criteria); + if (isset($_REQUEST['status'])) { + $status = XoopsRequest::getInt('status', RandomquoteConstants::STATUS_ONLINE); + $criteria->add(new Criteria('status', $status)); + } else { + $criteria->setSort('id'); + } + $criteria->setOrder('ASC'); + $quotesObjArray = $quotesHandler->getAll($criteria); + $quoteCount = (!empty($quotesObjArray) ? count($quotesObjArray) : 0); +// $quoteCount = $quotesHandler->getCount(); //Table view - if ($numrows > 0) { - echo "<table width='100%' cellspacing='1' class='outer'> - <tr> - <th align=\"center\">" . _AM_RANDOMQUOTE_QUOTES_QUOTE . "</th> - <th align=\"center\">" . _AM_RANDOMQUOTE_QUOTES_AUTHOR . "</th> - <th align=\"center\">" . _AM_RANDOMQUOTE_QUOTES_STATUS . "</th> - <th align=\"center\">" . _AM_RANDOMQUOTE_QUOTES_WAITING . "</th> - <th align=\"center\">" . _AM_RANDOMQUOTE_QUOTES_ONLINE . "</th> + if ($quoteCount) { + echo "<table class='width100 outer' cellspacing='1'>\n" + . " <thead>\n" + . " <tr>\n" + . " <th class='txtcenter'>" . _AM_RANDOMQUOTE_QUOTES_QUOTE . "</th>\n" + . " <th class='txtcenter'>" . _AM_RANDOMQUOTE_QUOTES_AUTHOR . "</th>\n" + . " <th class='txtcenter'>" . _AM_RANDOMQUOTE_QUOTES_STATUS . "</th>\n" + . " <th class='txtcenter width10'>" . _AM_RANDOMQUOTE_FORMACTION . "</th>\n" + . " </tr>\n" + . " </thead>\n" + . " <tbody>\n"; - <th align='center' width='10%'>" . _AM_RANDOMQUOTE_FORMACTION . "</th> - </tr>"; + $class = 'even'; - $class = "odd"; - - foreach (array_keys($quotes_arr) as $i) { - if ($quotes_arr[$i]->getVar("quotes_pid") == 0) { - echo "<tr class='" . $class . "'>"; - $class = ($class == "even") ? "odd" : "even"; - echo "<td>" . $quotes_arr[$i]->getVar("quote") . "</td>"; - echo "<td align=\"center\">" . $quotes_arr[$i]->getVar("author") . "</td>"; - - $verif_quote_status = ($quotes_arr[$i]->getVar("quote_status") == 1) ? _YES : _NO; - echo "<td align=\"center\">" . $verif_quote_status . "</td>"; - - $verif_quote_waiting = ($quotes_arr[$i]->getVar("quote_waiting") == 1) ? _YES : _NO; - echo "<td align=\"center\">" . $verif_quote_waiting . "</td>"; - - $verif_quote_online = ($quotes_arr[$i]->getVar("quote_online") == 1) ? _YES : _NO; - echo "<td align=\"center\">" . $verif_quote_online . "</td>"; - - echo "<td align='center' width='10%'> - <a href='main.php?op=edit_quote&id=" . $quotes_arr[$i]->getVar("id") . "'><img src=" . $pathIcon16 . "/edit.png alt='" . _EDIT . "' title='" . _EDIT . "'></a> - <a href='main.php?op=delete_quote&id=" . $quotes_arr[$i]->getVar("id") . "'><img src=" . $pathIcon16 . "/delete.png alt='" . _DELETE . "' title='" . _DELETE . "'></a> - </td>"; - echo "</tr>"; - } + $statusIcons = array(RandomquoteConstants::STATUS_OFFLINE => array('image' => 'off.png', 'text' => _AM_RANDOMQUOTE_QUOTES_OFFLINE), + RandomquoteConstants::STATUS_ONLINE => array('image' => 'on.png', 'text' => _AM_RANDOMQUOTE_QUOTES_ONLINE), + RandomquoteConstants::STATUS_WAITING => array('image' => 'warning.png', 'text' => _AM_RANDOMQUOTE_QUOTES_WAITING) + ); + foreach($quotesObjArray as $quoteObj) { +// foreach (array_keys($quotes_arr) as $i) { + $class = ('even' == $class) ? 'odd' : 'even'; + $thisStatus = $quoteObj->getVar('quote_status'); + $quote_status_link = "<img src='{$pathIcon16}/{$statusIcons[$thisStatus]['image']}'" + . " alt='{$statusIcons[$thisStatus]['text']}'" + . " title='{$statusIcons[$thisStatus]['text']}' />"; + echo " <tr class='{$class}'>\n" + . " <td>" . $quoteObj->getVar('quote') . "</td>\n" + . " <td class='txtcenter width20'>" . $quoteObj->getVar('author') . "</td>\n" + . " <td class='txtcenter width10'>" . $quote_status_link . "</td>\n" + . " <td class='txtcenter width10'>\n" + . " <a href='main.php?op=edit_quote&id=" . $quoteObj->getVar('id') . "'><img src='{$pathIcon16}/edit.png' alt='" . _EDIT . "' title='" . _EDIT . "' /></a>\n" + . " <a href='main.php?op=delete_quote&id=" . $quoteObj->getVar('id') . "'><img src='{$pathIcon16}/delete.png' alt='" . _DELETE . "' title='" . _DELETE . "' /></a>\n" + . " </td>\n" + . " </tr>\n"; } - echo "</table><br /><br />"; + echo " </tbody>\n" + . "</table><br /><br />\n"; } break; - case "new_quote": - echo $adminMenu->addNavigation("main.php"); + + case 'new_quote': + echo $adminMenu->addNavigation('main.php'); $adminMenu->addItemButton(_AM_RANDOMQUOTE_QUOTESLIST, 'main.php?op=list', 'list'); echo $adminMenu->renderButton('left'); @@ -84,63 +98,112 @@ $form = $obj->getForm(); $form->display(); break; - case "save_quote": - if (!$GLOBALS["xoopsSecurity"]->check()) { - redirect_header("main.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + + case 'save_quote': + // check to make sure this passes form submission security + if (($GLOBALS['xoopsSecurity'] instanceof XoopsSecurity)) { + if ( !$GLOBALS['xoopsSecurity']->check()) { + // failed xoops security check + redirect_header($_SERVER['PHP_SELF'], RandomquoteConstants::REDIRECT_DELAY_MEDIUM, $GLOBALS['xoopsSecurity']->getErrors(true)); + exit(); + } + } else { + redirect_header('index.php', RandomquoteConstants::REDIRECT_DELAY_MEDIUM, _MD_RANDOMQUOTE_INVALID_SECURITY_TOKEN); } - if (isset($_REQUEST["id"])) { - $obj =& $quotesHandler->get($_REQUEST["id"]); + + $input = new stdClass; // setup input array + + $input->id = XoopsRequest::getInt('id', RandomquoteConstants::DEFAULT_ID, 'POST'); + $input->quote = XoopsRequest::getString('quote', '', 'POST'); + $input->author = XoopsRequest::getString('author', '', 'POST'); + $input->item_tag = XoopsRequest::getString('item_tag', '', 'POST'); + + $verify_quote_status = XoopsRequest::getInt('quote_status', RandomquoteConstants::STATUS_OFFLINE, 'POST'); + $input->quote_status = (in_array($verify_quote_status, array(RandomquoteConstants::STATUS_ONLINE, RandomquoteConstants::STATUS_OFFLINE, RandomquoteConstants::STATUS_WAITING))) ? $verify_quote_status : RandomquoteConstants::STATUS_OFFLINE; + + if (!empty($input->id)) { + $obj = $quotesHandler->get($input->id); + $add_msg = _AM_RANDOMQUOTE_FORM_UPDATE_OK; } else { - $obj =& $quotesHandler->create(); + $obj = $quotesHandler->create(); + $add_msg = _AM_RANDOMQUOTE_FORM_ADD_OK; } - //Form texto - $obj->setVar("quote", $_REQUEST["quote"]); - //Form autor - $obj->setVar("author", $_REQUEST["author"]); - //Form quote_status - $verif_quote_status = ($_REQUEST["quote_status"] == 1) ? "1" : "0"; - $obj->setVar("quote_status", $verif_quote_status); - //Form quote_waiting - $verif_quote_waiting = ($_REQUEST["quote_waiting"] == 1) ? "1" : "0"; - $obj->setVar("quote_waiting", $verif_quote_waiting); - //Form quote_online - $verif_quote_online = ($_REQUEST["quote_online"] == 1) ? "1" : "0"; - $obj->setVar("quote_online", $verif_quote_online); + $obj->setVars(array('quote' => $input->quote, + 'author' => $input->author, + 'quote_status' => $input->quote_status) + ); - if ($quotesHandler->insert($obj)) { - redirect_header("main.php?op=list", 2, _AM_RANDOMQUOTE_FORMOK); + if ($objId = $quotesHandler->insert($obj)) { +// $module_handler =& xoops_gethandler('module'); + $tagModule =& XoopsModule::getByDirname('tag'); + if (($tagModule instanceof XoopsModule) && ($tagModule->isactive())) { + $tag_handler =& xoops_getmodulehandler('tag', 'tag'); + $tag_handler->updateByItem($input->item_tag, $objId, $thisDirname, 0); + } + redirect_header("main.php?op=list", RandomquoteConstants::REDIRECT_DELAY_MEDIUM, $add_msg); } echo $obj->getHtmlErrors(); $form =& $obj->getForm(); $form->display(); break; - case "edit_quote": - echo $adminMenu->addNavigation("main.php"); + + case 'edit_quote': + echo $adminMenu->addNavigation('main.php'); $adminMenu->addItemButton(_AM_RANDOMQUOTE_NEWCITAS, 'main.php?op=new_quote', 'add'); $adminMenu->addItemButton(_AM_RANDOMQUOTE_QUOTESLIST, 'main.php?op=list', 'list'); echo $adminMenu->renderButton('left'); - $obj = $quotesHandler->get($_REQUEST["id"]); + $id = XoopsRequest::getInt('id', RandomquoteConstants::DEFAULT_ID); +// $id = cleanVarsRandomquote($_POST, 'id', RandomquoteConstants::DEFAULT_ID, 'int'); + if (empty($id)) { + redirect_header($_SERVER['PHP_SELF'] . "&op=new_quote"); + } + $obj = $quotesHandler->get($id); $form = $obj->getForm(); $form->display(); break; - case "delete_quote": - $obj =& $quotesHandler->get($_REQUEST["id"]); - if (isset($_REQUEST["ok"]) && $_REQUEST["ok"] == 1) { - if (!$GLOBALS["xoopsSecurity"]->check()) { - redirect_header("main.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + + case 'delete_quote': + $request_ok = XoopsRequest::getInt('ok', RandomquoteConstants::CONFIRM_NOT_OK, 'POST'); + $id = XoopsRequest::getInt('id', RandomquoteConstants::DEFAULT_ID); +// $request_ok = cleanVarsRandomquote($_POST, 'ok', RandomquoteConstants::CONFIRM_NOT_OK, 'int'); +// $id = cleanVarsRandomquote($_REQUEST, 'id', RandomquoteConstants::DEFAULT_ID, 'int'); + if ($request_ok) { + // check to make sure this passes form submission security + if (($GLOBALS['xoopsSecurity'] instanceof XoopsSecurity)) { + if ( !$GLOBALS['xoopsSecurity']->check()) { + // failed xoops security check + redirect_header($_SERVER['PHP_SELF'], RandomquoteConstants::REDIRECT_DELAY_MEDIUM, $GLOBALS['xoopsSecurity']->getErrors(true)); + exit(); + } + } else { + redirect_header('index.php', RandomquoteConstants::REDIRECT_DELAY_MEDIUM, _MD_RANDOMQUOTE_INVALID_SECURITY_TOKEN); } - if ($quotesHandler->delete($obj)) { - redirect_header("main.php", 3, _AM_RANDOMQUOTE_FORMDELOK); + $obj =& $quotesHandler->get($id); + if (($obj instanceof RandomquoteQuotes)) { + $item_id = $obj->getVar('id'); + if ($quotesHandler->delete($obj)) { + // now clear out items in tag module for this item + $module_handler =& xoops_gethandler('module'); + $tagModule =& XoopsModule::getByDirname('tag'); + if (($tagModule instanceof XoopsModule) && ($tagModule->isactive())) { + $tag_handler =& xoops_getmodulehandler('tag', 'tag'); + $tag_handler->updateByItem(array(), $item_id, $thisDirname); //clear all tags for this item + } + redirect_header($_SERVER['PHP_SELF'], RandomquoteConstants::REDIRECT_DELAY_MEDIUM, _AM_RANDOMQUOTE_FORMDELOK); + } else { + echo $obj->getHtmlErrors(); + } } else { - echo $obj->getHtmlErrors(); + redirect_header($_SERVER['PHP_SELF'], RandomquoteConstants::REDIRECT_DELAY_MEDIUM, _AM_RANDOMQUOTE_INVALID_QUOTE_ID); } } else { + $obj = $quotesHandler->get($id); xoops_confirm( - array("ok" => 1, "id" => $_REQUEST["id"], "op" => "delete_quote"), - $_SERVER["REQUEST_URI"], - sprintf(_AM_RANDOMQUOTE_FORMSUREDEL, $obj->getVar("quote")) + array('ok' => RandomquoteConstants::CONFIRM_OK, 'id' => $id, 'op' => 'delete_quote'), + $_SERVER['REQUEST_URI'], + sprintf(_AM_RANDOMQUOTE_FORMSUREDEL, $obj) ); } break; Modified: XoopsModules/randomquote/branches/zyspec/randomquote/admin/menu.php =================================================================== --- XoopsModules/randomquote/branches/mamba/randomquote/admin/menu.php 2014-11-26 07:33:36 UTC (rev 12873) +++ XoopsModules/randomquote/branches/zyspec/randomquote/admin/menu.php 2014-12-08 20:18:04 UTC (rev 12889) @@ -1,18 +1,23 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + /** * Module: RandomQuote * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * - * PHP version 5 - * * @category Module - * @package Randomquote - * @author XOOPS Development Team, Mamba - * @copyright 2001-2013 The XOOPS Project - * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) + * @package randomquote + * @author XOOPS Module Development Team + * @author Mamba + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} * @version $Id$ * @link http://sourceforge.net/projects/xoops/ * @since 2.0.0 @@ -22,18 +27,17 @@ $module_handler =& xoops_gethandler("module"); $xoopsModule =& XoopsModule::getByDirname($dirname); $moduleInfo =& $module_handler->get($xoopsModule->getVar("mid")); -$pathIcon32 = $moduleInfo->getInfo("icons32"); -$adminmenu = array(); -$i = 1; -$adminmenu[$i]["title"] = _MI_RANDOMQUOTE_ADMENU1; -$adminmenu[$i]["link"] = "admin/index.php"; -$adminmenu[$i]["icon"] = $pathIcon32 . "/home.png"; -++$i; -$adminmenu[$i]["title"] = _MI_RANDOMQUOTE_ADMENU2; -$adminmenu[$i]["link"] = "admin/main.php"; -$adminmenu[$i]["icon"] = $pathIcon32 . "/content.png"; -++$i; -$adminmenu[$i]["title"] = _MI_RANDOMQUOTE_ADMENU3; -$adminmenu[$i]["link"] = "admin/about.php"; -$adminmenu[$i]["icon"] = $pathIcon32 . "/about.png"; -unset($i); +$pathIcon32 = '../../' . $moduleInfo->getInfo('icons32'); + +$adminmenu = array(array("title" => _MI_RANDOMQUOTE_ADMENU1, + "link" => 'admin/index.php', + "icon" => "{$pathIcon32}/home.png"), + + array("title" => _MI_RANDOMQUOTE_ADMENU2, + "link" => 'admin/main.php', + "icon" => "{$pathIcon32}/content.png"), + + array("title" => _MI_RANDOMQUOTE_ADMENU3, + "link" => 'admin/about.php', + "icon" => "{$pathIcon32}/about.png") +); Modified: XoopsModules/randomquote/branches/zyspec/randomquote/blocks/views.php =================================================================== --- XoopsModules/randomquote/branches/mamba/randomquote/blocks/views.php 2014-11-26 07:33:36 UTC (rev 12873) +++ XoopsModules/randomquote/branches/zyspec/randomquote/blocks/views.php 2014-12-08 20:18:04 UTC (rev 12889) @@ -1,102 +1,125 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + /** * Module: RandomQuote * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * - * PHP version 5 - * * @category Module - * @package Randomquote - * @author XOOPS Development Team, Mamba - * @copyright 2001-2013 The XOOPS Project - * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) + * @package randomquote + * @author XOOPS Development Team + * @author Mamba + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} * @version $Id$ * @link http://sourceforge.net/projects/xoops/ * @since 2.0.0 */ -include_once XOOPS_ROOT_PATH . "/modules/randomquote/include/functions.php"; +include_once $GLOBALS['xoops']->path("/modules/randomquote/include/functions.php"); +xoops_load('constants', 'randomquote'); /** - * @param $options * - * @return array + * Show a random quote in a block + * + * @param array { + * @param string [0] block type + * @param int [1] number of quotes to display + * } + * + * @return array { + * array { + * @param string [quote] + * @param string [author] + * } + * } */ function showRandomquoteBlockViews($options) { - include_once XOOPS_ROOT_PATH . "/modules/randomquote/class/quotes.php"; -// $myts =& MyTextSanitizer::getInstance(); +// xoops_load('quotes', 'randomquote'); + xoops_load('constants', 'randomquote'); $citas = array(); $type_block = $options[0]; $nb_quotes = $options[1]; -// $lenght_title = $options[2]; + $length_title = $options[2]; - $quotesHandler =& xoops_getModuleHandler("quotes", "randomquote"); + $quotesHandler =& xoops_getmodulehandler('quotes', 'randomquote'); $criteria = new CriteriaCompo(); - array_shift($options); - array_shift($options); - array_shift($options); switch ($type_block) { - // for block: citas recent - case "recent": - $criteria->add(new Criteria("quote_online", 1)); -// $criteria->setSort("quotes_date_created"); - $criteria->setSort("id"); - $criteria->setOrder("DESC"); + case 'recent': + $criteria->add(new Criteria('quote_status', RandomquoteConstants::STATUS_ONLINE)); + $criteria->setSort('create_date'); + $criteria->setOrder('DESC'); break; - // for block: citas today's - case "day": - $criteria->add(new Criteria("quote_online", 1)); -// $criteria->add(new Criteria("quotes_date_created", strtotime(date("Y/m/d")), ">=")); -// $criteria->add(new Criteria("quotes_date_created", strtotime(date("Y/m/d")) + 86400, "<=")); -// $criteria->setSort("quotes_date_created"); - $criteria->setOrder("ASC"); - $criteria->setSort("RAND()"); +/* + case 'day': + $criteria->add(new Criteria('quote_status', RandomquoteConstants::STATUS_ONLINE)); +// $criteria->add(new Criteria('quotes_date_created', strtotime(date('Y/m/d')), '>=')); +// $criteria->add(new Criteria('quotes_date_created', strtotime(date('Y/m/d')) + 86400, '<=')); +// $criteria->setSort('quotes_date_created'); + $criteria->setOrder('ASC'); + $criteria->setSort('RAND()'); break; - // for block: citas random - case "random": - $criteria->add(new Criteria("quote_online", 1)); - $criteria->setSort("RAND()"); +*/ + case 'random': + default: + $criteria->add(new Criteria('quote_status', RandomquoteConstants::STATUS_ONLINE)); + $criteria->setSort('RAND()'); break; } - $criteria->setLimit($nb_quotes); - $quotes_arr = $quotesHandler->getall($criteria); - foreach (array_keys($quotes_arr) as $i) { - $citas[$i]["quote"] = $quotes_arr[$i]->getVar("quote"); - $citas[$i]["author"] = $quotes_arr[$i]->getVar("author"); + if (intval($nb_quotes) > 0) { + $criteria->setLimit($nb_quotes); } + $quoteObjsArray = $quotesHandler->getAll($criteria); + foreach ($quoteObjsArray as $thisQuote) { + if ($options[2] > 0) { + $short_quote = xoops_substr($thisQuote->getVar('quote'), 0, $options[2], $trimmarker = '...'); + } else { + $shotr_quote = $thisQuote->getVar('quote'); + } + $citas[] = array('quote' => $short_quote, + 'author' => $thisQuote->getVar('author') + ); + } return $citas; } /** - * @param $options + * @param array $options Preferences config array * - * @return string + * @return string HTML form to edit module options */ function editRandomquoteBlockViews($options) { $quotes_arr = array(); - $form = "" . _MB_RANDOMQUOTE_QUOTES_DISPLAY . "\n"; - $form .= "<input type=\"hidden\" name=\"options[0]\" value=\"" . $options[0] . "\" />"; - $form .= "<input name=\"options[1]\" size=\"5\" maxlength=\"255\" value=\"" . $options[1] . "\" type=\"text\" /> <br />"; - $form .= "" . _MB_RANDOMQUOTE_QUOTES_TITLELENGTH . " : <input name=\"options[2]\" size=\"5\" maxlength=\"255\" value=\"" . $options[2] . "\" type=\"text\" /><br /><br />"; + $form = "" . _MB_RANDOMQUOTE_QUOTES_DISPLAY . "\n" + . "<input type='hidden' name='options[0]' value='" . $options[0] . "' />\n" + . "<input name='options[1]' size='5' maxlength='255' value='" . $options[1] . "' type='text' /> <br />\n" + . "" . _MB_RANDOMQUOTE_QUOTES_SHORTEN . " <input name='options[2]' size='5' maxlength='255' value='" . $options[2] . "' type='number' min='0' /> " . _MB_RANDOMQUOTE_QUOTES_CHARACTERS . "<br /><br />"; +/* array_shift($options); array_shift($options); array_shift($options); - $form .= "" . _MB_RANDOMQUOTE_QUOTES_CATTODISPLAY . "<br /><select name=\"options[]\" multiple=\"multiple\" size=\"5\">"; - $form .= "<option value=\"0\" " . (array_search(0, $options) === false ? "" : "selected=\"selected\"") . ">" . _MB_RANDOMQUOTE_QUOTES_ALLCAT . "</option>"; + $form .= "" . _MB_RANDOMQUOTE_QUOTES_CATTODISPLAY . "<br />\n" + . "<select name='options[]' multiple='multiple' size='5'>\n" + . "<option value='0'" . (false === array_search(0, $options) ? "" : " selected='selected'") . ">" . _MB_RANDOMQUOTE_QUOTES_ALLCAT . "</option>\n"; foreach (array_keys($quotes_arr) as $i) { - $form .= "<option value=\"" . $quotes_arr[$i]->getVar("quotes_id") . "\" " . (array_search($quotes_arr[$i]->getVar("quotes_id"), $options) === false ? "" : "selected=\"selected\"") . ">" - . $quotes_arr[$i]->getVar("quotes_title") . "</option>"; + $form .= "<option value='" . $quotes_arr[$i]->getVar('quotes_id') . "'" . (false === array_search($quotes_arr[$i]->getVar('quotes_id'), $options) ? '' : " selected='selected'") . ">" + . $quotes_arr[$i]->getVar('quotes_title') . "</option>\n"; } - $form .= "</select>"; - + $form .= "</select>\n"; +*/ return $form; } Modified: XoopsModules/randomquote/branches/zyspec/randomquote/class/quotes.php =================================================================== --- XoopsModules/randomquote/branches/mamba/randomquote/class/quotes.php 2014-11-26 07:33:36 UTC (rev 12873) +++ XoopsModules/randomquote/branches/zyspec/randomquote/class/quotes.php 2014-12-08 20:18:04 UTC (rev 12889) @@ -1,26 +1,29 @@ <?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + /** * Module: RandomQuote * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * - * PHP version 5 - * * @category Module - * @package Randomquote - * @author XOOPS Development Team, Mamba - * @copyright 2001-2013 The XOOPS Project - * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) + * @package randomquote + * @author XOOPS Module Development Team + * @author Mamba + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} * @version $Id$ * @link http://sourceforge.net/projects/xoops/ - * @since 2.0.0 + * @since 2.00 */ -if (!defined("XOOPS_ROOT_PATH")) { - die("XOOPS root path not defined"); -} +defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** * Class RandomquoteQuotes @@ -34,90 +37,99 @@ function __construct() { $this->XoopsObject(); - $this->initVar("id", XOBJ_DTYPE_INT, null, false, 11); - $this->initVar("quote", XOBJ_DTYPE_TXTAREA, null, false); - $this->initVar("author", XOBJ_DTYPE_TXTAREA, null, false); - $this->initVar("quote_status", XOBJ_DTYPE_INT, null, false, 10); - $this->initVar("quote_waiting", XOBJ_DTYPE_INT, null, false, 10); - $this->initVar("quote_online", XOBJ_DTYPE_INT, null, false, 1); - + $this->initVar('id', XOBJ_DTYPE_INT, null, false, 11); + $this->initVar('quote', XOBJ_DTYPE_TXTAREA, null, true); + $this->initVar('author', XOBJ_DTYPE_TXTAREA, null, false); + $this->initVar('quote_status', XOBJ_DTYPE_INT, null, false, 10); + $this->initVar('create_date', XOBJ_DTYPE_TIMESTAMP, time(), false); $this->initVar('dohtml', XOBJ_DTYPE_INT, 1, false); $this->initVar('dosmiley', XOBJ_DTYPE_INT, 1, false); $this->initVar('doxcode', XOBJ_DTYPE_INT, 1, false); $this->initVar('doimage', XOBJ_DTYPE_INT, 1, false); $this->initVar('dobr', XOBJ_DTYPE_INT, 1, false); - } /** - * @param bool $action * - * @return XoopsThemeForm + * Magic function to display obj as string */ - function getForm($action = false) + function __toString() { - // global $xoopsDB, $xoopsModuleConfig; - - if ($action === false) { + return $this->getVar('quote') . " - " . $this->getVar('author'); + } + /** + * Displays the Edit (Create) quote form + * + * @param mixed $action + * + * @return object {@see XoopsThemeForm) + */ + public function getForm($action = false) + { + if (false === $action) { $action = $_SERVER["REQUEST_URI"]; } $title = $this->isNew() ? sprintf(_AM_RANDOMQUOTE_QUOTES_ADD) : sprintf(_AM_RANDOMQUOTE_QUOTES_EDIT); - include_once(XOOPS_ROOT_PATH . "/class/xoopsformloader.php"); + xoops_load('constants', 'randomquote'); + include_once $GLOBALS['xoops']->path("/class/xoopsformloader.php"); $form = new XoopsThemeForm($title, "form", $action, "post", true); $form->setExtra('enctype="multipart/form-data"'); - $author = $this->isNew() ? '' : $this->getVar("author"); - $textAuthor = new XoopsFormText(_AM_RANDOMQUOTE_QUOTES_AUTHOR, "author", 50, 255, $author); + $author = $this->isNew() ? '' : $this->getVar('author'); + $id = ($this->getVar('id')) ? $this->getVar('id') : RandomquoteConstants::DEFAULT_ID; + $textAuthor = new XoopsFormText(_AM_RANDOMQUOTE_QUOTES_AUTHOR, 'author', 50, 255, $author); $form->addElement($textAuthor); - $editorConfigs = array(); - $editorConfigs["name"] = "quote"; - $editorConfigs["value"] = $this->getVar("quote", "e"); - $editorConfigs["rows"] = 10; - $editorConfigs["cols"] = 80; - $editorConfigs["width"] = "100%"; - $editorConfigs["height"] = "400px"; - $editorConfigs["editor"] = $GLOBALS["xoopsModuleConfig"]["randomquote_editor"]; - $form->addElement(new XoopsFormEditor(_AM_RANDOMQUOTE_QUOTES_QUOTE, "quote", $editorConfigs), true); + $editorConfigs = array("name" => "quote", + "value" => $this->getVar("quote", "e"), + "rows" => 10, + "cols" => 80, + "width" => "100%", + "height" => "400px", + "editor" => $GLOBALS["xoopsModuleConfig"]["randomquote_editor"] + ); + $form->addElement(new XoopsFormEditor(_AM_RANDOMQUOTE_QUOTES_QUOTE, 'quote', $editorConfigs), true); -// $editorConfigs = array(); -// $editorConfigs["name"] = "author"; -// $editorConfigs["value"] = $this->getVar("author", "e"); -// $editorConfigs["rows"] = 10; -// $editorConfigs["cols"] = 80; -// $editorConfigs["width"] = "100%"; -// $editorConfigs["height"] = "400px"; -// $editorConfigs["editor"] = $GLOBALS["xoopsModuleConfig"]["randomquote_editor"]; -// $form->addElement(new XoopsFormEditor(_AM_RANDOMQUOTE_QUOTES_AUTHOR, "author", $editorConfigs), true); + /* + * pseudo code + * see if tag module is present & active + * load the formtag class + * display the tag form element to collect the tag item + */ + $module_handler =& xoops_gethandler('module'); + $tagModule =& XoopsModule::getByDirname('tag'); + if (($tagModule instanceof XoopsModule) && ($tagModule->isactive())) { + $tagClassExists = XoopsLoad::load('formtag', 'tag'); // get the TagFormTag class + if ($tagClassExists) { + if ($this->isNew()) { + $tag_items = array(); + } else { + $moduleMid = $GLOBALS['xoopsModule']->mid(); + $tag_handler =& xoops_getmodulehandler('tag', 'tag'); + $tag_items = $tag_handler->getByItem($id, $moduleMid, 0); + } + $tag_string = implode('|', $tag_items); + $form->addElement(new TagFormTag('item_tag', 60, 255, $tag_string, 0)); + } + } else { + $form->XoopsFormHidden('item_tag', ''); + } - $quote_status = $this->isNew() ? 0 : $this->getVar("quote_status"); - $check_quote_status = new XoopsFormCheckBox(_AM_RANDOMQUOTE_QUOTES_STATUS, "quote_status", $quote_status); - $check_quote_status->addOption(1, " "); + $quote_status = ($this->isNew()) ? RandomquoteConstants::STATUS_OFFLINE : $this->getVar("quote_status"); + $check_quote_status = new XoopsFormRadio(_AM_RANDOMQUOTE_QUOTES_STATUS, "quote_status", $quote_status); + $check_quote_status->addOption(RandomquoteConstants::STATUS_OFFLINE, _AM_RANDOMQUOTE_QUOTES_OFFLINE); + $check_quote_status->addOption(RandomquoteConstants::STATUS_ONLINE, _AM_RANDOMQUOTE_QUOTES_ONLINE); + $check_quote_status->addOption(RandomquoteConstants::STATUS_WAITING, _AM_RANDOMQUOTE_QUOTES_WAITING); $form->addElement($check_quote_status); - $quote_waiting = $this->isNew() ? 0 : $this->getVar("quote_waiting"); - $check_quote_waiting - = new XoopsFormCheckBox(_AM_RANDOMQUOTE_QUOTES_WAITING, "quote_waiting", $quote_waiting); - $check_quote_waiting->addOption(1, " "); - $form->addElement($check_quote_waiting); - $quote_online = $this->isNew() ? 0 : $this->getVar("quote_online"); - $check_quote_online = new XoopsFormCheckBox(_AM_RANDOMQUOTE_QUOTES_ONLINE, "quote_online", $quote_online); - $check_quote_online->addOption(1, " "); - $form->addElement($check_quote_online); - $form->addElement(new XoopsFormHidden("op", "save_quote")); + $form->addElement(new XoopsFormHidden('op', 'save_quote')); + $form->addElement(new XoopsFormHidden('id', $id)); //Submit buttons - $button_tray = new XoopsFormElementTray("", ""); - $submit_button = new XoopsFormButton("", "submit", _SUBMIT, "submit"); - $button_tray->addElement($submit_button); - - $cancel_button = new XoopsFormButton("", "", _CANCEL, "cancel"); - $cancel_button->setExtra('onclick="history.go(-1)"'); - $button_tray->addElement($cancel_button); - + $button_tray = new XoopsFormButtonTray('submit', _SUBMIT); $form->addElement($button_tray); return $form; @@ -134,6 +146,6 @@ */ function __construct(&$db) { - parent::__construct($db, "randomquote_quotes", "RandomquoteQuotes", "id", "quote"); + parent::__construct($db, 'quotes', 'RandomquoteQuotes', 'id', 'quote'); } } Modified: XoopsModules/randomquote/branches/zyspec/randomquote/docs/changelog.txt =================================================================== --- XoopsModules/randomquote/branches/mamba/randomquote/docs/changelog.txt 2014-11-26 07:33:36 UTC (rev 12873) +++ XoopsModules/randomquote/branches/zyspec/randomquote/docs/changelog.txt 2014-12-08 20:18:04 UTC (rev 12889) @@ -1,7 +1,20 @@ +Version 2.1 Beta 1 from 2014-12-08 +================================= +- Require PHP 5.3 +- Require XOOPS 2.5.7+ +- Significant security improvements for all vars passed from forms +- Replaced cleanVarsRandomquote with XoopsRequest +- removed need for ./include/config.php +- fixed typo in ./docs/licencs file name to license.txt +- Clean up phpdocumentor comments +- General code cleanup +- added module search capability +- added support for XOOPS Tag module +- added date quote was created to database +- removed "day" block - can be accomplished setting quote cache ------------------------------------- - 2.00 Alpha 1 2013/06/27 ------------------------------------- - +Version 2.00 from 2013-06-27 +================================= - Original release RandomQuote 2.0 Alpha 1. - This module is developed from scratch using TDMCreate, but it's inspired by the original code from RandomQuote + This module is developed from scratch using TDMCreate, but it's inspired by + the original code from RandomQuote Modified: XoopsModules/randomquote/branches/zyspec/randomquote/docs/install.txt =================================================================== --- XoopsModules/randomquote/branches/mamba/randomquote/docs/install.txt 2014-11-26 07:33:36 UTC (rev 12873) +++ XoopsModules/randomquote/branches/zyspec/randomquote/docs/install.txt 2014-12-08 20:18:04 UTC (rev 12889) @@ -1,4 +1,10 @@ -Read Me First -============= +INSTALL/UNISTALL +================= -Install just like another XOOPS module \ No newline at end of file +No special measures necessary, follow the standard installation process +1. Extract the /randomquote folder into the ./modules directory. +2. Install the module through Admin -> System Module -> Modules +3. Configure module settings in the Admin -> Preferences -> Random Quotes + +Detailed instructions on installing modules are available in the XOOPS +Operations Manual (http://goo.gl/adT2i) \ No newline at end of file Deleted: XoopsModules/randomquote/branches/zyspec/randomquote/docs/licencs.txt =================================================================== --- XoopsModules/randomquote/branches/mamba/randomquote/docs/licencs.txt 2014-11-26 07:33:36 UTC (rev 12873) +++ XoopsModules/randomquote/branches/zyspec/randomquote/docs/licencs.txt 2014-12-08 20:18:04 UTC (rev 12889) @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. ... [truncated message content] |
From: <txm...@us...> - 2014-12-06 21:54:52
|
Revision: 12888 http://sourceforge.net/p/xoops/svn/12888 Author: txmodxoops Date: 2014-12-06 21:54:48 +0000 (Sat, 06 Dec 2014) Log Message: ----------- Updated - Fixed bugs Modified Paths: -------------- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/header.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/building.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateArchitecture.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateFile.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/AdminPages.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/ClassFormElements.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/blocks/TemplatesBlocks.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/TemplatesUserPages.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/modules.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/tables.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/common.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/templates/admin/tdmcreate_fields.tpl Added Paths: ----------- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateHelper.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/TDMCreateHtmlSmartyCodes.php Removed Paths: ------------- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/request.php Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php 2014-12-04 21:57:19 UTC (rev 12887) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/fields.php 2014-12-06 21:54:48 UTC (rev 12888) @@ -132,10 +132,10 @@ } else { $GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_FIELDS); } - var_dump($fieldMid); + /*var_dump($fieldMid); var_dump($fieldTid); var_dump($fieldNumb); - var_dump($fieldName); + var_dump($fieldName);*/ break; case 'new': @@ -152,10 +152,10 @@ $form = $fieldsObj->getFormNew($fieldMid, $fieldTid, $fieldNumb, $fieldName); $GLOBALS['xoopsTpl']->assign('form', $form->render()); // Test -> Will be removed - var_dump($fieldMid); + /*var_dump($fieldMid); var_dump($fieldTid); var_dump($fieldNumb); - var_dump($fieldName); + var_dump($fieldName); */ break; case 'save': @@ -242,7 +242,7 @@ $form = $fieldsObj->getFormEdit($fieldMid, $fieldTid); $GLOBALS['xoopsTpl']->assign('form', $form->render()); // Test -> Will be removed - var_dump($fieldTid); + //var_dump($fieldTid); break; case 'drag': @@ -273,7 +273,23 @@ unset($i); } exit; - break; + break; + + case 'delete': + $tablesObj =& $tdmcreate->getHandler('tables')->get($fieldTid); + if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) { + if ( !$GLOBALS['xoopsSecurity']->check() ) { + redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); + } + if ($tdmcreate->getHandler('tables')->delete($tablesObj)) { + redirect_header('fields.php', 3, _AM_TDMCREATE_FORMDELOK); + } else { + echo $tablesObj->getHtmlErrors(); + } + } else { + xoops_confirm(array('ok' => 1, 'field_tid' => $fieldTid, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $tablesObj->getVar('table_name'))); + } + break; case 'display': // Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/header.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/header.php 2014-12-04 21:57:19 UTC (rev 12887) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/admin/header.php 2014-12-06 21:54:48 UTC (rev 12888) @@ -30,7 +30,7 @@ $modPathIcon32 = $GLOBALS['xoopsModule']->getInfo('modicons32'); $pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin'); // TDMCreate Instance -$tdmcreate = TDMCreate::getInstance(); +$tdmcreate = TDMCreateHelper::getInstance(); // MyTextSanitizer $myts =& MyTextSanitizer::getInstance(); if (!isset($xoopsTpl) || !is_object($xoopsTpl)) { Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateHelper.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateHelper.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateHelper.php 2014-12-06 21:54:48 UTC (rev 12888) @@ -0,0 +1,173 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +/** + * tdmcreate module + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package tdmcreate + * @since 2.5.0 + * @author trabis <lus...@gm...> + * @version $Id: TDMCreateHelper.php 12258 2014-04-12 23:45:12Z timgno $ + */ +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class TDMCreateHelper +{ + /** + * @var string + */ + private $dirname = null; + /** + * @var string + */ + private $module = null; + /** + * @var string + */ + private $handler = null; + /** + * @var string + */ + private $config = null; + /** + * @var string + */ + private $debug = null; + /** + * @var array + */ + private $debugArray = array(); + /* + * @protected function constructor class + * @param mixed $debug + */ + protected function __construct($debug) + { + $this->debug = $debug; + $this->dirname = basename(dirname(dirname(__FILE__))); + } + /* + * @static function &getInstance + * @param mixed $debug + */ + public static function &getInstance($debug = false) + { + static $instance = false; + if (!$instance) { + $instance = new self($debug); + } + return $instance; + } + /* + * @static function getModule + * @param null + */ + public function &getModule() + { + if ($this->module == null) { + $this->initModule(); + } + return $this->module; + } + /* + * @static function getConfig + * @param string $name + */ + public function getConfig($name = null) + { + if ($this->config == null) { + $this->initConfig(); + } + if (!$name) { + $this->addLog("Getting all config"); + return $this->config; + } + if (!isset($this->config[$name])) { + $this->addLog("ERROR :: CONFIG '{$name}' does not exist"); + return null; + } + $this->addLog("Getting config '{$name}' : " . $this->config[$name]); + return $this->config[$name]; + } + /* + * @static function setConfig + * @param string $name + * @param mixed $value + */ + public function setConfig($name = null, $value = null) + { + if ($this->config == null) { + $this->initConfig(); + } + $this->config[$name] = $value; + $this->addLog("Setting config '{$name}' : " . $this->config[$name]); + return $this->config[$name]; + } + /* + * @static function getHandler + * @param string $name + */ + public function &getHandler($name) + { + if (!isset($this->handler[$name . '_handler'])) { + $this->initHandler($name); + } + $this->addLog("Getting handler '{$name}'"); + return $this->handler[$name . '_handler']; + } + /* + * @static function initModule + * @param null + */ + public function initModule() + { + global $xoopsModule; + if (isset($xoopsModule) && is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $this->dirname) { + $this->module = $xoopsModule; + } else { + $hModule = xoops_gethandler('module'); + $this->module = $hModule->getByDirname($this->dirname); + } + $this->addLog('INIT MODULE'); + } + /* + * @static function initConfig + * @param null + */ + public function initConfig() + { + $this->addLog('INIT CONFIG'); + $hModConfig = xoops_gethandler('config'); + $this->config = $hModConfig->getConfigsByCat(0, $this->getModule()->getVar('mid')); + } + /* + * @static function initHandler + * @param string $name + */ + public function initHandler($name) + { + $this->addLog('INIT ' . $name . ' HANDLER'); + $this->handler[$name . '_handler'] = xoops_getModuleHandler($name, $this->dirname); + } + /* + * @static function addLog + * @param string $log + */ + public function addLog($log) + { + if ($this->debug) { + if (is_object($GLOBALS['xoopsLogger'])) { + $GLOBALS['xoopsLogger']->addExtra($this->module->name(), $log); + } + } + } +} \ No newline at end of file Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/building.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/building.php 2014-12-04 21:57:19 UTC (rev 12887) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/building.php 2014-12-06 21:54:48 UTC (rev 12888) @@ -36,7 +36,7 @@ public function __construct() { $this->XoopsObject(); - $this->tdmcreate = TDMCreate::getInstance(); + $this->tdmcreate = TDMCreateHelper::getInstance(); } /* Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php 2014-12-04 21:57:19 UTC (rev 12887) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php 2014-12-06 21:54:48 UTC (rev 12888) @@ -38,7 +38,7 @@ */ public function __construct() { - $this->tdmcreate = TDMCreate::getInstance(); + $this->tdmcreate = TDMCreateHelper::getInstance(); $this->initVar('field_id', XOBJ_DTYPE_INT); $this->initVar('field_mid', XOBJ_DTYPE_INT); $this->initVar('field_tid', XOBJ_DTYPE_INT); @@ -248,16 +248,10 @@ $check_field_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK); $parameters_tray->addElement($check_field_block); - if(($i == 1)) { - $field_main = 1; + $field_main = ( $i == 1 ) ? 1 : 0; $check_field_main = new XoopsFormRadio('', 'field_main['.$i.']', $field_main); - $check_field_main->addOption($field_main, _AM_TDMCREATE_FIELD_MAINFIELD ); - } else { - $field_main = 0; - $check_field_main = new XoopsFormRadio('', 'field_main['.$i.']'); - $check_field_main->addOption($field_main, _AM_TDMCREATE_FIELD_MAINFIELD ); - } - $parameters_tray->addElement($check_field_main); + $check_field_main->addOption($i, _AM_TDMCREATE_FIELD_MAINFIELD ); + $parameters_tray->addElement($check_field_main); $field_search = 0; $check_field_search = new XoopsFormCheckBox(' ', 'field_search['.$i.']', $field_search); @@ -379,15 +373,11 @@ $check_field_block = new XoopsFormCheckBox('', 'field_block['.$field_id.']', $field->getVar('field_block')); $check_field_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK); - $parameters_tray->addElement($check_field_block); - - $field_main = $field->getVar('field_main'); - if($field_main == 1) { - $check_field_main = new XoopsFormRadio('', 'field_main['.$field_id.']', $field_main); - } else { - $check_field_main = new XoopsFormRadio('', 'field_main['.$field_id.']'); - } - $check_field_main->addOption($field_main, _AM_TDMCREATE_FIELD_MAINFIELD ); + $parameters_tray->addElement($check_field_block); + + $field_main = $field->getVar('field_main'); + $check_field_main = new XoopsFormRadio('', 'field_main['.$field_id.']', $field_main); + $check_field_main->addOption($field_id, _AM_TDMCREATE_FIELD_MAINFIELD ); $parameters_tray->addElement($check_field_main); $check_field_search = new XoopsFormCheckBox(' ', 'field_search['.$field_id.']', $field->getVar('field_search')); Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateArchitecture.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateArchitecture.php 2014-12-04 21:57:19 UTC (rev 12887) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateArchitecture.php 2014-12-06 21:54:48 UTC (rev 12888) @@ -36,7 +36,7 @@ * @param null */ public function __construct() { - $this->tdmcreate = TDMCreate::getInstance(); + $this->tdmcreate = TDMCreateHelper::getInstance(); $this->structure = TDMCreateStructure::getInstance(); } /* Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateFile.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateFile.php 2014-12-04 21:57:19 UTC (rev 12887) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/TDMCreateFile.php 2014-12-06 21:54:48 UTC (rev 12888) @@ -88,7 +88,7 @@ */ public function __construct() { $this->xoopsFile = XoopsFile::getHandler(); - $this->tdmcreate = TDMCreate::getInstance(); + $this->tdmcreate = TDMCreateHelper::getInstance(); } /* Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/AdminPages.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/AdminPages.php 2014-12-04 21:57:19 UTC (rev 12887) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/AdminPages.php 2014-12-06 21:54:48 UTC (rev 12888) @@ -124,7 +124,7 @@ $rpFieldName = $this->tdmcfile->getRightString($fieldName); // $fieldElement = $fields[$f]->getVar('field_element'); - if( ($fields[$f]->getVar('field_admin') == 1) || ($tableAutoincrement == 1) ) { + if( ($fields[$f]->getVar('field_admin') == 1) || ($tableAutoincrement == 1) && ($fields[$f]->getVar('field_inlist') == 1) ) { switch($fieldElement) { case 3: case 4: @@ -307,6 +307,8 @@ * @public function getAdminPagesDelete * @param string $tableName * @param string $language + * @param string $fpif + * @param string $fpmf */ public function getAdminPagesDelete($tableName, $language, $fpif, $fpmf) { @@ -331,6 +333,33 @@ } /* + * @public function getAdminPagesUpdate + * @param string $moduleDirname + * @param string $tableName + * @param string $language + * @param string $fpif + * @param string $fpmf + */ + public function getAdminPagesUpdate($moduleDirname, $tableName, $language, $fpif, $fpmf) { + + $upModuleName = strtoupper($moduleDirname); + $ret = <<<EOT + case 'update': + if (isset(\${$fpif})) { + \${$tableName}Obj =& \${$tableName}Handler->get(\${$fpif}); + } + \${$tableName}Obj->setVar("\${$tableName}_display", \$_POST["\${$tableName}_display"]); + + if (\${$tableName}Handler->insert(\${$tableName}Obj)) { + redirect_header("\${$tableName}.php", 3, _AM_{$upModuleName}_FORMOK); + } + echo \${$tableName}Obj->getHtmlErrors(); + break;\n +EOT; + return $ret; + } + + /* * @public function getAdminPagesFooter * @param null */ @@ -350,7 +379,7 @@ { $module = $this->getModule(); $table = $this->getTable(); - $moduleDirname = $module->getVar('mod_dirname'); + $moduleDirname = $module->getVar('mod_dirname'); $tableName = $table->getVar('table_name'); $tableFieldname = $table->getVar('table_fieldname'); $language = $this->getLanguage($moduleDirname, 'AM'); Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/ClassFormElements.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/ClassFormElements.php 2014-12-04 21:57:19 UTC (rev 12887) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/ClassFormElements.php 2014-12-06 21:54:48 UTC (rev 12888) @@ -28,7 +28,7 @@ */ public function __construct() { parent::__construct(); - $this->tdmcreate = TDMCreate::getInstance(); + $this->tdmcreate = TDMCreateHelper::getInstance(); } /* * @static function &getInstance @@ -300,9 +300,23 @@ * @param string $fields * @param string $required */ - private function getXoopsFormTopic($language, $moduleDirname, $tableName, $field_id, $field_pid, $fieldName, $field_main, $required = 'false') + private function getXoopsFormTopic($language, $moduleDirname, $table, $fields, $required = 'false') { + $tableName = $table->getVar('table_name'); $ucfTableName = ucfirst($tableName); + foreach(array_keys($fields) as $f) + { + $fieldName = $fields[$f]->getVar('field_name'); + if(($f == 0) && ($table->getVar('table_autoincrement') == 1)) { + $fieldId = $fieldName; + } + if($fields[$f]->getVar('field_parent') == 1) { + $fieldPid = $fieldName; + } + if($fields[$f]->getVar('field_main') == 1) { + $fieldMain = $fieldName; + } + } $ret = <<<EOT // Form Topic {$ucfTableName} //\${$tableName}Handler = \$this->{$moduleDirname}->getHandler('{$tableName}'); @@ -310,9 +324,9 @@ \${$tableName} = \${$tableName}Handler->getObjects( \$criteria ); if(\${$tableName}) { include_once(XOOPS_ROOT_PATH . '/class/tree.php'); - \${$tableName}_tree = new XoopsObjectTree( \${$tableName}, '{$field_id}', '{$field_pid}' ); - \${$field_pid} = \${$tableName}_tree->makeSelBox( '{$field_pid}', '{$field_main}', '--', \$this->getVar('{$field_pid}', 'e' ), true ); - \$form->addElement( new XoopsFormLabel ( {$language}, \${$field_pid} ){$required} ); + \${$tableName}_tree = new XoopsObjectTree( \${$tableName}, '{$fieldId}', '{$fieldPid}' ); + \${$fieldPid} = \${$tableName}_tree->makeSelBox( '{$fieldPid}', '{$fieldMain}', '--', \$this->getVar('{$fieldPid}', 'e' ), true ); + \$form->addElement( new XoopsFormLabel ( {$language}, \${$fieldPid} ){$required} ); }\n EOT; return $ret; @@ -399,7 +413,7 @@ } if ($fieldElement > 13) { if($table->getVar('table_category') == 1) { - $ret .= $this->getXoopsFormTopic($language, $moduleDirname, $tableName, $fieldId, $fieldPid, $fieldName, $fieldMain, $required); + $ret .= $this->getXoopsFormTopic($language, $moduleDirname, $table, $fields, $required); } else { $ret .= $this->getXoopsFormTable($language, $moduleDirname, $tableName, $fieldName, $fieldElement, $required); } Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/TDMCreateHtmlSmartyCodes.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/TDMCreateHtmlSmartyCodes.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/TDMCreateHtmlSmartyCodes.php 2014-12-06 21:54:48 UTC (rev 12888) @@ -0,0 +1,308 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +/** + * tdmcreate module + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package tdmcreate + * @since 2.5.0 + * @author Txmod Xoops http://www.txmodxoops.org + * @version $Id: htmlsmartycodes.php 12258 2014-01-02 09:33:29Z timgno $ + */ +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class TDMCreateHtmlSmartyCodes extends TDMCreateFile +{ + /* + * @public function constructor + * @param null + */ + public function __construct() { + parent::__construct(); + } + /* + * @static function &getInstance + * @param null + */ + public static function &getInstance() + { + static $instance = false; + if (!$instance) { + $instance = new self(); + } + return $instance; + } + /* + * @public function getHtmlDiv + * @param string $class + * @param string $content + */ + public function getHtmlDiv($class = 'bnone', $content = '') { + $ret = <<<EOT + <div class='{$class}'> + {$content} + </div> +EOT; + return $ret; + } + /* + * @public function getHtmlSpan + * @param string $class + * @param string $content + */ + public function getHtmlSpan($class = 'bnone', $content = '') { + $ret = <<<EOT + <span class='{$class}'> + {$content} + </span> +EOT; + return $ret; + } + /* + * @public function getHtmlParagraph + * @param string $class + * @param string $content + */ + public function getHtmlParagraph($class = 'bnone', $content = '') { + $ret = <<<EOT + <p class='{$class}'> + {$content} + </p> +EOT; + return $ret; + } + /* + * @public function getHtmlAnchor + * @param string $class + * @param string $url + * @param string $target + * @param string $content + */ + public function getHtmlAnchor($class = 'bnone', $url = 'http://', $target = '_top', $content = '') { + $ret = <<<EOT + <a class='{$class}' href='{$url}' target='{$target}'> + {$content} + </a> +EOT; + return $ret; + } + /* + * @public function getHtmlImage + * @param string $class + * @param string $src + * @param string $alt + */ + public function getHtmlImage($class = 'bnone', $src = 'blank.gif', $alt = 'blank.gif') { + $ret = <<<EOT + <img class='{$class}' src='{$src}' alt='{$alt}' /> +EOT; + return $ret; + } + /* + * @public function getHtmlTable + * @param string $class + * @param string $content + */ + public function getHtmlTable($class = 'bnone', $content = '') { + $ret = <<<EOT + <table class='{$class}'> + {$content} + </table> +EOT; + return $ret; + } + /* + * @public function getHtmlTableThead + * @param string $class + * @param string $content + */ + public function getHtmlTableThead($class = 'bnone', $content = '') { + $ret = <<<EOT + <thead class='{$class}'> + {$content} + </thead> +EOT; + return $ret; + } + /* + * @public function getHtmlTableTbody + * @param string $class + * @param string $content + */ + public function getHtmlTableTbody($class = 'bnone', $content = '') { + $ret = <<<EOT + <tbody class='{$class}'> + {$content} + </tbody> +EOT; + return $ret; + } + /* + * @public function getHtmlTableTfoot + * @param string $class + * @param string $content + */ + public function getHtmlTableTfoot($class = 'bnone', $content = '') { + $ret = <<<EOT + <tfoot class='{$class}'> + {$content} + </tfoot> +EOT; + return $ret; + } + /* + * @public function getHtmlTableHead + * @param string $class + * @param string $content + */ + public function getHtmlTableHead($class = 'bnone', $content = '') { + $ret = <<<EOT + <th class='{$class}'>{$content}</th> +EOT; + return $ret; + } + /* + * @public function getHtmlTableRow + * @param string $class + * @param string $content + */ + public function getHtmlTableRow($class = 'bnone', $content = '') { + $ret = <<<EOT + <tr class='{$class}'> + {$content} + </tr> +EOT; + return $ret; + } + /* + * @public function getHtmlTableData + * @param string $class + * @param string $content + */ + public function getHtmlTableData($class = 'bnone', $content = '') { + $ret = <<<EOT + <td class='{$class}'>{$content}</td> +EOT; + return $ret; + } + /* + * @public function getSmartyConst + * @param string $language + * @param mixed $fieldName + */ + public function getSmartyConst($language, $fieldName) { + $ret = <<<EOT + <{\$smarty.const.{$language}{$fieldName}}> +EOT; + return $ret; + } + /* + * @public function getSmartyTableFieldNameEmptyData + * @param string $tableName + * @param string $fieldName + */ + public function getSmartyTableFieldNameEmptyData($tableName = '', $fieldName = '') { + $ret = <<<EOT + <{\${$tableName}.{$fieldName}}> +EOT; + return $ret; + } + /* + * @public function getSmartyTableField + * @param string $tableFieldname + * @param string $fieldName + */ + public function getSmartyTableFieldData($tableFieldname = '', $fieldName = '') { + $ret = <<<EOT + <{\${$tableFieldname}.{$fieldName}}> +EOT; + return $ret; + } + /* + * @public function getSmartyIncludeFile + * @param string $name + */ + public function getSmartyIncludeFile($moduleDirname, $tableName = 'header') { + $ret = <<<EOT + <{include file='db:{$moduleDirname}_{$tableName}.html'}> +EOT; + return $ret; + } + /* + * @public function getSmartyConditions + * @param string $condition + * @param string $operator + * @param string $type + * @param string $content_if + * @param mixed $content_else + */ + public function getSmartyConditions($condition = '', $operator = '==', $type = '1', $content_if = '', $content_else = false) { + if(!$content_else) { + $ret = <<<EOT + <{if ${$condition} {$operator} {$type}'}> + {$content_if} + <{/if}> +EOT; + } else { + $ret = <<<EOT + <{if ${$condition} {$operator} {$type}'}> + {$content_if} + <{else}> + {$content_else} + <{/if}> +EOT; + } + return $ret; + } + /* + * @public function getSmartyForeach + * @param string $item + * @param string $from + * @param string $content + */ + public function getSmartyForeach($item = 'item', $from = 'from', $content = 'content') { + $ret = <<<EOT + <{foreach item={$item} from=${$from}}> + {$content} + <{/foreach}> +EOT; + return $ret; + } + /* + * @public function getSmartyForeachQuery + * @param string $item + * @param string $from + * @param string $content + */ + public function getSmartyForeachQuery($item = 'item', $from = 'from', $content = 'content') { + $ret = <<<EOT + <{foreachq item={$item} from=${$from}}> + {$content} + <{/foreachq}> +EOT; + return $ret; + } + /* + * @public function getSmartySection + * @param string $name + * @param string $loop + * @param string $content + */ + public function getSmartySection($name = 'name', $loop = 'loop', $content = 'content') { + $ret = <<<EOT + <{section name={$name} loop=${$loop}}> + {$content} + <{/section}> +EOT; + return $ret; + } +} \ No newline at end of file Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php 2014-12-04 21:57:19 UTC (rev 12887) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php 2014-12-06 21:54:48 UTC (rev 12888) @@ -113,7 +113,7 @@ switch( $fieldElement ) { case 9: $ret .= <<<EOT - <td class="center"><span style="background-color: <{\$list.{$rpFieldName}}>;"> </span></td>\n + <td class="center"><span style="background-color: #<{\$list.{$rpFieldName}}>;"> </span></td>\n EOT; break; case 10: @@ -176,7 +176,7 @@ switch( $fieldElement ) { case 9: $ret .= <<<EOT - <td class="center"><span style="background-color: <{\$list.{$fieldName}}>;">\t\t</span></td>\n + <td class="center"><span style="background-color: #<{\$list.{$fieldName}}>;">\t\t</span></td>\n EOT; break; case 10: Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/blocks/TemplatesBlocks.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/blocks/TemplatesBlocks.php 2014-12-04 21:57:19 UTC (rev 12887) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/blocks/TemplatesBlocks.php 2014-12-06 21:54:48 UTC (rev 12888) @@ -102,7 +102,7 @@ switch( $fieldElement ) { case 9: $ret .= <<<EOT - <td class="center"><span style="background-color: <{\$list.{$rpFieldName}}>;">\t\t</span></td>\n + <td class="center"><span style="background-color: #<{\$list.{$rpFieldName}}>;">\t\t</span></td>\n EOT; break; case 10: @@ -156,7 +156,7 @@ switch( $fieldElement ) { case 9: $ret .= <<<EOT - <td class="center"><span style="background-color: <{\$list.{$fieldName}}>;">\t\t</span></td>\n + <td class="center"><span style="background-color: #<{\$list.{$fieldName}}>;">\t\t</span></td>\n EOT; break; case 10: Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/TemplatesUserPages.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/TemplatesUserPages.php 2014-12-04 21:57:19 UTC (rev 12887) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/TemplatesUserPages.php 2014-12-06 21:54:48 UTC (rev 12888) @@ -107,7 +107,7 @@ switch( $fieldElement ) { case 9: $ret .= <<<EOT - <td class="center"><span style="background-color: <{\$list.{$rpFieldName}}>;">\t\t</span></td>\n + <td class="center"><span style="background-color: #<{\$list.{$rpFieldName}}>;">\t\t</span></td>\n EOT; break; case 10: @@ -159,7 +159,7 @@ switch( $fieldElement ) { case 9: $ret .= <<<EOT - <td class="center"><span style="background-color: <{\$list.{$fieldName}}>;"></span></td>\n + <td class="center"><span style="background-color: #<{\$list.{$fieldName}}>;"></span></td>\n EOT; break; case 10: Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/modules.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/modules.php 2014-12-04 21:57:19 UTC (rev 12887) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/modules.php 2014-12-06 21:54:48 UTC (rev 12888) @@ -40,7 +40,7 @@ */ public function __construct() { - $this->tdmcreate = TDMCreate::getInstance(); + $this->tdmcreate = TDMCreateHelper::getInstance(); $this->initVar('mod_id',XOBJ_DTYPE_INT); $this->initVar('mod_name',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('name')); $this->initVar('mod_dirname',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('dirname')); Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/request.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/request.php 2014-12-04 21:57:19 UTC (rev 12887) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/request.php 2014-12-06 21:54:48 UTC (rev 12888) @@ -1,960 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ -/** - * Request class - * - * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. - * @license GNU/GPL, see LICENSE.php - * Joomla! is free software. This version may have been modified pursuant - * to the GNU General Public License, and as distributed it includes or - * is derivative of works licensed under the GNU General Public License or - * other free or open source software licenses. - * See COPYRIGHT.php for copyright notices and details. - * @package TDMCreate - * @since 1.0 - * @author trabis <lus...@gm...> - * @version $Id: request.php 10374 2012-12-12 23:39:48Z trabis $ - * @version $Id: request.php 12424 2014-04-18 22:11:14Z timgno $ - */ - -/** - * Set the available masks for cleaning variables - */ -define('TDMCREATE_REQUEST_NOTRIM', 1); -define('TDMCREATE_REQUEST_ALLOWRAW', 2); -define('TDMCREATE_REQUEST_ALLOWHTML', 4); - -/** - * TDMCreateRequest Class - * This class serves to provide a common interface to access - * request variables. This includes $_POST, $_GET, and naturally $_REQUEST. Variables - * can be passed through an input filter to avoid injection or returned raw. - */ -class TDMCreateRequest -{ - - /** - * Gets the request method - * - * @return string - */ - static function getOptions() - { - $method = strtoupper($_SERVER['REQUEST_METHOD']); - return $method; - } - - /** - * Fetches and returns a given variable. - * The default behaviour is fetching variables depending on the - * current request method: GET and HEAD will result in returning - * an entry from $_GET, POST and PUT will result in returning an - * entry from $_POST. - * You can force the source by setting the $hash parameter: - * post $_POST - * get $_GET - * files $_FILES - * cookie $_COOKIE - * env $_ENV - * server $_SERVER - * method via current $_SERVER['REQUEST_METHOD'] - * default $_REQUEST - * - * @static - * - * @param string $name Variable name - * @param string $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * @param string $type Return type for the variable, for valid values see {@link JFilterInput::clean()} - * @param int $mask Filter mask for the variable - * - * @return mixed Requested variable - */ - static function getVar($name, $default = null, $hash = 'default', $type = 'none', $mask = 0) - { - // Ensure hash and type are uppercase - $hash = strtoupper($hash); - if ($hash === 'METHOD') { - $hash = strtoupper($_SERVER['REQUEST_METHOD']); - } - $type = strtoupper($type); - // Get the input hash - switch ($hash) { - case 'GET' : - $input = & $_GET; - break; - case 'POST' : - $input = & $_POST; - break; - case 'FILES' : - $input = & $_FILES; - break; - case 'COOKIE' : - $input = & $_COOKIE; - break; - case 'ENV' : - $input = & $_ENV; - break; - case 'SERVER' : - $input = & $_SERVER; - break; - default: - $input = & $_REQUEST; - $hash = 'REQUEST'; - break; - } - if (isset($input[$name]) && $input[$name] !== null) { - // Get the variable from the input hash and clean it - $var = TDMCreateRequest::_cleanVar($input[$name], $mask, $type); - // Handle magic quotes compatability - if (get_magic_quotes_gpc() && ($var != $default) && ($hash != 'FILES')) { - $var = TDMCreateRequest::_stripSlashesRecursive($var); - } - } else if ($default !== null) { - // Clean the default value - $var = TDMCreateRequest::_cleanVar($default, $mask, $type); - } else { - $var = $default; - } - return $var; - } - - /** - * Fetches and returns a given filtered variable. The integer - * filter will allow only digits to be returned. This is currently - * only a proxy function for getVar(). - * See getVar() for more in-depth documentation on the parameters. - * - * @static - * - * @param string $name Variable name - * @param int $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * - * @return integer Requested variable - */ - static function getInt($name, $default = 0, $hash = 'default') - { - return TDMCreateRequest::getVar($name, $default, $hash, 'int'); - } - - /** - * Fetches and returns a given filtered variable. The float - * filter only allows digits and periods. This is currently - * only a proxy function for getVar(). - * See getVar() for more in-depth documentation on the parameters. - * - * @static - * - * @param string $name Variable name - * @param float $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * - * @return float Requested variable - */ - static function getFloat($name, $default = 0.0, $hash = 'default') - { - return TDMCreateRequest::getVar($name, $default, $hash, 'float'); - } - - /** - * Fetches and returns a given filtered variable. The bool - * filter will only return true/false bool values. This is - * currently only a proxy function for getVar(). - * See getVar() for more in-depth documentation on the parameters. - * - * @static - * - * @param string $name Variable name - * @param bool $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * - * @return bool Requested variable - */ - static function getBool($name, $default = false, $hash = 'default') - { - return TDMCreateRequest::getVar($name, $default, $hash, 'bool'); - } - - /** - * Fetches and returns a given filtered variable. The word - * filter only allows the characters [A-Za-z_]. This is currently - * only a proxy function for getVar(). - * See getVar() for more in-depth documentation on the parameters. - * - * @static - * - * @param string $name Variable name - * @param string $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * - * @return string Requested variable - */ - static function getWord($name, $default = '', $hash = 'default') - { - return TDMCreateRequest::getVar($name, $default, $hash, 'word'); - } - - /** - * Fetches and returns a given filtered variable. The cmd - * filter only allows the characters [A-Za-z0-9.-_]. This is - * currently only a proxy function for getVar(). - * See getVar() for more in-depth documentation on the parameters. - * - * @static - * - * @param string $name Variable name - * @param string $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * - * @return string Requested variable - */ - static function getCmd($name, $default = '', $hash = 'default') - { - return TDMCreateRequest::getVar($name, $default, $hash, 'cmd'); - } - - /** - * Fetches and returns a given filtered variable. The string - * filter deletes 'bad' HTML code, if not overridden by the mask. - * This is currently only a proxy function for getVar(). - * See getVar() for more in-depth documentation on the parameters. - * - * @static - * - * @param string $name Variable name - * @param string $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * @param int $mask Filter mask for the variable - * - * @return string Requested variable - */ - static function getString($name, $default = '', $hash = 'default', $mask = 0) - { - // Cast to string, in case JREQUEST_ALLOWRAW was specified for mask - return (string)TDMCreateRequest::getVar($name, $default, $hash, 'string', $mask); - } - - static function getArray($name, $default = array(), $hash = 'default') - { - return TDMCreateRequest::getVar($name, $default, $hash, 'array'); - } - - static function getText($name, $default = '', $hash = 'default') - { - return (string)TDMCreateRequest::getVar($name, $default, $hash, 'string', TDMCREATE_REQUEST_ALLOWRAW); - } - - /** - * Set a variabe in on of the request variables - * - * @access public - * - * @param string $name Name - * @param string $value Value - * @param string $hash Hash - * @param boolean $overwrite Boolean - * - * @return string Previous value - */ - static function setVar($name, $value = null, $hash = 'method', $overwrite = true) - { - //If overwrite is true, makes sure the variable hasn't been set yet - if (!$overwrite && array_key_exists($name, $_REQUEST)) { - return $_REQUEST[$name]; - } - // Get the request hash value - $hash = strtoupper($hash); - if ($hash === 'METHOD') { - $hash = strtoupper($_SERVER['REQUEST_METHOD']); - } - $previous = array_key_exists($name, $_REQUEST) ? $_REQUEST[$name] : null; - switch ($hash) { - case 'GET' : - $_GET[$name] = $value; - $_REQUEST[$name] = $value; - break; - case 'POST' : - $_POST[$name] = $value; - $_REQUEST[$name] = $value; - break; - case 'COOKIE' : - $_COOKIE[$name] = $value; - $_REQUEST[$name] = $value; - break; - case 'FILES' : - $_FILES[$name] = $value; - break; - case 'ENV' : - $_ENV['name'] = $value; - break; - case 'SERVER' : - $_SERVER['name'] = $value; - break; - } - return $previous; - } - - /** - * Fetches and returns a request array. - * The default behaviour is fetching variables depending on the - * current request method: GET and HEAD will result in returning - * $_GET, POST and PUT will result in returning $_POST. - * You can force the source by setting the $hash parameter: - * post $_POST - * get $_GET - * files $_FILES - * cookie $_COOKIE - * env $_ENV - * server $_SERVER - * method via current $_SERVER['REQUEST_METHOD'] - * default $_REQUEST - * - * @static - * - * @param string $hash to get (POST, GET, FILES, METHOD) - * @param int $mask Filter mask for the variable - * - * @return mixed Request hash - */ - static function get($hash = 'default', $mask = 0) - { - $hash = strtoupper($hash); - if ($hash === 'METHOD') { - $hash = strtoupper($_SERVER['REQUEST_METHOD']); - } - switch ($hash) { - case 'GET' : - $input = $_GET; - break; - case 'POST' : - $input = $_POST; - break; - case 'FILES' : - $input = $_FILES; - break; - case 'COOKIE' : - $input = $_COOKIE; - break; - case 'ENV' : - $input = & $_ENV; - break; - case 'SERVER' : - $input = & $_SERVER; - break; - default: - $input = $_REQUEST; - break; - } - $result = TDMCreateRequest::_cleanVar($input, $mask); - // Handle magic quotes compatability - if (get_magic_quotes_gpc() && ($hash != 'FILES')) { - $result = TDMCreateRequest::_stripSlashesRecursive($result); - } - return $result; - } - - /** - * Sets a request variable - * - * @param array $array An associative array of key-value pairs - * @param string $hash The request variable to set (POST, GET, FILES, METHOD) - * @param boolean $overwrite If true and an existing key is found, the value is overwritten, otherwise it is ingored - */ - static function set($array, $hash = 'default', $overwrite = true) - { - foreach ($array as $key => $value) { - TDMCreateRequest::setVar($key, $value, $hash, $overwrite); - } - } - - /** - * Cleans the request from script injection. - * - * @static - * @return void - */ - static function clean() - { - TDMCreateRequest::_cleanArray($_FILES); - TDMCreateRequest::_cleanArray($_ENV); - TDMCreateRequest::_cleanArray($_GET); - TDMCreateRequest::_cleanArray($_POST); - TDMCreateRequest::_cleanArray($_COOKIE); - TDMCreateRequest::_cleanArray($_SERVER); - if (isset($_SESSION)) { - TDMCreateRequest::_cleanArray($_SESSION); - } - $REQUEST = $_REQUEST; - $GET = $_GET; - $POST = $_POST; - $COOKIE = $_COOKIE; - $FILES = $_FILES; - $ENV = $_ENV; - $SERVER = $_SERVER; - if (isset ($_SESSION)) { - $SESSION = $_SESSION; - } - foreach ($GLOBALS as $key => $value) { - if ($key != 'GLOBALS') { - unset($GLOBALS[$key]); - } - } - $_REQUEST = $REQUEST; - $_GET = $GET; - $_POST = $POST; - $_COOKIE = $COOKIE; - $_FILES = $FILES; - $_ENV = $ENV; - $_SERVER = $SERVER; - if (isset($SESSION)) { - $_SESSION = $SESSION; - } - } - - /** - * Adds an array to the GLOBALS array and checks that the GLOBALS variable is not being attacked - * - * @access protected - * - * @param array $array Array to clean - * @param boolean $globalise True if the array is to be added to the GLOBALS - */ - static function _cleanArray(&$array, $globalise = false) - { - static $banned = array('_files', '_env', '_get', '_post', '_cookie', '_server', '_session', 'globals'); - foreach ($array as $key => $value) { - // PHP GLOBALS injection bug - $failed = in_array(strtolower($key), $banned); - // PHP Zend_Hash_Del_Key_Or_Index bug - $failed |= is_numeric($key); - if ($failed) { - exit('Illegal variable <strong>' . implode('</strong> or <strong>', $banned) . '</strong> passed to script.'); - } - if ($globalise) { - $GLOBALS[$key] = $value; - } - } - } - - /** - * Clean up an input variable. - * - * @param mixed $var The input variable. - * @param int $mask Filter bit mask. 1=no trim: If this flag is cleared and the - * input is a string, the string will have leading and trailing whitespace - * trimmed. 2=allow_raw: If set, no more filtering is performed, higher bits - * are ignored. 4=allow_html: HTML is allowed, but passed through a safe - * HTML filter first. If set, no more filtering is performed. If no bits - * other than the 1 bit is set, a strict filter is applied. - * @param string $type The variable type {@see JFilterInput::clean()}. - * - * @return string - */ - static function _cleanVar($var, $mask = 0, $type = null) - { - // Static input filters for specific settings - static $noHtmlFilter = null; - static $safeHtmlFilter = null; - // If the no trim flag is not set, trim the variable - if (!($mask & 1) && is_string($var)) { - $var = trim($var); - } - // Now we handle input filtering - if ($mask & 2) { - // If the allow raw flag is set, do not modify the variable - } else if ($mask & 4) { - // If the allow html flag is set, apply a safe html filter to the variable - if (is_null($safeHtmlFilter)) { - $safeHtmlFilter = TDMCreateFilterInput::getInstance(null, null, 1, 1); - } - $var = $safeHtmlFilter->clean($var, $type); - } else { - // Since no allow flags were set, we will apply the most strict filter to the variable - if (is_null($noHtmlFilter)) { - $noHtmlFilter = TDMCreateFilterInput::getInstance( /* $tags, $attr, $tag_method, $attr_method, $xss_auto */); - } - $var = $noHtmlFilter->clean($var, $type); - } - return $var; - } - - /** - * Strips slashes recursively on an array - * - * @access protected - * - * @param array $value Array of (nested arrays of) strings - * - * @return array|string The input array with stripshlashes applied to it - */ - protected function _stripSlashesRecursive($value) - { - $value = is_array($value) ? array_map(array('TDMCreateRequest', '_stripSlashesRecursive'), $value) : stripslashes($value); - return $value; - } -} - -/** - * TDMCreateInput is a class for filtering input from any data source - * Forked from the php input filter library by: Daniel Morris <da...@ro...> - * Original Contributors: Gianpaolo Racca, Ghislain Picard, Marco Wandschneider, Chris Tobin and Andrew Eddie. - * - * @author Louis Landry <lou...@jo...> - */ -class TDMCreateFilterInput -{ - var $tagsArray; // default = empty array - var $attrArray; // default = empty array - var $tagsMethod; // default = 0 - var $attrMethod; // default = 0 - var $xssAuto; // default = 1 - var $tagBlacklist = array('applet', 'body', 'bgsound', 'base', 'basefont', 'embed', 'frame', 'frameset', 'head', 'html', 'id', 'iframe', 'ilayer', 'layer', 'link', 'meta', 'name', 'object', 'script', 'style', 'title', 'xml'); - var $attrBlacklist = array('action', 'background', 'codebase', 'dynsrc', 'lowsrc'); // also will strip ALL event handlers - /** - * Constructor for inputFilter class. Only first parameter is required. - * - * @access protected - * - * @param array $tagsArray list of user-defined tags - * @param array $attrArray list of user-defined attributes - * @param int $tagsMethod WhiteList method = 0, BlackList method = 1 - * @param int $attrMethod WhiteList method = 0, BlackList method = 1 - * @param int $xssAuto Only auto clean essentials = 0, Allow clean blacklisted tags/attr = 1 - */ - public function __construct($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1) - { - // Make sure user defined arrays are in lowercase - $tagsArray = array_map('strtolower', (array)$tagsArray); - $attrArray = array_map('strtolower', (array)$attrArray); - // Assign member variables - $this->tagsArray = $tagsArray; - $this->attrArray = $attrArray; - $this->tagsMethod = $tagsMethod; - $this->attrMethod = $attrMethod; - $this->xssAuto = $xssAuto; - } - - /** - * Returns a reference to an input filter object, only creating it if it doesn't already exist. - * This method must be invoked as: - * <pre> $filter = & TDMCreateFilterInput::getInstance();</pre> - * - * @static - * - * @param array $tagsArray list of user-defined tags - * @param array $attrArray list of user-defined attributes - * @param int $tagsMethod WhiteList method = 0, BlackList method = 1 - * @param int $attrMethod WhiteList method = 0, BlackList method = 1 - * @param int $xssAuto Only auto clean essentials = 0, Allow clean blacklisted tags/attr = 1 - * - * @return object The TDMCreateFilterInput object. - * @since 1.5 - */ - public function & getInstance($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1) - { - static $instances; - $sig = md5(serialize(array($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto))); - if (!isset ($instances)) { - $instances = array(); - } - if (empty ($instances[$sig])) { - $instances[$sig] = new TDMCreateFilterInput($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto); - } - return $instances[$sig]; - } - - /** - * Method to be called by another php script. Processes for XSS and - * specified bad code. - * - * @access public - * - * @param mixed $source Input string/array-of-string to be 'cleaned' - * @param string $type Return type for the variable (INT, FLOAT, BOOLEAN, WORD, ALNUM, CMD, BASE64, STRING, ARRAY, PATH, NONE) - * - * @return mixed 'Cleaned' version of input parameter - * @static - */ - public function clean($source, $type = 'string') - { - // Handle the type constraint - switch (strtoupper($type)) { - case 'INT' : - case 'INTEGER' : - // Only use the first integer value - preg_match('/-?[0-9]+/', (string)$source, $matches); - $result = @ (int)$matches[0]; - break; - case 'FLOAT' : - case 'DOUBLE' : - // Only use the first floating point value - preg_match('/-?[0-9]+(\.[0-9]+)?/', (string)$source, $matches); - $result = @ (float)$matches[0]; - break; - case 'BOOL' : - case 'BOOLEAN' : - $result = (bool)$source; - break; - case 'WORD' : - $result = (string)preg_replace('/[^A-Z_]/i', '', $source); - break; - case 'ALNUM' : - $result = (string)preg_replace('/[^A-Z0-9]/i', '', $source); - break; - case 'CMD' : - $result = (string)preg_replace('/[^A-Z0-9_\.-]/i', '', $source); - $result = ltrim($result, '.'); - break; - case 'BASE64' : - $result = (string)preg_replace('/[^A-Z0-9\/+=]/i', '', $source); - break; - case 'STRING' : - // Check for static usage and assign $filter the proper variable - if (isset($this) && is_a($this, 'TDMCreateFilterInput')) { - $filter =& $this; - } else { - $filter = TDMCreateFilterInput::getInstance(); - } - $result = (string)$filter->_remove($filter->_decode((string)$source)); - break; - case 'ARRAY' : - $result = (array)$source; - break; - case 'PATH' : - $pattern = '/^[A-Za-z0-9_-]+[A-Za-z0-9_\.-]*([\\\\\/][A-Za-z0-9_-]+[A-Za-z0-9_\.-]*)*$/'; - preg_match($pattern, (string)$source, $matches); - $result = @ (string)$matches[0]; - break; - case 'USERNAME' : - $result = (string)preg_replace('/[\x00-\x1F\x7F<>"\'%&]/', '', $source); - break; - default : - // Check for static usage and assign $filter the proper variable - if (is_object($this) && get_class($this) == 'TDMCreateFilterInput') { - $filter =& $this; - } else { - $filter = TDMCreateFilterInput::getInstance(); - } - // Are we dealing with an array? - if (is_array($source)) { - foreach ($source as $key => $value) { - // filter element for XSS and other 'bad' code etc. - if (is_string($value)) { - $source[$key] = $filter->_remove($filter->_decode($value)); - } - } - $result = $source; - } else { - // Or a string? - if (is_string($source) && !empty ($source)) { - // filter source for XSS and other 'bad' code etc. - $result = $filter->_remove($filter->_decode($source)); - } else { - // Not an array or string.. return the passed parameter - $result = $source; - } - } - break; - } - return $result; - } - - /** - * Function to determine if contents of an attribute is safe - * - * @static - * - * @param array $attrSubSet A 2 element array for attributes name,value - * - * @return boolean True if bad code is detected - */ - public function checkAttribute($attrSubSet) - { - $attrSubSet[0] = strtolower($attrSubSet[0]); - $attrSubSet[1] = strtolower($attrSubSet[1]); - return (((strpos($attrSubSet[1], 'expression') !== false) && ($attrSubSet[0]) == 'style') || (strpos($attrSubSet[1], 'javascript:') !== false) || (strpos($attrSubSet[1], 'behaviour:') !== false) || (strpos($attrSubSet[1], 'vbscript:') !== false) || (strpos($attrSubSet[1], 'mocha:') !== false) || (strpos($attrSubSet[1], 'livescript:') !== false)); - } - - /** - * Internal method to iteratively remove all unwanted tags and attributes - * - * @access protected - * - * @param string $source Input string to be 'cleaned' - * - * @return string 'Cleaned' version of input parameter - */ - protected function _remove($source) - { - $loopCounter = 0; - // Iteration provides nested tag protection - while ($source != $this->_cleanTags($source)) { - $source = $this->_cleanTags($source); - $loopCounter++; - } - retur... [truncated message content] |
From: <txm...@us...> - 2014-12-04 21:57:26
|
Revision: 12887 http://sourceforge.net/p/xoops/svn/12887 Author: txmodxoops Date: 2014-12-04 21:57:19 +0000 (Thu, 04 Dec 2014) Log Message: ----------- Added folders for horoscope module in next time Added Paths: ----------- XoopsModules/horoscope/ XoopsModules/horoscope/branchies/ XoopsModules/horoscope/releases/ XoopsModules/horoscope/trunk/ |
From: <txm...@us...> - 2014-12-03 11:09:31
|
Revision: 12886 http://sourceforge.net/p/xoops/svn/12886 Author: txmodxoops Date: 2014-12-03 11:09:22 +0000 (Wed, 03 Dec 2014) Log Message: ----------- Added folders for budget module in next time Added Paths: ----------- XoopsModules/budget/ XoopsModules/budget/branchies/ XoopsModules/budget/releases/ XoopsModules/budget/trunk/ |
From: <txm...@us...> - 2014-12-03 11:05:42
|
Revision: 12885 http://sourceforge.net/p/xoops/svn/12885 Author: txmodxoops Date: 2014-12-03 11:05:38 +0000 (Wed, 03 Dec 2014) Log Message: ----------- Added folders for estimate module in next time Added Paths: ----------- XoopsModules/estimate/ XoopsModules/estimate/branchies/ XoopsModules/estimate/releases/ XoopsModules/estimate/trunk/ |
From: <txm...@us...> - 2014-12-03 11:02:20
|
Revision: 12884 http://sourceforge.net/p/xoops/svn/12884 Author: txmodxoops Date: 2014-12-03 11:02:18 +0000 (Wed, 03 Dec 2014) Log Message: ----------- Added folders for invoices module in next time Added Paths: ----------- XoopsModules/invoices/ XoopsModules/invoices/branchies/ XoopsModules/invoices/releases/ XoopsModules/invoices/trunk/ |
From: <luc...@us...> - 2014-12-02 21:23:40
|
Revision: 12883 http://sourceforge.net/p/xoops/svn/12883 Author: luciorota Date: 2014-12-02 21:23:27 +0000 (Tue, 02 Dec 2014) Log Message: ----------- ! fixed some database fields length + support multiple test emails * templatize some admin side page + use DateTime object instead of strtotime() function + added xnewsletter_randomLipsum() function (in_progress) Modified Paths: -------------- XoopsModules/xnewsletter/branches/luciorota/xnewsletter/admin/attachment.php XoopsModules/xnewsletter/branches/luciorota/xnewsletter/admin/letter.php XoopsModules/xnewsletter/branches/luciorota/xnewsletter/admin/maintenance.php XoopsModules/xnewsletter/branches/luciorota/xnewsletter/admin/subscr.php XoopsModules/xnewsletter/branches/luciorota/xnewsletter/admin/template.php XoopsModules/xnewsletter/branches/luciorota/xnewsletter/class/import.php XoopsModules/xnewsletter/branches/luciorota/xnewsletter/class/letter.php XoopsModules/xnewsletter/branches/luciorota/xnewsletter/class/subscr.php XoopsModules/xnewsletter/branches/luciorota/xnewsletter/class/template.php XoopsModules/xnewsletter/branches/luciorota/xnewsletter/docs/changelog.txt XoopsModules/xnewsletter/branches/luciorota/xnewsletter/include/functions.php XoopsModules/xnewsletter/branches/luciorota/xnewsletter/include/task.inc.php XoopsModules/xnewsletter/branches/luciorota/xnewsletter/language/english/admin.php XoopsModules/xnewsletter/branches/luciorota/xnewsletter/language/english/common.php XoopsModules/xnewsletter/branches/luciorota/xnewsletter/sql/mysql.sql XoopsModules/xnewsletter/branches/luciorota/xnewsletter/xoops_version.php Added Paths: ----------- XoopsModules/xnewsletter/branches/luciorota/xnewsletter/templates/admin/xnewsletter_admin_attachments_list.tpl XoopsModules/xnewsletter/branches/luciorota/xnewsletter/templates/admin/xnewsletter_admin_letters_list.tpl XoopsModules/xnewsletter/branches/luciorota/xnewsletter/templates/admin/xnewsletter_admin_subscrs_list.tpl XoopsModules/xnewsletter/branches/luciorota/xnewsletter/templates/admin/xnewsletter_admin_templates_list.tpl Modified: XoopsModules/xnewsletter/branches/luciorota/xnewsletter/admin/attachment.php =================================================================== --- XoopsModules/xnewsletter/branches/luciorota/xnewsletter/admin/attachment.php 2014-12-02 21:16:19 UTC (rev 12882) +++ XoopsModules/xnewsletter/branches/luciorota/xnewsletter/admin/attachment.php 2014-12-02 21:23:27 UTC (rev 12883) @@ -37,64 +37,50 @@ switch ($op) { case 'list': + case 'list_attachments': default: echo $indexAdmin->addNavigation($currentFile); echo $indexAdmin->renderButton(); // - $limit = $xnewsletter->getConfig('adminperpage'); - $attachmentCriteria = new CriteriaCompo(); - $attachmentCriteria->setSort('attachment_letter_id DESC, attachment_id'); - $attachmentCriteria->setOrder('DESC'); $attachmentCount = $xnewsletter->getHandler('attachment')->getCount(); - $start = xnewsletterRequest::getInt('start', 0); - $attachmentCriteria->setStart($start); - $attachmentCriteria->setLimit($limit); - $attachmentObjs = $xnewsletter->getHandler('attachment')->getObjects($attachmentCriteria, true); - if ($attachmentCount > $limit) { - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; - $pagenav = new XoopsPageNav($attachmentCount, $limit, $start, 'start', 'op=list'); - $pagenav = $pagenav->renderNav(4); - } else { - $pagenav = ''; - } - // output table - echo "<table class='outer' cellspacing='1'>"; - echo "<tr>"; - echo " <th>" . _AM_XNEWSLETTER_ATTACHMENT_ID . "</th>"; - echo " <th>" . _AM_XNEWSLETTER_ATTACHMENT_LETTER_ID . "</th>"; - echo " <th>" . _AM_XNEWSLETTER_ATTACHMENT_NAME . "</th>"; - echo " <th>" . _AM_XNEWSLETTER_ATTACHMENT_SIZE . "<br />" . _AM_XNEWSLETTER_ATTACHMENT_TYPE . "</th>"; - echo " <th>" . _AM_XNEWSLETTER_ATTACHMENT_SUBMITTER . "</th>"; - echo " <th>" . _AM_XNEWSLETTER_ATTACHMENT_CREATED . "</th>"; - echo " <th>" . _AM_XNEWSLETTER_FORMACTION . "</th>"; - echo "</tr>"; if ($attachmentCount > 0) { - $class = 'odd'; - foreach ($attachmentObjs as $attachment_id => $attachmentObj) { - $letterObj = $xnewsletter->getHandler('letter')->get($attachmentObj->getVar('attachment_letter_id')); - echo "<tr class='{$class}'>"; - $class = ($class == 'even') ? 'odd' : 'even'; - echo "<td class='center'>{$attachment_id}</td>"; - echo "<td>" . $letterObj->getVar('letter_title') . "</td>"; - echo "<td>" . $attachmentObj->getVar('attachment_name') . "</td>"; - echo "<td>"; - echo "<span title='" . $attachmentObj->getVar('attachment_size') . " B'>" . xnewsletter_bytesToSize1024($attachmentObj->getVar('attachment_size')) . "</span>"; - echo "<br />"; - echo $attachmentObj->getVar('attachment_type'); - echo "</td>"; - echo "<td>" . XoopsUser::getUnameFromId($attachmentObj->getVar('attachment_submitter'), 'S') . "</td>"; - echo "<td>" . formatTimeStamp($attachmentObj->getVar('attachment_created'), 'S') . "</td>"; - echo "<td class='center'>"; - echo " <a href='?op=edit_attachment&attachment_id={$attachment_id}'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_edit.png alt='" . _EDIT . "' title='" . _EDIT . "' /></a>"; - echo " "; - echo " <a href='?op=delete_attachment&attachment_id={$attachment_id}'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_delete.png alt='" . _DELETE . "' title='" . _DELETE . "' /></a>"; - echo "</td>"; + $attachmentCriteria = new CriteriaCompo(); + // + $attachmentCriteria->setSort('attachment_letter_id DESC, attachment_id'); + $attachmentCriteria->setOrder('DESC'); + // + $start = xnewsletterRequest::getInt('start', 0); + $limit = $xnewsletter->getConfig('adminperpage'); + $attachmentCriteria->setStart($start); + $attachmentCriteria->setLimit($limit); + // + if ($attachmentCount > $limit) { + include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; + $pagenav = new XoopsPageNav($attachmentCount, $limit, $start, 'start', 'op=list'); + $pagenav = $pagenav->renderNav(4); + } else { + $pagenav = ''; } + $GLOBALS['xoopsTpl']->assign('attachments_pagenav', $pagenav); + // + $attachmentObjs = $xnewsletter->getHandler('attachment')->getObjects($attachmentCriteria, true); + $attachments = $xnewsletter->getHandler('attachment')->getObjects($attachmentCriteria, true, false); // as array + foreach ($attachments as $attachment_id => $attachment) { + $letterObj = $xnewsletter->getHandler('letter')->get($attachment['attachment_letter_id']); + $attachment['attachment_letter_title'] = $letterObj->getVar('letter_title'); +// IN PROGRESS +// IN PROGRESS +// IN PROGRESS + $attachment['attachment_submitter_uname'] = XoopsUser::getUnameFromId($attachment['attachment_submitter'], 'S'); + $attachment['attachment_created_formatted'] = formatTimestamp($template['attachment_created'], $xnewsletter->getConfig('dateformat')); + $GLOBALS['xoopsTpl']->append('attachments', $attachment); + } + // + $GLOBALS['xoopsTpl']->display("db:{$xnewsletter->getModule()->dirname()}_admin_attachments_list.tpl"); + } else { + echo _CO_XNEWSLETTER_WARNING_NOATTACHMENTS; } - echo "</table>"; - echo "<br />"; - echo "<div>" . $pagenav . "</div>"; - echo "<br />"; + include_once __DIR__ . '/admin_footer.php'; break; case 'edit_attachment': @@ -105,6 +91,7 @@ $attachmentObj = $xnewsletter->getHandler('attachment')->get($attachment_id); $form = $attachmentObj->getForm(); $form->display(); + include_once __DIR__ . '/admin_footer.php'; break; case 'save_attachment': @@ -123,6 +110,7 @@ $form = $attachmentObj->getForm(); $form->display(); } + include_once __DIR__ . '/admin_footer.php'; break; case 'delete_attachment': @@ -143,7 +131,6 @@ sprintf(_AM_XNEWSLETTER_FORMSUREDEL, $attachmentObj->getVar('attachment_letter_id')) ); } + include_once __DIR__ . '/admin_footer.php'; break; } - -include_once __DIR__ . '/admin_footer.php'; Modified: XoopsModules/xnewsletter/branches/luciorota/xnewsletter/admin/letter.php =================================================================== --- XoopsModules/xnewsletter/branches/luciorota/xnewsletter/admin/letter.php 2014-12-02 21:16:19 UTC (rev 12882) +++ XoopsModules/xnewsletter/branches/luciorota/xnewsletter/admin/letter.php 2014-12-02 21:23:27 UTC (rev 12883) @@ -29,7 +29,6 @@ $currentFile = basename(__FILE__); include_once __DIR__ . '/admin_header.php'; -xoops_cp_header(); // We recovered the value of the argument op in the URL$ $op = xnewsletterRequest::getString('op', 'list'); @@ -38,13 +37,16 @@ switch ($op) { case 'show_preview': case 'show_letter_preview': + // render start here + xoops_cp_header(); + // render submenu echo $indexAdmin->addNavigation($currentFile); $indexAdmin->addItemButton(_AM_XNEWSLETTER_LETTERLIST, '?op=list', 'list'); echo $indexAdmin->renderButton(); // + $letterObj = $xnewsletter->getHandler('letter')->get($letter_id); + // $letterTpl = new XoopsTpl(); - - $letterObj = $xnewsletter->getHandler('letter')->get($letter_id); // subscr data $letterTpl->assign('sex', _AM_XNEWSLETTER_SUBSCR_SEX_PREVIEW); $letterTpl->assign('salutation', _AM_XNEWSLETTER_SUBSCR_SEX_PREVIEW); // new from v1.3 @@ -97,124 +99,109 @@ echo nl2br(utf8_encode($textBody)); echo "</div>"; echo "</div>"; + include_once __DIR__ . '/admin_footer.php'; break; + case 'list': case 'list_letters': default: + // render start here + xoops_cp_header(); + // render submenu echo $indexAdmin->addNavigation($currentFile); $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWLETTER, '?op=new_letter', 'add'); echo $indexAdmin->renderButton(); // - $limit = $xnewsletter->getConfig('adminperpage'); $letterCriteria = new CriteriaCompo(); $letterCriteria->setSort('letter_id'); $letterCriteria->setOrder('DESC'); $letterCount = $xnewsletter->getHandler('letter')->getCount(); - $start = xnewsletterRequest::getInt('start', 0); - $letterCriteria->setStart($start); - $letterCriteria->setLimit($limit); - $letterObjs = $xnewsletter->getHandler('letter')->getObjects($letterCriteria, true); - - // pagenav - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; - $pagenav = new XoopsPageNav($letterCount, $limit, $start, 'start', 'op=list'); - $pagenav = $pagenav->renderNav(); - - // View Table - echo "<table class='outer' cellspacing='1'> - <tr> - <th>" . _AM_XNEWSLETTER_LETTER_ID . "</th> - <th>" . _AM_XNEWSLETTER_LETTER_TITLE . "</th> - <th>" . _AM_XNEWSLETTER_LETTER_CATS . "</th> - <th style='white-space: nowrap'>" . _AM_XNEWSLETTER_LETTER_SUBMITTER . "<br />" . _AM_XNEWSLETTER_LETTER_CREATED . "</th> - <th style='white-space: nowrap'>" . _AM_XNEWSLETTER_LETTER_SENDER . "<br />" . _AM_XNEWSLETTER_LETTER_SENT . "</th> - <th>" . _AM_XNEWSLETTER_LETTER_TEMPLATE . "</th> - <th>" . _AM_XNEWSLETTER_LETTER_ATTACHMENT . "<br />" . _AM_XNEWSLETTER_LETTER_SIZE . "</th> - <th>" . _AM_XNEWSLETTER_LETTER_ACCOUNT . "</th> - <th>" . _AM_XNEWSLETTER_LETTER_EMAIL_TEST . "</th> - <th>" . _AM_XNEWSLETTER_PROTOCOL_LAST_STATUS . "</th> - <th>" . _AM_XNEWSLETTER_FORMACTION . "</th> - </tr>"; if ($letterCount > 0) { - $class = 'odd'; + $limit = $xnewsletter->getConfig('adminperpage'); + $start = xnewsletterRequest::getInt('start', 0); + $letterCriteria->setStart($start); + $letterCriteria->setLimit($limit); + // + $letterObjs = $xnewsletter->getHandler('letter')->getObjects($letterCriteria, true); + $letters = $xnewsletter->getHandler('letter')->getObjects($letterCriteria, true, false); // as array + // pagenav + if ($letterCount > $limit) { + include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; + $pagenav = new XoopsPageNav($letterCount, $limit, $start, 'start', 'op=list'); + $pagenav = $pagenav->renderNav(); + } else { + $pagenav = ''; + } + $GLOBALS['xoopsTpl']->assign('letters_pagenav', $pagenav); + // fill letters array foreach ($letterObjs as $letter_id => $letterObj) { - echo "<tr class='{$class}'>"; - $class = ($class == 'even') ? 'odd' : 'even'; - - echo "<td>{$letter_id}</td>"; - - echo "<td>{$letterObj->getVar('letter_title')}</td>"; - - echo "<td style='white-space: nowrap'>"; - $letter_cat_ids = explode('|', $letterObj->getVar('letter_cats')); + $letter = $letterObj->toArray(); + // + $letter_cat_ids = explode('|', $letter['letter_cats']); + unset($letter['letter_cats']); foreach ($letter_cat_ids as $letter_cat_id) { $catObj = $xnewsletter->getHandler('cat')->get($letter_cat_id); - if (is_object($catObj)) { - echo $catObj->getVar('cat_name') . " <a href='cat.php?op=edit_cat&cat_id={$catObj->getVar('cat_id')}'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_edit.png alt='" . _EDIT - . "' title='" . _EDIT . "' style='padding:1px' /></a>"; - } else { - $letter_cats .= 'Invalid cat_name'; - } - echo "<br />"; + $cat = $catObj->toArray(); + $letter['letter_cats']['letter_cat_id'] = $cat; } - echo "</td>"; - - echo "<td>" . XoopsUser::getUnameFromId($letterObj->getVar('letter_submitter'), 's') . "<br />" . formatTimeStamp($letterObj->getVar('letter_created'), 's') . "</td>"; - - echo "<td>"; - if ($letterObj->getVar('letter_sender') != 0) { - echo XoopsUser::getUnameFromId($letterObj->getVar('letter_sender'), 's'); - } - echo "<br />"; - if ($letterObj->getVar('letter_sent') != false) { - echo formatTimeStamp($letterObj->getVar('letter_sent'), 's'); - } - echo "</td>"; - - echo "<td>"; - preg_match('/db:([0-9]*)/', $letterObj->getVar('letter_template'), $matches); + // + $letter['letter_submitter_uname'] = XoopsUser::getUnameFromId($letter['letter_submitter'], 's'); + $letter['letter_created_formatted'] = formatTimeStamp($letter['letter_created'], 's'); + // + $letter['letter_sender_uname'] = ($letter['letter_sender'] != 0) ? XoopsUser::getUnameFromId($letter['letter_sender'], 's') : ''; + $letter['letter_sent_formatted'] = ($letter['letter_sent'] != false) ? formatTimeStamp($letter['letter_sent'], 's') : ''; + // + preg_match('/db:([0-9]*)/', $letter['letter_template'], $matches); if (isset($matches[1]) && ($templateObj = $xnewsletter->getHandler('template')->get((int)$matches[1]))) { - echo "db:" . $templateObj->getVar('template_title'); - echo " <a href='template.php?op=edit_template&template_id={$templateObj->getVar('template_id')}'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_edit.png alt='" . _EDIT . "' title='" - . _EDIT . "' style='padding:1px' /></a>"; + $template = $templateObj->toArray(); + $template['template_submitter_uname'] = XoopsUser::getUnameFromId($template['template_submitter'], 's'); + $template['template_created_formatted'] = formatTimeStamp($template['template_created'], 's'); } else { - echo "file:" . $letterObj->getVar('letter_template'); + $template_path = XOOPS_ROOT_PATH . '/modules/xnewsletter/language/' . $GLOBALS['xoopsConfig']['language'] . '/templates/'; + if (!is_dir($template_path)) { + $template_path = XOOPS_ROOT_PATH . '/modules/xnewsletter/language/english/templates/'; + } + $templateFile = $template_path . $letter['letter_template'] . '.tpl'; + $template = array( + 'template_id' => null, + 'template_title' => $letter['letter_template'], + 'template_description' => '', + 'template_content' => file_get_contents($templateFile), + 'template_submitter' => null, + 'template_submitter_uname' => '', + 'template_created' => filemtime($templateFile), + 'template_created_formatted' => formatTimeStamp(filemtime($templateFile), 's') + ); } - echo "</td>"; - + unset($letter['letter_template']); + $letter['letter_template'] = $template; + // $attachmentCriteria = new CriteriaCompo(); $attachmentCriteria->add(new Criteria('attachment_letter_id', $letter_id)); $attachmentCount = $xnewsletter->getHandler('attachment')->getCount($attachmentCriteria); $attachmentObjs = $xnewsletter->getHandler('attachment')->getObjects($attachmentCriteria, true); - echo "<td style='white-space: nowrap'>"; - //echo "({$attachmentCount})"; $attachmentsSize = 0; - if ($attachmentCount > 0) { - $attachmentsSize = 0; - echo "<ul>"; - foreach ($attachmentObjs as $attachment_id => $attachmentObj) { - $attachmentsSize = $attachmentsSize + $attachmentObj->getVar('attachment_size'); - $size = xnewsletter_bytesToSize1024($attachmentObj->getVar('attachment_size')); - echo "<li><span title='" . $attachmentObj->getVar('attachment_type') . " " . $size . "'>{$attachmentObj->getVar('attachment_name')}</span></li>"; - } - echo "</ul>"; - echo _AM_XNEWSLETTER_LETTER_ATTACHMENT_TOTALSIZE . ": <span title='" . $attachmentsSize . " Bytes'>" . xnewsletter_bytesToSize1024($attachmentsSize) . "</span>"; - echo "<br />"; + foreach ($attachmentObjs as $attachment_id => $attachmentObj) { + $attachment = $attachmentObj->toArray(); + $attachmentsSize = $attachmentsSize + $attachment['attachment_size']; + $attachment['attachment_size1024'] = xnewsletter_bytesToSize1024($attachment['attachment_size']); + $letter['letter_attachments'][$attachment_id] = $attachment; } + $letter['letter_attachments_size'] = $attachmentsSize; + $letter['letter_attachments_size1024'] = xnewsletter_bytesToSize1024($attachmentsSize); + // $emailSize = xnewsletter_emailSize($letter_id); - echo _AM_XNEWSLETTER_LETTER_EMAIL_SIZE . ": <span title='" . $emailSize . " Bytes (" . _AM_XNEWSLETTER_LETTER_EMAIL_SIZE_DESC . ")'>" . xnewsletter_bytesToSize1024($emailSize) - . "</span>"; - echo "</td>"; - + $letter['letter_size'] = $emailSize; + $letter['letter_size1024'] = xnewsletter_bytesToSize1024($emailSize); + // $accountCriteria = new CriteriaCompo(); $accountCriteria->setSort('accounts_id'); $accountCriteria->setOrder('ASC'); - $accountObj = $xnewsletter->getHandler('accounts')->get($letterObj->getVar('letter_account')); - $letter_account = ($accountObj) ? $accountObj->getVar('accounts_name') : _NONE; - echo "<td>{$letter_account}</td>"; - - echo "<td>{$letterObj->getVar('letter_email_test')} </td>"; - + $accountObj = $xnewsletter->getHandler('accounts')->get($letter['letter_account']); + $account = $accountObj->toArray(); + unset($letter['letter_account']); + $letter['letter_account'] = $account; + // // take last item protocol_subscriber_id=0 from table protocol as actual status $protocolCriteria = new CriteriaCompo(); $protocolCriteria->add(new Criteria('protocol_letter_id', $letter_id)); @@ -222,46 +209,26 @@ $protocolCriteria->setSort('protocol_id'); $protocolCriteria->setOrder('DESC'); $protocolCriteria->setLimit(1); - $protocolObjs = $xnewsletter->getHandler('protocol')->getAll($protocolCriteria); -// IN PROGRESS - $protocol_status = ''; - $protocol_letter_id = 0; - foreach ($protocolObjs as $protocolObj) { -// IN PROGRESS - $protocol_status .= $protocolObj->getVar('protocol_status'); - $protocol_letter_id = $protocolObj->getVar('protocol_letter_id'); + $protocolObjs = $xnewsletter->getHandler('protocol')->getAll($protocolCriteria); + foreach ($protocolObjs as $protocol_id => $protocolObj) { + $protocol = $protocolObj->toArray(); + $letter['letter_protocols'][$protocol_id] = $protocol; } - echo "<td class='center'><a href=' protocol.php?op=list_letter&letter_id={$protocol_letter_id}'>{$protocol_status}</a></td>"; - - echo "<td class='center'>"; - echo " <a href='?op=edit_letter&letter_id={$letter_id}'><img src='" . XNEWSLETTER_ICONS_URL . "/xn_edit.png' alt='" . _EDIT . "' title='" . _EDIT . "' style='padding:1px' /></a>"; - echo " <a href='?op=clone_letter&letter_id={$letter_id}'><img src='" . XNEWSLETTER_ICONS_URL . "/xn_clone.png' alt='" . _CLONE . "' title='" . _CLONE - . "' style='padding:1px' /></a>"; - echo " <a href='?op=delete_letter&letter_id={$letter_id}'><img src='" . XNEWSLETTER_ICONS_URL . "/xn_delete.png' alt='" . _DELETE . "' title='" . _DELETE - . "' style='padding:1px' /></a>"; - echo " <br />"; - echo " <a href='sendletter.php?op=send_test&letter_id={$letter_id}'><img src='" . XNEWSLETTER_ICONS_URL . "/xn_sendtest.png' alt='" . _AM_XNEWSLETTER_LETTER_ACTION_SENDTEST - . "' title='" . _AM_XNEWSLETTER_LETTER_ACTION_SENDTEST . "' style='padding:1px' /></a>"; - echo " <a href='sendletter.php?op=send_letter&letter_id={$letter_id}'><img src='" . XNEWSLETTER_ICONS_URL . "/xn_send.png' alt='" . _AM_XNEWSLETTER_LETTER_ACTION_SEND . "' title='" - . _AM_XNEWSLETTER_LETTER_ACTION_SEND . "' style='padding:1px' /></a>"; - echo " <a href='sendletter.php?op=resend_letter&letter_id={$letter_id}'><img src='" . XNEWSLETTER_ICONS_URL . "/xn_resend.png' alt='" . _AM_XNEWSLETTER_LETTER_ACTION_RESEND - . "' title='" . _AM_XNEWSLETTER_LETTER_ACTION_RESEND . "' style='padding:1px' /></a>"; - echo " <br />"; - echo " <a href='?op=show_preview&letter_id={$letter_id}'><img src='" . XNEWSLETTER_ICONS_URL . "/xn_preview.png' alt='" . _AM_XNEWSLETTER_LETTER_ACTION_PREVIEW . "' title='" - . _AM_XNEWSLETTER_LETTER_ACTION_PREVIEW . "' style='padding:1px' /></a>"; - echo " <a href='" . XNEWSLETTER_URL . "/print.php?letter_id={$letter_id}' target='_BLANK' ><img src='" . XNEWSLETTER_ICONS_URL . "/printer.png' alt='" - . _AM_XNEWSLETTER_LETTER_ACTION_PRINT . "' title='" . _AM_XNEWSLETTER_LETTER_ACTION_PRINT . "' style='padding:1px' /></a>"; - echo "</td>"; - echo "</tr>"; + // + $GLOBALS['xoopsTpl']->append('letters', $letter); } + // + $GLOBALS['xoopsTpl']->display("db:{$xnewsletter->getModule()->dirname()}_admin_letters_list.tpl"); + } else { + echo _CO_XNEWSLETTER_WARNING_NOLETTERS; } - echo "</table>"; - echo "<br />"; - echo "<div>{$pagenav}</div>"; - echo "<br />"; + include_once __DIR__ . '/admin_footer.php'; break; case 'new_letter': + // render start here + xoops_cp_header(); + // render submenu echo $indexAdmin->addNavigation($currentFile); $indexAdmin->addItemButton(_AM_XNEWSLETTER_LETTERLIST, '?op=list', 'list'); echo $indexAdmin->renderButton(); @@ -269,9 +236,13 @@ $letterObj = $xnewsletter->getHandler('letter')->create(); $form = $letterObj->getForm(false, true); $form->display(); + include_once __DIR__ . '/admin_footer.php'; break; case 'edit_letter': + // render start here + xoops_cp_header(); + // render submenu echo $indexAdmin->addNavigation($currentFile); $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWLETTER, '?op=new_letter', 'add'); $indexAdmin->addItemButton(_AM_XNEWSLETTER_LETTERLIST, '?op=list', 'list'); @@ -280,9 +251,13 @@ $letterObj = $xnewsletter->getHandler('letter')->get($letter_id); $form = $letterObj->getForm(false, true); $form->display(); + include_once __DIR__ . '/admin_footer.php'; break; case 'delete_attachment': + // render start here + xoops_cp_header(); + // render submenu echo $indexAdmin->addNavigation($currentFile); $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWLETTER, '?op=new_letter', 'add'); $indexAdmin->addItemButton(_AM_XNEWSLETTER_LETTERLIST, '?op=list', 'list'); @@ -319,6 +294,7 @@ } else { echo $attachmentObj->getHtmlErrors(); } + include_once __DIR__ . '/admin_footer.php'; break; case 'save_letter': @@ -432,6 +408,9 @@ case 'clone_letter': case 'copy_letter': + // render start here + xoops_cp_header(); + // render submenu echo $indexAdmin->addNavigation($currentFile); $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWLETTER, '?op=new_letter', 'add'); $indexAdmin->addItemButton(_AM_XNEWSLETTER_LETTERLIST, '?op=list', 'list'); @@ -443,6 +422,7 @@ $letterObj->setVar('letter_title', sprintf(_AM_XNEWSLETTER_LETTER_CLONED, $letterObj->getVar('letter_title'))); $form = $letterObj->getForm($currentFile, true); $form->display(); + include_once __DIR__ . '/admin_footer.php'; break; case 'delete_letter': @@ -467,8 +447,15 @@ echo $letterObj->getHtmlErrors(); } } else { - xoops_confirm(array('ok' => true, 'letter_id' => $letter_id, 'op' => 'delete_letter'), $_SERVER['REQUEST_URI'], sprintf(_AM_XNEWSLETTER_FORMSUREDEL, $letterObj->getVar('letter_title'))); + // render start here + xoops_cp_header(); + // render confirm form + xoops_confirm( + array('ok' => true, 'letter_id' => $letter_id, 'op' => 'delete_letter'), + $_SERVER['REQUEST_URI'], + sprintf(_AM_XNEWSLETTER_FORMSUREDEL, $letterObj->getVar('letter_title')) + ); + include_once __DIR__ . '/admin_footer.php'; } break; } -include_once __DIR__ . '/admin_footer.php'; Modified: XoopsModules/xnewsletter/branches/luciorota/xnewsletter/admin/maintenance.php =================================================================== --- XoopsModules/xnewsletter/branches/luciorota/xnewsletter/admin/maintenance.php 2014-12-02 21:16:19 UTC (rev 12882) +++ XoopsModules/xnewsletter/branches/luciorota/xnewsletter/admin/maintenance.php 2014-12-02 21:23:27 UTC (rev 12883) @@ -175,7 +175,10 @@ break; case 'del_oldsubscr': - $time = strtotime($_POST['del_date']); + $dateTimeObj = DateTime::createFromFormat(_SHORTDATESTRING, $_POST['del_date']); + $dateTimeObj->setTime(0, 0, 0); + $time = $dateTimeObj->getTimestamp(); + unset($dateTimeObj); if ($time >= time() || $time == 0) { $subscrCount = -1; // for error } else { Modified: XoopsModules/xnewsletter/branches/luciorota/xnewsletter/admin/subscr.php =================================================================== --- XoopsModules/xnewsletter/branches/luciorota/xnewsletter/admin/subscr.php 2014-12-02 21:16:19 UTC (rev 12882) +++ XoopsModules/xnewsletter/branches/luciorota/xnewsletter/admin/subscr.php 2014-12-02 21:23:27 UTC (rev 12883) @@ -29,38 +29,21 @@ $currentFile = basename(__FILE__); include_once __DIR__ . '/admin_header.php'; -xoops_cp_header(); // We recovered the value of the argument op in the URL$ $op = xnewsletterRequest::getString('op', 'list'); -$subscr_id = xnewsletterRequest::getInt('subscr_id', 0); -$filter_subscr = xnewsletterRequest::getString('filter_subscr', '='); -$filter_subscr_firstname = xnewsletterRequest::getString('filter_subscr_firstname', ''); -$filter_subscr_lastname = xnewsletterRequest::getString('filter_subscr_lastname', ''); -$filter_subscr_email = xnewsletterRequest::getString('filter_subscr_email', ''); - -if ($op == 'apply_filter') { - if ($filter_subscr == 'LIKE' && !$filter_subscr_firstname == '') { - $filter_subscr_firstname = "%{$filter_subscr_firstname}%"; - } - if ($filter_subscr == 'LIKE' && !$filter_subscr_lastname == '') { - $filter_subscr_lastname = "%{$filter_subscr_lastname}%"; - } - if ($filter_subscr == 'LIKE' && !$filter_subscr_email == '') { - $filter_subscr_email = "%{$filter_subscr_email}%"; - } - if ($filter_subscr_firstname == '' && $filter_subscr_lastname == '' && $filter_subscr_email == '') { - $op = 'list'; - } -} - $subscrAdmin = new ModuleAdmin(); switch ($op) { case 'show_catsubscr': + $subscr_id = xnewsletterRequest::getInt('subscr_id', 0); + // render start here + xoops_cp_header(); + // render submenu echo $subscrAdmin->addNavigation($currentFile); + // $apply_filter = xnewsletterRequest::getString('apply_filter', 'list'); - $linklist = "?op=$apply_filter&filter_subscr={$filter_subscr}"; + $linklist = "?op=$apply_filter&filter_subscr={$filter_subscr}"; $linklist .= "&filter_subscr_firstname={$filter_subscr_firstname}"; $linklist .= "&filter_subscr_lastname={$filter_subscr_lastname}"; $linklist .= "&filter_subscr_email={$filter_subscr_email}"; @@ -98,11 +81,16 @@ echo "</td>"; echo "</tr>"; echo "</table>"; + include_once __DIR__ . '/admin_footer.php'; break; case 'list': + case 'list_subscrs': case 'apply_filter': default: + // render start here + xoops_cp_header(); + // render submenu echo $subscrAdmin->addNavigation($currentFile); $subscrAdmin->addItemButton(_AM_XNEWSLETTER_NEWSUBSCR, '?op=new_subscr', 'add'); if ($op == 'apply_filter') { @@ -110,163 +98,90 @@ } echo $subscrAdmin->renderButton(); // - $limit = $xnewsletter->getConfig('adminperpage'); - $subscrCriteria = new CriteriaCompo(); - - if ($op == 'apply_filter') { - if ($filter_subscr_firstname != '') { - $subscrCriteria->add(new Criteria('subscr_firstname', $filter_subscr_firstname, $filter_subscr)); - } - if ($filter_subscr_lastname != '') { - $subscrCriteria->add(new Criteria('subscr_lastname', $filter_subscr_lastname, $filter_subscr)); - } - if ($filter_subscr_email != '') { - $subscrCriteria->add(new Criteria('subscr_email', $filter_subscr_email, $filter_subscr)); - } - } - $subscrCriteria->setSort('subscr_id'); - $subscrCriteria->setOrder('DESC'); - $subscrCount = $xnewsletter->getHandler('subscr')->getCount($subscrCriteria); - $start = xnewsletterRequest::getInt('start', 0); - $subscrCriteria->setStart($start); - $subscrCriteria->setLimit($limit); - $subscrObjs = $xnewsletter->getHandler('subscr')->getAll($subscrCriteria); - if ($subscrCount > $limit) { - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; - $linklist = "op={$op}"; - $linklist .= "&filter_subscr={$filter_subscr}"; - $linklist .= "&filter_subscr_firstname={$filter_subscr_firstname}"; - $linklist .= "&filter_subscr_lastname={$filter_subscr_lastname}"; - $linklist .= "&filter_subscr_email={$filter_subscr_email}"; - $pagenav = new XoopsPageNav($subscrCount, $limit, $start, 'start', $linklist); - $pagenav = $pagenav->renderNav(4); - } else { - $pagenav = ''; - } - if ($filter_subscr == 'LIKE') { - //clean up var for refill form - $filter_subscr_firstname = str_replace('%', '', $filter_subscr_firstname); - $filter_subscr_lastname = str_replace('%', '', $filter_subscr_lastname); - $filter_subscr_email = str_replace('%', '', $filter_subscr_email); - } - - // View Table - echo "<table class='outer width100' cellspacing='1'>"; - echo "<tr>"; - echo " <th class='center'><input type='checkbox' title='" . _ALL . "'onClick='toggle(this);'></th>"; - echo " <th>" . _AM_XNEWSLETTER_SUBSCR_ID . "</th>"; - echo " <th>" . _AM_XNEWSLETTER_SUBSCR_SEX . "</th>"; - echo " <th>" . _AM_XNEWSLETTER_SUBSCR_FIRSTNAME . "</th>"; - echo " <th>" . _AM_XNEWSLETTER_SUBSCR_LASTNAME . "</th>"; - echo " <th>" . _AM_XNEWSLETTER_SUBSCR_EMAIL . "</th>"; - echo " <th>" . _AM_XNEWSLETTER_SUBSCR_UID . "</th>"; - echo " <th>" . _AM_XNEWSLETTER_SUBSCR_CREATED . "</th>"; - echo " <th>" . _AM_XNEWSLETTER_FORMACTION . "</th>"; - echo "</tr>"; - - if ($subscrCount > 0) { - $class = 'odd'; - echo "<form id='form_filter' enctype='multipart/form-data' method='post' action='{$currentFile}' name='form_filter'>"; - $inputstyle = '';//style='border: 1px solid #000000;"; - echo "<tr class='{$class}'>"; - $class = ($class == 'even') ? 'odd' : 'even'; - echo " <td class='center'> </td>"; - echo " <td colspan='2'>" . _SEARCH . ": "; - echo " <select id='filter_subscr' title='" . _SEARCH . "' name='filter_subscr' size='1'>"; - echo " <option value='='" . (($filter_subscr == "=") ? " selected='selected'" : "") . ">" . _AM_XNEWSLETTER_SEARCH_EQUAL . "</option>"; - echo " <option value='LIKE'" . (($filter_subscr == "LIKE") ? " selected='selected'" : "") . ">" . _AM_XNEWSLETTER_SEARCH_CONTAINS . "</option>"; - echo " </select>"; - echo " </td>"; - echo " <td><input {$inputstyle} id='filter_subscr_firstname' type='text' value='{$filter_subscr_firstname}' maxlength='50' size='15' title='' name='filter_subscr_firstname'></td>"; - echo " <td><input {$inputstyle} id='filter_subscr_lastname' type='text' value='{$filter_subscr_lastname}' maxlength='50' size='15' title='' name='filter_subscr_lastname'></td>"; - echo " <td><input {$inputstyle} id='filter_subscr_email' type='text' value='{$filter_subscr_email}' maxlength='255' size='40' title='' name='filter_subscr_email'></td>"; - echo " <td> </td>"; - echo " <td> </td>"; - echo " <td class='center'><input id='filter_submit' class='formButton' type='submit' title='" . _SEARCH . "' value='" . _SEARCH . "' name='filter_submit'></td>"; - echo "</tr>"; - echo "<input id='filter_op' type='hidden' value='apply_filter' name='op'>"; - echo "</form>"; - - echo "<script language='JavaScript'> - function toggle(source) - { - checkboxes = document.getElementsByName('subscr_ids[]'); - for (var i=0, n=checkboxes.length;i<n;i++) { - checkboxes[i].checked = source.checked; + $subsrCount = $xnewsletter->getHandler('subscr')->getCount(); + if ($subsrCount > 0) { + // get filter parameters + $filter_subscr = xnewsletterRequest::getString('filter_subscr', '='); + $filter_subscr_firstname = xnewsletterRequest::getString('filter_subscr_firstname', ''); + $filter_subscr_lastname = xnewsletterRequest::getString('filter_subscr_lastname', ''); + $filter_subscr_email = xnewsletterRequest::getString('filter_subscr_email', ''); + if ($op == 'apply_filter') { + if ($filter_subscr == 'LIKE' && !$filter_subscr_firstname == '') { + $filter_subscr_firstname = "%{$filter_subscr_firstname}%"; } - } - </script>"; - echo "<script language='JavaScript'> - function check(source) - { - checkboxes = document.getElementsByName('subscr_ids[]'); - for (var i=0, n=checkboxes.length;i<n;i++) { - if (checkboxes[i].checked) return true; + if ($filter_subscr == 'LIKE' && !$filter_subscr_lastname == '') { + $filter_subscr_lastname = "%{$filter_subscr_lastname}%"; } - - return false; + if ($filter_subscr == 'LIKE' && !$filter_subscr_email == '') { + $filter_subscr_email = "%{$filter_subscr_email}%"; + } + if ($filter_subscr_firstname == '' && $filter_subscr_lastname == '' && $filter_subscr_email == '') { + $op = 'list'; + } } - </script>"; - - echo "<form id='form_action' onsubmit='return check(this);' enctype='multipart/form-data' method='post' action='{$currentFile}' name='form_action'>"; - foreach ($subscrObjs as $subscr_id => $subscrObj) { - echo "<tr class='{$class}'>"; - $class = ($class == 'even') ? 'odd' : 'even'; - echo " <td class='center'><input type='checkbox' name='subscr_ids[]' value='{$subscr_id}'></td>"; - echo " <td>" . $subscr_id . "</td>"; - echo " <td>" . $subscrObj->getVar('subscr_sex') . " </td>"; - echo " <td>" . $subscrObj->getVar('subscr_firstname') . " </td>"; - echo " <td>" . $subscrObj->getVar('subscr_lastname') . " </td>"; - echo " <td>" . $subscrObj->getVar('subscr_email') . " </td>"; - echo " <td>"; - if ($subscrObj->getVar('subscr_uid') > 0) { - echo XoopsUser::getUnameFromId($subscrObj->getVar('subscr_uid'), 'S'); - } else { - echo "-"; + // get filtered subscrs criteria + $subscrCriteria = new CriteriaCompo(); + if ($op == 'apply_filter') { + if ($filter_subscr_firstname != '') { + $subscrCriteria->add(new Criteria('subscr_firstname', $filter_subscr_firstname, $filter_subscr)); } - echo " </td>"; - echo " <td>"; - if ($subscrObj->getVar('subscr_activated') == 0) { - echo '<img src="' . XNEWSLETTER_ICONS_URL . '/xn_failed.png" alt="' . _AM_XNEWSLETTER_SUBSCRWAIT . '" title="' . _AM_XNEWSLETTER_SUBSCRWAIT . '" /> '; - } else { - echo '<img src="' . XNEWSLETTER_ICONS_URL . '/xn_ok.png" alt="' . _MA_XNEWSLETTER_SUBSCRIPTION_REG_CLOSED . '" title="' . _MA_XNEWSLETTER_SUBSCRIPTION_REG_CLOSED . '" /> '; + if ($filter_subscr_lastname != '') { + $subscrCriteria->add(new Criteria('subscr_lastname', $filter_subscr_lastname, $filter_subscr)); } - echo formatTimestamp($subscrObj->getVar("subscr_created"), $xnewsletter->getConfig('dateformat')) . " [" . $subscrObj->getVar('subscr_ip') . "]"; - echo " </td>"; - - echo " <td class='center' nowrap='nowrap'>"; - echo " <a href='?op=edit_subscr&subscr_id={$subscr_id}'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_edit.png alt='" . _EDIT . "' title='" . _EDIT . "' /></a>"; - echo " "; - echo " <a href='?op=delete_subscr&subscr_id={$subscr_id}'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_delete.png alt='" . _DELETE . "' title='" . _DELETE . "' /></a>"; - echo " "; - echo " <a href='?op=show_catsubscr&subscr_id={$subscr_id}&filter_subscr={$filter_subscr}&filter_subscr_firstname={$filter_subscr_firstname}&filter_subscr_lastname={$filter_subscr_lastname}&filter_subscr_email={$filter_subscr_email}&apply_filter={$op}'>"; - echo " <img src=" . XNEWSLETTER_ICONS_URL . "/xn_details.png alt='" . _AM_XNEWSLETTER_DETAILS . "' title='" . _AM_XNEWSLETTER_DETAILS . "' />"; - echo " </a>"; - echo " </td>"; - echo "</tr>"; - -// $filter_subscr = xnewsletterRequest::getString('filter_subscr', '='); -// $filter_subscr_firstname = xnewsletterRequest::getString('filter_subscr_firstname', ''); -// $filter_subscr_lastname = xnewsletterRequest::getString('filter_subscr_lastname', ''); -// $filter_subscr_email = xnewsletterRequest::getString('filter_subscr_email', ''); + if ($filter_subscr_email != '') { + $subscrCriteria->add(new Criteria('subscr_email', $filter_subscr_email, $filter_subscr)); + } } - echo "<tr>"; - echo " <td colspan='9'>"; - echo " <select id='actions_action' name='actions_action' size='1'>"; - echo " <option value='delete'>" . _DELETE . "</option>"; - echo " <option value='activate'>" . _AM_XNEWSLETTER_ACTIONS_ACTIVATE . "</option>"; - echo " <option value='unactivate'>" . _AM_XNEWSLETTER_ACTIONS_UNACTIVATE . "</option>"; - echo " </select>"; - echo " <input id='actions_submit' class='formButton' type='submit' title='" . _AM_XNEWSLETTER_ACTIONS_EXEC . "' value='" . _AM_XNEWSLETTER_ACTIONS_EXEC . "' name='actions_submit'>"; - echo " </td>"; - echo "</tr>"; - echo "<input id='actions_op' type='hidden' value='apply_actions' name='op'>"; - echo "</form>"; + $subsrFilterCount = $xnewsletter->getHandler('subscr')->getCount($subscrCriteria); + // + $subscrCriteria->setSort('subscr_id'); + $subscrCriteria->setOrder('DESC'); + // + $start = xnewsletterRequest::getInt('start', 0); + $limit = $xnewsletter->getConfig('adminperpage'); + $subscrCriteria->setStart($start); + $subscrCriteria->setLimit($limit); + // + $subscrObjs = $xnewsletter->getHandler('subscr')->getAll($subscrCriteria); + $subscrs = $xnewsletter->getHandler('subscr')->getObjects($subscrCriteria, true, false); // as array + if ($subsrFilterCount > $limit) { + include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; + $linklist = "op={$op}"; + $linklist .= "&filter_subscr={$filter_subscr}"; + $linklist .= "&filter_subscr_firstname={$filter_subscr_firstname}"; + $linklist .= "&filter_subscr_lastname={$filter_subscr_lastname}"; + $linklist .= "&filter_subscr_email={$filter_subscr_email}"; + $pagenav = new XoopsPageNav($subsrFilterCount, $limit, $start, 'start', $linklist); + $pagenav = $pagenav->renderNav(4); + } else { + $pagenav = ''; + } + $GLOBALS['xoopsTpl']->assign('subscrs_pagenav', $pagenav); + // + if ($filter_subscr == 'LIKE') { + //clean up var for refill form + $filter_subscr_firstname = str_replace('%', '', $filter_subscr_firstname); + $filter_subscr_lastname = str_replace('%', '', $filter_subscr_lastname); + $filter_subscr_email = str_replace('%', '', $filter_subscr_email); + } + $GLOBALS['xoopsTpl']->assign('filter_subscr', $filter_subscr); + $GLOBALS['xoopsTpl']->assign('filter_subscr_firstname', $filter_subscr_firstname); + $GLOBALS['xoopsTpl']->assign('filter_subscr_lastname', $filter_subscr_lastname); + $GLOBALS['xoopsTpl']->assign('filter_subscr_email', $filter_subscr_email); + // + $GLOBALS['xoopsTpl']->assign('token', $GLOBALS['xoopsSecurity']->getTokenHTML()); + // fill subscrs array + foreach ($subscrs as $subscr_id => $subscr) { + $subscr['subscr_uname'] = XoopsUser::getUnameFromId($subscr['subscr_uid'], 'S'); + $subscr['subscr_created_formatted'] = formatTimestamp($subscr['subscr_created'], $xnewsletter->getConfig('dateformat')); + $GLOBALS['xoopsTpl']->append('subscrs', $subscr); + } + // + $GLOBALS['xoopsTpl']->display("db:{$xnewsletter->getModule()->dirname()}_admin_subscrs_list.tpl"); + } else { + echo _CO_XNEWSLETTER_WARNING_NOSUBSCRS; } - echo "</table>"; - echo "<br />"; - echo "<div>" . $pagenav . "</div>"; - echo "<br />"; + include_once __DIR__ . '/admin_footer.php'; break; case 'apply_actions': @@ -287,11 +202,15 @@ foreach ($xnewsletter->getHandler('subscr')->getObjects($subscrCriteria) as $subscrObj) { $subscr_emails[] = $subscrObj->getVar('subscr_email'); } + // render start here + xoops_cp_header(); + // render confirm form xoops_confirm( array('ok' => true, 'op' => 'apply_actions', 'actions_action' => $action, 'serialize_subscr_ids' => serialize($subscr_ids)), $_SERVER['REQUEST_URI'], sprintf(_AM_XNEWSLETTER_FORMSUREDEL, implode(', ', $subscr_emails)) ); + include_once __DIR__ . '/admin_footer.php'; } break; case 'activate': @@ -317,6 +236,9 @@ break; case 'new_subscr': + // render start here + xoops_cp_header(); + // render submenu echo $subscrAdmin->addNavigation($currentFile); $subscrAdmin->addItemButton(_AM_XNEWSLETTER_SUBSCRLIST, '?op=list', 'list'); echo $subscrAdmin->renderButton(); @@ -324,9 +246,11 @@ $subscrObj = $xnewsletter->getHandler('subscr')->create(); $form = $subscrObj->getFormAdmin(); $form->display(); + include_once __DIR__ . '/admin_footer.php'; break; case 'save_subscr': + $subscr_id = xnewsletterRequest::getInt('subscr_id', 0); if (!$GLOBALS["xoopsSecurity"]->check()) { redirect_header($currentFile, 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); } @@ -346,13 +270,20 @@ if ($xnewsletter->getHandler('subscr')->insert($subscrObj)) { redirect_header('?op=list', 3, _AM_XNEWSLETTER_FORMOK); } - // + // render start here + xoops_cp_header(); + // render form echo $subscrObj->getHtmlErrors(); $form = $subscrObj->getFormAdmin(); $form->display(); + include_once __DIR__ . '/admin_footer.php'; break; case 'edit_subscr': + $subscr_id = xnewsletterRequest::getInt('subscr_id', 0); + // render start here + xoops_cp_header(); + // render submenu echo $subscrAdmin->addNavigation($currentFile); $subscrAdmin->addItemButton(_AM_XNEWSLETTER_NEWSUBSCR, '?op=new_subscr', 'add'); $subscrAdmin->addItemButton(_AM_XNEWSLETTER_SUBSCRLIST, '?op=list', 'list'); @@ -361,9 +292,11 @@ $subscrObj = $xnewsletter->getHandler('subscr')->get($subscr_id); $form = $subscrObj->getFormAdmin(); $form->display(); + include_once __DIR__ . '/admin_footer.php'; break; case 'delete_subscr': + $subscr_id = xnewsletterRequest::getInt('subscr_id', 0); $subscrObj = $xnewsletter->getHandler('subscr')->get($subscr_id); if (xnewsletterRequest::getBool('ok', false, 'POST') == true) { if (!$GLOBALS['xoopsSecurity']->check()) { @@ -376,12 +309,15 @@ echo $subscrObj->getHtmlErrors(); } } else { + // render start here + xoops_cp_header(); + // render confirm form xoops_confirm( array('ok' => true, 'subscr_id' => $_REQUEST['subscr_id'], 'op' => 'delete_subscr'), $_SERVER['REQUEST_URI'], sprintf(_AM_XNEWSLETTER_FORMSUREDEL, $subscrObj->getVar('subscr_email')) ); + include_once __DIR__ . '/admin_footer.php'; } break; } -include_once __DIR__ . '/admin_footer.php'; Modified: XoopsModules/xnewsletter/branches/luciorota/xnewsletter/admin/template.php =================================================================== --- XoopsModules/xnewsletter/branches/luciorota/xnewsletter/admin/template.php 2014-12-02 21:16:19 UTC (rev 12882) +++ XoopsModules/xnewsletter/branches/luciorota/xnewsletter/admin/template.php 2014-12-02 21:23:27 UTC (rev 12883) @@ -36,6 +36,61 @@ $template_id = xnewsletterRequest::getInt('template_id', 0); switch ($op) { + case 'show_preview': + case 'show_template_preview': + echo $indexAdmin->addNavigation($currentFile); + $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWTEMPLATE, '?op=new_template', 'add'); + $indexAdmin->addItemButton(_AM_XNEWSLETTER_TEMPLATELIST, '?op=list', 'list'); + echo $indexAdmin->renderButton(); + // + $templateObj = $xnewsletter->getHandler('template')->get($template_id); + // + $letterTpl = new XoopsTpl(); + // subscr data + $letterTpl->assign('sex', _AM_XNEWSLETTER_SUBSCR_SEX_PREVIEW); + $letterTpl->assign('salutation', _AM_XNEWSLETTER_SUBSCR_SEX_PREVIEW); // new from v1.3 + $letterTpl->assign('firstname', _AM_XNEWSLETTER_SUBSCR_FIRSTNAME_PREVIEW); + $letterTpl->assign('lastname', _AM_XNEWSLETTER_SUBSCR_LASTNAME_PREVIEW); + $letterTpl->assign('subscr_email', _AM_XNEWSLETTER_SUBSCR_EMAIL_PREVIEW); + $letterTpl->assign('email', _AM_XNEWSLETTER_SUBSCR_EMAIL_PREVIEW); // new from v1.3 + // letter data + $letterTpl->assign('title', '<{$title}>'); // new from v1.3 + //$letterTpl->assign('content', xnewsletter_randomLipsum(5, 'paras', 0)); + $letterTpl->assign('content', '<{$content}>'); + // letter attachments as link + for ($i = 1; $i <= 5; ++$i) { + $attachment_array['attachment_id'] = $i; + $attachment_array['attachment_letter_id'] = '#'; + $attachment_array['attachment_name'] = '<{$attachment_name}>'; + $attachment_array['attachment_type'] = '<{$attachment_type}>'; + $attachment_array['attachment_submitter'] = '<{$attachment_submitter}>'; + $attachment_array['attachment_created'] = time(); + $attachment_array['attachment_size'] = '<{$attachment_size}>'; + $attachment_array['attachment_mode'] = '<{$attachment_mode}>'; + $attachment_array['attachment_url'] = '#'; + $attachment_array['attachment_link'] = '#'; + $letterTpl->append('attachments', $attachment_array); + } + // extra data + $letterTpl->assign('date', time()); // new from v1.3 + $letterTpl->assign('unsubscribe_url', '#'); + $letterTpl->assign('catsubscr_id', '0'); + + $htmlBody = $letterTpl->fetchFromData($templateObj->getVar('template_content', 'n')); + $textBody = xnewsletter_html2text($htmlBody); // new from v1.3 + + echo "<h2>{$templateObj->getVar('template_title')}</h2>"; + echo "<div style='clear:both'>"; + echo "<div style='padding:10px;border:1px solid black'>"; + echo $htmlBody; + echo "</div>"; + echo "<div style='padding:10px;border:1px solid black; font-family: monospace;'>"; + echo nl2br(utf8_encode($textBody)); + echo "</div>"; + echo "</div>"; + include_once __DIR__ . '/admin_footer.php'; + break; + case 'list': case 'list_templates': default: @@ -43,56 +98,40 @@ $indexAdmin->addItemButton(_AM_XNEWSLETTER_NEWTEMPLATE, '?op=new_template', 'add'); echo $indexAdmin->renderButton(); // - $limit = $xnewsletter->getConfig('adminperpage'); - $templateCriteria = new CriteriaCompo(); - $templateCriteria->setSort('template_title DESC, template_id'); - $templateCriteria->setOrder('DESC'); - $templatesCount = $xnewsletter->getHandler('template')->getCount(); - $start = xnewsletterRequest::getInt('start', 0); - $templateCriteria->setStart($start); - $templateCriteria->setLimit($limit); - $templateObjs = $xnewsletter->getHandler('template')->getAll($templateCriteria); - if ($templatesCount > $limit) { - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; - $pagenav = new XoopsPageNav($templatesCount, $limit, $start, 'start', 'op=list'); - $pagenav = $pagenav->renderNav(4); + $templateCount = $xnewsletter->getHandler('template')->getCount(); + if ($templateCount > 0) { + $templateCriteria = new CriteriaCompo(); + // + $templateCriteria->setSort('template_title DESC, template_id'); + $templateCriteria->setOrder('DESC'); + // + $start = xnewsletterRequest::getInt('start', 0); + $limit = $xnewsletter->getConfig('adminperpage'); + $templateCriteria->setStart($start); + $templateCriteria->setLimit($limit); + // + if ($templateCount > $limit) { + include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; + $pagenav = new XoopsPageNav($templateCount, $limit, $start, 'start', 'op=list'); + $pagenav = $pagenav->renderNav(4); + } else { + $pagenav = ''; + } + $GLOBALS['xoopsTpl']->assign('subscrs_pagenav', $pagenav); + // + $templateObjs = $xnewsletter->getHandler('template')->getAll($templateCriteria); + $templates = $xnewsletter->getHandler('template')->getObjects($templateCriteria, true, false); // as array + foreach ($templates as $template_id => $template) { + $template['template_submitter_uname'] = XoopsUser::getUnameFromId($template['template_submitter'], 'S'); + $template['template_created_formatted'] = formatTimestamp($template['template_created'], $xnewsletter->getConfig('dateformat')); + $GLOBALS['xoopsTpl']->append('templates', $template); + } + // + $GLOBALS['xoopsTpl']->display("db:{$xnewsletter->getModule()->dirname()}_admin_templates_list.tpl"); } else { - $pagenav = ''; + echo _CO_XNEWSLETTER_WARNING_NOTEMPLATES; } - - // View Table - echo "<table class='outer width100' cellspacing='1'>"; - echo "<tr>"; - echo " <th>" . _AM_XNEWSLETTER_TEMPLATE_ID . "</th>"; - echo " <th>" . _AM_XNEWSLETTER_TEMPLATE_TITLE . "</th>"; - echo " <th>" . _AM_XNEWSLETTER_TEMPLATE_DESCRIPTION . "</th>"; - echo " <th>" . _AM_XNEWSLETTER_TEMPLATE_SUBMITTER . "</th>"; - echo " <th>" . _AM_XNEWSLETTER_TEMPLATE_CREATED . "</th>"; - echo " <th>" . _AM_XNEWSLETTER_FORMACTION . "</th>"; - echo "</tr>"; - - if ($templatesCount > 0) { - $class = 'odd'; - foreach ($templateObjs as $template_id => $templateObj) { - echo "<tr class='{$class}'>"; - $class = ($class == 'even') ? 'odd' : 'even'; - echo "<td>" . $template_id . "</td>"; - echo "<td>" . $templateObj->getVar("template_title") . "</td>"; - echo "<td>" . $templateObj->getVar("template_description") . "</td>"; - echo "<td class='center'>" . XoopsUser::getUnameFromId($templateObj->getVar("template_submitter"), "S") . "</td>"; - echo "<td class='center'>" . formatTimeStamp($templateObj->getVar("template_created"), "S") . "</td>"; - echo "<td class='center' nowrap='nowrap'>"; - echo " <a href='?op=edit_template&template_id=" . $template_id . "'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_edit.png alt='" . _EDIT . "' title='" . _EDIT . "' /></a>"; - echo " "; - echo " <a href='?op=delete_template&template_id=" . $template_id . "'><img src=" . XNEWSLETTER_ICONS_URL . "/xn_delete.png alt='" . _DELETE . "' title='" . _DELETE . "' /></a>"; - echo "</td>"; - echo "</tr>"; - } - } - echo "</table>"; - echo "<br />"; - echo "<div>{$pagenav}</div>"; - echo "<br />"; + include_once __DIR__ . '/admin_footer.php'; break; case 'new_template': @@ -103,6 +142,7 @@ $templateObj = $xnewsletter->getHandler('template')->create(); $form = $templateObj->getForm(); $form->display(); + include_once __DIR__ . '/admin_footer.php'; break; case 'save_template': @@ -123,6 +163,7 @@ echo $templateObj->getHtmlErrors(); $form = $templateObj->getForm(); $form->display(); + include_once __DIR__ . '/admin_footer.php'; break; case 'edit_template': @@ -134,6 +175,7 @@ $templateObj = $xnewsletter->getHandler('template')->get($template_id); $form = $templateObj->getForm(); $form->display(); + ... [truncated message content] |
From: <luc...@us...> - 2014-12-02 21:16:21
|
Revision: 12882 http://sourceforge.net/p/xoops/svn/12882 Author: luciorota Date: 2014-12-02 21:16:19 +0000 (Tue, 02 Dec 2014) Log Message: ----------- Xoops 2.5.7.1+ compatibility removed request.php Removed Paths: ------------- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/request.php Deleted: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/request.php =================================================================== --- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/request.php 2014-11-30 21:34:06 UTC (rev 12881) +++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/request.php 2014-12-02 21:16:19 UTC (rev 12882) @@ -1,1012 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ -/** - * WfdownloadsRequest class - * - * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. - * @license GNU/GPL, see LICENSE.php - * Joomla! is free software. This version may have been modified pursuant - * to the GNU General Public License, and as distributed it includes or - * is derivative of works licensed under the GNU General Public License or - * other free or open source software licenses. - * See COPYRIGHT.php for copyright notices and details. - * @package Wfdownloads - * @since 3.23 - * @author trabis <lus...@gm...> - * @version $Id: request.php 10374 2012-12-12 23:39:48Z trabis $ - */ - -/** - * Set the available masks for cleaning variables - */ -define('WFDOWNLOADS_REQUEST_NOTRIM', 1); -define('WFDOWNLOADS_REQUEST_ALLOWRAW', 2); -define('WFDOWNLOADS_REQUEST_ALLOWHTML', 4); - -/** - * WfdownloadsRequest Class - * This class serves to provide a common interface to access - * request variables. This includes $_POST, $_GET, and naturally $_REQUEST. Variables - * can be passed through an input filter to avoid injection or returned raw. - */ -class WfdownloadsRequest -{ - - /** - * Gets the request method - * - * @return string - */ - static function getMethod() - { - $method = strtoupper($_SERVER['REQUEST_METHOD']); - - return $method; - } - - /** - * Fetches and returns a given variable. - * The default behaviour is fetching variables depending on the - * current request method: GET and HEAD will result in returning - * an entry from $_GET, POST and PUT will result in returning an - * entry from $_POST. - * You can force the source by setting the $hash parameter: - * post $_POST - * get $_GET - * files $_FILES - * cookie $_COOKIE - * env $_ENV - * server $_SERVER - * method via current $_SERVER['REQUEST_METHOD'] - * default $_REQUEST - * - * @static - * - * @param string $name Variable name - * @param string $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * @param string $type Return type for the variable, for valid values see {@link JFilterInput::clean()} - * @param int $mask Filter mask for the variable - * - * @return mixed Requested variable - */ - static function getVar($name, $default = null, $hash = 'default', $type = 'none', $mask = 0) - { - // Ensure hash and type are uppercase - $hash = strtoupper($hash); - if ($hash === 'METHOD') { - $hash = strtoupper($_SERVER['REQUEST_METHOD']); - } - $type = strtoupper($type); - // Get the input hash - switch ($hash) { - case 'GET' : - $input = & $_GET; - break; - case 'POST' : - $input = & $_POST; - break; - case 'FILES' : - $input = & $_FILES; - break; - case 'COOKIE' : - $input = & $_COOKIE; - break; - case 'ENV' : - $input = & $_ENV; - break; - case 'SERVER' : - $input = & $_SERVER; - break; - default: - $input = & $_REQUEST; - $hash = 'REQUEST'; - break; - } - if (isset($input[$name]) && $input[$name] !== null) { - // Get the variable from the input hash and clean it - $var = WfdownloadsRequest::_cleanVar($input[$name], $mask, $type); - // Handle magic quotes compatability - if (get_magic_quotes_gpc() && ($var != $default) && ($hash != 'FILES')) { - $var = WfdownloadsRequest::_stripSlashesRecursive($var); - } - } elseif ($default !== null) { - // Clean the default value - $var = WfdownloadsRequest::_cleanVar($default, $mask, $type); - } else { - $var = $default; - } - - return $var; - } - - /** - * Fetches and returns a given filtered variable. The integer - * filter will allow only digits to be returned. This is currently - * only a proxy function for getVar(). - * See getVar() for more in-depth documentation on the parameters. - * - * @static - * - * @param string $name Variable name - * @param int $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * - * @return integer Requested variable - */ - static function getInt($name, $default = 0, $hash = 'default') - { - return WfdownloadsRequest::getVar($name, $default, $hash, 'int'); - } - - /** - * Fetches and returns a given filtered variable. The float - * filter only allows digits and periods. This is currently - * only a proxy function for getVar(). - * See getVar() for more in-depth documentation on the parameters. - * - * @static - * - * @param string $name Variable name - * @param float $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * - * @return float Requested variable - */ - static function getFloat($name, $default = 0.0, $hash = 'default') - { - return WfdownloadsRequest::getVar($name, $default, $hash, 'float'); - } - - /** - * Fetches and returns a given filtered variable. The bool - * filter will only return true/false bool values. This is - * currently only a proxy function for getVar(). - * See getVar() for more in-depth documentation on the parameters. - * - * @static - * - * @param string $name Variable name - * @param bool $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * - * @return bool Requested variable - */ - static function getBool($name, $default = false, $hash = 'default') - { - return WfdownloadsRequest::getVar($name, $default, $hash, 'bool'); - } - - /** - * Fetches and returns a given filtered variable. The word - * filter only allows the characters [A-Za-z_]. This is currently - * only a proxy function for getVar(). - * See getVar() for more in-depth documentation on the parameters. - * - * @static - * - * @param string $name Variable name - * @param string $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * - * @return string Requested variable - */ - static function getWord($name, $default = '', $hash = 'default') - { - return WfdownloadsRequest::getVar($name, $default, $hash, 'word'); - } - - /** - * Fetches and returns a given filtered variable. The cmd - * filter only allows the characters [A-Za-z0-9.-_]. This is - * currently only a proxy function for getVar(). - * See getVar() for more in-depth documentation on the parameters. - * - * @static - * - * @param string $name Variable name - * @param string $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * - * @return string Requested variable - */ - static function getCmd($name, $default = '', $hash = 'default') - { - return WfdownloadsRequest::getVar($name, $default, $hash, 'cmd'); - } - - /** - * Fetches and returns a given filtered variable. The string - * filter deletes 'bad' HTML code, if not overridden by the mask. - * This is currently only a proxy function for getVar(). - * See getVar() for more in-depth documentation on the parameters. - * - * @static - * - * @param string $name Variable name - * @param string $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * @param int $mask Filter mask for the variable - * - * @return string Requested variable - */ - static function getString($name, $default = '', $hash = 'default', $mask = 0) - { - // Cast to string, in case JREQUEST_ALLOWRAW was specified for mask - return (string) WfdownloadsRequest::getVar($name, $default, $hash, 'string', $mask); - } - - /** - * @param $name - * @param array $default - * @param string $hash - * - * @return mixed - */ - static function getArray($name, $default = array(), $hash = 'default') - { - return WfdownloadsRequest::getVar($name, $default, $hash, 'array'); - } - - /** - * @param $name - * @param string $default - * @param string $hash - * - * @return string - */ - static function getText($name, $default = '', $hash = 'default') - { - return (string) WfdownloadsRequest::getVar($name, $default, $hash, 'string', PUBLISHER_REQUEST_ALLOWRAW); - } - - /** - * Set a variabe in on of the request variables - * - * @access public - * - * @param string $name Name - * @param string $value Value - * @param string $hash Hash - * @param boolean $overwrite Boolean - * - * @return string Previous value - */ - static function setVar($name, $value = null, $hash = 'method', $overwrite = true) - { - //If overwrite is true, makes sure the variable hasn't been set yet - if (!$overwrite && array_key_exists($name, $_REQUEST)) { - return $_REQUEST[$name]; - } - // Get the request hash value - $hash = strtoupper($hash); - if ($hash === 'METHOD') { - $hash = strtoupper($_SERVER['REQUEST_METHOD']); - } - $previous = array_key_exists($name, $_REQUEST) ? $_REQUEST[$name] : null; - switch ($hash) { - case 'GET' : - $_GET[$name] = $value; - $_REQUEST[$name] = $value; - break; - case 'POST' : - $_POST[$name] = $value; - $_REQUEST[$name] = $value; - break; - case 'COOKIE' : - $_COOKIE[$name] = $value; - $_REQUEST[$name] = $value; - break; - case 'FILES' : - $_FILES[$name] = $value; - break; - case 'ENV' : - $_ENV['name'] = $value; - break; - case 'SERVER' : - $_SERVER['name'] = $value; - break; - } - - return $previous; - } - - /** - * Fetches and returns a request array. - * The default behaviour is fetching variables depending on the - * current request method: GET and HEAD will result in returning - * $_GET, POST and PUT will result in returning $_POST. - * You can force the source by setting the $hash parameter: - * post $_POST - * get $_GET - * files $_FILES - * cookie $_COOKIE - * env $_ENV - * server $_SERVER - * method via current $_SERVER['REQUEST_METHOD'] - * default $_REQUEST - * - * @static - * - * @param string $hash to get (POST, GET, FILES, METHOD) - * @param int $mask Filter mask for the variable - * - * @return mixed Request hash - */ - static function get($hash = 'default', $mask = 0) - { - $hash = strtoupper($hash); - if ($hash === 'METHOD') { - $hash = strtoupper($_SERVER['REQUEST_METHOD']); - } - switch ($hash) { - case 'GET' : - $input = $_GET; - break; - case 'POST' : - $input = $_POST; - break; - case 'FILES' : - $input = $_FILES; - break; - case 'COOKIE' : - $input = $_COOKIE; - break; - case 'ENV' : - $input = & $_ENV; - break; - case 'SERVER' : - $input = & $_SERVER; - break; - default: - $input = $_REQUEST; - break; - } - $result = WfdownloadsRequest::_cleanVar($input, $mask); - // Handle magic quotes compatability - if (get_magic_quotes_gpc() && ($hash != 'FILES')) { - $result = WfdownloadsRequest::_stripSlashesRecursive($result); - } - - return $result; - } - - /** - * Sets a request variable - * - * @param array $array An associative array of key-value pairs - * @param string $hash The request variable to set (POST, GET, FILES, METHOD) - * @param boolean $overwrite If true and an existing key is found, the value is overwritten, otherwise it is ingored - */ - static function set($array, $hash = 'default', $overwrite = true) - { - foreach ($array as $key => $value) { - WfdownloadsRequest::setVar($key, $value, $hash, $overwrite); - } - } - - /** - * Cleans the request from script injection. - * - * @static - * @return void - */ - static function clean() - { - WfdownloadsRequest::_cleanArray($_FILES); - WfdownloadsRequest::_cleanArray($_ENV); - WfdownloadsRequest::_cleanArray($_GET); - WfdownloadsRequest::_cleanArray($_POST); - WfdownloadsRequest::_cleanArray($_COOKIE); - WfdownloadsRequest::_cleanArray($_SERVER); - if (isset($_SESSION)) { - WfdownloadsRequest::_cleanArray($_SESSION); - } - $REQUEST = $_REQUEST; - $GET = $_GET; - $POST = $_POST; - $COOKIE = $_COOKIE; - $FILES = $_FILES; - $ENV = $_ENV; - $SERVER = $_SERVER; - if (isset ($_SESSION)) { - $SESSION = $_SESSION; - } - foreach ($GLOBALS as $key => $value) { - if ($key != 'GLOBALS') { - unset($GLOBALS[$key]); - } - } - $_REQUEST = $REQUEST; - $_GET = $GET; - $_POST = $POST; - $_COOKIE = $COOKIE; - $_FILES = $FILES; - $_ENV = $ENV; - $_SERVER = $SERVER; - if (isset($SESSION)) { - $_SESSION = $SESSION; - } - } - - /** - * Adds an array to the GLOBALS array and checks that the GLOBALS variable is not being attacked - * - * @access protected - * - * @param array $array Array to clean - * @param boolean $globalise True if the array is to be added to the GLOBALS - */ - static function _cleanArray(&$array, $globalise = false) - { - static $banned = array('_files', '_env', '_get', '_post', '_cookie', '_server', '_session', 'globals'); - foreach ($array as $key => $value) { - // PHP GLOBALS injection bug - $failed = in_array(strtolower($key), $banned); - // PHP Zend_Hash_Del_Key_Or_Index bug - $failed |= is_numeric($key); - if ($failed) { - exit('Illegal variable <strong>' . implode('</strong> or <strong>', $banned) . '</strong> passed to script.'); - } - if ($globalise) { - $GLOBALS[$key] = $value; - } - } - } - - /** - * Clean up an input variable. - * - * @param mixed $var The input variable. - * @param int $mask Filter bit mask. 1=no trim: If this flag is cleared and the - * input is a string, the string will have leading and trailing whitespace - * trimmed. 2=allow_raw: If set, no more filtering is performed, higher bits - * are ignored. 4=allow_html: HTML is allowed, but passed through a safe - * HTML filter first. If set, no more filtering is performed. If no bits - * other than the 1 bit is set, a strict filter is applied. - * @param string $type The variable type {@see JFilterInput::clean()}. - * - * @return string - */ - static function _cleanVar($var, $mask = 0, $type = null) - { - // Static input filters for specific settings - static $noHtmlFilter = null; - static $safeHtmlFilter = null; - // If the no trim flag is not set, trim the variable - if (!($mask & 1) && is_string($var)) { - $var = trim($var); - } - // Now we handle input filtering - if ($mask & 2) { - // If the allow raw flag is set, do not modify the variable - } elseif ($mask & 4) { - // If the allow html flag is set, apply a safe html filter to the variable - if (is_null($safeHtmlFilter)) { - $safeHtmlFilter = WfdownloadsFilterInput::getInstance(null, null, 1, 1); - } - $var = $safeHtmlFilter->clean($var, $type); - } else { - // Since no allow flags were set, we will apply the most strict filter to the variable - if (is_null($noHtmlFilter)) { - $noHtmlFilter = WfdownloadsFilterInput::getInstance( /* $tags, $attr, $tag_method, $attr_method, $xss_auto */); - } - $var = $noHtmlFilter->clean($var, $type); - } - - return $var; - } - - /** - * Strips slashes recursively on an array - * - * @access protected - * - * @param array $value Array of (nested arrays of) strings - * - * @return array|string The input array with stripshlashes applied to it - */ - protected function _stripSlashesRecursive($value) - { - $value = is_array($value) ? array_map(array('WfdownloadsRequest', '_stripSlashesRecursive'), $value) : stripslashes($value); - - return $value; - } -} - -/** - * WfdownloadsInput is a class for filtering input from any data source - * Forked from the php input filter library by: Daniel Morris <da...@ro...> - * Original Contributors: Gianpaolo Racca, Ghislain Picard, Marco Wandschneider, Chris Tobin and Andrew Eddie. - * - * @author Louis Landry <lou...@jo...> - */ -class WfdownloadsFilterInput -{ - var $tagsArray; // default = empty array - var $attrArray; // default = empty array - var $tagsMethod; // default = 0 - var $attrMethod; // default = 0 - var $xssAuto; // default = 1 - var $tagBlacklist - = array( - 'applet', - 'body', - 'bgsound', - 'base', - 'basefont', - 'embed', - 'frame', - 'frameset', - 'head', - 'html', - 'id', - 'iframe', - 'ilayer', - 'layer', - 'link', - 'meta', - 'name', - 'object', - 'script', - 'style', - 'title', - 'xml' - ); - var $attrBlacklist = array('action', 'background', 'codebase', 'dynsrc', 'lowsrc'); // also will strip ALL event handlers - /** - * Constructor for inputFilter class. Only first parameter is required. - * - * @access protected - * - * @param array $tagsArray list of user-defined tags - * @param array $attrArray list of user-defined attributes - * @param int $tagsMethod WhiteList method = 0, BlackList method = 1 - * @param int $attrMethod WhiteList method = 0, BlackList method = 1 - * @param int $xssAuto Only auto clean essentials = 0, Allow clean blacklisted tags/attr = 1 - */ - public function __construct($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1) - { - // Make sure user defined arrays are in lowercase - $tagsArray = array_map('strtolower', (array) $tagsArray); - $attrArray = array_map('strtolower', (array) $attrArray); - // Assign member variables - $this->tagsArray = $tagsArray; - $this->attrArray = $attrArray; - $this->tagsMethod = $tagsMethod; - $this->attrMethod = $attrMethod; - $this->xssAuto = $xssAuto; - } - - /** - * Returns a reference to an input filter object, only creating it if it doesn't already exist. - * This method must be invoked as: - * <pre> $filter = & WfdownloadsFilterInput::getInstance();</pre> - * - * @static - * - * @param array $tagsArray list of user-defined tags - * @param array $attrArray list of user-defined attributes - * @param int $tagsMethod WhiteList method = 0, BlackList method = 1 - * @param int $attrMethod WhiteList method = 0, BlackList method = 1 - * @param int $xssAuto Only auto clean essentials = 0, Allow clean blacklisted tags/attr = 1 - * - * @return object The WfdownloadsFilterInput object. - * @since 1.5 - */ - public static function & getInstance($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1) - { - static $instances; - $sig = md5(serialize(array($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto))); - if (!isset ($instances)) { - $instances = array(); - } - if (empty ($instances[$sig])) { - $instances[$sig] = new WfdownloadsFilterInput($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto); - } - - return $instances[$sig]; - } - - /** - * Method to be called by another php script. Processes for XSS and - * specified bad code. - * - * @access public - * - * @param mixed $source Input string/array-of-string to be 'cleaned' - * @param string $type Return type for the variable (INT, FLOAT, BOOLEAN, WORD, ALNUM, CMD, BASE64, STRING, ARRAY, PATH, NONE) - * - * @return mixed 'Cleaned' version of input parameter - * @static - */ - public function clean($source, $type = 'string') - { - // Handle the type constraint - switch (strtoupper($type)) { - case 'INT' : - case 'INTEGER' : - // Only use the first integer value - preg_match('/-?[0-9]+/', (string) $source, $matches); - $result = @ (int) $matches[0]; - break; - case 'FLOAT' : - case 'DOUBLE' : - // Only use the first floating point value - preg_match('/-?[0-9]+(\.[0-9]+)?/', (string) $source, $matches); - $result = @ (float) $matches[0]; - break; - case 'BOOL' : - case 'BOOLEAN' : - $result = (bool) $source; - break; - case 'WORD' : - $result = (string) preg_replace('/[^A-Z_]/i', '', $source); - break; - case 'ALNUM' : - $result = (string) preg_replace('/[^A-Z0-9]/i', '', $source); - break; - case 'CMD' : - $result = (string) preg_replace('/[^A-Z0-9_\.-]/i', '', $source); - $result = ltrim($result, '.'); - break; - case 'BASE64' : - $result = (string) preg_replace('/[^A-Z0-9\/+=]/i', '', $source); - break; - case 'STRING' : - // Check for static usage and assign $filter the proper variable - if (isset($this) && is_a($this, 'WfdownloadsFilterInput')) { - $filter =& $this; - } else { - $filter = WfdownloadsFilterInput::getInstance(); - } - $result = (string) $filter->_remove($filter->_decode((string) $source)); - break; - case 'ARRAY' : - $result = (is_array($source)) ? (array) $source : array(); - break; - case 'PATH' : - $pattern = '/^[A-Za-z0-9_-]+[A-Za-z0-9_\.-]*([\\\\\/][A-Za-z0-9_-]+[A-Za-z0-9_\.-]*)*$/'; - preg_match($pattern, (string) $source, $matches); - $result = @ (string) $matches[0]; - break; - case 'USERNAME' : - $result = (string) preg_replace('/[\x00-\x1F\x7F<>"\'%&]/', '', $source); - break; - default : - // Check for static usage and assign $filter the proper variable - if (is_object($this) && get_class($this) == 'WfdownloadsFilterInput') { - $filter =& $this; - } else { - $filter = WfdownloadsFilterInput::getInstance(); - } - // Are we dealing with an array? - if (is_array($source)) { - foreach ($source as $key => $value) { - // filter element for XSS and other 'bad' code etc. - if (is_string($value)) { - $source[$key] = $filter->_remove($filter->_decode($value)); - } - } - $result = $source; - } else { - // Or a string? - if (is_string($source) && !empty ($source)) { - // filter source for XSS and other 'bad' code etc. - $result = $filter->_remove($filter->_decode($source)); - } else { - // Not an array or string.. return the passed parameter - $result = $source; - } - } - break; - } - - return $result; - } - - /** - * Function to determine if contents of an attribute is safe - * - * @static - * - * @param array $attrSubSet A 2 element array for attributes name,value - * - * @return boolean True if bad code is detected - */ - public function checkAttribute($attrSubSet) - { - $attrSubSet[0] = strtolower($attrSubSet[0]); - $attrSubSet[1] = strtolower($attrSubSet[1]); - - return (((strpos($attrSubSet[1], 'expression') !== false) && ($attrSubSet[0]) == 'style') || (strpos($attrSubSet[1], 'javascript:') !== false) - || (strpos($attrSubSet[1], 'behaviour:') !== false) - || (strpos($attrSubSet[1], 'vbscript:') !== false) - || (strpos($attrSubSet[1], 'mocha:') !== false) - || (strpos($attrSubSet[1], 'livescript:') !== false)); - } - - /** - * Internal method to iteratively remove all unwanted tags and attributes - * - * @access protected - * - * @param string $source Input string to be 'cleaned' - * - * @return string 'Cleaned' version of input parameter - */ - protected function _remove($source) - { - $loopCounter = 0; - // Iteration provides nested tag protection - while ($source != $this->_cleanTags($source)) { - $source = $this->_cleanTags($source); - ++$loopCounter; - } - - return $source; - } - - /** - * Internal method to strip a string of certain tags - * - * @access protected - * - * @param string $source Input string to be 'cleaned' - * - * @return string 'Cleaned' version of input parameter - */ - protected function _cleanTags($source) - { - /* - * In the beginning we don't really have a tag, so everything is - * postTag - */ - $preTag = null; - $postTag = $source; - // Is there a tag? If so it will certainly start with a '<' - $tagOpen_start = strpos($source, '<'); - while ($tagOpen_start !== false) { - // Get some information about the tag we are processing - $preTag .= substr($postTag, 0, $tagOpen_start); - $postTag = substr($postTag, $tagOpen_start); - $fromTagOpen = substr($postTag, 1); - $tagOpen_end = strpos($fromTagOpen, '>'); - // Let's catch any non-terminated tags and skip over them - if ($tagOpen_end === false) { - $postTag = substr($postTag, $tagOpen_start + 1); - $tagOpen_start = strpos($postTag, '<'); - continue; - } - // Do we have a nested tag? - $tagOpen_nested = strpos($fromTagOpen, '<'); - if (($tagOpen_nested !== false) && ($tagOpen_nested < $tagOpen_end)) { - $preTag .= substr($postTag, 0, ($tagOpen_nested + 1)); - $postTag = substr($postTag, ($tagOpen_nested + 1)); - $tagOpen_start = strpos($postTag, '<'); - continue; - } - // Lets get some information about our tag and setup attribute pairs - $currentTag = substr($fromTagOpen, 0, $tagOpen_end); - $tagLength = strlen($currentTag); - $tagLeft = $currentTag; - $attrSet = array(); - $currentSpace = strpos($tagLeft, ' '); - // Are we an open tag or a close tag? - if (substr($currentTag, 0, 1) == '/') { - // Close Tag - $isCloseTag = true; - list ($tagName) = explode(' ', $currentTag); - $tagName = substr($tagName, 1); - } else { - // Open Tag - $isCloseTag = false; - list ($tagName) = explode(' ', $currentTag); - } - /* - * Exclude all "non-regular" tagnames - * OR no tagname - * OR remove if xssauto is on and tag is blacklisted - */ - if ((!preg_match("/^[a-z][a-z0-9]*$/i", $tagName)) || (!$tagName) - || ((in_array(strtolower($tagName), $this->tagBlacklist)) - && ($this->xssAuto)) - ) { - $postTag = substr($postTag, ($tagLength + 2)); - $tagOpen_start = strpos($postTag, '<'); - // Strip tag - continue; - } - /* - * Time to grab any attributes from the tag... need this section in - * case attributes have spaces in the values. - */ - while ($currentSpace !== false) { - $attr = ''; - $fromSpace = substr($tagLeft, ($currentSpace + 1)); - $nextSpace = strpos($fromSpace, ' '); - $openQuotes = strpos($fromSpace, '"'); - $closeQuotes = strpos(substr($fromSpace, ($openQuotes + 1)), '"') + $openQuotes + 1; - // Do we have an attribute to process? [check for equal sign] - if (strpos($fromSpace, '=') !== false) { - /* - * If the attribute value is wrapped in quotes we need to - * grab the substring from the closing quote, otherwise grab - * till the next space - */ - if (($openQuotes !== false) && (strpos(substr($fromSpace, ($openQuotes + 1)), '"') !== false)) { - $attr = substr($fromSpace, 0, ($closeQuotes + 1)); - } else { - $attr = substr($fromSpace, 0, $nextSpace); - } - } else { - /* - * No more equal signs so add any extra text in the tag into - * the attribute array [eg. checked] - */ - if ($fromSpace != '/') { - $attr = substr($fromSpace, 0, $nextSpace); - } - } - // Last Attribute Pair - if (!$attr && $fromSpace != '/') { - $attr = $fromSpace; - } - // Add attribute pair to the attribute array - $attrSet[] = $attr; - // Move search point and continue iteration - $tagLeft = substr($fromSpace, strlen($attr)); - $currentSpace = strpos($tagLeft, ' '); - } - // Is our tag in the user input array? - $tagFound = in_array(strtolower($tagName), $this->tagsArray); - // If the tag is allowed lets append it to the output string - if ((!$tagFound && $this->tagsMethod) || ($tagFound && !$this->tagsMethod)) { - // Reconstruct tag with allowed attributes - if (!$isCloseTag) { - // Open or Single tag - $attrSet = $this->_cleanAttributes($attrSet); - $preTag .= '<' . $tagName; - for ($i = 0; $i < count($attrSet); ++$i) { - $preTag .= ' ' . $attrSet[$i]; - } - // Reformat single tags to XHTML - if (strpos($fromTagOpen, '</' . $tagName)) { - $preTag .= '>'; - } else { - $preTag .= ' />'; - } - } else { - // Closing Tag - $preTag .= '</' . $tagName . '>'; - } - } - // Find next tag's start and continue iteration - $postTag = substr($postTag, ($tagLength + 2)); - $tagOpen_start = strpos($postTag, '<'); - } - // Append any code after the end of tags and return - if ($postTag != '<') { - $preTag .= $postTag; - } - - return $preTag; - } - - /** - * Internal method to strip a tag of certain attributes - * - * @access protected - * - * @param array $attrSet Array of attribute pairs to filter - * - * @return array Filtered array of attribute pairs - */ - protected function _cleanAttributes($attrSet) - { - // Initialize variables - $newSet = array(); - // Iterate through attribute pairs - for ($i = 0; $i < count($attrSet); ++$i) { - // Skip blank spaces - if (!$attrSet[$i]) { - continue; - } - // Split into name/value pairs - $attrSubSet = explode('=', trim($attrSet[$i]), 2); - list ($attrSubSet[0]) = explode(' ', $attrSubSet[0]); - /* - * Remove all "non-regular" attribute names - * AND blacklisted attributes - */ - if ((!preg_match('/[a-z]*$/i', $attrSubSet[0])) - || (($this->xssAuto) - && ((in_array(strtolower($attrSubSet[0]), $this->attrBlacklist)) - || (substr($attrSubSet[0], 0, 2) == 'on'))) - ) { - continue; - } - // XSS attribute value filtering - if ($attrSubSet[1]) { - // strips unicode, hex, etc - $attrSubSet[1] = str_replace('&#', '', $attrSubSet[1]); - // strip normal newline within attr value - $attrSubSet[1] = preg_replace('/[\n\r]/', '', $attrSubSet[1]); - // strip double quotes - $attrSubSet[1] = str_replace('"', '', $attrSubSet[1]); - // convert single quotes from either side to doubles (Single quotes shouldn't be used to pad attr value) - if ((substr($attrSubSet[1], 0, 1) == "'") && (substr($attrSubSet[1], (strlen($attrSubSet[1]) - 1), 1) == "'")) { - $attrSubSet[1] = substr($attrSubSet[1], 1, (strlen($attrSubSet[1]) - 2)); - } - // strip slashes - $attrSubSet[1] = stripslashes($attrSubSet[1]); - } - // Autostrip script tags - if (WfdownloadsFilterInput::checkAttribute($attrSubSet)) { - continue; - } - // Is our attribute in the user input array? - $attrFound = in_array(strtolower($attrSubSet[0]), $this->attrArray); - // If the tag is allowed lets keep it - if ((!$attrFound && $this->attrMethod) || ($attrFound && !$this->attrMethod)) { - // Does the attribute have a value? - if ($attrSubSet[1]) { - $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[1] . '"'; - } elseif ($attrSubSet[1] == "0") { - /* - * Special Case - * Is the value 0? - */ - $newSet[] = $attrSubSet[0] . '="0"'; - } else { - $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[0] . '"'; - } - } - } - - return $newSet; - } - - /** - * Try to convert to plaintext - * - * @access protected - * - * @param string $source - * - * @return string Plaintext string - */ - protected function _decode($source) - { - // entity decode - $trans_tbl = get_html_translation_table(HTML_ENTITIES); - foreach ($trans_tbl as $k => $v) { - $ttr[$v] = utf8_encode($k); - } - $source = strtr($source, $ttr); - // convert decimal - //$source = preg_replace('/&#(\d+);/me', "chr(\\1)", $source); // decimal notation - //TODO swich to this once we have PHP 5.3 as minimum -// $source = preg_replace_callback('/&#(\d+);/m', function($m) {return chr($m[1]);}, $source); // decimal notation - $source = preg_replace_callback('/&#(\d+);/m', create_function('$matches', "return chr(\$matches[1]);"), $source); // decimal notation - // convert hex - //$source = preg_replace('/&#x([a-f0-9]+);/mei', "chr(0x\\1)", $source); // hex notation - //TODO swich to this once we have PHP 5.3 as minimum -// $source = preg_replace_callback('/&#x([a-f0-9]+);/mi', function($m) {return chr(hexdec($m[1]));}, $source); // hex notation - $source = preg_replace_callback( - '/&#x([a-f0-9]+);/mi', - create_function('$matches', "return chr('0x'.\$matches[1]);"), - $source - ); // hex notation - - return $source; - } -} |
From: <txm...@us...> - 2014-11-30 21:34:13
|
Revision: 12881 http://sourceforge.net/p/xoops/svn/12881 Author: txmodxoops Date: 2014-11-30 21:34:06 +0000 (Sun, 30 Nov 2014) Log Message: ----------- Added new folder version 1.91 Alpha 1 Added Paths: ----------- XoopsModules/TDMCreate/branches/timgno/1.91a1/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/about.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/building.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/fields.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/footer.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/header.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/index.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/menu.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/modules.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/tables.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/css/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/css/admin/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/css/admin/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/css/admin/style.css XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/css/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/css/style.css XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/empty.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/16/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/16/arrow.gif XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/16/blocks.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/16/drag.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/16/editfields.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/16/fields.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/16/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/16/left_right.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/16/nb_fields.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/16/spinner.gif XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/16/submenu.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/16/tables.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/16/toggle.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/32/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/32/addmodule.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/32/addtable.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/32/builder.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/32/dashboard.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/32/edittable.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/32/fields.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/32/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/blank.gif XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/icons/loading.gif XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/loading.gif XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/logo.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/logos/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/logos/VeraBd.ttf XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/logos/empty.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/logos/green.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/logos/red.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/logos/xoops2.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/logos/xoopsdevelopmentteam_logo.gif XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/naked.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/tdmcreate_slogo.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/xcvLogo.txt XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/js/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/js/debug.log XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/js/fields.js XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/js/functions.js XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/js/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/js/jq.init.js XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/TDMCreate.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/TDMCreateAutoload.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/TDMCreateSession.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/building.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/cache/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/cache/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/fieldattributes.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/fieldelements.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/fieldkey.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/fieldnull.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/fields.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/fields_copy.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/fieldtype.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/TDMCreateAbstract.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/TDMCreateArchitecture.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/TDMCreateFile.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/TDMCreateHtmlSmartyCodes.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/TDMCreateStructure.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/TDMCreateTableFields.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/admin/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/admin/AdminAbout.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/admin/AdminFooter.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/admin/AdminHeader.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/admin/AdminIndex.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/admin/AdminMenu.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/admin/AdminObjects.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/admin/AdminPages.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/admin/AdminPermissions.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/admin/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/blocks/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/blocks/BlocksFiles.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/blocks/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/class/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/classes/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/classes/ClassFiles.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/classes/ClassFormElements.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/classes/ClassHelper.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/classes/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/css/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/css/CssStyles.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/css/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/docs/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/docs/DocsChangelog.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/docs/DocsFiles.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/docs/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/include/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/include/IncludeCommentFunctions.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/include/IncludeComments.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/include/IncludeCommon.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/include/IncludeFunctions.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/include/IncludeInstall.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/include/IncludeJquery.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/include/IncludeNotifications.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/include/IncludeSearch.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/include/IncludeUpdate.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/include/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/language/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/language/LanguageAdmin.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/language/LanguageBlocks.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/language/LanguageDefines.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/language/LanguageHelp.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/language/LanguageMailTpl.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/language/LanguageMain.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/language/LanguageModinfo.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/language/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/sql/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/sql/SqlFile.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/sql/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/templates/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/templates/admin/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/templates/admin/TemplatesAdminAbout.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/templates/admin/TemplatesAdminFooter.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/templates/admin/TemplatesAdminHeader.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/templates/admin/TemplatesAdminIndex.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/templates/admin/TemplatesAdminPermissions.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/templates/admin/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/templates/blocks/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/templates/blocks/TemplatesBlocks.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/templates/blocks/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/templates/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/templates/user/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/templates/user/TemplatesUserFooter.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/templates/user/TemplatesUserHeader.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/templates/user/TemplatesUserIndex.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/templates/user/TemplatesUserPages.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/templates/user/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/user/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/user/UserFooter.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/user/UserHeader.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/user/UserIndex.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/user/UserNotificationUpdate.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/user/UserObjects.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/user/UserPages.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/user/UserPrint.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/user/UserRss.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/user/UserSubmit.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/user/UserXoopsVersion.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/user/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/form/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/form/TDMCreateThemeForm.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/form/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/html/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/html/TDMCreateFormLabel.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/html/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/logoGenerator.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/modules.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/repository.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/request.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/tables.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/docs/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/docs/changelog.txt XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/docs/credits.txt XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/docs/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/docs/install.txt XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/docs/lang_diff.txt XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/docs/license.txt XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/docs/readme.txt XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/include/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/include/common.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/include/functions.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/include/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/include/install.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/include/update.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/language/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/language/english/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/language/english/admin.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/language/english/help/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/language/english/help/help.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/language/english/help/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/language/english/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/language/english/modinfo.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/language/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/language/update language 1.0 to 1.1.txt XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/language/update language 1.1 to 1.15.txt XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/language/update language 1.1 to 1.37.txt XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/language/update language 1.15 to 1.37.txt XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/language/update language 1.37 to 1.38.txt XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/language/update language 1.38 to 1.39.txt XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/sql/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/sql/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/sql/mysql.sql XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/tdmcreate_about.tpl XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/tdmcreate_building.tpl XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/tdmcreate_fields.tpl XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/tdmcreate_footer.tpl XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/tdmcreate_header.tpl XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/tdmcreate_index.tpl XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/tdmcreate_modules.tpl XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/tdmcreate_tables.tpl XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/xoops_version.php Added: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/about.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/about.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/about.php 2014-11-30 21:34:06 UTC (rev 12881) @@ -0,0 +1,25 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +/** + * tdmcreate module + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package tdmcreate + * @since 2.5.0 + * @author Txmod Xoops http://www.txmodxoops.org + * @version $Id: about.php 11084 2013-02-23 15:44:20Z timgno $ + */ +include 'header.php'; +$template_main = 'tdmcreate_about.tpl'; +$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('about.php')); +$GLOBALS['xoopsTpl']->assign('about', $adminMenu->renderAbout('6KJ7RW5DR3VTJ', false)); +include 'footer.php'; \ No newline at end of file Added: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/building.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/building.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/building.php 2014-11-30 21:34:06 UTC (rev 12881) @@ -0,0 +1,97 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +/** + * tdmcreate module + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package tdmcreate + * @since 2.5.0 + * @author Txmod Xoops http://www.txmodxoops.org + * @version $Id: building.php 12258 2014-01-02 09:33:29Z timgno $ + */ +include 'header.php'; +$op = XoopsRequest::getString('op', 'default'); +$mid = XoopsRequest::getInt('mod_id'); +$moduleObj = $tdmcreate->getHandler('modules')->get( $mid ); +// Switch option +switch ($op) { + case 'build': + $template_main = 'tdmcreate_building.tpl'; + $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php')); + // Get var module dirname + $moduleDirname = $moduleObj->getVar('mod_dirname'); + // Directories for copy from to + $fromDir = TDMC_UPLOAD_REPOSITORY_PATH.'/'.strtolower($moduleDirname); + $toDir = XOOPS_ROOT_PATH.'/modules/'.strtolower($moduleDirname); + if(isset($moduleDirname)) { + // Clear this module if it's in repository + if(is_dir($fromDir)) { + TDMCreate_clearDir($fromDir); + } + // Clear this module if it's in root/modules + if(is_dir($toDir)) { + TDMCreate_clearDir($toDir); + } + } + // Structure + include_once TDMC_PATH . '/class/files/TDMCreateArchitecture.php'; + $handler = TDMCreateArchitecture::getInstance(); + $handler->getPath( TDMC_PATH ); + $handler->getUploadPath( TDMC_UPLOAD_PATH ); + // Creation of the structure of folders and files + $base_architecture = $handler->createBaseFoldersFiles( $moduleObj ); + if($base_architecture !== false) { + $GLOBALS['xoopsTpl']->assign('base_architecture', true); + } else { + $GLOBALS['xoopsTpl']->assign('base_architecture', false); + } + // Get files + $build = array(); + $files = $handler->createFilesToBuilding( $moduleObj ); + foreach($files as $file) { + if($file) { + $build['list'] = $file; + } + $GLOBALS['xoopsTpl']->append('builds', $build); + } + unset($build); + // Directory to saved all files + $GLOBALS['xoopsTpl']->assign('building_directory', sprintf(_AM_TDMCREATE_BUILDING_DIRECTORY, $moduleDirname)); + // Copy this module in root modules + if( $moduleObj->getVar('mod_inroot_copy') == 1 ) { + TDMCreate_copyr($fromDir, $toDir); + } + break; + + case 'default': + default: + $template_main = 'tdmcreate_building.tpl'; + $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php')); + // Redirect if there aren't modules + $nbModules = $tdmcreate->getHandler('modules')->getCount(); + if( $nbModules == 0 ) { + redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES ); + } + unset($nbModules); + // Redirect if there aren't tables + /*$nbTables = $tdmcreate->getHandler('tables')->getCount(); + if($nbTables == 0) { + redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES ); + } + unset($nbTables);*/ + include_once TDMC_PATH . '/class/building.php'; + $handler = TDMCreateBuilding::getInstance(); + $form = $handler->getForm(); + $GLOBALS['xoopsTpl']->assign('form', $form->render()); + break; +} +include 'footer.php'; \ No newline at end of file Added: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/fields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/fields.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/fields.php 2014-11-30 21:34:06 UTC (rev 12881) @@ -0,0 +1,320 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +/** + * tdmcreate module + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package tdmcreate + * @since 2.5.0 + * @author Txmod Xoops http://www.txmodxoops.org + * @version $Id: 1.91 fields.php 12258 2014-01-02 09:33:29Z timgno $ + */ +include 'header.php'; +// Recovered value of arguments op in the URL $ +$op = XoopsRequest::getString('op', 'list'); +// Get fields Variables +/*$fieldMid = TDMCreate_CleanVars($_REQUEST, 'field_mid'); +$fieldTid = TDMCreate_CleanVars($_REQUEST, 'field_tid'); +$fieldNumb = TDMCreate_CleanVars($_REQUEST, 'field_numb'); +$fieldName = TDMCreate_CleanVars($_REQUEST, 'field_name', '', 'string');*/ +$fieldMid = XoopsRequest::getInt('field_mid'); +$fieldTid = XoopsRequest::getInt('field_tid'); +$fieldNumb = XoopsRequest::getInt('field_numb'); +$fieldName = XoopsRequest::getString('field_name'); /**/ +// +switch ($op) +{ + case 'list': + default: + $start = XoopsRequest::getInt('start', 0); + $limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager')); + // Define main template + $template_main = 'tdmcreate_fields.tpl'; + $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/assets/css/admin/style.css' ); + $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/functions.js'); + $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/fields.js'); + $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php')); + $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add'); + $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton()); + $GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL); + $GLOBALS['xoopsTpl']->assign('tdmc_icons_url', TDMC_ICONS_URL); + $GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL); + $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgtab_url', TDMC_UPLOAD_IMGTAB_URL); + $GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16); + $GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32); + //var_dump($sysPathIcon32); + // Redirect if there aren't modules + $countModules = $tdmcreate->getHandler('modules')->getCount(); + if ( $countModules == 0 ) { + redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES ); + } + unset($countModules); + // Redirect if there aren't tables + $countTables = $tdmcreate->getHandler('tables')->getCount(); + if ($countTables == 0) { + redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES ); + } + unset($countTables); + // Get the list of tables + $criteria = new CriteriaCompo(); + $criteria->setSort('table_id ASC, table_name'); + $criteria->setOrder('ASC'); + $countTables = $tdmcreate->getHandler('tables')->getCount($criteria); + $tablesAll = $tdmcreate->getHandler('tables')->getAll($criteria); + unset($criteria); + if ($countTables > 0) + { + foreach (array_keys($tablesAll) as $tid) + { + // Display tables list + $table['id'] = $tid; + $table['mid'] = $tablesAll[$tid]->getVar('table_mid'); + $table['name'] = ucfirst($tablesAll[$tid]->getVar('table_name')); + $table['image'] = $tablesAll[$tid]->getVar('table_image'); + $table['nbfields'] = $tablesAll[$tid]->getVar('table_nbfields'); + $table['autoincrement'] = $tablesAll[$tid]->getVar('table_autoincrement'); + $table['blocks'] = $tablesAll[$tid]->getVar('table_blocks'); + $table['admin'] = $tablesAll[$tid]->getVar('table_admin'); + $table['user'] = $tablesAll[$tid]->getVar('table_user'); + $table['search'] = $tablesAll[$tid]->getVar('table_search'); + // Get the list of fields + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('field_mid', $table['mid'])); + $criteria->add(new Criteria('field_tid', $tid)); + $criteria->setSort('field_id ASC, field_name'); + $criteria->setOrder('ASC'); + $countFields = $tdmcreate->getHandler('fields')->getCount($criteria); + $fieldsAll = $tdmcreate->getHandler('fields')->getObjects($criteria); + unset($criteria); + // Display fields list + $fields = array(); + $lid = 1; + if ( $countFields > 0 ) + { + foreach (array_keys($fieldsAll) as $fid) + { + $field['id'] = $fid; + $field['lid'] = $lid; + $field['name'] = str_replace('_', ' ', ucfirst($fieldsAll[$fid]->getVar('field_name'))); + $field['parent'] = $fieldsAll[$fid]->getVar('field_parent'); + $field['inlist'] = $fieldsAll[$fid]->getVar('field_inlist'); + $field['inform'] = $fieldsAll[$fid]->getVar('field_inform'); + $field['admin'] = $fieldsAll[$fid]->getVar('field_admin'); + $field['user'] = $fieldsAll[$fid]->getVar('field_user'); + $field['block'] = $fieldsAll[$fid]->getVar('field_block'); + $field['main'] = $fieldsAll[$fid]->getVar('field_main'); + $field['search'] = $fieldsAll[$fid]->getVar('field_search'); + $field['required'] = $fieldsAll[$fid]->getVar('field_required'); + $fields[] = $field; + unset($field); + $lid++; + } + } + unset($lid); + $table['fields'] = $fields; + $GLOBALS['xoopsTpl']->append('tables_list', $table); + unset($table); + } + if ( $countTables > $limit ) { + include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; + $pagenav = new XoopsPageNav($countTables, $limit, $start, 'start', 'op=list&limit=' . $limit); + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); + } + } else { + $GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_FIELDS); + } + var_dump($fieldMid); + var_dump($fieldTid); + var_dump($fieldNumb); + var_dump($fieldName); + break; + + case 'new': + // Define main template + $template_main = 'tdmcreate_fields.tpl'; + $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/assets/css/admin/style.css' ); + $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/fields.js'); + $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php')); + $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list'); + $adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list'); + $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton()); + // Form Add + $fieldsObj =& $tdmcreate->getHandler('fields')->create(); + $form = $fieldsObj->getFormNew($fieldMid, $fieldTid, $fieldNumb, $fieldName); + $GLOBALS['xoopsTpl']->assign('form', $form->render()); + // Test -> Will be removed + var_dump($fieldMid); + var_dump($fieldTid); + var_dump($fieldNumb); + var_dump($fieldName); + break; + + case 'save': + // + if ( !$GLOBALS['xoopsSecurity']->check() ) { + redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); + } + $fieldId = XoopsRequest::getInt('field_id'); + // Fields Handler + $fields = $tdmcreate->getHandler('fields'); + // Set Variables + foreach($_POST['field_id'] as $key => $value) + { + switch($value){ + case 'new': + $fieldsObj =& $fields->create(); + break; + default: + $fieldsObj =& $fields->get($value); + break; + } + if (isset($fieldMid) && isset($fieldTid) && !empty($_POST['field_name'][$key])) { + // Set Data + $fieldsObj->setVar( 'field_mid', $fieldMid ); + $fieldsObj->setVar( 'field_tid', $fieldTid ); + $fieldsObj->setVar( 'field_numb', $fieldNumb ); + $fieldsObj->setVar( 'field_name', (isset($_POST['field_name'][$key]) ? $_POST['field_name'][$key] : '') ); + $fieldsObj->setVar( 'field_type', (isset($_POST['field_type'][$key]) ? $_POST['field_type'][$key] : '') ); + $fieldsObj->setVar( 'field_value', (isset($_POST['field_value'][$key]) ? $_POST['field_value'][$key] : '') ); + $fieldsObj->setVar( 'field_attribute', (isset($_POST['field_attribute'][$key]) ? $_POST['field_attribute'][$key] : '') ); + $fieldsObj->setVar( 'field_null', (isset($_POST['field_null'][$key]) ? $_POST['field_null'][$key] : '') ); + $fieldsObj->setVar( 'field_default', (isset($_POST['field_default'][$key]) ? $_POST['field_default'][$key] : '') ); + $fieldsObj->setVar( 'field_key', (isset($_POST['field_key'][$key]) ? $_POST['field_key'][$key] : '') ); + $fieldsObj->setVar( 'field_element', (isset($_POST['field_element'][$key]) ? $_POST['field_element'][$key] : '') ); + $fieldsObj->setVar( 'field_parent', ((isset($_REQUEST['field_parent'][$key]) == 1) ? 1 : 0) ); + $fieldsObj->setVar( 'field_inlist', ((isset($_REQUEST['field_inlist'][$key]) == 1) ? 1 : 0) ); + $fieldsObj->setVar( 'field_inform', ((isset($_REQUEST['field_inform'][$key]) == 1) ? 1 : 0) ); + $fieldsObj->setVar( 'field_admin', ((isset($_REQUEST['field_admin'][$key]) == 1) ? 1 : 0) ); + $fieldsObj->setVar( 'field_user', ((isset($_REQUEST['field_user'][$key]) == 1) ? 1 : 0) ); + $fieldsObj->setVar( 'field_block', ((isset($_REQUEST['field_block'][$key]) == 1) ? 1 : 0) ); + $fieldsObj->setVar( 'field_main', (($key == isset($_REQUEST['field_main'][$key])) ? 1 : 0) ); + $fieldsObj->setVar( 'field_search', ((isset($_REQUEST['field_search'][$key]) == 1) ? 1 : 0) ); + $fieldsObj->setVar( 'field_required', ((isset($_REQUEST['field_required'][$key]) == 1) ? 1 : 0) ); + // Insert Data + $tdmcreate->getHandler('fields')->insert($fieldsObj); + } + } + // Get table name from field table id + $tables =& $tdmcreate->getHandler('tables')->get($fieldTid); + $table_name = $tables->getVar('table_name'); + // Set field elements + if ($fieldsObj->isNew()) { + // Fields Elements Handler + $fieldelementObj =& $tdmcreate->getHandler('fieldelements')->create(); + $fieldelementObj->setVar( 'fieldelement_mid', $fieldMid ); + $fieldelementObj->setVar( 'fieldelement_tid', $fieldTid ); + $fieldelementObj->setVar( 'fieldelement_name', 'Table : '.ucfirst($table_name) ); + $fieldelementObj->setVar( 'fieldelement_value', 'XoopsFormTables-'.ucfirst($table_name) ); + // Insert new field element id for table name + if (!$tdmcreate->getHandler('fieldelements')->insert($fieldelementObj) ) { + $GLOBALS['xoopsTpl']->assign('error', $fieldelementObj->getHtmlErrors() . ' Field element'); + } + redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELDS_FORM_SAVED_OK, $table_name)); + } else { + redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELDS_FORM_UPDATED_OK, $table_name)); + } + // + $GLOBALS['xoopsTpl']->assign('error', $fieldsObj->getHtmlErrors()); + $form = $fieldsObj->getForm(null, $fieldTid); + $GLOBALS['xoopsTpl']->assign('form', $form->render()); + break; + + case 'edit': + // Define main template + $template_main = 'tdmcreate_fields.tpl'; + $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php')); + $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add'); + $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list'); + $adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list'); + $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton()); + // Form Edit + $fieldId = XoopsRequest::getInt('field_id'); + $fieldsObj = $tdmcreate->getHandler('fields')->get( $fieldId ); + $form = $fieldsObj->getFormEdit($fieldMid, $fieldTid); + $GLOBALS['xoopsTpl']->assign('form', $form->render()); + // Test -> Will be removed + var_dump($fieldTid); + break; + + case 'drag': + $side = TDMCreate_CleanVars( $_POST, 'field_id', 0, 'int' ); + $fieldId = XoopsRequest::getInt('field_id'); + if ( $fieldId > 0 ) { + $fieldsObj = $tdmcreate->getHandler('fields')->get( $fieldId ); + $fieldsObj->setVar('field_id', $side); + if (!$tdmcreate->getHandler('fields')->insert( $fieldsObj )) { + redirect_header('fields.php', 5, _AM_TDMCREATE_FIELD_SIDE_ERROR); + } + } + break; + + case 'order': + if ( isset($_POST['field_id'] ) ) { + $i = 0; + foreach($_POST['field_id'] as $order) { + if( $order > 0 ) { + $fieldsObj = $tdmcreate->getHandler('fields')->get( $order ); + $fieldsObj->setVar('field_id', $i); + if (!$tdmcreate->getHandler('fields')->insert( $fieldsObj )) { + redirect_header('fields.php', 5, _AM_TDMCREATE_FIELD_ORDER_ERROR); + } + $i++; + } + } + unset($i); + } + exit; + break; + + case 'display': + // + $fields = $tdmcreate->getHandler('fields'); + // Fields Handler + foreach($_REQUEST['field_id'] as $key => $value) + { + /*$fieldId = XoopsRequest::getInt('field_id'); + $fieldParent = XoopsRequest::getInt('field_parent'); + $fieldInlist = XoopsRequest::getInt('field_inlist'); + $fieldInform = XoopsRequest::getInt('field_inform'); + $fieldAdmin = XoopsRequest::getInt('field_admin'); + $fieldUser = XoopsRequest::getInt('field_user'); + $fieldBlock = XoopsRequest::getInt('field_block'); + $fieldMain = XoopsRequest::getInt('field_main'); + $fieldSearch = XoopsRequest::getInt('field_search'); + $fieldRequired = XoopsRequest::getInt('field_required');*/ + + $fieldsObj =& $fields->get($value); + /*$fieldsObj->setVar('field_parent', $fieldParent); + $fieldsObj->setVar('field_inlist', $fieldInlist); + $fieldsObj->setVar('field_inform', $fieldInform); + $fieldsObj->setVar('field_admin', $fieldAdmin); + $fieldsObj->setVar('field_user', $fieldUser); + $fieldsObj->setVar('field_block', $fieldBlock); + $fieldsObj->setVar('field_main', $fieldMain); + $fieldsObj->setVar('field_search', $fieldSearch); + $fieldsObj->setVar('field_required', $fieldRequired);*/ + $fieldsObj->setVar( 'field_parent', $_POST['field_parent'][$key]); + $fieldsObj->setVar( 'field_inlist', $_POST['field_inlist'][$key]); + $fieldsObj->setVar( 'field_inform', $_POST['field_inform'][$key]); + $fieldsObj->setVar( 'field_admin', $_POST['field_admin'][$key]); + $fieldsObj->setVar( 'field_user', $_POST['field_user'][$key]); + $fieldsObj->setVar( 'field_block', $_POST['field_block'][$key]); + $fieldsObj->setVar( 'field_main', $_POST['field_main'][$key]); + $fieldsObj->setVar( 'field_search', $_POST['field_search'][$key]); + $fieldsObj->setVar( 'field_required', $_POST['field_required'][$key]); + // + $fields->insert($fieldsObj, true); + } + redirect_header('fields.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS); + break; +} +include 'footer.php'; \ No newline at end of file Added: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/footer.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/footer.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/footer.php 2014-11-30 21:34:06 UTC (rev 12881) @@ -0,0 +1,26 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +/** + * tdmcreate module + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package tdmcreate + * @since 2.5.0 + * @author Txmod Xoops http://www.txmodxoops.org + * @version $Id: footer.php 12207 2013-10-23 02:46:52Z beckmi $ + */ +$GLOBALS['xoopsTpl']->assign('module_name', $GLOBALS['xoopsModule']->getVar('name')); +if ( isset($template_main) ) { + $GLOBALS['xoopsTpl']->display("db:{$template_main}"); +} +xoops_cp_footer(); +?> \ No newline at end of file Added: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/header.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/header.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/header.php 2014-11-30 21:34:06 UTC (rev 12881) @@ -0,0 +1,57 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +/** + * tdmcreate module + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package tdmcreate + * @since 2.5.0 + * @author Txmod Xoops http://www.txmodxoops.org + * @version $Id: header.php 12258 2014-01-02 09:33:29Z timgno $ +*/ +include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php'; +include_once dirname(dirname(__FILE__)) . '/include/common.php'; +// +$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname'); +// Link System Icons +$sysPathIcon16 = $GLOBALS['xoopsModule']->getInfo('sysicons16'); +$sysPathIcon32 = $GLOBALS['xoopsModule']->getInfo('sysicons32'); +// Link Local Icons +$modPathIcon16 = $GLOBALS['xoopsModule']->getInfo('modicons16'); +$modPathIcon32 = $GLOBALS['xoopsModule']->getInfo('modicons32'); +$pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin'); +// TDMCreate Instance +$tdmcreate = TDMCreate::getInstance(); +// MyTextSanitizer +$myts =& MyTextSanitizer::getInstance(); +if (!isset($xoopsTpl) || !is_object($xoopsTpl)) { + include_once(XOOPS_ROOT_PATH."/class/template.php"); + $xoopsTpl = new XoopsTpl(); +} +// System Icons +$GLOBALS['xoopsTpl']->assign('sysPathIcon16', $sysPathIcon16); +$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32); +// Local Icons +$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16); +$GLOBALS['xoopsTpl']->assign('modPathIcon32', $modPathIcon32); +// Load languages +xoops_loadLanguage('admin', $thisDirname); +xoops_loadLanguage('modinfo', $thisDirname); +xoops_loadLanguage('main', $thisDirname); +// Locad admin menu class +if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))){ + include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'); +}else{ + redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false); +} +xoops_cp_header(); +$adminMenu = new ModuleAdmin(); \ No newline at end of file Added: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/index.html =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/index.html (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/index.html 2014-11-30 21:34:06 UTC (rev 12881) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/index.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/index.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/index.php 2014-11-30 21:34:06 UTC (rev 12881) @@ -0,0 +1,35 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +/** + * tdmcreate module + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package tdmcreate + * @since 2.5.0 + * @author Txmod Xoops http://www.txmodxoops.org + * @version $Id: index.php 11084 2013-02-23 15:44:20Z timgno $ + */ +include 'header.php'; +$criteria = new CriteriaCompo(); +$count_modules = $tdmcreate->getHandler('modules')->getCount($criteria); +$count_tables = $tdmcreate->getHandler('tables')->getCount($criteria); +$count_fields = $tdmcreate->getHandler('fields')->getCount($criteria); +unset($criteria); +$template_main = 'tdmcreate_index.tpl'; +$adminMenu->addInfoBox(_AM_TDMCREATE_ADMIN_NUMMODULES) ; +$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMMODULES. '</label>', $count_modules, 'Green') ; +$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMTABLES. '</label>', $count_tables, 'Orange'); +$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMFIELDS. '</label>', $count_fields, 'Gray'); +//$xoopsOption['template_main'] = 'tdmcreate_index.html'; +$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('index.php')); +$GLOBALS['xoopsTpl']->assign('index', $adminMenu->renderIndex()); +include 'footer.php'; \ No newline at end of file Added: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/menu.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/menu.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/menu.php 2014-11-30 21:34:06 UTC (rev 12881) @@ -0,0 +1,50 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +/** + * tdmcreate module + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package tdmcreate + * @since 2.5.0 + * @author Txmod Xoops http://www.txmodxoops.org + * @version $Id: menu.php 11084 2013-02-23 15:44:20Z timgno $ + */ +$module_handler =& xoops_gethandler('module'); +$xoopsModule =& XoopsModule::getByDirname('TDMCreate'); +$moduleInfo =& $module_handler->get($xoopsModule->getVar('mid')); +$sysPathIcon32 = $moduleInfo->getInfo('sysicons32'); +$adminmenu = array(); +$i = 1; +$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU1; +$adminmenu[$i]['link'] = 'admin/index.php'; +$adminmenu[$i]['icon'] = $sysPathIcon32.'/dashboard.png'; +$i++; +$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU2; +$adminmenu[$i]['link'] = 'admin/modules.php'; +$adminmenu[$i]['icon'] = 'assets/images/icons/32/addmodule.png'; +$i++; +$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU3; +$adminmenu[$i]['link'] = 'admin/tables.php'; +$adminmenu[$i]['icon'] = 'assets/images/icons/32/addtable.png'; +$i++; +$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU4; +$adminmenu[$i]['link'] = 'admin/fields.php'; +$adminmenu[$i]['icon'] = 'assets/images/icons/32/fields.png'; +$i++; +$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU5; +$adminmenu[$i]['link'] = 'admin/building.php'; +$adminmenu[$i]['icon'] = 'assets/images/icons/32/builder.png'; +$i++; +$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU6; +$adminmenu[$i]['link'] = 'admin/about.php'; +$adminmenu[$i]['icon'] = $sysPathIcon32.'/about.png'; +unset($i); Added: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/modules.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/modules.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/modules.php 2014-11-30 21:34:06 UTC (rev 12881) @@ -0,0 +1,252 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +/** + * tdmcreate module + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package tdmcreate + * @since 2.5.5 + * @author Txmod Xoops <su...@tx...> + * @version $Id: 1.59 modules.php 11297 2013-03-24 10:58:10Z timgno $ + */ +include 'header.php'; +// Recovered value of argument op in the URL $ +$op = XoopsRequest::getString('op', 'list'); +// +$mod_id = XoopsRequest::getInt('mod_id'); +// +switch ($op) +{ + case 'list': + default: + $start = XoopsRequest::getInt('start', 0); + $limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('modules_adminpager')); + // Define main template + $template_main = 'tdmcreate_modules.tpl'; + $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/functions.js'); + $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/assets/css/admin/style.css' ); + $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php')); + $adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add'); + $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton()); + $GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL); + $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL); + $GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16); + $GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32); + $criteria = new CriteriaCompo(); + $criteria->setSort('mod_id ASC, mod_name'); + $criteria->setOrder('ASC'); + $nb_modules = $tdmcreate->getHandler('modules')->getCount( $criteria ); + $mods_arr = $tdmcreate->getHandler('modules')->getAll( $criteria ); + unset($criteria); + // Redirect if there aren't modules + if ( $nb_modules == 0 ) { + redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES ); + } + // Display modules list + if ( $nb_modules > 0 ) { + foreach (array_keys($mods_arr) as $i) { + $mod['id'] = $i; + $mod['name'] = $mods_arr[$i]->getVar('mod_name'); + $mod['version'] = $mods_arr[$i]->getVar('mod_version'); + $mod['image'] = $mods_arr[$i]->getVar('mod_image'); + $mod['release'] = $mods_arr[$i]->getVar('mod_release'); + $mod['status'] = $mods_arr[$i]->getVar('mod_status'); + $mod['admin'] = $mods_arr[$i]->getVar('mod_admin'); + $mod['user'] = $mods_arr[$i]->getVar('mod_user'); + $mod['blocks'] = $mods_arr[$i]->getVar('mod_blocks'); + $mod['search'] = $mods_arr[$i]->getVar('mod_search'); + $mod['comments'] = $mods_arr[$i]->getVar('mod_comments'); + $mod['notifications'] = $mods_arr[$i]->getVar('mod_notifications'); + $mod['permissions'] = $mods_arr[$i]->getVar('mod_permissions'); + $GLOBALS['xoopsTpl']->append('modules_list', $mod); + unset($mod); + } + if ( $nb_modules > $limit ) { + include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; + $pagenav = new XoopsPageNav($nb_modules, $limit, $start, 'start', 'op=list&limit=' . $limit); + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); + } + } else { + $GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_MODULES); + } + break; + + case 'new': + // Define main template + $template_main = 'tdmcreate_modules.tpl'; + $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/functions.js'); + $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php')); + $adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list'); + $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton()); + + $modulesObj =& $tdmcreate->getHandler('modules')->create(); + $form = $modulesObj->getForm(); + $GLOBALS['xoopsTpl']->assign('form', $form->render()); + break; + + case 'save': + if ( !$GLOBALS['xoopsSecurity']->check() ) { + redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); + } + if (isset($mod_id)) { + $modulesObj =& $tdmcreate->getHandler('modules')->get($mod_id); + } else { + $modulesObj =& $tdmcreate->getHandler('modules')->create(); + } + $moduleDirname = preg_replace('/[^a-zA-Z0-9]\s+/', '', strtolower($_POST['mod_dirname'])); + //Form module save + $modulesObj->setVars(array('mod_name' => $_POST['mod_name'], + 'mod_dirname' => $moduleDirname, + 'mod_version' => $_POST['mod_version'], + 'mod_since' => $_POST['mod_since'], + 'mod_min_php' => $_POST['mod_min_php'], + 'mod_min_xoops' => $_POST['mod_min_xoops'], + 'mod_min_admin' => $_POST['mod_min_admin'], + 'mod_min_mysql' => $_POST['mod_min_mysql'], + 'mod_description' => $_POST['mod_description'], + 'mod_author' => $_POST['mod_author'], + 'mod_author_mail' => $_POST['mod_author_mail'], + 'mod_author_website_url' => $_POST['mod_author_website_url'], + 'mod_author_website_name' => $_POST['mod_author_website_name'], + 'mod_credits' => $_POST['mod_credits'], + 'mod_license' => $_POST['mod_license'], + 'mod_release_info' => $_POST['mod_release_info'], + 'mod_release_file' => $_POST['mod_release_file'], + 'mod_manual' => $_POST['mod_manual'], + 'mod_manual_file' => $_POST['mod_manual_file'])); + //Form mod_image + include_once XOOPS_ROOT_PATH . '/class/uploader.php'; + $uploader = new XoopsMediaUploader(TDMC_UPLOAD_IMGMOD_PATH, $tdmcreate->getConfig('mimetypes'), + $tdmcreate->getConfig('maxsize'), null, null); + if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { + /*$extension = preg_replace( '/.*\.([^.]+)$/', '\\1', $_FILES['attachedfile']['name']); + $logo_image = $moduleDirname.'_slogo.'.$extension; + $uploader->setPrefix($logo_image);*/ + $uploader->fetchMedia($_POST['xoops_upload_file'][0]); + if (!$uploader->upload()) { + $errors = $uploader->getErrors(); + redirect_header('javascript:history.go(-1)',3, $errors); + } else { + $modulesObj->setVar('mod_image', $uploader->getSavedFileName()); + } + } else { + $modulesObj->setVar('mod_image', $_POST['mod_image']); + } + //Form module save + $modulesObj->setVars(array('mod_demo_site_url' => $_POST['mod_demo_site_url'], + 'mod_demo_site_name' => $_POST['mod_demo_site_name'], + 'mod_support_url' => $_POST['mod_support_url'], + 'mod_support_name' => $_POST['mod_support_name'], + 'mod_website_url' => $_POST['mod_website_url'], + 'mod_website_name' => $_POST['mod_website_name'], + 'mod_release' => $_POST['mod_release'], + 'mod_status' => $_POST['mod_status'], + 'mod_admin' => (($_REQUEST['mod_admin'] == 1) ? '1' : '0'), + 'mod_user' => (($_REQUEST['mod_user'] == 1) ? '1' : '0'), + 'mod_blocks' => (($_REQUEST['mod_blocks'] == 1) ? '1' : '0'), + 'mod_search' => (($_REQUEST['mod_search'] == 1) ? '1' : '0'), + 'mod_comments' => (($_REQUEST['mod_comments'] == 1) ? '1' : '0'), + 'mod_notifications' => (($_REQUEST['mod_notifications'] == 1) ? '1' : '0'), + 'mod_permissions' => (($_REQUEST['mod_permissions'] == 1) ? '1' : '0'), + 'mod_inroot_copy' => (($_REQUEST['mod_inroot_copy'] == 1) ? '1' : '0'), + 'mod_donations' => $_POST['mod_donations'], + 'mod_subversion' => $_POST['mod_subversion']) + ); + + if ($tdmcreate->getHandler('modules')->insert($modulesObj)) { + if( $modulesObj->isNew() ) { + redirect_header('modules.php', 5, sprintf(_AM_TDMCREATE_MODULE_FORM_CREATED_OK, $_POST['mod_name'])); + } else { + redirect_header('modules.php', 5, sprintf(_AM_TDMCREATE_MODULE_FORM_UPDATED_OK, $_POST['mod_name'])); + } + } + + $GLOBALS['xoopsTpl']->assign('error', $modulesObj->getHtmlErrors()); + $form =& $modulesObj->getForm(); + $GLOBALS['xoopsTpl']->assign('form', $form->render()); + break; + + case 'edit': + // Define main template + $template_main = 'tdmcreate_modules.tpl'; + $GLOBALS['xoTheme']->addScript('modules/TDMCreate/assets/js/functions.js'); + $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php')); + $adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modu... [truncated message content] |
From: <txm...@us...> - 2014-11-30 21:30:16
|
Revision: 12880 http://sourceforge.net/p/xoops/svn/12880 Author: txmodxoops Date: 2014-11-30 21:30:00 +0000 (Sun, 30 Nov 2014) Log Message: ----------- Added new classes file for autoload fixed bugs Modified Paths: -------------- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/ClassFormElements.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/common.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/install.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/xoops_version.php Added Paths: ----------- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreate.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateSession.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserFooter.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserHeader.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserIndex.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserNotificationUpdate.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserObjects.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserPages.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserPrint.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserRss.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserSubmit.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserXoopsVersion.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/form/TDMCreateThemeForm.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/html/TDMCreateFormLabel.php Removed Paths: ------------- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/abstract.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/about.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/footer.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/header.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/index.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/menu.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/objects.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/permissions.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/architecture.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/classes.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/formelements.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/helper.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/css/styles.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/docs/changelog.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/docs/docs.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/file.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/htmlsmartycodes.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/comment_functions.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/comments.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/common.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/functions.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/install.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/jquery.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/notifications.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/search.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/update.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/index.html XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/admin.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/blocks.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/defines.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/help.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/mail.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/main.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/modinfo.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/sql/mysql.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/structure.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/tablefields.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/about.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/footer.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/header.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/index.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/pages.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/permissions.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/blocks/blocks.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/footer.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/header.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/index.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/pages.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/footer.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/header.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/index.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/notification_update.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/objects.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/pages.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/print.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/rss.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/submit.php XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/xoopsversion.php Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreate.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreate.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreate.php 2014-11-30 21:30:00 UTC (rev 12880) @@ -0,0 +1,173 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +/** + * tdmcreate module + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package tdmcreate + * @since 2.5.0 + * @author trabis <lus...@gm...> + * @version $Id: tdmcreate.php 12258 2014-04-12 23:45:12Z timgno $ + */ +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class TDMCreate +{ + /** + * @var string + */ + private $dirname = null; + /** + * @var string + */ + private $module = null; + /** + * @var string + */ + private $handler = null; + /** + * @var string + */ + private $config = null; + /** + * @var string + */ + private $debug = null; + /** + * @var array + */ + private $debugArray = array(); + /* + * @protected function constructor class + * @param mixed $debug + */ + protected function __construct($debug) + { + $this->debug = $debug; + $this->dirname = basename(dirname(dirname(__FILE__))); + } + /* + * @static function &getInstance + * @param mixed $debug + */ + public static function &getInstance($debug = false) + { + static $instance = false; + if (!$instance) { + $instance = new self($debug); + } + return $instance; + } + /* + * @static function getModule + * @param null + */ + public function &getModule() + { + if ($this->module == null) { + $this->initModule(); + } + return $this->module; + } + /* + * @static function getConfig + * @param string $name + */ + public function getConfig($name = null) + { + if ($this->config == null) { + $this->initConfig(); + } + if (!$name) { + $this->addLog("Getting all config"); + return $this->config; + } + if (!isset($this->config[$name])) { + $this->addLog("ERROR :: CONFIG '{$name}' does not exist"); + return null; + } + $this->addLog("Getting config '{$name}' : " . $this->config[$name]); + return $this->config[$name]; + } + /* + * @static function setConfig + * @param string $name + * @param mixed $value + */ + public function setConfig($name = null, $value = null) + { + if ($this->config == null) { + $this->initConfig(); + } + $this->config[$name] = $value; + $this->addLog("Setting config '{$name}' : " . $this->config[$name]); + return $this->config[$name]; + } + /* + * @static function getHandler + * @param string $name + */ + public function &getHandler($name) + { + if (!isset($this->handler[$name . '_handler'])) { + $this->initHandler($name); + } + $this->addLog("Getting handler '{$name}'"); + return $this->handler[$name . '_handler']; + } + /* + * @static function initModule + * @param null + */ + public function initModule() + { + global $xoopsModule; + if (isset($xoopsModule) && is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $this->dirname) { + $this->module = $xoopsModule; + } else { + $hModule = xoops_gethandler('module'); + $this->module = $hModule->getByDirname($this->dirname); + } + $this->addLog('INIT MODULE'); + } + /* + * @static function initConfig + * @param null + */ + public function initConfig() + { + $this->addLog('INIT CONFIG'); + $hModConfig = xoops_gethandler('config'); + $this->config = $hModConfig->getConfigsByCat(0, $this->getModule()->getVar('mid')); + } + /* + * @static function initHandler + * @param string $name + */ + public function initHandler($name) + { + $this->addLog('INIT ' . $name . ' HANDLER'); + $this->handler[$name . '_handler'] = xoops_getModuleHandler($name, $this->dirname); + } + /* + * @static function addLog + * @param string $log + */ + public function addLog($log) + { + if ($this->debug) { + if (is_object($GLOBALS['xoopsLogger'])) { + $GLOBALS['xoopsLogger']->addExtra($this->module->name(), $log); + } + } + } +} \ No newline at end of file Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateSession.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateSession.php (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateSession.php 2014-11-30 21:30:00 UTC (rev 12880) @@ -0,0 +1,107 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ +/** + * TDMCreate class + * + * @copyright The XUUPS Project http://sourceforge.net/projects/xuups/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package TDMCreate + * @since 1.0 + * @author trabis <lus...@gm...> + * @author Harry Fuecks (PHP Anthology Volume II) + * @version $Id: 1.91 session.php 12453 2014-03-28 18:34:46Z timgno $ + */ +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class TDMCreateSession +{ + /** + * Session constructor<br /> + * Starts the session with session_start() + * <strong>Note:</strong> that if the session has already started, + * session_start() does nothing + */ + protected function __construct() + { + if(!isset($_SESSION)) { + session_start(); + } + } + + /* + * @static function &getInstance + * @param null + */ + public static function &getInstance() + { + static $_sess = false; + if (!isset($_sess)) { + $_sess = new self(); + } + return $_sess; + } + + /** + * Sets a session variable + * + * @param string $name name of variable + * @param mixed $value value of variable + * + * @return void + * @access public + */ + public function setSession($name, $value) + { + $_SESSION[$name] = $value; + } + + /** + * Fetches a session variable + * + * @param string $name name of variable + * + * @return mixed value of session variable + * @access public + */ + public function getSession($name) + { + if (isset($_SESSION[$name])) { + return $_SESSION[$name]; + } else { + return false; + } + } + + /** + * Deletes a session variable + * + * @param string $name name of variable + * + * @return void + * @access public + */ + public function deleteSession($name) + { + unset($_SESSION[$name]); + } + + /** + * Destroys the whole session + * + * @return void + * @access public + */ + public function destroySession() + { + $_SESSION = array(); + session_destroy(); + } +} \ No newline at end of file Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php 2014-11-27 22:11:13 UTC (rev 12879) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php 2014-11-30 21:30:00 UTC (rev 12880) @@ -19,8 +19,8 @@ * @version $Id: 1.91 fields.php 12258 2014-01-02 09:33:29Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); -require_once 'html/simplelabel.php'; -require_once 'form/themeform.php'; +require_once 'html/TDMCreateFormLabel.php'; +require_once 'form/TDMCreateThemeForm.php'; /* * @Class TDMCreateFields * @extends XoopsObject Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/abstract.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/abstract.php 2014-11-27 22:11:13 UTC (rev 12879) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/abstract.php 2014-11-30 21:30:00 UTC (rev 12880) @@ -1,137 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ -/** - * tdmcreate module - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package tdmcreate - * @since 2.5.0 - * @author Txmod Xoops http://www.txmodxoops.org - * @version $Id: abstract.php 12258 2014-01-02 09:33:29Z timgno $ - */ - -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -/** - * Abstract base class - */ -abstract class TDMCreateAbstract -{ - /** - * "module" attribute fot files - * - * @var mixed - */ - protected $module = null; - - /** - * "table" attribute fot files - * - * @var mixed - */ - protected $table = null; - - /** - * "tables" attribute fot files - * - * @var mixed - */ - protected $tables = null; - - /** - * "fields" attribute fot files - * - * @var mixed - */ - protected $fields = null; - - /** - * public function setFileName - * @param mixed $module - */ - public function setModule($module) { - if (is_object($module) && ($module instanceof TDMCreateModules)) { - $this->module = $module; - } - } - - /* - * @public function getModule - * @param null - */ - public function getModule() { - return $this->module; - } - - /** - * public function setTable - * @param mixed $table - */ - public function setTable($table) { - if (is_object($table) && ($table instanceof TDMCreateTables)) { - $this->table = $table; - } - } - - /* - * @public function getTable - * @param null - */ - public function getTable() { - return $this->table; - } - - /** - * public function setTables - * @param mixed $tables - */ - public function setTables($tables) { - if (is_array($tables)) { - $this->tables = $tables; - } - } - - /* - * @public function getTables - * @param null - */ - public function getTables() { - return $this->tables; - } - - /** - * @public function setFields - * @param mixed $fields - */ - public function setFields($fields) { - if (is_object($fields) && ($fields instanceof TDMCreateFields)) { - $this->fields = $fields; - } - } - - /* - * @public function getFields - * @param null - */ - public function getFields() { - return $this->fields; - } - - /** - * Generates output for files. - * - * This method is abstract and must be overwritten by the child classes. - * - * @abstract - */ - public function render() {} -} \ No newline at end of file Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/about.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/about.php 2014-11-27 22:11:13 UTC (rev 12879) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/about.php 2014-11-30 21:30:00 UTC (rev 12880) @@ -1,73 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ -/** - * tdmcreate module - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package tdmcreate - * @since 2.5.0 - * @author Txmod Xoops http://www.txmodxoops.org - * @version $Id: 1.91 admin_about.php 12258 2014-01-02 09:33:29Z timgno $ - */ -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -class AdminAbout extends TDMCreateFile -{ - /* - * @public function constructor - * @param null - */ - public function __construct() { - $this->tdmcfile = TDMCreateFile::getInstance(); - } - /* - * @static function &getInstance - * @param null - */ - public static function &getInstance() - { - static $instance = false; - if (!$instance) { - $instance = new self(); - } - return $instance; - } - /* - * @public function write - * @param string $module - * @param string $filename - */ - public function write($module, $filename) { - $this->setModule($module); - $this->setFileName($filename); - } - /* - * @public function render - * @param null - */ - public function render() { - $module = $this->getModule(); - $filename = $this->getFileName(); - $moduleDirname = $module->getVar('mod_dirname'); - $moduleDonations = $module->getVar('mod_donations'); - $content = $this->getHeaderFilesComments($module, $filename); - $content .= <<<EOT -include 'header.php'; -\$template_main = '{$moduleDirname}_admin_about.tpl'; -\$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('about.php')); -\$GLOBALS['xoopsTpl']->assign('about', \$adminMenu->renderAbout('{$moduleDonations}', false)); -include 'footer.php'; -EOT; - $this->tdmcfile->create($moduleDirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED); - return $this->tdmcfile->renderFile(); - } -} \ No newline at end of file Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/footer.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/footer.php 2014-11-27 22:11:13 UTC (rev 12879) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/footer.php 2014-11-30 21:30:00 UTC (rev 12880) @@ -1,73 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ -/** - * tdmcreate module - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package tdmcreate - * @since 2.5.0 - * @author Txmod Xoops http://www.txmodxoops.org - * @version $Id: 1.91 admin_footer.php 12258 2014-01-02 09:33:29Z timgno $ - */ -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -class AdminFooter extends TDMCreateFile -{ - /* - * @public function constructor - * @param null - */ - public function __construct() { - $this->tdmcfile = TDMCreateFile::getInstance(); - } - /* - * @static function &getInstance - * @param string $module - * @param string $filename - */ - public static function &getInstance() - { - static $instance = false; - if (!$instance) { - $instance = new self(); - } - return $instance; - } - /* - * @public function write - * @param string $module - * @param string $filename - */ - public function write($module, $filename) { - $this->setModule($module); - $this->setFileName($filename); - } - /* - * @public function render - * @param null - */ - public function render() { - $module = $this->getModule(); - $filename = $this->getFileName(); - $moduleDirname = $module->getVar('mod_dirname'); - $content = $this->getHeaderFilesComments($module, $filename); - $content .= <<<EOT -if ( isset(\$template_main) ) { - \$GLOBALS['xoopsTpl']->display("db:{\$template_main}"); -} -xoops_cp_footer(); -?> -EOT; - $this->tdmcfile->create($moduleDirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED); - return $this->tdmcfile->renderFile(); - } -} \ No newline at end of file Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/header.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/header.php 2014-11-27 22:11:13 UTC (rev 12879) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/header.php 2014-11-30 21:30:00 UTC (rev 12880) @@ -1,126 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ -/** - * tdmcreate module - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package tdmcreate - * @since 2.5.0 - * @author Txmod Xoops http://www.txmodxoops.org - * @version $Id: admin_header.php 12258 2014-01-02 09:33:29Z timgno $ - */ -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -class AdminHeader extends TDMCreateFile -{ - /* - * @public function constructor - * @param null - */ - public function __construct() { - $this->tdmcfile = TDMCreateFile::getInstance(); - } - /* - * @static function &getInstance - * @param null - */ - public static function &getInstance() - { - static $instance = false; - if (!$instance) { - $instance = new self(); - } - return $instance; - } - /* - * @public function write - * @param string $module - * @param mixed $table - * @param array $tables - * @param string $filename - */ - public function write($module, $table, $tables, $filename) { - $this->setModule($module); - $this->setTable($table); - $this->setTables($tables); - $this->setFileName($filename); - } - /* - * @public function render - * @param null - */ - public function render() { - $module = $this->getModule(); - $table = $this->getTable(); - $tables = $this->getTables(); - $filename = $this->getFileName(); - $moduleDirname = $module->getVar('mod_dirname'); - $ucfModuleDirname = ucfirst($moduleDirname); - $language = $this->getLanguage('AM'); - $content = $this->getHeaderFilesComments($module, $filename); - $content .= <<<EOT -\nrequire_once dirname(dirname(dirname(dirname(__FILE__)))). '/include/cp_header.php'; -\$thisPath = dirname(dirname(__FILE__)); -include_once \$thisPath.'/include/common.php'; -\$sysPathIcon16 = '../' . \$xoopsModule->getInfo('sysicons16'); -\$sysPathIcon32 = '../' . \$xoopsModule->getInfo('sysicons32'); -\$pathModuleAdmin = \$GLOBALS['xoopsModule']->getInfo('dirmoduleadmin'); -// -\$modPathIcon16 = \$xoopsModule->getInfo('modicons16'); -\$modPathIcon32 = \$xoopsModule->getInfo('modicons32');\n -EOT; - if (is_object($table)) { - if ( $table->getVar('table_name') != '' ) { - $content .= <<<EOT -// Get instance of module -\${$moduleDirname} = {$ucfModuleDirname}Helper::getInstance();\n -EOT; - } - foreach (array_keys($tables) as $t) - { - $tableName = $tables[$t]->getVar('table_name'); - $content .= <<<EOT -// {$tableName} -\${$tableName}Handler =& \${$moduleDirname}->getHandler('{$tableName}');\n -EOT; - } - } - $content .=<<<EOT -// -\$myts =& MyTextSanitizer::getInstance(); -if (!isset(\$xoopsTpl) || !is_object(\$xoopsTpl)) { - include_once(XOOPS_ROOT_PATH."/class/template.php"); - \$xoopsTpl = new XoopsTpl(); -} -// System icons path -\$xoopsTpl->assign('sysPathIcon16', \$sysPathIcon16); -\$xoopsTpl->assign('sysPathIcon32', \$sysPathIcon32); -// Local icons path -\$xoopsTpl->assign('modPathIcon16', \$modPathIcon16); -\$xoopsTpl->assign('modPathIcon32', \$modPathIcon32); - -//Load languages -xoops_loadLanguage('admin'); -xoops_loadLanguage('modinfo'); -// Local admin menu class -if ( file_exists(\$GLOBALS['xoops']->path(\$pathModuleAdmin.'/moduleadmin.php'))){ - include_once \$GLOBALS['xoops']->path(\$pathModuleAdmin.'/moduleadmin.php'); -}else{ - redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false); -} -xoops_cp_header(); -\$adminMenu = new ModuleAdmin(); -EOT; - $this->tdmcfile->create($moduleDirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED); - return $this->tdmcfile->renderFile(); - } -} \ No newline at end of file Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/index.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/index.php 2014-11-27 22:11:13 UTC (rev 12879) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/index.php 2014-11-30 21:30:00 UTC (rev 12880) @@ -1,114 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ -/** - * tdmcreate module - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package tdmcreate - * @since 2.5.0 - * @author Txmod Xoops http://www.txmodxoops.org - * @version $Id: admin_index.php 12258 2014-01-02 09:33:29Z timgno $ - */ -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -class AdminIndex extends TDMCreateFile -{ - /* - * @public function constructor - * @param null - */ - public function __construct() { - $this->tdmcfile = TDMCreateFile::getInstance(); - } - /* - * @static function &getInstance - * @param null - */ - public static function &getInstance() - { - static $instance = false; - if (!$instance) { - $instance = new self(); - } - return $instance; - } - /* - * @public function write - * @param string $module - * @param mixed $tables - * @param string $filename - */ - public function write($module, $tables, $filename) { - $this->setModule($module); - $this->setTables($tables); - $this->setFileName($filename); - } - /* - * @public function render - * @param null - */ - public function render() { - $module = $this->getModule(); - $tables = $this->getTables(); - $filename = $this->getFileName(); - $moduleDirname = $module->getVar('mod_dirname'); - $language = $this->getLanguage($moduleDirname, 'AM'); - $language_thereare = $this->getLanguage($moduleDirname, 'AM', 'THEREARE_'); - $content = $this->getHeaderFilesComments($module, $filename); - $content .= <<<EOT -include_once 'header.php'; -// Count elements\n -EOT; - $tableName = null; - if(is_array($tables)) { - foreach (array_keys($tables) as $i) - { - $tableName = $tables[$i]->getVar('table_name'); - $content .= <<<EOT -\$count_{$tableName} = \${$tableName}Handler->getCount();\n -EOT; - } - } - $content .= <<<EOT -// Template Index -\$template_main = '{$moduleDirname}_admin_index.tpl';\n -EOT; - if(is_array($tables)) { - $content .= <<<EOT -// InfoBox Statistics -\$adminMenu->addInfoBox({$language}STATISTICS); -// Info elements\n -EOT; - foreach (array_keys($tables) as $i) - { - $tableName = $tables[$i]->getVar('table_name'); - $stuTableName = $language_thereare.strtoupper($tableName); - $content .= <<<EOT -\$adminMenu->addInfoBoxLine({$language}STATISTICS, '<label>'.{$stuTableName}.'</label>', \$count_{$tableName});\n -EOT; - } - } - if($tableName == null) { - $content .= <<<EOT -\$adminMenu->addInfoBoxLine({$language}STATISTICS, '<label>No statistics</label>', 0);\n -EOT; - } - $content .= <<<EOT -// Render Index -echo \$adminMenu->addNavigation('index.php'); -echo \$adminMenu->renderIndex(); -include_once 'footer.php'; -EOT; - $this->tdmcfile->create($moduleDirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED); - return $this->tdmcfile->renderFile(); - } -} \ No newline at end of file Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/menu.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/menu.php 2014-11-27 22:11:13 UTC (rev 12879) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/menu.php 2014-11-30 21:30:00 UTC (rev 12880) @@ -1,165 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ -/** - * tdmcreate module - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package tdmcreate - * @since 2.5.0 - * @author Txmod Xoops http://www.txmodxoops.org - * @version $Id: admin_menu.php 12258 2014-01-02 09:33:29Z timgno $ - */ -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -class AdminMenu extends TDMCreateFile -{ - /* - * @public function constructor - * @param null - */ - public function __construct() { - parent::__construct(); - $this->tdmcfile = TDMCreateFile::getInstance(); - } - /* - * @static function &getInstance - * @param null - */ - public static function &getInstance() - { - static $instance = false; - if (!$instance) { - $instance = new self(); - } - return $instance; - } - /* - * @public function write - * @param string $module - * @param object $table - * @param array $tables - * @param string $filename - */ - public function write($module, $table, $tables, $filename) { - $this->setModule($module); - $this->setTable($table); - $this->setTables($tables); - $this->setFileName($filename); - } - /* - * @private function getAdminMenuHeader - * @param null - */ - private function getAdminMenuHeader() { - $ret = <<<EOT -\$dirname = basename( dirname( dirname( __FILE__ ) ) ) ; -\$module_handler =& xoops_gethandler('module'); -\$xoopsModule =& XoopsModule::getByDirname(\$dirname); -\$moduleInfo =& \$module_handler->get(\$xoopsModule->getVar('mid')); -\$sysPathIcon32 = \$moduleInfo->getInfo('sysicons32');\n -EOT; - return $ret; - } - /* - * @private function getAdminMenuDashboard - * @param string $language - * @param integer $menu - */ - private function getAdminMenuDashboard($language, $menu) { - $ret = <<<EOT -\$i = 1; -\$adminmenu[\$i]['title'] = {$language}{$menu}; -\$adminmenu[\$i]['link'] = 'admin/index.php'; -\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/dashboard.png'; -\$i++;\n -EOT; - return $ret; - } - /* - * @private function getAdminMenuImagesPath - * @param array $tables - * @param integer $t - */ - private function getAdminMenuImagesPath($tables, $t) { - $fields = $this->getTableFields($tables[$t]->getVar('table_id')); - foreach (array_keys($fields) as $f) - { - $fieldElement = $fields[$f]->getVar('field_element'); - switch( $fieldElement ) { - case 11: - $ret = <<<EOT -\$adminmenu[\$i]['icon'] = 'assets/images/icons/32/{$tables[$t]->getVar('table_image')}';\n -EOT; - break; - default: - $ret = <<<EOT -\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$tables[$t]->getVar('table_image')}';\n -EOT; - break; - } - } - return $ret; - } - /* - * @public function render - * @param null - */ - public function render() { - $module = $this->getModule(); - $table = $this->getTable(); - $tables = $this->getTables(); - $filename = $this->getFileName(); - $moduleDirname = $module->getVar('mod_dirname'); - $language = $this->getLanguage($moduleDirname, 'MI', 'ADMENU'); - $menu = 1; - $content = $this->getHeaderFilesComments($module, $filename); - $content .= $this->getAdminMenuHeader(); - $content .= $this->getAdminMenuDashboard($language, $menu); - foreach (array_keys($tables) as $t) - { - $tablePermissions = $tables[$t]->getVar('table_permissions'); - if ( $tables[$t]->getVar('table_admin') == 1 ) - { - $menu++; - $content .= <<<EOT -\$adminmenu[\$i]['title'] = {$language}{$menu}; -\$adminmenu[\$i]['link'] = 'admin/{$tables[$t]->getVar('table_name')}.php'; -\$adminmenu[\$i]['icon'] = 'assets/images/icons/32/{$tables[$t]->getVar('table_image')}';\n -EOT; - //$content .= $this->getAdminMenuImagesPath($tables, $t); - $content .= <<<EOT -\$i++;\n -EOT; - } - } - if (is_object($table) && $table->getVar('table_permissions') == 1) { - $menu++; - $content .= <<<EOT -\$adminmenu[\$i]['title'] = {$language}{$menu}; -\$adminmenu[\$i]['link'] = 'admin/permissions.php'; -\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/permissions.png'; -\$i++;\n -EOT; - } - $menu++; - $content .= <<<EOT -\$adminmenu[\$i]['title'] = {$language}{$menu}; -\$adminmenu[\$i]['link'] = 'admin/about.php'; -\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/about.png'; -unset( \$i ); -EOT; - unset( $menu ); - - $this->tdmcfile->create($moduleDirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED); - return $this->tdmcfile->renderFile(); - } -} \ No newline at end of file Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/objects.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/objects.php 2014-11-27 22:11:13 UTC (rev 12879) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/objects.php 2014-11-30 21:30:00 UTC (rev 12880) @@ -1,246 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ -/** - * tdmcreate module - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package tdmcreate - * @since 2.5.0 - * @author Txmod Xoops http://www.txmodxoops.org - * @version $Id: admin_objects.php 12258 2014-01-02 09:33:29Z timgno $ - */ -defined('XOOPS_ROOT_PATH') or die('Restricted access'); - -class AdminObjects -{ - /* - * @static function &getInstance - * @param null - */ - public static function &getInstance() - { - static $instance = false; - if (!$instance) { - $instance = new self(); - } - return $instance; - } - /* - * @public function getSimpleSetVar - * @param string $tableName - * @param string $fieldName - */ - public function getSimpleSetVar($tableName, $fieldName) { - $ret = <<<EOT - // Set Var {$fieldName} - \${$tableName}Obj->setVar('{$fieldName}', \$_POST['{$fieldName}']);\n -EOT; - return $ret; - } - /* - * @public function getTextDateSelectSetVar - * @param string $tableName - * @param string $fieldName - */ - public function getTextDateSelectSetVar($tableName, $fieldName) { - $ret = <<<EOT - // Set Var {$fieldName} - \${$tableName}Obj->setVar('{$fieldName}', strtotime(\$_POST['{$fieldName}']));\n -EOT; - return $ret; - } - /* - * @public function getCheckBoxOrRadioYNSetVar - * @param string $tableName - * @param string $fieldName - */ - public function getCheckBoxOrRadioYNSetVar($tableName, $fieldName) { - $ret = <<<EOT - // Set Var {$fieldName} - \${$tableName}Obj->setVar('{$fieldName}', ((\$_REQUEST['{$fieldName}'] == 1) ? '1' : '0'));\n -EOT; - return $ret; - } - /* - * @public function getImageListSetVar - * @param string $moduleDirname - * @param string $tableName - * @param string $fieldName - */ - public function getImageListSetVar($moduleDirname, $tableName, $fieldName) { - $ret = <<<EOT - // Set Var {$fieldName} - include_once XOOPS_ROOT_PATH.'/class/uploader.php'; - \$uploaddir = XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32'; - \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'), - \${$moduleDirname}->getConfig('maxsize'), null, null); - if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) { - //\$uploader->setPrefix('{$fieldName}_'); - //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]); - if (!\$uploader->upload()) { - \$errors = \$uploader->getErrors(); - redirect_header('javascript:history.go(-1)', 3, \$errors); - } else { - \${$tableName}Obj->setVar('{$fieldName}', \$uploader->getSavedFileName()); - } - } else { - \${$tableName}Obj->setVar('{$fieldName}', \$_POST['{$fieldName}']); - }\n -EOT; - return $ret; - } - /* - * @public function getUploadImageSetVar - * @param string $moduleDirname - * @param string $tableName - * @param string $fieldName - */ - public function getUploadImageSetVar($moduleDirname, $tableName, $fieldName) { - $stuModuleDirname = strtoupper($moduleDirname); - $ret = <<<EOT - // Set Var {$fieldName} - include_once XOOPS_ROOT_PATH.'/class/uploader.php'; - \$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/images/{$tableName}'; - \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'), - \${$moduleDirname}->getConfig('maxsize'), null, null); - if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) { - //\$uploader->setPrefix('{$fieldName}_'); - //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]); - if (!\$uploader->upload()) { - \$errors = \$uploader->getErrors(); - redirect_header('javascript:history.go(-1)', 3, \$errors); - } else { - \${$tableName}Obj->setVar('{$fieldName}', \$uploader->getSavedFileName()); - } - } else { - \${$tableName}Obj->setVar('{$fieldName}', \$_POST['{$fieldName}']); - }\n -EOT; - return $ret; - } - /* - * @public function getUploadFileSetVar - * @param string $moduleDirname - * @param string $tableName - * @param string $fieldName - */ - public function getUploadFileSetVar($moduleDirname, $tableName, $fieldName) { - $stuModuleDirname = strtoupper($moduleDirname); - $ret = <<<EOT - // Set Var {$fieldName} - include_once XOOPS_ROOT_PATH.'/class/uploader.php'; - \$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/files/{$tableName}'; - \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'), - \${$moduleDirname}->getConfig('maxsize'), null, null); - if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) { - //\$uploader->setPrefix('{$fieldName}_') ; - //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]); - if (!\$uploader->upload()) { - \$errors = \$uploader->getErrors(); - redirect_header('javascript:history.go(-1)', 3, \$errors); - } else { - \${$tableName}Obj->setVar('{$fieldName}', \$uploader->getSavedFileName()); - } - }\n -EOT; - return $ret; - } - /* - * @public function getSimpleGetVar - * @param string $lpFieldName - * @param string $rpFieldName - * @param string $tableName - * @param string $fieldName - */ - public function getSimpleGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) { - $ret = <<<EOT -\t\t\t\t// Get Var {$fieldName} -\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = \${$tableName}_arr[\$i]->getVar('{$fieldName}');\n -EOT; - return $ret; - } - /* - * @public function getTopicGetVar - * @param string $lpFieldName - * @param string $rpFieldName - * @param string $tableName - * @param string $tableNameTopic - * @param string $fieldNameParent - * @param string $fieldNameTopic - */ - public function getTopicGetVar($lpFieldName, $rpFieldName, $tableName, $tableNameTopic, $fieldNameParent, $fieldNameTopic) { - $ret = <<<EOT -\t\t\t\t// Get Var {$fieldNameParent} -\t\t\t\t\${$rpFieldName} =& \${$tableNameTopic}Handler->get(\${$tableName}_arr[\$i]->getVar('{$fieldNameParent}')); -\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = \${$rpFieldName}->getVar('{$fieldNameTopic}');\n -EOT; - return $ret; - } - /* - * @public function getUploadImageGetVar - * @param string $lpFieldName - * @param string $rpFieldName - * @param string $tableName - * @param string $fieldName - */ - public function getUploadImageGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) { - $ret = <<<EOT -\t\t\t\t// Get Var {$fieldName} -\t\t\t\t\${$fieldName} = \${$tableName}_arr[\$i]->getVar('{$fieldName}'); -\t\t\t\t\$upload_image = \${$fieldName} ? \${$fieldName} : 'blank.gif'; -\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = \$upload_image;\n -EOT; - return $ret; - } - /* - * @public function getTextAreaGetVar - * @param string $lpFieldName - * @param string $rpFieldName - * @param string $tableName - * @param string $fieldName - */ - public function getTextAreaGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) { - $ret = <<<EOT -\t\t\t\t// Get Var {$fieldName} -\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = strip_tags(\${$tableName}_arr[\$i]->getVar('{$fieldName}'));\n -EOT; - return $ret; - } - /* - * @public function getSelectUserGetVar - * @param string $lpFieldName - * @param string $rpFieldName - * @param string $tableName - * @param string $fieldName - */ - public function getSelectUserGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) { - $ret = <<<EOT -\t\t\t\t// Get Var {$fieldName} -\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = XoopsUser::getUnameFromId(\${$tableName}_arr[\$i]->getVar('{$fieldName}'), 's');\n -EOT; - return $ret; - } - /* - * @public function getTextDateSelectGetVar - * @param string $lpFieldName - * @param string $rpFieldName - * @param string $tableName - * @param string $fieldName - */ - public function getTextDateSelectGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) { - $ret = <<<EOT -\t\t\t\t// Get Var {$fieldName} -\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = formatTimeStamp(\${$tableName}_arr[\$i]->getVar('{$fieldName}'), 's');\n -EOT; - return $ret; - } -} \ No newline at end of file Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php 2014-11-27 22:11:13 UTC (rev 12879) +++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php 2014-11-30 21:30:00 UTC (rev 12880) @@ -1,380 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ -/** - * tdmcreate module - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package tdmcreate - * @since 2.5.0 - * @author Txmod Xoops http://www.txmodxoops.org - * @version $Id: pages.php 12258 2014-01-02 09:33:29Z timgno $ - */ -defined('XOOPS_ROOT_PATH') or die('Restricted access'); -require_once 'objects.php'; -class AdminPages extends TDMCreateFile -{ - /* - * @var string - */ - private $adminobjects = null; - /* - * @public function constructor - * @param null - */ - public function __construct() { - parent::__construct(); - $this->adminobjects = AdminObjects::getInstance(); - $this->tdmcfile = TDMCreateFile::getInstance(); - } - /* - * @static function &getInstance - * @param null - */ - public static function &getInstance() - { - static $instance = false; - if (!$instance) { - $instance = new self(); - } - return $instance; - } - /* - * @public function write - * @param string $module - * @param string $table - */ - public function write($module, $table) { - $this->setModule($module); - $this->setTable($table); - } - /* - * @public function getAdminPagesHeader - * @param string $moduleDirname - * @param string $tableName - */ - public function getAdminPagesHeader($moduleDirname, $table, $fpif) { - - $ret = <<<EOT -include_once 'header.php'; -//It recovered the value of argument op in URL$ -\$op = XoopsRequest::getString('op', 'list'); -// Request {$fpif} -\${$fpif} = XoopsRequest::getInt('{$fpif}'); -// Switch options -switch (\$op) -{\n -EOT; - return $ret; - } - - /* - * @public function getAdminPagesList - * @param string $moduleDirname - * @param string $table - * @param string $tableFieldname - * @param string $language - * @param string $fields - * @param string $fpif - * @param string $fpmf - */ - public function getAdminPagesList($moduleDirname, $table, $tableFieldname, $language, $fields, $fpif, $fpmf) { - $stuModuleDirname = strtoupper($moduleDirname); - $tableName = $table->getVar('table_name'); - $tableAutoincrement = $table->getVar('table_autoincrement'); - $stuTableName = strtoupper($tableName); - $stuTableFieldname = strtoupper($tableFieldname); - $ret = <<<EOT - case 'list': - default: - \$start = XoopsRequest::getInt('start', 0); - \$limit = XoopsRequest::getInt('limit', \${$moduleDirname}->getConfig('adminpager')); - \$template_main = '{$moduleDirname}_admin_{$tableName}.tpl'; - \$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php')); - \$adminMenu->addItemButton({$language}ADD_{$stuTableFieldname}, '{$tableName}.php?op=new', 'add'); - \$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton()); - \$criteria = new CriteriaCompo(); - \$criteria->setSort('{$fpif} ASC, {$fpmf}'); - \$criteria->setOrder('ASC'); - \${$tableName}_rows = \${$tableName}Handler->getCount(\$criteria); - \${$tableName}_arr = \${$tableName}Handler->getAll(\$criteria); - unset(\$criteria); - \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_url', {$stuModuleDirname}_URL); - \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_upload_url', {$stuModuleDirname}_UPLOAD_URL); - // Table view - if (\${$tableName}_rows > 0) - { - foreach (array_keys(\${$tableName}_arr) as \$i) - {\n -EOT; - foreach(array_keys($fields) as $f) - { - $fieldName = $fields[$f]->getVar('field_name'); - $fieldParent = $fields[$f]->getVar('field_parent'); - // Verify if table_fieldname is not empty - $lpFieldName = !empty($tableFieldname) ? substr($fieldName, 0, strpos($fieldName, '_')) : $tableName; - $rpFieldName = $this->tdmcfile->getRightString($fieldName); - // - $fieldElement = $fields[$f]->getVar('field_element'); - if( ($fields[$f]->getVar('field_admin') == 1) || ($tableAutoincrement == 1) ) { - switch($fieldElement) { - case 3: - case 4: - $ret .= $this->adminobjects->getTextAreaGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName); - break; - case 8: - $ret .= $this->adminobjects->getSelectUserGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName); - break; - case 11: - $ret .= $this->adminobjects->getUploadImageGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName); - break; - case 13: - $ret .= $this->adminobjects->getTextDateSelectGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName); - break; - default: - if( ($fieldParent == 1) && !$table->getVar('table_category') ) { - if($fieldElement > 13) { - $fieldElements = $this->tdmcreate->getHandler('fieldelements')->get($fieldElement); - $fieldElementTid = $fieldElements->getVar('fieldelement_tid'); - $fieldElementName = $fieldElements->getVar('fieldelement_name'); - $rpFieldElementName = strtolower(str_replace('Table : ', '', $fieldElementName)); - } - // - $fieldNameParent = $fieldName; - // - $criteriaFieldsTopic = new CriteriaCompo(); - $criteriaFieldsTopic->add(new Criteria('field_tid', $fieldElementTid)); - $fieldsTopic = $this->tdmcreate->getHandler('fields')->getObjects($criteriaFieldsTopic); - unset($criteriaFieldsTopic); - foreach(array_keys($fieldsTopic) as $ft) - { - if( $fieldsTopic[$ft]->getVar('field_main') == 1 ) { - $fieldNameTopic = $fieldsTopic[$ft]->getVar('field_name'); - } - } - $ret .= $this->adminobjects->getTopicGetVar($lpFieldName, $rpFieldName, $tableName, $rpFieldElementName, $fieldNameParent, $fieldNameTopic); - } else { - $ret .= $this->adminobjects->getSimpleGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName); - } - break; - } - } - } - $ret .= <<<EOT - \$GLOBALS['xoopsTpl']->append('{$tableName}_list', \${$lpFieldName}); - unset(\${$lpFieldName}); - }\n -EOT; - $ret .= <<<EOT - if ( \${$tableName}_rows > \$limit ) { - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; - \$pagenav = new XoopsPageNav(\${$tableName}_rows, \$limit, \$start, 'start', 'op=list&limit=' . \$limit); - \$GLOBALS['xoopsTpl']->assign('pagenav', \$pagenav->renderNav(4)); - } - } else { - \$GLOBALS['xoopsTpl']->assign('error', {$language}THEREARENT_{$stuTableName}); - } - break;\n -EOT; - return $ret; - } - - /* - * @public function getAdminPagesNew - * @param string $moduleDirname - * @param string $tableName - * @param string $language - */ - public function getAdminPagesNew($moduleDirname, $tableName, $language) { - $stuTableName = strtoupper($tableName); - $ret = <<<EOT - case 'new': - \$template_main = '{$moduleDirname}_admin_{$tableName}.tpl'; - \$adminMenu->addItemButton({$language}{$stuTableName}_LIST, '{$tableName}.php', 'list'); - \$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php')); - \$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton()); - // Get Form - \${$tableName}Obj =& \${$tableName}Handler->create(); - \$form = \${$tableName}Obj->getForm(); - \$GLOBALS['xoopsTpl']->assign('form', \$form->render()); - break;\n -EOT; - return $ret; - } - - /* - * @public function getAdminPagesSave - * @param string $moduleDirname - * @param string $tableName - * @param string $language - * @param string $fields - * @param string $fpif - * @param string $fpmf - */ - public function getAdminPagesSave($moduleDirname, $tableName, $language, $fields, $fpif, $fpmf) - { - $ret = <<<EOT - case 'save': - if ( !\$GLOBALS['xoopsSecurity']->check() ) { - redirect_header('{$tableName}.php', 3, implode(',', \$GLOBALS['xoopsSecurity']->getErrors())); - } - if (isset(\${$fpif})) { - \${$tableName}Obj =& \${$tableName}Handler->get(\${$fpif}); - } else { - \${$tableName}Obj =& \${$tableName}Handler->create(); - } - // Set Vars\n -EOT; - foreach (array_keys($fields) as $f) - { - $fieldName = $fields[$f]->getVar('field_name'); - $fieldElement = $fields[$f]->getVar('field_element'); - if($f > 0) { // If we want to hide field id - switch($fieldElement) { - case 5: - case 6: - $ret .= $this->adminobjects->getCheckBoxOrRadioYNSetVar($tableName, $fieldName); - break; - case 10: - $ret .= $this->adminobjects->getImageListSetVar($moduleDirname, $tableName, $fieldName); - break; - case 11: - $ret .= $this->adminobjects->getUploadImageSetVar($moduleDirname, $tableName, $fieldName); - break; - case 12: - $ret .= $this->adminobjects->getUploadFileSetVar($moduleDirname, $tableName, $fieldName); - break; - case 13: - $ret .= $this->adminobjects->getTextDateSelectSetVar($tableName, $fieldName); - break; - default: - $ret .= $this->adminobjects->getSimpleSetVar($tableName, $fieldName); - break; - } - } - } - - $ret .= <<<EOT - // Insert Data - if (\${$tableName}Handler->insert(\${$tableName}Obj)) { - redirect_header('{$tableName}.php?op=list', 2, {$language}FORMOK); - } - // Get Form - \$GLOBALS['xoopsTpl']->assign('error', \${$tableName}Obj->getHtmlErrors()); - \$form =& \${$tableName}Obj->getForm(); - \$GLOBALS['xoopsTpl']->assign('form', \$form->render()); - break;\n -EOT; - return $ret; - } - - /* - * @public function getAdminPagesEdit - * @param string $moduleDirname - * @param string $tableName - * @param string $tableFieldname - * @param string $language - * @param string $fpif - */ - public function getAdminPagesEdit($moduleDirname, $tableName, $tableFieldname, $language, $fpif) { - $stuTableName = strtoupper($tableName); - $stuTableFieldname = strtoupper($tableFieldname); - $ret = <<<EOT - case 'edit': - \$template_main = '{$moduleDirname}_admin_{$tableName}.tpl'; - \$adminMenu->addItemButton({$language}ADD_{$stuTableFieldname}, '{$tableName}.php?op=new', 'add'); - \$adminMenu->addItemButton({$language}{$stuTableName}_LIST, '{$tableName}.php', 'list'); - \$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php')); - \$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton()); - // Get Form - \${$tableName}Obj = \${$tableName}Handler->get(\${$fpif}); - \$form = \${$tableName}Obj->getForm(); - \$GLOBALS['xoopsTpl']->assign('form', \$form->render()); - break;\n -EOT; - return $ret; - } - - /* - * @public function getAdminPagesDelete - * @param string $tableName - * @param string $language - */ - public function getAdminPagesDelete($tableName, $language, $fpif, $fpmf) { - - $ret = <<<EOT - case 'delete': - \${$tableName}Obj =& \${$tableName}Handler->get(\${$fpif}); - if (isset(\$_REQUEST['ok']) && \$_REQUEST['ok'] == 1) { - if ( !\$GLOBALS['xoopsSecurity']->check() ) { - redirect_header('{$tableName}.php', 3, implode(', ', \$GLOBALS['xoopsSecurity']->getErrors())); - } - if (\${$tableName}Handler->delete(\${$tableName}Obj)) { - redirect... [truncated message content] |
From: <txm...@us...> - 2014-11-27 22:11:22
|
Revision: 12879 http://sourceforge.net/p/xoops/svn/12879 Author: txmodxoops Date: 2014-11-27 22:11:13 +0000 (Thu, 27 Nov 2014) Log Message: ----------- To Team Core Pleace consider this addon in error.php language for features Modified Paths: -------------- XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/language/english/errors.php Modified: XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/language/english/errors.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/language/english/errors.php 2014-11-27 20:24:57 UTC (rev 12878) +++ XoopsCore/branches/2.5.x/2.5.7_timgno/htdocs/language/english/errors.php 2014-11-27 22:11:13 UTC (rev 12879) @@ -4,7 +4,7 @@ // Translator: XOOPS Translation Team define('_XO_ER_FILENOTFOUND','Requested file: <b>%s</b> was not found '); define('_XO_ER_CLASSNOTFOUND','Requested class %s was not found'); -// Error Pages by TXMod Xoops +// Error Pages by Timgno define ('_XO_ER_TITLE', 'Error not classified (Not Classified)'); define ('_XO_ER_DESC', 'Sorry, but this error has not been classified.'); define ('_XO_ER_TITLE400', 'Error 400 - Bad Request (Bad Request)'); |
From: <be...@us...> - 2014-11-27 20:25:05
|
Revision: 12878 http://sourceforge.net/p/xoops/svn/12878 Author: beckmi Date: 2014-11-27 20:24:57 +0000 (Thu, 27 Nov 2014) Log Message: ----------- Adding 2.5.7.1 to /releases Added Paths: ----------- XoopsCore/releases/2.5.7.1/ |
From: <be...@us...> - 2014-11-27 20:16:06
|
Revision: 12877 http://sourceforge.net/p/xoops/svn/12877 Author: beckmi Date: 2014-11-27 20:15:53 +0000 (Thu, 27 Nov 2014) Log Message: ----------- Adding 2.5.7.1 patch Modified Paths: -------------- XoopsCore/branches/2.5.x/2.5.7.1/docs/changelog.250.txt XoopsCore/branches/2.5.x/2.5.7.1/htdocs/class/uploader.php XoopsCore/branches/2.5.x/2.5.7.1/htdocs/class/xoopsfilterinput.php XoopsCore/branches/2.5.x/2.5.7.1/htdocs/class/xoopsrequest.php XoopsCore/branches/2.5.x/2.5.7.1/htdocs/include/common.php XoopsCore/branches/2.5.x/2.5.7.1/htdocs/include/version.php XoopsCore/branches/2.5.x/2.5.7.1/htdocs/kernel/session.php XoopsCore/branches/2.5.x/2.5.7.1/htdocs/modules/pm/pmlite.php XoopsCore/branches/2.5.x/2.5.7.1/htdocs/modules/pm/readpmsg.php XoopsCore/branches/2.5.x/2.5.7.1/htdocs/modules/pm/viewpmsg.php XoopsCore/branches/2.5.x/2.5.7.1/htdocs/modules/system/admin/modulesadmin/main.php XoopsCore/branches/2.5.x/2.5.7.1/htdocs/modules/system/themes/default/default.php XoopsCore/branches/2.5.x/2.5.7.1/htdocs/pmlite.php XoopsCore/branches/2.5.x/2.5.7.1/htdocs/readpmsg.php XoopsCore/branches/2.5.x/2.5.7.1/htdocs/viewpmsg.php XoopsCore/branches/2.5.x/2.5.7.1/release_notes.txt Modified: XoopsCore/branches/2.5.x/2.5.7.1/docs/changelog.250.txt =================================================================== --- XoopsCore/branches/2.5.x/2.5.7.1/docs/changelog.250.txt 2014-11-27 19:24:24 UTC (rev 12876) +++ XoopsCore/branches/2.5.x/2.5.7.1/docs/changelog.250.txt 2014-11-27 20:15:53 UTC (rev 12877) @@ -1,5 +1,17 @@ XOOPS 2.5.x Changelog (Language changes: see: /docs/lang_diff.txt) +================================= +2014/06/14: Version 2.5.7.1 Final +================================= + +This patch for XOOPS 2.5.7 corrects the following issues: + +- CSRF and XSS issues reported by Dingjie 'Daniel' Yang of Qualsys +- XSS and best practice issues reported by Narendra Bhati + +All XOOPS 2.5.7 users are advised to apply this patch as soon as possible. Any users that are running an older XOOPS version are advised to update to XOOPS 2.5.7.1 now. + + =============================== 2014/06/14: Version 2.5.7 Final =============================== Modified: XoopsCore/branches/2.5.x/2.5.7.1/htdocs/class/uploader.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.7.1/htdocs/class/uploader.php 2014-11-27 19:24:24 UTC (rev 12876) +++ XoopsCore/branches/2.5.x/2.5.7.1/htdocs/class/uploader.php 2014-11-27 20:15:53 UTC (rev 12877) @@ -9,7 +9,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @copyright (c) 2000-2014 XOOPS Project (www.xoops.org) * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package kernel * @since 2.0.0 @@ -589,7 +589,7 @@ } else { $ret = ''; if (count($this->errors) > 0) { - $ret = '<h4>' . sprintf(_ER_UP_ERRORSRETURNED, $this->mediaName) . '</h4>'; + $ret = '<h4>' . sprintf(_ER_UP_ERRORSRETURNED, htmlspecialchars($this->mediaName, ENT_QUOTES)) . '</h4>'; foreach ($this->errors as $error) { $ret .= $error . '<br />'; } Modified: XoopsCore/branches/2.5.x/2.5.7.1/htdocs/class/xoopsfilterinput.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.7.1/htdocs/class/xoopsfilterinput.php 2014-11-27 19:24:24 UTC (rev 12876) +++ XoopsCore/branches/2.5.x/2.5.7.1/htdocs/class/xoopsfilterinput.php 2014-11-27 20:15:53 UTC (rev 12877) @@ -13,7 +13,7 @@ * XoopsFilterInput is a class for filtering input from any data source * * Forked from the php input filter library by Daniel Morris - * + * * Original Contributors: Gianpaolo Racca, Ghislain Picard, * Marco Wandschneider, Chris Tobin and Andrew Eddie. * @@ -26,7 +26,7 @@ * @author Richard Griffith <ri...@ge...> * @copyright 2005 Daniel Morris * @copyright 2005 - 2013 Open Source Matters, Inc. All rights reserved. - * @copyright 2011-2013 The XOOPS Project http://sourceforge.net/projects/xoops/ + * @copyright 2011-2014 The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) * @version Release: 1.0 * @link http://xoops.org @@ -66,10 +66,10 @@ $xssAuto = 1 ) { // make sure user defined arrays are in lowercase - for ($i = 0; $i < count($tagsArray); $i++) { + for ($i = 0; $i < count($tagsArray); ++$i) { $tagsArray[$i] = strtolower($tagsArray[$i]); } - for ($i = 0; $i < count($attrArray); $i++) { + for ($i = 0; $i < count($attrArray); ++$i) { $attrArray[$i] = strtolower($attrArray[$i]); } // assign to member vars @@ -121,11 +121,11 @@ } /** - * Method to be called by another php script. Processes for XSS and + * Method to be called by another php script. Processes for XSS and * any specified bad code. * * @param Mixed $source - input string/array-of-string to be 'cleaned' - * + * * @return String $source - 'cleaned' version of input parameter */ public function process($source) @@ -258,7 +258,7 @@ * Internal method to iteratively remove all unwanted tags and attributes * * @param String $source - input string to be 'cleaned' - * + * * @return String $source - 'cleaned' version of input parameter */ protected function remove($source) @@ -267,7 +267,7 @@ // provides nested-tag protection while ($source != $this->filterTags($source)) { $source = $this->filterTags($source); - $loopCounter++; + ++$loopCounter; } return $source; @@ -275,9 +275,9 @@ /** * Internal method to strip a string of certain tags - * + * * @param String $source - input string to be 'cleaned' - * + * * @return String $source - 'cleaned' version of input parameter */ protected function filterTags($source) @@ -355,7 +355,7 @@ $attr = substr($fromSpace, 0, $nextSpace); } // one or neither exist - + } else { // no more equals exist $attr = substr($fromSpace, 0, $nextSpace); @@ -378,7 +378,7 @@ if (!$isCloseTag) { $attrSet = $this->filterAttr($attrSet); $preTag .= '<' . $tagName; - for ($i = 0; $i < count($attrSet); $i++) { + for ($i = 0; $i < count($attrSet); ++$i) { $preTag .= ' ' . $attrSet[$i]; } // reformat single tags to XHTML @@ -406,14 +406,14 @@ * Internal method to strip a tag of certain attributes * * @param array $attrSet attributes - * + * * @return Array $newSet stripped attributes */ protected function filterAttr($attrSet) { $newSet = array(); // process attributes - for ($i = 0; $i <count($attrSet); $i++) { + for ($i = 0; $i <count($attrSet); ++$i) { // skip blank spaces in tag if (!$attrSet[$i]) { continue; @@ -483,7 +483,7 @@ * Try to convert to plaintext * * @param String $source string to decode - * + * * @return String $source decoded */ protected function decode($source) Modified: XoopsCore/branches/2.5.x/2.5.7.1/htdocs/class/xoopsrequest.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.7.1/htdocs/class/xoopsrequest.php 2014-11-27 19:24:24 UTC (rev 12876) +++ XoopsCore/branches/2.5.x/2.5.7.1/htdocs/class/xoopsrequest.php 2014-11-27 20:15:53 UTC (rev 12877) @@ -21,7 +21,7 @@ * @author Richard Griffith <ri...@ge...> * @author trabis <lus...@gm...> * @author Joomla! - * @copyright 2011-2013 The XOOPS Project http://sourceforge.net/projects/xoops/ + * @copyright (c) 2000-2014 XOOPS Project (www.xoops.org) * @license GNU GPL 2 or later (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @version Release: 1.0 * @link http://xoops.org @@ -429,6 +429,11 @@ $var = trim($var); } + // convert $var in array if $type is ARRAY + if (strtoupper($type) == 'ARRAY' && !is_array($var)) { + $var = array($var); + } + // Now we handle input filtering if ($mask & 2) { // If the allow raw flag is set, do not modify the variable Modified: XoopsCore/branches/2.5.x/2.5.7.1/htdocs/include/common.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.7.1/htdocs/include/common.php 2014-11-27 19:24:24 UTC (rev 12876) +++ XoopsCore/branches/2.5.x/2.5.7.1/htdocs/include/common.php 2014-11-27 20:15:53 UTC (rev 12877) @@ -9,7 +9,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @copyright (c) 2000-2014 XOOPS Project (www.xoops.org) * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package kernel * @version $Id$ @@ -130,6 +130,14 @@ trigger_error('File Path Error: ' . 'var/configs/xoopsconfig.php' . ' does not exist.'); } +/** + * clickjack protection - Add option to HTTP header restrictig using site in an iframe + */ +$xFrameOptions = isset($xoopsConfig['xFrameOptions']) ? $xoopsConfig['xFrameOptions'] : 'sameorigin'; +if (!headers_sent() && !empty($xFrameOptions)) { + header('X-Frame-Options: ' .$xFrameOptions); +} + //check if user set a local timezone (from XavierS) // $xoops_server_timezone="Etc/GMT"; // if ($xoopsConfig["server_TZ"]>0) { Modified: XoopsCore/branches/2.5.x/2.5.7.1/htdocs/include/version.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.7.1/htdocs/include/version.php 2014-11-27 19:24:24 UTC (rev 12876) +++ XoopsCore/branches/2.5.x/2.5.7.1/htdocs/include/version.php 2014-11-27 20:15:53 UTC (rev 12877) @@ -30,4 +30,4 @@ /** * Define XOOPS version */ -define('XOOPS_VERSION', 'XOOPS 2.5.7'); +define('XOOPS_VERSION', 'XOOPS 2.5.7.1'); Modified: XoopsCore/branches/2.5.x/2.5.7.1/htdocs/kernel/session.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.7.1/htdocs/kernel/session.php 2014-11-27 19:24:24 UTC (rev 12876) +++ XoopsCore/branches/2.5.x/2.5.7.1/htdocs/kernel/session.php 2014-11-27 20:15:53 UTC (rev 12877) @@ -9,7 +9,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @copyright (c) 2000-2014 XOOPS Project (www.xoops.org) * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package kernel * @since 2.0.0 @@ -26,7 +26,7 @@ * * @author Kazumi Ono <on...@xo...> * @author Taiwen Jiang <ph...@us...> - * @copyright copyright (c) The XOOPS project XOOPS.org + * @copyright (c) 2000-2014 XOOPS Project (www.xoops.org) */ class XoopsSessionHandler { @@ -255,6 +255,6 @@ $session_name = ($xoopsConfig['use_mysession'] && $xoopsConfig['session_name'] != '') ? $xoopsConfig['session_name'] : session_name(); $session_expire = !is_null($expire) ? intval($expire) : (($xoopsConfig['use_mysession'] && $xoopsConfig['session_name'] != '') ? $xoopsConfig['session_expire'] * 60 : ini_get("session.cookie_lifetime")); $session_id = empty($sess_id) ? session_id() : $sess_id; - setcookie($session_name, $session_id, $session_expire ? time() + $session_expire : 0, '/', XOOPS_COOKIE_DOMAIN, 0); + setcookie($session_name, $session_id, $session_expire ? time() + $session_expire : 0, '/', XOOPS_COOKIE_DOMAIN, false, true); } } Modified: XoopsCore/branches/2.5.x/2.5.7.1/htdocs/modules/pm/pmlite.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.7.1/htdocs/modules/pm/pmlite.php 2014-11-27 19:24:24 UTC (rev 12876) +++ XoopsCore/branches/2.5.x/2.5.7.1/htdocs/modules/pm/pmlite.php 2014-11-27 20:15:53 UTC (rev 12877) @@ -9,7 +9,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @copyright (c) 2000-2014 XOOPS Project (www.xoops.org) * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package pm * @since 2.3.0 @@ -19,27 +19,33 @@ */ if (!defined('XOOPS_MAINFILE_INCLUDED')) { - include_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'mainfile.php'; + include_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'mainfile.php'; } else { chdir(XOOPS_ROOT_PATH . '/modules/pm/'); xoops_loadLanguage('main', 'pm'); } -$reply = !empty($_GET['reply']) ? 1 : 0; -$send = !empty($_GET['send']) ? 1 : 0; -$send2 = !empty($_GET['send2']) ? 1 : 0; -$sendmod = !empty($_POST['sendmod']) ? 1 : 0; // send from other modules with post data -$to_userid = isset($_GET['to_userid']) ? intval($_GET['to_userid']) : 0; -$msg_id = isset($_GET['msg_id']) ? intval($_GET['msg_id']) : 0; +XoopsLoad::load('XoopsRequest'); -if (empty($_GET['refresh']) && isset($_POST['op']) && $_POST['op'] != "submit") { +$subject_icons = XoopsLists::getSubjectsList(); + +$op = XoopsRequest::getCmd('op', '', 'POST'); + +$reply = XoopsRequest::getBool('reply', 0, 'GET'); +$send = XoopsRequest::getBool('send', 0, 'GET'); +$send2 = XoopsRequest::getBool('send2', 0, 'GET'); +$sendmod = XoopsRequest::getBool('sendmod', 0, 'POST'); // send from other modules with post data +$to_userid = XoopsRequest::getInt('to_userid', 0, 'GET'); +$msg_id = XoopsRequest::getInt('msg_id', 0, 'GET'); + +if (empty($_GET['refresh']) && $op != "submit") { $jump = "pmlite.php?refresh=" . time(); if ($send == 1) { - $jump .= "&send={$send}"; - } else if ($send2 == 1) { - $jump .= "&send2={$send2}&to_userid={$to_userid}"; - } else if ($reply == 1) { - $jump .= "&reply={$reply}&msg_id={$msg_id}"; + $jump .= "&send={$send}"; + } elseif ($send2 == 1) { + $jump .= "&send2={$send2}&to_userid={$to_userid}"; + } elseif ($reply == 1) { + $jump .= "&reply={$reply}&msg_id={$msg_id}"; } else { } header('location: ' . $jump); @@ -53,28 +59,26 @@ xoops_header(); $myts =& MyTextSanitizer::getInstance(); -if (isset($_POST['op']) && $_POST['op'] == "submit") { +if ($op == "submit") { $member_handler =& xoops_gethandler('member'); - $count = $member_handler->getUserCount(new Criteria('uid', intval($_POST['to_userid']))); + $count = $member_handler->getUserCount(new Criteria('uid', XoopsRequest::getInt('to_userid', 0, 'POST'))); if ($count != 1) { echo "<br /><br /><div><h4>"._PM_USERNOEXIST."<br />"; echo _PM_PLZTRYAGAIN."</h4><br />"; echo "[ <a href='javascript:history.go(-1)'>"._PM_GOBACK."</a> ]</div>"; - } else if ($GLOBALS['xoopsSecurity']->check()) { + } elseif ($GLOBALS['xoopsSecurity']->check()) { $pm_handler =& xoops_getModuleHandler('message', 'pm'); $pm =& $pm_handler->create(); $pm->setVar("msg_time", time()); -//------------------ mamba -if (isset($_POST['icon'])) { - $pm->setVar("msg_image", $_POST['icon']); + $msg_image = XoopsRequest::getCmd('icon', null, 'POST'); + if (in_array($msg_image, $subject_icons)) { + $pm->setVar("msg_image", $msg_image); } - //else $pm->setVar("msg_image", 'icon1.gif'); -//----------------- mamba - $pm->setVar("subject", $_POST['subject']); - $pm->setVar("msg_text", $_POST['message']); - $pm->setVar("to_userid", $_POST['to_userid']); + $pm->setVar("subject", XoopsRequest::getString('subject', null, 'POST')); + $pm->setVar("msg_text", XoopsRequest::getString('message', null, 'POST')); + $pm->setVar("to_userid", XoopsRequest::getInt('to_userid', 0, 'POST')); $pm->setVar("from_userid", $GLOBALS['xoopsUser']->getVar("uid")); - if (isset($_REQUEST['savecopy']) && $_REQUEST['savecopy'] == 1) { + if (XoopsRequest::getBool('savecopy', 0)) { //PMs are by default not saved in outbox $pm->setVar('from_delete', 0); } @@ -91,14 +95,14 @@ echo "<br /><a href=\"javascript:window.close();\">"._PM_ORCLOSEWINDOW."</a>"; } -} else if ($reply == 1 || $send == 1 || $send2 == 1 || $sendmod == 1) { +} elseif ($reply == 1 || $send == 1 || $send2 == 1 || $sendmod == 1) { if ($reply == 1) { $pm_handler =& xoops_getModuleHandler('message', 'pm'); $pm =& $pm_handler->get($msg_id); if ($pm->getVar("to_userid") == $GLOBALS['xoopsUser']->getVar('uid')) { $pm_uname = XoopsUser::getUnameFromId($pm->getVar("from_userid")); $message = "[quote]\n"; - $message .= sprintf(_PM_USERWROTE , $pm_uname); + $message .= sprintf(_PM_USERWROTE, $pm_uname); $message .= "\n" . $pm->getVar("msg_text", "E") . "\n[/quote]"; } else { unset($pm); @@ -118,11 +122,11 @@ } $GLOBALS['xoopsTpl']->assign('to_username', $pm_uname); $pmform->addElement(new XoopsFormHidden('to_userid', $pm->getVar("from_userid"))); - } else if ($sendmod == 1) { - $GLOBALS['xoopsTpl']->assign('to_username', XoopsUser::getUnameFromId($_POST["to_userid"])); - $pmform->addElement(new XoopsFormHidden('to_userid', intval($_POST["to_userid"]))); - $subject = $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST['subject'])); - $message = $myts->htmlSpecialChars($myts->stripSlashesGPC($_POST['message'])); + } elseif ($sendmod == 1) { + $GLOBALS['xoopsTpl']->assign('to_username', XoopsUser::getUnameFromId(XoopsRequest::getInt("to_userid", 0, 'POST'))); + $pmform->addElement(new XoopsFormHidden('to_userid', XoopsRequest::getInt("to_userid", 0, 'POST'))); + $subject = $myts->htmlSpecialChars(XoopsRequest::getString('subject', '', 'POST')); + $message = $myts->htmlSpecialChars(XoopsRequest::getString('message', '', 'POST')); } else { if ($send2 == 1) { $GLOBALS['xoopsTpl']->assign('to_username', XoopsUser::getUnameFromId($to_userid, false)); @@ -136,19 +140,11 @@ } $pmform->addElement(new XoopsFormText('', 'subject', 30, 100, $subject), true); -//----------------------------- mamba - $msg_image=''; - $icons_radio = new XoopsFormRadio(_MESSAGEICON, 'msg_image', $msg_image); - $subject_icons = XoopsLists::getSubjectsList(); - // foreach ($subject_icons as $iconfile) { - // $icons_radio->addOption($iconfile, '<img src="' . XOOPS_URL . '/images/subject/' . $iconfile . '" alt="" />'); - // } - // $pmform->addElement($icons_radio, true); + $msg_image=''; + $icons_radio = new XoopsFormRadio(_MESSAGEICON, 'msg_image', $msg_image); + //$subject_icons = XoopsLists::getSubjectsList(); + $xoopsTpl->assign('radio_icons', $subject_icons); - $xoopsTpl->assign('radio_icons', $subject_icons); -//------------------------------- mamba - - $pmform->addElement(new XoopsFormDhtmlTextArea('', 'message', $message, 8, 37), true); $pmform->addElement(new XoopsFormRadioYN('', 'savecopy', 0)); Modified: XoopsCore/branches/2.5.x/2.5.7.1/htdocs/modules/pm/readpmsg.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.7.1/htdocs/modules/pm/readpmsg.php 2014-11-27 19:24:24 UTC (rev 12876) +++ XoopsCore/branches/2.5.x/2.5.7.1/htdocs/modules/pm/readpmsg.php 2014-11-27 20:15:53 UTC (rev 12877) @@ -9,7 +9,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @copyright (c) 2000-2014 XOOPS Project (www.xoops.org) * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package pm * @since 2.3.0 @@ -18,7 +18,7 @@ * @version $Id$ */ -include_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'mainfile.php'; +include_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'mainfile.php'; if (!is_object($GLOBALS['xoopsUser'])) { redirect_header(XOOPS_URL, 3, _NOPERM); @@ -36,12 +36,12 @@ if (is_object($pm) && ($pm->getVar('from_userid') != $GLOBALS['xoopsUser']->getVar('uid')) && ($pm->getVar('to_userid') != $GLOBALS['xoopsUser']->getVar('uid')) -){ +) { redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['xoopsModule']->getVar("dirname", "n") . '/index.php', 2, _NOPERM); exit(); } -if (is_object($pm) && !empty($_POST['action']) ) { +if (is_object($pm) && !empty($_POST['action'])) { if (!$GLOBALS['xoopsSecurity']->check()) { echo implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()); exit(); @@ -49,7 +49,7 @@ $res = false; if (!empty($_REQUEST['email_message'])) { $res = $pm_handler->sendEmail($pm, $GLOBALS['xoopsUser']); - } else if (!empty($_REQUEST['move_message']) + } elseif (!empty($_REQUEST['move_message']) && $_REQUEST['op'] != 'save' && !$GLOBALS['xoopsUser']->isAdmin() && $pm_handler->getSavecount() >= $GLOBALS['xoopsModuleConfig']['max_save'] @@ -58,10 +58,12 @@ } else { switch ($_REQUEST['op']) { case 'out': - if ($pm->getVar('from_userid') != $GLOBALS['xoopsUser']->getVar('uid')) break; + if ($pm->getVar('from_userid') != $GLOBALS['xoopsUser']->getVar('uid')) { + break; + } if (!empty($_REQUEST['delete_message'])) { $res = $pm_handler->setFromdelete($pm); - } else if (!empty($_REQUEST['move_message'])) { + } elseif (!empty($_REQUEST['move_message'])) { $res = $pm_handler->setFromsave($pm); } break; @@ -70,7 +72,7 @@ if (!empty($_REQUEST['delete_message'])) { $res1 = $pm_handler->setTodelete($pm); $res1 = ($res1) ? $pm_handler->setTosave($pm, 0) : false; - } else if (!empty($_REQUEST['move_message'])) { + } elseif (!empty($_REQUEST['move_message'])) { $res1 = $pm_handler->setTosave($pm, 0); } } @@ -78,7 +80,7 @@ if (!empty($_REQUEST['delete_message'])) { $res2 = $pm_handler->setFromDelete($pm); $res2 = ($res2) ? $pm_handler->setFromsave($pm, 0) : false; - } else if (!empty($_REQUEST['move_message'])) { + } elseif (!empty($_REQUEST['move_message'])) { $res2 = $pm_handler->setFromsave($pm, 0); } } @@ -92,14 +94,14 @@ } if (!empty($_REQUEST['delete_message'])) { $res = $pm_handler->setTodelete($pm); - } else if (!empty($_REQUEST['move_message'])) { + } elseif (!empty($_REQUEST['move_message'])) { $res = $pm_handler->setTosave($pm); } break; } } $res_message = isset($res_message) ? $res_message : (($res) ? _PM_ACTION_DONE : _PM_ACTION_ERROR); - redirect_header('viewpmsg.php?op=' . htmlspecialchars($_REQUEST['op'] ) , 2, $res_message); + redirect_header('viewpmsg.php?op=' . htmlspecialchars($_REQUEST['op']), 2, $res_message); } $start = !empty($_GET['start']) ? intval($_GET['start']) : 0; $total_messages = !empty($_GET['total_messages']) ? intval($_GET['total_messages']) : 0; @@ -111,10 +113,10 @@ $criteria = new CriteriaCompo(new Criteria('from_delete', 0)); $criteria->add(new Criteria('from_userid', $GLOBALS['xoopsUser']->getVar('uid'))); $criteria->add(new Criteria('from_save', 0)); - } else if ($_REQUEST['op'] == "save") { + } elseif ($_REQUEST['op'] == "save") { $crit_to = new CriteriaCompo(new Criteria('to_delete', 0)); $crit_to->add(new Criteria('to_save', 1)); - $crit_to->add(new Criteria('to_userid',$GLOBALS['xoopsUser']->getVar('uid'))); + $crit_to->add(new Criteria('to_userid', $GLOBALS['xoopsUser']->getVar('uid'))); $crit_from = new CriteriaCompo(new Criteria('from_delete', 0)); $crit_from->add(new Criteria('from_save', 1)); $crit_from->add(new Criteria('from_userid', $GLOBALS['xoopsUser']->getVar('uid'))); @@ -139,7 +141,7 @@ if (is_object($pm) && !empty($pm)) { if ($pm->getVar('from_userid') != $GLOBALS['xoopsUser']->getVar('uid')) { $reply_button = new XoopsFormButton('', 'send', _PM_REPLY); - $reply_button->setExtra("onclick='javascript:openWithSelfMain(\"" . XOOPS_URL . "/modules/pm/pmlite.php?reply=1&msg_id=".$pm->getVar("msg_id")."\", \"pmlite\", 565,500);'"); + $reply_button->setExtra("onclick='javascript:openWithSelfMain(\"" . XOOPS_URL . "/modules/pm/pmlite.php?reply=1&msg_id=".$pm->getVar("msg_id")."\", \"pmlite\", 565,500);'"); $pmform->addElement($reply_button); } $pmform->addElement(new XoopsFormButton('', 'delete_message', _PM_DELETE, 'submit')); @@ -168,6 +170,7 @@ $message = $pm->getValues(); $message['msg_time'] = formatTimestamp($pm->getVar("msg_time")); + $message['msg_image'] = htmlspecialchars($message['msg_image'], ENT_QUOTES); } $GLOBALS['xoopsTpl']->assign('message', $message); $GLOBALS['xoopsTpl']->assign('op', $_REQUEST['op']); Modified: XoopsCore/branches/2.5.x/2.5.7.1/htdocs/modules/pm/viewpmsg.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.7.1/htdocs/modules/pm/viewpmsg.php 2014-11-27 19:24:24 UTC (rev 12876) +++ XoopsCore/branches/2.5.x/2.5.7.1/htdocs/modules/pm/viewpmsg.php 2014-11-27 20:15:53 UTC (rev 12877) @@ -9,7 +9,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @copyright (c) 2000-2014 XOOPS Project (www.xoops.org) * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package pm * @since 2.3.0 @@ -18,7 +18,7 @@ * @version $Id$ */ -include_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'mainfile.php'; +include_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'mainfile.php'; if (!is_object($GLOBALS['xoopsUser'])) { redirect_header(XOOPS_URL, 3, _NOPERM); @@ -34,15 +34,15 @@ $start = empty($_REQUEST["start"]) ? 0 : intval($_REQUEST["start"]); $pm_handler =& xoops_getModuleHandler('message'); -if (isset($_POST['delete_messages']) && isset($_POST['msg_id'])) { +if (isset($_POST['delete_messages']) && (isset($_POST['msg_id']) || isset($_POST['msg_ids']))) { if (!$GLOBALS['xoopsSecurity']->check()) { $GLOBALS['xoopsTpl']->assign('errormsg', implode('<br />', $GLOBALS['xoopsSecurity']->getErrors())); - } else if (empty($_REQUEST['ok'])) { - xoops_confirm(array('ok' => 1, 'delete_messages' => 1, 'op' => $_REQUEST['op'], 'msg_id'=> json_encode(array_map("intval", $_POST['msg_id']))), $_SERVER['REQUEST_URI'], _PM_SURE_TO_DELETE); + } elseif (empty($_REQUEST['ok'])) { + xoops_confirm(array('ok' => 1, 'delete_messages' => 1, 'op' => $_REQUEST['op'], 'msg_ids'=> json_encode(array_map("intval", $_POST['msg_id']))), $_SERVER['REQUEST_URI'], _PM_SURE_TO_DELETE); include $GLOBALS['xoops']->path('footer.php'); exit(); } else { - $clean_msg_id = json_decode($_POST['msg_id'], true, 2); + $clean_msg_id = json_decode($_POST['msg_ids'], true, 2); if (!empty($clean_msg_id)) { $clean_msg_id = array_map("intval", $clean_msg_id); } @@ -52,7 +52,7 @@ $pm =& $pm_handler->get($msg[$i]); if ($pm->getVar('to_userid') == $GLOBALS['xoopsUser']->getVar('uid')) { $pm_handler->setTodelete($pm); - } else if ($pm->getVar('from_userid') == $GLOBALS['xoopsUser']->getVar('uid')) { + } elseif ($pm->getVar('from_userid') == $GLOBALS['xoopsUser']->getVar('uid')) { $pm_handler->setFromdelete($pm); } unset($pm); @@ -63,7 +63,7 @@ if (isset($_POST['move_messages']) && isset($_POST['msg_id'])) { if (!$GLOBALS['xoopsSecurity']->check()) { $GLOBALS['xoopsTpl']->assign('errormsg', implode('<br />', $GLOBALS['xoopsSecurity']->getErrors())); - } else{ + } else { $size = count($_POST['msg_id']); $msg = $_POST['msg_id']; if ($_POST['op'] == 'save') { @@ -71,7 +71,7 @@ $pm =& $pm_handler->get($msg[$i]); if ($pm->getVar('to_userid') == $GLOBALS['xoopsUser']->getVar('uid')) { $pm_handler->setTosave($pm, 0); - } else if ($pm->getVar('from_userid') == $GLOBALS['xoopsUser']->getVar('uid')) { + } elseif ($pm->getVar('from_userid') == $GLOBALS['xoopsUser']->getVar('uid')) { $pm_handler->setFromsave($pm, 0); } unset($pm); @@ -85,7 +85,7 @@ $pm =& $pm_handler->get($msg[$i]); if ($_POST['op']=='in') { $pm_handler->setTosave($pm); - } else if ($_POST['op'] == 'out') { + } elseif ($_POST['op'] == 'out') { $pm_handler->setFromsave($pm); } unset($pm); @@ -93,7 +93,7 @@ } if ($_POST['op'] == 'save') { $GLOBALS['xoopsTpl']->assign('msg', _PM_UNSAVED); - } else if (isset($total_save) && !$GLOBALS['xoopsUser']->isAdmin()) { + } elseif (isset($total_save) && !$GLOBALS['xoopsUser']->isAdmin()) { $GLOBALS['xoopsTpl']->assign('msg', sprintf(_PM_SAVED_PART, $GLOBALS['xoopsModuleConfig']['max_save'], $i)); } else { $GLOBALS['xoopsTpl']->assign('msg', _PM_SAVED_ALL); @@ -103,25 +103,25 @@ if (isset($_REQUEST['empty_messages'])) { if (!$GLOBALS['xoopsSecurity']->check()) { $GLOBALS['xoopsTpl']->assign('errormsg', implode('<br />', $GLOBALS['xoopsSecurity']->getErrors())); - } else if (empty($_REQUEST['ok'])) { + } elseif (empty($_REQUEST['ok'])) { xoops_confirm(array('ok' => 1, 'empty_messages' => 1, 'op' => $_REQUEST['op']), $_SERVER['REQUEST_URI'], _PM_RUSUREEMPTY); include $GLOBALS['xoops']->path('footer.php'); exit(); } else { if ($_POST['op'] == 'save') { $crit_to = new CriteriaCompo(new Criteria('to_delete', 0)); - $crit_to->add(new Criteria('to_save',1)); - $crit_to->add(new Criteria('to_userid',$GLOBALS['xoopsUser']->getVar('uid'))); + $crit_to->add(new Criteria('to_save', 1)); + $crit_to->add(new Criteria('to_userid', $GLOBALS['xoopsUser']->getVar('uid'))); $crit_from = new CriteriaCompo(new Criteria('from_delete', 0)); $crit_from->add(new Criteria('from_save', 1)); - $crit_from->add(new Criteria('from_userid',$GLOBALS['xoopsUser']->getVar('uid'))); + $crit_from->add(new Criteria('from_userid', $GLOBALS['xoopsUser']->getVar('uid'))); $criteria = new CriteriaCompo($crit_to); $criteria->add($crit_from, "OR"); - } else if ($_POST['op'] == 'out') { + } elseif ($_POST['op'] == 'out') { $criteria = new CriteriaCompo(new Criteria('from_delete', 0)); $criteria->add(new Criteria('from_userid', $GLOBALS['xoopsUser']->getVar('uid'))); $criteria->add(new Criteria('from_save', 0)); - } else{ + } else { $criteria = new CriteriaCompo(new Criteria('to_delete', 0)); $criteria->add(new Criteria('to_userid', $GLOBALS['xoopsUser']->getVar('uid'))); $criteria->add(new Criteria('to_save', 0)); @@ -137,14 +137,14 @@ if ($pms[$i]->getVar('to_userid') == $GLOBALS['xoopsUser']->getVar('uid')) { if ($_POST['op'] == 'save') { $pm_handler->setTosave($pms[$i], 0); - } else if ($_POST['op'] == 'in') { + } elseif ($_POST['op'] == 'in') { $pm_handler->setTodelete($pms[$i]); } } if ($pms[$i]->getVar('from_userid') == $GLOBALS['xoopsUser']->getVar('uid')) { if ($_POST['op']=='save') { - $pm_handler->setFromsave($pms[$i],0); - } else if ($_POST['op']=='out') { + $pm_handler->setFromsave($pms[$i], 0); + } elseif ($_POST['op']=='out') { $pm_handler->setFromdelete($pms[$i]); } } @@ -158,7 +158,7 @@ $criteria = new CriteriaCompo(new Criteria('from_delete', 0)); $criteria->add(new Criteria('from_userid', $GLOBALS['xoopsUser']->getVar('uid'))); $criteria->add(new Criteria('from_save', 0)); -} else if ($_REQUEST['op'] == "save") { +} elseif ($_REQUEST['op'] == "save") { $crit_to = new CriteriaCompo(new Criteria('to_delete', 0)); $crit_to->add(new Criteria('to_save', 1)); $crit_to->add(new Criteria('to_userid', $GLOBALS['xoopsUser']->getVar('uid'))); @@ -200,9 +200,10 @@ } } $member_handler =& xoops_gethandler('member'); - $senders = $member_handler->getUserList(new Criteria('uid', "(" . implode(", ", array_unique($uids) ) . ")", "IN")); + $senders = $member_handler->getUserList(new Criteria('uid', "(" . implode(", ", array_unique($uids)) . ")", "IN")); foreach (array_keys($pm_arr) as $i) { $message = $pm_arr[$i]; + $message['msg_image'] = htmlspecialchars($message['msg_image'], ENT_QUOTES); $message['msg_time'] = formatTimestamp($message["msg_time"]); if (isset($_REQUEST['op']) && $_REQUEST['op'] == "out") { $message['postername'] = $senders[$pm_arr[$i]['to_userid']]; Modified: XoopsCore/branches/2.5.x/2.5.7.1/htdocs/modules/system/admin/modulesadmin/main.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.7.1/htdocs/modules/system/admin/modulesadmin/main.php 2014-11-27 19:24:24 UTC (rev 12876) +++ XoopsCore/branches/2.5.x/2.5.7.1/htdocs/modules/system/admin/modulesadmin/main.php 2014-11-27 20:15:53 UTC (rev 12877) @@ -2,7 +2,7 @@ // $Id$ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // -// Copyright (c) 2000 XOOPS.org // +// Copyright (c) 2000-2014 XOOPS Project (www.xoops.org) // // <http://www.xoops.org/> // // ------------------------------------------------------------------------ // // This program is free software; you can redistribute it and/or modify // @@ -36,6 +36,7 @@ include_once XOOPS_ROOT_PATH . '/class/xoopsblock.php'; include_once XOOPS_ROOT_PATH . '/modules/system/admin/modulesadmin/modulesadmin.php'; +XoopsLoad::load('XoopsFilterInput'); if (isset($_POST)) { foreach ($_POST as $k => $v) { @@ -88,6 +89,7 @@ $install_mods = array(); foreach ($installed_mods as $module) { $listed_mods[$i] = $module->toArray(); + $listed_mods[$i]['name'] = htmlspecialchars($module->getVar('name'), ENT_QUOTES); $listed_mods[$i]['image'] = $module->getInfo('image'); $listed_mods[$i]['adminindex'] = $module->getInfo('adminindex'); $listed_mods[$i]['version'] = round($module->getVar('version') / 100, 2); @@ -104,7 +106,7 @@ } $install_mods[] = $module->getInfo('dirname'); unset($module); - $i++; + ++$i; } // Get module to install $dirlist = XoopsLists::getModulesList(); @@ -115,7 +117,7 @@ clearstatcache(); $file = trim($file); if (!in_array($file, $install_mods)) { - $i++; + ++$i; } } } @@ -166,7 +168,7 @@ if (!in_array($file, $install_mods)) { $module =& $module_handler->create(); $module->loadInfo($file); - $toinstall_mods[$i]['name'] = $module->getInfo('name'); + $toinstall_mods[$i]['name'] = htmlspecialchars($module->getInfo('name'), ENT_QUOTES); $toinstall_mods[$i]['dirname'] = $module->getInfo('dirname'); $toinstall_mods[$i]['image'] = $module->getInfo('image'); $toinstall_mods[$i]['version'] = round($module->getInfo('version'), 2); @@ -177,7 +179,7 @@ $toinstall_mods[$i]['description'] = $module->getInfo('description'); $toinstall_mods[$i]['mid'] = $i; // Use only for display popup unset($module); - $i++; + ++$i; } } } @@ -202,7 +204,7 @@ if (!$module_handler->insert($module)) { $error = true; } - $i++; + ++$i; } } } @@ -242,11 +244,12 @@ $module = empty($_POST['module']) ? array() : $_POST['module']; foreach ($module as $mid) { $mid = (int) $mid; + $newname[$mid] = trim(XoopsFilterInput::clean($newname[$mid], 'STRING')); $modifs_mods[$i]['mid'] = $mid; $modifs_mods[$i]['oldname'] = $myts->htmlspecialchars($myts->stripSlashesGPC($oldname[$mid])); $modifs_mods[$i]['newname'] = $myts->htmlspecialchars(trim($myts->stripslashesGPC($newname[$mid]))); $modifs_mods[$i]['newstatus'] = (isset($newstatus[$mid])) ? $myts->htmlspecialchars($newstatus[$mid]) : 0; - $i++; + ++$i; } $xoopsTpl->assign('modifs_mods', $modifs_mods); $xoopsTpl->assign('input_security', $GLOBALS['xoopsSecurity']->getTokenHTML()); @@ -268,7 +271,7 @@ } $blocks = XoopsBlock::getByModule($module_id); $bcount = count($blocks); - for ($i = 0; $i < $bcount; $i++) { + for ($i = 0; $i < $bcount; ++$i) { $blocks[$i]->setVar('isactive', !$old); $blocks[$i]->store(); } @@ -306,7 +309,7 @@ $ret[] = xoops_module_deactivate($mid); } } - $newname[$mid] = trim($newname[$mid]); + $newname[$mid] = trim(XoopsFilterInput::clean($newname[$mid], 'STRING')); if ($oldname[$mid] != $newname[$mid]) { $ret[] = xoops_module_change($mid, $newname[$mid]); $write = true; @@ -551,7 +554,7 @@ if (is_array($deltpl)) { // delete template file entry in db $dcount = count($deltpl); - for ($i = 0; $i < $dcount; $i++) { + for ($i = 0; $i < $dcount; ++$i) { if (!$tplfile_handler->delete($deltpl[$i])) { $delng[] = $deltpl[$i]->getVar('tpl_file'); } @@ -582,7 +585,7 @@ $tplfile = empty($tplfiles) ? $tplfile_handler->create() : $tplfiles[0]; // END irmtfan solve templates duplicate issue $tplfile->setVar('tpl_refid', $newmid); - $tplfile->setVar('tpl_lastimported', 0); +// $tplfile->setVar('tpl_lastimported', 0); $tplfile->setVar('tpl_lastmodified', time()); $tplfile->setVar('tpl_type', $type); $tplfile->setVar('tpl_source', $tpldata, true); @@ -659,7 +662,7 @@ $fresult = $xoopsDB->query($sql); $fcount = 0; while ($fblock = $xoopsDB->fetchArray($fresult)) { - $fcount++; + ++$fcount; $sql = "UPDATE " . $xoopsDB->prefix("newblocks") . " SET name='" . addslashes($block['name']) @@ -686,7 +689,7 @@ $tplfile_new->setVar('tpl_source', $content, true); $tplfile_new->setVar('tpl_desc', $block['description'], true); $tplfile_new->setVar('tpl_lastmodified', time()); - $tplfile_new->setVar('tpl_lastimported', 0); +// $tplfile_new->setVar('tpl_lastimported', 0); $tplfile_new->setVar( 'tpl_file', $block['template'], @@ -848,7 +851,7 @@ $tplfiles = $tplfile_handler->find(null, 'block', $block->getVar('bid')); if (is_array($tplfiles)) { $btcount = count($tplfiles); - for ($k = 0; $k < $btcount; $k++) { + for ($k = 0; $k < $btcount; ++$k) { if (!$tplfile_handler->delete($tplfiles[$k])) { $msgs[] = ' <span style="color:#ff0000;">' . _AM_SYSTEM_MODULES_BLOCK_DEPRECATED_ERROR . '(ID: <strong>' @@ -877,7 +880,7 @@ $config_delng = array(); if ($confcount > 0) { $msgs[] = _AM_SYSTEM_MODULES_MODULE_DATA_DELETE; - for ($i = 0; $i < $confcount; $i++) { + for ($i = 0; $i < $confcount; ++$i) { if (!$config_handler->deleteConfig($configs[$i])) { $msgs[] = ' <span style="color:#ff0000;">' . _AM_SYSTEM_MODULES_GONFIG_DATA_DELETE_ERROR @@ -1065,7 +1068,7 @@ unset($confop); } } - $order++; + ++$order; if (false != $config_handler->insertConfig($confobj)) { //$msgs[] = ' Config <strong>'.$config['name'].'</strong> added to the database.'.$confop_msgs; $msgs[] = " " . sprintf( Modified: XoopsCore/branches/2.5.x/2.5.7.1/htdocs/modules/system/themes/default/default.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.7.1/htdocs/modules/system/themes/default/default.php 2014-11-27 19:24:24 UTC (rev 12876) +++ XoopsCore/branches/2.5.x/2.5.7.1/htdocs/modules/system/themes/default/default.php 2014-11-27 20:15:53 UTC (rev 12877) @@ -14,7 +14,7 @@ /* * Xoops Cpanel default GUI class * - * @copyright The XOOPS project http://sf.net/projects/xoops/ + * @copyright (c) 2000-2014 XOOPS Project (www.xoops.org) * @license http://www.fsf.org/copyleft/gpl.html GNU public license * @package system * @usbpackage GUI @@ -113,7 +113,7 @@ $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php', 'text' => _CPHOME, 'menu' => $menu)); //add SYSTEM Menu items - include dirname(__FILE__) . '/menu.php'; + include __DIR__ . '/menu.php'; if (empty($xoopsModule) || 'system' == $xoopsModule->getVar('dirname', 'n')) { $modpath = XOOPS_URL . '/admin.php'; $modname = _OXYGEN_SYSOPTIONS; @@ -166,7 +166,7 @@ } else { $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar('mid'); } - $rtn['title'] = $mod->name(); + $rtn['title'] = htmlspecialchars($mod->name(), ENT_QUOTES); $rtn['absolute'] = 1; $rtn['url'] = XOOPS_URL . '/modules/'. $mod->getVar('dirname', 'n') . '/'; //add for sub menus $modOptions = $mod->getAdminMenu(); //add for sub menus @@ -239,7 +239,7 @@ $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups()); if ($sadmin && ($mod->getVar('hasnotification') || is_array($mod->getInfo('config')) || is_array($mod->getInfo('comments')))) { $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar('mid'); - $rtn['title'] = $mod->name(); + $rtn['title'] = htmlspecialchars($mod->name(), ENT_QUOTES); $rtn['absolute'] = 1; $rtn['icon'] = XOOPS_ADMINTHEME_URL . '/gui/oxygen/icons/prefs_small.png'; $menu[] = $rtn; @@ -298,7 +298,7 @@ } else { $rtn ['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar ( 'mid' ); } - $rtn ['title'] = $mod->getVar ('name'); + $rtn ['title'] = htmlspecialchars($mod->getVar ('name'), ENT_QUOTES); $rtn ['description'] = $mod->getInfo('description'); $rtn ['absolute'] = 1; if (isset ( $info ['icon_big'] )) { Modified: XoopsCore/branches/2.5.x/2.5.7.1/htdocs/pmlite.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.7.1/htdocs/pmlite.php 2014-11-27 19:24:24 UTC (rev 12876) +++ XoopsCore/branches/2.5.x/2.5.7.1/htdocs/pmlite.php 2014-11-27 20:15:53 UTC (rev 12877) @@ -9,39 +9,39 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @copyright (c) 2000-2014 XOOPS Project (www.xoops.org) * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package core * @since 2.0.0 * @version $Id$ */ -include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; +include __DIR__ . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoopsPreload =& XoopsPreload::getInstance(); $xoopsPreload->triggerEvent('core.pmlite.start'); xoops_loadLanguage('pmsg'); +XoopsLoad::load('XoopsRequest'); - -//------------------------------ mamba include $GLOBALS['xoops']->path('class/xoopsformloader.php'); $icon=''; $icons_radio = new XoopsFormRadio(_MESSAGEICON, 'icon', $icon); $subject_icons = XoopsLists::getSubjectsList(); -//------------------------------- mamba -$reply = !empty($_GET['reply']) ? 1 : 0; -$send = !empty($_GET['send']) ? 1 : 0; -$send2 = !empty($_GET['send2']) ? 1 : 0; -$to_userid = !empty($_GET['to_userid']) ? intval($_GET['to_userid']) : 0; -$msg_id = !empty($_GET['msg_id']) ? intval($_GET['msg_id']) : 0; -if (empty($_GET['refresh']) && isset($_POST['op']) && $_POST['op'] != "submit") { +$op = XoopsRequest::getCmd('op', '', 'POST'); + +$reply = XoopsRequest::getBool('reply', 0, 'GET'); +$send = XoopsRequest::getBool('send', 0, 'GET'); +$send2 = XoopsRequest::getBool('send2', 0, 'GET'); +$to_userid = XoopsRequest::getInt('to_userid', 0, 'GET'); +$msg_id = XoopsRequest::getInt('msg_id', 0, 'GET'); +if (empty($_GET['refresh']) && $op != "submit") { $jump = "pmlite.php?refresh=" . time() . ""; if ($send == 1) { $jump .= "&send=" . $send . ""; - } else if ($send2 == 1) { + } elseif ($send2 == 1) { $jump .= "&send2=" . $send2 . "&to_userid=" . $to_userid . ""; - } else if ($reply == 1) { + } elseif ($reply == 1) { $jump .= "&reply=" . $reply . "&msg_id=" . $msg_id . ""; } else { } @@ -50,32 +50,37 @@ } xoops_header(); + +$method = XoopsRequest::getMethod(); +$safeMethods = array('GET', 'HEAD'); +if (!in_array($method, $safeMethods)) { + if (!$GLOBALS['xoopsSecurity']->check()) { + echo "<br /><br /><div><h4>" . _ERRORS . "</h4><br />"; + echo "[ <a href='javascript:history.go(-1)' title=''>" . _PM_GOBACK . "</a> ]</div>"; + xoops_footer(); + exit; + } +} + if (is_object($xoopsUser)) { $myts =& MyTextSanitizer::getInstance(); - if (isset($_POST['op']) && $_POST['op'] == "submit") { - if (!$GLOBALS['xoopsSecurity']->check()) { - $security_error = true; - } - $res = $xoopsDB->query("SELECT COUNT(*) FROM " . $xoopsDB->prefix("users") . " WHERE uid=" . intval($_POST['to_userid']) . ""); + if ($op == 'submit') { + $res = $xoopsDB->query("SELECT COUNT(*) FROM " . $xoopsDB->prefix("users") . " WHERE uid=" . XoopsRequest::getInt('to_userid', 0, 'POST') . ""); list ($count) = $xoopsDB->fetchRow($res); if ($count != 1) { echo "<br /><br /><div><h4>" . _PM_USERNOEXIST . "<br />"; echo _PM_PLZTRYAGAIN . "</h4><br />"; - if (isset($security_error) && $security_error == true) { - echo implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()); - } echo "[ <a href='javascript:history.go(-1)' title=''>" . _PM_GOBACK . "</a> ]</div>"; } else { $pm_handler =& xoops_gethandler('privmessage'); $pm =& $pm_handler->create(); -//------------------ mamba -if (isset($_POST['icon'])) { - $pm->setVar("msg_image", $_POST['icon']); + $msg_image = XoopsRequest::getCmd('icon', null, 'POST'); + if (in_array($msg_image, $subject_icons)) { + $pm->setVar("msg_image", $msg_image); } -//----------------- mamba - $pm->setVar("subject", $_POST['subject']); - $pm->setVar("msg_text", $_POST['message']); - $pm->setVar("to_userid", $_POST['to_userid']); + $pm->setVar("subject", XoopsRequest::getString('subject', null, 'POST')); + $pm->setVar("msg_text", XoopsRequest::getString('message', null, 'POST')); + $pm->setVar("to_userid", XoopsRequest::getInt('to_userid', 0, 'POST')); $pm->setVar("from_userid", $xoopsUser->getVar("uid")); if (!$pm_handler->insert($pm)) { echo $pm->getHtmlErrors(); @@ -84,7 +89,7 @@ echo "<br /><br /><div style='text-align:center;'><h4>" . _PM_MESSAGEPOSTED . "</h4><br /><a href=\"javascript:window.opener.location='" . XOOPS_URL . "/viewpmsg.php';window.close();\" title=\"\">" . _PM_CLICKHERE . "</a><br /><br /><a href=\"javascript:window.close();\" title=\"\">" . _PM_ORCLOSEWINDOW . "</a></div>"; } } - } else if ($reply == 1 || $send == 1 || $send2 == 1) { + } elseif ($reply == 1 || $send == 1 || $send2 == 1) { include_once $GLOBALS['xoops']->path('include/xoopscodes.php'); if ($reply == 1) { $pm_handler =& xoops_gethandler('privmessage'); @@ -103,14 +108,14 @@ echo "<table style=' text-align:left;' class='outer'><tr><td class='head txtright' style='width:25%'>" . _PM_TO . "</td>"; if ($reply == 1) { echo "<td class='even'><input type='hidden' name='to_userid' value='" . $pm->getVar("from_userid") . "' />" . $pm_uname . "</td>"; - } else if ($send2 == 1) { + } elseif ($send2 == 1) { $to_username = XoopsUser::getUnameFromId($to_userid); echo "<td class='even'><input type='hidden' name='to_userid' value='" . $to_userid . "' />" . $to_username . "</td>"; } else { - require_once $GLOBALS['xoops']->path('class/xoopsform/formelement.php'); - require_once $GLOBALS['xoops']->path('class/xoopsform/formselect.php'); - require_once $GLOBALS['xoops']->path('class/xoopsform/formlabel.php'); - require_once $GLOBALS['xoops']->path('class/xoopsform/formselectuser.php'); + //require_once $GLOBALS['xoops']->path('class/xoopsform/formelement.php'); + //require_once $GLOBALS['xoops']->path('class/xoopsform/formselect.php'); + //require_once $GLOBALS['xoops']->path('class/xoopsform/formlabel.php'); + //require_once $GLOBALS['xoops']->path('class/xoopsform/formselectuser.php'); $user_sel = new XoopsFormSelectUser("", "to_userid"); echo "<td class='even'>" . $user_sel->render(); echo "</td>"; @@ -129,16 +134,14 @@ } echo "</tr>"; -//----------------------------- mamba - echo "<tr>"; - echo "<td class='head txtright' style='width:25%;'>" . _MESSAGEICON. "</td>"; - foreach ($subject_icons as $iconfile) { - $icons_radio->addOption($iconfile, '<img src="' . XOOPS_URL . '/images/subject/' . $iconfile . '" alt="" />'); + echo "<tr>"; + echo "<td class='head txtright' style='width:25%;'>" . _MESSAGEICON. "</td>"; + foreach ($subject_icons as $iconfile) { + $icons_radio->addOption($iconfile, '<img src="' . XOOPS_URL . '/images/subject/' . $iconfile . '" alt="" />'); } - echo "<td class='even'>" . $icons_radio->render(); - echo "</td>"; - echo "</tr>"; -//------------------------------- mamba + echo "<td class='even'>" . $icons_radio->render(); + echo "</td>"; + echo "</tr>"; echo "<tr style='vertical-align:top;'><td style='width:25%;' class='head txtright'>" . _PM_MESSAGEC . "</td>"; echo "<td class='even'>"; Modified: XoopsCore/branches/2.5.x/2.5.7.1/htdocs/readpmsg.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.7.1/htdocs/readpmsg.php 2014-11-27 19:24:24 UTC (rev 12876) +++ XoopsCore/branches/2.5.x/2.5.7.1/htdocs/readpmsg.php 2014-11-27 20:15:53 UTC (rev 12877) @@ -9,14 +9,14 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @copyright (c) 2000-2014 XOOPS Project (www.xoops.org) * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package core * @since 2.0.0 * @version $Id$ */ -include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; +include __DIR__ . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoopsPreload =& XoopsPreload::getInstance(); $xoopsPreload->triggerEvent('core.readpmsg.start'); @@ -80,14 +80,12 @@ } else { echo $xoopsConfig['anonymous']; // we need to do this for deleted users } -//------------- mamba - $iconName=$pm_arr[0]->getVar("msg_image", "E"); + $iconName=htmlspecialchars($pm_arr[0]->getVar("msg_image", "E"), ENT_QUOTES); if ($iconName != '') { - echo "</td><td><img src='images/subject/" .$iconName . "' alt='' /> " . _PM_SENTC . "" . formatTimestamp($pm_arr[0]->getVar("msg_time")); + echo "</td><td><img src='images/subject/" .$iconName . "' alt='' /> " . _PM_SENTC . "" . formatTimestamp($pm_arr[0]->getVar("msg_time")); } else { - echo "</td><td>" . _PM_SENTC . "" . formatTimestamp($pm_arr[0]->getVar("msg_time")); + echo "</td><td>" . _PM_SENTC . "" . formatTimestamp($pm_arr[0]->getVar("msg_time")); } -//------------- mamba echo "<hr /><br /><strong>" . $pm_arr[0]->getVar("subject") . "</strong><br /><br />\n"; echo $pm_arr[0]->getVar("msg_text") . "<br /><br /></td></tr><tr class='foot'><td class='width20 txtleft' colspan='2'>"; Modified: XoopsCore/branches/2.5.x/2.5.7.1/htdocs/viewpmsg.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.7.1/htdocs/viewpmsg.php 2014-11-27 19:24:24 UTC (rev 12876) +++ XoopsCore/branches/2.5.x/2.5.7.1/htdocs/viewpmsg.php 2014-11-27 20:15:53 UTC (rev 12877) @@ -9,14 +9,14 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @copyright (c) 2000-2014 XOOPS Project (www.xoops.org) * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package core * @since 2.0.0 * @version $Id$ */ -include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; +include __DIR__ . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoopsPreload =& XoopsPreload::getInstance(); $xoopsPreload->triggerEvent('core.viewpmsg.start'); @@ -27,23 +27,23 @@ redirect_header("user.php", 2, $errormessage); } else { $pm_handler =& xoops_gethandler('privmessage'); - if (isset($_POST['delete_messages']) && isset($_POST['msg_id'])) { + if (isset($_POST['delete_messages']) && (isset($_POST['msg_id']) || isset($_POST['msg_ids']))) { if (!$GLOBALS['xoopsSecurity']->check()) { echo implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()); exit(); } elseif (empty($_REQUEST['ok'])) { include $GLOBALS['xoops']->path('header.php'); - xoops_confirm(array('ok' => 1, 'delete_messages' => 1, 'msg_id'=> json_encode(array_map("intval", $_POST['msg_id']))), $_SERVER['REQUEST_URI'], _PM_SURE_TO_DELETE); + xoops_confirm(array('ok' => 1, 'delete_messages' => 1, 'msg_ids'=> json_encode(array_map("intval", $_POST['msg_id']))), $_SERVER['REQUEST_URI'], _PM_SURE_TO_DELETE); include $GLOBALS['xoops']->path('footer.php'); exit(); } - $clean_msg_id = json_decode($_POST['msg_id'], true, 2); + $clean_msg_id = json_decode($_POST['msg_ids'], true, 2); if (!empty($clean_msg_id)) { $clean_msg_id = array_map("intval", $clean_msg_id); } $size = count($clean_msg_id); $msg =& $clean_msg_id; - for ($i = 0; $i < $size; $i++) { + for ($i = 0; $i < $size; ++$i) { $pm =& $pm_handler->get(intval($msg[$i])); if ($pm->getVar('to_userid') == $xoopsUser->getVar('uid')) { $pm_handler->delete($pm); @@ -68,7 +68,7 @@ } else { $display = 1; } - for ($i = 0; $i < $total_messages; $i++) { + for ($i = 0; $i < $total_messages; ++$i) { $class = ($i % 2 == 0) ? 'even' : 'odd'; echo "<tr class='$class txtleft'><td class='aligntop width2 txtcenter'><input type='checkbox' id='msg_id[]' name='msg_id[]' value='" . $pm_arr[$i]->getVar("msg_id") . "' /></td>\n"; ... [truncated message content] |
From: <be...@us...> - 2014-11-27 19:24:28
|
Revision: 12876 http://sourceforge.net/p/xoops/svn/12876 Author: beckmi Date: 2014-11-27 19:24:24 +0000 (Thu, 27 Nov 2014) Log Message: ----------- Creating base for 2.5.7.1 Added Paths: ----------- XoopsCore/branches/2.5.x/2.5.7.1/ |
From: <luc...@us...> - 2014-11-26 21:42:23
|
Revision: 12875 http://sourceforge.net/p/xoops/svn/12875 Author: luciorota Date: 2014-11-26 21:42:17 +0000 (Wed, 26 Nov 2014) Log Message: ----------- - update to latest mamba work - fixed: use DateTime object instead of strtotime function (luciorota) Modified Paths: -------------- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/about.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_header.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/categories.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/clone.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/images.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/import.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/index.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/indexpage.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/menu.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/mimetypes.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/mirrors.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/permissions.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/ratings.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reportsmodifications.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/reviews.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/swishe.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/blocks/top.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/blocks/top_by_cat.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/brokenfile.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/breadcrumb.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/category.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/dbupdater.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/download.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/ip_log.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/mimetype.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/mirror.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/modification.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/multicolumnsthemeform.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/rating.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/report.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/review.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/session.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/tree.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/wfdownloads.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/wfdownloads_lists.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/class/xoopstree.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/comment_new.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/docs/changelog.txt XoopsModules/wfdownloads/branches/luciorota/wfdownloads/docs/credits.txt XoopsModules/wfdownloads/branches/luciorota/wfdownloads/docs/install.txt XoopsModules/wfdownloads/branches/luciorota/wfdownloads/docs/lang_diff.txt XoopsModules/wfdownloads/branches/luciorota/wfdownloads/docs/readme.txt XoopsModules/wfdownloads/branches/luciorota/wfdownloads/header.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/comment_functions.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/common.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/directorychecker.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/filechecker.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/functions.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/notification.inc.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/oninstall.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onuninstall.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/onupdate.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/include/search.inc.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/index.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/admin.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/category_filemodified_notify.tpl XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/category_filesubmit_notify.tpl XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/category_newfile_notify.tpl XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/file_approve_notify.tpl XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/file_filemodified_notify.tpl XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/filebroken_notify.tpl XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/global_filebroken_notify.tpl XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/global_filemodified_notify.tpl XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/global_filemodify_notify.tpl XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/global_filesubmit_notify.tpl XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/global_newcategory_notify.tpl XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/global_newfile_notify.tpl XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/mail_template/index.html XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/main.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/english/modinfo.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/language/index.html XoopsModules/wfdownloads/branches/luciorota/wfdownloads/mirror.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/newlist.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/ratefile.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/review.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/rss.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/singlefile.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/submit.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/admin/wfdownloads_am_categorieslist.tpl XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_co_letterschoice.tpl XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_singlefile.tpl XoopsModules/wfdownloads/branches/luciorota/wfdownloads/templates/wfdownloads_viewcat.tpl XoopsModules/wfdownloads/branches/luciorota/wfdownloads/topten.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/viewcat.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/visit.php XoopsModules/wfdownloads/branches/luciorota/wfdownloads/xoops_version.php Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/about.php =================================================================== --- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/about.php 2014-11-26 21:38:33 UTC (rev 12874) +++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/about.php 2014-11-26 21:42:17 UTC (rev 12875) @@ -18,7 +18,7 @@ * @author Xoops Development Team * @version svn:$id$ */ -include_once dirname(__FILE__) . '/admin_header.php'; +include_once __DIR__ . '/admin_header.php'; xoops_cp_header(); @@ -27,4 +27,4 @@ echo $aboutAdmin->addNavigation('about.php'); echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false); -include_once dirname(__FILE__) . '/admin_footer.php'; +include_once __DIR__ . '/admin_footer.php'; Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_header.php =================================================================== --- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_header.php 2014-11-26 21:38:33 UTC (rev 12874) +++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/admin_header.php 2014-11-26 21:42:17 UTC (rev 12875) @@ -18,8 +18,8 @@ * @author Xoops Development Team * @version svn:$id$ */ -include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php'; -include_once dirname(dirname(__FILE__)) . '/include/common.php'; +include_once dirname(dirname(dirname(__DIR__))) . '/mainfile.php'; +include_once dirname(__DIR__) . '/include/common.php'; // Include xoops admin header include_once XOOPS_ROOT_PATH . '/include/cp_header.php'; Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/categories.php =================================================================== --- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/categories.php 2014-11-26 21:38:33 UTC (rev 12874) +++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/categories.php 2014-11-26 21:42:17 UTC (rev 12875) @@ -19,7 +19,7 @@ * @version svn:$id$ */ $currentFile = basename(__FILE__); -include_once dirname(__FILE__) . '/admin_header.php'; +include_once __DIR__ . '/admin_header.php'; // Check directories if (!is_dir($wfdownloads->getConfig('uploaddir'))) { @@ -39,38 +39,38 @@ exit(); } -$op = WfdownloadsRequest::getString('op', 'categories.list'); +$op = XoopsRequest::getString('op', 'categories.list'); switch ($op) { case 'category.move': case 'move': - $ok = WfdownloadsRequest::getBool('ok', false, 'POST'); + $ok = XoopsRequest::getBool('ok', false, 'POST'); if ($ok == false) { - $cid = WfdownloadsRequest::getInt('cid', 0); + $cid = XoopsRequest::getInt('cid', 0); wfdownloads_xoops_cp_header(); include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; $sform = new XoopsThemeForm(_AM_WFDOWNLOADS_CCATEGORY_MOVE, 'move', xoops_getenv('PHP_SELF')); - $categoryObjs = $wfdownloads->getHandler('category')->getObjects(); + $categoryObjs = $wfdownloads->getHandler('category')->getObjects(); $categoryObjsTree = new XoopsObjectTree($categoryObjs, 'cid', 'pid'); $sform->addElement(new XoopsFormLabel(_AM_WFDOWNLOADS_BMODIFY, $categoryObjsTree->makeSelBox('target', 'title'))); - $create_tray = new XoopsFormElementTray('', ''); - $create_tray->addElement(new XoopsFormHidden('source', $cid)); - $create_tray->addElement(new XoopsFormHidden('ok', true)); - $create_tray->addElement(new XoopsFormHidden('op', 'category.move')); - $butt_save = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BMOVE, 'submit'); - $butt_save->setExtra('onclick="this.form.elements.op.value=\'category.move\'"'); - $create_tray->addElement($butt_save); - $butt_cancel = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BCANCEL, 'submit'); - $butt_cancel->setExtra('onclick="this.form.elements.op.value=\'cancel\'"'); - $create_tray -> addElement($butt_cancel); + $create_tray = new XoopsFormElementTray('', ''); + $create_tray->addElement(new XoopsFormHidden('source', $cid)); + $create_tray->addElement(new XoopsFormHidden('ok', true)); + $create_tray->addElement(new XoopsFormHidden('op', 'category.move')); + $butt_save = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BMOVE, 'submit'); + $butt_save->setExtra('onclick="this.form.elements.op.value=\'category.move\'"'); + $create_tray->addElement($butt_save); + $butt_cancel = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BCANCEL, 'submit'); + $butt_cancel->setExtra('onclick="this.form.elements.op.value=\'cancel\'"'); + $create_tray->addElement($butt_cancel); $sform->addElement($create_tray); $sform->display(); xoops_cp_footer(); } else { - $source = WfdownloadsRequest::getInt('source', 0, 'POST'); - $target = WfdownloadsRequest::getInt('target', 0, 'POST'); + $source = XoopsRequest::getInt('source', 0, 'POST'); + $target = XoopsRequest::getInt('target', 0, 'POST'); if ($target == $source) { redirect_header($currentFile . "?op=category.move&ok=0&cid={$source}", 5, _AM_WFDOWNLOADS_CCATEGORY_MODIFY_FAILED); } @@ -89,40 +89,40 @@ case 'category.save': case 'addCat': - $cid = WfdownloadsRequest::getInt('cid', 0, 'POST'); - $pid = WfdownloadsRequest::getInt('pid', 0, 'POST'); - $weight = (isset($_POST['weight']) && $_POST['weight'] > 0) ? (int) $_POST["weight"] : 0; - $down_groups = isset($_POST['groups']) ? $_POST['groups'] : array(); - $up_groups = isset($_POST['up_groups']) ? $_POST['up_groups'] : array(); - $spotlighthis = (isset($_POST['lid'])) ? (int) $_POST['lid'] : 0; + $cid = XoopsRequest::getInt('cid', 0, 'POST'); + $pid = XoopsRequest::getInt('pid', 0, 'POST'); + $weight = (isset($_POST['weight']) && $_POST['weight'] > 0) ? (int)$_POST["weight"] : 0; + $down_groups = isset($_POST['groups']) ? $_POST['groups'] : array(); + $up_groups = isset($_POST['up_groups']) ? $_POST['up_groups'] : array(); + $spotlighthis = (isset($_POST['lid'])) ? (int)$_POST['lid'] : 0; $spotlighttop = (isset($_POST['spotlighttop']) && ($_POST['spotlighttop'] == 1)) ? 1 : 0; include_once XOOPS_ROOT_PATH . '/class/uploader.php'; $allowedMimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png'); - $imgurl = 'blank.png'; - $maxFileSize = $wfdownloads->getConfig('maxfilesize'); - $maxImgWidth = $wfdownloads->getConfig('maximgwidth'); - $maxImgHeight = $wfdownloads->getConfig('maximgheight'); - $uploadDirectory = XOOPS_ROOT_PATH . '/' . $wfdownloads->getConfig('catimage'); - $uploader = new XoopsMediaUploader($uploadDirectory, $allowedMimetypes, $maxFileSize, $maxImgWidth, $maxImgHeight); + $imgurl = 'blank.png'; + $maxFileSize = $wfdownloads->getConfig('maxfilesize'); + $maxImgWidth = $wfdownloads->getConfig('maximgwidth'); + $maxImgHeight = $wfdownloads->getConfig('maximgheight'); + $uploadDirectory = XOOPS_ROOT_PATH . '/' . $wfdownloads->getConfig('catimage'); + $uploader = new XoopsMediaUploader($uploadDirectory, $allowedMimetypes, $maxFileSize, $maxImgWidth, $maxImgHeight); if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { $uploader->setTargetFileName('wfdownloads_' . uniqid(time()) . '--' . strtolower($_FILES['uploadfile']['name'])); $uploader->fetchMedia($_POST['xoops_upload_file'][0]); if (!$uploader->upload()) { $errors = $uploader->getErrors(); - redirect_header('javascript:history.go(-1)',3, $errors); + redirect_header('javascript:history.go(-1)', 3, $errors); } else { $imgurl = $uploader->getSavedFileName(); } } else { - $imgurl = (isset($_POST['imgurl']) && $_POST['imgurl'] != 'blank.png') ? $myts -> addslashes($_POST['imgurl']) : ''; + $imgurl = (isset($_POST['imgurl']) && $_POST['imgurl'] != 'blank.png') ? $myts->addslashes($_POST['imgurl']) : ''; } if (!$cid) { $categoryObj = $wfdownloads->getHandler('category')->create(); } else { $categoryObj = $wfdownloads->getHandler('category')->get($cid); - $childcats = $wfdownloads->getHandler('category')->getChildCats($categoryObj); + $childcats = $wfdownloads->getHandler('category')->getChildCats($categoryObj); if ($pid == $cid || in_array($pid, array_keys($childcats))) { $categoryObj->setErrors(_AM_WFDOWNLOADS_CCATEGORY_CHILDASPARENT); } @@ -141,7 +141,7 @@ $categoryObj->setVar('dobr', isset($_POST['dobr'])); // Formulize module support (2006/05/04) jpc - start if (wfdownloads_checkModule('formulize')) { - $formulize_fid = (isset($_POST['formulize_fid'])) ? (int) $_POST['formulize_fid'] : 0; + $formulize_fid = (isset($_POST['formulize_fid'])) ? (int)$_POST['formulize_fid'] : 0; $categoryObj->setVar('formulize_fid', $formulize_fid); } // Formulize module support (2006/05/04) jpc - end @@ -153,15 +153,15 @@ } if (!$cid) { if ($cid == 0) { - $newid = (int) $categoryObj->getVar('cid'); + $newid = (int)$categoryObj->getVar('cid'); } wfdownloads_savePermissions($down_groups, $newid, 'WFDownCatPerm'); wfdownloads_savePermissions($up_groups, $newid, 'WFUpCatPerm'); // Notify of new category - $tags = array(); + $tags = array(); $tags['CATEGORY_NAME'] = $_POST['title']; - $tags['CATEGORY_URL'] = WFDOWNLOADS_URL . '/viewcat.php?cid=' . $newid; - $notification_handler = xoops_gethandler('notification'); + $tags['CATEGORY_URL'] = WFDOWNLOADS_URL . '/viewcat.php?cid=' . $newid; + $notification_handler = xoops_gethandler('notification'); $notification_handler->triggerEvent('global', 0, 'new_category', $tags); $database_mess = _AM_WFDOWNLOADS_CCATEGORY_CREATED; } else { @@ -174,11 +174,11 @@ case 'category.delete': case 'del': - $cid = WfdownloadsRequest::getInt('cid', 0); - $ok = WfdownloadsRequest::getBool('ok', false, 'POST'); - $categoryObjs = $wfdownloads->getHandler('category')->getObjects(); + $cid = XoopsRequest::getInt('cid', 0); + $ok = XoopsRequest::getBool('ok', false, 'POST'); + $categoryObjs = $wfdownloads->getHandler('category')->getObjects(); $categoryObjsTree = new XoopsObjectTree($categoryObjs, 'cid', 'pid'); - if ($ok == true) { + if ($ok === true) { // get all subcategories under the specified category $childCategoryObjs = $categoryObjsTree->getAllChild($cid); foreach ($childCategoryObjs as $childCategoryObj) { @@ -199,7 +199,7 @@ $wfdownloads->getHandler('report')->deleteAll($download_criteria); $wfdownloads->getHandler('download')->deleteAll($download_criteria); foreach (array_keys($downloads) as $lid) { - xoops_comment_delete($wfdownloads->getModule()->mid(), (int) $lid); + xoops_comment_delete($wfdownloads->getModule()->mid(), (int)$lid); } // all downloads for each category is deleted, now delete the category data @@ -207,8 +207,8 @@ $error = _AM_WFDOWNLOADS_DBERROR; foreach ($cids as $cid) { - xoops_groupperm_deletebymoditem ($wfdownloads->getModule()->mid(), 'WFDownCatPerm', $cid); - xoops_groupperm_deletebymoditem ($wfdownloads->getModule() -> mid(), 'WFUpCatPerm', $cid); + xoops_groupperm_deletebymoditem($wfdownloads->getModule()->mid(), 'WFDownCatPerm', $cid); + xoops_groupperm_deletebymoditem($wfdownloads->getModule()->mid(), 'WFUpCatPerm', $cid); } redirect_header($currentFile, 1, _AM_WFDOWNLOADS_CCATEGORY_DELETED); @@ -237,9 +237,9 @@ $categoryObj = $wfdownloads->getHandler('category')->create(); } $form = $categoryObj->getForm(); - $form -> display(); + $form->display(); - include_once dirname(__FILE__) . '/admin_footer.php'; + include_once __DIR__ . '/admin_footer.php'; break; case 'categories.list': @@ -257,22 +257,22 @@ if ($totalCategories > 0) { $sorted_categories = wfdownloads_sortCategories(); $GLOBALS['xoopsTpl']->assign('sorted_categories', $sorted_categories); - $GLOBALS['xoopsTpl']->assign('token', $GLOBALS['xoopsSecurity']->getTokenHTML() ); + $GLOBALS['xoopsTpl']->assign('token', $GLOBALS['xoopsSecurity']->getTokenHTML()); $GLOBALS['xoopsTpl']->display("db:{$wfdownloads->getModule()->dirname()}_am_categorieslist.tpl"); } else { redirect_header("{$currentFile}?op=category.add", 1, _AM_WFDOWNLOADS_CCATEGORY_NOEXISTS); } - include_once dirname(__FILE__) . '/admin_footer.php'; + include_once __DIR__ . '/admin_footer.php'; break; case 'categories.reorder': if (!$GLOBALS['xoopsSecurity']->check()) { - redirect_header($currentFile, 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors() )); + redirect_header($currentFile, 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); } if (isset($_POST['new_weights']) && count($_POST['new_weights']) > 0) { $new_weights = $_POST['new_weights']; - $ids = array(); + $ids = array(); foreach ($new_weights as $cid => $new_weight) { $categoryObj = $wfdownloads->getHandler('category')->get($cid); $categoryObj->setVar('weight', $new_weight); Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/clone.php =================================================================== --- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/clone.php 2014-11-26 21:38:33 UTC (rev 12874) +++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/clone.php 2014-11-26 21:42:17 UTC (rev 12875) @@ -19,7 +19,7 @@ * @version svn:$id$ */ $currentFile = basename(__FILE__); -include_once dirname(__FILE__) . '/admin_header.php'; +include_once __DIR__ . '/admin_header.php'; if (@$_POST['op'] == 'submit') { if (!$GLOBALS['xoopsSecurity']->check()) { @@ -71,7 +71,7 @@ $indexAdmin = new ModuleAdmin(); echo $indexAdmin->addNavigation($currentFile); echo $message; - include_once dirname(__FILE__) . '/admin_footer.php'; + include_once __DIR__ . '/admin_footer.php'; exit(); } else { @@ -86,7 +86,7 @@ $form->addElement(new XoopsFormHidden('op', 'submit')); $form->addElement(new XoopsFormButton('', '', _SUBMIT, 'submit')); $form->display(); - include_once dirname(__FILE__) . '/admin_footer.php'; + include_once __DIR__ . '/admin_footer.php'; exit(); } Modified: XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php =================================================================== --- XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php 2014-11-26 21:38:33 UTC (rev 12874) +++ XoopsModules/wfdownloads/branches/luciorota/wfdownloads/admin/downloads.php 2014-11-26 21:42:17 UTC (rev 12875) @@ -19,7 +19,7 @@ * @version svn:$id$ */ $currentFile = basename(__FILE__); -include_once dirname(__FILE__) . '/admin_header.php'; +include_once __DIR__ . '/admin_header.php'; // Check directories if (!is_dir($wfdownloads->getConfig('uploaddir'))) { @@ -39,7 +39,7 @@ exit(); } -$op = WfdownloadsRequest::getString('op', 'downloads.list'); +$op = XoopsRequest::getString('op', 'downloads.list'); switch ($op) { case 'download.edit': case 'download.add': @@ -52,15 +52,15 @@ $adminMenu->addItemButton(_MI_WFDOWNLOADS_MENU_DOWNLOADS, "{$currentFile}?op=downloads.list", 'list'); echo $adminMenu->renderButton(); - $lid = WfdownloadsRequest::getInt('lid', 0); + $lid = XoopsRequest::getInt('lid', 0); $categoriesCount = $wfdownloads->getHandler('category')->getCount(); if ($categoriesCount) { // Allowed mimetypes list echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_WFDOWNLOADS_FILE_ALLOWEDAMIME . "</legend>\n"; echo "<div style='padding: 8px;'>\n"; - $criteria = new Criteria("mime_admin", true); - $mimetypes = $wfdownloads->getHandler('mimetype')->getList($criteria); + $criteria = new Criteria("mime_admin", true); + $mimetypes = $wfdownloads->getHandler('mimetype')->getList($criteria); $allowMimetypes = implode(' | ', $mimetypes); echo $allowMimetypes; echo "</div>\n"; @@ -77,16 +77,16 @@ redirect_header($currentFile, 4, _AM_WFDOWNLOADS_DOWN_ERROR_CATEGORYNOTFOUND); exit(); } - $title = preg_replace("/{category}/", $categoryObj->getVar('title'), _AM_WFDOWNLOADS_FILE_EDIT); + $title = preg_replace("/{category}/", $categoryObj->getVar('title'), _AM_WFDOWNLOADS_FILE_EDIT); $title12 = preg_replace("/{category}/", $categoryObj->getVar('title'), _AM_WFDOWNLOADS_FFS_1STEP); $title22 = preg_replace("/{category}/", $categoryObj->getVar('title'), _AM_WFDOWNLOADS_FFS_EDITDOWNLOADTITLE); } else { // create download $downloadObj = $wfdownloads->getHandler('download')->create(); - $cid = WfdownloadsRequest::getInt('cid', 0, 'POST'); + $cid = XoopsRequest::getInt('cid', 0, 'POST'); $categoryObj = $wfdownloads->getHandler('category')->get($cid); $downloadObj->setVar('cid', $cid); - $title = preg_replace("/{category}/", $categoryObj->getVar('title'), _AM_WFDOWNLOADS_FILE_CREATE); + $title = preg_replace("/{category}/", $categoryObj->getVar('title'), _AM_WFDOWNLOADS_FILE_CREATE); $title12 = preg_replace("/{category}/", $categoryObj->getVar('title'), _AM_WFDOWNLOADS_FFS_1STEP); $title22 = preg_replace("/{category}/", $categoryObj->getVar('title'), _AM_WFDOWNLOADS_FFS_DOWNLOADTITLE); } @@ -97,15 +97,16 @@ $sform = $downloadObj->getAdminForm($title); } elseif ((isset($_POST['submit_category']) && !empty($_POST['submit_category']))) { // two steps form: 2nd step - $fid = $categoryObj->getVar('formulize_fid'); + $fid = $categoryObj->getVar('formulize_fid'); $customArray = array(); if ($fid) { include_once XOOPS_ROOT_PATH . '/modules/formulize/include/formdisplay.php'; include_once XOOPS_ROOT_PATH . '/modules/formulize/include/functions.php'; - $customArray['fid'] = $fid; + $customArray['fid'] = $fid; $customArray['formulize_mgr'] = xoops_getmodulehandler('elements', 'formulize'); - $customArray['groups'] = $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS); - $customArray['prevEntry'] = getEntryValues( // is a Formulize function + $customArray['groups'] = $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS); + $customArray['prevEntry'] = getEntryValues( + // is a Formulize function $downloadObj->getVar('formulize_idreq'), $customArray['formulize_mgr'], $customArray['groups'], @@ -124,7 +125,7 @@ } else { $owner = getEntryOwner($customArray['entry'], $fid); // is a Formulize function } - $ownerGroups = $member_handler->getGroupsByUser($owner, false); + $ownerGroups = $member_handler->getGroupsByUser($owner, false); $customArray['owner_groups'] = $ownerGroups; } $sform = $downloadObj->getAdminForm($title22, $customArray); @@ -192,9 +193,9 @@ foreach ($regUserRatingObjs as $regUserRatingObj) { $formatted_date = XoopsLocal::formatTimestamp($regUserRatingObj->getVar('ratingtimestamp'), 'l'); - $userAvgRating = isset($userRatings[$regUserRatingObj->getVar('ratinguser')]) ? $userRatings[$regUserRatingObj->getVar('ratinguser')]['avg'] : 0; - $userVotes = isset($userRatings[$regUserRatingObj->getVar('ratinguser')]) ? $userRatings[$regUserRatingObj->getVar('ratinguser')]['count'] : 0; - $ratingUserName = XoopsUser :: getUnameFromId($regUserRatingObj->getVar('ratinguser')); + $userAvgRating = isset($userRatings[$regUserRatingObj->getVar('ratinguser')]) ? $userRatings[$regUserRatingObj->getVar('ratinguser')]['avg'] : 0; + $userVotes = isset($userRatings[$regUserRatingObj->getVar('ratinguser')]) ? $userRatings[$regUserRatingObj->getVar('ratinguser')]['count'] : 0; + $ratingUserName = XoopsUser:: getUnameFromId($regUserRatingObj->getVar('ratinguser')); echo " <tr><td class='head'>$ratingUserName</td>\n @@ -204,8 +205,7 @@ <td class='even'>$userVotes</th>\n <td class='even'>$formatted_date</th>\n <td class='even'>\n - <a href='{$currentFile}?op=vote.delete&lid={$lid}&rid=" . $regUserRatingObj->getVar('ratingid') . "'>" - . $imagearray['deleteimg'] . "</a>\n + <a href='{$currentFile}?op=vote.delete&lid={$lid}&rid=" . $regUserRatingObj->getVar('ratingid') . "'>" . $imagearray['deleteimg'] . "</a>\n </th></tr>\n "; } @@ -227,14 +227,14 @@ if ($anonUserRatingCount == 0) { echo "<tr><td colspan='7' class='even'><b>" . _AM_WFDOWNLOADS_VOTE_NOUNREGVOTES . "</b></td></tr>"; } else { - $criteria = new Criteria('ratinguser', 0); - $userRatings = $wfdownloads->getHandler('rating')->getUserAverage($criteria); + $criteria = new Criteria('ratinguser', 0); + $userRatings = $wfdownloads->getHandler('rating')->getUserAverage($criteria); $anonUserRatingObjs = $wfdownloads->getHandler('rating')->getObjects($anonUserCriteria); foreach (array_keys($anonUserRatingObjs) as $anonUserRatingObj) { $formatted_date = XoopsLocal::formatTimestamp($anonUserRatingObj->getVar('ratingtimestamp'), 'l'); - $userAvgRating = isset($userRatings['avg']) ? $userRatings['avg'] : 0; - $userVotes = isset($userRatings['count']) ? $userRatings['count'] : 0; + $userAvgRating = isset($userRatings['avg']) ? $userRatings['avg'] : 0; + $userVotes = isset($userRatings['count']) ? $userRatings['count'] : 0; $ratingUserName = $GLOBALS['xoopsConfig']['anonymous']; @@ -246,8 +246,7 @@ <td class='even'>$userVotes</th>\n <td class='even'>$formatted_date</th>\n <td class='even'>\n - <a href='{$currentFile}?op=vote.delete&lid={$lid}&rid=" . $anonUserRatingObj->getVar('ratingid') . "'>" - . $imagearray['deleteimg'] . "</a>\n + <a href='{$currentFile}?op=vote.delete&lid={$lid}&rid=" . $anonUserRatingObj->getVar('ratingid') . "'>" . $imagearray['deleteimg'] . "</a>\n </th></tr>\n "; } @@ -255,32 +254,32 @@ echo "</table>\n"; echo "</fieldset>\n"; } - include_once dirname(__FILE__) . '/admin_footer.php'; + include_once __DIR__ . '/admin_footer.php'; break; case 'download.save': case 'addDownload': - $lid = WfdownloadsRequest::getInt('lid', 0, 'POST'); - $cid = WfdownloadsRequest::getInt('cid', 0, 'POST'); - $status = WfdownloadsRequest::getInt('status', _WFDOWNLOADS_STATUS_UPDATED, 'POST'); + $lid = XoopsRequest::getInt('lid', 0, 'POST'); + $cid = XoopsRequest::getInt('cid', 0, 'POST'); + $status = XoopsRequest::getInt('status', _WFDOWNLOADS_STATUS_UPDATED, 'POST'); if ($lid > 0) { $thisIsANewRecord = false; /* Added by Lankford on 2007/3/21 */ - $downloadObj = $wfdownloads->getHandler('download')->get($lid); + $downloadObj = $wfdownloads->getHandler('download')->get($lid); } else { $thisIsANewRecord = true; /* Added by Lankford on 2007/3/21 */ - $downloadObj = $wfdownloads->getHandler('download')->create(); + $downloadObj = $wfdownloads->getHandler('download')->create(); } // Define URL if (empty($_FILES['userfile']['name'])) { if ($_POST['url'] && $_POST['url'] != '' && $_POST['url'] != 'http://') { - $url = ($_POST['url'] != 'http://') ? $_POST['url'] : ''; + $url = ($_POST['url'] != 'http://') ? $_POST['url'] : ''; $filename = ''; $filetype = ''; // Get size from form - $size = (empty($_POST['size']) || !is_numeric($_POST['size'])) ? 0 : (int) $_POST['size']; + $size = (empty($_POST['size']) || !is_numeric($_POST['size'])) ? 0 : (int)$_POST['size']; } else { - $url = ($_POST['url'] != 'http://') ? $_POST['url'] : ''; + $url = ($_POST['url'] != 'http://') ? $_POST['url'] : ''; $filename = $_POST['filename']; $filetype = $_POST['filetype']; $filePath = $wfdownloads->getConfig('uploaddir') . '/' . $filename; @@ -291,12 +290,12 @@ $downloadObj->setVar('filename', $filename); $downloadObj->setVar('filetype', $filetype); } else { - $down = wfdownloads_uploading($_FILES, $wfdownloads->getConfig('uploaddir'), '', $currentFile, 0, false, true); - $url = ($_POST['url'] != 'http://') ? $_POST['url'] : ''; - $size = $down['size']; + $down = wfdownloads_uploading($_FILES, $wfdownloads->getConfig('uploaddir'), '', $currentFile, 0, false, true); + $url = ($_POST['url'] != 'http://') ? $_POST['url'] : ''; + $size = $down['size']; $title = $_FILES['userfile']['name']; - $ext = rtrim(strrchr($title, '.'), '.'); + $ext = rtrim(strrchr($title, '.'), '.'); $title = str_replace($ext, '', $title); $title = (isset($_POST['title_checkbox']) && $_POST['title_checkbox'] == 1) ? $title : trim($_POST['title']); @@ -306,7 +305,7 @@ $downloadObj->setVar('filetype', $filetype); } // Get data from form - $screenshots = array(); + $screenshots = array(); $screenshots[] = ($_POST['screenshot'] != 'blank.png') ? $_POST['screenshot'] : ''; $screenshots[] = ($_POST['screenshot2'] != 'blank.png') ? $_POST['screenshot2'] : ''; $screenshots[] = ($_POST['screenshot3'] != 'blank.png') ? $_POST['screenshot3'] : ''; @@ -326,11 +325,11 @@ // If both conditions are true, then trigger all three notifications related to modified records. if (!$thisIsANewRecord && ($downloadObj->getVar('version') != $version)) { // Trigger the three events related to modified files (one for the file, category, and global event categories respectively) - $tags = array(); - $tags['FILE_NAME'] = $title; - $tags['FILE_URL'] = WFDOWNLOADS_URL . "/singlefile.php?cid={$cid}&lid={$lid}"; - $categoryObj = $wfdownloads->getHandler('category')->get($cid); - $tags['FILE_VERSION'] = $version; + $tags = array(); + $tags['FILE_NAME'] = $title; + $tags['FILE_URL'] = WFDOWNLOADS_URL . "/singlefile.php?cid={$cid}&lid={$lid}"; + $categoryObj = $wfdownloads->getHandler('category')->get($cid); + $tags['FILE_VERSION'] = $version; $tags['CATEGORY_NAME'] = $categoryObj->getVar('title'); $tags['CATEGORY_URL'] = WFDOWNLOADS_URL . "/viewcat.php?cid='{$cid}"; @@ -377,12 +376,12 @@ $versiontypes = (isset($_POST['versiontypes'])) ? $_POST['versiontypes'] : ''; $downloadObj->setVar('versiontypes', $versiontypes); - $dhistory = (isset($_POST['dhistory'])) ? $_POST['dhistory'] : ''; + $dhistory = (isset($_POST['dhistory'])) ? $_POST['dhistory'] : ''; $dhistoryhistory = (isset($_POST['dhistoryaddedd'])) ? $_POST['dhistoryaddedd'] : ''; if ($lid > 0 && !empty($dhistoryhistory)) { $dhistory = $dhistory . "\n\n"; - $time = time(); + $time = time(); $dhistory .= _AM_WFDOWNLOADS_FILE_HISTORYVERS . $version . _AM_WFDOWNLOADS_FILE_HISTORDATE . XoopsLocal::formatTimestamp($time, 'l') . "\n\n"; $dhistory .= $dhistoryhistory; } @@ -398,7 +397,7 @@ $offline = ($_POST['offline'] == true) ? true : false; $downloadObj->setVar('offline', $offline); - $approved = (isset($_POST['approved']) && $_POST['approved'] == true) ? true : false; + $approved = (isset($_POST['approved']) && $_POST['approved'] == true) ? true : false; $notifypub = (isset($_POST['notifypub']) && $_POST['notifypub'] == true); $expiredate = 0; @@ -406,19 +405,23 @@ $publishdate = time(); } else { $publishdate = $_POST['was_published']; - $expiredate = $_POST['was_expired']; + $expiredate = $_POST['was_expired']; } if ($approved == 1 && empty($publishdate)) { $publishdate = time(); } if (isset($_POST['publishdateactivate'])) { - $publishdate = strtotime($_POST['published']['date']) + $_POST['published']['time']; + $obj = DateTime::createFromFormat(_SHORTDATESTRING, $_POST['published']['date']); + $obj->setTime(0, 0, 0); + $publishdate = $obj->getTimestamp() + $_POST['published']['time']; } if ($_POST['clearpublish']) { $publishdate = $downloadObj->getVar('published'); } if (isset($_POST['expiredateactivate'])) { - $expiredate = strtotime($_POST['expired']['date']) + $_POST['expired']['time']; + $obj = DateTime::createFromFormat(_SHORTDATESTRING, $_POST['expired']['date']); + $obj->setTime(0, 0, 0); + $expiredate = $obj->getTimestamp() + $_POST['expired']['time']; } if ($_POST['clearexpire']) { $expiredate = '0'; @@ -452,17 +455,17 @@ } else { print 'no idreq'; $entries[$fid][0] = ''; - $owner = ''; + $owner = ''; } $cid = $downloadObj->getVar('cid'); } else { $entries[$fid][0] = ''; - $owner = ''; + $owner = ''; } $ownerGroups = $member_handler->getGroupsByUser($owner, false); - $uid = !empty($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; - $groups = $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS); - $entries = handleSubmission( + $uid = !empty($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; + $groups = $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS); + $entries = handleSubmission( $formulizeElements_handler, $entries, $uid, @@ -480,24 +483,24 @@ } // Formulize module support (2006/05/04) jpc - end $wfdownloads->getHandler('download')->insert($downloadObj); - $newid = (int) $downloadObj->getVar('lid'); + $newid = (int)$downloadObj->getVar('lid'); // Send notifications if (!$lid) { - $tags = array(); - $tags['FILE_NAME'] = $title; - $tags['FILE_URL'] = WFDOWNLOADS_URL . "/singlefile.php?cid={$cid}&lid={$newid}"; + $tags = array(); + $tags['FILE_NAME'] = $title; + $tags['FILE_URL'] = WFDOWNLOADS_URL . "/singlefile.php?cid={$cid}&lid={$newid}"; $tags['CATEGORY_NAME'] = $categoryObj->getVar('title'); - $tags['CATEGORY_URL'] = WFDOWNLOADS_URL . "/viewcat.php?cid={$cid}"; + $tags['CATEGORY_URL'] = WFDOWNLOADS_URL . "/viewcat.php?cid={$cid}"; $notification_handler->triggerEvent('global', 0, 'new_file', $tags); $notification_handler->triggerEvent('category', $cid, 'new_file', $tags); } if ($lid && $approved && $notifypub) { - $tags = array(); - $tags['FILE_NAME'] = $title; - $tags['FILE_URL'] = WFDOWNLOADS_URL . "/singlefile.php?cid={$cid}&lid={$lid}"; - $categoryObj = $wfdownloads->getHandler('category')->get($cid); + $tags = array(); + $tags['FILE_NAME'] = $title; + $tags['FILE_URL'] = WFDOWNLOADS_URL . "/singlefile.php?cid={$cid}&lid={$lid}"; + $categoryObj = $wfdownloads->getHandler('category')->get($cid); $tags['CATEGORY_NAME'] = $categoryObj->getVar('title'); - $tags['CATEGORY_URL'] = WFDOWNLOADS_URL . '/viewcat.php?cid=' . $cid; + $tags['CATEGORY_URL'] = WFDOWNLOADS_URL . '/viewcat.php?cid=' . $cid; $notification_handler->triggerEvent('global', 0, 'new_file', $tags); $notification_handler->triggerEvent('category', $cid, 'new_file', $tags); $notification_handler->triggerEvent('file', $lid, 'approve', $tags); @@ -509,14 +512,14 @@ break; case 'download.delete': - $lid = WfdownloadsRequest::getInt('lid', 0); - $ok = WfdownloadsRequest::getBool('ok', false, 'POST'); + $lid = XoopsRequest::getInt('lid', 0); + $ok = XoopsRequest::getBool('ok', false, 'POST'); if (!$downloadObj = $wfdownloads->getHandler('download')->get($lid)) { redirect_header($currentFile, 4, _AM_WFDOWNLOADS_ERROR_DOWNLOADNOTFOUND); exit(); } $title = $downloadObj->getVar('title'); - if ($ok == true) { + if ($ok === true) { if (!$GLOBALS['xoopsSecurity']->check()) { redirect_header($currentFile, 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); } @@ -546,7 +549,7 @@ case 'delVote': $ratingObj = $wfdownloads->getHandler('rating')->get($_GET['rid']); if ($wfdownloads->getHandler('rating')->delete($ratingObj, true)) { - wfdownloads_updateRating((int) $ratingObj->getVar('lid')); + wfdownloads_updateRating((int)$ratingObj->getVar('lid')); } redirect_header($currentFile, 1, _AM_WFDOWNLOADS_VOTE_VOTEDELETED); break; @@ -563,8 +566,7 @@ $sqls[] = "ALTER TABLE " . $GLOBALS['xoopsDB']->prefix('wfdownloads_downloads') . " ADD formulize_idreq int(5) NOT NULL default '0';"; foreach ($sqls as $sql) { if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { - exit("Error patching for Formulize.<br>SQL dump:<br>" . $sql - . "<br>Please contact <a href=su...@fr...>Freeform Solutions</a> for assistance."); + exit("Error patching for Formulize.<br>SQL dump:<br>" . $sql . "<br>Please contact <a href=su...@fr...>Freeform Solutions</a> for assistance."); } } print "Patching for Formulize completed."; @@ -575,7 +577,7 @@ case 'newdownload.approve': case 'approve': - $lid = WfdownloadsRequest::getInt('lid', 0); + $lid = XoopsRequest::getInt('lid', 0); if (!$downloadObj = $wfdownloads->getHandler('download')->get($lid)) { redirect_header($currentFile, 4, _AM_WFDOWNLOADS_ERROR_DOWNLOADNOTFOUND); exit(); @@ -588,14 +590,14 @@ exit(); } // Trigger notify - $title = $downloadObj->getVar('title'); - $cid = $downloadObj->getVar('cid'); - $categoryObj = $wfdownloads->getHandler('category')->get($cid); - $tags = array(); - $tags['FILE_NAME'] = $title; - $tags['FILE_URL'] = WFDOWNLOADS_URL . "/singlefile.php?cid={$cid}&lid={$lid}"; + $title = $downloadObj->getVar('title'); + $cid = $downloadObj->getVar('cid'); + $categoryObj = $wfdownloads->getHandler('category')->get($cid); + $tags = array(); + $tags['FILE_NAME'] = $title; + $tags['FILE_URL'] = WFDOWNLOADS_URL . "/singlefile.php?cid={$cid}&lid={$lid}"; $tags['CATEGORY_NAME'] = $categoryObj->getVar('title'); - $tags['CATEGORY_URL'] = WFDOWNLOADS_URL . "/viewcat.php?cid={$cid}"; + $tags['CATEGORY_URL'] = WFDOWNLOADS_URL . "/viewcat.php?cid={$cid}"; $notification_handler->triggerEvent('global', 0, 'new_file', $tags); $notification_handler->triggerEvent('category', $cid, 'new_file', $tags); if ($downloadObj->getVar('notifypub')) { @@ -608,13 +610,13 @@ case 'downloads.filter': default : // get filter conditions - $filter_title_condition = WfdownloadsRequest::getString('filter_title_condition', '='); - $filter_title = WfdownloadsRequest::getString('filter_title', ''); - $filter_category_title_condition = WfdownloadsRequest::getString('filter_category_title_condition', '='); - $filter_category_title = WfdownloadsRequest::getString('filter_category_title', ''); - $filter_submitter = WfdownloadsRequest::getArray('filter_submitter', null); - $filter_date = WfdownloadsRequest::getArray('filter_date', null); - $filter_date_condition = WfdownloadsRequest::getString('filter_date_condition', '<'); + $filter_title_condition = XoopsRequest::getString('filter_title_condition', '='); + $filter_title = XoopsRequest::getString('filter_title', ''); + $filter_category_title_condition = XoopsRequest::getString('filter_category_title_condition', '='); + $filter_category_title = XoopsRequest::getString('filter_category_title', ''); + $filter_submitter = XoopsRequest::getArray('filter_submitter', null); + $filter_date = XoopsRequest::getArray('filter_date', null); + $filter_date_condition = XoopsRequest::getString('filter_date_condition', '<'); // check filter conditions if ($op == 'downloads.filter') { if ($filter_title == '' && $filter_category_title == '' && is_null($filter_submitter)) { @@ -626,14 +628,14 @@ $categoryObjs = $wfdownloads->getHandler('category')->getObjects(); - $start_published = WfdownloadsRequest::getInt('start_published', 0); - $start_new = WfdownloadsRequest::getInt('start_new', 0); - $start_autopublished = WfdownloadsRequest::getInt('start_autopublished', 0); - $start_expired = WfdownloadsRequest::getInt('start_expired', 0); - $start_offline = WfdownloadsRequest::getInt('start_offline', 0); + $start_published = XoopsRequest::getInt('start_published', 0); + $start_new = XoopsRequest::getInt('start_new', 0); + $start_autopublished = XoopsRequest::getInt('start_autopublished', 0); + $start_expired = XoopsRequest::getInt('start_expired', 0); + $start_offline = XoopsRequest::getInt('start_offline', 0); - $totalCategoriesCount = wfdownloads_categoriesCount(); - $categoryObjs = $wfdownloads->getHandler('category')->getObjects(null, true, false); + $totalCategoriesCount = wfdownloads_categoriesCount(); + $categoryObjs = $wfdownloads->getHandler('category')->getObjects(null, true, false); $totalDownloadsCount = $wfdownloads->getHandler('download')->getCount(); @@ -681,7 +683,7 @@ $criteria->setOrder('DESC'); $criteria->setStart($start_published); $criteria->setLimit($wfdownloads->getConfig('admin_perpage')); - $publishedDownloadObjs = $wfdownloads->getHandler('download')->getActiveDownloads($criteria); + $publishedDownloadObjs = $wfdownloads->getHandler('download')->getActiveDownloads($criteria); $publishedDownloadCount = $wfdownloads->getHandler('download')->getActiveCount(); $GLOBALS['xoopsTpl']->assign('published_downloads_count', $publishedDownloadCount); @@ -701,7 +703,7 @@ $GLOBALS['xoopsTpl']->assign('filter_title_condition', $filter_title_condition); $GLOBALS['xoopsTpl']->assign('filter_category_title', $filter_category_title); $GLOBALS['xoopsTpl']->assign('filter_category_title_condition', $filter_category_title_condition); - $submitters = array(); + $submitters = array(); $downloadsSubmitters_array = $wfdownloads->getHandler('download')->getAll(null, array('submitter'), false, false); foreach ($downloadsSubmitters_array as $downloadSubmitters_array) { $submitters[$downloadSubmitters_array['submitter']] = XoopsUserUtility::getUnameFromId($downloadSubmitters_array['submitter']); @@ -721,23 +723,23 @@ $criteria->add(new Criteria('published', 0)); $criteria->setStart($start_new); $criteria->setLimit($wfdownloads->getConfig('admin_perpage')); - $newDownloadObjs = $wfdownloads->getHandler('download')->getObjects($criteria); + $newDownloadObjs = $wfdownloads->getHandler('download')->getObjects($criteria); $newDownloadCount = $wfdownloads->getHandler('download')->getCount($criteria); $GLOBALS['xoopsTpl']->assign('new_downloads_count', $newDownloadCount); if ($newDownloadCount > 0) { foreach ($newDownloadObjs as $newDownloadObj) { - $newDownload_array = $newDownloadObj->toArray(); - $newDownload_array['rating'] = number_format($newDownload_array['rating'], 2); - $newDownload_array['title_html'] = $myts->htmlSpecialChars($newDownload_array['title']); - $newDownload_array['category_title'] = $categories[$newDownload_array['cid']]['title']; -/* - $url = urldecode($myts->htmlSpecialChars($newDownload_array['url'])); - $homepage = $myts->htmlSpecialChars($newDownload_array['homepage']); - $version = $myts->htmlSpecialChars($newDownload_array['version']); - $size = $myts->htmlSpecialChars($newDownload_array['size']); - $platform = $myts->htmlSpecialChars($newDownload_array['platform']); - $logourl = $myts->htmlSpecialChars($newDownload_array['screenshot']); // IN PROGRESS -*/ + $newDownload_array = $newDownloadObj->toArray(); + $newDownload_array['rating'] = number_format($newDownload_array['rating'], 2); + $newDownload_array['title_html'] = $myts->htmlSpecialChars($newDownload_array['title']); + $newDownload_array['category_title'] = $categories[$newDownload_array['cid']]['title']; + /* + $url = urldecode($myts->htmlSpecialChars($newDownload_array['url'])); + $homepage = $myts->htmlSpecialChars($newDownload_array['homepage']); + $version = $myts->htmlSpecialChars($newDownload_array['version']); + $size = $myts->htmlSpecialChars($newDownload_array['size']); + $platform = $myts->htmlSpecialChars($newDownload_array['platform']); + $logourl = $myts->htmlSpecialChars($newDownload_array['screenshot']); // IN PROGRESS + */ $newDownload_array['submitter_uname'] = XoopsUserUtility::getUnameFromId($newDownload_array['submitter']); $newDownload_array['date_formatted'] = XoopsLocal::formatTimestamp($newDownload_array['date'], 'l'); $GLOBALS['xoopsTpl']->append('new_downloads', $newDownload_array); @@ -753,7 +755,7 @@ $criteria->setOrder('ASC'); $criteria->setStart($start_autopublished); $criteria->setLimit($wfdownloads->getConfig('admin_perpage')); - $autopublishedDownloadObjs = $wfdownloads->getHandler('download')->getObjects($criteria); + $autopublishedDownloadObjs = $wfdownloads->getHandler('download')->getObjects($criteria); $autopublishedDownloadCount = $wfdownloads->getHandler('download')->getCount($criteria); $GLOBALS['xoopsTpl']->assign('autopublished_downloads_count', $autopublishedDownloadCount); if ($autopublishedDownloadCount > 0) { @@ -766,9 +768,11 @@ $GLOBALS['xoopsTpl']->append('autopublished_downloads', $autopublishedDownload_array); } } - $pagenav = new XoopsPageNav($autopublishedDownloadCount, $wfdownloads->getConfig( - 'admin_perpage' - ), $start_autopublished, 'start_autopublished'); + $pagenav = new XoopsPageNav( + $autopublishedDownloadCount, $wfdownloads->getConfig( + 'admin_perpage' + ), $start_autopublished, 'start_autopublished' + ); $GLOBALS['xoopsTpl']->assign('autopublished_downloads_pagenav', $pagenav->renderNav()); // Expired downloads @@ -779,7 +783,7 @@ $criteria->setOrder('ASC'); $criteria->setStart($start_expired); $criteria->setLimit($wfdownloads->getConfig('admin_perpage')); - $expiredDownloadObjs = $wfdownloads->getHandler('download')->getObjects($criteria); + $expiredDownloadObjs = $wfdownloads->getHandler('download')->getObjects($criteria); $expiredDownloadCount = $wfdownloads->getHandler('download')->getCount($criteria); $GLOBALS['xoopsTpl']->assign('expired_downloads_count', $expiredDownloadCount); if ($expiredDownloadCount > 0) { @@ -801,7 +805,7 @@ $criteria->setOrder('ASC'); $criteria->setStart($start_offline); $criteria->setLimit($wfdownloads->getConfig('admin_perpage')); - $offlineDownloadObjs = $wfdownloads->getHandler('download')->getObjects($criteria); + $offlineDownloadObjs = $wfdownloads->getHandler('download')->getObjects($criteria); $offlineDownloadCount = $wfdownloads->getHandler('download')->getCount($criteria); $GLOBALS['xoopsTpl']->assign('offline_downloads_count', $offlineDownloadCount); if ($offlineDownloadCount > 0) { @@ -822,19 +826,19 @@ // Batch files $extensionToMime = include $GLOBALS['xoops']->path('include/mimetypes.inc.php'); - $batchPath = $wfdownloads->getConfig('batchdir'); + $batchPath = $wfdownloads->getConfig('batchdir'); $GLOBALS['xoopsTpl']->assign('batch_path', $batchPath); - $batchFiles = wfdownloads_getFiles($batchPath . '/'); + $batchFiles = wfdownloads_getFiles($batchPath . '/'); $batchFilesCount = count($batchFiles); $GLOBALS['xoopsTpl']->assign('batch_files_count', $batchFilesCount); if ($batchFilesCount > 0) { - foreach($batchFiles as $key => $batchFile) { - $batchFile_array = array(); - $batchFile_array['id'] = $key; - $batchFile_array['filename'] = $batchFile; - $batchFile_array['size'] = wfdownloads_bytesToSize1024(filesize($batchPath . '/' . $batchFile)); + foreach ($batchFiles as $key => $batchFile) { + $batchFile_array = array(); + $batchFile_array['id'] = $key; + $batchFile_array['filename'] = $batchFile; + $batchFile_array['size'] = wfdownloads_bytesToSize1024(filesize($batchPath . '/' . $batchFile)); $batchFile_array['extension'] = pathinfo($batchFile, PATHINFO_EXTENSION); - $batchFile_array['mimetype'] = $extensionToMime[pathinfo($batchFile, PATHINFO_EXTENSION)]; + $batchFile_array['mimetype'] = $extensionToMime[pathinfo($batchFile, PATHINFO_EXTENSION)]; $GLOBALS['xoopsTpl']->append('batch_files', $batchFile_array); unset($batchFile_array); } @@ -842,15 +846,15 @@ $GLOBALS['xoopsTpl']->display("db:{$wfdownloads->getModule()->dirname()}_am_downloadslist.tpl"); - include_once dirname(__FILE__) . '/admin_footer.php'; + include_once __DIR__ . '/admin_footer.php'; break; case 'batchfile.add': - $batchid = WfdownloadsRequest::getInt('batchid', 0); + $batchid = XoopsRequest::getInt('batchid', 0); $extensionToMime = include $GLOBALS['xoops']->path('include/mimetypes.inc.php'); - $batchPath = $wfdownloads->getConfig('batchdir'); - $batchFiles = wfdownloads_getFiles($batchPath . '/'); + $batchPath = $wfdownloads->getConfig('batchdir'); + $batchFiles = wfdownloads_getFiles($batchPath . '/'); if (!isset($batchFiles[$batchid]) || !is_file($batchPath . '/' . $batchFiles[$batchid])) { redirect_header($currentFile, 4, _AM_WFDOWNLOADS_ERROR_BATCHFILENOTFOUND); @@ -891,10 +895,10 @@ break; case 'batchfile.delete': - $batchid = WfdownloadsRequest::getInt('batchid', 0); - $ok = WfdownloadsRequest::getBool('ok', false, 'POST'); + $batchid = XoopsRequest::getInt('batchid', 0); + $ok = XoopsRequest::getBool('ok', false, 'POST'); - $batchPath = $wfdownloads->getConfig('batchdir'); + $batchPath = $wfdownloads->getConfig('batchdir'); $batchFiles = wfdownloads_getFiles($batchPath); if (!isset($batchFiles[$batchid]) || !is_file($batchPath . '/' . $batchFiles[$batchid])) { @@ ... [truncated message content] |
From: <luc...@us...> - 2014-11-26 21:38:39
|
Revision: 12874 http://sourceforge.net/p/xoops/svn/12874 Author: luciorota Date: 2014-11-26 21:38:33 +0000 (Wed, 26 Nov 2014) Log Message: ----------- Use native XoopsRequest Modified Paths: -------------- XoopsModules/xhttperror/branches/luciorota/xhttperror/admin/error.php XoopsModules/xhttperror/branches/luciorota/xhttperror/admin/report.php XoopsModules/xhttperror/branches/luciorota/xhttperror/docs/changelog.txt XoopsModules/xhttperror/branches/luciorota/xhttperror/include/common.php XoopsModules/xhttperror/branches/luciorota/xhttperror/xoops_version.php Removed Paths: ------------- XoopsModules/xhttperror/branches/luciorota/xhttperror/class/request.php Modified: XoopsModules/xhttperror/branches/luciorota/xhttperror/admin/error.php =================================================================== --- XoopsModules/xhttperror/branches/luciorota/xhttperror/admin/error.php 2014-11-26 07:33:36 UTC (rev 12873) +++ XoopsModules/xhttperror/branches/luciorota/xhttperror/admin/error.php 2014-11-26 21:38:33 UTC (rev 12874) @@ -59,7 +59,7 @@ $modcreate_admin->addItemButton(_CO_XHTTPERROR_BUTTON_ERRORS_LIST, '' . $currentFile . '?op=list_errors', 'list'); echo $modcreate_admin->renderButton(); // - $error_id = XhttperrorRequest::getInt('error_id', 0); + $error_id = XoopsRequest::getInt('error_id', 0); $errorObj = $xhttperror->getHandler('error')->get($error_id); if (!$errorObj) { // ERROR @@ -76,7 +76,7 @@ if (!$GLOBALS['xoopsSecurity']->check()) { redirect_header($currentFile, 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); } - $error_id = XhttperrorRequest::getInt('error_id', 0, 'POST'); + $error_id = XoopsRequest::getInt('error_id', 0, 'POST'); $isNewError = ($error_id == 0) ? true : false; $errorObj = $xhttperror->getHandler('error')->get($error_id); // Check statuscode @@ -89,9 +89,9 @@ $errorObj->setVar('error_statuscode', $_REQUEST['error_statuscode']); } } - $error_title = XhttperrorRequest::getString('error_title', '', 'POST'); - $error_text = XhttperrorRequest::getString('error_text', '', 'POST'); - $error_text_html = XhttperrorRequest::getString('error_text_html', '', 'POST'); + $error_title = XoopsRequest::getString('error_title', '', 'POST'); + $error_text = XoopsRequest::getString('error_text', '', 'POST'); + $error_text_html = XoopsRequest::getString('error_text_html', '', 'POST'); // $errorObj->setVar('error_title', $error_title); $errorObj->setVar('error_text', $error_text); @@ -117,14 +117,14 @@ break; case 'delete_error': - $error_id = XhttperrorRequest::getInt('error_id', 0); + $error_id = XoopsRequest::getInt('error_id', 0); $errorObj = $xhttperror->getHandler('error')->get($error_id); if (!$errorObj) { // ERROR redirect_header($currentFile, 3, _CO_XHTTPERROR_ERROR_NOERROR); exit(); } - if (XhttperrorRequest::getBool('ok', false, 'POST') == true) { + if (XoopsRequest::getBool('ok', false, 'POST') == true) { if (!$GLOBALS['xoopsSecurity']->check()) { redirect_header($currentFile, 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); } Modified: XoopsModules/xhttperror/branches/luciorota/xhttperror/admin/report.php =================================================================== --- XoopsModules/xhttperror/branches/luciorota/xhttperror/admin/report.php 2014-11-26 07:33:36 UTC (rev 12873) +++ XoopsModules/xhttperror/branches/luciorota/xhttperror/admin/report.php 2014-11-26 21:38:33 UTC (rev 12874) @@ -22,7 +22,7 @@ $currentFile = basename(__FILE__); include_once __DIR__ . '/admin_header.php'; -$op = XhttperrorRequest::getString('op', 'list_reports'); +$op = XoopsRequest::getString('op', 'list_reports'); switch($op) { default: case 'list_reports': @@ -34,7 +34,7 @@ // $reportCount = $xhttperror->getHandler('report')->getCount(); if($reportCount > 0) { - $start = XhttperrorRequest::getInt('start', 0); + $start = XoopsRequest::getInt('start', 0); $criteria = new CriteriaCompo(); $criteria->setSort('report_date'); $criteria->setOrder('ASC'); @@ -59,12 +59,12 @@ break; case 'apply_actions': - $action = XhttperrorRequest::getString('actions_action'); - $report_ids = XhttperrorRequest::getArray('report_ids', unserialize(XhttperrorRequest::getString('serialize_report_ids'))); + $action = XoopsRequest::getString('actions_action'); + $report_ids = XoopsRequest::getArray('report_ids', unserialize(XoopsRequest::getString('serialize_report_ids'))); $reportCriteria = new Criteria('report_id', '(' . implode(',', $report_ids) . ')', 'IN'); switch ($action) { case 'delete_reports': - if (XhttperrorRequest::getBool('ok', false, 'POST') == true) { + if (XoopsRequest::getBool('ok', false, 'POST') == true) { // delete subscriber (subscr), subscriptions (catsubscrs) and mailinglist if ($xhttperror->getHandler('report')->deleteAll($reportCriteria, true, true)) { redirect_header($currentFile, 3, _CO_XHTTPERROR_ERRORS_DELETED); @@ -91,14 +91,14 @@ break; case 'delete_report' : - $report_id = XhttperrorRequest::getInt('report_id', 0); + $report_id = XoopsRequest::getInt('report_id', 0); $reportObj = $xhttperror->getHandler('report')->get($report_id); if (!$reportObj) { // ERROR redirect_header($currentFile, 3, _CO_XHTTPERROR_ERROR_NOREPORT); exit(); } - if (XhttperrorRequest::getBool('ok', false, 'POST') == true) { + if (XoopsRequest::getBool('ok', false, 'POST') == true) { if (!$GLOBALS['xoopsSecurity']->check()) { redirect_header($currentFile, 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); } Deleted: XoopsModules/xhttperror/branches/luciorota/xhttperror/class/request.php =================================================================== --- XoopsModules/xhttperror/branches/luciorota/xhttperror/class/request.php 2014-11-26 07:33:36 UTC (rev 12873) +++ XoopsModules/xhttperror/branches/luciorota/xhttperror/class/request.php 2014-11-26 21:38:33 UTC (rev 12874) @@ -1,1015 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ -/** - * xhttperrorRequestRequest class - * - * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. - * @license GNU/GPL, see LICENSE.php - * Joomla! is free software. This version may have been modified pursuant - * to the GNU General Public License, and as distributed it includes or - * is derivative of works licensed under the GNU General Public License or - * other free or open source software licenses. - * See COPYRIGHT.php for copyright notices and details. - * @package xhttperror - * @since 1.01 - * @author Lucio Rota <luc...@gm...> - * @author trabis <lus...@gm...> - * @version svn:$id$ - */ - -/** - * Set the available masks for cleaning variables - */ -define('XHTTPERROR_REQUEST_NOTRIM', 1); -define('XHTTPERROR_REQUEST_ALLOWRAW', 2); -define('XHTTPERROR_REQUEST_ALLOWHTML', 4); - -/** - * xhttperrorRequest Class - * This class serves to provide a common interface to access - * request variables. This includes $_POST, $_GET, and naturally $_REQUEST. Variables - * can be passed through an input filter to avoid injection or returned raw. - */ -class xhttperrorRequest -{ - - /** - * Gets the request method - * - * @return string - */ - static function getMethod() - { - $method = strtoupper($_SERVER['REQUEST_METHOD']); - - return $method; - } - - /** - * Fetches and returns a given variable. - * The default behaviour is fetching variables depending on the - * current request method: GET and HEAD will result in returning - * an entry from $_GET, POST and PUT will result in returning an - * entry from $_POST. - * You can force the source by setting the $hash parameter: - * post $_POST - * get $_GET - * files $_FILES - * cookie $_COOKIE - * env $_ENV - * server $_SERVER - * method via current $_SERVER['REQUEST_METHOD'] - * default $_REQUEST - * - * @static - * - * @param string $name Variable name - * @param string $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * @param string $type Return type for the variable, for valid values see {@link JFilterInput::clean()} - * @param int $mask Filter mask for the variable - * - * @return mixed Requested variable - */ - static function getVar($name, $default = null, $hash = 'default', $type = 'none', $mask = 0) - { - // Ensure hash and type are uppercase - $hash = strtoupper($hash); - if ($hash === 'METHOD') { - $hash = strtoupper($_SERVER['REQUEST_METHOD']); - } - $type = strtoupper($type); - // Get the input hash - switch ($hash) { - case 'GET' : - $input = &$_GET; - break; - case 'POST' : - $input = &$_POST; - break; - case 'FILES' : - $input = &$_FILES; - break; - case 'COOKIE' : - $input = &$_COOKIE; - break; - case 'ENV' : - $input = &$_ENV; - break; - case 'SERVER' : - $input = &$_SERVER; - break; - default: - $input = &$_REQUEST; - $hash = 'REQUEST'; - break; - } - if (isset($input[$name]) && $input[$name] !== null) { - // Get the variable from the input hash and clean it - $var = xhttperrorRequest::_cleanVar($input[$name], $mask, $type); - // Handle magic quotes compatability - if (get_magic_quotes_gpc() && ($var != $default) && ($hash != 'FILES')) { - $var = xhttperrorRequest::_stripSlashesRecursive($var); - } - } elseif ($default !== null) { - // Clean the default value - $var = xhttperrorRequest::_cleanVar($default, $mask, $type); - } else { - $var = $default; - } - - return $var; - } - - /** - * Fetches and returns a given filtered variable. The integer - * filter will allow only digits to be returned. This is currently - * only a proxy function for getVar(). - * See getVar() for more in-depth documentation on the parameters. - * - * @static - * - * @param string $name Variable name - * @param int $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * - * @return integer Requested variable - */ - static function getInt($name, $default = 0, $hash = 'default') - { - return xhttperrorRequest::getVar($name, $default, $hash, 'int'); - } - - /** - * Fetches and returns a given filtered variable. The float - * filter only allows digits and periods. This is currently - * only a proxy function for getVar(). - * See getVar() for more in-depth documentation on the parameters. - * - * @static - * - * @param string $name Variable name - * @param float $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * - * @return float Requested variable - */ - static function getFloat($name, $default = 0.0, $hash = 'default') - { - return xhttperrorRequest::getVar($name, $default, $hash, 'float'); - } - - /** - * Fetches and returns a given filtered variable. The bool - * filter will only return true/false bool values. This is - * currently only a proxy function for getVar(). - * See getVar() for more in-depth documentation on the parameters. - * - * @static - * - * @param string $name Variable name - * @param bool $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * - * @return bool Requested variable - */ - static function getBool($name, $default = false, $hash = 'default') - { - return xhttperrorRequest::getVar($name, $default, $hash, 'bool'); - } - - /** - * Fetches and returns a given filtered variable. The word - * filter only allows the characters [A-Za-z_]. This is currently - * only a proxy function for getVar(). - * See getVar() for more in-depth documentation on the parameters. - * - * @static - * - * @param string $name Variable name - * @param string $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * - * @return string Requested variable - */ - static function getWord($name, $default = '', $hash = 'default') - { - return xhttperrorRequest::getVar($name, $default, $hash, 'word'); - } - - /** - * Fetches and returns a given filtered variable. The cmd - * filter only allows the characters [A-Za-z0-9.-_]. This is - * currently only a proxy function for getVar(). - * See getVar() for more in-depth documentation on the parameters. - * - * @static - * - * @param string $name Variable name - * @param string $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * - * @return string Requested variable - */ - static function getCmd($name, $default = '', $hash = 'default') - { - return xhttperrorRequest::getVar($name, $default, $hash, 'cmd'); - } - - /** - * Fetches and returns a given filtered variable. The string - * filter deletes 'bad' HTML code, if not overridden by the mask. - * This is currently only a proxy function for getVar(). - * See getVar() for more in-depth documentation on the parameters. - * - * @static - * - * @param string $name Variable name - * @param string $default Default value if the variable does not exist - * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD) - * @param int $mask Filter mask for the variable - * - * @return string Requested variable - */ - static function getString($name, $default = '', $hash = 'default', $mask = 0) - { - // Cast to string, in case JREQUEST_ALLOWRAW was specified for mask - return (string)xhttperrorRequest::getVar($name, $default, $hash, 'string', $mask); - } - - /** - * @param $name - * @param array $default - * @param string $hash - * - * @return mixed - */ - static function getArray($name, $default = array(), $hash = 'default') - { - return xhttperrorRequest::getVar($name, $default, $hash, 'array'); - } - - /** - * @param $name - * @param string $default - * @param string $hash - * - * @return string - */ - static function getText($name, $default = '', $hash = 'default') - { - return (string)xhttperrorRequest::getVar($name, $default, $hash, 'string', PUBLISHER_REQUEST_ALLOWRAW); - } - - /** - * Set a variabe in on of the request variables - * - * @access public - * - * @param string $name Name - * @param string $value Value - * @param string $hash Hash - * @param boolean $overwrite Boolean - * - * @return string Previous value - */ - static function setVar($name, $value = null, $hash = 'method', $overwrite = true) - { - //If overwrite is true, makes sure the variable hasn't been set yet - if (!$overwrite && array_key_exists($name, $_REQUEST)) { - return $_REQUEST[$name]; - } - // Get the request hash value - $hash = strtoupper($hash); - if ($hash === 'METHOD') { - $hash = strtoupper($_SERVER['REQUEST_METHOD']); - } - $previous = array_key_exists($name, $_REQUEST) ? $_REQUEST[$name] : null; - switch ($hash) { - case 'GET' : - $_GET[$name] = $value; - $_REQUEST[$name] = $value; - break; - case 'POST' : - $_POST[$name] = $value; - $_REQUEST[$name] = $value; - break; - case 'COOKIE' : - $_COOKIE[$name] = $value; - $_REQUEST[$name] = $value; - break; - case 'FILES' : - $_FILES[$name] = $value; - break; - case 'ENV' : - $_ENV['name'] = $value; - break; - case 'SERVER' : - $_SERVER['name'] = $value; - break; - } - - return $previous; - } - - /** - * Fetches and returns a request array. - * The default behaviour is fetching variables depending on the - * current request method: GET and HEAD will result in returning - * $_GET, POST and PUT will result in returning $_POST. - * You can force the source by setting the $hash parameter: - * post $_POST - * get $_GET - * files $_FILES - * cookie $_COOKIE - * env $_ENV - * server $_SERVER - * method via current $_SERVER['REQUEST_METHOD'] - * default $_REQUEST - * - * @static - * - * @param string $hash to get (POST, GET, FILES, METHOD) - * @param int $mask Filter mask for the variable - * - * @return mixed Request hash - */ - static function get($hash = 'default', $mask = 0) - { - $hash = strtoupper($hash); - if ($hash === 'METHOD') { - $hash = strtoupper($_SERVER['REQUEST_METHOD']); - } - switch ($hash) { - case 'GET' : - $input = $_GET; - break; - case 'POST' : - $input = $_POST; - break; - case 'FILES' : - $input = $_FILES; - break; - case 'COOKIE' : - $input = $_COOKIE; - break; - case 'ENV' : - $input = &$_ENV; - break; - case 'SERVER' : - $input = &$_SERVER; - break; - default: - $input = $_REQUEST; - break; - } - $result = xhttperrorRequest::_cleanVar($input, $mask); - // Handle magic quotes compatability - if (get_magic_quotes_gpc() && ($hash != 'FILES')) { - $result = xhttperrorRequest::_stripSlashesRecursive($result); - } - - return $result; - } - - /** - * Sets a request variable - * - * @param array $array An associative array of key-value pairs - * @param string $hash The request variable to set (POST, GET, FILES, METHOD) - * @param boolean $overwrite If true and an existing key is found, the value is overwritten, otherwise it is ingored - */ - static function set($array, $hash = 'default', $overwrite = true) - { - foreach ($array as $key => $value) { - xhttperrorRequest::setVar($key, $value, $hash, $overwrite); - } - } - - /** - * Cleans the request from script injection. - * - * @static - * @return void - */ - static function clean() - { - xhttperrorRequest::_cleanArray($_FILES); - xhttperrorRequest::_cleanArray($_ENV); - xhttperrorRequest::_cleanArray($_GET); - xhttperrorRequest::_cleanArray($_POST); - xhttperrorRequest::_cleanArray($_COOKIE); - xhttperrorRequest::_cleanArray($_SERVER); - if (isset($_SESSION)) { - xhttperrorRequest::_cleanArray($_SESSION); - } - $REQUEST = $_REQUEST; - $GET = $_GET; - $POST = $_POST; - $COOKIE = $_COOKIE; - $FILES = $_FILES; - $ENV = $_ENV; - $SERVER = $_SERVER; - if (isset ($_SESSION)) { - $SESSION = $_SESSION; - } - foreach ($GLOBALS as $key => $value) { - if ($key != 'GLOBALS') { - unset($GLOBALS[$key]); - } - } - $_REQUEST = $REQUEST; - $_GET = $GET; - $_POST = $POST; - $_COOKIE = $COOKIE; - $_FILES = $FILES; - $_ENV = $ENV; - $_SERVER = $SERVER; - if (isset($SESSION)) { - $_SESSION = $SESSION; - } - } - - /** - * Adds an array to the GLOBALS array and checks that the GLOBALS variable is not being attacked - * - * @access protected - * - * @param array $array Array to clean - * @param boolean $globalise True if the array is to be added to the GLOBALS - */ - static function _cleanArray(&$array, $globalise = false) - { - static $banned = array('_files', '_env', '_get', '_post', '_cookie', '_server', '_session', 'globals'); - foreach ($array as $key => $value) { - // PHP GLOBALS injection bug - $failed = in_array(strtolower($key), $banned); - // PHP Zend_Hash_Del_Key_Or_Index bug - $failed |= is_numeric($key); - if ($failed) { - exit('Illegal variable <strong>' . implode('</strong> or <strong>', $banned) . '</strong> passed to script.'); - } - if ($globalise) { - $GLOBALS[$key] = $value; - } - } - } - - /** - * Clean up an input variable. - * - * @param mixed $var The input variable. - * @param int $mask Filter bit mask. 1=no trim: If this flag is cleared and the - * input is a string, the string will have leading and trailing whitespace - * trimmed. 2=allow_raw: If set, no more filtering is performed, higher bits - * are ignored. 4=allow_html: HTML is allowed, but passed through a safe - * HTML filter first. If set, no more filtering is performed. If no bits - * other than the 1 bit is set, a strict filter is applied. - * @param string $type The variable type {@see JFilterInput::clean()}. - * - * @return string - */ - static function _cleanVar($var, $mask = 0, $type = null) - { - // Static input filters for specific settings - static $noHtmlFilter = null; - static $safeHtmlFilter = null; - // If the no trim flag is not set, trim the variable - if (!($mask & 1) && is_string($var)) { - $var = trim($var); - } - // Now we handle input filtering - if ($mask & 2) { - // If the allow raw flag is set, do not modify the variable - } elseif ($mask & 4) { - // If the allow html flag is set, apply a safe html filter to the variable - if (is_null($safeHtmlFilter)) { - $safeHtmlFilter = xhttperror::getInstance(null, null, 1, 1); - } - $var = $safeHtmlFilter->clean($var, $type); - } else { - // Since no allow flags were set, we will apply the most strict filter to the variable - if (is_null($noHtmlFilter)) { - $noHtmlFilter = xhttperror::getInstance( /* $tags, $attr, $tag_method, $attr_method, $xss_auto */); - } - $var = $noHtmlFilter->clean($var, $type); - } - - return $var; - } - - /** - * Strips slashes recursively on an array - * - * @access protected - * - * @param array $value Array of (nested arrays of) strings - * - * @return array|string The input array with stripshlashes applied to it - */ - protected function _stripSlashesRecursive($value) - { - $value = is_array($value) ? array_map(array('xhttperrorRequest', '_stripSlashesRecursive'), $value) : stripslashes($value); - - return $value; - } -} - -/** - * xhttperrorInput is a class for filtering input from any data source - * Forked from the php input filter library by: Daniel Morris <da...@ro...> - * Original Contributors: Gianpaolo Racca, Ghislain Picard, Marco Wandschneider, Chris Tobin and Andrew Eddie. - * - * @author Louis Landry <lou...@jo...> - */ -class xhttperror -{ - var $tagsArray; // default = empty array - var $attrArray; // default = empty array - var $tagsMethod; // default = 0 - var $attrMethod; // default = 0 - var $xssAuto; // default = 1 - var $tagBlacklist - = array( - 'applet', - 'body', - 'bgsound', - 'base', - 'basefont', - 'embed', - 'frame', - 'frameset', - 'head', - 'html', - 'id', - 'iframe', - 'ilayer', - 'layer', - 'link', - 'meta', - 'name', - 'object', - 'script', - 'style', - 'title', - 'xml' - ); - var $attrBlacklist = array('action', 'background', 'codebase', 'dynsrc', 'lowsrc'); // also will strip ALL event handlers - - /** - * Constructor for inputFilter class. Only first parameter is required. - * - * @access protected - * - * @param array $tagsArray list of user-defined tags - * @param array $attrArray list of user-defined attributes - * @param int $tagsMethod WhiteList method = 0, BlackList method = 1 - * @param int $attrMethod WhiteList method = 0, BlackList method = 1 - * @param int $xssAuto Only auto clean essentials = 0, Allow clean blacklisted tags/attr = 1 - */ - public function __construct($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1) - { - // Make sure user defined arrays are in lowercase - $tagsArray = array_map('strtolower', (array)$tagsArray); - $attrArray = array_map('strtolower', (array)$attrArray); - // Assign member variables - $this->tagsArray = $tagsArray; - $this->attrArray = $attrArray; - $this->tagsMethod = $tagsMethod; - $this->attrMethod = $attrMethod; - $this->xssAuto = $xssAuto; - } - - /** - * Returns a reference to an input filter object, only creating it if it doesn't already exist. - * This method must be invoked as: - * <pre> $filter = & xhttperror::getInstance();</pre> - * - * @static - * - * @param array $tagsArray list of user-defined tags - * @param array $attrArray list of user-defined attributes - * @param int $tagsMethod WhiteList method = 0, BlackList method = 1 - * @param int $attrMethod WhiteList method = 0, BlackList method = 1 - * @param int $xssAuto Only auto clean essentials = 0, Allow clean blacklisted tags/attr = 1 - * - * @return object The xhttperror object. - * @since 1.5 - */ - public static function & getInstance($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1) - { - static $instances; - $sig = md5(serialize(array($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto))); - if (!isset ($instances)) { - $instances = array(); - } - if (empty ($instances[$sig])) { - $instances[$sig] = new xhttperror($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto); - } - - return $instances[$sig]; - } - - /** - * Method to be called by another php script. Processes for XSS and - * specified bad code. - * - * @access public - * - * @param mixed $source Input string/array-of-string to be 'cleaned' - * @param string $type Return type for the variable (INT, FLOAT, BOOLEAN, WORD, ALNUM, CMD, BASE64, STRING, ARRAY, PATH, NONE) - * - * @return mixed 'Cleaned' version of input parameter - * @static - */ - public function clean($source, $type = 'string') - { - // Handle the type constraint - switch (strtoupper($type)) { - case 'INT' : - case 'INTEGER' : - // Only use the first integer value - preg_match('/-?[0-9]+/', (string)$source, $matches); - $result = @ (int)$matches[0]; - break; - case 'FLOAT' : - case 'DOUBLE' : - // Only use the first floating point value - preg_match('/-?[0-9]+(\.[0-9]+)?/', (string)$source, $matches); - $result = @ (float)$matches[0]; - break; - case 'BOOL' : - case 'BOOLEAN' : - $result = (bool)$source; - break; - case 'WORD' : - $result = (string)preg_replace('/[^A-Z_]/i', '', $source); - break; - case 'ALNUM' : - $result = (string)preg_replace('/[^A-Z0-9]/i', '', $source); - break; - case 'CMD' : - $result = (string)preg_replace('/[^A-Z0-9_\.-]/i', '', $source); - $result = ltrim($result, '.'); - break; - case 'BASE64' : - $result = (string)preg_replace('/[^A-Z0-9\/+=]/i', '', $source); - break; - case 'STRING' : - // Check for static usage and assign $filter the proper variable - if (isset($this) && is_a($this, 'xhttperror')) { - $filter =& $this; - } else { - $filter = xhttperror::getInstance(); - } - $result = (string)$filter->_remove($filter->_decode((string)$source)); - break; - case 'ARRAY' : - // If $source is not an array - $result = (is_array($source)) ? (array)$source : array($source); - break; - case 'PATH' : - $pattern = '/^[A-Za-z0-9_-]+[A-Za-z0-9_\.-]*([\\\\\/][A-Za-z0-9_-]+[A-Za-z0-9_\.-]*)*$/'; - preg_match($pattern, (string)$source, $matches); - $result = @ (string)$matches[0]; - break; - case 'USERNAME' : - $result = (string)preg_replace('/[\x00-\x1F\x7F<>"\'%&]/', '', $source); - break; - default : - // Check for static usage and assign $filter the proper variable - if (is_object($this) && get_class($this) == 'xhttperror') { - $filter =& $this; - } else { - $filter = xhttperror::getInstance(); - } - // Are we dealing with an array? - if (is_array($source)) { - foreach ($source as $key => $value) { - // filter element for XSS and other 'bad' code etc. - if (is_string($value)) { - $source[$key] = $filter->_remove($filter->_decode($value)); - } - } - $result = $source; - } else { - // Or a string? - if (is_string($source) && !empty ($source)) { - // filter source for XSS and other 'bad' code etc. - $result = $filter->_remove($filter->_decode($source)); - } else { - // Not an array or string.. return the passed parameter - $result = $source; - } - } - break; - } - - return $result; - } - - /** - * Function to determine if contents of an attribute is safe - * - * @static - * - * @param array $attrSubSet A 2 element array for attributes name,value - * - * @return boolean True if bad code is detected - */ - public function checkAttribute($attrSubSet) - { - $attrSubSet[0] = strtolower($attrSubSet[0]); - $attrSubSet[1] = strtolower($attrSubSet[1]); - - return (((strpos($attrSubSet[1], 'expression') !== false) && ($attrSubSet[0]) == 'style') || (strpos($attrSubSet[1], 'javascript:') !== false) - || (strpos($attrSubSet[1], 'behaviour:') !== false) - || (strpos($attrSubSet[1], 'vbscript:') !== false) - || (strpos($attrSubSet[1], 'mocha:') !== false) - || (strpos($attrSubSet[1], 'livescript:') !== false)); - } - - /** - * Internal method to iteratively remove all unwanted tags and attributes - * - * @access protected - * - * @param string $source Input string to be 'cleaned' - * - * @return string 'Cleaned' version of input parameter - */ - protected function _remove($source) - { - $loopCounter = 0; - // Iteration provides nested tag protection - while ($source != $this->_cleanTags($source)) { - $source = $this->_cleanTags($source); - ++$loopCounter; - } - - return $source; - } - - /** - * Internal method to strip a string of certain tags - * - * @access protected - * - * @param string $source Input string to be 'cleaned' - * - * @return string 'Cleaned' version of input parameter - */ - protected function _cleanTags($source) - { - /* - * In the beginning we don't really have a tag, so everything is - * postTag - */ - $preTag = null; - $postTag = $source; - // Is there a tag? If so it will certainly start with a '<' - $tagOpen_start = strpos($source, '<'); - while ($tagOpen_start !== false) { - // Get some information about the tag we are processing - $preTag .= substr($postTag, 0, $tagOpen_start); - $postTag = substr($postTag, $tagOpen_start); - $fromTagOpen = substr($postTag, 1); - $tagOpen_end = strpos($fromTagOpen, '>'); - // Let's catch any non-terminated tags and skip over them - if ($tagOpen_end === false) { - $postTag = substr($postTag, $tagOpen_start + 1); - $tagOpen_start = strpos($postTag, '<'); - continue; - } - // Do we have a nested tag? - $tagOpen_nested = strpos($fromTagOpen, '<'); - if (($tagOpen_nested !== false) && ($tagOpen_nested < $tagOpen_end)) { - $preTag .= substr($postTag, 0, ($tagOpen_nested + 1)); - $postTag = substr($postTag, ($tagOpen_nested + 1)); - $tagOpen_start = strpos($postTag, '<'); - continue; - } - // Lets get some information about our tag and setup attribute pairs - $currentTag = substr($fromTagOpen, 0, $tagOpen_end); - $tagLength = strlen($currentTag); - $tagLeft = $currentTag; - $attrSet = array(); - $currentSpace = strpos($tagLeft, ' '); - // Are we an open tag or a close tag? - if (substr($currentTag, 0, 1) == '/') { - // Close Tag - $isCloseTag = true; - list ($tagName) = explode(' ', $currentTag); - $tagName = substr($tagName, 1); - } else { - // Open Tag - $isCloseTag = false; - list ($tagName) = explode(' ', $currentTag); - } - /* - * Exclude all "non-regular" tagnames - * OR no tagname - * OR remove if xssauto is on and tag is blacklisted - */ - if ((!preg_match("/^[a-z][a-z0-9]*$/i", $tagName)) || (!$tagName) - || ((in_array(strtolower($tagName), $this->tagBlacklist)) - && ($this->xssAuto)) - ) { - $postTag = substr($postTag, ($tagLength + 2)); - $tagOpen_start = strpos($postTag, '<'); - // Strip tag - continue; - } - /* - * Time to grab any attributes from the tag... need this section in - * case attributes have spaces in the values. - */ - while ($currentSpace !== false) { - $attr = ''; - $fromSpace = substr($tagLeft, ($currentSpace + 1)); - $nextSpace = strpos($fromSpace, ' '); - $openQuotes = strpos($fromSpace, '"'); - $closeQuotes = strpos(substr($fromSpace, ($openQuotes + 1)), '"') + $openQuotes + 1; - // Do we have an attribute to process? [check for equal sign] - if (strpos($fromSpace, '=') !== false) { - /* - * If the attribute value is wrapped in quotes we need to - * grab the substring from the closing quote, otherwise grab - * till the next space - */ - if (($openQuotes !== false) && (strpos(substr($fromSpace, ($openQuotes + 1)), '"') !== false)) { - $attr = substr($fromSpace, 0, ($closeQuotes + 1)); - } else { - $attr = substr($fromSpace, 0, $nextSpace); - } - } else { - /* - * No more equal signs so add any extra text in the tag into - * the attribute array [eg. checked] - */ - if ($fromSpace != '/') { - $attr = substr($fromSpace, 0, $nextSpace); - } - } - // Last Attribute Pair - if (!$attr && $fromSpace != '/') { - $attr = $fromSpace; - } - // Add attribute pair to the attribute array - $attrSet[] = $attr; - // Move search point and continue iteration - $tagLeft = substr($fromSpace, strlen($attr)); - $currentSpace = strpos($tagLeft, ' '); - } - // Is our tag in the user input array? - $tagFound = in_array(strtolower($tagName), $this->tagsArray); - // If the tag is allowed lets append it to the output string - if ((!$tagFound && $this->tagsMethod) || ($tagFound && !$this->tagsMethod)) { - // Reconstruct tag with allowed attributes - if (!$isCloseTag) { - // Open or Single tag - $attrSet = $this->_cleanAttributes($attrSet); - $preTag .= '<' . $tagName; - for ($i = 0; $i < count($attrSet); ++$i) { - $preTag .= ' ' . $attrSet[$i]; - } - // Reformat single tags to XHTML - if (strpos($fromTagOpen, '</' . $tagName)) { - $preTag .= '>'; - } else { - $preTag .= ' />'; - } - } else { - // Closing Tag - $preTag .= '</' . $tagName . '>'; - } - } - // Find next tag's start and continue iteration - $postTag = substr($postTag, ($tagLength + 2)); - $tagOpen_start = strpos($postTag, '<'); - } - // Append any code after the end of tags and return - if ($postTag != '<') { - $preTag .= $postTag; - } - - return $preTag; - } - - /** - * Internal method to strip a tag of certain attributes - * - * @access protected - * - * @param array $attrSet Array of attribute pairs to filter - * - * @return array Filtered array of attribute pairs - */ - protected function _cleanAttributes($attrSet) - { - // Initialize variables - $newSet = array(); - // Iterate through attribute pairs - for ($i = 0; $i < count($attrSet); ++$i) { - // Skip blank spaces - if (!$attrSet[$i]) { - continue; - } - // Split into name/value pairs - $attrSubSet = explode('=', trim($attrSet[$i]), 2); - list ($attrSubSet[0]) = explode(' ', $attrSubSet[0]); - /* - * Remove all "non-regular" attribute names - * AND blacklisted attributes - */ - if ((!preg_match('/[a-z]*$/i', $attrSubSet[0])) - || (($this->xssAuto) - && ((in_array(strtolower($attrSubSet[0]), $this->attrBlacklist)) - || (substr($attrSubSet[0], 0, 2) == 'on'))) - ) { - continue; - } - // XSS attribute value filtering - if ($attrSubSet[1]) { - // strips unicode, hex, etc - $attrSubSet[1] = str_replace('&#', '', $attrSubSet[1]); - // strip normal newline within attr value - $attrSubSet[1] = preg_replace('/[\n\r]/', '', $attrSubSet[1]); - // strip double quotes - $attrSubSet[1] = str_replace('"', '', $attrSubSet[1]); - // convert single quotes from either side to doubles (Single quotes shouldn't be used to pad attr value) - if ((substr($attrSubSet[1], 0, 1) == "'") && (substr($attrSubSet[1], (strlen($attrSubSet[1]) - 1), 1) == "'")) { - $attrSubSet[1] = substr($attrSubSet[1], 1, (strlen($attrSubSet[1]) - 2)); - } - // strip slashes - $attrSubSet[1] = stripslashes($attrSubSet[1]); - } - // Autostrip script tags - if (xhttperror::checkAttribute($attrSubSet)) { - continue; - } - // Is our attribute in the user input array? - $attrFound = in_array(strtolower($attrSubSet[0]), $this->attrArray); - // If the tag is allowed lets keep it - if ((!$attrFound && $this->attrMethod) || ($attrFound && !$this->attrMethod)) { - // Does the attribute have a value? - if ($attrSubSet[1]) { - $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[1] . '"'; - } elseif ($attrSubSet[1] == "0") { - /* - * Special Case - * Is the value 0? - */ - $newSet[] = $attrSubSet[0] . '="0"'; - } else { - $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[0] . '"'; - } - } - } - - return $newSet; - } - - /** - * Try to convert to plaintext - * - * @access protected - * - * @param string $source - * - * @return string Plaintext string - */ - protected function _decode($source) - { - // entity decode - $trans_tbl = get_html_translation_table(HTML_ENTITIES); - foreach ($trans_tbl as $k => $v) { - $ttr[$v] = utf8_encode($k); - } - $source = strtr($source, $ttr); - // convert decimal - //$source = preg_replace('/&#(\d+);/me', "chr(\\1)", $source); // decimal notation - //TODO swich to this once we have PHP 5.3 as minimum -// $source = preg_replace_callback('/&#(\d+);/m', function($m) {return chr($m[1]);}, $source); // decimal notation - $source = preg_replace_callback('/&#(\d+);/m', create_function('$matches', "return chr(\$matches[1]);"), $source); // decimal notation - // convert hex - //$source = preg_replace('/&#x([a-f0-9]+);/mei', "chr(0x\\1)", $source); // hex notation - //TODO swich to this once we have PHP 5.3 as minimum -// $source = preg_replace_callback('/&#x([a-f0-9]+);/mi', function($m) {return chr(hexdec($m[1]));}, $source); // hex notation - $source = preg_replace_callback( - '/&#x([a-f0-9]+);/mi', - create_function('$matches', "return chr('0x'.\$matches[1]);"), - $source - ); // hex notation - - return $source; - } -} Modified: XoopsModules/xhttperror/branches/luciorota/xhttperror/docs/changelog.txt =================================================================== --- XoopsModules/xhttperror/branches/luciorota/xhttperror/docs/changelog.txt 2014-11-26 07:33:36 UTC (rev 12873) +++ XoopsModules/xhttperror/branches/luciorota/xhttperror/docs/changelog.txt 2014-11-26 21:38:33 UTC (rev 12874) @@ -6,9 +6,10 @@ ! Bug fix. o General comment. -version 1.01 (Released: 2014/11/07) +version 1.01 (Released: 2014/11/26) =================================== + delete multiple reports. +o Use native XoopsRequest (mamba) o Upgraded to Xoops 2.5.7 coding standard. o Refactory all language definitions ! store wrong requested uri in reports (REDIRECT_URL, REDIRECT_QUERY_STRING) Modified: XoopsModules/xhttperror/branches/luciorota/xhttperror/include/common.php =================================================================== --- XoopsModules/xhttperror/branches/luciorota/xhttperror/include/common.php 2014-11-26 07:33:36 UTC (rev 12873) +++ XoopsModules/xhttperror/branches/luciorota/xhttperror/include/common.php 2014-11-26 21:38:33 UTC (rev 12874) @@ -37,7 +37,6 @@ include_once XHTTPERROR_ROOT_PATH . '/class/session.php'; // XhttperrorSession class include_once XHTTPERROR_ROOT_PATH . '/class/xhttperror.php'; // XhttperrorXhttperror class -include_once XHTTPERROR_ROOT_PATH . '/class/request.php'; // XhttperrorRequest class xoops_load('XoopsUserUtility'); xoops_load('XoopsLocal'); Modified: XoopsModules/xhttperror/branches/luciorota/xhttperror/xoops_version.php =================================================================== --- XoopsModules/xhttperror/branches/luciorota/xhttperror/xoops_version.php 2014-11-26 07:33:36 UTC (rev 12873) +++ XoopsModules/xhttperror/branches/luciorota/xhttperror/xoops_version.php 2014-11-26 21:38:33 UTC (rev 12874) @@ -41,11 +41,11 @@ // About $modversion['module_status'] = 'RC1'; -$modversion['release_date'] = '2014/11/07'; // YYYY/mm/dd +$modversion['release_date'] = '2014/11/26'; // YYYY/mm/dd $modversion['module_website_url'] = 'http://www.xoops.org/'; $modversion['module_website_name'] = 'XOOPS'; $modversion['min_php'] = '5.3.7'; -$modversion['min_xoops'] = '2.5.7'; +$modversion['min_xoops'] = '2.5.7.1'; $modversion['min_admin'] = '1.1'; $modversion['min_db'] = array( 'mysql' => '5.0.7', |
From: <zy...@us...> - 2014-11-26 07:33:46
|
Revision: 12873 http://sourceforge.net/p/xoops/svn/12873 Author: zyspec Date: 2014-11-26 07:33:36 +0000 (Wed, 26 Nov 2014) Log Message: ----------- - commit files missing in previous commit Modified Paths: -------------- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/log.php Added Paths: ----------- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/index.html XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/stats.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/class/formvalidatedinput.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/waiting.plugin.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/blocks.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/help/module_index.html XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/waiting.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/blocks/ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/blocks/contact_block_stats.tpl XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/blocks/index.html Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/log.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/log.php 2014-11-26 07:12:14 UTC (rev 12872) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/log.php 2014-11-26 07:33:36 UTC (rev 12873) @@ -75,7 +75,7 @@ $column = $contact_handler->contactCleanVars($_POST, 'column', 'contact_mail', 'string'); $valid_column = in_array(trim($column), array('contact_icq', 'contact_mail', 'contact_phone', 'contact_url')); $column = ($valid_column) ? trim($column) : 'contact_mail'; - $timestamp = $contact_handler->contactCleanVars($_POST, 'timestamp', formatTimestamp(xoops_getUserTimestamp(time()), _SHORTDATESTRING), 'string'); + $timestamp = $contact_handler->contactCleanVars($_POST, 'timestamp', formatTimestamp(xoops_getUserTimestamp(time()), 's'), 'string'); $log = $contact_handler->contactLogs($column, $timestamp); /* $timestamp = $contact_handler->contactCleanVars($_POST, 'timestamp', xoops_getUserTimestamp(time()), 'date'); Added: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/index.html =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/index.html (rev 0) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/index.html 2014-11-26 07:33:36 UTC (rev 12873) @@ -0,0 +1 @@ +<script>history.go(-1);</script> Added: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/stats.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/stats.php (rev 0) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/stats.php 2014-11-26 07:33:36 UTC (rev 12873) @@ -0,0 +1,80 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ +/** + * Contact stats.php + * + * Xoops Contact - a database driven Contact form + * Displays contact statistics in a block. + * + * @copyright:: {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license:: {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @package:: contact + * @subpackage:: blocks + * @author:: zyspec <owners@zyspec> + * @version:: $Id: $ + * @since:: 1.82 + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +/** + * + * Show Contact Us stats block + * + * @uses xoops_getmodulehandler + * @uses CriteriaCompo + * @uses ContactContact + * @uses ContactContactHandler + * @param array $options + * + * @return array with count of noreplies, replies & total + */ +function b_contact_stats_show($options) +{ + $dirname = basename(dirname(__DIR__)); + + $block = array(); + + $contact_handler =& xoops_getmodulehandler('contact', $dirname); + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('contact_cid', 0)); + $criteria->add(new Criteria('contact_type', 'Contact')); + $criteria->setGroupby('contact_reply'); + $msgCountArray = $contact_handler->getCounts($criteria); + if ((is_array($msgCountArray) && count($msgCountArray) > 0)) { + $block['noreplies'] = (isset($msgCountArray[0])) ? $msgCountArray[0] : 0; + $block[ 'replies'] = (isset($msgCountArray[1])) ? $msgCountArray[1] : 0; + $block[ 'total'] = $block['noreplies'] + $block['replies']; + + // if using departments show number of contacts per department + include_once $GLOBALS['xoops']->path( "modules/{$dirname}/include/functions.php"); +// include_once '../include/functions.php'; + $moduleMgr = contactGetModuleManager(); + if ($moduleMgr->config['form_dept']) { +/* + $module_handler =& xoops_gethandler('module'); + $module =& $module_handler->getByDirname($dirname); + $config_handler =& xoops_gethandler('config'); + $contactConfig =& $config_handler->getConfigsByCat(0, $module->getVar('mid')); + if ($contactConfig['form_dept']) { +*/ + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('contact_cid', 0)); + $criteria->add(new Criteria('contact_type', 'Contact')); + $criteria->setGroupby('contact_department'); + $depts = $contact_handler->getCounts($criteria); + if ((is_array($depts) && count($depts) > 0)) { + $block['depts'] = $depts; + } + } + } + return $block; +} \ No newline at end of file Added: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/class/formvalidatedinput.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/class/formvalidatedinput.php (rev 0) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/class/formvalidatedinput.php 2014-11-26 07:33:36 UTC (rev 12873) @@ -0,0 +1,143 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/** + * Contact form element for form input + * + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU GPL 2} + * @package contact + * @subpackage class + * @since 1.82 + * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/ + * @author ZySpec <ow...@zy...> + * @version $Id: $ + */ + +defined('XOOPS_ROOT_PATH') || die('Restricted access'); + +/** + * A simple HTML5 type validated input field + */ +class ContactFormValidatedInput extends XoopsFormText +{ + + /** + * Initial type + * + * @var string + * @access private + */ + private $_type; + + /** + * Valid HTML Type array + * + * @var string + * @access private + */ + private $_htmlTypes; + + /** + * Constructor + * + * @param string $caption Caption + * @param string $name "name" attribute + * @param int $size Size + * @param int $maxlength Maximum length of text + * @param string $value Initial text + */ + function __construct($caption, $name, $size, $maxlength, $value = '', $type='text') + { + $this->_htmlTypes = array('color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'number', 'range', + 'search', 'tel', 'text', 'time', 'url', 'week'); + $this->setCaption($caption); + $this->setName($name); + $this->_size = intval($size); + $this->_maxlength = intval($maxlength); + $this->setValue($value); + $this->setType($type); + } + + function ContactFormValidatedInput(&$caption, &$name, &$size, &$maxlength, &$value = '', &$type) + { + self::__construct($caption, $name, $size, $maxlength, $value, $type); + } + + /** + * + * XoopsFormText method is included here as an override for the base class (XoopsFormText) + */ + function XoopsFormText(&$caption, &$name, &$size, &$maxlength, $value='') + { + self::__construct($caption, $name, $size, $maxlength, $value, 'text'); + } + + /** + * Get type information value + * + * @return string + */ + function getType() + { + return $this->_type; + } + + /** + * Get HTML types supported + * + * @return array + */ + function getHtmlTypes() + { + return $this->_htmlTypes; + } + + /** + * Set initial text value + * + * @param string|array $value is string, set value; value is array then keys are ('type', 'min', 'max') + */ + function setType($value) + { + if (isset($value)) { + if (is_array($value)) { + $value = isset($value['type']) ? mb_strtolower($value['type']) : 'text'; + $this->_type = in_array($value, $this->_htmlTypes) ? $value : 'text'; + if (in_array($value['type'], array('number', 'date', 'range'))) { + if (isset($value['min'])) { + $this->setExtra("min=" . $value['min']); + } + if (isset($value['max'])) { + $this->setExtra("max=" . $value['max']); + } + } + } else { + $value = isset($value) ? mb_strtolower($value) : 'text'; + $this->_type = in_array($value, $this->_htmlTypes) ? $value : 'text'; + } + } else { + $this->_type = 'text'; + } + } + + /** + * Prepare HTML for output + * + * @return string HTML + */ + function render() + { + $myClasses = $this->getClass(); + $classes = ($myClasses) ? " class='{$myClasses}'" : ""; + return "<input type='" . $this->_type . "' name='" . $this->getName() . "' title='" . $this->getTitle() . "' id='" . $this->getName() . "' size='" . $this->getSize() . "' maxlength='" . $this->getMaxlength() . "' value='" . $this->getValue() . "'" . $classes . $this->getExtra() . " />"; + } +} Added: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/waiting.plugin.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/waiting.plugin.php (rev 0) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/waiting.plugin.php 2014-11-26 07:33:36 UTC (rev 12873) @@ -0,0 +1,51 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ +/** + * Contact - waiting.php + * + * English language defines for Waiting Module support + * + * @copyright:: {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license:: {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @package:: contact + * @subpackage:: plugin + * @author:: XOOPS Module Development Team + * @since:: 1.82 + * @version:: $Id: $ + */ +function b_waiting_contact() +{ +// $contactDB =& XoopsDatabaseFactory::getDatabaseConnection(); + + $block = array(); + + $module_handler =&xoops_gethandler('module'); + $contactModule =&$module_handler->getByDirname('contact'); + $config_handler =& xoops_gethandler('config'); + $contactModuleConfigs =& $config_handler->getConfigsByCat(0, $contactModule->getVar('mid')); + + //check to see if module is active, return if not... + if ($contactModule->isactive()) { + // setup the contact messages + $contact_handler = & xoops_getModuleHandler('contact', 'contact'); + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('contact_cid', 0, '=')); //don't include replies + $criteria->add(new Criteria('contact_reply', 0, '=')); // only include messages that haven't had a reply + $messageCount = $contact_handler->getCount($criteria); + if ($messageCount) { + $block = array('adminlink' => $GLOBALS['xoops']->url("www/modules/contact/admin/contact.php"), + 'pendingnum' => $messageCount, + 'lang_linkname' => _PI_CONTACT_WAITING_REPLY + ); + } + } + return $block; +} Added: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/blocks.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/blocks.php (rev 0) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/blocks.php 2014-11-26 07:33:36 UTC (rev 12873) @@ -0,0 +1,27 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ +/** + * Contact - blocks.php + * + * English language defines for Waiting Module Blocks + * + * @copyright:: {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license:: {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @package:: contact + * @subpackage:: library + * @author:: XOOPS Module Development Team + * @since:: 1.82 + * @version:: $Id: $ + */ +define('_MB_CONTACT_REPLIES', "Replies"); +define('_MB_CONTACT_NOREPLIES', "No Replies"); +define('_MB_CONTACT_TOTAL', "Total"); +define('_MB_CONTACT_BYDEPT', "By Department"); Added: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/help/module_index.html =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/help/module_index.html (rev 0) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/help/module_index.html 2014-11-26 07:33:36 UTC (rev 12873) @@ -0,0 +1,22 @@ +<div id="help-template" class="outer"> + <h1 class="head">Help: + <a class="ui-corner-all tooltip" href="<{$xoops_url}>/modules/contact/admin/index.php" + title="Back to the administration of Contact"> Contact + <img src="<{xoAdminIcons home.png}>" + alt="Back to the Administration of Contact"/> + </a></h1> + + <h4 class="odd">Contact Module</h4> + <p style='margin: 1em 0;'>This module includes the following features:</p> + <ul> + <li style='height: 1.3em;'>Automatically emails contact form to requested contact</li> + <li style='height: 1.3em;'>Allows Administrator to reply to message from module control panel</li> + <li style='height: 1.3em;'>Stores Contact submission in database</li> + <li style='height: 1.3em;'>Allows Administrator to select type of information to collect (URL, Company Name, Location, Address, Phone, etc.) + <li style='height: 1.3em;'>Supports contacting departments</li> + <li style='height: 1.3em;'>Form Captcha based on site settings</li> + <li style='height: 1.3em;'>Ability to require anonymous users to enter email twice on form to ensure it was entered correctly</li> + <li style='height: 1.3em;'>Provides log of users who have filled out Contact form</li> + <li style='height: 1.3em;'>Allows Administrator to prune (delete) messages from the database</li> + </ul> +</div> \ No newline at end of file Added: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/waiting.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/waiting.php (rev 0) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/waiting.php 2014-11-26 07:33:36 UTC (rev 12873) @@ -0,0 +1,24 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ +/** + * Contact - waiting.php + * + * English language defines for Waiting Module support + * + * @copyright:: {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license:: {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @package:: contact + * @subpackage:: library + * @author:: XOOPS Module Development Team + * @since:: 1.82 + * @version:: $Id: $ + */ +define('_PI_CONTACT_WAITING_REPLY', "Waiting Replies"); Added: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/blocks/contact_block_stats.tpl =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/blocks/contact_block_stats.tpl (rev 0) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/blocks/contact_block_stats.tpl 2014-11-26 07:33:36 UTC (rev 12873) @@ -0,0 +1,11 @@ +<ul> +<li><{$block.replies}> : <{$smarty.const._MB_CONTACT_REPLIES}></li> +<li><{$block.noreplies}> : <{$smarty.const._MB_CONTACT_NOREPLIES}></li> +<li><{$block.total}> : <{$smarty.const._MB_CONTACT_TOTAL}></li> +</ul> +<div class='inline bolder'><{$smarty.const._MB_CONTACT_BYDEPT}></div> +<{foreach from=$block.depts key=dept item=qty name=deptlp}> +<{if $smarty.foreach.deptlp.first}><ul><{/if}> +<li><{$dept}> : <{$qty}></li> +<{if $smarty.foreach.deptlp.last}></ul><{/if}> +<{/foreach}> Added: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/blocks/index.html =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/blocks/index.html (rev 0) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/blocks/index.html 2014-11-26 07:33:36 UTC (rev 12873) @@ -0,0 +1 @@ +<script>history.go(-1);</script> |
From: <zy...@us...> - 2014-11-26 07:12:21
|
Revision: 12872 http://sourceforge.net/p/xoops/svn/12872 Author: zyspec Date: 2014-11-26 07:12:14 +0000 (Wed, 26 Nov 2014) Log Message: ----------- - Added ability to require visitors to enter email 2X on form - Added features page to Admin help - Added date select to Admin log form - Added ability to include original message body in Admin Reply - Added mail body formatter to limit line lengths per RFC2822 - Added confirm when pruning contacts in Admin panel - Added Waiting module support - Added Stats block - Added ContactFormValidatedInput class using HTML5 types - Restored capability for Admin to enter the thank you message - Removed ./icons folder/files - admin uses XOOPS module icons - Removed ./docs/readme.html - no longer used and out of date - Fixed bug: Contact->contactPlatform() always returned "Web" - Fixed bug: Contact->contactType() always returned "Contact" - Fixed bug: Contact->infoProcessing always used $_POST - Fixed bug: Admin Prune date parser - Fixed bug: remove slashes from email subject & body - Fixed HTML table missing row tags in Admin - Changed clicking contact URL in Admin to open in _blank window - Changed ./admin/tools.php to prune.php to reflect function - Changed update script to remove "old" directories (css, images, js) - Changed retrieving configs, eliminating deprecated XOOPS functions - Updated documentation files (changelog.txt, readme.txt) - Minor code cleanup Modified Paths: -------------- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/about.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/admin_footer.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/admin_header.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/contact.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/index.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/log.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/menu.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/ajax.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/assets/css/admin.css XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/assets/js/admin.js XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/class/contact.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/docs/changelog.txt XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/docs/install.txt XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/docs/readme.txt XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/header.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/functions.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/functions_update.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/index.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/admin.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/help/help.html XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/main.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/modinfo.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/sql/mysql.sql XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/admin/contact_contact.tpl XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/contact_index.tpl XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/xoops_version.php Added Paths: ----------- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/prune.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/admin/contact_prune.tpl Removed Paths: ------------- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/tools.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/assets/images/icons/ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/docs/readme.html XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/admin/contact_tools.tpl Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/about.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/contact/admin/about.php 2014-10-31 07:13:53 UTC (rev 12828) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/about.php 2014-11-26 07:12:14 UTC (rev 12872) @@ -12,8 +12,9 @@ /** * Contact module * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @package contact * @author Kazumi Ono (aka Onokazu) * @author Trabis <lus...@gm...> * @author Hossein Azizabadi (AKA Voltan) @@ -25,10 +26,10 @@ // Display Admin header xoops_cp_header(); -$xoopsTpl->assign('navigation', $admin_class->addNavigation('about.php')); -$xoopsTpl->assign('renderabout', $admin_class->renderabout('6KJ7RW5DR3VTJ', false)); +$GLOBALS['xoopsTpl']->assign('navigation', $admin_class->addNavigation('about.php')); +$GLOBALS['xoopsTpl']->assign('renderabout', $admin_class->renderabout('6KJ7RW5DR3VTJ', false)); // Call template file -$xoopsTpl->display(XOOPS_ROOT_PATH . '/modules/contact/templates/admin/contact_about.tpl'); +$GLOBALS['xoopsTpl']->display($GLOBALS['xoops']->path('www/modules/contact/templates/admin/contact_about.tpl')); // Call footer require __DIR__ . '/admin_footer.php'; Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/admin_footer.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/contact/admin/admin_footer.php 2014-10-31 07:13:53 UTC (rev 12828) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/admin_footer.php 2014-11-26 07:12:14 UTC (rev 12872) @@ -12,8 +12,10 @@ /** * Contact module * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @package contact + * @subpackage admin * @author Kazumi Ono (aka Onokazu) * @author Trabis <lus...@gm...> * @author Hossein Azizabadi (AKA Voltan) Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/admin_header.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/contact/admin/admin_header.php 2014-10-31 07:13:53 UTC (rev 12828) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/admin_header.php 2014-11-26 07:12:14 UTC (rev 12872) @@ -12,8 +12,10 @@ /** * Contact module * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @package contact + * @subpackage admin * @author Kazumi Ono (aka Onokazu) * @author Trabis <lus...@gm...> * @author Hossein Azizabadi (AKA Voltan) @@ -21,14 +23,12 @@ */ $path = dirname(dirname(dirname(__DIR__))); +require_once $path . '/mainfile.php'; +include_once $GLOBALS['xoops']->path('www/include/cp_functions.php'); +include_once $GLOBALS['xoops']->path('www/include/cp_header.php'); +include_once $GLOBALS['xoops']->path('www/class/pagenav.php'); +include_once $GLOBALS['xoops']->path('www/class/xoopsformloader.php'); -include_once $path . '/mainfile.php'; -include_once XOOPS_ROOT_PATH . '/include/cp_functions.php'; -include_once XOOPS_ROOT_PATH . '/include/cp_header.php'; -include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; -include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; -global $xoopsModule; - $thisModuleDir = $GLOBALS['xoopsModule']->getVar('dirname'); // Load language files @@ -36,11 +36,12 @@ xoops_loadLanguage('modinfo', $thisModuleDir); xoops_loadLanguage('main', $thisModuleDir); -$pathIcon16 = XOOPS_URL . '/' . $xoopsModule->getInfo('icons16'); -$pathIcon32 = XOOPS_URL . '/' . $xoopsModule->getInfo('icons32'); -$pathModuleAdmin = XOOPS_ROOT_PATH . '/' . $xoopsModule->getInfo('dirmoduleadmin'); -require_once $pathModuleAdmin . '/moduleadmin/moduleadmin.php'; +$pathIcon16 = $GLOBALS['xoops']->url('www/' . $GLOBALS['xoopsModule']->getInfo('icons16')); +$pathIcon32 = $GLOBALS['xoops']->url('www/' . $GLOBALS['xoopsModule']->getInfo('icons32')); +$pathModuleAdmin = $GLOBALS['xoops']->path('www/' . $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin')); +require_once "{$pathModuleAdmin}/moduleadmin/moduleadmin.php"; $admin_class = new ModuleAdmin(); -// Contact Handler -$contact_handler = & xoops_getModuleHandler('contact', 'contact'); +// Contact Module specific pieces +include_once $GLOBALS['xoops']->path("/modules/{$thisModuleDir}/include/functions.php"); +$contact_handler =& xoops_getModuleHandler('contact', $thisModuleDir); Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/contact.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/contact/admin/contact.php 2014-10-31 07:13:53 UTC (rev 12828) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/contact.php 2014-11-26 07:12:14 UTC (rev 12872) @@ -12,12 +12,14 @@ /** * Contact module * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @package contact + * @subpackage admin * @author Kazumi Ono (aka Onokazu) * @author Trabis <lus...@gm...> * @author Hossein Azizabadi (AKA Voltan) - * @version $Id$ + * @version $Id: $ */ // Call header @@ -25,182 +27,193 @@ // Display Admin header xoops_cp_header(); // Define default value -$op = $contact_handler->Contact_CleanVars($_REQUEST, 'op', 'list', 'string'); -$contact_id = $contact_handler->Contact_CleanVars($_REQUEST, 'id', '0', 'int'); +$op = $contact_handler->contactCleanVars($_REQUEST, 'op', 'list', 'string'); +$contactId = $contact_handler->contactCleanVars($_REQUEST, 'id', '0', 'int'); +$level = ''; // Define scripts $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js'); $xoTheme->addScript('browse.php?Frameworks/jquery/plugins/jquery.ui.js'); -$xoTheme->addScript(XOOPS_URL . '/modules/contact/assets/js/admin.js'); +$xoTheme->addScript($GLOBALS['xoops']->url('www/modules/contact/assets/js/admin.js')); // Add module stylesheet -$xoTheme->addStylesheet(XOOPS_URL . '/modules/contact/assets/css/admin.css'); -$xoTheme->addStylesheet(XOOPS_URL . '/modules/system/assets/css/ui/' . xoops_getModuleOption('jquery_theme', 'system') . '/ui.all.css'); -$xoTheme->addStylesheet(XOOPS_URL . '/modules/system/assets/css/admin.css'); +$xoTheme->addStylesheet($GLOBALS['xoops']->url('www/modules/contact/assets/css/admin.css')); +//add system module stylesheets +$module_handler =& xoops_gethandler('module'); +$systemModule =& $module_handler->getByDirname('system'); +$config_handler =& xoops_gethandler('config'); +if ($systemModule instanceof XoopsModule) { + $moduleConfig =& $config_handler->getConfigsByCat(0, $systemModule->getVar('mid')); + if (isset($moduleConfig['jquery_theme'])) { + $xoTheme->addStylesheet($GLOBALS['xoops']->url("www/modules/system/css/ui/{$moduleConfig['jquery_theme']}/ui.all.css")); + } +} +$xoTheme->addStylesheet($GLOBALS['xoops']->url('www/modules/system/css/admin.css')); + switch ($op) { case 'list': - $contact = array(); - $contact['perpage'] = xoops_getModuleOption('admin_perpage', 'contact'); - $contact['order'] = 'DESC'; - $contact['sort'] = 'contact_id'; + default: - // get limited information - if (isset($_REQUEST['limit'])) { - $contact['limit'] = $contact_handler->Contact_CleanVars($_REQUEST, 'limit', 0, 'int'); - } else { - $contact['limit'] = $contact['perpage']; - } + $pageSettings = array('perpage' => $GLOBALS['xoopsModuleConfig']['admin_perpage'], + 'order' => 'DESC', + 'sort' => 'contact_id' + ); + $pageSettingsObj = (object) $pageSettings; //cast contact to a stdClass object + $pageSettingsObj->limit = (isset($_REQUEST['limit'])) ? $contact_handler->contactCleanVars($_REQUEST, 'limit', 0, 'int') : $pageSettingsObj->perpage; + $pageSettingsObj->start = (isset($_REQUEST['start'])) ? $contact_handler->contactCleanVars($_REQUEST, 'start', 0, 'int') : 0; - // get start information - if (isset($_REQUEST['start'])) { - $contact['start'] = $contact_handler->Contact_CleanVars($_REQUEST, 'start', 0, 'int'); - } else { - $contact['start'] = 0; - } - $contact_numrows = $contact_handler->Contact_GetCount('contact_cid'); - $contacts = $contact_handler->Contact_GetAdminList($contact, 'contact_cid'); + $contactCount = $contact_handler->contactGetCount('contact_cid'); //count all contacts + $contacts = $contact_handler->getAdminList($pageSettingsObj, 'contact_cid'); - if ($contact_numrows > $contact['limit']) { - $contact_pagenav = new XoopsPageNav($contact_numrows, $contact['limit'], $contact['start'], 'start', 'limit=' . $contact['limit']); - $contact_pagenav = $contact_pagenav->renderNav(4); + if ($contactCount > $pageSettingsObj->limit) { + $contactPageNavObj = new XoopsPageNav($contactCount, $pageSettingsObj->limit, $pageSettingsObj->start, 'start', 'limit=' . $pageSettingsObj->limit); + $contact_pagenav = $contactPageNavObj->renderNav(4); } else { $contact_pagenav = ''; } - $xoopsTpl->assign('contacts', $contacts); - $xoopsTpl->assign('contact_pagenav', $contact_pagenav); + $GLOBALS['xoopsTpl']->assign(array('use_depts' => $GLOBALS['xoopsModuleConfig']['form_dept'] ? 1 : 0, + 'contacts' => $contacts, + 'contact_pagenav' => $contact_pagenav) + ); $level = 'list'; break; case 'reply': - if ($contact_id > 0) { - $obj = $contact_handler->get($contact_id); - if ($obj->getVar('contact_cid') != 0) { - redirect_header('contact.php', 3, _AM_CONTACT_CANTREPLY); + + if ($contactId > 0) { + $obj = $contact_handler->get($contactId); + if (!($obj instanceof contact) || (0 != $obj->getVar('contact_cid'))) { + redirect_header($_SERVER['PHP_SELF'], 3, _AM_CONTACT_REPLY_CANT); } - $form = $obj->Contact_ReplyForm(); - $xoopsTpl->assign('replyform', $form->render()); - $xoopsTpl->assign('replylist', $contact_handler->Contact_GetReply($contact_id)); + + $form = $obj->replyForm(); + $GLOBALS['xoopsTpl']->assign(array('replyform' => $form->render(), + 'replylist' => $contact_handler->contactGetReply($contactId), + 'use_depts' => $GLOBALS['xoopsModuleConfig']['form_dept'] ? 1 : 0, + ) + ); } else { - redirect_header('contact.php', 3, _AM_CONTACT_MSG_EXIST); + redirect_header($_SERVER['PHP_SELF'], 3, _AM_CONTACT_MSG_NOTEXIST); } $level = 'reply'; break; case 'doreply': - // check email - if (!$contact_handler->Contact_CleanVars($_POST, 'contact_mailto', '', 'mail')) { - redirect_header("contact.php", 3, _MD_CONTACT_MES_NOVALIDEMAIL); + $formInput = $contact_handler->infoProcessing($_POST); + $mailObj = (object) $formInput; + unset($formInput); + $deptEmails = array(); + $message = array(); + + // verfiy we're sending to a valid email + if ((!$mailObj->contact_mail || !(checkEmail($mailObj->contact_mail))) && !$GLOBALS['xoopsModuleConfig']['form_dept']) { + redirect_header($_SERVER['PHP_SELF'], 3, _MD_CONTACT_MES_NOVALIDEMAIL); exit(); } - // Info Processing - $contact = $contact_handler->Contact_InfoProcessing($_POST); + // verify valid message body + $mailObj->contact_message = $contact_handler->replyBodyFormat($mailObj, (bool) $mailObj->inc_orig); + if ($mailObj->contact_message) { + // successfully retrieved message body so insert into dB + if ($saveinfo = true) { + $contactObj = $contact_handler->create(); + $contactObj->prepareToInsert($mailObj); + if (!$contact_handler->insert($contactObj)) { + redirect_header($_SERVER['PHP_SELF'], 3, _AM_CONTACT_MSG_NOTSAVED); + exit(); + } + $contact_handler->contactAddReply($contactObj->getVar('contact_cid')); + } else { + $message[] = _AM_CONTACT_MSG_NOTSAVED; // did not save message + } - // insert in DB - if ($saveinfo = true) { - $obj = $contact_handler->create(); - $obj->setVars($contact); - - if (!$contact_handler->insert($obj)) { - redirect_header("contact.php", 3, '4'); - exit(); + // send mail can send message if $sendmail = true + if ($sendmail = true) { + $message[] = $contact_handler->contactReplyMail($mailObj); + } elseif ($saveinfo = true) { + $message = _MD_CONTACT_MES_SAVEINDB; + } else { + $message[] = _MD_CONTACT_MES_SENDERROR; } - $contact_handler->Contact_AddReply($contact['contact_cid']); - - } - - // send mail can seet message - if ($sendmail = true) { - $message = $contact_handler->Contact_ReplyMail($contact); - } elseif ($saveinfo = true) { - $message = _MD_CONTACT_MES_SAVEINDB; } else { - $message = _MD_CONTACT_MES_SENDERROR; + //failed to set message body + $message[] = _AM_CONTACT_MSG_NOBODY; } - redirect_header("contact.php", 3, $message); + redirect_header($_SERVER['PHP_SELF'], 3, implode('<br />', $message)); $level = 'doreply'; break; case 'view': - $obj = $contact_handler->get($contact_id); + $obj = $contact_handler->get($contactId); if (!$obj) { - redirect_header('contact.php', 3, _AM_CONTACT_MSG_EXIST); + redirect_header($_SERVER['PHP_SELF'], 3, _AM_CONTACT_MSG_NOTEXIST); exit (); } + $user_timezone = ($GLOBALS['xoopsUser'] instanceof XoopsUser) ? $GLOBALS['xoopsUser']->timezone() : null; - $contact = array(); - $contact = $obj->toArray(); - $contact['contact_id'] = $obj->getVar('contact_id'); - $contact['contact_uid'] = $obj->getVar('contact_uid'); - $contact['contact_name'] = $obj->getVar('contact_name'); - $contact['contact_owner'] = XoopsUser::getUnameFromId($obj->getVar('contact_uid')); - $contact['contact_subject'] = $obj->getVar('contact_subject'); - $contact['contact_mail'] = $obj->getVar('contact_mail'); - $contact['contact_url'] = $obj->getVar('contact_url'); - $contact['contact_create'] = formatTimestamp($obj->getVar('contact_create'), _MEDIUMDATESTRING); - $contact['contact_icq'] = $obj->getVar('contact_icq'); - $contact['contact_company'] = $obj->getVar('contact_company'); - $contact['contact_location'] = $obj->getVar('contact_location'); - $contact['contact_phone'] = $obj->getVar('contact_phone'); - $contact['contact_department'] = $obj->getVar('contact_department'); - $contact['contact_ip'] = $obj->getVar('contact_ip'); - $contact['contact_message'] = $obj->getVar('contact_message'); - $contact['contact_address'] = $obj->getVar('contact_address'); + $contact = $obj->getValues(); + $contact['contact_owner'] = XoopsUser::getUnameFromId($contact['contact_uid']); + $contact['contact_create'] = formatTimestamp($contact['contact_create'], 'm', $user_timezone); - $xoopsTpl->assign('contact', $contact); - $xoopsTpl->assign('replylist', $contact_handler->Contact_GetReply($contact_id)); + $GLOBALS['xoopsTpl']->assign(array('use_depts' => $GLOBALS['xoopsModuleConfig']['form_dept'] ? 1 : 0, + 'contact' => $contact, + 'replylist' => $contact_handler->contactGetReply($contactId)) + ); $level = 'view'; break; case 'delete': - if ($contact_id > 0) { - // Prompt message - xoops_confirm(array("id" => $contact_id), 'contact.php?op=dodelete', _AM_CONTACT_MSG_DELETE); - } else { - redirect_header('contact.php', 3, _AM_CONTACT_MSG_EXIST); + if (!$contactId) { + redirect_header($_SERVER['PHP_SELF'], 3, _AM_CONTACT_MSG_NOTEXIST); + exit(); } - + // Prompt message + xoops_confirm(array('id' => $contactId, 'op' => 'dodelete'), $_SERVER['PHP_SELF'], _AM_CONTACT_MSG_DELETE); $level = 'delete'; break; case 'dodelete': - if (!$contact_id > 0) { - redirect_header('contact.php', 3, _AM_CONTACT_MSG_EXIST); - xoops_cp_footer(); - exit (); + // check to make sure this passes form submission security + if ( ($GLOBALS['xoopsSecurity'] instanceof XoopsSecurity) ) { + if ( !$GLOBALS['xoopsSecurity']->check() ) { + // failed xoops security check + redirect_header('index.php', 3, $GLOBALS['xoopsSecurity']->getErrors(true)); + exit(); + } + } else { + redirect_header('index.php', 3, _MD_CONTACT_INVALID_SECURITY_TOKEN); } - $criteria = new CriteriaCompo (); - $criteria->add(new Criteria ('contact_id', $contact_id)); - $criteria->add(new Criteria ('contact_cid', $contact_id), 'OR'); - - if (!$contact_handler->deleteAll($criteria)) { - redirect_header('contact.php', 1, _AM_CONTACT_MSG_DELETEERROR); - xoops_cp_footer(); - exit (); + if (!$contactId) { + $msg = _AM_CONTACT_MSG_NOTEXIST; + } else { + $criteria = new CriteriaCompo (); + $criteria->add(new Criteria ('contact_id', $contactId)); //messages + $criteria->add(new Criteria ('contact_cid', $contactId), 'OR'); //replies + $msg = (!$contact_handler->deleteAll($criteria)) ? _AM_CONTACT_MSG_DELETEERROR : _AM_CONTACT_MSG_DELETED; } - - redirect_header('contact.php', 1, _AM_CONTACT_MSG_DELETED); - xoops_cp_footer(); - exit (); + redirect_header($_SERVER['PHP_SELF'], 3, $msg); +// xoops_cp_footer(); + exit(); break; } -$xoopsTpl->assign('navigation', $admin_class->addNavigation('contact.php')); -$xoopsTpl->assign('level', $level); +$GLOBALS['xoopsTpl']->assign(array('navigation' => $admin_class->addNavigation('contact.php'), + 'level' => $level) +); // Call template file -$xoopsTpl->display(XOOPS_ROOT_PATH . '/modules/contact/templates/admin/contact_contact.tpl'); +$GLOBALS['xoopsTpl']->display($GLOBALS['xoops']->path('www/modules/contact/templates/admin/contact_contact.tpl')); // Call footer require __DIR__ . '/admin_footer.php'; Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/index.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/contact/admin/index.php 2014-10-31 07:13:53 UTC (rev 12828) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/index.php 2014-11-26 07:12:14 UTC (rev 12872) @@ -12,8 +12,10 @@ /** * Contact module * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @package contact + * @subpackage admin * @author Kazumi Ono (aka Onokazu) * @author Trabis <lus...@gm...> * @author Hossein Azizabadi (AKA Voltan) @@ -24,14 +26,28 @@ require __DIR__ . '/admin_header.php'; // Display Admin header xoops_cp_header(); - // Display Admin menu class $admin_class->addInfoBox(_AM_CONTACT_INDEX_ADMENU1); -$admin_class->addInfoBoxLine(_AM_CONTACT_INDEX_ADMENU1, _AM_CONTACT_INDEX_TOTAL, $contact_handler->Contact_GetCount('contact_cid')); -$xoopsTpl->assign('navigation', $admin_class->addNavigation('index.php')); -$xoopsTpl->assign('renderindex', $admin_class->renderIndex()); +// Display number of messages without replies +$criteria = new CriteriaCompo(); +$criteria->add(new Criteria('contact_cid', 0)); +$criteria->add(new Criteria('contact_reply', 0)); +$criteria->add(new Criteria('contact_type', 'Contact')); +$admin_class->addInfoBoxLine(_AM_CONTACT_INDEX_ADMENU1, _AM_CONTACT_INDEX_NOREPLIES, $contact_handler->getCount($criteria)); + +// Display total number of messages +$admin_class->addInfoBoxLine(_AM_CONTACT_INDEX_ADMENU1, _AM_CONTACT_INDEX_TOTAL, $contact_handler->contactGetCount('contact_cid')); + +// Display total number of replies +$criteria = new CriteriaCompo(); +$criteria->add(new Criteria('contact_cid', 0, '<>')); +$criteria->add(new Criteria('contact_reply', 0)); +$admin_class->addInfoBoxLine(_AM_CONTACT_INDEX_ADMENU1, _AM_CONTACT_INDEX_REPLIES, $contact_handler->getCount($criteria)); +$GLOBALS['xoopsTpl']->assign('navigation', $admin_class->addNavigation('index.php')); +$GLOBALS['xoopsTpl']->assign('renderindex', $admin_class->renderIndex()); + // Call template file -$xoopsTpl->display(XOOPS_ROOT_PATH . '/modules/contact/templates/admin/contact_index.tpl'); +$GLOBALS['xoopsTpl']->display($GLOBALS['xoops']->path('www/modules/contact/templates/admin/contact_index.tpl')); // Call footer require __DIR__ . '/admin_footer.php'; Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/log.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/contact/admin/log.php 2014-10-31 07:13:53 UTC (rev 12828) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/log.php 2014-11-26 07:12:14 UTC (rev 12872) @@ -12,8 +12,10 @@ /** * Contact module * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @package contact + * @subpackage admin * @author Kazumi Ono (aka Onokazu) * @author Trabis <lus...@gm...> * @author Hossein Azizabadi (AKA Voltan) @@ -25,31 +27,71 @@ // Display Admin header xoops_cp_header(); // Define default value -$op = $contact_handler->Contact_CleanVars($_REQUEST, 'op', 'form', 'string'); +$op = $contact_handler->contactCleanVars($_REQUEST, 'op', 'form', 'string'); switch ($op) { case 'form': - // prune manager - $form = new XoopsThemeForm(_AM_CONTACT_LOGS_FORM, 'logs', 'log.php', 'post'); - $column = new XoopsFormSelect(_AM_CONTACT_LOGS_COLUMN, 'column', 'contact_phone'); - $column->addOption("contact_phone", _AM_CONTACT_LOGS_COLUMN_PHONE); - $column->addOption("contact_url", _AM_CONTACT_LOGS_COLUMN_URL); - $column->addOption("contact_mail", _AM_CONTACT_LOGS_COLUMN_MAIL); - $form->addElement($column); - $form->addElement(new XoopsFormHidden('op', 'getlog')); - $form->addElement(new XoopsFormButton('', 'post', _SUBMIT, 'submit')); - $xoopsTpl->assign('form', $form->render()); + // log manager + $log_count = $contact_handler->getCount(); + if ($log_count) { + $form = new XoopsThemeForm(_AM_CONTACT_LOGS_FORM, 'logs', 'log.php', 'post', true); + $column = new XoopsFormSelect(_AM_CONTACT_LOGS_COLUMN, 'column', 'contact_mail'); + $column->addOption("contact_mail", _AM_CONTACT_LOGS_COLUMN_MAIL); //always show email option + if ($GLOBALS['xoopsModuleConfig']['form_icq']) { + $column->addOption("contact_icq", _AM_CONTACT_LOGS_COLUMN_ICQ); + } + if ($GLOBALS['xoopsModuleConfig']['form_phone']) { + $column->addOption("contact_phone", _AM_CONTACT_LOGS_COLUMN_PHONE); + } + if ($GLOBALS['xoopsModuleConfig']['form_url']) { + $column->addOption("contact_url", _AM_CONTACT_LOGS_COLUMN_URL); + } + $form->addElement($column); + $form->addElement(new XoopsFormTextDateSelect(_AM_CONTACT_LOGS_BEFORE_DATE, 'timestamp', 15, xoops_getUserTimestamp(time()))); + $form->addElement(new XoopsFormHidden('op', 'getlog')); + $form->addElement(new XoopsFormButton('', 'post', _SUBMIT, 'submit')); + $GLOBALS['xoopsTpl']->assign('form', $form->render()); + } else { + $form = new XoopsThemeForm(_AM_CONTACT_LOGS_FORM, 'logs', 'index.php', 'get', false); + $info_label =new XoopsFormLabel('', "<div style='text-align: center; font-weight: bold;'>" . _AM_CONTACT_LOGS_NOTHING_HERE . "</div>"); + $info_label->setClass('txtcenter bold'); + $form->addElement($info_label); +// $form->addElement(new XoopsFormButton('', 'post', _SUBMIT, 'submit')); + $GLOBALS['xoopsTpl']->assign('form', $form->render()); + } break; case 'getlog': - $column = $contact_handler->Contact_CleanVars($_REQUEST, 'column', '', 'string'); - $log = $contact_handler->Contact_Logs($column); - $xoopsTpl->assign('logs', $log); + if ( ($GLOBALS['xoopsSecurity'] instanceof XoopsSecurity) ) { + if ( !$GLOBALS['xoopsSecurity']->check() ) { + // failed xoops security check + redirect_header('index.php', 3, $GLOBALS['xoopsSecurity']->getErrors(true)); + exit(); + } + } else { + xoops_loadLanguage('main', 'contact'); + redirect_header('index.php', 3, _MD_CONTACT_INVALID_SECURITY_TOKEN); + } + $column = $contact_handler->contactCleanVars($_POST, 'column', 'contact_mail', 'string'); + $valid_column = in_array(trim($column), array('contact_icq', 'contact_mail', 'contact_phone', 'contact_url')); + $column = ($valid_column) ? trim($column) : 'contact_mail'; + $timestamp = $contact_handler->contactCleanVars($_POST, 'timestamp', formatTimestamp(xoops_getUserTimestamp(time()), _SHORTDATESTRING), 'string'); + $log = $contact_handler->contactLogs($column, $timestamp); +/* + $timestamp = $contact_handler->contactCleanVars($_POST, 'timestamp', xoops_getUserTimestamp(time()), 'date'); + $server_timestamp = userTimeToServerTime($timestamp, $GLOBALS['xoopsUser']->getVar('timezone_offset')); + $abs_timestamp = xoops_getUserTimestamp($server_timestamp, 0); + $log = $contact_handler->contactLogs($column, $abs_timestamp); +*/ + if (!$log) { + $log = array(_AM_CONTACT_LOGS_NOTHING_HERE); + } + $GLOBALS['xoopsTpl']->assign('logs', $log); break; } -$xoopsTpl->assign('navigation', $admin_class->addNavigation('log.php')); +$GLOBALS['xoopsTpl']->assign('navigation', $admin_class->addNavigation('log.php')); // Call template file -$xoopsTpl->display(XOOPS_ROOT_PATH . '/modules/contact/templates/admin/contact_logs.tpl'); +$GLOBALS['xoopsTpl']->display($GLOBALS['xoops']->path('www/modules/contact/templates/admin/contact_logs.tpl')); // Call footer require __DIR__ . '/admin_footer.php'; Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/menu.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/contact/admin/menu.php 2014-10-31 07:13:53 UTC (rev 12828) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/menu.php 2014-11-26 07:12:14 UTC (rev 12872) @@ -12,8 +12,10 @@ /** * Contact module * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @package contact + * @subpackage admin * @author Kazumi Ono (aka Onokazu) * @author Trabis <lus...@gm...> * @author Hossein Azizabadi (AKA Voltan) @@ -33,24 +35,24 @@ $adminmenu[$i]["title"] = _MI_CONTACT_MENU_HOME; $adminmenu[$i]["link"] = "admin/index.php"; $adminmenu[$i]["desc"] = _MI_CONTACT_MENU_HOME_DESC; -$adminmenu[$i]["icon"] = $pathIcon32 . '/home.png'; +$adminmenu[$i]["icon"] = "{$pathIcon32}/home.png"; ++$i; $adminmenu[$i]["title"] = _MI_CONTACT_MENU_CONTACT; $adminmenu[$i]["link"] = "admin/contact.php"; $adminmenu[$i]["desc"] = _MI_CONTACT_MENU_CONTACT_DESC; -$adminmenu[$i]["icon"] = $pathIcon32 . '/content.png'; +$adminmenu[$i]["icon"] = "{$pathIcon32}/content.png"; ++$i; $adminmenu[$i]["title"] = _MI_CONTACT_MENU_LOGS; $adminmenu[$i]["link"] = "admin/log.php"; $adminmenu[$i]["desc"] = _MI_CONTACT_MENU_LOGS_DESC; -$adminmenu[$i]["icon"] = $pathIcon32 . '/exec.png'; +$adminmenu[$i]["icon"] = "{$pathIcon32}/exec.png"; ++$i; -$adminmenu[$i]["title"] = _MI_CONTACT_MENU_TOOLS; -$adminmenu[$i]["link"] = "admin/tools.php"; -$adminmenu[$i]["desc"] = _MI_CONTACT_MENU_TOOLS_DESC; -$adminmenu[$i]["icon"] = $pathIcon32 . '/exec.png'; +$adminmenu[$i]["title"] = _MI_CONTACT_MENU_PRUNE; +$adminmenu[$i]["link"] = "admin/prune.php"; +$adminmenu[$i]["desc"] = _MI_CONTACT_MENU_PRUNE_DESC; +$adminmenu[$i]["icon"] = "{$pathIcon32}/prune.png"; ++$i; $adminmenu[$i]["title"] = _MI_CONTACT_MENU_ABOUT; $adminmenu[$i]["link"] = "admin/about.php"; $adminmenu[$i]["desc"] = _MI_CONTACT_MENU_ABOUT_DESC; -$adminmenu[$i]["icon"] = $pathIcon32 . '/about.png'; +$adminmenu[$i]["icon"] = "{$pathIcon32}/about.png"; Copied: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/prune.php (from rev 12828, XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/contact/admin/tools.php) =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/prune.php (rev 0) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/prune.php 2014-11-26 07:12:14 UTC (rev 12872) @@ -0,0 +1,105 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/** + * Contact module + * + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @package contact + * @subpackage admin + * @author Kazumi Ono (aka Onokazu) + * @author Trabis <lus...@gm...> + * @author Hossein Azizabadi (AKA Voltan) + * @author ZySpec <ow...@zy...> + * @version $Id: $ + */ + +// Call header +require __DIR__ . '/admin_header.php'; +// Display Admin header +xoops_cp_header(); +// Define default value +$op = $contact_handler->contactCleanVars($_REQUEST, 'op', 'list', 'string'); + +switch ($op) { + case 'list': + default: + // prune manager + // check to see if there are any items in the dB + $contact_count = $contact_handler->getCount(); + if ($contact_count) { + $form = new XoopsThemeForm(_AM_CONTACT_PRUNE_PRUNE, 'prune', 'prune.php', 'post', true); + $form->addElement(new XoopsFormTextDateSelect(_AM_CONTACT_PRUNE_BEFORE, 'prune_date', 15, xoops_getUserTimestamp(time()))); + $onlyreply = new xoopsFormCheckBox('', 'onlyreply'); + $onlyreply->addOption(1, _AM_CONTACT_PRUNE_REPLYONLY); + $form->addElement($onlyreply, false); + $form->addElement(new XoopsFormHidden('op', 'prune')); + $form->addElement(new XoopsFormButton('', 'post', _SUBMIT, 'submit')); + $GLOBALS['xoopsTpl']->assign('prune', $form->render()); + } else { + $form = new XoopsThemeForm(_AM_CONTACT_PRUNE_PRUNE, 'prune', 'index.php', 'get', false); + $info_label = new XoopsFormLabel('', "<div style='text-align: center; font-weight: bold;'>" . _AM_CONTACT_PRUNE_NOTHING_HERE . "</div>"); + $form->addElement($info_label); +// $form->addElement(new XoopsFormButton('', 'post', _SUBMIT, 'submit')); + $GLOBALS['xoopsTpl']->assign('prune', $form->render()); + } + break; + case 'prune': + if ( ($GLOBALS['xoopsSecurity'] instanceof XoopsSecurity) ) { + if (!$GLOBALS['xoopsSecurity']->check()) { + // failed xoops security check + redirect_header('index.php', 3, $GLOBALS['xoopsSecurity']->getErrors(true)); + exit(); + } + } else { + xoops_loadLanguage('main', 'contact'); + redirect_header('index.php', 3, _MD_CONTACT_INVALID_SECURITY_TOKEN); + } + $onlyreply = (isset($_POST['onlyreply'])) ? 1 : 0; + $prune_date = $contact_handler->contactCleanVars($_POST, 'prune_date', formatTimestamp(xoops_getUserTimestamp(time())), 'string'); + ob_start(); + xoops_confirm(array('op' => 'prune_ok', + 'prune_date' => $prune_date, + 'onlyreply' => $onlyreply), + $_SERVER['PHP_SELF'], + sprintf(_AM_CONTACT_PRUNE_RUSURE, $prune_date), + '', + true); + $GLOBALS['xoopsTpl']->assign('prune', ob_get_contents()); + ob_end_clean(); + break; + case 'prune_ok': + if ( ($GLOBALS['xoopsSecurity'] instanceof XoopsSecurity) ) { + if (!$GLOBALS['xoopsSecurity']->check()) { + // failed xoops security check + redirect_header('index.php', 3, $GLOBALS['xoopsSecurity']->getErrors(true)); + exit(); + } + } else { + xoops_loadLanguage('main', 'contact'); + redirect_header('index.php', 3, _MD_CONTACT_INVALID_SECURITY_TOKEN); + } + + $timestamp = $contact_handler->contactCleanVars($_POST, 'prune_date', xoops_getUserTimestamp(time()), 'date'); + $onlyreply = (bool) $contact_handler->contactCleanVars($_POST, 'onlyreply', 0, 'int'); + $count = (int) $contact_handler->deleteBeforeDate($timestamp, $onlyreply); + redirect_header('prune.php', 2, sprintf(_AM_CONTACT_MSG_PRUNE_DELETED, $count)); + xoops_cp_footer(); + exit (); + break; +} + +$GLOBALS['xoopsTpl']->assign('navigation', $admin_class->addNavigation('prune.php')); +// Call template file +$GLOBALS['xoopsTpl']->display($GLOBALS['xoops']->path('www/modules/contact/templates/admin/contact_prune.tpl')); +// Call footer +require __DIR__ . '/admin_footer.php'; Deleted: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/tools.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/contact/admin/tools.php 2014-10-31 07:13:53 UTC (rev 12828) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/tools.php 2014-11-26 07:12:14 UTC (rev 12872) @@ -1,59 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ - -/** - * Contact module - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @author Kazumi Ono (aka Onokazu) - * @author Trabis <lus...@gm...> - * @author Hossein Azizabadi (AKA Voltan) - * @version $Id$ - */ - -// Call header -require __DIR__ . '/admin_header.php'; -// Display Admin header -xoops_cp_header(); -// Define default value -$op = $contact_handler->Contact_CleanVars($_REQUEST, 'op', 'list', 'string'); - -switch ($op) { - case 'list': - // prune manager - $form = new XoopsThemeForm(_AM_CONTACT_TOOLS_PRUNE, 'tools', 'tools.php', 'post'); - $form->addElement(new XoopsFormTextDateSelect(_AM_CONTACT_TOOLS_PRUNE_BEFORE, 'prune_date', 15, time())); - $onlyreply = new xoopsFormCheckBox('', 'onlyreply'); - $onlyreply->addOption(1, _AM_CONTACT_TOOLS_PRUNE_REPLYONLY); - $form->addElement($onlyreply, false); - $form->addElement(new XoopsFormHidden('op', 'prune')); - $form->addElement(new XoopsFormButton('', 'post', _SUBMIT, 'submit')); - $xoopsTpl->assign('prune', $form->render()); - break; - - case 'prune': - $timestamp = $contact_handler->Contact_CleanVars($_REQUEST, 'prune_date', '', 'int'); - $onlyreply = $contact_handler->Contact_CleanVars($_REQUEST, 'onlyreply', 0, 'int'); - $timestamp = strtotime($timestamp); - $count = $contact_handler->Contact_PruneCount($timestamp, $onlyreply); - $contact_handler->Contact_DeleteBeforeDate($timestamp, $onlyreply); - redirect_header('tools.php', 1, sprintf(_AM_CONTACT_MSG_PRUNE_DELETED, $count)); - xoops_cp_footer(); - exit (); - break; -} - -$xoopsTpl->assign('navigation', $admin_class->addNavigation('tools.php')); -// Call template file -$xoopsTpl->display(XOOPS_ROOT_PATH . '/modules/contact/templates/admin/contact_tools.tpl'); -// Call footer -require __DIR__ . '/admin_footer.php'; Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/ajax.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/contact/ajax.php 2014-10-31 07:13:53 UTC (rev 12828) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/ajax.php 2014-11-26 07:12:14 UTC (rev 12872) @@ -12,23 +12,26 @@ /** * Contact module * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @package contact * @author Kazumi Ono (aka Onokazu) * @author Trabis <lus...@gm...> * @author Hossein Azizabadi (AKA Voltan) - * @version $Id$ + * @version $Id: $ */ include __DIR__ . '/header.php'; if (!empty($_POST)) { // Info Processing - $contact = $contact_handler->Contact_InfoProcessing($_POST); + $mailFormContents = $contact_handler->infoProcessing($_POST); + $mailObj = (object) $mailFormContents; // Save info - $obj = $contact_handler->create(); - $obj->setVars($contact); - $contact_handler->insert($obj); - // send mail can seet message - $message = $contact_handler->Contact_SendMail($contact); + $contactObj = $contact_handler->create(); + $contactObj->prepareToInsert($mailObj); +// $contentObj->setVars($contact); + $contact_handler->insert($contactObj); + // send mail can send message + $message = $contact_handler->contactSendMail($mailObj); } Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/assets/css/admin.css =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/contact/assets/css/admin.css 2014-10-31 07:13:53 UTC (rev 12828) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/assets/css/admin.css 2014-11-26 07:12:14 UTC (rev 12872) @@ -1 +0,0 @@ - Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/assets/js/admin.js =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/contact/assets/js/admin.js 2014-10-31 07:13:53 UTC (rev 12828) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/assets/js/admin.js 2014-11-26 07:12:14 UTC (rev 12872) @@ -7,9 +7,9 @@ * of supporting developers from this source code or any supporting source code * which is considered copyrighted (c) material of the original comment or credit authors. * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @package system + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @package contact * @version $Id$ */ Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/class/contact.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/trunk/modules/contact/class/contact.php 2014-10-31 07:13:53 UTC (rev 12828) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/class/contact.php 2014-11-26 07:12:14 UTC (rev 12872) @@ -12,17 +12,19 @@ /** * Contact module * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @copyright {@link http://sourceforge.net/projects/xoops/ The XOOPS Project} + * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} + * @package contact + * @subpackage class * @author Kazumi Ono (aka Onokazu) * @author Trabis <lus...@gm...> * @author Hossein Azizabadi (AKA Voltan) - * @version $Id$ + * @version $Id: $ */ -// defined("XOOPS_ROOT_PATH") || die("XOOPS root path not defined"); +//defined("XOOPS_ROOT_PATH") || die("Restricted Access - " . basename($_SERVER['PHP_SELF'], '.php') . PHP_EOL); -class contact extends XoopsObject +class Contact extends XoopsObject { public function __construct() @@ -48,26 +50,28 @@ $this->initVar("contact_platform", XOBJ_DTYPE_ENUM, null, false, '', '', array('Android', 'Ios', 'Web')); $this->initVar("contact_type", XOBJ_DTYPE_ENUM, null, false, '', '', array('Contact', 'Phone', 'Mail')); - $this->db = $GLOBALS ['xoopsDB']; + $this->db = $GLOBALS['xoopsDB']; $this->table = $this->db->prefix('contact'); } - public function Contact_ContactForm($department) + public function contactForm() { - global $xoopsConfig, $xoopsOption, $xoopsUser, $xoopsUserIsAdmin, $xoopsModuleConfig; + if ($this->isNew()) { - if (!empty($xoopsUser)) { - $contact_uid = $xoopsUser->getVar('uid'); - $contact_name = $xoopsUser->getVar('uname'); - $contact_mail = $xoopsUser->getVar('email'); - $contact_url = $xoopsUser->getVar('url'); - $contact_icq = $xoopsUser->getVar('user_icq'); - $contact_location = $xoopsUser->getVar('user_from'); + if (($GLOBALS['xoopsUser'] instanceof XoopsUser) && ($GLOBALS['xoopsUser']->uid())) { + $contact_uid = $GLOBALS['xoopsUser']->getVar('uid'); + $contact_name = $GLOBALS['xoopsUser']->getVar('uname'); + $contact_mail = $GLOBALS['xoopsUser']->getVar('email'); + $contact_mail2 = $GLOBALS['xoopsUser']->getVar('email'); + $contact_url = $GLOBALS['xoopsUser']->getVar('url'); + $contact_icq = $GLOBALS['xoopsUser']->getVar('user_icq'); + $contact_location = $GLOBALS['xoopsUser']->getVar('user_from'); } else { $contact_uid = 0; $contact_name = ''; $contact_mail = ''; + $contact_mail2 = ''; $contact_url = ''; $contact_icq = ''; $contact_location = ''; @@ -76,54 +80,72 @@ $contact_uid = $this->getVar('contact_uid'); $contact_name = $this->getVar('contact_name'); $contact_mail = $this->getVar('contact_mail'); + $contact_mail2 = $this->getVar('contact_mail'); $contact_url = $this->getVar('contact_url'); $contact_icq = $this->getVar('contact_icq'); $contact_location = $this->getVar('contact_location'); } + xoops_load('FormValidatedInput', 'contact'); $form = new XoopsThemeForm(_MD_CONTACT_FORM, 'save', 'index.php', 'post', true); $form->setExtra('enctype="multipart/form-data"'); - $form->addElement(new XoopsFormHidden ('op', 'save')); - $form->addElement(new XoopsFormHidden ('contact_id', $this->getVar('contact_id', 'e'))); - $form->addElement(new XoopsFormHidden ('contact_uid', $contact_uid)); - $form->addElement(new XoopsFormText (_MD_CONTACT_NAME, 'contact_name', 50, 255, $contact_name), true); - $form->addElement(new XoopsFormText (_MD_CONTACT_MAIL, 'contact_mail', 50, 255, $contact_mail), true); + $form->addElement(new XoopsFormHidden('op', 'save')); + $form->addElement(new XoopsFormHidden('contact_id', $this->getVar('contact_id', 'e'))); + $form->addElement(new XoopsFormHidden('contact_uid', $contact_uid)); + if ($contact_uid > 0) { + // XOOPS user so don't allow entry of name/email (changed in v1.82) + $form->addElement(new XoopsFormHidden('contact_name', $contact_name)); + $form->addElement(new XoopsFormHidden('contact_mail', $contact_mail)); + /** @internal re-enable following code (and disable previous) if you want XoopsUser to edit their name/email */ + /* + $form->addElement(new ContactFormValidatedInput(_MD_CONTACT_NAME, 'contact_name', 50, 255, $contact_name), true); + $form->addElement(new ContactFormValidatedInput(_MD_CONTACT_MAIL, 'contact_mail', 50, 255, $contact_mail, 'email'), true); + */ + } else { + $form->addElement(new ContactFormValidatedInput(_MD_CONTACT_NAME, 'contact_name', 50, 255, $contact_name), true); + $form->addElement(new ContactFormValidatedInput(_MD_CONTACT_MAIL, 'contact_mail', 50, 255, $contact_mail, 'email'), true); + } - if (xoops_getModuleOption('form_url', 'contact')) { - $form->addElement(new XoopsFormText (_MD_CONTACT_URL, 'contact_url', 50, 255, $contact_url), false); + if (!$GLOBALS['xoopsUser'] && $GLOBALS['xoopsModuleConfig']['form_req_email2']) { + $form->addElement(new ContactFormValidatedInput(_MD_CONTACT_MAIL2, 'contact_mail2', 50, 255, $contact_mail2, 'email'), true); } - if (xoops_getModuleOption('form_icq', 'contact')) { - $form->addElement(new XoopsFormText (_MD_CONTACT_ICQ, 'contact_icq', 50, 255, $contact_icq), false); + if ($GLOBALS['xoopsModuleConfig']['form_url']) { + $form->addElement(new ContactFormValidatedInput(_MD_CONTACT_URL, 'contact_url', 50, 255, $contact_url, 'url'), false); } - if (xoops_getModuleOption('form_company', 'contact')) { - $form->addElement(new XoopsFormText (_MD_CONTACT_COMPANY, 'contact_company', 50, 255, $this->getVar('contact_company')), false); + if ($GLOBALS['xoopsModuleConfig']['form_icq']) { + $form->addElement(new ContactFormValidatedInput(_MD_CONTACT_ICQ, 'contact_icq', 50, 255, $contact_icq), false); } - if (xoops_getModuleOption('form_location', 'contact')) { - $form->addElement(new XoopsFormText (_MD_CONTACT_LOCATION, 'contact_location', 50, 255, $contact_location), false); + if ($GLOBALS['xoopsModuleConfig']['form_company']) { + $form->addElement(new ContactFormValidatedInput(_MD_CONTACT_COMPANY, 'contact_company', 50, 255, $this->getVar('contact_company')), false); } - if (xoops_getModuleOption('form_phone', 'contact')) { - $form->addElement(new XoopsFormText (_MD_CONTACT_PHONE, 'contact_phone', 50, 255, $this->getVar('contact_phone')), false); + if ($GLOBALS['xoopsModuleConfig']['form_location']) { + $form->addElement(new ContactFormValidatedInput(_MD_CONTACT_LOCATION, 'contact_location', 50, 255, $contact_location), false); } - if (xoops_getModuleOption('form_address', 'contact')) { - $form->addElement(new XoopsFormTextArea (_MD_CONTACT_ADDRESS, 'contact_address', $this->getVar('contact_address', 'e'), 3, 60), false); + if ($GLOBALS['xoopsModuleConfig']['form_phone']) { + $form->addElement(new ContactFormValidatedInput(_MD_CONTACT_PHONE, 'contact_phone', 50, 255, $this->getVar('contact_phone'), 'tel'), false); } - if (xoops_getModuleOption('form_dept', 'contact')) { - // show a drop down with the correct departments listed + if ($GLOBALS['xoopsModuleConfig']['form_address']) { + $form->addElement(new XoopsFormTextArea(_MD_CONTACT_ADDRESS, 'contact_address', $this->getVar('contact_address', 'e'), 3, 60), false); + } + if ($GLOBALS['xoopsModuleConfig']['form_dept']) { + // show a drop down with the departments listed $departmentlist = new XoopsFormSelect(_MD_CONTACT_DEPARTMENT, 'contact_department'); - $departments = xoops_getModuleOption('contact_dept', 'contact'); + $departments = $GLOBALS['xoopsModuleConfig']['contact_dept']; foreach ($departments as $val) { $valexplode = explode(',', $val); $departmentlist->addOption($valexplode[0]); } $form->addElement($departmentlist); + } else { + $form->addElement(new XoopsFormHidden('contact_department', '')); } - $form->addElement(new XoopsFormText (_MD_CONTACT_SUBJECT, 'contact_subject', 50, 255, $this->getVar('contact_subject')), true); - $form->addElement(new XoopsFormTextArea (_MD_CONTACT_MESSAGE, 'contact_message', $this->getVar('contact_message', 'e'), 5, 60), true); + $form->addElement(new ContactFormValidatedInput(_MD_CONTACT_SUBJECT, 'contact_subject', 50, 255, $this->getVar('contact_subject')), true); + $form->addElement(new XoopsFormTextArea(_MD_CONTACT_MESSAGE, 'contact_message', $this->getVar('contact_message', 'e'), 5, 60), true); // check captcha - if ((!$xoopsUser && $xoopsModuleConfig['captchaAnonymous']) - || ($xoopsUser && !$xoopsUserIsAdmin && $xoopsModuleConfig['captchaRegistered']) + if ((!$GLOBALS['xoopsUser'] && $GLOBALS['xoopsModuleConfig']['captchaAnonymous']) + || ($GLOBALS['xoopsUser'] && !$GLOBALS['xoopsUser']->isAdmin() && $GLOBALS['xoopsModuleConfig']['captchaRegistered']) ) { xoops_load('XoopsFormCaptcha'); $form->addElement(new XoopsFormCaptcha('','xoopscaptcha',false), true); @@ -134,44 +156,76 @@ return $form; } - public function Contact_ReplyForm() + /** + * + * Get the Contact Reply Form Object + * + * @return object {@see XoopsThemeForm} + */ + public function replyForm() { - global $xoopsConfig; + xoops_load('FormValidatedInput', 'contact'); $form = new XoopsThemeForm(_AM_CONTACT_REPLY, 'doreply', 'contact.php', 'post', true); $form->setExtra('enctype="multipart/form-data"'); - $form->addElement(new XoopsFormHidden ('op', 'doreply')); - $form->addElement(new XoopsFormHidden ('contact_id', $this->getVar('contact_id', 'e'))); - $form->addElement(new XoopsFormHidden ('contact_uid', $this->getVar('contact_uid', 'e'))); - $form->addElement(new XoopsFormLabel(_AM_CONTACT_FROM, '', '')); - $form->addElement( - new XoopsFormText (_AM_CONTACT_NAMEFROM, 'contact_name', 50, 255, XoopsUser::getUnameFromId($this->getVar('contact_uid'))), - true - ); - $form->addElement(new XoopsFormText (_AM_CONTACT_MAILFROM, 'contact_mail', 50, 255, $xoopsConfig['adminmail']), true); - $form->addElement(new XoopsFormLabel(_AM_CONTACT_TO, '', '')); - $form->addElement(new XoopsFormText (_AM_CONTACT_NAMETO, 'contact_nameto', 50, 255, $this->getVar('contact_name')), true); - $form->addElement(new XoopsFormText (_AM_CONTACT_MAILTO, 'contact_mailto', 50, 255, $this->getVar('contact_mail')), true); - $form->addElement(new XoopsFormText (_AM_CONTACT_SUBJECT, 'contact_subject', 50, 255, _RE . $this->getVar('contact_subject')), true); - $form->addElement(new XoopsFormTextArea (_AM_CONTACT_MESSAGE, 'contact_message', '', 5, 60), true); + $form->addElement(new XoopsFormHidden('op', 'doreply')); + $form->addElement(new XoopsFormHidden('contact_id', $this->getVar('contact_id', 'e'))); + $form->addElement(new XoopsFormHidden('contact_uid', $this->getVar('contact_uid', 'e'))); + $form->insertBreak(_AM_CONTACT_FROM, "big bolder uppercase"); + + if ($GLOBALS['xoopsModuleConfig']['form_dept']) { + // add dropdown to allow administrator to change "From" department + include_once "../include/functions.php"; + $dept_values = $dept_keys = contactGetDepartmentNames(); + $dept_optio... [truncated message content] |
From: <wis...@us...> - 2014-11-25 18:46:24
|
Revision: 12871 http://sourceforge.net/p/xoops/svn/12871 Author: wishcraft Date: 2014-11-25 18:46:20 +0000 (Tue, 25 Nov 2014) Log Message: ----------- Signed 1.13 (Trunk) - Final Minor Release Versioning Added Paths: ----------- XoopsModules/signed/trunk/.htaccess.signed Removed Paths: ------------- XoopsModules/signed/trunk/modules/signed/admin/ XoopsModules/signed/trunk/modules/signed/api/ XoopsModules/signed/trunk/modules/signed/class/ XoopsModules/signed/trunk/modules/signed/crons/ XoopsModules/signed/trunk/modules/signed/css/ XoopsModules/signed/trunk/modules/signed/docs/ XoopsModules/signed/trunk/modules/signed/dojsonids.php XoopsModules/signed/trunk/modules/signed/dojsonoperations.php XoopsModules/signed/trunk/modules/signed/fonts/ XoopsModules/signed/trunk/modules/signed/footer.php XoopsModules/signed/trunk/modules/signed/generator.php XoopsModules/signed/trunk/modules/signed/go/ XoopsModules/signed/trunk/modules/signed/header.php XoopsModules/signed/trunk/modules/signed/image/ XoopsModules/signed/trunk/modules/signed/include/ XoopsModules/signed/trunk/modules/signed/index.php XoopsModules/signed/trunk/modules/signed/js/ XoopsModules/signed/trunk/modules/signed/language/ XoopsModules/signed/trunk/modules/signed/preloads/ XoopsModules/signed/trunk/modules/signed/request.php XoopsModules/signed/trunk/modules/signed/reset.php XoopsModules/signed/trunk/modules/signed/sql/ XoopsModules/signed/trunk/modules/signed/templates/ XoopsModules/signed/trunk/modules/signed/updator.php XoopsModules/signed/trunk/modules/signed/verifor.php XoopsModules/signed/trunk/modules/signed/xoops_version.php Added: XoopsModules/signed/trunk/.htaccess.signed =================================================================== --- XoopsModules/signed/trunk/.htaccess.signed (rev 0) +++ XoopsModules/signed/trunk/.htaccess.signed 2014-11-25 18:46:20 UTC (rev 12871) @@ -0,0 +1,20 @@ +# /modules/signed -- Version 1.13 ~~ Mod Rewrite ~~ Started +<IfModule mod_rewrite.c> + + RewriteEngine On + + # Client Signature Service Mod Rewrite + RewriteRule ^signing/index.html modules/signed/index.php + RewriteRule ^signing/=([a-zA-Z0-9]+)=/finished/([a-zA-Z0-9]+).(.*?)$ modules/signed/$1.php?op=finished&serial=$2 + RewriteRule ^signing/=([a-zA-Z0-9]+)=/index(.*?)?(.*?)$ modules/signed/$1.php?$3 + RewriteRule ^signing/=([a-zA-Z0-9]+)=/index(.*?)$ modules/signed/$1.php + RewriteRule ^signing/=([a-zA-Z0-9]+)=/?(.*?)$ modules/signed/$1.php?$2 + + # API Service Mod Rewrite + RewriteRule ^signer/(.*?)/(.*?)?(.*?)$ modules/signed/api/$1/$2.php?$3 + RewriteRule ^signer/(.*?)/(.*?)$ modules/signed/api/$1/$2.php + RewriteRule ^signer/(.*?)/$ modules/signed/api/$1/index.php + RewriteRule ^signer$ modules/signed/api/index.php + +</IfModule> +# /modules/signed -- Version 1.13 ~~ Mod Rewrite ~~ Ended \ No newline at end of file Property changes on: XoopsModules/signed/trunk/.htaccess.signed ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Deleted: XoopsModules/signed/trunk/modules/signed/dojsonids.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/dojsonids.php 2014-11-25 18:45:25 UTC (rev 12870) +++ XoopsModules/signed/trunk/modules/signed/dojsonids.php 2014-11-25 18:46:20 UTC (rev 12871) @@ -1,49 +0,0 @@ -<?php -/** - * Chronolabs Digital Signature Generation & API Services - * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * @copyright Chronolabs Cooperative http://labs.coop - * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) - * @package signed - * @since 1.0.1 - * @author Simon Roberts <wis...@us...> - * @subpackage kernel - * @description Digital Signature Generation & API Services - * @link https://signed.labs.coop Digital Signature Generation & API Services - */ - -require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'common.php'; -$GLOBALS['xoopsLogger']->activated = false; -//error_reporting(0); -ob_end_flush(); -header('Content-type: application/json'); -set_time_limit(120); -if (signedCiphers::getInstance()->getHash(_URL_ROOT.date('Ymdh').session_id())==$_REQUEST['passkey']) { - $ids = signedArrays::getInstance()->returnKeyed($_REQUEST['signature_mode'], 'getIdentificationsArray'); - $verify = signedArrays::getInstance()->returnKeyed($_REQUEST['signature_mode'], 'getValidationsArray'); - $points = 0; - foreach($_REQUEST['identification'] as $key => $id) { - if ($key = $id) { - $points = $points + $ids[$key]['points']; - } - } - if ($points>=$verify['required']['id-score']['fields'][0]){ - $values['innerhtml']['total-points'] = $points . ' ~ <em>Required: '.$verify['required']['id-score']['fields'][0].'</em>'; - $values['disable']['submit-next'] = 'false'; - } else { - $values['innerhtml']['total-points'] = $points . ' ~ <em>Required: '.$verify['required']['id-score']['fields'][0].'</em>'; - $values['disable']['submit-next'] = 'true'; - } -} else { - $values['innerhtml']['total-points'] = "<font style='color: rgb(255,0,0);'>Pass Key has Timed-out please refresh the page!</font>"; - $values['disable']['submit-next'] = 'true'; -} -print json_encode($values); -?> \ No newline at end of file Deleted: XoopsModules/signed/trunk/modules/signed/dojsonoperations.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/dojsonoperations.php 2014-11-25 18:45:25 UTC (rev 12870) +++ XoopsModules/signed/trunk/modules/signed/dojsonoperations.php 2014-11-25 18:46:20 UTC (rev 12871) @@ -1,56 +0,0 @@ -<?php -/** - * Chronolabs Digital Signature Generation & API Services - * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * @copyright Chronolabs Cooperative http://labs.coop - * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) - * @package signed - * @since 1.0.1 - * @author Simon Roberts <wis...@us...> - * @subpackage kernel - * @description Digital Signature Generation & API Services - * @link https://signed.labs.coop Digital Signature Generation & API Services - */ - -require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'common.php'; -$GLOBALS['xoopsLogger']->activated = false; -header('Content-type: application/json'); -set_time_limit(120); -$passed = true; -if (isset($_REQUEST['fields-typal'])) { - foreach($_REQUEST['fields-required'] as $key => $field) { - if (is_array($_REQUEST[$_REQUEST['fields-typal']][$field])) { - foreach($_REQUEST[$_REQUEST['fields-typal']][$field] as $keyb => $value) - if (empty($value)||strlen(trim($value))==0) - $passed = false; - } else { - if (empty($_REQUEST[$_REQUEST['fields-typal']][$field])||strlen(trim($_REQUEST[$_REQUEST['fields-typal']][$field]))==0) - $passed = false; - } - } -} else { - foreach($_REQUEST['fields-required'] as $key => $field) { - if (is_array($_REQUEST[$field])) { - foreach($_REQUEST[$field] as $keyb => $value) - if (empty($value)||strlen(trim($value))==0) - $passed = false; - } else { - if (empty($_REQUEST[$field])||strlen(trim($_REQUEST[$field]))==0) - $passed = false; - } - } -} -if ($passed==true){ - $values['disable']['submit-next'] = 'false'; -} else { - $values['disable']['submit-next'] = 'true'; -} -print json_encode($values); -?> \ No newline at end of file Deleted: XoopsModules/signed/trunk/modules/signed/footer.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/footer.php 2014-11-25 18:45:25 UTC (rev 12870) +++ XoopsModules/signed/trunk/modules/signed/footer.php 2014-11-25 18:46:20 UTC (rev 12871) @@ -1,45 +0,0 @@ -<?php -/** - * Chronolabs Digital Signature Generation & API Services - * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * @copyright Chronolabs Cooperative http://labs.coop - * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) - * @package signed - * @since 1.0.1 - * @author Simon Roberts <wis...@us...> - * @subpackage kernel - * @description Digital Signature Generation & API Services - * @link https://signed.labs.coop Digital Signature Generation & API Services - */ - -$GLOBALS['canvas'] = ob_get_clean(); -if (!defined('_SIGNED_CANVAS')) - define('_SIGNED_CANVAS', $GLOBALS['canvas']); - -if (isset($GLOBALS['errors']) && is_array($GLOBALS['errors']) && count($GLOBALS['errors'])>0) { - $GLOBALS['error'] = "<ol><li>" . implode("</li><li>", $GLOBALS['errors']) . "</li></ol>"; - if (!defined('_SIGNED_ERRORS')) - define('_SIGNED_ERRORS', $GLOBALS['error']); - if (is_object($GLOBALS['logger'])) - $GLOBALS['logger']->logBytes(strlen($GLOBALS['error']), 'html-canvased'); -} -if ($GLOBALS['logger'] = signedLogger::getInstance()) - $GLOBALS['logger']->logBytes(strlen($GLOBALS['canvas']), 'html-canvased'); -ob_start(); -include _PATH_TEMPLATES . _DS_ . 'common' . _DS_ . 'canvas.php'; -$buffer = ob_get_clean(); -if ($GLOBALS['logger'] = signedLogger::getInstance()) - $GLOBALS['logger']->logBytes(strlen($buffer), 'html-buffered'); -$GLOBALS['xoopsTpl']->assign('xodes', $buffer); -$GLOBALS['xoopsTpl']->assign('xoops_pagetitle', (isset($GLOBALS['pagetitle'])&&!empty($GLOBALS['pagetitle'])?$GLOBALS['pagetitle'] . " :: " ._SIGNED_TITLE:_SIGNED_TITLE)); -$GLOBALS['xoopsTpl']->display("db:signed_wrapper.html"); -include $GLOBALS['xoops']->path('/footer.php'); -exit(0); -?> \ No newline at end of file Deleted: XoopsModules/signed/trunk/modules/signed/generator.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/generator.php 2014-11-25 18:45:25 UTC (rev 12870) +++ XoopsModules/signed/trunk/modules/signed/generator.php 2014-11-25 18:46:20 UTC (rev 12871) @@ -1,89 +0,0 @@ -<?php -/** - * Chronolabs Digital Signature Generation & API Services - * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * @copyright Chronolabs Cooperative http://labs.coop - * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) - * @package signed - * @since 1.0.1 - * @author Simon Roberts <wis...@us...> - * @subpackage kernel - * @description Digital Signature Generation & API Services - * @link https://signed.labs.coop Digital Signature Generation & API Services - */ - - define('_SIGNED_EVENT_SYSTEM', 'generator'); - require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'header.php'; - - if (!defined('_SIGNATURE_MODE')) { - header('Location: '. _URL_ROOT); - exit(0); - } - - /** - * Prompting Sessioning - */ - if (!isset($_SESSION["signed"]['prompts'])) { - $prompts = signedProcesses::getInstance()->getPromptsArray(); - $_SESSION["signed"]['prompts'] = $prompts[constant('_SIGNATURE_MODE')]; - } - $promptskeys = array_keys($_SESSION["signed"]['prompts']); - - if (!isset($_SESSION["signed"]['action'])) { - $_SESSION["signed"]['action'] = $promptskeys[0]; - $_SESSION["signed"]['stepstogo'] = signedPrompts::getInstance()->getStepsInPrompt($_SESSION["signed"]['action']); - $_SESSION["signed"]['finished'] = false; - $_SESSION["signed"]['package'] = array(); - $_SESSION["signed"]['workbook'] = array(); - } - - /** - * Inbound Data - */ - if (strtoupper($_SERVER["REQUEST_METHOD"])=="POST" && isset($_REQUEST['step'])) { - if (signedPrompts::getInstance()->goVerifyAndPackagePrompt($_SESSION["signed"]['action'], $_REQUEST['step'])) { - if (count(signedPrompts::getInstance()->getStepsLeftPrompt($_SESSION["signed"]['action'], $_REQUEST['step']))==0) { - $next = ''; - $found = false; - foreach($promptskeys as $prompt) { - if ($found==true) { - $_SESSION["signed"]['action'] = $prompt; - $_SESSION["signed"]['stepstogo'] = signedPrompts::getInstance()->getStepsInPrompt($_SESSION["signed"]['action']); - $found= false; - continue; - continue; - } - if ($prompt == $_SESSION["signed"]['action']) { - unset($_SESSION["signed"]['stepstogo'][$_REQUEST['step']]); - if (count($_SESSION["signed"]['stepstogo'])==0) { - $_SESSION["signed"]['action'] = ''; - $found = true; - } else { - continue; - } - } - } - if ($found == true && empty($_SESSION["signed"]['action'])) { - $_SESSION["signed"]['finished'] = true; - $_SESSION["signed"]['stepstogo'] = array(); - $_SESSION["signed"]['action'] = $promptskeys[count($promptskeys)-1]; - } - } - } - } - define('_SIGNED_EVENT_TYPE', $_SESSION["signed"]['action']); - - /** - * Buffer Templates to output buffer - */ - signedCanvas::getInstance()->getContentBuffer($_SESSION["signed"]['action'], signedPrompts::getInstance()->getNextStepInPrompt($_SESSION["signed"]['action'], $_SESSION["signed"]['stepstogo'])); - - require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'footer.php'; -?> \ No newline at end of file Deleted: XoopsModules/signed/trunk/modules/signed/header.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/header.php 2014-11-25 18:45:25 UTC (rev 12870) +++ XoopsModules/signed/trunk/modules/signed/header.php 2014-11-25 18:46:20 UTC (rev 12871) @@ -1,27 +0,0 @@ -<?php -/** - * Chronolabs Digital Signature Generation & API Services - * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * @copyright Chronolabs Cooperative http://labs.coop - * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) - * @package signed - * @since 1.0.1 - * @author Simon Roberts <wis...@us...> - * @subpackage kernel - * @description Digital Signature Generation & API Services - * @link https://signed.labs.coop Digital Signature Generation & API Services - */ - -require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'common.php'; -if (($GLOBALS['logger'] = signedLogger::getInstance()) && isset($_SERVER['CONTENT_LENGTH'])) - $GLOBALS['logger']->logBytes($_SERVER['CONTENT_LENGTH'], 'recieved'); -include $GLOBALS['xoops']->path('/header.php'); -ob_start(); -?> \ No newline at end of file Deleted: XoopsModules/signed/trunk/modules/signed/index.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/index.php 2014-11-25 18:45:25 UTC (rev 12870) +++ XoopsModules/signed/trunk/modules/signed/index.php 2014-11-25 18:46:20 UTC (rev 12871) @@ -1,26 +0,0 @@ -<?php -/** - * Chronolabs Digital Signature Generation & API Services - * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * @copyright Chronolabs Cooperative http://labs.coop - * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) - * @package signed - * @since 1.0.1 - * @author Simon Roberts <wis...@us...> - * @subpackage kernel - * @description Digital Signature Generation & API Services - * @link https://signed.labs.coop Digital Signature Generation & API Services - */ -define('_SIGNED_EVENT_SYSTEM', 'kernel'); -define('_SIGNED_EVENT_TYPE', 'beginning'); -require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'header.php'; -require _PATH_TEMPLATES . _DS_ . 'common' . _DS_ . 'start.php'; -require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'footer.php'; -?> Deleted: XoopsModules/signed/trunk/modules/signed/request.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/request.php 2014-11-25 18:45:25 UTC (rev 12870) +++ XoopsModules/signed/trunk/modules/signed/request.php 2014-11-25 18:46:20 UTC (rev 12871) @@ -1,106 +0,0 @@ -<?php -/** - * Chronolabs Digital Signature Generation & API Services - * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * @copyright Chronolabs Cooperative http://labs.coop - * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) - * @package signed - * @since 1.0.1 - * @author Simon Roberts <wis...@us...> - * @subpackage kernel - * @description Digital Signature Generation & API Services - * @link https://signed.labs.coop Digital Signature Generation & API Services - */ - define('_SIGNED_EVENT_SYSTEM', 'request'); - require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'header.php'; - - if (!defined('_SIGNATURE_MODE')) { - header('Location: '. _URL_ROOT); - exit(0); - } - - if (!isset($_SESSION["signed"]['serial']) && isset($_GET['serial'])) { - $_SESSION["signed"]['serial'] = $_GET['serial']; - $_SESSION["signed"]['start'] = microtime(); - } - - $GLOBALS['io'] = signedStorage::getInstance(_SIGNED_RESOURCES_STORAGE); - - if (!$GLOBALS['io']->file_exists(_PATH_PATHWAYS_REQUEST, $_SESSION["signed"]['serial'])) { - signed_goReset(); - header('Location: ' . _URL_ROOT); - exit(0); - } - - if (!isset($_SESSION["signed"]['request']) || empty($_SESSION["signed"]['request']) && isset($_SESSION["signed"]['serial'])) { - $_SESSION["signed"]['request'] = $GLOBALS['io']->load(_PATH_PATHWAYS_REQUEST, $_SESSION["signed"]['serial']); - $resource = $GLOBALS['io']->load(_PATH_REPO_SIGNATURES, $_SESSION["signed"]['serial']); - $_SESSION["signed"]['package'] = $resource['resources']['signature']; - } - /** - * Prompting Sessioning - */ - if (!isset($_SESSION["signed"]['prompts'])) { - $prompts = signed_getRequestPromptsArray($_SESSION["signed"]['serial']); - $_SESSION["signed"]['prompts'] = $prompts[constant('_SIGNATURE_MODE')]; - } - $promptskeys = array_keys($_SESSION["signed"]['prompts']); - - if (!isset($_SESSION["signed"]['action'])) { - $_SESSION["signed"]['action'] = $promptskeys[0]; - $_SESSION["signed"]['stepstogo'] = signed_getRequestStepsInPrompt($_SESSION["signed"]['action'], $_SESSION["signed"]['serial']); - $_SESSION["signed"]['finished'] = false; - $_SESSION["signed"]['package'] = array(); - $_SESSION["signed"]['workbook'] = array(); - } - - /** - * Inbound Data - */ - if (strtoupper($_SERVER["REQUEST_METHOD"])=="POST" && isset($_REQUEST['step'])) { - if (signed_goVerifyAndPackagePrompt($_SESSION["signed"]['action'], $_REQUEST['step'])) { - if (count(signed_getStepsLeftPrompt($_SESSION["signed"]['action'], $_REQUEST['step']))==0) { - $next = ''; - $found = false; - foreach($promptskeys as $prompt) { - if ($found==true) { - $_SESSION["signed"]['action'] = $prompt; - $_SESSION["signed"]['stepstogo'] = signed_getRequestStepsInPrompt($_SESSION["signed"]['action'], $_SESSION["signed"]['serial']); - $found= false; - continue; - continue; - } - if ($prompt == $_SESSION["signed"]['action']) { - unset($_SESSION["signed"]['stepstogo'][$_REQUEST['step']]); - if (count($_SESSION["signed"]['stepstogo'])==0) { - $_SESSION["signed"]['action'] = ''; - $found = true; - } else { - continue; - } - } - } - if ($found == true && empty($_SESSION["signed"]['action'])) { - $_SESSION["signed"]['finished'] = true; - $_SESSION["signed"]['stepstogo'] = array(); - $_SESSION["signed"]['action'] = $promptskeys[count($promptskeys)-1]; - } - } - } - } - define('_SIGNED_EVENT_TYPE', $_SESSION["signed"]['action']); - - /** - * Buffer Templates to output buffer - */ - signed_goBufferPrompt($_SESSION["signed"]['action'], signed_getNextStepInPrompt($_SESSION["signed"]['action'], $_SESSION["signed"]['stepstogo'])); - - require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'footer.php'; -?> \ No newline at end of file Deleted: XoopsModules/signed/trunk/modules/signed/reset.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/reset.php 2014-11-25 18:45:25 UTC (rev 12870) +++ XoopsModules/signed/trunk/modules/signed/reset.php 2014-11-25 18:46:20 UTC (rev 12871) @@ -1,24 +0,0 @@ -<?php -/** - * Chronolabs Digital Signature Generation & API Services - * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * @copyright Chronolabs Cooperative http://labs.coop - * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) - * @package signed - * @since 1.0.1 - * @author Simon Roberts <wis...@us...> - * @subpackage kernel - * @description Digital Signature Generation & API Services - * @link https://signed.labs.coop Digital Signature Generation & API Services - */ -require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'header.php'; -require _PATH_TEMPLATES . _DS_ . 'common' . _DS_ . 'reset.php'; -require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'footer.php'; -?> Deleted: XoopsModules/signed/trunk/modules/signed/updator.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/updator.php 2014-11-25 18:45:25 UTC (rev 12870) +++ XoopsModules/signed/trunk/modules/signed/updator.php 2014-11-25 18:46:20 UTC (rev 12871) @@ -1,32 +0,0 @@ -<?php -/** - * Chronolabs Digital Signature Generation & API Services - * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * @copyright Chronolabs Cooperative http://labs.coop - * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) - * @package signed - * @since 1.0.1 - * @author Simon Roberts <wis...@us...> - * @subpackage kernel - * @description Digital Signature Generation & API Services - * @link https://signed.labs.coop Digital Signature Generation & API Services - */ - define('_SIGNED_EVENT_SYSTEM', 'updator'); - require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'header.php'; - if (!isset($_SESSION["signed"]['op'])) - $_SESSION["signed"]['op'] = isset($_GET['op'])?$_GET['op']:'identification'; - if (!isset($_SESSION["signed"]['serial'])) - $_SESSION["signed"]['serial'] = isset($_GET['serial'])?$_GET['serial']:md5(NULL); - if (!isset($_SESSION["signed"]['key'])) - $_SESSION["signed"]['key'] = isset($_GET['key'])?$_GET['key']:md5(NULL); - define('_SIGNED_EVENT_TYPE', $_SESSION["signed"]['op']); - require _PATH_TEMPLATES . _DS_ . 'common' . _DS_ . 'update-'.$_SESSION["signed"]['op'].'.php'; - require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'footer.php'; -?> \ No newline at end of file Deleted: XoopsModules/signed/trunk/modules/signed/verifor.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/verifor.php 2014-11-25 18:45:25 UTC (rev 12870) +++ XoopsModules/signed/trunk/modules/signed/verifor.php 2014-11-25 18:46:20 UTC (rev 12871) @@ -1,27 +0,0 @@ -<?php -/** - * Chronolabs Digital Signature Generation & API Services - * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * @copyright Chronolabs Cooperative http://labs.coop - * @license General Software Licence (https://web.labs.coop/public/legal/general-software-license/10,3.html) - * @package signed - * @since 1.0.1 - * @author Simon Roberts <wis...@us...> - * @subpackage kernel - * @description Digital Signature Generation & API Services - * @link https://signed.labs.coop Digital Signature Generation & API Services - */ -define('_SIGNED_EVENT_SYSTEM', 'verifor'); -$op = isset($_GET['op'])?$_GET['op']:'email'; -define('_SIGNED_EVENT_TYPE', $op); -require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'header.php'; -require _PATH_TEMPLATES . _DS_ . 'common' . _DS_ . 'verify-'.$op.'.php'; -require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'footer.php'; -?> \ No newline at end of file Deleted: XoopsModules/signed/trunk/modules/signed/xoops_version.php =================================================================== --- XoopsModules/signed/trunk/modules/signed/xoops_version.php 2014-11-25 18:45:25 UTC (rev 12870) +++ XoopsModules/signed/trunk/modules/signed/xoops_version.php 2014-11-25 18:46:20 UTC (rev 12871) @@ -1,712 +0,0 @@ -<?php -/** - * Private message module - * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package pm - * @since 2.3.0 - * @author Jan Pedersen - * @author Taiwen Jiang <ph...@us...> - * @version $Id: xoops_version.php 12593 2014-06-14 16:04:02Z beckmi $ - */ - -/** - * This is a temporary solution for merging XOOPS 2.0 and 2.2 series - * A thorough solution will be available in XOOPS 3.0 - * - */ - -$modversion = array(); -$modversion['name'] = _SIGNED_MI_MODULE_NAME; -$modversion['version'] = _SIGNED_MI_MODULE_VERSION; -$modversion['description'] = _SIGNED_MI_MODULE_DESCRIPTION; -$modversion['author'] = _SIGNED_MI_MODULE_AUTHOR; -$modversion['credits'] = _SIGNED_MI_MODULE_CREDITS; -$modversion['help'] = 'page=help'; -$modversion['license'] = 'Chronolabs GSL'; -$modversion['license_url'] = "web.labs.coop/public/legal/general-software-license/10,3.html"; -$modversion['image'] = "image/signed.png"; -$modversion['dirname'] = "signed"; -$modversion['dirmoduleadmin'] = '/Frameworks/moduleclasses/moduleadmin'; -$modversion['icons16'] = 'image/icons/16'; -$modversion['icons32'] = 'image/icons/32'; - -//about -$modversion["module_status"] = "Final"; -$modversion['release_date'] = '2014/06/14'; -$modversion["module_website_url"] = "http://labs.coop/"; -$modversion["module_website_name"] = "Chronolabs Cooperative"; -$modversion['min_php'] = '5.3.7'; -$modversion['min_xoops'] = "2.5.7"; -$modversion['min_admin'] = '1.1'; -$modversion['min_db'] = array( - 'mysql' => '5.0.7', - 'mysqli' => '5.0.7' -); - -// Admin menu -// Set to 1 if you want to display menu generated by system module -$modversion['system_menu'] = 1; - -// Admin things -$modversion['hasAdmin'] = 1; -$modversion['adminindex'] = "admin/admin.php"; -$modversion['adminmenu'] = "admin/menu.php"; - -// Mysql file -$modversion['sqlfile']['mysql'] = "sql/mysql.sql"; - -// Table -$modversion['tables'][0] = "signed_signatures"; -$modversion['tables'][1] = "signed_events"; -$modversion['tables'][2] = "signed_event_links"; - - -// Templates -$modversion['templates'] = array(); -$modversion['templates'][1]['file'] = 'signed_wrapper.html'; -$modversion['templates'][1]['description'] = 'Digital Self Signinf ~ HTML Wrapper'; - - -// Menu -$modversion['hasMain'] = 1; - -$modversion['config'] = array(); -$modversion['config'][] = array( - 'name' => 'memory_limits', - 'title' => '_SIGNED_MI_MEMORY_LIMITS', - 'description' => '_SIGNED_MI_MEMORY_LIMITS_DESC', - 'formtype' => 'text', - 'valuetype' => 'int', - 'default' => 396 -); - - -$modversion['config'][] = array( - 'name' => 'htaccess', - 'title' => '_SIGNED_MI_HTACCESS', - 'description' => '_SIGNED_MI_HTACCESS_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => false -); - -$modversion['config'][] = array( - 'name' => 'htaccess_path', - 'title' => '_SIGNED_MI_HTACCESS_PATH', - 'description' => '_SIGNED_MI_HTACCESS_PATH_DESC', - 'formtype' => 'text', - 'valuetype' => 'text', - 'default' => '/signing' -); - -$modversion['config'][] = array( - 'name' => 'htaccess_url_api', - 'title' => '_SIGNED_MI_HTACCESS_URL_API', - 'description' => '_SIGNED_MI_HTACCESS_URL_API_DESC', - 'formtype' => 'text', - 'valuetype' => 'text', - 'default' => XOOPS_URL . '/signer' -); - - -$modversion['config'][] = array( - 'name' => 'htaccess_extension', - 'title' => '_SIGNED_MI_HTACCESS_EXTENSION', - 'description' => '_SIGNED_MI_HTACCESS_EXTENSION_DESC', - 'formtype' => 'text', - 'valuetype' => 'text', - 'default' => '.html' -); - - -$modversion['config'][] = array( - 'name' => 'title', - 'title' => '_SIGNED_MI_TITLE', - 'description' => '_SIGNED_MI_TITLE_DESC', - 'formtype' => 'text', - 'valuetype' => 'text', - 'default' => 'Digital Signatures' -); - -$modversion['config'][] = array( - 'name' => 'email', - 'title' => '_SIGNED_MI_EMAIL', - 'description' => '_SIGNED_MI_EMAIL_DESC', - 'formtype' => 'text', - 'valuetype' => 'text', - 'default' => $GLOBALS['xoopsConfig']['adminmail'] -); - -$modversion['config'][] = array( - 'name' => 'use_ssl', - 'title' => '_SIGNED_MI_USE_SSL', - 'description' => '_SIGNED_MI_USE_SSL_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => false -); - -$modversion['config'][] = array( - 'name' => 'verify_email', - 'title' => '_SIGNED_MI_VERIFY_EMAIL', - 'description' => '_SIGNED_MI_VERIFY_EMAIL_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'verify_mobile', - 'title' => '_SIGNED_MI_VERIFY_MOBILE', - 'description' => '_SIGNED_MI_VERIFY_MOBILE_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => false -); - -$modversion['config'][] = array( - 'name' => 'php_timezone', - 'title' => '_SIGNED_MI_PHPTIMEZONE', - 'description' => '_SIGNED_MI_PHPTIMEZONE_DESC', - 'formtype' => 'text', - 'valuetype' => 'text', - 'default' => 'Australia/Sydney' -); - -$modversion['config'][] = array( - 'name' => 'years_numberof', - 'title' => '_SIGNED_MI_YEARS_NUMBEROF', - 'description' => '_SIGNED_MI_YEARS_NUMBEROF_DESC', - 'formtype' => 'textbox', - 'valuetype' => 'int', - 'default' => 14 -); - -$modversion['config'][] = array( - 'name' => 'watermark_gif', - 'title' => '_SIGNED_MI_WATERMARK_GIF', - 'description' => '_SIGNED_MI_WATERMARK_GIF_DESC', - 'formtype' => 'text', - 'valuetype' => 'text', - 'default' => 'watermark.gif' -); - -$modversion['config'][] = array( - 'name' => 'watermark_weight', - 'title' => '_SIGNED_MI_WATERMARK_WEIGHT', - 'description' => '_SIGNED_MI_WATERMARK_WEIGHT_DESC', - 'formtype' => 'textbox', - 'valuetype' => 'float', - 'default' => 1.25 -); - -$modversion['config'][] = array( - 'name' => 'watermark_scale', - 'title' => '_SIGNED_MI_WATERMARK_SCALE', - 'description' => '_SIGNED_MI_WATERMARK_SCALE_DESC', - 'formtype' => 'textbox', - 'valuetype' => 'float', - 'default' => 3.75 -); - -$modversion['config'][] = array( - 'name' => 'watermark_min_opacity', - 'title' => '_SIGNED_MI_WATERMARK_MINOPACITY', - 'description' => '_SIGNED_MI_WATERMARK_MINOPACITY_DESC', - 'formtype' => 'textbox', - 'valuetype' => 'int', - 'default' => 32 -); - -$modversion['config'][] = array( - 'name' => 'watermark_max_opacity', - 'title' => '_SIGNED_MI_WATERMARK_MAXOPACITY', - 'description' => '_SIGNED_MI_WATERMARK_MAXOPACITY_DESC', - 'formtype' => 'textbox', - 'valuetype' => 'int', - 'default' => 82 -); - -$modversion['config'][] = array( - 'name' => 'errors_logged', - 'title' => '_SIGNED_MI_ERRORS_LOGGED', - 'description' => '_SIGNED_MI_ERRORS_LOGGED_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => false -); - -$modversion['config'][] = array( - 'name' => 'errors_displayed', - 'title' => '_SIGNED_MI_ERRORS_DISPLAYED', - 'description' => '_SIGNED_MI_ERRORS_DISPLAYED_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => false -); - -$modversion['config'][] = array( - 'name' => 'errors_reporting', - 'title' => '_SIGNED_MI_ERRORS_REPORTING', - 'description' => '_SIGNED_MI_ERRORS_REPORTING_DESC', - 'formtype' => 'select', - 'valuetype' => 'int', - 'options' => array('All Errors' => E_ALL, 'Critical Only' => E_ERROR, 'Notices Only' => E_NOTICE, 'Warnings Only' => E_WARNING), - 'default' => E_ERROR -); - -$modversion['config'][] = array( - 'name' => 'discoverable', - 'title' => '_SIGNED_MI_DISCOVERABLE', - 'description' => '_SIGNED_MI_DISCOVERABLE_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'storage', - 'title' => '_SIGNED_MI_STORAGE', - 'description' => '_SIGNED_MI_STORAGE_DESC', - 'formtype' => 'select', - 'valuetype' => 'text', - 'options' => array(_SIGNED_MI_FORMAT_JSON => 'json', _SIGNED_MI_FORMAT_SERIAL => 'serial', _SIGNED_MI_FORMAT_XML => 'xml'), - 'default' => 'json' -); - -$modversion['config'][] = array( - 'name' => 'storage_logs', - 'title' => '_SIGNED_MI_STORAGE_LOGS', - 'description' => '_SIGNED_MI_STORAGE_LOGS_DESC', - 'formtype' => 'select', - 'valuetype' => 'text', - 'options' => array(_SIGNED_MI_FORMAT_JSON => 'json', _SIGNED_MI_FORMAT_SERIAL => 'serial', _SIGNED_MI_FORMAT_XML => 'xml'), - 'default' => 'json' -); - -$modversion['config'][] = array( - 'name' => 'storage_signed', - 'title' => '_SIGNED_MI_STORAGE_SIGNED', - 'description' => '_SIGNED_MI_STORAGE_SIGNED_DESC', - 'formtype' => 'select', - 'valuetype' => 'text', - 'options' => array(_SIGNED_MI_FORMAT_JSON => 'json', _SIGNED_MI_FORMAT_SERIAL => 'serial', _SIGNED_MI_FORMAT_XML => 'xml'), - 'default' => 'json' -); - -$modversion['config'][] = array( - 'name' => 'storage_resources', - 'title' => '_SIGNED_MI_STORAGE_RESOURCES', - 'description' => '_SIGNED_MI_STORAGE_RESOURCES_DESC', - 'formtype' => 'select', - 'valuetype' => 'text', - 'options' => array(_SIGNED_MI_FORMAT_JSON => 'json', _SIGNED_MI_FORMAT_SERIAL => 'serial', _SIGNED_MI_FORMAT_XML => 'xml'), - 'default' => 'json' -); - -$modversion['config'][] = array( - 'name' => 'storage_urls', - 'title' => '_SIGNED_MI_STORAGE_URLS', - 'description' => '_SIGNED_MI_STORAGE_URLS_DESC', - 'formtype' => 'select', - 'valuetype' => 'text', - 'options' => array(_SIGNED_MI_FORMAT_JSON => 'json', _SIGNED_MI_FORMAT_SERIAL => 'serial', _SIGNED_MI_FORMAT_XML => 'xml'), - 'default' => 'json' -); - -$modversion['config'][] = array( - 'name' => 'logo_width', - 'title' => '_SIGNED_MI_LOGOWIDTH', - 'description' => '_SIGNED_MI_LOGOWIDTH_DESC', - 'formtype' => 'textbox', - 'valuetype' => 'int', - 'default' => 320 -); - -$modversion['config'][] = array( - 'name' => 'logo_height', - 'title' => '_SIGNED_MI_LOGOHEIGHT', - 'description' => '_SIGNED_MI_LOGOHEIGHT_DESC', - 'formtype' => 'textbox', - 'valuetype' => 'int', - 'default' => 320 -); - -$modversion['config'][] = array( - 'name' => 'photo_width', - 'title' => '_SIGNED_MI_PHOTOWIDTH', - 'description' => '_SIGNED_MI_PHOTOWIDTH_DESC', - 'formtype' => 'textbox', - 'valuetype' => 'int', - 'default' => 340 -); - -$modversion['config'][] = array( - 'name' => 'photo_height', - 'title' => '_SIGNED_MI_PHOTOHEIGHT', - 'description' => '_SIGNED_MI_PHOTOHEIGHT_DESC', - 'formtype' => 'textbox', - 'valuetype' => 'int', - 'default' => 375 -); - -$modversion['config'][] = array( - 'name' => 'api_user', - 'title' => '_SIGNED_MI_API_USER', - 'description' => '_SIGNED_MI_API_USER_DESC', - 'formtype' => 'text', - 'valuetype' => 'text', - 'default' => '' -); - -$modversion['config'][] = array( - 'name' => 'api_format', - 'title' => '_SIGNED_MI_API_FORMAT', - 'description' => '_SIGNED_MI_API_FORMAT_DESC', - 'formtype' => 'select', - 'valuetype' => 'text', - 'options' => array(_SIGNED_MI_FORMAT_JSON => 'json', _SIGNED_MI_FORMAT_SERIAL => 'serial', _SIGNED_MI_FORMAT_XML => 'xml'), - 'default' => 'json' -); - -$modversion['config'][] = array( - 'name' => 'api_enabled', - 'title' => '_SIGNED_MI_API_ENABLED', - 'description' => '_SIGNED_MI_API_ENABLED_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'api_sign', - 'title' => '_SIGNED_MI_API_SIGN', - 'description' => '_SIGNED_MI_API_SIGN_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'api_verify', - 'title' => '_SIGNED_MI_API_VERIFY', - 'description' => '_SIGNED_MI_API_VERIFY_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - - -$modversion['config'][] = array( - 'name' => 'api_verification', - 'title' => '_SIGNED_MI_API_VERIFICATION', - 'description' => '_SIGNED_MI_API_VERIFICATION_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'api_sites', - 'title' => '_SIGNED_MI_API_SITES', - 'description' => '_SIGNED_MI_API_SITES_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - - -$modversion['config'][] = array( - 'name' => 'api_languages', - 'title' => '_SIGNED_MI_API_LANGUAGES', - 'description' => '_SIGNED_MI_API_LANGUAGES_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'api_classes', - 'title' => '_SIGNED_MI_API_CLASSES', - 'description' => '_SIGNED_MI_API_CLASSES_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'api_descriptions', - 'title' => '_SIGNED_MI_API_DESCRIPTIONS', - 'description' => '_SIGNED_MI_API_DESCRIPTIONS_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'api_enumerators', - 'title' => '_SIGNED_MI_API_ENUMERATORS', - 'description' => '_SIGNED_MI_API_ENUMERATORS_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'api_fields', - 'title' => '_SIGNED_MI_API_FIELDS', - 'description' => '_SIGNED_MI_API_FIELDS_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'api_fieldtypes', - 'title' => '_SIGNED_MI_API_FIELDTYPES', - 'description' => '_SIGNED_MI_API_FIELDTYPES_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'api_identifications', - 'title' => '_SIGNED_MI_API_IDENTIFICATIONS', - 'description' => '_SIGNED_MI_API_IDENTIFICATIONS_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'api_prompts', - 'title' => '_SIGNED_MI_API_PROMPTS', - 'description' => '_SIGNED_MI_API_PROMPTS_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'api_providers', - 'title' => '_SIGNED_MI_API_PROVIDERS', - 'description' => '_SIGNED_MI_API_PROVIDERS_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'api_signatures', - 'title' => '_SIGNED_MI_API_SIGNATURES', - 'description' => '_SIGNED_MI_API_SIGNATURES_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'api_validations', - 'title' => '_SIGNED_MI_API_VALIDATIONS', - 'description' => '_SIGNED_MI_API_VALIDATIONS_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'api_processes', - 'title' => '_SIGNED_MI_API_PROCESSES', - 'description' => '_SIGNED_MI_API_PROCESSES_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'api_language', - 'title' => '_SIGNED_MI_API_LANGAUGE', - 'description' => '_SIGNED_MI_API_LANGAUGE_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'api_states', - 'title' => '_SIGNED_MI_API_STATES', - 'description' => '_SIGNED_MI_API_STATES_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'api_request', - 'title' => '_SIGNED_MI_API_REQUEST', - 'description' => '_SIGNED_MI_API_REQUEST_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'api_banned', - 'title' => '_SIGNED_MI_API_BANNED', - 'description' => '_SIGNED_MI_API_BANNED_DESC', - 'formtype' => 'yesno', - 'valuetype' => 'int', - 'default' => true -); - -$modversion['config'][] = array( - 'name' => 'banning_cookie', - 'title' => '_SIGNED_MI_BANNING_COOKIE', - 'description' => '_SIGNED_MI_BANNING_COOKIE_DESC', - 'formtype' => 'text', - 'valuetype' => 'text', - 'default' => 'signed-xoops-pointers' -); - - -$modversion['config'][] = array( - 'name' => 'email_fromaddr', - 'title' => '_SIGNED_MI_EMAIL_FROMADDR', - 'description' => '_SIGNED_MI_EMAIL_FROMADDR_DESC', - 'formtype' => 'text', - 'valuetype' => 'text', - 'default' => $GLOBALS['xoopsConfig']['adminmail'] -); - -$modversion['config'][] = array( - 'name' => 'email_fromname', - 'title' => '_SIGNED_MI_EMAIL_FROMNAME', - 'description' => '_SIGNED_MI_EMAIL_FROMNAME_DESC', - 'formtype' => 'text', - 'valuetype' => 'text', - 'default' => $GLOBALS['xoopsConfig']['sitename'] . ' Digital Signatures' -); - -$modversion['config'][] = array( - 'name' => 'email_priority', - 'title' => '_SIGNED_MI_EMAIL_PRIORITY', - 'description' => '_SIGNED_MI_EMAIL_PRIORITY_DESC', - 'formtype' => 'select', - 'valuetype' => 'text', - 'options' => array( _SIGNED_MI_OPTION_EMAIL_PRIORITY_HIGH => 'high', _SIGNED_MI_OPTION_EMAIL_PRIORITY_NORMAL => 'normal', _SIGNED_MI_OPTION_EMAIL_PRIORITY_LOW => 'low'), - 'default' => 'high' -); - -$modversion['config'][] = array( - 'name' => 'email_method', - 'title' => '_SIGNED_MI_EMAIL_METHOD', - 'description' => '_SIGNED_MI_EMAIL_METHOD_DESC', - 'formtype' => 'select', - 'valuetype' => 'text', - 'options' => array('PHP Mail' => 'mail','SMTP Authenticated' => 'smtp','Sendmail' => 'sendmail'), - 'default' => 'mail' -); - -$modversion['config'][] = array( - 'name' => 'email_smtp_host', - 'title' => '_SIGNED_MI_EMAIL_SMTP_HOST', - 'description' => '_SIGNED_MI_EMAIL_SMTP_HOST_DESC', - 'formtype' => 'text', - 'valuetype' => 'text', - 'default' => '' -); - -$modversion['config'][] = array( - 'name' => 'email_smtp_user', - 'title' => '_SIGNED_MI_EMAIL_SMTP_USER', - 'description' => '_SIGNED_MI_EMAIL_SMTP_USER_DESC', - 'formtype' => 'text', - 'valuetype' => 'text', - 'default' => '' -); - -$modversion['config'][] = array( - 'name' => 'email_smtp_pass', - 'title' => '_SIGNED_MI_EMAIL_SMTP_PASS', - 'description' => '_SIGNED_MI_EMAIL_SMTP_PASS_DESC', - 'formtype' => 'password', - 'valuetype' => 'text', - 'default' => '' -); - -$modversion['config'][] = array( - 'name' => 'email_sendmail', - 'title' => '_SIGNED_MI_EMAIL_SENDMAIL', - 'description' => '_SIGNED_MI_EMAIL_SENDMAIL_DESC', - 'formtype' => 'text', - 'valuetype' => 'text', - 'default' => '/usr/sbin/sendmail' -); - -$modversion['config'][] = array( - 'name' => 'email_queued', - 'title' => '_SIGNED_MI_EMAIL_QUEUED', - 'description' => '_SIGNED_MI_EMAIL_QUEUED_DESC', - 'formtype' => 'text', - 'valuetype' => 'int', - 'default' => 172800 -); - -$modversion['config'][] = array( - 'name' => 'sms_method', - 'title' => '_SIGNED_MI_SMS_METHOD', - 'description' => '_SIGNED_MI_SMS_METHOD_DESC', - 'formtype' => 'select', - 'valuetype' => 'text', - 'options' => array('Cardboardfish SMS' => 'cardboardfish'), - 'default' => 'mail' -); - - -$modversion['config'][] = array( - 'name' => 'sms_fromnumber', - 'title' => '_SIGNED_MI_SMS_FROMNUMBER', - 'description' => '_SIGNED_MI_SMS_FROMNUMBER_DESC', - 'formtype' => 'text', - 'valuetype' => 'int', - 'default' => 61000000000 -); - -$modversion['config'][] = array( - 'name' => 'cardboardfish_uri', - 'title' => '_SIGNED_MI_SMS_CARDBOARDFISH_URI', - 'description' => '_SIGNED_MI_SMS_CARDBOARDFISH_URI_DESC', - 'formtype' => 'text', - 'valuetype' => 'text', - 'default' => 'http://sms1.cardboardfish.com:9001/HTTPSMS?' -); - -$modversion['config'][] = array( - 'name' => 'cardboardfish_user', - 'title' => '_SIGNED_MI_SMS_CARDBOARDFISH_USER', - 'description' => '_SIGNED_MI_SMS_CARDBOARDFISH_USER_DESC', - 'formtype' => 'text', - 'valuetype' => 'text', - 'default' => '' -); - -$modversion['config'][] = array( - 'name' => 'cardboardfish_pass', - 'title' => '_SIGNED_MI_SMS_CARDBOARDFISH_PASS', - 'description' => '_SIGNED_MI_SMS_CARDBOARDFISH_PASS_DESC', - 'formtype' => 'password', - 'valuetype' => 'text', - 'default' => '' -); - -?> \ No newline at end of file |