1 Oct 11:55
Re: HELP: mgd_update_article - Authentication in php?
Marcin Soltysiak wrote:
>>I want to run the "mgd_update_article" function inside a php script
>>hosted in midgard.
>>
>>The problem is that the function results in a "Access Denied" error for
>>the article that I want to update. This is obviously because the user
>>running the script needs "write" access to the requested article.
>>
>>The question is how do I give an anonymous user write access to a given
>>article? The user must be anonymous because I am calling
>>the script from a Cron job !
>>
>>Alternatively I need to get the Cron to login to Midgard somehow, or
>>login as a particular user inside the php script. Can anybody help?
>
>
> <?
> mgd_auth_midgard("user+SG","password",0);
> $midgard=mgd_get_midgard();
>
> do_what_you_want($with,$parameters);
>
> ?>
>
> But beware - this cannot be a shell script. It has to be parsed by Apache and mod_midgard so it could be wise to
restrict access to the page to localhost only. And then call
>
> * * * * * wget -q http://www.com/you_magic_page.html
Or
lynx -auth=user+SG:password -source http://www.com/you_magic_page.html
(Continue reading)
=============================================================
RSS Feed