Exemplo n.º 1
0
 function SB_Writer_search()
 {
     parent::__construct();
     $this->switches['flat'] = 1;
     $this->tree->sortMode = 'hits';
     $this->search = SB_safeVal($_COOKIE, 'SB3SEARCH');
     if (SB_reqChk('q') != '') {
         $this->search = SB_reqVal('q');
     }
     $this->type = $this->um->getParam('user', 'default_search');
     // Check search pattern
     if (preg_match("/^(url|desc|name|all):(.*)\$/i", $this->search, $matches)) {
         $this->type = $matches[1];
         // If we have pattern then use it
         if ($this->type == 'url' || $this->type == 'desc' || $this->type == 'name' || $this->type == 'all') {
             $this->search = $matches[2];
         }
     }
     $url = $this->um->getParamB64('user', 'search_engine_url');
     $url = str_replace('%SEARCH%', $this->search, $url);
     $url = str_replace('%BASEURL%', urlencode(SB_Page::absBaseUrlShort()), $url);
     $url = str_replace('%LOGO%', urlencode(SB_Page::absBaseUrl() . SB_Skin::imgsrc('logo')), $url);
     $this->engineURL = $url;
     // We would not get here if no engine is specified
     if ($this->um->getParam('user', 'hide_xslt') || SB_reqVal("web") == 1) {
         header('Location: ' . $this->engineURL);
         exit;
     }
 }
Exemplo n.º 2
0
    function designedBy()
    {
        echo SB_T("Skin designed by");
        ?>
 <a href='http://www.alexisisaac.net/' <?php 
        echo SB_Page::target();
        ?>
>Alexis Isaac</a><?php 
    }
Exemplo n.º 3
0
 function drawLink(&$node, &$link)
 {
     $this->path = implode('/', $this->nodes);
     $comment = preg_replace("/[\n\r]/m", ' ', $link->comment);
     if ($link->favicon && $this->um->getParam('user', 'use_favicons') && $this->um->getParam('config', 'use_favicon_cache')) {
         $link->favicon = SB_Page::absBaseUrl() . 'favicon.php?' . md5($link->favicon) . '=' . $link->id;
     }
     $this->write(array(str_repeat('.', $node->level), $link->name, $this->quoteAtt($link->url), $comment, $link->favicon));
 }
Exemplo n.º 4
0
    function designedBy()
    {
        echo SB_T("Skin designed by");
        ?>
 <a href='http://brablc.com/' <?php 
        echo SB_Page::target();
        ?>
>Ondrej Brablc</a><?php 
    }
Exemplo n.º 5
0
    function designedBy()
    {
        echo SB_T('Skin created by');
        ?>
 <a href="http://www.jasonsawtelle.com/" <?php 
        echo SB_Page::target();
        ?>
>Jason Sawtelle</a><?php 
    }
Exemplo n.º 6
0
    function designedBy()
    {
        echo SB_T('Skin created by');
        ?>
 <a href="http://brablc.com/" <?php 
        echo SB_Page::target();
        ?>
>Ondrej Brablc</a><?php 
    }
Exemplo n.º 7
0
    function designedBy()
    {
        echo SB_T('Skin created by');
        ?>
 <a href="http://igor.kraljic.info" <?php 
        echo SB_Page::target();
        ?>
>Igor</a><?php 
    }
Exemplo n.º 8
0
 function drawLink(&$node, &$link)
 {
     $this->path = implode('/', $this->nodes);
     $url = $link->url;
     if (!($url[0] == 'j' && strpos($url, 'javascript:') !== false)) {
         $url = SB_Page::absBaseUrl() . 'go.php?id=' . $link->id . '&url=' . $link->url;
     }
     $this->write(array($this->path . '/' . $link->id, 'flags', $link->name, '', $this->quoteAtt($url)));
 }
Exemplo n.º 9
0
    function designedBy()
    {
        echo SB_T("Skin designed by");
        ?>
 <a href='http://www.mindslip.com/' <?php 
        echo SB_Page::target();
        ?>
>David Szego</a><?php 
    }
