コード例 #1
0
 function getHTML($id)
 {
     $this->loadMeOrEmpty();
     $gui = new HTMLGUI2();
     $gui->setObject($this);
     $gui->setName("RSSFilter");
     $gui->setShowAttributes(array("RSSFilterName", "RSSFilterFeed", "RSSFilterAdapter", "RSSFilterJDID", "RSSFilterAutoDL", "RSSFilterProviderRapidshare", "RSSFilterProviderNetload", "RSSFilterProviderUploaded"));
     $gui->setLabel("RSSFilterName", "Name");
     $gui->setLabel("RSSFilterFeed", "Feed URL");
     $gui->setLabel("RSSFilterAdapter", "Adapter");
     $gui->setLabel("RSSFilterJDID", "DL with");
     $gui->setLabel("RSSFilterProviderRapidshare", "Rapidshare.com");
     $gui->setLabel("RSSFilterProviderNetload", "Netload");
     $gui->setLabel("RSSFilterProviderUploaded", "Uploaded");
     $gui->setLabel("RSSFilterAutoDL", "Auto-DL?");
     $gui->setType("RSSFilterProviderRapidshare", "checkbox");
     $gui->setType("RSSFilterProviderNetload", "checkbox");
     $gui->setType("RSSFilterAutoDL", "checkbox");
     $gui->setType("RSSFilterProviderUploaded", "checkbox");
     $gui->insertSpaceAbove("RSSFilterJDID");
     $gui->setFieldDescription("RSSFilterAutoDL", "Currently only works when using JDownloader RC, Qnap and pyLoad. Will have no effect otherwise.");
     $gui->selectWithCollection("RSSFilterJDID", new mJDGUI(), "JDName", "nicht herunterladen");
     $gui->setStandardSaveButton($this);
     $Tab = new HTMLSideTable("right");
     $B = new Button("show filtered\nfeed", "./trinityDB/RSSFilter/Filtered.png");
     $B->onclick("window.open('./trinityDB/RSSFilter/FilteredFeed.php?RSSFilterID=" . $this->getID() . "', 'Filtered feed');");
     $Tab->addRow($B);
     $FB = new FileBrowser();
     $FB->addDir(Util::getRootPath() . "trinityDB/RSSFilter");
     $Adapters = $FB->getAsLabeledArray("iFeedFilter", ".class.php", true);
     $gui->setType("RSSFilterAdapter", "select");
     $gui->setOptions("RSSFilterAdapter", array_values($Adapters), array_keys($Adapters));
     return $Tab . $gui->getEditHTML();
 }
コード例 #2
0
ファイル: Filelink.class.php プロジェクト: nemiah/trinityDB
 public static function cleanUp()
 {
     if (!file_exists(Util::getRootPath() . "../phynxPublic/filelink")) {
         return;
     }
     $delete = array();
     $dir = new DirectoryIterator(Util::getRootPath() . "../phynxPublic/filelink/");
     foreach ($dir as $file) {
         if ($file->isDot()) {
             continue;
         }
         if (!$file->isDir()) {
             continue;
         }
         if ($file->getCTime() < time() - 3600 * 24 * 14) {
             $delete[] = $file->getPathname();
         }
     }
     foreach ($delete as $dir) {
         $D = new DirectoryIterator($dir);
         foreach ($D as $file) {
             if ($file->isDot()) {
                 continue;
             }
             if ($file->isDir()) {
                 continue;
             }
             unlink($file->getPathname());
         }
         rmdir($dir);
     }
 }
コード例 #3
0
ファイル: CCPage.class.php プロジェクト: nemiah/fheME
 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;
 }
コード例 #4
0
ファイル: File.class.php プロジェクト: nemiah/trinityDB
 function getRelPath()
 {
     $Path = $this->A("FileDir") . "/" . $this->A("FileName");
     $pAF = Util::getRootPath();
     #str_replace("interface","",dirname($_SERVER["PHP_SELF"]));
     return str_replace($pAF, "./", substr($Path, strpos($Path, $pAF)));
 }
コード例 #5
0
ファイル: CCShopping.class.php プロジェクト: nemiah/trinityDB
 function getCMSHTML()
 {
     $key = substr(Util::eK(), 0, 5);
     if (!isset($_GET["key"]) or $key != $_GET["key"]) {
         return "<span style=\"color:red;\">Bitte geben Sie den richtigen Schlüssel zum Aufrufen der Seite in der Adresszeile an.</span>";
     }
     registerClassPath("Einkaufszettel", Util::getRootPath() . "fheME/Einkaufszettel/Einkaufszettel.class.php");
     /*
     		registerClassPath("GSRaumgruppe", Util::getRootPath()."FCalc/GSRaumgruppe/GSRaumgruppe.class.php");
     		registerClassPath("ObjektL", Util::getRootPath()."personalKartei/ObjekteL/ObjektL.class.php");
     		registerClassPath("mGSTaetigkeitGUI", Util::getRootPath()."FCalc/GSTaetigkeit/mGSTaetigkeitGUI.class.php");
     		registerClassPath("GSTaetigkeit", Util::getRootPath()."FCalc/GSTaetigkeit/GSTaetigkeit.class.php");
     * 
     */
     $AC = anyC::get("Einkaufszettel");
     $AC->addAssocV3("EinkaufszettelBought", "=", "0");
     $AC->addOrderV3("EinkaufszettelName");
     $html = "<style type=\"text/css\">\n\t\t\t\tbody {\n\t\t\t\t\tmargin:0px;\n\t\t\t\t\tmargin-top:10px;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.entry {\n\t\t\t\t\tpadding:10px;\n\t\t\t\t\tborder-top-width:1px;\n\t\t\t\t\tborder-top-style:solid;\n\t\t\t\t\tborder-bottom-width:1px;\n\t\t\t\t\tborder-bottom-style:solid;\n\t\t\t\t\tfont-size:2em;\n\t\t\t\t\tmargin-bottom:10px;\n\t\t\t\t\tcursor:pointer;\n\t\t\t\t\t-webkit-touch-callout: none;\n\t\t\t\t\t-webkit-user-select: none;\n\t\t\t\t\t-khtml-user-select: none;\n\t\t\t\t\t-moz-user-select: none;\n\t\t\t\t\t-ms-user-select: none;\n\t\t\t\t\tuser-select: none;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.entryTouch {\n\t\t\t\t\tbackground-color: #c5d674;\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<div id=\"einkaufsliste\">";
     while ($E = $AC->getNextEntry()) {
         $html .= "<div id=\"entry" . $E->getID() . "\" onclick=\"CustomerPage.rme('setBought', [" . $E->getID() . "], function(){ \$('#entry" . $E->getID() . "').remove(); if(\$('#einkaufsliste .nonEmpty').length == 0) \$('#emptyEntry').show(); });\" class=\"nonEmpty entry backgroundColor1 borderColor1\">" . ($E->A("EinkaufszettelMenge") > 1 ? $E->A("EinkaufszettelMenge") . " x " : "") . $E->A("EinkaufszettelName") . ($E->A("EinkaufszettelNameDetails") != "" ? "<br /><small style=\"color:grey;\">" . $E->A("EinkaufszettelNameDetails") . "</small>" : "") . "</div>";
     }
     $html .= "<div style=\"" . ($AC->numLoaded() == 0 ? "" : "display:none;") . "\" class=\"entry backgroundColor1 borderColor1\" id=\"emptyEntry\">Die Einkaufsliste enthält keine Einträge.<br /><small style=\"color:grey;\">" . Util::CLDateParser(time()) . "</small></div>";
     $html .= "</div>";
     return $html . OnEvent::script("\$('.entry').hammer().on('touch', function(){ \$(this).addClass('entryTouch'); }); \$('.entry').hammer().on('release', function(){ \$(this).removeClass('entryTouch'); });");
 }
