Exemplo n.º 1
0
    Core_quit();
}
/**
 * get theme from api
 */
$theme = Core_getExternalFile('http://kvweb.me/ww.plugins/themes-api/api.php?theme=' . $id);
if ($theme == false) {
    die('theme does not exist');
}
$theme = json_decode($theme, true);
echo '<h2>Downloading Theme</h2>';
/**
 * downloading
 */
echo 'Downloading...<br/>';
$zipfile = Core_getExternalFile($theme['download']);
$theme_dir = USERBASE . '/themes-personal/';
file_put_contents($theme_dir . $theme['name'] . '.zip', $zipfile);
/**
 * extracting
 */
echo 'Extracting...<br/>';
shell_exec('cd ' . $theme_dir . ' && unzip -o ' . $theme['name'] . '.zip');
/**
 * cleaning
 */
echo 'Removing Zip File..<br/>';
shell_exec('rm -rf ' . $theme_dir . $theme['name'] . '.zip');
echo 'Theme Download Successful<br/>';
/**
 * install theme if selected
Exemplo n.º 2
0
 * @category None
 * @package  None
 * @author   Conor Mac Aoidh <*****@*****.**>
 * @author   Kae Verens <*****@*****.**>
 * @license  GPL 2.0
 * @link     http://kvsites.ie/
 */
require_once 'basics.php';
require SCRIPTBASE . 'ww.admin/admin_libs.php';
$url = @$_GET['url'];
/**
 * make sure host and referer are the same
 */
$referer = @$_SERVER['HTTP_REFERER'];
$referer = preg_replace('/^https?:\\/\\/([^\\/]*)\\/.*/', '\\1', $referer);
$host = $_SERVER['SERVER_NAME'];
if ($host != $referer) {
    Core_quit();
}
/**
 * get rest of query string and pass to url
 */
if (strpos($url, '?') !== 0) {
    $querystring = $_SERVER['QUERY_STRING'];
    $explode = explode('?', $querystring);
    $querystring = '?' . end($explode);
    $explode = explode('?', $url);
    $url = reset($explode) . $querystring;
}
$content = Core_getExternalFile($url);
echo $content;