Ejemplo n.º 1
0
 private function getGUI($id)
 {
     $this->loadMeOrEmpty();
     if ($id == -1) {
         $this->A->typ = "LoginData";
     }
     $gui = new HTMLGUIX($this);
     $gui->name("LoginData");
     $gui->label("UserID", "Benutzer");
     $gui->label("name", "Typ");
     $gui->label("passwort", "Passwort");
     $gui->label("optionen", "Optionen");
     $gui->label("benutzername", "Benutzername");
     $gui->label("server", "Server");
     $gui->type("typ", "hidden");
     $gui->type("wert", "hidden");
     $gui->type("passwort", "password");
     $onkeyup = "\$('editLoginDataGUI').wert.value = \$('editLoginDataGUI').benutzername.value+'::::'+\$('editLoginDataGUI').passwort.value+(\$('editLoginDataGUI').server.value != '' ? '::::s:'+\$('editLoginDataGUI').server.value : '')+(\$('editLoginDataGUI').optionen.value != '' ? '::::o:'+\$('editLoginDataGUI').optionen.value : '')";
     $gui->addFieldEvent("benutzername", "onKeyup", $onkeyup);
     $gui->addFieldEvent("server", "onKeyup", $onkeyup);
     $gui->addFieldEvent("passwort", "onKeyup", $onkeyup);
     $gui->addFieldEvent("optionen", "onKeyup", $onkeyup);
     $U = new Users();
     $U->addAssocV3("isAdmin", "=", "0");
     $Users = array();
     $Users[-1] = "alle Benutzer";
     while ($t = $U->getNextEntry()) {
         $Users[$t->getID()] = $t->A("name");
     }
     $gui->type("UserID", "select", $Users);
     $dataTypes = LoginData::getNames();
     $gui->type("name", "select", $dataTypes);
     return $gui;
 }
Ejemplo n.º 2
0
 public function __construct()
 {
     //przykładowe dane, normalnie sprawdzili byśmy to w bazie danych
     $correctData = new LoginData('janek', 'muzykant');
     //dla wygody ten sam kontroler od razu zajmuje się sprawdzaniem loginu jak i ładowaniem odpowiednich widoków
     if (isset($_POST['login']) && isset($_POST['pass'])) {
         $inputLogin = $_POST['login'];
         $inputPass = $_POST['pass'];
         if ($correctData->checkPassword($inputLogin, $inputPass)) {
             echo file_get_contents(__DIR__ . '/../views/logged.php');
         } else {
             //tutaj powinien być jakiś widok załadowany zamiast stringa
             echo "Złe dane";
         }
     } else {
         echo file_get_contents(__DIR__ . '/../views/login.php');
     }
 }
Ejemplo n.º 3
0
 function __construct()
 {
     $this->LD = LoginData::get("LDAPServerUserPass");
     if ($this->LD == null) {
         throw new NoDBUserDataException();
     }
     $this->c = ldap_connect($this->LD->A("server"));
     ldap_set_option($this->c, LDAP_OPT_PROTOCOL_VERSION, 3);
     $r = ldap_bind($this->c, $this->LD->A("benutzername"), $this->LD->A("passwort"));
     #if(!$r) throw new StorageException("Could not authenticate to LDAP server: ".ldap_error($this->c));
 }
Ejemplo n.º 4
0
 public static function getUsers($type = 0)
 {
     $LD = LoginData::get("ADServerUserPass");
     if (mUserdata::getGlobalSettingValue("AppServer", "") != "") {
         $U = new Users();
         $U->getAppServerUsers();
     } elseif ($LD != null and $LD->A("server") != "") {
         $U = new LoginAD();
         $U->getUsers();
     } else {
         $U = new Users();
         $U->addAssocV3("isAdmin", "=", "0");
         $U->addAssocV3("UserType", "=", $type);
     }
     return $U;
 }
Ejemplo n.º 5
0
 function loadMe($empty = true)
 {
     if ($this->getID() > 20000) {
         if (mUserdata::getGlobalSettingValue("AppServer", "") != "") {
             $S = Util::getAppServerClient();
             $this->setA($S->getUserById($this->ID, $empty));
             return;
         }
         $LD = LoginData::get("ADServerUserPass");
         if ($LD != null and $LD->A("server") != "") {
             $this->setA(LoginAD::getUserById($this->ID));
             return;
         }
     }
     parent::loadMe();
     if ($empty and $this->A != null) {
         $this->A->SHApassword = "";
     }
 }
Ejemplo n.º 6
0
 public static function getS($value, $default, $forceReload = false)
 {
     Environment::load($forceReload);
     $return = Environment::$currentEnvironment->get($value, $default);
     switch ($value) {
         case "usePWEncryption":
             try {
                 $LD = LoginData::get("ADServerUserPass");
                 if ($LD != null and $LD->A("server") != "") {
                     return false;
                 }
             } catch (Exception $e) {
             }
             return true;
             break;
         case "onLogout":
         case "onTimeout":
             return str_replace("%CLOUDUSER", Environment::$currentEnvironment->cloudUser(), $return);
             break;
         case "databaseData":
             if (is_array($return)) {
                 return $return;
             }
             $ex = explode(";;", $return);
             $dbData = array();
             $dbData["host"] = $ex[0];
             $dbData["user"] = $ex[1];
             $dbData["password"] = $ex[2];
             $dbData["httpHost"] = "*";
             $dbData["datab"] = $ex[3];
             $return = $dbData;
             break;
         case "databaseDataWrite":
             if ($return == null) {
                 return null;
             }
             if (is_array($return)) {
                 return $return;
             }
             $ex = explode(";;", $return);
             $dbData = array();
             $dbData["host"] = $ex[0];
             $dbData["user"] = $ex[1];
             $dbData["password"] = $ex[2];
             $dbData["httpHost"] = "*";
             $dbData["datab"] = $ex[3];
             $return = $dbData;
         case "allowedApplications":
             if ($return == null) {
                 return null;
             }
             return explode(",", $return);
             break;
         case "pluginsExtra":
         case "allowedPlugins":
         case "hiddenPlugins":
             if ($return == null) {
                 return $default;
             }
             return explode(",", $return);
             break;
         case "customizer":
         case "customizerExtra":
             if ($return == null) {
                 return $default;
             }
             return explode(",", $return);
             break;
     }
     $return = Aspect::joinPoint("alter", null, __METHOD__, array($value, $default), $return);
     return $return;
 }
