Skip to content

Commit

Permalink
Merge branch 'master' of github.com:loadedcommerce/loaded7
Browse files Browse the repository at this point in the history
  • Loading branch information
datazen committed Oct 3, 2014
2 parents 18e1f6d + 78ae223 commit a8a5544
Show file tree
Hide file tree
Showing 148 changed files with 7,212 additions and 4,397 deletions.
2 changes: 1 addition & 1 deletion catalog/admin/includes/application_top.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
require($lC_Vqmod->modCheck('../includes/classes/mail.php'));

// file uploading class
require($lC_Vqmod->modCheck('includes/classes/upload.php'));
require($lC_Vqmod->modCheck('../includes/classes/upload.php'));

// api class
require($lC_Vqmod->modCheck('includes/classes/api.php'));
Expand Down
114 changes: 57 additions & 57 deletions catalog/admin/includes/applications/backup/backup.php
Original file line number Diff line number Diff line change
@@ -1,78 +1,78 @@
<?php
/**
@package catalog::admin::applications
@author Loaded Commerce
@copyright Copyright 2003-2014 Loaded Commerce, LLC
@copyright Portions Copyright 2003 osCommerce
@copyright Template built on Developr theme by DisplayInline http://themeforest.net/user/displayinline under Extended license
@license https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt
@version $Id: backup.php v1.0 2013-08-08 datazen $
@package catalog::admin::applications
@author Loaded Commerce
@copyright Copyright 2003-2014 Loaded Commerce, LLC
@copyright Portions Copyright 2003 osCommerce
@copyright Template built on Developr theme by DisplayInline http://themeforest.net/user/displayinline under Extended license
@license https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt
@version $Id: backup.php v1.0 2013-08-08 datazen $
*/
global $lC_Vqmod;
global $lC_Vqmod;

require_once($lC_Vqmod->modCheck('includes/applications/backup/classes/backup.php'));
require_once($lC_Vqmod->modCheck('includes/applications/backup/classes/backup.php'));

