I'm using masquerade in a setup where people can fill in webforms or if they don't a callcenter phones, interviews and fills in the webform on their behalf using masquerade. Works very well :)
In the webform I need to save the UID of original user who masqueraded as well. Webform has the functionality to use token to save various things into a hidden field, specifically any session variable. What would make more sense and be the better way of getting the two to talk, modifying webform to include tokens for $GLOBALS as well, or (what I think, which is why I'm posting here) this patch:
--- masquerade.module.orig 2006-11-20 11:38:41.000000000 +0200
+++ masquerade.module 2008-10-23 07:50:25.000000000 +0200
@@ -71,9 +71,11 @@
// using if so that we get unset rather than false if not masqing
if ($uid) {
$GLOBALS['masquerading'] = $uid;
+ $_SESSION['masquerading'] = $uid;
}
else{
$GLOBALS['masquerading'] = null;
+ $_SESSION['masquerading'] = null;
}
}
What is the advantage of using GLOBALS instead of SESSION here?
Comment | File | Size | Author |
---|---|---|---|
#2 | 325019_globals_to_session.patch | 3.56 KB | deviantintegral |
Comments
Comment #1
deekayen CreditAttribution: deekayen commentedSeems harmless enough, but I think I want Gurpartap to +1 this kind of functionality change before I'd commit it in case it's not really that harmless.
Comment #2
deviantintegral CreditAttribution: deviantintegral commentedThis is a great idea - being able to use webform is really handy for support.
I've attached a patch which replaces all $GLOBALS with $_SESSION for the masquerade variable which I'll be committing in a moment.