<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */


class ToolAdministrationSettings extends ToolSettingsBASys
{
  public $vhsname = '';
  public $adminmail = '';
  public $vhsimpressum = '';
  public $savemail2file = ANMELDUNGPER_MAIL;
  public $directenrol = ANMELDUNGSOFORTEINBUCHEN_NIE;
  public $duplicatedetection = ANMELDUNGSOFORTEINBUCHEN_DUBLETTENERKENNUNG_NEIN;
  public $directenrolTools = ANMELDUNGSOFORTEINBUCHEN_NIE;
  public $duplicateinsertbankaccount = false;
  public $uploadviamail = false; 
  public $uploadmailto = '';
  public $nowebattendee = TEILNEHMER_IN_MYSQL_ANLEGEN;
  public $downtimestart = SERVER_WARTUNGSARBEITEN_BEGINN;
  public $downtimefinish = SERVER_WARTUNGSARBEITEN_ENDE;
  public $usexmlmail = true;
  public $emailfilepath = '';
  public $encrypt = false;
  
  public $bevorzugeDmzBeiAnmeldungDurchMitarbeiter = true;

  
  public $uebermittlungsartMitabeiterTools;
  
  public $SSLAnmeldung = false;
  
  public $serverName = '';
  
  public $SSLserverName = '';
  
  public $SSLserverNameTools = '';
  
  public $pwdMinLength = 0;
  
  public $pwdSpecialCharsRequired = false;
  
  public $pwdNumbersRequired = false;
  
  public $pwdLowerUpperRequired = false;

  
  public $absenderTeilnehmerAnEinrichtung = 'Person';
  public $absenderTeilnehmerAnAndere = 'Einrichtung';
  public $absenderDozentAnEinrichtung = 'Person';
  public $absenderDozentAnAndere = 'Einrichtung';
  public $absenderMitarbeiterAnEinrichtung = 'Person';
  public $absenderMitarbeiterAnDozent = 'Einrichtung';
  public $absenderMitarbeiterAnTeilnehmer = 'Einrichtung';
  public $absenderHausmeisterAnEinrichtung = 'Person';
  public $absenderHausmeisterAnAndere = 'Einrichtung';

  public $abweichendeAbsenderEMailAdresse = '';

  
  public $savebak = false;
  
  public $verificationident = false;
  
  public $encryptXML = false;

  
  public $wbXsrf = false;

  
  public $wbSichereStatusmeldungenDeaktivieren = false;

  
  public $wbPwVergessenVorRateAngriffSchuetzen = true;

  
  public $ktPwVergessenVorRateAngriffSchuetzen = false;

  
  public $filterAllHtmlFields = false;

  
  public $loggip = false;

  
  public $willkommenTools;

  
  public $vhswebsite;
  
  public $zurVhsHPBenGruppen;


  
  
  public $nameMap_DOZ;
  public $nameMap_MA;
  public $nameMap_TN;
  public $nameMap_FA;
  public $nameMap_ADR;

  
  public $toolMap_DOZ;
  public $toolMap_MA;
  public $toolMap_TN;
  public $toolMap_FA;
  public $toolMap_ADR;
  
  public $breakMap_DOZ;
  public $breakMap_MA;
  public $breakMap_TN;
  public $breakMap_FA;
  public $breakMap_ADR;

  
  public $menuBar;

  
  public $menuBarResponsive;


  
  public $buttonWidth;
  
  public $fileUploadPath = '../log/uploads';
  
  public $fileUploadMaxFileSize = 2097152;
  
  public $fileUploadMaxFileNumber = 5;

