[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()
{
}
- [Noalyss-commit] [noalyss] 02/23: translate en, (continued)
- [Noalyss-commit] [noalyss] 02/23: translate en, Dany De Bontridder, 2020/11/24
- [Noalyss-commit] [noalyss] 03/23: rename upgrade18, Dany De Bontridder, 2020/11/24
- [Noalyss-commit] [noalyss] 01/23: Security administration : add a confirmation with generate random string and record it in audit, Dany De Bontridder, 2020/11/24
- [Noalyss-commit] [noalyss] 04/23: Security, Dany De Bontridder, 2020/11/24
- [Noalyss-commit] [noalyss] 05/23: Version 8.0, Dany De Bontridder, 2020/11/24
- [Noalyss-commit] [noalyss] 08/23: Security remove direct access to $_REQUEST, Dany De Bontridder, 2020/11/24
- [Noalyss-commit] [noalyss] 06/23: Follow-up : list , the name is a tip, Dany De Bontridder, 2020/11/24
- [Noalyss-commit] [noalyss] 15/23: fixup! Translate , make failed chrome because of HTML in javascript message, Dany De Bontridder, 2020/11/24
- [Noalyss-commit] [noalyss] 17/23: Typo, Dany De Bontridder, 2020/11/24
- [Noalyss-commit] [noalyss] 20/23: Fix: template doesn't delete LOB files, Dany De Bontridder, 2020/11/24
- [Noalyss-commit] [noalyss] 09/23: IText require , used for admin and password,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 07/23: ANCGL : export CSV add the date of payment, Dany De Bontridder, 2020/11/24
- [Noalyss-commit] [noalyss] 16/23: IText : protect against Quote and Double Quote, Dany De Bontridder, 2020/11/24
- [Noalyss-commit] [noalyss] 18/23: Merge branch 'dev8000', Dany De Bontridder, 2020/11/24
- [Noalyss-commit] [noalyss] 13/23: Translate , make failed chrome because of HTML in javascript message, Dany De Bontridder, 2020/11/24
- [Noalyss-commit] [noalyss] 21/23: CfgPlugin : improve trace, Dany De Bontridder, 2020/11/24
- [Noalyss-commit] [noalyss] 19/23: Bug Securimage : fix if session is expired then $code is undefined, Dany De Bontridder, 2020/11/24
- [Noalyss-commit] [noalyss] 22/23: Merge branch 'dev8001', Dany De Bontridder, 2020/11/24
- [Noalyss-commit] [noalyss] 23/23: IText , remove double-quote, Dany De Bontridder, 2020/11/24
- [Noalyss-commit] [noalyss] 10/23: typo, Dany De Bontridder, 2020/11/24
- [Noalyss-commit] [noalyss] 11/23: Small typo, Dany De Bontridder, 2020/11/24