Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Moving net-ldap query into model
- treebase = "OU=Organisation,DC=foo,DC=com"
- filter = Net::LDAP::Filter.eq( "cn", "#{CGI.escape(params[:collect])}" )
- attrs = ["givenname", "cn", "mail"]
- host = "somehost"
- port = "389"
- base = "OU=Organisation,DC=foo,DC=com"
- username = "CN=Foo"
- password = "bar"
- @collection = Net::LDAP.open( :host => host, :port => port, :base => base, :auth => {:method => :simple, :username => username , :password => password} ) do |ldap|ldap.search( :base => treebase, :attributes => attrs, :filter => filter)
- end
- <%= form_tag new_ticket_path(@ticket), :method => 'get' do %>
- <p>
- <%= text_field_tag :collect, params[:collect] %>
- <%= submit_tag "Weiter", :name => nil %>
- </p>
- <% end %>
- @collection = Ticket.ldap(params[:collect])
- <%= f.text_field :supervisor, :value => @collection.first.mail.first %>
- wrong number of arguments (1 for 0)
Add Comment
Please, Sign In to add comment