ajout de la gestion des adresses POP et mise à jour de l'interface utilisateur
This commit is contained in:
@ -52,17 +52,17 @@ $labSizeProfile = GUICtrlCreateLabel("", 220, 25, 150, 30)
|
||||
GUICtrlSetColor(-1, $color)
|
||||
GUIctrlSetFont(-1,11, 600, Default, "Segoe UI")
|
||||
;~ GUICtrlSetBkColor(-1, 0xff0000)
|
||||
GUICtrlCreateLabel("Domaine(s) :", 390, 25, 75, 30)
|
||||
GUICtrlSetColor(-1, $color)
|
||||
GUICtrlSetTip(-1, "Séparez les domaines par un |", "Domaines à rechercher")
|
||||
GUICtrlSetCursor(-1, 4)
|
||||
$searchDoamin = GUICtrlCreateInput("ac-nice.fr", 470, 21, 140, 25)
|
||||
GUICtrlSetFont(-1, 10, 500, Default, "Segoe UI")
|
||||
$refresh = GUICtrlCreateLabel("🔄", 610, 20, 30, 33)
|
||||
GUICtrlSetFont(-1, 15, 500, Default, "Segoe UI")
|
||||
GUICtrlSetColor(-1, $color)
|
||||
GUICtrlSetCursor(-1, 0)
|
||||
GUICtrlSetTip(-1, "Rafraichir la liste des comptes")
|
||||
;~ GUICtrlCreateLabel("Domaine(s) :", 390, 25, 75, 30)
|
||||
;~ GUICtrlSetColor(-1, $color)
|
||||
;~ GUICtrlSetTip(-1, "Séparez les domaines par un |", "Domaines à rechercher")
|
||||
;~ GUICtrlSetCursor(-1, 4)
|
||||
;~ $searchDoamin = GUICtrlCreateInput("ac-nice.fr|ac-aix-marseille.fr", 470, 21, 140, 25)
|
||||
;~ GUICtrlSetFont(-1, 10, 500, Default, "Segoe UI")
|
||||
;~ $refresh = GUICtrlCreateLabel("🔄", 610, 20, 30, 33)
|
||||
;~ GUICtrlSetFont(-1, 15, 500, Default, "Segoe UI")
|
||||
;~ GUICtrlSetColor(-1, $color)
|
||||
;~ GUICtrlSetCursor(-1, 0)
|
||||
;~ GUICtrlSetTip(-1, "Rafraichir la liste des comptes")
|
||||
$modifProFileDirectory = GUICtrlCreateButton("📂 Modifier", 660, 17, 120, 33)
|
||||
GUICtrlSetBkColor(-1, $color2)
|
||||
GUICtrlSetColor(-1, 0xffffff)
|
||||
@ -155,8 +155,8 @@ While 1
|
||||
GUICtrlSetData($labSizeSave, "("&Round(DriveSpaceFree($dstSave)/1024, 0)&" Go disponible)")
|
||||
_getAllServer($profileDirectory)
|
||||
EndIf
|
||||
Case $refresh
|
||||
_getAllServer($profileDirectory)
|
||||
;~ Case $refresh
|
||||
;~ _getAllServer($profileDirectory)
|
||||
Case $modifSaveDirectory
|
||||
$newSaveFolder = FileSelectFolder("Séléctionnez le dossier de sauvegarde", @AppDataDir&"\Thunderbird\Profiles")
|
||||
If Not @error Then
|
||||
@ -201,26 +201,34 @@ While 1
|
||||
$servID = $allServer[$c][3]
|
||||
$directory = $allServer[$c][4]
|
||||
$smtpID = $allServer[$c][5]
|
||||
$sizePopAccount = $allServer[$c][6]
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.identity.'&$identity&'.archive_folder", "imap://'&$accountName&'@imap.ac-nice.fr/Archives");'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.identity.'&$identity&'.draft_folder", "imap://'&$accountName&'@imap.ac-nice.fr/Drafts");'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.identity.'&$identity&'.fcc_folder", "imap://'&$accountName&'@imap.ac-nice.fr/Sent");'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.identity.'&$identity&'.stationery_folder", "imap://'&$accountName&'@imap.ac-nice.fr/Templates");'&@CRLF)
|
||||
$popAdress = $allServer[$c][6]
|
||||
If StringInStr($popAdress, "ac-nice.fr") Then
|
||||
$domain = ".ac-nice.fr"
|
||||
$smtpAddress = "smtps.ac-nice.fr"
|
||||
ElseIf StringInStr($popAdress, "ac-aix-marseille.fr") Then
|
||||
$domain = ".ac-aix-marseille.fr"
|
||||
$smtpAddress = "smtp.ac-aix-marseille.fr"
|
||||
EndIf
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.identity.'&$identity&'.archive_folder", "imap://'&$accountName&'@imap'&$domain&'/Archives");'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.identity.'&$identity&'.draft_folder", "imap://'&$accountName&'@imap'&$domain&'/Drafts");'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.identity.'&$identity&'.fcc_folder", "imap://'&$accountName&'@imap'&$domain&'/Sent");'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.identity.'&$identity&'.stationery_folder", "imap://'&$accountName&'@imap'&$domain&'/Templates");'&@CRLF)
|
||||
|
||||
$randomUID = Random(10000, 99999, 1)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.server.'&$servID&'.directory", "'&StringReplace($proFileDirectory, "\", "\\")&'\\ImapMail\\imap.ac-nice.fr-'&$randomUID&'");'&@CRLF);'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.server.'&$servID&'.directory-rel", "[ProfD]ImapMail/imap.ac-nice.fr-'&$randomUID&'");'&@CRLF);'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.server.'&$servID&'.hostname", "imap.ac-nice.fr");'&@CRLF);'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.server.'&$servID&'.directory", "'&StringReplace($proFileDirectory, "\", "\\")&'\\ImapMail\\imap'&$domain&'-'&$randomUID&'");'&@CRLF);'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.server.'&$servID&'.directory-rel", "[ProfD]ImapMail/imap'&$domain&'-'&$randomUID&'");'&@CRLF);'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.server.'&$servID&'.hostname", "imap'&$domain&'");'&@CRLF);'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.server.'&$servID&'.type", "imap");'&@CRLF);'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.server.'&$servID&'.port", 993);'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.server.'&$servID&'.socketType", 3);'&@CRLF);'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.server.'&$servID&'.spamActionTargetAccount", "imap://'&$accountName&'@imap.ac-nice.fr");'&@CRLF);'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.server.'&$servID&'.spamActionTargetAccount", "imap://'&$accountName&'@imap'&$domain&'");'&@CRLF);'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.server.'&$servID&'.namespace.personal", "\"\"");'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.server.'&$servID&'.namespace.public", "\"Shared Folders/Public/\"");'&@CRLF)
|
||||
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.smtpserver.'&$smtpID&'.authMethod", 3);'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.smtpserver.'&$smtpID&'.description", "");'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.smtpserver.'&$smtpID&'.hostname", "smtps.ac-nice.fr");'&@CRLF)
|
||||
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.smtpserver.'&$smtpID&'.hostname", "'&$smtpAddress&'");'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.smtpserver.'&$smtpID&'.port", 465);'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.smtpserver.'&$smtpID&'.try_ssl", 3);'&@CRLF)
|
||||
FileWrite($profileDirectory&"\user.js", 'user_pref("mail.smtpserver.'&$smtpID&'.type", "smtp");'&@CRLF)
|
||||
@ -229,10 +237,10 @@ While 1
|
||||
;~ $directory = StringReplace($directory, "\\", "\")
|
||||
;~ MsgBox("","",$directory)
|
||||
;~ if $sizePopAccount > 10737418240 then
|
||||
DirCreate($localFolderDirectory&"\Archives de "&$accountName&".sbd")
|
||||
$dst = $localFolderDirectory&"\Archives de "&$accountName&".sbd"
|
||||
FileWrite($localFolderDirectory&"\Archives de "&$accountName, "")
|
||||
RunWait(@ComSpec & ' /c powershell.exe -Command "Move-Item -Path ''' & $directory & '\*'' -Destination ''' & $dst & '''"', "")
|
||||
DirCreate($localFolderDirectory&"\Archives de "&$accountName&".sbd")
|
||||
$dst = $localFolderDirectory&"\Archives de "&$accountName&".sbd"
|
||||
FileWrite($localFolderDirectory&"\Archives de "&$accountName, "")
|
||||
RunWait(@ComSpec & ' /c powershell.exe -Command "Move-Item -Path ''' & $directory & '\*'' -Destination ''' & $dst & '''"', "")
|
||||
;~ Else
|
||||
;~ $dst = $proFileDirectory&"\ImapMail\imap.ac-nice.fr-"&$randomUID
|
||||
;~ DirCreate($dst)
|
||||
@ -325,7 +333,8 @@ Func _getAllServer($profileDirectory)
|
||||
$searchForAcNice = _searchValueInPrefsJsArrayRegex($prefsToArray, "mail\.server\."&$serverID&"\.hostname$")
|
||||
For $p = 1 To $searchForAcNice[0]
|
||||
;~ If StringInStr($searchForAcNice[$p], "ac-nice.fr") Then
|
||||
$domainToSearch = GUICtrlRead($searchDoamin)
|
||||
;~ $domainToSearch = GUICtrlRead($searchDoamin)
|
||||
$domainToSearch = "ac-nice.fr|ac-aix-marseille.fr"
|
||||
$domainToSearch = StringReplace($domainToSearch, ".", "\.")
|
||||
$domainToSearch = StringReplace($domainToSearch, " ", "")
|
||||
if StringRegExp($searchForAcNice[$p], $domainToSearch) Then
|
||||
@ -340,6 +349,7 @@ Func _getAllServer($profileDirectory)
|
||||
if $smtpID = "0" Then
|
||||
$smtpID = _searchValueInPrefsJsArray($prefsToArray, "mail.smtp.defaultserver")
|
||||
EndIf
|
||||
$popHostname = $searchForAcNice[$p]
|
||||
;~ ConsoleWrite($smtpID&@CRLF)
|
||||
;~ $mail = $infoServeur[4]
|
||||
;~ $username = $infoServeur[2]
|
||||
@ -350,7 +360,7 @@ Func _getAllServer($profileDirectory)
|
||||
$allServer[$count][3] = $serverID
|
||||
$allServer[$count][4] = $directory
|
||||
$allServer[$count][5] = $smtpID
|
||||
$allServer[$count][6] = DirGetSize($directory)
|
||||
$allServer[$count][6] = $popHostname
|
||||
;~ $allServer[$count][2] = $username
|
||||
;~ $allServer[$count][3] = StringReplace($directory, "\\", "\")
|
||||
;~ $allServer[$count][4] = StringReplace($signature, "\\", "\")
|
||||
@ -362,9 +372,9 @@ Func _getAllServer($profileDirectory)
|
||||
if $count = 0 then GUICtrlSetState($go, $GUI_DISABLE)
|
||||
Redim $allServer[$count][7]
|
||||
;~ _ArrayDisplay($allServer)
|
||||
;~ GUICtrlDelete($listview)
|
||||
;~ $listview = GUICtrlCreateListView("Username|Account|ID|ServerID|Dossier de stockage|smtpID", 20, 220, 760, 250)
|
||||
;~ GUICtrlSetFont(-1, 11, 500, Default, "Segoe UI")
|
||||
GUICtrlDelete($listview)
|
||||
$listview = GUICtrlCreateListView("Username|Account|ID|ServerID|Dossier de stockage|smtpID|Adresse du POP", 20, 220, 760, 250)
|
||||
GUICtrlSetFont(-1, 11, 500, Default, "Segoe UI")
|
||||
_GUICtrlListView_AddArray($listview, $allServer)
|
||||
;~ Redim $allServer[$count][6]
|
||||
GUICtrlSendMsg($ListView, $LVM_SETCOLUMNWIDTH, 0, -1) ; $LVSCW_AUTOSIZE
|
||||
@ -374,6 +384,7 @@ Func _getAllServer($profileDirectory)
|
||||
GUICtrlSendMsg($ListView, $LVM_SETCOLUMNWIDTH, 4, -1) ; $LVSCW_AUTOSIZE
|
||||
GUICtrlSendMsg($ListView, $LVM_SETCOLUMNWIDTH, 5, -1) ; $LVSCW_AUTOSIZE
|
||||
GUICtrlSendMsg($ListView, $LVM_SETCOLUMNWIDTH, 6, -1) ; $LVSCW_AUTOSIZE
|
||||
GUICtrlSendMsg($ListView, $LVM_SETCOLUMNWIDTH, 7, -1) ; $LVSCW_AUTOSIZE
|
||||
GUICtrlSendMsg($ListView, $LVM_SETCOLUMNWIDTH, 0, -2) ; $LVSCW_AUTOSIZE_USEHEADER
|
||||
GUICtrlSendMsg($ListView, $LVM_SETCOLUMNWIDTH, 1, -2) ; $LVSCW_AUTOSIZE_USEHEADER
|
||||
GUICtrlSendMsg($ListView, $LVM_SETCOLUMNWIDTH, 2, -2) ; $LVSCW_AUTOSIZE_USEHEADER
|
||||
@ -381,6 +392,7 @@ Func _getAllServer($profileDirectory)
|
||||
GUICtrlSendMsg($ListView, $LVM_SETCOLUMNWIDTH, 4, -2) ; $LVSCW_AUTOSIZE_USEHEADER
|
||||
GUICtrlSendMsg($ListView, $LVM_SETCOLUMNWIDTH, 5, -2) ; $LVSCW_AUTOSIZE_USEHEADER
|
||||
GUICtrlSendMsg($ListView, $LVM_SETCOLUMNWIDTH, 6, -2) ; $LVSCW_AUTOSIZE_USEHEADER
|
||||
GUICtrlSendMsg($ListView, $LVM_SETCOLUMNWIDTH, 7, -2) ; $LVSCW_AUTOSIZE_USEHEADER
|
||||
EndFunc
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user