Exemplo n.º 10
0
    function designedBy()
    {
        echo SB_T("Skin designed by");
        ?>
 <a href='http://www.gunnarwrobel.de/' <?php 
        echo SB_Page::target();
        ?>
>Gunnar Wrobel</a><?php 
    }
Exemplo n.º 11
0
 function getLinkAttMap(&$bmkAtt, &$node, &$link)
 {
     // Append absolute URL to relative urls
     if (!preg_match('/^\\w+:/', $link->url)) {
         $link->url = SB_Page::absBaseUrl() . $link->url;
     }
     $bmkAtt['href'] = $this->quoteAtt($link->url);
     $bmkAtt['modified'] = $this->getDateISO8601($link->changed);
     $bmkAtt['visited'] = $this->getDateISO8601($link->visited);
 }
Exemplo n.º 12
0
    function drawFoot()
    {
        echo '<p>';
        $link = '<a href="http://sitebar.org/" ' . SB_Page::target() . '>%s</a>';
        echo sprintf($link, 'SiteBar ') . sprintf($link, 'Bookmark Manager');
        ?>
</body>
</html>
<?php 
    }
Exemplo n.º 13
0
 function getXSLPath($file)
 {
     /**
      * The path to URL should use &amp;
      * IE - handles OK
      * Firefox - https://bugzilla.mozilla.org/show_bug.cgi?id=286132
      * Safari - omits parameters after the first
      *
      * Workaround, use ; as parameter delimiter.
      */
     return SB_Page::absBaseUrl() . 'xsl.php?file=' . $file . ';skin=' . str_replace(' ', '%20', SB_Skin::get());
 }
Exemplo n.º 14
0
 function writeMenuItem($id, &$itemArray)
 {
     static $expertMode = null;
     if ($expertMode === null) {
         $expertMode = $this->um->getParam('user', 'expert_mode');
     }
     $command = SB_safeVal($itemArray, 'name');
     $link = SB_safeVal($itemArray, 'href');
     $callback = SB_safeVal($itemArray, 'callback');
     $acl = SB_safeVal($itemArray, 'acl');
     $optional = SB_safeVal($itemArray, 'optional', false);
     $more = SB_safeVal($itemArray, 'more', false);
     $class = 'item';
     if (!$command) {
         $class .= ' separator';
     } else {
         if ($optional && !$expertMode) {
             $class .= ' optional';
         }
     }
     $div = "\t" . '<div id="' . $id . '" class="' . $class . '"';
     if ($command) {
         $div .= ' onmouseover="SB_itemOn(this);"' . ' onmouseout="SB_itemOff(this);"';
     }
     if ($command && !$link) {
         $div .= ' x_acl="' . $acl . '"' . ' x_cmd="' . $command . '"';
     }
     echo $div . '>';
     if ($link) {
         static $target;
         if ($target == null) {
             $target = SB_Page::target();
         }
         if (strstr($link, 'http') !== 0) {
             $link = SB_Page::absBaseUrl() . $link;
         }
         echo '<a class="menuLink" href="' . $link . '"' . $target . '>';
     } else {
         echo '<a href="javascript:SB_itemDoAlt(\'' . $id . '\'' . ($callback ? ',\'' . $callback . '\'' : '') . ')">';
     }
     echo SB_T($command);
     if ($command == 'Log Out') {
         echo ' (' . $this->um->username . ')';
     }
     if ($link) {
         echo '</a>';
     }
     echo "</div>\r";
 }
