OK lets see if I can explain this.
I have a file with a form <form> that sends email to subscribers....
Now I have the leave s9y and log into that file to send emails.
Is it possible tha add a menu option i admininterface there I can put this form.
The form calls a php-file that sends away the mail.
Is there any easy why to do it?
Make an own admin_plugin
Make an own admin_plugin
Last edited by jojje on Mon Jan 30, 2006 11:02 am, edited 1 time in total.
Kind of like an HTML nugget for the admin screen?
It sounds kind of insecure to just include another file from the admin page. After all, if someone managed to overwrite it with something malicious, you'd run it without even a chance to stop it. That's why the backend doesn't even use Smarty templating. Heck, it won't even run if it's in an IFRAME.
We might manage to convince Garvin that copy-and-pasting text into an Admin HTML Nugget isn't too insecure. Then you could put the contents of the form into a nugget. But I wouldn't count on it.
You can paste the <form> directly into your admin page by modifying serendipity_admin.php. The "New Entries" link is called NEW_ENTRIES, and you can figure out from there where you want your code to go.
It sounds kind of insecure to just include another file from the admin page. After all, if someone managed to overwrite it with something malicious, you'd run it without even a chance to stop it. That's why the backend doesn't even use Smarty templating. Heck, it won't even run if it's in an IFRAME.
We might manage to convince Garvin that copy-and-pasting text into an Admin HTML Nugget isn't too insecure. Then you could put the contents of the form into a nugget. But I wouldn't count on it.
You can paste the <form> directly into your admin page by modifying serendipity_admin.php. The "New Entries" link is called NEW_ENTRIES, and you can figure out from there where you want your code to go.
A html-nugget for the admin screen sounds like something like it.
I think that if someone has manage to overwrite a php-file on my server I will have other problems than that they changed this sendmail file.
But thanks for the tip, I will look in the suggested files and see if I can make somethinh out.
I think that if someone has manage to overwrite a php-file on my server I will have other problems than that they changed this sendmail file.
But thanks for the tip, I will look in the suggested files and see if I can make somethinh out.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
You should write a plugin for that.
Something like this:
You could abstract this plugin a bit more to make the FORM output configurable via a configuration option of the plugin.
Have fun,
Garvin
Something like this:
Code: Select all
<?php
class serendipity_event_adminform extends serendipity_event {
function introspect(&$propbag) {
global $serendipity;
$propbag->add('name', 'Adminform');
$propbag->add('version', '1.0');
$propbag->add('author', 'Garvin Hicking');
$propbag->add('stackable', true);
$propbag->add('event_hooks', array(
'backend_sidebar_entries' => true,
'backend_sidebar_entries_event_display_adminform' => true
)
);
}
function event_hook($event, &$bag, &$eventData) {
global $serendipity;
$hooks = &$bag->get('event_hooks');
if (isset($hooks[$event])) {
switch($event) {
case 'backend_sidebar_entries':
if ($serendipity['serendipityUserlevel'] >= USERLEVEL_CHIEF) {
?>
<li><a href="?serendipity[adminModule]=event_display&serendipity[adminAction]=adminform">Adminform</a></li>
<?php
}
break;
case 'backend_sidebar_entries_event_display_aggregator':
?>
<form action="">
Your form here
</form>
<?php
break;
}
}
return true;
}
}
Have fun,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
I'm sorry, you'll need to replace
backend_sidebar_entries_event_display_aggregator
with
backend_sidebar_entries_event_display_adminform

Regards,
Garvin
I'm sorry, you'll need to replace
backend_sidebar_entries_event_display_aggregator
with
backend_sidebar_entries_event_display_adminform
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/