/**
  * Queue header scripts
  *
  * Queues script libraries and stylesheets to include in header
  *
  * @return null
  */
 public function viewerHead($params)
 {
     $libUrl = absolute_url('plugins/MultimediaDisplay/libraries/mediaelement/build/');
     $libUrl = str_replace('admin/', '', $libUrl);
     queue_js_url($libUrl . 'mediaelement-and-player.min.js');
     queue_css_url($libUrl . 'mediaelementplayer.css');
 }
 /**
  * Queue header scripts
  *
  * Queues script libraries and stylesheets to include in header
  *
  * @return null
  */
 public function viewerHead($params)
 {
     $libDir = dirname(dirname(dirname(__FILE__))) . '/libraries/ohmsviewer/';
     $config = parse_ini_file($libDir . "config/config.ini", true);
     if (empty($params['cacheFileName'])) {
         throw new Exception('Item cannot be displayed. No cache file specified for Ohms Viewer.');
         return;
     }
     $cachefile = is_array($params['cacheFileName']) ? $params['cacheFileName'][0] : $params['cacheFileName'];
     require_once $libDir . 'lib/CacheFile.class.php';
     $liburl = absolute_url('/plugins/MultimediaDisplay/libraries/ohmsviewer/');
     $liburl = str_replace('admin/', '', $liburl);
     $cssurl = $liburl . 'css/';
     $jsurl = $liburl . 'js/';
     //queue_css_url($cssurl.$config['css']);
     queue_css_url($cssurl . 'viewer.css');
     queue_css_url($cssurl . 'jquery-ui.toggleSwitch.css');
     queue_css_url($cssurl . 'jquery-ui-1.8.16.custom.css');
     queue_css_url($cssurl . 'font-awesome.css');
     queue_css_url($cssurl . 'jquery.fancybox.css');
     queue_css_url($cssurl . 'jquery.fancybox-buttons.css');
     queue_css_url($cssurl . 'jquery.fancybox-thumbs.css');
     queue_css_url($cssurl . 'jplayer.blue.monday.css');
     queue_js_url('//ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js');
     queue_js_url($jsurl . 'jquery-ui.toggleSwitch.js');
     queue_js_url($jsurl . 'viewer_legacy.js');
     queue_js_url($jsurl . 'jquery.jplayer.min.js');
     queue_js_url($jsurl . 'jquery.easing.1.3.js');
     queue_js_url($jsurl . 'jquery.scrollTo-min.js');
     queue_js_url($jsurl . 'fancybox_2_1_5/source/jquery.fancybox.pack.js');
     queue_js_url($jsurl . 'fancybox_2_1_5/source/helpers/jquery.fancybox-buttons.js');
     queue_js_url($jsurl . 'fancybox_2_1_5/source/helpers/jquery.fancybox-media.js');
     queue_js_url($jsurl . 'fancybox_2_1_5/source/helpers/jquery.fancybox-thumbs.js');
 }
Example #3
0
 /**
  * Get the specified UniversalViewer.
  *
  * @param array $args Associative array of optional values:
  *   - (string) id: The unique main id.
  *   - (integer|Record) record: The record is the item if it's an integer.
  *   - (string) type: Type of record if record is integer (item by default).
  *   - (integer|Item) item
  *   - (integer|Collection) collection
  *   - (integer|File) file
  *   - (string) class
  *   - (string) width
  *   - (string) height
  *   - (string) locale
  * The only one record is defined according to the priority above.
  * @return string. The html string corresponding to the UniversalViewer.
  */
 public function universalViewer($args = array())
 {
     $record = $this->_getRecord($args);
     if (empty($record)) {
         return '';
     }
     // Some specific checks.
     switch (get_class($record)) {
         case 'Item':
             // Currently, item without files is unprocessable.
             if ($record->fileCount() == 0) {
                 return __('This item has no files and is not displayable.');
             }
             break;
         case 'Collection':
             if ($record->totalItems() == 0) {
                 return __('This collection has no item and is not displayable.');
             }
             break;
     }
     $class = isset($args['class']) ? $args['class'] : get_option('universalviewer_class');
     if (!empty($class)) {
         $class = ' ' . $class;
     }
     $width = isset($args['width']) ? $args['width'] : get_option('universalviewer_width');
     if (!empty($width)) {
         $width = ' width:' . $width . ';';
     }
     $height = isset($args['height']) ? $args['height'] : get_option('universalviewer_height');
     if (!empty($height)) {
         $height = ' height:' . $height . ';';
     }
     $locale = isset($args['locale']) ? $args['locale'] : get_option('universalviewer_locale');
     if (!empty($locale)) {
         $locale = ' data-locale="' . $locale . '"';
     }
     if (isset($args['only_images'])) {
         $manif = 'universalviewer_presentation_alternative_manifest';
     } else {
         $manif = 'universalviewer_presentation_manifest';
     }
     if (isset($args['current_image'])) {
         $currentImage = $args['current_image'];
     } else {
         $currentImage = 99999;
     }
     $urlManifest = absolute_url(array('recordtype' => Inflector::tableize(get_class($record)), 'id' => $record->id, 'image' => $currentImage), $manif);
     if (isset($args['only_images'])) {
         $config = src('config-images', 'universal-viewer', 'json');
     } else {
         $config = src('config', 'universal-viewer', 'json');
     }
     $urlJs = src('embed', 'javascripts/uv/lib', 'js');
     $imageClass = 'images';
     $html = sprintf('<div class="uv%s %s" data-config="%s" data-uri="%s"%s style="background-color: #000;%s%s"></div>', $class, $imageClass, $config, $urlManifest, $locale, $width, $height);
     $html .= sprintf('<script type="text/javascript" id="embedUV" src="%s"></script>', $urlJs);
     $html .= '<script type="text/javascript">/* wordpress fix */</script>';
     return $html;
 }
