view usrajax.js.php @ 1096:bbc0a3d0b51e

Major renaming / refactor of site messages. Some that were previously modifiable from admin interface are now "hardcoded" in the configuration file. Having these settings made modifiable from there made no sense and just took space in the UI.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 27 Jan 2017 22:15:06 +0200
parents 01783161eeb2
children
line wrap: on
line source

<?php
//
// FAPWeb - Simple Web-based Demoparty Management System
// User actions page AJAX javascript module
// (C) Copyright 2012-2017 Tecnic Software productions (TNSP)
//
$sessionType = "user";
header("Content-Type: application/javascript");
require_once "mconfig.inc.php";
require_once "msite.inc.php";
require_once "msession.inc.php";


// Initiate SQL database connection
if (!stConnectSQLDB())
  exit;

// Fetch non-"hardcoded" settings from SQL database
stReloadSettings();

stUserSessionAuth();

stCommonAJAX("usrajax.php", "usrlogout.php");


?>

function updateVote(eid, value)
{
  var msuccess = function(txt)
  {
  }

  var mfail = function(txt)
  {
    jsMessageBox("<h1>Ooops, an error occured</h2><p>Something went wrong, votes might not be submitted. :(</p>");
  }

  jsSendPOSTRequest("action=set&entry_id="+eid+"&vote="+value, msuccess, mfail);
  return false;
}