Exemple #1
0
 public function __construct(LoggerInterface $logger)
 {
     $this->dbh = parent::getDb();
     $this->logger = $logger;
     $this->permissions = new Permissions($this->logger);
     $this->config = parent::loadConfig('users');
 }
Exemple #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;
     }
 }
Exemple #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;
     }
 }
Exemple #4
0
 public function __construct()
 {
     $this->db = parent::getDb();
 }
Exemple #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'];
 }
Exemple #6
0
 public function __construct()
 {
     $config = $this->config = parent::loadConfig('logger');
     $this->logLevelThreshold = constant('\\Wappr\\Ticklr\\log\\LogLevel::' . $config['threshold']);
 }
Exemple #7
0
 /**
  * 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;
     }
 }