/** * Create the panel of buttons for submitting the form or otherwise perform operations. * * @return array all available buttons as an assoc. array */ protected function getButtons() { $buttons = array('csh' => '', 'shortcut' => ''); // CSH //$buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_func', '', $GLOBALS['BACK_PATH']); // Shortcut if ($GLOBALS['BE_USER']->mayMakeShortcut()) { $buttons['shortcut'] = $this->doc->makeShortcutIcon('', 'function', $this->MCONF['name']); } return $buttons; }
/** * Create the panel of buttons for submitting the form or otherwise perform operations. * * @return array all available buttons as an assoc. array */ protected function getButtons() { $buttons = array('csh' => '', 'shortcut' => ''); // Shortcut if ($GLOBALS['BE_USER']->mayMakeShortcut()) { $buttons['shortcut'] = $this->doc->makeShortcutIcon('', 'function', $this->MCONF['name']); } return $buttons; }
/** * @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']) . ' ' . '</td>' . '<td nowrap="nowrap">' . htmlspecialchars($session['realName']) . ' </td>' . '<td nowrap="nowrap">' . $this->elementLinks('be_users', $session) . '</td>' . '<td nowrap="nowrap" valign="top">' . ($session['bu_username'] ? ' SU from: ' : '') . htmlspecialchars($session['bu_username']) . ' </td>' . '<td nowrap="nowrap" valign="top"> ' . 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; }
/** * Generates a list of user names that has access to the workspace. * * @param array A list of user IDs separated by comma * @param string Access string * @return string Generated content */ function workspaceList_getUserListWithAccess(&$list, $access) { $content_array = array(); if ($list != '') { $userIDs = explode(',', $list); // get user names and sort $regExp = '/^(be_[^_]+)_(\\d+)$/'; $groups = false; foreach ($userIDs as $userUID) { $id = $userUID; if (preg_match($regExp, $userUID)) { $table = preg_replace($regExp, '\\1', $userUID); $id = intval(preg_replace($regExp, '\\2', $userUID)); if ($table == 'be_users') { // user $icon = $GLOBALS['TCA']['be_users']['typeicons'][$this->be_user_Array[$id]['admin']]; if ($id == $GLOBALS['BE_USER']->user['uid']) { // highlight current user $tag0 = '<span class="ver-wl-current-user">'; $tag1 = '</span>'; } else { $tag0 = $tag1 = ''; } $content_array[] = $this->doc->wrapClickMenuOnIcon(t3lib_iconWorks::getIconImage($table, $this->be_user_Array[$id], $GLOBALS['BACK_PATH'], ' align="middle" alt="UID: ' . $id . '"'), $table, $id, 2) . $tag0 . htmlspecialchars($this->be_user_Array_full[$id]['username']) . $tag1; } else { // group if (false === $groups) { $groups = t3lib_BEfunc::getGroupNames(); } $content_array[] = $this->doc->wrapClickMenuOnIcon(t3lib_iconWorks::getIconImage($table, $groups[$id], $GLOBALS['BACK_PATH'], ' align="middle" alt="UID: ' . $id . '"'), $table, $id, 2) . $groups[$id]['title']; } } else { // user id if ($userUID == $GLOBALS['BE_USER']->user['uid']) { // highlight current user $tag0 = '<span class="ver-wl-current-user">'; $tag1 = '</span>'; } else { $tag0 = $tag1 = ''; } $content_array[] = t3lib_iconWorks::getIconImage('be_users', $this->be_user_Array[$id], $GLOBALS['BACK_PATH'], ' align="middle" alt="UID: ' . $id . '"') . $tag0 . htmlspecialchars($this->be_user_Array_full[$userUID]['username']) . $tag1; } } sort($content_array); } else { $content_array[] = ' –'; } $content = '<tr><td class="ver-wl-details-label ver-wl-details-user-list-label">'; // TODO CSH lable explaining access here? $content .= '<strong>' . $access . '</strong></td>'; $content .= '<td class="ver-wl-details">' . implode('<br />', $content_array) . '</td></tr>'; return $content; }
/** * 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"') . ' <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"') . ' <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); }