some gpg code added + bug fixes etc

pull/1/head
root 20 years ago
parent 21cc988c40
commit 2e0fce259e

@ -0,0 +1,91 @@
#!/usr/bin/php
<?
/**
* check site seal
*
* @package org.cacert.framework
* @author Duane Groth <duane@groth.net>
* @copyright Copyright (C) 2003, {@link http://www.cacert.org/ CAcert Inc.}
* @version $Id: siteseal.cgi,v 1.1 2004/11/10 06:12:43 root Exp $
*/
if($_SERVER["HTTPS"] == "on")
$http = "https";
else
$http = "http";
/* obfuscate var names */
srand((double)microtime()*1000000);
$var1 = "ca".md5(rand(0,9999999));
$var2 = "ca".md5(rand(0,9999999));
$var3 = "ca".md5(rand(0,9999999));
$var4 = "ca".md5(rand(0,9999999));
$var5 = "ca".md5(rand(0,9999999));
$var6 = "ca".md5(rand(0,9999999));
$var7 = "ca".md5(rand(0,9999999));
$var8 = "ca".md5(rand(0,9999999));
$var9 = "ca".md5(rand(0,9999999));
$var10 = "ca".md5(rand(0,9999999));
$var11 = "ca".md5(rand(0,9999999));
header("Content-Type: text/javascript");
header("Content-Disposition: inline; filename=\"siteseal.js\"");
?>
var <?=$var1?> = window.location.href;
<? // var <?=$var2?> = '<?=$http?>://www.cacert.org/certdetails.php?referer=' + <?=$var1?>; ?>
var <?=$var2?> = '<?=$http?>://www.cacert.org';
var <?=$var3?> = (new Date()).getTimezoneOffset();
var <?=$var4?> = navigator.userAgent.toLowerCase();
var <?=$var5?> = false;
if (<?=$var4?>.indexOf("msid") != 1) {
<?=$var5?> = (<?=$var4?>.indexOf("msie 5") == -1 && <?=$var4?>.indexOf("msie 6") == -1);
}
function <?=$var6?>(e) {
if (document.addEventListener) {
if (e.target.name == '<?=$var7?>') {
<?=$var8?>();
return false;
}
} else if (document.captureEvents) {
if (e.target.toString().indexOf('certdetails') != -1) {
<?=$var8?>();
return false;
}
}
return true;
}
function <?=$var9?>() {
if (event.button == 1) {
if (<?=$var5?>) {
return true;
} else {
<?=$var8?>();
return false;
}
} else if (event.button == 2) {
<?=$var8?>();
return false;
}
}
function <?=$var8?>() {
cacertWindow = window.open(<?=$var2?>, '<?=$var10?>', config='height=420,width=523,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=yes');
cacertWindow.focus();
}
if (document.addEventListener) {
document.addEventListener('mouseup', <?=$var6?>, true);
} else {
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=<?=$var6?>;
}
}
document.write("<a href='" + <?=$var2?> + "' target='<?=$var10?>' tabindex='-1' onmousedown='<?=$var9?>(); return false;'><img name='<?=$var7?>' border='0' src='<?=$http?>://www.cacert.org/sealgen.php?cert=<?=$cert?>&referer=" + <?=$var1?> + "' alt='Click to verify' oncontextmenu='return false;' /></a>"); ?>

