webservice MDL-17135 add logging to add/edit/delete service action

This commit is contained in:
jerome mouneyrac 2009-11-06 08:17:09 +00:00
parent 975341d161
commit 3b59ba8c73
2 changed files with 8 additions and 3 deletions

View File

@ -57,6 +57,7 @@ if ($action == 'delete' and confirm_sesskey() and $service and empty($service->c
$DB->delete_records('external_services_users', array('externalserviceid'=>$service->id));
$DB->delete_records('external_services_functions', array('externalserviceid'=>$service->id));
$DB->delete_records('external_services', array('id'=>$service->id));
add_to_log(1, 'webservice', 'delete', $CFG->wwwroot."/admin/settings.php?section=externalservices", get_string('deleteservice', 'webservice', $service));
redirect($returnurl);
}
@ -74,12 +75,12 @@ if ($mform->is_cancelled()) {
if (empty($data->id)) {
$data->timecreated = mktime();
$DB->insert_record('external_services', $data);
//TODO: logging
$data->id = $DB->insert_record('external_services', $data);
add_to_log(1, 'webservice', 'add', $CFG->wwwroot."/admin/settings.php?section=externalservices", get_string('addservice', 'webservice', $data));
} else {
$data->timemodified = mktime();
$DB->update_record('external_services', $data);
//TODO: logging
add_to_log(1, 'webservice', 'edit', $CFG->wwwroot."/admin/settings.php?section=externalservices", get_string('editservice', 'webservice', $data));
}
redirect($returnurl);

View File

@ -4,10 +4,13 @@ $string['accessexception'] = 'Access control exception';
$string['addfunction'] = 'Add function';
$string['addfunctionhelp'] = 'Select the function to add to the service.';
$string['addrequiredcapability'] = 'Assign/Unassign the required capability';
$string['addservice'] = 'Add a new service: $a->name (id: $a->id)';
$string['actwebserviceshhdr'] = 'Active web service protocols';
$string['configwebserviceplugins'] = 'For security reasons enable only protocols that are used.';
$string['deleteservice'] = 'Delete the service: $a->name (id: $a->id)';
$string['deleteserviceconfirm'] = 'Do you really want to delete external service \"$a\"?';
$string['disabledwarning'] = 'All webs service protocols are disabled, the \Enable web services\" setting can be found in the \"Advanced features\" section.';
$string['editservice'] = 'Edit the service: $a->name (id: $a->id)';
$string['enabled'] = 'Enabled';
$string['execute'] = 'Execute';
$string['executewarnign'] = 'WARNING: if you press execute your database will be modified and changes can not be reverted automatically!';
@ -26,6 +29,7 @@ $string['protocol'] = 'Protocol';
$string['removefunction'] = 'Remove';
$string['removefunctionconfirm'] = 'Do you really want to remove function \"$a->function\" from service \"$a->service\"?';
$string['requiredcapability'] = 'Required capability';
$string['selectedcapabilitydoesntexit'] = 'The currently set required capability ($a) doesn\'t exist anymore. Please change it and save the changes.';
$string['restrictedusers'] = 'Authorised users only';
$string['selectedcapability'] = 'Selected';
$string['servicename'] = 'Service name';