From tamirk@gmail.com Tue Jun 20 22:29:32 2006 From: Tamir Khason To: development@drupal.org Subject: [development] $user->uid from popup Date: Wed, 21 Jun 2006 01:29:29 +0300 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5262169824894543979==" --===============5262169824894543979== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I want to get $user->uid (if authenticated user popped it up) from the window, popped up by drupal site (not drupal window) *without* transferring uid as parameter. Is it possible, and if it is, so how? Thank you -- Tamir --===============5262169824894543979==-- From dopry@thing.net Wed Jun 21 00:19:20 2006 From: Darrel O'Pry To: development@drupal.org Subject: Re: [development] $user->uid from popup Date: Tue, 20 Jun 2006 20:18:50 -0400 Message-ID: <1150849130.5565.12.camel@localhost> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1843764137847801914==" --===============1843764137847801914== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Wed, 2006-06-21 at 01:29 +0300, Tamir Khason wrote: > I want to get $user->uid (if authenticated user popped it up) from the > window, popped up by drupal site (not drupal window) *without* > transferring uid as parameter. Is it possible, and if it is, so how? > > Thank you If drupal is generating the popup gobal $user should be available if the user is logged in. The session spans windows. --===============1843764137847801914==-- From tamirk@gmail.com Wed Jun 21 18:47:42 2006 From: Tamir Khason To: development@drupal.org Subject: Re: [development] $user->uid from popup Date: Wed, 21 Jun 2006 21:47:34 +0300 Message-ID: In-Reply-To: <1150849130.5565.12.camel@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6818680359015308960==" --===============6818680359015308960== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit no, it does not do following make file (e.g. foo.php) and put it in drupal's root in the file put something like: uid) { echo $user->uid; } else { echo "BOO"; } ?> comment post with following foo Preview comment and click link. You'll get new window with BOO in it On 6/21/06, Darrel O'Pry wrote: > On Wed, 2006-06-21 at 01:29 +0300, Tamir Khason wrote: > > I want to get $user->uid (if authenticated user popped it up) from the > > window, popped up by drupal site (not drupal window) *without* > > transferring uid as parameter. Is it possible, and if it is, so how? > > > > Thank you > > > If drupal is generating the popup gobal $user should be available if the > user is logged in. The session spans windows. > > -- Tamir --===============6818680359015308960==-- From dopry@thing.net Wed Jun 21 19:26:42 2006 From: Darrel O'Pry To: development@drupal.org Subject: Re: [development] $user->uid from popup Date: Wed, 21 Jun 2006 15:26:35 -0400 Message-ID: <1150917995.6629.26.camel@localhost> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2381452011371570467==" --===============2381452011371570467== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit If drupal is generating the pop-up content, or you bootstrap drupal in your script the session will be available. To do this with a minimal amount of drupal fuss you can use drupal_bootstrap in your foo.php. I think you you add the following to the head of your foo.php you will be set. http://api.drupal.org/api/4.7/function/drupal_bootstrap cheers, .darrel. On Wed, 2006-06-21 at 21:47 +0300, Tamir Khason wrote: > no, it does not > do following > make file (e.g. foo.php) and put it in drupal's root > in the file put something like: > global $user; > if($user->uid) { > echo $user->uid; > } > else { > echo "BOO"; > } > ?> > comment post with following href="javascript:window.open('/foo.php');">foo > > Preview comment and click link. You'll get new window with BOO in it > > > On 6/21/06, Darrel O'Pry wrote: > > On Wed, 2006-06-21 at 01:29 +0300, Tamir Khason wrote: > > > I want to get $user->uid (if authenticated user popped it up) from the > > > window, popped up by drupal site (not drupal window) *without* > > > transferring uid as parameter. Is it possible, and if it is, so how? > > > > > > Thank you > > > > > > If drupal is generating the popup gobal $user should be available if the > > user is logged in. The session spans windows. > > > > > > --===============2381452011371570467==-- From tfarsheed@yahoo.com Wed Jun 21 20:46:19 2006 From: Farsheed To: development@drupal.org Subject: Re: [development] $user->uid from popup Date: Wed, 21 Jun 2006 13:46:11 -0700 Message-ID: <20060621204611.21110.qmail@web54510.mail.yahoo.com> In-Reply-To: <1150917995.6629.26.camel@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7136957153994253505==" --===============7136957153994253505== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Another way to do popups is to define a menu path such as "/popup" Then have the menu callback be a function that instead of returning $output, prints and then exits. function make_popup() { $output = "Popup test"; print $output; exit(); } then you would have to provide the javascript in a link, such as LAUNCH POPUP WINDOW Then when a user clicks on the link, it would open up a new window with javascript, and print out the data inside the make_popup() function without having to go through a theme_pager or anything. This way you can avoid having to bootstrap (which I was told will cause problems). -F --- Darrel O'Pry wrote: > > If drupal is generating the pop-up content, or you > bootstrap drupal in > your script the session will be available. > > To do this with a minimal amount of drupal fuss you > can use > drupal_bootstrap in your foo.php. > > I think you you add the following to the head of > your foo.php you will > be set. > include('common/bootstrap.inc'); > drupal_bootstrap(DRUPAL_SESSION); > ?> > http://api.drupal.org/api/4.7/function/drupal_bootstrap > > cheers, > .darrel. > > On Wed, 2006-06-21 at 21:47 +0300, Tamir Khason > wrote: > > no, it does not > > do following > > make file (e.g. foo.php) and put it in drupal's > root > > in the file put something like: > > > global $user; > > if($user->uid) { > > echo $user->uid; > > } > > else { > > echo "BOO"; > > } > > ?> > > comment post with following > href="javascript:window.open('/foo.php');">foo > > > > Preview comment and click link. You'll get new > window with BOO in it > > > > > > On 6/21/06, Darrel O'Pry wrote: > > > On Wed, 2006-06-21 at 01:29 +0300, Tamir Khason > wrote: > > > > I want to get $user->uid (if authenticated > user popped it up) from the > > > > window, popped up by drupal site (not drupal > window) *without* > > > > transferring uid as parameter. Is it possible, > and if it is, so how? > > > > > > > > Thank you > > > > > > > > > If drupal is generating the popup gobal $user > should be available if the > > > user is logged in. The session spans windows. > > > > > > > > > > > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --===============7136957153994253505==--