Using the bit of code for logged in user
Permalink Browser Info Environment
Hi John,
I am ina situation where a logged in user should be executing the code and I see you included what looks like a very handy piece of code to do just that.
Problem is, I don't see how to use it in the context of the job.
Could you help please?
Thank you
I am ina situation where a logged in user should be executing the code and I see you included what looks like a very handy piece of code to do just that.
Problem is, I don't see how to use it in the context of the job.
Could you help please?
Thank you
Type: | Discussion |
---|---|
Status: | Archived |
:/ OK, If I figure out how to do that, I'll let you know.
Thank you.
Thank you.
Actually there's a function in the library that uses that bit of code. It is commented out, I don't know why.
The function is
As it is written here, If I try t get content from a page only visible to a particular group of users, I won't be able to see it since it uses $req->setCustomRequestUser(false);
Even if I'm logged in as admin, I won't see it.
The function is
public function getPageContent(Page $c) { ob_start(); $v = View::getInstance(); $v->disableEditing(); $v->setCollectionObject($c); $req = Request::get(); $req->setCustomRequestUser(false); $req->setCurrentPage($c); $v->render($c); $contents = ob_get_contents(); ob_end_clean(); return $contents; }
As it is written here, If I try t get content from a page only visible to a particular group of users, I won't be able to see it since it uses $req->setCustomRequestUser(false);
Even if I'm logged in as admin, I won't see it.
If you find out more, please post whatever you find. I suspect it will come in useful to others.
http://www.concrete5.org/community/forums/jobs1/using-fileimporter-...