Example #1
0
 function saveMe($checkUserData = true, $output = false)
 {
     $allowedUsers = Environment::getS("allowedUsers", null);
     if ($allowedUsers !== null and $this->A("isAdmin") == "0") {
         $AC = anyC::get("User", "isAdmin", "0");
         $AC->addAssocV3("UserID", "!=", $this->getID());
         $AC->lCV3();
         if ($AC->numLoaded() >= $allowedUsers) {
             Red::errorD("Sie können keine weiteren Benutzer ohne Admin-Rechte anlegen. Bitte wenden Sie sich an den Support.");
         }
     }
     $U = new User($this->ID);
     $U->loadMe(false);
     if (mUserdata::getGlobalSettingValue("encryptionKey") == null and Session::isUserAdminS()) {
         mUserdata::setUserdataS("encryptionKey", Util::getEncryptionKey(), "eK", -1);
     }
     if ($this->A->SHApassword != "") {
         $this->A->SHApassword = sha1($this->A->SHApassword);
     } else {
         $this->A->SHApassword = $U->A("SHApassword");
     }
     if ($checkUserData) {
         mUserdata::checkRestrictionOrDie("cantEdit" . str_replace("GUI", "", get_class($this)));
     }
     $this->loadAdapter();
     $this->Adapter->saveSingle2($this->getClearClass(get_class($this)), $this->A);
     if ($output) {
         Red::messageSaved();
     }
 }
 function getHTML($id)
 {
     #$showHelp = true;
     if ($this->collector == null) {
         $this->lCV3($id);
     }
     $singularLanguageClass = $this->loadLanguageClass("Installation");
     $text = $singularLanguageClass != null ? $singularLanguageClass->getText() : "";
     if ($id == -1) {
         echo OnEvent::script(OnEvent::rme($this, "getActions", "", "function(transport){ contentManager.contentBelow(transport.responseText); }"));
     }
     $hasDBConnection = false;
     try {
         mUserdata::getGlobalSettingValue("DBVersion", false);
         $hasDBConnection = true;
     } catch (Exception $e) {
     }
     $g = "";
     $DBFilePath = Util::getRootPath() . "system/DBData/Installation.pfdb.php";
     $writable = new HTMLTable(1);
     $File = new File($DBFilePath);
     $File->loadMe();
     if (!$File->A("FileIsWritable") and !$hasDBConnection) {
         return;
     }
     if (!$File->A("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 = "
     	<script type=\"text/javascript\">
     		contentManager.rmePCR('mInstallation','','getHelp','true','if(checkResponse(transport)) { Popup.create(\'123\', \'Installation\', \'Hilfe\'); Popup.update(transport, \'123\', \'Installation\'); }');
     	</script>";*/
     $ST = new HTMLSideTable("left");
     try {
         #$MailServer = LoginData::get("MailServerUserPass");
         #$MailServerID = $MailServer == null ? -1 : $MailServer->getID();
         $BMail = $ST->addButton("Mail-Server", "./plugins/Installation/serverMail.png");
         #$BMail->popup("edit", "Mail-Server", "LoginData", $MailServerID, "getPopup", "", "LoginDataGUI;preset:mailServer");
         $BMail->popup("edit", "Mail-Server", "mInstallation", -1, "manageMailservers");
         $BTestMail = $ST->addButton("Mailversand\ntesten", "mail");
         $BTestMail->popup("mailTest", "Mailversand testen", "mInstallation", "-1", "testMailGUI");
         if (Session::isPluginLoaded("mJabber")) {
             $JabberServer = LoginData::get("JabberServerUserPass");
             $JabberServerID = $JabberServer == null ? -1 : $JabberServer->getID();
             $BJabber = $ST->addButton("Jabber-Server", "./plugins/Installation/serverMail.png");
             $BJabber->popup("edit", "Jabber-Server", "LoginData", $JabberServerID, "getPopup", "", "LoginDataGUI;preset:jabberServer");
         }
         $BackupButton = $ST->addButton("Daten-\nsicherungen", "disk");
         $BackupButton->onclick("contentManager.loadFrame('contentLeft','BackupManager');");
     } catch (Exception $e) {
     }
     return $ST . $g;
     #.$t->getHTML();
     $t = new HTMLTable(1);
     try {
         $user = new User(1);
         $user->loadMe();
     } catch (DatabaseNotSelectedException $e) {
         if (BPS::getProperty("mInstallationGUI", "showErrorText", false)) {
             $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.");
             $t->addRowClass("backgroundColor0");
             $t->addRowStyle("color:red;");
         }
         return $g . $t->getHTML();
         #.$help;
     } catch (NoDBUserDataException $e) {
         if (BPS::getProperty("mInstallationGUI", "showErrorText", false)) {
             $t->addRow(isset($text["wrongData"]) ? $text["wrongData"] : "Mit den angegebenen Datenbank-Zugangsdaten kann keine Verbindung aufgebaut werden.<br /><br />Wenn sie korrekt sind, werden hier weitere Möglichkeiten angezeigt angezeigt.");
             $t->addRowClass("backgroundColor0");
             $t->addRowStyle("color:red;");
         }
         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 (TableDoesNotExistException $e) {
     } catch (StorageException $e) {
     }
     /*$help = "
     	<script type=\"text/javascript\">
     		rme('mInstallation','','getHelp','false','if(checkResponse(transport)) { Popup.create(\'123\', \'Installation\', \'Hilfe\'); Popup.update(transport, \'123\', \'Installation\'); }');
     	</script>";*/
     /*if(false AND $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 .= "
     	<div style=\"height:30px;\"></div>
     	$BackupTab
     	<div class=\"Tab backgroundColor1\"><p>Plugins</p></div>
     	<table>
     		<colgroup>
     			<col style=\"width:100px;\" class=\"backgroundColor2\" />
     			<col class=\"backgroundColor3\" />
     		</colgroup>
     		<tr>
     			<td colspan=\"3\">
     				<span style=\"float:right;\">".Installation::getReloadButton()."</span>
     				$BUT
     			</td>
     		</tr>
     		<tr>
     			<td style=\"background-color:white;\"></td>
     		</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;
     				
     
     				if($c->checkIfMyTableExists() AND $c->checkIfMyDBFileExists()) $showHelp = false;
     
     				if(!$c->checkIfMyDBFileExists())
     					continue;
     
     				$g .= "
     		<tr>
     			<td style=\"font-weight:bold;text-align:right;\">".($value != -1 ? $value : $key )."</td>
     			<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>
     		</tr>";
     			}
     
     			$g .= "
     	</table>";
     		}*/
     #$showHelp = false;
     #if(!$showHelp)
     #	$help = OnEvent::script(OnEvent::closePopup("123", "Installation"));
     return $ST . $g;
     #.$help;
 }
Example #3
0
<?php

#session_name("phim_".sha1(__FILE__));
define("PHYNX_NO_SESSION_RELOCATION", true);
require "../../system/connect.php";
addClassPath(Util::getRootPath() . "ubiquitous/phim");
$username = filter_input(INPUT_GET, "username");
$password = sha1(filter_input(INPUT_GET, "password"));
if (filter_input(INPUT_GET, "token")) {
    $AC = anyC::get("phimUser", "phimUserToken", filter_input(INPUT_GET, "token"));
    $AC->addAssocV3("phimUserActive", "=", "1");
    $U = $AC->n();
    if ($U != null) {
        $AnyUser = anyC::getFirst("User");
        $Us = new Users();
        $login = $Us->doLogin(array("loginUsername" => $AnyUser->A("username"), "loginSHAPassword" => $AnyUser->A("SHApassword"), "loginPWEncrypted" => 1));
        $user = new User($U->A("phimUserUserID"));
        $user->loadMe(false);
        $username = $user->A("username");
        $password = $user->A("SHApassword");
    }
}
$U = new Users();
$login = $U->doLogin(array("loginUsername" => $username, "loginSHAPassword" => $password, "loginPWEncrypted" => 1, "anwendung" => "lightCRM"));
if (!$login) {
    emoFatalError("Sorry, ich kenne dich nicht!", "Login fehlgeschlagen! Vermutlich sind die Zugangsdaten falsch.", "Login fehlgeschlagen", false);
}
$p = new mphimGUI();
$p->chatPopup("../");