I have installed PhpmyLibrary and after installation it asks to remove the install folder. After removing the install folder i get a page full of code and somewhere in that long page he asks for username and password. If I give the username and password it says "you are not authorized to view this page". Please do help me in this regard.
Waiting for the reply at the earliest...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There seems to be a mixture of short and long open tags used throughout the application - either you need to set short_open_tag = Off for the directory you installed in, or go through the scripts and change <? to <?php
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For me also it showing some code after i click the "View Site"
here is code wat i got
Execute($sql); return; } // added to get just the value. apr-29-2006 polerio function GetConfigVar($name='') { list($dbconn) = Polerio::DBGetConn(); $table = Polerio::DBGetTables(); $v = $table['vars']; $vc = $table['vars_column']; $sql = " SELECT "; $sql .= " $vc[value] "; $sql .= " from $v WHERE $vc[name]='$name'"; //echo $sql; $recordSet = $dbconn->Execute($sql); list($value) = $recordSet->fields; return $value; } function SelectModuleVar($name='') { list($dbconn) = Polerio::DBGetConn(); $table = Polerio::DBGetTables(); $v = $table['vars']; $vc = $table['vars_column']; $sql = " SELECT "; $sql .= " $vc[id], $vc[category], $vc[user], $vc[group], $vc[name], $vc[value] "; $sql .= " from $v WHERE $vc[name]='$name'"; //echo $sql; $recordSet = $dbconn->Execute($sql); list($id, $category, $user, $group, $name, $value) = $recordSet->fields; $ret = array('id'=>$id, 'category'=>$category, 'user'=>$user, 'group'=>$group, 'name'=>$name, 'value'=>$value); //print_r($ret); return $ret; } function UpdateModuleVar($name='', $value='') { list($dbconn) = Polerio::DBGetConn(); $table = Polerio::DBGetTables(); $v = $table['vars']; $vc = $table['vars_column']; $sql = " UPDATE $v SET "; $sql .= " $vc[value]='$value'"; $sql .= " WHERE $vc[name]='$name'"; //echo $sql; $recordSet = $dbconn->Execute($sql); return; } function DeleteModuleVar() { list($dbconn) = Polerio::DBGetConn(); $table = Polerio::DBGetTables(); $v = $table['vars']; $vc = $table['vars_column']; } function Linux_Server() { if((ereg("Linux",getenv("SERVER_SOFTWARE"))) || (ereg("Unix",getenv("SERVER_SOFTWARE"))) ) return true; } function PostNuke() { global $op, $name; if($op && $name) return true; else return false; } /** * get base URI * @returns string * @return base URI */ function GetBaseURI() { global $HTTP_SERVER_VARS; // Get the name of this URI // Start of with REQUEST_URI if (isset($HTTP_SERVER_VARS['REQUEST_URI'])) { $path = $HTTP_SERVER_VARS['REQUEST_URI']; } else { $path = getenv('REQUEST_URI'); } if ((empty($path)) || (substr($path, -1, 1) == '/')) { // REQUEST_URI was empty or pointed to a path // Try looking at PATH_INFO $path = getenv('PATH_INFO'); if (empty($path)) { // No luck there either // Try SCRIPT_NAME if (isset($HTTP_SERVER_VARS['SCRIPT_NAME'])) { $path = $HTTP_SERVER_VARS['SCRIPT_NAME']; } else { $path = getenv('SCRIPT_NAME'); } } } $path = preg_replace('/[#\?].*/', '', $path); $path = dirname($path); if (preg_match('!^[/\\\]*$!', $path)) { $path = ''; } return $path; } function GetBaseURL() { global $HTTP_SERVER_VARS; if (empty($HTTP_SERVER_VARS['HTTP_HOST'])) { $server = getenv('HTTP_HOST'); } else { $server = $HTTP_SERVER_VARS['HTTP_HOST']; } $path = Polerio::GetBaseURI(); if(Polerio::PostNuke()) return "http://$server$path/"; return "http://$server$path/"; } /** * private function * @returns string */ function GetRoot() { global $HTTP_SERVER_VARS; if (empty($HTTP_SERVER_VARS['DOCUMENT_ROOT'])) { $root= getenv('DOCUMENT_ROOT'); } else { $root = $HTTP_SERVER_VARS['DOCUMENT_ROOT']; } return $root; } /** * generate c:/htodcs/modulename/polerio/ * generate /var/www/html/ . . . * @returns string */ function GetPolerioURI() { $PolerioModuleRoot = './polerio/'; if(PostNuke()) $PolerioModuleRoot = './modules/PhpMyLibrary/polerio/'; return $PolerioModuleRoot; } function GetPolerioURL() { global $name; // For postnuke if(Polerio::PostNuke()) $PolerioModuleRoot = Polerio::GetBaseURL().'modules/'.$name.'/polerio/'; else $PolerioModuleRoot = Polerio::GetBaseURL().'/polerio/'; return $PolerioModuleRoot; } /** * generate c:/htodocs/modulename/polerio/module/ . . . * generate /var/www/html/ . . . * @returns string */ function GetModuleURI() { return Polerio::GetPolerioURI().'PhpMyLibrary/'; } /** * generate http://modulename/polerio/module/index.php * @returns string */ function GetModuleURL() { global $op, $name, $file; // For postnuke compatibility if(Polerio::PostNuke()) $link = 'modules.php?op=modload&name='.$name.'&file=index'; else $link = 'index.php'; return Polerio::GetBaseURL().$link; } /** * to generate static color * @returns static color */ function useColora() { global $pmlconfig; if($pmlconfig['PnThOver']!=0) { $bcolor2 = $pmlconfig['bgcolor1']; $bcolor1 = $pmlconfig['bgcolor3']; } else { global $bgcolor1,$bgcolor2,$bgcolor3; $bcolor2 = $bgcolor1; $bcolor1 = $bgcolor3; } static $ColorValue; if($ColorValue==$bcolor2) $ColorValue=$bcolor1; else $ColorValue=$bcolor2; return($ColorValue); } /** * check to see if this is a local referral * @returns bool * @return true if locally referred, false if not */ function pnLocalReferer() { global $HTTP_SERVER_VARS; if (empty($HTTP_SERVER_VARS['HTTP_HOST'])) { $server = getenv('HTTP_HOST'); } else { $server = $HTTP_SERVER_VARS['HTTP_HOST']; } if (empty($HTTP_SERVER_VARS['HTTP_REFERER'])) { $referer = getenv('HTTP_REFERER'); } else { $referer = $HTTP_SERVER_VARS['HTTP_REFERER']; } if (preg_match("!^http://$server/!", $referer)) { return true; } else { return false; } } function Med() { $Med = "?"; if(Polerio::PostNuke()) $Med = "&"; return $Med; } // pn start function Init() { // proper error_repoting // E_ALL for development // error_reporting(E_ALL); // without warnings and notices for release //development error_reporting(E_ALL); //release //error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING); //phpinfo(); // Hack for some weird PHP systems that should have the // LC_* constants defined, but don't if (!defined('LC_TIME')) { define('LC_TIME', 'LC_TIME'); } // register globals anti-hack from mambo globals.php define( 'RG_EMULATION', 1 ); if (RG_EMULATION == 0) { // force register_globals = off Polerio::unregisterGlobals(); } else if (ini_get('register_globals') == 0) { // php.ini has register_globals = off and emulate = on Polerio::registerGlobals(); } else { // php.ini has register_globals = on and emulate = on // just check for spoofing Polerio::checkInputArray( $_FILES ); Polerio::checkInputArray( $_ENV ); Polerio::checkInputArray( $_GET ); Polerio::checkInputArray( $_POST ); Polerio::checkInputArray( $_COOKIE ); Polerio::checkInputArray( $_SERVER ); if (isset( $_SESSION )) { Polerio::checkInputArray( $_SESSION ); } } //Installation sub folder check, removed for work with SVN if (file_exists( 'installation/index.php' )) { define( '_INSTALL_CHECK', 1 ); include ('offline.php'); exit(); } // ADODB configuration define('POLERIO_ADODB_DIR',Polerio::GetPolerioURI()); include POLERIO_ADODB_DIR.'adodb/adodb.inc.php'; include POLERIO_ADODB_DIR.'adodb/tohtml.inc.php'; // Load filtering include_once Polerio::GetPolerioURI().'phpInputFilter/class.inputfilter.php'; // Load templating class include_once Polerio::GetPolerioURI().'patTemplate/patErrorManager.php'; include_once Polerio::GetPolerioURI().'patTemplate/patTemplate.php'; // Initialise and load configuration global $config; $config = array(); include Polerio::GetPolerioURI().'config/conf.php'; // Initialise and load tables global $table; $table = array(); include Polerio::GetPolerioURI().'lib/tables.php'; // Connect to database if (!Polerio::DBInit()) { die('Database initialisation failed'); } // Load filtering if (!Polerio::FilteringInit()) { die('Filtering initialisation failed'); } // Load pat Templating if (!Polerio::TemplateInit()) { die('Filtering initialisation failed'); } // Start Session to non-post-nuked site if(!Polerio::PostNuke()) { // session management include Polerio::GetPolerioURI().'lib/Session2.php'; if (Polerio::ConfigGetVar('anonymoussessions') || !empty($_REQUEST['POLERIOSID'])) { // Start session if (!SessionSetup()) { die('Session setup failed'); } if (!SessionInit()) { die('Session initialisation failed'); } } } //global $absolutePath; return true; } // Init() function TemplateInit() { global $template; $template = new patTemplate(); $tmpldir = Polerio::GetModuleURI().'templates'; $template->setBasedir($tmpldir); return true; } function Template() { global $template; return $template; } function FilteringInit() { global $filter; $filter = new InputFilter(); return true; } function Filtering() { global $filter; return $filter; } function InputFilter($input="") { $filter = Polerio::Filtering(); $ret = $filter->process($input); return $ret; } // aprl 30, 2006 by polerio. needed in block //$tags = array("em", "br"); //$attributes = array("title", "selected"); //http://cyberai.com/inputfilter/examples/string.php function CustomInputFilter($input="", $tags=array(), $attributes=array()) { $myFilter = new InputFilter($tags, $attributes); $ret = $myFilter->process($input); return $ret; } function DBInit() { // Get database parameters global $config; $dbtype = $config['dbtype']; $dbhost = $config['dbhost']; $dbname = $config['dbname']; $dbuname = $config['dbuname']; $dbpass = $config['dbpass']; // Database connection is a global (for now) global $dbconn; // Start connection $dbconn = ADONewConnection($dbtype); $dbh = $dbconn->Connect($dbhost, $dbuname, $dbpass, $dbname); if (!$dbh) { $dbpass = ""; die("$dbtype://$dbuname:$dbpass@$dbhost/$dbname failed to connect" . $dbconn->ErrorMsg()); } global $ADODB_FETCH_MODE; $ADODB_FETCH_MODE = ADODB_FETCH_NUM; // force oracle to a consistent date format for comparison methods later on if (strcmp($dbtype, 'oci8') == 0) { $dbconn->Execute("alter session set NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'"); } return true; } /** * get a list of database connections * @returns array * @redturn array of database connections */ function DBGetConn() { global $dbconn; return array($dbconn); } function DBGetTables() { global $table; return $table; } function PhpMyLibrary() { global $site_footer; $some = "@ PhpMyLibrary 2.0.3-1"; return $site_footer[1]."
"; } function Mail($recipient="", $subject="", $body="", $headers="") { mail($recipient, $subject, $body, $headers); } function GetBrowser() { /* Get the Browser data */ if((ereg("Nav", getenv("HTTP_USER_AGENT"))) || (ereg("Gold", getenv("HTTP_USER_AGENT"))) || (ereg("X11", getenv("HTTP_USER_AGENT"))) || (ereg("Mozilla", getenv("HTTP_USER_AGENT"))) || (ereg("Netscape", getenv("HTTP_USER_AGENT"))) AND (!ereg("MSIE", getenv("HTTP_USER_AGENT"))) AND (!ereg("Konqueror", getenv("HTTP_USER_AGENT")))) $browser = "Netscape"; // Opera needs to be above MSIE as it pretends to be an MSIE clone elseif(ereg("Opera", getenv("HTTP_USER_AGENT"))) $browser = "Opera"; elseif(ereg("MSIE", getenv("HTTP_USER_AGENT"))) $browser = "MSIE"; elseif(ereg("Lynx", getenv("HTTP_USER_AGENT"))) $browser = "Lynx"; elseif(ereg("WebTV", getenv("HTTP_USER_AGENT"))) $browser = "WebTV"; elseif(ereg("Konqueror", getenv("HTTP_USER_AGENT"))) $browser = "Konqueror"; elseif((eregi("bot", getenv("HTTP_USER_AGENT"))) || (ereg("Google", getenv("HTTP_USER_AGENT"))) || (ereg("Slurp", getenv("HTTP_USER_AGENT"))) || (ereg("Scooter", getenv("HTTP_USER_AGENT"))) || (eregi("Spider", getenv("HTTP_USER_AGENT"))) || (eregi("Infoseek", getenv("HTTP_USER_AGENT")))) $browser = "Bot"; else $browser = "Other"; return $browser; } function GetOS() { /* Get the Operating System data */ if(ereg("Win", getenv("HTTP_USER_AGENT"))) $os = "Windows"; elseif((ereg("Mac", getenv("HTTP_USER_AGENT"))) || (ereg("PPC", getenv("HTTP_USER_AGENT")))) $os = "Mac"; elseif(ereg("Linux", getenv("HTTP_USER_AGENT"))) $os = "Linux"; elseif(ereg("FreeBSD", getenv("HTTP_USER_AGENT"))) $os = "FreeBSD"; elseif(ereg("SunOS", getenv("HTTP_USER_AGENT"))) $os = "SunOS"; elseif(ereg("IRIX", getenv("HTTP_USER_AGENT"))) $os = "IRIX"; elseif(ereg("BeOS", getenv("HTTP_USER_AGENT"))) $os = "BeOS"; elseif(ereg("OS/2", getenv("HTTP_USER_AGENT"))) $os = "OS/2"; elseif(ereg("AIX", getenv("HTTP_USER_AGENT"))) $os = "AIX"; else $os = "Other"; return $os; } /* * I've read about microtime() * I think it is more useful than calling the random * The purpose of this is just to make distinct number * Advantage, fixed distance in microtime. rand is not. * srand((double)microtime()*1000000); * return time().rand(); * */ function TimeAndRandom() { $tim = microtime(); $mtime = substr($tim,11,10).substr($tim,2,8); return $mtime; } function CheckEmailPassed($email="") { if (!eregi ("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+\\.)+[a-z]{2,4}$", $email)) die ("Invalid Email"); return; } /** * Get a session variable * * @param name $ name of the session variable to get */ function SessionGetVar($name) { if(isset($name) && isset($_SESSION['PMLV' . $name])) { return $_SESSION['PMLV' . $name]; } return false; } /** * Set a session variable * * @param name $ name of the session variable to set * @param value $ value to set the named session variable */ function SessionSetVar($name, $value='') { if (!isset($name)) { return false; } $_SESSION['PMLV' . $name] = $value; return true; } /** * Delete a session variable * * @param name $ name of the session variable to delete * @return success or error */ function SessionDelVar($name) { // if empty or not set in both globals, return if (empty($name) || !(isset($_SESSION['PMLV' . $name]) || !isset($GLOBALS['PMLV' . $name]))){ return false; } // Unset the session var unset($_SESSION['PMLV' . $name]); // This unsets the variable if register globals are on unset($GLOBALS['PMLV' . $name]); return true; } function VarPrepForStore() { $resarray = array(); foreach (func_get_args() as $ourvar) { // Prepare var if (!get_magic_quotes_runtime()) { $ourvar = addslashes($ourvar); } // Add to array array_push($resarray, $ourvar); } // Return vars if (func_num_args() == 1) { return $resarray[0]; } else { return $resarray; } } function Redirect($redirecturl) { if (preg_match('!^http!', $redirecturl)) { // Absolute URL - simple redirect Header("Location: $redirecturl"); return; } else { // Removing leading slashes from redirect url $redirecturl = preg_replace('!^/*!', '', $redirecturl); // Get base URL $baseurl = Polerio::GetBaseURL(); Header("Location: $baseurl$redirecturl"); } } /* * Added sep 24, 2002 for use in selecting color * returns array bgcolor */ function SelectColor() { global $pmlconfig; if($pmlconfig['PnThOver']!=0) { $bgcolor[3] = $pmlconfig['bgcolor3']; $bgcolor[2] = $pmlconfig['bgcolor2']; $bgcolor[1] = $pmlconfig['bgcolor1']; } else { global $bgcolor1,$bgcolor2,$bgcolor3; $bgcolor[3] = $bgcolor3; $bgcolor[2] = $bgcolor2; $bgcolor[1] = $bgcolor1; } return $bgcolor; } /** * clean user input *
* Gets a global variable, cleaning it up to try to ensure that * hack attacks don't work * @param var name of variable to get * @param ... * @returns string/array * @return prepared variable if only one variable passed * in, otherwise an array of prepared variables */ function VarCleanFromInput() { $search = array('||si', '||si', '||si', '||si', '||si', '||si', '||si', '|STYLE\s*=\s*"[^"]*"|si'); $replace = array(''); $resarray = array(); foreach (func_get_args() as $var) { // Get var global $$var; if (empty($var)) { return; } $ourvar = $$var; if (!isset($ourvar)) { array_push($resarray, NULL); continue; } if (empty($ourvar)) { array_push($resarray, $ourvar); continue; } // Add to result array array_push($resarray, $ourvar); } // Return vars if (func_num_args() == 1) { return $resarray[0]; } else { return $resarray; } } /* Added some security scripts do elimiante simultaneous send error which * cause to much delete, update, or insert */ /** * generate an authorisation key *
* The authorisation key is used to confirm that actions requested by a * particular user have followed the correct path. Any stage that an * action could be made (e.g. a form or a 'delete' button) this function * must be called and the resultant string passed to the client as either * a GET or POST variable. When the action then takes place it first calls * pnSecConfirmAuthKey() to ensure that the operation has * indeed been manually requested by the user and that the key is valid * * @public * @param modname the module this authorisation key is for (optional) * @returns string * @return an encrypted key for use in authorisation of operations */ function SecGenAuthKey($modname='') { if (empty($modname)) { $modname = Polerio::VarCleanFromInput('module'); } // Date gives extra security but leave it out for now // $key = pnSessionGetVar('rand') . $modname . date ('YmdGi'); $key = Polerio::SessionGetVar('rand') . $modname; // Encrypt key $authid = md5($key); // Return encrypted key return $authid; } /** * confirm an authorisation key is valid *
* See description of pnSecGenAuthKey for information on * this function * @public * @returns bool * @return true if the key is valid, false if it is not */ function SecConfirmAuthKey($authid='') { // Regenerate static part of key $partkey = Polerio::SessionGetVar('rand'); // Not using time-sensitive keys for the moment // // Key life is 5 minutes, so search backwards and forwards 5 // // minutes to see if there is a match anywhere // for ($i=-5; $i<=5; $i++) { // $testdate = mktime(date('G'), date('i')+$i, 0, date('m') , date('d'), date('Y')); // // $testauthid = md5($partkey . date('YmdGi', $testdate)); // if ($testauthid == $authid) { // // Match // // // We've used up the current random // // number, make up a new one // srand((double)microtime()*1000000); // pnSessionSetVar('rand', rand()); // // return true; // } // } if ((md5($partkey)) == $authid) { // Match - generate new random number for next key and leave happy srand((double)microtime()*1000000); Polerio::SessionSetVar('rand', rand()); return true; } // Not found, assume invalid return false; } /** * To activate multi-admin capability * the program should get his/her gid or group id * The uid resides in the session */ function SelectGID() { $id = Polerio::SessionGetVar('uid'); if(empty($id)) $id = 0; $table = Polerio::DBGetTables(); $users = $table['users']; $users_col = $table['users_column']; list($dbconn) = Polerio::DBGetConn(); $sql="select $users_col[gid] from $users where $users_col[uid]=$id"; $result = $dbconn->Execute($sql); list($gid) = $result->fields; return $gid; } // taken from php.net // function _make_seed() { list($usec, $sec) = explode(' ', microtime()); return (float) $sec + ((float) $usec * 100000); } function makePass() { define('_SYLLABELS', "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789"); define('_MAKEPASS_LEN', 8); define('_MAKEPASS_BOX', 5000); // init some $result = ''; mt_srand(Polerio::_make_seed()); $syllabels = _SYLLABELS; $len = strlen($syllabels) - 1; $box = ""; // create box for($i = 0; $i < _MAKEPASS_BOX; $i++) { $ch = $syllabels[mt_rand(0, $len)]; // about 20% upper case letters if (mt_rand(0, $len) % 5 == 1) { $ch = strtoupper($ch); } // filling up the box with random chars $box .= $ch; } // now collect password from box for($i = 0; $i < _MAKEPASS_LEN; $i++) { $result .= $box[mt_rand(0, (_MAKEPASS_BOX - 1))]; } return $result; } // function makePass //================globals.php /** * @version $Id: globals.php 1145 2005-11-20 22:57:55Z Jinx $ * @package Joomla * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * Joomla! is free software and parts of it may contain or be derived from the * GNU General Public License or other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ /** * Use 1 to emulate register_globals = on * * Use 0 to emulate regsiter_globals = off */ /** * Adds an array to the GLOBALS array and checks that the GLOBALS variable is * not being attacked * @param array * @param boolean True if the array is to be added to the GLOBALS */ function checkInputArray( &$array, $globalise=false ) { static $banned = array( '_files', '_env', '_get', '_post', '_cookie', '_server', '_session', 'globals' ); foreach ($array as $key => $value) { if (in_array( strtolower( $key ), $banned ) ) { die( 'Illegal variable ' . implode( ' or ', $banned ) . ' passed to script.' ); } if ($globalise) { $GLOBALS[$key] = $value; } } } /** * Emulates register globals = off */ function unregisterGlobals () { Polerio::checkInputArray( $_FILES ); Polerio::checkInputArray( $_ENV ); Polerio::checkInputArray( $_GET ); Polerio::checkInputArray( $_POST ); Polerio::checkInputArray( $_COOKIE ); Polerio::checkInputArray( $_SERVER ); if (isset( $_SESSION )) { Polerio::checkInputArray( $_SESSION ); } $REQUEST = $_REQUEST; $GET = $_GET; $POST = $_POST; $COOKIE = $_COOKIE; if (isset ( $_SESSION )) { $SESSION = $_SESSION; } $FILES = $_FILES; $ENV = $_ENV; $SERVER = $_SERVER; foreach ($GLOBALS as $key => $value) { if ( $key != 'GLOBALS' ) { unset ( $GLOBALS [ $key ] ); } } $_REQUEST = $REQUEST; $_GET = $GET; $_POST = $POST; $_COOKIE = $COOKIE; if (isset ( $SESSION )) { $_SESSION = $SESSION; } $_FILES = $FILES; $_ENV = $ENV; $_SERVER = $SERVER; } /** * Emulates register globals = on */ function registerGlobals() { Polerio::checkInputArray( $_FILES, true ); Polerio::checkInputArray( $_ENV, true ); Polerio::checkInputArray( $_GET, true ); Polerio::checkInputArray( $_POST, true ); Polerio::checkInputArray( $_COOKIE, true ); Polerio::checkInputArray( $_SERVER, true ); if (isset( $_SESSION )) { Polerio::checkInputArray( $_SESSION, true ); } foreach ($_FILES as $key => $value){ $GLOBALS[$key] = $_FILES[$key]['tmp_name']; foreach ($value as $ext => $value2){ $key2 = $key . '_' . $ext; $GLOBALS[$key2] = $value2; } } } //================pnAPI.php postnuke 02212006 /** * Functions */ /** * get a configuration variable * * @param name $ the name of the variable * @return mixed value of the variable, or false on failure */ function ConfigGetVar($name) { if (!isset($name)) { return null; } if (isset($GLOBALS['polerioconfig'][$name])) { $result = $GLOBALS['polerioconfig'][$name]; } if (!isset($result)) { return null; } return $result; } /** * set a configuration variable * * @param name $ the name of the variable * @param value $ the value of the variable * @return bool true on success, false on failure */ function ConfigSetVar($name, $value='') { $name = isset($name) ? (string)$name : ''; // The database parameter are not allowed to change if (empty($name) || ($name == 'dbtype') || ($name == 'dbhost') || ($name == 'dbuname') || ($name == 'dbpass') || ($name == 'dbname') || ($name == 'system') || ($name == 'prefix') || ($name == 'encoded')) { return false; } // set the variable $GLOBALS['polerioconfig'][$name] = $value; return true; } /** * delete a configuration variable * * @param name $ the name of the variable * @return bool true on success, false on failure */ function ConfigDelVar($name) { if (!isset($name)) { return false; } // The database parameter are not allowed to be deleted if (empty($name) || ($name == 'dbtype') || ($name == 'dbhost') || ($name == 'dbuname') || ($name == 'dbpass') || ($name == 'dbname') || ($name == 'system') || ($name == 'prefix') || ($name == 'encoded')) { return false; } // Update my vars unset($GLOBALS['polerioconfig'][$name]); // success return true; } /** * Gets a server variable * * Returns the value of $name from $_SERVER array. * Accepted values for $name are exactly the ones described by the * {@link http://www.php.net/manual/en/reserved.variables.html#reserved.variables.server PHP manual}. * If the server variable doesn't exist void is returned. * * @author Marco Canini , Michel Dalle * @access public * @param name string the name of the variable * @return mixed value of the variable */ function ServerGetVar($name) { // Check the relevant superglobals if (!empty($name) && isset($_SERVER[$name])) { return $_SERVER[$name]; } return null; // we found nothing here } } //end class Polerio ?> offset = ""; } function HeaderOpen() { $Header = " Pi
"; } function Login() { $login ='
User login
Username:
Password:
Remember me:
Dear all,
I have installed PhpmyLibrary and after installation it asks to remove the install folder. After removing the install folder i get a page full of code and somewhere in that long page he asks for username and password. If I give the username and password it says "you are not authorized to view this page". Please do help me in this regard.
Waiting for the reply at the earliest...
There seems to be a mixture of short and long open tags used throughout the application - either you need to set short_open_tag = Off for the directory you installed in, or go through the scripts and change <? to <?php
For me also it showing some code after i click the "View Site"
here is code wat i got
Execute($sql); return; } // added to get just the value. apr-29-2006 polerio function GetConfigVar($name='') { list($dbconn) = Polerio::DBGetConn(); $table = Polerio::DBGetTables(); $v = $table['vars']; $vc = $table['vars_column']; $sql = " SELECT "; $sql .= " $vc[value] "; $sql .= " from $v WHERE $vc[name]='$name'"; //echo $sql; $recordSet = $dbconn->Execute($sql); list($value) = $recordSet->fields; return $value; } function SelectModuleVar($name='') { list($dbconn) = Polerio::DBGetConn(); $table = Polerio::DBGetTables(); $v = $table['vars']; $vc = $table['vars_column']; $sql = " SELECT "; $sql .= " $vc[id], $vc[category], $vc[user], $vc[group], $vc[name], $vc[value] "; $sql .= " from $v WHERE $vc[name]='$name'"; //echo $sql; $recordSet = $dbconn->Execute($sql); list($id, $category, $user, $group, $name, $value) = $recordSet->fields; $ret = array('id'=>$id, 'category'=>$category, 'user'=>$user, 'group'=>$group, 'name'=>$name, 'value'=>$value); //print_r($ret); return $ret; } function UpdateModuleVar($name='', $value='') { list($dbconn) = Polerio::DBGetConn(); $table = Polerio::DBGetTables(); $v = $table['vars']; $vc = $table['vars_column']; $sql = " UPDATE $v SET "; $sql .= " $vc[value]='$value'"; $sql .= " WHERE $vc[name]='$name'"; //echo $sql; $recordSet = $dbconn->Execute($sql); return; } function DeleteModuleVar() { list($dbconn) = Polerio::DBGetConn(); $table = Polerio::DBGetTables(); $v = $table['vars']; $vc = $table['vars_column']; } function Linux_Server() { if((ereg("Linux",getenv("SERVER_SOFTWARE"))) || (ereg("Unix",getenv("SERVER_SOFTWARE"))) ) return true; } function PostNuke() { global $op, $name; if($op && $name) return true; else return false; } /** * get base URI * @returns string * @return base URI */ function GetBaseURI() { global $HTTP_SERVER_VARS; // Get the name of this URI // Start of with REQUEST_URI if (isset($HTTP_SERVER_VARS['REQUEST_URI'])) { $path = $HTTP_SERVER_VARS['REQUEST_URI']; } else { $path = getenv('REQUEST_URI'); } if ((empty($path)) || (substr($path, -1, 1) == '/')) { // REQUEST_URI was empty or pointed to a path // Try looking at PATH_INFO $path = getenv('PATH_INFO'); if (empty($path)) { // No luck there either // Try SCRIPT_NAME if (isset($HTTP_SERVER_VARS['SCRIPT_NAME'])) { $path = $HTTP_SERVER_VARS['SCRIPT_NAME']; } else { $path = getenv('SCRIPT_NAME'); } } } $path = preg_replace('/[#\?].*/', '', $path); $path = dirname($path); if (preg_match('!^[/\\\]*$!', $path)) { $path = ''; } return $path; } function GetBaseURL() { global $HTTP_SERVER_VARS; if (empty($HTTP_SERVER_VARS['HTTP_HOST'])) { $server = getenv('HTTP_HOST'); } else { $server = $HTTP_SERVER_VARS['HTTP_HOST']; } $path = Polerio::GetBaseURI(); if(Polerio::PostNuke()) return "http://$server$path/"; return "http://$server$path/"; } /** * private function * @returns string */ function GetRoot() { global $HTTP_SERVER_VARS; if (empty($HTTP_SERVER_VARS['DOCUMENT_ROOT'])) { $root= getenv('DOCUMENT_ROOT'); } else { $root = $HTTP_SERVER_VARS['DOCUMENT_ROOT']; } return $root; } /** * generate c:/htodcs/modulename/polerio/ * generate /var/www/html/ . . . * @returns string */ function GetPolerioURI() { $PolerioModuleRoot = './polerio/'; if(PostNuke()) $PolerioModuleRoot = './modules/PhpMyLibrary/polerio/'; return $PolerioModuleRoot; } function GetPolerioURL() { global $name; // For postnuke if(Polerio::PostNuke()) $PolerioModuleRoot = Polerio::GetBaseURL().'modules/'.$name.'/polerio/'; else $PolerioModuleRoot = Polerio::GetBaseURL().'/polerio/'; return $PolerioModuleRoot; } /** * generate c:/htodocs/modulename/polerio/module/ . . . * generate /var/www/html/ . . . * @returns string */ function GetModuleURI() { return Polerio::GetPolerioURI().'PhpMyLibrary/'; } /** * generate http://modulename/polerio/module/index.php * @returns string */ function GetModuleURL() { global $op, $name, $file; // For postnuke compatibility if(Polerio::PostNuke()) $link = 'modules.php?op=modload&name='.$name.'&file=index'; else $link = 'index.php'; return Polerio::GetBaseURL().$link; } /** * to generate static color * @returns static color */ function useColora() { global $pmlconfig; if($pmlconfig['PnThOver']!=0) { $bcolor2 = $pmlconfig['bgcolor1']; $bcolor1 = $pmlconfig['bgcolor3']; } else { global $bgcolor1,$bgcolor2,$bgcolor3; $bcolor2 = $bgcolor1; $bcolor1 = $bgcolor3; } static $ColorValue; if($ColorValue==$bcolor2) $ColorValue=$bcolor1; else $ColorValue=$bcolor2; return($ColorValue); } /** * check to see if this is a local referral * @returns bool * @return true if locally referred, false if not */ function pnLocalReferer() { global $HTTP_SERVER_VARS; if (empty($HTTP_SERVER_VARS['HTTP_HOST'])) { $server = getenv('HTTP_HOST'); } else { $server = $HTTP_SERVER_VARS['HTTP_HOST']; } if (empty($HTTP_SERVER_VARS['HTTP_REFERER'])) { $referer = getenv('HTTP_REFERER'); } else { $referer = $HTTP_SERVER_VARS['HTTP_REFERER']; } if (preg_match("!^http://$server/!", $referer)) { return true; } else { return false; } } function Med() { $Med = "?"; if(Polerio::PostNuke()) $Med = "&"; return $Med; } // pn start function Init() { // proper error_repoting // E_ALL for development // error_reporting(E_ALL); // without warnings and notices for release //development error_reporting(E_ALL); //release //error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING); //phpinfo(); // Hack for some weird PHP systems that should have the // LC_* constants defined, but don't if (!defined('LC_TIME')) { define('LC_TIME', 'LC_TIME'); } // register globals anti-hack from mambo globals.php define( 'RG_EMULATION', 1 ); if (RG_EMULATION == 0) { // force register_globals = off Polerio::unregisterGlobals(); } else if (ini_get('register_globals') == 0) { // php.ini has register_globals = off and emulate = on Polerio::registerGlobals(); } else { // php.ini has register_globals = on and emulate = on // just check for spoofing Polerio::checkInputArray( $_FILES ); Polerio::checkInputArray( $_ENV ); Polerio::checkInputArray( $_GET ); Polerio::checkInputArray( $_POST ); Polerio::checkInputArray( $_COOKIE ); Polerio::checkInputArray( $_SERVER ); if (isset( $_SESSION )) { Polerio::checkInputArray( $_SESSION ); } } //Installation sub folder check, removed for work with SVN if (file_exists( 'installation/index.php' )) { define( '_INSTALL_CHECK', 1 ); include ('offline.php'); exit(); } // ADODB configuration define('POLERIO_ADODB_DIR',Polerio::GetPolerioURI()); include POLERIO_ADODB_DIR.'adodb/adodb.inc.php'; include POLERIO_ADODB_DIR.'adodb/tohtml.inc.php'; // Load filtering include_once Polerio::GetPolerioURI().'phpInputFilter/class.inputfilter.php'; // Load templating class include_once Polerio::GetPolerioURI().'patTemplate/patErrorManager.php'; include_once Polerio::GetPolerioURI().'patTemplate/patTemplate.php'; // Initialise and load configuration global $config; $config = array(); include Polerio::GetPolerioURI().'config/conf.php'; // Initialise and load tables global $table; $table = array(); include Polerio::GetPolerioURI().'lib/tables.php'; // Connect to database if (!Polerio::DBInit()) { die('Database initialisation failed'); } // Load filtering if (!Polerio::FilteringInit()) { die('Filtering initialisation failed'); } // Load pat Templating if (!Polerio::TemplateInit()) { die('Filtering initialisation failed'); } // Start Session to non-post-nuked site if(!Polerio::PostNuke()) { // session management include Polerio::GetPolerioURI().'lib/Session2.php'; if (Polerio::ConfigGetVar('anonymoussessions') || !empty($_REQUEST['POLERIOSID'])) { // Start session if (!SessionSetup()) { die('Session setup failed'); } if (!SessionInit()) { die('Session initialisation failed'); } } } //global $absolutePath; return true; } // Init() function TemplateInit() { global $template; $template = new patTemplate(); $tmpldir = Polerio::GetModuleURI().'templates'; $template->setBasedir($tmpldir); return true; } function Template() { global $template; return $template; } function FilteringInit() { global $filter; $filter = new InputFilter(); return true; } function Filtering() { global $filter; return $filter; } function InputFilter($input="") { $filter = Polerio::Filtering(); $ret = $filter->process($input); return $ret; } // aprl 30, 2006 by polerio. needed in block //$tags = array("em", "br"); //$attributes = array("title", "selected"); //http://cyberai.com/inputfilter/examples/string.php function CustomInputFilter($input="", $tags=array(), $attributes=array()) { $myFilter = new InputFilter($tags, $attributes); $ret = $myFilter->process($input); return $ret; } function DBInit() { // Get database parameters global $config; $dbtype = $config['dbtype']; $dbhost = $config['dbhost']; $dbname = $config['dbname']; $dbuname = $config['dbuname']; $dbpass = $config['dbpass']; // Database connection is a global (for now) global $dbconn; // Start connection $dbconn = ADONewConnection($dbtype); $dbh = $dbconn->Connect($dbhost, $dbuname, $dbpass, $dbname); if (!$dbh) { $dbpass = ""; die("$dbtype://$dbuname:$dbpass@$dbhost/$dbname failed to connect" . $dbconn->ErrorMsg()); } global $ADODB_FETCH_MODE; $ADODB_FETCH_MODE = ADODB_FETCH_NUM; // force oracle to a consistent date format for comparison methods later on if (strcmp($dbtype, 'oci8') == 0) { $dbconn->Execute("alter session set NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'"); } return true; } /** * get a list of database connections * @returns array * @redturn array of database connections */ function DBGetConn() { global $dbconn; return array($dbconn); } function DBGetTables() { global $table; return $table; } function PhpMyLibrary() { global $site_footer; $some = "@ PhpMyLibrary 2.0.3-1"; return $site_footer[1]."
"; } function Mail($recipient="", $subject="", $body="", $headers="") { mail($recipient, $subject, $body, $headers); } function GetBrowser() { /* Get the Browser data */ if((ereg("Nav", getenv("HTTP_USER_AGENT"))) || (ereg("Gold", getenv("HTTP_USER_AGENT"))) || (ereg("X11", getenv("HTTP_USER_AGENT"))) || (ereg("Mozilla", getenv("HTTP_USER_AGENT"))) || (ereg("Netscape", getenv("HTTP_USER_AGENT"))) AND (!ereg("MSIE", getenv("HTTP_USER_AGENT"))) AND (!ereg("Konqueror", getenv("HTTP_USER_AGENT")))) $browser = "Netscape"; // Opera needs to be above MSIE as it pretends to be an MSIE clone elseif(ereg("Opera", getenv("HTTP_USER_AGENT"))) $browser = "Opera"; elseif(ereg("MSIE", getenv("HTTP_USER_AGENT"))) $browser = "MSIE"; elseif(ereg("Lynx", getenv("HTTP_USER_AGENT"))) $browser = "Lynx"; elseif(ereg("WebTV", getenv("HTTP_USER_AGENT"))) $browser = "WebTV"; elseif(ereg("Konqueror", getenv("HTTP_USER_AGENT"))) $browser = "Konqueror"; elseif((eregi("bot", getenv("HTTP_USER_AGENT"))) || (ereg("Google", getenv("HTTP_USER_AGENT"))) || (ereg("Slurp", getenv("HTTP_USER_AGENT"))) || (ereg("Scooter", getenv("HTTP_USER_AGENT"))) || (eregi("Spider", getenv("HTTP_USER_AGENT"))) || (eregi("Infoseek", getenv("HTTP_USER_AGENT")))) $browser = "Bot"; else $browser = "Other"; return $browser; } function GetOS() { /* Get the Operating System data */ if(ereg("Win", getenv("HTTP_USER_AGENT"))) $os = "Windows"; elseif((ereg("Mac", getenv("HTTP_USER_AGENT"))) || (ereg("PPC", getenv("HTTP_USER_AGENT")))) $os = "Mac"; elseif(ereg("Linux", getenv("HTTP_USER_AGENT"))) $os = "Linux"; elseif(ereg("FreeBSD", getenv("HTTP_USER_AGENT"))) $os = "FreeBSD"; elseif(ereg("SunOS", getenv("HTTP_USER_AGENT"))) $os = "SunOS"; elseif(ereg("IRIX", getenv("HTTP_USER_AGENT"))) $os = "IRIX"; elseif(ereg("BeOS", getenv("HTTP_USER_AGENT"))) $os = "BeOS"; elseif(ereg("OS/2", getenv("HTTP_USER_AGENT"))) $os = "OS/2"; elseif(ereg("AIX", getenv("HTTP_USER_AGENT"))) $os = "AIX"; else $os = "Other"; return $os; } /* * I've read about microtime() * I think it is more useful than calling the random * The purpose of this is just to make distinct number * Advantage, fixed distance in microtime. rand is not. * srand((double)microtime()*1000000); * return time().rand(); * */ function TimeAndRandom() { $tim = microtime(); $mtime = substr($tim,11,10).substr($tim,2,8); return $mtime; } function CheckEmailPassed($email="") { if (!eregi ("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+\\.)+[a-z]{2,4}$", $email)) die ("Invalid Email"); return; } /** * Get a session variable * * @param name $ name of the session variable to get */ function SessionGetVar($name) { if(isset($name) && isset($_SESSION['PMLV' . $name])) { return $_SESSION['PMLV' . $name]; } return false; } /** * Set a session variable * * @param name $ name of the session variable to set * @param value $ value to set the named session variable */ function SessionSetVar($name, $value='') { if (!isset($name)) { return false; } $_SESSION['PMLV' . $name] = $value; return true; } /** * Delete a session variable * * @param name $ name of the session variable to delete * @return success or error */ function SessionDelVar($name) { // if empty or not set in both globals, return if (empty($name) || !(isset($_SESSION['PMLV' . $name]) || !isset($GLOBALS['PMLV' . $name]))){ return false; } // Unset the session var unset($_SESSION['PMLV' . $name]); // This unsets the variable if register globals are on unset($GLOBALS['PMLV' . $name]); return true; } function VarPrepForStore() { $resarray = array(); foreach (func_get_args() as $ourvar) { // Prepare var if (!get_magic_quotes_runtime()) { $ourvar = addslashes($ourvar); } // Add to array array_push($resarray, $ourvar); } // Return vars if (func_num_args() == 1) { return $resarray[0]; } else { return $resarray; } } function Redirect($redirecturl) { if (preg_match('!^http!', $redirecturl)) { // Absolute URL - simple redirect Header("Location: $redirecturl"); return; } else { // Removing leading slashes from redirect url $redirecturl = preg_replace('!^/*!', '', $redirecturl); // Get base URL $baseurl = Polerio::GetBaseURL(); Header("Location: $baseurl$redirecturl"); } } /* * Added sep 24, 2002 for use in selecting color * returns array bgcolor */ function SelectColor() { global $pmlconfig; if($pmlconfig['PnThOver']!=0) { $bgcolor[3] = $pmlconfig['bgcolor3']; $bgcolor[2] = $pmlconfig['bgcolor2']; $bgcolor[1] = $pmlconfig['bgcolor1']; } else { global $bgcolor1,$bgcolor2,$bgcolor3; $bgcolor[3] = $bgcolor3; $bgcolor[2] = $bgcolor2; $bgcolor[1] = $bgcolor1; } return $bgcolor; } /** * clean user input *
* Gets a global variable, cleaning it up to try to ensure that * hack attacks don't work * @param var name of variable to get * @param ... * @returns string/array * @return prepared variable if only one variable passed * in, otherwise an array of prepared variables */ function VarCleanFromInput() { $search = array('||si', '||si', '||si', '||si', '||si', '||si', '||si', '|STYLE\s*=\s*"[^"]*"|si'); $replace = array(''); $resarray = array(); foreach (func_get_args() as $var) { // Get var global $$var; if (empty($var)) { return; } $ourvar = $$var; if (!isset($ourvar)) { array_push($resarray, NULL); continue; } if (empty($ourvar)) { array_push($resarray, $ourvar); continue; } // Add to result array array_push($resarray, $ourvar); } // Return vars if (func_num_args() == 1) { return $resarray[0]; } else { return $resarray; } } /* Added some security scripts do elimiante simultaneous send error which * cause to much delete, update, or insert */ /** * generate an authorisation key *
* The authorisation key is used to confirm that actions requested by a * particular user have followed the correct path. Any stage that an * action could be made (e.g. a form or a 'delete' button) this function * must be called and the resultant string passed to the client as either * a GET or POST variable. When the action then takes place it first calls * pnSecConfirmAuthKey() to ensure that the operation has * indeed been manually requested by the user and that the key is valid * * @public * @param modname the module this authorisation key is for (optional) * @returns string * @return an encrypted key for use in authorisation of operations */ function SecGenAuthKey($modname='') { if (empty($modname)) { $modname = Polerio::VarCleanFromInput('module'); } // Date gives extra security but leave it out for now // $key = pnSessionGetVar('rand') . $modname . date ('YmdGi'); $key = Polerio::SessionGetVar('rand') . $modname; // Encrypt key $authid = md5($key); // Return encrypted key return $authid; } /** * confirm an authorisation key is valid *
* See description of pnSecGenAuthKey for information on * this function * @public * @returns bool * @return true if the key is valid, false if it is not */ function SecConfirmAuthKey($authid='') { // Regenerate static part of key $partkey = Polerio::SessionGetVar('rand'); // Not using time-sensitive keys for the moment // // Key life is 5 minutes, so search backwards and forwards 5 // // minutes to see if there is a match anywhere // for ($i=-5; $i<=5; $i++) { // $testdate = mktime(date('G'), date('i')+$i, 0, date('m') , date('d'), date('Y')); // // $testauthid = md5($partkey . date('YmdGi', $testdate)); // if ($testauthid == $authid) { // // Match // // // We've used up the current random // // number, make up a new one // srand((double)microtime()*1000000); // pnSessionSetVar('rand', rand()); // // return true; // } // } if ((md5($partkey)) == $authid) { // Match - generate new random number for next key and leave happy srand((double)microtime()*1000000); Polerio::SessionSetVar('rand', rand()); return true; } // Not found, assume invalid return false; } /** * To activate multi-admin capability * the program should get his/her gid or group id * The uid resides in the session */ function SelectGID() { $id = Polerio::SessionGetVar('uid'); if(empty($id)) $id = 0; $table = Polerio::DBGetTables(); $users = $table['users']; $users_col = $table['users_column']; list($dbconn) = Polerio::DBGetConn(); $sql="select $users_col[gid] from $users where $users_col[uid]=$id"; $result = $dbconn->Execute($sql); list($gid) = $result->fields; return $gid; } // taken from php.net // function _make_seed() { list($usec, $sec) = explode(' ', microtime()); return (float) $sec + ((float) $usec * 100000); } function makePass() { define('_SYLLABELS', "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789"); define('_MAKEPASS_LEN', 8); define('_MAKEPASS_BOX', 5000); // init some $result = ''; mt_srand(Polerio::_make_seed()); $syllabels = _SYLLABELS; $len = strlen($syllabels) - 1; $box = ""; // create box for($i = 0; $i < _MAKEPASS_BOX; $i++) { $ch = $syllabels[mt_rand(0, $len)]; // about 20% upper case letters if (mt_rand(0, $len) % 5 == 1) { $ch = strtoupper($ch); } // filling up the box with random chars $box .= $ch; } // now collect password from box for($i = 0; $i < _MAKEPASS_LEN; $i++) { $result .= $box[mt_rand(0, (_MAKEPASS_BOX - 1))]; } return $result; } // function makePass //================globals.php /** * @version $Id: globals.php 1145 2005-11-20 22:57:55Z Jinx $ * @package Joomla * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * Joomla! is free software and parts of it may contain or be derived from the * GNU General Public License or other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ /** * Use 1 to emulate register_globals = on * * Use 0 to emulate regsiter_globals = off */ /** * Adds an array to the GLOBALS array and checks that the GLOBALS variable is * not being attacked * @param array * @param boolean True if the array is to be added to the GLOBALS */ function checkInputArray( &$array, $globalise=false ) { static $banned = array( '_files', '_env', '_get', '_post', '_cookie', '_server', '_session', 'globals' ); foreach ($array as $key => $value) { if (in_array( strtolower( $key ), $banned ) ) { die( 'Illegal variable ' . implode( ' or ', $banned ) . ' passed to script.' ); } if ($globalise) { $GLOBALS[$key] = $value; } } } /** * Emulates register globals = off */ function unregisterGlobals () { Polerio::checkInputArray( $_FILES ); Polerio::checkInputArray( $_ENV ); Polerio::checkInputArray( $_GET ); Polerio::checkInputArray( $_POST ); Polerio::checkInputArray( $_COOKIE ); Polerio::checkInputArray( $_SERVER ); if (isset( $_SESSION )) { Polerio::checkInputArray( $_SESSION ); } $REQUEST = $_REQUEST; $GET = $_GET; $POST = $_POST; $COOKIE = $_COOKIE; if (isset ( $_SESSION )) { $SESSION = $_SESSION; } $FILES = $_FILES; $ENV = $_ENV; $SERVER = $_SERVER; foreach ($GLOBALS as $key => $value) { if ( $key != 'GLOBALS' ) { unset ( $GLOBALS [ $key ] ); } } $_REQUEST = $REQUEST; $_GET = $GET; $_POST = $POST; $_COOKIE = $COOKIE; if (isset ( $SESSION )) { $_SESSION = $SESSION; } $_FILES = $FILES; $_ENV = $ENV; $_SERVER = $SERVER; } /** * Emulates register globals = on */ function registerGlobals() { Polerio::checkInputArray( $_FILES, true ); Polerio::checkInputArray( $_ENV, true ); Polerio::checkInputArray( $_GET, true ); Polerio::checkInputArray( $_POST, true ); Polerio::checkInputArray( $_COOKIE, true ); Polerio::checkInputArray( $_SERVER, true ); if (isset( $_SESSION )) { Polerio::checkInputArray( $_SESSION, true ); } foreach ($_FILES as $key => $value){ $GLOBALS[$key] = $_FILES[$key]['tmp_name']; foreach ($value as $ext => $value2){ $key2 = $key . '_' . $ext; $GLOBALS[$key2] = $value2; } } } //================pnAPI.php postnuke 02212006 /** * Functions */ /** * get a configuration variable * * @param name $ the name of the variable * @return mixed value of the variable, or false on failure */ function ConfigGetVar($name) { if (!isset($name)) { return null; } if (isset($GLOBALS['polerioconfig'][$name])) { $result = $GLOBALS['polerioconfig'][$name]; } if (!isset($result)) { return null; } return $result; } /** * set a configuration variable * * @param name $ the name of the variable * @param value $ the value of the variable * @return bool true on success, false on failure */ function ConfigSetVar($name, $value='') { $name = isset($name) ? (string)$name : ''; // The database parameter are not allowed to change if (empty($name) || ($name == 'dbtype') || ($name == 'dbhost') || ($name == 'dbuname') || ($name == 'dbpass') || ($name == 'dbname') || ($name == 'system') || ($name == 'prefix') || ($name == 'encoded')) { return false; } // set the variable $GLOBALS['polerioconfig'][$name] = $value; return true; } /** * delete a configuration variable * * @param name $ the name of the variable * @return bool true on success, false on failure */ function ConfigDelVar($name) { if (!isset($name)) { return false; } // The database parameter are not allowed to be deleted if (empty($name) || ($name == 'dbtype') || ($name == 'dbhost') || ($name == 'dbuname') || ($name == 'dbpass') || ($name == 'dbname') || ($name == 'system') || ($name == 'prefix') || ($name == 'encoded')) { return false; } // Update my vars unset($GLOBALS['polerioconfig'][$name]); // success return true; } /** * Gets a server variable * * Returns the value of $name from $_SERVER array. * Accepted values for $name are exactly the ones described by the * {@link http://www.php.net/manual/en/reserved.variables.html#reserved.variables.server PHP manual}. * If the server variable doesn't exist void is returned. * * @author Marco Canini , Michel Dalle * @access public * @param name string the name of the variable * @return mixed value of the variable */ function ServerGetVar($name) { // Check the relevant superglobals if (!empty($name) && isset($_SERVER[$name])) { return $_SERVER[$name]; } return null; // we found nothing here } } //end class Polerio ?> offset = ""; } function HeaderOpen() { $Header = " Pi
"; } function Login() { $login ='
User login
Username:
Password:
Remember me:
'; return $login; } function print_menu() { global $PHP_SELF; global $SITE_URL; global $ADMIN_MODE; global $HOME_URL; global $HOUR; global $MINUTE; global $conf; $polerio_base_url = $conf['main']['polerio_base_url']; $phpmylibrary_url = $polerio_base_url."/phpmylibrary"; $GetModuleURL = Polerio::GetModuleURL(); $Med = Polerio::Med(); $_import = $GetModuleURL; $_import .= $Med; $_import .= "_a=1"; $_webpac = $GetModuleURL; $_cataloging = $GetModuleURL; $_cataloging .= $Med; $_cataloging .= "_a=2"; if(Phpmylibrary::IsLoggedIn()!=1) { $_login = $GetModuleURL; $_login .= $Med; $_login .= "_a=3&_aa=2"; $loginmsg = "Log-in"; } else { $_login = $GetModuleURL; $_login .= $Med; $_login .= "_a=3&_aa=1"; $loginmsg = "Log-out"; } $bcolor1 = $conf['table']['bcolor1']; $bcolor2 = $conf['table']['bcolor2']; $bcolor3 = $conf['table']['bcolor3']; $year = date("y"); $mon = date("m"); $day = date("D"); $hour = date("h"); $min = date("i"); $orgdate = date("l F dS, Y h:i A",gmmktime($hour+8,$min+10,$sec,$mon,$day,$year)); $orgdate = date("M d y h:i a",gmmktime($hour+$HOUR,$min+$MINUTE)); print" PhpMyLibrary 1.0.4b
WebPAC"; if(Phpmylibrary::IsLoggedIn()==1) print"
Import MARC"; if(Phpmylibrary::IsLoggedIn()==1) print"
Cataloging"; print"
$loginmsg
"; return; } function print_query($file="") { global $pmlconfig; global $searchableflds; if($pmlconfig['PnThOver']!=0) { $pmlbgcolor3 = $pmlconfig['bgcolor3']; $pmlbgcolor2 = $pmlconfig['bgcolor2']; $pmlbgcolor1 = $pmlconfig['bgcolor1']; } else { global $bgcolor1,$bgcolor2,$bgcolor3; $pmlbgcolor3 = $bgcolor3; $pmlbgcolor2 = $bgcolor2; $pmlbgcolor1 = $bgcolor1; } $getmoduleurl = Polerio::GetModuleURL(); $pmlsearchquery = _PMLSEARCHQUERY; $pmlany = _PMLANY; $pmlauthor = $searchableflds[1][0]; // if you want to translate this, go to polerio/module/config/conf.php $pmltitle = $searchableflds[2][0]; $pmlsubject = $searchableflds[3][0]; $pmlpublisher = $searchableflds[4][0]; $pmlnotes = $searchableflds[5][0]; $pmlabstract = ''.@$searchableflds[6][0].' '; if (empty($searchableflds[6][0])) $pmlabstract = ''; $pmlsearch = _PMLSEARCH; $pmlsearchfor = _PMLSEARCHFOR; $pmlclearsearch = _PMLCLEARSEARCH; $pmlmediatype = _PMLMEDIATYPE; $pmlbooks = _PMLBOOKS; $pmlserials = _PMLSERIALS; $pmlmaps = _PMLMAPS; $pmlmusic = _PMLMUSIC; $pmlvisualmaterial = _PMLVISUALMATERIAL; $pmlcomputerfiles = _PMLCOMPUTERFILES; $pmlmixedmaterial = _PMLMIXEDMATERIAL; $pmlthesis = _PMLTHESIS; $pmllogical = _PMLLOGICAL; $pmland = _PMLAND; $pmlor = _PMLOR; $pmlnot = _PMLNOT; $pmllimit = _PMLLIMIT; global $library_type; $data = array(); $sel = ''; while (list($key1, $value1) = each ($library_type)) { while (list($key2, $value2) = each ($value1)) { $a = 1; } $sel = $sel.''.$value1[2].''; } $selectbranch = 'Any'.$sel.' '; $authid = Polerio::SecGenAuthKey(); $template = polTemplate::LoadTemplate(Polerio::GetModuleURI().'templates/search.html'); $vars = array("pol::getmoduleurl","pol::pmlsearchquery","pol::pmlany","pol::pmlauthor", "pol::pmltitle","pol::pmlsubject","pol::pmlpublisher","pol::pmlnotes","pol::pmlabstract", "pol::pmlsearch","pol::pmlsearchfor","pol::pmlsearchfor","pol::pmlclearsearch", "pol::pmlbooks","pol::pmlserials","pol::pmlmaps","pol::pmlmusic", "pol::pmlvisualmaterial","pol::pmlcomputerfiles","pol::pmlmixedmaterial","pol::pmlthesis", "pol::pmlmediatype","pol::pmllogical","pol::pmland","pol::pmlor","pol::pmlnot","pol::pmllimit", "pol::pmlbgcolor1","pol::pmlbgcolor2","pol::pmlbgcolor3","pol::authid" ); $vals = array("$getmoduleurl","$pmlsearchquery","$pmlany","$pmlauthor", "$pmltitle","$pmlsubject","$pmlpublisher","$pmlnotes","$pmlabstract", "$pmlsearch","$pmlsearchfor","$pmlsearchfor","$pmlclearsearch", "$pmlbooks","$pmlserials","$pmlmaps","$pmlmusic", "$pmlvisualmaterial","$pmlcomputerfiles ","$pmlmixedmaterial","$pmlthesis", "$pmlmediatype","$pmllogical","$pmland","$pmlor","$pmlnot","$pmllimit", "$pmlbgcolor1","$pmlbgcolor2","$pmlbgcolor3","$authid" ); $template = polTemplate::ReplaceStatic($template, $vars, $vals); return $template; } function sql_generator ($keywords="",$Media="",$Heading="",$Operator="",$offset="",$limit="",$mode="") { global $conf; global $pmlconfig; global $encodingtype; list($dbconn) = Polerio::DBGetConn(); $table = Polerio::DBGetTables(); if($Operator=="NOT") $NOT = "NOT"; else $NOT=''; //print"sql_gen key $keywords, med $Media, hea $Heading, ope $Operator, off $offset, lim $limit"; // Heading evaluation to produce tbl to search start if($Heading==0) { $tablea= $table['tblanyindex']; $tableb = $table['tblanybibrelation']; $tablea_col= &$table['tblanyindex_column']; $tableb_col = &$table['tblanybibrelation_column']; } elseif($Heading==1) { $tablea= $table['tblauthorindex']; $tableb = $table['tblauthorbibrelation']; $tablea_col= &$table['tblauthorindex_column']; $tableb_col = &$table['tblauthorbibrelation_column']; } elseif($Heading==2) { $tablea= $table['tbltitleindex']; $tableb = $table['tbltitlebibrelation']; $tablea_col= &$table['tbltitleindex_column']; $tableb_col = &$table['tbltitlebibrelation_column']; } elseif($Heading==3) { $tablea= $table['tblsubjectindex']; $tableb = $table['tblsubjectbibrelation']; $tablea_col= &$table['tblsubjectindex_column']; $tableb_col = &$table['tblsubjectbibrelation_column']; } elseif($Heading==4) { $tablea= $table['tblpublisherindex']; $tableb = $table['tblpublisherbibrelation']; $tablea_col= &$table['tblpublisherindex_column']; $tableb_col = &$table['tblpublisherbibrelation_column']; } elseif($Heading==5) { $tablea= $table['tblnotesindex']; $tableb = $table['tblnotesbibrelation']; $tablea_col= &$table['tblnotesindex_column']; $tableb_col = &$table['tblnotesbibrelation_column']; } elseif($Heading==6) { $tablea= $table['tblabstractindex']; $tableb = $table['tblabstractbibrelation']; $tablea_col= &$table['tblabstractindex_column']; $tableb_col = &$table['tblabstractbibrelation_column']; } $tablec = $table['tblbib']; $tablec_col = $table['tblbib_column']; // Heading evaluation to produce tbl to search end // Media evaluation to produce what category i.e book to search start if($Media==0) { $catid="0"; } elseif($Media==1) { $catid="1"; } elseif($Media==2) { $catid="2"; } elseif($Media==3) { $catid="3"; } elseif($Media==4) { $catid="4"; } elseif($Media==5) { $catid="5"; } elseif($Media==6) { $catid="6"; } elseif($Media==7) { $catid="7"; } elseif($Media==8) { $catid="8"; } elseif($Media==9) { $catid="9"; } // Media evaluation to produce what category i.e book to search stop $limits = "LIMIT $offset,$limit"; $tblbib = $conf['table']['marc']; $catid = "= $Media"; //print"current mode is $mode"; if($Media > 0) $webpac_total_cat_id = "AND catid = $Media"; if($mode=="catalog_stats") { $sql = "SELECT * FROM $tblbib WHERE (approved = 1) AND catid $catid "; } elseif($mode=="webpac_total") { $sql = "SELECT id FROM $table WHERE (approved = 1) $webpac_total_cat_id ORDER BY id "; } elseif($mode=="catalog_browse") { $sql = "SELECT id, marc, catid, approved FROM $tblbib WHERE (approved = 1) AND catid $catid ORDER BY id $limits"; } elseif($mode=="catalog_total") { $sql = "SELECT id FROM $table WHERE (approved = 1) AND catid $catid"; } elseif($mode=="catalog_search") { //print"this is $offset "; if(empty($offset)) { $limits = "LIMIT 0,$limit"; } else { $limits = "LIMIT $offset,$limit"; } if(empty($limit)) { $limits=""; } $DEBUG = "\n"; // set DEBUG == "\n" to see this query $keywordsforabstracts = $keywords; $keywords = trim(urldecode($keywords)); $keywords = ereg_replace("([ ]+)"," ",$keywords); if(!ereg(" ",$keywords)) { // Only 1 keyword $KeyWords[0] = "$keywords"; } else { $KeyWords = explode(" ",$keywords); } if($Media==0) { $Med = "($tablec_col[approved] = 1) "; if(Phpmylibrary::IsLoggedIn()) $Med = "($tablec_col[approved] = '0' OR $tablec_col[approved] = '1') "; } else { $Med = "($tablec_col[approved] = 1) AND ($tablec_col[catid] = $Media)"; if(Phpmylibrary::IsLoggedIn()) $Med = "($tablec_col[approved] = 1 OR $tablec_col[approved] = 0) AND ($tablec_col[catid] = $Media)"; } $sql = "SELECT DISTINCT $tablec_col[id], $tablec_col[marc], $tablec_col[catid], $tablec_col[accessid], $tablec_col[approved] FROM $tablea, $tableb, $tablec WHERE $DEBUG ( "; $count = count($KeyWords); if( $count == 1 && $Heading!=5) { $single = $KeyWords[0]; // discard if keyword length is < 4 if(strlen($single) < $pmlconfig['keyword_length']) { return false; } $sql .= " ( $tablea_col[any] $NOT LIKE '%$single%') AND ($tableb_col[anyid]=$tablea_col[id]) AND ($tablec_col[id]=$tableb_col[bibid]) AND $Med ) ORDER by $tablec_col[id] $limits $DEBUG "; } elseif( $Heading== 6 ) // meaning this is abstract { $single = $keywordsforabstracts; // discard if keyword length is < 4 if(strlen($single) < $pmlconfig['keyword_length']) { return false; } $sql .= " ( MATCH $tablea_col[any] AGAINST ('$single')) AND ($tableb_col[anyid]=$tablea_col[id]) AND ($tablec_col[id]=$tableb_col[bibid]) AND $Med ) ORDER by $tablec_col[id] $limits $DEBUG "; } else { $ticker = 0; while ( list ($key,$word) = each ($KeyWords) ) { if($Operator=="NOT") { $Operator = "AND NOT"; } $ticker++; if(!empty($word)) { if($ticker != $count) { if(strlen($word) < $pmlconfig[keyword_length]) { return false; } $sql .= "($tablea_col[any] LIKE '%$word%' ) AND ($tableb_col[anyid]=$tablea_col[id]) AND ($tablec_col[id]=$tableb_col[bibid]) $Operator $DEBUG "; } else { // Last condition, omit the trailing OR $sql .= " ($tablea_col[any] LIKE '%$word%') AND ($tableb_col[anyid]=$tablea_col[id]) AND ($tablec_col[id]=$tableb_col[bibid]) $DEBUG "; } } } $sql .= " ) AND $Med ORDER BY $tablec_col[id] $limits $DEBUG"; } /*if(!empty($DEBUG)) { echo "
$sql\nTicker [$ticker]\nCount [$count]
\n"; }*/ } //$results = $this->select($sql); //print"$sql"; return $sql; } function Marc($selected_tbl="") { $table = Polerio::DBGetTables(); list($dbconn) = Polerio::DBGetConn(); $tblbib = $table['tblbib']; $tblbib_col = $table['tblbib_column']; $i=0; $zipmarc = ""; while($i <= (count($selected_tbl)-1)) { $query = "SELECT * FROM $tblbib WHERE $tblbib_col[id]=$selected_tbl[$i]"; $recordSet = $dbconn->Execute($query); $row = $recordSet->fields; $zipmarc .= $row[1].chr(29); $i++; } return $zipmarc; } function View($selected_tbl="") { $table = Polerio::DBGetTables(); list($dbconn) = Polerio::DBGetConn(); $tblbib = $table['tblbib']; $tblbib_col = $table['tblbib_column']; include_once Polerio::GetModuleURI().'/lib/marcdefs.php'; $total = count($selected_tbl); $j=0; $viewmarc = ""; $row = array(); while($j <= (count($selected_tbl)-1)) { $query = "SELECT * FROM $tblbib WHERE $tblbib_col[id]=$selected_tbl[$j]"; $recordSet = $dbconn->Execute($query); list($id, $content, $catid, $approved ) = $recordSet->fields; $marc_field_explode = explode(chr(30),$content); $marc_field_explode_count = count($marc_field_explode); $i = 1; $tags_i = 1; $marc_fields_count = ((strlen($marc_field_explode[0])-24)/12); $rj = 0; $_j = 0; while ( $i <= $marc_fields_count) { $tags = substr($marc_field_explode[0],23,strlen($marc_field_explode[0])); $tags = substr($tags,$tags_i,3); $tag_value = $marc_field_explode[$i]; $tag_value = ereg_replace(31,"$",$tag_value); $tags_i = $tags_i + 12; $ktag[$rj] = $tags; $tag_names[$i] = @$tag_name[$ktag[$rj]]; $tag_content[$i] = Phpmylibrary::convertit($tag_value); $tag_name_marc[$i] = $tags; $tag_content_marc[$i] = $tag_value; $i++; } $_j = $_j+1; $viewmarc .= ""._PMLRECORDNO.". $_j "._PMLOF." $total
"; $viewmarc .= ''; $total_fields = count($tag_names); $i=1; while($i <= $total_fields) { $bcolor = "ffffff"; if($tag_names[$i]) $viewmarc .= " $tag_names[$i] $tag_content[$i]
"; $i++; } $viewmarc .= "
"; $j++; } return $viewmarc; } function convertit2($text="") { $x = $text; $ptext = substr($text,2,strlen($text)-2); $etext = explode('^',$ptext); $ctext = count($etext); $i = 0; $text2 = " "; while ($i < $ctext) { $text2 = $text2.' '.substr($etext[$i],1,strlen($etext[$i])-1); $i++; } return substr($text2, 3, strlen($text2)); } function ViewPrintPreview($selected_tbl="") { $table = Polerio::DBGetTables(); list($dbconn) = Polerio::DBGetConn(); $tblbib = $table['tblbib']; $tblbib_col = $table['tblbib_column']; include_once Polerio::GetModuleURI().'/lib/marcdefs.php'; $total = count($selected_tbl); $j=0; $viewmarc = ""; $row = array(); $data = array(); while($j <= (count($selected_tbl)-1)) { $query = "SELECT * FROM $tblbib WHERE $tblbib_col[id]=$selected_tbl[$j]"; $recordSet = $dbconn->Execute($query); list($id, $content, $catid, $approved ) = $recordSet->fields; $marc_field_explode = explode(chr(30),$content); $marc_field_explode_count = count($marc_field_explode); $i = 1; $tags_i = 1; $marc_fields_count = ((strlen($marc_field_explode[0])-24)/12); $rj = 0; $_j = 0; $accno = ''; while ( $i <= $marc_fields_count) { $tags = substr($marc_field_explode[0],23,strlen($marc_field_explode[0])); $tags = substr($tags,$tags_i,3); $mytags = $tags; $tag_value = $marc_field_explode[$i]; $tag_value = ereg_replace(31,"$",$tag_value); $tags_i = $tags_i + 12; $ktag[$rj] = $tags; $tag_names[$i] = @$tag_name[$ktag[$rj]]; $tag_content[$i] = Phpmylibrary::convertit($tag_value); $tag_name_marc[$i] = $tags; $tag_content_marc[$i] = $tag_value; $tagtag[$mytags] = $tag_value; $i++; $author = Phpmylibrary::convertit2($tagtag['100']); $title = Phpmylibrary::convertit2($tagtag['245']); if ($tags=='949') $accno = $accno.' '.Phpmylibrary::convertit2($tagtag['949']); $calln = Phpmylibrary::convertit2($tagtag['082']); $subject = Phpmylibrary::convertit2($tagtag['650']); //$subject1 = $subject1."\n".$subject; } $authtitle = "$author $title"; $newar = array('no'=>$j+1,'accno'=>$accno,'calln'=>$calln,'author'=>$author,'authtitle'=>$authtitle,'subject'=>$subject); array_push($data, $newar); $_j = $_j+1; $j++; } return $data; } function ViewCatalogPreview($selected_tbl="") { $table = Polerio::DBGetTables(); list($dbconn) = Polerio::DBGetConn(); $tblbib = $table['tblbib']; $tblbib_col = $table['tblbib_column']; include_once Polerio::GetModuleURI().'/lib/marcdefs.php'; $total = count($selected_tbl); $j=0; $viewmarc = ""; $row = array(); while($j <= (count($selected_tbl)-1)) { $query = "SELECT * FROM $tblbib WHERE $tblbib_col[id]=$selected_tbl[$j]"; $recordSet = $dbconn->Execute($query); list($id, $content, $catid, $approved ) = $recordSet->fields; $marc_field_explode = explode(chr(30),$content); $marc_field_explode_count = count($marc_field_explode); $i = 1; $tags_i = 1; $marc_fields_count = ((strlen($marc_field_explode[0])-24)/12); $rj = 0; $_j = 0; while ( $i <= $marc_fields_count) { $tags = substr($marc_field_explode[0],23,strlen($marc_field_explode[0])); $tags = substr($tags,$tags_i,3); $tag_value = $marc_field_explode[$i]; $tag_value = ereg_replace(31,"$",$tag_value); $tags_i = $tags_i + 12; $ktag[$rj] = $tags; $tag_names[$i] = @$tag_name[$ktag[$rj]]; $tag_content[$i] = Phpmylibrary::convertit($tag_value); $tag_name_marc[$i] = $tags; $tag_content_marc[$i] = $tag_value; $i++; } $_j = $_j+1; $viewmarc .= ""._PMLRECORDNO.". $_j "._PMLOF." $total
"; $viewmarc .= ''; $total_fields = count($tag_names); $i=1; while($i <= $total_fields) { $bcolor = "ffffff"; if($tag_names[$i]) $viewmarc .= " $tag_names[$i] $tag_content[$i]
"; $i++; } $viewmarc .= "
"; $j++; } return $viewmarc; } function Viewnohtml($selected_tbl="") { $table = Polerio::DBGetTables(); $tblbib = $table['tblbib']; $tblbib_col = $table['tblbib_column']; include_once Polerio::GetModuleURI().'/lib/marcdefs.php'; list($dbconn) = Polerio::DBGetConn(); $total = count($selected_tbl); $j=0; $viewmarc .= "\r\n"; $viewmarc .= "Polerio::PhpMyLibrary http://phpmylibrary.sourceforge.net\r\n"; $viewmarc .= "Copyleft 2002 PhpMyLibrary GNU/GPL License\r\n"; $viewmarc .= "\r\n"; $viewmarc .= "--------------------------------------"; $viewmarc .= "--------------------------------------"; $viewmarc .= "\r\n"; $viewmarc .= "\r\n"; while($j <= (count($selected_tbl)-1)) { $query = "SELECT * FROM $tblbib WHERE $tblbib_col[id]=$selected_tbl[$j]"; $recordSet = $dbconn->Execute($query); $row = $recordSet->fields; $id = $row[0]; $content = $row[1]; $catid = $row[2]; $approved = $row[3]; $marc_field_explode = explode(chr(30),$content); $marc_field_explode_count = count($marc_field_explode); $i = 1; $tags_i = 1; $marc_fields_count = ((strlen($marc_field_explode[0])-24)/12); $rj = 0; while ( $i <= $marc_fields_count) { $bib = $bibid; $tags = substr($marc_field_explode[0],23,strlen($marc_field_explode[0])); $tags = substr($tags,$tags_i,3); $tag_value = $marc_field_explode[$i]; $tag_value = ereg_replace(31,"$",$tag_value); $tags_i = $tags_i + 12; $ktag[$rj] = $tags; $tag_names[$i] = $tag_name[$ktag[$rj]]; //$tag_name[$i] = Phpmylibrary::get_tag_name($tags); $tag_content[$i] = Phpmylibrary::convertit($tag_value); $tag_name_marc[$i] = $tags; $tag_content_marc[$i] = $tag_value; $i++; } $_j = $_j+1; $viewmarc .= "\r\n"; $viewmarc .= ""._PMLRECORDNO.". $id "._PMLRESULT." $_j "._PMLOF." $total\r\n\r\n"; $total_fields = count($tag_names); $i=1; while($i <= $total_fields) { $bcolor = Polerio::useColora(); if($tag_names[$i]) $viewmarc .= "$tag_names[$i]: $tag_content[$i]\r\n\r\n"; $i++; } $viewmarc .= "\r\n"; $viewmarc .= "--------------------------------------"; $viewmarc .= "--------------------------------------"; $viewmarc .= "\r\n"; $j++; } $viewmarc .= "\r\n"; $viewmarc .= "Polerio::PhpMyLibrary http://phpmylibrary.sourceforge.net\r\n"; $viewmarc .= "Copyleft 2002 PhpMyLibrary GNU/GPL License\r\n"; $viewmarc .= "\r\n"; return $viewmarc; } // function to convert $a's with space start function convertit($text="") { $x = $text; $ptext = substr($text,2,strlen($text)-2); $etext = explode("^",$ptext); $ctext = count($etext); $i = 0; $text2 = " "; while ($i < $ctext) { $text2 = $text2.' '.substr($etext[$i],1,strlen($etext[$i])-1); $i++; } return $text2; } function IsLoggedIn($msg="") { global $pmlconfig; if(Polerio::SessionGetVar('uid') >= 2 ) { if(empty($msg)) { return Polerio::SessionGetVar('uid'); } else { $stress = "$msg Error: "._PMLYOUMUSTLOGINFIRST."!."; $res = "
$stress
"; return $res; } } else { $stress = "$msg Error: "._PMLYOUMUSTLOGINFIRST."!."; $res = "
$stress
"; return $res; } } function ToSearchAll() { global $pmlconfig; $tosearchall = ''; if($pmlconfig['note_lkeywords'] == 1) { $c=$pmlconfig['keyword_length']; $i=1; $h=""; while($i <= $c) { $h = $h."%"; $i++; } if(empty($h)) $h='%%%'; $tosearchall = "
"._PMLTYPE." $h "._PMLTOBROWSEALLRECORDS."!
"; } return $tosearchall; } function Message($msg="") { $msg = "
$msg
"; return $msg; } function bgcolor1() { if(Phpmylibrary::PnThOver()) { global $bgcolor1; } else { global $pmlconfig; $bgcolor1 = $pmlconfig['bgcolor1']; } return $bgcolor1; } function bgcolor2() { if(Phpmylibrary::PnThOver()) { global $bgcolor2; } else { global $pmlconfig; $bgcolor2 = $pmlconfig['bgcolor2']; } return $bgcolor2; } function bgcolor3() { if(Phpmylibrary::PnThOver()) { global $bgcolor3; } else { global $pmlconfig; $bgcolor3 = $pmlconfig['bgcolor3']; } return $bgcolor3; } function MouseOver() { global $pmlconfig; $MouseOver = $pmlconfig['mouseover']; return $MouseOver; } /** * to generate static color * @returns static color */ function useColora() { global $pmlconfig; if($pmlconfig['PnThOver']!=0) { $bcolor2 = $pmlconfig['bgcolor1']; $bcolor1 = $pmlconfig['bgcolor3']; } else { global $bgcolor1,$bgcolor2,$bgcolor3; $bcolor2 = $bgcolor1; $bcolor1 = $bgcolor3; } static $ColorValue; if($ColorValue==$bcolor2) $ColorValue=$bcolor1; else $ColorValue=$bcolor2; return($ColorValue); } function PnThOver() { global $pmlconfig; if($pmlconfig['PnThOver']==0) return true; } function BackToDecoder($bakto="") { $temp = explode("~",$bakto); for($i=0;$i $value) { if($i==$c-1) $tl = ''; $tm = $tm.$key.'^'.$value.$tl; $i++; } //echo $bakto; return $tm; } function BackToEncoder($bakto="") { $bakto = ereg_replace("=","^",$bakto); $bakto = ereg_replace("&","~",$bakto); return $bakto; } } ?> "; } fclose($myFile); } else include($fname); } else echo "Error!!!
Failed to open $fcontent.
"; } elseif($_a=="settings") { if((Polerio::SelectGID()==2) || (Polerio::SelectGID()==4) || (Polerio::SessionGetVar('uid')==2)) { include_once Polerio::GetModuleURI()."/lib/settings.php"; if($test) { Settings::ShowSettingsArea(); } elseif($_POST['flag']=="Refresh Global") { Settings::ShowSettingsChangeGlobalArea(); } elseif($_POST['flag']=="Update Global") { Settings::ProcessChangeGlobal(Polerio::InputFilter($_POST)); Settings::ShowSettingsChangeGlobalArea(); } elseif($changeglobals) { Settings::ShowSettingsChangeGlobalArea(); } elseif($_POST['flag']=="Refresh Blocks") { Settings::ShowSettingsChangeBlocksArea(); } elseif($_POST['flag']=="Update Blocks") { $tags = array("em", "br", "a", "href","strong","p"); $attributes = array("title", "selected", "a", "href","strong","p"); Settings::ProcessChangeBlocks(Polerio::CustomInputFilter($_POST, $tags, $attributes)); Settings::ShowSettingsChangeBlocksArea(); } elseif($changeblocks) { Settings::ShowSettingsChangeBlocksArea(); } elseif($_POST['flag']=="Refresh Mailer") { Settings::ShowSettingsChangeMailerArea(); } elseif($_POST['flag']=="Update Mailer") { Settings::ProcessChangeMailer(Polerio::InputFilter($_POST)); Settings::ShowSettingsChangeMailerArea(); } elseif($changemailer) { Settings::ShowSettingsChangeMailerArea(); } elseif($_POST['flag']=="Refresh Library") { Settings::ShowSettingsChangeLibraryArea(); } elseif($_POST['flag']=="Update Library") { Settings::ProcessChangeLibrary(Polerio::InputFilter($_POST)); Settings::ShowSettingsChangeLibraryArea(); } elseif($changelibrary) { Settings::ShowSettingsChangeLibraryArea(); } elseif($_POST['flag']=="Refresh Theme") { Settings::ShowSettingsChangeThemeArea(); } elseif($_POST['flag']=="Update Theme") { Settings::ProcessChangeTheme(Polerio::InputFilter($_POST)); Settings::ShowSettingsChangeThemeArea(); } elseif($changetheme) { Settings::ShowSettingsChangeThemeArea(); } else { Settings::ShowSettingsArea(); } } else echo Phpmylibrary::IsLoggedIn("Protected Area"); } elseif($_a=="inquiry") { include_once Polerio::GetModuleURI()."/lib/inquiry.php"; if($_POST['flag']=="Send Inquiry") { Inquiry::ProcessInquiry(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET)); } else { Inquiry::ShowFieldArea(); } } elseif($_a=="circulation2") { if((Polerio::SelectGID()==2) || (Polerio::SelectGID()==4) || (Polerio::SessionGetVar('uid')==2)) { include_once Polerio::GetModuleURI()."/lib/circulation2.php"; $baktovars = PhpMyLibrary::BackToDecoder2($bakto); if($checkout) { Circulation::ShowCirculationCheckoutArea(); } elseif($_POST['flag']=="Set Temp Due Date") { Circulation::ProcessSetTempDueDate(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($_POST['flag']=="Hold") { Circulation::ProcessHold2(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($_POST['flag']=="Patron Submit - Hold") { Circulation::ProcessHold1(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($_POST['flag']=="Clear Hold") { Circulation::ProcessClearHold(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($_POST['flag']=="Renew") { Circulation::ProcessRenew(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($_POST['flag']=="Check In") { Circulation::ProcessCheckIn(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($checkin) { Circulation::ShowCirculationCheckinArea(); } elseif($_POST['flag']=="Check Out") { Circulation::ProcessCheckOut(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($_POST['flag']=="Patron Submit") { Circulation::ShowPatronInfoAndTransactionInfo(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($renew) { Circulation::ShowCirculationRenewArea(); } elseif($hold) { Circulation::ShowCirculationHoldArea(); } elseif($clearhold) { Circulation::ShowCirculationClearHoldArea(); } elseif($cleartempduedate) { Circulation::ProcessClearTempDueDate(); } elseif($settempduedate) { Circulation::ShowCirculationSetTempDueDateArea(); } else { Circulation::ShowCirculationCheckoutArea(); } } else echo Phpmylibrary::IsLoggedIn("Protected Area"); } elseif($_a=="permissions") { if((Polerio::SelectGID()==2) || (Polerio::SelectGID()==4) || (Polerio::SessionGetVar('uid')==2)) { include_once Polerio::GetModuleURI()."/lib/permissions.php"; $baktovars = PhpMyLibrary::BackToDecoder2($bakto); if($_POST['flag']=="Search") { Permissions::ShowSearchRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($_POST['flag']=="Update") { Permissions::ProcessUpdate(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); $baktovars = PhpMyLibrary::BackToDecoder2($bakto); $_POST['Heading'] = $baktovars['Heading']; $_POST['searchterm'] = $baktovars['searchterm']; $_GET['pos'] = $baktovars['pos']; Permissions::ShowDetailedRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($delete) { Permissions::ProcessDelete(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); $baktovars = PhpMyLibrary::BackToDecoder2($bakto); $_POST['Heading'] = $baktovars['Heading']; $_POST['searchterm'] = $baktovars['searchterm']; $_GET['pos'] = $baktovars['pos']; Permissions::ShowDetailedRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($pos) { $baktovars = PhpMyLibrary::BackToDecoder2($bakto); $_POST['Heading'] = $baktovars['Heading']; $_POST['searchterm'] = $baktovars['searchterm']; Permissions::ShowDetailedRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($nav) { $baktovars = PhpMyLibrary::BackToDecoder2($bakto); $_POST['Heading'] = $baktovars['Heading']; $_POST['searchterm'] = $baktovars['searchterm']; Permissions::ShowSearchRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($_POST['flag']=="Add User") { Permissions::ProcessAddUser(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); $_POST['searchindex'] = 1; $_POST['searchterm'] = '%'; Permissions::ShowSearchRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($_POST['flag']=="Search") { echo "Search Administrators"; Permissions::ShowPermissionsManagementArea(); } elseif($showall) { $_POST['searchindex'] = 1; $_POST['searchterm'] = '%'; Permissions::ShowSearchRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($newrecord) { Permissions::ShowAddNewPermissionRecordArea(); } elseif($importlnk) { echo "importlnk"; Permissions::ShowPermissionsManagementArea(); } elseif($exportlnk) { echo "exportlnk"; Permissions::ShowPermissionsManagementArea(); } elseif($reinitializerec) { echo "reinitializerec"; Permissions::ShowPermissionsManagementArea(); } else { Permissions::ShowPermissionsManagementArea(); } } else echo Phpmylibrary::IsLoggedIn("Protected Area"); } elseif($_a=="serials") { if((Polerio::SelectGID()==2) || (Polerio::SelectGID()==4) || (Polerio::SessionGetVar('uid')==2)) { include_once Polerio::GetModuleURI()."/lib/serials.php"; $baktovars = PhpMyLibrary::BackToDecoder2($bakto); if($_POST['flag']=="Search") { Serials::ShowSearchRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($_POST['flag']=="Add Serial Copy") { Serials::ProcessAddCopyHoldings(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($addbookidtoserial) { Serials::ShowAddCopySerialHoldings(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($serialscatalognav) { Serials::ProcessSerialsCatalogNav(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($serdelete) { Serials::ProcessDelete(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); $baktovars = PhpMyLibrary::BackToDecoder2($bakto); $_POST['Heading'] = $baktovars['Heading']; $_POST['searchterm'] = $baktovars['searchterm']; $_GET['serialspos'] = $baktovars['serialspos']; Serials::ShowDetailedRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($serialspos) { //$baktovars = PhpMyLibrary::BackToDecoder2($bakto); //print_r($_POST); //print_r($_GET); $baktovars = PhpMyLibrary::BackToDecoder2($bakto); $_POST['Heading'] = $baktovars['Heading']; $_POST['searchterm'] = $baktovars['searchterm']; Serials::ShowDetailedRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($serialsnav) { //$baktovars = PhpMyLibrary::BackToDecoder2($bakto); //print_r($_POST); //print_r($_GET); $baktovars = PhpMyLibrary::BackToDecoder2($bakto); $_POST['Heading'] = $baktovars['Heading']; $_POST['searchterm'] = $baktovars['searchterm']; Serials::ShowSearchRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($_POST['flag']=="Save") { Serials::ProcessSave(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); $_POST['searchindex'] = 1; $_POST['searchterm'] = '%'; Serials::ShowSearchRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($_POST['flag']=="Update") { Serials::ProcessUpdate(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); $baktovars = PhpMyLibrary::BackToDecoder2($bakto); $_POST['Heading'] = $baktovars['Heading']; $_POST['searchterm'] = $baktovars['searchterm']; $_GET['serialspos'] = $baktovars['serialspos']; Serials::ShowDetailedRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($_POST['flag']=="Received") { Serials::ProcessReceived(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($newrecord) { Serials::ShowAddNewSerialRecordArea(); } elseif($importlnk) { echo "importlnk"; Serials::ShowSerialsManagementArea(); } elseif($exportlnk) { echo "exportln"; Serials::ShowSerialsManagementArea(); } elseif($showall) { $_POST['searchindex'] = 1; $_POST['searchterm'] = '%'; Serials::ShowSearchRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($reinitializerec) { echo "reinitializerec"; Serials::ShowSerialsManagementArea(); } else { Serials::ShowSerialsManagementArea(); } } else echo Phpmylibrary::IsLoggedIn("Protected Area"); } elseif($_a=="patron2") { if((Polerio::SelectGID()==2) || (Polerio::SelectGID()==4) || (Polerio::SessionGetVar('uid')==2)) { include_once Polerio::GetModuleURI()."/lib/patron2.php"; $baktovars = PhpMyLibrary::BackToDecoder2($bakto); if($patronnav) { //$baktovars = PhpMyLibrary::BackToDecoder2($bakto); //print_r($_POST); //print_r($_GET); $baktovars = PhpMyLibrary::BackToDecoder2($bakto); $_POST['Heading'] = $baktovars['Heading']; $_POST['searchterm'] = $baktovars['searchterm']; Patron::ShowSearchRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($patrondeleteid) { Patron::ProcessDeletePatronID(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); $_POST['searchindex'] = 1; $_POST['searchterm'] = '%'; Patron::ShowSearchRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($_POST['flag']=="Update Patron") { Patron::ProcessUpdatePatronRecord(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); $_GET['editpatronid'] = $_POST['patronupdateid']; Patron::ShowEditNewPatronRecordArea(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($editpatronid) { Patron::ShowEditNewPatronRecordArea(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($showallpatron) { $_POST['searchindex'] = 1; $_POST['searchterm'] = '%'; Patron::ShowSearchRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($_POST['flag']=="Search") { Patron::ShowSearchRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($_POST['flag']=="Add Patron") { $uid = Patron::ProcessInsertNewPatronRecord(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); if($uid) { $_GET['editpatronid'] = $uid; Patron::ShowEditNewPatronRecordArea(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } } elseif($newpatronrecord) { Patron::ShowAddNewPatronRecordArea(); } elseif($searchterm) { Patron::ShowSearchRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } else { Patron::ShowPatronManagementArea(); } } else echo Phpmylibrary::IsLoggedIn("Protected Area"); } elseif($_a=="webopac2") { include_once Polerio::GetModuleURI()."/lib/webopac2.php"; if($_POST['flag']=="Search") { Webopac::WebopacShowSearchRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET)); } elseif($catalogpos) { //$baktovars = PhpMyLibrary::BackToDecoder2($bakto); //print_r($_POST); //print_r($_GET); $baktovars = PhpMyLibrary::BackToDecoder2($bakto); $_POST['Heading'] = $baktovars['Heading']; $_POST['searchterm'] = $baktovars['searchterm']; $EditID = Webopac::ShowDetailedRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); Webopac::ShowHoldingsValues(Polerio::InputFilter($EditID), Polerio::InputFilter($bakto)); } elseif($catalognav) { //$baktovars = PhpMyLibrary::BackToDecoder2($bakto); //print_r($_POST); //print_r($_GET); $baktovars = PhpMyLibrary::BackToDecoder2($bakto); $_POST['Heading'] = $baktovars['Heading']; $_POST['searchterm'] = $baktovars['searchterm']; Webopac::ShowSearchRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($EditID) { $baktovars = PhpMyLibrary::BackToDecoder2($bakto); $bakto = Webopac::MARCNormalViewToggler(Polerio::InputFilter($bakto)); $_POST['Heading'] = $baktovars['Heading']; $_POST['searchterm'] = $baktovars['searchterm']; $_GET['catalogpos'] = $baktovars['catalogpos']; Webopac::ShowDetailedRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } else { //Webopac::WebopacShowSearchRecordsUsingIndexName(Polerio::InputFilter($_POST), // Polerio::InputFilter($_GET)); Webopac::ShowSearchCatalogArea(); } } elseif($_a=="cataloging3") { if((Polerio::SelectGID()==2) || (Polerio::SelectGID()==4) || (Polerio::SessionGetVar('uid')==2)) { include_once Polerio::GetModuleURI()."/lib/cataloging3.php"; $baktovars = PhpMyLibrary::BackToDecoder2($bakto); if($importmarclnk) { Cataloging::ShowUploadMARCRecords(Polerio::InputFilter($bakto)); } elseif($editholdings) { Cataloging::ShowEditCopyHoldings(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($deleteholdingspos) { Cataloging::ProcessDeleteCopyHoldings(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); $baktovars = PhpMyLibrary::BackToDecoder2($bakto); $_POST['Heading'] = $baktovars['Heading']; $_POST['searchterm'] = $baktovars['searchterm']; $EditID = Cataloging::ShowDetailedRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); Cataloging::ShowHoldingsValues(Polerio::InputFilter($EditID), Polerio::InputFilter($bakto)); } elseif($addcopy) { Cataloging::ShowAddCopyHoldings(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($catalogpos) { //$baktovars = PhpMyLibrary::BackToDecoder2($bakto); //print_r($_POST); //print_r($_GET); $baktovars = PhpMyLibrary::BackToDecoder2($bakto); $_POST['Heading'] = $baktovars['Heading']; $_POST['searchterm'] = $baktovars['searchterm']; $EditID = Cataloging::ShowDetailedRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); Cataloging::ShowHoldingsValues(Polerio::InputFilter($EditID), Polerio::InputFilter($bakto)); } elseif($catalognav) { //$baktovars = PhpMyLibrary::BackToDecoder2($bakto); //print_r($_POST); //print_r($_GET); $baktovars = PhpMyLibrary::BackToDecoder2($bakto); $_POST['Heading'] = $baktovars['Heading']; $_POST['searchterm'] = $baktovars['searchterm']; Cataloging::ShowSearchRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($_POST['flag']=="Search") { Cataloging::ShowSearchRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET)); } elseif($_POST['flag']=="Update Copy") { $barcodeid = Cataloging::ProcessUpdateCopyHoldings(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); $_GET['editholdings'] = $barcodeid; Cataloging::ShowEditCopyHoldings(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($_POST['flag']=="Add Copy") { Cataloging::ProcessAddCopyHoldings(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); //$baktovars = PhpMyLibrary::BackToDecoder2($bakto); //print_r($_POST); //print_r($_GET); $baktovars = PhpMyLibrary::BackToDecoder2($bakto); $_POST['Heading'] = $baktovars['Heading']; $_POST['searchterm'] = $baktovars['searchterm']; $EditID = Cataloging::ShowDetailedRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); Cataloging::ShowHoldingsValues(Polerio::InputFilter($EditID), Polerio::InputFilter($bakto)); } elseif($_POST['flag']=="Import MARC") { Cataloging::ShowUploadMARCRecords(Polerio::InputFilter($bakto)); Cataloging::ProcessMARCImport(Polerio::InputFilter($_FILES), Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($exportmarclnk) { echo "exportmarclnk"; } elseif($reinitializerec) { Cataloging::ReInitializeCatalogTables(); Cataloging::ShowCatalogManagementArea(); } elseif($showallrecords) { $baktovars = PhpMyLibrary::BackToDecoder2($bakto); $_POST['Heading'] = 0; $_POST['searchterm'] = '%'; Cataloging::ShowSearchRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } elseif($subfieldmarctoggle) { $bakto = Cataloging::MARCNormalViewToggler(Polerio::InputFilter($bakto)); Cataloging::ShowSelectedFieldTypeEncodingArea(Polerio::InputFilter($EditID), Polerio::InputFilter($fieldindex), Polerio::InputFilter($bakto)); } elseif($marcviewtoggle) { $bakto = Cataloging::MARCNormalViewToggler(Polerio::InputFilter($bakto)); list($content, $tag, $value, $ldr) = Cataloging::ConvertMARCToTagsAndValues(Polerio::InputFilter($EditID)); Cataloging::GetReOrderAndSaveMARCAndReIndex(Polerio::InputFilter($EditID), Polerio::InputFilter($tag), Polerio::InputFilter($value), Polerio::InputFilter($ldr)); if(empty($baktovars['catalogpos'])) { Cataloging::ShowCatalogFieldListing(Polerio::InputFilter($disp), Polerio::InputFilter($action),Polerio::InputFilter($tag), Polerio::InputFilter($value), Polerio::InputFilter($approved), Polerio::InputFilter($EditID), Polerio::InputFilter($catid), Polerio::InputFilter($content), Polerio::InputFilter($level), Polerio::InputFilter($bakto), Polerio::InputFilter($ldr)); } else { $baktovars = PhpMyLibrary::BackToDecoder2($bakto); $_POST['Heading'] = $baktovars['Heading']; $_POST['searchterm'] = $baktovars['searchterm']; $_GET['catalogpos'] = $baktovars['catalogpos']; $EditID = Cataloging::ShowDetailedRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); Cataloging::ShowHoldingsValues(Polerio::InputFilter($EditID), Polerio::InputFilter($bakto)); } } elseif($EditID && $_POST['flag']=="Submit Field Addition") { Cataloging::EditIDSubmitFieldAddition(Polerio::InputFilter($_GET),Polerio::InputFilter($_POST)); list($content, $tag, $value, $ldr) = Cataloging::ConvertMARCToTagsAndValues($EditID); Cataloging::GetReOrderAndSaveMARCAndReIndex(Polerio::InputFilter($EditID), Polerio::InputFilter($tag), Polerio::InputFilter($value), Polerio::InputFilter($ldr)); if(empty($baktovars['catalogpos'])) { Cataloging::ShowCatalogFieldListing(Polerio::InputFilter($disp), Polerio::InputFilter($action),Polerio::InputFilter($tag), Polerio::InputFilter($value), Polerio::InputFilter($approved), Polerio::InputFilter($EditID), Polerio::InputFilter($catid), Polerio::InputFilter($content), Polerio::InputFilter($level), Polerio::InputFilter($bakto), Polerio::InputFilter($ldr)); } else { $baktovars = PhpMyLibrary::BackToDecoder2($bakto); $_POST['Heading'] = $baktovars['Heading']; $_POST['searchterm'] = $baktovars['searchterm']; $_GET['catalogpos'] = $baktovars['catalogpos']; Cataloging::ShowDetailedRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } } elseif($EditID && $deleterecord ) { Cataloging::EditIDDeleteRecord(Polerio::InputFilter($EditID)); echo "Record deleted!"; if(empty($baktovars['catalogpos'])) { /* if(empty($bakto)) $bakto = "KeyWords^%%%~Media^~Heading^~Operator^AND~offset^0~total^1~limit^10"; list($KeyWords,$Media,$Heading,$Operator,$offset, $total, $limit) = Phpmylibrary::BackToDecoder($bakto); $GetModuleURI = Polerio::GetModuleURI(); echo Phpmylibrary::print_query(); include_once "$GetModuleURI/lib/webpac.class.php"; $webpac = new Webpac_html; $recordSet = $webpac->GetBriefResult($KeyWords,$Media,$Heading,$Operator,$limit,$offset,$total); echo $webpac->GetBriefResult_html($recordSet); */ } else { $baktovars = PhpMyLibrary::BackToDecoder2($bakto); $_POST['Heading'] = $baktovars['Heading']; $_POST['searchterm'] = $baktovars['searchterm']; $_GET['catalogpos'] = $baktovars['catalogpos']; Cataloging::ShowDetailedRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } } elseif($EditID && $gottagnum ) { Cataloging::ShowEditIDAddFieldGotTagNum(Polerio::InputFilter($EditID), Polerio::InputFilter($showaddingfield), Polerio::InputFilter($bakto)); } elseif($EditID && $showaddingfield ) { Cataloging::ShowEditIDAddField(Polerio::InputFilter($EditID), Polerio::InputFilter($showaddingfield), Polerio::InputFilter($bakto)); } elseif($EditID && $fieldindex && $subfieldnavi ) { Cataloging::ShowSelectedFieldTypeEncodingArea(Polerio::InputFilter($EditID), Polerio::InputFilter($fieldindex), Polerio::InputFilter($bakto), Polerio::InputFilter($subfieldnavi)); } elseif($EditID && $fieldindex && $deletefield ) { list($content, $tag, $value, $ldr) = Cataloging::EditIDFieldIndexDeleteField(Polerio::InputFilter($EditID), Polerio::InputFilter($fieldindex), Polerio::InputFilter($bakto)); Cataloging::ShowCatalogFieldListing(Polerio::InputFilter($disp), Polerio::InputFilter($action),Polerio::InputFilter($tag), Polerio::InputFilter($value), Polerio::InputFilter($approved), Polerio::InputFilter($EditID), Polerio::InputFilter($catid), Polerio::InputFilter($content), Polerio::InputFilter($level), Polerio::InputFilter($bakto), Polerio::InputFilter($ldr)); } elseif($EditID && $fieldindex && $addsubfieldtotagnum ) { Cataloging::EditIDFieldIndexAddSubFieldShow(Polerio::InputFilter($EditID), Polerio::InputFilter($fieldindex), Polerio::InputFilter($addsubfieldtotagnum), Polerio::InputFilter($bakto)); } elseif($EditID && $fieldindex && $addsubfield ) { Cataloging::EditIDFieldIndexAddSubField(Polerio::InputFilter($EditID), Polerio::InputFilter($fieldindex), Polerio::InputFilter($addsubfield), Polerio::InputFilter($bakto)); } elseif($EditID && $fieldindex && $_POST['flag']=="Save Modified and Add Subfield") { Cataloging::EditIDFieldIndexSaveModifiedandAddSubfield(Polerio::InputFilter($EditID), Polerio::InputFilter($fieldindex), Polerio::InputFilter($_POST), Polerio::InputFilter($bakto)); } elseif($EditID && $fieldindex && $_POST['flag']=="Save Modified and Repeat Field") { Cataloging::EditIDFieldIndexSaveModifiedandRepeatField(Polerio::InputFilter($EditID), Polerio::InputFilter($fieldindex), Polerio::InputFilter($_POST), Polerio::InputFilter($bakto)); } elseif($EditID && $fieldindex && $_POST['flag']=="Save Modified Field") { Cataloging::EditIDFieldIndexSaveModifiedField(Polerio::InputFilter($EditID), Polerio::InputFilter($fieldindex), Polerio::InputFilter($_POST)); Cataloging::ShowSelectedFieldTypeEncodingArea(Polerio::InputFilter($EditID), Polerio::InputFilter($fieldindex), Polerio::InputFilter($bakto)); } elseif($EditID && $fieldindex && $delimindex && $delimaction && $bakto) { Cataloging::EditIDFieldIndexDelimIndexDelimAction(Polerio::InputFilter($EditID), Polerio::InputFilter($fieldindex), Polerio::InputFilter($delimindex), Polerio::InputFilter($delimaction), Polerio::InputFilter($bakto)); Cataloging::ShowSelectedFieldTypeEncodingArea(Polerio::InputFilter($EditID), Polerio::InputFilter($fieldindex), Polerio::InputFilter($bakto)); } elseif($EditID && $fieldindex ) { Cataloging::ShowSelectedFieldTypeEncodingArea(Polerio::InputFilter($EditID), Polerio::InputFilter($fieldindex), Polerio::InputFilter($bakto)); } elseif($EditID) { list($content, $tag, $value, $ldr) = Cataloging::ConvertMARCToTagsAndValues(Polerio::InputFilter($EditID)); Cataloging::GetReOrderAndSaveMARCAndReIndex(Polerio::InputFilter($EditID), Polerio::InputFilter($tag), Polerio::InputFilter($value), Polerio::InputFilter($ldr)); if(empty($baktovars['catalogpos'])) { Cataloging::ShowCatalogFieldListing(Polerio::InputFilter($disp), Polerio::InputFilter($action),Polerio::InputFilter($tag), Polerio::InputFilter($value), Polerio::InputFilter($approved), Polerio::InputFilter($EditID), Polerio::InputFilter($catid), Polerio::InputFilter($content), Polerio::InputFilter($level), Polerio::InputFilter($bakto), Polerio::InputFilter($ldr)); } else { $_POST['Heading'] = $baktovars['Heading']; $_POST['searchterm'] = $baktovars['searchterm']; $_GET['catalogpos'] = $baktovars['catalogpos']; Cataloging::ShowDetailedRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET), Polerio::InputFilter($bakto)); } } elseif($rectype && $rectype_submitted=="1") { $EditID = Cataloging::SaveSelectedRecordTypeEncodingArea(Polerio::InputFilter($_POST)); list($content, $tag, $value, $ldr) = Cataloging::ConvertMARCToTagsAndValues(Polerio::InputFilter($EditID)); Cataloging::GetReOrderAndSaveMARCAndReIndex(Polerio::InputFilter($EditID), Polerio::InputFilter($tag), Polerio::InputFilter($value), Polerio::InputFilter($ldr)); Cataloging::ShowCatalogFieldListing(Polerio::InputFilter($disp), Polerio::InputFilter($action),Polerio::InputFilter($tag), Polerio::InputFilter($value), Polerio::InputFilter($approved), Polerio::InputFilter($EditID), Polerio::InputFilter($catid), Polerio::InputFilter($content), Polerio::InputFilter($level), Polerio::InputFilter($bakto), Polerio::InputFilter($ldr)); } elseif($rectype) { Cataloging::ShowSelectedRecordTypeEncodingArea(Polerio::InputFilter($rectype)); } elseif($newcatalogrecord) { Cataloging::ShowSelectRecordType(); } elseif($searchterm) { Cataloging::ShowSearchRecordsUsingIndexName(Polerio::InputFilter($_POST), Polerio::InputFilter($_GET)); } else { Cataloging::ShowCatalogManagementArea(); } } else echo Phpmylibrary::IsLoggedIn("Protected Area"); } elseif($_a=="support") { include_once Polerio::GetModuleURI()."/lib/support.php"; Support::ShowSupportArea(); } elseif($_a==4) { include_once Polerio::GetModuleURI()."/lib/webopac2.php"; if($msg==1) echo"Succesfully Login! ".Webopac::ShowSearchCatalogArea(); elseif($msg==2) echo"Please Retry!"; elseif($msg==3) echo "Wrong Password!".Phpmylibrary::Login(); elseif($msg==4) echo "Wrong Username and Password!".Phpmylibrary::Login(); elseif($msg==5) echo"Successfully Logged-out".Phpmylibrary::Login(); else echo Phpmylibrary::IsLoggedIn("Protected Area"); }elseif($_a==3 ) { if($q=="login") { echo Phpmylibrary::Login(); } elseif($q=="logout") { echo "Successfully Logged-out"; } else echo Phpmylibrary::IsLoggedIn("Protected Area"); } else { include_once Polerio::GetModuleURI()."/lib/webopac2.php"; Webopac::ShowSearchCatalogArea(); } if(Polerio::PostNuke()) { CloseTable(); include("./footer.php"); } else { CloseTable(); include './footer.php'; } ?>