class lC_Application_Backup extends lC_Template_Admin {
/*
* Protected variables
*/
protected $_module = 'backup',
$_page_title,
$_page_contents = 'main.php';
/*
* Class constructor
*/
function __construct() {
global $lC_Language;
class lC_Application_Backup extends lC_Template_Admin {
/*
* Protected variables
*/
protected $_module = 'backup',
$_page_title,
$_page_contents = 'main.php';
/*
* Class constructor
*/
function __construct() {
global $lC_Language;

$this->_page_title = $lC_Language->get('heading_title');
$this->_page_title = $lC_Language->get('heading_title');

if ( !isset($_GET['action']) ) {
$_GET['action'] = '';
}
if ( !isset($_GET['action']) ) {
$_GET['action'] = '';
}

if ( !empty($_GET['action']) ) {
switch ( $_GET['action'] ) {
if ( !empty($_GET['action']) ) {
switch ( $_GET['action'] ) {

case 'backup':
if (lC_Backup_Admin::backup($_GET['compression'], (isset($_GET['download_only']) && ($_GET['download_only'] == 'yes') ? true : false))) {
return true;
} else {
return false;
}
break;
case 'backup':
if (lC_Backup_Admin::backup($_GET['compression'], (isset($_GET['download_only']) && ($_GET['download_only'] == 'yes') ? true : false))) {
return true;
} else {
return false;
}
break;

case 'download':
$filename = basename($_GET['file']);
$extension = substr($filename, -3);
case 'download':
$filename = basename($_GET['file']);
$extension = substr($filename, -3);

if ( ( $extension == 'zip' ) || ( $extension == '.gz' ) || ( $extension == 'sql' ) ) {
if ( file_exists(DIR_FS_BACKUP . $filename) ) {
if ( $fp = fopen(DIR_FS_BACKUP . $filename, 'rb') ) {
$buffer = fread($fp, filesize(DIR_FS_BACKUP . $filename));
fclose($fp);
if ( ( $extension == 'zip' ) || ( $extension == '.gz' ) || ( $extension == 'sql' ) ) {
if ( file_exists(DIR_FS_BACKUP . $filename) ) {
if ( $fp = fopen(DIR_FS_BACKUP . $filename, 'rb') ) {
$buffer = fread($fp, filesize(DIR_FS_BACKUP . $filename));
fclose($fp);

header('Content-type: application/x-octet-stream');
header('Content-disposition: attachment; filename=' . $filename);
header('Content-type: application/x-octet-stream');
header('Content-disposition: attachment; filename=' . $filename);

echo $buffer;
echo $buffer;

exit;
exit;
}
}
}
}
break;
break;

case 'restoreLocal':
if (lC_Backup_Admin::restore()) {
$_SESSION['restoreLocal'] = true;
return true;
} else {
return false;
}
break;
case 'restoreLocal':
if (lC_Backup_Admin::restore()) {
$_SESSION['restoreLocal'] = true;
return true;
} else {
return false;
}
break;
}
}
}
}
}
?>
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public static function drawMenu() {
}

return $menu;
}
}



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
.dataColAction { text-align: right; }
.store-type-selected{ color: #ff9f00 !important; font-size: 1.2em; }
</style>
<div class="with-padding">
<!-- main panel -->
<div class="with-padding">
<!-- main panel -->
<div class="content-panel margin-bottom">
<!-- menu nav panel -->
<div class="panel-navigation silver-gradient">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function newZone() {
' <form name="zNew" id="zNew" autocomplete="off" action="" method="post">'+
' <p><?php echo $lC_Language->get('introduction_new_zone'); ?></p>'+
' <p class="button-height inline-label">'+
' <input type="hidden" name="countries" value="<?php echo $_GET["countries"];?>">'+
' <label for="zone_name" class="label"><?php echo $lC_Language->get('field_zone_name'); ?></label>'+
' <?php echo lc_draw_input_field('zone_name', null, 'class="input full-width"'); ?>'+
' </p>'+
Expand Down
30 changes: 16 additions & 14 deletions catalog/admin/includes/applications/customers/classes/customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public static function getAll() {
if (isset($_GET['iSortCol_0'])) {
$sOrder = " ORDER BY ";
for ($i=0 ; $i < (int)$_GET['iSortingCols'] ; $i++ ) {
$sOrder .= lC_Customers_Admin::fnColumnToField($_GET['iSortCol_'.$i] ) . " " . $_GET['sSortDir_'.$i] .", ";
$sOrder .= lC_Customers_Admin::fnColumnToField($_GET['iSortCol_'.$i]) . " " . $_GET['sSortDir_'.$i] .", ";
}
$sOrder = substr_replace( $sOrder, "", -2 );
$sOrder = substr_replace($sOrder, "", -2);
}

/* Filtering */
Expand Down Expand Up @@ -113,7 +113,7 @@ public static function getAll() {

$Qcustomers_orders = $lC_Database->query("SELECT count(*) as order_count
from :table_orders
where customers_id = '".$Qcustomers->valueInt('customers_id')."'");
where customers_id = '" . $Qcustomers->valueInt('customers_id') . "'");
$Qcustomers_orders->bindTable(':table_orders', TABLE_ORDERS);
$Qcustomers_orders->execute();

Expand Down Expand Up @@ -832,17 +832,19 @@ public static function deleteAddress($id, $customer_id = null) {
* @access private
* @return string
*/
private static function fnColumnToField($i) {
if ( $i == 0 )
return "c.customers_id";
else if ( $i == 1 )
return "c.customers_lastname";
else if ( $i == 2 )
return "c.customers_firstname";
else if ( $i == 3 )
return "c.customers_group_id";
else if ( $i == 4 )
return "c.date_account_created";
private static function fnColumnToField($i = null, $c = null) {
if ( $i == 0 )
return "c.customers_id";
else if ( $i == 1 )
return "c.customers_lastname";
else if ( $i == 2 )
return "c.customers_firstname";
else if ( $i == 3 )
return "c.customers_email_address";
else if ( $i == 5 )
return "c.customers_group_id";
else if ( $i == 6 )
return "c.date_account_created";
}
}
?>
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{ "sWidth": "10px", "bSortable": false, "sClass": "hide-on-mobile dataColIcon" },
{ "sWidth": "22%", "bSortable": true, "sClass": "dataColLast" },
{ "sWidth": "25%", "bSortable": true, "sClass": "hide-on-mobile hide-on-tablet dataColEmail" },
{ "sWidth": "8%", "bSortable": true, "sClass": "hide-on-mobile-portrait dataColFirst" },
{ "sWidth": "8%", "bSortable": false, "sClass": "hide-on-mobile-portrait dataColFirst" },
{ "sWidth": "10%", "bSortable": true, "sClass": "hide-on-mobile-portrait dataColGroup" },
{ "sWidth": "10%", "bSortable": true, "sClass": "hide-on-tablet hide-on-mobile dataColDate" },
{ "sWidth": "25%", "bSortable": false, "sClass": "dataColAction" }]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ public static function save($id = null, $data) {

// insert/update the featured products table
$Qfeatured->bindTable(':table_featured_products', TABLE_FEATURED_PRODUCTS);
$Qfeatured->bindDate(':expires_date', (($data['expires_date'] != '0000-00-00 00:00:00') ? ((strstr($data['expires_date'], '/')) ? lC_DateTime::toDateTime($data['expires_date']) : $data['expires_date']) : '0000-00-00 00:00:00'));
//$Qfeatured->bindDate(':expires_date', (($data['expires_date'] != '0000-00-00 00:00:00') ? ((strstr($data['expires_date'], '/')) ? lC_DateTime::toDateTime($data['expires_date']) : $data['expires_date']) : '0000-00-00 00:00:00'));
$Qfeatured->bindDate(':expires_date', ($data['expires_date'] != '0000-00-00 00:00:00') ? lC_DateTime::toDateTime($data['expires_date']) : $data['expires_date']);
$Qfeatured->bindInt(':status', $data['status']);
$Qfeatured->setLogging($_SESSION['module'], $id);
$Qfeatured->execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static function getEntry() {
* @return json
*/
public static function saveEntry() {
$result = lC_File_manager_Admin::saveFile($_GET['fid'], $_GET['contents'], $_GET['dir']);
$result = lC_File_manager_Admin::saveFile($_POST['fid'], $_POST['contents'], $_POST['dir']);

$return = array();
if ($result == true) $return = array('rpcStatus' => RPC_STATUS_SUCCESS);
Expand Down
10 changes: 5 additions & 5 deletions catalog/admin/includes/applications/file_manager/modal/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ classes: 'blue-gradient glossy',
invalidHandler: function() {
}
}).form();
if (bValid) {
var nvp = $("#editEntry").serialize();
var link = '<?php echo lc_href_link_admin('rpc.php', $lC_Template->getModule() . '&action=saveEntry&fid=FID&dir=DIR&BATCH'); ?>'
var jsonLink = link.replace('FID', id).replace('DIR', data.target);
$.getJSON(jsonLink.replace('BATCH', nvp),
if (bValid) {
var contentEdit = document.getElementById('contentsEdit').value;
$.post('<?php echo lc_href_link_admin('rpc.php', $lC_Template->getModule(). '&action=saveEntry');?>',
{fid: id, contents : contentEdit, dir: data.target},
function (rdata) {
var rdata = jQuery.parseJSON( rdata );
if (rdata.rpcStatus == -10) { // no session
var url = "<?php echo lc_href_link_admin(FILENAME_DEFAULT, 'login'); ?>";
$(location).attr('href',url);
Expand Down
25 changes: 12 additions & 13 deletions catalog/admin/includes/applications/index/classes/rpc.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
require_once($lC_Vqmod->modCheck('includes/applications/products/classes/products.php'));
require_once($lC_Vqmod->modCheck('includes/classes/category_tree.php'));
require_once($lC_Vqmod->modCheck('includes/applications/administrators_log/classes/administrators_log.php'));
require_once($lC_Vqmod->modCheck('includes/applications/login/classes/login.php'));

class lC_Index_Admin_rpc {

Expand Down Expand Up @@ -238,18 +239,6 @@ public static function getAll() {
echo json_encode($result);
}
/*
* Removes the api check status tmp file
*
* @access public
* @return json
*/
public static function removeApiTmp() {
@unlink(DIR_FS_WORK . 'apinocom.tmp');
$result['rpcStatus'] = RPC_STATUS_SUCCESS;

echo json_encode($result);
}
/*
* Removes the image resize check status tmp file
*
* @access public
Expand All @@ -273,6 +262,16 @@ public static function noRemindResize() {

echo json_encode($result);
}

/*
* perform an API health check
*
* @access public
* @return json
*/
public static function apiHealthCheck() {
$result['rpcStatus'] = lC_Login_Admin::apiCheck();

echo json_encode($result);
}
}
?>
8 changes: 1 addition & 7 deletions catalog/admin/includes/applications/index/js/index.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,8 @@
@license https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt
@version $Id: index.js.php v1.0 2013-08-08 datazen $
*/
?>
<script>

// Favicon count
//Tinycon.setBubble(2);
</script>
<?php
global $lC_Language;

require_once($lC_Vqmod->modCheck('includes/applications/index/classes/index.php'));
?>
<!-- Charts library -->
Expand Down
8 changes: 4 additions & 4 deletions catalog/admin/includes/applications/login/classes/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,10 @@ public static function apiCheck() {
}

if ($versions == null || $error) { // set the error flag
if ( is_writable(DIR_FS_WORK) ) {
file_put_contents(DIR_FS_WORK . 'apinocom.tmp', '[' . lC_DateTime::getNow('d-M-Y H:i:s') . '] ' . $errorMsg . "\n", FILE_APPEND);
}
return -1;
}

return 1;
}
/*
* Download the product PHARs
Expand Down Expand Up @@ -321,7 +321,7 @@ public static function getProVersionTag() {

if (utility::isB2B()) {
return '<small class="tag orange-gradient mid-margin-left mid-margin-right">B2B</small>' . $lC_Language->get('text_version') . ' ' . utility::getB2BVersion();
} else {
} else if (utility::isPro()) {
return '<small class="tag red-gradient mid-margin-left mid-margin-right">PRO</small>' . $lC_Language->get('text_version') . ' ' . utility::getProVersion();
}
}
Expand Down
14 changes: 0 additions & 14 deletions catalog/admin/includes/applications/login/classes/rpc.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,6 @@ public static function validateSerial() {

$result = lC_Login_Admin::validateSerial($_GET['activation_serial']);

echo json_encode($result);
}

/*
* ping the API server and make sure we get a response
*
* @access public
* @return json
*/
public static function apiHealthCheck() {
lC_Login_Admin::apiCheck();

$result['rpcStatus'] = RPC_STATUS_SUCCESS;

echo json_encode($result);
}
}
Expand Down
12 changes: 0 additions & 12 deletions catalog/admin/includes/applications/login/js/login.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,5 @@
$(document).ready(function() {
$('body').removeClass('clearfix with-menu with-shortcuts');
$('html').addClass('linen');

// added for api communication health check
apiHealthCheck();
});

function apiHealthCheck() {
var jsonLink = '<?php echo lc_href_link_admin('rpc.php', 'login' . '&action=apiHealthCheck'); ?>';
$.getJSON(jsonLink,
function (data) {
return true;
}
);
}
</script>
Loading

0 comments on commit a8a5544

Please sign in to comment.