示例#1
0
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     $sql = "SELECT *\n\t\t\t\tFROM ugml_archive_fleet\n\t\t\t\tWHERE fleetID = " . $this->fleetID;
     $row = WCF::getDB()->getFirstRow($sql);
     $this->fleetData = unserialize(LWUtil::unserialize($row['data']));
 }
 public function readData()
 {
     parent::readData();
     $this->photoList = new UserGalleryPhotoList();
     $this->photoList->sqlConditions .= 'user_gallery.albumID = ' . intval($this->album->albumID);
     $this->photoList->readObjects();
 }
 /**
  * @see Page::readData
  */
 public function readData()
 {
     parent::readData();
     //echo ".";
     $this->fleetQueue = new FleetQueue(0);
     $this->readTarget();
     $this->specs = Spec::getBySpecType(3);
     $this->fleets = Fleet::getByUserID(WCF::getUser()->userID);
     foreach ($this->fleets as $fleetID => $fleet) {
         $this->fleets[$fleetID]->navalFormation = NavalFormation::getByFleetID($fleetID);
     }
     // backlink
     if (isset($_REQUEST['backlink'])) {
         $this->backlink = StringUtil::trim($_REQUEST['backlink']);
     }
     $array = array();
     preg_match('/^(https?:\\/\\/[^\\/]*\\/)?(.*)$/i', $this->backlink, $array);
     $this->fleetQueue->backlink = $this->backlink = isset($array[2]) ? $array[2] : '';
     //echo ".";
     // TODO: clean this one up
     $sql = "DELETE FROM ugml_galactic_jump_queue\n\t\t\t\tWHERE userID = " . WCF::getUser()->userID;
     WCF::getDB()->registerShutdownUpdate($sql);
     $sql = "INSERT INTO ugml_galactic_jump_queue (userID, startPlanetID, state, time)\n\t\t\t\tVALUES(" . WCF::getUser()->userID . ", " . LWCore::getPlanet()->planetID . ", 1, " . TIME_NOW . ")";
     WCF::getDB()->registerShutdownUpdate($sql);
 }
示例#4
0
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     $this->os = PHP_OS;
     if (isset($_SERVER['SERVER_SOFTWARE'])) {
         $this->webserver = $_SERVER['SERVER_SOFTWARE'];
     }
     $this->sqlVersion = WCF::getDB()->getVersion();
     $this->sqlType = WCF::getDB()->getDBType();
     $this->readLoad();
     $this->readStat();
     // updates
     if (WCF::getUser()->getPermission('admin.system.package.canUpdatePackage')) {
         require_once WCF_DIR . 'lib/acp/package/update/PackageUpdate.class.php';
         $this->updates = PackageUpdate::getAvailableUpdates();
     }
     // news
     if (false) {
         $this->news = FeedReaderSource::getEntries(5);
         foreach ($this->news as $key => $news) {
             $this->news[$key]['description'] = preg_replace('/href="(.*?)"/e', '\'href="' . RELATIVE_WCF_DIR . 'acp/dereferrer.php?url=\'.rawurlencode(\'$1\').\'" class="externalURL"\'', $news['description']);
         }
     } else {
         $this->news = array();
     }
 }
 public function readData()
 {
     parent::readData();
     $this->entry = new ViewableBashEntry($this->entryID);
     // check for the entry
     if (!$this->entry->entryID) {
         throw new IllegalLinkException();
     }
     // check for permissions
     $throwPermissionDeniedException = false;
     if ($this->entry->isDisabled) {
         // guest
         if (!WCF::getUser()->userID) {
             $throwPermissionDeniedException = true;
         }
         // check for author (the author of the entry can see this entry)
         if (!$throwPermissionDeniedException and WCF::getUser()->userID != $this->entry->authorID) {
             $throwPermissionDeniedException = true;
         }
         // check for a moderator (a moderator can see this entry)
         if (!$throwPermissionDeniedException and WCF::getUser()->userID != $this->entry->authorID and !WCF::getUser()->getPermission('mod.bash.moderatorPermissions')) {
             $throwPermissionDeniedException = true;
         }
     }
     // throw a permission denied exception
     if ($throwPermissionDeniedException) {
         throw new PermissionDeniedException();
     }
     // init sidebars
     $this->sidebarFactory = new MessageSidebarFactory($this);
     $this->sidebarFactory->create($this->entry);
     $this->sidebarFactory->init();
 }
示例#6
0
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     if (!empty($this->allianceID)) {
         $this->alliance = new Alliance($this->allianceID);
     } else {
         $this->alliance = Alliance::getByUserID(WCF::getUser()->userID);
     }
     // no such alliance
     if ($this->alliance === null || $this->alliance->id <= 0) {
         require_once WCF_DIR . 'lib/system/exception/NamedUserException.class.php';
         //$_SERVER['HTTP_ACCEPT'] = str_replace('platzhalter', 'application/xhtml+xml', $_SERVER['HTTP_ACCEPT']);
         // user has no alliance
         if (empty($this->allianceID)) {
             // waiting for a answer to the application
             if (WCF::getUser()->ally_request) {
                 $alliance = new Alliance(WCF::getUser()->ally_request);
                 throw new NamedUserException(WCF::getLanguage()->get('wot.alliance.waitingForApplicationAnswer', array('allianceID' => $alliance->allianceID, 'allianceTag' => $alliance->ally_tag, 'userID' => WCF::getUser()->userID)));
             }
             throw new NamedUserException(WCF::getLanguage()->get('wot.alliance.notMember'));
         }
         // requested alliance does not exist
         throw new NamedUserException(WCF::getLanguage()->get('wot.alliance.notExisting'));
     }
     // applications
     if ($this->alliance->getRank(true, 3)) {
         $sql = "SELECT COUNT(*) AS count\n\t\t\t\t\tFROM ugml_users\n\t\t\t\t\tWHERE ally_request = " . $this->alliance->allianceID;
         $result = WCF::getDB()->getFirstRow($sql);
         $this->applicationsCount = $result['count'];
     }
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     $this->server = new Server($this->serverID);
     if ($this->server->serverID == 0) {
         throw new IllegalLinkException();
     }
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     $this->readMemberships();
     $this->readOpenGroups();
     $this->readApplications();
     $this->readGroupLeaders();
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     $sql = "SELECT username,\n\t\t\t\t\tugml_planets.galaxy,\n\t\t\t\t\tugml_planets.system,\n\t\t\t\t\tugml_planets.planet,\n\t\t\t\t\tugml_planets.name\n\t\t\t\tFROM ugml_users\n\t\t\t\tLEFT JOIN ugml_planets\n\t\t\t\t\tON ugml_users.id_planet = ugml_planets.id\n\t\t\t\tWHERE username LIKE '" . escapeString($this->input) . "%'";
     $result = WCF::getDB()->sendQuery($sql);
     while ($row = WCF::getDB()->fetchArray($result)) {
         $this->users[] = array($row['username'], $row['name'], '[' . $row['galaxy'] . ':' . $row['system'] . ':' . $row['planet'] . ']', $row['galaxy'], $row['system']);
     }
 }
 /**
  * @see AbstractPage::readData()
  */
 public function readData()
 {
     parent::readData();
     //gets current version
     $sql = 'SELECT packageVersion
     		FROM wcf' . WCF_N . "_package\n        \t\tWHERE package = 'de.plugins-zum-selberbauen.newsletter'";
     $row = WCF::getDB()->getFirstRow($sql);
     $this->version = $row['packageVersion'];
 }
