I have a case where i need to route a Web Service SOAP message through an intermediary server. Can anyone point me in the direction of some good resources on how to accomplish this?
Hello,
Suppose we have 3 apps - appMain, app1 and app2.
Applications 1 and 2 are protected, they have is_secure: true and everything works fine with sfDoctrineGuard plugin.
A behavior I want to achieve is when a user is not authenticated, current application to forward him to another one, say appMain with defined module and action.
Is that possible? Or can someone tell me where to dig about security mechanisms in symfony?
Hi,
I new in database design:
I have question with my own few solution,what do you thinks?:
Which tables should be created for all kinds files (images, attached email files,text files for store email body, etc..) that stored in my online store?
*option 1:use seperate table for files types *
files{
id
files_types_id FK
file_path
file_extension
}
files_types{
id
type_name (unique)
}
*option 2: use bool field for each file type *
files{
id
file_path
file_extension
is_image_main
is_image_icon
is_image_logo
is_pdf_file
is_text_file
}
**option 3: use 1 enum field 'file_type' for each file type **
files{
id
file_path
file_extension
file_type (image_main,image_icon,image_logo,image_main,pdf,text) **enum**
}
Thanks you,
Yosef
Not sure how to frame this question (I'm still wrapping my head around Rails).
Let's try this:
Say I wanted to implement the user side of Ryan Bates' excellent railscast on nested models. (He shows how to implement a survey where you can add and remove questions and answers dynamically). I want the user's side of this: to be able to answer questions and, not in the tutorial, be able to add comments.
It seems to me that you have to implement a view that shows the questions and answers, allow selection of the answers, and the input of comments. So there would need to be a way to show the information, but also update the model on input, right?
I know I'm not explaining this very well. I hope you understand what I'm getting at.
Is it just a question of setting up the right routes? Or is there some controller mojo that needs to happen?
I need to allow access to an svn repository using email addresses as the user name. I can log in to the server over ssh no problem by changing the email address "@" to a "$" like so:
ssh [email protected]
Unfortunately, the same does not work for svn+ssh. This gets me nowhere:
svn ls svn+ssh://[email protected]/home/accountname/data/svn/repos
Anyone know how this is usually done?
I'm building a WPF MVVM-ish application. I want to be able to display an event log containing items in a collection that exists in my viewmodel. I want any of the objects in the model to be able to add data to the event log. Therefore every object needs to be able to pass data back to one central collection for databinding in the view. I could implement an event in every one of my data classes and manually pass the events up the object heirarchy but this seems super clumsy. On the visual tree a Routed Event would take care of this, is there some equivelent in the model scope? Any other ideas?
I have an app with multiple users. Each user as a theoretical role (user, client, etc). I've designed a view/controller for each user type.
I want to be able to login each type of user do a different root url and lock them to it.
Originally I was going to add a column to Users in Devise called role and so I can differentiate the users. The problem I'm having is how to say in routes.rb if current_user.role == "client" root :to = 'controller#index'
Once they are logged in to the page I also want to keep them from being able to visit any of my other paths ie: domain.com/calls domain.com/units
I've been looking into cancan to run alongside Devise but I'm not sure if this is the answer.
Hello,
I want to update a blog, by sending an email using php. This is not wordpress, tumblr, or the famous ones.
I could set up an email id, with a specific code in the subject line, but how I get input the contents into the db?
Thanks
Jean
My overall use case:
I have a Listing model that has many images. The Listing detail page lists all the fields that can be updated inline (through ajax).
I want to be able to use the same view for both update listing and create new listing.
My listing controller looks as follows:
def detail
@listing = Listing.find(params[:id])
@image = Image.new #should this link somewhere else?
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @listing }
end
end
def create
# create a new listing and save it immediately. Assign it to guest, with a status of "draft"
@listing = Listing.new(:price_id => 1) # Default price id
# save it to db
# TODO add validation that it has to have a price ID, on record creation. So the view doesn't break.
@listing.save
@image = Image.new
# redirect_to "/listings/detail/@listing.id" #this didn't work
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @listing }
end
end
The PROBLEM
I'm using a partial that shows the same form for the create view and the detail view.
This works perfectly except for one thing:
When I pull up
http://0.0.0.0:3000/listings/detail/7, it works perfectly.
When I pull up
http://0.0.0.0:3000/listings/new, I get the following error:
Showing /Applications/MAMP/htdocs/rails_testing/feedbackd/app/views/listings/_edit_form.html.erb where line #100 raised:
No route matches {:action="show", :controller="images"}
Extracted source (around line #100):
97: <!-- Form for new images -->
98: <div class="span-20 append-bottom">
99: <!-- <%# form_for :image, @image, :url => image_path, :html => { :multipart => true } do |f| %> -->
100: <%= form_for @image, :url => image_path, :html => { :multipart => true } do |f| %>
101: <%= f.text_field :description %><br />
102: <%= f.file_field :photo %>
103: <%= submit_tag "Upload" %>
What I think the issue is:
When I upload a new image (I'm using Paperclip), it requires the listing_id to create the image record. Since the listing_id isn't passed in with listings/new it can't find the listing_id. How can I pass in the id? Via a redirect? What's the best way to solve this? Thank you.
I am running Symfony 1.3.2 on Ubuntu. I need to write a batch script that can:
Access the database using the ORM
Send email(s)
IIRC, this was in a previous cookback, but I thing that was for an earlier version of Symfony (the API may have changed since).
Does anyone know how I may access the database via the ORM layer in a batch script and also how to send out email(s) in a batch script?
I am playing with custom view and routes. I think that I have everything right but obviously not. Essentially I tried to copy the show method and show.html.erb but for some reason it will not work.
My controller
class fatherController < ApplicationController
def show
@father = Father.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @father }
end
end
def ofmine
@father = Father.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @father }
end
end
end
My routes.rb
Parent::Application.routes.draw do
resources :fathers do
resources :kids
end
match 'hospitals/:id/ofmine' => 'father#show2'
end
when I go to
127.0.0.1:/father/1
it works fine but when I try to go to
127.0.0.1:/father/1/ofmine
it gives the following error. It doesn't matter what the variable/method that is called; it occurs at the first one to be displayed. Both show.html.erb and show2.html.erb are the exact same files
My Error from webserver commandline
> Processing by fathersController#show2
> as HTML Parameters: {"id"=>"1"}
> Rendered fathers/show2.html.erb within
> layouts/application (31.6ms) Completed
> in 37ms
>
> ActionView::Template::Error (undefined
> method `name' for nil:NilClass):
> 4: <td>Name</td><td></td>
> 5: </tr>
> 6: <tr>
> 7: <td><%= @father.name %></td><td></td>
> 8: </tr>
> 9: <tr>
> 10: <td>City</td><td>State</td> app/views/fathers/show2.html.erb:7:in
> `_app_views_fatherss_show__html_erb___709193087__616989688_0'
Error as displayed on actual page
NoMethodError in Fathers#show2
Showing
/var/ruby/chs/app/views/fathers/show2.html.erb
where line #7 raised:
undefined method `name' for
nil:NilClass
Extracted source (around line #7):
4: Name 5:
6: 7: <%=
@father.name % 8:
9: 10:
CityState
If anyone could tell me what in the world I am doing wrong I would appreciate it greatly.
Hello, we're facing a problem now. We have a pretty big page with a loooong inline script, which does all the work. We now want to obfuscate it and use it as a separate .js file. But the problem is that we have paths which are generated by Url helper (Url.Content()). So what is the best way to separate js file from the page and not using hard-coded path strings?
I have IP cam that supports RTSP streaming. It's connected to router with 2 network cards with IP1 and IP2 addresses. I make 2 connections to IP cam by IP1 and IP2 addresses from the same IP and I need to receive corresponding streams thru correct network card, but both streams (RTP over UDP) go thru IP1. How this can be resolved?
I don't know if RTSP server binds UDP sockets to corresponding IP and I don't know what IP stack is in IP cam (weak end system or strong end system). I haven't found anything interesting in router configuration. As I understand, routing table cannot help me cos I'm connected from the same IP, is it right? Also
Sorry for incomplete info but it's all I have at the moment. Thanks for your time.
Hello! I am an MVC newbie. I'm trying to get my URLs to look like this:
/Corporate/Users/Edit/1
/Corporate/Stores/Edit/17
/Corporate/Contacts/Edit/17
/Store/Contacts/Create
/Store/Products/Edit/29
Pretty much like plain-vanilla urls, except with a user type at the front. I'm running into a lot of problems with duplicate controller names, etc.
Is there a simple way to do this? I looked briefly at Areas, but this seemed way to complicated.
On my Debian server running a Django website, I have an error when I need to send an email.
The error received is
Exception Type: gaierror Exception Value:
[Errno -2] Name or service not known
Exception Location: /usr/lib/python2.6/socket.py in
create_connection, line 547
You can see the full error log here.
After testing, it seems it is my firewall that blocks the request. You can see my iptable file (/etc/init.d/firewall). I think the problem comes from the two commented lines that were supposed to accepts all established connections.
When I uncomment them, I have an error iptables: No chain/target/match by that name.
Thank you
Hi.
I have a controller named Content, which has an Index action, which is associated with a view.
I would like the simple route "content" to show me the index view of the content controller, so I use the following code (with the addition of the default site home route):
routes.MapRoute(
"ContentIndex",
"content",
new { controller = "Content", action = "Index"}
);
routes.MapRoute(
"Default",
"{controller}/{action}",
new { controller = "Home", action = "Index" }
);
when I type the url : "http://localhost/content/", I get an error 404 saying the resource cannot be found, but when I type "http://localhost/content/index", it shows the content index view. How can I get rid of the index in the url ?
Thanks !
Howdy,
Im adding the filevistacontrol to my asp.net MVC web application.
I have a media.aspx page that is ignored in the routing with
routes.IgnoreRoute("media.aspx");
This works successfully and serves a standard webforms page.
Upon adding the filevistacontrol, I can't seem to ignore any calls the control makes to it's webservice.
Eg the following ignoreRoute still seems to get picked up by the MvcHandler.
routes.IgnoreRoute("FileVistaControl/filevista.asmx/GetLanguageFile/");
The exception thrown is:
'The RouteData must contain an item named 'controller' with a non-empty string value'
Thanks in advance.
I have IP cam that supports RTSP streaming. It's connected to router with 2 network cards with IP1 and IP2 addresses. I make 2 connections to IP cam by IP1 and IP2 addresses from the same IP and I need to receive corresponding streams thru correct network card, but both streams (RTP over UDP) go thru IP1. How this can be resolved?
I don't know if RTSP server binds UDP sockets to corresponding IP and I don't know what IP stack is in IP cam (weak end system or strong end system). I haven't found anything interesting in router configuration. As I understand, routing table cannot help me cos I'm connected from the same IP, is it right? Also
Sorry for incomplete info but it's all I have at the moment. Thanks for your time.
I've setup my Outlook.com email address in Windows 8 Mail (Modern UI) but is unable to send and receive emails when my AVG Internet Security 2012 Business Edition's Firewall is enable.
When I disable the firewall, the emails are coming through and are being send.
I know that I can most probably open the ports for IMAP on the firewall, but instead I would like to permit the application.
Where/how do I find the application path for Windows 8 Mail (Modern UI) to allow all network traffic? (AVG did not show its normal Allow/Disallow notification for 1st time communications)
Any advice would be appreciated.
Hello,
As my project to do over this summer I would like to create a program that answers a Skype call using the Skype API and allows a user to connect to another VOIP provider (through SIP) and make calls by dialling through the client callers Skype application.
I understand that the Skype API allows me to answer and receive keypad input, but I'm stuck on actually sending the sound of the call to a SIP client.
Is there an API/library that would allow me to take the Skype receiving audio as input in the SIP client?
Is this even possible?
I'm not tied to a language but I had planned on using Python.
Thanks.
Looking for a Linux script solution that can send alerts to a service such as Twitter, Skype or Google Talk and sends to Android and iPhone clients.
Have found twurl for Twitter with previous Bash scripts using curl no longer supported. But twurl looks promising. But haven't seen how to get Android Twitter client to make a distinctive sound when a tweet arrives.
Found some info about Skype4Py from several years ago that supports Skype Chats. But doesn't look like it is currently supported.
Have tried a few CLI clients for XMPP/Google Talk including xmpp4r-simple and freetalk, but found xmpp4r-simple buggy and freetalk succeeded in sending one chat message, but most never arrived.
Whatever is used needs to support Android and iPhone clients. Reason why email is problematic is that Gmail gets very upset when emails start flooding in every minute as a result of alerts.
Any suggestions?
I am trying to send a faceless(without showing the interface)email by using the code below:
I also want to attach an image to this email
can anybody suggest is it possible???
(void) sendEmailTo:(NSString *)toStr withSubject:(NSString *)subjectStr withBody:(NSString *)bodyStr
{
NSString *emailString=[[NSString alloc] initWithFormat:@"mailto:?to=%@&subject=%@&body=%@",
[toStr stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding],
[subjectStr stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding],
[bodyStr stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:emailString]];
[emailString release];
}
I have the following in app.yaml:
- url: /gae_mini_profiler/static
static_dir: gae_mini_profiler/static
- url: /gae_mini_profiler/.*
script: gae_mini_profiler/main.py
- url: .*
script: main.py
and the following in gae_mini_profiler/main.py:
def main():
logging.critical("gae_mini_profiler request!")
run_wsgi_app(application)
However, when I fire requests to, say, /gae_mini_profiler/request?request=ABC, and repeatedly reload the page, sometimes I will get the proper response (as well as a "gae_mini_profiler request!" log entry, and sometimes I get a blank response and nothing in the App Engine logs other than a 200 with an empty response body.
This is completely reproducible, only happens in the live environment, and I'd say ~50% of the refreshes work while 50% do not.
This only happens in production. Any ideas?
Code:
<label for="email">{t _your_email}:</label>
CSS:
label
{
display: block;
width: 156px;
cursor: pointer;
padding-right: 6px;
padding-bottom: 1px;
}
I want to make a new CSS for the email label as it's not meant to be that wide.. Just can't think right now :P
Thanks.