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 6160759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:21:33+00:00 2026-05-23T21:21:33+00:00

I let users create a profile and use 36 chars profile id’s. The users/profile.ctp

  • 0

I let users create a profile and use 36 chars profile id’s. The users/profile.ctp file was originally the users/view.ctp file baked by Cake.

The url looks like example/users/profile/3213123-12313-12313-4544534

I want to prevent that other users access each others profiles or edit pages: e.g. achievements/edit

I block certain actions with ACL, but users are in the same ‘group’ with the same access rights.

How can I make sure that a user can only access his profile / methods and that users that access other people profiles through the url are redirected to the homepage. Should I do this through advanced ACL or do I miss some simple code here.

  • 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-23T21:21:34+00:00Added an answer on May 23, 2026 at 9:21 pm

    when your user is connected, his info stays in session. So in your UsersController you could do something like this:

    function profile($user_id){ // let's say that the 36chars is the user's id
        if($user_id !== $this->Auth->user('id')){
            $this->cakeError("error404"); // or redirect to a view saying that he doesn't have access
        }
    
        // ... do your stuff
    }
    

    maybe you’ll need to do the same thing in different methods of different controllers. You might create a Component to do this, or add a method in the AppController.

    Good Luck!

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

Sidebar

Related Questions

I built a LAMP web application that let's users create their own profile page
We let users create ad-hoc queries in our website. We would like to have
I have a .NET app and I let users to create their account. Right
I'm using codemirror http://marijn.haverbeke.nl/codemirror/ to let users create their own web templates inside a
I have created a Link DataObject to automatically let users create a reference to
I have an and users can login and view their own profile with a
I'm creating an app that will use UIImagePicker to let users pull custom images
I let users embed videos from Youtube, Google, Vimeo etc. I thought about the
I want to let users specify a date that may or may not include
I need to let users of an application open a folder by clicking a

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.