Fix doc issues
This commit is contained in:
parent
78ec637899
commit
b2d2adad55
6 changed files with 38 additions and 12 deletions
4
auth.php
4
auth.php
|
@ -107,7 +107,7 @@ class auth_plugin_userkey extends auth_plugin_base {
|
|||
/**
|
||||
* Redirects the user to provided URL.
|
||||
*
|
||||
* @param $url URL to redirect to.
|
||||
* @param string $url URL to redirect to.
|
||||
*
|
||||
* @throws \moodle_exception If gets running via CLI or AJAX call.
|
||||
*/
|
||||
|
@ -134,8 +134,6 @@ class auth_plugin_userkey extends auth_plugin_base {
|
|||
/**
|
||||
* Logs a user in using userkey and redirects after.
|
||||
*
|
||||
* @TODO: refactor this method to make it easy to read.
|
||||
*
|
||||
* @throws \moodle_exception If something went wrong.
|
||||
*/
|
||||
public function user_login_userkey() {
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace auth_userkey;
|
||||
|
||||
/**
|
||||
* Key manager class.
|
||||
*
|
||||
|
@ -21,9 +23,6 @@
|
|||
* @copyright 2016 Dmitrii Metelkin (dmitriim@catalyst-au.net)
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace auth_userkey;
|
||||
|
||||
class core_userkey_manager implements userkey_manager_interface {
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,6 +22,12 @@
|
|||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
/**
|
||||
* Upgrade hook.
|
||||
*
|
||||
* @param string $oldversion Old version of the plugin.
|
||||
* @return bool
|
||||
*/
|
||||
function xmldb_auth_userkey_upgrade($oldversion) {
|
||||
global $DB;
|
||||
|
||||
|
|
|
@ -28,6 +28,13 @@ require_once($CFG->libdir . "/externallib.php");
|
|||
require_once($CFG->dirroot . "/webservice/lib.php");
|
||||
require_once($CFG->dirroot . "/auth/userkey/auth.php");
|
||||
|
||||
/**
|
||||
* Webservices for auth_userkey.
|
||||
*
|
||||
* @package auth_userkey
|
||||
* @copyright 2016 Dmitrii Metelkin (dmitriim@catalyst-au.net)
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class auth_userkey_external extends external_api {
|
||||
|
||||
/**
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
* @copyright 2016 Dmitrii Metelkin (dmitriim@catalyst-au.net)
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
class auth_userkey_externallib_testcase extends advanced_testcase {
|
||||
/**
|
||||
* User object.
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace auth_userkey;
|
||||
|
||||
/**
|
||||
* Fake userkey manager for testing.
|
||||
*
|
||||
|
@ -21,20 +23,35 @@
|
|||
* @copyright 2016 Dmitrii Metelkin (dmitriim@catalyst-au.net)
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace auth_userkey;
|
||||
|
||||
class fake_userkey_manager implements userkey_manager_interface {
|
||||
|
||||
/**
|
||||
* Create key.
|
||||
*
|
||||
* @param int $userid user ID.
|
||||
* @param null $allowedips Allowed IPs.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function create_key($userid, $allowedips = null) {
|
||||
return 'FaKeKeyFoRtEsTiNg';
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete keys for a user.
|
||||
*
|
||||
* @param int $userid User ID to delete keys for.
|
||||
*/
|
||||
public function delete_keys($userid) {
|
||||
// TODO: Implement delete_keys() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate provided key.
|
||||
*
|
||||
* @param string $keyvalue Key to validate.
|
||||
*
|
||||
* @return object|void
|
||||
*/
|
||||
public function validate_key($keyvalue) {
|
||||
// TODO: Implement validate_key() method.
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue