/**
  * @see Form::save()
  */
 public function save()
 {
     parent::save();
     // store search result in database
     $data = serialize(array('matches' => $this->matches, 'itemsPerPage' => $this->itemsPerPage, 'columns' => $this->columns));
     $sql = "INSERT INTO \twcf" . WCF_N . "_search\n\t\t\t\t\t(userID, searchData, searchDate, searchType)\n\t\t\tVALUES\t\t(" . WCF::getUser()->userID . ",\n\t\t\t\t\t'" . escapeString($data) . "',\n\t\t\t\t\t" . TIME_NOW . ",\n\t\t\t\t\t'users')";
     unset($data);
     // save memory
     WCF::getDB()->sendQuery($sql);
     unset($sql);
     // save memory
     // get new search id
     $this->searchID = WCF::getDB()->getInsertID();
     $this->saved();
     // forward to result page
     HeaderUtil::redirect('index.php?page=UserList&searchID=' . $this->searchID . '&sortField=' . rawurlencode($this->sortField) . '&sortOrder=' . rawurlencode($this->sortOrder) . '&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
 /**
  * @see Form::show()
  */
 public function show()
 {
     // set active menu item
     WCFACP::getMenu()->setActiveMenuItem('wcf.acp.menu.link.user.massProcessing');
     // check permission
     WCF::getUser()->checkPermission(array('admin.user.canEditUser', 'admin.user.canDeleteUser', 'admin.user.canMailUser'));
     // check master password
     WCFACP::checkMasterPassword();
     // get user options and categories from cache
     $this->readCache();
     // show form
     parent::show();
 }
예제 #3
0
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     // get profile options
     require_once WCF_DIR . 'lib/data/user/option/UserOptions.class.php';
     $userOptions = new UserOptions();
     $this->categories = $userOptions->getOptionTree('profile', $this->frame->getUser());
     // move contact information and about me
     foreach ($this->categories as $category => $categoryData) {
         if ($category == 'profile.contact' || $category == 'profile.messenger') {
             foreach ($categoryData['options'] as $key => $option) {
                 if (isset($option['outputData'])) {
                     $this->contactInformation[] = $option['outputData'];
                 } else {
                     if (!empty($option['optionValue']) && (empty($option['outputClass']) || !$userOptions->getOutputObject($option['outputClass']) instanceof UserOptionOutputContactInformation)) {
                         $this->contactInformation[] = array('icon' => '', 'title' => WCF::getLanguage()->get('wcf.user.option.' . $option['optionName']), 'value' => $option['optionValue'], 'url' => '');
                     }
                 }
             }
             unset($this->categories[$category]);
         }
     }
     // add vcard link
     $this->contactInformation[] = array('icon' => StyleManager::getStyle()->getIconPath('vCardM.png'), 'title' => WCF::getLanguage()->get('wcf.user.profile.downloadVCard'), 'value' => StringUtil::encodeHTML($this->frame->getUser()->username), 'url' => 'index.php?page=VCard&userID=' . $this->frame->getUserID() . SID_ARG_2ND);
     // add general informations
     // registration date
     $this->generalInformation[] = array('icon' => StyleManager::getStyle()->getIconPath('registerM.png'), 'title' => WCF::getLanguage()->get('wcf.user.registrationDate'), 'value' => DateUtil::formatTime(null, $this->frame->getUser()->registrationDate));
     // languages
     require_once WCF_DIR . 'lib/acp/form/UserOptionListForm.class.php';
     $languages = array();
     $availableLanguages = UserOptionListForm::getAvailableContentLanguages();
     if (!$this->frame->getUser()->languageIDs) {
         $this->languages = $availableLanguages;
     } else {
         $languageIDs = explode(',', $this->frame->getUser()->languageIDs);
         foreach ($languageIDs as $languageID) {
             if (isset($availableLanguages[$languageID])) {
                 $languages[$languageID] = $availableLanguages[$languageID];
             }
         }
         // sort languages
         StringUtil::sort($languages);
     }
     if (count($languages)) {
         $this->generalInformation[] = array('icon' => StyleManager::getStyle()->getIconPath('languageM.png'), 'title' => WCF::getLanguage()->get('wcf.user.profile.languages'), 'value' => implode(', ', $languages));
     }
     // last activity
     if (!$this->frame->getUser()->isOnline() && (!$this->frame->getUser()->invisible || WCF::getUser()->getPermission('admin.general.canViewInvisible')) && $this->frame->getUser()->lastActivityTime != 0) {
         $this->generalInformation[] = array('icon' => StyleManager::getStyle()->getIconPath('offlineM.png'), 'title' => WCF::getLanguage()->get('wcf.user.lastActivity'), 'value' => DateUtil::formatTime(null, $this->frame->getUser()->lastActivityTime, true));
     }
     // profile visits
     WCF::getTPL()->assign('user', $this->frame->getUser());
     $this->generalInformation[] = array('icon' => StyleManager::getStyle()->getIconPath('visitsM.png'), 'title' => WCF::getLanguage()->get('wcf.user.profile.hits'), 'value' => StringUtil::formatNumeric($this->frame->getUser()->profileHits) . ($this->frame->getUser()->getProfileAge() > 1 ? ' ' . WCF::getLanguage()->getDynamicVariable('wcf.user.profile.hitsPerDay') : ''));
     // get profile visitors
     $sql = "SELECT\t\tavatar.*, user_table.*, visitor.*\n\t\t\tFROM\t\twcf" . WCF_N . "_user_profile_visitor visitor\n\t\t\tLEFT JOIN \twcf" . WCF_N . "_user user_table\n\t\t\tON \t\t(user_table.userID = visitor.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\townerID = " . $this->frame->getUserID() . "\n\t\t\t\t\tAND user_table.userID IS NOT NULL\n\t\t\tORDER BY\ttime DESC";
     $result = WCF::getDB()->sendQuery($sql, 5);
     while ($row = WCF::getDB()->fetchArray($result)) {
         $this->profileVisitors[] = new UserProfile(null, $row);
     }
     // friends
     if (MODULE_MEMBERS_LIST == 1 && $this->frame->getUser()->shareWhitelist) {
         $sql = "SELECT\t\tavatar.*, user_table.*\n\t\t\t\tFROM\t\twcf" . WCF_N . "_user_whitelist friends\n\t\t\t\tLEFT JOIN \twcf" . WCF_N . "_user user_table\n\t\t\t\tON \t\t(user_table.userID = friends.whiteUserID)\n\t\t\t\tLEFT JOIN \twcf" . WCF_N . "_avatar avatar\n\t\t\t\tON \t\t(avatar.avatarID = user_table.avatarID)\n\t\t\t\tWHERE\t\tfriends.userID = " . $this->frame->getUserID() . "\n\t\t\t\t\t\tAND confirmed = 1\n\t\t\t\t\t\tAND user_table.userID IS NOT NULL\n\t\t\t\tORDER BY\tfriends.time DESC";
         $result = WCF::getDB()->sendQuery($sql, 5);
         while ($row = WCF::getDB()->fetchArray($result)) {
             $this->friends[] = new UserProfile(null, $row);
         }
     }
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     UserOptionListForm::readData();
     if (!count($_POST)) {
         // get visible languages
         $this->readVisibleLanguages();
         // default values
         $this->readDefaultValues();
     }
     // add icon path
     $this->categoryData = $this->cachedCategories[$this->activeCategory];
     if (!empty($this->categoryData['categoryIconM'])) {
         // get relative path
         $path = '';
         if (empty($this->categoryData['packageDir'])) {
             $path = RELATIVE_WCF_DIR;
         } else {
             $path = FileUtil::getRealPath(RELATIVE_WCF_DIR . $this->categoryData['packageDir']);
         }
         $this->categoryData['categoryIconM'] = $path . $this->categoryData['categoryIconM'];
     }
     // get path to category icons
     foreach ($this->cachedCategories as $key => $category) {
         // add icon path
         if (!empty($category['categoryIconM'])) {
             // get relative path
             $path = '';
             if (empty($category['packageDir'])) {
                 $path = RELATIVE_WCF_DIR;
             } else {
                 $path = FileUtil::getRealPath(RELATIVE_WCF_DIR . $category['packageDir']);
             }
             $this->cachedCategories[$key]['categoryIconM'] = $path . $category['categoryIconM'];
         }
     }
     // get categories
     $this->options = $this->getOptionTree($this->activeCategory);
     if (count($this->options) == 0) {
         $this->pageOptions = $this->getCategoryOptions($this->activeCategory);
     }
 }
예제 #5
0
 /**
  * @see DynamicOptionListForm::checkOption()
  */
 protected function checkOption($optionName)
 {
     if (!parent::checkOption($optionName)) {
         return false;
     }
     $option = $this->cachedOptions[$optionName];
     return $option['editable'] != 1 && $option['editable'] != 4 && !$option['disabled'];
 }