@ -12,92 +12,7 @@
the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the License for more details.
*/
if($_SERVER['HTTP_HOST'] == "secure.cacert.org")
{
$query = "select * from `emailcerts` where `serial`='$_SERVER[SSL_CLIENT_M_SERIAL]' and `revoked`=0 and
UNIX_TIMESTAMP(`expire`) - UNIX_TIMESTAMP() > 0";
$res = mysql_query($query);
if(mysql_num_rows($res) > 0)
{
$row = mysql_fetch_assoc($res);
$_SESSION['profile'] = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".$row['memid']."'"));
$_SESSION['profile']['loggedin'] = 1;
} else {
$_SESSION['profile']['loggedin'] = 0;
unset($_SESSION['_config']['oldlocation']);
foreach($_GET as $key => $val)
{
if($_SESSION['_config']['oldlocation'])
$_SESSION['_config']['oldlocation'] .= "&";
$_SESSION['_config']['oldlocation'] .= "$key=$val";
}
$_SESSION['_config']['oldlocation'] = "account.php?".$_SESSION['_config']['oldlocation'];
header("location: https://".$_SERVER['HTTP_HOST']."/index.php?id=4");
exit;
}
} else if($_SERVER['HTTP_HOST'] == "secure.cacert.org" && $_SESSION['profile']['id'] > 0) {
$_SESSION['profile'] = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".$_SESSION['profile']['id']."'"));
}
if($_SERVER['HTTP_HOST'] == "secure.cacert.org" && ($_SESSION['profile']['id'] <= 0 || $_SESSION['profile']['loggedin'] == 0))
{
header("location: https://www.cacert.org");
exit;
}
if($_SERVER['HTTP_HOST'] == "secure.cacert.org" && $_SESSION['profile']['id'] > 0)
{
$query = "select sum(`points`) as `total` from `notary` where `to`='".$_SESSION['profile']['id']."' group by `to`";
$res = mysql_query($query);
$row = mysql_fetch_assoc($res);
$_SESSION['profile']['points'] = $row['total'];
if($_SESSION['profile']['language'] == "")
{
$query = "update `users` set `language`='".$_SESSION['_config']['language']."'
where `id`='".$_SESSION['profile']['id']."'";
mysql_query($query);
} else {
$_SESSION['_config']['language'] = $_SESSION['profile']['language'];
putenv("LANG=".$_SESSION['_config']['language']);
setlocale(LC_ALL, $_SESSION['_config']['language']);
$domain = 'messages';
bindtextdomain("$domain", "/home/cacert/locale");
textdomain("$domain");
}
}
if($id == "logout")
{
$_SESSION['profile']['loggedin'] = 0;
header("location: https://".$_SERVER['HTTP_HOST']."/index.php");
exit;
}
if($_SESSION['profile']['loggedin'] < 1)
{
unset($_SESSION['_config']['oldlocation']);
foreach($_GET as $key => $val)
{
if($_SESSION['_config']['oldlocation'])
$_SESSION['_config']['oldlocation'] .= "&";
$_SESSION['_config']['oldlocation'] .= "$key=$val";
}
$_SESSION['_config']['oldlocation'] = "account.php?".$_SESSION['_config']['oldlocation'];
header("location: https://".$_SERVER['HTTP_HOST']."/index.php?id=4");
exit;
}
require_once("../includes/loggedin.php");
loadem("account");
@ -208,7 +123,7 @@
}
$_SESSION['_config']['addid'] = $addid;
if($_SESSION['profile']['points'] > 50)
if($_SESSION['profile']['points'] >= 50)
$_SESSION['_config']['incname'] = intval($incname);
$id = 4;
}
@ -256,6 +171,12 @@
$emails .= "commonName = ".$_SESSION['profile']['fname']."\n";
if($_SESSION['_config']['incname'] == 2)
$emails .= "commonName = ".$_SESSION['profile']['fname']." ".$_SESSION['profile']['lname']."\n";
if($_SESSION['_config']['incname'] == 3)
$emails .= "commonName = ".$_SESSION['profile']['fname']." ".$_SESSION['profile']['mname']." ".$_SESSION['profile']['lname']."\n";
if($_SESSION['_config']['incname'] == 4)
$emails .= "commonName = ".$_SESSION['profile']['fname']." ".$_SESSION['profile']['lname']." ".$_SESSION['profile']['suffix']."\n";
if($_SESSION['_config']['incname'] == 5)
$emails .= "commonName = ".$_SESSION['profile']['fname']." ".$_SESSION['profile']['mname']." ".$_SESSION['profile']['lname']." ".$_SESSION['profile']['suffix']."\n";
$emails .= "SPKAC = ".str_replace("\n", "", str_replace("\r", "", $_POST['SPKAC']));
$query = "insert into `emailcerts` set `CN`='$defaultemail', `keytype`='NS',
`memid`='".$_SESSION['profile']['id']."',
@ -286,6 +207,12 @@
$csrsubject = "/CN=".$_SESSION['profile']['fname'];
if($_SESSION['_config']['incname'] == 2)
$csrsubject = "/CN=".$_SESSION['profile']['fname']." ".$_SESSION['profile']['lname'];
if($_SESSION['_config']['incname'] == 3)
$csrsubject = "/CN = ".$_SESSION['profile']['fname']." ".$_SESSION['profile']['mname']." ".$_SESSION['profile']['lname']."\n";
if($_SESSION['_config']['incname'] == 4)
$csrsubject = "/CN = ".$_SESSION['profile']['fname']." ".$_SESSION['profile']['lname']." ".$_SESSION['profile']['suffix']."\n";
if($_SESSION['_config']['incname'] == 5)
$csrsubject = "/CN = ".$_SESSION['profile']['fname']." ".$_SESSION['profile']['mname']." ".$_SESSION['profile']['lname']." ".$_SESSION['profile']['suffix']."\n";
if(is_array($_SESSION['_config']['addid']))
foreach($_SESSION['_config']['addid'] as $id)
{

@ -30,6 +30,8 @@
$tmpid = $id;
if($PHP_SELF == "/wot.php")
$tmpid = $id + 500;
if($PHP_SELF == "/gpg.php")
$tmpid = $id + 1000;
switch($tmpid)
{
@ -82,6 +84,17 @@
case 504:
case 505:
case 506: $expand = " explode('WoT');"; break;
case 1000:
case 1001:
case 1002:
case 1003:
case 1004:
case 1005:
case 1006:
case 1007:
case 1008:
case 1009:
case 1010: $expand = " explode('gpg');"; break;
}
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
@ -165,7 +178,7 @@ function hideall() {
<? if($_SESSION['profile']['id'] == 1) { ?>
<div class="relatedLinks">
<h3 onclick="explode('gpg')">+ <?=_("GPG/PGP Keys")?></h3>
<ul class="menu" id="gpg"><li><a href="#"><?=_("New")?></a></li><li><a href="#"><?=_("View")?></a></li></ul>
<ul class="menu" id="gpg"><li><a href="gpg.php?id=0"><?=_("New")?></a></li><li><a href="gpg.php?id=2"><?=_("View")?></a></li></ul>
</div>
<? } ?>
<? if($_SESSION['profile']['admin'] == 1) { ?>

@ -36,7 +36,7 @@
$_SESSION['_config']['translations'] = array("da_DK" => "Dansk", "de_DE" => "Deutsch", "en_AU" => "English",
"es_ES" => "Español", "fr_FR" => "Français", "it_IT" => "Italiano",
"hu_HU" => "Magyar", "nl_NL" => "Nederlands", "pt_PT" => "Português",
"zh_CN" => "Chinese");
"pt_BR" => "Português Brasileiro", "zh_CN" => "Chinese");
if($_SESSION['_config']['language'] == "")
{
@ -134,7 +134,7 @@
function includeit($id = "0", $section = "index")
{
$id = intval($id);
if($section != "index" && $section != "account" && $section != "wot" && $section != "help")
if($section != "index" && $section != "account" && $section != "wot" && $section != "help" && $section != "gpg")
{
$section = "index";
}
@ -479,4 +479,17 @@
return(10);
return(0);
}
function hex2bin($data)
{
while(strstr($data, "\\x"))
{
$pos = strlen($data) - strlen(strstr($data, "\\x"));
$before = substr($data, 0, $pos);
$char = chr(hexdec(substr($data, $pos + 2, 2)));
$after = substr($data, $pos + 4);
$data = $before.$char.$after;
}
return(utf8_decode($data));
}
?>

@ -0,0 +1,101 @@
<? /*
Copyright (C) 2004 by Duane Groth <duane_at_CAcert_dot_org>
This file is part of CAcert.
CAcert has been released under a CAcert Source license
which can be found included with these source files or can
be downloaded from the internet from the following address:
http://www.cacert.org/src-lic.php
CAcert is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the License for more details.
*/
if($_SERVER['HTTP_HOST'] == "secure.cacert.org")
{
$query = "select * from `emailcerts` where `serial`='$_SERVER[SSL_CLIENT_M_SERIAL]' and `revoked`=0 and
UNIX_TIMESTAMP(`expire`) - UNIX_TIMESTAMP() > 0";
$res = mysql_query($query);
if(mysql_num_rows($res) > 0)
{
$row = mysql_fetch_assoc($res);
$_SESSION['profile'] = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".$row['memid']."'"));
$_SESSION['profile']['loggedin'] = 1;
} else {
$_SESSION['profile']['loggedin'] = 0;
unset($_SESSION['_config']['oldlocation']);
foreach($_GET as $key => $val)
{
if($_SESSION['_config']['oldlocation'])
$_SESSION['_config']['oldlocation'] .= "&";
$_SESSION['_config']['oldlocation'] .= "$key=$val";
}
$_SESSION['_config']['oldlocation'] = "account.php?".$_SESSION['_config']['oldlocation'];
header("location: https://".$_SERVER['HTTP_HOST']."/index.php?id=4");
exit;
}
} else if($_SERVER['HTTP_HOST'] == "secure.cacert.org" && $_SESSION['profile']['id'] > 0) {
$_SESSION['profile'] = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".$_SESSION['profile']['id']."'"));
}
if($_SERVER['HTTP_HOST'] == "secure.cacert.org" && ($_SESSION['profile']['id'] <= 0 || $_SESSION['profile']['loggedin'] == 0))
{
header("location: https://www.cacert.org");
exit;
}
if($_SERVER['HTTP_HOST'] == "secure.cacert.org" && $_SESSION['profile']['id'] > 0)
{
$query = "select sum(`points`) as `total` from `notary` where `to`='".$_SESSION['profile']['id']."' group by `to`";
$res = mysql_query($query);
$row = mysql_fetch_assoc($res);
$_SESSION['profile']['points'] = $row['total'];
if($_SESSION['profile']['language'] == "")
{
$query = "update `users` set `language`='".$_SESSION['_config']['language']."'
where `id`='".$_SESSION['profile']['id']."'";
mysql_query($query);
} else {
$_SESSION['_config']['language'] = $_SESSION['profile']['language'];
putenv("LANG=".$_SESSION['_config']['language']);
setlocale(LC_ALL, $_SESSION['_config']['language']);
$domain = 'messages';
bindtextdomain("$domain", "/home/cacert/locale");
textdomain("$domain");
}
}
if($id == "logout")
{
$_SESSION['profile']['loggedin'] = 0;
header("location: https://".$_SERVER['HTTP_HOST']."/index.php");
exit;
}
if($_SESSION['profile']['loggedin'] < 1)
{
unset($_SESSION['_config']['oldlocation']);
foreach($_GET as $key => $val)
{
if($_SESSION['_config']['oldlocation'])
$_SESSION['_config']['oldlocation'] .= "&";
$_SESSION['_config']['oldlocation'] .= "$key=$val";
}
$_SESSION['_config']['oldlocation'] = "account.php?".$_SESSION['_config']['oldlocation'];
header("location: https://".$_SERVER['HTTP_HOST']."/index.php?id=4");
exit;
}
?>

File diff suppressed because it is too large Load Diff

@ -40,7 +40,7 @@
<td class="DataTD"><?=$row[email]?></td>
</tr>
<? }
if($_SESSION['profile']['points'] > 50)
if($_SESSION['profile']['points'] >= 50)
{
$fname = $_SESSION[profile][fname];
$mname = $_SESSION[profile][mname];

@ -23,7 +23,7 @@
$user = mysql_fetch_array($res);
$userlang = $user['language'];
$points = mysql_num_rows(mysql_query("select sum(`points`) as `total` from `notary`
where `to`='".$user['id']."' group by `to` HAVING SUM(`points`) >= 100"));
where `to`='".$user['id']."' group by `to` HAVING SUM(`points`) > 0"));
if($points <= 0)
{
echo _("Sorry, I was unable to locate that user.");

@ -1,8 +1,9 @@
all: runserver.c runclient.c
gcc -O2 -o runserver runserver.c
gcc -O2 -o runclient runclient.c
chown root:www-data runserver runclient
chmod 4710 runserver runclient
gcc -O2 -o rungpg rungpg.c
chown root:www-data runserver runclient rungpg
chmod 4710 runserver runclient rungpg
clean:
rm -f runserver runclient
rm -f runserver runclient rungpg

@ -0,0 +1,161 @@
<? /*
Copyright (C) 2004 by Duane Groth <duane_at_CAcert_dot_org>
This file is part of CAcert.
CAcert has been released under the CAcert Source License
which can be found included with these source files or can
be downloaded from the internet from the following address:
http://www.cacert.org/src-lic.php
CAcert is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the License for more details.
*/ ?>
<?
require_once("../includes/loggedin.php");
loadem("account");
$oldid = intval($_POST['oldid']);
$id = intval($id);
if($oldid == "1")
{
if($_POST['process'] != _("Submit") || $_POST['level'] == "" || $_POST['CSR'] == "" || intval($_POST['level']) < 0 || intval($_POST['level']) > 1)
{
$_SESSON['_config']['errmsg'] = _("You failed to paste a valid GPG/PGP key.");
$id = $oldid;
unset($oldid);
}
}
if($oldid == "1")
{
$gpgkey = $_POST['CSR'];
$gpg = `echo "$gpgkey"|gpg --with-colons --homedir /tmp 2>&1`;
$lines = "";
foreach(explode("\n", $gpg) as $line)
{
if(substr($line, 0, 3) == "pub" || substr($line, 0, 3) == "uid")
{
if($lines != "")
$lines .= "\n";
$lines .= $line;
}
}
$gpg = $lines;
foreach(explode("\n", $gpg) as $line)
{
$name = $comment = "";
$bits = explode(":", $line);
if($bits[0] == "pub" && (!$keyid || !$when))
{
$keyid = $bits[4];
$when = $bits[5];
}
if(!strstr($line, "@")) continue;
$pos = strpos($bits[9], "(") - 1;
$nocomment = 0;
if($pos < 0)
{
$nocomment = 1;
$pos = strpos($bits[9], "<") - 1;
}
$name = trim(hex2bin(trim(substr($bits[9], 0, $pos))));
if($name != "")
$names[] = $name;
if($nocomment == 0)
{
$pos += 2;
$pos2 = strpos($bits[9], ")");
$comm = trim(hex2bin(trim(substr($bits[9], $pos, $pos2 - $pos))));
if($comm != "")
$comment[] = $comm;
$pos = $pos2 + 3;
} else {
$pos = strpos($bits[9], "<") + 1;
}
$pos2 = strpos($bits[9], ">", $pos);
$mail = trim(hex2bin(trim(substr($bits[9], $pos, $pos2 - $pos))));
if($mail != "")
$emailaddies[] = $mail;
}
if($_SESSION['profile']['points'] < 50 && $_POST['level'] == 1)
{
$_SESSON['_config']['errmsg'] = _("You don't have enough assurance points to be issued a high level trust gpg signature.");
unset($_POST['process']);
$id = $oldid;
unset($oldid);
}
foreach($names as $name)
{
if($name == $_SESSION['profile']['fname']." ".$_SESSION['profile']['lname'])
continue;
if($name == $_SESSION['profile']['fname']." ".$_SESSION['profile']['mname']." ".$_SESSION['profile']['lname'])
continue;
if($name == $_SESSION['profile']['fname']." ".$_SESSION['profile']['lname']." ".$_SESSION['profile']['suffix'])
continue;
if($name == $_SESSION['profile']['fname']." ".$_SESSION['profile']['mname']." ".$_SESSION['profile']['lname']." ".$_SESSION['profile']['suffix'])
continue;
$_SESSON['_config']['errmsg'] = _("No suitable name combination could be matched from your PGP/GPG keys to what we have in the database");
unset($_POST['process']);
$id = $oldid;
unset($oldid);
}
foreach($emailaddies as $email)
{
if(mysql_num_rows(mysql_query("select * from `email` where `memid`='".$_SESSION['profile']['id']."' and
`email`='$email' and `deleted`=0 and `hash`=''")) > 0)
continue;
$_SESSON['_config']['errmsg'] = _("No suitable emails could be matched from your PGP/GPG keys to what we have in the database");
unset($_POST['process']);
$id = $oldid;
unset($oldid);
}
}
if($oldid == "1")
{
$_POST['level'] = intval($_POST['level']);
if($_POST['level'] < 0 || $_POST['level'] > 1)
$_POST['level'] = 0;
$query = "insert into `gpg` set `memid`='".$_SESSION['profile']['id']."', `email`='".$emailaddies['0']."',`level`='".$_POST['level']."'";
mysql_query($query);
$id = mysql_insert_id();
$fp = fopen("../csr/gpg-$id.csr", "w");
fputs($fp, $csr);
fclose($fp);
mysql_query("update `gpg` set `csr`='../csr/gpg-$id.csr' where `id`='$id'");
$do = `../scripts/rungpg`;
showheader(_("Welcome to CAcert.org"));
$query = "select * from `gpg` where `id`='$id' and `crt`!=''";
$res = mysql_query($query);
if(mysql_num_rows($res) <= 0)
{
echo _("Your certificate request has failed to be processed correctly, please try submitting it again.");
} else {
echo "<pre>";
readfile("../crt/gpg-$id.crt");
echo "</pre>";
}
showfooter();
exit;
}
showheader(_("Welcome to CAcert.org"));
includeit($id, "gpg");
showfooter();
?>

@ -1,7 +1,7 @@
<?
if($process == "Confirm, I agree to these terms and conditions" && $iagree == "yes")
{
$output_file = $fname = "cacert-20041026.tar.bz2";
$output_file = $fname = "cacert-20041103.tar.bz2";
header('Pragma: public');

@ -13,91 +13,7 @@
PARTICULAR PURPOSE. See the License for more details.
*/ ?>
<?
if($_SERVER['HTTP_HOST'] == "secure.cacert.org")
{
$query = "select * from `emailcerts` where `serial`='".mysql_escape_string(stripslashes($_SERVER['SSL_CLIENT_M_SERIAL']))."'
and `revoked`=0 and UNIX_TIMESTAMP(`expire`) - UNIX_TIMESTAMP() > 0";
$res = mysql_query($query);
if(mysql_num_rows($res) > 0)
{
$row = mysql_fetch_assoc($res);
$_SESSION['profile'] = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='$row[memid]'"));
$_SESSION['profile']['loggedin'] = 1;
} else {
$_SESSION['profile']['loggedin'] = 0;
unset($_SESSION['_config']['oldlocation']);
foreach($_GET as $key => $val)
{
if($_SESSION['_config']['oldlocation'])
$_SESSION['_config']['oldlocation'] .= "&";
$_SESSION['_config']['oldlocation'] .= "$key=$val";
}
$_SESSION['_config']['oldlocation'] = "wot.php?".$_SESSION['_config']['oldlocation'];
header("location: https://".$_SERVER['HTTP_HOST']."/index.php?id=4");
exit;
}
} else if($_SERVER['HTTP_HOST'] == "secure.cacert.org" && $_SESSION['profile']['id'] > 0) {
$_SESSION['profile'] = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".$_SESSION['profile']['id']."'"));
}
if($_SERVER['HTTP_HOST'] == "secure.cacert.org" && ($_SESSION['profile']['id'] <= 0 || $_SESSION['profile']['loggedin'] == 0))
{
header("location: https://www.cacert.org");
exit;
}
if($_SERVER['HTTP_HOST'] == "secure.cacert.org" && $_SESSION['profile']['id'] > 0)
{
$query = "select sum(`points`) as `total` from `notary` where `to`='".$_SESSION['profile']['id']."' group by `to`";
$res = mysql_query($query);
$row = mysql_fetch_assoc($res);
$_SESSION['profile']['points'] = $row['total'];
if($_SESSION['profile']['language'] == "")
{
$query = "update `users` set `language`='".$_SESSION['_config']['language']."'
where `id`='".$_SESSION['profile']['id']."'";
mysql_query($query);
} else {
$_SESSION['_config']['language'] = $_SESSION['profile']['language'];
putenv("LANG=".$_SESSION['_config']['language']);
setlocale(LC_ALL, $_SESSION['_config']['language']);
$domain = 'messages';
bindtextdomain("$domain", "/home/cacert/locale");
textdomain("$domain");
}
}
if($id == "logout")
{
$_SESSION['profile']['loggedin'] = 0;
header("location: https://".$_SERVER['HTTP_HOST']."/index.php");
exit;
}
if($_SESSION['profile']['loggedin'] < 1)
{
unset($_SESSION['_config']['oldlocation']);
foreach($_GET as $key => $val)
{
if($_SESSION['_config']['oldlocation'])
$_SESSION['_config']['oldlocation'] .= "&";
$_SESSION['_config']['oldlocation'] .= "$key=$val";
}
$_SESSION['_config']['oldlocation'] = "wot.php?".$_SESSION['_config']['oldlocation'];
header("location: https://".$_SERVER['HTTP_HOST']."/index.php?id=4");
exit;
}
require_once("../includes/loggedin.php");
loadem("account");

Loading…
Cancel
Save