summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorINOPIAE <inopiae@cacert.org>2013-09-14 23:20:18 +0200
committerINOPIAE <inopiae@cacert.org>2013-09-14 23:20:18 +0200
commit4b924244c859aba7daf8c6e04036784d49a767e4 (patch)
tree6599008d0de1d24a8cbd48f9ae96a57839bf0474
parent9709a2ae6177f612ca06e2698041494fdafb7992 (diff)
downloadcacert-devel-4b924244c859aba7daf8c6e04036784d49a767e4.tar.gz
cacert-devel-4b924244c859aba7daf8c6e04036784d49a767e4.tar.xz
cacert-devel-4b924244c859aba7daf8c6e04036784d49a767e4.zip
bug 1192: change call of index/52.php
-rw-r--r--www/index.php46
1 files changed, 28 insertions, 18 deletions
diff --git a/www/index.php b/www/index.php
index 749e7a0..3fec73e 100644
--- a/www/index.php
+++ b/www/index.php
@@ -27,6 +27,7 @@ require_once('../includes/lib/l10n.php');
$id = 0;
$_SESSION['_config']['errmsg'] = "";
+ $ccatest='';
if($id == 17 || $id == 20)
{
@@ -164,31 +165,18 @@ require_once('../includes/lib/l10n.php');
{
$cca=get_last_user_agreement($user_id);
if (!isset($cca['active'])){
- header('location: https://'.$_SERVER['HTTP_HOST'].'/index.php?id=52');
+ $id=52;
+ $ccatest=1;
+ }else{
+ $_SESSION['profile']['loggedin'] = 1;
+ header('location: https://'.$_SERVER['HTTP_HOST'].'/account.php');
exit;
}
- $_SESSION['profile']['loggedin'] = 1;
- header('location: https://'.$_SERVER['HTTP_HOST'].'/account.php');
- exit;
} else {
$_SESSION['profile']['loggedin'] = 0;
}
}
}
-// check for CCA acceptance prior to login
- if ($id == 52)
- {
- $agree = ""; if(array_key_exists('agree',$_REQUEST)) $agree=$_REQUEST['agree'];
- if (!$agree) {
- $_SESSION['profile']['loggedin'] = 0;
- }else{
- include_once("../includes/notary.inc.php");
- write_user_agreement($memid, "CCA", "Login acception", "", 1);
- $_SESSION['profile']['loggedin'] = 1;
- header("location: https://".$_SERVER['HTTP_HOST']."/account.php");
- exit;
- }
- }
if($id == 4 && array_key_exists('profile',$_SESSION) && array_key_exists('loggedin',array($_SESSION['profile'])) && $_SESSION['profile']['loggedin'] == 1)
@@ -369,7 +357,29 @@ require_once('../includes/lib/l10n.php');
} else {
$_SESSION['_config']['errmsg'] = _("Your account has not been verified yet, please check your email account for the signup messages.");
}
+
+ $cca=get_last_user_agreement($user_id);
+ if (!isset($cca['active'])){
+ $id=52;
+ $ccatest=1;
+ }
+ }
+
+// check for CCA acceptance prior to login
+if ($id == 52 && $ccatest=='')
+{
+ $agree = ""; if(array_key_exists('agree',$_REQUEST)) $agree=$_REQUEST['agree'];
+ if (!$agree) {
+ $_SESSION['profile']['loggedin'] = 0;
+ }else{
+ include_once("../includes/notary.inc.php");
+ write_user_agreement($memid, "CCA", "Login acception", "", 1);
+ $_SESSION['profile']['loggedin'] = 1;
+ header("location: https://".$_SERVER['HTTP_HOST']."/account.php");
+ exit;
}
+}
+
if($process && $oldid == 1)
{