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


PHP Events::appendSignupComment方法代码示例

本文整理汇总了PHP中Events::appendSignupComment方法的典型用法代码示例。如果您正苦于以下问题:PHP Events::appendSignupComment方法的具体用法?PHP Events::appendSignupComment怎么用?PHP Events::appendSignupComment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Events的用法示例。


在下文中一共展示了Events::appendSignupComment方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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

示例2: process

 public function process()
 {
     $event = Events::getById($this->getElementValue('event'));
     switch ($event['signups']) {
         case 'staff':
             $initialSignupStatus = 'STAFF';
             break;
         case 'punters':
             $initialSignupStatus = 'SIGNEDUP';
             break;
         case 'waitinglist':
             $initialSignupStatus = 'WAITING_LIST';
             break;
         default:
             throw new Exception('Cannot determine your initial signup status when the event signup status is: ' . $event['signups']);
     }
     Events::setSignupStatus($this->getElementValue('user'), $this->getElementValue('event'), $initialSignupStatus);
     $userReq = $this->getElementValue('comment');
     if (!empty($userReq)) {
         $userReq = 'User requirement: ' . $userReq;
     }
     Events::appendSignupComment($this->getElementValue('user'), $this->getElementValue('event'), 'User self signup. ' . $userReq);
 }
开发者ID:CWFranklin,项目名称:lan-party-site,代码行数:23,代码来源:FormSignup.php

示例3: getAuthenticatedMachines

    case 'PAID':
        $authenticatedMachines = getAuthenticatedMachines($user->getId(), $event['id']);
        $sql = 'SELECT s.numberMachinesAllowed FROM signups s WHERE s.user = :user AND s.event = :event';
        $stmt = DatabaseFactory::getInstance()->prepare($sql);
        $stmt->bindValue(':user', $user->getId());
        $stmt->bindValue(':event', $event['id']);
        $stmt->execute();
        $signup = $stmt->fetchRowNotNull();
        if (count($authenticatedMachines) >= $signup['numberMachinesAllowed']) {
            apiReturn('reject-overuse');
        } else {
            $sql = 'INSERT INTO authenticated_machines (user, event, seat, ip, hostname, mac) VALUES (:user, :event, :seat, :ip, :hostname, :mac)';
            $stmt = DatabaseFactory::getInstance()->prepare($sql);
            $stmt->bindValue(':user', $user->getId());
            $stmt->bindValue(':event', $event['id']);
            $stmt->bindValue(':seat', $sanitizer->filterString('seat'));
            $stmt->bindValue(':ip', $sanitizer->filterString('ip'));
            $stmt->bindValue(':hostname', $sanitizer->filterString('hostname'));
            $stmt->bindValue(':mac', $sanitizer->filterString('mac'));
            $stmt->execute();
            Events::setSignupStatus($user->getId(), $event['id'], 'ATTENDED');
            Events::appendSignupComment($user->getId(), $event['id'], 'Authenticated machine: ' . $sanitizer->filterString('mac'));
            apiReturn('allow');
        }
    case 'STAFF':
        apiReturn('allow-full');
    case 'SIGNEDUP':
        apiReturn('reject-payment');
    default:
        apiReturn('fatal', 'Unrecognised signup status: ' . $signupStatus);
}
开发者ID:CWFranklin,项目名称:lan-party-site,代码行数:31,代码来源:machineAuthentication.php


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