Beispiel #1
0
 public function getRepositoryUrls()
 {
     if ($this->_repositoryurls === null) {
         $app = Zend_Registry::get("app");
         //$this->_repositoryurls = web_get_contents("http://commrepo/repofiles/getrepositorydata/" . $this->id);
         $this->_repositoryurls = web_get_contents($app["commrepoUrl"] . "repofiles/getrepositorydata/" . $this->id);
     }
     return $this->_repositoryurls;
 }
Beispiel #2
0
 public function wikiAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender();
     $page = isset($_GET["page"]) ? strval($_GET["page"]) : null;
     if ($page === null) {
         header("HTTP/1.0 404 Not Found");
         return;
     }
     $data = @web_get_contents("https://wiki.appdb.egi.eu/" . $page . "?do=export_xhtmlbody");
     if ($data === false) {
         header("HTTP/1.0 404 Not Found");
         return;
     }
     echo "<div class='wikipage'>" . $data . "</div>";
 }
Beispiel #3
0
 private static function publishToVMCaster($researcher, $vo, $voimagelist)
 {
     $url = VMCaster::getVMCasterUrl();
     $url .= "/vmlistcontroller/create/" . $voimagelist->id . "/published/vos";
     $result = web_get_contents($url);
     if ($result === false) {
         error_log("[VOAdmin:publishToVMCaster]:Could not retrieve response data from " . $url);
         return false;
     }
     return true;
 }
Beispiel #4
0
 public function entitydescriptorAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender();
     $source = trim($this->_getParam("source"));
     header('Access-Control-Allow-Origin: *');
     header("Content-type: application/samlmetadata+xml");
     header("Content-Disposition: attachment; filename=" . $source);
     echo web_get_contents("https://" . $_SERVER['HTTP_HOST'] . "/auth/module.php/saml/sp/metadata.php/" . $source);
 }
Beispiel #5
0
 public static function calculatePackageVersionIndex($package)
 {
     $pck = null;
     if (is_numeric($package)) {
         $pcks = new Repository_Model_MetaPoaReleasePackages();
         $pcks->filter->id->equals($package);
         if (count($pcks->items) == 0) {
             return false;
         }
         $pck = $pcks->item[0];
     } else {
         $pck = $package;
     }
     $ptype = strtolower(trim($pck->pkgType));
     if ($ptype == "rpm" || $ptype == "deb") {
         $url = self::getBackendUrl() . "package/action/calcversionindex/" . $pck->id;
         $response = web_get_contents($url);
         if (!$response) {
             return false;
         }
     }
     return true;
 }
Beispiel #6
0
 private function getData($url)
 {
     return web_get_contents($url);
 }
Beispiel #7
0
 public static function statusIntegrityCheck($vaversionid)
 {
     $url = VMCaster::getVMCasterUrl() . "/integrity/statusimageList/" . $vaversionid . "/xml";
     try {
         $xml = web_get_contents($url);
         if (trim($xml) === "") {
             throw new Exception('Could not connect with integrity check service. Please, try again later.');
         }
         $result = VMCaster::parseIntegrityCheckResponse($xml);
     } catch (Exception $ex) {
         $result = VMCaster::parseIntegrityCheckResponse('[ERROR]' . $ex->getMessage());
         return $result;
     }
     $newres = VMCaster::syncStatusIntegrityCheck($result);
     return $newres;
 }
