MODx Community Forums
The MODx Blog
Donations
Feedburner Feeds
Documentation
Bugs & Requests
The Wiki
download MODx
plugins, modules, snippets
online demo
Jul 04, 2009, 05:15 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search via SMF
or Google:
modx forums
all of modxcms.com
web
MODxCMS.com
Forums
Help
Login
Register
News
:Read
Frequently Asked Questions (FAQ)
MODx Community Forums
»
Development & Coding
»
Core Code
(Moderator:
OpenGeek
)
»
Better Veriword Captcha Display
Pages: [
1
]
Go Down
« Previous topic
Next topic »
Print
Author
Topic: Better Veriword Captcha Display (Read 2824 times)
0 Members and 1 Guest are viewing this topic.
devtrench
Member
Posts: 53
Better Veriword Captcha Display
«
on:
May 27, 2007, 11:46 PM »
I really like MODx
I especially like how accessible the core code is when you want to make a modification. One of the things that really bugged me about MODx is how the Veriword Captcha is displayed - both the look of it and the default words used for the captcha. I really didn't want my clients having to type in words like Zygote,BitCode,MODx,etc. I just wanted a 'normal' looking captcha with random characters. So I modified the veriword script to output what I think looks nice, and it uses a random string of characters. I just wanted to post the code and images that I redid in case someone else wanted a different look, or wanted to see what I did so they could make the captcha look how they wanted. It isn't too hard if you know PHP and an image manipulation tool like Photoshop or the Gimp.
Here is
an example
of what the script looks like (used with the eForm snippet).
Enjoy,
James
better-veriword-captcha-1.0.zip
(30.76 KB - downloaded 184 times.)
Logged
DEVTRENCH: web development blog
::
EHLY DESIGN
rthrash
Foundation
Posts: 10,471
Re: Better Veriword Captcha Display
«
Reply #1 on:
May 28, 2007, 09:00 AM »
Does look much better indeed. Thanks for sharing.
Logged
MODx
is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you
help us help you
,
read the wiki
, and review snippet parameters even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @
Collabpad
work
productively.
work
intelligently.
work
together.
MODx
Current
|
Dev
|
SVN Root
|
JIRA (Bugs)
|
Confluence (Revolution Wiki)
|
Fisheye SVN Browser
sinbad
Committed to MODx
Posts: 675
Re: Better Veriword Captcha Display
«
Reply #2 on:
Dec 03, 2008, 10:32 PM »
anyway to make it non case sensitive?
I tried just lowercase the letters in the file but that makes the letters sometime* unreadable inside the box as they drop down...
Logged
BobRay
Coding Team
Posts: 3,173
Re: Better Veriword Captcha Display
«
Reply #3 on:
Dec 03, 2008, 11:37 PM »
I don't think it's available as a settable option, but you could easily change the code that evaluates the user's input against the $_SESSION variable to do a case-insensitive compare. These are off the top of my head and untested:
If it's eForm that's doing the check for example, you'd need to change this line (line 178 in eform.inc.php):
Code:
if($fields['vericode']!=$code) {
to
Code:
if (strtolower($fields['vericode']) != strtolower($code) ) {
or
Code:
if (strcasecmp($fields['vericode'], $code) == 0) {
Which might be a little faster.
WebLoginPE, OTOH, has
Code:
if ($_SESSION['veriword'] !== $formcode)
which could be changed to
Code:
if (strcasecmp($_SESSION['veriword'],formcode) != 0)
The Manager login comparison is in manager/processors/login.processor.php:
Code:
elseif ($_SESSION['veriword'] != $captcha_code) {
would change to
Code:
elseif (strcasecmp($_SESSION['veriword'],$captcha_code) != 0 ) {
Note that if the captcha words have non-English characters (e.g. é), you might need a more complicated comparison function.
«
Last Edit: Dec 04, 2008, 12:37 AM by BobRay
»
Logged
MODx info for newbies:
http://bobsguides.com/MODx.html
sinbad
Committed to MODx
Posts: 675
Re: Better Veriword Captcha Display
«
Reply #4 on:
Dec 04, 2008, 12:30 AM »
consider
Code:
if (strcasecmp($fields['vericode'], $code) == 0) {
as tested. it works perfect
however the manager capacha gives an error in the related file. mind trying again that one?
Logged
BobRay
Coding Team
Posts: 3,173
Re: Better Veriword Captcha Display
«
Reply #5 on:
Dec 04, 2008, 12:37 AM »
Quote from: sinbad on Dec 04, 2008, 12:30 AM
. . . however the manager capacha gives an error in the related file. mind trying again that one?
Oops, missing right bracket and right parend. It should be:
Code:
elseif (strcasecmp($_SESSION['veriword'],$captcha_code) != 0) {
(fixed in post above also -- I hope).
Thanks for checking.
Bob
Logged
MODx info for newbies:
http://bobsguides.com/MODx.html
mrhaw
Committed to MODx
Posts: 1,084
modx == freedom
Re: Better Veriword Captcha Display
«
Reply #6 on:
Dec 04, 2008, 12:46 AM »
Thank you BobRay!!
Logged
My playground:
http://4up2date.info
| Host: (mt) Media Temple (gs) | Server: Apache 2.0 | MySQL 4.1.11 | PHP 5.2.6 | MODx 0.9.6.3 (patchwork)
sinbad
Committed to MODx
Posts: 675
Re: Better Veriword Captcha Display
«
Reply #7 on:
Dec 04, 2008, 12:47 AM »
No, thank YOU for checking. This works well. Guess we have both tested. sorry don't have WLPE.
Thank you very much!
Logged
sinbad
Committed to MODx
Posts: 675
Re: Better Veriword Captcha Display
«
Reply #8 on:
Dec 04, 2008, 12:51 AM »
btw, for the standard modx capacha you can simply type your words in lower case. I use this modified capacha from devtrench and don't want to lose users due to frustration so bob's solution is perfect...
Logged
dev_cw
Testers
Posts: 4,018
Re: Better Veriword Captcha Display
«
Reply #9 on:
Dec 04, 2008, 05:16 AM »
Nice tip, bookmarked
BobRay is becoming quite an encyclopedia of modx code (old and new), I am impressed that he knew all those code bits off the top of his head (I would have been opening files and searching for hours). Looks like another team member who 'eats php for breakfast'
Logged
Shane Sponagle
|
[wiki] Snippet Call Anatomy
|
MODx Developer Blog
|
[nettuts] Working With a Content Management Framework: MODx
Something is happening here, but you don't know what it is.
Do you, Mr. Jones? - [bob dylan]
BobRay
Coding Team
Posts: 3,173
Re: Better Veriword Captcha Display
«
Reply #10 on:
Dec 04, 2008, 05:37 PM »
Thanks for the kind words. I wish I could make that claim.
I use NuSphere's PhpED as my primary code editor. It has a whole modx install as one project, and Revo as another. It will do a search of the entire MODx codebase in about 5-10 seconds (a little longer for a regex search). When the search is done, it shows each found line in a list in the Search Results pane and, if you click on one, it loads the file for editing and puts the cursor on that line in less than a second.
As a bonus, in the Pro version, I get code highlighting, code folding, multi-file regex search and replace, a db browser/editor, a code explorer, ftp, a zillion keyboard shortcuts, a built-in php debugger, code autoformatting, and a NuSoap Client. If I right-click on a function call, it will offer to take me to the function declaration -- even if it's in a different file. If I right-click on an include file name, it will offer to open the include file. If I start typing a variable name, it will show me a list of variables in the current file to select from.
I couldn't live without it. Someday I'll do a review of it for Bob's Guides.
I should mention that many, if not all, of these capabilities are available in PhpEclipse for free. I happen to like the PhpED user interface better (and it's a one-step install/upgrade) but many people swear by the Eclipse platform.
Logged
MODx info for newbies:
http://bobsguides.com/MODx.html
Pages: [
1
]
Go Up
Print
« Previous topic
Next topic »
Jump to:
Please select a destination:
-----------------------------
Announcements
-----------------------------
=> Important News
=> Security Notices
-----------------------------
Commercial Support
-----------------------------
=> [CS] About Commercial Support
-----------------------------
Development & Coding
-----------------------------
=> Commercial Inquiries & Bounties
=> Core Code
===> MODx Next
===> xPDO
=> Module, Plugin & Snippet Creation and Modification
=> In Development
=> Templates
-----------------------------
Add-ons, Extensions & Elements
-----------------------------
=> Module, Plugin & Snippet Usage
=> General Repository Items Support
=> Navigation & Tagging/Taxonomy
===> Wayfinder & DropMenu
=> Creating & Repurposing Content
===> Ditto
===> Jot
===> Front-end Document Management
=> Users, Authentication & Personalization
===> WebloginPE
===> WebLogin, WebSignup and WebChangePwd
=> Rich Text Editors & File Browser
===> TinyMCE
===> FCKeditor
===> MCPuck File Browser
=> Forms, Form Processing & Anti-Spam
===> eForm
=> Search
===> AjaxSearch
=> E-business
=> Polls, Calendars, Address Book and Community
=> Third-party integrations
=> Images, Videos & Podcasts
===> MaxiGallery
=> Manager, Parser & the Core
===> Backup & Versioning
===> Doc Finder
===> ManagerManager
===> PHx
=> Templates
-----------------------------
Support
-----------------------------
=> Release Support
===> 0.9.6.3
===> 0.9.6.2
===> 0.9.6.1
===> 0.9.6
===> 0.9.5 and earlier
=> General Support
===> MODx 101
===> E-Commerce, E-Marketing, Analytics & SEO
===> Hosting Experiences
===> IIS / Windows Hosting Issues
=> Documentation, Tips & Tricks
===> Documentation Suggestions & Corrections
-----------------------------
General Discussions
-----------------------------
=> General MODx Discussions
=> Webworker Lounge
=> Wishlist
=> You and Your Sites
=> modxcms.com Discussions and Suggestions
=> Off-topic
-----------------------------
International Support & Translations
-----------------------------
=> Internationalization
=> Bulgarian
===> Поддръжка
=====> Често задавани въпроси
=====> Инсталация
=====> Модули, Плъгини, Снипети и код
=====> Дизайн и Шаблони
===> Документация, Ръководства и Превод
=====> Документация
=====> Ръководства
=====> Превод
===> Общество
=====> Съобщения
=====> Представете се
=====> Представете сайта си
=====> Дискусии извън MODx
=> Chinese
=> Czech
===> Oznámení
=====> Důleitá oznámení/novinky
=====> Bezpečnost
===> Komunita
=====> Oznámení
=====> Představte se, prosím
=====> Ukázky práce
=====> Různé aneb cokoli co se jinam nehodí
===> Podpora
=====> FAQ (často kladené otázky)
=====> Instalace
=====> Moduly, pluginy, "snippets & code" (ablony zdrojových kódů)
=====> Design & ablony
===> Dokumentace, tutoriály (návody) a překlady
=====> Dokumentace
=====> Tutoriály (návody)
=====> Překlady (lokalizace)
=> Dutch
===> Ondersteuning
=====> Veel gestelde vragen
=====> Modules, Plugins, Snippets & Code
=====> Design & Templates
===> Documentatie, Tutorials en Vertalingen
=====> Documentatie
=====> Tutorials
=====> Vertalingen
===> Community
=====> Aankondigingen
=====> Stel jezelf voor
=====> Site Showcase
=====> De stamkroeg
=> Filipino
===> Suporta
=====> Kadalasang tanong
=====> Instalasyon
=====> Moduler, Maidadagdag, Karagdagang mga Code
=====> Desenyo at Templates
===> Dokumentasyon, Mga Turo, Mga Salin
=====> Dokumentasyon
=====> Mga Turo
=====> Mga Salin
===> Kumunidad
=====> Anunsyo
=====> Ipakilala ang sarili
=====> Ang Galing ng pinoy
=====> Tsismisan atbp
=> Finnish
===> Tuki
=====> UKK
=====> Asennus
=====> Moduulit, liitännäiset, koodinpätkät
=====> Ulkoasu/Sivustopohjat
===> Dokumentaatio, oppaat ja käännökset
=====> Dokumentaatio
=====> Käännökset
=====> Oppaat
===> Yhteisö
=====> Tiedotteet
=====> Esittele itsesi
=====> MODx sivustosi
=====> Kahvihuone
=> French
===> Support
=====> FAQ
=====> Installation
=====> Module, plugin, snippets
=====> Design/Templates
===> Documentation, Tutoriels et Traductions
=====> Documentation
=====> Traduction
=====> Tutoriels
===> Communauté
=====> Annonces
=====> Présentez vous
=====> Vos sites
=====> Le Bistrot Français
=> German
===> Support (de)
=====> FAQ (de)
=====> Installation (de)
=====> Module, Plugins, Snippets & Code (de)
=====> Design & Templates (de)
===> Dokumentation, Tutorials und Übersetzung
=====> Dokumentation
=====> Tutorials (de)
=====> Übersetzung
===> Community (de)
=====> Ankündigungen
=====> Stellt Euch vor
=====> Beispielseiten
=====> Off Topic / Verschiedenes
=> Hebrew
===> הכרזה
=====> חדשות חשובות
=====> אבטחה
===> תמיכה
=====> התקנה
=====> תיעוד, מדריכים ותרגומים
=====> עיצוב ותבניות
=====> שאלות נפוצות
===> תיעוד, מדריכים ותרגומים
=====> תיעוד
=====> מדריכים
=====> תרגומים
===> קהילה
=====> הודעות
=====> הצג את עצמך
=====> אתרים לדוגמא
=====> כללי
=> Irish
=> Italian
===> Supporto
=====> FAQ
=====> Installazione
=====> Moduli, Plugin, Snippet e altro codice
=====> Web Design e Template
===> Documentazione, Tutorial e Traduzione
=====> Documentazione
=====> Tutorial
=====> Traduzione
===> Comunitŕ
=====> Annunci
=====> Presentazioni
=====> Siti in vetrina
=====> Chiacchiere in libertŕ
=> Japanese
===> サポート
=====> 良くある質問
=====> インストール
=====> モジュール・プラグイン・スニペット・本体
=====> デザインやテンプレート
===> マニュアル・テュートリアル・翻訳
=====> マニュアル
=====> 事例集、テュートリアル
=====> 日本語化
===> コミュニティ
=====> お知らせ
=====> MODxサイト展示場
=====> 自己紹介
=====> 雑談
=====> 国産リソース
=> Persian - فارسي
===> پشتيباني
=====> راهنما
=====> نصب
=====> ماژول , پلاگین ها , کد ها و جزییات
=====> طراحی و قالب ها
===> مستند سازی , آموزش ها و ترجمه ها
=====> مستند سازی
=====> آموزش ها
=====> ترجمه ها
===> انجمن ها
=====> اخبار
=====> معرفی کردن خود
=====> نمایش دادن سایت ها
=====> بحث های عمومی و سایر موضوعات
=> Polish
===> Wsparcie
=====> FAQ
=====> Instalacja
=====> Moduły, pluginy, snipety i kod
=====> Wygląd i szablony
===> Dokumentacja, tutoriale i tłumaczenie
=====> Dokumentacja
=====> Tutoriale
=====> Tłumaczenie
===> Społeczność
=====> Ogłoszenia
=====> Przedstaw się
=====> Twój serwis WWW
=====> Hyde Park
=> Portuguese
===> Suporte
=====> FAQ - Dúvidas Frequentes
=====> Instalaçăo
=====> Módulos, Plugins, Snippets e Código
=====> Design e Templates
===> Documentaçăo, Guias e Traduçőes
=====> Documentaçăo
=====> Guias
=====> Traduçőes
===> Comunidade
=====> Anúncios
=====> Apresente-se!
=====> Bar da esquina (fora de tópico)
=====> Portfólio de Sites
=> Russian
===> Поддержка
=====> ЧАВО (FAQ)
=====> Установка
=====> Модули, плагины, сниппеты и код
=====> Дизайны и шаблоны
===> Документация, Уроки, Перевод
=====> Документация
=====> Уроки
=====> Перевод
===> Сообщество
=====> Объявления
=====> Представьтесь публике
=====> Галерея сайтов
=====> Диван
=> Scandanavian
===> Support
=====> Frĺgor och svar
=====> Installation
=====> Moduler, plugins, snippets och kod
=====> Design & sidmallar
===> Dokumentation, guider och översättningar
=====> Dokumentation
=====> Guider
=====> Översättningar
===> Webbgemenskap
=====> Meddelanden
=====> Presentera dig själv
=====> Visa upp dina webbsidor
=====> Ordet fritt
=> Slovak
=> Spanish
===> Soporte
=====> FAQ
=====> Instalación
=====> Modulos, Plugins, Snippets & Código
=====> Diseńo y plantillas
===> Documentación, Tutoriales y Traducciones
=====> Documentatción
=====> Tutoriales
=====> Traducciones
===> Comunidad
=====> Anuncios
=====> Presentaciones personales
=====> Muestra de sitios
=====> El Café
=> Swedish
=> TÜRKÇE (Turkish)
===> Destek
=====> SSS
=====> Kurulum
=====> Modüller, Pluginler, Snippetlar & Kodlar
=====> Dizayn & Temalar
===> Belgeleme, Eğitmenler ve Çeviri
=====> Belgeleme
=====> Eğitmenler
=====> Çeviri
===> Topluluk
=====> Duyurular
=====> Kendinizi Tanıtın
=====> Site Vitrini
=====> Konu Dışı