Please check your GitHub repository and branch settings. Make sure the repository exists and is accessible.'); return; } if( ! file_put_contents(RSS_LOCAL_PATH, $rssContent)) { print_failure('Unable to save update information to: ' . RSS_LOCAL_PATH . '
Please check file permissions.'); return; } } else { print_failure('Module directory is not writable: ' . MODULE_PATH); return; } if( file_exists(RSS_LOCAL_PATH) ) { try { $rssContent = file_get_contents(RSS_LOCAL_PATH); if ($rssContent === false || empty($rssContent)) { print_failure('Unable to read update information from: ' . RSS_LOCAL_PATH); return; } $feedXml = new SimpleXMLElement($rssContent, LIBXML_NOCDATA); if (!isset($feedXml->entry[0]->link['href'])) { print_failure('Invalid repository feed format. Please check your GitHub repository and branch settings.'); return; } $seed = basename((string) $feedXml->entry[0]->link['href']); unlink(RSS_LOCAL_PATH); } catch (Exception $e) { print_failure('Unable to parse update information: ' . $e->getMessage() . '
Please check your GitHub repository and branch settings.'); return; } } else { print_failure('Unable to read : ' . RSS_LOCAL_PATH); return; } if(isset($seed)) { /// Checking for changes in the main update files: $main_update_files = array( 'includes/functions.php' => 'https://raw.githubusercontent.com/' . $gitHubOrganization . '/'.REPONAME.'/'.$seed.'/includes/functions.php', 'includes/helpers.php' => 'https://raw.githubusercontent.com/' . $gitHubOrganization . '/'.REPONAME.'/'.$seed.'/includes/helpers.php', 'modules/update/update.php' => 'https://raw.githubusercontent.com/' . $gitHubOrganization . '/'.REPONAME.'/'.$seed.'/modules/update/update.php', 'modules/update/updating.php' => 'https://raw.githubusercontent.com/' . $gitHubOrganization . '/'.REPONAME.'/'.$seed.'/modules/update/updating.php', 'modules/update/unzip.php' => 'https://raw.githubusercontent.com/' . $gitHubOrganization . '/'.REPONAME.'/'.$seed.'/modules/update/unzip.php' ); $refresh = False; foreach($main_update_files as $local_path => $remote_url) { $result = check_file($local_path, $remote_url); if ($result === 'nochange') { continue; } elseif($result) { $refresh = True; } else { return; } } if($refresh) { header("Refresh:0"); return; } echo "

".get_lang('update')."

"; $pversion = $settings['ogp_version']; echo ''.get_lang('blacklist_files')." ".get_lang('blacklist_files_info')."

"; echo get_lang('panel_version').": ".$pversion."

"; echo get_lang('latest_version').": $seed

"; if ( $seed != $pversion ) { $dwl = $gitHubURL . REPONAME . '/archive/'.$seed.'.zip'; $dwlHeaders = @get_headers($dwl); if($dwlHeaders === false || $dwlHeaders[0] != 'HTTP/1.1 302 Found') { $errorMsg = 'The generated URL for the download returned a bad response'; if ($dwlHeaders !== false) { $errorMsg .= ' code: ' . $dwlHeaders[0]; } else { $errorMsg .= ': Unable to reach the URL'; } $errorMsg .= '
URL: ' . $dwl . '
Please check your GitHub repository and branch settings.'; print_failure($errorMsg); } else { echo "
\n". "


\n"; } if(function_exists('curl_version')){ echo "

Latest Changes

"; $commitsStart = 0; $commitsToShow = 5; $gitHubUpdateName = GITHUB_USERNAME; if($gitHubBranchName != "master"){ $commitsUrl = 'https://api.github.com/repos/'.$gitHubUpdateName.'/'.REPONAME.'/commits/' . $gitHubBranchName; }else{ $commitsUrl = 'https://api.github.com/repos/'.$gitHubUpdateName.'/'.REPONAME.'/commits'; } $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $commitsUrl); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); $data = curl_exec($ch); if ($data) { $json = json_decode($data, true); if(array_key_exists("0", $json)){ if (!empty($json[0]['commit'])) { echo 'View more commits...'; } }else{ if (!empty($json['commit'])) { echo ''; } } } } } else { print_success(get_lang('the_panel_is_up_to_date')); } } } ?>