当前位置: 首页>>代码示例>>PHP>>正文


PHP logActivity函数代码示例

本文整理汇总了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);
 }
开发者ID:carriercomm,项目名称:sso-whmcs,代码行数:7,代码来源:connect.class.php

示例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.");
}
开发者ID:carriercomm,项目名称:opennode-whmcs,代码行数:29,代码来源:hook_oms_dailycronjob.php

示例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'];
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:38,代码来源:unsubscribe.php

示例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;
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:25,代码来源:fraudfunctions.php

示例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);
}
开发者ID:carriercomm,项目名称:opennode-whmcs,代码行数:8,代码来源:hook_oms_passwd.php

示例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;
 }
开发者ID:billyprice1,项目名称:whmcs,代码行数:8,代码来源:class.order.php

示例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.');
 }
开发者ID:CWFranklin,项目名称:lan-party-site,代码行数:8,代码来源:FormForceSignup.php

示例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);
 }
开发者ID:CWFranklin,项目名称:lan-party-site,代码行数:8,代码来源:FormSeatingPlanMoveUser.php

示例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");
        }
    }
}
开发者ID:carriercomm,项目名称:opennode-whmcs,代码行数:68,代码来源:function.oms_bundle_products.php

示例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'));
 }
开发者ID:CWFranklin,项目名称:lan-party-site,代码行数:12,代码来源:FormEventCreate.php

示例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;
 }
开发者ID:CWFranklin,项目名称:lan-party-site,代码行数:12,代码来源:FormContentEdit.php

示例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);
}
开发者ID:hxinen,项目名称:whmcs-hook-slack,代码行数:14,代码来源:slack.php

示例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();
}
开发者ID:CWFranklin,项目名称:lan-party-site,代码行数:14,代码来源:functions.seatingPlan.php

示例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);
}
开发者ID:n8whnp,项目名称:cPconf-2015,代码行数:21,代码来源:populateCpanelDetails.php

示例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));
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:26,代码来源:affiliatefunctions.php


注:本文中的logActivity函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。