Changeset 25465
- Timestamp:
- 11/30/08 23:10:51 (5 years ago)
- Location:
- lang/perl/NanoA/trunk
- Files:
-
- 3 added
- 4 modified
-
app/openid (added)
-
app/openid/openid.pm (added)
-
app/openid/start.mt (added)
-
lib/NanoA.pm (modified) (2 diffs)
-
lib/NanoA/Plugin.pm (modified) (2 diffs)
-
nanoa.pl (modified) (1 diff)
-
plugin/form.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/NanoA/trunk/lib/NanoA.pm
r25131 r25465 125 125 } 126 126 $status ||= 302; 127 print 'Status: ', $status, "\nLocation: " . $uri . "\n\n"; 127 $self->header(-status => 302); 128 $self->header(-location => $uri); 129 my $body = ''; 130 $self->run_hooks('postrun', \$body); 131 $self->print_header(); 132 utf8::encode($body) 133 if utf8::is_utf8($body); 134 print $body; 128 135 CGI::ExceptionManager::detach(); 129 136 } … … 161 168 } 162 169 170 sub uri_escape { 171 my $s = shift; 172 join( 173 '', 174 map { 175 /^[a-zA-Z0-9_.!~*'()-]$/ ? $_ : '%' . uc(unpack('H2', $_)) 176 } split(//, $s), 177 ); 178 } 179 163 180 sub nanoa_uri { 164 181 $ENV{SCRIPT_NAME} || '/nanoa.cgi'; 182 } 183 184 sub uri_for { 185 my ($app, $path, $query) = @_; 186 $path = nanoa_uri . '/' . $path 187 unless $path =~ m|^/|; 188 return $path unless $query && ref $query eq 'HASH'; 189 $path . '?' . join( 190 '&', 191 map { 192 uri_escape($_) . '=' . uri_escape($query->{$_}), 193 } sort keys %$query, 194 ); 165 195 } 166 196 -
lang/perl/NanoA/trunk/lib/NanoA/Plugin.pm
r24561 r25465 5 5 use utf8; 6 6 7 use base qw(NanoA); 8 7 9 sub import { 8 10 my $pkg = caller; 9 11 # plugins loading other plugins should call init_plugin explicitely 10 return if $pkg =~ /^plugin::/; 12 local $@; 13 my $pkg_is_plugin; 14 eval { 15 $pkg_is_plugin = $pkg->is_plugin; 16 }; 17 return if $pkg_is_plugin; 11 18 shift->init_plugin($pkg); 12 19 } … … 17 24 } 18 25 26 sub is_plugin { 1 } 27 19 28 1; -
lang/perl/NanoA/trunk/nanoa.pl
r24409 r25465 4 4 5 5 BEGIN { 6 unshift @INC, 'extlib';6 unshift @INC, qw(extlib app); 7 7 }; 8 8 -
lang/perl/NanoA/trunk/plugin/form.pm
r25439 r25465 6 6 7 7 use HTML::AutoForm; 8 use plugin::session;9 8 10 9 use base qw(NanoA::Plugin); 10 11 use plugin::session; 11 12 12 13 BEGIN {
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)