laura robeson

technical website production and geeky commentary

laura robeson header image 1

Drupal Login Redirect Based on Roles

October 2nd, 2009 · 3 Comments

Sidenote: I’ve been meaning to write something about my switch from DotNetNuke to Drupal, but until I get around to that, let me just say: Drupal wins over DNN on many levels. I plan to expand on that statement in the future, for now you’ll just have to take my word for it.

That being said — today I needed to set up a new user account and role for my company’s Drupal site. The site is only a few weeks old so this is the first user account created besides Admin. For ease-of-use I wanted the user to be able to log in and immediately be redirected to the section they’re responsible for editing. I tried using Drupal’s core Trigger module, but that applied Actions to all users, not what I needed.

I somehow stumbled upon the Login Destination module and it ended up doing just what I needed: redirecting a user to a specific page after logging in, based on what their Role was.

The module is lacking documentation, and the configuration page was a little confusing at first, until I realized I would need to add some PHP in order to get everything working. I searched through the issues page a bit and found a good chunk of code to start with (I’m not PHP-fluent yet, but can make basic edits and customizations.)

Once I had the basic snippet to work with, it was a snap to customize:

  1. In the URL Destination Settings section, make sure “Preserve destination” is UNchecked
  2. Select the “PHP Snippet” checkbox and add this code (replacing “role1″ and “admin” with your own desired role titles, of course):
    global $user;
    if (in_array('role1', $user->roles)) {
    return 'role1'; // Which path 'role1' is redirected to
    } elseif (in_array('admin', $user->roles)) {
    return 'admin'; //
    Which path 'admin' is redirected to
    } else {
    return '<front>'; //User does not have 'role1 or admin' role.
    }
  3. For the Redirection Condition settings, select the “Always” checkbox.

Login Destination Configuration

I’m only a couple months into understanding and using Drupal, so I realize this isn’t a super insightful discovery and there are probably many other ways to achieve this, but this is what worked for me. Hopefully it’ll help other people looking to set up the same functionality.

→ 3 CommentsTags: · ,

Browser test for a Mac with low RAM: Firefox vs. Camino vs. Flock

December 20th, 2008 · 2 Comments

I have an old Mac PowerBook G4 that I use mostly for web-browsing because it only has 640MB of RAM and I haven’t gotten around to upgrading it yet.

This is quite a noticeable change in performance when I’m used to using either a Dell laptop with 2GB of RAM or a Linux desktop with 1GB. After many wasted minutes/hours of frustration and waiting for Firefox to catch up with what I was doing, I decided to re-evaluate my browser choice.

Obviously Firefox is my preferred browser because of the Extensions/Add-Ons. Those were not factored into this test because that would add too many variables. To start off simple, I just wanted to see how each browser performed with 3 tabs active on sites I keep open pretty much all day: Gmail, Facebook, and Google Reader.

Here are my results:

  • 1st Place: Camino (1.6.6)
    RAM – Real: 100MB, Virtual: 273MB
    CPU: 25-44% (couldn’t get it higher than that)
  • 2nd Place: Flock (2.0.2)
    RAM – Real: 116MB, Virtual: 334MB
    CPU: 23-83% (this number kept jumping around randomly)
  • 3rd Place: Firefox (3.0.5)
    RAM – Real: 140MB, Virtual: 344MB
    CPU: 30-88% (randomly jumped around a lot too)

Guess I’ll be switching!

At first glance, Camino seems like it’ll be a pretty painless switch, with automatic ad and flash blocking, that takes care of one Firefox add-on I used. Not to mention it’s open-source like Firefox and uses Mozilla’s Gecko-engine (Flock does too.) This page looks immensely helpful for transitioning as well.

PimpMyCamino.com seems promising to get back the rest of my Firefox functionality. My top priorities: Stylish or Greasemonkey (something to enable Userstyles), and Better Gmail 2 equivalents. Wouldn’t mind Twitterfox and Delicious either.

UPDATE: I can’t seem to find any direct equivalent to Stylish/Greasemonkey, but you can manually add userstyles by adding a “userContent.css” file to the Library / Application Support / Camino / Chrome folder. This will definitely get me by, took me about five minutes to copy my favorites over.