Exemplo n.º 15
0
 function drawHead()
 {
     $this->drawXMLPI();
     $this->drawTagOpen('rss', array('version' => '2.0', 'xmlns:rss' => 'http://purl.org/rss/2.0/'));
     $this->drawTagOpen('channel');
     $this->drawTag('title', null, $this->quoteText($this->getTitle()));
     $desc = $this->settingsValue('feed_desc') . ' ' . SB_Page::absBaseUrl();
     $this->drawTag('description', null, $this->quoteText($desc));
     $this->drawTagOpen('image');
     $this->drawTag('title', null, $this->quoteText($this->getTitle()));
     $this->drawTag('url', null, SB_Page::absBaseUrl() . SB_Skin::imgsrc('root_transparent'));
     $this->drawTag('link', null, $this->settingsValue('feed_link'));
     $this->drawTagClose('image');
     $this->drawTag('link', null, $this->settingsValue('feed_link'));
     $this->drawTag('managingEditor', null, $this->quoteText($this->settingsValue('feed_managing_editor')));
     $this->drawTag('webMaster', null, $this->quoteText($this->settingsValue('feed_webmaster')));
     $this->drawTag('copyright', null, $this->quoteText($this->settingsValue('feed_copyright')));
     $this->drawTag('language', null, str_replace('_', '-', $this->um->getParam('user', 'lang')));
     $this->drawTag('generator', null, 'SiteBar ' . SB_CURRENT_RELEASE . ' (Bookmark Server; http://sitebar.org/)');
     // Time to live in minutes
     $this->drawTag('ttl', null, '60');
 }
Exemplo n.º 16
0
    function buildValidateLink($link, $level)
    {
        if (substr($link->url, 0, 4) != 'http' || !$link->validate) {
            return;
        }
        $validationIconSrc = 'validate.php?id=' . $link->id . '&amp;uniq=' . SB_StopWatch::getMicroTime();
        if (strlen($link->favicon) && $this->deleteInvalidFavicons && !$this->fc->isFaviconCached($link->favicon)) {
            $this->tree->updateLink($link->id, array('favicon' => ''), false);
        }
        if ($this->discoverMissingFavicons) {
            $validationIconSrc .= '&amp;get_favicon=1';
        }
        $url = SB_Page::quoteValue($link->url);
        $name = SB_Page::quoteValue($link->name);
        $this->linkCount++;
        $this->fields['-raw' . $this->counter++ . '-'] = <<<__LINK
<div class="link">
    <img class="favicon" height=16 width=16 src="{$validationIconSrc}" alt="">
    <a href="{$url}">{$name}</a>
</div>
__LINK;
    }
Exemplo n.º 17
0
 function drawNodeOpen(&$node)
 {
     $filler = str_repeat("\t", $node->level);
     $added = $node->added ? strtotime($node->added) : mktime();
     $feedname = $node->name;
     // If we have subfolders
     if ($node->nodeCount()) {
         echo $filler . '<DT><H3 ADD_DATE="' . $added . '">' . $node->name . "</H3>\r";
         if ($node->comment) {
             echo $filler . '<DD>' . $node->comment . "\r";
         }
         echo $filler . "<DL><p>\r";
         $filler = str_repeat("\t", $node->level + 1);
         $feedname = '@' . SB_T('Content');
     }
     // Do we have some content
     if ($node->linkCount()) {
         $url = SB_Page::absBaseUrl() . 'index.php?w=rss&sd=0&root=' . $node->id;
         if ($this->switches['hits']) {
             $url .= '&hits=1';
         }
         echo $filler . '<DT><A HREF="' . SB_Page::absBaseUrl() . 'index.php"' . ' ADD_DATE="' . $added . '"' . ' FEEDURL="' . $url . '">' . $feedname . "</A>\r";
     }
 }
Exemplo n.º 18
0
    function drawFoot()
    {
        $baseurl = SB_Page::absBaseUrl();
        ?>
    </form>
    <div class="footer cmnTitleColorInverse">
    <?php 
        echo SB_T("Messages from SiteBar installation at");
        ?>
    <a class="url" href="<?php 
        echo $baseurl;
        ?>
"><?php 
        echo $baseurl;
        ?>
</a>
    </div>
</body>
</html>
<?php 
    }
