Ejemplo n.º 1
0
 /**
  * Main function to generate the content
  *
  * @return	void
  */
 function main()
 {
     $this->content = $this->doc->header('Indexing Engine Statistics');
     $this->content .= $this->doc->spacer(5);
     switch ($this->MOD_SETTINGS['function']) {
         case 'stat':
             $this->content .= $this->doc->section('Records', $this->doc->table($this->getRecordsNumbers()), 0, 1);
             $this->content .= $this->doc->spacer(15);
             $this->content .= $this->doc->section('index_phash TYPES', $this->doc->table($this->getPhashTypes()), 1);
             $this->content .= $this->doc->spacer(15);
             break;
         case 'externalDocs':
             $this->content .= $this->doc->section('External documents', $this->doc->table($this->getPhashExternalDocs()), 0, 1);
             $this->content .= $this->doc->spacer(15);
             break;
         case 'typo3pages':
             $this->content .= $this->doc->section('TYPO3 Pages', $this->doc->table($this->getPhashT3pages()), 0, 1);
             $this->content .= $this->doc->spacer(15);
             break;
     }
     $docHeaderButtons = $this->getButtons();
     $markers = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => t3lib_BEfunc::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'CONTENT' => $this->content);
     $this->content = $this->doc->startPage('Indexing Engine Statistics');
     $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
     $this->content .= $this->doc->endPage();
     $this->content = $this->doc->insertStylesAndJS($this->content);
 }
Ejemplo n.º 2
0
    /**
     * @author Martin Kutschker
     */
    function whoIsOnline()
    {
        $select_fields = 'ses_id, ses_tstamp, ses_iplock, u.uid,u.username, u.admin, u.realName, u.disable, u.starttime, u.endtime, u.deleted, bu.uid AS bu_uid,bu.username AS bu_username, bu.realName AS bu_realName';
        $from_table = 'be_sessions INNER JOIN be_users u ON ses_userid=u.uid LEFT OUTER JOIN be_users bu ON ses_backuserid=bu.uid';
        $where_clause = '';
        $orderBy = 'u.username';
        if (t3lib_div::testInt($GLOBALS['TYPO3_CONF_VARS']['BE']['sessionTimeout'])) {
            $where_clause .= 'ses_tstamp+' . $GLOBALS['TYPO3_CONF_VARS']['BE']['sessionTimeout'] . ' > ' . $GLOBALS['EXEC_TIME'];
        } else {
            $timeout = intval($GLOBALS['TYPO3_CONF_VARS']['BE']['sessionTimeout']);
            if ($timeout > 0) {
                $where_clause .= 'ses_tstamp+' . $timeout . ' > ' . $GLOBALS['EXEC_TIME'];
            }
        }
        // Fetch active sessions of other users from storage:
        $sessions = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($select_fields, $from_table, $where_clause, '', $orderBy);
        // Process and visualized each active session as a table row:
        if (is_array($sessions)) {
            foreach ($sessions as $session) {
                $ip = $session['ses_iplock'];
                $hostName = '';
                if ($session['ses_iplock'] == '[DISABLED]' || $GLOBALS['TYPO3_CONF_VARS']['BE']['lockIP'] == 0) {
                    $ip = '-';
                } elseif ($GLOBALS['TYPO3_CONF_VARS']['BE']['lockIP'] == 4) {
                    $hostName = ' title="' . @gethostbyaddr($session['ses_iplock']) . '"';
                } else {
                    $ip .= str_repeat('.*', 4 - $GLOBALS['TYPO3_CONF_VARS']['BE']['lockIP']);
                }
                $outTable .= '
					<tr class="bgColor4" height="17" valign="top">' . '<td nowrap="nowrap">' . date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'], $session['ses_tstamp']) . '</td>' . '<td nowrap="nowrap">' . '<span' . $hostName . '>' . $ip . '</span>' . '</td>' . '<td width="130">' . t3lib_iconWorks::getSpriteIconForRecord('be_users', $session, array('title' => $session['uid'])) . htmlspecialchars($session['username']) . '&nbsp;' . '</td>' . '<td nowrap="nowrap">' . htmlspecialchars($session['realName']) . '&nbsp;&nbsp;</td>' . '<td nowrap="nowrap">' . $this->elementLinks('be_users', $session) . '</td>' . '<td nowrap="nowrap" valign="top">' . ($session['bu_username'] ? '&nbsp;SU from: ' : '') . htmlspecialchars($session['bu_username']) . '&nbsp;</td>' . '<td nowrap="nowrap" valign="top">&nbsp;' . htmlspecialchars($session['bu_realName']) . '</td>' . '</tr>';
            }
        }
        // Wrap <table> tag around the rows:
        $outTable = '
		<table border="0" cellpadding="0" cellspacing="0" class="typo3-dblist">
			<tr class="t3-row-header">
				<td>' . $GLOBALS['LANG']->getLL('timestamp', true) . '</td>
				<td>' . $GLOBALS['LANG']->getLL('host', true) . '</td>
				<td colspan="5">' . $GLOBALS['LANG']->getLL('username', true) . '</td>
			</tr>' . $outTable . '
		</table>';
        $content .= $this->doc->section($GLOBALS['LANG']->getLL('whoIsOnline', true), $outTable, 0, 1);
        return $content;
    }
