Subversion Repositories cheapmusic

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 9
Line 12... Line 12...
12
 
12
 
13
if (isset($_GET["target"])) {
13
if (isset($_GET["target"])) {
14
 
14
 
15
    $location = base64_decode($_GET["target"]);
15
    $location = base64_decode($_GET["target"]);
16
    
16
    
-
 
17
    saveRedirect();
17
    printHeader();
18
    printHeader();
18
    printMessage($location);
19
    printMessage($location);
19
    printFooter();
20
    printFooter();
-
 
21
    saveRedirect();
20
    
22
    
21
    echo '<script type="text/javascript">setTimeout( function() { location.href="' . $location . '"; }, 250);</script>';
23
    echo '<script type="text/javascript">setTimeout( function() { location.href="' . $location . '"; }, 250);</script>';
22
 
24
 
23
    exit;
25
    exit;
24
 
26
 
Line 32... Line 34...
32
 
34
 
33
function printHeader() {
35
function printHeader() {
34
    echo '<!DOCTYPE html>';
36
    echo '<!DOCTYPE html>';
35
    echo '<html lang="en">';
37
    echo '<html lang="en">';
36
    echo '<head>';
38
    echo '<head>';
37
    echo '    <title>Merchant Transfer Page</title>';
39
    echo '    <title>FindCheapMusic Transfer Page</title>';
38
    echo '    <meta charset="UTF-8">';
40
    echo '    <meta charset="UTF-8">';
39
    echo '    <meta name="viewport" content="width=device-width, initial-scale=1.0">';
41
    echo '    <meta name="viewport" content="width=device-width, initial-scale=1.0">';
40
    echo '    <style>';
42
    echo '    <style>';
41
    echo '    html, body { margin: 0; padding: 0; width: 100%; height: 100%; display: table; }';
43
    echo '    html, body { margin: 0; padding: 0; width: 100%; height: 100%; display: table; }';
42
    echo '    #content { display: table-cell; text-align: center; vertical-align: middle; }';
44
    echo '    #content { display: table-cell; text-align: center; vertical-align: middle; }';
Line 45... Line 47...
45
    echo '<body>';
47
    echo '<body>';
46
    echo '    <div id="content">';
48
    echo '    <div id="content">';
47
}
49
}
48
 
50
 
49
function printMessage($location) {
51
function printMessage($location) {
50
    echo '<h1>Merchant Transfer Page</h1>';
52
    echo '<h1>FindCheapMusic Transfer Page</h1>';
51
    echo '<p>You are now leaving FindCheapMusic.com. <a href="' . $location . '">Press here</a> if page doesn\'t load.';
53
    echo '<p>You are now leaving FindCheapMusic.com. <a href="' . $location . '">Press here</a> if the page doesn\'t load.';
52
}
54
}
53
 
55
 
54
function printFooter() {
56
function printFooter() {
55
    echo '    </div>';
57
    echo '    </div>';
56
    echo '</body>';
58
    echo '</body>';
57
    echo '</html>';
59
    echo '</html>';
58
    echo '';
60
    echo '';
-
 
61
}
-
 
62
 
-
 
63
function saveRedirect() {
-
 
64
    include_once('php/sessions_db.php');
-
 
65
    include_once('php/cryptor.php');
-
 
66
 
-
 
67
    $configFile = parse_ini_file("../MyFiles/config/cheapmusic.ini",true);
-
 
68
    $crypt = Cryptor::getInstance($configFile['cryptor']);
-
 
69
    $tmpSessionTab = (isset($_POST["sessionTab"]) && $_POST["sessionTab"] > 0 ? $_POST["sessionTab"] : null);
-
 
70
    $handler = MySessionHandler::getInstance($tmpSessionTab, $configFile['mysqli']);
-
 
71
    unset($configFile);
-
 
72
 
-
 
73
    ini_set("session.cookie_httponly", 1);
-
 
74
    ini_set("session.cookie_secure", 1);
-
 
75
    session_set_save_handler($handler, true);
-
 
76
    session_start();
-
 
77
 
-
 
78
    $_sess_db = $handler->getDBSessionId();
-
 
79
	    
-
 
80
    $access = mysqli_real_escape_string($_sess_db, time());
-
 
81
    $url = mysqli_real_escape_string($_sess_db, base64_decode($_GET["target"]));
-
 
82
 
-
 
83
    $sql = "INSERT
-
 
84
            INTO transfers
-
 
85
            (sessId, access, url)
-
 
86
            VALUES  ('" . session_id() . "', '$access', '$url')";
-
 
87
 
-
 
88
    return mysqli_query($_sess_db, $sql);
59
}
89
}
60
?>
90
?>