コード例 #1
0
<?php

include "../include/db.php";
include "../include/general.php";
# External access support (authenticate only if no key provided, or if invalid access key provided)
$k = getvalescaped("k", "");
if ($k == "" || !check_access_key(getvalescaped("ref", "", true), $k)) {
    include "../include/authenticate.php";
}
include "../include/search_functions.php";
include "../include/collections_functions.php";
include "../include/resource_functions.php";
# Save the thumbs status, this value will be restored when leaving the page
$saved_thumbs_state = getvalescaped("thumbs", $thumbs_default);
# Hide the thumbs
rs_setcookie("thumbs", "hide", 1000);
# Restore the thumbs status when leaving the page
$headerinsert .= "<script type='text/javascript'>jQuery(window).unload(function(){SetCookie('thumbs','" . $saved_thumbs_state . "');});</script>";
$ref = getvalescaped("ref", "", true);
$search = getvalescaped("search", "");
$offset = getvalescaped("offset", "", true);
$order_by = getvalescaped("order_by", "");
$archive = getvalescaped("archive", "", true);
$restypes = getvalescaped("restypes", "");
$starsearch = getvalescaped("starsearch", "");
$page = getvalescaped("page", 1);
$alternative = getvalescaped("alternative", -1);
if (strpos($search, "!") !== false) {
    $restypes = "";
}
$default_sort = "DESC";
コード例 #2
0
ファイル: general.php プロジェクト: artsmia/mia_resourcespace
function get_rs_session_id($create = false)
{
    //exit();
    // Note this is not a PHP session, we are using this is to create an ID so we can distinguish between anonymous users
    if (isset($_COOKIE["rs_session"])) {
        return $_COOKIE["rs_session"];
    }
    if ($create) {
        // Create a new ID - numeric values only so we can search for it easily
        $rs_session = rand();
        global $baseurl;
        rs_setcookie("rs_session", $rs_session, 7, "", "", substr($baseurl, 0, 5) == "https", true);
        return $rs_session;
    }
    return false;
}
コード例 #3
0
    {
    remove_all_resources_from_collection($emptycollection);
    }
    
# Disable info box for external access.
if ($k!="") {$infobox=false;} 
# Disable checkboxes for external users.
if ($k!="") {$use_checkboxes_for_selection=false;}

if(!isset($thumbs))
    {
    $thumbs=getval("thumbs","unset");
    if($thumbs == "unset")
        {
        $thumbs = $thumbs_default;
        rs_setcookie("thumbs", $thumbs, 1000,"","",false,false);
        }
    }

# Basket mode? - this is for the e-commerce user request modes.
if ($userrequestmode==2 || $userrequestmode==3)
	{
	# Enable basket
	$basket=true;	
	}
else
	{
	$basket=false;
	}

$collection=getvalescaped("collection","",true);
コード例 #4
0
    setcookie("search", "", 0, '', '', false, true);
    setcookie("saved_offset", "", 0, '', '', false, true);
    setcookie("saved_archive", "", 0, '', '', false, true);
    unset($username);
    hook("postlogout");
    if (isset($anonymous_login)) {
        # If the system is set up with anonymous access, redirect to the home page after logging out.
        redirect("pages/" . $default_home_page);
    }
}
hook("postlogout2");
if (getval("langupdate", "") != "") {
    # Update language while remaining on this page.
    rs_setcookie("language", $language, 1000);
    # Only used if not global cookies
    rs_setcookie("language", $language, 1000, $baseurl_short . "pages/");
    redirect("login.php?username="******"username", "")));
}
include "include/header.php";
if (!hook("replaceloginform")) {
    ?>

  <h1><?php 
    echo text("welcomelogin");
    ?>
</h1>
  <p><?php 
    echo text(getvalescaped("text", "defaultintro"));
    ?>
</p>
  <p>
コード例 #5
0
			}
		}
	if(in_array("col-".$ctheme,$plugin_names))
		{
		// check that record exists for user
		if(empty($userpreferences))
			{
			// create a record
			sql_query("INSERT into user_preferences (user, parameter, `value`) VALUES (" . $userref . ", 'colour_theme', '" . escape_check(preg_replace('/^col-/', '', $ctheme)) . "');");
			rs_setcookie("colour_theme", escape_check(preg_replace("/^col-/","",$ctheme)),100, "/", "", substr($baseurl,0,5)=="https", true);
			exit("1");
			}
		else
			{
			sql_query("UPDATE user_preferences SET `value` = '" . escape_check(preg_replace('/^col-/', '', $ctheme)) . "' WHERE user = "******" AND parameter = 'colour_theme';");
			rs_setcookie("colour_theme", escape_check(preg_replace("/^col-/","",$ctheme)),100, "/", "", substr($baseurl,0,5)=="https", true);
			exit("1");
			}
		}

	exit("0");
	}