  public $fileUploadCheckMimeType = false;

  
  public $bildUploadMaxSize = 2097152; 

  
  public $dokuUploadAllowByExclude = false;

  
  public $uploadBlacklist4Ext = '.php, .pl, .cgi';

  
  public $uploadWhitelist4Ext = '.pdf, .doc, .docx, .ppt, .pptx, .xls, .xlsx, .txt, .odt, .jpg, .jpeg, .png';

  
  public $imgUploadWhitelist = '.jpg, .jpeg, .png, .gif';

  
  public $useAllowedExt4Attach = true;

  
  

  
  public $checkEmailAnhaenge = false;

  
  public $checkEmailAnhaengeKostenfreiNicht = false;

  
  public $fileUploadEmailPath = '../log/uploads/email';

  
  public $filesEmailAnhaengeArray = '';

  
  public $direktMaKuerzel = 'WT';

  
  public $bccAnmeldebestaetigungeMail;
  public $bccAnmeldebestaetigungeMailAdresse;
  public $suppressInfoMail;
  public $infoMailMultipleContent;
  public $infoMailTextContent;
  public $mitUnterKursen = false;
  public $kurstageNurVonEingeloggtemDozent = false;
  public $loginStammHoerer = false;

  
  public $stammhoererDatenAendernEmailAddresse = '';

  
  public $stammhoererDatenAendernEmailAuchAnTn = false;

  
  public $stammhoererLoginDatenAendernDirektInDb = false;

  
  public $stammhoererLoginDatenAendernEmailAuchWennDirekt = false;

  public $stammhoererLoginBankverbindungAendernEmailInfo = false;
  public $stammhoererLoginBankverbindungHinzufuegenEmailInfo = false;

  
  public $stammhoererLoginStatusAusfuehrlich = false;

  
  public $stammhoererLoginLoginMitMailAendern = true;

  
  public $stammhoererLoginEmailAendernErfordertPwEingabe = false;

  
  public $stammhoererLoginLoginRequiresCaptcha = false;

  
  public $tnLdapLoginUrl;

  
  public $tnLdapLoginPort = 389;

  
  public $tnLdapLoginServiceAccDN;

  
  public $tnLdapLoginServiceAccPassword;

  
  public $tnLdapLoginSearchFilter;

  
  public $tnLdapLoginSearchBasisDN;

  
  public $tnLdapLoginUseCaCertFile = false;

  
  public $tnLdapLoginCaCertFile = '';

  
  public $uploadpath = '../ablage';
  
  public $uploadmaxsize = 2097152;
  
  public $uploadmaxcount = 5;

  
  public $downloadpath = '../ablage';

  
  public $downloadPathAbsoluteForRelative = '';

  
  public $kurs_status_farben = 'BASE64#YTowOnt9'; 
  
  public $kurstag_status_farben = 'BASE64#YTowOnt9'; 
  
  public $belegung_status_farben = 'BASE64#YTowOnt9'; 

  
  public $kursFilterCheckKnrAb = false;

  
  public $login_err_email = false;

  
  public $stammhoererAusloggenWarenkorbLoeschen = false;

  public $stammhoererOptinAdditionalClick = false;

  
  public $stammhoererKennzeichenZuordnen = 0;

  
  public $stammhoererOptinExpires = 72;

  public $stammhoererRegistrierungOptinExpires = 0;

  
  public const LOGIN_ERR_DISABLE_NICHT_SPERREN = 0;
  public const LOGIN_ERR_DISABLE_DAUERHAFT_SPERREN = 1;
  public const LOGIN_ERR_DISABLE_VORUEBERGEHEND_SPERREN = 2;
  
  public $login_err_disable = self::LOGIN_ERR_DISABLE_NICHT_SPERREN;

  
  public $login_err_disable_value = 0;

  
  public const LOGIN_ERR_DISABLE_UNIT_MINUTEN = 0;
  public const LOGIN_ERR_DISABLE_UNIT_STUNDEN = 1;
  public const LOGIN_ERR_DISABLE_UNIT_TAGE = 2;
  
  public $login_err_disable_unit = self::LOGIN_ERR_DISABLE_UNIT_MINUTEN;
  
  public $login_err_count = 0;
  
  public $SSLLogin = false;
  
  public $captchaLoginFehlerhaft = false;
  
  public $captchaTyp = CAPTCHA_SIMPLECAPTCHA;

  
  public $vorlagePasswortEMailBetreff = '';

  
  public $vorlagePasswortEMailInhalt = '';
  
  public $vorlagePasswortAendernEMailBetreff = '';

  
  public $icsWhichTitle = 'kurzbez_titel';

  
  public $icsWithoutDescription = false;
  
