From: ndparker <> Date: Thu, 29 Mar 2001 21:46:47 +0000 (+0000) Subject: renamed Posting::Handle as Posting::Admin X-Git-Url: https://git.p6c8.net/selfforum.git/commitdiff_plain/aaff267fdddc495df3bfa2fc0eb0d20a76b6d220 renamed Posting::Handle as Posting::Admin did several style changes in many files --- diff --git a/selfforum-cgi/shared/Conf.pm b/selfforum-cgi/shared/Conf.pm index 1fa97b2..3d2d5be 100644 --- a/selfforum-cgi/shared/Conf.pm +++ b/selfforum-cgi/shared/Conf.pm @@ -12,17 +12,14 @@ use strict; package Conf; -use vars qw(@ISA @EXPORT); - use XML::DOM; # ==================================================== # Funktionsexport # ==================================================== -require Exporter; -@ISA = qw(Exporter); -@EXPORT = qw(read_script_conf); +use base qw(Exporter); +@Conf::EXPORT = qw(read_script_conf); ################################ # sub read_script_conf diff --git a/selfforum-cgi/shared/Id.pm b/selfforum-cgi/shared/Id.pm index 33c0c83..fb51d48 100644 --- a/selfforum-cgi/shared/Id.pm +++ b/selfforum-cgi/shared/Id.pm @@ -17,14 +17,12 @@ use strict; package Id; -require 5.000; ##################### # Funktionsexport ##################### -require Exporter; -@Id::ISA = qw(Exporter); +use base qw(Exporter); @Id::EXPORT = qw(unique_id); use vars qw(@table); @@ -38,7 +36,11 @@ use vars qw(@table); # Rueckgabe der ID # ########################################## -sub unique_id { +# sub unique_id ################################################ +# +# composing of an unique ID... +# +sub unique_id () { my $id; my $ip=$ENV{'REMOTE_ADDR'}; @@ -47,16 +49,21 @@ sub unique_id { my $rand=int(rand(time())); $ip = hex(join ('',map {sprintf ('%02X',$_)} split (/\./,$ip))); - join '',map {to_base64 ($_)} (substr ($time,-9), $port, $ip, $rand, $$); + join '',map {to_base64 ($_)} ($time, $port, $ip, $rand, $$); } +# sub to_base64 ################################################ +# +# only converts (max.) 32-bit numbers into a +# system with base 64 +# its not the RFC base64 format! +# sub to_base64 ($) { my $x = shift; my $y = $table[$x % 64]; - while ($x = int ($x/64)) {$y = $table[$x % 64] . $y} + $y = $table[$x % 64].$y while ($x = int ($x/64)); - # Rueckgabe $y; } diff --git a/selfforum-cgi/shared/Lock.pm b/selfforum-cgi/shared/Lock.pm index b1e42d3..f7234f0 100644 --- a/selfforum-cgi/shared/Lock.pm +++ b/selfforum-cgi/shared/Lock.pm @@ -12,14 +12,13 @@ use strict; package Lock; -use vars qw(@ISA @EXPORT_OK %EXPORT_TAGS $Timeout $violentTimeout $masterTimeout $iAmMaster); +use vars qw(@EXPORT_OK %EXPORT_TAGS $Timeout $violentTimeout $masterTimeout $iAmMaster); # ==================================================== # Funktionsexport # ==================================================== -require Exporter; -@ISA = qw(Exporter); +use base qw(Exporter); @EXPORT_OK = qw(lock_file unlock_file write_lock_file write_unlock_file violent_unlock_file set_master_lock release_file); diff --git a/selfforum-cgi/shared/Mail.pm b/selfforum-cgi/shared/Mail.pm index 73166c9..8ba56e3 100644 --- a/selfforum-cgi/shared/Mail.pm +++ b/selfforum-cgi/shared/Mail.pm @@ -18,14 +18,13 @@ use strict; package Mail; -use vars qw($mailbox $mailprog @ISA @EXPORT); +use vars qw($mailbox $mailprog @EXPORT); # =================== # Funktionsexport # =================== -require Exporter; -@ISA = qw(Exporter); +use base qw(Exporter); @EXPORT = qw(is_mail_address send_mail); ######################################## diff --git a/selfforum-cgi/shared/Posting/Handle.pm b/selfforum-cgi/shared/Posting/Admin.pm similarity index 95% rename from selfforum-cgi/shared/Posting/Handle.pm rename to selfforum-cgi/shared/Posting/Admin.pm index 700a101..f3a4330 100644 --- a/selfforum-cgi/shared/Posting/Handle.pm +++ b/selfforum-cgi/shared/Posting/Admin.pm @@ -1,12 +1,14 @@ -package Posting::Handle; +package Posting::Admin; ################################################################################ # # -# File: shared/Posting/Handle.pm # +# File: shared/Posting/Admin.pm # +# (was: ~Handle.pm) # # # # Authors: Frank Schoenmann , 2001-03-13 # +# Andre Malo , 2001-03-29 # # # -# Description: Allow modifications of postings # +# Description: Allow administration of postings # # # # Todo: * Lock files before modification # # * Change body in change_posting_body() # @@ -17,10 +19,9 @@ package Posting::Handle; use strict; -use vars qw(@EXPORT); use base qw(Exporter); -@EXPORT = qw(hide_posting recover_posting modify_posting add_user_vote level_vote); +@Posting::Admin::EXPORT = qw(hide_posting recover_posting modify_posting add_user_vote level_vote); use Lock qw(:READ); use Posting::_lib qw(get_message_node save_file get_all_threads @@ -330,4 +331,4 @@ sub change_posting_body($$$$) # Let it be true -1; +1; \ No newline at end of file diff --git a/selfforum-cgi/shared/Posting/Write.pm b/selfforum-cgi/shared/Posting/Write.pm index 7e6ba97..48941d1 100644 --- a/selfforum-cgi/shared/Posting/Write.pm +++ b/selfforum-cgi/shared/Posting/Write.pm @@ -12,14 +12,13 @@ package Posting::Write; use strict; -use vars qw(@EXPORT); use base qw(Exporter); # ==================================================== # Funktionsexport # ==================================================== -@EXPORT = qw(write_posting); +@Posting::Write::EXPORT = qw(write_posting); use Encode::Plain; $Encode::Plain::utf8 = 1; use Encode::Posting; @@ -278,4 +277,4 @@ sub create_new_thread ($) { # ==================================================== # end of Posting::Write -# ==================================================== +# ==================================================== \ No newline at end of file diff --git a/selfforum-cgi/shared/Template/Forum.pm b/selfforum-cgi/shared/Template/Forum.pm index 6b29a22..c03f05a 100644 --- a/selfforum-cgi/shared/Template/Forum.pm +++ b/selfforum-cgi/shared/Template/Forum.pm @@ -13,8 +13,6 @@ use strict; package Template::Forum; -use vars qw(@ISA @EXPORT); - use Lock qw(:READ); use Encode::Plain; $Encode::Plain::utf8 = 1; use Posting::_lib qw(get_all_threads long_hr_time); @@ -26,9 +24,8 @@ use Template::_thread; # Funktionsexport # ==================================================== -require Exporter; -@ISA = qw(Exporter); -@EXPORT = qw(print_forum_as_HTML); +use base qw(Exporter); +@Template::Forum::EXPORT = qw(print_forum_as_HTML); ################################ # sub print_forum_as_HTML diff --git a/selfforum-cgi/shared/Template/Posting.pm b/selfforum-cgi/shared/Template/Posting.pm index fe504f0..441178d 100644 --- a/selfforum-cgi/shared/Template/Posting.pm +++ b/selfforum-cgi/shared/Template/Posting.pm @@ -12,8 +12,6 @@ use strict; package Template::Posting; -use vars qw(@ISA @EXPORT); - use Encode::Posting; use Encode::Plain; $Encode::Plain::utf8 = 1; use Id; @@ -30,9 +28,8 @@ use XML::DOM; # Funktionsexport # ==================================================== -require Exporter; -@ISA = qw(Exporter); -@EXPORT = qw(print_posting_as_HTML message_as_HTML); +use base qw(Exporter); +@Template::Posting::EXPORT = qw(print_posting_as_HTML message_as_HTML); ################################ # sub print_posting_as_HTML diff --git a/selfforum-cgi/shared/Template/_conf.pm b/selfforum-cgi/shared/Template/_conf.pm index b94d01d..6528d38 100644 --- a/selfforum-cgi/shared/Template/_conf.pm +++ b/selfforum-cgi/shared/Template/_conf.pm @@ -13,15 +13,12 @@ use strict; package Template::_conf; -use vars qw(@ISA @EXPORT); - # ==================================================== # Funktionsexport # ==================================================== -require Exporter; -@ISA = qw(Exporter); -@EXPORT = qw(get_view_params); +use base qw(Exporter); +@Template::_conf::EXPORT = qw(get_view_params); ################################ # sub get_view_params diff --git a/selfforum-cgi/shared/Template/_query.pm b/selfforum-cgi/shared/Template/_query.pm index 606f4f3..66be8fc 100644 --- a/selfforum-cgi/shared/Template/_query.pm +++ b/selfforum-cgi/shared/Template/_query.pm @@ -12,15 +12,12 @@ use strict; package Template::_query; -use vars qw(@ISA @EXPORT); - # ==================================================== # Funktionsexport # ==================================================== -require Exporter; -@ISA = qw(Exporter); -@EXPORT = qw(query_string); +use base qw(Exporter); +@Template::_query::EXPORT = qw(query_string); ################################ # sub query_string diff --git a/selfforum-cgi/shared/Template/_thread.pm b/selfforum-cgi/shared/Template/_thread.pm index 74ae404..0cea038 100644 --- a/selfforum-cgi/shared/Template/_thread.pm +++ b/selfforum-cgi/shared/Template/_thread.pm @@ -12,8 +12,6 @@ use strict; package Template::_thread; -use vars qw(@ISA @EXPORT); - use Encode::Plain; $Encode::Plain::utf8 = 1; use Posting::_lib qw(short_hr_time); use Template; @@ -23,9 +21,8 @@ use Template::_query; # Funktionsexport # ==================================================== -require Exporter; -@ISA = qw(Exporter); -@EXPORT = qw(html_thread); +use base qw(Exporter); +@Template::_thread::EXPORT = qw(html_thread); ################################ # sub html_thread