/** * retrieve a value * * @param string $name the variable to retrieve * * @return mixed value */ static function get($name) { if (!isset(self::$vals[$name])) { if (count(self::$vals)) { self::$vals[$name] = ''; } if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/ww.incs/distconfig.php')) { require_once $_SERVER['DOCUMENT_ROOT'] . '/ww.incs/distconfig.php'; self::$vals = $config; } else { require_once $_SERVER['DOCUMENT_ROOT'] . '/ww.incs/distconfig.example.php'; self::$vals = $config; } if (!isset(self::$vals[$name])) { self::$vals[$name] = ''; } } return self::$vals[$name]; }
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/ww.incs/basics.php'; if (!Core_isAdmin()) { die('access denied'); } header('Content-type: text/json'); $rs = dbAll('select * from sitecredits_options'); $options = array(); foreach ($rs as $k => $v) { $options[$v['name']] = $v['value']; } if (!@$options['payment-recipient']) { $cr = DistConfig::get('credits-email'); $options['payment-recipient'] = $cr; dbQuery('insert into sitecredits_options values("payment-recipient", "' . $cr . '")'); } if (!@$options['currency']) { $options['currency'] = 'EUR'; $options['currency-symbol'] = '€'; } if (!@$options['credit-costs']) { $options['credit-costs'] = '[' . '[5000000,1]' . ']'; } $options['credit-costs'] = json_decode($options['credit-costs']); echo json_encode($options);
*/ $theme_id = addslashes(@$_POST['theme_id']); $user_id = addslashes(@$_POST['user_id']); if ($theme_id == 0 || $user_id == 0) { die('error'); } require_once '../../../ww.incs/basics.php'; require_once SCRIPTBASE . 'ww.incs/mail.php'; /** * get data on the theme and the user */ $user = dbRow('select name,email from user_accounts where id=' . $user_id); $theme_name = dbOne('select name from themes_api where id=' . $theme_id, 'name'); /** * delete theme from user-files * and from themes-personal */ shell_exec('rm -rf ' . USERBASE . '/f/themes_api/themes/' . $theme_id); shell_exec('rm -rf ' . USERBASE . '/themes-personal/' . $theme_name); /** * delete the theme from the db */ dbQuery('delete from themes_api where id=' . $theme_id); /** * send the user an email telling them the theme * was deleted */ $cms_name = DistConfig::get('cms-name'); $body = '<h3>' . __('Theme Deleted') . '</h3><p>' . __('Hi %1,', array($user['name']), 'core') . '</p><p>' . __('Your theme named "%1" has been deleted by moderaters.', array($theme_name), 'core') . '</p><p>' . __('Contact us if you have questions.') . '</p><p>' . __('Thanks<br/>---<br/>%1', array($cms_name), 'core') . '</p>'; send_mail($user['email'], 'no-reply@' . $_SERVER['HTTP_HOST'], __('Theme Deleted'), $body, false); die('ok');
/** * get a list of the available themes * * @return array names */ function Theme_getTemplateNames() { $themes = array(); $dir = USERBASE . '/themes-personal/'; $handler = opendir($dir); while ($file = readdir($handler)) { if ($file == '.' || $file == '..') { continue; } if (is_dir($dir . $file)) { array_push($themes, $file); } } closedir($handler); return $themes; } echo '<script src="/ww.admin/siteoptions/themes/download.js"></script>' . '<link rel="stylesheet" href="' . DistConfig::get('themes-api') . '/api.' . 'css"/>'; echo '<div id="public-repository"><p>' . __('Choosing a theme here will download it into your private repository.' . ' If you already have a copy of the chosen theme there, then your copy' . ' will be over-written.') . '</p>'; echo '<div id="themes-carousel"> </div>'; /** * build an array of installed themes */ $installed = Theme_getTemplateNames(); echo '<script type="text/javascript">window.installed_themes=' . json_encode($installed) . ';</script>'; echo '<br style="clear:both"/>';
* PHP version 5.2 * * @category None * @package None * @author Kae Verens <*****@*****.**> * @license GPL 2.0 * @link http://kvsites.ie/ */ require 'header.php'; // write the config to file if (!$_SESSION['userbase_created']) { // user shouldn't be here header('Location: /install/step4.php'); Core_quit(); } $privatedir = DistConfig::get('installer-private'); if (!is_dir($privatedir)) { // create config directory mkdir($privatedir); if (!is_dir($privatedir)) { echo '<p><strong>' . __('Could not create <code>%1</code> directory.', array($privatedir), 'code') . '</strong></p>'; $webroot = dirname($privatedir); echo __('<p>Please either:</p><ul><li>make the web root <code>%1</code> ' . 'writable for the web server</li><li>or create the <code>.private' . '</code> directory yourself and make it writable to the web server' . '</li></ul><p>Then reload this page.</p>', array($webroot), 'core'); Core_quit(); } } $config = '<' . "?php\n\$DBVARS=array(\n\t'username' => '" . addslashes($_SESSION['db_vars']['username']) . "',\n\t'password' => '" . addslashes($_SESSION['db_vars']['password']) . "',\n\t'hostname' => '" . addslashes($_SESSION['db_vars']['hostname']) . "',\n\t'db_name' => '" . addslashes($_SESSION['db_vars']['db_name']) . "',\n\t'userbase' => '" . addslashes($_SESSION['userbase']) . "',\n\t'plugins' => 'panels',\n\t'theme_variant' => '',\n\t'version' => 1\n);"; file_put_contents($privatedir . '/config.php', $config); if (!file_exists($privatedir . '/config.php')) { echo '<p>' . __('<strong>Could not create /.private/config.php</strong>. Please ' . 'make /.private/ writable for the web server, then reload this page.') . '</p>'; Core_quit();
</form> <iframe name="upload-iframe" style="display:none" href="javascript:;"></ifr' . 'ame>'; ?> </div> </div> <?php if (isset($_POST['install-theme'])) { // install theme if selected // get id $id = (int) @$_POST['theme_id']; if ($id == 0) { Core_quit(); } $themeapi = DistConfig::get('themes-api'); $themeUrl = $themeapi . '/api.php?theme=' . $id; $theme = curl($themeUrl); if ($theme == false) { die(__('Theme does not exist. %1', array($themeUrl), 'core')); } $theme = json_decode($theme, true); echo '<h2>' . __('Downloading Theme') . '</h2>'; // downloading echo __('Downloading...') . '<br/>'; $zipfile = curl($theme['download']); $theme_dir = USERBASE . '/themes-personal/'; @mkdir($theme_dir); file_put_contents($theme_dir . $theme['name'] . '.zip', $zipfile); // extracting echo __('Extracting...') . '<br/>';
Core_quit(); } list($pid, $wid) = explode('-', preg_replace('/.*widget-id=([0-9]*-[0-9]*).*/', '\\1', $_SERVER['REQUEST_URI'])); require_once $_SERVER['DOCUMENT_ROOT'] . '/ww.incs/basics.php'; $panel = json_decode(dbOne('select body from panels where id=' . (int) $pid, 'body')); foreach ($panel->widgets as $widget) { if ($widget->id == $wid) { $fbappid = $widget->fbappid; $fbsecret = $widget->fbsecret; $url = 'https://graph.facebook.com/oauth/access_token' . '?client_id=' . $fbappid . '&redirect_uri=http://' . $_SERVER['HTTP_HOST'] . preg_replace('/\\?.*/', '', $_SERVER['REQUEST_URI']) . '&client_secret=' . $fbsecret . '&code=' . $_REQUEST['code']; $auth = file_get_contents($url); $details = file_get_contents('https://graph.facebook.com/me?' . $auth); $details = json_decode($details); if (is_null($details)) { // failed login mail(DistConfig::get('email'), 'Facebook failed data', $details); header('Location: /'); Core_quit(); } $name = $details->name; $email = $details->email; $user = dbRow('select * from user_accounts where email="' . addslashes($email) . '"'); if ($user == false) { $pass = md5($details->id); dbQuery('insert into user_accounts set email="' . addslashes($email) . '",name="' . addslashes($name) . '",active=1,password="******"'); $user = dbRow('select * from user_accounts where id=' . dbLastInsertId()); } $_SESSION['userdata'] = $user; dbQuery('update user_accounts set last_login=now() where id=' . $user['id']); } }
/** * retrieve HTML for a captcha * * @return string HTML for the captcha */ function Recaptcha_getHTML() { return '<script>var RecaptchaOptions={theme:"custom",lang:"' . DistConfig::get('preferred-language') . '",' . 'custom_theme_widget:"recaptcha_widget"};</script>' . '<div id="recaptcha_widget" style="display:none">' . '<div id="recaptcha_image"></div>' . '<a href="javascript:Recaptcha.reload()">' . __('reload captcha') . '</a><br />' . '<div class="recaptcha_only_if_incorrect_sol" style="color:red">' . __('Incorrect please try again') . '</div>' . '<span class="recaptcha_only_if_image">' . __('Enter the words above') . ':</span>' . '<input id="recaptcha_response_field" ' . 'name="recaptcha_response_field" /></div>' . '<script src="//www.google.com/recaptcha/api/challenge?k=' . RECAPTCHA_PUBLIC . '"></script>'; }