Using Wordpress and zend framework to serve the same website - php

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.

Related

How to link WordPress website to an external Laravel application?

I have developed a Laravel application that is currently being used by my clients. I am in the midst of developing a simple WordPress website to advertise my services and basically showcase what I do.
I'm unsure on what the best way is to link the two.
My domain is www.themacrocoach.co.uk
I'm thinking the best way to do this would be if the client logs in from: www.themacrocoach.co.uk/login
Which then automatically redirects to:
www.themacrocoach.co.uk/dashboard
Upon logging out, the user is redirected back the WordPress website:
www.themacrocoach.co.uk
The dilemma I have is how to set all this up? Currently my server only has the Laravel application residing on it.
Do I keep everything on one server or split them across two?

PHP pages behind asp.net forums authentication

Been searching for an answer to this but read some conflicting reports.
I have a asp.net website with forms authentication setup and I'm adding some php pages to a subfolder within the site. I want these pages to follow the same authentication as the rest of the site, ie be bounced to my asp.net login form if not logged in.
Currently if I access a file http://localhost/test/test.php it is serving it even if I'm not logged in. However if I just browse to the folder http://localhost/test/ it does bounce me to login page. Guess I need to force these PHP pages through the asp pipeline but is this possible in classic mode / iis6?
I seem to have got this working by doing the following:
Convert folder containing my app into an application in iis 6 manager
Click Configuration in the Directory tab of the properties dialog for the above folder and define a wildcard mapping pointing to c:\windows\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll

URL redirect for public profiles like facebook does

i'm building a site for my company, this site will be in some way like facebook or other social sites, and the user will have a public profile page. I can't find, or maybe i don't know where to look for, any information on how to do something to create that public page without creating a specific page for each user, i want to do something like facebook does when you type a username after the facebook url (EX. http://www.facebook.com/ANYUSERNAME) and then you fall into the profile page, somebody can help me with an idea? The development server is a windows 2008 using IIS 7.5 and PHP but the production server will be mandriva or any other linux distro with apache and php. Thnxs a lot to everyone in advance.
dynamic URLs are done on most Unix/Linux based systems in Apache, by a plugin called 'mod_rewrite'. However, you are running windows. IIS has a rewrite plugin by Microsoft.
http://www.iis.net/download/URLRewrite
Essentially the behavior ends up being that you set up rules for specific folders or other things. If a page doesn't physically exist on disk, or doesn't end in .php, run the ruleset. if it matches the rule, pass it to a real page as a querystring or other variable to the codepage. If it doesn't exist, throw a 404.
You'll need mod_rewrite (for IIS) and implement the front-controller pattern (usually in index.php).
The front-controller will then check the first segment of the URL (in your example it'll be ANYUSERNAME) and, if that route doesn't exist you can assume it's a user profile page. You can then choose to redirect the user to that specific profile page (something like /profile/USER), or just display it directly.

IIS forms auth using PHP

I have a website with PHP and 3 different .Net apps in 3 different subfolders. All is working well.
The PHP app has authentication builtin with ye old "include security_check.php" on top. The PHP app also has the user editor (logins) and is the star of the show.
I would like to extend the PHP security scheme to include the .Net apps. To do this I am thinking something in the direction of a web.config placed in the root with .Net forms auth configured. This should include all subfolders.
How would this affect web.config inheritence in subfolders?
Can I use PHP to handle the logins directly? Or do I have to use ASPX to check for cookie containing username (set on successful auth in PHP), then redirect to PHP login if it is missing?

Communication between two subdomains. Zend Framework

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.

Categories