]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Trying to standardize php names
authorJean-Marc Pigeon <jmp@safe.c>
Sat, 6 Sep 2025 09:26:51 +0000 (05:26 -0400)
committerJean-Marc Pigeon <jmp@safe.c>
Sat, 6 Sep 2025 09:26:51 +0000 (05:26 -0400)
mailleur.spec.in
www/index.php
www/login.php [deleted file]
www/lvllog.php [new file with mode: 0644]
www/lvlmai.php [moved from www/lvldis.php with 91% similarity]
www/lvlusr.php
www/unidis.php

index 486fed833825f311f6cb39822e9d007b81885f20..299d844324d8beae9b1e991d654f66021a4cf976 100644 (file)
@@ -76,10 +76,10 @@ search about email exchange within time and transaction context.
 %attr(0750,%{name},mail) %dir %{spooldir}/%{name}/mails
 %attr(0750,%{name},apache) %dir %{wwwdir}/%{name}/
 %{wwwdir}/%{name}/index.php
-%attr(0750,%{name},apache) %{wwwdir}/%{name}/%{name}.php
+%attr(0750,%{name},apache) %{wwwdir}/%{name}/lvlmai.php
 %attr(0750,%{name},apache) %{wwwdir}/%{name}/devsql.php
 %attr(0750,%{name},apache) %{wwwdir}/%{name}/gessql.php
-%attr(0750,%{name},apache) %{wwwdir}/%{name}/login.php
+%attr(0750,%{name},apache) %{wwwdir}/%{name}/lvllog.php
 %attr(0750,%{name},apache) %{wwwdir}/%{name}/release.php
 %attr(0750,%{name},apache) %{wwwdir}/%{name}/unidis.php
 %attr(0750,%{name},apache) %{wwwdir}/%{name}/unienv.php
@@ -138,7 +138,7 @@ if [ ! "$(getent passwd %{name})" ]; then
 %post
 OS=`%{_libdir}/%{name}/shell/getsysos.sh`
 ln -nsf                                                        \
-       ./login.php                                     \
+       ./lvllog.php                                    \
        %{_var}/www/%{name}/index.php                   \
 
 if [ "$1" = 1 ]; then
