Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6974651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:15:57+00:00 2026-05-27T17:15:57+00:00

I’m building a small web app to sit within an existing WordPress membership site.

  • 0

I’m building a small web app to sit within an existing WordPress membership site.

At the moment, all of the content is protected using Digital Access Pass, which handles user authentication and content protection.

I’m thinking of using Yii for this, and installing it into a subdirectory of the WordPress site.

My plan is to have this layout:

http://www.site.com (wordpress blog)

http://www.site.com/members (content protected with the Digital Access Pass membership solution, set up in WordPress)

http://www.site.com/members/app (yii folder – protected by DAP, but not set up in WordPress)

I don’t want to do a full integration, as I’m using a lot of Ajax and that doesn’t look like it will work too well from the examples I’ve seen.

What I’d like is to use DAP to protect the pages and handle authentication, and also to pass the logged- in userid to Yii so I can use as a key to store user preferences, user data, etc.

The way DAP works is that you just insert the following code into any page you want to protect, and then you can access a User object that contains the info I need.

<?php
    include_once "../dap/dap-config.php";
    $user = null;

if( !Dap_Session::isLoggedIn() ) { 
    //send viewer to login page
    header("Location:".SITE_URL_DAP.Dap_Config::get("LOGIN_URL"));
    exit;
}
else if( Dap_Session::isLoggedIn() ) { 
    //get userid
    $session = Dap_Session::getSession();
    $user = $session->getUser();
    $user = Dap_User::loadUserById($user->getId()); //reload User object
    if(!isset($user)) {
        //send viewer to login page
        header("Location:".SITE_URL_DAP.Dap_Config::get("LOGIN_URL"));
        exit;
    } else {
        $userProducts = Dap_UsersProducts::loadProducts($user->getId());
    }
}
?>

How do I go about implementing this in Yii?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:15:58+00:00Added an answer on May 27, 2026 at 5:15 pm

    I’d start by taking a look at Yii Filters

    You should be able to put your code in the filter and then have it run (much like the built-in Access Control Filter)

    And then, if you’re going to build your app truly Yii-like, you might want to work on wrapping the DapUser in a CUserIdentity class and making it work well with the CWebUser object. It would take a bit of work, but then you’d truly have easy access to the user info in all Yii objects.

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
We're building an app, our first using Rails 3, and we're having to build
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
Seemingly simple, but I cannot find anything relevant on the web. What is the
I am writing an app with both english and french support. The app requests

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.