コード例 #6
0
ファイル: CCShopping.class.php プロジェクト: nemiah/fheME
 function getCMSHTML()
 {
     $key = substr(Util::eK(), 0, 5);
     if (!isset($_GET["key"]) or $key != $_GET["key"]) {
         return "<span style=\"color:red;\">Bitte geben Sie den richtigen Schlüssel zum Aufrufen der Seite in der Adresszeile an.</span>";
     }
     registerClassPath("Einkaufszettel", Util::getRootPath() . "fheME/Einkaufszettel/Einkaufszettel.class.php");
     /*
     		registerClassPath("GSRaumgruppe", Util::getRootPath()."FCalc/GSRaumgruppe/GSRaumgruppe.class.php");
     		registerClassPath("ObjektL", Util::getRootPath()."personalKartei/ObjekteL/ObjektL.class.php");
     		registerClassPath("mGSTaetigkeitGUI", Util::getRootPath()."FCalc/GSTaetigkeit/mGSTaetigkeitGUI.class.php");
     		registerClassPath("GSTaetigkeit", Util::getRootPath()."FCalc/GSTaetigkeit/GSTaetigkeit.class.php");
     * 
     */
     $AC = anyC::get("Einkaufszettel");
     $AC->addAssocV3("EinkaufszettelBought", "=", "0");
     $AC->addJoinV3("EinkaufszettelKategorie", "EinkaufszettelEinkaufszettelKategorieID", "=", "EinkaufszettelKategorieID");
     $AC->addOrderV3("EinkaufszettelKategorieName");
     $AC->addOrderV3("EinkaufszettelName");
     $html = "<style type=\"text/css\">\n\t\t\t\tbody {\n\t\t\t\t\tmargin:0px;\n\t\t\t\t\tmargin-top:10px;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t@media only screen and (max-width: 360px) {\n\t\t\t\t\thtml {\n\t\t\t\t\t\tzoom: .8;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t  \n\t\t\t\t.entry {\n\t\t\t\t\tpadding:10px;\n\t\t\t\t\tborder-top-width:1px;\n\t\t\t\t\tborder-top-style:solid;\n\t\t\t\t\tborder-bottom-width:1px;\n\t\t\t\t\tborder-bottom-style:solid;\n\t\t\t\t\tfont-size:2em;\n\t\t\t\t\tmargin-bottom:10px;\n\t\t\t\t\tcursor:pointer;\n\t\t\t\t\t-webkit-touch-callout: none;\n\t\t\t\t\t-webkit-user-select: none;\n\t\t\t\t\t-khtml-user-select: none;\n\t\t\t\t\t-moz-user-select: none;\n\t\t\t\t\t-ms-user-select: none;\n\t\t\t\t\tuser-select: none;\n\t\t\t\t\t-webkit-tap-highlight-color:rgba(255,255,255,0);\n\t\t\t\t\twidth:100%;\n\t\t\t\t\tbox-sizing:border-box;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.entryRestore {\n\t\t\t\t\tborder-top-width:1px;\n\t\t\t\t\tborder-top-style:solid;\n\t\t\t\t\tborder-bottom-width:1px;\n\t\t\t\t\tborder-bottom-style:solid;\n\t\t\t\t\tpadding:10px;\n\t\t\t\t\tfont-size:2em;\n\t\t\t\t\tmargin-bottom:10px;\n\t\t\t\t\tcursor:pointer;\n\t\t\t\t\t-webkit-touch-callout: none;\n\t\t\t\t\t-webkit-user-select: none;\n\t\t\t\t\t-khtml-user-select: none;\n\t\t\t\t\t-moz-user-select: none;\n\t\t\t\t\t-ms-user-select: none;\n\t\t\t\t\tuser-select: none;\n\t\t\t\t\tcolor:#444;\n\t\t\t\t\t-webkit-tap-highlight-color:rgba(255,255,255,0);\n\t\t\t\t\twidth:100%;\n\t\t\t\t\tbox-sizing:border-box;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.backgroundColor4 {\n\t\t\t\t\tbackground-color: #eee;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.entryTouch {\n\t\t\t\t\tbackground-color: #c5d674;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.borderColor0 {\n\t\t\t\t\tborder-color:white;\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<div id=\"einkaufsliste\">";
     $B = new Button("Wiederherstellen", "undo", "iconicL");
     $last = null;
     while ($E = $AC->getNextEntry()) {
         if ($last != $E->A("EinkaufszettelKategorieName") and $last !== null) {
             $html .= "<h1 style=\"padding-left:10px;padding-top:15px;padding-bottom:7px;\">" . $E->A("EinkaufszettelKategorieName") . "</h1>";
         }
         $html .= "\n\t\t\t\t<div\n\t\t\t\t\tid=\"entry" . $E->getID() . "\"\n\t\t\t\t\tontouchend=\"if(Touch.cancelNext) return;  CustomerPage.rme('setBought', [" . $E->getID() . "], function(){ \$('#entry" . $E->getID() . "').hide(); \$('#restoreEntry" . $E->getID() . "').show(); \$('#emptyEntry').hide(); if(\$('#einkaufsliste .nonEmpty').length == 0) \$('#emptyEntry').show(); });\"\n\t\t\t\t\tclass=\"nonEmpty entry backgroundColor1 borderColor1\">\n\t\t\t\t\t\n\t\t\t\t\t" . ($E->A("EinkaufszettelMenge") > 1 ? $E->A("EinkaufszettelMenge") . " x " : "") . $E->A("EinkaufszettelName") . ($E->A("EinkaufszettelNameDetails") != "" ? "<br /><small style=\"color:grey;\">" . $E->A("EinkaufszettelNameDetails") . "</small>" : "") . "\n\t\t\t\t</div>\n\t\t\t\t<div \n\t\t\t\t\tclass=\"nonEmpty entryRestore backgroundColor4 borderColor0\"\n\t\t\t\t\tontouchend=\"if(Touch.cancelNext) return; CustomerPage.rme('setUnBought', [" . $E->getID() . "], function(){ \$('#entry" . $E->getID() . "').show(); \$('#restoreEntry" . $E->getID() . "').hide(); \$('#emptyEntry').hide(); if(\$('#einkaufsliste .nonEmpty').length == 0) \$('#emptyEntry').show(); });\"\n\t\t\t\t\tid=\"restoreEntry" . $E->getID() . "\" style=\"display:none;\">" . $E->A("EinkaufszettelName") . " {$B}</div>";
         $last = $E->A("EinkaufszettelKategorieName");
     }
     $html .= "<div style=\"" . ($AC->numLoaded() == 0 ? "" : "display:none;") . "\" class=\"entry backgroundColor1 borderColor1\" id=\"emptyEntry\">Die Einkaufsliste enthält keine Einträge.<br /><small style=\"color:grey;\">" . Util::CLDateParser(time()) . "</small></div>";
     $html .= "</div>";
     return $html . OnEvent::script("\n\t\tvar Touch = {};\n\t\t\n\t\t\$(document).on('touchstart mousedown', '[ontouchend]', function(ev){\n\t\t\t\$(this).addClass('entryTouch'); \n\t\t\t\n\t\t\tTouch.startPos = [ev.clientX, ev.clientY];\n\t\t\tTouch.cancelNext = false;\n\t\t\tTouch.inAction = this;\n\t\t\n\t\t}); \n\t\t\n\t\t\$(document).on('touchend mouseup', '[ontouchend]', function(ev){\n\t\t\t\$(this).removeClass('entryTouch');\n\t\t\tTouch.inAction = false;\n\t\t});\n\t\t\t\n\t\t\$(document).on('touchmove mousemove', '[ontouchend]', function(ev){\n\t\t\tif(!Touch.inAction)\n\t\t\t\treturn;\n\n\t\t\tif(Math.abs(ev.clientX - Touch.startPos[0]) < 15 && Math.abs(ev.clientY - Touch.startPos[1]) < 15)\n\t\t\t\treturn;\n\n\t\t\tTouch.cancelNext = true;\n\t\t\t\$('.entryTouch').removeClass('entryTouch');\n\t\t\t\n\t\t\t//\$(ev.target).trigger('touchend');\n\t\t});\n\t");
 }
コード例 #7
0
ファイル: Session.class.php プロジェクト: nemiah/fheME
 public function getDBData($newFolder = null)
 {
     $external = false;
     if (file_exists(Util::getRootPath() . "../../phynxConfig")) {
         $newFolder = Util::getRootPath() . "../../phynxConfig/";
         $external = true;
     }
     if (file_exists(Util::getRootPath() . "../phynxConfig")) {
         $newFolder = Util::getRootPath() . "../phynxConfig/";
         $external = true;
     }
     if ($newFolder == null) {
         $newFolder = Util::getRootPath() . "system/DBData/";
     }
     $findFor = "*";
     if (isset($_SERVER["HTTP_HOST"])) {
         $findFor = $_SERVER["HTTP_HOST"];
     }
     $data = new mInstallation();
     if ($newFolder != "") {
         $data->changeFolder($newFolder);
     }
     $data->setAssocV3("httpHost", "=", $findFor);
     #$data->loadCollectionV2();
     $n = $data->getNextEntry();
     if ($n == null) {
         #$data = new mInstallation();
         #if($newFolder != "") $data->changeFolder($newFolder);
         $data = new mInstallation();
         if ($newFolder != "") {
             $data->changeFolder($newFolder);
         }
         $data->setAssocV3("httpHost", "=", "*");
         $n = $data->getNextEntry();
     }
     if ($n != null) {
         $n->changeFolder($newFolder);
         $d = $n->getA();
     } else {
         if (!isset($_SERVER["HTTP_CLOUD"])) {
             $I = new Installation(-1);
             $I->changeFolder($newFolder);
             $I->makeNewInstallation();
             $d = $I->getA();
         }
     }
     $I2 = new Installation(-1);
     $s = PMReflector::getAttributesArray($I2->newAttributes());
     $t = array();
     if (isset($d)) {
         foreach ($s as $key => $value) {
             $t[$value] = $d->{$value};
         }
     }
     $t["external"] = $external;
     $rt = Environment::getS("databaseData", $t);
     return $rt;
 }
コード例 #8
0
ファイル: Applications.class.php プロジェクト: nemiah/poolPi
 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]);
             }
         }
     }
 }
