noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 09/23: IText require , used for admin and pas


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 09/23: IText require , used for admin and password
Date: Tue, 24 Nov 2020 14:22:40 -0500 (EST)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 93723987b45d9f3c60d98353b6a1f9b2af94956b
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Thu Nov 12 18:08:33 2020 +0100

    IText require , used for admin and password
---
 html/install.php            | 12 +++++++-----
 include/lib/config_file.php |  2 ++
 include/lib/itext.class.php | 16 ++++++++++++----
 3 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/html/install.php b/html/install.php
index efa5aad..821df7a 100644
--- a/html/install.php
+++ b/html/install.php
@@ -260,13 +260,15 @@ if (isset($_POST['save_config'])) {
   // If conx successfull save the file or display it
   // -----
   if ( $err == 0 && $cnx !== false ) {
-       echo '<h1>'._('Important').'</h1>';
-       echo '<h2 class="warning">',_("Voici l'utilisateur et mot de passe de 
l'utilisateur administrateur de Noalyss , "
+      echo '<div style="border:red 1px solid">';
+       echo '<h1 
style="padding-top:0px;margin-top:0px;background-color:orangered">'._('Important').'</h1>';
+       echo '<p style="padding:10px">',_("Voici l'utilisateur et mot de passe 
de l'utilisateur administrateur de Noalyss , "
                . " il a tous les droits et a accès à tout."
                . " Connectez-vous avec ses identifiants et changer le mot de 
passe dans préférence (en haut à droit)"),
-        "</h2>";
-       echo '<p style="font-size:120%">'._('Utilisateur administrateur'),' 
','<span style="color:red"> ',$cadmin,'</span>','</p>';
-       echo '<p style="font-size:120%">',_('Mot de passe'),'<span 
style="color:red"> '.$cpassword_admin.' </span>','</p>';
+        "</p>";
+       echo '<p style="padding:10px;font-size:120%">'._('Utilisateur 
administrateur'),' ','<span style="color:red"> ',$cadmin,'</span>','</p>';
+       echo '<p style="padding:10px;font-size:120%">',_('Mot de passe'),'<span 
style="color:red"> '.$cpassword_admin.' </span>','</p>';
+       echo '</div>';
       // Create the db
       if (is_writable(NOALYSS_INCLUDE)) { 
         $url=config_file_create($_POST,1,$os); 
diff --git a/include/lib/config_file.php b/include/lib/config_file.php
index 3f7c7e6..b70da17 100644
--- a/include/lib/config_file.php
+++ b/include/lib/config_file.php
@@ -94,6 +94,7 @@ function config_file_form($p_array=null)
     $ichost=new IText("chost",$chost);
     
     $icadmin=new IText('cadmin',$cadmin);
+    $icadmin->set_require(true);
     /*
      * For version MONO
      */
@@ -109,6 +110,7 @@ function config_file_form($p_array=null)
     
     $icpassword_admin=new IText('cpassword_admin');
     $icpassword_admin->value=$cpassword_admin;
+    $icpassword_admin->set_require(true);
     
     require NOALYSS_TEMPLATE.'/template_config_form.php';
 }
diff --git a/include/lib/itext.class.php b/include/lib/itext.class.php
index 0b813aa..e74c238 100644
--- a/include/lib/itext.class.php
+++ b/include/lib/itext.class.php
@@ -36,6 +36,7 @@ class IText extends HtmlInput
         $this->extra="";
         $this->style=' class="input_text" ';
         $this->autofocus=false;
+        $this->require=false;
     }
     /*!\brief show the html  input of the widget*/
     public function input($p_name=null,$p_value=null)
@@ -48,11 +49,12 @@ class IText extends HtmlInput
         $t= 'title="'.$this->title.'" ';
         $autofocus=($this->autofocus)?" autofocus ":"";
         $this->value=str_replace('"','',$this->value);
+        $require=($this->require)?"required":"";
         if ( ! isset ($this->css_size))
         {
             
             $r=  sprintf('<INPUT TYPE="TEXT" %s id="%s" name="%s" value="%s" 
placeholder="%s" title="%s"
-                     Size="%s"  %s %s  %s>
+                     Size="%s"  %s %s  %s %s>
                     ',$this->style,
                     $this->id,
                     $this->name,
@@ -62,11 +64,12 @@ class IText extends HtmlInput
                     $this->size,
                     $this->javascript,
                     $this->extra,
-                    $autofocus
+                    $autofocus,
+                    $require
                     );
         } else {
             $r=  sprintf('<INPUT TYPE="TEXT" %s id="%s" name="%s" value="%s" 
placeholder="%s" title="%s"
-                     style="width:%s;"  %s %s  %s>
+                     style="width:%s;"  %s %s  %s %s>
                     ',$this->style,
                     $this->id,
                     $this->name,
@@ -76,7 +79,8 @@ class IText extends HtmlInput
                     $this->css_size,
                     $this->javascript,
                     $this->extra,
-                    $autofocus
+                    $autofocus,
+                    $require
                     );
         }
 
@@ -115,6 +119,10 @@ class IText extends HtmlInput
         return $r;
 
     }
+    function set_require($p_boolean)
+    {
+        $this->require=$p_boolean;
+    }
     static public function test_me()
     {
     }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]