示例#11
0
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     $this->ovents = Ovent::getByConditions(array('userID' => WCF::getUser()->userID, 'checked' => 0));
     $this->hovents = Ovent::getByConditions(array('userID' => WCF::getUser()->userID, 'checked' => 1));
     // news
     WCF::getCache()->addResource('news-' . PACKAGE_ID, WCF_DIR . 'cache/cache.news-' . PACKAGE_ID . '.php', LW_DIR . 'lib/system/cache/CacheBuilderNews.class.php');
     $this->news = WCF::getCache()->get('news-' . PACKAGE_ID);
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     // Lade Content
     $uwp = new UserWantedPosterData($this->userID);
     $this->uwpData = $uwp->readEntry();
     // Wandle BBCode um und newlines
     if (isset($this->uwpData['text'])) {
         $bbcode = new MessageParser();
         $this->uwpData['text'] = $bbcode->parse($this->uwpData['text'], $this->uwpData['enableSmilies'], $this->uwpData['enableHtml'], $this->uwpData['enableBBCodes']);
     }
 }
 /**
  * @see	Page::readData()
  */
 public function readData()
 {
     parent::readData();
     $this->entry = new UserGuestbookEntry($this->entryID);
     $this->verifyData();
     $this->verifyPermissions();
     if (!USER_GUESTBOOK_SHOW_DELETED_ENTRY_NOTE || !$this->modPermissions['canReadDeletedEntry']) {
         $this->entry->getCommentList()->sqlConditions .= ', comment.isDeleted = 0';
     }
     $this->entry->getCommentList()->sqlOrderBy .= "comment.time ASC, comment.commentID ASC";
     $this->comments = $this->entry->getComments();
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     // read warnings
     $this->userWarningList->sqlLimit = 50;
     $this->userWarningList->sqlOrderBy = 'user_warning.expires DESC';
     $this->userWarningList->readObjects();
     // read suspensions
     $this->userSuspensionList->sqlLimit = 50;
     $this->userSuspensionList->sqlOrderBy = 'user_suspension.expires DESC';
     $this->userSuspensionList->readObjects();
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     $this->countDeletedThreads();
     $this->countHiddenThreads();
     $this->countMarkedThreads();
     $this->countDeletedPosts();
     $this->countHiddenPosts();
     $this->countMarkedPosts();
     $this->countReports();
     WCF::getSession()->unregister('outstandingModerations');
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     // get members
     require_once WCF_DIR . 'lib/data/user/UserProfile.class.php';
     $sql = "SELECT\t\tavatar.*, user_table.*\n\t\t\tFROM\t\twcf" . WCF_N . "_user_to_groups ug\n\t\t\tLEFT JOIN \twcf" . WCF_N . "_user user_table\n\t\t\tON \t\t(user_table.userID = ug.userID)\n\t\t\tLEFT JOIN \twcf" . WCF_N . "_avatar avatar\n\t\t\tON \t\t(avatar.avatarID = user_table.avatarID)\n\t\t\tWHERE\t\tug.groupID = " . intval($this->groupID) . "\n\t\t\t\t\tAND user_table.userID IS NOT NULL";
     $result = WCF::getDB()->sendQuery($sql);
     while ($row = WCF::getDB()->fetchArray($result)) {
         $this->userlist[] = new UserProfile(null, $row);
     }
     // init sidebar
     $this->sidebar = new ContestSidebar();
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     // get package data
     try {
         $this->package = new Package($this->packageID);
         $this->requiredPackages = $this->package->getRequiredPackages();
         $this->dependentPackages = $this->package->getDependentPackages();
         $this->dependencies = $this->package->getDependencies();
     } catch (SystemException $e) {
         throw new IllegalLinkException();
     }
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     $this->os = PHP_OS;
     if (isset($_SERVER['SERVER_SOFTWARE'])) {
         $this->webserver = $_SERVER['SERVER_SOFTWARE'];
     }
     $this->sqlVersion = WCF::getDB()->getVersion();
     $this->sqlType = WCF::getDB()->getDBType();
     $this->readUpdates();
     $this->readNews();
     $this->readLoad();
     $this->readStat();
 }
 /**
  * @see	Page::readData()
  */
 public function readData()
 {
     parent::readData();
     $sql = "SELECT\r\n\t\t\t    \t*\r\n\t\t\t\tFROM\r\n\t\t\t   \t\t`bash" . BASH_N . "_entry`" . (BASHCore::getUser()->isModerator() ? '' : 'WHERE `isDisabled` = 0 ') . "\r\n\t\t\t\tORDER BY\r\n\t\t\t    \t votes DESC\r\n\t\t\t   \tLIMIT\r\n\t\t\t   \t\t10";
     $result = WCF::getDB()->sendQuery($sql);
     while ($row = WCF::getDB()->fetchArray($result)) {
         $this->entries[] = new ViewableBashEntry(null, $row);
     }
     // init sidebars
     $this->sidebarFactory = new MessageSidebarFactory($this);
     foreach ($this->entries as $entry) {
         $this->sidebarFactory->create($entry);
     }
     $this->sidebarFactory->init();
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     // get post, thread and board
     $this->post = new PostEditor($this->postID);
     $this->thread = new Thread($this->post->threadID);
     $this->board = Board::getBoard($this->thread->boardID);
     // get ip addresses of the author
     $this->authorIpAddresses = PostEditor::getIpAddressByAuthor($this->post->userID, $this->post->username, $this->post->ipAddress);
     // get hostnames
     $this->loadHostnames();
     // get other users of this ip address
     if ($this->post->ipAddress) {
         $this->otherUsers = PostEditor::getAuthorByIpAddress($this->post->ipAddress, $this->post->userID, $this->post->username);
     }
 }
 public function readData()
 {
     parent::readData();
     // read outstanding bash moderations
     if (BASHCore::getUser()->getPermission('mod.bash.moderatorPermissions')) {
         $sql = "SELECT\r\n\t\t\t\t\t\tCOUNT(*) AS count\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t\tbash" . BASH_N . "_entry\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\tisDisabled = 1";
         $result = WCF::getDB()->getFirstRow($sql);
         $this->outstandingModerations['entries'] = $result['count'];
     }
     // read outstanding comment moderations
     if (BASHCore::getUser()->getPermission('mod.comment.moderatorPermissions')) {
         $sql = "SELECT\r\n\t\t\t\t\t\tCOUNT(*) AS count\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t\tbash" . BASH_N . "_server_comment\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\tisDisabled = 1";
         $result = WCF::getDB()->getFirstRow($sql);
         $this->outstandingModerations['comments'] = $result['count'];
     }
 }
