示例#1
0
 public function loadPlugin($app, $folder, $optional = false)
 {
     if (!file_exists(Util::getRootPath() . "{$app}/{$folder}/plugin.xml") and !$optional) {
         throw new Exception("Required plugin {$app}/{$folder} not available (1)");
     }
     if (!file_exists(Util::getRootPath() . "{$app}/{$folder}/plugin.xml")) {
         return false;
     }
     $xml = new XMLPlugin(Util::getRootPath() . "{$app}/{$folder}/plugin.xml");
     $allowedPlugins = Environment::getS("allowedPlugins", false);
     $extraPlugins = Environment::getS("pluginsExtra", false);
     $allow = false;
     if ($allowedPlugins !== false and in_array($xml->registerClassName(), $allowedPlugins)) {
         $allow = true;
     }
     if ($extraPlugins !== false and in_array($xml->registerClassName(), $extraPlugins)) {
         $allow = true;
     }
     if ($allowedPlugins !== false and !$allow) {
         if (!$optional) {
             throw new Exception("Required plugin {$app}/{$folder} not available (2)");
         }
         return false;
     }
     require_once Util::getRootPath() . "{$app}/{$folder}/" . $xml->registerClassName() . ".class.php";
     $this->addClassPath(Util::getRootPath() . "{$app}/{$folder}");
     return true;
 }
示例#2
0
 public function getOffice3aRSS()
 {
     if (Environment::getS("blogShow", "1") == "0") {
         return "";
     }
     $data = file_get_contents(Environment::getS("blogRSSURL", "http://blog.office3a.eu/feed/"));
     if ($data === false) {
         return "";
     }
     $html = "\n\t\t\t<div style=\"border-bottom:1px solid #DDD;position:relative;\" class=\"desktopButton\" onclick=\"window.open('" . Environment::getS("blogURL", "http://blog.office3a.eu/") . "', '_blank');\">\n\t\t\t\t<h1 style=\"font-size:2.0em;color:#999999;position:absolute;bottom:5px;\">" . Environment::getS("blogName", "office<span style=\"color:#A0C100;\">3a</span> blog") . "</h1>\n\t\t\t</div>\n\t\t\t<div id=\"blogContainer\" style=\"padding-left:30px;padding-right:30px;overflow:auto;\">";
     try {
         $XML = new SimpleXMLElement($data);
         $i = 0;
         foreach ($XML->channel->item as $item) {
             $html .= "<h2 style=\"color:#999999;" . ($i > 0 ? "margin-top:30px;" : "") . "margin-bottom:0px;\">" . $item->title . "</h2>";
             $html .= "<p style=\"color:#999999;margin-top:10px;\">" . $item->description . "<br />\n\t\t\t\t\t<small style=\"color:#AAA;\">" . Util::CLFormatDate(strtotime($item->pubDate), true) . "</small> <a style=\"float:right;color:#444;\" href=\"{$item->link}\">mehr...</a></p>";
             #print_r($item);
             $i++;
             if ($i == 4) {
                 break;
             }
         }
         $html .= "</div>" . OnEvent::script("\$j('#blogContainer').css('height', contentManager.maxHeight() - \$j('.desktopButton').outerHeight() - 20)");
         return $html;
     } catch (Exception $e) {
         return "";
     }
 }
