Cron Interval Actions is a module to create hooks which will be executed on
timed intervals ran by the cron.
When this module is enabled, an administration page becomes available on
admin/config/system/cron_interval_actions.
This administration page brings the permission 'Administer Cron Interval Action Settings'.
On this page it is possible to create multiple intervals. Each interval generates
an unique hook generated from the
interval name. Once created, the interval name can be changed but the hook name
stays the same.
This hook can be implemented in your own module. All code in this hook will be
executed every interval you have configured.
For example: You create an interval named 'Monthly Digest' and you set the interval
to the first day of every month. The hook 'hook_cia_action_monthly_digest' becomes
available. Every first of the month this hook gets called by the cron and executes
your code. See below for an example hook.
Cron Interval Actions are exportable by features.
Project page: https://www.drupal.org/project/cron_interval_actions
git clone --branch 7.x-1.x https://git.drupal.org/project/cron_interval_actions.git
Similar modules:
Both modules provide extensive support for cron handling. Cron Interval Actions aims to do the same, but simpler. It allows the user to execute custom code on specified intervals. Nothing more, nothing less.
Also, unlike the modules mentioned above, Cron Interval Actions makes no use of existing cron jobs but provides a unique hook per interval. This makes the management and maintenance of cron jobs code easier for the user.
Manual reviews of other projects:
[D7] Taxonomy Server - https://www.drupal.org/node/2267611#comment-11093671
[D7] wait_timeout - https://www.drupal.org/node/2364165#comment-11093749
[D7] Wrap Word - https://www.drupal.org/node/2498921#comment-11093841
| Comment | File | Size | Author |
|---|---|---|---|
| #26 | cia-security-2563595-26.diff | 5.36 KB | franskuipers |
| #4 | Screen Shot 2015-09-08 at 11.24.09 pm.png | 33.28 KB | purushotam.rai |
Comments
Comment #2
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxPatrickScheffer256359...
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #3
patrickscheffer commentedComment #4
purushotam.rai commentedAutomated Review
[No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.]
Manual Review
Comment #5
purushotam.rai commentedComment #6
purushotam.rai commentedAdding the tag as per #4.
Comment #7
purushotam.rai commentedComment #8
patrickscheffer commentedComment #9
patrickscheffer commentedComment #10
patrickscheffer commented@purushotam.rai Thanks for the feedback! I have fixed the issues and updated the description.
Comment #11
leewillis77 commentedAutomated Review
Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
FILE: /var/www/drupal-7-pareview/pareview_temp/cron_interval_actions.module
---------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------
340 | ERROR | [x] Whitespace found at end of line
Pretty minor, and shouldn't stop acceptance.
Manual Review
Individual user account
Follows the guidelines for individual user accounts.
No duplication
Does not cause module duplication and/or fragmentation. While I think that other modules provide the same functionality as this one does - they also provide a wide range of other functionality that I can imagine is not always needed by people who need this functionality. I can see myself using this module, but discounting the others as too heavyweight.
Master Branch
Follows the guidelines for master branch.
Licensing
Follows the licensing requirements.
3rd party assets/code
Follows the guidelines for 3rd party assets/code.
README.txt/README.md
A README.md is provided which is useful and covers many of the points of interest. The code example at the end of the document should be marked up as pre-formatted so that formatting is preserved when rendered by a markdown renderer.
Code long/complex enough for review
Follows the guidelines for project length and complexity.
Secure code
Meets the security requirements.
Coding style & Drupal API usage
Nothing major. I'd consider the first two as needing fixing though, the rest are just suggestions.
Comment #12
patrickscheffer commented@leewillis77 Thanks for your feedback, I fixed all your comments. Good job finding the double encoding issue!
Comment #13
patrickscheffer commentedComment #14
ayesh commentedHi Patrick,
I have not tested the module fully yet, but to mention a few points;
- In the menu callback for
admin/config/system/cron_interval_actions/test_run/%, since it only has an access check, this menu router is vulnerable to cross site request forgery.For example, suppose someone tricks an administrator with
administer cia settingspermission to open a URL that would run the cron.<img src="http://example.com/admin/config/system/cron_interval_actions/test_run/5">.Administrator is not aware of this, but if the administrator is logged in to example.com, he would have run the cron with id 5.
You can overcome this by adding a token to the URL and validate it before running the cron test run.
drupal_get_token()anddrupal_valid_token()make that dead easy.- Also, please do not use
drupal_goto()inside a form_submit function. This will prevent Drupal from executing the full form submit (allow form_altered additional submit handlers from running) becausedrupal_goto()callsdie()when called. Setting the destination to$form_state['redirect']will do the trick.Comment #15
patrickscheffer commentedHello Ayesh,
I didn't think about cross site request forgery, so thanks for pointing it out! I added the token as you suggested and also changed drupal_goto to $form_state['redirect'].
Let me know if you find anything else!
Comment #16
frans commentedGood Job Patrick.
Used it today in a project. Simple and effective!
Comment #17
jeroen.b commentedDid a manual code review and did not find any issues.
All issues mentioned above are fixed so I'll mark this Reviewed & Tested.
Comment #18
patrickscheffer commentedComment #19
patrickscheffer commentedComment #20
patrickscheffer commentedComment #21
PA robot commentedProject 1: https://www.drupal.org/node/2563595
Project 2: https://www.drupal.org/node/2707655
As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).
If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #22
patrickscheffer commentedComment #23
patrickscheffer commentedComment #24
klausiplease don't remove the security tag, we keep that for statistics and to show examples of security problems.
manual review:
Those are blockers right now, because you need to know when to use check_plain() and when not.
Comment #25
patrickscheffer commentedMy apologies for removing the security tag, I couldn't find a clear description what it meant so I thought it indicated I still had some security issues.
Thanks for pointing out how to use the check_plain() function properly! I've edited my code to save the original user input and only sanitize it on output. I have also added an extra validation check on the custom interval input.
Comment #26
franskuipers commentedI have reviewed all the code on security issues, both point from #24 are fixed.
For completeness I included the git diff output for the last changes.
Comment #27
klausimanual review:
But otherwise looks good to me.
Thanks for your contribution, Patrick!
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #28
patrickscheffer commentedThanks, Klausi! I will update my git repo and look into the watchdog messages.
Many thanks to all reviewers for investing some time in my module, I appreciate it!
Comment #29
patrickscheffer commentedComment #31
avpadernoI am giving credits to the users who participated in this issue.