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

  • SEARCH
  • Home
  • 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 6864613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:56:00+00:00 2026-05-27T02:56:00+00:00

We are developing a site using ZendFrame work. We need to set a auth

  • 0

We are developing a site using ZendFrame work.

We need to set a auth variable(role) to manage user-type.

For that we use a variable this->view->auth->getIdentity()->role to manage user-type.

In one chase we are trying to assign the user-type statically.

What is the code to assign the auth variable ‘role’.

We tried with this->view->auth->getIdentity()->role = 'test', but it through warning.

  • 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-27T02:56:01+00:00Added an answer on May 27, 2026 at 2:56 am

    The following should allow you to create a new Zend_Auth identity upon successful login :

    $identity = Zend_Auth::getInstance()->getStorage();
    $identity->write($userData);
    

    As for the user data, I usually store the database row corresponding to the user with the required fields like Name, surname, email, role, to name a few. If you store a Zend_Db_TableRow in the Zend_Auth you will be able to access it like this :

    Zend_Auth::getInstance()->getIdentity()->role;
    

    Quick reminder on Zend_Auth:

    $auth = Zend_Auth::getInstance(); // get the `Zend_Auth` instance (build on the singleton pattern)
    
    $auth->hasIdentity(); // return true if an indentity exists and false if it doesn't
    
    $auth->getIdentity(); // allow you to get the identity content (array, Zend_Db_TableRow and such)
    
    $auth->write($data): // allow to create a new identity
    
    $auth->clearIdentity(); // destroy any content stored in the identity. Zend_Session::destroy() can also be used since identity is stored in a session variable
    

    For more you can read the official documentation : Zend_Auth

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

Sidebar

Related Questions

I've been developing a site using ASP.NET MVC, and have decided to use the
I'm developing a mobile site using IUI . It's a framework that makes web
I need to get up to speed about developing a commerce site using MS-Commerce
I'm developing web site using asp.net. In my web site after login i set
I am currently developing a site using SSL that requires users to be able
I start developing a site using Rails 3.x and I need to run multiple
I am developing a site using PHP, XHTML strict, and jQuery that will be
I've recently started work on developing a site using Magento. All of my files
I am developing a site where users can buy features using paypal. If user's
I am developing a site using asp.net and C# ( framework 1.1 ). Theres

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.