示例#3
0
 public function scanApplications()
 {
     $_SESSION["messages"]->startMessage("checking for directory ./applications/: ");
     if (is_dir(Util::getRootPath() . "applications/")) {
         $_SESSION["messages"]->endMessage("found");
         $apps = array();
         $fp = opendir(Util::getRootPath() . "applications/");
         while (($file = readdir($fp)) !== false) {
             if (strpos($file, "Application") === false) {
                 continue;
             }
             $apps[] = $file;
         }
         sort($apps);
         $allowedApplications = Environment::getS("allowedApplications", null);
         foreach ($apps as $key => $file) {
             require Util::getRootPath() . "applications/{$file}";
             $f = explode(".", $file);
             if ($f[0][0] == "-") {
                 continue;
             }
             $_SESSION["messages"]->startMessage("trying to register application {$f['0']}: ");
             $f = $f[0];
             $c = new $f();
             if ($allowedApplications != null and !in_array($c->registerName(), $allowedApplications)) {
                 continue;
             }
             $this->apps[$c->registerName()] = $c->registerFolder();
             if (method_exists($c, "registerIcon")) {
                 $this->icons[$c->registerName()] = $c->registerIcon();
             }
             if (method_exists($c, "registerVersion")) {
                 $this->versions[$c->registerName()] = $c->registerVersion();
             }
             $_SESSION["messages"]->endMessage("loaded");
             unset($c);
         }
     } else {
         $_SESSION["messages"]->endMessage("not found");
     }
     foreach ($this->apps as $name => $folder) {
         $newName = Environment::getS("renameApplication:{$name}", $name);
         if ($name != $newName) {
             $this->apps[$newName] = $folder;
             unset($this->apps[$name]);
             if (isset($this->icons[$name])) {
                 $this->icons[$newName] = $this->icons[$name];
                 unset($this->icons[$name]);
             }
             if (isset($this->versions[$name])) {
                 $this->versions[$newName] = $this->versions[$name];
                 unset($this->versions[$name]);
             }
         }
     }
 }
示例#4
0
 public function getHTML($id)
 {
     $allowedUsers = Environment::getS("allowedUsers", null);
     $this->addOrderV3("name");
     if ($this->A == null) {
         $this->lCV3($id);
     }
     $up = new anyC();
     $up->setCollectionOf("User");
     $up->addAssocV3("password", "!=", ";;;-1;;;");
     $up->lCV3();
     if ($up->numLoaded() > 0 and $id == -1) {
         return "\n\t\t<table>\n\t\t\t<colgroup>\n\t\t\t\t<col class=\"backgroundColor3\" />\n\t\t\t</colgroup>\n\t\t\t<tr>\n\t\t\t\t<td><input onclick=\"rme('Users','','convertPasswords','','contentManager.reloadFrameRight();');\" type=\"button\" style=\"float:right;background-image:url(./images/navi/keys.png);\" class=\"bigButton backgroundColor2\" value=\"Passwörter\nkonvertieren\" />In Ihrer Datenbank befinden sich noch unkonvertierte Passwörter.</td>\n\t\t\t</tr>\n\t\t</table>";
     }
     $T = new HTMLTable(1, "Application Server");
     $I = new HTMLInput("AppServer", "text", mUserdata::getGlobalSettingValue("AppServer", ""));
     $I->onEnter("contentManager.rmePCR('Users', '-1', 'saveAppServer', [this.value], ' ');");
     if ($allowedUsers === null) {
         $T->addRow($I . "<br /><small>Wenn Sie einen Application Server bertreiben, tragen Sie hier bitte die URL ein, um die Benutzer mit diesem Server zu authorisieren.</small>");
     }
     $gui = new HTMLGUI();
     $gui->setObject($this);
     $gui->setName("Benutzer");
     $gui->setCollectionOf($this->collectionOf, "Benutzer");
     #$gui->setObject($this);
     $gui->setParser("isAdmin", "UsersGUI::isAdminParser");
     $gui->setColWidth("isAdmin", "20px");
     #$gui->hideAttribute("password");
     #$gui->hideAttribute("SHApassword");
     #$gui->hideAttribute("language");
     $gui->setShowAttributes(array("name", "username", "isAdmin"));
     $g = "";
     if (strstr($_SERVER["SCRIPT_FILENAME"], "demo")) {
         $UA = $_SESSION["S"]->getCurrentUser()->getA();
         if ($UA->name != "Installations-Benutzer") {
             $g = "In der Demo können keine Benutzer geändert werden!";
             $gui->setIsDisplayMode(true);
         }
     }
     $TR = new HTMLTable(1);
     if ($allowedUsers !== null and $id == -1) {
         $B = new Button("", "notice", "icon");
         $B->style("float:left;margin-right:10px;");
         $TR->addRow(array($B . "Bitte beachten Sie: Sie können insgesamt {$allowedUsers} Benutzer ohne Admin-Rechte anlegen."));
     }
     $gui->customize($this->customizer);
     return $TR . $g . $gui->getBrowserHTML($id) . ($id == -1 ? $T : "");
 }
