diff msite.inc.php @ 1114:51f24cb35fc8

s/SET_LEN_/SQL_LEN_/g
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 14 Oct 2019 10:31:39 +0300
parents 0a2117349f46
children 24e6915fc0fb
line wrap: on
line diff
--- a/msite.inc.php	Mon Oct 14 10:31:20 2019 +0300
+++ b/msite.inc.php	Mon Oct 14 10:31:39 2019 +0300
@@ -14,33 +14,33 @@
 
 // Define sizes of database fields, see createdb.php
 // and also the places where input is validated.
-define("SET_LEN_USERNAME", 32);
-define("SET_LEN_GROUPS", 64);
-define("SET_LEN_ONELINER", 64);
-define("SET_LEN_EMAIL", 80);
-define("SET_LEN_REGHOST", 128);
+define("SQL_LEN_USERNAME", 32);
+define("SQL_LEN_GROUPS", 64);
+define("SQL_LEN_ONELINER", 64);
+define("SQL_LEN_EMAIL", 80);
+define("SQL_LEN_REGHOST", 128);
 
-define("SET_LEN_NEWS_TITLE", 128);
-define("SET_LEN_NEWS_TEXT", 4096);
-define("SET_LEN_NEWS_AUTHOR", 64);
+define("SQL_LEN_NEWS_TITLE", 128);
+define("SQL_LEN_NEWS_TEXT", 4096);
+define("SQL_LEN_NEWS_AUTHOR", 64);
 
-define("SET_LEN_COMPO_NAME", 128);
-define("SET_LEN_COMPO_DESC", 4096);
-define("SET_LEN_COMPO_NOTES", 4096);
-define("SET_LEN_COMPO_PATH", 128);
+define("SQL_LEN_COMPO_NAME", 128);
+define("SQL_LEN_COMPO_DESC", 4096);
+define("SQL_LEN_COMPO_NOTES", 4096);
+define("SQL_LEN_COMPO_PATH", 128);
 
-define("SET_LEN_ENTRY_NAME", 64);
-define("SET_LEN_ENTRY_AUTHOR", 64);
-define("SET_LEN_ENTRY_FILENAME", 128);
-define("SET_LEN_ENTRY_INFO", 50*4);
-define("SET_LEN_ENTRY_NOTES", 1024);
-define("SET_LEN_ENTRY_PREVIEW_FILE", 128);
+define("SQL_LEN_ENTRY_NAME", 64);
+define("SQL_LEN_ENTRY_AUTHOR", 64);
+define("SQL_LEN_ENTRY_FILENAME", 128);
+define("SQL_LEN_ENTRY_INFO", 50*4);
+define("SQL_LEN_ENTRY_NOTES", 1024);
+define("SQL_LEN_ENTRY_PREVIEW_FILE", 128);
 
-define("SET_LEN_DISP_SLIDE_TITLE", 64);
-define("SET_LEN_DISP_SLIDE_TEXT", 4096);
-define("SET_LEN_ROT_LIST_NAME", 128);
+define("SQL_LEN_DISP_SLIDE_TITLE", 64);
+define("SQL_LEN_DISP_SLIDE_TEXT", 4096);
+define("SQL_LEN_ROT_LIST_NAME", 128);
 
-define("SET_LEN_USERKEY", 64);
+define("SQL_LEN_USERKEY", 64);
 
 
 //
@@ -427,16 +427,16 @@
   }
 
   echo
-    stGetTDFormTextInput($edit, 20, SET_LEN_USERNAME, "name", $id, $prefix, $item["name"]).
-    stGetTDFormTextInput($edit, 20, SET_LEN_GROUPS, "groups", $id, $prefix, $item["groups"]).
+    stGetTDFormTextInput($edit, 20, SQL_LEN_USERNAME, "name", $id, $prefix, $item["name"]).
+    stGetTDFormTextInput($edit, 20, SQL_LEN_GROUPS, "groups", $id, $prefix, $item["groups"]).
     "<td class=\"regtime\">".date("d.m. H:i", $item["regtime"])."</td>".
-    stGetTDFormTextInput($edit, 30, SET_LEN_ONELINER, "oneliner", $id, $prefix, $item["oneliner"], "autocomplete=\"off\"");
+    stGetTDFormTextInput($edit, 30, SQL_LEN_ONELINER, "oneliner", $id, $prefix, $item["oneliner"], "autocomplete=\"off\"");
 
   if ($full)
   {
     echo
-      stGetTDFormTextInput($edit, 15, SET_LEN_EMAIL, "email", $id, $prefix, $item["email"], "autocomplete=\"off\"").
-      stGetTDFormTextInput($edit, 15, SET_LEN_REGHOST, "reghost", $id, $prefix, $item["reghost"], "autocomplete=\"off\"");
+      stGetTDFormTextInput($edit, 15, SQL_LEN_EMAIL, "email", $id, $prefix, $item["email"], "autocomplete=\"off\"").
+      stGetTDFormTextInput($edit, 15, SQL_LEN_REGHOST, "reghost", $id, $prefix, $item["reghost"], "autocomplete=\"off\"");
 
     if ($edit)
     {
@@ -622,19 +622,19 @@
 
   if (stChkRequestItem("name", $name,
       array(CHK_ISGT, VT_STR, 0, "Handle / name not given."),
-      array(CHK_LTEQ, VT_STR, SET_LEN_USERNAME, "Handle / name is too long, should be less than ".SET_LEN_USERNAME." characters.")))
+      array(CHK_LTEQ, VT_STR, SQL_LEN_USERNAME, "Handle / name is too long, should be less than ".SQL_LEN_USERNAME." characters.")))
     $chk++;
   else
     $res = FALSE;
 
   if (stChkRequestItem("groups", $groups,
-      array(CHK_LTEQ, VT_STR, SET_LEN_GROUPS, "Groups are too long, should be less than ".SET_LEN_GROUPS." characters.")))
+      array(CHK_LTEQ, VT_STR, SQL_LEN_GROUPS, "Groups are too long, should be less than ".SQL_LEN_GROUPS." characters.")))
     $chk++;
   else
     $res = FALSE;
 
   if (!stChkRequestItem("oneliner", $oneliner,
-      array(CHK_LTEQ, VT_STR, SET_LEN_ONELINER, "Oneliner is too long, should be less than ".SET_LEN_ONELINER." characters.")))
+      array(CHK_LTEQ, VT_STR, SQL_LEN_ONELINER, "Oneliner is too long, should be less than ".SQL_LEN_ONELINER." characters.")))
     $res = FALSE;
 
   $email = stGetRequestItem("email");
@@ -650,9 +650,9 @@
     $res = FALSE;
   }
   else
-  if (strlen($email) > SET_LEN_EMAIL)
+  if (strlen($email) > SQL_LEN_EMAIL)
   {
-    stError("E-mail address too long, max ".SET_LEN_EMAIL." characters.");
+    stError("E-mail address too long, max ".SQL_LEN_EMAIL." characters.");
     $res = FALSE;
   }
   else