The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

Somehow, someone, somewhere screwed up? by klar_at_work 2010-05-12 00:25:00
I clicked on SQOTD, and was being shown the following:

perl/ARSConfig.pm0100755000000000000000000000237407442556667012666 0ustar rootroot;# $Id: ARSConfig.pm,v 1.2 2002/03/10 04:04:21 jay Exp $ package ARSConfig; require 5.005; use strict; use vars qw($VERSION @ISA %EXPORT_TAGS); $VERSION = do { my @r = (q$Revision: 1.2 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; # must be all one line, for MakeMaker @ISA = qw(Exporter); # System includes use Exporter; # Local includes #(none) ######################################################################
######## # # Globals # ######################################################################
######## use vars qw($GC); # Ref to global configuration hash ######################################################################
######## # # Initialization # ######################################################################
######## sub _load_config { my $config = $ENV{ARS_CONFIG} or die "No ARS_CONFIG in environment"; my $hr; unless ($hr = do $config) { die "Couldn't parse config file $config: $@" if $@; die "Couldn't do config file: $!" unless defined $hr; die "$config didn't return a hashref" unless ref($hr) eq 'HASH'; } $hr; } $GC = _load_config(); # XXX Verify GC here %EXPORT_TAGS = ( default => [qw($GC)] ); Exporter::export_tags (keys %EXPORT_TAGS); Exporter::export_ok_tags(keys %EXPORT_TAGS); 1; __END__ perl/ARSHandler/0040755000000000000000000000000007614044210012443 5ustar rootrootperl/ARSHandler/Admin.pm01006440000000000000000000024115076140
44210014031 0ustar rootroot;# $Id: Admin.pm,v 1.14 2003/01/23 19:54:22 jay Exp $ ;# ;# ARSHandler::Admin - Request handler plug-in that handles admin-only functions ;# use strict; # # All of these admin functions are run thru the following admin check # sub is_admin { my $state=shift; my %state=%$state; if ($state->{user_type} eq "admin" || $state->{user_type} eq "staff" || $state->{user_type} eq "moderator" ) { return 1; } else { return 0; } } # # admin_only handler builder - make handler accessible admin users only # sub admin_only($) { my $handler = shift; # Build a handler that requires admin privs sub { my $state = shift; unless(is_admin($state)) { my $template = "$Template_Dir/generic.html"; return output_template($template, $state, uf_content => "Must be admin; sorry. :("); } $handler->($state); }; } ########################################################### # # Admin-only URL handlers # ########################################################### sub emit_new_article_form { my $state=shift; my $template="$Template_Dir/articles.html"; my $currtime=time; my $buttons= '
'; # handle SUBMIT/PREVIEW actions in forms # we always show a preview button first. # is this a reply? my $uf_content; if ( $state->{submit_type} eq "Preview" ) { # Add a submit if the user pressed preview $buttons.= ''; $uf_content.=preview_new_article($state); } $uf_content .=<
Post New Article
[ Reply ]
  He's onto us. by vectorz2010-05-12 00:27:09
    roger that by Klymer2010-05-12 00:28:36
      Calling team bravo!! by mekkanik_mike2010-05-12 01:26:08
        *glares at MekMike* by klar_at_work2010-05-12 02:00:06
          numbers... knee caps... what's the difference? (n/t) by mekkanik_mike2010-05-12 07:25:14
        No, it's a crescent wrench. by MatthewDBA2010-05-12 06:13:08
  Perl code or line noise? by ttlogic2010-05-12 00:53:29
    Perl, brings back the 'Code' in 'Code-ing'.. :P (n/t) by EnzoMatrix2010-05-12 01:17:46

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)