Ejemplo n.º 1
0
<?
    require_once("util.php");

    # don't want nojs return-to-search navigation in saved list items.
    clear_prev_search();

    $sm = get_smarty();
    $p = new SiteParse();
   
    try {
        $saved = ar_get('saved', $_SESSION);

        $records = array();
    
        if(!isset($_COOKIE['PHPSESSID'])) $sm->assign('cookies_disabled', true);

        if ($saved) {
            foreach (array_keys($saved) as $pos_bibid) {
                $bibid = valid_bibid($pos_bibid);

                $record  = $p->get_record($bibid);
                $record['info_keys'] = $p->detail_keys;
                $record['is_saved']  = true;

                $records[] = $record;
            }
        }

        $sm->assign("records", $records);
        
        header("Content-Type: text/html; charset=utf-8");
Ejemplo n.º 2
0
<?
    require_once('util.php');

    $sm = get_smarty();
    $p = new SiteParse();

    try {
        if (!ar_get('userid', $_SESSION)) {
            throw new Exception("Please log into your account.");

        } else {
            $sm->assign("bibid", ar_get('bibid', $_REQUEST));
            $name = $_SESSION['name'];
            $code = $_SESSION['code'];

            $url = ar_get('request_url', $_REQUEST);

            $post_params = array();
            foreach (array('radio', 'locx00', 'inst', 'submit', 'submit.x', 'submit.y', 'name', 'code', 'needby_Month', 'needby_Day', 'needby_Year') as $key) {
                $post_params[$key] = ar_get($key, $_REQUEST);
            }

            if ($p->submit_item_request($name, $code, $url, $post_params)) {
                $sm->display("responses/request_success.html");
            }
        }

    } catch (Exception $e) {
        $sm->assign("error", $e->GetMessage());
        $sm->display("responses/error.html");
    }
Ejemplo n.º 3
0
        return implode("\n", $headers);
    }

    function get_subject($p, $is_text, $record) {
        if (!$is_text) {
            return sprintf("%s: %s", $p->email_subject_prefix, 
                substr($record['info']['Title'], 0, 50));
        }
    }

    function html_entity_decode_ref(&$str) {
        $str = html_entity_decode($str);
    }

    try {
        $p = new SiteParse();
        # Don't set a max value when doing the email, as we don't need to worry
        # about the display
        $p->max_value_length = null;

        list($email, $is_text) = get_email_addr();
        $bibid = valid_bibid($_REQUEST['bibid']);

        $record = $p->get_record($bibid);
        array_walk_recursive($record, "html_entity_decode_ref");
        
        $record["info_keys"] = $p->email_detail_keys;

        $contents = get_detail_text($record, $is_text);

        $headers = get_email_headers($p);
Ejemplo n.º 4
0
<?
    require_once("util.php");

    $sm = get_smarty();
    $p = new SiteParse();

    try { 
        if (!ar_get('userid', $_SESSION)) {
            $query = http_build_query(array(
                "redirect" => $p->base_url . "my_account",
            ));
            
            header("Location: " . $p->base_url . "login?" . $query);
            
        } else {
            $url = ar_get('url', $_REQUEST);
            list($items, $holds, $fines) = $p->get_my_account_info($_SESSION['name'], $_SESSION['code'], $_SESSION['userid'], $url);

            header("Content-Type: text/html; charset=utf-8");
            $sm->assign("items", $items);
            $sm->assign("holds", $holds);
            $sm->assign("fines", $fines);
            
            $sm->display("pages/my_account.html");
        }
    } catch (Exception $e) {
        $sm->assign("error", $e->GetMessage());
        $sm->display("responses/error.html");
    }
?>
Ejemplo n.º 5
0
<?
    require_once('util.php');

    $sm = get_smarty();
    $p = new SiteParse();

    try {
        if (!ar_get('userid', $_SESSION)) {

            $query = http_build_query(array(
                "redirect" => $_SERVER['REQUEST_URI']
            ));

            $page = use_js() ? "small_login" : "login";

            header("Location: " . $p->base_url . "$page?" . $query);

        } else {

            $bib  = ar_get('bibid', $_REQUEST);
            $rurl = ar_get('url', $_REQUEST);
       
            $loc_options = $p->get_request_form($_SESSION['name'], $_SESSION['code'], $rurl);
            $nbMonth = $p->get_needby_month($_SESSION['name'], $_SESSION['code'], $rurl);
            $nbDay = $p->get_needby_day($_SESSION['name'], $_SESSION['code'], $rurl);
            $nbYear = $p->get_needby_year($_SESSION['name'], $_SESSION['code'], $rurl);
            
            # if only one request location, skip step1?
            if(!$loc_options) $loc_options = array("Library pickup?");

            $sm->assign("jsfiles", array("static/relogin.js"));
Ejemplo n.º 6
0
function get_browse_results() {
    $p = new SiteParse();
     
    # The "More..." link presents a specific url to request, with 
    # session info and other stuff
    if (array_key_exists('url', $_REQUEST)) {
        return $p->get_next_browse($_REQUEST['url']);
    
    # For a normal search link, just use the search arg
    } else {
        if(isset($_REQUEST['scope'])) return $p->get_browse($_REQUEST['searcharg'], $_REQUEST['scope']);
        else return $p->get_browse($_REQUEST['searcharg']);
    }
}
Ejemplo n.º 7
0
<?
    require_once("util.php");

    $sm = get_smarty();
    $p = new SiteParse();

    try {
        if ($name = ar_get('name', $_REQUEST)) {
            $_SESSION['name'] = $name;
        }

        if ($code = ar_get('code', $_REQUEST)) {
            $_SESSION['code'] = $code;
        }

	if ($pin = ar_get('pin', $_REQUEST)) {
	    $_SESSION['pin'] = $pin;
	}

        if ($resp = $p->login($name, $code, $pin)) {
            $_SESSION['userid'] = $resp['userid'];
            header("Location: " . $_REQUEST['redirect']);

        } 

        elseif($name == 'admin' and $code == $p->admin_pass) {
            $_SESSION['userid'] = $resp['userid'];
            header("Location: settings.php");
        }
        else {
            do_logout();
Ejemplo n.º 8
0
<?
    require_once('util.php');

    $sm = get_smarty();
    $p = new SiteParse();

    try {
        if (!ar_get('userid', $_SESSION)) {
            throw new Exception("Please log into your account.");

        } else {
            $post_params = array(
                "locx00" => ar_get("locx00", $_REQUEST),
                "inst"   => ar_get("inst", $_REQUEST),
                "submit" => ar_get("submit", $_REQUEST),
                "submit.x" => ar_get("submit.x", $_REQUEST),
                "submit.y" => ar_get("submit.y", $_REQUEST),
            );
            
            $req_url = ar_get('request_url', $_REQUEST);

            $name = $_SESSION['name'];
            $code = $_SESSION['code'];
	    
	    if ($p->submit_item_request($name, $code, $req_url, $post_params)) {
                $sm->display("responses/request_success.html");
            } else {	
            	$resp = $p->get_request_loc($name, $code, $req_url, $post_params);
           	$sm->assign("url", $req_url);
            	$sm->assign("locs", $resp["locs"]);
            	$sm->assign("hidden", $resp["hidden"]);