→ 2 CommentsTags: · , , ,

Words I hope to see more of in the technology-world next year:

December 19th, 2008 · No Comments

  • integrated
  • open-source
  • cross-platform
  • edit-in-place
  • customizable
  • independent

What’s on YOUR wish list for 2009?

→ No CommentsTags: ·

Why DotNetNuke?

November 13th, 2008 · No Comments

The philosophy of DotNetNuke® (DNN) is this:

“…to create an open source content management system product – one which promotes human participation and the sharing of knowledge.”

What’s not to love about that? In my opinion it goes hand-in-hand with the spirit of Ubuntu Linux, the operation system I use at home and resoundingly prefer over Windows.

I’ve chosen DNN as my content-management system of choice for these main reasons:

Open Source

Though DNN is built on Microsoft’s ASP.NET platform, the DNN framework is open-source, which for most people means FREE — free to download, free to install, and free to develop.

I’m an idealist who believes technology should be as open and free as possible for the benefit of everybody using it. Open-source software equals transparency which [almost always] leads to a better product with more advanced functionality because the development takes place in a technological free market where the best product succeeds on the basis of legitimacy, not monopoly.

Think you’ve never used an open-source product before? Ever used Mozilla Firefox? Firefox is an open-source internet browser with of a vast array of features that Microsoft’s Internet Explorer is still trying to catch up with. Firefox was first released in November 2004 and as of October 2008 it claims almost 20% of the browser share worldwide. Not bad for only 4 years. My point is — open-source works.

Open to the Imagination

Because the core framework is open-source, that means DNN modules (the puzzle pieces of functionality that come together to create a DNN site) are completely open to the imagination of developers. If your organization or company has a need for some obscure site feature, there are third-party developers that can write/code/create that module for you. There are literally hundreds of third-party modules already created and available for sale via sites like SnowCovered.com. The possibilities for functionality are only limited to one’s imagination.

Design Freedom

DNN makes use of “skins” and “containers” to control a site’s design. This means a site has a completely customized look and feel. For the client, this means once a design is built, new pages can be created and will be guaranteed to look the same.

The separation of content and design means that DNN is truly a content-management system. Leaving the design to the designer, the client can focus on the content of their site.

For these reasons and more (which I intend to write about more in the future), I choose to work with DotNetNuke.

→ No CommentsTags: · , ,

Firefox Add-Ons: Its Reason for Greatness

September 18th, 2008 · No Comments

Mozilla Firefox Add-ons are what makes Firefox such an amazing and unique browser.

Firefox Add-Ons

As Internet Explorer gets ready to launch 8.0, and with Google Chrome recently added to the mix, I think it’s time to revisit what has made Firefox stand out from the beginning. No, it’s not the tabbed browsing — although that has done much to perpetuate our A.D.D. generation’s short attention span — it’s the Add-Ons, stupid!

Through the use of Add-Ons (also known as “extensions”) Firefox users can customize their browser functionality according to how they use it most. If Myspace is their thing, they can install Stylish and/or Greasemonkey and make use of user styles that remove annoying banner and sidebar advertisements. If website development is their thing, they can install Firebug and deconstruct a website to their heart’s content.

On a daily basis, I use (and highly recommend) these Add-Ons:

  1. Aardvark
  2. Adblock Plus
  3. Better Gmail2
  4. Blank Canvas Gmail Signatures (experimental/beta)
  5. Delicious Bookmarks
  6. Download Statusbar
  7. Firebug
  8. Flashblock
  9. Greasemonkey
  10. IE Tab
  11. Stylish
  12. Twitbin

Be careful though — Add-Ons are addicting, and you’ll never be able to use Internet Explorer again! Not a bad side-effect, in my opinion.

When you need to switch computers or upgrade your version of Firefox, be sure to use MozBackup to save all your Add-Ons and other user settings.

Which Add-Ons do you use?

→ No CommentsTags: · ,

Net Neutrality vs. Libertarianism

August 7th, 2008 · 1 Comment

Last Friday the FCC ruled to punish Comcast for violating Net Neutrality rules and blocking Internet traffic. While I used to be a strong proponent of Net Neutrality, I’m starting to reconsider my position now that I’ve discovered my Libertarian-leanings.

