Project: moodle
Issue MDL-40050: Replace add_to_log with an event trigger - webservices
Replace the add_to_log calls for the following area, with a call to the get_legacy_logdata function in the event class. *webservices* /webservice/lib.php:74: add_to_log(SITEID, 'webservice', get_string('tokenauthlog', 'webservice'), '', get_string('invalidtimedtoken', 'webservice'), 0); /webservice/lib.php:81: add_to_log(SITEID, 'webservice', get_string('tokenauthlog', 'webservice'), '', get_string('failedtolog', 'webservice') . ": " . getremoteaddr(), 0); /webservice/lib.php:145: add_to_log(SITEID, 'webservice', 'user unconfirmed', '', $user->username); /webservice/lib.php:151: add_to_log(SITEID, 'webservice', 'user suspended', '', $user->username); /webservice/lib.php:157: add_to_log(SITEID, 'webservice', 'nologin auth attempt with web service', '', $user->username); /webservice/lib.php:166: add_to_log(SITEID, 'webservice', 'expired password', '', $user->username); /webservice/lib.php:850: add_to_log(SITEID, 'webservice', get_string('simpleauthlog', 'webservice'), '' , get_string('failedtolog', 'webservice').": ".$this->username."/".$this->password." - ".getremoteaddr() , 0); /webservice/lib.php:870: add_to_log(SITEID, '', '', '', get_string('wsaccessuserdeleted', 'webservice', $user->username) . " - ".getremoteaddr(), 0, $user->id); /webservice/lib.php:876: add_to_log(SITEID, '', '', '', get_string('wsaccessuserunconfirmed', 'webservice', $user->username) . " - ".getremoteaddr(), 0, $user->id); /webservice/lib.php:882: add_to_log(SITEID, '', '', '', get_string('wsaccessusersuspended', 'webservice', $user->username) . " - ".getremoteaddr(), 0, $user->id); /webservice/lib.php:895: add_to_log(SITEID, '', '', '', get_string('wsaccessuserexpired', 'webservice', $user->username) . " - ".getremoteaddr(), 0, $user->id); /webservice/lib.php:902: add_to_log(SITEID, '', '', '', get_string('wsaccessusernologin', 'webservice', $user->username) . " - ".getremoteaddr(), 0, $user->id); /webservice/lib.php:929: add_to_log(SITEID, 'webservice', get_string('tokenauthlog', 'webservice'), '' , get_string('failedtolog', 'webservice').": ".$this->token. " - ".getremoteaddr() , 0); /webservice/lib.php:947: add_to_log(SITEID, 'webservice', get_string('tokenauthlog', 'webservice'), '' , get_string('failedtolog', 'webservice').": ".getremoteaddr() , 0); /webservice/lib.php:1061: add_to_log(SITEID, 'webservice', '', '' , $this->zend_class." ".getremoteaddr() , 0, $this->userid); /webservice/lib.php:1522: add_to_log(SITEID, 'webservice', $this->functionname, '' , getremoteaddr() , 0, $this->userid); /admin/webservice/service.php:61: add_to_log(SITEID, 'webservice', 'delete', $returnurl, get_string('deleteservice', 'webservice', $service)); /admin/webservice/service.php:78: add_to_log(SITEID, 'webservice', 'add', $returnurl, get_string('addservice', 'webservice', $servicedata)); /admin/webservice/service.php:88: add_to_log(SITEID, 'webservice', 'edit', $returnurl, get_string('editservice', 'webservice', $servicedata)); /admin/webservice/service_users.php:60: add_to_log(SITEID, 'core', 'assign', $CFG->admin . '/webservice/service_users.php?id=' /admin/webservice/service_users.php:74: add_to_log(SITEID, 'core', 'assign', $CFG->admin . '/webservice/service_users.php?id=' *webservice (login)* /login/token.php:164: add_to_log(SITEID, 'webservice', 'automatically create user token', '' , 'User ID: ' . $user->id); /login/token.php:174: add_to_log(SITEID, 'webservice', 'sending requested user token', '' , 'User ID: ' . $user->id);
Story points: 40