Ejemplo n.º 3
0
 /**
  * Main function
  *
  * @return	void
  */
 function main()
 {
     global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS;
     $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('adminLog'));
     $this->content .= $this->doc->spacer(5);
     // Menu compiled:
     $menuU = t3lib_BEfunc::getFuncMenu(0, 'SET[users]', $this->MOD_SETTINGS['users'], $this->MOD_MENU['users']);
     $menuM = t3lib_BEfunc::getFuncMenu(0, 'SET[max]', $this->MOD_SETTINGS['max'], $this->MOD_MENU['max']);
     $menuT = t3lib_BEfunc::getFuncMenu(0, 'SET[time]', $this->MOD_SETTINGS['time'], $this->MOD_MENU['time']);
     $menuA = t3lib_BEfunc::getFuncMenu(0, 'SET[action]', $this->MOD_SETTINGS['action'], $this->MOD_MENU['action']);
     $menuW = t3lib_BEfunc::getFuncMenu(0, 'SET[workspaces]', $this->MOD_SETTINGS['workspaces'], $this->MOD_MENU['workspaces']);
     $groupByPage = t3lib_BEfunc::getFuncCheck(0, 'SET[groupByPage]', $this->MOD_SETTINGS['groupByPage']);
     $style = ' style="margin:4px 2px;padding:1px;vertical-align:middle;width: 115px;"';
     $inputDate = '<input type="text" value="' . ($this->MOD_SETTINGS['manualdate'] ? $this->MOD_SETTINGS['manualdate'] : '') . '" name="SET[manualdate]" id="tceforms-datetimefield-manualdate"' . $style . ' />';
     $pickerInputDate = '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/datepicker.gif', '', 0) . ' style="cursor:pointer; vertical-align:middle;" alt=""' . ' id="picker-tceforms-datetimefield-manualdate" />';
     $inputDate_end = '<input type="text" value="' . ($this->MOD_SETTINGS['manualdate_end'] ? $this->MOD_SETTINGS['manualdate_end'] : '') . '" name="SET[manualdate]" id="tceforms-datetimefield-manualdate_end"' . $style . ' />';
     $pickerInputDate_end = '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/datepicker.gif', '', 0) . ' style="cursor:pointer; vertical-align:middle;" alt=""' . ' id="picker-tceforms-datetimefield-manualdate_end" />';
     $setButton = '<input type="button" value="' . $GLOBALS['LANG']->getLL('set') . '" onclick="jumpToUrl(\'mod.php?&amp;id=0&amp;M=tools_log&amp;SET[manualdate]=\'+escape($(\'tceforms-datetimefield-manualdate\').value)+\'&amp;SET[manualdate_end]=\'+escape($(\'tceforms-datetimefield-manualdate_end\').value),this);" />';
     $this->content .= $this->doc->section('', $this->doc->menuTable(array(array($GLOBALS['LANG']->getLL('users'), $menuU), array($GLOBALS['LANG']->getLL('time'), $menuT . ($this->MOD_SETTINGS['time'] == 30 ? '<br />' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:from', true) . ' ' . $inputDate . $pickerInputDate . ' ' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:to', true) . ' ' . $inputDate_end . $pickerInputDate_end . '&nbsp;' . $setButton : ''))), array(array($GLOBALS['LANG']->getLL('max'), $menuM), array($GLOBALS['LANG']->getLL('action'), $menuA)), array($GLOBALS['BE_USER']->workspace !== 0 ? array($GLOBALS['LANG']->getLL('workspace'), '<strong>' . $GLOBALS['BE_USER']->workspace . '</strong>') : array($GLOBALS['LANG']->getLL('workspace'), $menuW), array($GLOBALS['LANG']->getLL('groupByPage'), $groupByPage))));
     $codeArr = $this->lF->initArray();
     $oldHeader = '';
     $c = 0;
     // Action (type):
     $where_part = '';
     if ($this->MOD_SETTINGS['action'] > 0) {
         $where_part .= ' AND type=' . intval($this->MOD_SETTINGS['action']);
     } elseif ($this->MOD_SETTINGS['action'] == -1) {
         $where_part .= ' AND error != 0';
     }
     $starttime = 0;
     $endtime = $GLOBALS['EXEC_TIME'];
     // Time:
     switch ($this->MOD_SETTINGS['time']) {
         case 0:
             // This week
             $week = (date('w') ? date('w') : 7) - 1;
             $starttime = mktime(0, 0, 0) - $week * 3600 * 24;
             break;
         case 1:
             // Last week
             $week = (date('w') ? date('w') : 7) - 1;
             $starttime = mktime(0, 0, 0) - ($week + 7) * 3600 * 24;
             $endtime = mktime(0, 0, 0) - $week * 3600 * 24;
             break;
         case 2:
             // Last 7 days
             $starttime = mktime(0, 0, 0) - 7 * 3600 * 24;
             break;
         case 10:
             // This month
             $starttime = mktime(0, 0, 0, date('m'), 1);
             break;
         case 11:
             // Last month
             $starttime = mktime(0, 0, 0, date('m') - 1, 1);
             $endtime = mktime(0, 0, 0, date('m'), 1);
             break;
         case 12:
             // Last 31 days
             $starttime = mktime(0, 0, 0) - 31 * 3600 * 24;
             break;
         case 30:
             $starttime = $this->theTime;
             if ($this->theTime_end) {
                 $endtime = $this->theTime_end;
             } else {
                 $endtime = $GLOBALS['EXEC_TIME'];
             }
     }
     if ($starttime) {
         $where_part .= ' AND tstamp>=' . $starttime . ' AND tstamp<' . $endtime;
     }
     // Users
     $selectUsers = array();
     if (substr($this->MOD_SETTINGS['users'], 0, 3) == "gr-") {
         // All users
         $this->be_user_Array = t3lib_BEfunc::blindUserNames($this->be_user_Array, array(substr($this->MOD_SETTINGS['users'], 3)), 1);
         if (is_array($this->be_user_Array)) {
             foreach ($this->be_user_Array as $val) {
                 if ($val['uid'] != $BE_USER->user['uid']) {
                     $selectUsers[] = $val['uid'];
                 }
             }
         }
         $selectUsers[] = 0;
         $where_part .= ' AND userid in (' . implode($selectUsers, ',') . ')';
     } elseif (substr($this->MOD_SETTINGS['users'], 0, 3) == "us-") {
         // All users
         $selectUsers[] = intval(substr($this->MOD_SETTINGS['users'], 3));
         $where_part .= ' AND userid in (' . implode($selectUsers, ',') . ')';
     } elseif ($this->MOD_SETTINGS['users'] == -1) {
         $where_part .= ' AND userid=' . $BE_USER->user['uid'];
         // Self user
     }
     // Workspace
     if ($GLOBALS['BE_USER']->workspace !== 0) {
         $where_part .= ' AND workspace=' . intval($GLOBALS['BE_USER']->workspace);
     } elseif ($this->MOD_SETTINGS['workspaces'] != -99) {
         $where_part .= ' AND workspace=' . intval($this->MOD_SETTINGS['workspaces']);
     }
     // Finding out which page ids are in the log:
     $logPids = array();
     if ($this->MOD_SETTINGS['groupByPage']) {
         $log = $GLOBALS['TYPO3_DB']->exec_SELECTquery('event_pid', 'sys_log', '1=1' . $where_part, 'event_pid');
         while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($log)) {
             $logPids[] = $row['event_pid'];
         }
         // Overview:
         $overviewList = array();
         foreach ($logPids as $pid) {
             if ((int) $pid > 0) {
                 $overviewList[] = htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('pagenameWithUID'), t3lib_BEfunc::getRecordPath($pid, '', 20), $pid));
             }
         }
         sort($overviewList);
         $this->content .= $this->doc->divider(5);
         $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('overview'), sprintf($GLOBALS['LANG']->getLL('timeInfo'), date($this->dateFormat, $starttime), date($this->dateFormat, $endtime)) . '<br /><br /><br />' . implode('<br />', $overviewList), 1, 1, 0);
         $this->content .= $this->doc->spacer(30);
     } else {
         $logPids[] = '_SINGLE';
     }
     foreach ($logPids as $pid) {
         $codeArr = $this->lF->initArray();
         $this->lF->reset();
         $oldHeader = '';
         $this->content .= $this->doc->divider(5);
         switch ($pid) {
             case '_SINGLE':
                 $insertMsg = '';
                 break;
             case '-1':
                 $insertMsg = ' ' . $GLOBALS['LANG']->getLL('forNonPageRelatedActions') . ' ';
                 break;
             case '0':
                 $insertMsg = ' ' . $GLOBALS['LANG']->getLL('forRootLevel') . ' ';
                 break;
             default:
                 $insertMsg = ' ' . sprintf($GLOBALS['LANG']->getLL('forPage'), t3lib_BEfunc::getRecordPath($pid, '', 20), $pid) . ' ';
                 break;
         }
         $this->content .= $this->doc->section(sprintf($GLOBALS['LANG']->getLL('logForNonPageRelatedActionsOrRootLevelOrPage'), $insertMsg, date($this->dateFormat, $starttime), date($this->dateFormat, $endtime)), '', 1, 1, 0);
         $log = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_log', '1=1' . $where_part . ($pid != '_SINGLE' ? ' AND event_pid=' . intval($pid) : ''), '', 'uid DESC', intval($this->MOD_SETTINGS['max']));
         while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($log)) {
             $header = $this->doc->formatTime($row['tstamp'], 10);
             if (!$oldHeader) {
                 $oldHeader = $header;
             }
             if ($header != $oldHeader) {
                 $this->content .= $this->doc->spacer(10);
                 $this->content .= $this->doc->section($oldHeader, $this->doc->table($codeArr));
                 $codeArr = $this->lF->initArray();
                 $oldHeader = $header;
                 $this->lF->reset();
             }
             $i++;
             $codeArr[$i][] = $this->lF->getTimeLabel($row['tstamp']);
             $codeArr[$i][] = $this->lF->getUserLabel($row['userid'], $row['workspace']);
             $codeArr[$i][] = $this->lF->getTypeLabel($row['type']);
             $codeArr[$i][] = $row['error'] ? $this->lF->getErrorFormatting($this->lF->errorSign[$row['error']], $row['error']) : '';
             $codeArr[$i][] = $this->lF->getActionLabel($row['type'] . '_' . $row['action']);
             $codeArr[$i][] = $this->lF->formatDetailsForList($row);
         }
         $this->content .= $this->doc->spacer(10);
         $this->content .= $this->doc->section($header, $this->doc->table($codeArr));
         $GLOBALS['TYPO3_DB']->sql_free_result($log);
     }
     // Setting up the buttons and markers for docheader
     $docHeaderButtons = $this->getButtons();
     //$markers['CSH'] = $docHeaderButtons['csh'];
     $markers['CONTENT'] = $this->content;
     // Build the <body> for the module
     $this->content = $this->doc->startPage($GLOBALS['LANG']->getLL('adminLog'));
     $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
     $this->content .= $this->doc->endPage();
     $this->content = $this->doc->insertStylesAndJS($this->content);
 }
