function getImageHash($path, $type = FileManager::FILESYSTEM_PRIVATE)
 {
     if ($type == FileManager::FILESYSTEM_PLUGIN_PUBLIC) {
         $file = $this->pluginFiles . $path;
     } else {
         if ($type == FileManager::FILESYSTEM_PLUGIN_PRIVATE) {
             $file = $this->userInfo . $this->plugin . '/' . $path;
         } else {
             if ($type == FileManager::FILESYSTEM_PRIVATE && !$this->secure) {
                 $file = $this->userFiles . $path;
             }
         }
     }
     if ($this->getFileType($file) == "image" && $this->fileExists($path, true, $type)) {
         return FileManager::getImageHashByPath($file);
     } else {
         return "";
     }
 }
 function getImage($name)
 {
     $path = $this->basedir . '/plugins/' . $this->getPluginName() . '/images/' . $name;
     if (file_exists($path)) {
         return FileManager::getImageHashByPath($path);
     }
     return null;
 }
예제 #3
0
            $bgcolor = $conf['bgcolor'];
        }
        $output['bgcolor'] = $bgcolor;
        echo json_encode($output);
    }
} else {
    if (!empty($_POST['username']) and !empty($_POST['password'])) {
        $authtoken = $loginManager->loginUserByPassword($_POST['username'], $_POST['password'], 'Webinterface');
        if (!empty($authtoken)) {
            $pluginManager = new PluginManager();
            $pluginManager->enableNotifications(TRUE);
            $notificationManager = $pluginManager->getNotificationManager();
            $notification = new Notification("Sie haben sich mit ihrem Benutzerkonto auf einem neuen Endgerät angemeldet.", "Neue Anmeldung", time() + 86400);
            $notification->addReaded($authtoken);
            $notification->setActionOpenPlugin("plg_user");
            $notification->setIcon(FileManager::getImageHashByPath('images/user-add.png'));
            $notificationManager->addNotification($notification, $loginManager->getId());
            echo '{"token":' . json_encode($authtoken) . ',"username":"******",';
            echo '"mainplugins":' . $pluginManager->getMainPlugins();
            /* TODO */
            if (!$loginManager->getShareManager()->isShared()) {
                $seamless = $loginManager->getUserPreference("seamless");
                if (!empty($seamless) && strtoupper($seamless) == "TRUE") {
                    $seamlessString = $loginManager->getUserPreference("seamless-current");
                    if (!empty($seamlessString)) {
                        echo ',"seamless":' . $seamlessString;
                    }
                }
            }
            echo '}';
        } else {