Esempio n. 1
0
<?php

// $Header$
// Copyright( c )2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See below for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
// Initialization
require_once '../kernel/setup_inc.php';
// Is package installed and enabled
$gBitSystem->verifyPackage('articles');
require_once ARTICLES_PKG_PATH . 'BitArticle.php';
// Now check permissions to access this page
$gBitSystem->verifyPermission('p_articles_read');
if (!empty($_REQUEST['article_id'])) {
    $param = array('article_id' => (int) $_REQUEST['article_id']);
    bit_redirect(BitArticle::getDisplayUrlFromHash($param));
}
// Display the template
$gDefaultCenter = 'bitpackage:articles/center_display_articles.tpl';
$gBitSmarty->assignByRef('gDefaultCenter', $gDefaultCenter);
// Display the template
$gBitSystem->display('bitpackage:kernel/dynamic.tpl', tra('Articles'), array('display_mode' => 'display'));
Esempio n. 2
0
<?php

$feedback = array();
if (!empty($_REQUEST['skip'])) {
    bit_redirect(PACKAGER_PKG_URL . 'install.php?step=' . ++$step);
}
if (!empty($_REQUEST['db_download'])) {
    if (!$gInstall->fetchRemoteXmlFiles()) {
        $feedback['error'] = $gInstall->mErrors;
    } else {
        $feedback['success'] = 'All required database table data was downloaded and stored in:<br />' . dirname($gInstall->getXmlFilepath($gInstall->mTables[0]));
    }
    $tables = $gInstall->mTables;
    $tables[] = 'kernel_config';
    foreach ($tables as $table) {
        $xmlFiles[$table] = is_file($gInstall->getXmlFilepath($table));
    }
    $gBitSmarty->assign('xmlFiles', $xmlFiles);
}
if (!empty($_REQUEST['db_update'])) {
    if (!empty($_REQUEST['debug'])) {
        $gBitSystem->debug();
    }
    if (!$gInstall->packagerXmlToDb()) {
        $feedback['error'] = $gInstall->mErrors;
    }
    $app = "_done";
    $gBitSmarty->assign('next_step', $step + 1);
} else {
    $gBitSmarty->assign('next_step', $step);
}
Esempio n. 3
0
 */
