]>
Commit | Line | Data |
---|---|---|
997305cf | 1 | <?php |
79ffa771 JP |
2 | /* |
3 | (c) 2005 Joe Presbrey | |
4 | */ | |
997305cf | 5 | |
dc478ec8 | 6 | require_once('mitsql.cfg.php'); |
997305cf JP |
7 | require_once('mitsql.lib.php'); |
8 | ||
8ed5cf01 | 9 | $msg = $err = $timings = array(); |
dc478ec8 | 10 | |
1389493c JP |
11 | ## PROCESS CERTIFICATE |
12 | ||
dc478ec8 JP |
13 | $SSLCred = getSSLCert(); |
14 | $SSLName = ''; | |
15 | $SSLEmail = ''; | |
16 | $SSLUsername = ''; | |
17 | ||
8ed5cf01 JP |
18 | if (isOnline()) { |
19 | ||
20 | ## HANDLE SOME GLOBAL ACTIONS | |
377015e0 | 21 | |
8ed5cf01 JP |
22 | if (isset($i_ssl)) { |
23 | if (isSSL() && $i_ssl==1) redirect(newQS('ssl')); | |
24 | if (!isSSL() && $i_ssl==0) redirect(newQS('ssl')); | |
25 | redirect2(flipSSL()); | |
26 | } | |
27 | if (isset($i_reset)) { session_destroy(); session_start(); redirect(newQS('reset')); } | |
28 | ||
29 | ## SETUP SESSION VARS | |
30 | ||
31 | $UserId = sess('UserId'); | |
32 | $Login = new Login($UserId); | |
33 | ||
34 | if (isSSL() || !isLoggedIn()) { | |
35 | $SSLName = $SSLCred['Name']; | |
36 | $SSLUsername = $SSLCred['Username']; | |
37 | $SSLEmail = $SSLCred['Email']; | |
38 | ||
39 | /*$LoginSSL = sess('LoginSSL'); | |
40 | if (!is_a($LoginSSL, 'Login')) { $LoginSSL = new Login($SSLUsername); }*/ | |
89905822 | 41 | $LoginSSL = new Login(getUsernameID($SSLUsername)); |
8ed5cf01 JP |
42 | $LoginSSL->update($SSLCred['Name'],$SSLCred['Email']); |
43 | ||
44 | if (!isLoggedIn() && !$LoginSSL->exists()) { | |
45 | if (!empty($SSLName)) | |
46 | addUser($SSLCred); | |
89905822 | 47 | $LoginSSL = new Login(getUsernameID($SSLUsername)); |
8ed5cf01 JP |
48 | } |
49 | } else { | |
50 | unset($_SESSION['LoginSSL']); | |
51 | } | |
377015e0 | 52 | |
690e37fb | 53 | /* |
8ed5cf01 | 54 | if (isPost() || isset($i_refresh)) { |
e346f2b3 JP |
55 | if (!empty($UserId)) { |
56 | checkQuotas($UserId); | |
57 | } | |
690e37fb | 58 | isset($i_refresh) && redirect('main?r'); |
377015e0 | 59 | } |
690e37fb | 60 | */ |
8ed5cf01 JP |
61 | |
62 | } // isOnline() | |
6eacda6d | 63 | |
88b7d384 | 64 | ?> |