From 3b59ba8c73791246993bc0222ecdb4a3279ca81d Mon Sep 17 00:00:00 2001 From: jerome mouneyrac Date: Fri, 6 Nov 2009 08:17:09 +0000 Subject: [PATCH] webservice MDL-17135 add logging to add/edit/delete service action --- admin/webservice/service.php | 7 ++++--- lang/en_utf8/webservice.php | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/admin/webservice/service.php b/admin/webservice/service.php index 422a9b2f78..63771d15e1 100644 --- a/admin/webservice/service.php +++ b/admin/webservice/service.php @@ -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); diff --git a/lang/en_utf8/webservice.php b/lang/en_utf8/webservice.php index e7a1ae9aac..5d392f245d 100644 --- a/lang/en_utf8/webservice.php +++ b/lang/en_utf8/webservice.php @@ -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'; -- 2.39.5