warning

Invalid domain name for this ContentSeed License

If you're recieving this message in error, please contact me immediately.
Click Here
"; $contentfile = "content/content.php"; if( eregi( 'generator.php', sv( 'PHP_SELF' ) ) ) die( 'Access Denied' ); $aVariableNames = array( 'download', 'newname', 'get', 'myEditorCode', 'selected', 'login', 'logout', 'newpage', 'confpassword', 'retrieve', 'file', 'action', 'set', 'images', 'downloads', 'edit', 'normal', 'newpassword', 'doc', 'newdoc', 'localdoc', 'conflocalpassword', 'newlocalname', 'newlocalpassword' ); foreach( $aVariableNames as $i ) initvar( $i ); if( sv( 'QUERY_STRING' ) != '' ) { $rq = explode( '&', sv( 'QUERY_STRING' ) ); $su = $rq[0]; $v = count( $rq ); for( $i=1; $i < $v; $i++ ) { if ( ( @$GLOBALS[preg_replace( "/=.*/i", "", $rq[$i] )] == '' ) ) { $GLOBALS[preg_replace( "/=.*/i", "", $rq[$i] )] = 'true'; } } } else { $su = $selected; } if( $action == "login" ) { initvar("passwd"); initvar("name"); initvar("requested_action"); initvar("requested_doc"); $sRequest = ( $requested_action == "edit" ) ? "?action=$requested_action&doc=$requested_doc" : ""; $sAdminPassword = getPassword(); $sAdminName = getUser(); $sAdminSeed = getSeed(); $aLocalLogin = getLocalData($requested_doc); if( $passwd == $sAdminPassword and $name == $sAdminName ) { setcookie('login', encrypt( $sAdminName . $sAdminSeed ) ); echo ""; } elseif( $aLocalLogin != false and $passwd == $aLocalLogin["password"] and $name == $aLocalLogin["name"] ) { setcookie( 'login', encrypt( $requested_doc . $aLocalLogin["seed"] ) ); $sRequest = "?doc=$requested_doc&action=edit"; echo ""; } else { setcookie( 'login', '' ); getlost(); } } // SYSTEM FUNCTIONS function sv( $s ) { global $HTTP_SERVER_VARS, $HTTP_ENV_VARS; if( isset( $_SERVER[$s] ) ) { return $_SERVER[$s]; } elseif( isset( $HTTP_SERVER_VARS[$s] ) ) { return $HTTP_SERVER_VARS[$s]; } elseif( isset( $HTTP_ENV_VARS[$s] ) ) { return $HTTP_ENV_VARS[$s]; } else { return ''; } } function initvar( $name ) { global $GLOBALS, $HTTP_GET_VARS, $HTTP_POST_VARS; if( !isset( $GLOBALS[$name] ) ) { if( isset( $_GET[$name] ) ) { $GLOBALS[$name] = $_GET[$name]; } elseif( isset( $HTTP_GET_VARS[$name] ) ) { $GLOBALS[$name] = $HTTP_GET_VARS[$name]; } elseif( isset( $_POST[$name] ) ) { $GLOBALS[$name] = $_POST[$name]; } elseif( isset( $HTTP_POST_VARS[$name] ) ) { $GLOBALS[$name] = $HTTP_POST_VARS[$name]; } else { $GLOBALS[$name] = ''; } } return $GLOBALS[$name]; } function gc( $s ) { global $HTTP_COOKIE_VARS; if( isset( $_COOKIE[$s] ) ) { return $_COOKIE[$s]; } elseif( isset( $HTTP_COOKIE_VARS[$s] ) ) { return $HTTP_COOKIE_VARS[$s]; } return false; } // CMS FUNCTIONS function getContent( $get, $sType = "frontend" ) { global $contentfile, $path; switch( $sType ) { case "backend": $contentfileloc = "./" . $contentfile; break; case "frontend": default: $contentfileloc = $path . "generator/" . $contentfile; break; } $content = ""; $check = 0; $aStrings = @file( $contentfileloc ); if( is_array( $aStrings ) == false ) { print "Error: Can't open database file."; } else { foreach( $aStrings as $iStrNum => $sString ) { if( substr( $sString, 0, 3) != "" ) { if( $check==1 ) { $content .= $sString; } } else { $sData = trim( substr( $sString, 3 ) ); $aData = explode( "|", $sData, 3 ); if( $aData[0] == $get ) { $check = 1; } else { $check = 0; } } } } if( $content != "" ) { return StripSlashes( $content ); } else { return ""; } } function displayContent( $get ) { $bLogo = checkDomain(); $content = ""; global $path; $sDoc = getPageName(); $sEditorPath = "./" . $path . "generator/index.php?action=edit&doc=$sDoc"; $content .= " "; $sContent = getContent( $get ); if( $sContent == "" ) { $content .= "

