Пример #1
0
function set_default($setting_key)
{
    global $phpEx, $wpuAbs, $phpbb_root_path, $phpEx;
    require_once $phpbb_root_path . 'wp-united/wpu-helper-funcs.' . $phpEx;
    $server = add_http(add_trailing_slash($wpuAbs->config('server_name')));
    $scriptPath = add_trailing_slash($wpuAbs->config('script_path'));
    $scriptPath = $scriptPath[0] == "/" ? substr($scriptPath, 1) : $scriptPath;
    $defaultBlogUri = $server . $scriptPath . "blog." . $phpEx;
    $defaults = array('blogsUri' => $defaultBlogUri, 'wpUri' => '', 'wpPath' => '', 'integrateLogin' => 0, 'permList' => $wpuAbs->ver == 'PHPBB3' ? '' : '<S:><C:><A:>PHPBB:[USER]<E:>PHPBB:[MOD]</:>PHPBB:[ADMIN]', 'showHdrFtr' => 'FWD', 'cssFirst' => 0, 'wpSimpleHdr' => 1, 'dtdSwitch' => 0, 'installLevel' => 0, 'usersOwnBlogs' => 0, 'buttonsProfile' => 0, 'buttonsPost' => 0, 'allowStyleSwitch' => 0, 'useBlogHome' => 0, 'blogListHead' => $wpuAbs->lang('WPWiz_BlogListHead_Default'), 'blogIntro' => $wpuAbs->lang('WPWiz_blogIntro_Default'), 'blogsPerPage' => 6, 'blUseCSS' => 1, 'charEncoding' => $wpuAbs->ver == 'PHPBB3' ? 'NO_CHANGE' : 'MATCH_WP', 'phpbbCensor' => 1, 'wpuVersion' => $wpuAbs->lang('WPU_Not_Installed'), 'wpPageName' => 'page.php', 'phpbbPadding' => $wpuAbs->ver == 'PHPBB3' ? '0-0-0-0' : '20-20-20-20', 'mustLogin' => 0, 'upgradeRun' => 0, 'xposting' => 0, 'phpbbSmilies' => 0, 'fixHeader' => 1, 'wpuAutolinkingXpost' => 0);
    return $defaults[$setting_key];
}
Пример #2
0
 function fill_in_additional_list_fields()
 {
     global $mod_strings, $current_language;
     $mod_strings = return_module_language($current_language, 'TeamNotices');
     if (isset($this->description)) {
         $this->description = str_replace("\r\n", "<br>", $this->description);
         $this->description = str_replace("\n", "<br>", $this->description);
     }
     if (isset($this->url) && !empty($this->url)) {
         $this->url = add_http($this->url);
         if (!isset($this->url_title) || empty($this->url_title)) {
             $this->url_title = $this->url;
         }
     }
     $this->status = isset($mod_strings['dom_status'][$this->status]) ? $mod_strings['dom_status'][$this->status] : '';
     $this->fill_in_additional_detail_fields();
 }
Пример #3
0
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by SugarCRM".
 ********************************************************************************/
global $mod_strings;
global $app_list_strings;
global $app_strings;
global $theme;
global $current_user;
global $currentModule;
switch ($_REQUEST['view']) {
    case "support_portal":
        if (!is_admin($current_user)) {
            sugar_die("Unauthorized access to administration.");
        }
        $GLOBALS['log']->info("Administration SupportPortal");
        $iframe_url = add_http("www.sugarcrm.com/network/redirect.php?tmpl=network");
        $mod_title = $mod_strings['LBL_SUPPORT_TITLE'];
        echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_title, true);
        $sugar_smarty = new Sugar_Smarty();
        $sugar_smarty->assign('iframeURL', $iframe_url);
        echo $sugar_smarty->fetch('modules/Administration/SupportPortal.tpl');
        break;
    default:
        $send_version = isset($_REQUEST['version']) ? $_REQUEST['version'] : "";
        $send_edition = isset($_REQUEST['edition']) ? $_REQUEST['edition'] : "";
        $send_lang = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : "";
        $send_module = isset($_REQUEST['help_module']) ? $_REQUEST['help_module'] : "";
        $send_action = isset($_REQUEST['help_action']) ? $_REQUEST['help_action'] : "";
        $send_key = isset($_REQUEST['key']) ? $_REQUEST['key'] : "";
        $send_anchor = '';
        // awu: Fixes the ProjectTasks pluralization issue -- must fix in later versions.
