What is /local/externserverfile.php ??

What is /local/externserverfile.php ??

από Howard Miller -
Αριθμός απαντήσεων: 5
Φωτογραφία Core developers Φωτογραφία Documentation writers Φωτογραφία Particularly helpful Moodlers Φωτογραφία Peer reviewers Φωτογραφία Plugin developers

I the url resource, lives this bit of code:

function url_get_encrypted_parameter($url, $config) {
    global $CFG;

    if (file_exists("$CFG->dirroot/local/externserverfile.php")) {
        require_once("$CFG->dirroot/local/externserverfile.php");
        if (function_exists('extern_server_file')) {
            return extern_server_file($url, $config);
        }
    }
    return md5(getremoteaddr().$config->secretphrase);
}

What is /local/externserverfile.php that it is trying to find. I can't find it documented anywhere. 

Μέσος όρος βαθμολογίας: -
Σε απάντηση σε Howard Miller

Re: What is /local/externserverfile.php ??

από Steven Mao -

Hi Howard,

This is probably a file left by another developer who worked on your Moodle code. Maybe try to run grep -r -l 'url_get_encrypted_parameter' moodledirectory to see which files call this function?

Someone please correct if I am wrong but the /local directory is supposed to be where one installs local plugins and should be empty with a clean installation, except for a readme.txt file I believe.

Hope this helps!

Mao

Σε απάντηση σε Steven Mao

Re: What is /local/externserverfile.php ??

από Howard Miller -
Φωτογραφία Core developers Φωτογραφία Documentation writers Φωτογραφία Particularly helpful Moodlers Φωτογραφία Peer reviewers Φωτογραφία Plugin developers

Thanks but no it isn't. 'git blame' shows it was part of the original commit of the new 'url' resource written by Petr Skoda quite some time ago. 

You are right - local/ does not ship with any plugins at all. However, the above is in core code and is looking for a file in local/ with a specific name and then a specific function within that file. Typically, it won't find a file of course. 

Σε απάντηση σε Howard Miller

Re: What is /local/externserverfile.php ??

από Dan Marsden -
Φωτογραφία Core developers Φωτογραφία Particularly helpful Moodlers Φωτογραφία Peer reviewers Φωτογραφία Plugin developers Φωτογραφία Plugins guardians Φωτογραφία Testers Φωτογραφία Translators
Σε απάντηση σε Dan Marsden

Re: What is /local/externserverfile.php ??

από Howard Miller -
Φωτογραφία Core developers Φωτογραφία Documentation writers Φωτογραφία Particularly helpful Moodlers Φωτογραφία Peer reviewers Φωτογραφία Plugin developers

Ha! I'd forgotten - with a bit more research I discovered it was actually the same client asking me much the same question at the time. 

They wanted to modify the way the 'secretphrase' feature works and that looked like some form of candidate.