function settingsValue($label) { $um =& SB_UserManager::staticInstance(); $val = $um->getParamB64('config', $label); if ($val != '') { return $val; } switch ($label) { case 'feed_link': return SB_Page::absBaseUrl(); case 'feed_root_name': return SB_T('SiteBar Bookmarks'); case 'feed_folder_title': $baseurl = parse_url(SB_Page::absBaseUrl()); $ft = '%s%s [' . $baseurl['host']; if (isset($baseurl['path'])) { $ft .= $baseurl['path']; } return $ft . ']'; case 'feed_desc': return SB_T('Bookmarks from SiteBar installation at'); case 'feed_managing_editor': case 'feed_webmaster': $user = $um->getUser(SB_ADMIN); return sprintf('%s (%s)', $um->getParam('config', 'sender_email'), $user['name']); default: return ''; } }
function SB_SanityCheck() { $this->um =& SB_UserManager::staticInstance(); $this->tree =& SB_Tree::staticInstance(); $this->db =& SB_Database::staticInstance(); if (!$this->um->isLogged() || !$this->um->isAdmin()) { die("Access denied!"); } }
function Messenger() { $this->ajax = SB_reqChk('ajax'); $this->um = SB_UserManager::staticInstance(); SB_Skin::set($this->um->getParam('user', 'skin')); $this->db =& $this->um->db; if (SB_reqChk('folder')) { $this->folder = SB_reqVal('folder'); } }
function _buildMessengerFormatting($select = null) { $um =& SB_UserManager::staticInstance(); $formats = array(); $formats['html'] = 'HTML'; $formats['plain'] = 'Plain Text'; foreach ($formats as $format => $label) { echo '<option ' . ($select == $format ? 'selected' : '') . ' value="' . $format . '">' . $label . "</option>\n"; } }
function SB_Validator() { $this->um =& SB_UserManager::staticInstance(); $this->tree =& SB_Tree::staticInstance(); $this->db =& SB_Database::staticInstance(); $this->fc =& SB_FaviconCache::staticInstance(); if (!$this->um->setupDone || !$this->um->isLogged()) { echo 'Access denied!'; die; } }
function SB_CommandWindowBase() { $this->command = SB_reqVal('command'); if (!$this->command) { $this->error('Missing command!'); } if (strlen(SB_reqVal('button'))) { $this->command = SB_reqVal('button'); } if (SB_reqChk('weblinks')) { $this->bookmarklet = true; } $this->um =& SB_UserManager::staticInstance(); $this->tree =& SB_Tree::staticInstance(); $this->useToolTips = $this->um->getParam('user', 'use_tooltips'); $this->handleCommand(); }
function SB_Tree() { $this->db =& SB_Database::staticInstance(); $this->um =& SB_UserManager::staticInstance(); $this->userSortMode = $this->um->getParam('user', 'link_sort_mode'); $this->sortModeLabel = array('user' => 'User Default', 'custom' => 'Custom Order', 'abc' => 'Alphabetically', 'added' => 'Recently Added', 'changed' => 'Recently Modified', 'visited' => 'Recently Visited', 'hits' => 'Most Popular', 'waiting' => 'Waiting for Visit'); }
* This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Affero General Public License for more details. * * * * You should have received a copy of the GNU Affero General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************/ header('Content-Type: application/xml; charset=utf-8'); //text/xml is ambiguous for some clients and slower require_once './inc/localizer.inc.php'; require_once './inc/errorhandler.inc.php'; require_once './inc/page.inc.php'; require_once './inc/usermanager.inc.php'; $baseurl = str_replace('skins', '', SB_Page::absBaseUrl()); $um = SB_UserManager::staticInstance(); function niceUrl($writer) { global $baseurl; global $um; if ($um->getParam('config', 'use_nice_url')) { return "concat('{$baseurl}news/{$writer}/',substring(./@id,2),'/',\$root)"; } else { return "concat('{$baseurl}index.php?w={$writer}&flat=1&sort=',substring(./@id,2),'&root=',\$root)"; } } ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" version="4.01"
function SB_Token() { $this->db =& SB_Database::staticInstance(); $this->um =& SB_UserManager::staticInstance(); }
function SearchEngine() { $um = SB_UserManager::staticInstance(); $name = $um->getParamB64('config', 'feed_root_name'); if (!strlen($name)) { $name = 'SiteBar'; } ?> # SiteBar plug-in <search name="<?php echo $name; ?> " description="<?php echo SB_T('Search in SiteBar Bookmarks'); ?> " method="GET" action="<?php echo SB_Page::absBaseUrl(); ?> search.php" searchForm="<?php echo SB_Page::absBaseUrl(); ?> index.php" > <input name="q" user> <input name="sourceid" value="sitebar-search"> </search> <?php exit; }
function SB_PageParser($url) { $this->um =& SB_UserManager::staticInstance(); $this->expertMode = $this->um->getParam('user', 'expert_mode'); $this->maxBytes = $this->um->getParam('config', 'max_icon_size'); /* This is the timeout while reading or writing data * The function name changed in PHP 4.3 */ if (version_compare(phpversion(), '4.3.0', '>=')) { $this->http = new SB_HTTPStream430(); } else { $this->http = new SB_HTTPStream(); } // Set the necessary path information // so that url can be accessed by various // functions in different formats // calls $this->http->setAddress() if (!$this->setUrlInformation($url)) { return; } }
function SB_FaviconCache() { $this->db =& SB_Database::staticInstance(); $this->um =& SB_UserManager::staticInstance(); }
function check($needAdmin = false) { $um = SB_UserManager::staticInstance(); // We must be logged in pass this point if (!$um->isLogged()) { header("Location: command.php?command=Log%20In&forward=translator.php"); exit; } if ($needAdmin) { if (!$um->isAdmin()) { SB_Page::head('Translator Error', 'siteBarLocale'); echo 'You must be admin to create new dir!'; SB_Page::foot(); exit; } else { return true; } } $groups = $um->getGroups(); $trGid = null; foreach ($groups as $gid => $rec) { if ($rec['name'] == TRANSLATORS) { $trGid = $gid; break; } } if (!$um->isAdmin() && !$trGid) { SB_Page::head('Translator Error', 'siteBarLocale'); echo 'This installation does not have group "' . TRANSLATORS . '"!'; SB_Page::foot(); exit; } $myGroups = $um->getUserGroups(); $member = false; foreach ($myGroups as $gid => $rec) { if ($rec['name'] == TRANSLATORS) { $member = true; break; } } if (!$um->isAdmin() && !$member) { SB_Page::head('Translator Error', 'siteBarLocale'); echo 'You must be member of "' . TRANSLATORS . '" group to edit localizations! '; echo 'Ask <a href="command.php?command=Contact%20Moderator&gid=' . $trGid . '">moderator</a> for membership.'; SB_Page::foot(); exit; } }