function _buildMessengerCommon(&$fields, $to)
 {
     $fields['--hidden1-'] = array('name' => 'uid', 'value' => SB_reqVal('uid'));
     $fields['--hidden2-'] = array('name' => 'command_gid', 'value' => SB_reqVal('command_gid'));
     $isModerator = SB_reqChk('command_gid') && $this->um->isModerator(SB_reqVal('command_gid'));
     if ($isModerator || $this->um->isAdmin()) {
         $fields['From'] = array('name' => 'from', 'type' => 'select', '_options' => '_buildMessengerFrom');
         $fields['To (Just Label)'] = array('name' => 'to', 'value' => $to);
     } else {
         $fields['To'] = array('disabled' => 1, 'name' => 'to', 'value' => $to);
     }
     $fields['Subject'] = array('name' => 'subject');
     if (SB_reqChk('inre')) {
         $where = array('mid' => intval(SB_reqVal('inre')));
         $db =& SB_Database::staticInstance();
         $res = $db->select('subject', 'sitebar_message', $where);
         if ($res) {
             $rec = $db->fetchRecord($res);
             $subject = $rec['subject'];
             if (strpos($subject, SB_T('Re:')) != 0) {
                 $subject = SB_T('Re:') . ' ' . $subject;
             }
             $where['^1'] = 'AND';
             $where['uid'] = $this->um->uid;
             if ($db->select(null, 'sitebar_message_folder', $where)) {
                 $fields['Subject']['value'] = $subject;
             }
         }
     }
     $fields['Message'] = array('name' => 'message', 'type' => 'textarea', 'rows' => 5);
     if ($this->um->isAdmin()) {
         $fields['--raw1-'] = '<p><a target="_blank" href="http://www.fckeditor.net/demo/default.html">FCKeditor - WYSIWYG</a></p>';
         $fields['Formatting'] = array('name' => 'format', 'type' => 'select', '_options' => '_buildMessengerFormatting');
         $fields['Respect Allow Info Mail'] = array('name' => 'respect', 'type' => 'checkbox', 'checked' => 0, 'title' => SB_P('command::tooltip_respect'));
         $fields['Expiration'] = array('name' => 'expires', 'value' => date('Y-m-d', mktime(0, 0, 0, date('m') + 1, date('d'), date('Y'))));
     }
 }
Esempio n. 2
0
 function buildPaste()
 {
     $fields = array();
     $sourceId = SB_reqVal('sid', true);
     $sourceIsNode = SB_reqVal('stype', true);
     $sourceObj = null;
     $targetID = SB_reqValInt('nid_acl', true);
     $targetNode = $this->tree->getNode($targetID);
     $sourceNodeId = $sourceId;
     if ($sourceIsNode) {
         $sourceObj = $this->tree->getNode($sourceId);
         if (!$this->um->isAuthorized('Copy', false, null, $sourceId)) {
             $this->um->accessDenied();
             return;
         }
         $parents = $this->tree->getParentNodes($targetID);
         if (in_array($sourceId, $parents)) {
             $this->warn('Cannot move folder to its subfolder!');
             return;
         }
     } else {
         $sourceObj = $this->tree->getLink($sourceId);
         $sourceNodeId = $sourceObj->id_parent;
         if (!$this->um->isAuthorized('Copy Bookmark', false, null, null, $sourceId)) {
             $this->um->accessDenied();
             return;
         }
         if ($sourceObj->id_parent == $targetNode->id) {
             $this->warn('Link already is in the target folder!');
             return;
         }
     }
     $canMove = $this->um->canMove($sourceNodeId, $targetNode->id, $sourceIsNode);
     if ($this->um->getParam('user', 'paste_mode') != 'ask') {
         $this->skipBuild = true;
         $this->reload = !$this->um->getParam('user', 'extern_commander');
         $this->close = $this->um->getParam('user', 'auto_close');
         $move = $canMove && $this->um->getParam('user', 'paste_mode') == 'move';
         $this->executePaste($targetNode->id, $sourceId, $sourceIsNode, $move);
         return;
     }
     $fields[$sourceIsNode ? SB_T('Source Folder Name') : SB_T('Copy Bookmark')] = array('name' => 'sidname', 'value' => $sourceObj->name, 'disabled' => null);
     $fields['Target Folder Name'] = array('name' => 'tidname', 'value' => $targetNode->name, 'disabled' => null);
     if ($sourceIsNode) {
         $fields['Content Only'] = array('name' => 'content', 'type' => 'checkbox', 'title' => SB_P('command::tooltip_paste_content'));
     }
     $fields['Mode'] = array('type' => 'callback', 'function' => '_buildPasteMode', 'params' => array('canMove' => $canMove));
     $fields['-hidden1-'] = array('name' => 'nid_acl', 'value' => $targetNode->id);
     $fields['-hidden2-'] = array('name' => 'sid', 'value' => $sourceId);
     $fields['-hidden3-'] = array('name' => 'stype', 'value' => $sourceIsNode);
     return $fields;
 }