示例#5
0
 function newMe($checkUserData = true, $output = false)
 {
     $allowedUsers = Environment::getS("allowedUsers", null);
     if ($allowedUsers !== null and $this->A("isAdmin") == "0") {
         $AC = anyC::get("User", "isAdmin", "0");
         $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.");
         }
     }
     if (mUserdata::getGlobalSettingValue("encryptionKey") == null and Session::isUserAdminS()) {
         mUserdata::setUserdataS("encryptionKey", Util::getEncryptionKey(), "eK", -1);
     }
     $this->A->SHApassword = sha1($this->A->SHApassword);
     return parent::newMe($checkUserData, $output);
 }
示例#6
0
 public function getMenuEntries()
 {
     $entries = $this->menuEntries;
     $hidden = Environment::getS("hiddenPlugins", array());
     foreach ($entries as $key => $value) {
         #print_r($this->menuEntries);
         if (in_array($value, $hidden)) {
             unset($entries[$key]);
         }
         if (isset($this->blacklist[$value])) {
             unset($entries[$key]);
         }
         #$t = ((!isset($this->classes[$key]) OR !isset($this->isAdminOnlyByPlugin[$this->classes[$key]])) ?
         #	0 : $this->isAdminOnlyByPlugin[$this->classes[$key]]);
         $t = 0;
         if (isset($this->classes[$key]) and isset($this->isAdminOnlyByPlugin[$this->classes[$key]])) {
             $t = 1;
         }
         if (isset($this->isAdminOnlyByPlugin[$key])) {
             $t = 1;
         }
         if (isset($this->isAdminOnlyByPlugin[$value])) {
             $t = 1;
         }
         if ($t != $_SESSION["S"]->isUserAdmin()) {
             unset($entries[$key]);
         }
     }
     return $entries;
 }
示例#7
0
文件: index.php 项目: nemiah/fheME
				<?php 
if (!$updateTitle) {
    echo "\n\t\t\t\tcontentManager.updateTitle = false;";
}
echo "contentManager.init('" . (isset($_COOKIE["phynx_layout"]) ? $_COOKIE["phynx_layout"] : "horizontal") . "');";
?>
				
				$j('#altLogins').hover(function(){
					$j(this).fadeTo('fast', 1);
				}, function(){
					$j(this).fadeTo('slow', 0.3);
				});

				<?php 
if (Environment::getS("showApplicationsList", "1") == "0" or count($_SESSION["applications"]->getApplicationsList()) <= 1) {
    echo "\$j('#loginOptions, #altLogins').hide();";
}
?>
				/*setTimeout(function(){
					if($j.jStorage.get('phynxUserCert', null) == null && $j('#buttonCertificateLogin').length > 0)
						$j('#buttonCertificateLogin').css('opacity', '0.2');
					else
						userControl.autoCertificateLogin();
					} , 500);  */
			});

		</script>
		
		<div style="display:none;" id="messageSetup" title="Ersteinrichtung">
			<?php 
