Esempio n. 1
0
 public function processing()
 {
     $oController = new BxDolUpgradeController();
     if ($oController->setMaintenanceMode(true)) {
         // if upgrade was successful
         if (($sFolder = $oController->getAvailableUpgrade()) && $oController->runUpgrade($sFolder)) {
             // write upgrade log
             $oController->writeLog();
             // send email notification
             bx_import('BxDolLanguages');
             sendMailTemplateSystem('t_UpgradeSuccess', array('new_version' => bx_get_ver(true), 'conclusion' => $oController->getConclusion() ? _t('_sys_upgrade_conclusion', $oController->getConclusion()) : ''));
             // if next upgrade is available (in case of bulk upgrade) then schedule to run it upon next cron run
             $sUpgradeDir = pathinfo(__FILE__, PATHINFO_DIRNAME);
             if ($oController->getAvailableUpgrade()) {
                 $oUpgrader = bx_instance('BxDolUpgrader');
                 $oUpgrader->setTransientUpgradeCronJob($sUpgradeDir);
             } elseif (0 === strpos($sUpgradeDir, BX_DIRECTORY_PATH_TMP)) {
                 @bx_rrmdir($sUpgradeDir);
             }
         }
         $oController->setMaintenanceMode(false);
     }
     // if something went grong during upgrade
     if ($sErrorMsg = $oController->getErrorMsg()) {
         // write upgrade log
         $oController->writeLog();
         // send email notification
         sendMailTemplateSystem('t_UpgradeFailed', array('error_msg' => $sErrorMsg));
         // disable auto-upgrade if it is failed
         setParam('sys_autoupdate_system', '');
     }
 }
Esempio n. 2
0
 protected function onValidateId()
 {
     $id = param("id");
     if (!hasPerm(AUTH_MGR) || is_null(param("id"))) {
         setParam("id", $_SESSION["empId"]);
     }
 }
Esempio n. 3
0
 function uninstall($aParams)
 {
     $aResult = parent::uninstall($aParams);
     if ($aResult['result'] && getParam($this->_sParamDefaultPayment) == $this->_aConfig['home_uri']) {
         setParam($this->_sParamDefaultPayment, '');
     }
     return $aResult;
 }
 /**
  * constructor
  */
 function __construct()
 {
     if (isset($_POST['hide_admin_help']) && $_POST['hide_admin_help']) {
         setParam('sys_show_admin_help', '');
         echo '1';
         exit;
     }
     $this->aBlocks = array('help' => 'on' == getParam('sys_show_admin_help') ? true : false, 'links' => true, 'charts' => true, 'stats' => true);
 }
Esempio n. 5
0
function param($name, $value = null)
{
    if ($value !== null) {
        setParam($name, $value);
    }
    if (preg_match('/^([^\\[]+)\\[([^\\]]*)\\]$/', $name, $m)) {
        $name = $m[1];
    }
    return isset($_REQUEST[$name]) ? $_REQUEST[$name] : null;
}
Esempio n. 6
0
 /**
  * constructor
  */
 function BxDolAdminDashboard()
 {
     parent::BxDolMistake();
     if (isset($_POST['hide_admin_help']) && $_POST['hide_admin_help']) {
         setParam('sys_show_admin_help', '');
         echo '1';
         exit;
     }
     $this->aBlocks = array('help' => 'on' == getParam('sys_show_admin_help') ? true : false, 'links' => true, 'charts' => true, 'stats' => true);
 }
 public function processing()
 {
     if ('on' != getParam('sys_autoupdate_system')) {
         return;
     }
     $o = bx_instance('BxDolUpgrader');
     if (!$o->prepare()) {
         sendMailTemplateSystem('t_UpgradeFailed', array('error_msg' => $o->getError()));
         setParam('sys_autoupdate_system', '');
         // disable auto-update if it is failed
     }
 }
    echo $ad['blank'] ? 'target="_blank"' : '';
    ?>
>
                <img style="width:565px;height:53px;" src="<?php 
    echo $ad["pic_url"];
    ?>
">
            </a>
            <?php 
}
?>
        </div>
        <div class="search">
            <form name="searchform" id="searchform" action="index.php" method="get">
                <?php 
echo setParam(array('m' => 'search', 'a' => 'index'));
?>
            <span class="search-area fl">
                <input name="keywords" id="keywords" class="txt" value="请输入想找的宝贝" title="请输入想找的宝贝" type="text" onblur="if (value=='') {value='请输入想找的宝贝'}" onfocus="if(value=='请输入想找的宝贝') {value=''}">
            </span>
            <input value="搜全站" class="smt fr" type="submit">
            </form>
        </div>
    </div>

    <div class="mainNav">
        <div class="nav">
        <?php 
$allsort = IndexModel::I()->getAllSort();
?>
            <ul id="" class="navigation fl">
