Wordpress MultiSite

57 views
Skip to first unread message

carlo.s...@gmail.com

unread,
Jun 3, 2011, 8:51:53 AM6/3/11
to pwapl...@googlegroups.com
Hi, I try to use PWA+PHP in a multi site wordpress installation and it does not work. 

I discover the problem is in the link created to generate to google token.

In  the Settings section -> PWA+PHP  -> token generation
If I am in a specific site inside my wordpress installation the link used to connect to google is something similar to


This link generates the token but the return page is the main site of the wordpress installation and not in the specific site admin panel

To work in a multisite installation it should be:

Using the second link to create the google token the plugin works in a multsite installation.


Carlo

MarkPea

unread,
Jun 23, 2011, 3:27:23 PM6/23/11
to PWA + PHP
OK, so I'm trying to do this properly. Editing the URL so that it
displays 'quake.sergius.earlham.edu/markp/wp-admin' does force the
procedure to complete properly. But I'd like to edit the code so that
the URL works in a Multisite configuration. However, I was not sure
whether to use $_SERVER['REQUEST_URI'] or $_SERVER['SCRIPT_NAME'] to
extract the username and so I added the lines to install.php that are
commented out with # below:

function get_gdata_token() {

$site = $_SERVER['SERVER_NAME'];
$port = ($_SERVER['SERVER_PORT'] != 80) ? ':' .
$_SERVER['SERVER_PORT'] : '';
$self = $_SERVER['PHP_SELF'];
# $request-uri = $_SERVER['REQUEST_URI'];
# $script-name = $_SERVER['SCRIPT_NAME'];
$loc = urlencode("http://" . $site . $port . $self . "?
page=pwaplusphp&loc=return");
$next = "https://www.google.com/accounts/AuthSubRequest?
scope=http%3A%2F%2Fpicasaweb.google.com%2Fdata
%2F&session=1&secure=0&next=$loc";
echo "<h2>Install Step 1: Token Generation</h2>";
echo "<p>Generating this Google \"GData\" token is a one-time
step that allows PWA+PHP to access to your private (unlisted) Picasa
albums. Click the link below to continue if you wish to set up
PicasaWeb tokens for site: <strong>$site</strong></p>";
# echo "<p>REQUEST_URI string : '$request-uri'</p>";
# echo "<p>SCRIPT_NAME string : '$script-name'</p>";
echo "<p>If this is correct, <a href='$next'>";
echo "Login to your Google Account</a></p>";
echo "</body>\n</html>";

}

Unfortunately this caused nothing to be displayed and such is my
ignorance of php I could not figure out what was going wrong.
I think I'm on the right track but I'm flummoxed as how to proceed
from here. Currently the plugin cannot generally be used in a multi-
site configuration without a fix for this.

Cheers
Mark

On Jun 3, 8:51 am, carlo.savore...@gmail.com wrote:
> Hi, I try to use PWA+PHP in a multi site wordpress installation and it does
> not work.
>
> I discover the problem is in the link created to generate to google token.
>
> In  the Settings section -> PWA+PHP  -> token generation
> If I am in a specific site inside my wordpress installation the link used to
> connect to google is something similar to
>
> https://www.google.com/accounts/AuthSubRequest?scope=http%3A%2F%2Fpic...
> *www.MYSITE.it*%2F*wp-admin*
> %2Foptions-general.php%3Fpage%3Dpwaplusphp%26loc%3Dreturn
>
> This link generates the token but the return page is the main site of the
> wordpress installation and not in the specific site admin panel
>
> To work in a multisite installation it should be:https://www.google.com/accounts/AuthSubRequest?scope=http%3A%2F%2Fpic...
> *www.MYSITE.it*%2F*SUBSITE*
> %2Fwp-admin%2Foptions-general.php%3Fpage%3Dpwaplusphp%26loc%3Dreturn

Scott

unread,
Jun 23, 2011, 4:27:31 PM6/23/11
to PWA + PHP
Mark, for MU installation, you should be able to use wordpress'
get_bloginfo function to provide the data you want to use in place of
$_SERVER['REQUEST_URI']. Try something like:

<?php $blog_url = get_bloginfo('url'); ?>

Then insert $blog_url in place of the $_SERVER variable.

If you get stuck, let me know and I can make the changes here and pass
them along.

Scott

On Jun 23, 3:27 pm, MarkPea <markhpear...@gmail.com> wrote:
> OK, so I'm trying to do this properly. Editing the URL so that it
> displays 'quake.sergius.earlham.edu/markp/wp-admin' does force the
> procedure to complete properly. But I'd like to edit the code so that
> the URL works in a Multisite configuration. However, I was not sure
> whrether to use $_SERVER['REQUEST_URI'] or $_SERVER['SCRIPT_NAME'] to

agentm...@googlemail.com

unread,
Jun 23, 2012, 12:38:55 AM6/23/12
to pwapl...@googlegroups.com

Scott M

unread,
Jun 27, 2012, 5:48:44 PM6/27/12
to agentm...@googlemail.com, pwapl...@googlegroups.com

Please see:

http://code.google.com/p/pwaplusphp/issues/detail?id=172

--
You received this message because you are subscribed to the Google Groups "PWA + PHP" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pwaplusphp/-/i31hbpaD9c0J.
To post to this group, send email to pwapl...@googlegroups.com.
To unsubscribe from this group, send email to pwaplusphp+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pwaplusphp?hl=en.
Reply all
Reply to author
Forward
0 new messages