function updateID($email, $id)
{
    $row = colCont('googleAccount', $email, "users");
    $DATA = getDB("users", $row);
    if (!$DATA['identifier']) {
        writeDB($row, 'identifier', $id, "users");
    }
    return 1;
}
Beispiel #2
0
<?php

session_start();
require 'LTlib.php';
if ($_SESSION["nrwahl"] == 0) {
    $erfolg = writeDB("db83863_4", "UPDATE schueler SET nrwahl='1', Zeitwahl= '" . date('Y-m-d H:i:s', time()) . "', nrwahl= '1', 1Wahl= '" . $_POST['1wahl'] . ';' . $_POST['2wahl'] . ';' . $_POST['3wahl'] . "' WHERE ID = '" . $_SESSION['id'] . "';");
    $_SESSION["nrwahl"] = 1;
} else {
    if ($_SESSION["nrwahl"] == 1) {
        $erfolg = writeDB("db83863_4", "UPDATE schueler SET nrwahl='2', Zeitwahl= '" . date('Y-m-d H:i:s', time()) . "', nrwahl= '2', 2Wahl= '" . $_POST['1wahl'] . ';' . $_POST['2wahl'] . ';' . $_POST['3wahl'] . "' WHERE ID = '" . $_SESSION['id'] . "';");
        $_SESSION["nrwahl"] = 2;
    } else {
        alert("Fehler: Sie können nicht mehr wählen! ;)");
    }
}
if ($erfolg) {
    if ($_SESSION["nrwahl"] == $_SESSION["maxnrwahl"]) {
        echo "<script>alert('Vielen Dank f\\u00fcr deine Wahl!');</script>";
        echo "<script>location.href='/outscreen.php'</script>";
    } else {
        echo "<script>alert('Vielen Dank f\\u00fcr deine Wahl! \n Nun wählen Sie ihre 2. AG!');</script>";
        echo "<script>location.href='/wahl.php'</script>";
    }
} else {
    if ($_SESSION["nrwahl"] == 1) {
        $_SESSION["nrwahl"] = 0;
    } else {
        if ($_SESSION["nrwahl"] == 2) {
            $_SESSION["nrwahl"] = 1;
        }
    }
Beispiel #3
0
function create_newPodcasts_inDB($admin_redirect)
{
    //vars
    global $datum;
    $json = get_podcastList();
    //Json Daten vorhanden
    //Existiert die DB ?
    $existDB = isDBExists();
    if ($existDB == true) {
        //lösche DB
        $is_delete = schalterDB(false);
        if ($is_delete == false) {
            //ist gelöscht => dann: erstelle neue Datenbank
            $db = schalterDB(true);
            //schreibe tabelle in db
            createDB($db);
            //erstelle Inhalt
            $is_write = writeDB($json, $db, $datum);
            if ($is_write == true) {
                //mache weiterleitung ohne cache
                header("location: " . $admin_redirect . "?intern=updatepage");
                header("Cache-Control: post-check=0, pre-check=0", false);
                header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
                header("Pragma: no-cache");
            }
        }
    } else {
        //erstelle neue Datenbank
        $db = schalterDB(true);
        //schreibe tabelle in db
        createDB($db);
        //erstelle Inhalt
        $is_write = writeDB($json, $db, $datum);
        if ($is_write == true) {
            //mache weiterleitung ohne cache
            header("location: " . $admin_redirect . "?intern=updatepage");
            header("Cache-Control: post-check=0, pre-check=0", false);
            header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
            header("Pragma: no-cache");
        }
    }
}
Beispiel #4
0
<?php

$apw = $_POST["apw"];
require "secure/msql.php";
require "LTlib.php";
$sql = "UPDATE sonder_login SET pw = '" . $apw . "'";
writeDB($con, $sql);
echo "<script>createAlert('success', 'Passwort erfolgreich ge\\u00e4ndert');</script>";
<?php

/******************************************************************************
 *
 * This page is called by the Logins form and writes or removes an entry
 *
******************************************************************************/
include $_SERVER["DOCUMENT_ROOT"] . '/app/sql.php';
$action = $_REQUEST["action"];
$index = $_REQUEST["index"];
$name = $_REQUEST["name"];
$account = $_REQUEST["account"];
//$account = query("SELECT googleAccount FROM 'users' WHERE index = $index;");
//announceWrite($announcement, $by);
if ($action == "add") {
    $id = getrows("users");
    query("INSERT INTO users VALUES ({$id}, '{$name}', 1, '{$account}', '');");
} else {
    if ($action == "remove") {
        writeDB($index, "allowed", "0", "users");
    } else {
        header('Location: http://www.aiesecmichigan.com/admin.php?written=-1');
    }
}
header('Location: http://www.aiesecmichigan.com/admin.php?written=1');
Beispiel #6
0
function displayFormTwo()
{
    $sanitized = preg_replace('/[^a-zA-Z0-9\\.\\,\\(\\)@#!?_]/', '', $_POST);
    writeDB($sanitized['dbhost'], $sanitized['dbuser'], $sanitized['dbpass'], $sanitized['dbname']);
    displayHeader();
    if (strlen($_POST['dboldname']) > 0) {
        $headerstring = "Installing and migrating...";
        $quip = "You probably have time to get a coffee.";
    } else {
        $headerstring = "Installing...";
        $quip = "This shouldn't take too long.";
    }
    if (!isset($_POST['dboldname'])) {
        $_POST['dboldname'] = "";
    }
    ?>
	<h2><?php 
    echo $headerstring;
    ?>
</h2>
	<div class="hero-unit">

		<p id="quip"><?php 
    echo $quip;
    ?>
</p>

		<div class="progress progress-striped active">
			<div class="bar" id="progressbar" style="width: 0%;"></div>
		</div>
		<div id="waitbar">

		</div>
		<div id="stats"></div>
	</div>


	<script language="javascript">
		var prunning=0;
		var pinttimer=0;
		var online=1;
		var total = 0;
		var delay=50;

		function startInstall(key) {
			document.getElementById('progressbar').style.width = "1%";
			pinttimer=self.setInterval(function(){runInstall(key)},50);
			runInstall(key);
		}
		function runInstall(key)
		{

			if (prunning==1)
			{
				if(online==2)
				{
					var postvar = "getpg=1";

					$.post("install.php", postvar, function(data)
					{
						if (data[0]=="{")
						{
							obj = JSON.parse(data);
							if (obj.result=='success' && obj.progress>1) {
								document.getElementById('progressbar').style.width = obj.progress + "%";
								document.getElementById('progressbar').style.backgroundColor = "#AA0000";
							}
						}
					});
				}
				return;
			}
			prunning=1;
			var postvar = "sqlline="+ online +
				"&dbname=" + "<?php 
    echo $_POST['dbname'];
    ?>
" +
				"&dboldname=" + "<?php 
    echo $_POST['dboldname'];
    if (isset($_GET['qa'])) {
        echo "&qa=" . $_GET['qa'];
    }
    if (isset($_GET['debug'])) {
        echo "&debug=1";
    }
    ?>
";

			//document.getElementById('waitbar').innerHTML = 'about to post '+postvar;
			$.ajax({
				url: "install.php",
				type:'POST',data:postvar,
				error: function(jqXHR, textStatus, errorThrown){
					delay=delay+1000;
					document.getElementById('quip').innerHTML = "Server appears to be throttling connections, setting delay to "+((delay-50)/1000)+ " seconds";
					clearInterval(pinttimer);
					pinttimer=self.setInterval(function(){runInstall(key)},delay);
					prunning=0;
				}
			}).done(
				function(data){
					//document.getElementById('waitbar').innerHTML = "got back "+data;
				if (data[0]=="{")
				{
					obj = JSON.parse(data);
					if (obj.result=='success')
					{
						var perc = Math.round((100*(online/obj.total)));
						perc = perc/2;
						if(perc<1) perc=1;
						document.getElementById('progressbar').style.width = perc + "%";


						document.getElementById('progressbar').style.backgroundColor = "#149BDF";
						if (!obj.tag) obj.tag = "";
						document.getElementById('stats').innerHTML = obj.tag;
						<?php 
    if (isset($_GET['debug'])) {
        ?>
						document.getElementById('stats').innerHTML = obj.tag + " Running line "+online + " of " + obj.total + " (" + perc + "%)";
						<?php 
    }
    ?>
						if (online==obj.total) {
							clearInterval(pinttimer);
							prunning=0;
							online = 1;
							pinttimer=self.setInterval(function(){runUpgrade(key)},delay);
						}else {
							prunning=0;
							if (obj.line) online = (obj.line*1) +1;
							else online = online + 1;

							if (delay>1050)
							{
								delay=delay-1000;
								document.getElementById('quip').innerHTML =
									"Server appears to be throttling connections, setting delay to "+((delay-50)/1000)+ " seconds";
								clearInterval(pinttimer);
								pinttimer=self.setInterval(function(){runInstall(key)},delay);
							}
						}

					}
				}
				else {
					clearInterval(pinttimer);

					if(data.indexOf("Table 'xlsws_customer' already exists")>0)
						data = "Helpful information: This appears to be an error caused by installing into a database that is not blank. Web Store 3 requires a blank database to install.\n\n" + data;

					data = "An error has occured. If this does not appear to be an issue you can easily remedy based on the information below, please contact Web Store technical support for additional assistance.\n\n" + data;
					document.getElementById('progressbar').style.width = 0;
					document.getElementById('stats').innerHTML = "";
					document.getElementById('quip').innerHTML = "Error, install halted.";
					alert(data);
				}
				//document.getElementById('waitbar').innerHTML = "end of function";
			});

		}

		function runUpgrade(key)
		{

			if (prunning>2400)
			{
				clearInterval(pinttimer);
				prunning=0;
				alert("The install process has become unresponsive. This may indicate a problem with the database. Please contact technical support for additional information. Error information may be available in the xlsws_log table of your database for troubleshooting purposes.");
				document.getElementById('progressbar').style.width = 0;
				document.getElementById('stats').innerHTML = "Check xlsws_log for error information.";
				document.getElementById('quip').innerHTML = "Error, install halted.";

			}
			if (prunning>0) { prunning++; return; }
			prunning=1;
			var postvar = "online="+ online + "&total=" + total +
				"&dbname=" + "<?php 
    echo $_POST['dbname'];
    ?>
" +
				"&dboldname=" + "<?php 
    echo $_POST['dboldname'];
    ?>
";

			var exporturl = window.location.href.replace("/install.php", "/install/<?php 
    echo strlen($_POST['dboldname']) > 0 ? 'upgrade' : 'install';
    ?>
");
			$.ajax({
				url: exporturl,
				type:'POST',data:postvar,
				error: function(jqXHR, textStatus, errorThrown){
					delay=delay+1000;
					document.getElementById('quip').innerHTML = "Server appears to be throttling connections, setting delay to "+((delay-50)/1000)+ "seconds";
					clearInterval(pinttimer);
					pinttimer=self.setInterval(function(){runUpgrade(key)},delay);
					prunning=0;
				}
			}).done(function(data){
				if (data[0]=="{")
				{
					obj = JSON.parse(data);
					if (obj.result=='success')
					{
						total = obj.total;
						online = obj.makeline;
						var perc = 50 + online;
						document.getElementById('progressbar').style.width = perc + "%";
						if (!obj.tag) obj.tag = "";
						document.getElementById('stats').innerHTML = obj.tag;
						<?php 
    if (isset($_GET['debug'])) {
        ?>
						document.getElementById('stats').innerHTML = obj.tag + " at " + " (" + perc + "%)";
						<?php 
    }
    ?>
						if (online==obj.total) {
							clearInterval(pinttimer);
							window.location.href = window.location.href.replace("/install.php", "/admin/license");
						}else {
							prunning=0;
						}

					}
					else {
						clearInterval(pinttimer);
						alert(obj.result);
					}
				}
				else {
					clearInterval(pinttimer);
					alert(data);
				}
			});

		}

		startInstall();

	</script>
	<?php 
    displayFooter();
}