GithubHelp home page GithubHelp logo

moodle-auth_pop3's People

Contributors

ankitagarwal avatar dmonllao avatar doctorlard avatar iarenaza avatar marinaglancy avatar mudrd8mz avatar sbourget avatar skodak avatar stronk7 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moodle-auth_pop3's Issues

map pop3 username to local email feature

Hi

Here is my little addon I did on my moodle site, should be self-explainable.

Index: auth.php
===================================================================
--- auth.php    (wersja 4)
+++ auth.php    (kopia robocza)
@@ -137,6 +137,17 @@
         }
     }
 
+    /**
+     * {@inheritdoc} 
+     *
+     * @param string $username username
+     * @return mixed array with no magic quotes or false on error
+     */
+    function get_userinfo($username) {
+        return !empty($this->config->mapusernametoemail) 
+           ? array('email' => $username)
+            : array();
+    }
 }
 
 Index: lang/en/auth_pop3.php
===================================================================
--- lang/en/auth_pop3.php       (wersja 4)
+++ lang/en/auth_pop3.php       (kopia robocza)
@@ -34,3 +34,5 @@
 $string['auth_pop3type'] = 'Server type. If your server uses certificate security, choose pop3cert.';
 $string['auth_pop3type_key'] = 'Type';
 $string['pluginname'] = 'POP3 server';
+$string['auth_pop3mapusernametoemail'] = 'Map pop3 username to local email';
+$string['auth_pop3mapusernametoemailhelp'] = 'If an email address is used as remote pop3 username to authenticate you can map it to local email (for example to be able to lock email field).';
Index: settings.php
===================================================================
--- settings.php        (wersja 4)
+++ settings.php        (kopia robocza)
@@ -58,6 +58,11 @@
             get_string('auth_pop3changepasswordurl_key', 'auth_pop3'),
             get_string('changepasswordhelp', 'auth'), '', PARAM_URL));
 
+    // Map pop3 username to email
+    $settings->add(new admin_setting_configcheckbox('auth_pop3/mapusernametoemail',
+        get_string('auth_pop3mapusernametoemail', 'auth_pop3'),
+        get_string('auth_pop3mapusernametoemailhelp', 'auth_pop3'), ''));
+
     // Display locking / mapping of profile fields.
     $authplugin = get_auth_plugin('pop3');
     display_auth_lock_options($settings, $authplugin->authtype, $authplugin->userfields,

auth_pop3-mapusernametoemail-201807031000.diff.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.