original_string: protected function _prepareOptions(Zend_Ldap $ldap, array $options)
      {
          $adapterOptions = array(
              'group'       => null,
              'groupDn'     => $ldap->getBaseDn(),
              'groupScope'  => Zend_Ldap::SEARCH_SCOPE_SUB,
              'groupAttr'   => 'cn',
              'groupFilter' => 'objectClass=groupOfUniqueNames',
              'memberAttr'  => 'uniqueMember',
              'memberIsDn'  => true
          );
          foreach ($adapterOptions as $key => $value) {
              if (array_key_exists($key, $options)) {
                  $value = $options[$key];
                  unset($options[$key]);
                  switch ($key) {
                      case 'groupScope':
                          $value = (int)$value;
                          if (in_array($value, array(Zend_Ldap::SEARCH_SCOPE_BASE,
                                  Zend_Ldap::SEARCH_SCOPE_ONE, Zend_Ldap::SEARCH_SCOPE_SUB), true)) {
                             $adapterOptions[$key] = $value;
                          }
                          break;
                      case 'memberIsDn':
                          $adapterOptions[$key] = ($value === true ||
                                  $value === '1' || strcasecmp($value, 'true') == 0);
                          break;
                      default:
                          $adapterOptions[$key] = trim($value);
                          break;
                  }
              }
          }
          $ldap->setOptions($options);
          return $adapterOptions;
      }
code: protected function _prepareOptions(Zend_Ldap $ldap, array $options)
      {
          $adapterOptions = array(
              'group'       => null,
              'groupDn'     => $ldap->getBaseDn(),
              'groupScope'  => Zend_Ldap::SEARCH_SCOPE_SUB,
              'groupAttr'   => 'cn',
              'groupFilter' => 'objectClass=groupOfUniqueNames',
              'memberAttr'  => 'uniqueMember',
              'memberIsDn'  => true
          );
          foreach ($adapterOptions as $key => $value) {
              if (array_key_exists($key, $options)) {
                  $value = $options[$key];
                  unset($options[$key]);
                  switch ($key) {
                      case 'groupScope':
                          $value = (int)$value;
                          if (in_array($value, array(Zend_Ldap::SEARCH_SCOPE_BASE,
                                  Zend_Ldap::SEARCH_SCOPE_ONE, Zend_Ldap::SEARCH_SCOPE_SUB), true)) {
                             $adapterOptions[$key] = $value;
                          }
                          break;
                      case 'memberIsDn':
                          $adapterOptions[$key] = ($value === true ||
                                  $value === '1' || strcasecmp($value, 'true') == 0);
                          break;
                      default:
                          $adapterOptions[$key] = trim($value);
                          break;
                  }
              }
          }
          $ldap->setOptions($options);
          return $adapterOptions;
      }
code_tokens: protected function _prepareOptions ( Zend_Ldap $ ldap , array $ options ) { $ adapterOptions = array ( 'group' => null , 'groupDn' => $ ldap -> getBaseDn ( ) , 'groupScope' => Zend_Ldap :: SEARCH_SCOPE_SUB , 'groupAttr' => 'cn' , 'groupFilter' => 'objectClass=groupOfUniqueNames' , 'memberAttr' => 'uniqueMember' , 'memberIsDn' => true ) ; foreach ( $ adapterOptions as $ key => $ value ) { if ( array_key_exists ( $ key , $ options ) ) { $ value = $ options [ $ key ] ; unset ( $ options [ $ key ] ) ; switch ( $ key ) { case 'groupScope' : $ value = ( int ) $ value ; if ( in_array ( $ value , array ( Zend_Ldap :: SEARCH_SCOPE_BASE , Zend_Ldap :: SEARCH_SCOPE_ONE , Zend_Ldap :: SEARCH_SCOPE_SUB ) , true ) ) { $ adapterOptions [ $ key ] = $ value ; } break ; case 'memberIsDn' : $ adapterOptions [ $ key ] = ( $ value === true || $ value === '1' || strcasecmp ( $ value , 'true' ) == 0 ) ; break ; default : $ adapterOptions [ $ key ] = trim ( $ value ) ; break ; } } } $ ldap -> setOptions ( $ options ) ; return $ adapterOptions ; }
docstring: Sets the LDAP specific options on the Zend_Ldap instance
  
  @param  Zend_Ldap $ldap
  @param  array $options
  @return array of auth-adapter specific options
docstring_tokens: Sets the LDAP specific options on the Zend_Ldap instance