示例#8
0
 public function doLogin($ps)
 {
     $validUntil = Environment::getS("validUntil", null);
     if ($validUntil != null and $validUntil < time()) {
         Red::errorD("Diese Version ist abgelaufen. Bitte wenden Sie sich an den Support.");
     }
     if (!is_array($ps)) {
         parse_str($ps, $p);
     } else {
         $p = $ps;
     }
     #if($p["loginPassword"] == ";;;-1;;;") return 0;
     $this->doLogout();
     $_SESSION["DBData"] = $_SESSION["S"]->getDBData();
     try {
         $U = $this->getUser($p["loginUsername"], $p["loginSHAPassword"], $p["loginPWEncrypted"]);
         if ($U === null) {
             return 0;
         }
         if (get_class($U) == "phynxAltLogin") {
             $p["anwendung"] = $U->A("UserApplication");
         }
         if ($U->A("allowedApplications") != null and is_array($U->A("allowedApplications")) and !in_array($p["anwendung"], $U->A("allowedApplications"))) {
             return 0;
         }
         $AC = anyC::get("Userdata", "name", "loginTo" . ((isset($p["isCustomerPage"]) and $p["isCustomerPage"]) ? "customerPage" : $p["anwendung"]));
         $AC->addAssocV3("UserID", "=", $U->getID());
         $UD = $AC->n();
         if ($UD != null and $UD->A("wert") == "0") {
             return 0;
         }
         /*$AC = anyC::get("Userdata", "name", "loginToApplication");
         		$AC->addAssocV3("UserID", "=", $U->getID());
         		$UD = $AC->n();
         		if($UD != null AND $UD->A("wert") == "0")
         			return 0;*/
         $UA = $U->getA();
     } catch (Exception $e) {
         if ($p["loginUsername"] == "Admin" and $p["loginSHAPassword"] == "4e7afebcfbae000b22c7c85e5560f89a2a0280b4") {
             #"Admin"){
             $tu = new User(-1);
             $UA = $tu->newAttributes();
             $UA->name = "Installations-Benutzer";
             $UA->username = "******";
             $UA->password = "******";
             if ($p["loginSprache"] != "default") {
                 $UA->language = $p["loginSprache"];
             }
             $UA->isAdmin = 1;
             $U = new User(-1);
             $U->setA($UA);
         } else {
             return -2;
         }
     }
     if ($p["loginSprache"] != "default") {
         $U->changeA("language", $p["loginSprache"]);
     }
     if (strtolower($U->getA()->username) != strtolower($p["loginUsername"])) {
         return 0;
     }
     $_SESSION["S"]->setLoggedInUser($U);
     $_SESSION["S"]->initApp($p["anwendung"]);
     if (isset($_COOKIE["phynx_customer"])) {
         $_SESSION["phynx_customer"] = $_COOKIE["phynx_customer"];
     }
     #if($_SESSION["S"]->checkIfUserLoggedIn()) die("Beim Einloggen ist ein Fehler aufgetreten.\nBitte drücken Sie F5 (aktualisieren) und melden Sie sich erneut an.");
     return 1;
 }
示例#9
0
 public function tip()
 {
     if (Environment::getS("hideTooltips", "0") == "1") {
         return "";
     }
     $targetClass = $this->object->getClearClass();
     $this->tip = self::tipJS($targetClass);
 }