Esempio n. 9
0
 function _removeFields($sType)
 {
     switch ($sType) {
         case 'html':
         case 'json':
         case 'exceptions':
             break;
         default:
             return array();
     }
     $s = getParam("sys_{$sType}_fields");
     if (!$s) {
         return;
     }
     $a = unserialize($s);
     unset($a[$this->_aConfig['home_uri']]);
     $s = serialize($a);
     setParam("sys_{$sType}_fields", $s);
 }
 function resetPage()
 {
     if ($this->oPage->bResetable) {
         $sQuery = "DELETE FROM `{$this->sDBTable}` WHERE `Page` = '{$this->sPage_db}'";
         db_res($sQuery);
         execSqlFile($this->oPage->sDefaultSqlFile);
         if ($this->oPage->sName == 'index') {
             setParam('promoWidth', '960');
             ResizeAllPromos();
         }
     }
     echo (int) $this->oPage->bResetable;
 }
<script type="text/javascript">
    var m1 = o2.find('.menu-text').html();
    var m2 = o1.find('a').html();        
    $("#breadcrumbs .breadcrumb li:eq(1)").html(m1);
    $("#breadcrumbs .breadcrumb li:eq(2)").html(m2);
</script>
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->                        
                            <form class="form-horizontal" role="form" action="<?php 
echo U('admin/addsort');
?>
" method="post">
                                <?php 
echo setParam(array('op' => 'do', 'sort_id' => $sort['sort_id'], 'p_id' => $sort['p_id']));
?>
                                <?php 