Beispiel #8
0
 public function syncvaproviderimagesAction()
 {
     if (localRequest()) {
         $this->_helper->layout->disableLayout();
         $this->_helper->viewRenderer->setNoRender();
         error_log(gmdate("Y-m-d H:i:s", time()) . ": Sync VA Provider Images START");
         $filter = '(&(GLUE2ApplicationEnvironmentRepository=*/appdb.egi.eu/*))';
         $attrs = array('dn', 'GLUE2ApplicationEnvironmentID', 'GLUE2ApplicationEnvironmentAppName', 'GLUE2ApplicationEnvironmentDescription', 'GLUE2ApplicationEnvironmentComputingManagerForeignKey', 'GLUE2EntityName', 'GLUE2ApplicationEnvironmentAppVersion', 'GLUE2ApplicationEnvironmentRepository');
         $prod_sites = $this->getVAProvidersArray();
         db()->query("TRUNCATE TABLE va_provider_images");
         foreach ($prod_sites as $site) {
             $basedn = 'GLUE2GroupID=cloud,GLUE2DomainID=' . $site["name"] . ',GLUE2GroupID=grid,o=glue';
             if (trim($site["serviceid"]) != "") {
                 $basedn = 'GLUE2ServiceID=' . $site["serviceid"] . ',' . $basedn;
             }
             $result = $this->getTopBDIIData($basedn, $filter, $attrs);
             if (!empty($result)) {
                 if (isset($result["count"])) {
                     for ($i = 0; $i < $result["count"]; $i++) {
                         $mpURI = $result[$i]["glue2applicationenvironmentrepository"][0];
                         $imageID = $result[$i]["glue2entityname"][0];
                         # parse mpURI and find type
                         $start = strpos($mpURI, "/store/") + strlen("/store/");
                         $len = strpos($mpURI, "/image/") - $start;
                         $type = substr($mpURI, $start, $len);
                         # parse mpURI and find instanceID
                         $mpURI_tmp = parse_url($mpURI, PHP_URL_PATH);
                         $params = substr($mpURI_tmp, strrpos($mpURI_tmp, 'image/') + 5);
                         if (strlen($params) > 1) {
                             $params = explode('/', $params);
                             $params = explode(':', $params[1]);
                             if (count($params) > 1) {
                                 if (is_numeric($params[1])) {
                                     $instanceID = intval($params[1]);
                                 }
                             }
                         }
                         $vowide_instanceID = null;
                         if ($type == "vo") {
                             $vowide_instanceID = $instanceID;
                             db()->setFetchMode(Zend_Db::FETCH_BOTH);
                             $instanceID = db()->query("SELECT vapplists.vmiinstanceid FROM vowide_image_list_images INNER JOIN vapplists ON vapplists.id = vowide_image_list_images.vapplistid WHERE vowide_image_list_images.id = ?", array($instanceID))->fetchAll();
                             if (count($instanceID) > 0) {
                                 if (count($instanceID[0]) > 0) {
                                     $instanceID = $instanceID[0][0];
                                 } else {
                                     $instanceID = null;
                                 }
                             } else {
                                 $instanceID = null;
                             }
                         }
                         try {
                             db()->query("INSERT INTO va_provider_images (va_provider_id, vmiinstanceid, content_type, va_provider_image_id, mp_uri, vowide_vmiinstanceid) VALUES (?, ?, ?, ?, ?, ?)", array($site["id"], $instanceID, $type, $imageID, $mpURI, $vowide_instanceID));
                         } catch (Exception $e) {
                             error_log("ERROR in 'INSERT INTO va_provider_images (va_provider_id, vmiinstanceid, content_type, va_provider_image_id, mp_uri, vowide_vmiinstanceid)'");
                             error_log("VALUES: " . "'" . var_export($site["id"], true) . "', " . "'" . var_export($instanceID, true) . "', " . "'" . var_export($type, true) . "', " . "'" . var_export($imageID, true) . "', " . "'" . var_export($mpURI, true) . "', " . "'" . var_export($vowide_instanceID, true) . "', ");
                         }
                     }
                 }
             }
         }
         error_log(gmdate("Y-m-d H:i:s", time()) . ": Sync VA Provider Images DONE [1/2]. Will refresh related materialized views");
         error_log(gmdate("Y-m-d H:i:s", time()) . ": Sync VA Provider Images: Refreshing site_services_xml...");
         db()->query("REFRESH MATERIALIZED VIEW site_services_xml;");
         error_log(gmdate("Y-m-d H:i:s", time()) . ": Sync VA Provider Images: Refreshing site_service_images_xml...");
         db()->query("REFRESH MATERIALIZED VIEW site_service_images_xml;");
         error_log(gmdate("Y-m-d H:i:s", time()) . ": Sync VA Provider Images DONE [2/2]");
         $this->makeVAprovidersCache();
         if (strtolower($_SERVER["SERVER_NAME"]) == "appdb.egi.eu") {
             web_get_contents("https://dashboard.appdb.egi.eu/services/appdb/sync/cloud");
         }
     } else {
         $this->getResponse()->clearAllHeaders();
         $this->getResponse()->setRawHeader("HTTP/1.0 403 Forbidden");
         $this->getResponse()->setHeader("Status", "403 Forbidden");
     }
 }
Beispiel #9
0
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and 
 * limitations under the License.
 */
if (array_key_exists("image", $_GET) && $_GET["image"] === "email") {
    header('PRAGMA: NO-CACHE');
    header('CACHE-CONTROL: NO-CACHE');
    header('Content-type: image/png');
    echo web_get_contents('http://appdb.egi.eu/texttoimage/?msg=appdb-support@hellasgrid.gr');
} else {
    include "AppdbAPI.php";
    $api = new AppDBrestAPIHelper();
    $vos = $api->VOs();
    $vos = $vos->vo();
    $regional = $api->Regional();
    $countries = $regional->country();
    $mids = $api->Middlewares();
    $mids = $mids->middleware();
    $tags = $api->Tags();
    $tags = $tags->tag();
    $api2 = new AppDBrestAPIHelper('1.0');
    $disciplines = $api2->Desciplines();
    $disc = $disciplines->discipline();
    $categories = $api->categories();