コード例 #9
0
ファイル: CalculatorGUI.class.php プロジェクト: nemiah/poolPi
 public function calculate($formula)
 {
     require_once Util::getRootPath() . 'libraries/math-parser/lib/PHPMathParser/Math.php';
     $math = new PHPMathParser\Math();
     try {
         $answer = $math->evaluate($formula);
     } catch (Exception $e) {
         die("##");
     }
     echo Util::CLNumberParserZ($answer);
 }
コード例 #10
0
ファイル: websocket.php プロジェクト: nemiah/fheME
 public static function alienClassLoader($class)
 {
     $ex = explode("\\", $class);
     #if($ex[0] == "figo"){
     $file = Util::getRootPath() . "plugins/Websocket/WAMP/" . implode("/", $ex) . ".php";
     if (!file_exists($file)) {
         return false;
     }
     require_once $file;
     #}
 }
コード例 #11
0
ファイル: Phynx.class.php プロジェクト: nemiah/poolPi
 public static function build()
 {
     if (!file_exists(Util::getRootPath() . "system/build.xml")) {
         return false;
     }
     try {
         $xml = new SimpleXMLElement(file_get_contents(Util::getRootPath() . "system/build.xml"));
         return $xml->build->prefix . "-" . $xml->build->number;
     } catch (Exception $e) {
         return false;
     }
 }
コード例 #12
0
 function classes()
 {
     #registerClassPath("Seminar", Util::getRootPath()."MMDB/Seminare/Seminar.class.php");
     #registerClassPath("SeminarGUI", Util::getRootPath()."MMDB/Seminare/SeminarGUI.class.php");
     #registerClassPath("STeilnehmer", Util::getRootPath()."MMDB/Seminare/STeilnehmer.class.php");
     registerClassPath("Bestellung", Util::getRootPath() . "ubiquitous/Bestellungen/Bestellung.class.php");
     addClassPath(Util::getRootPath() . "MMDB/Seminare/");
     addClassPath(Util::getRootPath() . "open3A/Adressen/");
     addClassPath(Util::getRootPath() . "open3A/Kunden/");
     addClassPath(Util::getRootPath() . "open3A/Auftraege/");
     addClassPath(Util::getRootPath() . "open3A/Stammdaten/");
     addClassPath(Util::getRootPath() . "open3A/Textbausteine/");
     addClassPath(Util::getRootPath() . "open3A/Kategorien/");
     addClassPath(Util::getRootPath() . "open3A/Brief/");
 }
コード例 #13
0
 public function getDBData($newFolder = null)
 {
     if ($newFolder == null) {
         $newFolder = Util::getRootPath() . "system/DBData/";
     }
     if (!isset($_SERVER["HTTP_HOST"])) {
         $_SERVER["HTTP_HOST"] = "*";
     }
     $data = new mInstallation();
     if ($newFolder != "") {
         $data->changeFolder($newFolder);
     }
     $data->setAssocV3("httpHost", "=", $_SERVER["HTTP_HOST"]);
     #$data->loadCollectionV2();
     $n = $data->getNextEntry();
     if ($n == null) {
         #$data = new mInstallation();
         #if($newFolder != "") $data->changeFolder($newFolder);
         $data = new mInstallation();
         if ($newFolder != "") {
             $data->changeFolder($newFolder);
         }
         $data->setAssocV3("httpHost", "=", "*");
         $n = $data->getNextEntry();
     }
     if ($n != null) {
         $n->changeFolder($newFolder);
         $d = $n->getA();
     } else {
         $I = new Installation(-1);
         $I->changeFolder($newFolder);
         $I->makeNewInstallation();
         $d = $I->getA();
     }
     $I2 = new Installation(-1);
     $s = PMReflector::getAttributesArray($I2->newAttributes());
     $t = array();
     foreach ($s as $key => $value) {
         $t[$value] = $d->{$value};
     }
     $rt = Environment::getS("databaseData", $t);
     return $rt;
 }
コード例 #14
0
 function saveMe($checkUserData = true, $output = false)
 {
     if ($this->A("ContentImage") != "") {
         $path = Util::getRootPath() . "specifics/" . $this->A("ContentImage");
         $image = new Imagick($path);
         $imageSmall = Util::getRootPath() . "specifics/" . str_replace(basename($this->A("ContentImage")), "small/" . basename($this->A("ContentImage")), $this->A("ContentImage"));
         $imageBig = Util::getRootPath() . "specifics/" . str_replace(basename($this->A("ContentImage")), "big/" . basename($this->A("ContentImage")), $this->A("ContentImage"));
         $image->resizeImage(0, 550, Imagick::FILTER_LANCZOS, 1);
         if (!$image->writeImage($imageBig)) {
             Red::alertD("Das große Vorschaubild kann nicht erstellt werden!");
         }
         $image->resizeImage(150, 0, Imagick::FILTER_LANCZOS, 1);
         if (!$image->writeImage($imageSmall)) {
             Red::alertD("Das kleine Vorschaubild kann nicht erstellt werden!");
         }
         $image->destroy();
     }
     parent::saveMe($checkUserData, $output);
 }
コード例 #15
0
 function getCMSHTML()
 {
     if (!isset($_SERVER['PHP_AUTH_USER']) or $_SERVER['PHP_AUTH_USER'] == "") {
         header('WWW-Authenticate: Basic realm="Ticket POS"');
         header('HTTP/1.0 401 Unauthorized');
         die("Authentifikation fehlgeschlagen");
     }
     $EC = new ExtConn(Util::getRootPath());
     if (!$EC->login($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])) {
         header('WWW-Authenticate: Basic realm="Ticket POS"');
         header('HTTP/1.0 401 Unauthorized');
         die("Authentifikation fehlgeschlagen");
     }
     $html = "<div style=\"width:200px;float:right;\">Angemeldet als<br /><b>" . Session::currentUser()->A("name") . "</b></div>";
     $html .= "<h1>Ticket POS</h1>";
     $AC = anyC::get("Seminar");
     $AC->addAssocV3("SeminarVon", ">=", time() - 3600 * 48);
     $Events = array();
     while ($S = $AC->getNextEntry()) {
         $Events[$S->getID()] = $S->A("SeminarName") . ", " . Util::CLFormatDate($S->A("SeminarVon"), true);
     }
     $I = new HTMLInput("currentEvent", "select", null, $Events);
     $I->style("font-size:20px;width:45%;");
     $html .= "<div style=\"margin-bottom:45px;\">{$I}</div>";
     $TS = new CCTicketShop();
     /*$count = array();
     		for($i = 0; $i < 21; $i++)
     			$count[$i] = $i;
     		
     		$I = new HTMLInput("ticketCount", "select", null, $count);
     		$I->style("width:100%;font-size:20px;");
     		
     		$IC = new Button("Weiter", "");
     		$IC->onclick("CustomerPage.rme('handleTicketSale', [$('select[name=currentEvent]').val(), $('select[name=ticketCount]').val()], function(){  })");
     		$IC->className("submitFormButton");*/
     $html .= "\n\t\t<div style=\"float:right;width:45%;\">\n\t\t\t<h2 style=\"margin-bottom:10px;\">Ticketverkauf</h2>\n\t\t\t" . $TS->getCMSHTML(false) . "\n\t\t\t<!--<div style=\"border:1px dashed grey;padding:10px;margin-top:10px;\">\n\t\t\t\tAnzahl der Tickets:\n\t\t\t\t{$I}{$IC}\n\t\t\t\t<div style=\"clear:both;\"></div>\n\t\t\t</div>-->\n\t\t</div>";
     $I = new HTMLInput("ticketCheck");
     $I->style("width:98%;font-size:20px;");
     $I->onEnter("CustomerPage.rme('handleTicketCheck', [\$('select[name=currentEvent]').val(), \$(this).val()], function(transport){ \$('#ticketValidInfo').html(transport); })");
     $html .= "\n\t\t<div style=\"width:45%;\">\n\t\t\t<h2 style=\"margin-bottom:10px;\">Einlass</h2>\n\t\t\t<div style=\"border:1px dashed #BBBBBB;padding:10px;\">\n\t\t\t\tTicket-Nummer:\n\t\t\t\t{$I}\n\t\t\t\t<div id=\"ticketValidInfo\" style=\"font-size:20px;margin-top:20px;\">\n\t\t\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>";
     return $html;
 }
