+ Post New Thread
Results 1 to 15 of 15
Virtual Learning Platforms Thread, Moodle: SMB Web Client - HTTPS... in Technical; I've installed Moodle, SMB Web Client, and the proper certificate for secure access. I've set form authentication for SMB Web ...
  1. #1
    fabled-aesop's Avatar
    Join Date
    Mar 2008
    Posts
    7
    Thank Post
    2
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Moodle: SMB Web Client - HTTPS...

    I've installed Moodle, SMB Web Client, and the proper certificate for secure access.

    I've set form authentication for SMB Web Client, which I believe means that the username/password is encrypted before being passed to the remote server... however, is there anyway to for SMB Web Client to operate over HTTPS, so that the data transferred is also encrypted?

    It probably wouldn't be an issue for students, but I imagine it might be more problematic for teaching staff, where the information transmitted might be confidential.

  2. #2


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,033 Times in 813 Posts
    Rep Power
    341
    the 'easy' way is to set the entire site to https - might be overkill.
    in the the config.php

    Code:
    $CFG->wwwroot   = 'https:/yoursite.com'
    better option is to put a .htaccess file in the smb_client directory to use https.
    I'll have a play with this later
    Last edited by CyberNerd; 20th May 2008 at 08:05 PM.

  3. Thanks to CyberNerd from:

    fabled-aesop (21st May 2008)

  4. #3
    fabled-aesop's Avatar
    Join Date
    Mar 2008
    Posts
    7
    Thank Post
    2
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by CyberNerd View Post
    better option is to put a .htaccess file in the smb_client directory to use https.
    I'll have a play with this later
    Ahh, now that sounds interesting.

  5. #4
    fabled-aesop's Avatar
    Join Date
    Mar 2008
    Posts
    7
    Thank Post
    2
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thanks for the hint - I've located something about using .htaccess with mod_rewrite to force https on a specific folder:

    Code:
    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteCond %{REQUEST_URI} blocks/smb_web_client
    RewriteRule ^(.*)$ https://my_vle_website/blocks/smb_web_client/$1 [R,L]
    I've just tried it, and it works :-) Cool! I appreciate that it's sad trying this at 6:50 in the morning, but still, that's what remote access is for :-)

    Cheers.

  6. #5


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,033 Times in 813 Posts
    Rep Power
    341
    Another method, in the file block_smb_web_client.php hardcode the line
    $blockwww=$CFG->wwwroot.'/blocks/smb_web_client'
    to go direct to https:
    Code:
     $blockwww='https://yourvle.comblocks/smb_web_client';

  7. #6
    penfold_99's Avatar
    Join Date
    Feb 2008
    Location
    East Sussex
    Posts
    1,003
    Thank Post
    60
    Thanked 167 Times in 119 Posts
    Rep Power
    69
    CyberNerd, you missed a slash in the example, it should be

    Code:
     $blockwww='https://yourvle.com/blocks/smb_web_client';

  8. #7

    Join Date
    May 2008
    Location
    Manchester
    Posts
    5
    Thank Post
    2
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Have just hardcoded the https: into the php which seems to work but IE puts up an annoying prompt about displaying secure and unsecure items. I can change the settings but is there a better way? It seems the icons are the ones that are causing the warning for some reason even though they seem to be coming from the local system.

    To Change:

    01) Open Internet Explorer
    02) Click on Tools
    03) Click on Internet Options
    04) Click on the Security Tab
    05) Click on the Custom Level button
    06) Under the Miscellaneous section look for "Display Mixed Content"
    07) Click on Disable for Display Mixed Content instead of Prompt
    08) Click on OK twice
    09) Close Internet Explorer and reopen
    10) Open the webpage that was displaying the warning message, the message should not appear now.

    Thanks.

    Allan.

  9. #8
    duncane's Avatar
    Join Date
    Dec 2006
    Location
    Dewsbury, West Yorkshire
    Posts
    156
    Thank Post
    66
    Thanked 9 Times in 9 Posts
    Rep Power
    18
    Quote Originally Posted by allanmorris View Post
    Have just hardcoded the https: into the php which seems to work but IE puts up an annoying prompt about displaying secure and unsecure items. I can change the settings but is there a better way?
    Have you hard-coded https into both places where it's used? (The code changed since this thread started).

    There are references to http in both block_smb_web_client.php and class_smbwebclient.php - they both need changing.
    Last edited by duncane; 13th October 2008 at 06:25 PM. Reason: I noticed a grammatical mistake.

  10. #9

    Join Date
    May 2008
    Location
    Manchester
    Posts
    5
    Thank Post
    2
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Have you hard-coded https into both places where it's used? (The code changed since this thread started).

    There are references to http in both block_smb_web_client.php and class_smbwebclient.php - they both need changing.
    Hi DuncanE.

    I've added to the 'block', under the // set block www, only. Have just had a look in the 'class' and can't see anything - but it is a big file. Could you give me a clue where to look as it's worth a try. Most students and teachers just put up with the message even though I've let them all know how to stop it so it would be great to stop it happening at all.

    Btw, the version I'm using is 2008080500.

    Thanks.

    Allan.
    Last edited by allanmorris; 14th October 2008 at 12:20 PM. Reason: Forgot some info

  11. #10
    duncane's Avatar
    Join Date
    Dec 2006
    Location
    Dewsbury, West Yorkshire
    Posts
    156
    Thank Post
    66
    Thanked 9 Times in 9 Posts
    Rep Power
    18
    Quote Originally Posted by allanmorris View Post
    Hi DuncanE.

    I've added to the 'block', under the // set block www, only. Have just had a look in the 'class' and can't see anything - but it is a big file. Could you give me a clue where to look as it's worth a try. Most students and teachers just put up with the message even though I've let them all know how to stop it so it would be great to stop it happening at all.

    Btw, the version I'm using is 2008080500.

    Thanks.

    Allan.
    (Please note the changes are in bold.)

    Okay, in smb_web_client.php I have:

    Code:
    function init() {
            global $CFG;
    
            // Set title and version
            $this->title = get_string('blockmenutitle', 'block_smb_web_client');
            $this->title=$this->title=="[[blockmenutitle]]" ? "Online Documents" : $this->title;
            $this->version = 2008080500;
    
            // set block www
            $this->blockwww=$CFG->wwwroot.'/blocks/smb_web_client';
            $this->blockwww=str_replace("http://", "https://", $this->blockwww);
        }
    In class_smbwebclient.php I have:

    Code:
    # loads an HTML template
    function Template ($file, $vars=array())
    {
            $result = str_replace(array_keys($vars), array_values($vars), $this->GetInlineFile($file));
            $result = str_replace("http://mysiteurl/", "https://mysiteurl/", $result);
            return $result;
    }
    I didn't describe it very well - sorry about that - it's actually my additions anyway that refer to the http - it's the template function that needed changing.

    I hope that helps,
    Duncan.

  12. Thanks to duncane from:

    allanmorris (13th March 2009)

  13. #11

    Join Date
    May 2008
    Location
    Manchester
    Posts
    5
    Thank Post
    2
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Hi DuncanE.

    Your explanation was fine and I've added the 'class' code changes. It now works fine in IE which is great and will make things a bit easier for most people. I'd just add to your mail that the 'mysiteurl' has to change to your real one - in case someone types it in verbatim - and that the whole contents of the function need replacing due to your new $result var.

    I'm finding it quite humourous that sharing Windows files only works when you use a GNU/Linux based server

    Thanks for your help.

    Allan.

  14. #12

    Join Date
    Mar 2009
    Location
    wakefield
    Posts
    15
    Thank Post
    1
    Thanked 2 Times in 2 Posts
    Rep Power
    12

    windows share web client - https

    I'm the author of windows share web client.
    We use the ldapcapture auth plugin to pass the credentials on to the windows share web client block.
    This means that you can have a https login for your site and then not have to worry about the credentials being sent cleartext over http later.
    The credentials are fed through to smbclient at the OS level so they never touch http.

    This is the recommended method.

  15. #13

    Join Date
    May 2008
    Location
    Manchester
    Posts
    5
    Thank Post
    2
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Hi Brudinie (Guy?)

    Yes, we're using LDAP Capture, which works fine btw, but wanted the share client to work via https as sensitive data can pass between home and school. Now the share client windows pops up as https with a secure lock while the Moodle site stays as http. Any data passing through is secure and is much more safer than carrying a usb stick backwards and forwards. In cases like ours do you think it would be an idea to have a config switch available to use the client under https rather than have to change the code as I did?

    Thanks.

    Allan.
    CHHS.

  16. #14

    Join Date
    Mar 2009
    Location
    wakefield
    Posts
    15
    Thank Post
    1
    Thanked 2 Times in 2 Posts
    Rep Power
    12

    Now with SSL!

    I've modified my latest 'development' version to allow for ssl.
    To enable https you add the following config variable:

    $smb_cfg->cfgssl=true;

    You can download the latest development version from:
    http://www.ossett.wakefield.sch.uk/w...web_client.zip

    If anyone could test this for me and give me some feedback, that would be great.

    Thanks in advance

    Brudinie (Guy)

  17. #15

    Join Date
    May 2008
    Location
    Manchester
    Posts
    5
    Thank Post
    2
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Hi B(G)

    Great have just downloaded your latest zip and I'll see if I can test on another install nearby.

    Thanks.

    Allan.
    CHHS.



SHARE:
+ Post New Thread

Similar Threads

  1. No https:// requests can get through
    By Scotmk in forum Windows
    Replies: 21
    Last Post: 20th October 2008, 06:43 PM
  2. Problems logging in with HTTPS - moodle
    By timbo343 in forum Virtual Learning Platforms
    Replies: 10
    Last Post: 12th February 2008, 10:59 AM
  3. Moodle and HTTPS
    By timbo343 in forum Virtual Learning Platforms
    Replies: 12
    Last Post: 24th January 2008, 05:07 PM
  4. RDP over HTTP / HTTPS
    By GrumbleDook in forum Windows
    Replies: 2
    Last Post: 3rd September 2006, 10:37 PM
  5. Getting Moodle to logon using a different https port
    By p.simmons in forum Web Development
    Replies: 9
    Last Post: 8th March 2006, 03:35 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •