Displaying 20 results from an estimated 10000 matches similar to: "Double redirect"
2006 May 02
2
flash not shown
I am using the following code (inspired by one of the books) to check if
the user''s session should have timed out.
# Check to see if the user has been inactive for longer than the
# expiry period. If they have, reset the session.
def check_timeout
if session[:expires_at] != nil
@time_left = (session[:expires_at] - Time.now).to_i
unless @time_left > 0
2006 May 16
2
before_filter and the application controller
Hi there,
I''m having a bit of an issue with my before_filter. I know that the filters
put in the application.rb controller are global for all the controllers. In
my application filter I''d like to allow access to the RSS feed method in a
''member'' controller and skip the login checks that the before_filters are
currently performing.
In my application my filters
2017 Nov 09
2
Postlogin script
Hi,
I would like to prepare postlogin a script that allow imap connection to
roundcube for all but restrict imap access for selected users.
My question is that:
Is possible in condition IF use IP addresses as range or with mask (because
I've more than one web servers) ?
My script:
#!/bin/sh
if [ "$IP" = "172.11.0.28" ] ; then
printf "* [ALERT] Access allowed from
2017 Nov 10
1
Postlogin script
Thx, prips works as I expected, gr8 tool, not available in Gentoo repository
but after compilation Dovecot doing what I wanted.
Regards,
Jack
2017-11-09 21:19 GMT+01:00 Gedalya <gedalya at gedalya.net>:
> A bit clunky but perhaps you could find another command.
>
> https://packages.debian.org/stretch/netmask
>
> $ IP=172.11.0.28
> $ if [ "$(netmask -n $IP/24)"
2009 Aug 06
13
Redirect after login
Hi,
I''m new to Ruby/RoR so please bare with me!
I''m trying to adapt a ruby setup where someone logs in to a bonjour
service via a web browser. I have the login screen which asks for host
and password. There is only one user per host and i can log in fine.
It''s suppose to redirect me to /list in my browser but
doesn''t. Once i''ve entered the correct
2007 Oct 26
2
Examples of writing controller specs that use authentication
Hello,
I''m working on specs for a controller that handles authentication
using the restful_authentication plugin. I''m trying to find a
resource (tutorial or examples, if possible) about the best way to go
about writing mocks and specs to make sure that things like my
before_filters are working correctly. Does anyone know of any good
resources for this?
Thanks,
Les
2003 Oct 13
1
out going calls
I am not having any luck placing out going calls
I dial the number 08 82420173 ( our outside line )
But all I get is engaged signal and log this.
Oct 14 08:40:14 DEBUG[16401]: File pbx_wilcalu.c, Line 65 (autodial):
Entered Wil-Calu fd=20
Oct 14 08:40:14 DEBUG[8201]: File chan_sip.c, Line 657 (create_addr):
Setting NAT on RTP to 0
Oct 14 08:40:14 DEBUG[8201]: File chan_sip.c, Line 548
2003 Sep 22
1
Can't get simple config working!
Hi all.
I'm trying to get a simple configuration working so I can later expand it to
something more interesting.
I'm using kphone to call an extension on the * server. When I try to connect,
I get this error:
DEBUG[81926]: File chan_sip.c, Line 3562 (check_user): Setting NAT on RTP to 0
DEBUG[81926]: File chan_sip.c, Line 527 (__sip_ack): Stopping retransmission
on
2006 Jul 02
3
2 before_filters, only want one to render something
I have two before_filters for a few of my controllers. They are running
my own methods authorize and admin_authorize. authorize is called on
just about every action to make sure that a user is logged in.
admin_authorize is called on about 80% of the actions and is used to
make sure that a user is an administrator. If a user tries to access an
admin_authorize protected action without being
2006 Jan 08
4
Redirect to where I was
I wonder if there is a standard Rails way to redirect from an action
back to a previously viewed page. As a quick fix I created two little
methods in the controllers/application.rb. Does this seem like an ok
way to go?
Thanks,
Peter
class ApplicationController < ActionController::Base
def i_was_here
session[:i_was_here] = request.env[''REQUEST_URI'']
end
def
2006 Apr 21
9
Yet another dry question..
One of these days I''ll figure this out, but in the meantime help me be a
better programmer by eliminating some excess code:
I''m trying to check to see if somebody trying to view/edit/update a
product is the owner. In my scaffold I have this code that works:
def edit
@owner = Product.find(params[:id].to_i)
if @owner.user_id == @user.id
@product =
2007 Feb 14
2
prepend_before_filter
I''ve got a couple of before_filters that need to run in a specific order. One does a redirect_to if a session variable isn''t set. The other does a find which will fail if the session variable isn''t set. So they need to run in that order. But prepend_before_filter doesn''t seem to be working as advertised. Anybody got any insight? I''m still running
2010 Feb 08
3
Double render/redirect philosophy
Ok, I think I understand why RoR will flag an attempt double render in
an action.
What I don''t understand is the philosophy of render and redirect_to.
Specifically, why isn''t a return implicit in both those methods?
Or, I guess, more to the point ... what are the advantages of writing
code in the action after a render/redirect_to?
--
Posted via http://www.ruby-forum.com/.
--
2006 Aug 17
0
redirect_to POST?
Is it possible to automatically direct someone to a POST? Whenever a
user comes to my site, I''m automatically creating a user in the DB for
that person, however I''m also trying to stick to REST principles
otherwise. My idea was to have a before_filter :check_user that checked
to see whether this user existed or redirected to a POST users_url() to
automatically create the
2008 Dec 03
2
Render and/or redirect were called multiple times in this action
I''m trying to add an application enabled/disabled flag in my
application.. This is my code.
[code=] # application.rb
...
before_filter :check_enabled_flag
private
def check_enabled_flag
application_flag = ApplicationFlag.find(:first)
if application_flag.application_enabled
redirect_to application_disabled_path and return
end
end[/code]
and for some reason
2010 Dec 01
10
How to Redirect from http://mysite.com to https://www.mysite.com on Herok
Hello I''m looking to learn how to redirect all non-www (mysite.com) to
https://www.mysite.com
I tried the following:
class ApplicationController < ActionController::Base
before_filter :check_uri
def check_uri
redirect_to request.protocol + "www." + request.host_with_port +
request.request_uri if !/^www/.match(request.host) if Rails.env ==
2006 Jun 01
3
how can i redirect a person after a login
i built my own login system, but unfortunately, i am having problems
(ie, can''t really figure out how) to redirect a person back to the page
he was requesting before logging in...say, as the admin i want to edit a
certain message/logo, whatever, so i click on it, and i get redirected
to my login page. after the admin logs in, he gets redirected to the
homepage - i couldn''t
2004 Feb 13
1
possible bug?
A google search on this problem did not show any matches, so I'll take
the chance that someone on this list might consider it an rsync problem.
In a nutshell, if rsync forks a child process to handle the transport
(rsh in this case) it can hang in wait_process() forever waiting for
that child process to die. Normally this would not be a problem.
However, if the wrong packet is dropped
2006 Aug 12
7
Redirect back to last page?
I have a few pages where a user may do something (add tags, login, etc)
and I would like to redirect them back to the last page they were at
before calling that action. Is there an easy way to do this?
--
Posted via http://www.ruby-forum.com/.
2009 Apr 24
4
Undefined method "redirect_to" in before_filter
Code sample:
class SomeController < ApplicationController
before_filter do |c|
add_crumb "Blah", "/blah" #breadcrumbs plugin
redirect_to :controller => "foo", :action => "bar" unless c.send
(:has_package?)
end
# Rest of the controller...
private
def has_package?
# A bunch of logic work to check to make sure
# somebody''s session contains