Ejemplo n.º 7
0
 /**
  * Constructor function.
  */
 public function __construct($senderDomain = "", $skipOwnServer = false)
 {
     /**
      * Initialise some variables.
      */
     $this->attachments = array();
     $this->html_images = array();
     $this->headers = array();
     $this->is_built = false;
     $this->text = '';
     $this->sendmail_path = '/usr/lib/sendmail -ti';
     /**
      * If you want the auto load functionality
      * to find other image/file types, add the
      * extension and content type here.
      */
     $this->image_types = array('gif' => 'image/gif', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpe' => 'image/jpeg', 'bmp' => 'image/bmp', 'png' => 'image/png', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'swf' => 'application/x-shockwave-flash');
     /**
      * Set these up
      */
     $this->build_params['html_encoding'] = new QPrintEncoding();
     $this->build_params['text_encoding'] = new SevenBitEncoding();
     $this->build_params['calendar_encoding'] = new SevenBitEncoding();
     $this->build_params['html_charset'] = 'ISO-8859-1';
     $this->build_params['calendar_charset'] = 'ISO-8859-1';
     $this->build_params['text_charset'] = 'ISO-8859-1';
     $this->build_params['head_charset'] = 'ISO-8859-1';
     $this->build_params['text_wrap'] = 998;
     /**
      * Defaults for smtp sending
      */
     if (!empty($_SERVER['HTTP_HOST'])) {
         $helo = $_SERVER['HTTP_HOST'];
     } elseif (!empty($_SERVER['SERVER_NAME'])) {
         $helo = $_SERVER['SERVER_NAME'];
     } else {
         $helo = 'localhost';
     }
     $this->smtp_params['host'] = 'localhost';
     $this->smtp_params['port'] = 25;
     $this->smtp_params['helo'] = $helo;
     $this->smtp_params['auth'] = false;
     $this->smtp_params['user'] = '';
     $this->smtp_params['pass'] = '';
     /**
      * Make sure the MIME version header is first.
      */
     $this->headers['MIME-Version'] = '1.0';
     $this->headers['X-Mailer'] = 'htmlMimeMail5 <http://www.phpguru.org/>';
     try {
         $MailServerSet = false;
         $MailServer = LoginData::get("MailServerUserPass");
         if ($MailServer != null and $MailServer->A("server") != "") {
             $this->default_method = "smtp";
             $MailServerSet = true;
             $this->smtp_params['host'] = $MailServer->A("server");
             $this->smtp_params['port'] = 25;
             #if(isset($xml->Mail->options->helo)) $this->smtp_params['helo'] = $xml->Mail->options->helo["value"]."";
             $this->smtp_params['helo'] = "localhost";
             $this->smtp_params['auth'] = $MailServer->A("benutzername") != "";
             $this->smtp_params['user'] = $MailServer->A("benutzername");
             $this->smtp_params['pass'] = $MailServer->A("passwort");
         }
         $MailServer = null;
         for ($i = 2; $i <= 5; $i++) {
             if ($MailServer == null and $i > 2) {
                 break;
             }
             $MailServer = LoginData::get("MailServer{$i}UserPass");
             if ($MailServer == null or $MailServer->A("server") == "" or $MailServer->A("optionen") == "" or strtolower($MailServer->A("optionen")) != strtolower($senderDomain)) {
                 continue;
             }
             $MailServerSet = true;
             $this->smtp_params['host'] = $MailServer->A("server");
             $this->smtp_params['auth'] = $MailServer->A("benutzername") != "";
             $this->smtp_params['user'] = $MailServer->A("benutzername");
             $this->smtp_params['pass'] = $MailServer->A("passwort");
         }
     } catch (Exception $e) {
         $MailServer = null;
     }
     $CH = Util::getCloudHost();
     if (!$MailServerSet and $CH != null and isset($CH->forceOwnSMTPServer) and $CH->forceOwnSMTPServer === true and !$skipOwnServer) {
         throw new Exception("Bitte tragen Sie einen eigenen Mailserver ein, um den zuverlässigen Mailversand in Ihrem Namen zu gewährleisten. Melden Sie sich dazu als Admin-Benutzer am System an und tragen Sie den Mailserver im Cloud-Reiter ein.");
     }
     /*
     		  $optionsFile = (dirname(__FILE__)."/../../specifics"."/phynxOptions.xml");
     
     		  if(file_exists($optionsFile)){
     		  $optionsFileContent = file_get_contents($optionsFile);
     		  $xml = new SimpleXMLElement($optionsFileContent);
     
     		  if(isset($xml->Mail)){
     		  switch($xml->Mail->method["value"]){
     		  case "smtp":
     		  $this->default_method = $xml->Mail->method["value"];
     
     		  if(isset($xml->Mail->options->host)) $this->smtp_params['host'] = $xml->Mail->options->host["value"]."";
     		  if(isset($xml->Mail->options->port)) $this->smtp_params['port'] = $xml->Mail->options->port["value"] * 1;
     		  if(isset($xml->Mail->options->helo)) $this->smtp_params['helo'] = $xml->Mail->options->helo["value"]."";
     		  if(isset($xml->Mail->options->auth)) $this->smtp_params['auth'] = $xml->Mail->options->auth["value"]."" == "true";
     		  if(isset($xml->Mail->options->user)) $this->smtp_params['user'] = $xml->Mail->options->user["value"]."";
     		  if(isset($xml->Mail->options->pass)) $this->smtp_params['pass'] = $xml->Mail->options->pass["value"]."";
     		  break;
     		  }
     
     		  if(isset($xml->Mail->BCC) AND $xml->Mail->BCC["value"]."" != "") $this->setBcc($xml->Mail->BCC["value"]."");
     
     		  if(isset($xml->Mail->XMailer)) $this->headers['X-Mailer'] = $xml->Mail->XMailer["value"]."";
     		  }
     		  } */
 }
Ejemplo n.º 8
0
 /**
  * Constructor
  * @param boolean $exceptions Should we throw external exceptions?
  */
 public function __construct($exceptions = false, $senderDomain = "", $skipOwnServer = false)
 {
     $this->exceptions = $exceptions == true;
     $this->PluginDir = dirname(__FILE__) . "/";
     try {
         $MailServerSet = false;
         $MailServer = LoginData::get("MailServerUserPass");
         if ($MailServer != null and $MailServer->A("server") != "") {
             $this->IsSMTP();
             $MailServerSet = true;
             $this->Host = $MailServer->A("server");
             $this->SMTPAuth = $MailServer->A("benutzername") != "";
             $this->Username = $MailServer->A("benutzername");
             $this->Password = $MailServer->A("passwort");
         }
         $MailServer = null;
         for ($i = 2; $i <= 5; $i++) {
             if ($MailServer == null and $i > 2) {
                 break;
             }
             $MailServer = LoginData::get("MailServer{$i}UserPass");
             if ($MailServer == null or $MailServer->A("server") == "" or $MailServer->A("optionen") == "" or strtolower($MailServer->A("optionen")) != strtolower($senderDomain)) {
                 continue;
             }
             $this->IsSMTP();
             $MailServerSet = true;
             $this->Host = $MailServer->A("server");
             $this->SMTPAuth = $MailServer->A("benutzername") != "";
             $this->Username = $MailServer->A("benutzername");
             $this->Password = $MailServer->A("passwort");
         }
     } catch (Exception $e) {
         $MailServer = null;
     }
     $CH = Util::getCloudHost();
     if (!$MailServerSet and $CH != null and isset($CH->forceOwnSMTPServer) and $CH->forceOwnSMTPServer === true and !$skipOwnServer) {
         throw new Exception("Bitte tragen Sie einen eigenen Mailserver ein, um den zuverlässigen Mailversand in Ihrem Namen zu gewährleisten. Melden Sie sich dazu als Admin-Benutzer am System an und tragen Sie den Mailserver im Cloud-Reiter ein.");
     }
 }
Ejemplo n.º 9
0
 public static function getUser($username, $password)
 {
     try {
         $ldap = self::getADConnection($username, $password);
         if ($ldap == null) {
             return null;
         }
         $LD = LoginData::get("ADServerUserPass");
         $result = ldap_search($ldap, $LD->A("optionen"), "(&(objectCategory=person)(samaccountname={$username}))");
         #ldap_sort($ldap, $result, "sn");
         $info = ldap_get_entries($ldap, $result);
         foreach ($info as $user) {
             if (!isset($user["samaccountname"])) {
                 continue;
             }
             $R = self::getADEntry($user);
             $U = new User($R->UserID);
             $U->setA($R);
             return $U;
         }
     } catch (Exception $e) {
     }
     return null;
 }
Ejemplo n.º 10
0
 /**
  * Get login data for current user
  * 
  * @param string $name
  * @return LoginData
  */
 public static function getU($name, $userID = null)
 {
     if ($userID == null) {
         $userID = Session::currentUser()->getID();
     }
     $UD = new mUserdata();
     $UD->addAssocV3("UserID", "=", $userID);
     $UD->addAssocV3("name", "=", $name);
     $e = $UD->getNextEntry();
     if ($e == null) {
         return null;
     }
     $LD = new LoginData($e->getID());
     $LD->loadMe();
     return $LD;
 }
Ejemplo n.º 11
0
 function authenticationPopup()
 {
     $allowedUsers = Environment::getS("allowedUsers", null);
     if ($allowedUsers !== null) {
         return;
     }
     $F = new HTMLForm("appserver", array("appServer"), "Application Server");
     $F->useRecentlyChanged();
     $F->setLabel("appServer", "App-Server");
     if (function_exists("ldap_connect")) {
         $F->getTable()->setTableStyle("margin-bottom:30px;");
     }
     $F->getTable()->setColWidth(1, 120);
     $F->setValue("appServer", mUserdata::getGlobalSettingValue("AppServer", ""));
     $F->setDescriptionField("appServer", "Wenn Sie einen Application Server betreiben, tragen Sie hier bitte die URL ein, um die Benutzer mit diesem Server zu authentifizieren.");
     $F->setSaveRMEPCR("Speichern", "", "Users", "", "saveAppServer", OnEvent::closePopup("Users"));
     echo $F;
     if (!function_exists("ldap_connect")) {
         return;
     }
     echo "<span></span><div class=\"backgroundColor1 Tab\"><p>Active Directory</p></div>";
     $LD = LoginData::get("ADServerUserPass");
     BPS::setProperty("LoginDataGUI", "preset", "adServer");
     $gui = new LoginDataGUI($LD == null ? -1 : $LD->getID());
     $gui->loadMeOrEmpty();
     if ($LD != null) {
         $gui->setA($LD->getA());
     }
     $gui->getPopup();
 }
Ejemplo n.º 12
0
 /**
  * Constructor function.
  */
 public function __construct()
 {
     /**
      * Initialise some variables.
      */
     $this->attachments = array();
     $this->html_images = array();
     $this->headers = array();
     $this->is_built = false;
     $this->text = '';
     $this->sendmail_path = '/usr/lib/sendmail -ti';
     /**
      * If you want the auto load functionality
      * to find other image/file types, add the
      * extension and content type here.
      */
     $this->image_types = array('gif' => 'image/gif', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpe' => 'image/jpeg', 'bmp' => 'image/bmp', 'png' => 'image/png', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'swf' => 'application/x-shockwave-flash');
     /**
      * Set these up
      */
     $this->build_params['html_encoding'] = new QPrintEncoding();
     $this->build_params['text_encoding'] = new SevenBitEncoding();
     $this->build_params['html_charset'] = 'ISO-8859-1';
     $this->build_params['text_charset'] = 'ISO-8859-1';
     $this->build_params['head_charset'] = 'ISO-8859-1';
     $this->build_params['text_wrap'] = 998;
     /**
      * Defaults for smtp sending
      */
     if (!empty($_SERVER['HTTP_HOST'])) {
         $helo = $_SERVER['HTTP_HOST'];
     } elseif (!empty($_SERVER['SERVER_NAME'])) {
         $helo = $_SERVER['SERVER_NAME'];
     } else {
         $helo = 'localhost';
     }
     $this->smtp_params['host'] = 'localhost';
     $this->smtp_params['port'] = 25;
     $this->smtp_params['helo'] = $helo;
     $this->smtp_params['auth'] = false;
     $this->smtp_params['user'] = '';
     $this->smtp_params['pass'] = '';
     /**
      * Make sure the MIME version header is first.
      */
     $this->headers['MIME-Version'] = '1.0';
     $this->headers['X-Mailer'] = 'htmlMimeMail5 <http://www.phpguru.org/>';
     try {
         $MailServer = LoginData::get("MailServerUserPass");
         if ($MailServer != null and $MailServer->A("server") != "") {
             $this->default_method = "smtp";
             $this->smtp_params['host'] = $MailServer->A("server");
             $this->smtp_params['port'] = 25;
             #if(isset($xml->Mail->options->helo)) $this->smtp_params['helo'] = $xml->Mail->options->helo["value"]."";
             $this->smtp_params['helo'] = "localhost";
             $this->smtp_params['auth'] = $MailServer->A("benutzername") != "";
             $this->smtp_params['user'] = $MailServer->A("benutzername");
             $this->smtp_params['pass'] = $MailServer->A("passwort");
         }
     } catch (Exception $e) {
     }
     /*
     		$optionsFile = (dirname(__FILE__)."/../../specifics"."/phynxOptions.xml");
     
     		if(file_exists($optionsFile)){
     			$optionsFileContent = file_get_contents($optionsFile);
     			$xml = new SimpleXMLElement($optionsFileContent);
     			
     			if(isset($xml->Mail)){
     				switch($xml->Mail->method["value"]){
     					case "smtp":
     						$this->default_method = $xml->Mail->method["value"];
     
     						if(isset($xml->Mail->options->host)) $this->smtp_params['host'] = $xml->Mail->options->host["value"]."";
     						if(isset($xml->Mail->options->port)) $this->smtp_params['port'] = $xml->Mail->options->port["value"] * 1;
     						if(isset($xml->Mail->options->helo)) $this->smtp_params['helo'] = $xml->Mail->options->helo["value"]."";
     						if(isset($xml->Mail->options->auth)) $this->smtp_params['auth'] = $xml->Mail->options->auth["value"]."" == "true";
     						if(isset($xml->Mail->options->user)) $this->smtp_params['user'] = $xml->Mail->options->user["value"]."";
     						if(isset($xml->Mail->options->pass)) $this->smtp_params['pass'] = $xml->Mail->options->pass["value"]."";
     					break;
     				}
     
     				if(isset($xml->Mail->BCC) AND $xml->Mail->BCC["value"]."" != "") $this->setBcc($xml->Mail->BCC["value"]."");
     
     				if(isset($xml->Mail->XMailer)) $this->headers['X-Mailer'] = $xml->Mail->XMailer["value"]."";
     			}
     		}*/
 }
 function getHTML($id)
 {
     $showHelp = true;
     if ($this->collector == null) {
         $this->lCV3($id);
     }
     $singularLanguageClass = $this->loadLanguageClass("Installation");
     $text = $singularLanguageClass != null ? $singularLanguageClass->getText() : "";
     $t = new HTMLTable(1);
     $g = "";
     $DBFilePath = Util::getRootPath() . "system/DBData/Installation.pfdb.php";
     $writable = new HTMLTable(1);
     $File = new File($DBFilePath);
     $File->loadMe();
     if (!$File->getA()->FileIsWritable) {
         $writable->addRow("<img src=\"./images/navi/restrictions.png\" style=\"float:left;margin-right:10px;\"/>Die Datei " . $DBFilePath . " ist nicht beschreibbar, Änderungen können nicht gespeichert werden.<br /><br />Machen Sie die Datei mit einem FTP-Programm beschreibbar. Klicken Sie dazu mit der rechten Maustaste auf die Datei auf dem Server, wählen Sie \"Eigenschaften\", und geben Sie den Modus 666 an, damit sie durch den Besitzer, die Gruppe und alle Anderen les- und schreibbar ist.");
         $g .= $writable->getHTML();
     }
     $gui = new HTMLGUI();
     $gui->setName("Datenbank-Zugangsdaten");
     if ($this->collector != null) {
         $gui->setAttributes($this->collector);
     }
     $gui->setCollectionOf($this->collectionOf, "Datenbank-Zugangsdaten");
     $gui->hideAttribute("password");
     $gui->hideAttribute("httpHost");
     $gui->hideAttribute("InstallationID");
     if (strstr($_SERVER["SCRIPT_FILENAME"], "demo")) {
         $UA = $_SESSION["S"]->getCurrentUser()->getA();
         if ($UA->name != "Installations-Benutzer") {
             $g = "In der Demo können keine Datenbank-Zugangsdaten geändert werden!";
             $gui->setIsDisplayMode(true);
         }
     }
     if (!Session::isPluginLoaded("multiInstall")) {
         $gui->setIsDisplayMode(true);
         $gui->setEditInDisplayMode(true, "contentLeft");
     }
     #try {
     $g .= $gui->getBrowserHTML($id);
     #} catch (Exception $e){
     #	$t->addRow(array("Etwas stimmt nicht, eine ".get_class($e)." wurde abgefangen!"));
     #	$t->addRow(array("<span style=\"font-size:8px;\">".nl2br(str_replace("#","\n#", $e->getTraceAsString()))."</span>"));
     #}
     $help = "\n\t<script type=\"text/javascript\">\n\t\tcontentManager.rmePCR('mInstallation','','getHelp','true','if(checkResponse(transport)) { Popup.create(\\'123\\', \\'Installation\\', \\'Hilfe\\'); Popup.update(transport, \\'123\\', \\'Installation\\'); }');\n\t</script>";
     try {
         $user = new User(1);
         $user->loadMe();
     } catch (DatabaseNotSelectedException $e) {
         $t->addRow(isset($text["noDatabase"]) ? $text["noDatabase"] : "Es wurde kein korrekter Datenbankname angegeben.<br /><br />Bitte geben Sie eine existierende Datenbank an, sie wird nicht automatisch erzeugt.");
         return $g . $t->getHTML() . $help;
     } catch (NoDBUserDataException $e) {
         $t->addRow(isset($text["wrongData"]) ? $text["wrongData"] : "Mit den angegebenen Datenbank-Zugangsdaten kann keine Verbindung aufgebaut werden.<br /><br />Wenn sie korrekt sind, wird hier eine Liste der Plugins angezeigt.");
         if (PHYNX_MAIN_STORAGE == "MySQL") {
             try {
                 $DB1 = new DBStorageU();
                 $B = new Button("Hinweis", "notice", "icon");
                 $B->style("float:left;margin-right:10px;");
                 $File = new File(Util::getRootPath() . "system/connect.php");
                 $BR = new Button("DB-Verbindung\numstellen", "lieferschein");
                 $BR->style("float:right;margin-left:10px;");
                 $BR->rmePCR("mInstallation", "-1", "switchDBToMySQLo", "", "Installation.reloadApp();");
                 $BR = "Verwenden Sie den nebenstehenden Knopf, um die Verbindungsart auf die ältere Version umzustellen.<br />{$BR} Sie müssen sich anschließend erneut anmelden.";
                 $BReload = new Button("Ansicht\naktualisieren", "refresh");
                 $BReload->onclick("contentManager.emptyFrame('contentLeft'); contentManager.loadFrame('contentRight', 'mInstallation', -1, 0, 'mInstallationGUI;-');Popup.closeNonPersistent();");
                 $BReload->style("float:right;margin:10px;");
                 if (!$File->A("FileIsWritable")) {
                     $BR = "Bitte machen Sie die Datei /system/connect.php für den Webserver beschreibbar, damit phynx auf die ältere Verbindungsart umstellen kann.<br /><br />Verwenden Sie dazu Ihr FTP-Programm. Klicken Sie mit der rechten Maustaste auf die Datei auf dem Server, wählen Sie \"Eigenschaften\", und geben Sie den Modus 666 an, damit sie durch den Besitzer, die Gruppe und alle Anderen les- und schreibbar ist.{$BReload}";
                 }
                 $t->addRow(array("{$B} <b>Möglicherweise ist die MySQLi-Erweiterung auf Ihrem Server nicht korrekt konfiguriert.</b><br /><br />{$BR}"));
                 $t->addRowClass("backgroundColor0");
             } catch (Exception $e) {
                 #echo "MySQL geht auch nicht!";
             }
         }
         return $g . $t->getHTML() . $help;
     } catch (DatabaseNotFoundException $e) {
         $t->addRow(isset($text["noDatabase"]) ? $text["noDatabase"] : "Es wurde kein korrekter Datenbankname angegeben.<br /><br />Bitte geben Sie eine existierende Datenbank an, sie wird nicht automatisch erzeugt.");
         return $g . $t->getHTML() . $help;
     } catch (TableDoesNotExistException $e) {
     } catch (StorageException $e) {
     }
     $help = "\n\t<script type=\"text/javascript\">\n\t\trme('mInstallation','','getHelp','false','if(checkResponse(transport)) { Popup.create(\\'123\\', \\'Installation\\', \\'Hilfe\\'); Popup.update(transport, \\'123\\', \\'Installation\\'); }');\n\t</script>";
     if ($id == -1) {
         $BackupTab = new HTMLTable(1);
         $BackupButton = new Button("Backup-\nManager", "disk");
         $BackupButton->style("float:right;");
         $BackupButton->onclick("contentManager.loadFrame('contentLeft','BackupManager');");
         $BackupTab->addRow($BackupButton);
         $BUT = new Button(isset($text["alle Tabellen aktualisieren"]) ? $text["alle Tabellen aktualisieren"] : "alle Tabellen\naktualisieren", "update");
         $BUT->rmePCR("mInstallation", "", "updateAllTables", "", "\$('contentLeft').update(transport.responseText);");
         $g .= "\n\t<div style=\"height:30px;\"></div>\n\t{$BackupTab}\n\t<div class=\"Tab backgroundColor1\"><p>Plugins</p></div>\n\t<table>\n\t\t<colgroup>\n\t\t\t<col style=\"width:100px;\" class=\"backgroundColor2\" />\n\t\t\t<col class=\"backgroundColor3\" />\n\t\t</colgroup>\n\t\t<tr>\n\t\t\t<td colspan=\"3\">\n\t\t\t\t<span style=\"float:right;\">" . Installation::getReloadButton() . "</span>\n\t\t\t\t{$BUT}\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td style=\"background-color:white;\"></td>\n\t\t</tr>";
         $p = array_flip($_SESSION["CurrentAppPlugins"]->getAllPlugins());
         foreach ($p as $key => $value) {
             try {
                 if (method_exists($_SESSION["CurrentAppPlugins"], "isPluginGeneric") and $_SESSION["CurrentAppPlugins"]->isPluginGeneric($key)) {
                     $c = new mGenericGUI('', $key);
                 } else {
                     $c = new $key();
                 }
             } catch (ClassNotFoundException $e) {
                 $key2 = $key . "GUI";
                 try {
                     $c = new $key2();
                 } catch (ClassNotFoundException $e2) {
                     continue;
                 }
             }
             if ($key == "CIs") {
                 continue;
             }
             /*$e = explode(", ",$_SESSION["CurrentAppPlugins"]->getDepsOfPlugin($key));
             		for($i=0;$i<count($e);$i++) 
             			if($e[$i] != "none") 
             				$e[$i] = (($p[$e[$i]] != -1) ? $p[$e[$i]] : $e[$i]);*/
             if ($c->checkIfMyTableExists() and $c->checkIfMyDBFileExists()) {
                 $showHelp = false;
             }
             if (!$c->checkIfMyDBFileExists()) {
                 continue;
             }
             $g .= "\n\t\t<tr>\n\t\t\t<td style=\"font-weight:bold;text-align:right;\">" . ($value != -1 ? $value : $key) . "</td>\n\t\t\t<td>" . (!$c->checkIfMyTableExists() ? $c->checkIfMyDBFileExists() ? "<input type=\"button\" value=\"" . (isset($text["Tabelle anlegen"]) ? $text["Tabelle anlegen"] : "Tabelle anlegen") . "\" onclick=\"installTable('{$key}');\" />" : "keine DB-Info-Datei" : ($c->checkIfMyDBFileExists() ? "<input type=\"button\" onclick=\"checkFields('{$key}');\" value=\"Tabellenupdate\" style=\"float:right;width:140px;\" />" . (isset($text["Tabelle existiert"]) ? $text["Tabelle existiert"] : "Tabelle existiert") : (isset($text["keine DB-Info-Datei"]) ? $text["keine DB-Info-Datei"] : "keine DB-Info-Datei")) . "") . "</td>\n\t\t</tr>";
         }
         $g .= "\n\t</table>";
     }
     $showHelp = false;
     if (!$showHelp) {
         $help = "";
     }
     $ST = new HTMLSideTable("left");
     try {
         $BTestMail = $ST->addButton("Mailversand\ntesten", "mail");
         $BTestMail->popup("mailTest", "Mailversand testen", "mInstallation", "-1", "testMailGUI");
         $MailServer = LoginData::get("MailServerUserPass");
         $MailServerID = $MailServer == null ? -1 : $MailServer->getID();
         $BMail = $ST->addButton("Mail-Server\neintragen", "./plugins/Installation/serverMail.png");
         $BMail->popup("edit", "Mail-Server", "LoginData", $MailServerID, "getPopup", "", "LoginDataGUI;preset:mailServer");
     } catch (Exception $e) {
     }
     return (!$showHelp ? $ST : "") . $g . $help;
 }
 public function FTPUpload($filename)
 {
     $FTPServer = LoginData::get("BackupFTPServerUserPass");
     if ($FTPServer == null or $FTPServer->A("server") == "") {
         return null;
     }
     $ftp_server = $FTPServer->A("server");
     $benutzername = $FTPServer->A("benutzername");
     $passwort = $FTPServer->A("passwort");
     $connection_id = ftp_connect($ftp_server);
     $login_result = ftp_login($connection_id, $benutzername, $passwort);
     if (!$connection_id || !$login_result) {
         throw new Exception("Verbindung mit FTP-Server {$ftp_server} als Benutzer {$benutzername} nicht möglich!");
     }
     $subDir = $FTPServer->A("optionen");
     if ($subDir != "" and $subDir[strlen($subDir) - 1] != "/") {
         $subDir .= "/";
     }
     $zieldatei = $subDir . basename($filename);
     $lokale_datei = $filename;
     $upload = ftp_put($connection_id, $zieldatei, $lokale_datei, FTP_ASCII);
     if (!$upload) {
         throw new Exception("Beim FTP-Upload ist ein Fehler aufgetreten");
     }
     ftp_quit($connection_id);
     return true;
 }
Ejemplo n.º 15
0
 public function manageMailservers()
 {
     $MailServer = LoginData::get("MailServerUserPass");
     $MailServerID = $MailServer == null ? -1 : $MailServer->getID();
     $BMail = new Button("Standard", "./plugins/Installation/serverMail.png");
     $BMail->popup("edit", "Mail-Server", "LoginData", $MailServerID, "getPopup", "", "LoginDataGUI;preset:mailServer");
     $BMail->style("margin:10px;float:left;");
     echo $BMail . "<p><small style=\"color:grey;\">Über diesen Server werden alle Mails verschickt, wenn weiter unten kein eigener Server für eine Absender-Domain eingetragen wird.</small></p>";
     echo "<div style=\"clear:both;height:30px;\"></div><div class=\"Tab backgroundColor1\"><p>Weitere Mailserver</p></div>";
     echo "<p><small style=\"color:grey;\">Erfassen Sie einen zusätzlichen Server für eine bestimmte Absender-Domain, wenn der Standard-Server diese nicht verschicken kann.</small></p>";
     echo "<p><small style=\"color:grey;\">Ein Beispiel: Sie möchten E-Mails verschicken von den Adressen max.mustermann@<strong>gmx.de</strong> und erika.hatnachname@<strong>web.de</strong>. Über GMX können Sie die web.de-Mails nicht verschicken und web.de verschickt die GMX-E-Mails ebenfalls nicht. Sie müssen daher für jeden Anbieter seinen eigenen Server eintragen.</small></p>";
     $MailServer = 1;
     for ($i = 2; $i <= 5; $i++) {
         if ($MailServer == null) {
             break;
         }
         $MailServer = LoginData::get("MailServer{$i}UserPass");
         $MailServerID = $MailServer == null ? -1 : $MailServer->getID();
         $BMail = new Button("Server {$i}", "./plugins/Installation/serverMail.png");
         $BMail->popup("edit", "Mail-Server", "LoginData", $MailServerID, "getPopup", "", "LoginDataGUI;preset:mailServerAdditional{$i}");
         $BMail->style("margin:10px;display:inline-block;");
         echo $BMail;
         if ($MailServer != null) {
             echo $MailServer->A("optionen");
         }
         echo "<br />";
     }
     echo "<div style=\"clear:both;\"></div>";
 }
Ejemplo n.º 16
0
 public function getHTML($id)
 {
     #$_SESSION["BPS"]->unregisterClass(get_class($this));
     $defaultAnsicht = "monat";
     if (Applications::activeApplication() == "personalKartei") {
         $defaultAnsicht = "jahr";
     }
     $ansicht = mUserdata::getUDValueS("KalenderAnsicht", $defaultAnsicht);
     #$ansicht = $ansicht->getUDValue("KalenderAnsicht");
     #if($ansicht == null) $ansicht = "monat";
     $display = mUserdata::getUDValueS("KalenderDisplay" . ucfirst($ansicht), "0");
     $BThis = new Button("", "arrow_down", "iconicG");
     $BThis->style("float:left;margin-top:-6px;margin-right:5px;");
     $Calendars = "";
     Registry::reset("Kalender");
     while ($C = Registry::callNext("Kalender", "categories")) {
         if (!$C) {
             continue;
         }
         foreach ($C as $tab) {
             $Calendars .= "<div onclick=\"{$tab->onclick}\">" . ($tab->isCurrent ? $BThis : "") . " {$tab->label}</div>";
         }
     }
     // <editor-fold defaultstate="collapsed" desc="styles">
     $html = "\n\t\t\n\t\t<style type=\"text/css\">\n\t\t.Day {\n\t\t\t-moz-user-select:none;\n\t\t\tborder-left:1px solid #EEE;\n\t\t\tborder-bottom:1px solid #EEE;\n\t\t}\n\t\t\n\t\t/*.Day:hover {\n\t\t\tborder-style:solid;\n\t\t\tborder-width:1px;\n\t\t\tpadding:2px;\n\t\t}*/\n\n\t\t.dayOptions {\n\t\t\tdisplay:none;\n\t\t}\n\n\t\t.Day:hover .dayOptions {\n\t\t\tdisplay:inline;\n\t\t}\n\n\t\t.Termin {\n\t\t\tposition:relative;\n\t\t\tleft:44px;\n\t\t\tcursor:pointer;\n\t\t\twidth:150px;\n\t\t\tfloat:left;\n\t\t\tborder-style:solid;\n\t\t\tborder-width:1px;\n\t\t\tmargin-right:3px;\n\t\t}\n\t\t\n\t\t.KalenderButton {\n\t\t\topacity:0.5;\n\t\t}\n\t\t\n\t\t.KalenderButton:hover {\n\t\t\topacity:1;\n\t\t}\n\t\t\n\t\t.KalenderUser {\n\t\t\tmargin-left:10px;\n\t\t}\n\t\t\n\t\t.KalenderUser div {\n\t\t\tpadding:10px;\n\t\t\tpadding-top:10px;\n\t\t\tpadding-bottom:5px;\n\t\t\tdisplay:inline-block;\n\t\t\tmargin-right:20px;\n\t\t\tcursor:pointer;\n\t\t\tmin-width:150px;\n\t\t}\n\t\t\n\t\t.cellHeight {\n\t\t}\n\t\t\n\t\t.ui-datepicker {\n\t\t\twidth: auto;\n\t\t}\n\n\t\t#contentScreen tr:hover {\n\t\t\tbackground-color:inherit;\n\t\t}\n\n\t\t#calendar1stMonth .ui-datepicker-prev, #calendar1stMonth .ui-datepicker-next/*,\n\t\t#calendar2ndMonth .ui-datepicker-prev, #calendar2ndMonth .ui-datepicker-next */{\n\t\t\tdisplay:none;\n\t\t}\n\t\t\n\t\t#calendar1stMonth .ui-widget-content,\n\t\t#calendar2ndMonth .ui-widget-content, \n\t\t#calendar2ndMonth .ui-widget-content .ui-state-default,\n\t\t#calendar1stMonth .ui-widget-content .ui-state-default {\n\t\t\tborder:0px;\n\t\t}\n\t\t\n\t\t#calendar1stMonth .ui-datepicker-header,\n\t\t#calendar2ndMonth .ui-datepicker-header {\n\t\t\tborder:0px;\n\t\t}\n\t\t\n\t\t/*@media only screen and (max-height: 820px) {\n\t\t\t.cellHeight {\n\t\t\t\theight:55px;\n\t\t\t}\n\t\t}*/\n\t\t</style>";
     // </editor-fold>
     $BLeft = new Button("Zurück", "back", "icon");
     $BLeft->rmePCR("mKalender", "", "setDisplay", $display - 1, "contentManager.loadFrame('contentScreen','mKalender');");
     $BLeft->style("margin-right:10px;");
     $BRight = new Button("Weiter", "navigation", "icon");
     $BRight->rmePCR("mKalender", "", "setDisplay", $display + 1, "contentManager.loadFrame('contentScreen','mKalender');");
     $BRight->style("margin-right:10px;");
     $BToday = new Button("Aktuelles Datum", "down", "icon");
     $BToday->rmePCR("mKalender", "", "setToday", '', "contentManager.loadFrame('contentScreen','mKalender');");
     $BToday->style("margin-right:10px;");
     $BJahr = new Button("Jahr", "./ubiquitous/Kalender/month.png", "icon");
     $BJahr->rmePCR("mKalender", "", "setView", "jahr", "contentManager.loadFrame('contentScreen','mKalender');");
     $BJahr->style("margin-right:10px;" . ($ansicht != "jahr" ? "opacity:0.5;" : ""));
     $BJahr->id("jahrButton");
     $BMonat = new Button("Monat", "./ubiquitous/Kalender/month.png", "icon");
     $BMonat->rmePCR("mKalender", "", "setView", "monat", "contentManager.loadFrame('contentScreen','mKalender');");
     $BMonat->style("margin-right:10px;" . ($ansicht != "monat" ? "opacity:0.5;" : ""));
     $BMonat->id("monatButton");
     $BWoche = new Button("Woche", "./ubiquitous/Kalender/workweek.png", "icon");
     $BWoche->rmePCR("mKalender", "", "setView", "woche", "contentManager.loadFrame('contentScreen','mKalender');");
     $BWoche->style("margin-right:10px;" . ($ansicht != "woche" ? "opacity:0.5;" : ""));
     $BWoche->id("wocheButton");
     $BTag = new Button("Tag", "./ubiquitous/Kalender/day.png", "icon");
     $BTag->rmePCR("mKalender", "", "setView", "tag", "contentManager.loadFrame('contentScreen','mKalender');");
     $BTag->style("margin-right:10px;" . ($ansicht != "tag" ? "opacity:0.5;" : ""));
     $BTag->id("tagButton");
     if (Applications::activeApplication() == "personalKartei") {
         $BTag = "";
         $BWoche = "";
         $BMonat = "";
     }
     if (Applications::activeApplication() != "personalKartei") {
         $BJahr = "";
     }
     $ST = new HTMLTable(1);
     $ST->setColClass(1, "");
     #$ST->setTableStyle("width:40px;margin:0px;margin-right:-215px;float:right;/*margin-right:-50px;margin-top:95px;*/");
     $newWindow = new Button("Kalender in neuem Fenster öffnen", "new_window", "iconicL");
     $newWindow->style("margin-right:10px;");
     $newWindow->newSession("Mail", Applications::activeApplication(), "mKalender", "Kalender");
     if (Session::physion()) {
         $newWindow = "";
     }
     $reminder = "";
     if (Session::isPluginLoaded("mReminder")) {
         $reminder = Reminder::getButton();
         $reminder->style("margin-right:10px;");
     }
     $ST->addRow("<div id=\"calendar1stMonth\"></div>");
     $ST->addRow("<div id=\"calendar2ndMonth\"></div>");
     $TC = "KalenderView" . ucfirst($ansicht);
     $TC = new $TC();
     $TCalendars = "<div>";
     if (trim($Calendars) != "") {
         $TCalendars .= "<div class=\"KalenderUser\">" . $Calendars . "</div>";
     }
     $TCalendars .= "</div>";
     $pCalButton = "";
     if (Session::isPluginLoaded("mpCal")) {
         $pCalButton = pCal::getTBButton();
         $pCalButton->type("icon");
         $pCalButton->style("margin-right:10px;");
     }
     $GoogleButton = "";
     $GoogleDLButton = "";
     if (Session::isPluginLoaded("mGoogle")) {
         $GoogleButton = LoginData::getButtonU("GoogleAccountUserPass", "Google-Daten bearbeiten", "./ubiquitous/Google/google.png");
         $GoogleButton->type("icon");
         $GoogleButton->style("margin-right:10px;");
         $GoogleDLButton = new Button("Daten herunterladen", "./ubiquitous/Google/googleDL.png", "icon");
         $GoogleDLButton->popup("", "Daten herunterladen", "Google", "-1", "syncByDateRange", array("'" . date("Y-m-d", $TC->getFirst()) . "'", "'" . date("Y-m-d", $TC->getLast()) . "'"));
         $GoogleDLButton->style("margin-right:10px;");
     }
     $xCalButton = "";
     if (Session::isPluginLoaded("mxCal")) {
         $xCalButton = xCal::getButton();
         $xCalButton->style("margin-right:10px;");
     }
     $BShare = new Button("Kalender teilen", "fork", "iconicL");
     $BShare->popup("", "Kalender teilen", "mKalender", "-1", "share");
     $BShare->style("margin-right:10px;");
     #$AWVButton = new Button("Müllabfuhr-Daten herunterladen", "trash_stroke", "iconicL");
     #$AWVButton->popup("", "Müllabfuhr-Daten", "mKalender", "-1", "downloadTrashData");
     $AWVButton = "";
     $ST->addRow($pCalButton . $GoogleButton . $GoogleDLButton);
     $html .= "\n\t\t<div style=\"width:205px;float:right;margin-right:40px;\">\n\t\t\t\t<div style=\"padding-top:30px;padding-bottom:15px;padding-left:0px;\">\n\t\t\t\t\t{$newWindow}{$BShare}{$AWVButton}{$xCalButton}{$reminder}\n\t\t\t\t</div>\n\t\t</div>\n\t\t\n\t\t<div style=\"margin-right:270px;\">\n\t\t<div id=\"KalenderTitle\" class=\"prettyTitle\">\n\t\t\t\n\t\t\t<span style=\"float:right;\">\n\t\t\t\t{$BLeft}{$BToday}{$BRight}\n\t\t\t</span>\n\t\t\t<div style=\"float:right;margin-right:100px;\">{$BTag}{$BWoche}{$BMonat}{$BJahr}</div>\n\t\t\t" . $TC->getTitle() . "\n\t\t</div>\n\t\t</div>\n\t\t<div id=\"KalenderAuswahl\">\n\t\t\t{$TCalendars}\n\t\t</div>\n\t\t" . $TC->getHeader() . "\n\t\t<div id=\"KalenderWrapper\" style=\"overflow:auto;\">\n\t\t\t" . ($ansicht != "jahr" ? "\n\t\t\t<div style=\"width:205px;float:right;margin-right:40px;\">\n\t\t\t\t<div style=\"height:23px;\"></div>{$ST}\n\t\t\t</div>" : "") . "\n\t\t\t<div style=\"" . ($ansicht != "jahr" ? "margin-right:270px;" : "") . "\">\n\n\t\t\t" . $TC->getTable($this) . "\n\t\t\t</div>\n\t\t</div>";
     $nextMonths = new Datum();
     $nextMonths->setToMonth1st();
     $thisMonth = $nextMonths->time();
     $nextMonths->addMonth();
     $nextMonth = $nextMonths->time();
     $html .= OnEvent::script("\$j(function() {\n\t\t\$j('#calendar1stMonth').datepicker({ minDate: '" . date("d.m.Y", $thisMonth) . "'" . ($TC->getCurrent()->time() < $nextMonth ? ",defaultDate: '" . date("d.m.Y", $TC->getCurrent()->time()) . "'" : "") . ", showWeek: true,  showOtherMonths: true, onSelect: function(dateText, inst) { var day = Math.round(+new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay, 0, 1, 0)/1000); " . OnEvent::rme($this, "setView", array("'tag'", "day"), "function(){ " . OnEvent::reload("Screen") . " }") . " } });\n\t\t\t\n\t\t\$j('.KalenderUser div[class!=backgroundColor1]').hover(function(){ \$j(this).addClass('backgroundColor2'); }, function(){ \$j(this).removeClass('backgroundColor2'); });\n\t\tfitKalender();\n\t\t\t\n\t\t\$j(window).resize(function() {\n\t\t\tfitKalender();\n\t\t});\n\t\t\n\t\t});\n\t\t\n\t\tfunction fitKalender(){\n\t\t\tif(!\$j('#KalenderTitle').length)\n\t\t\t\treturn;\n\t\t\t\n\t\t\t//console.log(\$j('#KalenderTitle').outerHeight());\n\t\t\t//console.log(\$j('#KalenderAuswahl').outerHeight());\n\t\t\tvar height = (contentManager.maxHeight() - \$j('#KalenderAuswahl').outerHeight() - \$j('#KalenderTitle').outerHeight() - \$j('#KalenderHeader').outerHeight()) + 4;\n\t\t\tvar width = contentManager.maxWidth();\n\t\t\t\n\t\t\t\$j('#KalenderWrapper').css('height', height);\n\t\t\t\$j('#KalenderWrapper').css('width', width);\n\n\t\t\tvar cellHeight = (height - \$j('#KalenderTable tr:first th').parent().outerHeight()) / (\$j('#KalenderTable tr').length - " . (($ansicht == "monat" or $ansicht == "jahr") ? "1" : "0") . ") - 1;\n\t\t\t\$j('.cellHeight').css('height', cellHeight+'px');\n\t\t\t\$j('.innerCellHeight').css('height', (cellHeight - \$j('.innerCellTitle:visible').outerHeight())+'px');\n\t\t\t\n\t\t\tif(\$j('#KalenderHeader').length > 0){\n\t\t\t\t//console.log(\$j('#KalenderHeader tr:first th'));\n\t\t\t\t\$j('#KalenderTable tr:first td').each(function(k, v){\n\t\t\t\t\t\n\t\t\t\t\t\$j(\$j('#KalenderHeader tr:first th')[k]).css('width', \$j(v).width());\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\tif(\$j('#tagDiv').length) {\n\t\t\t\t\$j('#tagDiv').css('width', \$j('#KalenderTable tr').width()+'px');\n\t\t\t\t\$j('#tagDiv').animate({scrollTop: 7*40}, 0);\n\t\t\t\tvar pos = \$j('#tagDiv').offset();\n\t\t\t\tpos.position = 'absolute';\n\n\t\t\t\t\$j('#tagDiv').css(pos)\n\t\t\t}\n\t\t}") . "\n\t\t<style type=\"text/css\">\n\t\t\t" . ($TC->getCurrent()->time() < $thisMonth ? "#calendar1stMonth .ui-state-default { border: 1px solid #D3D3D3; background-color:transparent; }" : "") . "\n\t\t\t" . ($TC->getCurrent()->time() < $nextMonth ? "#calendar2ndMonth .ui-state-default { border: 1px solid #D3D3D3; background-color:transparent; }" : "") . "\n\t\t\t.ui-datepicker-week-col { color:grey; text-align:left; }\n\t\t\ttr td.ui-datepicker-week-col {text-align:left;font-size:10px; }\n\t\t\t/*.ui-datepicker-week-end { background-color:#DDD; }*/\n\t\t</style>";
     $html .= OnEvent::script("\$j(function() {\n\t\t\$j('#calendar2ndMonth').datepicker({ minDate: '" . date("d.m.Y", $nextMonth) . "'" . ($TC->getCurrent()->time() >= $nextMonth ? ", defaultDate: '" . date("d.m.Y", $TC->getCurrent()->time()) . "'" : "") . ", showWeek: true, showOtherMonths: true,  onSelect: function(dateText, inst) { var day = Math.round(+new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay, 0, 1, 0)/1000); " . OnEvent::rme($this, "setView", array("'tag'", "day"), "function(){ " . OnEvent::reload("Screen") . " }") . " } });\n\t});");
     return $html;
 }
Ejemplo n.º 17
0
 public function isCaptchaNeeded($isHaveFailedLogin)
 {
     if ($isHaveFailedLogin) {
         if ($this->userData->getIpCountry() !== $this->loginData->getIpCountry()) {
             $this->logger->logAttempt($this->loginData->getLoginIp(), self::FAILED_IP_LIMIT);
             return true;
         }
         $loggerData = $this->logger->getAttempts();
         $regexp = '/\\.([0-9]{1,3}$)/';
         $ipRange = preg_replace($regexp, 'X', $this->loginData->getLoginIp());
         if (@$loggerData[$this->loginData->getLoginIp()] >= self::FAILED_IP_LIMIT) {
             $this->logger->logAttempt($this->loginData->getLoginIp());
         } else {
             $this->logger->logAttempt($this->loginData->getLoginIp());
             $this->logger->logAttempt($this->loginData->getIpCountry());
             $this->logger->logAttempt($this->loginData->getLoginName());
             $this->logger->logAttempt($ipRange);
         }
         $loggerData = $this->logger->getAttempts();
         $a = @$loggerData[$this->loginData->getLoginIp()] >= self::FAILED_IP_LIMIT || @$loggerData[$this->loginData->getLoginName()] >= self::FAILED_USER_LIMIT || @$loggerData[$this->loginData->getIpCountry()] >= self::FAILED_IP_COUNTRY_LIMIT || @$loggerData[$ipRange] >= self::FAILED_IP_RANGE_LIMIT;
         echo 'ezlett' . json_encode($loggerData);
         return $a;
     }
     return false;
 }