コード例 #16
0
 function __construct($orientation = 'P', $unit = 'mm', $format = 'A4', $copy = false)
 {
     if (file_exists(Util::getRootPath() . "ubiquitous/Fonts/")) {
         # AND !defined("FPDF_FONTPATH")) {
         #define('FPDF_FONTPATH', Util::getRootPath()."ubiquitous/Fonts/");
         $this->AddFont("Ubuntu", "", "5e01bde68449bff64cefe374f81b7847_ubuntu-regular.php");
         $this->AddFont("Ubuntu", "B", "70fed3593f0725ddea7da8f1c62577c1_ubuntu-bold.php");
         $this->AddFont("Ubuntu", "I", "cfa4d284ee1dc737cb0fe903fbab1844_ubuntu-italic.php");
         $this->AddFont("Ubuntu", "BI", "c409dbcbee5b5ac6bf7b101817c7416a_ubuntu-bolditalic.php");
         $this->AddFont("Orbitron", "", "667a54623e1b9927fdf078125bbbf49b_orbitron-regular.php");
         $this->AddFont("Orbitron", "B", "c4c6025fc06df62e82ebf42b2709e6ae_orbitron-bold.php");
         $this->AddFont("Orbitron", "I", "c4c6025fc06df62e82ebf42b2709e6ae_orbitron-fakeItalic.php");
         $this->AddFont("Orbitron", "BI", "c4c6025fc06df62e82ebf42b2709e6ae_orbitron-fakeBoldItalic.php");
         $this->AddFont("Raleway", "", "ed7ad2408e498cae8fab623a755883f6_raleway-thin.php");
         $this->AddFont("Raleway", "B", "ed7ad2408e498cae8fab623a755883f6_raleway-thin-fakeBold.php");
         $this->AddFont("Raleway", "I", "ed7ad2408e498cae8fab623a755883f6_raleway-thin-fakeItalic.php");
         $this->AddFont("Raleway", "BI", "ed7ad2408e498cae8fab623a755883f6_raleway-thin-fakeBoldItalic.php");
     }
     parent::__construct($orientation, $unit, $format, $copy);
 }
コード例 #17
0
ファイル: FPDF.class.php プロジェクト: nemiah/poolPi
 protected function _getfontpath($file = null)
 {
     if (file_exists(Util::getRootPath() . "specifics/{$file}")) {
         return Util::getRootPath() . "specifics/{$file}";
     }
     if (file_exists(FileStorage::getFilesDir() . $file)) {
         return FileStorage::getFilesDir() . $file;
     }
     if (file_exists(Util::getRootPath() . "ubiquitous/Fonts/{$file}")) {
         return Util::getRootPath() . "ubiquitous/Fonts/{$file}";
     }
     if (file_exists(dirname(__FILE__) . '/font/' . $file)) {
         return dirname(__FILE__) . '/font/' . $file;
     }
     #if (!defined('FPDF_FONTPATH') && is_dir(dirname(__FILE__) . '/font'))
     #	define('FPDF_FONTPATH', dirname(__FILE__) . '/font/');
     #return defined('FPDF_FONTPATH') ? FPDF_FONTPATH : '';
 }
コード例 #18
0
 public function getActions()
 {
     $DBFilePath = Util::getRootPath() . "system/DBData/Installation.pfdb.php";
     $File = new File($DBFilePath);
     $File->loadMe();
     $ASetup = "contentManager.loadPlugin('contentRight', 'mInstallation');";
     $B = new Button("Erneut prüfen", "./plugins/Installation/recheck.png", "icon");
     $B->onclick($ASetup);
     $B->id("recheckButton");
     $hasDBConnection = false;
     try {
         $Version = mUserdata::getGlobalSettingValue("DBVersion", false);
         $hasDBConnection = true;
     } catch (Exception $e) {
     }
     if (!$File->A("FileIsWritable") and !$hasDBConnection) {
         $message = "<p style=\"padding:20px;font-size:20px;color:#555;text-align:center;\">" . $_SESSION["applications"]->getActiveApplication() . " ist auf diesem Server noch nicht installiert.</p>";
         $html = "<div style=\"width:600px;margin:auto;line-height:1.5;\">\n\t\t\t\t<p>\n\t\t\t\t<img src=\"./images/navi/restrictions.png\" style=\"float:left;margin-right:10px;\"/>\n\t\t\t\tDie Datei <code>/system/DBData/Installation.pfdb.php</code> ist <b>nicht beschreibbar</b>.</p>\n\t\t\t\t\n\t\t\t\t<p style=\"margin-top:20px;\">Machen Sie die Datei mit einem FTP-Programm beschreibbar.<br />\n\t\t\t\tKlicken Sie dazu mit der rechten Maustaste auf die Datei auf dem Server, wählen Sie <b>\"Eigenschaften\"</b>, und geben Sie den Modus <b>666</b> an, damit sie durch den Besitzer, die Gruppe und alle Anderen les- und beschreibbar ist.</p>\n\t\t\t\t<div style=\"width:350px;margin:auto;padding-top:20px;padding-bottom:20px;\">\n\t\t\t\t" . $this->box($B, $ASetup, "Erneut<br />prüfen") . "\n\t\t\t\t</div>\n\t\t\t</div>";
         die($message . $html);
     }
     $containers = 0;
     $message = "";
     $html = "";
     $hidden = "<a class=\"hiddenLink\" href=\"#\" onclick=\"" . OnEvent::popup("Fehlerausgabe", "mInstallation", "-1", "updateAllTables", array("'1'")) . "return false;\">&nbsp;</a>";
     try {
         $Version = mUserdata::getGlobalSettingValue("DBVersion", false);
         if ($Version !== false and $Version == Phynx::build()) {
             $message = "<p style=\"padding:20px;font-size:20px;color:#555;text-align:center;\">Ihre Datenbank ist auf dem aktuellen Stand.{$hidden}</p>";
         }
         if ($Version === false or $Version != Phynx::build()) {
             $message = "<p style=\"padding:10px;font-size:20px;color:#555;margin-bottom:40px;text-align:center;\">Ihre Datenbank muss aktualisiert werden.</p>";
             $ASetup = "\$j('#updateButton').attr('src', './plugins/Installation/bigLoader.png'); " . OnEvent::rme($this, "updateAllTables", "", "function(transport){ contentManager.contentBelow(transport.responseText); }");
             $B = new Button("Datenbank aktualisieren", "./plugins/Installation/aktualisieren.png", "icon");
             $B->onclick($ASetup);
             $B->id("updateButton");
             $html = $this->box($B, $ASetup, "Die Datenbank<br />aktualisieren", "", $hidden);
             $html = "<div style=\"width:350px;margin:auto;padding-bottom:40px;\">" . $html . "</div>";
         }
     } catch (NoDBUserDataException $e) {
         $message = "<p style=\"padding:10px;font-size:20px;color:#555;text-align:center;color:red;\">Mit den angegebenen Datenbank-Zugangsdaten kann keine Verbindung aufgebaut werden.</p>";
         echo OnEvent::script("contentManager.loadFrame('contentLeft','Installation','1');");
         if (PHYNX_MAIN_STORAGE == "MySQL") {
             try {
                 $DB1 = new DBStorageU();
                 $BN = new Button("Hinweis", "notice", "icon");
                 $BN->style("float:left;margin-right:10px;");
                 $File = new File(Util::getRootPath() . "system/connect.php");
                 $B = new Button("Verbindungsart umstellen", "./plugins/Installation/changedb.png", "icon");
                 $B->onclick($A);
                 $B->id("changedbButton");
                 $A = OnEvent::rme($this, "switchDBToMySQLo", "", "function(){ Installation.reloadApp(); }");
                 $BR = "<p style=\"margin-top:20px;\">Verwenden Sie den Knopf unten, um die Verbindungsart auf die ältere Version umzustellen.<br />\n\t\t\t\t\t\tSie müssen sich anschließend erneut anmelden.</p>\n\t\t\t\t\t\t<div style=\"width:350px;margin:auto;padding-top:20px;padding-bottom:20px;\">" . $this->box($B, $A, "Verbindungsart<br />umstellen") . "</div>";
                 $A = "contentManager.loadPlugin('contentRight', 'mInstallation');";
                 $B = new Button("Erneut prüfen", "./plugins/Installation/recheck.png", "icon");
                 $B->onclick($A);
                 $B->id("recheckButton");
                 if (!$File->A("FileIsWritable")) {
                     $BR = "<p style=\"margin-top:20px;\">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.\n\t\t\t\t\t\t\t</p><div style=\"width:350px;margin:auto;padding-top:20px;padding-bottom:20px;\">" . $this->box($B, $A, "Erneut<br />prüfen") . "</div>";
                 }
                 $html = "<p style=\"margin-top:30px;\">{$BN} Möglicherweise ist die MySQLi-Erweiterung auf Ihrem Server nicht korrekt konfiguriert.</p>{$BR}";
                 $html = "<div style=\"width:700px;margin:auto;padding-bottom:40px;\">" . $html . "</div>";
             } catch (Exception $e) {
                 #echo "MySQL geht auch nicht!";
             }
         }
     } catch (DatabaseNotFoundException $e) {
         $message = "<p style=\"padding:10px;font-size:20px;color:#555;text-align:center;color:red;\">Die angegebene Datenbank konnte nicht gefunden werden.</p>";
         echo OnEvent::script("contentManager.loadFrame('contentLeft','Installation','1');");
     } catch (TableDoesNotExistException $e) {
         $message = "<p style=\"padding:10px;font-size:20px;color:#555;margin-bottom:40px;text-align:center;\">Ihre Datenbank hat derzeit noch keinen Inhalt.</p>";
         $ASetup = "\$j('#setupButton').attr('src', './plugins/Installation/bigLoader.png'); " . OnEvent::rme($this, "setupAllTables", "", "function(transport){ contentManager.contentBelow(transport.responseText); }");
         $BSetup = new Button("Datenbank einrichten", "./plugins/Installation/setup.png", "icon");
         $BSetup->onclick($ASetup);
         $BSetup->id("setupButton");
         $hidden = "<a class=\"hiddenLink\" href=\"#\" onclick=\"" . OnEvent::popup("Fehlerausgabe", "mInstallation", "-1", "setupAllTables", array("'1'")) . "return false;\">&nbsp;</a>";
         $html = $this->box($BSetup, $ASetup, "Die Datenbank<br />einrichten", "", $hidden);
         $containers = 1;
         $BM = new BackupManagerGUI();
         $list = $BM->getBackupsList();
         $ARestore = OnEvent::popup("Backup-Manager", "BackupManager", "-1", "inPopup");
         $BRestore = new Button("Datenbank wiederherstellen", "./plugins/Installation/restore.png", "icon");
         $BRestore->onclick($ARestore);
         $BRestore->id("setupButton");
         $html .= $this->box($BRestore, $ARestore, "Eine Sicherung<br />wiederherstellen", count($list) == 0 ? "color:grey;" : "");
         $containers++;
         $html = "<div style=\"width:" . $containers * 360 . "px;margin:auto;padding-bottom:40px;\">" . $html . "</div>";
     }
     echo "{$message}{$html}";
 }
