Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Template Questions /

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


Reply


449 Views

Avatar
ihaveqquestion

Community Member, 12 Posts

29 October 2013 at 2:01pm

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.