示例#1
0
文件: Users.php 项目: wappr/ticklr
 public function __construct(LoggerInterface $logger)
 {
     $this->dbh = parent::getDb();
     $this->logger = $logger;
     $this->permissions = new Permissions($this->logger);
     $this->config = parent::loadConfig('users');
 }
示例#2
0
 /**
  * Gets responses to tickets by a User ID. This would be good to do to see
  * someone's progress with tickets
  * 
  * @param type $uid
  * @return boolean
  */
 public function getTicketResponseByUid($uid)
 {
     $q = 'SELECT ' . $this->fields . ' FROM ticketResponses WHERE uid = :uid';
     $this->stmt = $this->db->prepare($q);
     $this->stmt->bindParam(':uid', $uid, \PDO::PARAM_INT);
     $this->stmt->execute();
     $data = $this->stmt->fetch(\PDO::FETCH_ASSOC);
     if ($this->stmt->rowCount() > 0) {
         parent::setData($data);
         return true;
     } else {
         return false;
     }
 }
示例#3
0
 /**
  * Retrieves all of a user's ticket.
  * 
  * @param int $uid ID of the user
  * @return bool
  */
 public function getTicketRootByUid($uid)
 {
     $q = 'SELECT * FROM ticketRoot WHERE uid = :uid and status != -1 LIMIT 1';
     $this->stmt = $this->db->prepare($q);
     $this->stmt->bindParam(':uid', $uid, \PDO::PARAM_INT);
     $this->stmt->execute();
     $data = $this->stmt->fetch(\PDO::FETCH_ASSOC);
     if ($this->stmt->rowCount() > 0) {
         parent::setData($data);
         return true;
     } else {
         return false;
     }
 }
示例#4
0
 public function __construct()
 {
     $this->db = parent::getDb();
 }
示例#5
0
 public function __construct(LoggerInterface $logger)
 {
     $this->db = parent::getDb();
     $this->logger = $logger;
     $this->allowedQuestions = ['createOrganization', 'removeOrganization', 'createGroup', 'removeGroup', 'viewOtherGroup', 'removeOtherGroup', 'addUser', 'removeUser', 'viewOtherUser', 'removeOtherUser', 'assignUserGroup', 'removeUserGroup'];
 }
示例#6
0
文件: Logger.php 项目: wappr/ticklr
 public function __construct()
 {
     $config = $this->config = parent::loadConfig('logger');
     $this->logLevelThreshold = constant('\\Wappr\\Ticklr\\log\\LogLevel::' . $config['threshold']);
 }
示例#7
0
文件: Cache.php 项目: wappr/ticklr
 /**
  * Check to see if the directory already exists, if it doesn't, create it
  * 
  * @param type $class
  * @return boolean
  */
 protected static function checkDir($class)
 {
     $config = parent::loadConfig('cache');
     $classDir = $config['cache_directory'] . DS . $class;
     if (!file_exists($classDir)) {
         return mkdir($classDir);
     } else {
         return true;
     }
 }