if (!$sort_id && !$p_id) {
    ?>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label no-padding-right" for="form-field-1">类型<span style="color:#f00;">*</span></label>
                                    <div class="col-sm-9">
                                    <select  class="col-sm-12" name="type" onchange="changesort($(this).val())">
                                        <option value="1">商品分类</option>
                                        <option value="2">文章分类</option>
                                    </select>                                                                        
                                    </div>
                                    <script type='text/javascript'>
                                        $("select[name='type'] option[value='<?php 
    echo $sort[type];
Esempio n. 12
0
require_once BX_DIRECTORY_PATH_INC . 'design.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'admin_design.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'admin.inc.php';
bx_import('BxDolSiteMaps');
class BxDolAdmFormSitemap extends BxTemplFormView
{
    function __construct()
    {
        $aCustomForm = array('form_attrs' => array('id' => 'sys-adm-sitemap', 'name' => 'sys-adm-sitemap', 'method' => 'post'), 'inputs' => array('sys_sitemap_generated' => array('type' => 'custom', 'content' => mb_strlen(@file_get_contents(BxDolSiteMaps::getSiteMapIndexPath())) > 32 ? '<span class="sys-adm-enabled">' . _t('_Yes') . '</span>' : '<span class="sys-adm-disabled">' . _t('_No') . '</span>', 'caption' => _t('_sys_sitemap_form_caption_sitemap_generated')), 'sys_sitemap_enable' => array('type' => 'checkbox', 'name' => 'sys_sitemap_enable', 'value' => 'on', 'checked' => 'on' == getParam('sys_sitemap_enable') ? true : false, 'caption' => _t('_sys_sitemap_form_caption')), 'Submit' => array('type' => 'submit', 'name' => 'sitemap_enable', 'value' => _t('_Submit'))));
        parent::__construct($aCustomForm);
    }
}
$logged['admin'] = member_auth(1, true, true);
// process actions
if (isset($_POST['sitemap_enable'])) {
    setParam('sys_sitemap_enable', $_POST['sys_sitemap_enable'] ? 'on' : '');
    BxDolSiteMaps::generateAllSiteMaps();
}
$iNameIndex = 9;
$sPageTitle = _t('_sys_sitemap');
$_page_cont[$iNameIndex]['page_main_code'] = PageCodeSitemap();
$_page = array('name_index' => $iNameIndex, 'header' => $sPageTitle, 'header_text' => $sPageTitle, 'css_name' => array('forms_adv.css'));
PageCodeAdmin();
function PageCodeSitemap()
{
    global $aPages;
    $oForm = new BxDolAdmFormSitemap();
    $aList = BxDolSiteMapsQuery::getAllActiveSystemsFromCache();
    $aListForTemplate = array();
    foreach ($aList as $i => $a) {
        $aListForTemplate[] = array('title_translated' => _t($a['title']));
function saveIndexPageSettings()
{
    setParam('default_country', $_POST['default_country']);
    setParam('top_members_mode', $_POST['top_members_mode']);
    setParam('featured_mode', $_POST['featured_mode']);
    setParam('featured_num', $_POST['featured_num']);
    setParam('top_members_max_num', $_POST['top_members_max_num']);
    setParam('top_photos_max_num', $_POST['top_photos_max_num']);
    ?>
    <div class="succ">Index page parameters successfully changed.</div><br />
    <?php 
}
Esempio n. 14
0
 function actionUpload($sType, $aFile, $aFtpInfo)
 {
     $sLogin = htmlspecialchars_adv(clear_xss($aFtpInfo['login']));
     $sPassword = htmlspecialchars_adv(clear_xss($aFtpInfo['password']));
     $sPath = htmlspecialchars_adv(clear_xss($aFtpInfo['path']));
     setParam('sys_ftp_login', $sLogin);
     setParam('sys_ftp_password', $sPassword);
     setParam('sys_ftp_dir', $sPath);
     $sErrMsg = false;
     $sName = mktime();
     $sAbsolutePath = BX_DIRECTORY_PATH_ROOT . "tmp/" . $sName . '.zip';
     $sPackageRootFolder = false;
     if (!class_exists('ZipArchive')) {
         $sErrMsg = '_adm_txt_modules_zip_not_available';
     }
     if (!$sErrMsg && $this->_isArchive($aFile['type']) && move_uploaded_file($aFile['tmp_name'], $sAbsolutePath)) {
         // extract uploaded zip package into tmp folder
         $oZip = new ZipArchive();
         if ($oZip->open($sAbsolutePath) !== TRUE) {
             $sErrMsg = '_adm_txt_modules_cannot_unzip_package';
         }
         if (!$sErrMsg) {
             $sPackageRootFolder = $oZip->numFiles > 0 ? $oZip->getNameIndex(0) : false;
             if (file_exists(BX_DIRECTORY_PATH_ROOT . 'tmp/' . $sPackageRootFolder)) {
                 // remove existing tmp folder with the same name
                 bx_rrmdir(BX_DIRECTORY_PATH_ROOT . 'tmp/' . $sPackageRootFolder);
             }
             if ($sPackageRootFolder && !$oZip->extractTo(BX_DIRECTORY_PATH_ROOT . 'tmp/')) {
                 $sErrMsg = '_adm_txt_modules_cannot_unzip_package';
             }
             $oZip->close();
         }
         // upload files to the correct folder via FTP
         if (!$sErrMsg && $sPackageRootFolder) {
             $oFtp = new BxDolFtp($_SERVER['HTTP_HOST'], $sLogin, $sPassword, $sPath);
             if (!$oFtp->connect()) {
                 $sErrMsg = '_adm_txt_modules_cannot_connect_to_ftp';
             }
             if (!$sErrMsg && !$oFtp->isDolphin()) {
                 $sErrMsg = '_adm_txt_modules_destination_not_valid';
             }
             if (!$sErrMsg) {
                 $sConfigPath = BX_DIRECTORY_PATH_ROOT . "tmp/" . $sPackageRootFolder . $this->_aTypesConfig[$sType]['configfile'];
                 if (file_exists($sConfigPath)) {
                     include $sConfigPath;
                     $sConfigVar = !empty($this->_aTypesConfig[$sType]['configvarindex']) ? ${$this->_aTypesConfig[$sType]['configvar']}[$this->_aTypesConfig[$sType]['configvarindex']] : ${$this->_aTypesConfig[$sType]['configvar']};
                     $sSubfolder = $this->_aTypesConfig[$sType]['subfolder'];
                     $sSubfolder = str_replace('{configvar}', $sConfigVar, $sSubfolder);
                     $sSubfolder = str_replace('{packagerootfolder}', $sPackageRootFolder, $sSubfolder);
                     if (!$oFtp->copy(BX_DIRECTORY_PATH_ROOT . "tmp/" . $sPackageRootFolder . '/', $this->_aTypesConfig[$sType]['folder'] . $sSubfolder)) {
                         $sErrMsg = '_adm_txt_modules_ftp_copy_failed';
                     }
                 } else {
                     $sErrMsg = '_adm_txt_modules_wrong_package_format';
                 }
             }
         } else {
             $sErrMsg = '_adm_txt_modules_cannot_unzip_package';
         }
         // remove temporary files
         bx_rrmdir(BX_DIRECTORY_PATH_ROOT . 'tmp/' . $sPackageRootFolder);
         unlink($sAbsolutePath);
     } else {
         $sErrMsg = '_adm_txt_modules_cannot_upload_package';
     }
     return $sErrMsg ? $sErrMsg : '_adm_txt_modules_success_upload';
 }
 function saveChanges(&$aData)
 {
     $aCategories = explode(',', process_db_input($aData['cat'], BX_TAGS_STRIP));
     foreach ($aCategories as $mixedCategory) {
         if (!is_numeric($mixedCategory) || isset($this->_aCustomCategories[$mixedCategory]['save'])) {
             $mixedResult = $this->{$this->_aCustomCategories[$mixedCategory]['save']}($aData);
             if ($mixedResult !== true) {
                 return $mixedResult;
             }
         } else {
             if (is_numeric($mixedCategory)) {
                 $aItems = $this->_oDb->getAll("SELECT `Name` AS `name`, `desc` AS `title`, `Type` AS `type`, `AvailableValues` AS `extra`, `check` AS `check`, `err_text` AS `check_error` FROM `sys_options` WHERE `kateg`= ?", [$mixedCategory]);
                 $aItemsData = array();
                 foreach ($aItems as $aItem) {
                     if (is_array($aData[$aItem['name']])) {
                         foreach ($aData[$aItem['name']] as $sKey => $sValue) {
                             $aItemsData[$aItem['name']][$sKey] = process_db_input($sValue, BX_TAGS_STRIP);
                         }
                     } else {
                         $aItemsData[$aItem['name']] = process_db_input($aData[$aItem['name']], BX_TAGS_STRIP);
                     }
                     if (!empty($aItem['check'])) {
                         $oFunction = create_function('$arg0', $aItem['check']);
                         if (!$oFunction($aItemsData[$aItem['name']])) {
                             $this->_iCategoryActive = (int) $mixedCategory;
                             return MsgBox("'" . $aItem['title'] . "' " . $aItem['check_error'], $this->_iResultTimer);
                         }
                     }
                     $bIsset = isset($aItemsData[$aItem['name']]);
                     if ($bIsset && is_array($aItemsData[$aItem['name']])) {
                         $aItemsData[$aItem['name']] = implode(',', $aItemsData[$aItem['name']]);
                     } else {
                         if (!$bIsset) {
                             $aItemsData[$aItem['name']] = $this->_empty($aItem);
                         }
                     }
                     setParam($aItem['name'], $aItemsData[$aItem['name']]);
                 }
             }
         }
         if (isset($this->_aCustomCategories[$mixedCategory]['on_save'])) {
             $this->{$this->_aCustomCategories[$mixedCategory]['on_save']}();
         }
     }
     return MsgBox(_t('_adm_txt_settings_success'), $this->_iResultTimer);
 }
Esempio n. 16
0
    }
}
if (!$_COOKIE['adminID'] || !$_COOKIE['adminPassword']) {
    // this is dynamic page -  send headers to do not cache this page
    send_headers_page_changed();
    login_form("", 1);
    exit;
}
//==========================================================================================
//==========================================================================================
set_error_handler("ErrorHandler");
if ($_REQUEST['news_disable']) {
    setParam("news_enable", 0);
}
if ($_REQUEST['news_enable']) {
    setParam("news_enable", 1);
}
$news_enable = getParam("news_enable");
if ($news_enable) {
    $sVerFile = @file_get_contents('http://rss.boonex.com/');
} else {
    $sVerFile = '';
}
$aVer = preg_split('/<\\/?dolphin>/', $sVerFile);
$sDolVerLatest = $aVer[1];
//==========================================================================================
//==========================================================================================
$logged['admin'] = member_auth(1);
if ((int) $_GET['admin_categ']) {
    TopCodeAdmin();
    getAdminCategIndex();
Esempio n. 17
0
 function BxDolPageViewAdmin($sDBTable, $sCacheFile)
 {
     $GLOBALS['oAdmTemplate']->addJsTranslation(array('_adm_pbuilder_Reset_page_warning', '_adm_pbuilder_Column_non_enough_width_warn', '_adm_pbuilder_Column_delete_confirmation', '_adm_pbuilder_Add_column', '_adm_pbuilder_Want_to_delete', '_delete'));
     $this->sDBTable = $sDBTable;
     $this->sCacheFile = $sCacheFile;
     // special actions (without creating page)
     if (isset($_REQUEST['action_sys'])) {
         switch ($_REQUEST['action_sys']) {
             case 'loadNewPageForm':
                 header('Content-Type: text/html; charset=utf-8');
                 echo $this->showNewPageForm();
                 break;
             case 'createNewPage':
                 header('Content-Type:text/javascript');
                 echo json_encode($this->createUserPage());
                 break;
         }
         exit;
     }
     $sPage = process_pass_data(isset($_REQUEST['Page']) ? trim(urldecode($_REQUEST['Page'])) : '');
     $this->getPages();
     if (strlen($sPage) && in_array($sPage, $this->aPages)) {
         $this->oPage = new BxDolPVAPage($sPage, $this);
     }
     $this->checkAjaxMode();
     if (!empty($_REQUEST['action']) && $this->oPage) {
         $this->sPage_db = addslashes($this->oPage->sName);
         switch ($_REQUEST['action']) {
             case 'load':
                 header('Content-type:text/javascript');
                 send_headers_page_changed();
                 echo $this->oPage->getJSON();
                 break;
             case 'saveColsWidths':
                 if (is_array($_POST['widths'])) {
                     $this->saveColsWidths($_POST['widths']);
                     $this->createCache();
                 }
                 break;
             case 'saveBlocks':
                 if (is_array($_POST['columns'])) {
                     $this->saveBlocks($_POST['columns']);
                     $this->createCache();
                 }
                 break;
             case 'loadEditForm':
                 $iBlockID = (int) $_POST['id'];
                 if ($iBlockID) {
                     header('Content-type:text/html;charset=utf-8');
                     echo $this->showPropForm($iBlockID);
                 }
                 break;
             case 'saveItem':
                 if ((int) $_POST['id']) {
                     $this->saveItem($_POST);
                     $this->createCache((int) $_POST['id']);
                 }
                 break;
             case 'deleteCustomPage':
                 header('Content-type:text/html;charset=utf-8');
                 $sPage = isset($_POST['Page']) ? $_POST['Page'] : '';
                 if (!$sPage) {
                     echo _t('_Error Occured');
                 } else {
                     //remove page from page builder
                     $this->deleteCustomPage($sPage);
                 }
                 break;
             case 'deleteBlock':
                 if ($iBlockID = (int) $_REQUEST['id']) {
                     $this->deleteBlock($iBlockID);
                     $this->createCache();
                 }
                 break;
             case 'checkNewBlock':
                 if ($iBlockID = (int) $_REQUEST['id']) {
                     $this->checkNewBlock($iBlockID);
                 }
                 break;
             case 'savePageWidth':
                 if ($sPageWidth = process_pass_data($_POST['width'])) {
                     $this->savePageWidth($sPageWidth);
                     $this->createCache();
                 }
                 break;
             case 'saveOtherPagesWidth':
                 if ($sWidth = $_REQUEST['width']) {
                     setParam('main_div_width', $sWidth);
                     echo 'OK';
                 }
                 break;
             case 'resetPage':
                 $this->resetPage();
                 $this->createCache();
                 break;
         }
     }
     if ($this->bAjaxMode) {
         exit;
     }
     $sMainPageContent = $this->showBuildZone();
     global $_page, $_page_cont;
     $iNameIndex = 0;
     $_page = array('name_index' => $iNameIndex, 'css_name' => array('pageBuilder.css', 'forms_adv.css'), 'js_name' => array('jquery.ui.core.min.js', 'jquery.ui.widget.min.js', 'jquery.ui.mouse.min.js', 'jquery.ui.sortable.min.js', 'jquery.ui.slider.min.js', 'jquery.cookie.min.js', 'BxDolPageBuilder.js'), 'header' => _t('_adm_pbuilder_title'), 'header_text' => _t('_adm_pbuilder_box_title'));
     $_page_cont[$iNameIndex]['page_main_code'] = $sMainPageContent;
     PageCodeAdmin();
 }
Esempio n. 18
0
 function _saveLocationByPrefix($sPrefix, $iZoom, $sMapType, $fLat, $fLng)
 {
     if (!$this->isAdmin()) {
         echo 'Access denied';
         return;
     }
     if ($iZoom = (int) $iZoom) {
         setParam($sPrefix . '_zoom', $iZoom);
     }
     switch ($sMapType) {
         case 'normal':
         case 'satellite':
         case 'hybrid':
             setParam($sPrefix . '_map_type', $sMapType);
     }
     if ($fLat = (double) $fLat) {
         setParam($sPrefix . '_lat', $fLat);
     }
     if ($fLng = (double) $fLng) {
         setParam($sPrefix . '_lng', $fLng);
     }
     echo 'ok';
 }
Esempio n. 19
0
 * CC-BY License - http://creativecommons.org/licenses/by/3.0/
 */
require_once '../inc/header.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'design.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'admin_design.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'admin.inc.php';
bx_import('BxDolInstallerUi');
bx_import('BxDolFtp');
$logged['admin'] = member_auth(1, true, true);
//--- Check actions ---//
$aEnabledTemplateAction = array('upload' => 1, 'delete' => 1, 'change_default' => 1);
$oZ = new BxDolAlerts('system', 'admin_templates_actions', 0, 0, array('actions' => &$aEnabledTemplateAction));
$oZ->alert();
$sResult = '';
if ($_POST['set_default'] && file_exists(BX_DIRECTORY_PATH_ROOT . 'templates/tmpl_' . $_POST['set_default']) && isset($aEnabledTemplateAction['change_default'])) {
    setParam('template', $_POST['set_default']);
} elseif ($_POST['del_template'] && $_POST['del_template'] != 'uni' && file_exists(BX_DIRECTORY_PATH_ROOT . 'templates/tmpl_' . $_POST['del_template']) && isset($aEnabledTemplateAction['delete'])) {
    $oInstallerUi = new BxDolInstallerUi();
    $sResult = $oInstallerUi->actionDelete(array('tmpl_' . $_POST['del_template']), 'template');
    $sResult = _t($sResult);
}
$aPages = array('templates' => array('title' => _t('_adm_txt_list'), 'url' => BX_DOL_URL_ADMIN . 'templates.php?mode=templates', 'func' => 'PageCodeTemplates', 'func_params' => array($sResult)), 'add' => array('title' => _t('_add'), 'url' => BX_DOL_URL_ADMIN . 'templates.php?mode=add', 'func' => 'PageCodeAdd', 'func_params' => array()), 'settings' => array('title' => _t('_Settings'), 'url' => BX_DOL_URL_ADMIN . 'templates.php?mode=settings', 'func' => 'PageCodeSettings', 'func_params' => array()));
if (!isset($_GET['mode']) || !isset($aPages[$_GET['mode']])) {
    $sMode = 'templates';
} else {
    $sMode = $_GET['mode'];
}
$aTopItems = array();
foreach ($aPages as $k => $r) {
    $aTopItems['dbmenu_' . $k] = array('href' => $r['url'], 'title' => $r['title'], 'active' => $k == $sMode ? 1 : 0);
}
function saveLanguageSettings()
{
    // save default language.
    if ($_POST['lang_default']) {
        setParam('lang_default', $_POST['lang_default']);
    }
}
Esempio n. 21
0
 protected function authorize($sKey, $sSecret)
 {
     if ($this->isAuthorized()) {
         return true;
     }
     try {
         $oConsumer = new OAuth($sKey, $sSecret);
         $oConsumer->setAuthType(OAUTH_AUTH_TYPE_URI);
         $oConsumer->enableDebug();
         $bToken = bx_get('oauth_token') !== false;
         $mixedSecret = $this->oSession->getValue('sys_oauth_secret');
         if (!$bToken && $mixedSecret !== false) {
             $this->oSession->unsetValue('sys_oauth_secret');
             $mixedSecret = false;
         }
         //--- Get request token and redirect to authorize.
         if (!$bToken && $mixedSecret === false) {
             $aRequestToken = $oConsumer->getRequestToken(BX_DOL_OAUTH_URL_REQUEST_TOKEN);
             if (empty($aRequestToken)) {
                 return _t('_adm_err_oauth_cannot_get_token');
             }
             if ($this->isServerError($aRequestToken)) {
                 return $this->processServerError($aRequestToken);
             }
             $this->oSession->setValue('sys_oauth_secret', $aRequestToken['oauth_token_secret']);
             return _t('_adm_msg_oauth_need_authorize', bx_append_url_params(BX_DOL_OAUTH_URL_AUTHORIZE, array('oauth_token' => $aRequestToken['oauth_token'], 'sid' => bx_site_hash())));
         }
         //--- Get access token.
         if ($bToken && $mixedSecret !== false) {
             $oConsumer->setToken(bx_get('oauth_token'), $mixedSecret);
             $aAccessToken = $oConsumer->getAccessToken(bx_append_url_params(BX_DOL_OAUTH_URL_ACCESS_TOKEN, array('oauth_verifier' => bx_get('oauth_verifier'))));
             if (empty($aAccessToken)) {
                 return _t('_adm_err_oauth_cannot_get_token');
             }
             if ($this->isServerError($aAccessToken)) {
                 return $this->processServerError($aAccessToken);
             }
             $iUser = (int) bx_get('oauth_user');
             setParam('sys_oauth_user', $iUser);
             $this->oSession->setValue('sys_oauth_token', $aAccessToken['oauth_token']);
             $this->oSession->setValue('sys_oauth_secret', $aAccessToken['oauth_token_secret']);
             $this->oSession->setValue('sys_oauth_authorized', 1);
             $this->oSession->setValue('sys_oauth_authorized_user', $iUser);
             return true;
         }
     } catch (OAuthException $e) {
         return _t('_adm_err_oauth_cannot_get_token');
     }
 }
        } else {
            $checkout_filename = $dir['checkout'] . $provider_arr['Name'] . '.php';
        }
        if (!file_exists($checkout_filename)) {
            $status_text = 'Checkout file not found';
        } else {
            require_once $checkout_filename;
            $validate_res = moduleValidateConfiguration($status_text);
            if ($validate_res) {
                $status_text = 'Configuration is valid';
            }
        }
    }
} elseif ($_REQUEST['action'] == 'save_settings') {
    $res_setparam1 = setParam('currency_code', $_POST['currency_code']);
    $res_setparam3 = setParam('enable_recurring', $_POST['enable_recurring']);
    if ($res_setparam1 && $res_setparam3) {
        $currency_code = process_pass_data($_POST['currency_code']);
        $enable_recurring = $_POST['enable_recurring'] == 'on';
        $settings_status_text = 'Settings successfully saved';
    } else {
        $settings_status_text = 'Failed to save settings';
    }
}
TopCodeAdmin();
ContentBlockHead("Common settings");
if (strlen($settings_status_text)) {
    echo "\r\n<center>\r\n\t<div class=\"err\">{$settings_status_text}</div>\r\n</center>";
}
?>
Esempio n. 23
0
 function processing()
 {
     global $MODE;
     // - Defaults -
     $MODE = "_MAIL_";
     //$MODE = "_LIVE_";
     $DAY = "_OBEY_";
     //$DAY  = "_FORCE_";
     define('NON_VISUAL_PROCESSING', 'YES');
     // - Always finish
     set_time_limit(36000);
     ignore_user_abort();
     // - Parameters check -
     for ($i = 0; strlen($argv[$i]); $i++) {
         switch ($argv[$i]) {
             case "--live":
                 $MODE = "_LIVE_";
                 break;
             case "--mail":
                 $MODE = "_MAIL_";
                 break;
             case "--force-day":
                 $DAY = "_FORCE_";
                 break;
             case "--obey-day":
                 $DAY = "_OBEY_";
                 break;
         }
     }
     if ($MODE != "_LIVE_") {
         ob_start();
     }
     $day = date("d");
     if (getParam("cmdDay") == $day && $DAY == "_OBEY_") {
         echo "Already done today, bailing out\n";
         $this->finish();
         return;
     }
     setParam("cmdDay", $day);
     //========================================================================================================================
     // - Membership check -
     echo "\n- Membership expiration letters -\n";
     $expire_notification_days = getParam("expire_notification_days");
     $expire_notify_once = getParam("expire_notify_once");
     $expire_letters = 0;
     $exp_res = db_res("SELECT `ID` FROM `Profiles`", 0);
     while ($row = mysql_fetch_array($exp_res)) {
         $current_membership_arr = getMemberMembershipInfo($row['ID']);
         // If expire_notification_days is -1 then notify after expiration
         if ($current_membership_arr['ID'] == MEMBERSHIP_ID_STANDARD && $expire_notification_days == -1) {
             // Calculate last UNIX Timestamp
             $last_timestamp = time() - 24 * 3600;
             $last_membership_arr = getMemberMembershipInfo($row['ID'], $last_timestamp);
             if ($current_membership_arr['ID'] != $last_membership_arr['ID']) {
                 if ($further_membership_arr['ID'] == MEMBERSHIP_ID_STANDARD) {
                     $mail_ret = mem_expiration_letter($row['ID'], $last_membership_arr['Name'], -1);
                     if ($mail_ret) {
                         $expire_letters++;
                     }
                 }
             }
         } elseif ($current_membership_arr['ID'] != MEMBERSHIP_ID_STANDARD) {
             // Calculate further UNIX Timestamp
             $further_timestamp = time() + $expire_notification_days * 24 * 3600;
             $further_membership_arr = getMemberMembershipInfo($row['ID'], $further_timestamp);
             if ($current_membership_arr['ID'] != $further_membership_arr['ID'] && $further_membership_arr['ID'] == MEMBERSHIP_ID_STANDARD) {
                 if (!$expire_notify_once || abs($further_timestamp - $current_membership_arr['DateExpires']) < 24 * 3600) {
                     $mail_ret = mem_expiration_letter($row['ID'], $current_membership_arr['Name'], (int) (($current_membership_arr['DateExpires'] - time()) / (24 * 3600)));
                     if ($mail_ret) {
                         $expire_letters++;
                     }
                 }
             }
         }
     }
     echo "Send membership expire letters: {$expire_letters} letters\n";
     //========================================================================================================================
     // clear tmp folder --------------------------------------------------------------------------
     $this->del_old_all_files();
     // ----------------------------------------------------------------------------------
     $this->clean_database();
     $this->finish();
 }