function get_recommended_user_func()
{
    global $mybb, $db, $lang, $users, $tapatalk_users;
    $tapatalk_users = array();
    $users = array();
    // Load global language phrases
    $lang->load("memberlist");
    //get tapatalk users
    if (isset($_POST['mode']) && $_POST['mode'] == 2) {
        $sql = "SELECT userid FROM " . TABLE_PREFIX . "tapatalk_users";
        $query = $db->query($sql);
        while ($user = $db->fetch_array($query)) {
            $tapatalk_users[] = $user['userid'];
        }
    }
    // get pm users
    $sql = "SELECT p.toid as uid\n\tFROM " . TABLE_PREFIX . "privatemessages p \n\tWHERE p.uid = " . $mybb->user['uid'] . "\n\tGROUP BY p.toid\n\tLIMIT 0,1000";
    get_recommended_user_list($sql, 'contact');
    // get pm me users
    $sql = "SELECT p.uid as uid\n\tFROM " . TABLE_PREFIX . "privatemessages p \n\tWHERE p.toid = " . $mybb->user['uid'] . "\n\tGROUP BY p.uid\n\tLIMIT 0,1000";
    get_recommended_user_list($sql, 'contact');
    //get sub topic users
    $sql = "SELECT t.uid as uid\n\tFROM " . TABLE_PREFIX . "threadsubscriptions ts \n\tLEFT JOIN " . TABLE_PREFIX . "threads t ON ts.tid = t.tid \n\tWHERE ts.uid = " . $mybb->user['uid'] . "\n\tGROUP BY t.uid\n\tLIMIT 0,1000";
    get_recommended_user_list($sql, 'watch');
    //get sub me topic users
    $sql = "SELECT ts.uid as uid\n\tFROM " . TABLE_PREFIX . "threadsubscriptions ts \n\tRIGHT JOIN " . TABLE_PREFIX . "threads t ON ts.tid = t.tid \n\tWHERE t.uid = " . $mybb->user['uid'] . "\n\tGROUP BY ts.uid\n\tLIMIT 0,1000";
    get_recommended_user_list($sql, 'watch');
    //get like or thank users
    $prefix = "g33k_thankyoulike_";
    if (file_exists('thankyoulike.php') && $db->table_exists($prefix . 'thankyoulike')) {
        $sql = "SELECT thl.puid as uid\n\t\tFROM " . TABLE_PREFIX . $prefix . "thankyoulike thl \n\t\tWHERE thl.uid = " . $mybb->user['uid'] . "\n\t\tGROUP BY thl.puid\n\t\tLIMIT 0,1000";
        get_recommended_user_list($sql, 'like');
        $sql = "SELECT thl.uid as uid\n\t\tFROM " . TABLE_PREFIX . $prefix . "thankyoulike thl \n\t\tWHERE thl.puid = " . $mybb->user['uid'] . "\n\t\tGROUP BY thl.uid\n\t\tLIMIT 0,1000";
        get_recommended_user_list($sql, 'liked');
    }
    $page = intval($_POST['page']);
    $perpage = intval($_POST['perpage']);
    $start = ($page - 1) * $perpage;
    $return_user_lists = array();
    $users_rank = tapa_rank_users($users);
    $total = count($users_rank);
    $users_slice = array_slice($users_rank, $start, $perpage);
    $user_id_str = implode(',', $users_slice);
    $mobi_api_key = loadAPIKey();
    if (!empty($user_id_str)) {
        $sql = "SELECT uid,username,email,avatar FROM " . TABLE_PREFIX . "users WHERE uid IN({$user_id_str})";
        $query = $db->query($sql);
        while ($user = $db->fetch_array($query)) {
            $user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
            if ($user['avatar'] != '') {
                $user['avatar'] = absolute_url($user['avatar']);
            }
            $return_user_lists[] = new xmlrpcval(array('username' => new xmlrpcval(basic_clean($user['username']), 'base64'), 'user_id' => new xmlrpcval($user['uid'], 'string'), 'icon_url' => new xmlrpcval($user['avatar'], 'string'), 'type' => new xmlrpcval('', 'string'), 'enc_email' => new xmlrpcval(base64_encode(encrypt(trim($user['email']), $mobi_api_key)), 'string')), 'struct');
        }
    }
    $suggested_users = new xmlrpcval(array('total' => new xmlrpcval($total, 'int'), 'list' => new xmlrpcval($return_user_lists, 'array')), 'struct');
    return new xmlrpcresp($suggested_users);
}
Example #5
0
function link_to($url, $text, $class = '')
{
    $uri = absolute_url($url);
    if (empty($class)) {
        return "<a href=\"{$uri}\">{$text}</a>";
    } else {
        return "<a href=\"{$uri}\" class=\"{$class}\">{$text}</a>";
    }
}
function logout()
{
    if (isset($_SESSION["soap_session"])) {
        //print "Unsetting";
        unset($_SESSION["soap_session"]);
    }
    $url = absolute_url('index.php?errors=2');
    header("Location: {$url}");
}
Example #7
0
/**
 * Processes (un)subscription requests to multiple lists
 * @param string $address The email address
 * @param array $list_ids The ids of the lists
 * @param bool $subscribe TRUE if addresss should be subscribed to the lists, FALSE if it should be unsubscribed
 * @return bool TRUE if operation was successful, else FALSE
 */
function gu_subscription_process($address, &$list_ids, $subscribe)
{
    if (!check_email($address)) {
        return gu_error(t("Invalid email address"));
    }
    $succ_list_names = array();
    $fail_list_names = array();
    // For each list we need to load it with all addresses
    foreach ($list_ids as $list_id) {
        $list = gu_list::get($list_id, TRUE);
        // Don't allow subscriptions to private lists
        if ($list->is_private()) {
            $res = FALSE;
        } else {
            if ($subscribe) {
                $res = $list->add($address, TRUE);
            } else {
                $res = $list->remove($address, TRUE);
            }
        }
        if ($res) {
            $succ_list_names[] = $list->get_name();
        } else {
            $fail_list_names[] = $list->get_name();
        }
    }
    // Check if there were any successful
    if (count($succ_list_names) < 1) {
        return FALSE;
    }
    // Work out if we need to send any emails now, and if so create a sender
    if (gu_config::get('list_send_welcome') || gu_config::get('list_send_goodbye') || gu_config::get('list_subscribe_notify') || gu_config::get('list_unsubscribe_notify')) {
        $mailer = new gu_mailer();
        if ($mailer->init()) {
            $subject_prefix = count($succ_list_names) == 1 ? $succ_list_names[0] : gu_config::get('collective_name');
            // Send welcome / goodbye message
            if ($subscribe && gu_config::get('list_send_welcome') || !$subscribe && gu_config::get('list_send_goodbye')) {
                $subject = '[' . $subject_prefix . '] ' . ($subscribe ? t('Subscription') : t('Unsubscription')) . t(' confirmation');
                $action = $subscribe ? t('subscribed to') : t('unsubscribed from');
                $text = t("This is an automated message to confirm that you have been % the following lists:", array($action)) . "\n\n* " . implode("\n* ", $succ_list_names) . "\n\n";
                $text .= t('To change your subscriptions visit: ') . absolute_url('subscribe.php') . '?addr=' . $address . "\n\n";
                $text .= t('Please do not reply to this message. Thank you.');
                $mailer->send_mail($address, $subject, $text);
            }
            // Send admin notifications
            if ($subscribe && gu_config::get('list_subscribe_notify') || !$subscribe && gu_config::get('list_unsubscribe_notify')) {
                $subject = '[' . $subject_prefix . '] ' . ($subscribe ? t('Subscription') : t('Unsubscription')) . t(' notification');
                $action = $subscribe ? t('subscribed to') : t('unsubscribed from');
                $text = t("This is an automated message to notify you that % has been % the following lists:", array($address, $action)) . "\n\n* " . implode("\n* ", $succ_list_names) . "\n\n";
                $mailer->send_admin_mail($subject, $text);
            }
        }
    }
    $action = $subscribe ? t('subscribed to') : t('unsubscribed from');
    return gu_success(t('You have been % lists: <i>%</i>', array($action, implode('</i>, <i>', $succ_list_names))));
}
function prefetch_account_func()
{
    global $mybb, $db;
    $user = tt_get_user_by_email($mybb->input['email']);
    if (empty($user['uid'])) {
        error("Can't find the user");
    }
    $result = array('result' => new xmlrpcval(true, 'boolean'), 'result_text' => new xmlrpcval('', 'base64'), 'user_id' => new xmlrpcval($user['uid'], 'string'), 'login_name' => new xmlrpcval(basic_clean($user['username']), 'base64'), 'display_name' => new xmlrpcval(basic_clean($user['username']), 'base64'), 'avatar' => new xmlrpcval(absolute_url($user['avatar']), 'string'));
    return new xmlrpcresp(new xmlrpcval($result, 'struct'));
}
 public function hookPublicItemsShow($args)
 {
     $item = $args['item'];
     $uri = absolute_url(array('controller' => 'items', 'action' => 'embed', 'id' => $item->id), 'id');
     $html = "<div id='embed-codes'><h2>" . __('Embed') . "</h2>";
     $html .= "<p>" . __("Copy the code below into your web page") . "</p>";
     $iFrameHtml = "<iframe class='omeka-embed' src='{$uri}' style='margin: 2em 0; border: 1px solid #e7e7e7' width='315px' height='285px' frameborder='0' allowfullscreen></iframe>";
     $html .= "<textarea id='embed-code-text' style='font-family:monospace' rows='4'>{$iFrameHtml}</textarea>";
     $html .= "</div>";
     echo $html;
 }
 /**
  * Queue header scripts
  *
  * Queues script libraries and stylesheets to include in header
  *
  * @return null
  */
 public function viewerHead($params)
 {
     if (is_array($params['url'])) {
         $liburl = absolute_url('/plugins/MultimediaDisplay/libraries/bookreader/', '', array(), true);
         $liburl = str_replace('admin/', '', $liburl);
         queue_js_url('http://www.archive.org/bookreader/jquery-ui-1.8.5.custom.min.js');
         queue_js_url('http://www.archive.org/bookreader/dragscrollable.js');
         queue_js_url('http://www.archive.org/bookreader/jquery.colorbox-min.js');
         queue_js_url('http://www.archive.org/bookreader/jquery.ui.ipad.js');
         queue_js_url('http://www.archive.org/bookreader/jquery.bt.min.js');
         queue_js_url($liburl . 'BookReader.js');
     }
 }
    /**
     * Retrieve body html
     *
     * Retrieves markup to include in the main content body of item show pages
     *
     * @return string Html to include in the header, 
     * linking to stylesheets and javascript libraries
     */
    public function getBodyHtml($params)
    {
        $liburl = absolute_url('plugins/MultimediaDisplay/libraries/bookreader/');
        $liburl = str_replace('admin/', '', $liburl);
        ob_start();
        ?>
        <div id="viewer"></div>
        <script type="text/javascript" src="<?php 
        echo $liburl . 'MiradorDeploy.js';
        ?>
" />
        <?php 
        return ob_get_clean();
    }