Ejemplo n.º 4
0
 /**
  * Main function for Workspace Manager module.
  *
  * @return	void
  */
 function main()
 {
     global $LANG, $BE_USER, $BACK_PATH;
     // See if we need to switch workspace
     $changeWorkspace = t3lib_div::_GET('changeWorkspace');
     if ($changeWorkspace != '') {
         $BE_USER->setWorkspace($changeWorkspace);
         $this->content .= $this->doc->wrapScriptTags('top.location.href="' . $BACK_PATH . t3lib_BEfunc::getBackendScript() . '";');
     } else {
         // Starting page:
         $this->content .= $this->doc->header($LANG->getLL('title'));
         $this->content .= $this->doc->spacer(5);
         // Get usernames and groupnames
         $be_group_Array = t3lib_BEfunc::getListGroupNames('title,uid');
         $groupArray = array_keys($be_group_Array);
         // Need 'admin' field for t3lib_iconWorks::getIconImage()
         $this->be_user_Array_full = $this->be_user_Array = t3lib_BEfunc::getUserNames('username,usergroup,usergroup_cached_list,uid,admin,workspace_perms');
         if (!$GLOBALS['BE_USER']->isAdmin()) {
             $this->be_user_Array = t3lib_BEfunc::blindUserNames($this->be_user_Array, $groupArray, 1);
         }
         // Build top menu:
         $menuItems = array();
         $menuItems[] = array('label' => $LANG->getLL('menuitem_review'), 'content' => $this->moduleContent_publish());
         $menuItems[] = array('label' => $LANG->getLL('menuitem_workspaces'), 'content' => $this->moduleContent_workspaceList());
         // Add hidden fields and create tabs:
         $content = $this->doc->getDynTabMenu($menuItems, 'user_ws');
         $this->content .= $this->doc->section('', $content, 0, 1);
         // Setting up the buttons and markers for docheader
         $docHeaderButtons = $this->getButtons();
         // $markers['CSH'] = $docHeaderButtons['csh'];
     }
     $markers['CONTENT'] = $this->content;
     // Build the <body> for the module
     $this->content = $this->doc->startPage($LANG->getLL('title'));
     $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
     $this->content .= $this->doc->endPage();
     $this->content = $this->doc->insertStylesAndJS($this->content);
 }
