[aMail-checkins] CVS: new_project/program/lib Common.pm,1.7,1.8 Storage.pm,1.7,1.8
Brought to you by:
bit-man
|
From: Victor A. R. <bi...@us...> - 2002-08-26 22:53:26
|
Update of /cvsroot/amail/new_project/program/lib
In directory usw-pr-cvs1:/tmp/cvs-serv24488/program/lib
Modified Files:
Common.pm Storage.pm
Log Message:
Use of TRex::Storage (alpha 1) for folder creation.
Index: Common.pm
===================================================================
RCS file: /cvsroot/amail/new_project/program/lib/Common.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** Common.pm 24 Aug 2002 17:52:29 -0000 1.7
--- Common.pm 26 Aug 2002 22:53:23 -0000 1.8
***************
*** 34,37 ****
--- 34,38 ----
Get_head Set_location Server_time Get_language FileCopy
Get_spellpath Get_language_list Get_file_list
+ existsAuthMethod
Get_UIDL_list in_uidl_list Save_UIDL_list
Delete_uidl_list_from_server Get_UIDL_Trash_list
***************
*** 119,123 ****
my $skin_URL = "http://$localhost/aMail/media/skins"; ## Skins
my $dir_URL = "http://$localhost/cgi-bin/aMail"; ## cgi-bin (Perl scripts)
! my $db_path = "/home/bit-man/aMail/initialize_user"; ## User data
my $img_URL = "http://$localhost/aMail/media/images"; ## Images base (modified
## on language basis)
--- 120,124 ----
my $skin_URL = "http://$localhost/aMail/media/skins"; ## Skins
my $dir_URL = "http://$localhost/cgi-bin/aMail"; ## cgi-bin (Perl scripts)
! my $db_path = "/home/bit-man/TRex/initialize_user"; ## User data
my $img_URL = "http://$localhost/aMail/media/images"; ## Images base (modified
## on language basis)
***************
*** 862,865 ****
--- 863,867 ----
}
+
######################## UIDL associated routines #################
Index: Storage.pm
===================================================================
RCS file: /cvsroot/amail/new_project/program/lib/Storage.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** Storage.pm 23 Aug 2002 18:02:00 -0000 1.7
--- Storage.pm 26 Aug 2002 22:53:23 -0000 1.8
***************
*** 97,101 ****
use Exporter;
@ISA = ('Exporter');
! @EXPORT = qw/new authMethods open close insert/;
use SOAP::Lite;
--- 97,102 ----
use Exporter;
@ISA = ('Exporter');
! @EXPORT = qw/new authMethods open insert
! notExistsAuthMethod/;
use SOAP::Lite;
***************
*** 203,209 ****
my @auth_methods = $handler->authGetMethods()->result;
! return @$auth_methods;
}
=pod
--- 204,260 ----
my @auth_methods = $handler->authGetMethods()->result;
! return @auth_methods;
}
+
+ =pod
+
+ =head2 notExistsAuthMethod
+
+ Checks if the passed authentication method exists in the array obtained
+ via authMethods() call.
+
+ The parameters are passed in a hash, and the key values are :
+
+ =over 2
+
+ =item *
+ AUTH_METHOD : Authenticated method to search for
+
+ =item *
+ AUTH_ARRAY : a reference to the authentication array obtained via authMethods() call.
+
+ =back
+
+ The return values are 1 (one) on failure and o (zero) on success.
+
+ Usage :
+
+ use aMail::Storage;
+
+ my $method = "AMAIL";
+
+ ### ... handler obtained via new() ...
+ ### ... auth methods obtained via authMethods() ..
+
+ die "$method auth. schema not supported"
+ if notExistsAuthMethod( { AUTH_METHOD => $method,
+ AUTH_ARRAY => \@authMethods });
+
+
+ =cut
+
+ sub notExistsAuthMethod {
+ my $input = shift;
+ my $authMethods = $$input{'AUTH_ARRAY'};
+
+ for( my $i=0; $i < scalar @$authMethods; $i++ ) {
+ return 0 if ( $$authMethods[$i] eq $$input{'AUTH_METHOD'} );
+ };
+
+ return 1; ### Sorry, not found :-(
+ }
+
+
=pod
***************
*** 270,273 ****
--- 321,364 ----
+ =pod
+
+ =head2 insert(%)
+
+ Inserts an object in the data store.
+
+ The parameters are passed in a hash, and the key values corresopnd
+ to the desired parameters to be passed:
+
+ =over 2
+
+ =item *
+ AUTH_METHOD : Authenticated method (described previously)
+
+ =item *
+ AUTH_PARAMETERS : hash containing the authentication credentials.
+ In case of NULL is an empty hash, if USER_PWD the keys USER and PASSWORD
+ must be passed, and if AMAIL the keys aMail_ID and SID will be used.
+
+ The the code returned is the corresponding to each storage class.
+
+ =back
+
+ Usage :
+
+ use aMail::Storage;
+
+ my $folder = "myFolder";
+
+ ### ... handler obtained via new() ...
+ ### ... auth methods obtained via authMethods() ..
+ ### ... authentication via open() ...
+
+ die "Can't insert folder $folder"
+ unless ! $handler->insert( { OBJECT => 'FOLDER',
+ NAME => $folder ] );
+
+
+ =cut
+
sub insert() {
my $self = shift;
***************
*** 288,291 ****
--- 379,388 ----
return 999; ## Sorry, invalid operation
}
+
+
+ ##
+ ## Miscellaneous functions (some internal, some exported)
+ ##
+
|