require_once '../kernel/setup_inc.php';
$gBitSystem->verifyPackage('fisheye');
require_once FISHEYE_PKG_PATH . 'FisheyeGallery.php';
require_once FISHEYE_PKG_PATH . 'FisheyeImage.php';
global $gBitSystem, $fisheyeErrors, $fisheyeWarnings, $fisheyeSuccess;
//$gDebug = TRUE;
include_once FISHEYE_PKG_PATH . 'gallery_lookup_inc.php';
if ($gContent && $gContent->isValid()) {
    $gBitSystem->setCanonicalLink($gContent->getDisplayUrl());
}
global $gHideModules;
$gHideModules = $gBitSystem->isFeatureActive('fisheye_gallery_hide_modules');
if (!$gContent->isValid()) {
    // No gallery was indicated so we will redirect to the browse galleries page
    bit_redirect(FISHEYE_PKG_URL . "list_galleries.php", '404');
    die;
}
if ($gContent->isCommentable()) {
    $commentsParentId = $gContent->mContentId;
    $comments_vars = array('fisheyegallery');
    $comments_prefix_var = 'fisheyegallery:';
    $comments_object_var = 'fisheyegallery';
    $comments_return_url = $_SERVER['SCRIPT_NAME'] . "?gallery_id=" . $gContent->mGalleryId;
    include_once LIBERTY_PKG_PATH . 'comments_inc.php';
}
if (!empty($_REQUEST['download'])) {
    // Checked against global users group assignment so that feature can be restricted on a group level.
    // If content was checked, user would always have permission to do this.
    $gContent->verifyUserPermission('p_fisheye_download_gallery_arc');
    $gContent->download();
Esempio n. 4
0
<?php

require_once "../kernel/setup_inc.php";
require_once PACKAGER_PKG_PATH . "Packager.php";
require_once PACKAGER_PKG_PATH . "PackagerVersions.php";
require_once PACKAGER_PKG_PATH . "lookup_package.php";
require_once PACKAGER_PKG_PATH . "form_options_inc.php";
$gBitSystem->verifyPackage('packager');
$gBitSystem->verifyPermission('p_packager_edit_package');
$listHash = array('user_id' => $gBitUser->mUserId);
$packageList = $gPackager->getList($listHash);
$gBitSmarty->assign('packageList', $packageList);
$feedback = array();
if (!empty($_REQUEST['process_package']) && !empty($_FILES['package_upload']['tmp_name'])) {
    $storeHash = $_REQUEST;
    $storeHash['upload'] = $_FILES['package_upload'];
    if ($gVersions->store($storeHash)) {
        $gPackager->mPackage = $_REQUEST['package'];
        bit_redirect($gPackager->getDisplayUrl());
    } else {
        $feedback['error'] = $gVersions->mErrors;
    }
} elseif (!empty($_REQUEST['process_package'])) {
    // form was submitted but no file uploaded
    $feedback['error'] = tra('You did not provide us with a package.');
}
$gBitSmarty->assign('feedback', $feedback);
$gBitSystem->display('bitpackage:packager/upload.tpl', tra('Upload Package'), array('display_mode' => 'display'));
Esempio n. 5
0
<?php

require_once "../kernel/setup_inc.php";
require_once PACKAGER_PKG_PATH . "Packager.php";
require_once PACKAGER_PKG_PATH . "PackagerVersions.php";
require_once PACKAGER_PKG_PATH . "lookup_package.php";
require_once PACKAGER_PKG_PATH . "form_options_inc.php";
$gBitSystem->verifyPackage('packager');
//$gBitSystem->verifyPermission( 'p_packager_edit_package' );
$feedback = array();
// check that we're ready to roll
if (empty($_REQUEST['package'])) {
    bit_redirect(PACKAGER_PKG_URL);
} elseif (empty($gPackager->mInfo)) {
    $feedback['error'] = tra('The package you are looking for does not seem to exist');
}
$listHash = $_REQUEST;
$listHash['package'] = $gPackager->mPackage;
$versionList = $gVersions->getList($listHash);
$gBitSmarty->assign('versionList', $versionList);
$gBitSmarty->assign('feedback', $feedback);
$gBitSystem->display('bitpackage:packager/view_package.tpl', tra('View Package Details'), array('display_mode' => 'display'));
Esempio n. 6
0
        $formHash['remove'] = TRUE;
        $formHash['nl_id'] = $gContent->mNewsletterId;
        $gBitSystem->confirmDialog($formHash, array('warning' => tra('Are you sure you want to delete this newsletter?') . ' ' . $gContent->getTitle()));
    } else {
        if ($gContent->expunge()) {
            header("Location: " . NEWSLETTERS_PKG_URL . 'newsletters.php');
            die;
        }
    }
} elseif (isset($_REQUEST["save"])) {
    $sid = $gContent->store($_REQUEST);
    $gContent->storePreference('registration_optin', !empty($_REQUEST['registration_optin']) ? $_REQUEST['registration_optin'] : NULL);
    header("Location: " . $_SERVER['SCRIPT_NAME']);
    die;
} elseif (!empty($_REQUEST['cancel'])) {
    bit_redirect(NEWSLETTERS_PKG_URL);
}
$gContent->invokeServices('content_edit_function');
$newsletters = $gContent->getList($listHash);
$gBitSmarty->assignByRef('newsletters', $newsletters);
$gBitSmarty->assignByRef('listInfo', $listHash);
// Fill array with possible number of questions per page
/*
$freqs = array();

for ($i = 0; $i < 90; $i++) {
	$aux["i"] = $i;

	$aux["t"] = $i * 24 * 60 * 60;
	$freqs[] = $aux;
}
Esempio n. 7
0
}
// eof: find gv for a particular order and set page
if ($_GET['action'] == 'confirmrelease' && BitBase::verifyId($_GET['gid'])) {
    $gv = $gBitDb->getRow("select release_flag from " . TABLE_COUPON_GV_QUEUE . " where unique_id=?", array($_GET['gid']));
    if ($gv['release_flag'] == 'N' && ($gv = $gBitDb->getRow("select customer_id, amount, order_id from " . TABLE_COUPON_GV_QUEUE . " where unique_id=?", array($_GET['gid'])))) {
        $fromUser = new BitUser($gv['customer_id']);
        $fromUser->load();
        if ($couponCode = CommerceVoucher::customerSendCoupon($fromUser, array('email' => $fromUser->getField('email'), 'to_name' => $fromUser->getDisplayName()), $gv['amount'])) {
            $gBitSmarty->assign('gvAmount', $currencies->format($gv['amount']));
            //send the message
            $textMessage = $gBitSmarty->fetch('bitpackage:bitcommerce/gv_purchase_email_text.tpl');
            $htmlMessage = $gBitSmarty->fetch('bitpackage:bitcommerce/gv_purchase_email_html.tpl');
            zen_mail($fromUser->getDisplayName(), $fromUser->getField('email'), TEXT_REDEEM_GV_SUBJECT . TEXT_REDEEM_GV_SUBJECT_ORDER . $gv['order_id'], $textMessage, STORE_NAME, EMAIL_FROM, $htmlMessage, 'gv_queue');
            $gBitDb->Execute("update " . TABLE_COUPON_GV_QUEUE . "\n\t\t\t\t\t\t  set `release_flag`= 'Y'\n\t\t\t\t\t\t  where `unique_id`='" . $_GET['gid'] . "'");
        }
        bit_redirect(BITCOMMERCE_PKG_URL . 'admin/gv_queue.php');
    }
}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php 
echo HTML_PARAMS;
?>
>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php 
echo CHARSET;
?>
">
<title><?php 
echo TITLE;
Esempio n. 8
0
    $gContent->addHit();
}
$now = $gBitSystem->getUTCTime();
$blogPost = new BitBlogPost();
$listHash = array();
$listHash['blog_id'] = $gContent->getField('blog_id');
$listHash['parse_data'] = TRUE;
$listHash['max_records'] = $gContent->getField('max_posts');
$listHash['load_num_comments'] = TRUE;
$blogPosts = $blogPost->getList($listHash);
if (count($blogPosts)) {
    // If there're more records then assign next_offset
    $gBitSmarty->assignByRef('blogPosts', $blogPosts);
    $gBitSmarty->assign('listInfo', $listHash);
} elseif ($gContent->hasPostPermission()) {
    bit_redirect(BLOGS_PKG_URL . 'post.php?blog_id=' . $gContent->getField('blog_id'));
}
if ($gBitSystem->isFeatureActive('users_watches')) {
    if ($gBitUser->isValid() && isset($_REQUEST['watch_event'])) {
        if ($_REQUEST['watch_action'] == 'add') {
            $blogPost = new BitBlogPost($_REQUEST['watch_object']);
            if ($blogPost->load()) {
                $gBitUser->storeWatch($_REQUEST['watch_event'], $_REQUEST['watch_object'], tra('blog'), $blogPost->getTitle(), $blogPost->getDisplayUrl());
            }
        } else {
            $gBitUser->expungeWatch($_REQUEST['watch_event'], $_REQUEST['watch_object']);
        }
    }
    $gBitSmarty->assign('user_watching_blog', 'n');
    if ($watch = $gBitUser->getEventWatches('blog_post', $listHash['blog_id'])) {
        $gBitSmarty->assign('user_watching_blog', 'y');
Esempio n. 9
0
 * All Rights Reserved. See below for details and a complete list of authors.
 * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
 * @package boards
 * @subpackage functions
 */
/**
 * required setup
 */
