module

Drupal Logo

Drupal 9: Creating A Session Inspector Module

20th February 2022 - 35 minutes read time

I recently had this idea for a new Drupal module that allows users to manage their sessions. The idea is that a user could look at their current sessions to see if any suspicious activity had happened on their Drupal account. They could then delete any sessions they don't like the look of in order to kill off that session.

The functionality I describe here is actually quite important as it allows users the ability to spot suspicious activity on their accounts. I have even used it in the past when one of my accounts was hacked. The fact that the session was opened from Brazil helped me inform the site that something was wrong.

I did some searching on Drupal for a module that did the same but didn't find anything so I thought I would create a module and go through the process of creation in an article. This includes the research into how this can be achieved in Drupal, looking at designing the interface, and then adding code to create the needed effect.

Read the full article

Drupal Logo

Drupal 6: List Selection Zero Value Fix

7th March 2011 - 4 minutes read time

I discovered a little issue recently with the Profile module in Drupal 6 and after finding the solution I thought I would post it here in case it helps anyone else.

The problem occurs when using the list selection form item in a specific way. This form item works find for just about every situation, except one special case. Lets assume that you wanted to ask a user a question which requires a number between zero and four; you enter the following into the selection options box.

0
1
2
3
4

This is saved fine, but when the form is rendered it doesn't actually print out the option to select 0, which is odd as the value is definitely saved in the database and can be reedited in the form admin.

Read the full article