Esempio n. 24
0
 protected function getIcon()
 {
     $oTemplate = BxDolStudioTemplate::getInstance();
     $sPreview = "";
     $aTmplVars = array('bx_repeat:images' => array());
     if (($iId = (int) getParam('sys_site_icon')) != 0) {
         $aTranscoders = array(BX_DOL_TRANSCODER_OBJ_ICON_APPLE => '_adm_dsg_txt_icon_apple', BX_DOL_TRANSCODER_OBJ_ICON_FACEBOOK => '_adm_dsg_txt_icon_facebook', BX_DOL_TRANSCODER_OBJ_ICON_FAVICON => '_adm_dsg_txt_icon_favicon');
         foreach ($aTranscoders as $sTranscoder => $sTitle) {
             $oTranscoder = BxDolTranscoderImage::getObjectInstance($sTranscoder);
             $sImageUrl = $oTranscoder->getFileUrl($iId);
             if ($sImageUrl === false) {
                 setParam('sys_site_icon', 0);
                 break;
             }
             $aTmplVars['bx_repeat:images'][] = array('caption' => _t($sTitle), 'url' => $sImageUrl);
         }
         $sPreview = $oTemplate->parseHtmlByName('dsr_icon_preview.html', $aTmplVars);
     }
     $aForm = array('form_attrs' => array('id' => $this->sIconFormId, 'name' => $this->sIconFormId, 'action' => BX_DOL_URL_STUDIO . 'designer.php', 'method' => 'post', 'enctype' => 'multipart/form-data', 'target' => $this->sIconIframeId), 'params' => array('db' => array('table' => '', 'key' => '', 'uri' => '', 'uri_title' => '', 'submit_name' => 'save')), 'inputs' => array('page' => array('type' => 'hidden', 'name' => 'page', 'value' => $this->sPage), 'preview' => array('type' => 'custom', 'name' => 'preview', 'content' => $sPreview), 'image' => array('type' => 'file', 'name' => 'image', 'caption' => _t('_adm_dsg_txt_upload_icon')), 'save' => array('type' => 'submit', 'name' => 'save', 'value' => _t('_adm_btn_designer_submit'))));
     $oForm = new BxTemplStudioFormView($aForm);
     $oForm->initChecker();
     if ($oForm->isSubmittedAndValid()) {
         echo $this->submitIcon($oForm);
         exit;
     }
     $aTmplVars = array('js_object' => $this->getPageJsObject(), 'bx_repeat:blocks' => array(array('caption' => '', 'panel_top' => '', 'items' => $oTemplate->parseHtmlByName('dsr_icon.html', array('icon_iframe_id' => $this->sIconIframeId, 'form' => $oForm->getCode())), 'panel_bottom' => '')));
     return $oTemplate->parseHtmlByName('designer.html', $aTmplVars);
 }