Example #12
0
 /**
  * Get the specified BookReader.
  *
  * @param array $args Associative array of optional values:
  *   - (integer|Item) item: The item is the current one if not set.
  *   - (integer) page: set the page to be shown when including the iframe.
  *   - (boolean) embed_functions: include buttons (Zoom, Search...).
  *   - (integer) mode_page: allow to display 1 or 2 pages side-by-side.
  *   - (integer) part: can be used to display the specified part of a book.
  *
  * @return string. The html string corresponding to the BookReader.
  */
 public function getBookReader($args = array())
 {
     if (!isset($args['item'])) {
         $item = get_current_record('item');
     } elseif ($args['item'] instanceof Item) {
         $item = $args['item'];
     } else {
         $item = get_record_by_id('Item', (int) $args['item']);
     }
     if (empty($item)) {
         return '';
     }
     $part = empty($args['part']) ? 0 : (int) $args['part'];
     $page = empty($args['page']) ? '0' : $args['page'];
     // Currently, all or none functions are enabled.
     $embed_functions = isset($args['embed_functions']) ? $args['embed_functions'] : get_option('bookreader_embed_functions');
     // TODO Count leaves, not files.
     if ($item->fileCount() > 1) {
         $mode_page = isset($args['mode_page']) ? $args['mode_page'] : get_option('bookreader_mode_page');
     } else {
         $mode_page = 1;
     }
     // Build url of the page with iframe.
     $queryParams = array();
     if ($part > 1) {
         $queryParams['part'] = $part;
     }
     if (empty($embed_functions)) {
         $queryParams['ui'] = 'embed';
     }
     $url = absolute_url(array('id' => $item->id), 'bookreader_viewer', $queryParams);
     $url .= '#';
     $url .= empty($page) ? '' : 'page/n' . $page . '/';
     $url .= 'mode/' . $mode_page . 'up';
     $class = get_option('bookreader_class');
     if (!empty($class)) {
         $class = ' class="' . $class . '"';
     }
     $width = get_option('bookreader_width');
     if (!empty($width)) {
         $width = ' width="' . $width . '"';
     }
     $height = get_option('bookreader_height');
     if (!empty($height)) {
         $height = ' height="' . $height . '"';
     }
     $html = '<div><iframe src="' . $url . '"' . $class . $width . $height . ' frameborder="0"></iframe></div>';
     return $html;
 }
Example #13
0
 function parse()
 {
     $this->links = array();
     $nodes = $this->api->xpath->query("//a/@href");
     if (!$nodes->length) {
         $nodes = $this->api->xpath->query("//enclosure/@url");
     }
     if ($nodes->length) {
         foreach ($nodes as $node) {
             if ($link = $this->check_link($node->value)) {
                 $this->links[$link] = array('url' => absolute_url($link, $this->base), 'title' => empty($node->ownerElement->textContent) ? basename($link) : trim($node->ownerElement->textContent));
             }
         }
     }
 }
Example #14
0
 /**
  * Queue header scripts
  *
  * Queues script libraries and stylesheets to include in header
  *
  * @return null
  */
 public function viewerHead($params)
 {
     $liburl = absolute_url('/plugins/MultimediaDisplay/libraries/pdf/', '', array(), true);
     $liburl = str_replace('admin/', '', $liburl);
     queue_js_url($liburl . 'src/shared/util.js');
     queue_js_url($liburl . 'src/display/api.js');
     queue_js_url($liburl . 'src/display/metadata.js');
     queue_js_url($liburl . 'src/display/canvas.js');
     queue_js_url($liburl . 'src/display/webgl.js');
     queue_js_url($liburl . 'src/display/pattern_helper.js');
     queue_js_url($liburl . 'src/display/font_loader.js');
     queue_js_url($liburl . 'src/display/annotation_helper.js');
     queue_js_string('PDFJS.workerSrc = \'' . $liburl . 'src/worker_loader.js\';');
     queue_js_string('pdfFile = \'' . $params['url'][0]['url'] . '\';');
     queue_js_url($liburl . 'displayPDF.js');
 }
