Compare commits

..

No commits in common. "master" and "v1.1.0" have entirely different histories.

3 changed files with 10 additions and 26 deletions

View File

@ -1,17 +0,0 @@
name: Workflow
on: [push]
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: yesolutions/mirror-action@master
with:
REMOTE: 'https://git.popov.link/moodle/auth_link.git'
GIT_USERNAME: ${{ secrets.GIT_USERNAME }}
GIT_PASSWORD: ${{ secrets.GIT_PASSWORD }}

View File

@ -127,11 +127,13 @@ class auth_plugin_link extends auth_plugin_base {
public function loginpage_hook() { public function loginpage_hook() {
global $DB; global $DB;
$username = optional_param('username', '', PARAM_RAW);
$password = optional_param('password', '', PARAM_RAW);
if (!isloggedin()) { if (!isloggedin()) {
if (!empty($username) && !empty($password)) { if (isset($_REQUEST['username']) &&
isset($_REQUEST['password'])) {
$username = htmlspecialchars($_REQUEST['username']);
$password = htmlspecialchars($_REQUEST['password']);
// User existence check. // User existence check.
if ($user = $DB->get_record('user', array('username' => $username) )) { if ($user = $DB->get_record('user', array('username' => $username) )) {
// Verification of authorization data. // Verification of authorization data.
@ -150,13 +152,12 @@ class auth_plugin_link extends auth_plugin_base {
public function redirect_user() { public function redirect_user() {
global $CFG, $SESSION; global $CFG, $SESSION;
$wantsurl = optional_param('wantsurl', '', PARAM_URL);
$redirect = new moodle_url($CFG->wwwroot, $_GET); $redirect = new moodle_url($CFG->wwwroot, $_GET);
if (isset($SESSION->wantsurl)) { if (isset($SESSION->wantsurl)) {
$redirect = new moodle_url($SESSION->wantsurl, $_GET); $redirect = new moodle_url($SESSION->wantsurl, $_GET);
} else if (!empty($wantsurl)) { } else if (isset($_GET['wantsurl'])) {
$redirect = new moodle_url($wantsurl); $redirect = htmlspecialchars($_GET['wantsurl']);
} }
redirect($redirect); redirect($redirect);

View File

@ -23,8 +23,8 @@
*/ */
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
$plugin->release = '1.1.1 (Build: 2018061010)'; $plugin->release = '1.1.0 (Build: 2018061000)';
$plugin->version = 2018061010; $plugin->version = 2018061000;
$plugin->requires = 2016112900; $plugin->requires = 2016112900;
$plugin->component = 'auth_link'; $plugin->component = 'auth_link';
$plugin->maturity = MATURITY_STABLE; $plugin->maturity = MATURITY_STABLE;