Esempio n. 1
0
 /**
  * FreetagLib
  *
  * Constructor for the freetag class.
  *
  */
 function __construct()
 {
     parent::__construct();
     global $prefs;
     if ($prefs['freetags_lowercase_only'] != 'y') {
         $this->_normalize_in_lowercase = 0;
     }
     if (isset($prefs['freetags_ascii_only']) && $prefs['freetags_ascii_only'] != 'y') {
         $this->_normalized_valid_chars = '';
     } else {
         $this->_normalized_valid_chars = $prefs['freetags_normalized_valid_chars'];
     }
     $this->multilingual = $prefs['freetags_multilingual'] == 'y' && $prefs['feature_multilingual'] == 'y';
 }
 function get_mail_events($event, $object)
 {
     global $tikilib;
     require_once 'lib/objectlib.php';
     $query = "select * from `tiki_user_watches` where `event`=? and (`object`=? or `object`='*')";
     $result = $this->query($query, array($event, $object));
     $ret = array();
     $map = ObjectLib::map_object_type_to_permission();
     while ($res = $result->fetchRow()) {
         if (empty($res['user']) || $tikilib->user_has_perm_on_object($res['user'], $object, $res['type'], $map[$res['type']])) {
             $ret[] = $res['email'];
         }
     }
     return $ret;
 }
Esempio n. 3
0
 function hasOnlyPrivateBacklinks($fileId)
 {
     $objects = $this->getFileBacklinks($fileId);
     if (empty($objects)) {
         return false;
     }
     foreach ($objects as $object) {
         $pobjects[$object['type']][] = $object;
     }
     include_once 'lib/objectlib.php';
     $map = ObjectLib::map_object_type_to_permission();
     foreach ($pobjects as $type => $list) {
         if ($type == 'blog post') {
             $this->parentObjects($list, 'tiki_blog_posts', 'postId', 'blogId');
             $f = Perms::filter(array('type' => 'blog'), 'object', $list, array('object' => 'blogId'), str_replace('tiki_p_', '', $map['blog']));
         } elseif (strstr($type, 'comment')) {
             $this->parentObjects($list, 'tiki_comments', 'threadId', 'object');
             $t = str_replace(' comment', '', $type);
             $f = Perms::filter(array('type' => $t), 'object', $list, array('object' => 'object'), str_replace('tiki_p_', '', $map[$t]));
         } elseif ($type == 'forum post') {
             $this->parentObjects($list, 'tiki_comments', 'threadId', 'object');
             $f = Perms::filter(array('type' => 'forum'), 'object', $list, array('object' => 'object'), str_replace('tiki_p_', '', $map['forum']));
         } elseif ($type == 'trackeritem') {
             $this->parentObjects($list, 'tiki_tracker_items', 'itemId', 'trackerId');
             $f = Perms::filter(array('type' => 'tracker'), 'object', $list, array('object' => 'trackerId'), str_replace('tiki_p_', '', $map['tracker']));
             //NEED to check item perm
         } else {
             $f = Perms::filter(array('type' => $type), 'object', $list, array('object' => 'itemId'), str_replace('tiki_p_', '', $map[$type]));
         }
         $debug = 0;
         if (!empty($debug)) {
             echo "<br />FILE{$fileId}";
             if (!empty($f)) {
                 echo 'OK-';
             } else {
                 echo 'NO-';
             }
             foreach ($list as $l) {
                 echo $l['type'] . ': ' . $l['itemId'] . '(' . $l['href'] . ')' . ',';
             }
         }
         if (!empty($f)) {
             return false;
         }
     }
     return true;
 }
Esempio n. 4
0
 function CategLib($db)
 {
     parent::ObjectLib($db);
 }