Related Content
Drupal 10: Adding Extra User Account Protection
One of Drupal's strengths is its ability to create communities of users who contribute towards the content of the site. Whether you have an open forum, where users can create their own accounts, or a closed magazine with just a few editors your need to take the security of your users seriously.
Recreating Spotify Wrapped In PHP
I quite like the end of the year report from Spotify that they call "Wrapped". This is a little application in which they tell you what your favorite artist was and what sort of genres you listened to the most during the year.
Should A Constructor Throw An Exception?
Let's say you had a class that you wanted to use, but there was some sort of error in creating the object. This might be that the wrong parameters were passed, or the third party service (eg. a database) wasn't available at the time of creation.
Drupal 10: Opening An Ajax Dialog On Page Load
Drupal has a quick and convenient way of creating ajax dialogs that gives users the ability to embed links in content that open up dialog boxes when clicked. This is a useful way of presenting a bit of content to a user without them navigating away from the page.
Drupal 10: Creating Custom Paths With Path Processors
Routes in Drupal can be altered as they are created, or even changed on the fly as the page request is being processed.
PHP Question: Variable Reference
Question
What does the following code print out?
function arrayPrint($array)
{
echo implode(' ', $array);
}
$arrayA = [1, 2, 3];
$arrayB = $arrayA;
$arrayB[1] = 0;
arrayPrint($arrayA);
Comments
I use Login Destination and use it for this exact purpose, user roles that is. However, I also use LoginToboggan to display the user login form on access denied pages so that a user that tries to directly access a page in which they must login first to view via a bookmark or in my case, a notification email, they can simply login and they will be redirected to the page they were trying to view. This worked perfectly until I used the same logic you describe in Login Destination. Do you know how you would preserve this functionality while still using Login Destination to redirect based on role?
Submitted by steve on Thu, 09/01/2011 - 01:28
PermalinkI think there is probably an overlap between the LoginToboggan and Login Destination modules, in which case one is overriding the functionality of the other. In this case I think the Login Destination module takes precidence. I haven't tested anything, but I think removing the else block of the if statement in Login Destination should stop it overriding anything that LoginToboggan is trying to do.
Worth a shot anyway...
Submitted by philipnorton42 on Thu, 09/01/2011 - 13:12
PermalinkI figured this out and it is very simple to preserve the LoginToboggan functionality. There is a fieldset titled "Redirection Conditions" in the Login Destination settings page. Here, it simply asks, when do you want redirection to occur? I checked the PHP snippet option and entered:
This way it won't redirect if another module, like LoginToboggan, has set the destination. I imagine this is not desirable behavior for all situations, but it worked perfectly in my case.
Submitted by steve on Tue, 09/13/2011 - 20:43
PermalinkAdd new comment