DokuWiki

It's better when it's simple

User Tools

Site Tools


auth:ning

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
auth:ning [2012-11-10 14:30] – [Code] 95.161.18.3auth:ning [2013-03-01 09:51] – [Installation] 210.55.240.39
Line 15: Line 15:
  
 Make sure that the file does not contain empty lines at the beginning and at the end, otherwise you will get PHP warnings. Make sure that the file does not contain empty lines at the beginning and at the end, otherwise you will get PHP warnings.
 +
 +=== WARNING: Passwords Sent As Plain Text ===
 +
 +Username and password are sent as plaintext in the example code below. 
 +
 +To use a secure SSL connection modify the checkDomain function by setting $url to use https and adding a user agent to the curl options: 
 +
 +        function checkDomain($domain) {
 +            $url = "https://$domain/main/external/info?format=serialize";
 +            $curl = curl_init($url);
 +            curl_setopt ($curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");   // set user agent to allow SSL to work
 +            curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
 +            $result = curl_exec($curl);
 +            if ($result && is_array($info = unserialize($result)) && $info['version']) {
 +                return true;
 +            }
 +            return false;
 +   
 +
  
 ===== Code ===== ===== Code =====

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki