Hi,
in the flat file version (and i think in DBman sql 1.x as well), if you want to hook a complete new function into the main loop you just add in db.cgi
...
# Main Menu. Check to see what the user requested, then, if he has permission for that
# request, do it. Otherwise send the user off to an unauthorized request page.
if ($in{'add_form'}) { if ($per_add) { &html_add_form; } else { &html_unauth; } }
# added for new_func
elsif ($in{'new_func'}) { if ($per_view) { &new_func; } else { &html_unauth; } }
...
}
What would mimic this in a plugin? (including the authorisation part)
In the XML sample an existing function (search_results) is altered. I think I understand this concept.
In the "static pages" plugin the hook is put in front (PRE) of "home" and gets triggerd using a do=home in the query string (db.cgi?do=home&page=page.html). Is this the way to do it? How ist authorisation handled?
Thanks,
Henning
in the flat file version (and i think in DBman sql 1.x as well), if you want to hook a complete new function into the main loop you just add in db.cgi
Code:
sub main { ...
# Main Menu. Check to see what the user requested, then, if he has permission for that
# request, do it. Otherwise send the user off to an unauthorized request page.
if ($in{'add_form'}) { if ($per_add) { &html_add_form; } else { &html_unauth; } }
# added for new_func
elsif ($in{'new_func'}) { if ($per_view) { &new_func; } else { &html_unauth; } }
...
}
What would mimic this in a plugin? (including the authorisation part)
In the XML sample an existing function (search_results) is altered. I think I understand this concept.
In the "static pages" plugin the hook is put in front (PRE) of "home" and gets triggerd using a do=home in the query string (db.cgi?do=home&page=page.html). Is this the way to do it? How ist authorisation handled?
Thanks,
Henning