  public $icsLocation = '';

  
  public $showSmsBetreff = false;

  
  public $linkToCurrentToolSettings = false;

  
  public $vhsEmailTools = '';

  
  public $vhsEmailTool0Section5 = ''; 

  
  public $hint4Login = '';

  
  public $needAdress4Login = false;

  
  public $dseZustimmung4Login = false;

  
  public $dseZustimmungLink4Login = '';

  
  public $freiesPflichtfeldZustimmung4Login = false;

  
  public $freiesPflichtfeldZustimmungText4Login = '';

  
  public $eLearningUrl = '';


  
  public $keepFilterSettings = false;

  
  public $forwardToResponsive = false;

  
  public $forwardHmToResponsive = false;

  
  public $forwardTnToResponsive = false;

  
  public $forwardMaToResponsive = false;

  
  public $telefonnummerBeiLoginAnforderung = 0;

  public $dozAutoLogin = false;
  public $tnAutoLogin = false;

  
  public $unterschiedsPruefungFelder = '';

  
  public $showUserSettings = false;

  public $showToolTipOnError = false;

  
  public $forwardToWillkommenWennAngemeldet = false;

  
  public $toolNachLogin = '1, 20, 21, 5, 8';

  
  public $emailAendernErfordertPwEingabe = false;

  
  public $hinterlegungKursorteNurVonEingeloggtemMitarbeiter = false;

  
  public $pdflisteLogoWidth = 150;

  
  public $useFeedbackOnlyInReplikatsDb = false;

  
  public $convertUploadDocumentsToPDF = false;

  
  public $ferienKalender = '';

  
  public $cronjobExecutionType = 0;

  
  public $cronjobWebExecutionTypeChance = 50;

  
  public $cronjobWebAllowCliProcess = true;

  
  public $cronEmailEMailRecipient = '';

  
  public $cronjobReplikatCheckActiv = true;

  
  public $cronjobReplikatCheckNichtAmWochenende = true;

  
  public $cronjobReplikatCheckDb1 = 720;

  
  public $cronjobReplikatCheckDb2 = 720;

  
  public $cronjobReplikatCheckDb3 = 720;

  
  public $cronjobReplikatCheckDb4 = 720;

  
  public $cronjobReplikatCheckDb5 = 720;

  
  public $cronjobReplikatCheckDb10 = 1440;

  public function initSystemVars()
  {
    parent::initSystemVars();
    $this->systemVars['savemail2file'] = 'savemail2file';
    $this->systemVars['usexmlmail'] = 'usexmlmail';
    $this->systemVars['emailfilepath'] = 'emailfilepath';
    $this->systemVars['encrypt'] = 'encrypt';
    $this->systemVars['SSLAnmeldung'] = 'SSLAnmeldung';
    $this->systemVars['SSLLogin'] = 'SSLLogin';
    $this->systemVars['serverName'] = 'serverName';
    $this->systemVars['SSLserverName'] = 'SSLserverName';
    $this->systemVars['SSLserverNameTools'] = 'SSLserverNameTools';
    $this->systemVars['pwdMinLength'] = 'pwdMinLength';
    $this->systemVars['pwdSpecialCharsRequired'] = 'pwdSpecialCharsRequired';
    $this->systemVars['pwdNumbersRequired'] = 'pwdNumbersRequired';
    $this->systemVars['pwdLowerUpperRequired'] = 'pwdLowerUpperRequired';
    $this->systemVars['savebak'] = 'savebak';
    $this->systemVars['verificationident'] = 'verificationident';
    $this->systemVars['encryptXML'] = 'encryptXML';
    $this->systemVars['fileUploadPath '] = 'fileUploadPath ';
    $this->systemVars['fileUploadMaxFileSize '] = 'fileUploadMaxFileSize ';
    $this->systemVars['fileUploadMaxFileNumber '] = 'fileUploadMaxFileNumber ';
  }

  public function afterToolSettingsLoaded()
  {
    if ($this->fileUploadPath == '') {
      $path = '..\\log\\uploads';
    } else {
      $path = $this->fileUploadPath;
    }

    $uploadPath = new Path($path);
    $webbasysPath = new Path(BASEDIR . 'webbasys' . DIRECTORY_SEPARATOR);

    $absolutePath = $uploadPath->getAbsoluteTo($webbasysPath);

    $this->fileUploadPath = $absolutePath;
  }

  public function beforeToolSettingsSaved()
  {
    if ($this->fileUploadPath instanceof Path) {
      $this->fileUploadPath = $this->fileUploadPath->getPathBeforeMakeAbsolute();
    }
  }
}