CodeIgniter Forums
Show content for scpecific user - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Show content for scpecific user (/showthread.php?tid=53276)



Show content for scpecific user - El Forum - 07-17-2012

[eluser]ardillanet[/eluser]
Hello

I am developing an intranet and all user are registred. But I need show some content of intranet just for one specific user.


In my view I have this:

Code:
if($this->session->userdata('logged_in'))
   {
   $session_data = $this->session->userdata('logged_in');
     $data['username'] = $session_data['username'];
echo 'here I show some content';

But all user can see this content.

How can I do for show so for one user?

If somebody have any idea I really will happy Wink


Show content for scpecific user - El Forum - 07-17-2012

[eluser]solid9[/eluser]
wow confusing dude,

First of all why you wanted only one person can view the content?

You need to elaborate more dude so we can help you.




Show content for scpecific user - El Forum - 07-17-2012

[eluser]PhilTem[/eluser]
You need to obviously match the current user's username against the name that may only view the content. Just that simple.

Though it sounds a little like you have little to no knowledge of coding PHP or other languages in general? Please tell me that I'm wrong!


Show content for scpecific user - El Forum - 07-17-2012

[eluser]CroNiX[/eluser]
I would match their user ID, or user level, rather than their username. Most systems allow for users to be able to change their username.


Show content for scpecific user - El Forum - 07-17-2012

[eluser]ardillanet[/eluser]
I solve this. CI run like PHP ever, I'm fool Sad

I did this:

Code:
if($this->session->userdata('logged_in'))
   {

   $session_data = $this->session->userdata('logged_in');
     $data['username'] = $session_data['username'];
     if ($data['username']=='userX')
     {
echo 'show some content";
}



Thank you to all Wink

Regrads
Arol