No entry exists in the for this page. Press control-Y on your keyboard to begin.

"; } $content .= $sContent; if( $bLogo == false ) { $content .= "

"; } return StripSlashes( $content ); } function getKey($keyid) { global $contentfile; $count = 0; $key = ''; $tempstring = ""; if($fh=@fopen($contentfile,"rb")) { while(!feof($fh)) { $tempstring = cs_fgets( $fh ); if( ( substr( $tempstring, 0, 3) ) == "" ) { if( $keyid == $count ) { $sData = trim( substr( $tempstring, 3 ) ); $aData = explode( "|", $sData, 3 ); $key = $aData[0]; } $count = $count + 1; } } fclose($fh); } return $key; } function getKeyListCount() { global $contentfile; $count = 0; $tempstring = ""; if($fh=@fopen($contentfile,"rb")) { while(!feof($fh)) { $tempstring = cs_fgets( $fh ); if ((substr($tempstring, 0, 3))=="") { $count = $count + 1; } } fclose($fh); } return $count; } function addKey( $keyname ) { global $contentfile; if( checkPerm( "admin" ) == false ) { return false; } if( is_writable( $contentfile ) == false ) { print "Error: Database file is not writable."; return false; } $doit = true; for( $i = 0; $i <= getKeyListCount(); $i++ ) { if( getKey( $i ) == $keyname) { $doit = false; } } if( $doit ) { if( $wfh = @fopen( $contentfile, "ab" ) ) { @fwrite( $wfh, "". $keyname . "||\n" . "\n" ); @fclose($wfh); } } } function deleteKey($set) { if( checkPerm( "admin" ) == false ) { return false; } global $contentfile; $content = ""; $tempstring = ""; $check = 0; $wcheck = 0; if($fh=@fopen($contentfile,"rb")) { while(!feof($fh)) { $tempstring = cs_fgets( $fh ); if ((substr($tempstring, 0, 3)!="") && ($wcheck==0) && (substr($tempstring, 0, 3)!="<+>")) { if ($check==1) { $wcheck = 1; } else { $content = $content.$tempstring; } } else if ((substr($tempstring, 0, 3)=="") || (substr($tempstring, 0, 3)=="<+>")) { $sData = trim( substr( $tempstring, 3 ) ); $aData = explode( "|", $sData, 3 ); if( $aData[0] == $set) { $check = 1; } else { $check = 0; $content = $content.$tempstring; } $wcheck = 0; } } fclose($fh); } if($wfh=@fopen($contentfile, "wb")) { fwrite($wfh, $content); fclose($wfh); } } function isRecordExisit( $sPage ) { global $contentfile; if( $fh = @fopen( $contentfile, "rb" ) ) { while( !feof( $fh ) ) { $tempstring = cs_fgets( $fh ); if( substr( $tempstring, 0, 3 ) == "" ) { $sData = trim( substr( $tempstring, 3 ) ); $aData = explode( "|", $sData, 3 ); if( $sPage == $aData[0] ) { fclose( $fh ); return true; } } } } return false; } function setContent( $sDoc, $sNewContent ) { global $contentfile; $contentfile = "./" . $contentfile; if( is_writable( $contentfile ) == false ) { print "Error: Database file is not writable."; return false; } $aStrings = @file( $contentfile ); $check = 0; $sContent = ""; if( is_array( $aStrings ) == false ) { print "Error: Can't open database file $contentfile."; } else { foreach( $aStrings as $iStrNum => $sString ) { if( substr( $sString, 0, 3) != "" and $check == 0 ) { $sContent .= $sString; } elseif( substr( $sString, 0, 3) != "" and $check == 1 ) { } else { $sData = trim( substr( $sString, 3 ) ); $aData = explode( "|", $sData, 3 ); if( $aData[0] == $sDoc ) { $check = 1; $sContent .= $sString; $sContent .= $sNewContent . "\n"; } else { $check = 0; $sContent .= $sString; } } } if( $wfh = @fopen( $contentfile, "wb" ) ) { if( @fwrite( $wfh, $sContent ) == false ) { print "Error: Can't save new data."; } @fclose( $wfh ); } } } function renameKey($set, $newname) { if( checkPerm( "admin" ) == false ) { return false; } $doit=true; for ($i = 0; $i <= getKeyListCount(); $i++) { if (getKey($i)==$newname) { $doit=false; } } if ($doit) { global $contentfile; $content = ""; $tempstring = ""; $check = 0; $wcheck = 0; if($fh=@fopen($contentfile,"rb")) { while(!feof($fh)) { $tempstring = cs_fgets( $fh ); if ((substr($tempstring, 0, 3)!="")) { $content = $content.$tempstring; } else if ((substr($tempstring, 0, 3)=="")) { $sData = trim( substr( $tempstring, 3 ) ); $aData = explode( "|", $sData, 3 ); //echo $aData[0]; if( $aData[0] == $set) { $content = $content."".$newname."||\n"; } else { $content = $content.$tempstring; } } } fclose($fh); } if($wfh=@fopen($contentfile, "wb")) { fwrite($wfh, $content); fclose($wfh); } } echo ""; } function getlost() { //header('status: 401 Unauthorized'); echo "
Unauthorized access.
"; } function getUser() { global $contentfile; $content = ""; $tempstring = ""; $check = 0; if( $fh = @fopen( $contentfile, "rb" ) ) { while(!feof($fh)) { $tempstring = cs_fgets( $fh ); if (substr($tempstring, 0, 3)=="<+>") { $tempstring = cs_fgets( $fh ); $content = substr(str_replace("", "", $tempstring), 0, strlen(str_replace("", "", $tempstring))-1); } } } else { print "Error: Can't open database."; exit(); } if ($content!="") return $content; else return "Error"; } function getPassword() { global $contentfile; $content = ""; $tempstring = ""; $check = 0; if( $fh = @fopen( $contentfile, "rb" ) ) { while(!feof($fh)) { $tempstring = cs_fgets( $fh ); if (substr($tempstring, 0, 3)=="<+>") { $tempstring = cs_fgets( $fh ); $tempstring = cs_fgets( $fh ); $content = substr(str_replace("", "", $tempstring), 0, strlen(str_replace("", "", $tempstring))-1); } } fclose($fh); } else { print "Can't open database."; exit(); } if ($content!="") return $content; else return "Error"; } function getSeed() { global $contentfile; $content = ""; $tempstring = ""; $check = 0; if( $fh = @fopen( $contentfile, "rb" ) ) { while(!feof($fh)) { $tempstring = cs_fgets( $fh ); if (substr($tempstring, 0, 3)=="<+>") { $tempstring = cs_fgets( $fh ); $tempstring = cs_fgets( $fh ); $tempstring = cs_fgets( $fh ); $content = substr(str_replace("", "", $tempstring), 0, strlen(str_replace("", "", $tempstring))-1); } } fclose($fh); } else { print "Error: Can't open database."; exit(); } if ($content!="") return $content; else return "Error"; } function setAdmin( $sName, $sPassword ) { if( checkPerm( "admin" ) == false ) { return false; } global $contentfile; $content = ""; $tempstring = ""; $check = 0; $wcheck = 0; if( $fh = @fopen($contentfile,"rb" ) ) { while( !feof( $fh ) ) { $tempstring = cs_fgets( $fh ); if( substr( $tempstring, 0, 3 ) == "<+>" ) { $content = $content. $tempstring; $tempstring = cs_fgets( $fh ); $content .= $sName . "\n"; $tempstring = cs_fgets( $fh ); $content .= $sPassword . "\n"; $tempstring = cs_fgets( $fh ); $content .= encrypt( mt_rand() ) . "\n"; $tempstring = cs_fgets( $fh ); if( $tempstring != "" ) { $content .= "\n"; } $content .= $tempstring; } else { $content .= $tempstring; } } fclose($fh); } if( $wfh = @fopen( $contentfile, "wb" ) ) { @fwrite( $wfh, $content ); @fclose( $wfh ); } } function getPageName() { $page = sv( "SCRIPT_NAME" ); if( substr( $page, 0, 1 ) == '/' ) { $page = substr($page, 1 ); } return $page; } function checkDomain(){ global $allowed_domain_names, $domain_error_message; $aTmpDomains = explode( ',', $allowed_domain_names ); $iCount = 0; foreach( $aTmpDomains as $sDomain ) { $aDomains[$iCount] = strtolower( trim( $sDomain ) ); $iCount++; } array_unshift( $aDomains, "localhost" ); $sDomain = ""; if( sv( "HTTP_HOST" ) != "" ) { $sDomain = strtolower( sv( "HTTP_HOST" ) ); } elseif( sv( "SERVER_NAME" ) ) { $sDomain = strtolower( sv( "SERVER_NAME" ) ); } else { echo $domain_error_message; return false; } if( $allowed_domain_names == "" ) { return false; } elseif( $allowed_domain_names != "" and is_array( $aDomains ) and count( $aDomains ) > 0 and !in_array( $sDomain, $aDomains ) ) { echo $domain_error_message; return false; } return true; } function getLocalData( $doc ) { global $contentfile; if( $fh = @fopen( $contentfile, "rb" ) ) { while( !feof( $fh ) ) { $tempstring = cs_fgets( $fh ); if( substr( $tempstring, 0, 3 ) == "" ) { $sData = trim( substr( $tempstring, 3 ) ); $aData = explode( "|", $sData, 4 ); if ( $aData[0] == $doc ) { if( isset( $aData[1] ) and isset( $aData[2] ) and isset( $aData[3] ) and $aData[1] != "" and $aData[2] != "" and $aData[3] != "" ) { return array( "name" => $aData[1], "password" => $aData[2], "doc" => $doc, "seed" => $aData[3] ); } } } } fclose( $fh ); } return false; } function setLocalData( $doc, $name, $password ) { if( checkPerm( "admin" ) == false ) { return false; } global $contentfile; $content = ""; $tempstring = ""; $check = 0; if( $fh = @fopen( $contentfile, "rb" ) ) { while( !feof( $fh ) ) { $tempstring = cs_fgets( $fh ); if( substr( $tempstring, 0, 3 ) != "" and $check == 1 ) { $content .= $tempstring; } else { $sData = trim( substr( $tempstring, 3 ) ); $aData = explode( "|", $sData, 3 ); if ( $aData[0] == $doc ) { $tempstring = "$doc|$name|$password|" . encrypt( mt_rand() ) . "\n"; } $content .= $tempstring; } } fclose( $fh ); } if( $wfh = @fopen( $contentfile, "wb" ) ) { fwrite( $wfh, $content ); fclose( $wfh ); return true; } return false; } /** * This fimction gets array of availbale keys */ function getKeys() { global $contentfile; $aKeys = array(); if( $fh = @fopen( $contentfile , "rb" ) ) { $iCount = 0; while( !feof( $fh ) ) { $tempstring = cs_fgets( $fh ); if (substr($tempstring, 0, 3)=="") { $sData = trim( substr( $tempstring, 3 ) ); $aData = explode( "|", $sData ); if( checkPerm( "local", $aData[0] ) == false ) { continue; } $aKeys[$iCount] = $aData[0]; $iCount++; } //if } // while } // if return $aKeys; } // getKeys function checkPerm( $sLevel = "local", $doc = "" ) { checkDomain(); $adm = gc( 'login' ); $sAdminName = getUser(); $sAdminSeed = getSeed(); if( $sAdminSeed == "" ) { $sSecret = encrypt( "true" ); } else { $sSecret = encrypt( $sAdminName . $sAdminSeed ); } $xPerm = false; switch( $sLevel ) { case "local": $aLocalLogin = getLocalData( $doc ); $xPerm = ( ( $adm == $sSecret ) or ( $doc != "" and isset( $aLocalLogin["seed"] ) and $adm == encrypt( $doc . $aLocalLogin["seed"] ) ) ) ? true : false; break; case "admin": $xPerm = ( $adm == $sSecret ) ? true : false; break; } return $xPerm; } function encrypt( $sData ) { $sData = md5( $sData . sv( "HTTP_USER_AGENT" ) ); return $sData; } /** * That function replaces all cs_fgets function. */ function cs_fgets( &$fh ) { $sPHPVer = cs_phpversion(); if( $sPHPVer == 'new' ) { return fgets( $fh ); } else { return fgets( $fh, 4096 ); } } /** * Returns true or false */ function cs_phpversion() { $sPHPVer = 'old'; $sPHPVersion = phpversion(); $aVer = explode( ".", $sPHPVersion ); if( (int)$aVer[0] > 4 or ( (int)$aVer[0] == 4 and (int)$aVer[1] >= 3 ) ) { $sPHPVer = 'new'; } return $sPHPVer; } function list_directory($dir) { $file_list = ""; $stack[] = $dir; while( $stack ) { $current_dir = array_pop( $stack ); if( $dh = @opendir( $current_dir ) ) { while( ( $file = @readdir( $dh ) ) !== false ) { if( $file !== "." AND $file !== ".." ) { $current_file = "{$current_dir}/{$file}"; if( is_file( $current_file ) ) { $file_list[] = "{$file}"; } elseif( is_dir( $current_file ) ) { $stack[] = $current_file; } } } } } return $file_list; } /* * This function will display content without power by * image and without javascript */ function displayContentSub( $get ) { checkDomain(); $content = getContent( $get ); if( $content == "" ) { $content = $content . "

No entry exists for this page area.

"; } return StripSlashes( $content ); } ?> SJB Catholic School | Academics
 
 
Slideshow News & Resources Contact Us
 

Academics

 

 
 
Supporters
 
 
 
Home | News | Academics | Faculty & Staff | Organizations | Fundraisers | Athletics | Policies & Forms | Board | Contact | About
St. John the Baptist Catholic School, 1844 Lincoln Avenue, Whiting, IN 46394 | Phone: 219-659.3042