function getCallbackURL($callbackPage)
{
    $urlbase = curPageURL();
    $urlbase = substr($urlbase, 0, strrpos($urlbase, '/'));
    $urlbase = $urlbase . "/" . $callbackPage;
    return $urlbase;
}
Beispiel #2
0
function write_log($logfile = 'log.txt')
{
    if (($time = $_SERVER['REQUEST_TIME']) == '') {
        $time = time();
    }
    if (($remote_addr = $_SERVER['REMOTE_ADDR']) == '') {
        $remote_addr = "REMOTE_ADDR_UNKNOWN";
    }
    $date = date("Y-m-d H:i:s", $time);
    if ($fd = @fopen($logfile, "a")) {
        fputs($fd, "-------------\r\n");
        $result = fputcsv($fd, array($date, $remote_addr, curPageURL()));
        fputs($fd, "POST:");
        fputs($fd, print_r($_POST, true));
        fputs($fd, "GET:");
        fputs($fd, print_r($_GET, true));
        fclose($fd);
        if ($result > 0) {
            return 'done';
        } else {
            return 'Unable to write to';
        }
    } else {
        return 'Unable to open log!';
    }
}
function social_share_buttons()
{
    echo '<script>    
    !function(d, s, id) {var js, fjs = d.getElementsByTagName(s)[0];if(!d.getElementById(id)) {js = d.createElement(s); js.id = id; js.src = "//platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs);}} (document, "script", "twitter-wjs");  
    window.___gcfg = {lang: \'en\'};
    (function() {var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true; po.src = \'https://apis.google.com/js/plusone.js\'; var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);})();
    (function(d, s, id) {  var js, fjs = d.getElementsByTagName(s)[0];  if (d.getElementById(id)) return;  js = d.createElement(s); js.id = id;  js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.3";  fjs.parentNode.insertBefore(js, fjs);}(document, \'script\', \'facebook-jssdk\'));
    </script>
    <div id="fb-root"></div>
    <div class="social-share-wrapper">
        <span class="social-share-facebook">
            <div class="fb-like" data-href="' . curPageURL() . '" data-layout="button_count" data-action="like" data-show-faces="false" data-share="true"></div>
        </span>
        <span class="social-share-facebook">
            <div class="fb-send" data-href="' . curPageURL() . '" data-colorscheme="light"></div>
        </span>
        <span class="social-share-twitter">
            <a href="https://twitter.com/share" class="twitter-share-button" data-lang="en"></a>
        </span>
        <span class="social-share-google">
            <div class="g-plusone" data-size="medium"></div>
        </span>
        <div class="clearfix"></div>
    </div>';
}
 /**
  * Form Declaration
  *
  * Creates the opening portion of the form.
  *
  * @param   string  the URI segments of the form destination
  * @param   array   a key/value pair of attributes
  * @param   array   a key/value pair hidden data
  * @return  string
  * @example
  * $attributes = array('class' => 'email', 'id' => 'myform');
  * echo form_open('test/test.php', $attributes);
  */
 function form_open($action = '', $attributes = array(), $hidden = array())
 {
     // $CI =& DB::get_instance();
     // If no action is provided then set to the current url
     if (!$action) {
         $action = curPageURL();
         // $action = Config::get('site/site_url');
     } elseif (strpos($action, '://') === FALSE) {
         $a = Config::get('site/site_url');
         $action = $a . $action;
     }
     $attributes = _attributes_to_string($attributes);
     if (stripos($attributes, 'method=') === FALSE) {
         $attributes .= ' method="post"';
     }
     if (stripos($attributes, 'accept-charset=') === FALSE) {
         $attributes .= ' accept-charset="' . strtolower(Config::get("site/charset")) . '"';
     }
     $form = '<form action="' . $action . '"' . $attributes . ">\n";
     // Add CSRF field if enabled, but leave it out for GET requests and requests to external websites
     if (Config::get('csrf/csrf_protection') === TRUE) {
         $hidden[Config::get('csrf/csrf_token_name')] = Token::generateCSRF();
     }
     if (is_array($hidden)) {
         foreach ($hidden as $name => $value) {
             $form .= '<input type="hidden" name="' . $name . '" value="' . escape($value) . '" style="display:none;" />' . "\n";
         }
     }
     return $form;
 }
Beispiel #5
0
function curPageFolder()
{
    $path = curPageURL();
    $last = strripos($path, "/");
    $new = substr($path, 0, $last);
    $start = strripos($new, "/") + 1;
    return substr($path, $start, $last - $start);
}
Beispiel #6
0
function auto_redir(&$a, $contact_nick)
{
    // prevent looping
    if (x($_REQUEST, 'redir') && intval($_REQUEST['redir'])) {
        return;
    }
    if (!$contact_nick || $contact_nick === $a->user['nickname']) {
        return;
    }
    if (local_user()) {
        // We need to find out if $contact_nick is a user on this hub, and if so, if I
        // am a contact of that user. However, that user may have other contacts with the
        // same nickname as me on other hubs or other networks. Exclude these by requiring
        // that the contact have a local URL. I will be the only person with my nickname at
        // this URL, so if a result is found, then I am a contact of the $contact_nick user.
        //
        // We also have to make sure that I'm a legitimate contact--I'm not blocked or pending.
        $baseurl = $a->get_baseurl();
        $domain_st = strpos($baseurl, "://");
        if ($domain_st === false) {
            return;
        }
        $baseurl = substr($baseurl, $domain_st + 3);
        $nurl = normalise_link($baseurl);
        $r = q("SELECT id FROM contact WHERE uid = ( SELECT uid FROM user WHERE nickname = '%s' LIMIT 1 )\n\t\t        AND nick = '%s' AND self = 0 AND ( url LIKE '%%%s%%' or nurl LIKE '%%%s%%' ) AND blocked = 0 AND pending = 0 LIMIT 1", dbesc($contact_nick), dbesc($a->user['nickname']), dbesc($baseurl), dbesc($nurl));
        if (!$r || !count($r) || $r[0]['id'] == remote_user()) {
            return;
        }
        $r = q("SELECT * FROM contact WHERE nick = '%s'\n\t\t        AND network = '%s' AND uid = %d  AND url LIKE '%%%s%%' LIMIT 1", dbesc($contact_nick), dbesc(NETWORK_DFRN), intval(local_user()), dbesc($baseurl));
        if (!($r && count($r))) {
            return;
        }
        $cid = $r[0]['id'];
        $dfrn_id = $orig_id = $r[0]['issued-id'] ? $r[0]['issued-id'] : $r[0]['dfrn-id'];
        if ($r[0]['duplex'] && $r[0]['issued-id']) {
            $orig_id = $r[0]['issued-id'];
            $dfrn_id = '1:' . $orig_id;
        }
        if ($r[0]['duplex'] && $r[0]['dfrn-id']) {
            $orig_id = $r[0]['dfrn-id'];
            $dfrn_id = '0:' . $orig_id;
        }
        // ensure that we've got a valid ID. There may be some edge cases with forums and non-duplex mode
        // that may have triggered some of the "went to {profile/intro} and got an RSS feed" issues
        if (strlen($dfrn_id) < 3) {
            return;
        }
        $sec = random_string();
        q("INSERT INTO `profile_check` ( `uid`, `cid`, `dfrn_id`, `sec`, `expire`)\n\t\t\tVALUES( %d, %s, '%s', '%s', %d )", intval(local_user()), intval($cid), dbesc($dfrn_id), dbesc($sec), intval(time() + 45));
        $url = curPageURL();
        logger('auto_redir: ' . $r[0]['name'] . ' ' . $sec, LOGGER_DEBUG);
        $dest = $url ? '&destination_url=' . $url : '';
        goaway($r[0]['poll'] . '?dfrn_id=' . $dfrn_id . '&dfrn_version=' . DFRN_PROTOCOL_VERSION . '&type=profile&sec=' . $sec . $dest);
    }
    return;
}
Beispiel #7
0
function guess_base_url()
{
    $url = curPageURL();
    $url_parts = explode('/', $url);
    //take install off the end of the url
    array_pop($url_parts);
    array_pop($url_parts);
    $guessed_base_url = implode('/', $url_parts);
    return $guessed_base_url;
}
function getsignature()
{
    $url = curPageURL();
    $urls = explode("#", $url);
    $url = $urls[0];
    $ex = "jsapi_ticket=" . $GLOBALS["aticket"] . "&noncestr=" . $GLOBALS["noncestr"] . "&timestamp=" . $GLOBALS["timestamp"] . "&url=";
    if (!isset($_SESSION)) {
        session_start();
    }
    $_SESSION['signature_ex'] = $ex;
    $str = $ex . $url;
    return sha1($str);
}
Beispiel #9
0
function Main()
{
    echo curPageURL() . '<br />';
    $ch = curl_init();
    $data = array('nome' => 'Regis', 'secao' => 'exames');
    curl_setopt($ch, CURLOPT_URL, "HTTP://localhost/testes/cURL/pagina1.php");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    $output = curl_exec($ch);
    curl_close($ch);
    echo "Retorno obtido: " . $output;
}
function appendQuery($query, $entities = true)
{
    $url = curPageURL();
    if ($entities) {
        $url = str_replace("&", "&amp;", $url);
    }
    $amp = $entities ? "&amp;" : "&";
    if (strpos($url, "?") !== FALSE) {
        $url .= $amp . $query;
    } else {
        $url .= "?" . $query;
    }
    return $url;
}
function CheckMultiProxy($proxies, $timeout, $proxy_type)
{
    $data = array();
    foreach ($proxies as $proxy) {
        $parts = explode(':', trim($proxy));
        $url = strtok(curPageURL(), '?');
        $data[] = $url . '?ip=' . $parts[0] . "&port=" . $parts[1] . "&timeout=" . $timeout . "&proxy_type=" . $proxy_type;
    }
    $results = multiRequest($data);
    $holder = array();
    foreach ($results as $result) {
        $holder[] = json_decode($result, true)["result"];
    }
    $arr = array("results" => $holder);
    echo json_encode($arr);
}
function find_a_similar_page() {

	if( is_404() ){

		$pageSlugsRaw = array();
		$cleanSinglePageSlug = array();
		$mixin = array();
		$removeMe = site_url();
		$url = curPageURL();
		$closestValue = 100;
		$closestLink = '';
		$lastUrlQueryString = array_pop( explode( "/", $url ) );

		$args = array(
			'sort_order' => 'ASC',
			'sort_column' => 'post_title',
			'hierarchical' => 1,
			'post_type' => 'page',
			'post_status' => 'publish'
		);
		$pages = get_pages( $args ); 

		foreach ( $pages as $key ) {
			$pageLink = get_page_link( $key->ID );
			array_push( $pageSlugsRaw, $pageLink );
		}

		foreach( $pageSlugsRaw as $pageLink ) {
			$wholeLink = $pageLink;
			$trimedLink = str_replace( $removeMe, '', $pageLink );
			$similarityLevel = levenshtein( $trimedLink, $lastUrlQueryString );

			array_push( $mixin, array( 'similar' => $similarityLevel, 'link' => $wholeLink ) );
		}

		for( $i = 0; $i < count($mixin); $i++ ){
			if( $closestValue > $mixin[$i]['similar'] ){
				$closestValue = $mixin[$i]['similar'];
				$closestLink = $mixin[$i]['link'];
			}
		}

		wp_redirect( $closestLink );
	}

}
Beispiel #13
0
 function ondefault()
 {
     $title = '服务中心';
     $all_num = $_ENV['question']->total_question();
     $left_game = $_ENV['question']->get_question_game();
     //$banner_list = $_ENV['banner']->get_banner_list(true);
     $common_list = $_ENV['common_question']->get_common_list(true);
     $taglist = $_ENV['tag']->get_tag();
     // 判断用户是否登录
     $url = 'http://' . config::FRONT_LOGIN_DOMAIN . '/?returnUrl=' . curPageURL();
     $imgType = intval($this->get[2]);
     $Qtype = intval($this->get[3]);
     if ($imgType > 5) {
         $imgType = 0;
     }
     include template('index');
 }
function showThreadWithTable($threadwithtype, $type)
{
    $gc_current_URL = curPageURL();
    //获取最后一个/之前得所有字符串
    //$gc_current_URL=strchr($gc_current_URL,"/",true);
    $arr = explode('/', $gc_current_URL);
    $gc_current_URL = "";
    //$curren_URL="";
    for ($i = 0; $i < count($arr) - 1; $i++) {
        $gc_current_URL .= $arr[$i] . "/";
    }
    if ($type) {
        include template("excellent_shared/threadwithtype.tpl");
    } else {
        include template("excellent_shared/threadwithtype2.tpl");
    }
}
Beispiel #15
0
function protegerme($solo_salir = false, $solo_iniciado = false, $niveles = array())
{
    if (!$solo_iniciado) {
        if (_F_usuario_cache('nivel') == _N_administrador || in_array(_F_usuario_cache('nivel'), $niveles)) {
            return;
        }
    } else {
        if (S_iniciado()) {
            return;
        }
    }
    if (!$solo_salir) {
        header('Location: ' . PROY_URL . 'inicio?ref=' . curPageURL());
    }
    ob_end_clean();
    exit;
}
Beispiel #16
0
 function ondefault()
 {
     header("Cache-control: private");
     $title = '服务中心 - 问题列表页';
     $all_num = $_ENV['question']->total_question();
     $left_game = $_ENV['question']->get_question_game();
     // 问题分类
     foreach ($left_game as $val) {
         $game_id_arr[] = "'" . $val['gameid'] . "'";
     }
     $game = '';
     $game_id = isset($this->post['gameid']) ? $this->post['gameid'] : (isset($this->get[2]) ? $this->get[2] : '');
     if ($game_id != '') {
         if ($game_id == 'other_games') {
             $game = " AND gameid<>'' AND gameid NOT IN (" . implode(',', $game_id_arr) . ") ";
         } else {
             $game = " AND gameid='" . $game_id . "' ";
         }
     }
     $tag_arr = isset($this->post['tag']) ? $this->post['tag'] : (isset($this->get[3]) ? explode(",", $this->get[3]) : array());
     foreach ($tag_arr as $k => &$v) {
         if ($v == '') {
             unset($tag_arr[$k]);
         }
     }
     $tag_str = implode(',', $tag_arr);
     $tag_list = $_ENV['tag']->get_tag_tree($tag_arr, $game);
     $rigth_game = $_ENV['question']->get_game_list($tag_arr, $game);
     //保存搜索条件
     $search_conf = array();
     $search_conf['tag'] = $tag_arr;
     $search_conf['game'] = $game;
     setcookie('search_conf', serialize($search_conf));
     $common_list = $_ENV['common_question']->get_common_list(true);
     // 常见问答
     $taglist = $_ENV['tag']->get_tag();
     // 问题分类
     // 判断是用户是否登录
     $url = 'http://' . config::FRONT_LOGIN_DOMAIN . '/?returnUrl=' . curPageURL();
     $imgType = 0;
     include template('list');
 }
Beispiel #17
0
function urlHandler_securepages()
{
    global $bapi_all_options;
    $url = get_relative($_SERVER['REQUEST_URI']);
    //echo $url; exit();
    if ((strpos($url, 'makepayment') !== false || strpos($url, 'makebooking') !== false) && strpos($_SERVER['HTTP_HOST'], 'lodgingcloud.com') == false && strpos($_SERVER['HTTP_HOST'], 'localhost') == false) {
        //Do not force the redirect on lodgingcloud - helps bobby debug connect.
        $purl = parse_url(curPageURL());
        if ($purl['scheme'] == 'http') {
            $nurl = "https://" . $purl['host'] . $purl['path'];
            if (!empty($purl['query'])) {
                $nurl .= "?" . $purl['query'];
            }
            //echo $nurl;
            header("Location: {$nurl}");
            exit;
        }
    } else {
        return;
    }
}
function mytheme_add_init()
{
    $subs = get_site_url();
    $scs = $subs . '/wp-admin/themes.php?page=option.php';
    $scb = $subs . '/wp-admin/admin.php?page=option.php&saved=true';
    $sdc = $subs . '/wp-admin/admin.php?page=option.php&reset=true';
    //echo $scs;
    $crturl = curPageURL();
    //echo $crturl;
    if ($crturl == $scs) {
        $file_dir = get_bloginfo('template_directory');
        wp_enqueue_style("option", $file_dir . "/theme_option/option/option.css", false, "1.0", "all");
        wp_enqueue_script("rm_script", $file_dir . "/theme_option/option/rm_script.js", false, "1.0");
        wp_enqueue_style('thickbox');
        // Stylesheet used by Thickbox
        wp_enqueue_media();
        wp_register_script('theme_options', $file_dir . '/theme_option/option/theme_options.js', array('jquery'));
        wp_enqueue_script('theme_options');
    }
    if ($crturl == $scb) {
        $file_dir = get_bloginfo('template_directory');
        wp_enqueue_style("option", $file_dir . "/theme_option/option/option.css", false, "1.0", "all");
        wp_enqueue_script("rm_script", $file_dir . "/theme_option/option/rm_script.js", false, "1.0");
        wp_enqueue_style('thickbox');
        // Stylesheet used by Thickbox
        wp_enqueue_media();
        wp_register_script('theme_options', $file_dir . '/theme_option/option/theme_options.js', array('jquery'));
        wp_enqueue_script('theme_options');
    }
    if ($crturl == $sdc) {
        $file_dir = get_bloginfo('template_directory');
        wp_enqueue_style("option", $file_dir . "/theme_option/option/option.css", false, "1.0", "all");
        wp_enqueue_script("rm_script", $file_dir . "/theme_option/option/rm_script.js", false, "1.0");
        wp_enqueue_style('thickbox');
        // Stylesheet used by Thickbox
        wp_enqueue_media();
        wp_register_script('theme_options', $file_dir . '/theme_option/option/theme_options.js', array('jquery'));
        wp_enqueue_script('theme_options');
    }
}
Beispiel #19
0
 function domain_deployment()
 {
     $isadmin = 'admin' == substr($this->get[0], 0, 5);
     if ($isadmin) {
         if (config::ADMIN_DOMAIN != getServerName()) {
             $this->notfound('您所访问的页面不存在!');
         }
     } else {
         if (config::FRONT_DOMAIN != getServerName()) {
             $curPageURL = curPageURL();
             strpos($curPageURL, 'http://') !== false && ($curPageURL = str_replace('http://', '', $curPageURL));
             strpos($curPageURL, '/') !== false && ($curPageURL = str_replace('/', '', $curPageURL));
             if ($curPageURL == config::ADMIN_DOMAIN) {
                 header("Location: " . url('admin_main/', true));
                 exit;
             } else {
                 if ($this->get[0] != 'attach') {
                     $this->notfound('您所访问的页面不存在!');
                 }
             }
         }
     }
 }
}
?>
 ><a href="event.php">Current Event</a></li>
    <li <?php 
if (curPageURL('report')) {
    echo 'class="active"';
}
?>
 ><a href="report.php">Report</a></li>
  </ul>
  <ul class="nav nav-sidebar">
    <li <?php 
if (curPageURL('assignResource')) {
    echo 'class="active"';
}
?>
 ><a href="assignResource.php">Assign Resource</a></li>
    <li <?php 
if (curPageURL('createEvent')) {
    echo 'class="active"';
}
?>
 ><a href="createEvent.php">Create Event</a></li>
    <li <?php 
if (curPageURL('postOnSocialMedia')) {
    echo 'class="active"';
}
?>
 ><a href="postOnSocialMedia.php">Alert</a></li>
  </ul>
</div>
                                                        echo "<script>parent.\$('.main').nimbleLoader('hide');parent.created(1,'" . urlencode('https://www.paypal.com/cgi-bin/webscr' . $querystring) . "');</script>";
                                                    }
                                                } else {
                                                    if ($_POST['method'] == 1) {
                                                        $moneybooker_setting = file('config/payment/moneybooker.txt');
                                                        //0=>merchant_id, 1=>payment_mail, 2=>currency,3=>company, 4=>secret word
                                                        if ($file[0] == 0) {
                                                            $prices = json_decode($file[1]);
                                                            $amount = round($prices[$_POST['minutes']], 2);
                                                        } else {
                                                            if ($file[0] == 1) {
                                                                $amount = round($file[1] * $_POST['minutes'], 2);
                                                            }
                                                        }
                                                        $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
                                                        $url = curPageURL() . '/php/payment_moneybooker.php';
                                                        $form = '<form action="https://www.moneybookers.com/app/payment.pl" method="post">
								<input type="hidden" name="merchant_id" value="' . $moneybooker_setting[0] . '"/>
								<input type="hidden" name="recipient_description" value="' . $moneybooker_setting[3] . '"/>
								<input type="hidden" name="status_url" value="' . $url . '"/> 
								<input type="hidden" name="language" value="' . $lang . '"/>
								<input type="hidden" name="amount" value="' . $amount . '"/>
								<input type="hidden" name="currency" value="' . $moneybooker_setting[2] . '"/>

								<input type="hidden" name="merchant_fields" value="tkid, minutes">
								<input type="hidden" name="tkid" value="' . $tkid . '" />
								<input type="hidden" name="minutes" value="' . $minutes . '" />

								<input type="hidden" name="detail1_description" value="Support:" />
								<input type="hidden" name="detail1_text" value="Ticket ID:' . $tkid . ' for ' . $minutes . ' minutes" />
								<input type="submit" value="Pay"/>
Beispiel #22
0
#  published by the Free Software Foundation, version 2 of the License.
#  See license.txt.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#***************************************************************************************
//error_reporting(1);
include "functions/ParamLib.php";
include 'Redirect_root.php';
$url = validateQueryString(curPageURL());
if ($url === FALSE) {
    header('Location: index.php');
}
error_reporting(E_ERROR);
$start_time = time();
include 'Warehouse.php';
array_rwalk($_REQUEST, 'strip_tags');
if (!isset($_REQUEST['_openSIS_PDF'])) {
    Warehouse('header');
    //if(strpos($_REQUEST['modname'],'misc/')===false && $_REQUEST['modname']!='Students/Student.php' && $_REQUEST['modname']!='School_Setup/Calendar.php' && $_REQUEST['modname']!='Scheduling/Schedule.php' && $_REQUEST['modname']!='Attendance/Percent.php' && $_REQUEST['modname']!='Attendance/Percent.php?list_by_day=true' && $_REQUEST['modname']!='Scheduling/MassRequests.php' && $_REQUEST['modname']!='Scheduling/MassSchedule.php' && $_REQUEST['modname']!='Student_Billing/Fees.php')
    //if(strpos($_REQUEST['modname'],'misc/')===false)
    if (strpos(optional_param('modname', '', PARAM_NOTAGS), 'misc/') === false) {
        echo '<script language="JavaScript">if(window == top  && (!window.opener || window.opener.location.href.substring(0,(window.opener.location.href.indexOf("&")!=-1?window.opener.location.href.indexOf("&"):window.opener.location.href.replace("#","").length))!=window.location.href.substring(0,(window.location.href.indexOf("&")!=-1?window.location.href.indexOf("&"):window.location.href.replace("#","").length)))) window.location.href = "index.php";</script>';
    }
    echo "<BODY onload='doOnload();'>";
Beispiel #23
0
  <title>IMS Basic Learning Tools Interoperability</title>
</head>
<body style="font-family:sans-serif">
<img src="http://www.imsglobal.org/images/IMSGLCLogo.jpg"/>
<p><b>IMS BasicLTI PHP Consumer</b></p>
<p>This is a very simple reference implementaton of the LMS side (i.e. consumer) for IMS BasicLTI.</p>
<?php 
require_once "misc.php";
require_once "ims-blti/blti_util.php";
$lmsdata = array("resource_link_id" => "120988f929-274612", "resource_link_title" => "Weekly Blog", "resource_link_description" => "A weekly blog.", "user_id" => "292832126", "roles" => "Instructor", "lis_person_name_full" => 'Jane Q. Public', "lis_person_contact_email_primary" => "*****@*****.**", "lis_person_sourcedid" => "school.edu:user", "context_id" => "456434513", "context_title" => "Design of Personal Environments", "context_label" => "SI182", "tool_consumer_instance_guid" => "lmsng.school.edu", "tool_consumer_instance_description" => "University of School (LMSng)");
foreach ($lmsdata as $k => $val) {
    if ($_POST[$k] && strlen($_POST[$k]) > 0) {
        $lmsdata[$k] = $_POST[$k];
    }
}
$cur_url = curPageURL();
$key = $_REQUEST["key"];
if (!$key) {
    $key = "12345";
}
$secret = $_REQUEST["secret"];
if (!$secret) {
    $secret = "secret";
}
$endpoint = $_REQUEST["endpoint"];
if (!$endpoint) {
    $endpoint = str_replace("lms.php", "tool.php", $cur_url);
}
$urlformat = $_REQUEST["format"];
$urlformat = $urlformat != 'XML';
$tool_consumer_instance_guid = $lmsdata['tool_consumer_instance_guid'];
<a name="remote1"></a>
<H4>A caixa de texto diz "O serviço Rembrant devolveu um erro".</H4>
<P>Passa-se alguma coisa com o serviço, que foi abaixo. O servidor está programado para reactivar o serviço em cada hora, se não o encontrar. Tome um café e volte a tentar mais tarde.</P>
<P>
<a class="intlink" href="#top">Voltar ao topo da página</a>
<hr>

<H3>Execução local do programa REMBRANDT</H3>

<a name="local1"></a>
<H4>Dá-me uma excepção <code>in thread "main" java.lang.NoClassDefFoundError</code></H4>
<P>O Java não encontrou o REMBRANDT. Verifique se o CLASSPATH está bem configurado, ou se não escreveu um erro na linha de comandos.</P>

<P>
<a class="intlink" href="#top">Voltar ao topo da página</a>
<hr>

<a name="local2"></a>
<H4>O REMBRANDT falha muitas EM óbvias!</H4>

<P>Isso só acontece com EM que incluam caracteres não-ASCII? Experimente anotar, por exemplo, "Lisboa e Óbidos"; Se 'Óbidos' não foi anotado mas 'Lisboa' sim, isso indicia uma incompatibilidade em codificações de caracteres algures na execução do programa. Por outras palavras, o caracter 'Ó' é lido incorrectamente durante a execução do REMBRANDT, comprometendo a classificação da EM.</P>	

<P>O suspeito mais comum é o MySQL, que pode estar a devolver os resultados numa codificação inesperada. Recomendamos que reconfigure o MySQL para trabalhar em UTF-8, tanto o servidor como o cliente, e que as bases de dados sejam carregadas nessa codificação. Confirme também que o ambiente da consola / ficheiro de entrada está na codificação certa. Pode sempre ajudar o Java a compreender qual a codificação que deve usar por omissão, adicionando o parâmetro <code>-Dfile.encoding</code>.
<P>
<a class="intlink" href="#top">Voltar ao topo da página</a>
<hr>
<P>Não encontraste resposta ao seu problema? Então <a href="<?php 
echo curPageURL(array('do' => 'devel-issues'));
?>
">denuncia o erro</a>. Ajuda o REMBRANDT a ser um programa melhor.</P>
Beispiel #25
0
					<li><a <?php 
if (isset($_GET['order']) && $_GET['order'] == 'commented') {
    echo 'class="current"';
}
?>
 href="<?php 
echo curPageURL() . '?' . http_build_query(array_merge($_GET, array('order' => 'commented')));
?>
">评论最多</a></li>
					<li><a <?php 
if (isset($_GET['order']) && $_GET['order'] == 'alpha') {
    echo 'class="current"';
}
?>
 href="<?php 
echo curPageURL() . '?' . http_build_query(array_merge($_GET, array('order' => 'alpha')));
?>
">标题排序</a></li>
				</ul>
			</div>
			<h4>浏览<?php 
// If this is a category archive
if (is_category()) {
    printf('分类</h4>
			<h2>' . single_cat_title('', false) . '</h2>');
    if (category_description()) {
        echo '<p>' . category_description() . '</p>';
    }
    // If this is a tag archive
} elseif (is_tag()) {
    printf('标签</h4>
{
    $pageURL = 'http';
    if ($_SERVER["HTTPS"] == "on") {
        $pageURL .= "s";
    }
    $pageURL .= "://";
    if ($_SERVER["SERVER_PORT"] != "80") {
        $pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
    } else {
        $pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
    }
    $findme = 'reachlocal.net';
    $if_rl = strpos($pageURL, $findme);
    return $if_rl;
}
echo curPageURL();
//echo $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
//SET OUR DEPTH VARIABLE WHICH CAN BE USED BY CONTENT BLOCKS THROUGHOUT THE TEMPLATE
$depth = "";
//INCLUDE ALL OF OUR MODULE CLASSES
include "_admin/class/class_config.php";
include "_admin/class/class_db.php";
include "_admin/class/class_time.php";
//INCLUDE FACE MODULES NEEDED FOR THIS PAGE;
include "_face/class/face_common.php";
include "_face/class/face_events.php";
include "_face/class/face_news.php";
//CREATE OUR CONFIG
$cfg = new class_config();
//CREATE OUR DATABASE
$db = new class_db($cfg->db_host, $cfg->db_name, $cfg->db_user, $cfg->db_pass);
Beispiel #27
0
/**
 *
 * Add the navigation (menu) template
 *
 */
if ($a->module != 'install' && $a->module != 'maintenance') {
    nav($a);
}
/**
 * Add a "toggle mobile" link if we're using a mobile device
 */
if ($a->is_mobile || $a->is_tablet) {
    if (isset($_SESSION['show-mobile']) && !$_SESSION['show-mobile']) {
        $link = $a->get_baseurl() . '/toggle_mobile?address=' . curPageURL();
    } else {
        $link = $a->get_baseurl() . '/toggle_mobile?off=1&address=' . curPageURL();
    }
    $a->page['footer'] = replace_macros(get_markup_template("toggle_mobile_footer.tpl"), array('$toggle_link' => $link, '$toggle_text' => t('toggle mobile')));
}
/**
 * Build the page - now that we have all the components
 */
if (!$a->theme['stylesheet']) {
    $stylesheet = current_theme_url();
} else {
    $stylesheet = $a->theme['stylesheet'];
}
$a->page['htmlhead'] = replace_macros($a->page['htmlhead'], array('$stylesheet' => $stylesheet));
$page = $a->page;
$profile = $a->profile;
header("Content-type: text/html; charset=utf-8");
            $a = $STH->fetch();
            if (!empty($a)) {
                do {
                    $b[$a['id']] = htmlspecialchars($a['name'], ENT_QUOTES, 'UTF-8');
                } while ($a = $STH->fetch());
            }
            $DBH = null;
            return json_encode($b);
        } catch (PDOException $e) {
            file_put_contents('PDOErrors', "File: " . $e->getFile() . ' on line ' . $e->getLine() . "\nError: " . $e->getMessage() . "\n", FILE_APPEND);
            $DBH = null;
            return json_encode(array(0 => "Can't retrieve Operators"));
        }
    }
}
$siteurl = dirname(dirname(curPageURL()));
$siteurl = explode('?', $siteurl);
$siteurl = $siteurl[0];
function curPageURL()
{
    $pageURL = "//";
    if (isset($_SERVER["HTTPS"]) && $_SERVER["SERVER_PORT"] != "80") {
        $pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
    } else {
        $pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
    }
    return $pageURL;
}
function retrive_ip()
{
    if (isset($_SERVER['HTTP_CLIENT_IP']) && !empty($_SERVER['HTTP_CLIENT_IP'])) {
Beispiel #29
0
function PostTypes()
{
    screen_icon();
    echo '<div class="wrap">';
    ?>
	<script LANGUAGE="JavaScript">
			<!--
			function confirmSubmit()
			{
			var agree=confirm("<?php 
    _e('Are you sure you wish to delete?', THEME_ADMIN_LANG_DOMAIN);
    ?>
");
			if (agree)
				return true ;
			else
				return false ;
			}
			// -->
			</script>
	<h2><?php 
    echo THEME_NAME;
    _e('Post Types and Taxonomies', THEME_ADMIN_LANG_DOMAIN);
    ?>
</h2>
	<?php 
    if (isset($_REQUEST["task"])) {
        $task = $_REQUEST["task"];
    } else {
        $task = false;
    }
    switch ($task) {
        case 'editptype':
            editpostType();
            break;
        case 'edittax':
            edittaxType();
            break;
        default:
            global $wpdb;
            $table = $wpdb->prefix . 'ultimatum_ptypes';
            $table2 = $wpdb->prefix . 'ultimatum_tax';
            if ($_POST) {
                if ($_POST[action] == 'delptype') {
                    // delete post type
                    $delete = "DELETE  FROM {$table} WHERE `name`='{$_POST['delptype']}'";
                    $r = $wpdb->query($delete);
                    $url = curPageURL();
                    //delete taxonomies of post type
                    $delete = "DELETE  FROM {$table2} WHERE `pname`='{$_POST['delptype']}'";
                    $r = $wpdb->query($delete);
                }
                if ($_POST[action] == 'delcptax') {
                    //delete tax type
                    $delete = "DELETE  FROM {$table2} WHERE `tname`='{$_POST['delcptax']}'";
                    $r = $wpdb->query($delete);
                    $url = curPageURL();
                }
                ?>
			<script language="JavaScript">
				parent.location.href='<?php 
                echo $url;
                ?>
';
			</script>
			<?php 
            }
            flush_rewrite_rules(false);
            $query = "SELECT * FROM {$table}";
            $result = $wpdb->get_results($query, ARRAY_A);
            echo '<table class="widefat">';
            echo '<thead>';
            echo '<tr><th width="150">' . __('Custom Post Type', THEME_ADMIN_LANG_DOMAIN) . '</th><th>' . __('Taxonomies', THEME_ADMIN_LANG_DOMAIN) . '</th><th style="text-align:right;" width="150"><a href="admin.php?page=wonder-types&task=editptype" class="button-primary">' . __('Add Post Type', THEME_ADMIN_LANG_DOMAIN) . '</a></th></tr>';
            echo '</thead>';
            echo '<tbody>';
            foreach ($result as $ptypes) {
                $properties = unserialize($ptypes["properties"]);
                echo '<tr>
					<td style="font-size:14px"><a href="admin.php?page=wonder-types&task=editptype&name=' . $ptypes["name"] . '">' . $properties["label"] . '</a></td>
					<td>' . getTaxes($ptypes["name"]) . '</td>
					<td align="right">
					<p><a href="admin.php?page=wonder-types&task=editptype&name=' . $ptypes["name"] . '" class="button-primary">' . __('Edit Post Type', THEME_ADMIN_LANG_DOMAIN) . '</a><br /><br /><a href="admin.php?page=wonder-types&task=edittax&name=' . $ptypes["name"] . '" class="button-primary">' . __('Add Taxonomy', THEME_ADMIN_LANG_DOMAIN) . '</a></p><form method="post" action=""><input type="hidden" name="action" value="delptype" /><input type="hidden" name="delptype" value="' . $ptypes["name"] . '" /><input type="submit" value="' . __('Delete Post Type', THEME_ADMIN_LANG_DOMAIN) . '" class="button-secondary" onClick="return confirmSubmit()" /></form></td></tr>';
            }
            echo '</tbody>';
            echo '</table>';
            break;
    }
    echo '</div>';
}
function acl_enforce($function_name, $message = '', $portal = false)
{
    $_ci =& get_instance();
    if (!$_ci->user->isLoggedIn()) {
        if ($portal) {
            redirect('profile/login/?redirect=' . curPageURL());
        } else {
            redirect('auth/login/#/?error=login_required&redirect=' . curPageURL());
        }
        // throw new Exception (($message ?: "Access to this function requires you to be logged in. Perhaps you have been automatically logged out?"));
    } else {
        if (!$_ci->user->hasFunction($function_name)) {
            throw new Exception($message ?: "You do not have permission to use this function (" . $function_name . "). Perhaps you have been logged out?");
        }
    }
}