ATutor

Learning Management Tools







Pages:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


Bug fix for email footers v15


  • 2005-08-18 12:23:59

    Bug fix for email footers v15

    ATutor version: 1.5

    E-mail footers use a php variable defined in '/include/lib/constants.inc.php' called $_base_href to implement the URL of the server/application.

    The problem I ran in to was that this pointed to http://localhost/ . If you ran into this same problem, here is the solution I devised.

    I first made sure that my Apache server had the right name. One defines that in the httpd.conf file. I then wrote a new variable container that I inserted just after the '$_base_href' one, as follows:

    /* added by Jonathan Kaplan for email footers */
    $safe_url_parts = explode('/', $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF']);
    $_base_server = array_slice($safe_url_parts, 0, count($safe_url_parts) - $dir_deep-1);
    $_base_server = $server_protocol . implode('/', $_base_server).'/';

    Finally I replaced (in the following files) '$_base_href' by '$_base_server':
    '/include/classes/phpmailer/atutormailer.class.php'
    '/inbox/send_message.php'

    Please comment if you have come across the same problem or have found better workarounds. If the problem is to be considered as some sort of a bug, well then I'm sure those that are working on version 1.52 will take this into account :) .

  • 2005-08-18 13:14:28

    .

    using localhost as $_base_href is the expected behaviour if that is the URL of the installation.

    it is unlikely that installations being viewed using localhost will even have a publically available address.

    instead of using localhost, you could use 127.0.0.1, in which case it'll use that internal IP, which also is not accessible publically.

  • 2005-08-18 13:28:35

    .

    In some cases it is the router that has the public IP address related to the domain name. It then forwards requests on port 80 (www) to the right computer serving the Web.

  • 2005-08-18 13:46:02

    .

    I still do not see this as a big problem. If it's the router doing the mapping then ATutor wouldn't know what the real domain name or IP address is anyway.

    I do not think it's too realistic to access a localhost server if it has a domain name and IP.

    If you wanted to avoid accessing the router simply edit your hosts file to point the domain name to the internal IP.