本文整理汇总了PHP中zen_record_admin_activity函数的典型用法代码示例。如果您正苦于以下问题:PHP zen_record_admin_activity函数的具体用法?PHP zen_record_admin_activity怎么用?PHP zen_record_admin_activity使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zen_record_admin_activity函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: zen_set_ezpage_status
function zen_set_ezpage_status($pages_id, $status, $status_field)
{
global $db;
if ($status == '1') {
zen_record_admin_activity('EZ-Page ID ' . (int) $pages_id . ' [' . $status_field . '] changed to 0', 'info');
return $db->Execute("update " . TABLE_EZPAGES . " set " . zen_db_input($status_field) . " = '0' where pages_id = '" . (int) $pages_id . "'");
} elseif ($status == '0') {
zen_record_admin_activity('EZ-Page ID ' . (int) $pages_id . ' [' . $status_field . '] changed to 1', 'info');
return $db->Execute("update " . TABLE_EZPAGES . " set " . zen_db_input($status_field) . " = '1' where pages_id = '" . (int) $pages_id . "'");
} else {
return -1;
}
}
示例2: currencies
*/
require 'includes/application_top.php';
require DIR_WS_CLASSES . 'currencies.php';
$currencies = new currencies();
$languages = zen_get_languages();
$action = isset($_GET['action']) ? $_GET['action'] : '';
if (zen_not_null($action)) {
switch ($action) {
case 'insert':
case 'save':
$sql = "update " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " set products_attributes_filename=:filename:, products_attributes_maxdays=:maxdays:, products_attributes_maxcount=:maxcount: where products_attributes_id='" . (int) $_GET['padID'] . "'";
$sql = $db->bindVars($sql, ':filename:', $_POST['products_attributes_filename'], 'string');
$sql = $db->bindVars($sql, ':maxdays:', $_POST['products_attributes_maxdays'], 'string');
$sql = $db->bindVars($sql, ':maxcount:', $_POST['products_attributes_maxcount'], 'string');
$db->Execute($sql);
zen_record_admin_activity('Downloads-manager details added/updated for ' . $_POST['products_attributes_filename'], 'info');
zen_redirect(zen_href_link(FILENAME_DOWNLOADS_MANAGER, 'padID=' . (int) $_GET['padID'] . '&page=' . (int) $_GET['page']));
break;
}
}
?>
<!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;
?>
">
示例3: now
if ($rate != 1 && defined('CURRENCY_UPLIFT_RATIO') && (int) CURRENCY_UPLIFT_RATIO != 0) {
$rate = (string) ((double) $rate * (double) CURRENCY_UPLIFT_RATIO);
}
// special handling for currencies which don't support decimal places
if ($currency->fields['decimal_places'] == '0') {
$rate = (int) $rate;
}
if (zen_not_null($rate) && $rate > 0) {
$db->Execute("update " . TABLE_CURRENCIES . "\r\n set value = '" . $rate . "', last_updated = now()\r\n where currencies_id = '" . (int) $currency->fields['currencies_id'] . "'");
$messageStack->add_session(sprintf(TEXT_INFO_CURRENCY_UPDATED, $currency->fields['title'], $currency->fields['code'], $server_used), 'success');
} else {
$messageStack->add_session(sprintf(ERROR_CURRENCY_INVALID, $currency->fields['title'], $currency->fields['code'], $server_used), 'error');
}
$currency->MoveNext();
}
zen_record_admin_activity('Currency exchange rates updated via the Update button in the admin console.', 'info');
zen_redirect(zen_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $_GET['cID']));
break;
case 'delete':
// demo active test
if (zen_admin_demo()) {
$_GET['action'] = '';
$messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
zen_redirect(zen_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $_GET['cID']));
}
$currencies_id = zen_db_prepare_input($_GET['cID']);
$currency = $db->Execute("select code\r\n from " . TABLE_CURRENCIES . "\r\n where currencies_id = '" . (int) $currencies_id . "'");
$remove_currency = true;
if ($currency->fields['code'] == DEFAULT_CURRENCY) {
$remove_currency = false;
$messageStack->add(ERROR_REMOVE_DEFAULT_CURRENCY, 'error');
示例4: zen_remove
function zen_remove($source)
{
global $messageStack, $zen_remove_error;
if (isset($zen_remove_error)) {
$zen_remove_error = false;
}
if (is_dir($source)) {
$dir = dir($source);
while ($file = $dir->read()) {
if ($file != '.' && $file != '..') {
if (is_writeable($source . '/' . $file)) {
zen_remove($source . '/' . $file);
} else {
$messageStack->add(sprintf(ERROR_FILE_NOT_REMOVEABLE, $source . '/' . $file), 'error');
$zen_remove_error = true;
}
}
}
$dir->close();
if (is_writeable($source)) {
rmdir($source);
zen_record_admin_activity('Removed directory from server: [' . $source . ']', 'notice');
} else {
$messageStack->add(sprintf(ERROR_DIRECTORY_NOT_REMOVEABLE, $source), 'error');
$zen_remove_error = true;
}
} else {
if (is_writeable($source)) {
unlink($source);
zen_record_admin_activity('Deleted file from server: [' . $source . ']', 'notice');
} else {
$messageStack->add(sprintf(ERROR_FILE_NOT_REMOVEABLE, $source), 'error');
$zen_remove_error = true;
}
}
}
示例5: while
$reviews = $db->Execute("select reviews_id\n from " . TABLE_REVIEWS . "\n where customers_id = '" . (int) $customers_id . "'");
while (!$reviews->EOF) {
$db->Execute("delete from " . TABLE_REVIEWS_DESCRIPTION . "\n where reviews_id = '" . (int) $reviews->fields['reviews_id'] . "'");
$reviews->MoveNext();
}
$db->Execute("delete from " . TABLE_REVIEWS . "\n where customers_id = '" . (int) $customers_id . "'");
} else {
$db->Execute("update " . TABLE_REVIEWS . "\n set customers_id = null\n where customers_id = '" . (int) $customers_id . "'");
}
$db->Execute("delete from " . TABLE_ADDRESS_BOOK . "\n where customers_id = '" . (int) $customers_id . "'");
$db->Execute("delete from " . TABLE_CUSTOMERS . "\n where customers_id = '" . (int) $customers_id . "'");
$db->Execute("delete from " . TABLE_CUSTOMERS_INFO . "\n where customers_info_id = '" . (int) $customers_id . "'");
$db->Execute("delete from " . TABLE_CUSTOMERS_BASKET . "\n where customers_id = '" . (int) $customers_id . "'");
$db->Execute("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . "\n where customers_id = '" . (int) $customers_id . "'");
$db->Execute("delete from " . TABLE_WHOS_ONLINE . "\n where customer_id = '" . (int) $customers_id . "'");
zen_record_admin_activity('Customer with customer ID ' . (int) $customers_id . ' deleted.', 'warning');
zen_redirect(zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('cID', 'action')), 'NONSSL'));
break;
default:
$customers = $db->Execute("select c.customers_id, c.customers_gender, c.customers_firstname,\n c.customers_lastname, c.customers_dob, c.customers_email_address,\n a.entry_company, a.entry_street_address, a.entry_suburb,\n a.entry_postcode, a.entry_city, a.entry_state, a.entry_zone_id,\n a.entry_country_id, c.customers_telephone, c.customers_fax,\n c.customers_newsletter, c.customers_default_address_id,\n c.customers_email_format, c.customers_group_pricing,\n c.customers_authorization, c.customers_referral\n from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a\n on c.customers_default_address_id = a.address_book_id\n where a.customers_id = c.customers_id\n and c.customers_id = '" . (int) $customers_id . "'");
$cInfo = new objectInfo($customers->fields);
}
}
?>
<!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
示例6: zen_deregister_admin_pages
function zen_deregister_admin_pages($pages)
{
global $db;
if (!empty($pages)) {
if (is_array($pages)) {
$sql = "DELETE FROM " . TABLE_ADMIN_PAGES . " WHERE page_key IN (";
foreach ($pages as $page) {
$sql .= ":page_key:,";
$sql = $db->bindVars($sql, ':page_key:', $page, 'string');
}
$sql = substr($sql, 0, -1) . ")";
} else {
$sql = "DELETE FROM " . TABLE_ADMIN_PAGES . " WHERE page_key = :page_key:";
$sql = $db->bindVars($sql, ':page_key:', $pages, 'string');
}
$db->Execute($sql);
zen_record_admin_activity('Deleted admin pages for page keys: ' . print_r($pages, true), 'warning');
}
}
示例7: isset
require 'includes/application_top.php';
$action = isset($_GET['action']) ? $_GET['action'] : '';
if (zen_not_null($action)) {
switch ($action) {
case 'save':
$cID = zen_db_prepare_input($_GET['cID']);
// demo active test
if (zen_admin_demo()) {
$_GET['action'] = '';
$messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
zen_redirect(zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . (int) $cID));
}
$configuration_value = zen_db_prepare_input($_POST['configuration_value']);
$db->Execute("update " . TABLE_CONFIGURATION . "\r\n set configuration_value = '" . zen_db_input($configuration_value) . "',\r\n last_modified = now() where configuration_id = '" . (int) $cID . "'");
$result = $db->Execute("select configuration_key from " . TABLE_CONFIGURATION . " where configuration_id=" . (int) $cID . " LIMIT 1");
zen_record_admin_activity('Configuration setting changed for ' . $result->fields['configuration_key'] . ': ' . $configuration_value, 'warning');
// set the WARN_BEFORE_DOWN_FOR_MAINTENANCE to false if DOWN_FOR_MAINTENANCE = true
if (WARN_BEFORE_DOWN_FOR_MAINTENANCE == 'true' && DOWN_FOR_MAINTENANCE == 'true') {
$db->Execute("update " . TABLE_CONFIGURATION . "\r\n set configuration_value = 'false', last_modified = '" . NOW . "'\r\n where configuration_key = 'WARN_BEFORE_DOWN_FOR_MAINTENANCE'");
}
zen_redirect(zen_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . (int) $cID));
break;
}
}
$gID = isset($_GET['gID']) ? $_GET['gID'] : 1;
$_GET['gID'] = $gID;
$cfg_group = $db->Execute("select configuration_group_title\r\n from " . TABLE_CONFIGURATION_GROUP . "\r\n where configuration_group_id = '" . (int) $gID . "'");
if ($gID == 7) {
$shipping_errors = '';
if (zen_get_configuration_key_value('SHIPPING_ORIGIN_ZIP') == 'NONE' or zen_get_configuration_key_value('SHIPPING_ORIGIN_ZIP') == '') {
$shipping_errors .= '<br />' . ERROR_SHIPPING_ORIGIN_ZIP;
示例8: zen_record_admin_activity
zen_record_admin_activity('Inserted special ' . (int) $v_products_id . ' via EP4.', 'info');
}
$specials_print .= sprintf(EASYPOPULATE_4_SPECIALS_NEW, $v_products_model, substr(strip_tags($v_products_name[$epdlanguage_id]), 0, 10), $v_products_price, $v_specials_price);
} else {
// existing product
if ($v_specials_price == '0') {
// delete of existing requested
$db->Execute("DELETE FROM " . TABLE_SPECIALS . " WHERE products_id = '" . (int) $v_products_id . "'");
$specials_print .= sprintf(EASYPOPULATE_4_SPECIALS_DELETE, $v_products_model);
continue;
}
// just make an update
$sql = "UPDATE " . TABLE_SPECIALS . " SET\n\t\t\t\t\t\tspecials_new_products_price\t= '" . $v_specials_price . "',\n\t\t\t\t\t\tspecials_last_modified\t\t= now(),\n\t\t\t\t\t\tspecials_date_available\t\t= '" . $v_specials_date_avail . "',\n\t\t\t\t\t\texpires_date\t\t\t\t= '" . $v_specials_expires_date . "',\n\t\t\t\t\t\tstatus\t\t\t\t\t\t= '1'\n\t\t\t\t\t\tWHERE products_id\t\t\t= '" . (int) $v_products_id . "'";
$result = ep_4_query($sql);
if ($result) {
zen_record_admin_activity('Updated special ' . (int) $v_products_id . ' via EP4.', 'info');
}
$specials_print .= sprintf(EASYPOPULATE_4_SPECIALS_UPDATE, $v_products_model, substr(strip_tags($v_products_name[$epdlanguage_id]), 0, 10), $v_products_price, $v_specials_price);
}
// we still have our special here
}
// end specials for this product
// this is a test chadd - 12-08-2011
// why not just update price_sorter after each product?
// better yet, why not ONLY call if pricing was updated
// ALL these affect pricing: products_tax_class_id, products_price, products_priced_by_attribute, product_is_free, product_is_call
zen_update_products_price_sorter($v_products_id);
} else {
// this record is missing the product_model
$display_output .= EASYPOPULATE_4_DISPLAY_RESULT_NO_MODEL;
foreach ($items as $col => $summary) {
示例9: zen_record_admin_activity
$sql = $db->bindVars($sql, ':countryID:', $countries_id, 'integer');
$result = $db->Execute($sql);
if ($result->recordCount() == 0) {
$db->Execute("delete from " . TABLE_COUNTRIES . "\n where countries_id = '" . (int) $countries_id . "'");
zen_record_admin_activity('Country deleted: ' . $countries_id, 'warning');
} else {
$messageStack->add_session(ERROR_COUNTRY_IN_USE, 'error');
}
zen_redirect(zen_href_link(FILENAME_COUNTRIES, 'page=' . $_GET['page']));
break;
case 'setstatus':
$countries_id = zen_db_prepare_input($_GET['cID']);
if (isset($_POST['current_status']) && ($_POST['current_status'] == '0' || $_POST['current_status'] == '1')) {
$sql = "update " . TABLE_COUNTRIES . " set status='" . ($_POST['current_status'] == 0 ? 1 : 0) . "' where countries_id='" . (int) $countries_id . "'";
$db->Execute($sql);
zen_record_admin_activity('Country with ID number: ' . $countries_id . ' changed status to ' . ($_POST['current_status'] == 0 ? 1 : 0), 'info');
zen_redirect(zen_href_link(FILENAME_COUNTRIES, 'cID=' . (int) $countries_id . '&page=' . $_GET['page']));
}
$action = '';
break;
}
}
?>
<!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;
示例10: zen_db_prepare_input
$tax_description = zen_db_prepare_input($_POST['tax_description']);
$tax_priority = zen_db_prepare_input((int) $_POST['tax_priority']);
$db->Execute("update " . TABLE_TAX_RATES . "\r\n set tax_rates_id = '" . (int) $tax_rates_id . "',\r\n tax_zone_id = '" . (int) $tax_zone_id . "',\r\n tax_class_id = '" . (int) $tax_class_id . "',\r\n tax_rate = '" . zen_db_input($tax_rate) . "',\r\n tax_description = '" . zen_db_input($tax_description) . "',\r\n tax_priority = '" . zen_db_input($tax_priority) . "',\r\n last_modified = now() where tax_rates_id = '" . (int) $tax_rates_id . "'");
zen_record_admin_activity('Tax Rate updated for tax-rate-id ' . $tax_rates_id, 'info');
zen_redirect(zen_href_link(FILENAME_TAX_RATES, 'page=' . $_GET['page'] . '&tID=' . $tax_rates_id));
break;
case 'deleteconfirm':
// demo active test
if (zen_admin_demo()) {
$_GET['action'] = '';
$messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
zen_redirect(zen_href_link(FILENAME_TAX_RATES, 'page=' . $_GET['page']));
}
$tax_rates_id = zen_db_prepare_input($_POST['tID']);
$db->Execute("delete from " . TABLE_TAX_RATES . "\r\n where tax_rates_id = '" . (int) $tax_rates_id . "'");
zen_record_admin_activity('Tax Rate deleted for tax-rate-id ' . (int) $tax_rates_id, 'notice');
zen_redirect(zen_href_link(FILENAME_TAX_RATES, 'page=' . $_GET['page']));
break;
}
}
?>
<!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;
?>
">
示例11: zen_record_admin_activity
*/
if (!file_exists(SESSION_WRITE_DIRECTORY) || !is_writable(SESSION_WRITE_DIRECTORY)) {
zen_record_admin_activity('Session directory folder not found. Will attempt to re-detect and update configuration. Old value: ' . SESSION_WRITE_DIRECTORY, 'notice');
define('DIR_FS_ROOT', realpath(dirname($_SERVER['SCRIPT_FILENAME']) . '/../') . '/');
$possible_dir[] = DIR_FS_SQL_CACHE;
$possible_dir[] = DIR_FS_CATALOG . 'cache';
$possible_dir[] = DIR_FS_ROOT . 'cache';
$selected_dir = DIR_FS_CATALOG . 'cache';
foreach ($possible_dir as $dir) {
if (!file_exists($dir)) {
unset($dir);
continue;
}
if (!is_writable($dir)) {
unset($dir);
continue;
}
$selected_dir = $dir;
}
if ($selected_dir == '') {
$selected_dir = DIR_FS_CATALOG . 'cache';
}
$sql = "update " . TABLE_CONFIGURATION . " set configuration_value = '" . $db->prepare_input(trim($selected_dir)) . "' where configuration_key = 'SESSION_WRITE_DIRECTORY'";
$db->Execute($sql);
zen_record_admin_activity('Updated SESSION_WRITE_DIRECTORY configuration setting to ' . $selected_dir, 'notice');
if (!file_exists($selected_dir) || !is_writable($selected_dir)) {
die('ALERT: Your cache directory does not exist or is not writable: ' . $selected_dir . ' ... This must be fixed before the page can load correctly.');
}
zen_redirect(zen_href_link(FILENAME_DEFAULT));
exit(1);
}
示例12: switch
$limit = ' LIMIT ';
if ($start > 0) {
$limit .= (int) $start;
}
if ($start > 0 && $perpage > 0) {
$limit .= ', ';
}
if ($perpage > 0) {
$limit .= (int) $perpage;
}
}
$sort = '';
switch ($action) {
case 'save':
global $db;
zen_record_admin_activity(sprintf(TEXT_ACTIVITY_LOG_ACCESSED, $format, $selected_filter, $save_to_file_checked ? '(SaveToFile)' : ($format == 'HTML' ? '(Output to browser)' : '(Download to browser)')), 'warning');
if ($format == 'CSV') {
$FIELDSTART = '"';
$FIELDEND = '"';
$FIELDSEPARATOR = ',';
$LINESTART = '';
$LINEBREAK = "\n";
$sort = ' ASC ';
$limit = '';
}
if ($format == 'TXT') {
$FIELDSTART = '';
$FIELDEND = '';
$FIELDSEPARATOR = "\t";
$LINESTART = '';
$LINEBREAK = "\n";
示例13: save
function save($overwrite = true)
{
global $messageStack;
if (!$overwrite and file_exists($this->destination . $this->filename)) {
$messageStack->add_session(TEXT_IMAGE_OVERWRITE_WARNING . $this->filename, 'caution');
return true;
} else {
if (substr($this->destination, -1) != '/') {
$this->destination .= '/';
}
if (move_uploaded_file($this->file['tmp_name'], $this->destination . $this->filename)) {
chmod($this->destination . $this->filename, $this->permissions);
if ($this->message_location == 'direct') {
$messageStack->add(sprintf(SUCCESS_FILE_SAVED_SUCCESSFULLY, $this->filename), 'success');
} else {
$messageStack->add_session(sprintf(SUCCESS_FILE_SAVED_SUCCESSFULLY, $this->filename), 'success');
}
zen_record_admin_activity(sprintf(SUCCESS_FILE_SAVED_SUCCESSFULLY, $this->filename), 'notice');
return true;
} else {
if ($this->message_location == 'direct') {
$messageStack->add(ERROR_FILE_NOT_SAVED, 'error');
} else {
$messageStack->add_session(ERROR_FILE_NOT_SAVED, 'error');
}
return false;
}
}
}
示例14: zen_record_admin_activity
if ((! isset($_SESSION['securityToken']) || ! isset($_POST['securityToken'])) || ($_SESSION['securityToken'] !== $_POST['securityToken']))
{
$error = true;
$message = ERROR_SECURITY_ERROR;
zen_record_admin_activity(TEXT_ERROR_ATTEMPTED_ADMIN_LOGIN_WITHOUT_CSRF_TOKEN, 'warning');
}
if ($_POST['action'] == 'do' . $_SESSION['securityToken'])
{
$admin_name = zen_db_prepare_input($_POST['admin_name']);
$admin_pass = zen_db_prepare_input($_POST['admin_pass']);
if ($admin_name == '' && $admin_pass == '')
{
sleep(4);
$error = true;
$message = ERROR_WRONG_LOGIN;
zen_record_admin_activity(TEXT_ERROR_ATTEMPTED_ADMIN_LOGIN_WITHOUT_USERNAME, 'warning');
} else
{
list($error, $expired, $message, $redirect) = zen_validate_user_login($admin_name, $admin_pass);
if ($redirect != '') zen_redirect($redirect);
}
} elseif ($_POST['action'] == 'rs' . $_SESSION['securityToken'])
{
$expired = true;
$admin_name = zen_db_prepare_input($_POST['admin_name-' . $_SESSION['securityToken']]);
$adm_old_pwd = zen_db_prepare_input($_POST['oldpwd-' . $_SESSION['securityToken']]);
$adm_new_pwd = zen_db_prepare_input($_POST['newpwd-' . $_SESSION['securityToken']]);
$adm_conf_pwd = zen_db_prepare_input($_POST['confpwd-' . $_SESSION['securityToken']]);
$errors = zen_validate_pwd_reset_request($admin_name, $adm_old_pwd, $adm_new_pwd, $adm_conf_pwd);
if (sizeof($errors) > 0)
示例15: zen_redirect
$action = '';
zen_redirect(zen_href_link(FILENAME_DEFINE_PAGES_EDITOR));
break;
case 'save':
if ($_GET['lngdir'] && $_GET['filename']) {
if (file_exists($file)) {
if (file_exists('bak' . $file)) {
@unlink('bak' . $file);
}
@rename($file, 'bak' . $file);
$new_file = fopen($file, 'w');
$file_contents = stripslashes($_POST['file_contents']);
fwrite($new_file, $file_contents, strlen($file_contents));
fclose($new_file);
}
zen_record_admin_activity('Define-Page-Editor was used to save changes to file ' . $file, 'info');
zen_redirect(zen_href_link(FILENAME_DEFINE_PAGES_EDITOR));
}
break;
}
if (!$_SESSION['language']) {
$_SESSION['language'] = $language;
}
$languages_array = array();
$languages = zen_get_languages();
$lng_exists = false;
for ($i = 0; $i < sizeof($languages); $i++) {
if ($languages[$i]['directory'] == $_SESSION['language']) {
$lng_exists = true;
}
$languages_array[] = array('id' => $languages[$i]['directory'], 'text' => $languages[$i]['name']);