Example #15
0
 function getJSON($arguments)
 {
     // important for url_for() links
     define('FORCE_NO_RELATIVE', true);
     if (!in_array($arguments['currency1'], get_all_currencies())) {
         throw new \Exception("Invalid currency '" . $arguments['currency1'] . "'");
     }
     if (!in_array($arguments['currency2'], get_all_currencies())) {
         throw new \Exception("Invalid currency '" . $arguments['currency2'] . "'");
     }
     $q = db()->prepare("SELECT * FROM ticker_recent WHERE currency1=? AND currency2=? ORDER BY volume DESC");
     $q->execute(array($arguments['currency1'], $arguments['currency2']));
     $result = array();
     while ($ticker = $q->fetch()) {
         $result[] = array('exchange' => $ticker['exchange'], 'last_trade' => $ticker['last_trade'], 'bid' => $ticker['bid'], 'ask' => $ticker['ask'], "volume" => $ticker['volume'], 'time' => $ticker['created_at'], 'url' => absolute_url(url_for('historical', array('id' => $ticker['exchange'] . "_" . $ticker['currency1'] . $ticker['currency2'] . "_daily"))));
     }
     if (!$result) {
         throw new \Exception("No rates found");
     }
     return $result;
 }
Example #16
0
function addfile()
{
    require_once 'mysql_connect.php';
    // Check if a file has been uploaded
    if (isset($_FILES['uploaded_file'])) {
        // Make sure the file was sent without errors
        if ($_FILES['uploaded_file']['error'] == 0) {
            // If no session value is present,redirect the user:
            if (!isset($_SESSION['user_id'])) {
                require_once 'includes/login_functions.inc.php';
                $url = absolute_url();
                header("Location: {$url}");
                exit;
            }
            // Gather all required data
            $apptid = $_POST['apptid'];
            $name = @mysql_real_escape_string($_FILES['uploaded_file']['name']);
            $mime = @mysql_real_escape_string($_FILES['uploaded_file']['type']);
            $data = @mysql_real_escape_string(file_get_contents($_FILES['uploaded_file']['tmp_name']));
            $size = intval($_FILES['uploaded_file']['size']);
            // Create the SQL query
            $query = "\n            INSERT INTO `file` (\n                `name`, `mime`, `size`, `data`, `created`,`apptid`\n            )\n            VALUES (\n                '{$name}', '{$mime}', {$size}, '{$data}', NOW(), '{$apptid}'\n            )";
            // Execute the query
            $result = @mysql_query($query);
            // Check if it was successfull
            if ($result) {
                echo 'Success! Your file was successfully added!';
            } else {
                echo 'Error! Failed to insert the file' . "<pre>{$dbLink->error}</pre>";
            }
        } else {
            echo 'An error accured while the file was being uploaded. ' . 'Error code: ' . intval($_FILES['uploaded_file']['error']);
        }
    } else {
        echo 'Error! A file was not sent!';
    }
    // Echo a link back to the main page
    $meta = '<meta http-equiv="Refresh" content="3;url=addnote.php" />';
    //echo "window.location = 'addnote.php?sid=".$_POST['studentid']."&aptid=".$apptid."';";
}
 private function _getItem()
 {
     $item = get_record_by_id('Item', (int) $this->getParam('id'));
     if (is_object($item)) {
         $hasItem = true;
     }
     if (get_option('audio_recorder_attachment') == 'file' && $hasItem) {
         return $item;
     }
     //create a new item and attach it as much as possible
     $username = is_object($user = current_user()) ? "{$user->name} ({$user->email})" : "An Anonymous Contributor";
     $username = isset($_POST['audio_recorder_username']) ? $_POST['audio_recorder_username'] : $username;
     $elementTable = get_db()->getTable('Element');
     $creatorElement = $elementTable->findByElementSetNameAndElementName('Dublin Core', 'Creator');
     $elements[$creatorElement->id] = array(array('text' => $username, 'html' => "0"));
     //todo - if record relations is installed,
     //add an appropriate relation
     if (is_object($user) && $username !== $user->name) {
         $contributorElement = $elementTable->findByElementSetNameAndElementName('Dublin Core', 'Contributor');
         $elements[$contributorElement->id] = array(array('text' => "{$user->name} ({$user->email})", 'html' => "0"));
         //todo - if record relations is installed,
         //add an appropriate relation
     }
     $sourceElement = $elementTable->findByElementSetNameAndElementName('Dublin Core', 'Source');
     $elements[$sourceElement->id] = array(array('text' => "Audio Recorder plugin", 'html' => "0"));
     if ($hasItem) {
         $relationElement = $elementTable->findByElementSetNameAndElementName('Dublin Core', 'Relation');
         $elements[$relationElement->id] = array(array('text' => 'This recording describes, or is directly related to, the following item: <br> <a href="' . absolute_url('items/show/' . $item->id) . '">' . metadata($item, array('Dublin Core', 'Title')) . '</a>', 'html' => "1"));
         //todo - if record relations is installed,
         //add an appropriate relation
         $titleElement = $elementTable->findByElementSetNameAndElementName('Dublin Core', 'Title');
         $elements[$titleElement->id] = array(array('text' => "Audio Recording " . date('Y-m-d'), 'html' => "0"));
     }
     $fauxPost = array('Elements' => $elements, 'item_type_id' => '', 'public' => (bool) get_option('audio_recorder_public'));
     $recItem = new Item();
     $recItem->setPostData($fauxPost);
     $recItem->save();
     return $recItem;
 }
 /**
  * Redirect to the 'info' action, required by the feature "baseUriRedirect".
  *
  * @see self::infoAction()
  */
 public function indexAction()
 {
     $id = $this->getParam('id');
     $url = absolute_url(array('id' => $id), 'universalviewer_media_info');
     $this->redirect($url);
 }
