Zendamf Authentication - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Zendamf Authentication (/showthread.php?tid=43918) |
Zendamf Authentication - El Forum - 07-27-2011 [eluser]Unknown[/eluser] Hi, I posted this on stack overflow and have not had much of a response so I thought I would try it here: I am trying to get zendamf working with my codeigniter installation. I want to ensure that the user has logged on before allowing them to make any requests to any of the services. I have the following piece of code in my construct for the Testservice.php file. Code: function __construct() Code: public function getMessage() When i make a call to the service I get the string 'getmessage' returned irrespective of being logged in or not. I can see the log messages been written for the login check but it I want it to send me the text specifed in the return for each of the conditions. Any ideas Thanks in advance JaChNo Zendamf Authentication - El Forum - 07-27-2011 [eluser]ranjudsokomora[/eluser] JaChNo, I believe you are getting that because your if statement returns false. Trying changing it to Code: IF ($this->session->userdata['user_id']!==FALSE) { Zendamf Authentication - El Forum - 07-28-2011 [eluser]Unknown[/eluser] well spotted it seems you have found my deliberate mistake. here is the correct code. i still get the issue. Code: if(isset($this->session->userdata['user_id'])) it seems that once it hits the exit it carries on to the function? but i thought that exit should then make it stop running anything else. Zendamf Authentication - El Forum - 07-28-2011 [eluser]ranjudsokomora[/eluser] JaChNo, The reason this is not exiting the script is because you have return statements. The return will exit the function, not the script. Try this. Code: IF ($this->session->userdata['user_id']===FALSE) { |