示例#10
0
 public function getHTML($id, $page)
 {
     $entries = $_SESSION["CurrentAppPlugins"]->getMenuEntries();
     $icons = $_SESSION["CurrentAppPlugins"]->getIcons();
     $targets = $_SESSION["CurrentAppPlugins"]->getMenuTargets();
     $appMenuDisplayed = MenuGUI::getAppMenuOrder("appMenuDisplayed");
     if ($appMenuDisplayed != "") {
         $appMenuDisplayed = explode(";", $appMenuDisplayed);
     } else {
         $appMenuDisplayed = $entries;
     }
     ksort($entries);
     $request = array_values($entries);
     $xml = self::getSpell($request);
     #$AP3 = new AppPlugins("customer");
     #$plugins = array_merge($plugins, $AP3->getAllPlugins());
     #$menu = array_merge($menu, array_flip($AP3->getAllMenuEntries()));
     #$icons = array_merge($icons, $AP3->getIcons());
     #$plugins3 = array_flip($AP3->getAllPlugins());
     #print_r($plugins3);
     $AP = new AppPlugins(Applications::activeApplication());
     $plugins = array_flip($AP->getAllPlugins());
     $html = "";
     $html .= "<div style=\"float:right;width:160px;padding-top:20px;\" id=\"containerSortTabs\">" . $this->getSortable(false) . "</div>\n\t\t\t<div style=\"margin-right:160px;\">";
     $U = new mUserdata();
     $U->addAssocV3("typ", "=", "TTP");
     $collapsedTabs = Environment::getS("collapsedTabs", "0") == "1";
     foreach ($entries as $key => $value) {
         $text = "";
         if ($xml !== false) {
             foreach ($xml->plugin as $xmlp) {
                 if ($xmlp->name == $value) {
                     $text = $xmlp->description;
                 }
             }
         }
         if (isset($plugins[$value])) {
             unset($plugins[$value]);
         }
         $BG = new Button("Plugin {$key} öffnen", "navigation", "icon");
         $BG->onclick("contentManager.loadPlugin('" . (isset($targets[$value]) ? $targets[$value] : "contentRight") . "', '{$value}', '{$value}GUI;-');");
         $BG->style("float:right;margin-top:-7px;");
         $B = new Button($key, $icons[$value], "icon");
         $B->style("float:left;margin-right:10px;margin-top:-7px;margin-left:-5px;");
         $I = new HTMLInput("usePlugin{$value}", "checkbox", in_array($value, $appMenuDisplayed) ? "1" : "0");
         $I->id("usePlugin{$value}");
         $I->onchange("if(this.checked) { Menu.showTab('{$value}'); \$j('#minPlugin{$value}').prop('disabled', ''); } else { Menu.hideTab('{$value}'); \$j('#minPlugin{$value}').prop('disabled', 'disabled'); }");
         $t = !$_SESSION["S"]->isUserAdmin() ? $U->getUDValueCached("ToggleTab{$value}") : "big";
         if ($t == null and $collapsedTabs) {
             $t = "small";
         }
         if ($t == null) {
             $t = "big";
         }
         $IM = new HTMLInput("minPlugin{$value}", "checkbox", $t == "big" ? "0" : "1");
         $IM->id("minPlugin{$value}");
         $IM->onchange("toggleTab('{$value}');");
         if (isset($_COOKIE["phynx_layout"]) and ($_COOKIE["phynx_layout"] == "vertical" or $_COOKIE["phynx_layout"] == "desktop")) {
             $IM->isDisabled(true);
         }
         if (!in_array($value, $appMenuDisplayed)) {
             $IM->isDisabled(true);
         }
         #border-width:1px;border-style:solid;
         $html .= "\n\t\t\t<div style=\"width:33%;float:left;\">\n\t\t\t\t<div style=\"margin:10px;\" class=\"borderColor1 spell\">\n\t\t\t\t\t<div class=\"backgroundColor2\" style=\"padding:10px;padding-bottom:5px;\">\n\t\t\t\t\t\t{$BG}{$B}<h2 style=\"margin-bottom:0px;margin-top:0px;\">{$key}</h2>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style=\"padding:7px;\">\n\t\t\t\t\t\t{$I}<label style=\"float:none;width:200px;text-align:left;display:inline;margin-left:10px;font-wight:normal;\" for=\"usePlugin{$value}\">Plugin verwenden</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style=\"padding:7px;padding-top:0px;\">\n\t\t\t\t\t\t{$IM}<label style=\"float:none;width:200px;text-align:left;display:inline;margin-left:10px;font-wight:normal;\" for=\"minPlugin{$value}\">Reiter minimiert</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t" . ($xml !== false ? "<div style=\"padding:7px;height:115px;overflow:auto;\">{$text}</div>" : "") . "\n\t\t\t\t</div>\n\t\t\t</div>";
     }
     $html .= "</div><h2 style=\"clear:both;padding-top:50px;\">Admin-Plugins und Plugins ohne eigenen Reiter</h2><div style=\"margin-right:160px;\">";
     $icons = $AP->getIcons();
     $plugins = array_flip($plugins);
     $menu = array_flip($AP->getAllMenuEntries());
     $AP2 = new AppPlugins("plugins");
     $plugins = array_merge($plugins, $AP2->getAllPlugins());
     $menu = array_merge($menu, array_flip($AP2->getAllMenuEntries()));
     $icons = array_merge($icons, $AP2->getIcons());
     $plugins2 = array_flip($AP2->getAllPlugins());
     $request = array_values($plugins);
     $xml = self::getSpell($request);
     ksort($plugins);
     foreach ($plugins as $key => $value) {
         if (isset($menu[$value])) {
             $key = $menu[$value];
         }
         $text = "";
         if ($xml !== false) {
             foreach ($xml->plugin as $xmlp) {
                 if ($xmlp->name == $value) {
                     $text = $xmlp->description;
                 }
             }
         }
         if ($text == "" or $text == "-") {
             continue;
         }
         if (!isset($plugins2[$value]) and substr($AP->getFolderOfPlugin($value), 0, 3) == "../") {
             continue;
         }
         if (isset($plugins2[$value]) and substr($AP2->getFolderOfPlugin($value), 0, 3) == "../") {
             continue;
         }
         if (!isset($plugins2[$value])) {
             $isAdmin = $AP->getIsAdminOnly($value);
         }
         if (isset($plugins2[$value])) {
             $isAdmin = $AP2->getIsAdminOnly($value);
         }
         $B = new Button($key, $icons[$value], "icon");
         $B->style("float:left;margin-right:10px;margin-top:-7px;margin-left:-5px;");
         #border-width:1px;border-style:solid;
         $html .= "\n\t\t\t<div style=\"width:33%;float:left;\">\n\t\t\t\t<div style=\"margin:10px;border-radius:5px;\" class=\"borderColor1 spell\">\n\t\t\t\t\t<div class=\"backgroundColor2\" style=\"padding:10px;padding-bottom:5px;\">\n\t\t\t\t\t\t{$B}<span style=\"float:right;margin-top:7px;\">" . ($isAdmin ? "Admin!" : "") . "</span><h2  style=\"margin-bottom:0px;margin-top:0px;\">{$key}</h2>\n\t\t\t\t\t</div>\n\t\t\t\t\t" . ($xml !== false ? "<div style=\"padding:7px;height:115px;overflow:auto;\">{$text}</div>" : "") . "\n\t\t\t\t</div>\n\t\t\t</div>";
     }
     $html .= "</div>";
     #echo "<pre>";
     #print_r($menu);
     #echo "</pre>";
     return $html;
 }