Example #19
0
function search_user_func()
{
    global $mybb, $db, $lang, $cache;
    // Load global language phrases
    $lang->load("memberlist");
    if ($mybb->settings['enablememberlist'] == 0) {
        return xmlrespfalse($lang->memberlist_disabled);
    }
    //$plugins->run_hooks("memberlist_start");
    if ($mybb->usergroup['canviewmemberlist'] == 0) {
        return tt_no_permission();
    }
    $colspan = 5;
    $search_url = '';
    // Incoming sort field?
    $mybb->input['sort'] = $mybb->settings['default_memberlist_sortby'];
    switch ($mybb->input['sort']) {
        case "regdate":
            $sort_field = "u.regdate";
            break;
        case "lastvisit":
            $sort_field = "u.lastactive";
            break;
        case "reputation":
            $sort_field = "u.reputation";
            break;
        case "postnum":
            $sort_field = "u.postnum";
            break;
        case "referrals":
            $sort_field = "u.referrals";
            break;
        default:
            $sort_field = "u.username";
            $mybb->input['sort'] = 'username';
            break;
    }
    //$sort_selected[$mybb->input['sort']] = " selected=\"selected\"";
    // Incoming sort order?
    $mybb->input['order'] = strtolower($mybb->settings['default_memberlist_order']);
    if ($mybb->input['order'] == "ascending" || !$mybb->input['order'] && $mybb->input['sort'] == 'username') {
        $sort_order = "ASC";
        $mybb->input['order'] = "ascending";
    } else {
        $sort_order = "DESC";
        $mybb->input['order'] = "descending";
    }
    //$order_check[$mybb->input['order']] = " checked=\"checked\"";
    // Incoming results per page?
    $mybb->input['perpage'] = intval($mybb->input['perpage']);
    if ($mybb->input['perpage'] > 0 && $mybb->input['perpage'] <= 500) {
        $per_page = $mybb->input['perpage'];
    } else {
        if ($mybb->settings['membersperpage']) {
            $per_page = $mybb->input['perpage'] = intval($mybb->settings['membersperpage']);
        } else {
            $per_page = $mybb->input['perpage'] = 20;
        }
    }
    $search_query = '1=1';
    // Searching for a matching username
    $search_username = htmlspecialchars_uni(trim($mybb->input['username']));
    if ($search_username != '') {
        $username_like_query = $db->escape_string_like($search_username);
        // Name begins with
        if ($mybb->input['username_match'] == "begins") {
            $search_query .= " AND u.username LIKE '" . $username_like_query . "%'";
        } else {
            $search_query .= " AND u.username LIKE '%" . $username_like_query . "%'";
        }
    }
    $query = $db->simple_select("users u", "COUNT(*) AS users", "{$search_query}");
    $num_users = $db->fetch_field($query, "users");
    $page = intval($mybb->input['page']);
    if ($page && $page > 0) {
        $start = ($page - 1) * $per_page;
    } else {
        $start = 0;
        $page = 1;
    }
    //$search_url = htmlspecialchars_uni($search_url);
    $multipage = multipage($num_users, $per_page, $page, $search_url);
    // Cache a few things
    $usergroups_cache = $cache->read('usergroups');
    $query = $db->simple_select("usertitles", "*", "", array('order_by' => 'posts', 'order_dir' => 'DESC'));
    while ($usertitle = $db->fetch_array($query)) {
        $usertitles_cache[$usertitle['posts']] = $usertitle;
    }
    $query = $db->query("\n\t\tSELECT u.*, f.*\n\t\tFROM " . TABLE_PREFIX . "users u\n\t\tLEFT JOIN " . TABLE_PREFIX . "userfields f ON (f.ufid=u.uid)\n\t\tWHERE {$search_query}\n\t\tORDER BY {$sort_field} {$sort_order}\n\t\tLIMIT {$start}, {$per_page}\n\t");
    while ($user = $db->fetch_array($query)) {
        //$user = $plugins->run_hooks("memberlist_user", $user);
        if (!$user['username']) {
            continue;
        }
        $user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
        if ($user['avatar'] != '') {
            $user['avatar'] = absolute_url($user['avatar']);
        } else {
            $user['avatar'] = "";
        }
        $users[] = $user;
    }
    $total = $num_users;
    if (!empty($users)) {
        foreach ($users as $user) {
            $return_user_lists[] = new xmlrpcval(array('username' => new xmlrpcval(basic_clean($user['username']), 'base64'), 'user_id' => new xmlrpcval($user['uid'], 'string'), 'icon_url' => new xmlrpcval($user['avatar'], 'string')), 'struct');
        }
    }
    $suggested_users = new xmlrpcval(array('total' => new xmlrpcval($total, 'int'), 'list' => new xmlrpcval($return_user_lists, 'array')), 'struct');
    return new xmlrpcresp($suggested_users);
}
Example #20
0
<?php

// The user is redirected here from user_home.php.
session_start();
// If no session is present, redirect the user:
if (!isset($_SESSION['user_id'])) {
    // Need the functions to create an absolute URL:
    require_once 'login_functions.php';
    $url = absolute_url();
    header("Location: {$url}");
    exit;
    // Quit the script.
} else {
    $usr_id = (int) $_SESSION['user_id'];
}
?>

<?php 
$PageName = 'My News Items';
require_once $_SERVER['DOCUMENT_ROOT'] . '/templates/_header_english.php';
?>

		<div id="Content">
<!-- ------------------------------------------- Content starts here ------------------------------------------------- -->

			<h1><?php 
echo "{$PageName}";
?>
</h1>
			
			<?php 