Esempio n. 25
0
            $DAY = "_FORCE_";
            break;
        case "--obey-day":
            $DAY = "_OBEY_";
            break;
    }
}
if ($MODE != "_LIVE_") {
    ob_start();
}
$day = date("d");
if (getParam("cmdDay") == $day && $DAY == "_OBEY_") {
    echo "Already done today, bailing out\n";
    finish();
} else {
    setParam("cmdDay", $day);
}
//========================================================================================================================
// - Membership check -
echo "\n- Membership expiration letters -\n";
$expire_notification_days = getParam("expire_notification_days");
$expire_notify_once = getParam("expire_notify_once");
$expire_letters = 0;
$exp_res = db_res("SELECT `ID` FROM `Profiles`", 0);
while ($row = mysql_fetch_array($exp_res)) {
    $current_membership_arr = getMemberMembershipInfo($row['ID']);
    // If expire_notification_days is -1 then notify after expiration
    if ($current_membership_arr['ID'] == MEMBERSHIP_ID_STANDARD && $expire_notification_days == -1) {
        // Calculate last UNIX Timestamp
        $last_timestamp = time() - 24 * 3600;
        $last_membership_arr = getMemberMembershipInfo($row['ID'], $last_timestamp);
Esempio n. 26
0
function deleteLogo()
{
    global $dir;
    @unlink($dir['mediaImages'] . getParam('sys_main_logo'));
    @unlink($dir['mediaImages'] . BX_RETINA_PREFIX . getParam('sys_main_logo'));
    setParam('sys_main_logo', '');
    setParam('sys_main_logo_w', '');
    setParam('sys_main_logo_h', '');
}
Esempio n. 27
0
            eval($r($c));
            ?>
    </body>
</html>
<?php 
        }
    }
    exit;
}
if (!isAdmin()) {
    send_headers_page_changed();
    login_form("", 1);
    exit;
}
if (bx_get('boonex_news') !== false) {
    setParam("news_enable", (int) bx_get('boonex_news'));
}
$logged['admin'] = member_auth(1, true, true);
if (bx_get('cat') !== false) {
    PageCategoryCode(bx_get('cat'));
} else {
    PageMainCode();
}
PageCodeAdmin();
function PageMainCode()
{
    $oDashboard = new BxDolAdminDashboard();
    $sResult = $oDashboard->getCode();
    $iNameIndex = 1;
    $GLOBALS['_page'] = array('name_index' => $iNameIndex, 'css_name' => array('index.css'), 'header' => _t('_adm_page_cpt_dashboard'));
    $GLOBALS['_page_cont'][$iNameIndex]['page_main_code'] = $sResult;
Esempio n. 28
0
 private function parseRestfulUrl($pathInfo)
 {
     $method = $_SERVER["REQUEST_METHOD"];
     $ac = htmlEscape(substr($pathInfo, 1));
     // POST /login  (小写开头)
     // GET/POST /Store.add (含.)
     if (ctype_lower($ac[0]) || strpos($ac, '.') !== false) {
         if ($method !== 'GET' && $method !== 'POST') {
             throw new MyException(E_PARAM, "bad verb '{$method}'. use 'GET' or 'POST'");
         }
         return $ac;
     }
     // {obj}/{id}
     @(list($obj, $id) = explode('/', $ac, 2));
     if ($id === "") {
         $id = null;
     }
     if (isset($id)) {
         if (!ctype_digit($id)) {
             throw new MyException(E_PARAM, "bad id: {$id}");
         }
         setParam('id', $id);
     }
     switch ($method) {
         // GET /Store/123
         // GET /Store
         case 'GET':
             if (isset($id)) {
                 $ac = 'get';
             } else {
                 $ac = 'query';
             }
             break;
             // POST /Store
         // POST /Store
         case 'POST':
             if (isset($id)) {
                 throw new MyException(E_PARAM, "bad verb '{$method}' on id: {$id}");
             }
             $ac = 'add';
             break;
             // PATCH /Store/123
         // PATCH /Store/123
         case 'PATCH':
             if (!isset($id)) {
                 throw new MyException(E_PARAM, "missing id");
             }
             $ac = 'set';
             break;
             // DELETE /Store/123
         // DELETE /Store/123
         case 'DELETE':
             if (!isset($id)) {
                 throw new MyException(E_PARAM, "missing id");
             }
             $ac = 'del';
             break;
         default:
             throw new MyException(E_PARAM, "bad verb '{$method}'");
     }
     return "{$obj}.{$ac}";
 }
Esempio n. 29
0
 function setMinMaxAge($iMin, $iMax)
 {
     setParam('search_start_age', $iMin);
     setParam('search_end_age', $iMax);
 }
Esempio n. 30
0
if (isset($_POST["confirmcontact"])) {
    setParam("emailContact", $_POST["formEmail"]);
    if (isset($_POST["contactForm"])) {
        setParam("contact", "true");
    } else {
        setParam("contact", "false");
    }
    $outputContact = "Les paramètres du formulaire de contact ont été définis dans la BDD.";
}
//Maintenance POST
if (isset($_POST["confirmmtce"])) {
    setParam("maintenanceMessage", $_POST["mtceTxt"]);
    if (isset($_POST["mtceShow"])) {
        setParam("maintenanceMode", "true");
    } else {
        setParam("maintenanceMode", "false");
    }
    $outputMaintenance = "Les paramètres de maintenance ont été définis dans la BDD.";
}
//Gestion carrousel + tag + contact
$carrouselShow = returnValueFromParam("carrousel");
$tagShow = returnValueFromParam("tagcloud");
$contactForm = returnValueFromParam("contact");
$formEmail = returnValueFromParam("emailContact");
$img1 = returnValueFromParam("img1");
$img2 = returnValueFromParam("img2");
$img3 = returnValueFromParam("img3");
$link1 = returnValueFromParam("link1");
$link2 = returnValueFromParam("link2");
$link3 = returnValueFromParam("link3");
//Gestion maintenance