Ejemplo n.º 1
0
 function getHeader()
 {
     global $current_language;
     $mod_strings = return_module_language($current_language, "Administration");
     $header_text = '';
     $isAlive = false;
     $show_login = false;
     if (!function_exists('curl_init') && $show_login) {
         $header_text = "<font color='red'><b>" . $mod_strings['ERR_ENABLE_CURL'] . "</b></font>";
         $show_login = false;
     } else {
         $credentials = PackageManager::getCredentials();
         if (empty($credentials['username']) || empty($credentials['password'])) {
             //$header_text = "<font color='red'><b>".$mod_strings['ERR_CREDENTIALS_MISSING']."</b></font>";
         } else {
             $result = PackageManagerComm::login();
             if (is_array($result) && !empty($result['faultcode']) || $result == false) {
                 $header_text = "<font color='red'><b>" . $result['faultstring'] . "</b></font>";
             } else {
                 $header_text = PackageManager::getPromotion();
                 $isAlive = true;
             }
         }
     }
     return array('text' => $header_text, 'isAlive' => $isAlive, 'show_login' => $show_login);
 }
Ejemplo n.º 2
0
 /**
  * Grab the list of installed modules and send that list to the depot.
  * The depot will then send back a list of modules that need to be updated
  */
 function checkForUpdates()
 {
     $lists = $this->buildInstalledReleases(array('module'), true);
     $updates = array();
     if (!empty($lists)) {
         $updates = PackageManagerComm::checkForUpdates($lists);
     }
     //fi
     return $updates;
 }
Ejemplo n.º 3
0
 function downloadedDocumentation()
 {
     $json = getJSONobj();
     $document_id = '';
     if (isset($_REQUEST['document_id'])) {
         $document_id = nl2br($_REQUEST['document_id']);
     }
     $GLOBALS['log']->debug("Downloading Document: " . $document_id);
     PackageManagerComm::downloadedDocumentation($document_id);
     echo 'result = ' . $json->encode(array('result' => 'true'));
 }
Ejemplo n.º 4
0
 /**
  * Ping the server to determine if we have established proper communication
  * 
  * @return true if we can communicate with the server and false otherwise
  */
 function isAlive()
 {
     PackageManagerComm::initialize(false);
     $status = $GLOBALS['SugarDepot']->call('sugarPing', array());
     if (empty($status) || $GLOBALS['SugarDepot']->getError() || $status != ACTIVE_STATUS) {
         return false;
     } else {
         return true;
     }
 }