コード例 #19
0
ファイル: Environment.class.php プロジェクト: nemiah/poolPi
 public static function load($forceReload = false)
 {
     if (Environment::$currentEnvironment != null and !$forceReload) {
         return;
     }
     if (file_exists(Util::getRootPath() . "plugins/Cloud/Cloud.class.php")) {
         //!defined("PHYNX_VIA_INTERFACE") removed because of ZPush/lightCRM 03.07.2013
         require_once Util::getRootPath() . "plugins/Cloud/Cloud.class.php";
         require_once Util::getRootPath() . "plugins/Cloud/mCloud.class.php";
         require_once Util::getRootPath() . "plugins/Cloud/CloudStorage.class.php";
         Environment::$currentEnvironment = mCloud::getEnvironment();
         return;
     }
     $h = "Environment" . str_replace(array(":", "-"), "_", implode("", array_map("ucfirst", explode(".", isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : "NonExistentABCDEF"))));
     if (defined("PHYNX_VIA_INTERFACE")) {
         if (file_exists(Util::getRootPath() . "specifics/{$h}.class.php")) {
             require_once Util::getRootPath() . "specifics/{$h}.class.php";
             Environment::$currentEnvironment = new $h();
         } else {
             Environment::$currentEnvironment = new Environment();
         }
         return;
     }
     try {
         try {
             Environment::$currentEnvironment = new $h();
         } catch (ClassNotFoundException $e) {
             Environment::$currentEnvironment = new EnvironmentCurrent();
         }
     } catch (ClassNotFoundException $e) {
         Environment::$currentEnvironment = new Environment();
     }
 }
コード例 #20
0
ファイル: AppPlugins.class.php プロジェクト: nemiah/trinityDB
 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 = Environment::getS("allowedPlugins", array());
     $extraPlugins = Environment::getS("pluginsExtra", array());
     if (Applications::activeApplication() == "Zeus" or Applications::activeApplication() == "nil") {
         $extraPlugins = array();
     }
     $allowedPlugins = array_merge($allowedPlugins, $extraPlugins);
     #$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();
             $this->blockNonAdmin[$c->registerClassName()] = $c->registerBlockNonAdmin();
             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") {
                 $fld = $c->registerFolder();
                 if (!is_array($fld)) {
                     $fld = array($fld);
                 }
                 foreach ($fld as $folderName) {
                     $path = "./{$folder}/{$folderName}/" . $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");
     }
 }
コード例 #21
0
ファイル: index.php プロジェクト: nemiah/fheME
$E = new Environment();
*/
$cssColorsDir = Environment::getS("cssColorsDir", isset($_COOKIE["phynx_color"]) ? $_COOKIE["phynx_color"] : "standard");
$cssCustomFiles = Environment::getS("cssCustomFiles", null);
/*
if(file_exists(Util::getRootPath()."plugins/Cloud/Cloud.class.php")){
	require_once Util::getRootPath()."plugins/Cloud/Cloud.class.php";
	require_once Util::getRootPath()."plugins/Cloud/mCloud.class.php";

	$E = mCloud::getEnvironment();
}*/
$build = rand(1, 9999999);
if (Phynx::build()) {
    #$xml = new SimpleXMLElement(file_get_contents(Util::getRootPath()."system/build.xml"));
    if (isset($_COOKIE["phynx_lastSeenBuild"]) and $_COOKIE["phynx_lastSeenBuild"] != Phynx::build()) {
        $isCloud = file_exists(Util::getRootPath() . "plugins/Cloud/Cloud.class.php");
        header("Cache-Control: no-cache, must-revalidate");
        header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
        setcookie("phynx_lastSeenBuild", Phynx::build(), time() + 3600 * 24 * 365);
        //header("location: ".  basename(__FILE__));
        $button = "\n\t\t\t<div\n\t\t\t\tonclick=\"document.location.reload(true);\"\n\t\t\t\tonmouseover=\"this.style.backgroundColor = '#d7eac5';\"\n\t\t\t\tonmouseout=\"this.style.backgroundColor = 'transparent';\"\n\t\t\t\tstyle=\"width:120px;padding:10px;border:1px solid green;border-radius:5px;box-shadow:2px 2px 4px grey;margin-top:20px;cursor:pointer;font-weight:bold;\">\n\t\t\t\t\n\t\t\t\t<img src=\"./images/navi/navigation.png\" style=\"float:left;margin-top:-8px;margin-right:10px;\" />Weiter\n\t\t\t</div>";
        emoFatalError(T::_("Diese Anwendung wurde aktualisiert"), "Der Administrator dieser Anwendung hat seit Ihrem letzten Besuch eine Aktualisierung eingespielt.</p>\n\t\t\t" . (!$isCloud ? "<p style=\"margin-left:80px;\">Bitte entscheiden Sie sich nun für eine der beiden Möglichkeiten,<br />abhängig davon, ob Sie diese Anwendung eingerichtet haben, oder eine andere Person:</p>" : "") . "\n\t\t\t<div style=\"width:800px;\">\n\t\t\t\t" . (!$isCloud ? "<div style=\"width:350px;float:right;\">\n\t\t\t\t\t<h2>Administrator</h2>\n\t\t\t\t\t<p>Wenn Sie diese Anwendung eingerichtet haben und das Admin-Passwort kennen, gehen Sie wie folgt vor, um die Aktualisierung abzuschließen:</p><ol><li>Melden Sie sich mit dem <strong>Admin-Benutzer</strong> am System an.</li><li>Aktualisieren Sie im <strong>Installation-Plugin</strong> die Tabellen mit dem Knopf <strong>\"alle Tabellen aktualisieren\"</strong>.</li><ol>\n\t\t\t\t\t{$button}\n\t\t\t\t</div>" : "") . "\n\t\t\t\t<div style=\"width:350px;\">\n\t\t\t\t\t<h2 style=\"clear:none;\">Benutzer</h2>\n\t\t\t\t\t<p>Wenn Sie ein Benutzer dieser Anwendung sind und sie nicht selbst eingerichtet haben, initialisiert sich das System nach einem Klick auf den nachfolgenden Knopf neu und Sie können normal weiterarbeiten.</p>\n\t\t\t\t\t{$button}\n\t\t\t\t</div>\n\t\t\t<div style=\"clear:both;\"></div>\n\t\t\t</div>", T::_("Diese Anwendung wurde aktualisiert"), false, "ok");
    } elseif (!isset($_COOKIE["phynx_lastSeenBuild"])) {
        setcookie("phynx_lastSeenBuild", Phynx::build(), time() + 3600 * 24 * 365);
    }
    $build = Phynx::build();
}
$validUntil = Environment::getS("validUntil", null);
if ($_SESSION["S"]->checkIfUserLoggedIn() == false) {
    $_SESSION["CurrentAppPlugins"]->scanPlugins();
}
コード例 #22
0
 public function updateAllTables()
 {
     $apps = Applications::getList();
     $apps["plugins"] = "plugins";
     #$apps["plugins"] = "ubiquitous";
     $currentPlugins = $_SESSION["CurrentAppPlugins"];
     $return = array();
     foreach ($apps as $app) {
         $AP = $_SESSION["CurrentAppPlugins"] = new AppPlugins($app);
         $AP->scanPlugins("plugins");
         $p = array_flip($AP->getAllPlugins());
         #Applications::i()->setActiveApplication($app); //or the autoloader won't work; yes, it does because of addClassPath later on
         foreach ($p as $key => $value) {
             if ($key == "CIs") {
                 continue;
             }
             if ($key == "mInstallation") {
                 continue;
             }
             $return[$value] = "Keine Collection-Klasse!";
             addClassPath(Util::getRootPath() . $app . "/" . $AP->getFolderOfPlugin($key) . "/");
             try {
                 $c = new $key();
             } catch (ClassNotFoundException $e) {
                 $key2 = $key . "GUI";
                 try {
                     $c = new $key2();
                 } catch (ClassNotFoundException $e2) {
                     continue;
                 }
             }
             if (!$c->checkIfMyDBFileExists()) {
                 $return[$value] = "Keine DB-Datei!";
             } else {
                 if ($c->checkIfMyTableExists()) {
                     $return[$value] = $c->checkMyTables(true);
                 } else {
                     #if(!$c->checkIfMyTableExists())
                     $return[$value] = $c->createMyTable(true);
                 }
             }
         }
     }
     mUserdata::setUserdataS("DBVersion", Phynx::build(), "", -1);
     $_SESSION["CurrentAppPlugins"] = $currentPlugins;
     return $return;
 }