示例#22
0
 /**
  * @see Page::readData
  */
 public function readData()
 {
     global $user;
     parent::readData();
     $features = unserialize(WCF::getUser()->diliziumFeatures);
     if (!isset($features['galaxyScans']) || $features['galaxyScans'] <= TIME_NOW) {
         message('Dir steht diese Funktion nicht zur Verf&uuml;gung!');
     }
     // get planet
     $this->planetObj = Planet::getInstance($this->planetID);
     $subject = 'Spionagebericht von ' . $this->planetObj;
     $this->reports = EspionageFleet::searchReports(WCF::getUser()->userID, $this->planetID);
     if (!count($this->reports)) {
         message('Kein Spionagebericht gefunden!');
     }
 }
示例#23
0
 /**
  * @see Page::readData
  */
 public function readData()
 {
     parent::readData();
     // get system
     require_once LW_DIR . 'lib/data/system/System.class.php';
     $this->systemObj = new System($this->galaxy, $this->system);
     // get planet
     $this->planetObj = $this->systemObj->getPlanet($this->planet);
     // get fleets
     $sql = "SELECT ugml_fleet.*,\r\n\t\t\t\t\tugml_naval_formation.formationID,\r\n\t\t\t\t\t\t\t\tGROUP_CONCAT(\r\n\t\t\t\t\t\t\t\t\tCONCAT(specID, ',', shipCount) \r\n\t\t\t\t\t\t\t\t\tSEPARATOR ';')\r\n\t\t\t\t\t\t\t\tAS fleet\r\n\t\t\t\tFROM ugml_fleet\r\n\t\t\t\tLEFT JOIN ugml_naval_formation\r\n\t\t\t\t\tON ugml_fleet.formationID = ugml_naval_formation.formationID\r\n\t\t    \tLEFT JOIN ugml_fleet_spec\r\n\t\t    \t\tON ugml_fleet.fleetID = ugml_fleet_spec.fleetID\r\n\t\t\t\tWHERE targetPlanetID = " . $this->planetObj->planetID . "\r\n\t\t\t\t\tOR startPlanetID = " . $this->planetObj->planetID . "\r\n\t\t\t\tGROUP BY ugml_fleet.fleetID\r\n\t\t\t\tORDER BY ugml_fleet.impactTime,\r\n\t\t\t\t\tugml_fleet.returnTime";
     $fleets = WCF::getDB()->sendQuery($sql);
     $fleetArray = array();
     require_once LW_DIR . 'lib/data/fleet/Fleet.class.php';
     while ($row = WCF::getDB()->fetchArray($fleets)) {
         $fleet = Fleet::getInstance(null, $row);
         $fleetArray += $fleet->getFleetSet($this->planetObj->planetID);
     }
     ksort($fleetArray);
     $this->fleetObjs = $fleetArray;
     // calculate needed deuterium
     // 500 * (ENTFERNUNG + 2) * 0,9 ^ STUFE * (1 + 0,001 * 0,9 ^ (STUFE + 3)) ^ (ANZEIGEN + 1)
     // check phalanx
     if ($this->galaxy != LWCore::getPlanet()->galaxy) {
         message('Unerreichbare Koordinaten!');
     }
     $range = pow(LWCore::getPlanet()->sensor_phalanx, 2) - 1;
     if ($this->system < LWCore::getPlanet()->system - $range) {
         message('Unerreichbare Koordinaten!');
     }
     if ($this->system > LWCore::getPlanet()->system + $range) {
         message('Unerreichbare Koordinaten!');
     }
     if (LWCore::getPlanet()->deuterium < $this->systemObj->getPhalanxCosts()) {
         message('Zu wenig Deuterium vorhanden!');
     }
     if ($this->planetObj->id_owner == WCF::getUser()->userID && WCF::getUser()->userID != 143) {
         message('Du kannst dich nicht selbst phalanxen!');
     }
     if (LWCore::getPlanet()->sensor_phalanx <= 0) {
         message('Unerreichbare Koordinaten!');
     }
     $this->costs = $this->systemObj->getPhalanxCosts();
     $sql = "UPDATE ugml_planets\r\n\t\t\t\tSET deuterium = deuterium - " . $this->costs . ",\r\n\t\t\t\t\tphalanx_views = phalanx_views + 1\r\n\t\t\t\tWHERE id = " . LWCore::getPlanet()->planetID;
     WCF::getDB()->registerShutdownUpdate($sql);
     LWCore::getPlanet()->deuterium -= $this->costs;
     LWCore::getPlanet()->phalanx_views++;
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     $this->os = PHP_OS;
     if (isset($_SERVER['SERVER_SOFTWARE'])) {
         $this->webserver = $_SERVER['SERVER_SOFTWARE'];
     }
     $this->sqlVersion = WCF::getDB()->getVersion();
     $this->sqlType = WCF::getDB()->getDBType();
     $this->readLoad();
     $this->readStat();
     // updates
     if (WCF::getUser()->getPermission('admin.system.package.canUpdatePackage')) {
         require_once WCF_DIR . 'lib/acp/package/update/PackageUpdate.class.php';
         $updates = PackageUpdate::getAvailableUpdates();
         //print_r($updates);exit;
         foreach ($updates as $update) {
             $versions = array_reverse($update['versions']);
             // find newest minor update
             $i = 0;
             $currentVersionStatus = preg_match('/(alpha|beta|RC)/i', $update['packageVersion']) ? 'unstable' : 'stable';
             foreach ($versions as $version) {
                 $newVersionStatus = preg_match('/(alpha|beta|RC)/i', $version['packageVersion']) ? 'unstable' : 'stable';
                 if ($currentVersionStatus == $newVersionStatus && preg_match('/^(\\d\\.\\d)/', $update['packageVersion'], $match1) && preg_match('/^(\\d\\.\\d)/', $version['packageVersion'], $match2)) {
                     if ($match1[1] == $match2[1]) {
                         $minorUpdate = $update;
                         $minorUpdate['version'] = $version;
                         $this->minorUpdates[] = $minorUpdate;
                         if ($i != 0) {
                             $this->majorUpdates[] = $update;
                         }
                         continue 2;
                     }
                 }
                 $i++;
             }
             $this->majorUpdates[] = $update;
         }
     }
     // news
     $this->news = FeedReaderSource::getEntries(5);
     foreach ($this->news as $key => $news) {
         $this->news[$key]['description'] = preg_replace_callback('/href="(.*?)"/', array('IndexPage', 'parseNewsFeedCallback'), $news['description']);
     }
 }
 /**
  * @see	Page::readData()
  */
 public function readData()
 {
     parent::readData();
     $sql = "SELECT\n\t\t\t\t\t*\n\t\t\t\tFROM\n\t\t\t\t\tcms" . CMS_N . "_statistic_referer\n\t\t\t\tORDER BY\n\t\t\t\t\turl ASC";
     $result = WCF::getDB()->sendQuery($sql);
     $refererList = array();
     while ($row = WCF::getDB()->fetchArray($result)) {
         if (!isset($refererList[$row['hostID']])) {
             $refererList[$row['hostID']] = array();
         }
         $refererList[$row['hostID']][] = $row;
     }
     $sql = "SELECT\n\t\t\t\t\t*\n\t\t\t\tFROM\n\t\t\t\t\tcms" . CMS_N . "_statistic_referer_host\n\t\t\t\tORDER BY\n\t\t\t\t\thostname ASC";
     $result = WCF::getDB()->sendQuery($sql);
     while ($row = WCF::getDB()->fetchArray($result)) {
         $row['children'] = isset($refererList[$row['hostID']]) ? $refererList[$row['hostID']] : array();
         $this->hosts[] = $row;
     }
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     $this->identifier = $this->user->{$this->action};
     if (!$this->identifier) {
         throw new IllegalLinkException();
     }
     // check permissions
     WCF::getUser()->checkPermission('user.profile.canView');
     if ($this->user->ignoredUser) {
         throw new NamedUserException(WCF::getLanguage()->get('wcf.user.profile.error.ignoredUser', array('$username' => StringUtil::encodeHTML($this->user->username))));
     }
     if (!$this->user->canViewProfile()) {
         throw new IllegalLinkException();
     }
     if ($this->action == 'icq') {
         $this->identifier = StringUtil::replace('-', '', $this->identifier);
     }
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     // init cache data
     $this->cacheData = array('source' => get_class(WCF::getCache()->getCacheSource()), 'version' => '', 'size' => 0, 'files' => 0);
     // filesystem cache
     if ($this->cacheData['source'] == 'DiskCacheSource') {
         // set version
         $this->cacheData['version'] = WCF_VERSION;
         // get package dirs
         $sql = "SELECT\t\tpackage.packageDir\n\t\t\t\tFROM\t\twcf" . WCF_N . "_package_dependency package_dependency\n\t\t\t\tLEFT JOIN\twcf" . WCF_N . "_package package\n\t\t\t\tON\t\t(package.packageID = package_dependency.dependency)\n\t\t\t\tWHERE\t\tpackage_dependency.packageID = " . PACKAGE_ID . "\n\t\t\t\t\t\tAND standalone = 1";
         $result = WCF::getDB()->sendQuery($sql);
         while ($row = WCF::getDB()->fetchArray($result)) {
             $packageDir = FileUtil::getRealPath(WCF_DIR . $row['packageDir']);
             $cacheDir = $packageDir . 'cache';
             if (file_exists($cacheDir)) {
                 $this->caches[$cacheDir] = array();
                 // get files in cache directory
                 $files = glob($cacheDir . '/*.php');
                 // get additional file information
                 if (is_array($files)) {
                     foreach ($files as $file) {
                         $filesize = filesize($file);
                         $this->caches[$cacheDir][] = array('filename' => basename($file), 'filesize' => $filesize, 'mtime' => filemtime($file), 'perm' => substr(sprintf('%o', fileperms($file)), -3), 'writable' => is_writable($file));
                         $this->cacheData['files']++;
                         $this->cacheData['size'] += $filesize;
                     }
                 }
             }
         }
     } else {
         if ($this->cacheData['source'] == 'MemcacheCacheSource') {
             // get version
             require_once WCF_DIR . 'lib/system/cache/source/MemcacheAdapter.class.php';
             $this->cacheData['version'] = MemcacheAdapter::getInstance()->getMemcache()->getVersion();
             // get stats
             $stats = MemcacheAdapter::getInstance()->getMemcache()->getStats();
             $this->cacheData['files'] = $stats['curr_items'];
             $this->cacheData['size'] = $stats['bytes'];
         }
     }
 }
 /**
  * @see	Page::readData()
  */
 public function readData()
 {
     parent::readData();
     // get accessible sources
     $sourceList = new SourceList();
     $sourceList->sqlLimit = 0;
     $sourceList->hasAccessCheck = true;
     $sourceList->readObjects();
     foreach ($sourceList->getObjects() as $source) {
         $this->accessibleSources[] = $source->sourceID;
         $cache = $this->getCache('packages-' . $source->sourceID, 'Packages');
         foreach ($cache['packages'] as $package) {
             if (!in_array($package['packageName'], $this->packages[$package['packageType']])) {
                 $this->packages[$package['packageType']][] = $package['packageName'];
             }
         }
     }
     sort($this->packages['plugin'], SORT_STRING);
     sort($this->packages['standalone'], SORT_STRING);
 }
 /**
  * @see	Page::readData()
  */
 public function readData()
 {
     parent::readData();
     // validate
     if (!is_dir(CMS_DIR . 'cms_files/') or !is_readable(CMS_DIR . 'cms_files')) {
         throw new NamedUserException(WCF::getLanguage()->get('cms.filemanager.invalidDir'));
     }
     $directory = DirectoryUtil::getInstance(CMS_DIR . 'cms_files/');
     $this->fileList = $directory->getFilesObj();
     foreach ($this->fileList as $fileInfo) {
         if ($fileInfo->isDir()) {
             $this->dirObjects[$fileInfo->getPathname()] = new RecursiveDirectoryIterator(FileUtil::addTrailingSlash($fileInfo->getPathname()));
         }
     }
     print_r($this->dirObjects);
     // display warning if no htaccess file exists
     if (!file_exists(CMS_DIR . 'cms_files/.htaccess')) {
         WCF::getTPL()->assign('displayNoHtaccessWarning');
     }
 }
示例#30
0
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     $categories = WCF::getCache()->get('smileys', 'smileys');
     if (!isset($categories[$this->smileyCategoryID])) {
         $this->smileyCategoryID = 0;
     }
     $smileys = $categories[$this->smileyCategoryID];
     $maxPage = intval(ceil(count($smileys) / $this->smileysPerPage));
     if ($this->page > $maxPage) {
         $this->page = $maxPage;
     }
     $startSmiley = ($this->page - 1) * $this->smileysPerPage;
     $endSmiley = $this->page * $this->smileysPerPage;
     if ($endSmiley > count($smileys)) {
         $endSmiley = count($smileys);
     }
     for ($i = $startSmiley; $i < $endSmiley; $i++) {
         $this->smileys[] = $smileys[$i];
     }
 }