Communication between two subdomains. Zend Framework - php

I'm adding a bulletin board to my Zend-driven site, and am using an open source one called Phorum. While it would be theoretically possible to integrate Phorum into my Zend site, it's already self contained, and not designed to run through a controller.
My solution was to make a sub-domain for Phorum, which worked quite well. However, my next desire is to integrate my login system with Phorums, so my users don't have to log in twice. My login occurs through ajax, and runs through Zend_Auth.
In order to keep my login up, I've created a controller named messageboard, which keeps my login on the page, and then loads the bulletin board through an iframe. This allows me to keep the Zend component of my login on the same page as my new bulletin board.
Here's my new problem. In integrating the login systems, I need a way of passing messages back and forth from the Phorum Iframe to the Zend site. Whether this is having Phorum check my Zend Session to see if it exists, or simply passing an ajax message from Zend to Phorum doesn't matter. Is it possible to do this, and how? I believe that two subdomains don't share the same sessions, but I'm just not sure.

You cant have a sessions (session cookie to be exact) crossing a domain.
you could add the phorum in the public folder. This should work with the default ZF rewriting rules, couse its only rewriting files which dont exist.

Related

TYPO3 a few questions about felogin

i would like to redirect to a page outside from the typo3. is this possible because i donĀ“t find a input form to do that?
I have an external PHP application. This application may only be called after a successful login. Is it possible to bind the login data from felogin to a session that I can use in my PHP application? I need the login information in my PHP application. I would like to use the felogin logout mechanism in my external PHP application. Is that possible?
Regards
MS-Tech
Not by default.
The easiest way I can think of, if the external PHP application runs on the same domain, is to alter the PHP application to read the TYPO3 frontend user cookie (fe_typo_user) and get session (fe_sessions table) and frontend user (fe_users table) data from the database.
The cleanest way I can think of is to rewrite the external PHP application as a TYPO3 extension, but I'm assuming this would be too much work.
As for the log out, you can link to the TYPO3 login page and add ?logintype=logout to the URL.

Sharing authentication between php and python on same domain

I am in the early planning stages for a new project/site. Two-thrids of the application are already written in php/laravel. The new bit will be written in python, most likely with Flask or Cherrypy (I need Nosql access, so Django is out).
The Laravel application is the primary site and manages user signups, authentication, activity streams, and notifications, as well as a general REST Api. This part of the site is already well under development, and so switching to python is not an option.
Both sections would need to feel entirely unified to the end user. The design and themes would be identical. Even the urls would show no difference:
site.com - laravel
site.com/forums - laravel
site.com/login,logout,signup - laravel
site.com/ - laravel
site.com/maker - python/flask
I think I have figured out how to serve both from the same server, but how do I share logins? The user should be able to login using laravel and navigate to /maker and still be logged in.
To keep in mind:
maker will not signup user, only make sure they are logged in. If not, redirect to laravel's login page.
Also, both have access to the same database.
What are my options here?

Using Wordpress and zend framework to serve the same website

My web site is running two server side applications: application for logged-in users running on PHP (using Zend framework) and Wordpress application for the public, non-loggedin users.
I am using Apache.
I would like that requests from logged-in users Would be served by the index.php file of Zendframework and those from non-logged in users by Wordpress index.php file.
Note, I prefer not to have different URLs for the two frameworks. For example: mydomain.com should lead to both sites according to the log-in status.
One way I thought doing this, is by always starting at Zend, check if the user is not logged-in, and if so perform _forward or similar action to Wordpress.
Is that possible? Should I do something else?
Thanks.

How to handle authentication in hybrid ASP.NET and PHP website?

I am taking over a community website that was built using Kentico (an ASP.NET-based CMS).
I have PHP/CodeIgniter code that could add interesting functionality to this Kentico website. For example, my PHP code allows for uploading and posting of user-generated material such as images, which the community can then comment on.
Since I'm unfamiliar with how Kentico works, I wonder if anyone knows if this functionality exists in it (as a module). If not, either this
would have to be coded in ASP.NET or
I could have a hybrid website using my PHP code, however authentication from the Kentico side would have to be passed the PHP side of the website.
Any suggestions on how to handle this situation?
You can store the authenticated session in the DB where both ASP and PHP have access
Look into the "User contributions module" - if you've got access to a new enough version of Kentico and the appropriate license then it will probably do exactly what you need it to.
Otherwise if you needed to do authentication from a seperate PHP app, I suppose you could write a simple web service in .Net and add it into the Kentico site. In the past I've used a .ashx generic handler to do this.
Maybe you could include a hidden iframe to the other site on each page and use postMessage in JavaScript to send a session ID between the sites.
I would probably try to keep everything all in one code base unless there was reason to break it out into a seperate module though - otherwise it just seems like a lot of extra work.

Wordpress MediaWiki Cookie Integration

I have my Wordpress install and MediaWiki sharing the same login information. Unfortunately, users need to log into both separately, but at least they use the same credentials.
What I would like to do is cause a successful login on the Wordpress blog to also cause a login for MediaWiki (ideally both directions). There are two ways this could happen:
Logging in causes a login on the other application (writes the cookie and creates the session in the DB)
Accessing an application checks for the cookie of the other and then automatically logs in.
Since the usernames are shared it seems like the latter should be pretty easy to do. Any tips would be great.
The primary problem you are going to run into is that you'll have two login forms, and two logout methods. What you need to do is pick one of the login forms as the default, and redirect the other one over to it.
I've been able to successfully integrate bbPress + MediaWiki + WordPress + WordPress MU, but I wrote a lot of custom code to do it.
I'm using the bbPress login page as the default (and .htaccess rewrite to /login/), and then I created my own MediaWiki authentication plugin (which looks a lot like the one you are using), except my plugin checks the WordPress/bbPress cookie for the login information and automatically logs the user in.
I created a customized /logout/ link that runs the bbPress logout, and also kills the MediaWiki cookies at the same time.
Then the last step was to redirect all of the other logout / login links for bbpress, mediawiki, etc, over to my consolidated one. I used .htaccess rewrites for this rather than mess with core code.
Still a work in progress, but it works fairly well.
You could consider some kind of single-sign-on software. I am unaware of any that are free and I've only ever used SiteMinder which is neither free nor good. Crowd may be better (but is again not free).
I've seen a setup going through Invision Power Board, using IpbWiki and a Wordpress integration mod. Mind you, it's expensive and excessive.
They both support OpenId now.
MediaWiki's extension
WordPress's plugin
There are probably other options for using OpenId, but I think that is the best solution available.

Categories