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