Ejemplo n.º 5
0
 /**
  *  Checks if there are newer versions of installed extensions in the TER
  *  integrated from the extension "ter_update_check" for TYPO3 4.2 by Christian Welzel
  *
  * @return	nothing
  */
 function checkForUpdates()
 {
     global $LANG;
     $content = '';
     if (is_file(PATH_site . 'typo3temp/extensions.xml.gz')) {
         $content = $this->extensionList->showExtensionsToUpdate() . t3lib_BEfunc::getFuncCheck(0, 'SET[display_installed]', $this->MOD_SETTINGS['display_installed'], '', '', 'id="checkDisplayInstalled"') . '&nbsp;<label for="checkDisplayInstalled">' . $LANG->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:display_nle') . '</label><br />' . t3lib_BEfunc::getFuncCheck(0, 'SET[display_files]', $this->MOD_SETTINGS['display_files'], '', '', 'id="checkDisplayFiles"') . '&nbsp;<label for="checkDisplayFiles">' . $LANG->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:display_files') . '</label>';
         $this->content .= $this->doc->section($LANG->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:header_upd_ext'), $content, 0, 1);
         $dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'];
         $timeFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'];
         $content = sprintf($GLOBALS['LANG']->getLL('note_last_update_new'), date($dateFormat . ', ' . $timeFormat, filemtime(PATH_site . 'typo3temp/extensions.xml.gz'))) . '<br />';
     }
     $content .= sprintf($GLOBALS['LANG']->getLL('note_last_update2_new'), '<a href="' . t3lib_div::linkThisScript(array('SET[function]' => 2)) . '">', '</a>');
     $this->content .= $this->doc->section($LANG->sL('LLL:EXT:lang/locallang_mod_tools_em.xml:header_vers_ret'), $content, 0, 1);
 }