Exemplo n.º 19
0
    function writeConfig()
    {
        $this->writePage();
        ?>
<form action="<?php 
        echo SB_FORM_ACTION_EXECUTOR;
        ?>
" method="POST">
<table>
<tr><th>DB Host Name</th></tr>
<tr><td><input name="host" value="<?php 
        echo $this->host;
        ?>
"></tr>
<tr><th>DB Username</th></tr>
<tr><td><input name="username" value="<?php 
        echo $this->user;
        ?>
"></tr>
<tr><th>DB Password</th></tr>
<tr><td><input type="password" name="password" value="<?php 
        echo $this->pass;
        ?>
"></tr>
<tr><th>DB Repeat Password</th></tr>
<tr><td><input  type="password" name="repeat" value="<?php 
        echo $this->pass2;
        ?>
"></tr>
<tr><th>Database Name</th></tr>
<tr><td><input name="name" value="<?php 
        echo $this->name;
        ?>
"></tr>
</table>

<p>
<input type="submit" name="command" value="Check Settings">
<input type="submit" name="command" value="Create Database">
Use any of the following to create file <strong>config.inc.php</strong>
and place it to your <strong>adm</strong> subdirectory of your
SiteBar installation.
<input type="submit" name="command" value="Write To File">
If "Write To File" does not work, do not
waste time setting the rights, just download the file and upload
it to the <strong>adm</strong> manually!
<input type="submit" name="command" value="Download Settings">
<input type="submit" name="command" value="Preview Settings">
</form>

<?php 
        SB_Page::foot();
    }
Exemplo n.º 20
0
    function create()
    {
        SB_Page::head('Edit Translation', 'siteBarLocale');
        ?>
<h2>Create Translation</h2>
[<a href="translator.php">Back to Translation List</a>]
<p>
<?php 
        if (isset($_REQUEST['save'])) {
            $ok = true;
            foreach (array('newdir', 'language', 'author', 'url') as $name) {
                if (!isset($_REQUEST[$name]) || !strlen($_REQUEST[$name])) {
                    $ok = false;
                    echo "Field {$name} must be filled!<br>";
                }
            }
            if ($ok) {
                $lang = $_REQUEST['newdir'];
                if (!mkdir('./locale/' . $lang)) {
                    $this->writeErrors(true);
                    die('Cannot create directory!');
                }
                chmod('./locale/' . $lang, 0777);
                foreach ($this->parts as $part => $param) {
                    $file = sprintf($this->fmt, $lang, $param['file']);
                    if (!($fh = fopen($file, 'w'))) {
                        $this->writeErrors(true);
                        die("Cannot create file {$file}!");
                    }
                    fwrite($fh, "<?php \${$part} = array(); ?>");
                    fclose($fh);
                    chmod($file, 0666);
                }
                $file = sprintf($this->fmt, $lang, "info.inc.php");
                if (!($fh = fopen($file, 'w'))) {
                    die("Cannot create file {$file}!");
                }
                $text = <<<_INFO
<?php

\$info = array
(
    'language' => '{$_REQUEST['language']}',
    'authors' => array
    (
    '{$_REQUEST['author']}' => '{$_REQUEST['url']}',
    ),
);

?>
_INFO;
                fwrite($fh, $text);
                fclose($fh);
                chmod($file, 0666);
                echo 'Directory created!';
            }
        } else {
            ?>
<form method="POST">
<table>
<tr>
    <th>Directory</th>
    <td><input name="newdir"></td>
</tr>
<tr>
    <th>Language</th>
    <td><input name='language'></td>
</tr>
<tr>
    <th>Author</th>
    <td><input name='author'></td>
</tr>
<tr>
    <th>URL</th>
    <td><input name='url'></td>
</tr>
</table>
<input type='submit' name='save' value='Submit'>
<input type='reset'>
</form>
<?php 
        }
        if (!defined("EMBEDDED")) {
            SB_Page::foot();
        }
    }
Exemplo n.º 21
0
 *                                                                            *
 *  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}&amp;flat=1&amp;sort=',substring(./@id,2),'&amp;root=',\$root)";
    }
}
?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output
    method="html"
