开发者

Zend_Auth, Zend_Acl and Cron Jobs/Scheduled Tasks

开发者 https://www.devze.com 2023-03-14 03:18 出处:网络
I have implemented Zend_Auth & Zend_Acl into a project here at work and its working great. However, previously I had sceduled tasks running at various times of the day which now no longer work cor

I have implemented Zend_Auth & Zend_Acl into a project here at work and its working great. However, previously I had sceduled tasks running at various times of the day which now no longer work cor开发者_如何学Crectly due to the login process. These are called via cygwin wget to the URL's. I would like to know if there is a way to disable Auth/Acl for one of my controllers that does all the CRON stuff?


You could probably define a constant in your cron-script and process the authentication code based on that.

For Ex:

cron.php

<?php

define("ISCRONJOB", true);

... continue other flow

?>

in your auth-controller

<?php
# make sure you pass single-quote when checking for a defined constant
if (!defined('ISCRONJOB')) {
    ...
    ... continue authentication process
}
?>
0

精彩评论

暂无评论...
验证码 换一张
取 消