MODx Community Forums
The MODx Blog
Donations
Feedburner Feeds
Documentation
Bugs & Requests
The Wiki
download MODx
plugins, modules, snippets
online demo
Jul 05, 2009, 09:25 PM
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 what MODx Developers say:
MODx Dev. Blogs
MODx Community Forums
»
Support
»
Documentation, Tips & Tricks
(Moderators:
sottwell
,
BobRay
)
»
log in user via URL?
Pages: [
1
]
Go Down
« Previous topic
Next topic »
Print
Author
Topic: log in user via URL? (Read 1012 times)
0 Members and 1 Guest are viewing this topic.
leapy
Member
Posts: 79
log in user via URL?
«
on:
Nov 14, 2008, 08:45 AM »
hello
I need to run a link-checker on my dev site prior to going live. You feed the link-checker a Starting URL and off it goes finding links and checking them.
I need the link-checker to visit all pages on my site including private pages. To set things up, I created a login page specifically for the link-checking app with the alias 'linkcheck'. On this form, I call WebLogin with
Code:
&useCaptcha=`0`
.
The application will accept POST data to send with the Starting URL in order to deal with form based log-in. e.g.
http://dev.mydomain.com/linkcheck?username=test&password=testtest&rememberme=0
In MODx, this log in form just reloads without the user being logged in.
I should maybe point out that I do not want to check modx/wayfinder generated links but the content of our pages holds a number of manually entered links that need to be regularly checked for validity.
Can anyone explain how to get around this please?
Thanks
L
«
Last Edit: Nov 14, 2008, 08:55 AM by leapy
»
Logged
bunk58
Committed to MODx
Posts: 1,397
David Bunker
Re: log in user via URL?
«
Reply #1 on:
Nov 14, 2008, 09:27 AM »
If you're using the standard WebLogin snippet then it accepts only $_POST data from a form, not $_GET data from a querystring.
At around line 186 of assets/snippets/weblogin/weblogin.processor.inc.php you could try changing this :
Code:
$username = $modx->db->escape(strip_tags($_POST['username']));
$givenPassword = $modx->db->escape($_POST['password']);
$captcha_code = isset($_POST['captcha_code'])? $_POST['captcha_code']: '';
$rememberme = $_POST['rememberme'];
to this :
Code:
$username = $modx->db->escape(strip_tags($_REQUEST['username']));
$givenPassword = $modx->db->escape($_REQUEST['password']);
$captcha_code = isset($_REQUEST['captcha_code'])? $_REQUEST['captcha_code']: '';
$rememberme = $_REQUEST['rememberme'];
I haven't tested it, so
definitely
make a backup!
Logged
Snippets :
Highslide Gallery
|
Fisheye Menu
|
JS Tree Menu
|
PHC Results
|
EasyNewsletter from CSV
|
Google Translate
Wiki Articles :
Custom DB table to placeholders
|
Manager Locked Out?
Website :
U.K. based MODx development
leapy
Member
Posts: 79
Re: log in user via URL?
«
Reply #2 on:
Nov 14, 2008, 06:53 PM »
Thanks - that appeared to work.
For the benefit of others:
a) I duplicated assets/snippets/weblogin/weblogin.processor.inc.php creating assets/snippets/weblogin/webloginLinkCheck.processor.inc.php
b) Edited webloginLinkCheck.processor.inc.php with Davids suggested changes
c) Commented out any lines referring to captcha
d) I created a duplicate WebLogin snippet called WebLoginLinkCheck.
e) Edited WebLoginLinkCheck to include webloginLinkCheck.processor.inc.php in place of weblogin.processor.inc.php
f) called WebLoginLinkCheck on the new login page (untick "show in menu")
g) only publish this non-captcha log in page for duration of link-checking and then immediately unpublish it.
L
Logged
bunk58
Committed to MODx
Posts: 1,397
David Bunker
Re: log in user via URL?
«
Reply #3 on:
Nov 15, 2008, 01:40 AM »
Glad it worked
Thanks for putting the explanation to help others.
Logged
Snippets :
Highslide Gallery
|
Fisheye Menu
|
JS Tree Menu
|
PHC Results
|
EasyNewsletter from CSV
|
Google Translate
Wiki Articles :
Custom DB table to placeholders
|
Manager Locked Out?
Website :
U.K. based MODx development
leapy
Member
Posts: 79
Re: log in user via URL?
«
Reply #4 on:
Nov 15, 2008, 02:39 AM »
Thanks to you!
Not often I get the chance to give back :-)
Logged
BobRay
Moderator
Posts: 3,177
Re: log in user via URL?
«
Reply #5 on:
Nov 15, 2008, 02:03 PM »
Quote from: leapy on Nov 14, 2008, 06:53 PM
Thanks - that appeared to work.
For the benefit of others:
a) I duplicated assets/snippets/weblogin/weblogin.processor.inc.php creating assets/snippets/weblogin/webloginLinkCheck.processor.inc.php
b) Edited webloginLinkCheck.processor.inc.php with Davids suggested changes
c) Commented out any lines referring to captcha
d) I created a duplicate WebLogin snippet called WebLoginLinkCheck.
e) Edited WebLoginLinkCheck to include webloginLinkCheck.processor.inc.php in place of weblogin.processor.inc.php
f) called WebLoginLinkCheck on the new login page (untick "show in menu")
g) only publish this non-captcha log in page for duration of link-checking and then immediately unpublish it.
L
For others using this technique, the changes make the site less secure so items d and g are very important. I'd strongly recommend against make the suggested changes to the original file and leaving them in.
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ışı