Example #1
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;
 }
Example #2
0
 public function saveShowCalendarOf($UserID, $value)
 {
     mUserdata::setUserdataS("showCalendarOf" . $UserID, $value);
 }
Example #3
0
 public function rolesActivate($UserID, $role)
 {
     foreach ($this->roles($role) as $c => $s) {
         if ($c == "cantEdit" or $c == "cantDelete" or $c == "cantCreate") {
             foreach ($s as $k => $p) {
                 $p2 = "m{$p}";
                 if ($p == "Adresse") {
                     $p2 = "Adressen";
                 }
                 mUserdata::setUserdataS($c . $p2, $c . $p, "uRest", $UserID);
             }
             continue;
         }
         if ($c == "hidePlugin") {
             foreach ($s as $k => $p) {
                 mUserdata::setUserdataS($c . $p, $p, "pHide", $UserID);
             }
             continue;
         }
         foreach ($s as $k => $p) {
             mUserdata::setUserdataS($p, $c, "pSpec", $UserID);
         }
     }
 }
Example #4
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);
 }
Example #5
0
 public function discoverNow($reloadWhat = null, $force = false, $quiet = false)
 {
     $last = mUserdata::getGlobalSettingValue("UPnPLastDiscover", 0);
     if (time() - $last < 3600 * 3.5 and !$force) {
         return;
     }
     $C = new phpUPnP();
     $result = $C->mSearch();
     #print_r($result);
     if (!$quiet) {
         echo "<p>Gefundene Geräte:</p>";
     }
     #$locations = array();
     $L = new HTMLList();
     $L->addListStyle("list-style-type:none;");
     $foundLocations = array();
     #echo "<pre style=\"padding:5px;font-size:9px;overflow:auto;height:400px;\">";
     #print_r($result);
     #echo "</pre>";
     foreach ($result as $r) {
         if (isset($foundLocations[$r["location"]])) {
             continue;
         }
         $info = file_get_contents($r["location"]);
         if ($info === false) {
             continue;
         }
         $xml = new SimpleXMLElement($info);
         $services = array();
         foreach ($xml->device->serviceList->service as $service) {
             foreach (self::$desiredServices as $k => $S) {
                 if ($service->serviceId[0] == $S) {
                     $services[$k] = $service;
                 }
             }
         }
         #echo "<pre>";
         #print_r($xml->device->UDN);
         #echo "</pre>";
         $F = new Factory("UPnP");
         $F->sA("UPnPUDN", $xml->device->UDN);
         $L->addItem($xml->device->friendlyName);
         $U = $F->exists(true);
         if ($U !== false) {
             $U->changeA("UPnPLocation", $r["location"]);
             #$U->changeA("UPnPName", $xml->device->friendlyName);
             $U->changeA("UPnPModelName", $xml->device->modelName);
             $U->changeA("UPnPUDN", $xml->device->UDN);
             foreach (self::$desiredServices as $S => $nil) {
                 $U->changeA("UPnP{$S}", 0);
             }
             foreach ($services as $S => $service) {
                 $U->changeA("UPnP{$S}", 1);
                 $U->changeA("UPnP" . $S . "SCPDURL", $service->SCPDURL[0] . "");
                 $U->changeA("UPnP" . $S . "controlURL", $service->controlURL[0] . "");
             }
             #echo "save";
             $U->saveMe();
         } else {
             $F->sA("UPnPLocation", $r["location"]);
             $F->sA("UPnPName", $xml->device->friendlyName);
             $F->sA("UPnPModelName", $xml->device->modelName);
             foreach (self::$desiredServices as $S => $nil) {
                 $F->sA("UPnP{$S}", 0);
             }
             foreach ($services as $S => $service) {
                 $F->sA("UPnP{$S}", 1);
                 $F->sA("UPnP" . $S . "SCPDURL", $service->SCPDURL[0] . "");
                 $F->sA("UPnP" . $S . "controlURL", $service->controlURL[0] . "");
             }
             #echo "store";
             $F->store();
         }
         $foundLocations[$r["location"]] = true;
     }
     $AC = anyC::get("UPnP");
     while ($U = $AC->getNextEntry()) {
         if (!isset($foundLocations[$U->A("UPnPLocation")])) {
             $U->deleteMe();
         }
     }
     if (!$quiet) {
         echo $L;
     }
     $B = new Button("OK", "bestaetigung");
     $B->style("float:right;margin:10px;");
     if ($reloadWhat == "targets") {
         $B->onclick(OnEvent::closePopup("mUPnP") . " UPnP.targetSelection();");
     }
     if ($reloadWhat == "sources") {
         $B->onclick(OnEvent::closePopup("mUPnP") . " UPnP.sourceSelection();");
     }
     if ($reloadWhat) {
         echo $B . "<div style=\"clear:both;\"></div>";
     }
     mUserdata::setUserdataS("UPnPLastDiscover", time(), "", -1);
     #echo "</pre>";
 }
