package ONO::ToolBox::Auth::Auth;
################################################################################
# COPYRIGHT / LICENSE #
################################################################################
#
# This file is part of the ONO Software Project.
#
# Copyright (C) 2000-2025 Jos KIRPS [ www.kirps.com | jos_AT_kirps_DOT_com ]
# and The Joopita Project [ www.joopita.org | contact_AT_joopita_DOT_com ]
#
# This file, as well as other parts of the ONO Software Project or related
# elements, are FREE SOFTWARE available under the ARTISTIC LICENSE 2.0.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# For the full license, see /ono/osr/license/LICENSE.txt, or write to
# jos_AT_kirps_DOT_com or contact_AT_joopita_DOT_com.
#
################################################################################
# END OF COPYRIGHT / LICENSE, HERE COMES THE CODE ... #
################################################################################
use strict;
use ONO::Lib::Web::Community;
use ONO::Lib::Web::Cookie;
use ONO::IO;
###############################################################################
# ONO
###############################################################################
sub auth {
#: This *may* be DEPRECATED, based on ONO::ToolBox::Auth status.
my ($self,$sid) = @_;
my $sid_data = ONO::IO->load("var/sessions/$sid.sid");
my @dp = split(/:/,$sid_data);
if ($ENV{'SCRIPT_NAME'} =~ m~/cgi-bin/local/perl/~ && $sid =~ m/^(.*?)-(.*?)$/) {
my $sid1 = $1;
$ENV{'SCRIPT_NAME'} =~ m~/cgi-bin/local/perl/(.*?)/(.*?)\.pl$~;
my $app = $1;
my $data = ONO::IO->load("var/community/$app/accounts/sessions/$sid1.sid");
if ($data eq $sid) {
$dp[0] = $sid1;
} else {
$dp[0] = "";
}
}
if ($dp[0]) {
return ($sid,@dp);
} else {
return "";
}
}
###############################################################################
# end of script
###############################################################################
1;
__END__