?¡ëPNG
IHDR ? f ??C1 sRGB ??¨¦ gAMA ¡À?¨¹a pHYs ? ??o¡§d GIDATx^¨ª¨¹L¡±¡Âe¡ÂY?a?("Bh?_¨°???¡é¡ì?q5k?*:t0A-o??£¤]VkJ¡éM??f?¡À8\k2¨ªll¡ê1]q?¨´???T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/user1137782/www/china1.by/classwithtostring.php on line 86
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
#!/usr/bin/perl
#
#----------------------------------------------------------------------------
#
# This program was written by Clif Harden.
# It uses the PERL LDAP module.
# This LDAP module is available from the PERL CPAN
# system.
#
# Purpose: This program is designed to load jpeg file data into a LDAP
# directory entry.
#
#
# $Id: jpegLoad.pl,v 1.2 2003/06/18 18:23:31 gbarr Exp $
#
# Revisions:
# $Log: jpegLoad.pl,v $
# Revision 1.2 2003/06/18 18:23:31 gbarr
# Remove all references to :all as it is not recomended
#
# Revision 1.1 2001/03/12 14:01:46 gbarr
# New contrib scripts from Clif Harden
#
#
#
#
use strict;
use Getopt::Std;
use Net::LDAP;
use Net::LDAP::Filter;
use Net::LDAP;
use Net::LDAP::Util qw( ldap_error_name ldap_error_text );
use Net::LDAP::Constant;
my $errstr = 0;
my $errmsg = "";
$errmsg = ldap_error_text($errstr);
#
# Initialize opt hash.
# You can change the defaults to match your setup.
# This can eliminate the need for many of the input
# options on the command line.
#
my %opt = (
'b' => 'dc=harden,dc=org',
'h' => 'localhost',
'd' => 0,
'D' => 'cn=manager',
'w' => 'password',
'V' => '3',
'a' => 'cn',
'v' => 'commonName'
);
if ( @ARGV == 0 )
{
#
# print usage message.
#
Usage();
}
#
# Get command line options.
#
getopts('b:f:h:d:D:w:V:a:v:',\%opt);
if ( !defined( $opt{'f'}) || !-e $opt{'f'} )
{
#
# No jpeg file specified or the file does not exist.
#
print "$opt{'f'}\n";
Usage();
}
$/ = undef;
$\ = undef;
$, = undef;
#
# Slurp all of the jpeg file in at once.
#
open(IN, "<$opt{'f'}");
binmode(IN);
$_ = ;
close(IN);
#
# build filter string
#
my $match = "( $opt{'a'}=$opt{'v'} )";
#
# create filter object
#
my $f = Net::LDAP::Filter->new($match) or die "Bad filter '$match'";
#
# make ldap connection to directory.
#
my $ldap = new Net::LDAP($opt{'h'},
timeout => 10,
debug => $opt{'d'},
) or die $@;
#
# Bind to directory.
#
$ldap->bind($opt{'D'}, password => "$opt{'w'}", version => $opt{'V'}) or die $@;
#
# Search directory for record that matches filter
#
my $mesg = $ldap->search(
base => $opt{'b'},
filter => $f,
attrs => [ "cn","jpegphoto" ],
) or die $@;
die $mesg->error,$mesg->code
if $mesg->code;
#
# get record entry object
#
my $entry = $mesg->entry();
#
# get record DN
#
if ( !defined($entry) )
{
print "No record for filter $match\n";
$ldap->unbind;
exit;
}
my $dn = $entry->dn();
print "\n";
print "dn: $dn\n";
print "\n";
#
# initialize arrays
#
my @addMember = ();
my @memberChange = ();
push( @addMember, "jpegphoto" ); # attribute name
push( @addMember, $_ ); # attribute value
my $attr = $entry->get_value("jpegPhoto");
if(ref($attr))
{
#
# Entry already has a jpegPhoto, replace it.
#
push( @memberChange, "replace" ); # ldap replace operation
push( @memberChange, \@addMember ); # ldap data to add
}
else
{
#
# Entry does not have a jpegPhoto, add it.
#
push( @memberChange, "add" ); # ldap add operation
push( @memberChange, \@addMember ); # ldap data to add
}
$mesg = $ldap->modify( $dn, changes => [ @memberChange ] ) or die $@;
if ( $mesg->code )
{
$errstr = $mesg->code;
print "Error code: $errstr\n";
$errmsg = ldap_error_text($errstr);
print "$errmsg\n";
}
$ldap->unbind;
#----------------------------------------#
# Usage() - display simple usage message #
#----------------------------------------#
sub Usage
{
print( "Usage: [-b] | [-h] | [-d] | [-D] | [-w] | [-a] | [-v] | [-f] \n" );
print( "\t-b Search base.\n" );
print( "\t-d Debug mode. Display debug messages to stdout.\n" );
print( "\t-D Authenication Distingushed Name.\n" );
print( "\t-f JPEG file to load in to attribute jpegPhoto.\n" );
print( "\t Required input option.\n" );
print( "\t-h LDAP directory host computer.\n" );
print( "\t-w Authenication password.\n" );
print( "\t-a Attribute that will be incorporated into the search filter.\n" );
print( "\t-v Data that will be incorporated into the search filter.\n" );
print( "\t-V LDAP version of the LDAP directory.\n" );
print( "\n" );
print( "\t Perldoc pod documentation is included in this script.\n" );
print( "\t To read the pod documentation do the following;\n" );
print( "\t perldoc