Пример #4
0
    die("cURL extension is not loaded!");
}
// how are our URLs be generated from this point? this must be set here so the proxify_url function below can make use of it
if (Config::get('url_mode') == 1) {
    Config::set('encryption_key', md5(Config::get('app_key') . $_SERVER['REMOTE_ADDR']));
} else {
    if (Config::get('url_mode') == 2) {
        Config::set('encryption_key', md5(Config::get('app_key') . session_id()));
    }
}
// very important!!! otherwise requests are queued while waiting for session file to be unlocked
session_write_close();
// form submit in progress...
if (isset($_POST['url'])) {
    $url = $_POST['url'];
    $url = add_http($url);
    header("HTTP/1.1 302 Found");
    header('Location: ' . proxify_url($url));
    exit;
} else {
    if (!isset($_GET['q'])) {
        // must be at homepage - should we redirect somewhere else?
        if (Config::get('index_redirect')) {
            // redirect to...
            header("HTTP/1.1 302 Found");
            header("Location: " . Config::get('index_redirect'));
        } else {
            echo render_template("./templates/main.php", array('version' => Proxy::VERSION));
        }
        exit;
    }
Пример #5
0
}
$original_row = array_merge($original_row, $row);
$original_row['currency_id'] = !empty($original_row['currency_id']) ? $original_row['currency_id'] : $_SESSION['members']['currency']['id'];
$currency_data = get_currency_information($original_row['currency_id']);
$client_id = $original_row['client_id'];
$account_descriptive_name = $original_row['account_descriptive_name'];
$template_data['product_data_id'] = $product_data_id;
$template_data['year_period_start_date'] = $year_period_start_date;
$template_data['year_period_end_date'] = $year_period_end_date;
$template_data['client_id'] = $client_id;
$template_data['report_month'] = $report_month;
$template_data['report_year'] = $report_year;
$template_data['base_product_link'] = "../details/?id={$product_data_id}";
// header information
$template_data['domain_name'] = $original_row['ad_links'];
$template_data['ad_links'] = add_http($original_row['ad_links']);
$template_data['monthly_budget'] = $original_row['monthly_budget'] > 0 ? number_format($original_row['monthly_budget'], 2, '.', ',') : ($original_row['current_monthly_budget'] > 0 ? number_format($original_row['current_monthly_budget'], 2, '.', ',') : '0.00');
$template_data['monthly_balance'] = date('Y-m') == date('Y-m', mktime(0, 0, 0, $report_month, 1, $report_year)) ? number_format($original_row['balance'], 2, '.', ',') : '0.00';
$template_data['currency_symbol'] = $currency_data['symbol'];
$template_data['monthly_spend'] = $original_row['monthly_spend'] ? number_format($original_row['monthly_spend'], 2, '.', ',') : '0.00';
$template_data['monthly_clicks'] = $original_row['total_clicks'] ? number_format($original_row['total_clicks'], 0, '.', ',') : 0;
$template_data['monthly_impressions'] = $original_row['total_impressions'] ? number_format($original_row['total_impressions'], 0, '.', ',') : 0;
$template_data['domain_name_title'] = base::truncate_middle_text($original_row['ad_links'], 37);
if (strlen($template_data['domain_name']) > 35) {
    $template_data['domain_icon_title'] = $template_data['domain_name'];
}
$template_data['product_icon_class'] = 'iconFontGoogleAdvertising';
// data for info_boxes.tpl
$template_data['clicks'] = $template_data['monthly_clicks'];
$template_data['monthly_budget_currency_symbol'] = $currency_data['symbol'];
$template_data['monthly_spend_currency_symbol'] = $currency_data['symbol'];
Пример #6
0
 * "Powered by SugarCRM".
 ********************************************************************************/
/*********************************************************************************
 ********************************************************************************/