Esempio n. 3
0
    function drawBody()
    {
        $where = array('ms.uid' => $this->um->uid, '^1' => "AND m.mid=ms.mid AND flag<>'deleted' AND", 'folder' => $this->folder);
        $res = $this->db->select('*, m.uid sender, ms.uid recipient', 'sitebar_message m, sitebar_message_folder ms', $where);
        $midRecs = $this->db->fetchRecords($res);
        $command = SB_reqVal('command');
        $webMids = SB_reqVal('mid');
        $seenMid = array();
        foreach ($midRecs as $rec) {
            $mid = $rec['mid'];
            $uid = $rec['sender'];
            $fromuser = $this->um->getUser($uid);
            $role = $rec['role'];
            $to = $rec['to_label'];
            $date = $rec['sent'];
            $expires = $rec['expires'];
            $from = '';
            $subject = $rec['subject'];
            $message = $rec['message'];
            $format = $rec['format'];
            $folder = $rec['folder'];
            $flag = $rec['flag'];
            if (isset($seenMid[$mid])) {
                continue;
            }
            $seenMid[$mid] = 1;
            if (isset($webMids[$mid])) {
                if ($this->folder == 'outbox') {
                    if (isset($command['back'])) {
                        $this->db->delete('sitebar_message', array('mid' => $mid));
                        $this->db->delete('sitebar_message_folder', array('mid' => $mid));
                        continue;
                    }
                    if (isset($command['expire'])) {
                        $this->db->update('sitebar_message_folder', array('flag' => 'expired'), array('mid' => $mid));
                    }
                    if (isset($command['delete'])) {
                        $this->update($mid, 'outbox', 'deleted');
                        continue;
                    }
                } else {
                    if (isset($command['mark'])) {
                        $flag = 'read';
                        $this->update($mid, 'inbox', 'read');
                        if ($this->ajax) {
                            echo $mid . ';read';
                        }
                    }
                    if (isset($command['unmark'])) {
                        $flag = 'seen';
                        $this->update($mid, 'inbox', 'seen');
                        if ($this->ajax) {
                            echo $mid . ';new';
                        }
                    }
                    if (isset($command['save'])) {
                        $this->update($mid, 'saved');
                        continue;
                    }
                    if (isset($command['delete'])) {
                        $this->update($mid, null, 'deleted');
                        continue;
                    }
                }
            }
            switch ($as) {
                case 'admins':
                    $from = SB_T('Administrators') . ' (' . $fromuser['fullname'] . ')';
                    break;
                case 'moderator':
                    $gid = intval($this->db->getData('messenger', $mid . '_gid'));
                    if (!$this->um->isModerator($gid)) {
                        continue;
                    }
                    $group = $this->um->getGroup($gid);
                    $from = SB_T('Moderator of %s Group', $group['name']) . ' (' . $fromuser['fullname'] . ')';
                    break;
                default:
                    $from = $fromuser['fullname'];
                    break;
            }
            if ($this->folder == 'inbox' || $this->folder == 'saved') {
                $from = "<a title='" . SB_T('Reply') . "' href='command.php?command=Send Message to User&uid={$uid}&inre={$mid}'>" . $from . "</a>";
            }
            if ($format == 'html') {
                $message = stripslashes($message);
            } else {
                $message = "<pre>" . $message . "</pre>";
            }
            $highlight = '';
            $isnew = false;
            if ($folder == 'inbox' && ($flag == 'new' || $flag == 'seen')) {
                $this->displayedNew++;
                $highlight = ' highlight';
                $isnew = true;
                if ($flag == 'new') {
                    $this->update($mid, 'inbox', 'seen');
                }
            }
            $img = SB_Page::relBaseUrl() . sprintf('skins/msg_%s.gif', $isnew ? 'new' : 'read');
            $checkbox = "<input class='checkBox' type='checkbox' name='mid[{$mid}]'>";
            if (!$this->ajax) {
                ?>
<div id='message<?php 
                echo $mid;
                ?>
' class='message'>
<table class='cmnMenu'>
<tr>
    <td class='icon'><img id="img<?php 
                echo $mid;
                ?>
" src="<?php 
                echo $img;
                ?>
" <?php 
                if ($this->folder == 'inbox') {
                    ?>
onclick='SB_messengerToggleItem(this,<?php 
                    echo $mid;
                    ?>
)'<?php 
                }
                ?>
></td>
    <td class='cmnMenuItem<?php 
                echo $highlight;
                ?>
'><?php 
                echo SB_T('From');
                ?>
</td>
    <td><?php 
                echo $from;
                ?>
</td>
</tr>
<?php 
                if ($this->folder == 'outbox' && $to) {
                    ?>
<tr>
    <td class='check'><?php 
                    echo $checkbox;
                    $checkbox = '&nbsp;';
                    ?>
</td>
    <td class='cmnMenuItem<?php 
                    echo $highlight;
                    ?>
'><?php 
                    echo SB_T('To');
                    ?>
</td>
    <td><?php 
                    echo $to;
                    ?>
</td>
</tr>
<?php 
                }
                ?>
<tr>
    <td class='check'><?php 
                echo $checkbox;
                ?>
</td>
    <td class='cmnMenuItem<?php 
                echo $highlight;
                ?>
'><?php 
                echo SB_T('Date');
                ?>
</td>
    <td><?php 
                echo $date;
                ?>
</td>
</tr>
<tr>
    <td class='status'>&nbsp;</td>
    <td class='cmnMenuItem<?php 
                echo $highlight;
                ?>
'><?php 
                echo SB_T('Subject');
                ?>
</td>
    <td>
<?php 
                echo stripslashes($subject);
                ?>
    </td>
</tr>
<?php 
                if ($this->folder == 'outbox') {
                    if ($expires != '0000-00-00 00:00:00') {
                        ?>
<tr>
    <td class='check'>&nbsp;</td>
    <td class='cmnMenuItem'><?php 
                        echo SB_T('Expiration');
                        ?>
</td>
    <td><?php 
                        echo $expires;
                        ?>
</td>
</tr>
<?php 
                    }
                    $states = array('inbox_new' => 'messenger::state_unread', 'inbox_seen' => 'messenger::state_seen', 'inbox_read' => 'messenger::state_read', 'saved' => 'messenger::state_saved', 'deleted' => 'messenger::state_deleted', 'expired' => 'messenger::state_expired');
                    $statesWhere = array('inbox_new' => "folder='inbox' AND flag='new'", 'inbox_seen' => "folder='inbox' AND flag='seen'", 'inbox_read' => "folder='inbox' AND flag='read'", 'saved' => "folder='saved'", 'deleted' => "folder='trash'", 'expired' => "folder='expired'");
                    $breakdown = '';
                    foreach ($states as $status => $label) {
                        $res = $this->db->select('count(*) count', 'sitebar_message_folder', "mid={$mid} AND " . $statesWhere[$status]);
                        $countRec = $this->db->fetchRecord($res);
                        if ($countRec['count'] > 0) {
                            if (SB_reqVal('drill') == $status && is_string($webMids) && $mid == $webMids) {
                                if ($breakdown != '') {
                                    $breakdown .= '<br>';
                                }
                                $breakdown .= SB_P($label) . ": ";
                                $res = $this->db->select('uid', 'sitebar_message_folder', "mid={$mid} AND " . $statesWhere[$status]);
                                foreach ($this->db->fetchRecords($res) as $uidRec) {
                                    $user = $this->um->getUser($uidRec['uid']);
                                    if ($this->um->isAdmin()) {
                                        $breakdown .= '<a href="command.php?command=Modify%20User&amp;uid=' . $uidRec['uid'] . '">' . $user['username'] . '</a> ';
                                    } else {
                                        $breakdown .= $user['username'] . ' ';
                                    }
                                }
                                $breakdown .= "<br>";
                            } else {
                                $breakdown .= '<a class="states" href="' . $this->getUrl(array('folder' => $this->folder, 'mid' => $mid, 'drill' => $status)) . '">' . SB_P($label) . '</a> [' . $countRec['count'] . '] ';
                            }
                        }
                    }
                    ?>
<tr>
    <td class='status'>&nbsp;</td>
    <td class='cmnMenuItem'><?php 
                    echo SB_T("Status");
                    ?>
</td>
    <td><?php 
                    echo $breakdown;
                    ?>
</td>
</tr>
<?php 
                }
                ?>
<tr>
    <td class='message' colspan='3'><?php 
                echo $message;
                ?>
</td>
</tr>
</table>
</div>
<?php 
            }
        }
        if ($this->folder == 'inbox' && is_array($command)) {
            $this->db->lock($tables = array('sitebar_data' => 'WRITE', 'sitebar_user_data' => 'WRITE'));
            $this->db->setUserData('messenger', $this->um->uid, 'new', $this->displayedNew);
            $this->db->unlock();
        }
    }