index ce0cbc5876203d31d2c17507617d780e3796f0bf..336b4849320600a8e6e116b7133186d755b76c8e 120000 (symlink)
@@ -1 +1 @@
-login.php
\ No newline at end of file
+lvllog.php
\ No newline at end of file
diff --git a/www/login.php b/www/login.php
deleted file mode 100644 (file)
index 8a7336e..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-// vim: smarttab tabstop=8 shiftwidth=2 expandtab
-//==============================================================
-//
-//     login screen management
-//
-//==============================================================
-include_once "subrou.php";
-include_once "unienv.php";
-include_once "unidis.php";
-include_once "gessql.php";
-
-//==============================================================
-//
-//      To display login screen body
-//
-//==============================================================
-function body()
-
-{
-global $isadmin;
-
-$top=topper($isadmin,NULL,"login");
-$footer=footer("login");
-$login=login();
-
-$STR  = <<<EOT
-<!DOCTYPE html>
-<HTML>    
-<HEAD>
-<TITLE>Starting</TITLE>
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
-</HEAD>
-<BODY="white">
-
-<CENTER><STRONG><FONT SIZE=+2 color=red>
-$top
-</FONT></STRONG></CENTER>
-$login
-$footer
-</BODY>
-</HTML>
-EOT;
-
-return $STR;
-}
-
-if ($_SERVER["REQUEST_METHOD"] == "POST") {
-  $pass=$_POST["passwd"];
-  $logname=$_POST["email"];
-  $dbsql=sql_connect();
-  $isok=sql_checkpassword($dbsql,$logname,$pass);
-  sql_close($dbsql);
-  switch ($isok) {
-    case false  :       //trouble report
-      echo "<script>";
-      echo "alert('wrong username or password. Please try again.');";
-      echo "</script>";
-      break;
-    default     :
-      header('Location: lvldis.php');
-      break;
-    }
-  }
-
-//display main screen
-echo body();
-?>
-
-
-
diff --git a/www/lvllog.php b/www/lvllog.php
new file mode 100644 (file)
index 0000000..5c38cfd
--- /dev/null
@@ -0,0 +1,160 @@
+<?php
+// vim: smarttab tabstop=8 shiftwidth=2 expandtab
+//==============================================================
+//
+//     login screen management
+//
+//==============================================================
+include_once "subrou.php";
+include_once "unienv.php";
+include_once "unidis.php";
+include_once "gessql.php";
+
+//==============================================================
+//
+//     To display the login screen
+//
+//==============================================================
+function login()
+
+{
+$STR  = <<<EOT
+
+<script>
+//==============================================================
+//function to show password contents
+//==============================================================
+function showpass()
+
+{
+var datain;
+  
+datain=document.getElementById("myInput");
+if (datain.type==="password") {
+  datain.type="text";
+  }
+else {
+  datain.type = "password";
+  }
+}
+</script>
+
+<table border="0" align="center" width="350" cellpadding="0" cellspacing="0">
+    <tr>
+      <td><img src="/reg-icons/login.gif" alt="" border="0" /></td>
+    </tr>
+
+    <tr>
+      <td align="center" bgcolor="#000000">
+        <table width="100%" cellpadding="0" cellspacing="1" border="0">
+          <tr>
+            <td bgcolor="#FFFFFF" align="right">
+           <form method="post"
+                 action="lvllog.php"
+                 enctype="application/x-www-form-urlencoded"
+                 name="login">
+              <table align="center" border="0" cellspacing="2" cellpadding="0">
+                <tr>
+                  <td align="left" nowrap="nowrap">Email:</td>
+                  <td>
+                 <input type="text" name="email" size="20" onchange="" />
+                 </td>
+                </tr>
+
+                <tr>
+                  <td align="left" nowrap="nowrap">Password:</td>
+                  <td>
+                 <input type="password" name="passwd" size="20" id="myInput" />
+                 <input type="checkbox" onclick="showpass()">Show
+                 </td>
+                </tr>
+              </table>
+
+              <table width="100%" cellpadding="0" cellspacing="1" border="0">
+                <tr>
+                  <td align="center" colspan="2">
+                    <input type="hidden" name="action" value="login" />
+                    <table>
+                      <tr>
+                        <td align="center">
+                       <input type="submit" name="loginbutton" value="Login" />
+                       </td>
+                      </tr>
+                    </table>
+                  </td>
+                </tr>
+              </table>
+            </td>
+           </form>
+          </tr>
+        </table>
+      </td>
+    </tr>
+  </table>
+<br>
+<br>
+
+EOT;
+
+return $STR;
+}
+
+//==============================================================
+//
+//      To display login screen body
+//
+//==============================================================
+function body()
+
+{
+global $isadmin;
+
+$top=topper($isadmin,NULL,"lvllog");
+$footer=footer("lvllog");
+$login=login();
+
+$STR  = <<<EOT
+<!DOCTYPE html>
+<HTML>    
+<HEAD>
+<TITLE>Starting</TITLE>
+<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
+</HEAD>
+<BODY="white">
+
+<CENTER><STRONG><FONT SIZE=+2 color=red>
+$top
+</FONT></STRONG></CENTER>
+$login
+$footer
+</BODY>
+</HTML>
+EOT;
+
+return $STR;
+}
+
+if ($_SERVER["REQUEST_METHOD"] == "POST") {
+  $pass=$_POST["passwd"];
+  $logname=$_POST["email"];
+  $dbsql=sql_connect();
+  $isok=sql_checkpassword($dbsql,$logname,$pass);
+  sql_close($dbsql);
+  switch ($isok) {
+    case false  :       //trouble report
+      echo "<script>";
+      echo "alert('wrong username or password. Please try again.');";
+      echo "</script>";
+      break;
+    default     :
+      header('Location: lvlmai.php');
+      break;
+    }
+  }
+
+//display main screen
+echo body();
+?>
+
+
+
similarity index 91%
rename from www/lvldis.php
rename to www/lvlmai.php
index cfaf63c930278f659bbe1fe355b335a6fac5a605..accc9de1837da5f5edbc8c7d9052f71053f606c6 100644 (file)
@@ -16,8 +16,8 @@ function body($logname)
 {
 global $isadmin;
 
-$top=topper($isadmin,$logname,"lvldis");
-$footer=footer("lvldis");
+$top=topper($isadmin,$logname,"lvlmai");
+$footer=footer("lvlmai");
 $cook="???";
 if (isset($_COOKIE[getenv("APPNAME")])==true)
   $cook=$_COOKIE[getenv("APPNAME")];
@@ -60,7 +60,7 @@ if ($logname!=NULL) {
   echo body($logname);
   }
 else {
-  header('Location: login.php');
+  header('Location: lvllog.php');
   }
 ?>
 
index 0d49ca16e4d4edc4876a8ff41bb638f72abd177a..1de95a883780fc6e16495e093a24262732bae6d5 100644 (file)
@@ -53,7 +53,7 @@ if ($logname!=NULL) {
   echo body($logname);
   }
 else {
-  header('Location: login.php');
+  header('Location: lvllog.php');
   }
 ?>
 
index 91b40065311e2c0018eb9762ebcc732de25188af..609e5d5fecda145cc21a594088021a24989446ec 100644 (file)
@@ -23,10 +23,10 @@ $click3="";
 if ($isadmin==true) 
   $admcolor="red";
 switch ($pageref) {
-  case "login" :
+  case "lvllog"        :
     $entete="Authentication";
     break;
-  case "lvldis"        :
+  case "lvlmai"        :
     $entete="main";
     if ($isadmin==true) {
       $click2="<a href='/lvlusr.php'>Remotes</a>";
@@ -35,7 +35,7 @@ switch ($pageref) {
     break;
   case "lvlusr"        :
     $entete="user management";
-    $click3="<a href='/lvldis.php'>Main screen</a>";
+    $click3="<a href='/lvlmai.php'>Main screen</a>";
     break;
   default      :
     $color="red";
@@ -108,93 +108,4 @@ EOT;
 return $STR;
 }
 
-//==============================================================
-//
-//     To display the login screen
-//
-//==============================================================
-function login()
-
-{
-$STR  = <<<EOT
-
-<script>
-//==============================================================
-//function to show password contents
-//==============================================================
-function showpass()
-
-{
-var datain;
-  
-datain=document.getElementById("myInput");
-if (datain.type==="password") {
-  datain.type="text";
-  }
-else {
-  datain.type = "password";
-  }
-}
-</script>
-
-<table border="0" align="center" width="350" cellpadding="0" cellspacing="0">
-    <tr>
-      <td><img src="/reg-icons/login.gif" alt="" border="0" /></td>
-    </tr>
-
-    <tr>
-      <td align="center" bgcolor="#000000">
-        <table width="100%" cellpadding="0" cellspacing="1" border="0">
-          <tr>
-            <td bgcolor="#FFFFFF" align="right">
-           <form method="post"
-                 action="login.php"
-                 enctype="application/x-www-form-urlencoded"
-                 name="login">
-              <table align="center" border="0" cellspacing="2" cellpadding="0">
-                <tr>
-                  <td align="left" nowrap="nowrap">Email:</td>
-                  <td>
-                 <input type="text" name="email" size="20" onchange="" />
-                 </td>
-                </tr>
-
-                <tr>
-                  <td align="left" nowrap="nowrap">Password:</td>
-                  <td>
-                 <input type="password" name="passwd" size="20" id="myInput" />
-                 <input type="checkbox" onclick="showpass()">Show
-                 </td>
-                </tr>
-              </table>
-
-              <table width="100%" cellpadding="0" cellspacing="1" border="0">
-                <tr>
-                  <td align="center" colspan="2">
-                    <input type="hidden" name="action" value="login" />
-                    <table>
-                      <tr>
-                        <td align="center">
-                       <input type="submit" name="loginbutton" value="Login" />
-                       </td>
-                      </tr>
-                    </table>
-                  </td>
-                </tr>
-              </table>
-            </td>
-           </form>
-          </tr>
-        </table>
-      </td>
-    </tr>
-  </table>
-<br>
-<br>
-
-EOT;
-
-return $STR;
-}
-
 ?>