Логин, регистрация и восстановление пароля с помощью AJAX
Есть такой модуль замечательный - называется он Ajax Register. Раньше он работал довольно странно (к тому же для 6го Друпала), и никогда моих потребностей в ajax логине не удовлетворял. Потом я проскочил в ко-разработчики модуля и сделал релиз для Drupal 7. Однако этот релиз был больше заточен под тот проект, для которого я этот модуль писал на самом деле. Поэтому подходил он явно не всем, хотя всё же лучше, чем ничего.
Сегодня я наконец собрался с мыслями и выпустил в свет адекватный релиз Ajax Register 7.x-4.x. Вот его фичи:
Пишем плагин к Panels с помощью Ctools
Не так давно я очень плотно подружился связкой модулей Views + Panels + Page manager (входит в Ctools). Как оказалось, с их помощью можно много времени сэкономить на многих задачах. В добавок ко всему производительность отличная (выяснилось, что Panels работает быстрее, чем стандартные блоки ядра). Вдохновиться можно посмотрев скринкасты по работе с этой связкой. Живой пример могу показать на примере своей работы - footballtop.ru. Около 90% страниц построено именно на этой связке.
В общем, ближе к теме разговора. Передо мной стояла задача написать не совсем обычную форму голосования, со своими плюшками. Далее эту форму надо было закинуть через Panels в материалы, т.к. все ноды были уже переделаны с помощью панелей, и hook_node_view() уже не срабатывал. Саму реализацию голосования я оставлю за рамками статьи, а вот на написании плагина остановлюсь подробнее.
Корректная работа с полями в седьмом Друпале. Entity metadata wrappers.
В седьмой версии Друпала вывод полей был несколько изменён в связи с усовершенствованием многоязычной системы. Если раньше для вывода содержимого поля достаточно было написать так:
print $node->field_name[0]['value'];то в семёрке добавился к полю ещё и язык (для одноязычных сайтов по умолчанию 'und' - undefined, константа LANGUAGE_NONE):
print $node->field_name[LANGUAGE_NONE][0]['value'];Вывод значение поля стал чуть длиннее. Но если бы это было единственной проблемой - тогда и проблем бы не было :) Но здесь в игру вступают мультиязычные сайты. И получается, что если сайт наш англоязычный например, а мы пользовались кодом выше, то значение поля теперь получить не удастся, т.к. теперь надо его получать иначе:
Добавляем авторизацию по емейлу в Drupal 7
Я был несколько огорчён, узнав, что в семёрке я не имею возможности авторизоваться как по логину, так и по емейлу пользователя. Решения этой проблемы ровненько два.
Решение первоеМодуль Email registration. Поставив его вы получите требуемый функционал. Однако в дополнение вы получите дополнительный багаж из функционала модуля (регистрация по емейлу, вместо обычной). Если вас это устраивает - дальше можно не читать.
Собираем складчину на разработку нового модуля
В этой статье речь пойдет о применении краудфандинга для совместной разработки модулей для Drupal.
Наверное, нужно небольшое вступление, что же это за зверь такой, краудфандинг.
Вообще слово «краудфандинг» происходит от слов crowd — «толпа» и funding — «финансирование», то есть, crowdfunding — это коллективное финансирование благотворительных и коммерческих проектов.
Всё об AJAX в Drupal 7. Drupal Camp Minsk 2012.
14 апреля 2012 года в моём родном городе Минске прошёл очередной Drupal Camp. На нём я рассказывал об AJAX в семьмой версии Drupal. Видео прилагается:
А ниже предоставлен подробный план, по которому я рассказывал.
Модуль по созданию хлебных крошек к статичным страницам
Сегодня меня наконец прорвало и захотелось написать новую статью. Темой были выбраны хлебные крошки (breadcrumbs). Однако, всё пошло не так, как задумывалось изначально, и я написал полноценный модуль, который позволяет быстро и удобно создавать хлебные крошки для статичных страниц.
Поясню на примере. Например, с помощью модуля Views вы создали страницу с новостями. Однако, к сожалению, Views не даёт возможности указывать хлебные крошки для таких страниц (из-за чего эта темы и была поднята мной). А писать каждый раз кастомный код, когда попадётся такое задание, не очень хочется. Поэтому из простой статьи это вырасло в полноценный модуль.
Пользоваться им достаточно просто - после установки перейдите на страницу /admin/structute/path_breadcrumbs и добавьте новый путь с хлебными крошками. Пример заполнения можно посмотреть на скриншоте:
Многошаговые (мультистеп) формы на AJAX в Drupal 7
Итак, дорогие друзья, на повестке дня у нас шикарные мультистеп формы, от которых лично я в восторге. Сразу даю ссылку на мой пример, чтобы и вы воодушевились. Не написано ни строки js, однако всё шустро работает, ещё и с сохранением состояния формы. Великий и могучий Друпал. Теперь от слов переходим к делу.
Шаг первый. Создаём страницу с формой. function multistep_example_menu() { $items = array(); $items['multistep_example'] = array( 'title' => 'Multi-step ajax form example', 'page callback' => 'drupal_get_form', 'page arguments' => array('multistep_example_form'), 'access callback' => TRUE, ); return $items; }Создание своих токенов на примере регистрации пользователей
В этой статье я совмещу две очень полезные вещи: во-первых, расскажу про программное создание токенов, а во-вторых, покажу как в Drupal 7 отправлять пользователю письмо о регистрации, в котором будет находиться автоматически сгенерированный пароль для него.
Сегодня мне была поставлена такая задача по регистрации: Форма регистрации должна содержать только емейл пользователя. После ввода емейла пользователь автоматически авторизируется на сайте, а пароль и логин высылаются на указанную почту. Парадоксально, но в седьмом Друпале этого сделать стандартными средствами сделать невозможно. Из всех возможных стандартных средств, наиболее близкая к поставленной задаче оказалась такая: Пользователь вводит логин, емейл и пароль, после чего происходит автоматическая авторизация. На емейл приходит только логин пользователя - в токенах пароля нет и не предусмотрено. Поэтому отталкиваться я решил именно от него. Итак, переходим к реализации.
Программный перевод текста с помощью Google Translate
Не так давно поставили передо мной задачу: парсить сайт на английском языке, попутно переводя его на русский. И именно перевод вызвал затруднения. Раньше ведь всё проще было, когда существовал бесплатный Google Translate API. А теперь лавочку прикрыли, попросив выложить на стол по 20$ за каждый миллион переведённых символов. Деньги совсем не большие, но русская душа требует халявы. Поэтому немного подумав, я нашёл вполне легальный способом обхода нововведения. А именно - воспользоваться их сервисом Google Translate со своего сайта :)
Без долгих введений, к бою:
Apache Solr Select Sort
Displays the sort block as a form with select lists as opposed to links.
Link ESI
Link ESI is a quick way to add ESI (Edge Side Includes) tags to a node. It provides a field-formatter so that a link field will be rendered as an ESI tag instead.
Dependencies NotesThe module doesn't process the ESI tags in any way - you should use something like Varnish or Akamai to actually handle the ESI processing. This module simply allows you to output ESI tags.
SA-CONTRIB-2012-080 - Hostmaster (Aegir) - Access Bypass and Cross Site Scripting (XSS)
- Advisory ID: DRUPAL-SA-CONTRIB-2012-080
- Project: Hostmaster (Aegir) (third-party module)
- Version: 6.x
- Date: 2012-May-16
- Security risk: Less critical
- Exploitable from: Remote
- Vulnerability: Multiple vulnerabilities
CVE: Requested.
Hostmaster displays a log from tasks executed in Aegir's backend component, provision. In certain circumstances these log messages were not escaped properly before being displayed to the user. This vulnerability is mitigated by the fact that people wishing to exploit this must have access to the PHP code of either provision itself or one of the sites hosted by Aegir.
Access BypassCVE: Requested.
Hostmaster doesn't allow people to edit or create certain node types that are used for the internal representation of data. The implementation of this wasn't fully complete and would still allow privileged users to edit these nodes. This can cause some data corruption in the front-end, leading to tasks that would appear to never finish running. This vulnerability is mitigated by the fact that people wishing to exploit this must have the 'edit package' or 'administer nodes' permissions, which are not given to any roles by the default Aegir install.
Versions affected- Hostmaster 6.x-1.x versions prior to 6.x-1.9.
Drupal core is not affected. If you do not use the contributed Hostmaster (Aegir) module, there is nothing you need to do.
SolutionFollow the upgrade instructions in the release notes for the Aegir 1.9 release which can be found at: http://community.aegirproject.org/1.9
Also see the Hostmaster (Aegir) project page.
Reported by- The Cross Site Scripting vulnerability was reported by Steven Jones one of the module maintainers.
- The Access Bypass vulnerability was reported by Ivo Van Geertruyen of the Drupal Security Team.
- The Cross Site Scripting vulnerability was fixed by Steven Jones one of the module maintainers.
- The Access Bypass vulnerability was fixed by Ivo Van Geertruyen of the Drupal Security Team and mig5 one of the module maintainers.
- Ivo Van Geertruyen of the Drupal Security Team.
- Greg Knaddison of the Drupal Security Team
The Drupal security team can be reached at security at drupal.org or via the contact form at http://drupal.org/contact.
Learn more about the Drupal Security team and their policies, writing secure code for Drupal, and securing your site.
SA-CONTRIB-2012-079 - Post Affiliate Pro - Cross Site Scripting (XSS) and Access Bypass - Unsupported
- Advisory ID: DRUPAL-SA-CONTRIB-2012-079
- Project: Post Affiliate Pro (third-party module)
- Version: 6.x
- Date: 2012-May-16
- Security risk: Critical
- Exploitable from: Remote
- Vulnerability: Cross Site Scripting, Access bypass
CVE: Requested.
Post Affiliate Pro (PAP) is a module providing affiliate functionality for Ubercart and Post Affiliate Pro application.
The module doesn't sufficiently filter user supplied text provided by users registering on the site and also allows unauthorized users to view other user's commission.
- All versions of the module.
Drupal core is not affected. If you do not use the contributed Post Affiliate Pro module, there is nothing you need to do.
SolutionThe module is no longer supported. Users should disable it. Users interested in continuing to use it should see the project page for more information.
Also see the Post Affiliate Pro project page.
Reported by Fixed byNo fix was provided.
Coordinated by- Michael Hess of the Drupal Security Team
- Greg Knaddison of the Drupal Security Team
The Drupal security team can be reached at security at drupal.org or via the contact form at http://drupal.org/contact.
Learn more about the Drupal Security team and their policies, writing secure code for Drupal, and securing your site.
Style Node Title
This module allows content authors to style the node title of content displayed. It is based heavily on the excellent exclude_node_title module by Gabriel Ungureanu.
StatusThis module is currently under development and should be released shortly.
SA-CONTRIB-2012-078 - Smart Breadcrumb - Cross Site Scripting (XSS)
- Advisory ID: DRUPAL-SA-CONTRIB-2012-078
- Project: Smart Breadcrumb (third-party module)
- Version: 6.x
- Date: 2012-May-16
- Security risk: Moderately critical
- Exploitable from: Remote
- Vulnerability: Cross Site Scripting
CVE: Requested.
The function filter_titles() incorrectly attempts to set a title to plain-text, but does not properly filter user supplied text.
This vulnerability is mitigated by the fact that an attacker must have the permission to create or edit a node to exploit the issue.
Versions affected- Smart Breadcrumb 6.x-2.x versions prior to 6.x-1.3.
Drupal core is not affected. If you do not use the contributed Smart Breadcrumb module, there is nothing you need to do.
SolutionInstall the latest version:
- If you use the Smart Breadcrumb module for Drupal 6.x, upgrade to Smart Breadcrumb 6.x-1.3
Also see the Smart Breadcrumb project page.
Reported by- coltrane of the Drupal Security Team
- divThis the module maintainer
- Michael Hess of the Drupal Security Team
- Mori Sugimoto of the Drupal Security Team
The Drupal security team can be reached at security at drupal.org or via the contact form at http://drupal.org/contact.
Learn more about the Drupal Security team and their policies, writing secure code for Drupal, and securing your site.
SA-CONTRIB-2012-77 - Advertisement - Cross Site Scripting & Information Disclosure
- Advisory ID: DRUPAL-SA-CONTRIB-2012-077
- Project: Advertisement (third-party module)
- Version: 6.x
- Date: 2012-May-16
- Security risk: Moderately critical
- Exploitable from: Remote
- Vulnerability: Cross Site Scripting, Information Disclosure, Multiple vulnerabilities
CVE: Requested.
This module enables you to serve advertisements, define pools of ads and show certain ads on certain pages.
The module could, under certain conditions, expose limited site configuration information and a debugging mode did not sufficiently sanitize input, allowing for potential cross-site scripting (XSS).
This vulnerability is mitigated by the fact that exposed data must have been explicitly set in the $conf variable in settings.php.
- Advertisement 6.x-2.x versions prior to 6.x-2.2.
Drupal core is not affected. If you do not use the contributed Advertisement module, there is nothing you need to do.
SolutionInstall the latest version:
- If you use the Advertisement module for Drupal 6.x, upgrade to Advertisement 6.x-2.3
Also see the Advertisement project page.
Reported by Fixed by- Andrew Berry
- John Franklin, module maintainer
- Matt Kleve of the Drupal Security Team
- Michael Hess of the Drupal Security Team
- Ivo Van Geertruyen of the Drupal Security Team
The Drupal security team can be reached at security at drupal.org or via the contact form at http://drupal.org/contact.
Learn more about the Drupal Security team and their policies, writing secure code for Drupal, and securing your site.
SA-CONTRIB-2012-076 - Ubercart Product Keys Access Bypass
- Advisory ID: DRUPAL-SA-CONTRIB-2012-076
- Project: Ubercart Product Keys (third-party module)
- Version: 6.x
- Date: 2012-May-16
- Security risk: Moderately Critical
- Exploitable from: Remote
- Vulnerability: Access bypass
CVE: Requested.
This module enables you to sell product keys from an Ubercart store.
Under certain circumstances, a user can view all unassigned product keys which could grant them access to the software circumventing the process of selling the key.
Versions affected- Ubercart Product Keys 6.x-1.x versions prior to 6.x-1.1.
Drupal core is not affected. If you do not use the contributed Ubercart Product Keys module, there is nothing you need to do.
SolutionInstall the latest version:
- If you use the uc_product_keys module for Drupal 6.x upgrade to uc_products_key 6.x-1.1.
Also see the Ubercart Product Keys project page.
Reported by- Daniel Glucksman
- Daniel Glucksman
- Tony Freixas the module maintainer
- Greg Knaddison of the Drupal Security Team
- Michael Hess of the Drupal Security Team
The Drupal security team can be reached at security at drupal.org or via the contact form at http://drupal.org/contact.
Learn more about the Drupal Security team and their policies, writing secure code for Drupal, and securing your site.
Worldpay Payment Block
Provides a block for visitors to make payments such as donations on user or node pages via Worldpay.
Configuration page options include:
- Description Text (shown at the top of the block)
- Text of the submit button (e.g. 'Pay' or 'Donate')
- Currency (ISO 4217 Currency Code e.g. GBP or USD)
- Payment CartId pattern (the name of the transaction as shown in your Worldpay account. Accepts Tokens)
- Payment description pattern (the optional description of the transaction as shown in your Worldpay account. Accepts Tokens)
- Worldpay payment URL
- Worldpay Installation ID
- Worldpay Test Mode (checkbox)
I'm a learner-coder so review the codes before using this on a production site, and please suggest improvements!
Twitter bootstramp image presets
Provides some image presets for use with the twitter bootstrap module.
All images are designed to work with wrapping the image with a html element with a class of thumbnail to adding padding a border as can be seen here
http://twitter.github.com/bootstrap/components.html#thumbnails
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- …
- следующая ›
- последняя »
