/** * This function has a special rendering, because the ComfortUpdate server can choose what it's going to show : * the welcome message or the subscribe message or the updater update, etc. * The same system is used for the static views (update key, etc.) * * @return html the welcome message */ public function getwelcome() { if (Permission::model()->hasGlobalPermission('superadmin')) { // We get the update key in the database. If it's empty, getWelcomeMessage will return subscription $updateKey = getGlobalSetting("update_key"); //$updateKey = SettingGlobal::model()->findByPk('update_key')->stg_value; $updateModel = new UpdateForm(); $destinationBuild = $_REQUEST['destinationBuild']; $welcome = (array) $updateModel->getWelcomeMessage($updateKey, $destinationBuild); $welcome['destinationBuild'] = $destinationBuild; $welcome = (object) $welcome; return $this->_renderWelcome($welcome); } }
/** * This return the subscribe message * @return html the welcome message */ public function getnewkey() { // We try to get the update key in the database. If it's empty, getWelcomeMessage will return subscription $updateKey = NULL; $updateModel = new UpdateForm(); $destinationBuild = $_REQUEST['destinationBuild']; $welcome = $updateModel->getWelcomeMessage($updateKey, $destinationBuild); //$updateKey echo $this->_renderWelcome($welcome); }
/** * This return the subscribe message * @return html the welcome message */ public function getnewkey() { if (Permission::model()->hasGlobalPermission('superadmin')) { // We want to call the server to display the subscribe message // So if needed, we can display a specific html message (like we do for update to LTS with a free key) // To force server to render the subscribe message, we call for the last 2.06+ release (which need at least a free key) $updateModel = new UpdateForm(); $welcome = $updateModel->getWelcomeMessage(null, '160129'); //$updateKey echo $this->_renderWelcome($welcome); } }