-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify.php
More file actions
125 lines (124 loc) · 5 KB
/
Copy pathverify.php
File metadata and controls
125 lines (124 loc) · 5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?php
/*
* Property of Writale
* All rights reserved
* Writale © 2013
*/
require_once realpath(dirname(__FILE__) ."/class/init.php");
if (isset($_SESSION['uid']) || isset($_COOKIE['uid'])) {
require_once realpath(dirname(__FILE__) . "/control/session/saved.php");
}
if(isset($_GET['id']) && isset($_GET['veri_n'])) {
try {
$_mysql->autocommit(false);
$vn = Util::sanitize($_GET['veri_n'], WRITALE_INPT_GEN);
$id = Util::sanitize($_GET['id'], WRITALE_INPT_GEN);
$acc = new AccountUtility($id, array('veri_nonce' => $vn));
$status = $acc->verify();
if($status == -1)
$_invalid = 1;
else if($status == 0)
$_expired = 1;
// $query = "SELECT * FROM nonce where nonce_string = '$vn' AND userid = '$id'"
// . " AND purpose = 'V'";
// $res = $_mysql->query($query);
// if ($res->num_rows == 1) {
// $row = $res->fetch_assoc();
// if ($row['expired'] == 0) {
// $_mysql->query("UPDATE user SET verified = 1 WHERE userid= '$id' ");
// $_mysql->query("UPDATE nonce SET expired = 1 WHERE nonce_string = '$vn' ");
// } else {
// $_expired = 1;
// }
// $_SESSION['q_av'] = true;
// } else {
// $_invalid = 1;
// }
$_mysql->commit();
} catch (Exception $ex) {
$_error = 1;
Util::__errorSummary(WRITALE_ERR_GEN, $ex);
}
}
else $_invalid =1;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title> Verify Account </title>
<meta name="description" content="" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" type="image/x-icon" href="//<?php echo $_SERVER['HTTP_HOST']; ?>/resource/image/icon/favicon.ico" />
<link rel="stylesheet" type="text/css" href="//<?php echo $_SERVER['HTTP_HOST']; ?>/style/universal.css" />
<link rel="stylesheet" type="text/css" href="//<?php echo $_SERVER['HTTP_HOST']; ?>/style/style-2192013223.css" />
<script src="//<?php echo $_SERVER['HTTP_HOST']; ?>/script/common.js"></script>
</head>
<body id="verify-body">
<?php
if (isset($_SESSION['uid'])) {
include realpath(dirname(__FILE__) . '/control/decorator/userpanel.php');
} else {
include realpath(dirname(__FILE__) . '/control/decorator/signuppanel.php');
}
?>
<div id="verify-container">
<div id="verify-msg">
<div id="msg-head">
<?php
if(isset($_invalid)) {
?>
<span id="verify-error">Sorry! That's an invalid request.</span>
<?php
} else if(!isset($_error)) {
if(isset($_expired)) { ?>
Your account is <strong>already</strong> verified.
<?php }
else { ?>
Your account has been verified.
<?php } ?>
<img id="verified-icon"
src="<?php echo $_protocol.$_SERVER['HTTP_HOST'].'/resource/image/misc/verified.gif'; ?>"
alt="" />
<?php } ?>
</div>
<div id="msg-detail">
<?php if(isset($_SESSION['uid'])) {
?>
<a href="<?php echo $_protocol.$_SERVER['HTTP_HOST'].'/home'; ?>">
<div class="button-std button-blue" id="verify-continue">
Continue
</div></a>
to use Writale.
<?php
if(!isset($_invalid) && $id != $_SESSION['uid']) {
?>
<div id="diff-user-notice">
<ul type="square">
<li>Please note, that you are not logged in as yourself but, as
<?php echo Query::getFullName();?>,
right now.</li></ul>
</div>
<?php
}
?>
<?php } else {
?>
<a href="<?php echo $_protocol.$_SERVER['HTTP_HOST'].'/login'; ?>">
<div class="button-std button-blue" id="verify-login">
Login
</div></a>
to use Writale.
<?php
} ?>
</div>
</div>
</div>
<?php require realpath(dirname(__FILE__) . '/control/decorator/pagefooter.php'); ?>
<?php
include realpath(dirname(__FILE__) . '/control/decorator/utilbottom.php');
if (isset($_SESSION['uid']))
include realpath(dirname(__FILE__) . '/control/decorator/savedutil.php');
?>
</body>
</html>