Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: plugins can occur before data is posted to the database  (Read 2533 times)

0 Members and 1 Guest are viewing this topic.

menlo_bob

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
plugins can occur before data is posted to the database
« on: March 19, 2007, 04:14:20 am »

in short: pages like editOnePic.php call load_template() by including include/init.inc.php before calling process_post_data().  this means that if any plugins use the database for dynamic content, they will use data before any modifications have been posted.  this can leave the plugins out of step with the rest of the page.

task: to require user data entry on all pictures.
design: write a plugin that queries the database at gallery_header time to see if all data is entered by the current user.  if not, add links to editOnePic.php for the offending pictures and preclude normal operation at the plugin_block plugin.
operational problem: when the user adds the last required data field, the data posting occurs after the template was loaded so the last data entry is not found by the gallery_header plugin.

workaround: when process_post_data() is called in editOnePic.php, the template is re-loaded with another call to load_template() to properly reflect the database update.

is there a better way to do this?
Logged
Pages: [1]   Go Up
 

Page created in 0.059 seconds with 19 queries.