<commit_before>#! /usr/bin/perl -w

use strict;
use CGI;
use CoGe::Accessory::Web;
use HTML::Template;
use JSON qw(encode_json);
use Data::Dumper;
use List::Compare;
use CoGeX;
use CoGeX::Result::User;
use Data::Dumper;
use URI::Escape::JavaScript qw(escape unescape);
no warnings 'redefine';

use vars qw($P $PAGE_NAME $USER $BASEFILE $coge $cogeweb %FUNCTION $FORM $MAX_SEARCH_RESULTS %ITEM_TYPE);

$FORM = new CGI;
( $coge, $USER, $P ) = CoGe::Accessory::Web->init( cgi => $FORM );

$MAX_SEARCH_RESULTS = 400;

my $node_types = CoGeX::node_types();
#print STDERR $node_types->{user};

%FUNCTION = (
    search_organisms     		=> \&search_organisms,
    search_users	 		=> \&search_users,
    search_stuff	 		=> \&search_stuff,
    user_info		 		=> \&user_info,
    add_items_to_user_or_group 		=> \&add_items_to_user_or_group,
    remove_items_from_user_or_group 	=> \&remove_items_from_user_or_group,
    get_share_dialog			=> \&get_share_dialog,
    get_roles				=> \&get_roles,
    search_share 			=> \&search_share,
);

CoGe::Accessory::Web->dispatch( $FORM, \%FUNCTION, \&gen_html );

sub gen_html {
    #print STDERR "HTML\n";
    my $html;
    my $template =
      HTML::Template->new( filename => $P->{TMPLDIR} . 'generic_page.tmpl' );
    $template->param( HELP => '/wiki/index.php?title=ADMIN' );
    my $name = $USER->user_name;
    $name = $USER->first_name if $USER->first_name;
    $name .= " " . $USER->last_name if $USER->first_name && $USER->last_name;
    $template->param( USER       => $name );
    $template->param( PAGE_TITLE => qq{Admin} );
    $template->param( LOGO_PNG   => "Admin-logo.png" );
    $template->param( LOGON      => 1 ) unless $USER->user_name eq "public";
    $template->param( BODY       => gen_body() );<commit_msg>Updated Admin page header to new logo.<commit_after>#! /usr/bin/perl -w

use strict;
use CGI;
use CoGe::Accessory::Web;
use HTML::Template;
use JSON qw(encode_json);
use Data::Dumper;
use List::Compare;
use CoGeX;
use CoGeX::Result::User;
use Data::Dumper;
use URI::Escape::JavaScript qw(escape unescape);
no warnings 'redefine';

use vars qw($P $PAGE_NAME $USER $BASEFILE $coge $cogeweb %FUNCTION $FORM $MAX_SEARCH_RESULTS %ITEM_TYPE);

$FORM = new CGI;
( $coge, $USER, $P ) = CoGe::Accessory::Web->init( cgi => $FORM );

$MAX_SEARCH_RESULTS = 400;

my $node_types = CoGeX::node_types();
#print STDERR $node_types->{user};

%FUNCTION = (
    search_organisms     		=> \&search_organisms,
    search_users	 		=> \&search_users,
    search_stuff	 		=> \&search_stuff,
    user_info		 		=> \&user_info,
    add_items_to_user_or_group 		=> \&add_items_to_user_or_group,
    remove_items_from_user_or_group 	=> \&remove_items_from_user_or_group,
    get_share_dialog			=> \&get_share_dialog,
    get_roles				=> \&get_roles,
    search_share 			=> \&search_share,
);

CoGe::Accessory::Web->dispatch( $FORM, \%FUNCTION, \&gen_html );

sub gen_html {
    #print STDERR "HTML\n";
    my $html;
    my $template =
      HTML::Template->new( filename => $P->{TMPLDIR} . 'generic_page.tmpl' );
    #$template->param( HELP => '/wiki/index.php?title=ADMIN' );
    $template->param( HELP => $P->{SERVER} );
    my $name = $USER->user_name;
    $name = $USER->first_name if $USER->first_name;
    $name .= " " . $USER->last_name if $USER->first_name && $USER->last_name;
    $template->param( USER       => $name );
    $template->param( PAGE_TITLE => qq{Admin} );
    $template->param( TITLE	 => "Admin" );
    $template->param( LOGO_PNG   => "CoGe.svg" );
    $template->param( LOGON      => 1 ) unless $USER->user_name eq "public";
    $template->param( BODY       => gen_body() );
{'fraction_non_alphanumeric': 0.16965023409529056, 'fraction_numerical': 0.002203249793445332, 'mean_word_length': 3.8362183754993344, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 78, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3771935', 'n_tokens_mistral': 1431, 'n_tokens_neox': 1380, 'n_words': 272}