global $theme, $current_user;
global $mod_strings;
global $app_list_strings;
global $app_strings;
global $current_user, $focus;
echo get_module_title($mod_strings['LBL_MODULE_ID'], $mod_strings['LBL_MODULE_TITLE'], true);
if (!empty($_REQUEST['record']) && empty($_REQUEST['edit'])) {
    $iFrame = new iFrame();
    $iFrame->retrieve($_REQUEST['record']);
    $xtpl = new XTemplate('modules/iFrames/DetailView.html');
    $xtpl_data = $iFrame->get_xtemplate_data();
    $xtpl_data['URL'] = add_http($xtpl_data['URL']);
    $xtpl->assign('IFRAME', $xtpl_data);
    $xtpl->parse('main');
    $xtpl->out('main');
} else {
    if (!empty($_REQUEST['edit'])) {
        $iFrame = new iFrame();
        $xtpl = new XTemplate('modules/iFrames/EditView.html');
        if (!empty($_REQUEST['record'])) {
            $iFrame->retrieve($_REQUEST['record']);
        }
        $xtpl_data = $iFrame->get_xtemplate_data();
        $xtpl->assign("MOD", $mod_strings);
        $xtpl->assign("APP", $app_strings);
        if (isset($_REQUEST['return_module'])) {
            $xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']);
Пример #7
0
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 * 
 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by SugarCRM".
 ********************************************************************************/
global $mod_strings;
global $app_list_strings;
global $app_strings;
global $current_language;
global $sugar_config;
global $sugar_flavor;
global $sugar_version;
$send_version = isset($sugar_version) ? $sugar_version : "";
$send_edition = isset($sugar_flavor) ? $sugar_flavor : "";
$send_lang = isset($current_language) ? $current_language : "";
$send_key = isset($sugar_config['unique_key']) ? $sugar_config['unique_key'] : "";
$sugar_smarty = new Sugar_Smarty();
$iframe_url = add_http("www.sugarcrm.com/network/redirect.php?to=training&tmpl=network&version={$send_version}&edition={$send_edition}&language={$send_lang}&key={$send_key}");
$sugar_smarty->assign('iframeURL', $iframe_url);
echo $sugar_smarty->fetch('modules/Home/TrainingPortal.tpl');
Пример #8
0
function proxify_url($url, $base_url = '')
{
    $url = htmlspecialchars_decode($url);
    if ($base_url) {
        $base_url = add_http($base_url);
        $url = rel2abs($url, $base_url);
    }
    return app_url() . '?q=' . url_encrypt($url);
}
Пример #9
0
function twitter_parse_tags($input, $entities = false, $id = false)
{
    // Filter
    if ($id && substr($_GET["q"], 0, 6) !== "status" && setting_fetch('filtero', 'no') == 'yes' && twitter_timeline_filter($input)) {
        return "<a href='status/{$id}' class='filter'><span class='texts'>[Tweet Filtered]</span></a>";
    }
    $out = $input;
    //Linebreaks.  Some clients insert \n for formatting.
    $out = nl2br($out);
    // Use the Entities to replace hyperlink URLs
    // http://dev.twitter.com/pages/tweet_entities
    if ($entities) {
        if ($entities->urls) {
            foreach ($entities->urls as $urls) {
                if ($urls->display_url != "") {
                    $display_url = $urls->display_url;
                } else {
                    $display_url = $urls->url;
                }
                $expanded_url = $urls->expanded_url ? $urls->expanded_url : $urls->url;
                $expanded_url = add_http($expanded_url);
                $lurl = setting_fetch('longurl') == 'yes' && LONG_URL == 'ON' ? long_url($expanded_url) : $expanded_url;
                if (setting_fetch('gwt') == 'on') {
                    $encoded = urlencode($lurl);
                    $link = "http://google.com/gwt/n?u={$encoded}";
                } else {
                    $link = $lurl;
                }
                $atext = link_trans($display_url);
                $link_html = '<a href="' . $link . '" rel="external nofollow noreferrer">' . $atext . '</a>';
                $url = $urls->url;
                // Replace all URLs *UNLESS* they have already been linked (for example to an image)
                $pattern = '#((?<!href\\=(\'|\\"))' . preg_quote($url, '#') . ')#i';
                $out = preg_replace($pattern, $link_html, $out);
            }
        }
        if ($entities->hashtags) {
            foreach ($entities->hashtags as $hashtag) {
                $text = $hashtag->text;
                $pattern = '/(^|\\s)([##]+)(' . $text . ')/iu';
                $link_html = ' <a href="hash/' . $text . '" rel="external nofollow tag noreferrer" class="hashtag">#' . $text . '</a> ';
                $out = preg_replace($pattern, $link_html, $out, 1);
            }
        }
    } else {
        // If Entities haven't been returned (usually because of search or a bio) use Autolink
        // Create an array containing all URLs
        $urls = Twitter_Extractor::create($input)->extractURLs();
        // Hyperlink the URLs
        if (setting_fetch('gwt') == 'on') {
            foreach ($urls as $url) {
                if (setting_fetch('longurl') == 'yes' && LONG_URL == 'ON') {
                    $lurl = long_url($url);
                } else {
                    $lurl = $url;
                }
                $encoded = urlencode($lurl);
                $atext = link_trans($lurl);
                $out = str_replace($url, "<a href='http://google.com/gwt/n?u={$encoded}' rel='external nofollow noreferrer'>{$atext}</a>", $out);
            }
        } else {
            $out = Twitter_Autolink::create($out)->setTarget('')->setTag('')->addLinksToURLs();
            foreach ($urls as $url) {
                if (setting_fetch('longurl') == 'yes' && LONG_URL == 'ON') {
                    $lurl = long_url($url);
                    $out = str_replace('href="' . $url . '"', 'href="' . $lurl . '"', $out);
                } else {
                    $lurl = $url;
                }
                $atext = link_trans($lurl);
                $out = str_replace(">{$url}</a>", ">{$atext}</a>", $out);
            }
        }
        // Hyperlink the #
        $out = Twitter_Autolink::create($out)->setTarget('')->addLinksToHashtags();
    }
    // Hyperlink the @ and lists
    $out = Twitter_Autolink::create($out)->setTarget('')->setTag('')->addLinksToUsernamesAndLists();
    // Emails
    $tok = strtok($out, " \n\t\n\r");
    // Tokenise the string by whitespace
    while ($tok !== false) {
        // Go through all the tokens
        $at = stripos($tok, "@");
        // Does the string contain an "@"?
        if ($at && $at > 0) {
            // @ is in the string & isn't the first character
            $tok = trim($tok, "?.,!\"\\'");
            // Remove any trailing punctuation
            if (filter_var($tok, FILTER_VALIDATE_EMAIL)) {
                // Use the internal PHP email validator
                $email = $tok;
                $out = str_replace($email, "<a href=\"mailto:{$email}\">{$email}</a>", $out);
                // Create the mailto: link
            }
        }
        $tok = strtok(" \n\t\n\r");
        // Move to the next token
    }
    //Return the completed string
    return $out;
}
        if ($send_module == 'TargetLists') {
            $send_module = 'ProspectLists';
        }
        if ($send_module == 'Targets') {
            $send_module = 'Prospects';
        }
        $helpPath = 'modules/' . $send_module . '/language/' . $send_lang . '.help.' . $send_action . '.html';
        $sugar_smarty = new Sugar_Smarty();
        if (file_exists($helpPath)) {
            $sugar_smarty->assign('helpFileExists', TRUE);
            $sugar_smarty->assign('helpPath', $helpPath);
            $sugar_smarty->assign('helpBar', getHelpBar($send_module));
            $sugar_smarty->assign('bookmarkScript', bookmarkJS());
        } else {
            $sugar_smarty->assign('helpFileExists', FALSE);
            $iframe_url = add_http("www.sugarcrm.com/network/help.php?version={$send_version}&edition={$send_edition}&lang={$send_lang}&module={$send_module}&action={$send_action}&key={$send_key}");
            $sugar_smarty->assign('iframeURL', $iframe_url);
        }
        $sugar_smarty->assign('title', $mod_strings['LBL_SUGARCRM_HELP'] . " - " . $send_module);
        $sugar_smarty->assign('styleSheet', SugarThemeRegistry::current()->getCSS());
        $sugar_smarty->assign('table', getTable());
        $sugar_smarty->assign('endtable', endTable());
        $sugar_smarty->assign('charset', $app_strings['LBL_CHARSET']);
        echo $sugar_smarty->fetch('modules/Administration/SupportPortal.tpl');
        break;
}
function getHelpBar($moduleName)
{
    global $mod_strings;
    $helpBar = "<table width='100%'><tr><td align='right'>" . "<a href='javascript:window.print()'>" . $mod_strings['LBL_HELP_PRINT'] . "</a> - " . "<a href='mailto:?subject=" . $mod_strings['LBL_SUGARCRM_HELP'] . "&body=" . rawurlencode(getCurrentURL()) . "'>" . $mod_strings['LBL_HELP_EMAIL'] . "</a> - " . "<a href='#' onmousedown=\"createBookmarkLink('" . $mod_strings['LBL_SUGARCRM_HELP'] . " - " . $moduleName . "', '" . getCurrentURL() . "'" . ")\">" . $mod_strings['LBL_HELP_BOOKMARK'] . "</a>" . "</td></tr></table>";
    return $helpBar;
Пример #11
0
// What mode shall we run the integration in? latest posts or normal?
$wpuNoHead = false;
$latest = false;
if (isset($HTTP_GET_VARS['latest'])) {
    $latest = true;
    // run in latest posts mode, for showing latest posts on portal page, etc.
    $wpuNoHead = true;
}
// number of posts to show on portal page in latest posts mode
if (isset($HTTP_GET_VARS['numposts'])) {
    $postsToShow = (int) $HTTP_GET_VARS['numposts'];
    $postsToShow = $postsToShow > 10 ? 10 : $postsToShow;
    $postsToShow = $postsToShow < 1 ? 3 : $postsToShow;
}
// These will be useful later on
$server = add_http(add_trailing_slash($wpuAbs->config('server_name')));
$scriptPath = add_trailing_slash($wpuAbs->config('script_path'));
$scriptPath = $scriptPath[0] == "/" ? substr($scriptPath, 1) : $scriptPath;
$scriptPath = $server . $scriptPath;
// set some strings for the blogs home page. This needs to be moved out.
if ($phpbb_logged_in) {
    if ($wpuAbs->userdata('user_wpublog_id')) {
        $wpuGetBlog = $wpSettings['usersOwnBlogs'] ? $wpuAbs->lang('add_to_blog') : $wpuAbs->lang('go_wp_admin');
        $wpuGetBlogIntro = $wpuAbs->lang('blog_intro_add');
    } else {
        $wpuGetBlog = $wpSettings['usersOwnBlogs'] ? $wpuAbs->lang('get_blog') : $wpuAbs->lang('go_wp_admin');
        $wpuGetBlogIntro = $wpuAbs->lang('blog_intro_get');
    }
} else {
    $wpuGetBlogIntro = $wpSettings['usersOwnBlogs'] ? $wpuAbs->lang('blog_intro_loginreg_ownblogs') : $wpuAbs->lang('blog_intro_loginreg');
}
Пример #12
0
 $short_desc = utf8_normalize_nfc(request_var('short_desc', '', true));
 $price = str_replace(',', '.', request_var('ad_price', ''));
 $price_text = request_var('ad_price_text', 0);
 $cat = request_var('cat', '', true);
 $prefix_id = request_var('ad_prefix_id', 0);
 $location_id = request_var('ad_location_id', 0);
 $notify_comments = request_var('notify_comments', 0);
 $phone = request_var('phone', '');
 $paypal = request_var('paypal', '');
 $ad_currency = request_var('ad_currency', '', true);
 $agree_rules = request_var('agree_rules', 0);
 $now = time();
 $ad_description = utf8_normalize_nfc(request_var('message', '', true));
 $uid = $bitfield = $options = '';
 $allow_bbcode = $allow_urls = $allow_smilies = true;
 $thumb = add_http(request_var('thumb', ''));
 // check for errors
 $error = array();
 if (!$ad_title) {
     $error[] = $user->lang['CL_NO_TITLE'];
 }
 if (!$short_desc) {
     $error[] = $user->lang['CL_NO_SHORT_DESC'];
 }
 if ($price_text == 0) {
     if ($price == '') {
         $error[] = $user->lang['CL_NO_PRICE'];
     }
     if ($price && !is_numeric($price)) {
         $error[] = $user->lang['CL_NO_PRICE_NUMERIC'];
     }