I'm trying to add a role on user login if certain conditions are met.
I got all the conditions worked out and can display a message
confirming their access based on info from an external database.
The problem comes when I actually try to assign the role.
Upon login, the browser doesn't go to the site's homepage unless
I hit refresh a couple times. Instead, it just gives me a blank
white screen. After refreshing, I'm taken to the homepage,
but the role is not assigned. The same thing happens using
the "User page is Viewed" event, except no amount of refreshing
allows me to proceed.
The same thing also happens if I manually assign the role then try
to use Rules to remove the role, so it looks like any role alteration
results in a WSOD. Block user works fine. I had 6.x-1.1 originally,
but I'm still having the same problem with 6.x-1.x-dev.
Also, I'm NOT using the Auto Assign Role module, and
I can't find an error log that registers what's happening.
This is the most important step of the process since it's how
a customer's purchase actually translates into site access.
Please help!
Comments
Comment #1
vm commentedhave you checked your memory limit? WSOD is an apache error and with Drupal is typical of exhausting memory.
Comment #2
solidreign commentedI'm actually running on an IIS server - the memory_limit is set to 128mb and I wouldn't think that changing a user role would be very memory intensive.
Comment #3
vm commentedhttp://drupal.org/Troubleshooting-FAQ is worth a look. There are other reasons a WSOD may be thrown listed in there.
Comment #4
solidreign commentedOk, I installed the Diagnostic Tools module (dtools) and now instead of a blank screen, I get the following output:
array(4) { ["type"]=> int(64) ["message"]=> string(131)
"Cannot redeclare xmlrpc_encode_entitites()
(previously declared in D:\Hosting\5123101\html\include\xmlrpc-2.2.2\lib\xmlrpc.inc:276)"
["file"]=> string(59) "D:\Hosting\5123101\html\include\xmlrpc-2.2.2\lib\xmlrpc.inc"
["line"]=> int(405)
} n/a
I've created a custom token that refers to an external database using their API, which requires xmlrpc. That's how I determine a user's access level. The custom token works great, except for when I call it in the same Rule as a role change. If I disable my custom token Textual Comparison, the role change works.
Any ideas?
Comment #5
solidreign commentedI found a solution. It's not perfect since I had to modify
a drupal core include file (xmlrpc.inc), but it works.
I copied all the code from "[drupaldir]/includes/xmlrpc.inc"
to the bottom of my "..../xmlrpc-2.2.2/lib/xmlrpc.inc" file,
making sure to remove the ending ?> php tag, and
I found that none of the functions conflicted, so they
merged really cleanly. I then changed the name of
"[drupaldir]/includes/xmlrpc.inc" to "xmlrpc.inc.bak" and
moved my merged xmlrpc.inc file to the "[drupaldir]/includes"
directory.
Then, in my sdk.php file (the external database's API),
i changed the line
include("xmlrpc-2.2.2/lib/xmlrpc.inc");
to
xmlrpc("http://yourdomainhere");
I am now able to use my custom access-checking Token
in a Rule that changes the acting user's role and allows
access to certain nodes via the Content Access module.
Shoot me an email if you want to know more about the
custom token.
Hope this helps anyone with similar problems.