2022-04-13 12:51:56 +00:00
|
|
|
#include "accountManager.h"
|
|
|
|
|
|
|
|
AccountManager::AccountManager(std::string pathToFil, std::string pathToAccountNumberFile, PAGE page, const PAGE *pagesALL)
|
|
|
|
: pagesALL(pagesALL), pathToAccountNumberFile(pathToAccountNumberFile + "_" + page.name_id), pageInUse(page)
|
|
|
|
{
|
|
|
|
std::string pathToAccountsFile = pathToFil + "_" + page.name_id;
|
|
|
|
std::ifstream ifs(pathToAccountsFile);
|
|
|
|
if(!ifs.is_open()) {
|
|
|
|
if(writeDefault(pathToAccountsFile) != 0)
|
|
|
|
exit(12);
|
|
|
|
ifs.open(pathToAccountsFile);
|
|
|
|
if(!ifs.is_open()) {
|
|
|
|
std::cout << " => Error: Konnte Account File nicht aufmachen" << std::endl;
|
|
|
|
exit(13);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::string line;
|
|
|
|
while (std::getline(ifs, line)) {
|
|
|
|
if(line.length() > 0 && line[0] == '#')
|
|
|
|
continue;
|
|
|
|
Account account;
|
|
|
|
size_t Delimeter = line.find("/");
|
|
|
|
|
|
|
|
if(Delimeter == std::string::npos) {
|
|
|
|
account.Email = line;
|
|
|
|
account.Password = line;
|
|
|
|
} else {
|
|
|
|
account.Email = std::string(line).erase(Delimeter, line.length() - Delimeter);
|
|
|
|
account.Password = line.erase(0, Delimeter + 1);
|
|
|
|
}
|
|
|
|
if(account.Email == "" || account.Password == "")
|
|
|
|
continue;
|
|
|
|
else
|
|
|
|
accounts.push_back(account);
|
|
|
|
}
|
|
|
|
|
|
|
|
ifs.close();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Account AccountManager::getNextAccount()
|
|
|
|
{
|
|
|
|
if(accounts.size() == 0) {
|
|
|
|
std::cout << " => Error: Keine Accounts vorhanden." << std::endl;
|
|
|
|
exit(36);
|
|
|
|
}
|
|
|
|
size_t accountNumber = getLastAccountNumber();
|
|
|
|
++accountNumber;
|
|
|
|
|
|
|
|
if( accountNumber >= accounts.size() )
|
|
|
|
accountNumber=0;
|
|
|
|
if(setLastAccountNumber(accountNumber) != 0)
|
|
|
|
exit(45);
|
|
|
|
|
|
|
|
return accounts.at(accountNumber);
|
|
|
|
}
|
|
|
|
|
|
|
|
int AccountManager::writeDefault(std::string path)
|
|
|
|
{
|
|
|
|
std::ofstream ofs(path);
|
|
|
|
if(!ofs.is_open()) {
|
|
|
|
perror((std::string(" => Error: Konnte Account Datei nicht aufmachen: ") + path).c_str());
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
std::cout << " => Erstelle Datei mit Accounts unter: " << path << "..." <<std::endl;
|
|
|
|
ofs << "# <- Am Anfang der Zeile deaktiviert diese." << std::endl;
|
|
|
|
ofs << "#Email/Passwort - Falls diese gleich sind, geht auch nur Email oder Passwort" << std::endl;
|
|
|
|
|
|
|
|
enum pagesID {
|
|
|
|
STO,
|
|
|
|
ANICLOUD,
|
|
|
|
STOIP,
|
|
|
|
SERIENCAM,
|
|
|
|
SERIENSTREAMTO
|
|
|
|
};
|
|
|
|
|
|
|
|
if( pageInUse.url == pagesALL[STO].url
|
|
|
|
|| pageInUse.url == pagesALL[STOIP].url
|
|
|
|
|| pageInUse.url == pagesALL[SERIENCAM].url
|
|
|
|
|| pageInUse.url == pagesALL[SERIENSTREAMTO].url)
|
|
|
|
{
|
|
|
|
ofs << "EntzueckendPackenderSkorpion@oida.icu" << std::endl;
|
|
|
|
ofs << "HumorvollWundervollerDelfin@spam.care/HumorvollWundervollerDelfin@spam.care" << std::endl;
|
|
|
|
ofs << "ExzellentPackenderHirsch@muell.icu/ExzellentPackenderHirsch@muell.icu" << std::endl;
|
|
|
|
ofs << "GrandiosLeuchtenderPanda@papierkorb.me" << std::endl;
|
|
|
|
ofs << "AttraktivPositiverSteinbock@magspam.net" << std::endl;
|
|
|
|
ofs << "FreundlichKostbarerSteinbock@spam.care" << std::endl;
|
|
|
|
ofs << "FabelhaftSelbstsichererUhu@spam.care" << std::endl;
|
|
|
|
ofs << "HumorvollSinnlicherRabe@muell.icu" << std::endl;
|
|
|
|
ofs << "AnspruchsvollTraumhafterPavian@ultra.fyi" << std::endl;
|
|
|
|
ofs << "FaszinierendRiskanterLuchs@magspam.net" << std::endl;
|
|
|
|
ofs << "BeruehmtMystischerPanda@ultra.fyi" << std::endl;
|
|
|
|
ofs << "CharmantRasanterLoewe@existiert.net" << std::endl;
|
|
|
|
ofs << "BedeutendLuesternerAal@existiert.net" << std::endl;
|
|
|
|
ofs << "ElegantSelbstsichererAdler@ultra.fyi" << std::endl;
|
|
|
|
ofs << "FaszinierendKoeniglicherBaer@spam.care" << std::endl;
|
|
|
|
ofs << "CharmantKostbarerLoewe@magspam.net" << std::endl;
|
|
|
|
ofs << "BedeutendPrallerSkorpion@muellemail.com" << std::endl;
|
|
|
|
ofs << "FreundlichPerfekterRochen@muellmail.com" << std::endl;
|
|
|
|
ofs << "AusgelassenKostbarerBasilisk@magspam.net" << std::endl;
|
|
|
|
ofs << "FabelhaftLebhafterSchakal@ultra.fyi" << std::endl;
|
|
|
|
ofs << "ExzellentSchoenerSteinbock@existiert.net" << std::endl;
|
|
|
|
ofs << "ErhellendLustvollerAdler@muell.icu" << std::endl;
|
|
|
|
ofs << "ExzellentIdealerSchakal@muell.icu" << std::endl;
|
|
|
|
ofs << "BrillantVitalerSalamander@spam.care" << std::endl;
|
|
|
|
ofs << "BezauberndRiesigerSchakal@oida.icu" << std::endl;
|
|
|
|
ofs << "DynamischWarmerBaer@magspam.net" << std::endl;
|
|
|
|
ofs << "EmotionalLeidenschaftlicherBaer@oida.icu" << std::endl;
|
|
|
|
ofs << "BewundernswertWarmerSchwan@oida.icu" << std::endl;
|
|
|
|
ofs << "HuebschUnfassbarerAal@papierkorb.me" << std::endl;
|
|
|
|
ofs << "FroehlichWundervollerBiber@muellmail.com" << std::endl;
|
|
|
|
ofs << "BefreiendWilderDelfin@spam.care" << std::endl;
|
|
|
|
ofs << "FreundlichStilvollerTiger@oida.icu" << std::endl;
|
|
|
|
ofs << "EchtKoeniglicherStorch@existiert.net" << std::endl;
|
|
|
|
ofs << "BefluegeltPrallerSchwan@spam.care" << std::endl;
|
|
|
|
ofs << "ErhellendSeltenerSeeloewe@ultra.fyi" << std::endl;
|
|
|
|
ofs << "FreundlichZuverlaessigerSchwan@spam.care" << std::endl;
|
|
|
|
ofs << "HervorragendWundervollerReiher@oida.icu" << std::endl;
|
|
|
|
ofs << "AnspruchsvollStilvollerUhu@magspam.net" << std::endl;
|
|
|
|
ofs << "AnmutigTraumhafterHai@muellemail.com" << std::endl;
|
|
|
|
ofs << "AtemberaubendIdealerTapir@ultra.fyi" << std::endl;
|
|
|
|
ofs << "GeheimLeuchtenderLuchs@muellemail.com" << std::endl;
|
|
|
|
ofs << "DuftendKlarerTapir@muellmail.com" << std::endl;
|
|
|
|
ofs << "GeheimUnwiderstehlicherRabe@muell.icu" << std::endl;
|
|
|
|
ofs << "ExtravagantSpektakulaererAdler@spam.care" << std::endl;
|
|
|
|
ofs << "BildlichWarmerLoewe@oida.icu" << std::endl;
|
|
|
|
ofs << "AktivKlarerHai@spam.care" << std::endl;
|
|
|
|
ofs << "AktivKostbarerElch@oida.icu" << std::endl;
|
|
|
|
ofs << "Strust1991@jourrapide.com" << std::endl;
|
|
|
|
ofs << "Natchoughe1928@dayrep.com" << std::endl;
|
|
|
|
ofs << "zweirot@einrot.com" << std::endl;
|
|
|
|
ofs << "AktivMagischerFrosch@existiert.net" << std::endl;
|
|
|
|
ofs << "ErhellendPerfekterDachs@existiert.net" << std::endl;
|
|
|
|
ofs << "ojfvwj.fgf@existiert.net" << std::endl;
|
|
|
|
ofs << "lusiouae@wegwerfemail.de" << std::endl;
|
|
|
|
ofs << "fraiwrou@wegwerfemail.de" << std::endl;
|
|
|
|
ofs << "driotean@wegwerfemail.de" << std::endl;
|
|
|
|
ofs << "tiaprour@wegwerfemail.de" << std::endl;
|
|
|
|
ofs << "FeurigWarmerPapagei@existiert.net" << std::endl;
|
|
|
|
ofs << "FrischStilvollerPavian@magspam.net" << std::endl;
|
|
|
|
ofs << "FeurigZaghafterLoewe@muellmail.com" << std::endl;
|
|
|
|
ofs << "GigantischKoeniglicherSchwan@magspam.net" << std::endl;
|
|
|
|
ofs << "FreizuegigPersoenlicherLemming@spam.care" << std::endl;
|
|
|
|
ofs << "BelebtIntelligenterHusky@papierkorb.me" << std::endl;
|
|
|
|
ofs << "FreundlichMaximalerSpecht@muellmail.com" << std::endl;
|
|
|
|
ofs << "FreundlichStarkerHirsch@ultra.fyi" << std::endl;
|
|
|
|
ofs << "ErstklassigRasanterElch@oida.icu" << std::endl;
|
|
|
|
ofs << "FreundlichStarkerPavian@ultra.fyi" << std::endl;
|
|
|
|
ofs << "EinfuehlsamRiskanterPapagei@oida.icu" << std::endl;
|
|
|
|
ofs << "FantastischPositiverHirsch@existiert.net" << std::endl;
|
|
|
|
ofs << "GeborgenIndividuellerOtter@muell.icu" << std::endl;
|
|
|
|
ofs << "HervorragendSensibelerWal@oida.icu" << std::endl;
|
|
|
|
ofs << "HerrlichIndividuellerPelikan@spam.care" << std::endl;
|
|
|
|
ofs << "HerrlichLeuchtenderTapir@muellmail.com" << std::endl;
|
|
|
|
ofs << "ErstaunlichIntensiverEsel@magspam.net" << std::endl;
|
|
|
|
ofs << "ExtravagantPraechtigerWal@muellemail.com" << std::endl;
|
|
|
|
ofs << "GravierendWundervollerFalke@spam.care" << std::endl;
|
|
|
|
ofs << "EntzueckendLebhafterFlamingo@magspam.net" << std::endl;
|
|
|
|
ofs << "GeheimSprachloserStorch@existiert.net" << std::endl;
|
|
|
|
ofs << "GravierendVitalerOtter@spam.care" << std::endl;
|
|
|
|
ofs << "GrenzenlosInteressanterElch@oida.icu" << std::endl;
|
|
|
|
ofs << "HellPackenderGoldfisch@muellemail.com" << std::endl;
|
|
|
|
ofs << "AbenteuerlichSelbstloserFalke@muell.icu" << std::endl;
|
|
|
|
ofs << "EmotionalZaghafterPapagei@magspam.net" << std::endl;
|
|
|
|
ofs << "HellLiebenswerterElefant@muellemail.com" << std::endl;
|
|
|
|
ofs << "BildlichImponierenderEsel@muellemail.com" << std::endl;
|
|
|
|
ofs << "ErstaunlichSprachloserPapagei@ultra.fyi" << std::endl;
|
|
|
|
ofs << "BerauschendLebendigerDelfin@ultra.fyi" << std::endl;
|
|
|
|
ofs << "GravierendIntensiverHase@oida.icu" << std::endl;
|
|
|
|
ofs << "BerauschendUnglaublicherGorilla@oida.icu" << std::endl;
|
|
|
|
ofs << "GenuesslichPraechtigerDachs@spam.care" << std::endl;
|
|
|
|
|
|
|
|
} else if( pageInUse.url == pagesALL[ANICLOUD].url ) {
|
|
|
|
ofs << "C322334ark1954@teleworm.us/C322334ark1954@teleworm.us" << std::endl;
|
|
|
|
ofs << "wemixex225@iconmle.com/wemixex225@iconmle.com" << std::endl;
|
|
|
|
ofs << "Thw86757utary@teleworm.us" << std::endl;
|
|
|
|
ofs << "thw811ssssutary@teleworm.us" << std::endl;
|
|
|
|
ofs << "Leonardoutary@teleworm.us" << std::endl;
|
|
|
|
ofs << "efgewtzhewtrhterw@tonne.to" << std::endl;
|
|
|
|
ofs << "dwfwqefqefqe@dsgvo.ru" << std::endl;
|
|
|
|
ofs << "dfdfgwgwrgwg@muell.ru" << std::endl;
|
|
|
|
ofs << "BildlichSprachloserWal@spam.care" << std::endl;
|
|
|
|
ofs << "BildlichLustvollerRochen@muell.ru" << std::endl;
|
|
|
|
ofs << "AngenehmMaximalerHai@muell.icu" << std::endl;
|
|
|
|
ofs << "FreundlichKostbarerWolf@fukaru.com" << std::endl;
|
|
|
|
ofs << "animewatcherxgas120@oida.icu" << std::endl;
|
|
|
|
ofs << "animewatcherxgas7776@oida.icu" << std::endl;
|
|
|
|
ofs << "animewatcherxgas777116@oida.icu" << std::endl;
|
|
|
|
|
2022-04-13 18:56:15 +00:00
|
|
|
ofs << "HervorragendPositiverLoewe@muell.ru" << std::endl;
|
|
|
|
ofs << "FaszinierendRiskanterOtter@spam.care" << std::endl;
|
2022-04-13 12:51:56 +00:00
|
|
|
ofs << "" << std::endl;
|
|
|
|
ofs << "" << std::endl;
|
|
|
|
ofs << "" << std::endl;
|
|
|
|
ofs << "" << std::endl;
|
|
|
|
ofs << "" << std::endl;
|
|
|
|
ofs << "" << std::endl;
|
|
|
|
ofs << "" << std::endl;
|
|
|
|
ofs << "" << std::endl;
|
|
|
|
ofs << "" << std::endl;
|
|
|
|
ofs << "" << std::endl;
|
|
|
|
ofs << "" << std::endl;
|
|
|
|
ofs << "" << std::endl;
|
|
|
|
ofs << "" << std::endl;
|
|
|
|
ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
// ofs << "" << std::endl;
|
|
|
|
} else {
|
|
|
|
std::cout << " => WARNUNG: Keine standart Accounts für die Url '" << pageInUse.url << "' vorhanden." <<std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
ofs.close();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
size_t AccountManager::getLastAccountNumber()
|
|
|
|
{
|
|
|
|
std::ifstream fStream;
|
|
|
|
fStream.open(pathToAccountNumberFile);
|
|
|
|
if(!fStream.is_open()) {
|
|
|
|
std::ofstream ofs;
|
|
|
|
ofs.open(pathToAccountNumberFile);
|
|
|
|
ofs << "0" << std::endl;
|
|
|
|
ofs.close();
|
|
|
|
fStream.open(pathToAccountNumberFile);
|
|
|
|
if(!fStream.is_open()) {
|
|
|
|
perror(" => Error: Konnte Account Number Datei nicht erstellen");
|
|
|
|
exit(34);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string content( (std::istreambuf_iterator<char>(fStream) ), (std::istreambuf_iterator<char>() ) );
|
|
|
|
return static_cast<size_t>( atoi(content.c_str()) );
|
|
|
|
}
|
|
|
|
|
|
|
|
int AccountManager::setLastAccountNumber(size_t number)
|
|
|
|
{
|
|
|
|
std::ofstream ofs;
|
|
|
|
ofs.open(pathToAccountNumberFile, std::ios::trunc);
|
|
|
|
if(!ofs.is_open()) {
|
|
|
|
std::cout << " => Error: Account Number Datei ist nicht aufgemacht." << std::endl;
|
|
|
|
return 110;
|
|
|
|
}
|
|
|
|
//fStream.clear();
|
|
|
|
ofs << number << std::endl;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|