/
aamt_auth.pm
778 lines (717 loc) · 25 KB
/
aamt_auth.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
################################################################################
#Declaration of global variables for AUQ module
################################################################################
my $auqRetVal; #Main return value from the AUQ module
my $sessionName; #Session Name of a migration process (required for recovery)
my $filePath; #path for the http configuration file at the source machine
my $sessionFilename ; #Recovery file name
my $statusLogFile ; #Status file name
my $errorLogFile ; #Log file name
my $LocalFileName; #Renamed file name of configuration file
my $SESSIONFILELANDLE; #File handle for session file
my $migrationStatus; #To indicate the wizard is running in FRESHRUN mode or RECOVERY
my $logFilereturn; #RETURN VALUE for the file access methods in aamt_informationLog
my $parseSuccess ; #To run in the recovery mode, the output of auth_parseRecovery file
my $startTime; #Migration start time for logging
my $fileret;
my $tempretval;
my $return = 1;
my $dirSuccess=0;
my @fileparse;
my $lineContent;
my @tempfileparse;
my $recoveryFile;
my $retval;
##############################################################################
#### Variables used to define user prompt####################################
##############################################################################
my $REC_HTTPD_PATH = REC_HTTPD_PATH;
my $NEW_REC_HTTPD_PATH = NEW_REC_HTTPD_PATH;
my $LISTEN =FP_DEFAULT_LISTEN;
my $REC_USER_DIR ='[USER_DIR]' ;
my $REC_MY_NAME_VIRTUAL_HOST ='[NAME_VIRTUAL_HOST]' ;
################################################################################
#Main Subroutine for AUQ module starts here
################################################################################
sub auth_main
{
ui_clearScreen(); #used to clear screen defined in aamt_userinterface.pm file
ui_Title(); #used for title of the migartion kit defined in aamt_userinterface.pm file
if (!&auth_isUserRoot())
{
return (0, 0);
}
ui_printBanner();
&ilog_print(1,TITLE_SESSION_NAME); #To display title pertaining to session name
($tempretval,$sessionName)=auth_inputSessionName(); #user input "session name" for migration
if(!($tempretval))
{
$auqRetVal=0;
return($auqRetVal,0);
}
else
{
ilog_setSessionName($sessionName); #set session name for the migration
}
utf_setCurrentWorkingFolder();
($dirSuccess,$migrationStatus)=auth_createSessionDirectory($sessionName);
#create a folder with session name in current working folder
if (!($dirSuccess))
{
$auqRetVal=0;
return($auqRetVal,0);
}
&pars_SetSessionFolder(); #Set the folder to current session folder
&utf_gettimeinfo('0'); #Migration start time is to be written to log file
utf_setCurrentModuleName(AUQ); #set module name as AUQ for Authentication and UserQuery
#Module
################################################################################
#The loop basing on migration status (FRESHRUN or RECOVERY) starts here
################################################################################
if ($migrationStatus eq 'FRESHRUN')
{
&utf_setCurrentModuleName('');
$logFilereturn = ilog_setLogInformation('EXT_INFO',MSG_SESSION_NAME,$sessionName,'');
#Log session name to AIISMT files
if(!($logFilereturn))
{
$logFilereturn=ilog_print(1,ERR_INTERNAL_ERROR_CONSOLE.__LINE__);
$auqRetVal=0;
return ($auqRetVal,0); #return FALSE
}
utf_setCurrentModuleName(AUQ);
&pars_SetRecoveryCode(RECOVERY_MODE_0); #Log Recovery Mode to AIISMT files
if(!($logFilereturn))
{
$logFilereturn=ilog_print(1,ERR_INTERNAL_ERROR_CONSOLE.__LINE__);
$auqRetVal=0;
return ($auqRetVal,0); #return FALSE
}
ui_printBanner("Source Configuration Details\n");
&ilog_print(1,TITLE_SOURCE_IP); #Source IP keyword
$sourceMachineAddress = 'localhost';
$logFilereturn= ilog_setLogInformation('REC_INFO',REC_SOURCE_IP.REC_ADD_EQUAL,$sourceMachineAddress,'');
$logFilereturn= ilog_setLogInformation('EXT_INFO',REC_SOURCE_IP,$sourceMachineAddress,'');
if(!($logFilereturn))
{
ilog_print(1,ERR_INTERNAL_ERROR_CONSOLE.__LINE__);
$auqRetVal=0;
return ($auqRetVal,0); #return FALSE
}
$auqRetVal=1; # return TRUE
$logFilereturn= ilog_setLogInformation('REC_INFO',REC_MACHINE_TYPE.REC_ADD_EQUAL ,'S','');
$logFilereturn= ilog_setLogInformation('EXT_INFO',REC_MACHINE_TYPE ,CON_EXEC_SOURCE_MODE,'');
if(!($logFilereturn))
{
ilog_print(1,ERR_INTERNAL_ERROR_CONSOLE.__LINE__);
$auqRetVal=0;
return ($auqRetVal,0); #return FALSE
}
($tempretval,$filePath)=auth_inputFilePath(); # Http configuration file path of the source machine
if($tempretval)
{
$auqRetVal =1; #Success of AUQ module
}
else
{
$auqRetVal =0; #AUQ module Failed
return($auqRetVal,0);
}
#loop for FRESHRUN ends here
}
else #loop for RECOVERY starts here
{
@fileparse = auth_displaySessionFile(); #contents of recovery file is shown
if(@fileparse)
{
if($fileparse[0] eq RECOVERY_MODE_COMPLETE)
{
ilog_print (1,MSG_USAGE_COMPLETE);
$auqRetVal=0;
return ($auqRetVal,0); #return FALSE
}
$tempretval=auth_resumeMigrate(CON_RECOVERY_MODE);
if($tempretval)
{
$auqRetVal=1;
}
else
{
$auqRetVal=0;
}
}
}
$LocalFileName =AMW.$sessionName.FILE_CONF; #called both for freshrun and recovery
return ($auqRetVal,$LocalFileName); #returned to the main function
}
################################################################################
#Main Subroutine for AUQ module ends here
################################################################################
#---------------------------------------------------------------------------------
#Method Name : auth_checkIfUserIsRoot
#Description : Checks if the user is root
#Return Value : 1. TRUE / FALSE
#---------------------------------------------------------------------------------
sub auth_isUserRoot
{
if ($> == 0)
{
return 1;
}
ilog_print(1,"ERROR: Script must be run as root\n");
return 0;
}
#---------------------------------------------------------------------------------
#Method Name : auth_getConfFile
#Description : Gets the http configuration file to the local working directory
#Input : Remote filename
#Output : Local filename
#
#
#Return Value : 1. TRUE / FALSE
#---------------------------------------------------------------------------------
sub auth_getConfFile
{
#Local Variable declaration
my $RemoteFileName = shift; #httpd.conf filename path
my $LocalFileName; #renamed httpd.conf file in the current session folder
my $fileReturn;
my $ftpCount;
my $FTPSESSIONHANDLE;
#Local Variable initialization
$LocalFileName =AMW.$sessionName.FILE_CONF;
$LocalFileName="./$sessionName/$LocalFileName"; #appended to the full path
$ftpCount =0;
eval
{
$fileReturn = File::Copy::copy($RemoteFileName, $LocalFileName);
if (!$fileReturn)
{
ilog_print(1,"ERROR: copying: $RemoteFileName TO $LocalFileName \n");
}
};
if($@)
{
if($@ = ~/ERR_INVALID_FILE_PATH/)
{
ilog_print(1,"\n");
$logFilereturn = ilog_displayandLog(ERR_INVALID_FILE_PATH,1,'INT_ERROR','','',__LINE__);
if(!($logFilereturn))
{
ilog_print(1,ERR_INTERNAL_ERROR_CONSOLE.__LINE__);
exit(0);
}
$fileReturn= FALSE;
}
}
if ($fileReturn)
{
ilog_print(DEBUG_ONLY,MSG_FILE_TRANSFER_SUCCESS);
}
return $fileReturn;
}
#---------------------------------------------------------------------------------
#Method Name : auth_inputParam
#Description : Inputs parameters from the console in visible/invisible mode
#Input :1. Prompt Message
# 2. Default Value
# 3. Visible Flag
# 4. Validation type can be
# I Integer
# S String
# M Machine address
# F File path
# 5. Machine Type Source/Target
#
#Output : Nil
#
#
#Return Value : 1. TRUE / FALSE
#---------------------------------------------------------------------------------
sub auth_inputParam
{
my $returnparam = 0; #return value of the function
my($PromptMsg, $DefaultVal, $Visibleflag,$ValidationType, $MachineType) = @_;
#the value input by the user goes here
my $Value; #VisibleFlag determines whether the input is
#supposed to be visible or hidden
# if($Visibleflag eq "VISIBLE")
# {
ilog_print(1,$PromptMsg);
chomp($Value = <STDIN>); #input the value
$Value =~ s/^\s+//;
$Value =~ s/\s+$//;
$Value = ltrim($Value);
if($Value eq "") #default value incase the user enters blank
{
if (!($DefaultVal eq ''))
{
$Value = $DefaultVal;
$returnparam =1;
}
else
{
$returnparam = 0;
return (0,$Value)
} # but if input and default, both are blank, ask for reinput...
}
else
{
$returnparam =1; # basic validation has been removed for taking consideration the linux file structure
if ($returnparam) #if the input is valid
{
if ($ValidationType eq 'M')
{
if ($Value eq '')
{
$logFilereturn = ilog_setLogInformation('INT_INFO',ERR_INTERNAL_ERROR_CONSOLE,'',__LINE__);
$returnparam = 0;
return (0,$Value) #for loopback
}
}
}
else
{
$logFilereturn = ilog_displayandLog(ERR_INPUT_CONFIRM,1,'INT_ERROR',ERR_SERVER_IP,'',__LINE__);
return (0,$Value);
}
}
# }
# if($Visibleflag eq "HIDDEN")
# {
# ReadMode('noecho');
# ilog_print(1,$PromptMsg);
# chop($Value = ReadLine(0)); #input the value
# <STDIN>
# if($Value eq ""){$Value = $DefaultVal}; #default value incase the user enters blank
# ReadMode 1;
# ilog_print(1,"\n");
# $returnparam =1;
# }
if ($returnparam)
{
return (1,$Value);
}
}
#---------------------------------------------------------------------------------
#Method Name : auth_createSessionDirectory
#Description : Creates a directory in the current working folder
#Input : 1. sessionName from user
# 2.
#Output : 1. migration status (FRESHRUN or RECOVERY)
#Return Value : boolean
#---------------------------------------------------------------------------------
sub auth_createSessionDirectory
{
my $DIRHANDLE;
my $returnDirectory;
my $fileSuccess;
my $filename;
my $fileExist;
my $displaySuccess;
my $returnCreateSuccess;
my $tempretval;
$migrationStatus='';
$returnCreateSuccess=0;
$sessionFilename= "./$sessionName/$sessionFilename"; #appended with the full path
$DIRHANDLE= new IO::Dir ".";
if(opendir (DIRHANDLE,$sessionName))
{
$sessionFilename =AMW.$sessionName.FILE_RECOVERY;
while (defined($filename = readdir(DIRHANDLE)))
{
if ($filename =~/$sessionFilename/i)
{
$fileExist =1;
}
}
if($fileExist)
{
ilog_setLogInformation("EXT_INFO","<Recovery Info>","","");
$migrationStatus = 'RECOVERY';
$returnCreateSuccess =TRUE;
}
else
{
$logFilereturn = ilog_print(1,ERR_INVALID_FILE);
exit(0);
}
}
else
{
eval
{
$returnDirectory=mkdir($sessionName) or die 'ERR_CREATE_DIRECTORY'; #creates a directory in the current working directory
if($returnDirectory)
{
$fileSuccess = auth_createSessionFile();
if(!($fileSuccess))
{
$logFilereturn= ilog_setLogInformation('INT_ERROR','auth_createSessionFile()',ERR_METHOD_UNSUCCESSFUL,__LINE__);
}
else
{
$migrationStatus = 'FRESHRUN';
$returnCreateSuccess =TRUE;
}
}
};
}
closedir(DIRHANDLE);
if($@)
{
if($@=~/ERR_CREATE_DIRECTORY/)
{
# log error and exit tool
$logFilereturn=ilog_print(1,ERR_CREATE_DIRECTORY);
}
}
return ($returnCreateSuccess,$migrationStatus);
}
#---------------------------------------------------------------------------------
#Method Name : auth_createSessionFile
#Description : Creates the recovery,status and log files in the session folder
#Input :
#
#Output :
#
#
#Return Value : 1. TRUE / FALSE
#---------------------------------------------------------------------------------
sub auth_createSessionFile
{
my $filename;
my $SESSIONFILELANDLE;
my $STATUSFILEHANDLE;
my $LOGFILEHANDLE ;
$sessionFilename =AMW.$sessionName.FILE_RECOVERY; # RecoveryFile appended with full path
$sessionFilename = "./$sessionName/$sessionFilename ";
$statusLogFile =AMW.$sessionName.FILE_STATUS; # StatusFile appended with full path
$statusLogFile = "./$sessionName/$statusLogFile ";
$errorLogFile =AMW.$sessionName.FILE_LOG; # LogFile appended with full path
$errorLogFile = "./$sessionName/$errorLogFile ";
eval
{
$SESSIONFILELANDLE = new IO::File;
if(open(SESSIONFILELANDLE,">$sessionFilename") or die 'ERR_FILE_OPEN')
{
close(SESSIONFILELANDLE);
$STATUSFILEHANDLE = new IO::File;
if(open(STATUSFILEHANDLE,">$statusLogFile") or die 'ERR_FILE_OPEN')
{
close (STATUSFILEHANDLE);
$LOGFILEHANDLE= new IO::File;
if(open(LOGFILEHANDLE,">$errorLogFile") or die 'ERR_FILE_OPEN')
{
close (LOGFILEHANDLE);
}
} # ErrorFile Creation#
}
};
if($@)
{
if($@=~/ERR_FILE_OPEN/)
{
# log error and exit tool
$logFilereturn=ilog_print(1,ERR_FILE_OPEN.__LINE__);
}
return FALSE;
}
else
{
ilog_setLogInformation("EXT_INFO",HTM_BEGIN,"",""); #commented for now
$logFilereturn= ilog_setLogInformation('INT_INFO',AMW.$sessionName.FILE_RECOVERY,MSG_FILE_OPEN,'');
$logFilereturn= ilog_setLogInformation('INT_INFO',AMW.$sessionName.FILE_STATUS,MSG_FILE_OPEN,'');
$logFilereturn= ilog_setLogInformation('INT_INFO',AMW.$sessionName.FILE_LOG,MSG_FILE_OPEN,'');
$logFilereturn= ilog_setLogInformation('INT_INFO','auth_createSessionFile()',MSG_METHOD_SUCCESSFUL,'');
}
return TRUE;
}
#---------------------------------------------------------------------------------
#Method Name : auth_displaySessionFile
#Description : display the Recovery File contents to the user
#Input : recovery filename
#
#Output :
#
#
#Return Value : boolean
#---------------------------------------------------------------------------------
sub auth_displaySessionFile
{
my $tempfilename = shift;
my $fileret;
my $resumemigrate;
my $tempindex;
$tempindex= 0;
my $fileret;
my $websitecount=0;
my $retval;
my $RECOVERYFILEHANDLE;
$tempfilename=AMW.$sessionName.FILE_RECOVERY; # RecoveryFile appended with full path
$tempfilename = "./$sessionName/$tempfilename ";
$RECOVERYFILEHANDLE = new IO::File;
eval
{
$fileret = open ((RECOVERYFILEHANDLE,"<$tempfilename") ) or die 'ERR_FILE_OPEN';
};
if($@)
{
if($@=~/ERR_FILE_OPEN/)
{
# log error and exit tool
$logFilereturn=ilog_print(1,ERR_FILE_OPEN.__LINE__);
}
return FALSE;
}
else
{
ilog_print(1,CON_RECOVERY_FILE_CONTENTS);
ilog_print(1,"\n");
my $siteSection = 0;
while ($lineContent = <RECOVERYFILEHANDLE>)
{
if ($siteSection)
{
ilog_print(1, $lineContent);
next;
}
chomp($lineContent);
$lineContent =~ s/^\s+//;
$lineContent =~ s/\s+$//;
if ($lineContent eq RECOVERY_MODE_0 || $lineContent eq RECOVERY_MODE_1 || $lineContent eq RECOVERY_MODE_2 || $lineContent eq RECOVERY_MODE_COMPLETE)
{
$fileparse[$tempindex]=$lineContent;
$tempindex++;
}
if($lineContent=~ /$REC_HTTPD_PATH/)
{
$fileparse[$tempindex]=$lineContent;
$tempindex++;
@tempfileparse = split /\s+/,$lineContent;
$lineContent= $tempfileparse[$#tempfileparse];
chomp($lineContent);
$logFilereturn=ilog_print(1,"$NEW_REC_HTTPD_PATH\t$lineContent\n");
}
if( ($lineContent=~/^\[/ ) )
{
if( ($lineContent eq $LISTEN) || ($lineContent eq $IP_INFORMATION) || ($lineContent eq $REC_USER_DIR) || ( $lineContent eq $REC_MY_NAME_VIRTUAL_HOST))
{
#do nothing
}
else
{
$logFilereturn=ilog_print(1,CON_SITE_DETAILS);
ilog_print(1, "$lineContent\n");
$siteSection = 1;
}
}
}
}
close RECOVERYFILEHANDLE;
return @fileparse;
}
#---------------------------------------------------------------------------------
#Method Name : auth_inputSessionName
#Description : Returns the sessionname to the main program
#Input : Nil
#
#Output : SessionName
#
#
#Return Value : 1. TRUE / FALSE
#---------------------------------------------------------------------------------
sub auth_inputSessionName()
{
my $count; #Count for maximum number of attempts is reset to 0
$count = 0;
$tempretval = 0;
my $specialCharPattern = "[a-zA-Z0-9-_]"; # Allowed in directory creation
while ($count < MAXTRIES )
{
ilog_print(1,CON_SESSION_NAME);
chop($sessionName=<STDIN>);
$sessionName =~ s/^\s+//;
$sessionName =~ s/\s+$//;
$sessionName=ltrim($sessionName);
if (!($sessionName eq ''))
{
if($sessionName !~ /^$specialCharPattern+$/)
{
$logFilereturn=ilog_print(1,ERR_INPUT_CONFIRM);
$tempretval=0;
}
else
{
$tempretval=1;
$count = MAXTRIES;
}
}
else
{
$tempretval=0;
}
$count++;
}
if(!($tempretval))
{
$logFilereturn=ilog_print(1,ERR_INPUT_OVER);
}
return ($tempretval,$sessionName);
}
#---------------------------------------------------------------------------------
#Method Name : auth_inputFilePath
#Description : Returns the sessionname to the main program
#Input : Nil
#
#Output : SessionName
#
#
#Return Value : 1. TRUE / FALSE
#---------------------------------------------------------------------------------
sub auth_inputFilePath
{
my $count=0; #Count for maximum number of attempts is reset to 0
$tempretval=0;
while ($count < MAXTRIES )
{
($tempretval,$filePath) = auth_inputParam(CON_HTTPD_PATH,DEFAULT_HTTPD_PATH,'VISIBLE','F','0');
if($tempretval)
{
$return = auth_getConfFile($filePath);
if(!$return)
{
$tempretval=0;
}
else
{
$logFilereturn= ilog_setLogInformation('REC_INFO',REC_HTTPD_PATH.REC_ADD_EQUAL,$filePath,'');
$logFilereturn= ilog_setLogInformation('EXT_INFO',REC_HTTPD_PATH,$filePath,'');
$count = MAXTRIES;
}
}
$count++;
}
if(!($tempretval))
{
$logFilereturn = ilog_displayandLog(ERR_INPUT_OVER,1,'INT_ERROR',MSG_MAXIMUM_COUNTS,MAXTRIES,__LINE__);
}
if($tempretval)
{
$logFilereturn= ilog_setLogInformation('INT_INFO','auth_inputFilePath()',MSG_METHOD_SUCCESSFUL,'');
# Log Success message to the log files
if(!($logFilereturn))
{
ilog_print(1,ERR_INTERNAL_ERROR_CONSOLE.__LINE__);
}
}
return ($tempretval,$filePath);
}
#--------------------------------------------------------------------------------
#Method Name : auth_resumeMigrate()
#Description : Returns the TRUE if user determines to resume migration process
#Input : Nil
#
#Output : SessionName
#
#
#Return Value : 1. TRUE / FALSE
#---------------------------------------------------------------------------------
sub auth_resumeMigrate()
{
my $messageString=shift;
my $resumemigrate;
my $count=0; #Count for maximum number of attempts is reset to 0
$tempretval=0;
my $exitVal;
while ($count < MAXTRIES )
{
ilog_print(1,$messageString);
chop($resumemigrate=<STDIN>); # user input
$resumemigrate =~ s/^\s+//;
$resumemigrate =~ s/\s+$//;
$resumemigrate=ltrim($resumemigrate);
if ($resumemigrate eq 'y' || $resumemigrate eq 'Y')
{
$count = MAXTRIES;
$tempretval=1;
}
else
{
if ($resumemigrate eq 'n' || $resumemigrate eq 'N')
{
$tempretval=0;
$count = MAXTRIES;
$exitVal =1
}
}
$count++;
}
if($exitVal)
{
$logFilereturn = ilog_print(1,TITLE_EXIT);
}
else
{
if (!($resumemigrate eq 'y' || $resumemigrate eq 'Y'))
{
$logFilereturn = ilog_displayandLog(ERR_INPUT_OVER,1,'INT_ERROR',MSG_MAXIMUM_COUNTS,MAXTRIES,__LINE__);
}
}
return $tempretval;
}
#---------------------------------------------------------------------------------
#Method Name : auth_displaywebsitedetails
#Description : display the details such as destination directory,site IP and SSL
# enabled or not in a recovery file
#Input : website name
#
#Output :
#
#
#Return Value : boolean
#---------------------------------------------------------------------------------
sub auth_displaywebsitedetails
{
my $websiteName=shift;
my $tempfilename=shift;
my $i;
my $tempvar;
my $ipportVar;
&ui_printline();
ilog_print(1,"$websiteName\n\n");
for ($i=0; $i<5;$i++)
{
$lineContent = <RECOVERYFILEHANDLE>;
if($lineContent =~/DestinationPath/)
{
ilog_print(1,"$lineContent\n");
}
if($lineContent =~/SSL/i)
{
@tempfileparse = split /=/,$lineContent;
$lineContent= $tempfileparse[$#tempfileparse];
chomp($lineContent);
if($lineContent =~/y/i)
{
ilog_print(1,ENABLE_SSL);
}
}
}
return 1;
}
#---------------------------------------------------------------------------------
#Method Name : auth_isRecovery()
#Description : The function returns
#Input :
#
#Output :
#
#
#Return Value : boolean
#---------------------------------------------------------------------------------
sub auth_isRecovery
{
return $migrationStatus;
}
1;