Exemplo n.º 22
0
    function drawFoot()
    {
        $this->writeMenu('user', $this->userMenu);
        $this->sw->stop();
        $stat = array();
        $timeDb = $this->um->db->sw->elapsed;
        if ($timeDb >= $this->sw->elapsed) {
            $timeDb = $this->sw->elapsed - 0.01;
        }
        if ($this->um->getParam('config', 'show_statistics') && (!$this->um->isAnonymous() || $this->um->getParam('config', 'allow_sign_up'))) {
            $stat = array('links_shown' => $this->linkCount, 'nodes_shown' => $this->nodeCount, 'queries' => $this->um->db->count, 'time_db' => number_format($timeDb, 2), 'time_total' => number_format($this->sw->elapsed, 2), 'time_pct' => intval($timeDb / $this->sw->elapsed * 100));
            $this->um->statistics($stat);
            $this->tree->statistics($stat);
        }
        $this->hook->foot($this->um->config['release'] . (SB_DEVELOPMENT ? '-svn' : ''), $stat, $this->um);
        $sponsor = new SB_SponsorInterface($this->hook);
        $file = './inc/sponsor.inc.php';
        if (is_file($file)) {
            include_once $file;
            $sponsor = new SB_Sponsor($this->hook);
        }
        ?>
    <div id="sponsorSitebarBottom"><?php 
        $sponsor->sitebarBottom();
        ?>
</div>
<?php 
        if ($this->hasErrors()) {
            // Cannot be defined by skin
            echo '<div style="margin-top: 50px; color:yellow; background: red;">';
            $this->writeErrors();
            echo '</div>';
        }
        SB_Page::foot();
    }
Exemplo n.º 23
0
    function headerContent($inscript)
    {
        ?>
    <link rel="stylesheet" type="text/css" href="<?php 
        echo SB_Skin::webPath();
        ?>
/sitebar.css?version=<?php 
        echo STATIC_VERSION;
        ?>
" media="all">
    <script type="text/javascript" src="<?php 
        echo SB_Page::absBaseUrl();
        ?>
js/sitebar.js?version=<?php 
        echo STATIC_VERSION;
        ?>
"></script>
    <script type="text/javascript">
SB_gSkinDir = '<?php 
        echo SB_Skin::webPath();
        ?>
/';
<?php 
        echo $inscript . "\n";
        ?>
    </script>
<?php 
    }
Exemplo n.º 24
0
      </xsl:attribute>
      <xsl:attribute name="type">text/css</xsl:attribute>
      <xsl:attribute name="media">all</xsl:attribute>
    </xsl:element>
    <xsl:element name="script">
      <xsl:attribute name="type">text/javascript</xsl:attribute>
      <xsl:attribute name="src"><?php 
echo SB_Page::absBaseUrl() . "skins/sitebar.js?version=" . STATIC_VERSION;
?>
</xsl:attribute>
    </xsl:element>
    </head>

    <body class="siteBar siteBarBaseFont siteBarPageBackground">
      <div style="display: none" id="sb_absBaseUrl"><?php 
echo SB_Page::absBaseUrl();
?>
</div>
      <div class="title cmnTitleColorInverse">
      <xsl:value-of select="xbel/title" />
      </div>
      <xsl:if test="/xbel/folder/@id != 'n'">
        <xsl:call-template name="displayBack" />
      </xsl:if>
      <xsl:for-each select="xbel/folder/*">
        <xsl:choose>
          <xsl:when test="local-name(.)='folder'">
            <xsl:call-template name="displayFolder" />
          </xsl:when>
          <xsl:when test="local-name(.)='bookmark'">
            <xsl:call-template name="displayBookmark" />
Exemplo n.º 25
0
  <![CDATA[
<?php 
$height = "400px";
if (isset($_GET['height'])) {
    if (preg_match('/^(\\d+)(.*)?$/', $_GET['height'], $reg)) {
        $height = $reg[1];
        if ($reg[2] == '%') {
            $height .= '%';
        } else {
            $height .= 'px';
        }
    }
}
require_once './inc/errorhandler.inc.php';
require_once './inc/page.inc.php';
require_once './inc/usermanager.inc.php';
$um = SB_UserManager::staticInstance();
$url = SB_Page::absBaseUrl();
?>
    <iframe style="border: none; width:100%;height:<?php 
echo $height;
?>
"
        src="<?php 
echo $url;
?>
?target=_top" />
  ]]>
  </Content>
