adding mandatory fields to the account creation form, Fixes #132

This commit is contained in:
Benjamin Sonntag 2017-06-18 18:45:57 +02:00
parent a320c061fe
commit cd310b355a
6 changed files with 51 additions and 58 deletions

View File

@ -1,15 +1,10 @@
<?php
/*
$Id: adm_add.php,v 1.9 2006/01/24 05:03:30 joe Exp $
adm_add.php
----------------------------------------------------------------------
AlternC - Web Hosting System
Copyright (C) 2006 Le r<EFBFBD>seau Koumbit Inc.
http://koumbit.org/
Copyright (C) 2002 by the AlternC Development Team.
http://alternc.org/
----------------------------------------------------------------------
Based on:
Valentin Lacambre's web hosting softwares: http://altern.org/
Copyright (C) 2002-2017 by the AlternC Development Team.
https://alternc.com/
----------------------------------------------------------------------
LICENSE
@ -26,7 +21,7 @@
To read the license please visit http://www.gnu.org/copyleft/gpl.html
----------------------------------------------------------------------
Original Author of file: Benjamin Sonntag
Purpose of file: Member managment
Purpose of file: new Member managment
----------------------------------------------------------------------
*/
require_once("../class/config.php");
@ -61,20 +56,17 @@ if (isset($error) && $error) {
?>
<form method="post" action="adm_doadd.php" id="main" name="main" autocomplete="off">
<?php csrf_get(); ?>
<!-- honeypot fields -->
<input type="text" style="display: none" id="fakeUsername" name="fakeUsername" value="" />
<input type="password" style="display: none" id="fakePassword" name="fakePassword" value="" />
<table class="tedit">
<tr><th><label for="login"><?php __("Username"); ?></label></th><td>
<input type="text" class="int" name="login" id="login" value="<?php ehe($login); ?>" size="20" maxlength="16" />
<tr><th><label for="login"><?php __("Username"); ?></label><span class="mandatory">*</span></th><td>
<input type="text" class="int" name="login" id="login" autocomplete="off" value="<?php ehe($login); ?>" size="20" maxlength="16" />
</td></tr>
<tr>
<th><label for="pass"><?php __("Initial password"); ?></label></th>
<th><label for="pass"><?php __("Initial password"); ?></label><span class="mandatory">*</span></th>
<td><input type="password" id="pass" name="pass" autocomplete="off" class="int" value="<?php ehe($pass); ?>" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#pass","#passconf"); ?></td>
</tr>
<tr>
<th><label for="passconf"><?php __("Confirm password"); ?></label></th>
<th><label for="passconf"><?php __("Confirm password"); ?></label><span class="mandatory">*</span></th>
<td><input type="password" id="passconf" name="passconf" autocomplete="off" class="int" value="<?php ehe($passconf); ?>" size="20" maxlength="64" /></td>
</tr>
<tr>
@ -93,7 +85,7 @@ if (isset($error) && $error) {
<td><input class="int" type="text" id="nom" name="nom" value="<?php ehe($nom); ?>" size="16" maxlength="128" />&nbsp;/&nbsp;<input type="text" name="prenom" id="prenom" value="<?php ehe($prenom); ?>" class="int" size="16" maxlength="128" /></td>
</tr>
<tr>
<th><label for="nmail"><?php __("Email address"); ?></label></th>
<th><label for="nmail"><?php __("Email address"); ?></label><span class="mandatory">*</span></th>
<td><input type="text" name="nmail" id="nmail" class="int" value="<?php ehe($nmail); ?>" size="30" maxlength="128" /></td>
</tr>
<tr>
@ -107,7 +99,7 @@ if (isset($error) && $error) {
<tr>
<th>
<?php
__("Wich database server for this user ?");
__("Associate this new user to this database server:");
echo "<br/>";
echo "<i>"._("Warning: you can't change it after the creation of the user.")."</i>";
?>

View File

@ -1,9 +1,10 @@
<?php
/*
adm_doadd.php
----------------------------------------------------------------------
AlternC - Web Hosting System
Copyright (C) 2000-2012 by the AlternC Development Team.
https://alternc.org/
Copyright (C) 2002-2017 by the AlternC Development Team.
https://alternc.com/
----------------------------------------------------------------------
LICENSE
@ -19,6 +20,9 @@
To read the license please visit http://www.gnu.org/copyleft/gpl.html
----------------------------------------------------------------------
Original Author of file: Benjamin Sonntag
Purpose of file: validate and create a new member
----------------------------------------------------------------------
*/
require_once("../class/config.php");

View File

@ -1,11 +1,10 @@
<?php
/*
mem_admin.php
----------------------------------------------------------------------
AlternC - Web Hosting System
Copyright (C) 2006 Le r<EFBFBD>seau Koumbit Inc.
http://koumbit.org/
Copyright (C) 2002 by the AlternC Development Team.
http://alternc.org/
Copyright (C) 2002-2017 by the AlternC Development Team.
https://alternc.com/
----------------------------------------------------------------------
LICENSE

View File

@ -1,13 +1,10 @@
<?php
/*
$Id: mem_admin.php,v 1.2 2003/06/10 08:18:26 root Exp $
mem_admin.php
----------------------------------------------------------------------
AlternC - Web Hosting System
Copyright (C) 2002 by the AlternC Development Team.
http://alternc.org/
----------------------------------------------------------------------
Based on:
Valentin Lacambre's web hosting softwares: http://altern.org/
Copyright (C) 2002-2017 by the AlternC Development Team.
https://alternc.com/
----------------------------------------------------------------------
LICENSE

View File

@ -379,6 +379,14 @@ img {
color: red;
}
.mandatory {
color: red;
font-weight: bold;
vertical-align: super;
font-size: small;
line-height: normal;
}
.code {
font-size: 16px;
font-family: Courier New, Fixed;

View File

@ -587,12 +587,12 @@ class m_admin {
return false;
}
if (($login == "") || ($pass == "")) {
$err->raise("admin", _("All fields are mandatory"));
$err->raise("admin", _("Please fill all mandatory fields"));
return false;
}
if (!$force) {
if ($mail == "") {
$err->raise("admin", _("All fields are mandatory"));
$err->raise("admin", _("Please fill all mandatory fields"));
return false;
}
//@todo remove cf functions.php
@ -641,17 +641,10 @@ class m_admin {
// Triggering hooks
$mem->su($uid);
// TODO: old hook method FIXME: when unused remove this
/*
foreach($classes as $c) {
if (method_exists($GLOBALS[$c],"alternc_add_member")) {
$GLOBALS[$c]->alternc_add_member();
}
}
*/
$hooks->invoke("alternc_add_member");
// New hook way
$hooks->invoke("hook_admin_add_member", array(), array('quota')); // First !!! The quota !!! Etherway, we can't be sure to be able to create all
$hooks->invoke("hook_admin_add_member", array(), array('quota')); // First !!! The quota !!! Eitherway, we can't be sure to be able to create all
$hooks->invoke("hook_admin_add_member");
$mem->unsu();