(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
if (defined('VISCACHA_CORE') == false) {
    die('Error: Hacking Attempt');
}
include 'classes/class.gpc.php';
$gpc = new GPC();
// Thanks to phpBB for this code
if (ini_isActive(@ini_get('register_globals'))) {
    unset($not_used, $input);
    $not_unset = array('_GET', '_POST', '_COOKIE', '_SERVER', '_SESSION', '_ENV', '_FILES', 'config', 'gpc', 'imagetype_extension', 'var');
    $input = array_merge($_GET, $_POST, $_COOKIE, $_ENV, $_FILES);
    if (isset($_SERVER)) {
        $input = array_merge($input, $_SERVER);
    }
    if (isset($_SESSION) && is_array($_SESSION)) {
        $input = array_merge($input, $_SESSION);
    }
    unset($input['input'], $input['not_unset']);
    while (list($var, ) = @each($input)) {
        if (!in_array($var, $not_unset)) {
            unset(${$var});
}
@ini_set('default_charset', '');
header('Content-type: text/html; charset: iso-8859-1');
$htmlhead = '';
// Arrays for Dates
$months = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
$days = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
// Arrays for Permissions
$gls = array('admin' => 'Is Administrator', 'gmod' => 'Is Global Moderator', 'guest' => 'Is Guest', 'members' => 'Can view Memberlist', 'profile' => 'Can view Profiles', 'pdf' => 'Can view PDF-Files', 'pm' => 'Can use PM', 'wwo' => 'Can view Who is Online', 'search' => 'Can use Search', 'team' => 'Can view Teamlist', 'usepic' => 'Can use (own) Avatar', 'useabout' => 'Create (own) Personal Page', 'usesignature' => 'Can use (own) Signature', 'downloadfiles' => 'Can download Attachements', 'forum' => 'Can view Forums', 'posttopics' => 'Can start a new Thread', 'postreplies' => 'Can write a reply', 'addvotes' => 'Can start a Poll', 'attachments' => 'Can add Attachements', 'edit' => 'Can edit own Posts', 'voting' => 'Can vote', 'docs' => 'Can view Documents/Pages');
$glk = array_keys($gls);
$glk_forums = array('downloadfiles', 'forum', 'posttopics', 'postreplies', 'addvotes', 'attachments', 'edit', 'voting');
$gll = array('admin' => 'The user ist he highest ranked Administrator in the forum. He may use this admincenter and has full control of the forum!', 'gmod' => 'The user will automatically be moderator in all forums and can use all options and actions on topics.', 'guest' => 'The users in this usergroup are (not registered) guests.', 'members' => 'May view the memberlist and use eventually observably data.', 'profile' => 'The user may view the profiles of the members and use eventually observably data.', 'pdf' => 'The user may download particular topics as PDF-file.', 'pm' => 'The user may use the Private Messaging (PM) System. He can send, receive, administer and archive private messages.', 'wwo' => 'May view the where-is-who-online-list with the users residence.', 'search' => 'May use the Search and view the results.', 'team' => 'May view the teamlist with administrators, global moderators and moderators.', 'usepic' => 'May upload his own picture for his profile (frequently named avatar) or indicate an URL to a picture.', 'useabout' => 'May create a personal site in his user profile.', 'usesignature' => 'The user may create his own signature.', 'downloadfiles' => 'The user may view and download attached files.', 'forum' => 'The user may generally view the forums and read them.', 'posttopics' => 'New topics may be started.', 'postreplies' => 'Answers to topics may be written.', 'addvotes' => 'Polls may be created within topics.', 'attachments' => 'The user may attach files to his post.', 'edit' => 'The user may edit and delete his own posts.', 'voting' => 'The user may participate in polls in topics.', 'docs' => 'May view all documents & pages.');
$guest_limitation = array('admin', 'gmod', 'pm', 'usepic', 'useabout', 'usesignature', 'voting', 'edit');
// Variables
require_once "classes/class.gpc.php";
$gpc = new GPC();
$action = $gpc->get('action', none);
if (empty($_REQUEST['page'])) {
    $_REQUEST['page'] = 1;
}
// Permission and Logging Class
require_once "classes/class.permissions.php";
// A class for Templates
include_once "classes/class.template.php";
// A class for Languages
include_once "classes/class.language.php";
// Global functions
require_once "classes/function.global.php";
function isInvisibleHook($hook)
{
    switch ($hook) {
	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
if (isset($_SERVER['PHP_SELF']) && basename($_SERVER['PHP_SELF']) == "function.gpc.php") {
    die('Error: Hacking Attempt');
}
/* Handling of _GET, _POST, _REQUEST, _COOKIE, _SERVER, _ENV
 _ENV, _SERVER: Won't be checked
 _COOKIE: You can check them in the script, won't be checked
 _REQUEST: Won't be checked - array has the original values (with magic_quotes if enabled)
 _POST, _GET: Are checked and save (after this file)
*/
include 'classes/class.gpc.php';
$gpc = new GPC();
$http_vars = array('action' => str, 'job' => str, 'search' => str, 'reply' => str, 'name' => str, 'email' => str, 'topic' => str, 'comment' => str, 'error' => str, 'pw' => str, 'pwx' => str, 'order' => str, 'sort' => str, 'letter' => str, 'fullname' => str, 'about' => str, 'location' => str, 'signature' => str, 'hp' => str, 'icq' => str, 'pic' => str, 'question' => str, 'type' => str, 'gender' => str, 'aol' => str, 'msn' => str, 'yahoo' => str, 'jabber' => str, 'fid' => str, 'file' => str, 'groups' => str, 'board' => int, 'topic_id' => int, 'id' => int, 'page' => int, 'temp' => int, 'temp2' => int, 'dosmileys' => int, 'dowords' => int, 'birthday' => int, 'birthmonth' => int, 'birthyear' => int, 'opt_0' => int, 'opt_1' => int, 'opt_2' => int, 'opt_3' => int, 'opt_4' => int, 'opt_5' => int, 'opt_6' => int, 'opt_7' => int, 'notice' => arr_str, 'boards' => arr_int, 'delete' => arr_int);
$http_all = array_merge(array_keys($http_vars), array_keys($_POST), array_keys($_GET));
$http_all = array_unique($http_all);
$http_std = array(int => 0, arr_int => array(), arr_str => array(), str => '', none => null);
foreach ($http_all as $key) {
    if (isset($http_vars[$key])) {
        $type = $http_vars[$key];
    } else {
        $type = str;
    }
    if (isset($_POST[$key])) {
        if ($type == int || $type == arr_int) {
            $_POST[$key] = $gpc->save_int($_POST[$key]);
        } else {
            $_POST[$key] = $gpc->save_str($_POST[$key]);
 function updateconfig($key, $type = str, $val = null)
 {
     if (is_array($key)) {
         $key = array_map('trim', $key);
         $group = $key[0];
         $key = $key[1];
     } else {
         $key = trim($key);
     }
     if ($val == null) {
         global $gpc;
         if (!isset($gpc) || !is_object($gpc)) {
             $gpc = new GPC();
         }
         if ($type == str) {
             $type2 = none;
         } else {
             $type2 = $type;
         }
         $val = $gpc->get($key, $type2);
     }
     if (isset($group)) {
         $this->opt[$group][$key] = $type;
         $this->data[$group][$key] = $val;
     } else {
         $this->opt[$key] = $type;
         $this->data[$key] = $val;
     }
 }