require_once '../kernel/setup_inc.php';
// Is package installed and enabled
$gBitSystem->verifyPackage('boards');
// if we're getting a migrate id then lets move on right away
if (@BitBase::verifyId($_REQUEST['migrate_board_id'])) {
    require_once BOARDS_PKG_PATH . 'BitBoard.php';
    if ($_REQUEST['b'] = BitBoard::lookupByMigrateBoard($_REQUEST['migrate_board_id'])) {
        bit_redirect(BOARDS_PKG_URL . 'index.php?b=' . $_REQUEST['b']);
    }
}
// Load up the board
require_once BOARDS_PKG_PATH . 'lookup_inc.php';
if (!$gContent->isValid()) {
    $gBitSystem->fatalError("The board you requested could not be found. <a href='" . BOARDS_PKG_URL . "'>View all boards</a>", NULL, NULL, HttpStatusCodes::HTTP_GONE);
}
// approve or reject ananymous comments
if (!empty($_REQUEST['action'])) {
    // Check edit perms on the group
    $gContent->verifyUpdatePermission();
    // Check the ticket
    $gBitUser->verifyTicket();
    // Load up the comment as a board post
    require_once BOARDS_PKG_PATH . 'BitBoardPost.php';
Esempio n. 10
0
 */
$gBitSystem->verifyPackage('diasalsa');
require_once DIASALSA_PKG_PATH . 'lookup_action_inc.php';
// check permissions to access this page
if (!$gContent->isValid()) {
    $gBitSystem->setHttpStatus(404);
    $gBitSystem->fatalError("The action you requested could not be found.");
}
$gContent->verifyAdminPermission();
// nuke it if request confirmed
if (isset($_REQUEST["confirm"])) {
    $gBitUser->verifyTicket();
    // If we're expunging we need to get an admin cookie from Salsa
    $gContent->loginAdmin();
    if ($gContent->expunge()) {
        bit_redirect(DIASALSA_PKG_URL);
    } else {
        $feedback['error'] = $gContent->mErrors;
        $gBitSmarty->assign('feedback', $feedback);
        $gBitSystem->setBrowserTitle('There were errors trying to remove ' . $gContent->getTitle());
        vd($gContent->mErrors);
        $gBitSystem->fatalError($gContent->mErrors);
    }
    // clean up
    $gContent->closeConnection();
} else {
    // confirm request
    $gBitSystem->setBrowserTitle('Confirm removal of ' . $gContent->getTitle());
    $msgHash = array('label' => tra('Remove Action'), 'confirm_item' => $gContent->getTitle(), 'warning' => tra('This will remove the action.'), 'error' => tra('This cannot be undone!'));
    $formHash['action_id'] = $gContent->mActionId;
    $gBitSystem->confirmDialog($formHash, $msgHash);
Esempio n. 11
0
         $formHash['remove'] = TRUE;
         $formHash['structure_id'] = $_REQUEST['structure_id'];
         $msgHash = array('label' => tra('Remove content from Structure'), 'confirm_item' => $gContent->getTitle() . tra('and any subitems'), 'warning' => tra('This will remove the content from the structure but will <strong>not</strong> modify or remove the content itself.'));
         $gBitSystem->confirmDialog($formHash, $msgHash);
     }
 } elseif (isset($_REQUEST["move_node"])) {
     if ($_REQUEST["move_node"] == '1') {
         $gStructure->moveNodeWest();
     } elseif ($_REQUEST["move_node"] == '2') {
         $gStructure->moveNodeNorth();
     } elseif ($_REQUEST["move_node"] == '3') {
         $gStructure->moveNodeSouth();
     } elseif ($_REQUEST["move_node"] == '4') {
         $gStructure->moveNodeEast();
     }
     bit_redirect($_SERVER['SCRIPT_NAME'] . '?structure_id=' . $gStructure->mInfo["structure_id"]);
 } elseif (!empty($_REQUEST['submit_structure'])) {
     if ($gStructure->storeStructure($_REQUEST)) {
         $feedback['success'] = tra("Your changes were successfully saved.");
     } else {
         $feedback['error'] = $gStructure->mErrors;
     }
 } elseif (isset($_REQUEST["create"]) || isset($_REQUEST["action"]) && $_REQUEST["action"] == 'add') {
     $structureHash['root_structure_id'] = $rootStructure->mStructureId;
     $structureHash['parent_id'] = $_REQUEST['structure_id'];
     $after = null;
     if (isset($_REQUEST['after_ref_id'])) {
         $structureHash['after_ref_id'] = $_REQUEST['after_ref_id'];
     }
     if (!empty($_REQUEST['name'])) {
         $gStructure->s_create_page($_REQUEST["structure_id"], $after, $_REQUEST["name"], '');
Esempio n. 12
0
$gBitSystem->verifyPackage('group');
require_once GROUP_PKG_PATH . 'lookup_group_inc.php';
// must be owner or admin to edit an existing group
if ($gContent->isValid()) {
    $gContent->verifyUpdatePermission();
    // if it has a custom theme lets theme it
    $gContent->setGroupStyle();
} else {
    $gContent->verifyCreatePermission();
}
// user canceled out get us out of here
if (!empty($_REQUEST['cancel'])) {
    if ($gContent->isValid()) {
        bit_redirect($gContent->getDisplayUrl());
    } else {
        bit_redirect(GROUP_PKG_URL);
    }
}
// get content types groups can associate with their group
$exclude = array('bitboard', 'bitgroup', 'bitcomment');
$formGroupContent = array();
foreach ($gLibertySystem->mContentTypes as $cType) {
    if (!in_array($cType['content_type_guid'], $exclude) && $gBitSystem->getConfig('group_content_' . $cType['content_type_guid'])) {
        $formGroupContent['guids'][$cType['content_type_guid']] = $gLibertySystem->getContentTypeName($cType['content_type_guid']);
    }
}
// If we are in preview mode then preview it!
if (isset($_REQUEST["preview"])) {
    $gContent->load();
    $gContent->preparePreview($_REQUEST);
    $gBitSmarty->assign('preview', 'y');
Esempio n. 13
0
// ASSIGN USER TO ROLES
// Initialization
require_once '../../kernel/setup_inc.php';
$gBitSystem->verifyPermission('p_users_admin');
if (!$gBitUser->userExists(array('user_id' => $_REQUEST["assign_user"]))) {
    $gBitSystem->fatalError(tra("User doesnt exist"));
}
$assignUser = new RolePermUser($_REQUEST["assign_user"]);
$assignUser->load(TRUE);
if ($assignUser->isAdmin() && !$gBitUser->isAdmin()) {
    $gBitSystem->fatalError(tra('You cannot modify a system administrator.'));
}
if (isset($_REQUEST["action"])) {
    $gBitUser->verifyTicket();
    if ($_REQUEST["action"] == 'assign') {
        $assignUser->addUserToRole($assignUser->mUserId, $_REQUEST["role_id"]);
    } elseif ($_REQUEST["action"] == 'removerole') {
        $assignUser->removeUserFromRole($_REQUEST["assign_user"], $_REQUEST["role_id"]);
    }
    bit_redirect('assign_role_user.php?assign_user='******'set_default'])) {
    $gBitUser->verifyTicket();
    $assignUser->storeUserDefaultRole($assignUser->mUserId, $_REQUEST['default_role']);
    $assignUser->load();
}
$gBitSmarty->assignByRef('assignUser', $assignUser);
$listHash = array('sort_mode' => 'role_name_asc');
$gBitSmarty->assign('roles', $gBitUser->getAllRoles($listHash));
$gBitSystem->setBrowserTitle('Edit User: '******'bitpackage:users/admin_assign_role_user.tpl', NULL, array('display_mode' => 'admin'));
Esempio n. 14
0
                    $reload = TRUE;
                } else {
                    $feedback['error'] = tra('There was a problem clearing out the cache.');
                }
            }
        }
    }
    // nexus needs to rewrite the cache right away to avoid errors
    if ($gBitSystem->isPackageActive('nexus') && ($_GET['prune'] == 'all' || $_GET['prune'] == 'nexus')) {
        require_once NEXUS_PKG_PATH . 'Nexus.php';
        $nexus = new Nexus();
        $nexus->rewriteMenuCache();
    }
    // depending on what we've just nuked, we need to reload the page
    if (!empty($reload)) {
        bit_redirect(KERNEL_PKG_URL . "admin/admin_system.php?pruned=1");
    }
}
if (!empty($_GET['compiletemplates'])) {
    cache_templates(BIT_ROOT_PATH, $gBitLanguage->getLanguage(), $_GET['compiletemplates']);
}
foreach ($diskUsage as $key => $item) {
    $diskUsage[$key]['du'] = du($item['path']);
}
$gBitSmarty->assign('diskUsage', $diskUsage);
$languages = array();
$languages = $gBitLanguage->listLanguages();
ksort($languages);
$templates = array();
$langdir = TEMP_PKG_PATH . "templates_c/" . $gBitSystem->getConfig('style') . "/";
foreach (array_keys($languages) as $clang) {
Esempio n. 15
0
/**
 * @package fisheye
 * @subpackage functions
 */
/**
 * required setup
 */
require_once '../kernel/setup_inc.php';
require_once FISHEYE_PKG_PATH . 'FisheyeGallery.php';
require_once FISHEYE_PKG_PATH . 'FisheyeImage.php';
global $gBitSystem;
include_once FISHEYE_PKG_PATH . 'image_lookup_inc.php';
if ($gContent->isValid()) {
    $gContent->verifyUpdatePermission();
} else {
    bit_redirect(FISHEYE_PKG_URL . '?user_id=' . $gBitUser->mUserId);
}
//Utility function, maybe should be moved for use elsewhere. Seems like it has a multitude of possible hook points
function convertSmartQuotes($string)
{
    //UTF-8
    $search = array("‘", "’", "“", "”", "–", "—", "…");
    $replace = array("'", "'", '"', '"', '-', '--', '...');
    $string = str_replace($search, $replace, $string);
    //Windows
    $search = array(chr(145), chr(146), chr(147), chr(148), chr(150), chr(151), chr(133));
    $replace = array("'", "'", '"', '"', '-', '--', '...');
    $string = str_replace($search, $replace, $string);
    return $string;
}
if (!empty($_REQUEST['edit'])) {
Esempio n. 16
0
<?php

$themeSettings = array('site_use_jscalendar' => array('label' => 'Enable JSCalendar', 'note' => 'If checked, a calendar popup allows for easily selecting a date using an appealing interface.'), 'themes_collapsible_modules' => array('label' => 'Collapsible modules', 'note' => 'This allows users to collapse modules by clicking on their titles. Can be useful if you use many modules.'), 'site_disable_fat' => array('label' => "Disable fading", 'note' => "If checked, success, warning or error messages display no fading effect anymore."), 'site_disable_jstabs' => array('label' => "Disable Javascript tabs", 'note' => "If checked, admin pages flow vertically, instead of displaying in a 'tabbed pages' interface."), 'site_fancy_zoom' => array('label' => "Enable Fancy Zoom for images", 'note' => "If checked, a Javascript zooms images when clicking on them. This will modify the behaviour when viewing most images. If you are running a commercial site, please read the license notice in /util/javascript/fancyzoom/js-global/FancyZoom.js."), 'site_mods_req_admn_grp' => array('label' => 'Modules require membership', 'note' => 'If enabled, modules with group/role restrictions require the administrator to be member of the group/role. If disabled, all modules are always visible to administrators.'), 'themes_joined_js_css' => array('label' => 'Joined CSS and JS', 'note' => 'If enabled, javascript and CSS files will be concatenated into single files to reduce server requests. This is useful for webdesigners and developers. Please enable this feature on live sites.'), 'themes_packed_js_css' => array('label' => 'Packed CSS and JS', 'note' => 'If enabled, javascript and CSS files will be reduced to their smallest possible size. This is useful for webdesigners and developers. Please enable this feature on live sites.'), 'themes_disable_pkg_css' => array('label' => 'Disable All Package CSS', 'note' => 'If checked, all css that is automatically included by packages will be disabled. If you want to include some of the package css it is recommended you copy that css to your theme css file.'));
$gBitSmarty->assign('themeSettings', $themeSettings);
if (!empty($_REQUEST['change_prefs'])) {
    $pref_simple_values = array("site_biticon_display_style", "site_icon_size", "themes_jquery_hosting", "default_icon_style");
    foreach ($pref_simple_values as $svitem) {
        simple_set_value($svitem, THEMES_PKG_NAME);
    }
    foreach (array_keys($themeSettings) as $toggle) {
        simple_set_toggle($toggle, THEMES_PKG_NAME);
    }
    // due to the packing / joining options, we will remove the cache and reload the page
    $gBitThemes->mThemeCache->expungeCache();
    bit_redirect(KERNEL_PKG_URL . "admin/index.php?page=themes");
}
// set the options biticon takes
$biticon_display_options = array('icon' => tra('Icon'), 'text' => tra('Text'), 'icon_text' => tra('Icon and Text'));
$gBitSmarty->assign("biticon_display_options", $biticon_display_options);
// get the icon styles
$subDirs = array('style_info');
$iconStyles = $gBitThemes->getStylesList(CONFIG_PKG_PATH . "styles/icons/", NULL, $subDirs);
foreach ($iconStyles as $key => $style) {
    $iconStyles[$key] = str_replace("_", " ", $style['style']);
}
$gBitSmarty->assign_by_ref("iconStyles", $iconStyles);
$biticon_sizes = array('small' => tra('Small'), 'large' => tra('Large'));
$gBitSmarty->assign("biticon_sizes", $biticon_sizes);
// These numbers are intentionally off by 1 due to the way IE fixes name their js
$jqueryOptions = array('jquery' => tra('Google Hosted'), 'jquerylocal' => tra('Local'));
$gBitSmarty->assign('jqueryOptions', $jqueryOptions);
Esempio n. 17
0
    switch ($_REQUEST['action']) {
        case 'switch_status':
            $status = $gBitDb->getOne("SELECT coupon_restrict FROM " . TABLE_COUPON_RESTRICT . " WHERE restrict_id = ?", array($_GET['info']));
            $new_status = $status == 'N' ? 'Y' : 'N';
            $gBitDb->query("UPDATE " . TABLE_COUPON_RESTRICT . " SET coupon_restrict = ? WHERE restrict_id = ?", array($new_status, $_GET['info']));
            bit_redirect($_SERVER['SCRIPT_NAME'] . '?cid=' . $gCoupon->mCouponId);
            break;
        case 'Add':
            $gCoupon->storeRestriction($_REQUEST);
            bit_redirect($_SERVER['SCRIPT_NAME'] . '?cid=' . $gCoupon->mCouponId);
            break;
        case 'remove':
            if (!empty($_GET['info'])) {
                $gBitDb->query("delete from " . TABLE_COUPON_RESTRICT . " where restrict_id = ?", array($_GET['info']));
            }
            bit_redirect($_SERVER['SCRIPT_NAME'] . '?cid=' . $gCoupon->mCouponId);
            break;
    }
}
if (isset($_POST['cPath_prod'])) {
    $current_category_id = $_POST['cPath_prod'];
} else {
    $_POST['cPath_prod'] = NULL;
}
$productsList = $gBitDb->getAssoc("select p.`products_id`, pd.`products_name` from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.`products_id` = pd.`products_id` and pd.`language_id` = ? and p.`products_id` = p2c.`products_id` and p2c.`categories_id` = ? order by pd.`products_name`", array($_SESSION['languages_id'], $_POST['cPath_prod']));
$gBitSmarty->assign_by_ref('productsList', $productsList);
$gBitSmarty->assign_by_ref('gCoupon', $gCoupon);
require_once BITCOMMERCE_PKG_PATH . 'classes/CommerceProductManager.php';
$productManager = new CommerceProductManager();
$gBitSmarty->assign('optionsList', $productManager->getOptionsList());
$categoryTree = zen_get_category_tree();
Esempio n. 18
0
<?php

/**
 * $Id$
 * @package address
 * @subpackage 
 */
// required setup
require_once '../kernel/setup_inc.php';
$gBitSystem->verifyPackage('address');
include_once ADDRESS_PKG_PATH . 'lookup_inc.php';
if (!$gContent->isValid()) {
    $gBitSystem->fatalError("No address indicated");
}
$gContent->verifyExpungePermission();
if (isset($_REQUEST["confirm"])) {
    if ($gContent->expunge()) {
        bit_redirect(ADDRESS_PKG_URL);
    } else {
        vd($gContent->mErrors);
    }
}
$gBitSystem->setBrowserTitle(tra('Confirm delete of: ') . $gContent->getTitle());
$formHash['remove'] = TRUE;
$formHash['address_id'] = $_REQUEST['address_id'];
$msgHash = array('label' => tra('Delete Address'), 'confirm_item' => $gContent->getTitle(), 'warning' => tra('This address will be completely deleted.<br />This cannot be undone!'));
$gBitSystem->confirmDialog($formHash, $msgHash);
Esempio n. 19
0
$listHash['max_records'] = -1;
$listHash['content_permission'] = 'p_treasury_upload_item';
$galleryList = $gContent->getList($listHash);
$gBitSmarty->assign('galleryList', $galleryList);
// if we have no gallery we can upload our stuff into and we can't create a new one, we can't upload a file
if (empty($galleryList) && !$gBitUser->hasPermission('p_treasury_create_gallery')) {
    $gBitSystem->fatalPermission('p_treasury_upload_item');
}
if (!empty($_REQUEST['content_id'])) {
    $galleryContentIds[] = $_REQUEST['content_id'];
    $gBitSmarty->assign('galleryContentIds', $galleryContentIds);
}
if (!empty($_REQUEST['treasury_store'])) {
    $treasuryItem = new TreasuryItem();
    if ($treasuryItem->batchStore($_REQUEST)) {
        bit_redirect($_REQUEST['redirect']);
    } else {
        vd($treasuryItem->mErrors);
    }
}
if ($gBitSystem->isPackageActive('gigaupload')) {
    gigaupload_smarty_setup(TREASURY_PKG_URL . 'upload.php');
} elseif ($gBitSystem->isFeatureActive('treasury_extended_upload_slots')) {
    $gBitThemes->loadAjax('mochikit');
} else {
    $gBitThemes->loadJavascript(UTIL_PKG_PATH . 'javascript/libs/multifile.js', TRUE);
}
$gContent->invokeServices('content_edit_function');
$gBitSmarty->assign('feedback', !empty($feedback) ? $feedback : NULL);
// get the ajax file browser working
if ($gBitSystem->isFeatureActive('treasury_file_import_path') && $gBitUser->hasPermission('p_treasury_import_item')) {
Esempio n. 20
0
        bit_redirect(BITCOMMERCE_PKG_URL . 'admin/products_options.php');
    }
} elseif (!empty($_REQUEST['save_attribute'])) {
    $productManager->storeOptionsValue($_REQUEST, $_FILES);
    bit_redirect(BITCOMMERCE_PKG_URL . 'admin/products_options.php');
} elseif (!empty($_REQUEST['save_attribute_map'])) {
    $gBitProduct->expungeAllAttributes();
    if (!empty($_REQUEST['products_options'])) {
        foreach ($_REQUEST['products_options'] as $optionId) {
            $gBitProduct->storeAttributeMap($optionId);
        }
    }
    bit_redirect(BITCOMMERCE_PKG_URL . 'admin/products_options.php?products_id=' . $gBitProduct->getField('products_id'));
} elseif (!empty($_REQUEST['save_option'])) {
    if ($productManager->storeOption($_REQUEST, $_FILES)) {
        bit_redirect(BITCOMMERCE_PKG_URL . 'admin/products_options.php');
    } else {
        bit_error_log('option store failed');
        bit_error_log($_REQUEST);
    }
}
$listHash = array();
$groups = $gBitUser->getAllGroups($listHash);
$groupList[] = '';
foreach ($groups as $group) {
    $groupList[$group['group_id']] = $group['group_name'];
}
$gBitSmarty->assign_by_ref('groupList', $groupList);
if (!empty($editTpl)) {
    $gBitSmarty->assign_by_ref('editTpl', $editTpl);
}
Esempio n. 21
0
        $gBitSystem->fatalError(tra('You do not have permission to delete this topic.'));
    }
    if (!empty($_REQUEST['cancel'])) {
        // user cancelled - just continue on, doing nothing
    } elseif (empty($_REQUEST['confirm'])) {
        $formHash['remove'] = TRUE;
        $formHash['t'] = $_REQUEST['t'];
        $gBitSystem->confirmDialog($formHash, array('warning' => tra('Are you sure you want to delete this topic?') . ' ' . $gContent->getTitle(), 'error' => tra('This cannot be undone!')));
    } else {
        // @TODO Topic should extend LibertyComment - but until that day we load it up a second time
        $topicAsComment = new LibertyComment($_REQUEST['t']);
        if (!$topicAsComment->expunge()) {
            $gBitSmarty->assignByRef('errors', $topicAsComment->mErrors);
        }
        // send us back to the baord - http_referer won't work with confirm process
        bit_redirect(BOARDS_PKG_URL . 'index.php?b=' . $gContent->mInfo['board_id']);
    }
    // User pref options on a topic - not really editing but this simplifies topic related processes putting it here
} elseif (isset($_REQUEST['new']) || isset($_REQUEST['notify'])) {
    // Check permissions to view this topic
    $gContent->verifyViewPermission();
    if (isset($_REQUEST['new']) && is_numeric($_REQUEST['new'])) {
        $rslt = $gContent->readTopicSet($_REQUEST['new']);
    } elseif (isset($_REQUEST['notify']) && is_numeric($_REQUEST['notify'])) {
        $rslt = $gContent->notify($_REQUEST['notify']);
    }
}
if ($rslt) {
    // Return us to where we came from
    header("location: " . $_SERVER['HTTP_REFERER']);
} else {
Esempio n. 22
0
    if ($passswordError = $gBitUser->verifyPasswordFormat($_REQUEST["pass"], $_REQUEST["pass2"])) {
        $gBitSystem->fatalError(tra($passswordError));
    }
    $validated = FALSE;
    if (!empty($_REQUEST["provpass"])) {
        if ($validated = $gBitUser->confirmRegistration($userInfo['user_id'], $_REQUEST["provpass"])) {
            if ($gBitSystem->isFeatureActive('send_welcome_email')) {
                $siteName = $gBitSystem->getConfig('site_title', $_SERVER['HTTP_HOST']);
                // Send the welcome mail
                $gBitSmarty->assign('siteName', $_SERVER["SERVER_NAME"]);
                $gBitSmarty->assign('mail_site', $_SERVER["SERVER_NAME"]);
                $gBitSmarty->assign('mail_user', $userInfo['login']);
                $gBitSmarty->assign('mailPassword', $_REQUEST['pass']);
                $gBitSmarty->assign('mailEmail', $validated['email']);
                $mail_data = $gBitSmarty->fetch('bitpackage:users/welcome_mail.tpl');
                mail($validated["email"], tra('Welcome to') . ' ' . $siteName, $mail_data, "From: " . $gBitSystem->getConfig('site_sender_email') . "\r\nContent-type: text/plain;charset=utf-8\r\n");
            }
        } else {
            $gBitSystem->fatalError(tra("Password reset request is invalid or has expired"));
        }
    } elseif (!($validated = $gBitUser->validate($userInfo['email'], $_REQUEST["oldpass"], '', ''))) {
        $gBitSystem->fatalError(tra("Invalid old password"));
    }
    if ($validated) {
        $gBitUser->storePassword($_REQUEST["pass"], !empty($userInfo['login']) ? $userInfo['login'] : $userInfo['email']);
        $url = $gBitUser->login(!empty($userInfo['login']) ? $userInfo['login'] : $userInfo['email'], $_REQUEST["pass"]);
    }
    bit_redirect($url);
}
// Display the template
$gBitSystem->display('bitpackage:users/change_password.tpl', 'Change Password', array('display_mode' => 'display'));
Esempio n. 23
0
    $urlHash = parse_url($_SERVER['HTTP_REFERER']);
    if ($urlHash['path'] != $_SERVER['SCRIPT_NAME']) {
        $_SESSION['structure_referer'] = $_SERVER['HTTP_REFERER'];
    }
}
if ($gBitThemes->isAjaxRequest()) {
    header('Content-Type: text/html; charset=utf-8');
    print $gBitSmarty->fetch("bitpackage:liberty/add_structure_feedback_inc.tpl");
    exit;
} else {
    $_REQUEST['thumbnail_size'] = 'icon';
    include_once LIBERTY_PKG_PATH . 'get_content_list_inc.php';
    foreach ($contentList as $cItem) {
        $cList[$contentTypes[$cItem['content_type_guid']]][$cItem['content_id']] = $cItem['title'] . ' [id: ' . $cItem['content_id'] . ']';
    }
    $gBitSmarty->assign_by_ref('contentListHash', $contentList);
    $gBitSmarty->assign('contentList', $cList);
    $gBitSmarty->assign('contentSelect', $contentSelect);
    $gBitSmarty->assign('contentTypes', $contentTypes);
    $subpages = $gStructure->getStructureNodes($_REQUEST["structure_id"]);
    $max = count($subpages);
    $gBitSmarty->assign_by_ref('subpages', $subpages);
    if ($max != 0) {
        $last_child = $subpages[$max - 1];
        $gBitSmarty->assign('insert_after', $last_child["structure_id"]);
    }
    if (!empty($_REQUEST['done'])) {
        bit_redirect($_SESSION['structure_referer']);
    }
    $gBitSystem->display('bitpackage:liberty/add_structure_content.tpl', "Add Content", array('display_mode' => 'display'));
}
Esempio n. 24
0
require_once KERNEL_PKG_PATH . 'BitBase.php';
include_once KERNEL_PKG_PATH . 'notification_lib.php';
require_once USERS_PKG_PATH . 'classes/recaptchalib.php';
$gBitSystem->verifyFeature('users_allow_register');
// Everything below here is needed for registration
require_once USERS_PKG_PATH . 'BaseAuth.php';
if (!empty($_REQUEST['returnto'])) {
    $_SESSION['returnto'] = $_REQUEST['returnto'];
} elseif (!empty($_SERVER['HTTP_REFERER']) && !strpos($_SERVER['HTTP_REFERER'], 'login.php') && !strpos($_SERVER['HTTP_REFERER'], 'register.php')) {
    $from = parse_url($_SERVER['HTTP_REFERER']);
    if (!empty($from['path']) && $from['host'] == $_SERVER['SERVER_NAME']) {
        $_SESSION['loginfrom'] = $from['path'] . '?' . (!empty($from['query']) ? $from['query'] : '');
    }
}
if ($gBitUser->isRegistered()) {
    bit_redirect($gBitSystem->getDefaultPage());
}
if (isset($_REQUEST["register"])) {
    $reg = $_REQUEST;
    // Register the new user
    $userClass = $gBitSystem->getConfig('user_class', 'BitPermUser');
    $newUser = new $userClass();
    if ($newUser->preRegisterVerify($reg) && $newUser->register($reg)) {
        $gBitUser->mUserId = $newUser->mUserId;
        // add user to user-selected group
        if (!empty($_REQUEST['group'])) {
            $groupInfo = $gBitUser->getGroupInfo($_REQUEST['group']);
            if (empty($groupInfo) || $groupInfo['is_public'] != 'y') {
                $errors[] = "You can't use this group";
                $gBitSmarty->assignByRef('errors', $errors);
            } else {
Esempio n. 25
0
<?php

// $Header$
// Initialization
require_once '../kernel/setup_inc.php';
// Is package installed and enabled
$gBitSystem->verifyPackage('person');
require_once PERSON_PKG_PATH . 'lookup_inc.php';
// Now check permissions to access this page
if ($gContent->isValid()) {
    $gContent->verifyUpdatePermission();
} else {
    $gContent->verifyCreatePermission();
}
// Set up access to edit services needed by Person
$gContent->invokeServices('content_edit_function');
// Check if the page has changed
if (!empty($_REQUEST["save_person"])) {
    // Check if all Request values are delivered, and if not, set them to avoid error messages.
    // This can happen if some features are disabled
    if ($gContent->store($_REQUEST['person'])) {
        bit_redirect($gContent->getDisplayUrl());
    } else {
        $gBitSmarty->assign_by_ref('errors', $gContent->mErrors);
    }
}
// Load field attributes
$gBitSmarty->assign_by_ref('fields', $gContent->getFields());
// Display the template
$gBitSystem->display('bitpackage:person/edit.tpl', tra('Person'), array('display_mode' => 'edit'));
Esempio n. 26
0
    $gBitSmarty->assign('allGroups', $allGroups);
    $gBitSmarty->assign('version_210beta', TRUE);
    $versionUpdate = TRUE;
    // deal with assigning permissions to various groups
    if (!empty($_REQUEST['fix_version_210beta'])) {
        foreach (array_keys($allGroups) as $groupId) {
            foreach (array_keys($allPerms) as $perm) {
                if (!empty($_REQUEST['perms'][$groupId][$perm])) {
                    $gBitUser->assignPermissionToGroup($perm, $groupId);
                } else {
                    $gBitUser->removePermissionFromGroup($perm, $groupId);
                }
            }
        }
    }
}
// ===================== Update version to current one =====================
// Only update the version when the form has been submitted
if (!empty($_REQUEST['update_version'])) {
    if (!empty($upToDate) || !empty($_REQUEST['skip'])) {
        // if we're already up to date, we'll simply move on to the next page
        bit_redirect($_SERVER['SCRIPT_NAME'] . "?step=" . ++$step);
    } else {
        // set the version of bitweaver in the database
        if ($gBitSystem->storeVersion(NULL, $gBitSystem->getBitVersion())) {
            // display the confirmation page
            $gBitSmarty->assign('next_step', $step + 1);
            $app = '_done';
        }
    }
}
Esempio n. 27
0
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,			 |
// | that is bundled with this package in the file LICENSE, and is				|
// | available through the world-wide-web at the following url:					 |
// | http://www.zen-cart.com/license/2_0.txt.														 |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to			 |
// | license@zen-cart.com so we can mail you a copy immediately.					|
// +----------------------------------------------------------------------+
//	$Id$
//
require 'includes/application_top.php';
$feedback = array();
if (!empty($_REQUEST['action'])) {
    if ($_REQUEST['action'] == 'delete') {
        //		$gBitUser->verifyTicket();
        $coupon = new CommerceVoucher($_REQUEST['gid']);
        $coupon->expunge();
        bit_redirect($_SERVER['SCRIPT_NAME']);
    }
}
$gBitSmarty->assign('feedback', $feedback);
$sql = "SELECT c.`coupon_id` AS `hash_key`, c.coupon_amount, c.coupon_code, c.coupon_id, c.admin_note, et.sent_firstname, et.sent_lastname, et.customer_id_sent, et.emailed_to, et.date_sent, rt.`customer_id`, rt.`redeem_date`, rt.`redeem_ip`, rt.`order_id`\n\t\tFROM " . TABLE_COUPONS . " c\n\t\t\tINNER JOIN " . TABLE_COUPON_EMAIL_TRACK . " et ON(c.coupon_id=et.coupon_id)\n\t\t\tLEFT JOIN " . TABLE_COUPON_REDEEM_TRACK . " rt ON(c.coupon_id=rt.coupon_id)\n\t\tORDER BY date_sent desc";
$couponList = array();
if ($rs = $gBitDb->query($sql)) {
    while ($row = $rs->fetchRow()) {
        $couponList[$row['hash_key']] = $row;
    }
}
$gBitSmarty->assign_by_ref('couponList', $couponList);
$gBitSystem->display('bitpackage:bitcommerce/admin_gv_sent.tpl', 'Gift Vouchers Sent', array('display_mode' => 'admin'));
Esempio n. 28
0
<?php

/**
 * @version  $Header$
 * lookup_content_inc
 *
 * @author   spider <*****@*****.**>
 * @package  liberty
 * @subpackage functions
 */
/**
 * Required setup
 */
require_once '../kernel/setup_inc.php';
if (!empty($_REQUEST['q'])) {
    bit_redirect($_REQUEST['q']);
} else {
    $_REQUEST['error'] = tra('The redirect did not include a url.');
    include KERNEL_PKG_PATH . 'error.php';
}
Esempio n. 29
0
    foreach (array_keys($formMenuJsSettings) as $item) {
        simple_set_toggle($item, THEMES_PKG_NAME);
    }
}
if (!empty($_REQUEST['update_menus'])) {
    foreach (array_keys($gBitSystem->mAppMenu['bar']) as $menuPackage) {
        if (empty($_REQUEST["menu_{$menuPackage}"])) {
            // the package menu is off - store it off
            $gBitSystem->storeConfig("menu_{$menuPackage}", 'n', THEMES_PKG_NAME);
        } elseif ($gBitSystem->getConfig("menu_{$menuPackage}") == 'n') {
            // the package menu was off and now is on. Just delete the pref since on is the assumed state
            $gBitSystem->storeConfig("menu_{$menuPackage}", NULL, THEMES_PKG_NAME);
        }
        if (!empty($_REQUEST["{$menuPackage}_menu_text"])) {
            // someone thinks that our default package names aren't good enough! HA!
            $gBitSystem->storeConfig("{$menuPackage}_menu_text", $_REQUEST["{$menuPackage}_menu_text"], constant(strtoupper($menuPackage) . '_PKG_NAME'));
        }
        if (!empty($_REQUEST["{$menuPackage}_menu_position"])) {
            // someone thinks that our default package names aren't good enough! HA!
            $gBitSystem->storeConfig("{$menuPackage}_menu_position", $_REQUEST["{$menuPackage}_menu_position"], constant(strtoupper($menuPackage) . '_PKG_NAME'));
        } else {
            $gBitSystem->storeConfig("{$menuPackage}_menu_position", NULL, constant(strtoupper($menuPackage) . '_PKG_NAME'));
        }
    }
    // need to reload page to apply settings
    bit_redirect(THEMES_PKG_URL . "admin/menus.php");
}
if ($gBitSystem->isFeatureActive('site_top_bar_dropdown')) {
    $gBitSmarty->assign('formMenuJsSettings', $formMenuJsSettings);
}
$gBitSystem->display('bitpackage:themes/admin_themes_menus.tpl', 'Themes Manager', array('display_mode' => 'admin'));
Esempio n. 30
0
$gBitSmarty->assign('periodHash', $periodHash);
if (!isset($_REQUEST["period"])) {
    $_REQUEST["period"] = 'month';
}
switch ($_REQUEST["period"]) {
    case 'year':
        $format = 'Y';
        break;
    case 'quarter':
        $format = 'Y-\\QQ';
        break;
    case 'day':
        $format = 'Y-m-d';
        break;
    case 'week':
        $format = 'Y \\Week W';
        break;
    case 'month':
    default:
        $format = 'Y-m';
        break;
}
if (!empty($_REQUEST['itemize'])) {
    $listHash['registration_period'] = $_REQUEST['itemize'];
    $listHash['registration_period_format'] = $format;
    bit_redirect(USERS_PKG_URL . 'admin/index.php?registration_period=' . urlencode($_REQUEST['itemize']) . '&registration_period_format=' . urlencode($listHash['registration_period_format']));
}
$gBitSmarty->assign('userStats', $stats->registrationStats($format));
$gBitSmarty->assign('period', $_REQUEST["period"]);
// Display the template
$gBitSystem->display('bitpackage:stats/user_stats.tpl', NULL, array('display_mode' => 'display'));