Changeset 1342

Show
Ignore:
Timestamp:
04/01/08 20:28:58 (5 years ago)
Author:
benoitg
Message:
  • Apply patch from dc.ml@… to allow commas in authentication parameter strings. This is sometimes necessary for LDAP, and fixes #342
Location:
trunk/wifidog-auth
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/CHANGELOG

    r1341 r1342  
    11# $Id$ 
    2 2008-3-31 Robin Jones 
    3         * Minor install script improvements, including making changelog accessible and colour in the permissions tables 
     22008-04-01 Benoit Grégoire  <bock@step.polymtl.ca> 
     3        * Apply patch from dc.ml@oxys.net to allow commas in authentication parameter strings.  This is sometimes necessary for LDAP, and fixes #342 
     4 
     52008-03-31 Robin Jones 
     6    * Minor install script improvements, including making changelog accessible and colour in the permissions tables 
    47 
    582008-03-21 Benoit Grégoire  <bock@step.polymtl.ca> 
  • trunk/wifidog-auth/wifidog/classes/Authenticators/AuthenticatorLDAP.php

    r1304 r1342  
    143143     * @param string $password    Clear text password of user 
    144144     * @param string $ldap_server Hostname of LDAP server 
    145      * @param strong $o           The base dn of the LDAP server 
     145     * @param strong $o           The base dn string of the LDAP server (possibly including o=) 
    146146     * @param string $f           It's the field that will be used in the 
    147147     *                            LDAP search, i.e.: uid, mail, name server 
  • trunk/wifidog-auth/wifidog/classes/Content/FlickrPhotostream/FlickrPhotostream.php

    r1249 r1342  
    449449            $html .= "<div class='admin_element_data'>\n"; 
    450450            $name = "flickr_photostream_".$this->id."_api_key"; 
    451             $html .= "<input type='text' name='$name' value='".$this->getApiKey()."'\n"; 
     451            $html .= "<input type='text' name='$name' size=40 value='".$this->getApiKey()."'\n"; 
    452452            $html .= "</div>\n"; 
    453453            $html .= "</li>\n"; 
     
    594594                catch (Phlickr_ConnectionException $e) 
    595595                { 
    596                     $html .= _("Unable to connect to Flickr API."); 
    597                     echo $e; 
     596                    $html .= sprintf(_("Unable to connect to Flickr API: %s"), "<pre>$e</pre>"); 
    598597                } 
    599598                catch (Phlickr_MethodFailureException $e) 
     
    851850                catch (Phlickr_ConnectionException $e) 
    852851                { 
    853                     $html .= _("Unable to connect to Flickr API."); 
     852                   $html .= sprintf(_("Unable to connect to Flickr API: %s"), "<pre>$e</pre>"); 
    854853                } 
    855854                catch (Phlickr_MethodFailureException $e) 
  • trunk/wifidog-auth/wifidog/classes/Network.php

    r1331 r1342  
    643643        } 
    644644 
    645         return call_user_func_array(array (new ReflectionClass($this->_row['network_authenticator_class']), 'newInstance'), explode(",", str_replace(array ("'", '"'), "", str_replace(", ", ",", $this->_row['network_authenticator_params'])))); 
     645        $string=$this->_row['network_authenticator_params']; 
     646          
     647        $params = explode(',', $string); 
     648        for ($i = 0; $i < count($params); $i++) { 
     649            $nquotes = substr_count($params[$i], '\''); 
     650            if ($nquotes %2 == 1) { 
     651                for ($j = $i+1; $j < count($params); $j++) { 
     652                    if (substr_count($params[$j], '\'') > 0) { 
     653                        array_splice($params, $i, $j-$i+1, 
     654                        implode(',', array_slice($params, $i, $j-$i+1))); 
     655                        break; 
     656                    } 
     657                } 
     658            } 
     659            if ($nquotes > 0) { 
     660                $qstr =& $params[$i]; 
     661                $qstr = substr_replace($qstr, '', strpos($qstr, '\''), 1); 
     662                $qstr = substr_replace($qstr, '', strrpos($qstr, '\''), 1); 
     663            } 
     664        } 
     665        return call_user_func_array(array (new ReflectionClass($this->_row['network_authenticator_class']), 'newInstance'), $params); 
     666 
    646667    } 
    647668