</Module>
Exemplo n.º 26
0
 function privateMessage($params)
 {
     $gid = isset($params['gid']) && $params['gid'] ? $params['gid'] : null;
     $isModerator = $gid && $this->isModerator($gid);
     $isAdmin = $this->isAdmin();
     $role = ($isModerator || $isAdmin) && isset($params['from_role']) ? $params['from_role'] : 'user';
     $db =& SB_Database::staticInstance();
     $insert = array('uid' => $this->uid, 'gid' => $gid, 'sent' => array('now' => null), 'role' => $role, 'format' => $isAdmin && $params['format'] ? $params['format'] : 'plain', 'to_label' => $params['to_label'], 'subject' => $params['subject'], 'message' => $params['message']);
     $db->insert('sitebar_message', $insert);
     $mid = $db->getLastId();
     if ($isAdmin && $params['expires']) {
         $insert['expires'] = $params['expires'];
     }
     $counter = 0;
     $safe_mode = in_array(strtolower(ini_get('safe_mode')), array("1", "on", "yes", "true"));
     if (!$safe_mode) {
         // We need more time if our database is slow
         set_time_limit(intval(count($params['to_list']) / 20) + 10);
     }
     $insert = array('mid' => $mid);
     // Insert recipients
     foreach ($params['to_list'] as $uid => $user) {
         if ($uid == SB_ANONYM) {
             continue;
         }
         $userparams = $user['params'];
         $this->explodeParams($userparams, 'tmp');
         if (($isModerator || $isAdmin) && isset($params['respect']) && !$this->getParam('tmp', 'allow_info_mails')) {
             continue;
         }
         SB_SetLanguage($this->getParam('tmp', 'lang'));
         $counter++;
         $insert['uid'] = $uid;
         $db->insert('sitebar_message_folder', $insert);
         if ($params['pm_notification'] && $user['verified'] && $this->getParam('config', 'use_mail_features') && $this->getParam('tmp', 'pm_notification')) {
             $subject = SB_T('SiteBar: Private Message Notification');
             $msg = SB_P('command::pm_notification', array($params['subject'], SB_Page::absBaseUrl()));
             $this->sendMail(array('email' => $user['email']), $subject, $msg);
         }
     }
     SB_SetLanguage($this->getParam('user', 'lang'));
     $insert['folder'] = 'outbox';
     // Insert senders
     if (($isModerator || $isAdmin) && $role != 'user') {
         $gid = $role == 'admins' ? SB_ADMIN_GROUP : $gid;
         foreach ($this->getMembers($gid) as $uid => $user) {
             $userparams = $user['params'];
             $this->explodeParams($userparams, 'tmp');
             SB_SetLanguage($this->getParam('tmp', 'lang'));
             $counter++;
             $insert['uid'] = $uid;
             $db->insert('sitebar_message_folder', $insert);
         }
     } else {
         $insert['uid'] = $this->uid;
         $db->insert('sitebar_message_folder', $insert);
     }
     SB_SetLanguage($this->getParam('user', 'lang'));
 }