I used to view this issue as one of absolute necessity and importance. Something MUST be done, or else we’re left with this in our future:

No net neutrality

That’s definitely no good.

While part of me is secretly glad that Comcast was punished for their questionable business practices, one must keep in mind that the FCC is a federal agency and Comcast is a publicly-owned company. The U.S. Constitution says nothing about the federal government meddling in the affairs of businesses (it also says nothing about using these companies to spy on Americans, but that’s a whole other matter.)

Of course I don’t agree with their business practices and I’m very glad they aren’t my ISP. However — in a Free Market we wouldn’t need government intervention to deal with this sort of problem, we would simply leave them as a customer. Alas, we quite obviously do NOT live in a Free Market society and telecommunications monopolies are a bitter reality. In my apartment complex, for example, the only cable/internet option is Time Warner. Which means either I pay their outlandish price every month or I get static.

The issue of Net Neutrality is a perfect example of how the Free Market could be used to solve consumer problems instead of asking the government for help. Instead of being forced to put up with whatever sketchy access Comcast decided to give its customers, people could simple choose another ISP. Another bonus– the Free Market doesn’t eat up our tax dollars.

→ 1 CommentTags: ·

Open-source equivalent of Microsoft Visual Web Developer?

August 6th, 2008 · 1 Comment

.NET is a Microsoft language. So what’s an Ubuntu-using aspiring .NET developer to do? Survey says: Use MonoDevelop.

I compiled it from source because I like to make things extra difficult — but it’s found in Synaptic Package Manager if you want the easy way out.

wget http://ftp.novell.com/pub/mono/sources/monodevelop/monodevelop-1.0.tar.bz2

bunzip2 monodevelop-1.0.tar.bz2

tar xvf monodevelop-1.0.tar

cd monodevelop-1.0

./configure

make

sudo make install

The fun part is that I have a 750pg. book full of screenshots using VWD.

Let the learning curve begin…

→ 1 CommentTags: · , ,

DotNetNuke 101: How to Set Up a Local Installation

July 30th, 2008 · No Comments

I thought I’d kick off my new tech blog with a get-started-quick post for DotNetNuke.

Once you take away the tech terms (i.e. database, module, portal) and break it down, there are actually less than 10 steps separating you from starting your first DNN site. My motivation for having a local installation is for skin development and testing, although the same is also needed for module development.

Wait– what about Linux users? Worry not, there’s an open-source equivalent for Visual Web Developer.

Let’s get started!

Programs Needed:

  1. Visual Web Developer 2008 – Express Edition (free)
    http://www.microsoft.com/express/vwd/
  2. .NET 3.5 Framework
    http://www.microsoft.com/downloads/details.aspx?FamilyId=333325FD-AE52-4E35-B531-508D977D32A6&displaylang=en
  3. SQL Server Express
    http://www.microsoft.com/express/sql/register/default.aspx
  4. DotNetNuke latest Install Package (requires registration)
    http://www.dotnetnuke.com/tabid/125/default.aspx

After all programs are installed:

  1. Create a directory on your hard drive, e.g. “DotNetNuke”
    Do not put it under the wwwroot directory because it will most likely have permissions set that will make the installation difficult.
  2. Unzip the files to the directory

Open Visual Web Developer Express:

  1. Select File -> Open Web Site, open the root folder of the web site.
  2. From the toolbar select Debug then Start Without Debugging.
  3. The site will build and the internal web server will start. The installation wizard will appear and guide you through the installation, choose AUTO.
  4. Click on “Click Here To Access Your Portal” and the site will come up.

Congratulations — you now have your first DotNetNuke site!

Extra Note: Visual Web Developer Express can cause SQL Server Express to lock up. If you click on the Database Explorer tab,  it will allow you to manage your SQL Server Express database, but then you get this error when you try to view the site in your web browser:

Error Installing DotNetNuke
Current Assembly Version: 04.03.04
ERROR: Could not connect to database specified in connectionString for SqlDataProvider

The problem is Visual Web Developer Express has locked the database. Right-click on the database and select Close Connection.

→ No CommentsTags: · , ,