示例#11
0
 public function switchApplication($application)
 {
     $allowedApplications = Environment::getS("allowedApplications", null);
     if ($allowedApplications != null and !in_array($application, $allowedApplications)) {
         Red::errorD("Bitte wenden Sie sich an den Support, wenn Sie {$application} verwenden möchten");
     }
     ob_start();
     $U = new UsersGUI();
     $c = $this->getCurrentUser();
     $d = array();
     $d["loginUsername"] = $c->getA()->username;
     $d["loginSHAPassword"] = $c->getA()->SHApassword;
     $d["loginSprache"] = $c->getA()->language;
     $d["anwendung"] = $application;
     $U->doLogin($d);
     ob_end_clean();
 }
示例#12
0
							alt="Hilfe"
							src="./images/navi/hilfe.png" />
					<?php 
}
?>

					<!--<xsl:if test="options/showDesktopButton/@value='true'">
						<img
							onclick="DesktopLink.toggle();"
							style="float:right;margin-left:8px;margin-right:5px;"
							class="mouseoverFade"
							title="Desktop"
							alt="Desktop"><xsl:attribute name="src"><xsl:value-of select="iconDesktop" /></xsl:attribute></img>
					</xsl:if>-->
					<?php 
if (Environment::getS("showCopyright", "1") == "1") {
    echo 'Copyright (C) 2007 - 2012 by <a href="http://www.Furtmeier.IT">Furtmeier Hard- und Software</a>. This program comes with ABSOLUTELY NO WARRANTY; this is free software, and you are welcome to redistribute it under certain conditions; see <a href="gpl.txt">gpl.txt</a> for details.<br />Thanks to the authors of the libraries and icons used by this program. <a href="javascript:contentManager.loadFrame(\'contentRight\',\'Credits\');">View credits.</a>';
}
?>
				</p>
			</div>
		</div>
		<script type="text/javascript">
			$j(document).ready(function() {
				Ajax.physion = '<?php 
echo $physion;
?>
'

				contentManager.init();
示例#13
0
 public function getActiveApplicationName()
 {
     // <editor-fold defaultstate="collapsed" desc="Aspect:jP">
     try {
         $MArgs = func_get_args();
         return Aspect::joinPoint("around", $this, __METHOD__, $MArgs);
     } catch (AOPNoAdviceException $e) {
     }
     Aspect::joinPoint("before", $this, __METHOD__, $MArgs);
     // </editor-fold>
     $name = Applications::activeApplication();
     echo Environment::getS("renameApplication:{$name}", $name);
 }
示例#14
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();
 }
示例#15
0
 public function scanPlugins($appFolder = null)
 {
     #file_put_contents(Util::getRootPath()."debug.txt", print_r(debug_backtrace(), true));
     #echo "<pre>";
     #print_r();
     #echo "</pre>";
     foreach ($this->appFolder as $key => $value) {
         if ($value == "plugins") {
             continue;
         }
         unset($this->menuEntries[array_search($key, $this->menuEntries)]);
     }
     #echo "scanning for plugins...<br />";
     if ($appFolder == null) {
         $folder = "plugins";
         if ($_SESSION["applications"]->getActiveApplication() != "nil") {
             $folder = $_SESSION["applications"]->getActiveApplication();
         }
     } else {
         $folder = $appFolder;
     }
     #$allowedPlugins = "noSaaS";
     $allowedPlugins = Environment::getS("allowedPlugins", array());
     #print_r($allowedPlugins);
     /*if($folder != "plugins" AND $_SERVER["HTTP_HOST"] != "dev.furtmeier.lan"){
     			try {
     				$saas = new SaaS(-1);
     				
     				$sa = $saas->getCurrent();
     				if($sa != null){
     					$allowedPlugins = array_map("trim",explode("\n",$sa->getA()->SaaSPlugins));
     				} else $allowedPlugins = array();
     			} catch(ClassNotFoundException $e){ }
     			
     		}*/
     #$p = ".".(is_dir("./$folder/") ? "" : ".");
     $p = Util::getRootPath();
     if ($p[strlen($p) - 1] == "/") {
         $p[strlen($p) - 1] = " ";
     }
     $p = trim($p);
     $_SESSION["messages"]->startMessage("checking for directory {$p}/{$folder}/: ");
     if (is_dir("{$p}/{$folder}/")) {
         $_SESSION["messages"]->endMessage("found");
         $plugins = array();
         $fp = opendir("{$p}/{$folder}/");
         while (($file = readdir($fp)) !== false) {
             if ($file == "." or $file == "..") {
                 continue;
             }
             if (is_dir("{$p}/{$folder}/{$file}")) {
                 if (file_exists("{$p}/{$folder}/{$file}/plugin.xml")) {
                     $file = "{$file}/plugin.xml";
                 } else {
                     continue;
                 }
             }
             if (stripos($file, "plugin") === false) {
                 continue;
             }
             $plugins[] = $file;
         }
         sort($plugins);
         foreach ($plugins as $key => $file) {
             $f = explode(".", $file);
             if ($f[0][0] == "-") {
                 continue;
             }
             if ($f[1] == "xml") {
                 $c = new XMLPlugin("{$p}/{$folder}/{$file}", $allowedPlugins);
             } else {
                 require_once "{$p}/{$folder}/{$file}";
                 $f = $f[0];
                 $c = new $f();
             }
             $_SESSION["messages"]->startMessage("trying to register " . $c->registerName() . ": ");
             if (count($allowedPlugins) > 0 and !in_array($c->registerClassName(), $allowedPlugins)) {
                 $_SESSION["messages"]->endMessage(" not allowed");
                 continue;
             }
             $pFolder = $c->registerFolder();
             if (!is_array($pFolder)) {
                 $this->folders[] = $pFolder;
             } else {
                 foreach ($pFolder as $k => $v) {
                     $this->folders[] = $v;
                 }
             }
             $this->pluginToFolder[$c->registerClassName()] = $c->registerFolder();
             if ($c->registerMenuEntry() != "") {
                 $this->menuEntries[$c->registerMenuEntry()] = $c->registerClassName();
             }
             $this->appFolder[$c->registerClassName()] = $folder;
             if ($c->registerName() != "noName") {
                 $this->classes[$c->registerName()] = $c->registerClassName();
             }
             if ($c->registerName() != "noName" and $c->registerMenuEntryTarget() != "contentRight") {
                 $this->targets[$c->registerClassName()] = $c->registerMenuEntryTarget();
             }
             $this->icons[$c->registerClassName()] = $c->registerIcon();
             if ($c->registerPluginIsAdminOnly()) {
                 $this->isAdminOnlyByPlugin[$c->registerClassName()] = $c->registerPluginIsAdminOnly();
             } elseif (!$c->registerPluginIsAdminOnly() and isset($this->isAdminOnlyByPlugin[$c->registerClassName()])) {
                 unset($this->isAdminOnlyByPlugin[$c->registerClassName()]);
             }
             if ($c->registerDependencies() != "none") {
                 $this->deps[$c->registerClassName()] = $c->registerDependencies();
             }
             $this->versions[$c->registerClassName()] = $c->registerVersion();
             if ($c->registerJavascriptFile() != "" and isset($_SESSION["JS"])) {
                 if (is_array($c->registerJavascriptFile())) {
                     foreach ($c->registerJavascriptFile() as $v) {
                         JSLoader::addScriptS($v, $c->registerFolder(), $c->registerClassName(), $folder);
                     }
                 } else {
                     JSLoader::addScriptS($c->registerJavascriptFile(), $c->registerFolder(), $c->registerClassName(), $folder);
                 }
             }
             #if(method_exists($c, "registerUseGenericClasses"))
             #	$this->isGeneric[$c->registerName()] = $c->registerUseGenericClasses();
             #if(isset($this->isGeneric[$c->registerName()]) AND $this->isGeneric[$c->registerName()]){
             #	$this->collectors[$c->registerClassName()] = $c->registerName();
             #	$this->genericPlugins[$c->registerName()] = $c;
             #}
             $n = $c->registerClassName();
             if ($n != "" and $appFolder == null) {
                 try {
                     $nc = new $n();
                     if (method_exists($nc, 'getCollectionOf')) {
                         if (!isset($this->collectors[$c->registerClassName()])) {
                             $this->collectors[$c->registerClassName()] = $nc->getCollectionOf();
                         }
                     }
                 } catch (ClassNotFoundException $e) {
                     if ($n != "") {
                         try {
                             $n = $n . "GUI";
                             $nc = new $n();
                             if (method_exists($nc, 'getCollectionOf')) {
                                 if (!isset($this->collectors[$c->registerClassName()])) {
                                     $this->collectors[$c->registerClassName()] = $nc->getCollectionOf();
                                 }
                             }
                         } catch (ClassNotFoundException $e2) {
                         }
                     }
                 }
             }
             if ($f[1] == "xml") {
                 $path = "./{$folder}/" . $c->registerFolder() . "/" . $c->registerClassName() . ".class.php";
                 if (file_exists($path)) {
                     require_once $path;
                 } elseif (file_exists("." . $path)) {
                     require_once "." . $path;
                 }
             }
             if ($appFolder == null) {
                 $c->doSomethingElse();
             }
             $_SESSION["messages"]->endMessage(" successful");
             unset($c);
         }
     } else {
         $_SESSION["messages"]->endMessage("not found");
     }
 }