Esempio n. 4
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'));
 }
Esempio n. 5
0
function SB_C($context, $msg, $params = null)
{
    return SB_P($context . '::' . $msg, $params);
}
Esempio n. 6
0
    }
    echo "<td class=\"desc\">{$params['desc']}</td>\r";
    echo "</tr>\r";
}
?>
    </table>
    <p class="comment">
<?php 
echo SB_P('integrator::hint_bookmarklet');
?>
    </p>
  </div>
</div>
<div id="trailer">
    <?php 
echo SB_P('integrator::copyright3');
?>
</div>
</div>
<div id="sponsorIntegratorVerticalRight"><?php 
$sponsor->integratorVerticalRight();
?>
</div>

<?php 
SB_Page::foot();
function IEInstall()
{
    $install = $_REQUEST['install'];
    $code = '{3F218DFB-00FF-297C-4D54-57696C4A6F6F}';
    $title = 'SiteBar';
 function buildProperties()
 {
     $fields = array();
     $link = null;
     if ($this->command != 'Add Bookmark') {
         $link = $this->tree->getLink(SB_reqValInt('lid_acl'));
         if (!$link) {
             return null;
         }
     } else {
         $link = new SB_Tree_Link(array());
     }
     $fields['-hidden1-'] = array('name' => 'lid_acl', 'value' => $link->id);
     $fields['URL'] = array('name' => 'url');
     if ($this->command != 'Delete Bookmark') {
         /* Show the 'Retrieve Info' button only in case it has not been yet
          * performed
          */
         $fields['Get Bookmark Information'] = array('type' => 'addbutton');
         $fields['-hidden4-'] = array('name' => 'origin', 'value' => $this->command);
     }
     $fields['Bookmark Name'] = array('name' => 'name', 'maxlength' => 255);
     $size = strlen($link->comment);
     $MAXSIZETOEDIT = 4096;
     if ($size <= $MAXSIZETOEDIT) {
         $fields['Description'] = array('name' => 'comment', 'type' => 'textarea');
     } else {
         $fields['-raw1-'] = SB_T("Description too long for inplace editing, please use export feature!");
     }
     if ($this->um->getParam('user', 'use_favicons')) {
         $fields['Favicon'] = array('name' => 'favicon', 'maxsize' => 32000);
         $fields['-raw2-'] = '';
     }
     if (strlen(SB_reqVal('url'))) {
         $link->url = SB_reqVal('url');
     }
     if ($this->getInfo && strlen(SB_reqVal('url'))) {
         $link->name = SB_reqVal('name');
         $link->comment = SB_reqVal('comment');
         $link->favicon = SB_reqVal('favicon');
         /* Try to get the title and favicon */
         require_once './inc/pageparser.inc.php';
         $page = new SB_PageParser($link->url);
         if ($page->getInformation(array('CHARSET', 'TITLE', 'FAVURL', 'DESC', 'KEYWORDS'))) {
             $cp = 'iso-8859-1';
             if ($page->errorCode['CHARSET'] < PP_ERR) {
                 $cp = $page->info['CHARSET'];
             }
             require_once './inc/converter.inc.php';
             $c = new SB_Converter($this->um->getParam('config', 'use_conv_engine'), $cp);
             if (!$link->name && isset($page->info['TITLE'])) {
                 $link->name = $c->utf8RawUrlDecode($page->info['TITLE']);
             }
             if (!$link->comment && isset($page->info['DESC'])) {
                 $link->comment = $c->utf8RawUrlDecode($page->info['DESC']);
             }
             if ($this->um->getParam('user', 'use_favicons')) {
                 if (!$link->favicon && isset($page->info['FAVURL'])) {
                     $link->favicon = $page->info['FAVURL'];
                     /* Show the retrieved favicon. */
                     if ($this->command == 'Add Bookmark') {
                         /* Show the retrieved favicon. */
                         $wrong = SB_Skin::imgsrc('link_wrong_favicon');
                         $fields['-raw2-'] = "<div><img class='favicon' alt='' src='" . $link->favicon . "' onerror='this.src=\"{$wrong}\"'></div>";
                     } else {
                         $fields['-raw2-'] = $this->_buildFavicon(SB_reqValInt('lid_acl'), $link->favicon);
                     }
                 }
             }
         }
     }
     $fields['URL']['value'] = $link->url;
     $fields['Bookmark Name']['value'] = $link->name;
     $fields['Description']['value'] = $link->comment;
     if ($this->um->getParam('user', 'use_favicons')) {
         if ($this->command != 'Add Bookmark') {
             $favicon = $link->favicon;
             if (substr($link->favicon, 0, 7) == 'binary:') {
                 require_once './inc/faviconcache.inc.php';
                 $fc =& SB_FaviconCache::staticInstance();
                 $favicon = 'data:image/x-icon;base64,' . base64_encode($fc->faviconGet($link->favicon, null));
             }
             if ($link->favicon) {
                 $fields['-raw2-'] = $this->_buildFavicon($link->id, $link->favicon);
             }
         }
         $fields['Favicon']['value'] = $link->favicon;
     }
     $size = strlen($link->comment);
     $MAXSIZETOEDIT = 4096;
     if ($size <= $MAXSIZETOEDIT) {
         $fields['Description'] = array('name' => 'comment', 'type' => 'textarea', 'value' => $link->comment);
     } else {
         $fields['-raw1-'] = SB_T("Description too long for inplace editing, please use export feature!");
     }
     $fields['Feed Bookmark'] = array('name' => 'is_feed', 'type' => 'checkbox', 'title' => SB_P('command::tooltip_is_feed'));
     if ($link->is_feed) {
         $fields['Feed Bookmark']['checked'] = null;
     }
     if ($this->command == 'Add Bookmark' || $this->tree->inMyTree($link->id_parent)) {
         $fields['Private'] = array('name' => 'private', 'type' => 'checkbox', 'title' => SB_P('command::tooltip_private'));
         if ($link->private) {
             $fields['Private']['checked'] = null;
         }
     }
     if ($link->is_dead) {
         $fields['Dead Bookmark'] = array('name' => 'is_dead_check', 'type' => 'checkbox', 'checked' => null, 'title' => SB_P('command::tooltip_is_dead_check'));
         $fields['-hidden2-'] = array('name' => 'is_dead', 'type' => 'hidden', 'value' => 1);
     }
     if ($this->um->getParam('config', 'use_outbound_connection')) {
         $fields['Exclude From Validation'] = array('name' => 'novalidate', 'type' => 'checkbox', 'title' => SB_P('command::tooltip_novalidate'));
         if (!$link->validate) {
             $fields['Exclude From Validation']['checked'] = null;
         }
     }
     $fields['Target'] = array('name' => 'link_target', 'value' => $link->target);
     if ($this->command != 'Delete Bookmark') {
         if ($this->um->getParam('config', 'comment_impex') && strlen($link->comment) > 0 || strlen($link->comment) >= $MAXSIZETOEDIT) {
             $fields['Export Description'] = array('name' => 'command', 'type' => 'addbutton');
         }
         if ($this->um->getParam('config', 'comment_impex')) {
             $fields['Import Description'] = array('name' => 'command', 'type' => 'addbutton');
         }
     }
     if ($this->command == 'Properties') {
         $fields['Delete Bookmark'] = array('type' => 'addbutton');
     }
     return $fields;
 }
Esempio n. 8
0
 function drawNodeClose(&$node)
 {
     echo "</div>\r";
     echo "</div>\r";
     if ($node->isRoot) {
         if ($node->myTree == SB_TREE_OWN && !$this->um->isAnonymous() && !$this->um->getParam('user', 'has_link')) {
             // Hide for other roots
             $this->um->setParam('user', 'has_link', 1);
             // Make copy
             $nodeCopy = $node;
             $this->tree->loadNodes($nodeCopy, true);
             //
             if ($nodeCopy->childrenCount() == 0) {
                 echo "<div class='tutorial'>\r";
                 echo SB_P('sitebar::tutorial', array(SB_T('Add Bookmark'))) . "\r";
                 echo "</div>\r";
             } else {
                 $this->um->saveUserParams();
             }
         }
         echo "</div>\r";
     } else {
         array_pop($this->treearr);
     }
 }
Esempio n. 9
0
 function _commandSendEmail($to, $subject, $group = null)
 {
     // Prefetch to have it in our language
     $okStr = SB_T('%s - ok.');
     $errorStr = SB_T('%s - error!');
     $message = stripslashes(SB_reqVal('message'));
     foreach ($to as $uid => $user) {
         $userparams = $user['params'];
         $this->um->explodeParams($userparams, 'tmp');
         if (SB_reqVal('checkrcpt')) {
             if (SB_reqChk('respect') && !$this->um->getParam('tmp', 'allow_info_mails')) {
                 continue;
             }
             if (SB_reqChk('verified') && !$user['verified']) {
                 continue;
             }
         }
         SB_SetLanguage($this->um->getParam('tmp', 'lang'));
         $body = '';
         if ($group) {
             $body = SB_P('command::contact_group', array($group, $message, SB_Page::absBaseUrl()));
         } else {
             $body = SB_P('command::contact', array($message, SB_Page::absBaseUrl()));
         }
         if (!$this->um->email || !$this->checkEmailCorrectness($this->um->email)) {
             continue;
         }
         $ret = $this->um->sendMail($user, SB_T($subject), $body, $this->um->name, $this->um->email);
         // No translation here
         if ($ret) {
             $this->warn('%s', sprintf($okStr, $user['completenamehtml']));
         } else {
             $this->error('%s', sprintf($errorStr, $user['completenamehtml']));
         }
     }
     SB_SetLanguage($this->um->getParam('user', 'lang'));
 }
Esempio n. 10
0
 function buildExportBookmarks()
 {
     $fields = array();
     $writers = array();
     $dirName = './inc/writers';
     $dir = opendir($dirName);
     require_once './inc/writer.inc.php';
     while (($fileName = readdir($dir)) !== false) {
         if (preg_match('/(\\w+)\\.inc\\.php$/i', $fileName, $reg)) {
             $name = $reg[1];
             require_once $dirName . '/' . $fileName;
             if (!SB_safeVal($SB_writer_hidden, $name)) {
                 $writers[$name] = array(SB_safeVal($SB_writer_title, $name), SB_safeVal($SB_writer_default, $name));
             }
         }
     }
     closedir($dir);
     asort($writers);
     $fields['Select Output Format'] = array('name' => 'writer', 'type' => 'callback', 'function' => '_buildFeedBuildList', 'params' => array('name' => 'w', 'title' => SB_T('Select Output Format'), 'values' => $writers));
     if (SB_Page::isMSIE()) {
         $fields['-raw1-'] = SB_P('command::export_bk_ie_hint') . '<br>';
     }
     $fields['Codepage'] = array('type' => 'callback', 'function' => '_buildCodepage');
     $fields['Sort Mode'] = array('name' => 'sort', 'type' => 'select', '_options' => '_buildFolderSortMode', '_select' => 'custom');
     $fields['Order of Folders v. Bookmarks'] = array('name' => 'mix', 'type' => 'select', '_options' => '_buildMixMode', '_select' => $this->um->getParam('user', 'mix_mode'));
     $fields['Limit Number of Bookmarks'] = array('name' => 'max');
     $fields['Limit Description Length'] = array('name' => 'len');
     if ($this->um->getParam('config', 'use_hit_counter')) {
         $fields['Use Hit Counter'] = array('name' => 'hits', 'type' => 'checkbox', 'title' => SB_P('command::tooltip_hits'));
     }
     $fields['Exclude Root Folder'] = array('name' => 'exr', 'type' => 'checkbox', 'title' => SB_P('command::tooltip_exclude_root'));
     $fields['Ignore Private Bookmarks'] = array('name' => 'igp', 'type' => 'checkbox', 'title' => SB_P('command::tooltip_private'));
     $fields['Include Subfolders'] = array('name' => 'sd', 'type' => 'checkbox', 'checked' => null, 'title' => SB_P('command::tooltip_subdir'));
     $fields['Flatten the Hierarchy'] = array('name' => 'flat', 'type' => 'checkbox', 'title' => SB_P('command::tooltip_flat'));
     if (!SB_reqChk('doall')) {
         $fields['-hidden1-'] = array('name' => 'nid_acl', 'value' => SB_reqValInt('nid_acl'));
     } else {
         $fields['-hidden1-'] = array('name' => 'doall', 'value' => 1);
     }
     $fields['Add SiteBar Commands'] = array('name' => 'cmd', 'type' => 'checkbox', 'title' => SB_P('command::tooltip_cmd'));
     $fields['Download Bookmarks'] = array('type' => 'button');
     $fields['Username'] = array('name' => 'username');
     $fields['Password (visible to others)'] = array('name' => 'pass');
     $fields['Show Feed URL'] = array('type' => 'button');
     if (!count($writers)) {
         $this->error("No feed available!");
     }
     return $fields;
 }