コード例 #23
0
ファイル: Util.class.php プロジェクト: nemiah/fheME
 public static function getTempDir()
 {
     $dirtouse = Util::getRootPath() . "system/IECache/";
     if (!is_writable($dirtouse)) {
         $file = tempnam(":\n\\/?><", "");
         $dirtouse = dirname($file);
         unlink($file);
     } else {
         Util::clearIECache($dirtouse);
     }
     $subdir = (isset($_SESSION["S"]) and $_SESSION["S"]->getCurrentUser() != null) ? $_SESSION["S"]->getCurrentUser()->getID() : "info";
     $CH = Util::getCloudHost();
     if ($CH !== null and get_class($CH) != "CloudHostAny") {
         $dirtouse = "/tmp";
         Environment::load();
         $subdir = Environment::$currentEnvironment->cloudUser() . "/{$subdir}";
     }
     $dirtouse .= ($dirtouse[strlen($dirtouse) - 1] != "/" ? "/" : "") . $subdir . "/";
     if (!is_dir($dirtouse)) {
         #echo "create $dirtouse...\n";
         if (!mkdir($dirtouse, 0777, true)) {
             throw new Exception("Could not create temp dir " . $dirtouse);
         }
         chmod($dirtouse . "../", 0777);
         chmod($dirtouse, 0777);
     } else {
         chmod($dirtouse . "../", 0777);
         chmod($dirtouse, 0777);
     }
     if (!is_dir($dirtouse)) {
         throw new Exception("Did not create temp dir {$dirtouse}");
     }
     #echo gethostname().":";
     #var_dump(is_dir($dirtouse));
     #print_r($dirtouse);
     #die();
     if (PHYNX_USE_TEMP_HTACCESS and strpos($dirtouse, Util::getRootPath()) !== false and is_writable($dirtouse)) {
         $content = "<IfModule mod_authz_core.c>\n    Require ip " . $_SERVER["REMOTE_ADDR"] . "\n</IfModule>";
         if (strstr($_SERVER["REMOTE_ADDR"], ".")) {
             //USE ONLY WHEN ON IPV4 due to APACHE BUG https://issues.apache.org/bugzilla/show_bug.cgi?id=49737
             $content .= "\n<IfModule !mod_authz_core.c>\n\tallow from " . $_SERVER["REMOTE_ADDR"] . "\n\tdeny from all\n\tallow from " . $_SERVER["REMOTE_ADDR"] . "\n</IfModule>";
         }
         file_put_contents($dirtouse . ".htaccess", $content);
     } elseif (file_exists($dirtouse . ".htaccess")) {
         unlink($dirtouse . ".htaccess");
     }
     if (!PHYNX_USE_TEMP_HTACCESS and file_exists($dirtouse . ".htaccess")) {
         unlink($dirtouse . ".htaccess");
     }
     return $dirtouse;
 }
コード例 #24
0
 public static function getFilesDir()
 {
     $CH = Util::getCloudHost();
     if ($CH != null) {
         Environment::load();
         $dir = $CH->scientiaDir . "/" . strtolower(Environment::$currentEnvironment->cloudUser()) . "/specifics/";
         if (!file_exists($dir)) {
             #mkdir($CH->scientiaDir."/".strtolower(Environment::$currentEnvironment->cloudUser())."/");
             mkdir($CH->scientiaDir . "/" . strtolower(Environment::$currentEnvironment->cloudUser()) . "/specifics/", 0777, true);
         }
         return $dir;
     }
     return realpath(Util::getRootPath() . "specifics") . "/";
 }
コード例 #25
0
ファイル: HTMLGUIX.class.php プロジェクト: nemiah/fheME
 function getBrowserHTML($lineWithId = -1, $useBPS = true)
 {
     T::load(Util::getRootPath() . "libraries");
     $canDelete = mUserdata::isDisallowedTo("cantDelete" . $this->className);
     #$canEdit = mUserdata::isDisallowedTo("cantEdit".$this->className);
     if (!$canDelete) {
         $this->showTrash = false;
     }
     #if(!$canEdit) //KILLS SEARCH-FIELD!!
     #	$this->showEdit = false;
     $bps = BPS::getAllProperties("m" . $this->className . "GUI");
     if (!$useBPS) {
         $bps = false;
     }
     $GUIF = $this->GUIFactory;
     $GUIF->setMultiPageDetails($this->multiPageDetails);
     $GUIF->setTableMode($this->displayMode);
     $GUIF->options($this->showTrash, $this->showEdit, $this->showNew);
     if ($this->blacklists != null) {
         $GUIF->blacklists($this->blacklists);
     }
     if (isset($bps["selectionMode"])) {
         $GUIF->selection($bps["selectionMode"]);
     }
     #$GUIF->features($this->features);
     #$this->multiPageDetails["target"] = $this->frame;#"contentRight";
     #$GUIF->setMultiPageDetails($this->multiPageDetails);
     if ($this->targetFrame != null) {
         $GUIF->targetFrame($this->targetFrame);
     }
     $E = $this->object->getNextEntry();
     if ($this->attributes == null and $E != null) {
         $this->attributes = PMReflector::getAttributesArrayAnyObject($E->getA());
     }
     #if($E == null) //To fix display error when no entry
     #	$this->attributes = array("");
     if ($this->caption == null and $this->caption !== false) {
         $this->caption($this->displayMode == "BrowserLeft" ? $this->name == null ? $this->className : $this->name : "");
     }
     #"Bitte ".($this->name == null ? $this->className : $this->name)." auswählen:");
     $Tab = $GUIF->getTable($E == null ? array("") : $this->attributes, $this->colStyle, $this->caption);
     if ($this->tableWeight) {
         $Tab->weight($this->tableWeight);
     }
     $Tab->setTableID("Browserm{$this->className}");
     $Tab->addTableClass("contentBrowser");
     if ($this->useScreenHeight) {
         $Tab->useScreenHeight();
     }
     if ($this->header != null and $this->object->numLoaded() > 0) {
         $Tab->addHeaderRow($this->header);
     }
     if ($lineWithId == -1) {
         if ($this->showQuicksearch) {
             $GUIF->buildQuickSearchLine();
         }
         #if($this->multiPageDetails["total"] > $this->multiPageDetails["perPage"])
         if ($this->showPageFlip) {
             $GUIF->buildFlipPageLine("top");
         }
         if ($this->object->isFiltered()) {
             $GUIF->buildFilteredWarningLine($this->object->isFilteredLabel());
         }
         $GUIF->buildNewEntryLine(($this->name == null ? $this->className : $this->name) . " neu anlegen");
     }
     $this->object->resetPointer();
     $DisplayGroup = null;
     while ($E = $this->object->getNextEntry()) {
         /**
          * DisplayGroup
          */
         if ($lineWithId == -1 and $this->displayGroup != null and $DisplayGroup != $E->A($this->displayGroup[0])) {
             if ($this->displayGroup[1] != null) {
                 $DGP = explode("::", $this->displayGroup[1]);
                 $GUIF->buildGroupLine(Util::invokeStaticMethod($DGP[0], $DGP[1], array($E->A($this->displayGroup[0]), $E)));
             } else {
                 $GUIF->buildGroupLine($E->A($this->displayGroup[0]));
             }
         }
         $Line = array();
         foreach ($this->attributes as $attributeName) {
             $LineContent = $E->A($attributeName);
             if (isset($this->parsers[$attributeName])) {
                 $LineContent = $this->invokeParser($this->parsers[$attributeName], $LineContent, $E);
             } else {
                 $LineContent = htmlspecialchars($LineContent);
             }
             $Line[] = $LineContent;
         }
         $GUIF->buildLine($E->getID(), $Line);
         if ($this->displayGroup != null) {
             $DisplayGroup = $E->A($this->displayGroup[0]);
         }
     }
     if ($lineWithId == -1) {
         if ($this->object->isFiltered()) {
             $GUIF->buildFilteredWarningLine($this->object->isFilteredLabel());
         }
         if ($this->multiPageDetails["total"] > $this->multiPageDetails["perPage"] and $this->showPageFlip) {
             $GUIF->buildFlipPageLine("bottom");
         }
         if ($this->object->numLoaded() == 0) {
             $GUIF->buildNoEntriesLine();
         }
     } else {
         return $Tab->getHTMLForUpdate();
     }
     $prepend = "";
     foreach ($this->prepended as $PE) {
         $prepend .= $PE;
     }
     $appended = "";
     foreach ($this->appended as $PE) {
         $appended .= $PE;
     }
     return "<div class=\"browserContainer contentBrowser\">" . $prepend . $this->sideButtons($bps) . $GUIF->getContainer($Tab, $this->caption, $appended, $this->topButtons($bps)) . "</div>" . str_replace("%CLASSNAME", $this->className, $this->sortable) . $this->tip;
 }
