Jump to:

3392 Posts in 976 Topics by 852 members

Template Questions

SilverStripe Forums » Template Questions » specific user can only access to certain files, images, forum etc.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 324 Views
  • ihaveqquestion
    Avatar
    Community Member
    12 Posts

    specific user can only access to certain files, images, forum etc. Link to this post

    Hey there,

    Im quite new to website building.

    currently, what we wish to achieve is that for each user, he or she can only access to specific content of the website with same presentation. According to username, one user can his/her image, files, forum etc. and the rest documents for other users are hidden.
    also everything needs to be done under one domain.

    can someone tell me how i need to structure it? I have done a bit research regarding MCV. I have drafted unfinished code as following, (newpage.php in mysite/code)

    <?php
    class NewPage extends Page {

       
    }
    class NewPage_Controller extends Page_Controller {
       
       static $allowed_actions = array(
    'NewPage'
          
       public function NewPage(){
          
          $this->load->model('login_model');
          $data['Member'] = $this->login_model->get_member();
          $this->load->view('Page', $data);
       
          if ($member = Member::currentUser())
          {
             
          $sqlQuery = new SQLQuery();
          
          $sqlQuery= "SELECT GroupID from Group_Members where MemberID='.$member->ID'"
          
          $rawSQL = $sqlQuery->sql();
          $result = $sqlQuery->execute();
          $groupid = $result->first();
          }
          
          else {
          }   
          
       }
    }

    thanks for your help in advance.

  • Johnny9
    Avatar
    Community Member
    15 Posts

    Re: specific user can only access to certain files, images, forum etc. Link to this post

    Hi, are you talking about each member individual profile page?

    324 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.