Exemplo n.º 27
0
 /**
  * If the token is invalid, then all tokens for the given username will be invalidated.
  */
 function validate($uid, $token, $redirect = false)
 {
     // Select the right token
     $rset = $this->db->select(null, 'sitebar_token', array('uid' => $uid, '^1' => 'AND', 'token' => $token, '^2' => 'AND expires>=' . time()));
     $tokenRec = $this->db->fetchRecord($rset);
     if ($tokenRec) {
         $user = $this->um->getUser($uid);
         switch ($tokenRec['type']) {
             case 'verify':
                 // Delete all existing tokens for this user now
                 $this->invalidateTokens($uid);
                 $this->db->update('sitebar_user', array('verified' => 1), array('uid' => $user['uid']));
                 if ($this->um->getParam('config', 'users_must_verify_email')) {
                     $paraName = 'usermanager::signup_info_verified';
                     $paraAtt = array($user['username'], SB_Page::absBaseUrl());
                     if ($this->um->getParam('config', 'users_must_be_approved') && !$user['approved']) {
                         $paraName = 'usermanager::signup_approval_verified';
                         $paraAtt[] = $this->um->getApproveUserUrl($user['username']);
                         $paraAtt[] = $this->um->getRejectUserUrl($user['username']);
                         $paraAtt[] = $this->um->getPendingUsersUrl();
                     }
                     $this->um->mailToAdmins('SiteBar: New SiteBar User Verified E-mail', $paraName, $paraAtt);
                 }
                 if ($redirect) {
                     // No &amp; - it does not go to HTML, it is HTTP redirect
                     SB_redirect('command.php?command=Email+Verified&do=yes&uid=' . $uid);
                 }
                 break;
             case 'reset':
                 if ($redirect) {
                     // No &amp; - it does not go to HTML, it is HTTP redirect
                     SB_redirect('command.php?command=New+Password&uid=' . $uid . '&token=' . $token);
                 }
                 break;
         }
         return true;
     }
     if ($redirect) {
         // No &amp; - it does not go to HTML, it is HTTP redirect
         SB_redirect('command.php?command=Invalid+Token&do=yes');
     }
     return false;
 }
Exemplo n.º 28
0
 function drawChildren(&$node)
 {
     $count = $node->childrenCount();
     foreach ($node->getChildren() as $child) {
         $count--;
         if ($child->type) {
             continue;
         }
         if ($child->type_flag == 'n') {
             if (!$this->drawNode($child, $count == 0)) {
                 return false;
             }
         } else {
             $child->ignoreHits = false;
             $child->origURL = $child->url;
             if ($this->switches['hits']) {
                 $child->ignoreHits = strlen($child->url) && ($child->url[0] == 'j' && strpos($child->url, 'javascript:') !== false || $child->url[0] == 'm' && strpos($child->url, 'mailto:') !== false);
                 if ($child->id && !$child->ignoreHits && false) {
                     if ($this->switches['shorten']) {
                         $child->url = 'go.php?id=' . $child->id;
                     } else {
                         $child->url = SB_Page::absBaseUrl() . 'go.php?id=' . $child->id . '&url=' . urlencode($child->getUrl());
                     }
                 }
             }
             if ($this->switches['len'] !== null) {
                 $child->comment = substr($child->comment, 0, $this->switches['len']);
             }
             $child->name = $this->fromUTF8($child->name);
             $child->comment = $this->fromUTF8($child->comment);
             $this->drawLink($node, $child, $count == 0);
             $this->countLinks++;
             if ($this->switches['max'] !== null && $this->countLinks == $this->switches['max']) {
                 return false;
             }
         }
     }
     return true;
 }
Exemplo n.º 29
0
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;
}
Exemplo n.º 30
0
 function putCommonHeaders($close = true)
 {
     static $agent = null;
     if ($agent === null) {
         $agent = 'SiteBar/' . str_replace(' ', '', SB_CURRENT_RELEASE) . ' (Bookmark Server; http://sitebar.org/)';
     }
     $this->http->put('User-Agent: ' . $agent . "\r\n");
     // We cannot use Keep-Alive if we do not want to complicate the communication a lot.
     // It is not guaranteed that the connection would be kept and we do usually only 3
     // hits to one site. Keep-Alive could speed it up, but probably not very dramatically.
     // If someone wants to go this way, then he must count with other problems. He must
     // ensure that he flushes the stream, reads only what he should (some sites do not
     // sent Content-length!).
     $this->http->put('Connection: Close' . "\r\n");
     $this->http->put('Referer: ' . SB_Page::absBaseUrl() . "\r\n");
     if ($close) {
         $this->http->put("\r\n");
     }
 }