diff admajax.php @ 228:e3dd18b58e6c

Rename some functions.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 18 Nov 2013 14:15:09 +0200
parents 44081a2066f5
children 6927edc7e266
line wrap: on
line diff
--- a/admajax.php	Mon Nov 18 14:05:09 2013 +0200
+++ b/admajax.php	Mon Nov 18 14:15:09 2013 +0200
@@ -10,7 +10,7 @@
 require_once "msession.inc.php";
 
 
-function stCheckRequestCompoData($full)
+function stValidateRequestCompoData($full)
 {
   if (!stChkRequestItem("name", $fake,
       array(CHK_ISGT, VT_STR, 0, "Compo name too short"),
@@ -36,7 +36,7 @@
 }
 
 
-function stCheckRequestEntryData(&$compo_id)
+function stValidateRequestEntryData(&$compo_id)
 {
   return
     stChkRequestItem("name", $fake,
@@ -61,7 +61,7 @@
 }
 
 
-function stCheckRequestNewsData()
+function stValidateRequestNewsData()
 {
   return
     stChkRequestItem("text", $fake,
@@ -499,7 +499,7 @@
     //
     // Add new entry
     //
-    if ($type == "news" && stCheckRequestNewsData())
+    if ($type == "news" && stValidateRequestNewsData())
     {
       $sql = stPrepareSQL(
         "INSERT INTO news (utime,title,text,author) VALUES (%d,%S,%Q,%S)",
@@ -508,7 +508,7 @@
       stExecSQLCond($sql, "OK, news item added.");
     }
     else
-    if ($type == "compo" && stCheckRequestCompoData(FALSE))
+    if ($type == "compo" && stValidateRequestCompoData(FALSE))
     {
       $sql = stPrepareSQL(
         "INSERT INTO compos (name,description,visible,voting,showAuthors) VALUES (%S,%Q,0,0,0)",
@@ -517,7 +517,7 @@
       stExecSQLCond($sql, "OK, compo added.");
     }
     else
-    if ($type == "attendees" && stCheckRequestUserData(TRUE))
+    if ($type == "attendees" && stValidateRequestUserData(TRUE))
     {
       $sql = stPrepareSQL(
         "INSERT INTO attendees (regtime,name,groups,oneliner,email) VALUES (%d,%S,%S,%S,%S)",
@@ -526,7 +526,7 @@
       stExecSQLCond($sql, "OK, attendee added.");
     }
     else
-    if ($type == "entry" && stCheckRequestEntryData($fake))
+    if ($type == "entry" && stValidateRequestEntryData($fake))
     {
       $sql = stPrepareSQL(
         "INSERT INTO entries (name,author,compo_id,filename,info) VALUES (%S,%S,%D,%S,%S)",
@@ -551,7 +551,7 @@
     }
     if (stChkRequestItem("id", $id, array(CHK_TYPE, VT_INT, "Invalid data.")))
     {
-      if ($type == "attendees" && stCheckRequestUserData(TRUE))
+      if ($type == "attendees" && stValidateRequestUserData(TRUE))
       {
         $sql = stPrepareSQLUpdate("attendees",
           "WHERE id=".intval(stGetRequestItem("id")),
@@ -565,7 +565,7 @@
         stExecSQLCond($sql, "OK, attendee updated.");
       }
       else
-      if ($type == "news" && stCheckRequestNewsData())
+      if ($type == "news" && stValidateRequestNewsData())
       {
         $sql = stPrepareSQLUpdate("news",
           "WHERE id=".intval(stGetRequestItem("id")),
@@ -578,7 +578,7 @@
         stExecSQLCond($sql, "OK, news item updated.");
       }
       else
-      if ($type == "compo" && stCheckRequestCompoData(TRUE))
+      if ($type == "compo" && stValidateRequestCompoData(TRUE))
       {
         $sql = stPrepareSQLUpdate("compos",
           "WHERE id=".intval(stGetRequestItem("id")),
@@ -593,7 +593,7 @@
         stExecSQLCond($sql, "OK, compo updated.");
       }
       else
-      if ($type == "entry" && stCheckRequestEntryData($compo_id))
+      if ($type == "entry" && stValidateRequestEntryData($compo_id))
       {
         if (stFetchSQLColumn("SELECT id FROM compos WHERE id=".$compo_id) === FALSE)
         {