Example #21
0
function get_box_func($xmlrpc_params)
{
    global $db, $lang, $theme, $plugins, $mybb, $session, $settings, $cache, $time, $mybbgroups;
    $input = Tapatalk_Input::filterXmlInput(array('box_id' => Tapatalk_Input::INT, 'start_num' => Tapatalk_Input::INT, 'last_num' => Tapatalk_Input::INT), $xmlrpc_params);
    list($start, $limit) = process_page($input['start_num'], $input['last_num']);
    $lang->load("private");
    $parser = new postParser();
    if ($mybb->settings['enablepms'] == 0) {
        return xmlrespfalse($lang->pms_disabled);
    }
    if ($mybb->user['uid'] == '/' || $mybb->user['uid'] == 0 || $mybb->usergroup['canusepms'] == 0) {
        return tt_no_permission();
    }
    if (!$mybb->user['pmfolders']) {
        $mybb->user['pmfolders'] = "1**\$%%\$2**\$%%\$3**\$%%\$4**";
        $sql_array = array("pmfolders" => $mybb->user['pmfolders']);
        $db->update_query("users", $sql_array, "uid = " . $mybb->user['uid']);
    }
    $rand = my_rand(0, 9);
    if ($rand == 5) {
        update_pm_count();
    }
    $foldernames = array();
    $foldersexploded = explode("\$%%\$", $mybb->user['pmfolders']);
    foreach ($foldersexploded as $key => $folders) {
        $folderinfo = explode("**", $folders, 2);
        $folderinfo[1] = get_pm_folder_name($folderinfo[0], $folderinfo[1]);
        $foldernames[$folderinfo[0]] = $folderinfo[1];
    }
    if (!$input['box_id'] || !array_key_exists($input['box_id'], $foldernames)) {
        $input['box_id'] = 1;
    }
    $folder = $input['box_id'];
    $foldername = $foldernames[$folder];
    $lang->pms_in_folder = $lang->sprintf($lang->pms_in_folder, $foldername);
    if ($folder == 2 || $folder == 3) {
        $sender = $lang->sentto;
    } else {
        $sender = $lang->sender;
    }
    // Do Multi Pages
    $query = $db->simple_select("privatemessages", "COUNT(*) AS total", "uid='" . $mybb->user['uid'] . "' AND folder='{$folder}'");
    $count_total = $db->fetch_field($query, 'total');
    $query = $db->simple_select("privatemessages", "COUNT(*) AS unread", "uid='" . $mybb->user['uid'] . "' AND folder='{$folder}' AND readtime = 0");
    $count_unread = $db->fetch_field($query, 'unread');
    // Get all recipients into an array
    $cached_users = $get_users = array();
    $users_query = $db->simple_select("privatemessages", "recipients", "folder='{$folder}' AND uid='{$mybb->user['uid']}'", array('limit_start' => $start, 'limit' => $limit, 'order_by' => 'dateline', 'order_dir' => 'DESC'));
    while ($row = $db->fetch_array($users_query)) {
        $recipients = unserialize($row['recipients']);
        if (is_array($recipients['to']) && count($recipients['to'])) {
            $get_users = array_merge($get_users, $recipients['to']);
        }
        if (is_array($recipients['bcc']) && count($recipients['bcc'])) {
            $get_users = array_merge($get_users, $recipients['bcc']);
        }
    }
    $get_users = implode(',', array_unique($get_users));
    // Grab info
    if ($get_users) {
        $users_query = $db->simple_select("users", "uid, username, usergroup, displaygroup", "uid IN ({$get_users})");
        while ($user = $db->fetch_array($users_query)) {
            $cached_users[$user['uid']] = $user;
        }
    }
    $user_online = $folder == 1 ? ', fu.lastactive, fu.invisible, fu.lastvisit ' : ', tu.lastactive, tu.invisible, tu.lastvisit ';
    $query = $db->query("\n\t\tSELECT pm.*, fu.username AS fromusername, tu.username as tousername, fu.avatar as favatar, tu.avatar as tavatar {$user_online}\n\t\tFROM " . TABLE_PREFIX . "privatemessages pm\n\t\tLEFT JOIN " . TABLE_PREFIX . "users fu ON (fu.uid=pm.fromid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "users tu ON (tu.uid=pm.toid)\n\t\tWHERE pm.folder='{$folder}' AND pm.uid='" . $mybb->user['uid'] . "'\n\t\tORDER BY pm.dateline DESC\n\t\tLIMIT {$start}, {$limit}\n\t");
    $message_list = array();
    if ($db->num_rows($query) > 0) {
        while ($message = $db->fetch_array($query)) {
            $status = 1;
            if ($message['status'] == 0) {
                $msgalt = $lang->new_pm;
            } elseif ($message['status'] == 1) {
                $msgalt = $lang->old_pm;
                $status = 2;
            } elseif ($message['status'] == 3) {
                $msgalt = $lang->reply_pm;
                $status = 3;
            } elseif ($message['status'] == 4) {
                $msgalt = $lang->fwd_pm;
                $status = 4;
            }
            $msg_from = null;
            $msg_to = array();
            $avatar = "";
            $outboxdisplayuserid = 0;
            // Sent Items or Drafts Folder Check
            $recipients = unserialize($message['recipients']);
            if (count($recipients['to']) > 1 || count($recipients['to']) == 1 && count($recipients['bcc']) > 0) {
                foreach ($recipients['to'] as $uid) {
                    $profilelink = get_profile_link($uid);
                    $user = $cached_users[$uid];
                    if (!empty($user['username'])) {
                        $msg_to[] = new xmlrpcval(array("username" => new xmlrpcval($user['username'], "base64"), "user_id" => new xmlrpcval($uid, "string"), "user_type" => check_return_user_type($user['username'])), "struct");
                    }
                    if (($folder == 2 or $folder == 3) && !$outboxdisplayuserid) {
                        $outboxdisplayuserid = $uid;
                    }
                }
                /*if(is_array($recipients['bcc']) && count($recipients['bcc']))
                		{
                			foreach($recipients['bcc'] as $uid)
                			{
                				$profilelink = get_profile_link($uid);
                				$user = $cached_users[$uid];
                				$msg_to[]=new xmlrpcval($user['username'], "base64");
                			}
                		}*/
            } else {
                if ($message['toid']) {
                    $tofromusername = $message['tousername'];
                    $tofromuid = $message['toid'];
                    if (!empty($tofromusername)) {
                        $msg_to[] = new xmlrpcval(array("username" => new xmlrpcval($tofromusername, "base64"), "user_id" => new xmlrpcval($message['toid'], "string"), "user_type" => check_return_user_type($tofromusername)), "struct");
                    }
                }
            }
            $avatar = $message['tavatar'];
            if ($folder != 2 && $folder != 3) {
                $tofromusername = $message['fromusername'];
                $tofromuid = $message['fromid'];
                if ($tofromuid == 0) {
                    $tofromusername = $lang->mybb_engine;
                }
                if (!$tofromusername) {
                    $tofromuid = 0;
                    $tofromusername = $lang->na;
                }
                $msg_from = $tofromusername;
                $avatar = $message['favatar'];
            } else {
                if ($outboxdisplayuserid) {
                    $outboxdisplayuser = get_user($outboxdisplayuserid);
                    $avatar = $outboxdisplayuser['avatar'];
                }
            }
            if (!trim($message['subject'])) {
                $message['subject'] = $lang->pm_no_subject;
            }
            $is_online = false;
            $timecut = TIME_NOW - $mybb->settings['wolcutoff'];
            if ($message['lastactive'] > $timecut && ($message['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1) && $message['lastvisit'] != $message['lastactive']) {
                $is_online = true;
            }
            $new_message = array('msg_id' => new xmlrpcval($message['pmid'], 'string'), 'msg_state' => new xmlrpcval($status, 'int'), 'sent_date' => new xmlrpcval(mobiquo_iso8601_encode($message['dateline']), 'dateTime.iso8601'), 'msg_to' => new xmlrpcval($msg_to, 'array'), 'icon_url' => new xmlrpcval(absolute_url($avatar), 'string'), 'msg_subject' => new xmlrpcval($message['subject'], 'base64'), 'short_content' => new xmlrpcval(process_short_content($message['message'], $parser), 'base64'), 'is_online' => new xmlrpcval($is_online, 'boolean'));
            if ($msg_from !== null) {
                $new_message['msg_from'] = new xmlrpcval($msg_from, 'base64');
            }
            $message_list[] = new xmlrpcval($new_message, "struct");
        }
    }
    $result = new xmlrpcval(array('result' => new xmlrpcval(true, 'boolean'), 'result_text' => new xmlrpcval('', 'base64'), 'total_message_count' => new xmlrpcval($count_total, 'int'), 'total_unread_count' => new xmlrpcval($count_unread, 'int'), 'list' => new xmlrpcval($message_list, 'array')), 'struct');
    return new xmlrpcresp($result);
}
Example #22
0
         break;
     case "decreases":
         $change_text = "decreased";
         break;
     case "decreases_by":
         $change_text = "decreased by at least " . number_format_human($notification['trigger_value']) . ($notification['is_percent'] ? '%' : " " . $value_label);
         break;
     case "below":
         $change_text = "decreased below " . number_format_human($notification['trigger_value']) . " " . $value_label;
         break;
     default:
         throw new JobException("Unknown trigger condition for change text: '" . $notification['trigger_condition'] . "'");
 }
 // send the email
 if ($user['email']) {
     $args = array("name" => $user['name'] ? $user['name'] : $user['email'], "url" => absolute_url(url_for('wizard_notifications')), "profile" => absolute_url(url_for('profile')), "last_value" => number_format_human($notification['last_value']), "current_value" => number_format_human($current_value), "value_label" => $value_label, "value_delta" => number_format_human($value_delta), "percent" => $percent === null ? "infinite%" : number_format_human($percent * 100, -1), "change_text" => $change_text, "period" => $notification['period']);
     switch ($notification['notification_type']) {
         case "ticker":
             $email_template = 'notification_ticker';
             $args += array("exchange" => get_exchange_name($account['exchange']), "currency1" => get_currency_abbr($account['currency1']), "currency2" => get_currency_abbr($account['currency2']));
             break;
         case "summary_instance":
             $email_template = 'notification_summary_instance';
             if (substr($account['summary_type'], 0, strlen('totalmh_')) == 'totalmh_') {
                 $currency = substr($account['summary_type'], strlen('totalmh_'));
                 $args += array("label" => "total " . get_currency_abbr($currency) . " hashrate");
             } else {
                 if (substr($account['summary_type'], 0, strlen('total')) == 'total') {
                     $currency = substr($account['summary_type'], strlen('total'));
                     $args += array("label" => "total " . get_currency_abbr($currency));
                 } else {
Example #23
0
 * @modifications Cyril Maguire
 */
/* Gutama plugin package
 * @version 1.6
 * @date	01/10/2013
 * @author	Cyril MAGUIRE
*/
include 'inc/gutuma.php';
if ($_SESSION['profil'] != PROFIL_ADMIN) {
    header('Location:compose.php');
    exit;
}
gu_init();
gu_theme_start();
$lists = gu_list::get_all(FALSE, FALSE);
$script_import = '<script type="text/javascript" src="' . absolute_url('js/gadgets.js.php') . '"></script>';
$gadget_type = is_post_var('gadget_type') ? get_post_var('gadget_type') : '';
$generate = is_post_var('gadget_generate') && $gadget_type != '';
// Default to first list if one exists
$example_list_id = count($lists) > 0 ? $lists[0]->get_id() : 0;
if ($generate) {
    $gadget_list = is_post_var('gadget_list') ? get_post_var('gadget_list') : $example_list_id;
    switch ($gadget_type) {
        case 'basic_link':
            $gadget_text = is_post_var('gadget_text') ? get_post_var('gadget_text') : t('Subscribe to my newsletter');
            $script_create = 'gu_gadgets_create_basic_link(' . $gadget_list . ', "' . $gadget_text . '")';
            $script_write = '<script type="text/javascript">gu_gadgets_write_basic_link(' . $gadget_list . ', "' . $gadget_text . '")</script>';
            $gadget_params = array('list', 'text');
            $gadget_requires_import = FALSE;
            break;
        case 'basic_form':
 /**
  * Queue header scripts
  *
  * Queues script libraries and stylesheets to include in header
  *
  * @return null
  */
 public function viewerHead($params)
 {
     $libUrl = absolute_url('plugins/MultimediaDisplay/libraries/openseadragon/');
     $libUrl = str_replace('admin/', '', $libUrl);
     queue_js_url($libUrl . 'openseadragon.min.js');
 }
Example #25
0
 /**
  * Create a absolute URI containing the current query string.
  *
  * @return string
  */
 protected function _buildUrl()
 {
     $uri = Zend_Uri::factory(absolute_url());
     $uri->setQuery($_GET);
     return $uri->getUri();
 }
Example #26
0
<?php

session_start();
require_once './modules/objects/Customer.php';
require_once './modules/objects/Mechanic.php';
$user = unserialize($_SESSION['user']);
if ($user == null || $user->type != "C") {
    require_once './modules/login_functions.php';
    $url = absolute_url("noLogin.php?type=C");
    header("Location: {$url}");
    exit;
}
?>
<!DOCTYPE.php PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/.php1/DTD/.php1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text.php; charset=utf-8" />
<title>Chicago Auto Hobby Shop</title>
<link href="styles/default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">	
<?php 
echo "<div id='loggedInBox'>" . date('F j, Y') . "<br />";
echo "Logged in as <strong>" . $user->username . "</strong>";
echo "<br /><strong><a style='color:#999;' href='logout.php'>Logout</a></strong></div>";
?>
	<div id="header">
		<h1><a href="index.php">chicago auto hobby shop </a></h1>
		<h2>do it yourself!</h2>
 /**
  * Implements failing tables; if an account type fails multiple times,
  * then send the user an email and disable the account.
  * @see OpenclerkJobQueuer#getStandardJobs()
  */
 function failed(\Exception $runtime_exception, Connection $db, Logger $logger)
 {
     // is this a standard job?
     $standard = $this->findStandardJob();
     if ($standard) {
         $logger->info("Using standard job " . print_r($standard, true));
         if (!$standard['failure']) {
             $logger->info("Not a failure standard job");
             return;
         }
     } else {
         return;
     }
     $failing_table = $standard['table'];
     $job = $this->job;
     // find the relevant account_data for this standard job
     $account_data = false;
     foreach (account_data_grouped() as $label => $group) {
         foreach ($group as $exchange => $data) {
             if (isset($data['job_type']) && $job['job_type'] == $data['job_type']) {
                 $account_data = $data;
                 $account_data['exchange'] = $exchange;
                 break;
             }
         }
     }
     if (!$account_data) {
         $logger->warn("Could not find any account data for job type '" . $job['job_type'] . "'");
     }
     $logger->info("Using account data " . print_r($account_data, true));
     // don't count CloudFlare as a failure
     if ($runtime_exception instanceof CloudFlareException || $runtime_exception instanceof \Openclerk\Apis\CloudFlareException) {
         $logger->info("Not increasing failure count: was a CloudFlareException");
     } else {
         if ($runtime_exception instanceof IncapsulaException || $runtime_exception instanceof \Openclerk\Apis\IncapsulaException) {
             $logger->info("Not increasing failure count: was a IncapsulaException");
         } else {
             if ($runtime_exception instanceof BlockchainException || $runtime_exception instanceof \Core\BlockchainException) {
                 $logger->info("Not increasing failure count: was a BlockchainException");
             } else {
                 $q = $db->prepare("UPDATE {$failing_table} SET failures=failures+1,first_failure=IF(ISNULL(first_failure), NOW(), first_failure) WHERE id=?");
                 $q->execute(array($job['arg_id']));
                 $logger->info("Increasing account failure count");
             }
         }
     }
     $user = get_user($job['user_id']);
     if (!$user) {
         $logger->info("Warning: No user " . $job['user_id'] . " found");
     } else {
         // failed too many times?
         $q = $db->prepare("SELECT * FROM {$failing_table} WHERE id=? LIMIT 1");
         $q->execute(array($job['arg_id']));
         $account = $q->fetch();
         $logger->info("Current account failure count: " . number_format($account['failures']));
         if ($account['failures'] >= get_premium_value($user, 'max_failures')) {
             // disable it and send an email
             $q = $db->prepare("UPDATE {$failing_table} SET is_disabled=1 WHERE id=?");
             $q->execute(array($job['arg_id']));
             crypto_log(print_r($account_data, true));
             if ($user['email'] && !$account['is_disabled']) {
                 $email_type = $job['job_type'] == "notification" ? "failure_notification" : "failure";
                 send_user_email($user, $email_type, array("name" => $user['name'] ? $user['name'] : $user['email'], "exchange" => get_exchange_name($account_data['exchange']), "label" => $account_data['label'], "labels" => $account_data['labels'], "failures" => number_format($account['failures']), "message" => $runtime_exception->getMessage(), "length" => recent_format(strtotime($account['first_failure']), "", ""), "title" => isset($account['title']) && $account['title'] ? "\"" . $account['title'] . "\"" : "untitled", "url" => absolute_url(url_for("wizard_accounts"))));
                 $logger->info("Sent failure e-mail to " . htmlspecialchars($user['email']) . ".");
             }
         }
     }
 }
 protected function _sendConfirmationEmail($user, $token)
 {
     $siteTitle = get_option('site_title');
     $url = WEB_ROOT . '/guest-user/user/confirm/token/' . $token->token;
     $siteUrl = absolute_url('/');
     $subject = __("Your request to join %s", $siteTitle);
     $body = __("You have registered for an account on %s. Please confirm your registration by following %s.  If you did not request to join %s please disregard this email.", "<a href='{$siteUrl}'>{$siteTitle}</a>", "<a href='{$url}'>" . __('this link') . "</a>", $siteTitle);
     if (get_option('guest_user_instant_access') == 1) {
         $body .= "<p>" . __("You have temporary access to %s for twenty minutes. You will need to confirm your request to join after that time.", $siteTitle) . "</p>";
     }
     $mail = $this->_getMail($user, $body, $subject);
     try {
         $mail->send();
     } catch (Exception $e) {
         _log($e);
     }
 }
Example #29
0
function tt_login_success()
{
    global $db, $lang, $theme, $plugins, $mybb, $session, $settings, $cache, $time, $mybbgroups, $mobiquo_config, $user, $register;
    if ($user['coppauser']) {
        error($lang->error_awaitingcoppa);
    }
    my_setcookie('loginattempts', 1);
    $db->delete_query("sessions", "ip='" . $db->escape_string($session->ipaddress) . "' AND sid != '" . $session->sid . "'");
    $newsession = array("uid" => $user['uid']);
    $db->update_query("sessions", $newsession, "sid='" . $session->sid . "'");
    $db->update_query("users", array("loginattempts" => 1), "uid='{$user['uid']}'");
    my_setcookie("mybbuser", $user['uid'] . "_" . $user['loginkey'], null, true);
    my_setcookie("sid", $session->sid, -1, true);
    $mybb->cookies['sid'] = $session->sid;
    $session = new session();
    $session->init();
    $mybbgroups = $mybb->user['usergroup'];
    if ($mybb->user['additionalgroups']) {
        $mybbgroups .= ',' . $mybb->user['additionalgroups'];
    }
    $groups = explode(",", $mybbgroups);
    $xmlgroups = array();
    foreach ($groups as $group) {
        $xmlgroups[] = new xmlrpcval($group, "string");
    }
    tt_update_push();
    if ($settings['maxattachments'] == 0) {
        $settings['maxattachments'] = 100;
    }
    $userPushType = array('pm' => 1, 'newtopic' => 1, 'sub' => 1, 'tag' => 1, 'quote' => 1);
    $push_type = array();
    foreach ($userPushType as $name => $value) {
        $push_type[] = new xmlrpcval(array('name' => new xmlrpcval($name, 'string'), 'value' => new xmlrpcval($value, 'boolean')), 'struct');
    }
    if ($mybb->settings['postfloodsecs'] && !is_moderator(0, "", $mybb->user['uid'])) {
        $flood_interval = $mybb->settings['postfloodsecs'];
    }
    $result = array('result' => new xmlrpcval(true, 'boolean'), 'result_text' => new xmlrpcval('', 'base64'), 'user_id' => new xmlrpcval($mybb->user['uid'], 'string'), 'username' => new xmlrpcval(basic_clean($mybb->user['username']), 'base64'), 'login_name' => new xmlrpcval(basic_clean($mybb->user['username']), 'base64'), 'user_type' => check_return_user_type($mybb->user['username']), 'email' => new xmlrpcval(basic_clean($mybb->user['email']), 'base64'), 'icon_url' => new xmlrpcval(absolute_url($mybb->user['avatar']), 'string'), 'post_count' => new xmlrpcval(intval($mybb->user['postnum']), 'int'), 'usergroup_id' => new xmlrpcval($xmlgroups, 'array'), 'ignored_uids' => new xmlrpcval($mybb->user['ignorelist'], 'string'), 'max_png_size' => new xmlrpcval(10000000, "int"), 'max_jpg_size' => new xmlrpcval(10000000, "int"), 'max_attachment' => new xmlrpcval($mybb->usergroup['canpostattachments'] == 1 ? $settings['maxattachments'] : 0, "int"), 'can_upload_avatar' => new xmlrpcval($mybb->usergroup['canuploadavatars'] == 1, "boolean"), 'can_pm' => new xmlrpcval($mybb->usergroup['canusepms'] == 1 && !$mobiquo_config['disable_pm'], "boolean"), 'can_send_pm' => new xmlrpcval($mybb->usergroup['cansendpms'] == 1 && !$mobiquo_config['disable_pm'], "boolean"), 'can_moderate' => new xmlrpcval($mybb->usergroup['canmodcp'] == 1, "boolean"), 'can_search' => new xmlrpcval($mybb->usergroup['cansearch'] == 1, "boolean"), 'can_whosonline' => new xmlrpcval($mybb->usergroup['canviewonline'] == 1, "boolean"), 'register' => new xmlrpcval($register, "boolean"), 'push_type' => new xmlrpcval($push_type, 'array'), 'post_countdown' => new xmlrpcval($flood_interval, 'int'));
    if ($mybb->usergroup['isbannedgroup'] == 1) {
        // Fetch details on their ban
        $query = $db->simple_select("banned", "*", "uid='{$mybb->user['uid']}'", array('limit' => 1));
        $ban = $db->fetch_array($query);
        if ($ban['uid']) {
            // Format their ban lift date and reason appropriately
            if ($ban['lifted'] > 0) {
                $banlift = my_date($mybb->settings['dateformat'], $ban['lifted']) . ", " . my_date($mybb->settings['timeformat'], $ban['lifted']);
            } else {
                $banlift = $lang->banned_lifted_never;
            }
            $reason = htmlspecialchars_uni($ban['reason']);
        }
        if (empty($reason)) {
            $reason = $lang->unknown;
        }
        if (empty($banlift)) {
            $banlift = $lang->unknown;
        }
        $result_text = $lang->banned_warning . $lang->banned_warning2 . ": " . $reason . "\n" . $lang->banned_warning3 . ": " . $banlift;
        $result['result_text'] = new xmlrpcval($result_text, 'base64');
    }
    return new xmlrpcresp(new xmlrpcval($result, 'struct'));
}
Example #30
0
_e("Your temporary password is:");
?>
 

<?php 
echo $password;
?>
 


<?php 
_e("You can login here");
?>
:
<?php 
echo absolute_url('User_Auth', 'login');
?>
 
 
<?php 
_e("After you login, we recommend you change your password by editing your profile.");
?>
 
<?php 
_e("If you run into any difficulty with the new login details please contact us.");
?>
 

<?php 
_e('Thanks');
?>