コード例 #26
0
ファイル: cronjob.php プロジェクト: nemiah/fheME
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *  lightAd is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  2007 - 2016, Rainer Furtmeier - Rainer@Furtmeier.IT
 */
if (isset($argv[1])) {
    $_GET["cloud"] = $argv[1];
}
if (isset($argv[2])) {
    $_SERVER["HTTP_HOST"] = $argv[2];
}
session_name("ExtConnOWM");
require_once realpath(dirname(__FILE__) . "/../../system/connect.php");
$absolutePathToPhynx = Util::getRootPath();
$e = new ExtConn($absolutePathToPhynx);
$e->addClassPath($absolutePathToPhynx . "ubiquitous/OWM");
$e->addClassPath($absolutePathToPhynx . "specifics");
$e->addClassPath(FileStorage::getFilesDir());
$e->useDefaultMySQLData();
$e->useUser();
#echo "<pre>";
mOpenWeatherMap::update();
$e->cleanUp();
#echo "</pre>";
コード例 #27
0
ファイル: ExtConn.class.php プロジェクト: nemiah/trinityDB
 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");
     }
     if (!file_exists(Util::getRootPath() . "{$app}/{$folder}/plugin.xml")) {
         return false;
     }
     $xml = new XMLPlugin(Util::getRootPath() . "{$app}/{$folder}/plugin.xml");
     require_once Util::getRootPath() . "{$app}/{$folder}/" . $xml->registerClassName() . ".class.php";
     $this->addClassPath(Util::getRootPath() . "{$app}/{$folder}");
     return true;
 }
コード例 #28
0
 function handleForm($valuesAssocArray)
 {
     $this->classes();
     switch ($valuesAssocArray["action"]) {
         case "register":
             $F = new Factory("Adresse");
             $F->sA("firma", $valuesAssocArray["firma"]);
             $F->sA("strasse", $valuesAssocArray["strasse"]);
             $F->sA("nr", $valuesAssocArray["nr"]);
             $F->sA("plz", $valuesAssocArray["plz"]);
             $F->sA("ort", $valuesAssocArray["ort"]);
             $F->sA("email", $valuesAssocArray["userEmail"]);
             //from email
             $F->sA("tel", $valuesAssocArray["tel"]);
             $AdresseID = $F->store(false, false);
             $K = new Kunden();
             $Kappendix = $K->createKundeToAdresse($AdresseID, false, true);
             $Kappendix->changeA("KappendixKontonummer", $valuesAssocArray["kontonummer"]);
             $Kappendix->changeA("KappendixBLZ", $valuesAssocArray["blz"]);
             $Kappendix->changeA("KappendixSameKontoinhaber", "1");
             $KappendixID = $Kappendix->newMe(false);
             $token = sha1($AdresseID . $KappendixID . microtime());
             $F = new Factory("PDFixUser");
             $F->sA("PDFixUserAdresseID", $AdresseID);
             $F->sA("PDFixUserKappendixID", $KappendixID);
             $F->sA("PDFixUserPDFixUserDBID", "0");
             $F->sA("PDFixUserIsActive", "0");
             $F->sA("PDFixUserVorNachname", $valuesAssocArray["userVorNachname"]);
             $F->sA("PDFixUserUsername", $valuesAssocArray["userUsername"]);
             $F->sA("PDFixUserPassword", $valuesAssocArray["userPassword"]);
             $F->sA("PDFixUserEmail", $valuesAssocArray["userEmail"]);
             $F->sA("PDFixUserRate", $valuesAssocArray["zahlungsweise"]);
             $F->sA("PDFixUserRegisteredDate", time());
             $F->sA("PDFixUserToken", $token);
             $F->store(false, false);
             $mail = new htmlMimeMail5();
             $mail->setFrom("*****@*****.**");
             $mail->setSubject(utf8_decode("PDFix Registrierung ihres Mitarbeiters " . $valuesAssocArray["userVorNachname"]));
             $mail->setText(utf8_decode("Sehr geehrte Damen und Herren,\n \nSie selbst oder Ihr Mitarbeiter/Ihre Mitarbeiterin \n" . $valuesAssocArray["userVorNachname"] . " hat sich soeben bei www.pdfix.de angemeldet. \n \nDer Account wurde angelegt.\n \nIm Anhang finden Sie unsere AGB und den Softwarelizenzvertrag.\nMit der Aktivierung des Accounts werden die AGB und Nutzungsbedingungen\nannerkannt.\n\nSobald die Abbuchungserklärung bei uns eingegangen ist,\nwird der Account innerhalb 24 Std. freigeschalten und\n\"pdfix\" kann dann genutzt werden.\n \nWenn Sie die Kosten übernehmen, dann klicken Sie auf\n\n\nnachstehenden Aktivierungslink.\n\nhttp://" . $_SERVER["HTTP_HOST"] . "" . str_replace("/ubiquitous/CustomerPage/index.php", "/ubiquitous/CustomerPage/?CC=RegistrationPDFix&activate={$token}", $_SERVER["SCRIPT_NAME"]) . "\n \n\nAnsonsten klären Sie bitte die Kostenübernahme mit Ihrem Mitarbeiter ab.\n\n \nMit freundlichen Grüßen\n \nM. Tischler\nGeschäftsführer\nETS-SÜD UG (haftungsbeschränkt)\nDR. Michael Samer Ring 2a\n86609 Donauwörth\nAG Augsburg\nHRB 26204\ninfo@pdfix.de"));
             /*
             Zum Download von pdfix besuchen Sie bitte
             http://www.meine-smn.de und klicken auf \"Login\"
             
             melden Sie sich an mit:
             
             Benutzername: ".$valuesAssocArray["userUsername"]."
             Passwort: ".$valuesAssocArray["userPassword"]."
             
             Bestätigen Sie jeweils am Ende der Seiten die AGB´s und Lizenzbedingungen und
             laden \"pdfix\" down.
             
             Sobald die Abbuchungserklärung bei uns eingegangen ist,
             wird der Account innerhalb 24 Std. freigeschalten,und
             \"pdfix\" kann dann genutzt werden.
             */
             #$mail->setTextCharset("UTF-8");
             #$mail->addAttachment(new fileAttachment(Util::getRootPath()."open3A/PDFix/abbuchungserkl.pdf", "application/pdf"));
             $mail->addAttachment(new fileAttachment(Util::getRootPath() . "../download/Agbs.pdf", "application/pdf"));
             $mail->addAttachment(new fileAttachment(Util::getRootPath() . "../download/Softwarelizenzvertrag.pdf", "application/pdf"));
             if (!$mail->send(array($valuesAssocArray["userEmail"]))) {
                 //from email
                 Red::errorD("Die E-Mail konnte nicht verschickt werden, bitte versuchen Sie es erneut!");
             }
             break;
         case "activate":
             $PU = anyC::getFirst("PDFixUser", "PDFixUserToken", $valuesAssocArray["token"]);
             $PU->changeA("PDFixUserActivatedDate", time());
             $PU->changeA("PDFixUserIsActive", "1");
             $PU->changeA("PDFixUserRate", $valuesAssocArray["zahlungsweise"]);
             $PU->saveMe();
             $mail = new htmlMimeMail5();
             $mail->setFrom("*****@*****.**");
             $mail->setSubject(utf8_decode("PDFix Registrierung ihres Mitarbeiters " . $valuesAssocArray["userVorNachname"]));
             $mail->setText(utf8_decode("Sehr geehrte Damen und Herren,\n \nIhr Account wurde soeben angelegt.\n \nBenutzername: " . $PU->A("PDFixUserUsername") . "\nPasswort: " . $PU->A("PDFixUserPassword") . "\n \nSobald die Abbuchungserklärung bei uns eingegangen ist,\nwird der Account innerhalb 24 Std. freigeschalten und\n\"pdfix\" kann dann genutzt werden.\n\t\n\nMit freundlichen Grüßen\n \nM. Tischler\nGeschäftsführer\nETS-SÜD UG (haftungsbeschränkt)\nDR. Michael Samer Ring 2a\n86609 Donauwörth\nAG Augsburg\nHRB 26204\ninfo@pdfix.de"));
             /*
             Zum Download von pdfix besuchen Sie bitte
             http://www.meine-smn.de und klicken auf \"Login\"
             
             melden Sie sich an mit:
             
             Bestätigen Sie jeweils am Ende der Seiten die AGB´s und Lizenzbedingungen und
             laden \"pdfix\" down.
             */
             #$mail->setTextCharset("UTF-8");
             if (!$mail->send(array($PU->A("PDFixUserEmail")))) {
                 Red::errorD("Die E-Mail konnte nicht verschickt werden, bitte versuchen Sie es erneut!");
             }
             $Adresse = new Adresse($PU->A("PDFixUserAdresseID"));
             $mail = new htmlMimeMail5();
             $mail->setFrom("*****@*****.**");
             $mail->setSubject("PDFix Aktivierung");
             $mail->setText(utf8_decode("\nFirma: " . $Adresse->A("firma") . "\nBenutzername: " . $PU->A("PDFixUserUsername") . ""));
             #$mail->setTextCharset("UTF-8");
             if (!$mail->send(array("*****@*****.**"))) {
                 Red::errorD("Die E-Mail konnte nicht verschickt werden, bitte versuchen Sie es erneut!");
             }
             break;
     }
 }