Example #6
0
 public function manageMailsettingsSave($systemEmail)
 {
     if (trim($systemEmail) != "" and !Util::checkIsEmail($systemEmail)) {
         Red::alertD("Bitte geben Sie eine gültige E-Mail-Adresse ein.");
     }
     mUserdata::setUserdataS("mailSystemEmail", $systemEmail, "", -1);
 }
Example #7
0
    public function getConfigFile()
    {
        $T = mUserdata::getGlobalSettingValue("phimServerToken");
        if (!$T) {
            mUserdata::setUserdataS("phimServerToken", Util::genPassword(100), "", -1);
            $T = mUserdata::getGlobalSettingValue("phimServerToken");
        }
        header('Content-disposition: attachment; filename="phim.exe.config"');
        header('Content-type: "text/xml"; charset="utf8"');
        echo '<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
            <section name="phim.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
        </sectionGroup>
    
        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
            <section name="phim.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
        </sectionGroup>
    </configSections>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
    </startup>
    <userSettings>
        <phim.Properties.Settings>
            <setting name="server" serializeAs="String">
                <value />
            </setting>
            <setting name="user" serializeAs="String">
                <value />
            </setting>
            <setting name="password" serializeAs="String">
                <value />
            </setting>
            <setting name="cloud" serializeAs="String">
                <value />
            </setting>
            <setting name="position" serializeAs="String">
                <value>20, 20</value>
            </setting>
        </phim.Properties.Settings>
    </userSettings>
<applicationSettings>
        <phim.Properties.Settings>
                <setting name="authServerUrl" serializeAs="String">
                        <value>' . $_SERVER["HTTP_HOST"] . '</value>
                </setting>
                <setting name="authServerToken" serializeAs="String">
                        <value>' . $T . '</value>
                </setting>
                <setting name="authServerCloud" serializeAs="String">
                        <value>' . (isset($_SESSION["phynx_customer"]) ? $_SESSION["phynx_customer"] : "") . '</value>
                </setting>
        </phim.Properties.Settings>
    </applicationSettings>
</configuration>';
    }
Example #8
0
 public function saveAppServer($value)
 {
     mUserdata::setUserdataS("AppServer", $value, "", -1);
     Red::messageSaved();
 }
Example #9
0
 public function saveContextMenu($identifier, $key)
 {
     $F = new Factory("Userdata");
     $F->sA("UserID", "-1");
     $F->sA("name", "trinityDBdlCover");
     $U = $F->exists(true);
     if ($U !== false) {
         $U->changeA("wert", $identifier);
         $U->saveMe();
     } else {
         $F->sA("wert", $identifier);
         $F->store();
     }
     mUserdata::setUserdataS("trinityDBdlCover", $identifier);
 }
 public function saveContextMenu($identifier, $key = "")
 {
     mUserdata::setUserdataS("trinityDBPrettifyExecute", $identifier);
 }
Example #11
0
 public function saveEinstellungen($apiKey)
 {
     mUserdata::setUserdataS("OWMApiKey", $apiKey, "", -1);
 }