include "../../include/header.php";
?>
<div class="BasicsBox"> 
  	<h1><?php echo $lang["userpreferences"]?></h1>
  	<p><?php echo $lang["modifyuserpreferencesintro"]?></p>
  	
	<?php
	/* Display */
コード例 #6
0
     }
 }
 if (!isset($system_login) && strlen(trim($userdata[0]["last_active"])) > 0) {
     if ($userdata[0]["idle_seconds"] > $session_length * 60) {
         # Last active more than $session_length mins ago?
         $al = "";
         if (isset($anonymous_login)) {
             $al = $anonymous_login;
         }
         if ($session_autologout && $username != $al) {
             # Reached the end of valid session time, auto log out the user.
             # Remove session
             sql_query("update user set logged_in=0,session='' where ref='{$userref}'");
             hook("removeuseridcookie");
             # Blank cookie / var
             rs_setcookie("user", "", time() - 3600, "", "", substr($baseurl, 0, 5) == "https", true);
             unset($username);
             if (isset($anonymous_login)) {
                 # If the system is set up with anonymous access, redirect to the home page after logging out.
                 redirect("pages/" . $default_home_page);
             } else {
                 $valid = false;
                 $autologgedout = true;
             }
         } else {
             # Session end reached, but the user may still remain logged in.
             # This is a new 'session' for the purposes of statistics.
             daily_stat("User session", $userref);
         }
     }
 }
コード例 #7
0
$ajax = getval("ajax", "");
if ($ajax == "") {
    // blank starsearch cookie in case $star_search was turned off
    setcookie("starsearch", "");
    // cookies have to go above the header output
    if ($display_user_rating_stars && $star_search) {
        # if seardch is not a special search (ie. !recent), use starsearchvalue.
        if (getval("search", "") != "" && strpos(getval("search", ""), "!") !== false) {
            $starsearch = "";
        } else {
            $starsearch = getvalescaped("starsearch", "");
            setcookie("starsearch", $starsearch);
        }
    }
    if (getval("thumbs", "") == "") {
        rs_setcookie("thumbs", $thumbs_default, 1000);
    }
    ?>
<!DOCTYPE html>
<html>	<?php 
    if ($include_rs_header_info) {
        ?>
<!--<?php 
        hook("copyrightinsert");
        ?>
ResourceSpace version <?php 
        echo $productversion;
        ?>

Copyright Oxfam GB, Montala, WWF International, Tom Gleason, David Dwiggins, Historic New England, Colorhythm LLC, Worldcolor, Henrik Frizén 2006-2013
http://www.resourcespace.org/
コード例 #8
0
<?php

include "../include/db.php";
include "../include/general.php";
include "../include/authenticate.php";
if (getval("save", "") != "") {
    rs_setcookie("language", getval("language", ""), 1000);
    # Only used if not global cookies
    rs_setcookie("language", getval("language", ""), 1000, $baseurl_short);
    rs_setcookie("language", getval("language", ""), 1000, $baseurl_short . "pages/");
    redirect(getval("uri", $baseurl_short . "pages/" . ($use_theme_as_home ? 'themes.php' : $default_home_page)));
}
include "../include/header.php";
?>

<h1><?php 
echo $lang["languageselection"];
?>
</h1>
<p><?php 
echo text("introtext");
?>
</p>
  
<form method="post" action="<?php 
echo $baseurl_short;
?>
pages/change_language.php">  
<div class="Question">
<label for="password"><?php 
echo $lang["language"];
コード例 #9
0
<?php
include_once("/var/www/include/general.php");
$killsearch = rs_setcookie("search","",1,'/pages/', '', false, false);
if($killsearch){
  rs_setcookie("restypes",'1,2,3,4','1','/','',false,false);
}else{
  echo("did not killsearch");
}
if(isset($_COOKIE['contrib'])){
    rs_setcookie("contrib",'',1,'/', '', false, false);
}
var_dump($_COOKIE);
?>