コード例 #29
0
ファイル: JD.class.php プロジェクト: nemiah/trinityDB
 public function download($link, $logLink = null, $logFilename = "", Serie $Serie = null)
 {
     if (strpos($link, "linksafe.")) {
         $newLocation = get_headers($link, 1);
         $links = $newLocation["Location"];
         $link = null;
         if (is_array($links)) {
             foreach ($links as $k => $l) {
                 if (stripos($l, "https") === 0) {
                     $link = $links[$k];
                 }
             }
             if ($link == null) {
                 $link = $links[0];
             }
         } else {
             $link = $links;
         }
     }
     if (strpos($link, "safeurl.")) {
         $newLocation = get_headers($link, 1);
         if (isset($newLocation["Location"])) {
             $link = $newLocation["Location"][0];
         } else {
             $contentWithLink = file_get_contents($link);
             preg_match_all("/(https:\\/\\/rapidshare[a-zA-Z0-9\\.\\-\\/_#+\\|!]*)/", $contentWithLink, $links);
             $links = array_unique($links[1]);
             $link = $links[0];
             $ex = explode("|", $link);
             $ex[0] = str_replace("/#!download", "/files/", $ex[0]);
             $link = $ex[0] . $ex[2] . "/" . $ex[3];
         }
     }
     if (strpos($link, "canhaz.")) {
         $newLocation = get_headers($link, 1);
         $link = $newLocation["Location"];
         $contentWithLink = file_get_contents($link);
         preg_match_all("/(http:\\/\\/rapidshare[a-zA-Z0-9\\.\\-\\/_#+]*)/", $contentWithLink, $links);
         $links = array_unique($links[1]);
         $link = $links[0];
     }
     $linkOld = $link;
     if ($this->A("JDLinkParser") != "") {
         $C = $this->A("JDLinkParser");
         $C = new $C();
         $link = $C->parse($link, $this->A("JDLinkParserUser"), $this->A("JDLinkParserPassword"));
     }
     if ($this->A("JDDLType") == "4") {
         if ($logFilename == "") {
             $info = get_headers($link, 1);
             if ($info !== false) {
                 preg_match("/filename=\"(.*)\"/ismU", $info["Content-Disposition"], $matches);
                 if (isset($matches[1])) {
                     $logFilename = $matches[1];
                 }
             }
         }
         if ($logFilename == "") {
             $logFilename = basename($link);
         }
         $DL = anyC::getFirst("Incoming", "IncomingUseForDownloads", "1");
         $size = $this->filesize($link);
         if ($size < 10 * 1024 * 1024) {
             throw new Exception("File size too small");
         }
         $id = $this->logDownload($logLink, $linkOld, $logFilename, $size, $Serie, true);
         file_put_contents($this->A("JDWgetFilesDir") . "/{$id}.temp", "-o wgetDL_" . str_pad($id, 5, "0", STR_PAD_LEFT) . ".log -O " . rtrim($DL->A("IncomingDir"), "/") . "/" . str_replace(" ", ".", basename($logFilename)) . "." . Util::ext($link) . " {$link}");
         rename($this->A("JDWgetFilesDir") . "/{$id}.temp", $this->A("JDWgetFilesDir") . "/{$id}.dl");
         chmod($this->A("JDWgetFilesDir") . "/{$id}.dl", 0666);
         return true;
     }
     if ($this->A("JDDLType") == "0") {
         Util::PostToHost($this->A("JDHost"), $this->A("JDPort"), "/link_adder.tmpl", "none", "do=Add&addlinks=" . urlencode($link), $this->A("JDUser"), $this->A("JDPassword"));
     }
     if ($this->A("JDDLType") == "1") {
         $xml = Util::PostToHost($this->A("JDHost"), $this->A("JDPort"), "/cgi-bin/Qdownload/DS_Login.cgi", "none", "user="******"JDUser") . "&pwd=" . urlencode(base64_encode($this->A("JDPassword"))) . "&admin=1");
         $xml = new SimpleXMLElement(substr($xml, strpos($xml, "<?xml ")));
         $data = Util::PostToHost($this->A("JDHost"), $this->A("JDPort"), "/cgi-bin/Qdownload/DS_Task_Option.cgi", "none", "url=" . urlencode($link) . "&todo=add_rs&type=http_ftp&acc_id=1&user=&pwd=&sid=" . $xml->authSid . "&ver=2.0");
         $xml = new SimpleXMLElement(substr($data, strpos($data, "<?xml ")));
         if ($xml->Result . "" == "success") {
             $this->logDownload($logLink, $link, $logFilename, 0, $Serie);
         }
     }
     if ($this->A("JDDLType") == "2") {
         $content = file_get_contents("http://" . $this->A("JDHost") . ":" . $this->A("JDPort") . "/action/add/links/grabber0/start1/{$link}");
         if (strpos($content, "Link(s) added. (\"{$link}\"") !== false and $logLink != null) {
             $this->logDownload($logLink, $link, $logFilename, 0, $Serie);
         }
     }
     if ($this->A("JDDLType") == "3") {
         $GLOBALS['THRIFT_ROOT'] = Util::getRootPath() . "ubiquitous/Thrift";
         require_once $GLOBALS['THRIFT_ROOT'] . '/Thrift.php';
         require_once $GLOBALS['THRIFT_ROOT'] . '/transport/TTransport.php';
         require_once $GLOBALS['THRIFT_ROOT'] . '/transport/TSocket.php';
         require_once $GLOBALS['THRIFT_ROOT'] . '/protocol/TBinaryProtocol.php';
         require_once $GLOBALS['THRIFT_ROOT'] . '/transport/TFramedTransport.php';
         require_once $GLOBALS['THRIFT_ROOT'] . '/transport/TBufferedTransport.php';
         require_once $GLOBALS['THRIFT_ROOT'] . '/packages/pyload/Pyload.php';
         require_once $GLOBALS['THRIFT_ROOT'] . '/packages/pyload/pyload_types.php';
         $transport = new TSocket($this->A("JDHost"), $this->A("JDPort") * 1);
         $transport->open();
         $protocol = new TBinaryProtocol($transport);
         $client = new PyloadClient($protocol);
         $client->login($this->A("JDUser"), $this->A("JDPassword"));
         #echo $client->getServerVersion();
         #echo "<br />";
         $client->addPackage("trinityDB", array($link), 1);
         #Print 'result = ' . $result;
         $transport->close();
     }
 }
コード例 #30
0
ファイル: phimGUI.class.php プロジェクト: nemiah/fheME
 private function go($message, $to)
 {
     $S = anyC::getFirst("Websocket", "WebsocketUseFor", "phim");
     $realm = $S->A("WebsocketRealm");
     spl_autoload_unregister("phynxAutoloader");
     require Util::getRootPath() . 'PWS/Thruway/vendor/autoload.php';
     require_once __DIR__ . '/ClientPhimAuthenticator.php';
     Thruway\Logging\Logger::set(new Psr\Log\NullLogger());
     $connection = new \Thruway\Connection(["realm" => $realm, "url" => "ws" . ($S->A("WebsocketSecure") ? "s" : "") . "://" . $S->A("WebsocketServer") . ":" . $S->A("WebsocketServerPort") . "/"]);
     $client = $connection->getClient();
     $client->addClientAuthenticator(new ClientPhimAuthenticator($realm, "phimUser", $S->A("WebsocketToken")));
     $connection->on('open', function (\Thruway\ClientSession $session) use($connection, $message, $to) {
         $session->publish('it.furtmeier.phim_' . $to, [json_encode($message, JSON_UNESCAPED_UNICODE)], [], ["acknowledge" => true])->then(function () use($connection) {
             $connection->close();
         }, function ($connection) {
             $connection->close();
         });
     });
     $connection->open();
     /*$client = new Thruway\Peer\Client($realm);
     		$client->addClientAuthenticator(new ClientPhimAuthenticator($realm, "phimUser", $S->A("WebsocketToken")));
     		
     		$client->addTransportProvider(new Thruway\Transport\PawlTransportProvider("ws".($S->A("WebsocketSecure") ? "s" : "")."://".$S->A("WebsocketServer").":".$S->A("WebsocketServerPort")."/"));
     
     		$client->on('open', function (Thruway\ClientSession $session) use ($message, $to) {
     
     			$session->publish('it.furtmeier.phim_'.$to, [json_encode($message, JSON_UNESCAPED_UNICODE)], [], ["acknowledge" => true])->then(
     				function () {
     					echo "Publish Acknowledged!\n";
     					die();
     				},
     				function ($error) {
     					// publish failed
     					echo "Publish Error {$error}\n";
     				}
     			);
     
     			//$session->close();
     		});
     
     
     		$client->start();*/
 }