本文整理汇总了PHP中logActivity函数的典型用法代码示例。如果您正苦于以下问题:PHP logActivity函数的具体用法?PHP logActivity怎么用?PHP logActivity使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了logActivity函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: log
function log($msg)
{
if (is_array($msg)) {
$msg = print_r($msg, true);
}
logActivity($msg);
}
示例2: stop_users_vms
function stop_users_vms()
{
logActivity("Starting to stop vms for users.");
//Find all users whos credit is low
$table = "tblclients";
$fields = "*";
$result = select_query($table, $fields);
if ($result) {
while ($data = mysql_fetch_array($result)) {
$userid = $data['id'];
$balanceLimit = get_balance_limit($userid);
if (!$balanceLimit || !is_numeric($balanceLimit)) {
$balanceLimit = 0;
}
logActivity("Balance limit for user " . $userid . ": " . $balanceLimit);
if (getCreditForUserId($userid) + $balanceLimit < 0) {
logActivity("Stopping vms for user: " . $userid);
$command = '/bin/stopvms?arg=-u&arg=' . $userid . '&asynchronous';
$res = oms_command($command);
if ($res != -1) {
logActivity("Stopped vms for user: " . $userid . ". Result:" . $res);
} else {
logActivity("Stoping vms failed for user: " . $userid);
}
}
}
}
logActivity("Stopping vms for users ended.");
}
示例3: doUnsubscribe
/**
*
* @ WHMCS FULL DECODED & NULLED
*
* @ Version : 5.2.15
* @ Author : MTIMER
* @ Release on : 2013-12-24
* @ Website : http://www.mtimer.cn
*
**/
function doUnsubscribe($email, $key)
{
global $whmcs;
global $_LANG;
$whmcs->get_hash();
if (!$email) {
return $_LANG['pwresetemailrequired'];
}
$result = select_query("tblclients", "id,email,emailoptout", array("email" => $email));
$data = mysql_fetch_array($result);
$userid = $data['id'];
$email = $data['email'];
$emailoptout = $data['emailoptout'];
$newkey = sha1($email . $userid . $cc_encryption_hash);
if ($newkey == $key) {
if (!$userid) {
return $_LANG['unsubscribehashinvalid'];
}
if ($emailoptout == 1) {
return $_LANG['alreadyunsubscribed'];
}
update_query("tblclients", array("emailoptout" => "1"), array("id" => $userid));
sendMessage("Unsubscribe Confirmation", $userid);
logActivity("Unsubscribed From Marketing Emails - User ID:" . $userid, $userid);
return null;
}
return $_LANG['unsubscribehashinvalid'];
}
示例4: getActiveFraudModule
function getActiveFraudModule()
{
global $CONFIG;
$result = select_query("tblfraud", "fraud", array("setting" => "Enable", "value" => "on"));
$data = mysql_fetch_array($result);
$fraud = $data['fraud'];
$orderid = $_SESSION['orderdetails']['OrderID'];
if ($CONFIG['SkipFraudForExisting']) {
$result = select_query("tblorders", "COUNT(*)", array("status" => "Active", "userid" => $_SESSION['uid']));
$data = mysql_fetch_array($result);
if ($data[0]) {
$fraudmodule = "";
logActivity("Order ID " . $orderid . " Skipped Fraud Check due to Already Active Orders");
}
}
$hookresponses = run_hook("RunFraudCheck", array("orderid" => $orderid, "userid" => $_SESSION['uid']));
foreach ($hookresponses as $hookresponse) {
if ($hookresponse) {
$fraud = "";
logActivity("Order ID " . $orderid . " Skipped Fraud Check due to Custom Hook");
continue;
}
}
return $fraud;
}
示例5: modify_oms_passwd
function modify_oms_passwd($vars)
{
$userid = $vars['userid'];
$password = $vars['password'];
$command = '/bin/passwd?arg=-u&arg=' . $userid . '&arg=' . $password;
$result = oms_command($command);
logActivity('Modified password of the OMS user ' . $username . ', result: ' . $result);
}
示例6: createOrder
public function createOrder($userid, $paymentmethod, $contactid = "")
{
global $whmcs;
$order_number = generateUniqueID();
$this->orderid = insert_query("tblorders", array("ordernum" => $order_number, "userid" => $userid, "contactid" => $contactid, "date" => "now()", "status" => "Pending", "paymentmethod" => $paymentmethod, "ipaddress" => $whmcs->get_user_ip()));
logActivity("New Order Created - Order ID: " . $orderid . " - User ID: " . $userid);
return $this->orderid;
}
示例7: process
public function process()
{
$event = Events::getById($this->getElementValue('id'));
Events::setSignupStatus($this->user->getId(), $event['id'], 'SIGNEDUP');
Events::appendSignupComment($this->user->getId(), $event['id'], 'Forced signup.', Session::getUser()->getUsername());
logActivity('Forced signup of:' . $this->getElementValue('username') . ' to event: ' . $event['id'] . ' (' . $event['name'] . ')');
redirect('viewEvent.php?id=' . $event['id'], 'They have been signed up.');
}
示例8: process
public function process()
{
$eventId = $this->getElementValue('event');
$userId = $this->userId;
$seatId = $this->getElementValue('seat');
setSeatForUser($eventId, $userId, $seatId);
logActivity('Moved user ' . $this->getElementValue('username') . ' to seat ' . $seatId);
}
示例9: smarty_function_oms_bundle_products
/**
* Smarty {oms_bundle_products} function plugin
*
* Type: function<br>
* Name: oms_bundle_products<br>
* Date: April 12, 2013<br>
* Purpose: Provides OMS bundles with product items sum and with product items names if not defined manually.
* @version 1.0
* @param array
* @param Smarty
* @return Integer logged in user credit amount
*/
function smarty_function_oms_bundle_products($params, &$smarty)
{
$bundleId = empty($params['bundleId']) ? null : $params['bundleId'];
$groupId = empty($params['groupId']) ? null : $params['groupId'];
$smarty->assign('productSum', 0);
if ($bundleId && $bundleId) {
//Query for bundles
$table = "tblbundles";
$fields = "*";
$where = array("gid" => $groupId, "id" => $bundleId);
$sort = "id";
$sortorder = "ASC";
$result = select_query($table, $fields, $where, $sort, $sortorder);
if ($result) {
$productIds = array();
while ($data = mysql_fetch_array($result)) {
$itemdata = $data['itemdata'];
//find product ids from string
$ptn = "*\"pid\";[a-z]:[0-9]+:\"[0-9]+\"*";
preg_match_all($ptn, $itemdata, $matches);
foreach ($matches[0] as $match) {
$ptnNr = "/[0-9]+\$/";
$str = str_replace("\"", "", $match);
preg_match($ptnNr, $str, $matchNr);
if ($matchNr) {
$productIds[$matchNr[0]]++;
} else {
logActivity("Error parsing itemdata to get product id.");
}
}
}
$productsNames = array();
$sum = 0;
foreach ($productIds as $id => $count) {
//print_r("Product with id:".$id.", count:".$count);
//Query for products
$sql = "SELECT DISTINCT * FROM tblproducts product JOIN tblpricing price ON product.id = price.relid WHERE price.type='product' AND product.id = '" . $id . "'";
$query = mysql_query($sql);
$product = mysql_fetch_array($query);
if ($product) {
$sum += $product['monthly'] * $count;
$productsNames[] = ($count > 1 ? $count . " x " : '') . $product['name'];
} else {
logActivity("Error getting product");
}
}
$smarty->assign('productSum', $sum);
$smarty->assign('productNames', $productsNames);
//print_r("<PRE>");
//print_r($productIds);
//print_r("</PRE>");
} else {
logActivity("Error getting bundles products");
}
}
}
示例10: process
public function process()
{
global $db;
$sql = 'INSERT INTO events (name, date, duration, venue) VALUES (:title, :start, :duration, :venue)';
$stmt = $db->prepare($sql);
$stmt->bindValue(':title', $this->getElementValue('title'));
$stmt->bindValue(':start', $this->getElementValue('start'));
$stmt->bindValue(':duration', $this->getElementValue('duration'));
$stmt->bindValue(':venue', $this->getElementValue('venue'));
$stmt->execute();
logActivity('Event created: ' . $db->lastInsertId() . ' / ' . $this->getElementValue('title'));
}
示例11: processNew
public function processNew()
{
global $db;
$sql = 'INSERT INTO page_content (page, content, updatedBy) VALUES (:title, :content, :userId) ';
$stmt = $db->prepare($sql);
$stmt->bindValue(':title', $this->getElementValue('title'));
$stmt->bindValue(':content', $this->getElementValue('content'));
$stmt->bindValue(':userId', Session::getUser()->getId());
$stmt->execute();
logActivity('Content created: ' . $this->getElementValue('title'));
return true;
}
示例12: slack_post
function slack_post($text)
{
$json = file_get_contents(dirname(__FILE__) . "/slack.json");
$config = json_decode($json, true);
$url = $config['hook_url'];
$payload = array("text" => $text, "username" => $config["username"], "icon_emoji" => $config["emoji"], "channel" => $config["channel"]);
$data = "payload=" . json_encode($payload);
logActivity("Send slack notification:" . $text);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
}
示例13: setUserInSeat
function setUserInSeat($eventId, $seatId, $userId = null)
{
if (empty($userId)) {
$userId = Session::getUser()->getId();
}
logActivity('_u_' . ' selected seat ' . $seatId . ' for event _e_', null, array('user' => $userId, 'event' => $eventId));
$sql = 'INSERT INTO seatingplan_seat_selections (seat, event, user) VALUES (:seat, :event, :user1) ON DUPLICATE KEY UPDATE user = :user2';
$stmt = DatabaseFactory::getInstance()->prepare($sql);
$stmt->bindValue(':seat', $seatId);
$stmt->bindValue(':event', $eventId);
$stmt->bindValue(':user1', $userId);
$stmt->bindValue(':user2', $userId);
$stmt->execute();
}
示例14: populateLoadAverageInProductDetailsPage
/**
* Add information about the system's load average to the template
*
* @param array $params The current template variables to display
* @return array key value pairs of variables to add to the template
*/
function populateLoadAverageInProductDetailsPage($params)
{
$serviceId = $params['serviceid'];
// See http://docs.whmcs.com/classes/classes/WHMCS.Service.Service.html for details on this model
/** @var Service $service */
try {
$service = Service::findOrFail($serviceId);
} catch (Exception $e) {
logActivity('Exception caught when trying to load the Service Model:' . $e->getMessage());
return null;
}
$loadAverage = getLoadAverageFromService($service);
// Simple conversion from SimpleXMLElement to array
return array('loadAverage' => (array) $loadAverage);
}
示例15: affiliateActivate
/**
*
* @ WHMCS FULL DECODED & NULLED
*
* @ Version : 5.2.15
* @ Author : MTIMER
* @ Release on : 2013-12-24
* @ Website : http://www.mtimer.cn
*
**/
function affiliateActivate($userid)
{
global $CONFIG;
$result = select_query("tblclients", "currency", array("id" => $userid));
$data = mysql_fetch_array($result);
$clientcurrency = $data['currency'];
$bonusdeposit = convertCurrency($CONFIG['AffiliateBonusDeposit'], 1, $clientcurrency);
$result = select_query("tblaffiliates", "id", array("clientid" => $userid));
$data = mysql_fetch_array($result);
$affiliateid = $data['id'];
if (!$affiliateid) {
$affiliateid = insert_query("tblaffiliates", array("date" => "now()", "clientid" => $userid, "balance" => $bonusdeposit));
}
logActivity("Activated Affiliate Account - Affiliate ID: " . $affiliateid . " - User ID: " . $userid, $userid);
run_hook("AffiliateActivation", array("affid" => $affiliateid, "userid" => $userid));
}