- warning de variables non existantes

Un peu d'ergonomie :
 - quelques mini-patchs de présentation
 - quand on génére un mot de passe, ça le colle dans les textbox adéquats
This commit is contained in:
Alan Garcia 2013-01-23 13:34:01 +00:00
parent c6d79a9ed0
commit 6acdb33c77
17 changed files with 60 additions and 38 deletions

View File

@ -66,7 +66,7 @@ if (isset($error) && $error) {
</td></tr>
<tr>
<th><label for="pass"><?php __("Initial password"); ?></label></th>
<td><input type="password" id="pass" name="pass" class="int" value="<?php ehe($pass); ?>" size="20" maxlength="64" /><?php display_div_generate_password(); ?></td>
<td><input type="password" id="pass" name="pass" 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>

View File

@ -83,7 +83,7 @@ if (!$r=$admin->get($uid)) {
<tr>
<th><label for="pass"><?php __("Password"); ?></label></th>
<td><input type="password" class="int" id="pass" name="pass" value="" size="20" maxlength="64" /><?php display_div_generate_password(); ?></td>
<td><input type="password" class="int" id="pass" name="pass" value="" 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>

View File

@ -100,7 +100,7 @@ for($i=0;$i<count($c);$i++) {
<tr><th><label for="newlogin"><?php __("Login"); ?></label></th><th><label for="newpass"><?php __("Password"); ?></label></th></tr>
<tr>
<td><input type="text" class="int" value="<?php ehe($newlogin); ?>" id="newlogin" name="newlogin" maxlength="64" size="32" /><br/><br/></td>
<td><input type="password" class="int" value="<?php ehe($newpass); ?>" id="newpass" name="newpass" maxlength="64" size="32" /><?php display_div_generate_password(); ?></td>
<td><input type="password" class="int" value="<?php ehe($newpass); ?>" id="newpass" name="newpass" maxlength="64" size="32" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#newpass"); ?></td>
</tr>
<tr class="trbtn"><td colspan="2">
<input type="submit" value="<?php __("Add this account to the allowed list"); ?>" class="inb" />

View File

@ -100,7 +100,7 @@ for($i=0;$i<count($c);$i++) {
<tr><th><label for="newlogin"><?php __("Login"); ?></label></th><th><label for="newpass"><?php __("Password"); ?></label></th></tr>
<tr>
<td><input type="text" class="int" value="<?php ehe( isset($newlogin)?$newlogin:'') ; ?>" id="newlogin" name="newlogin" maxlength="64" size="32" /><br/><br/></td>
<td><input type="password" class="int" value="<?php ehe( (isset($newpass)?$newpass:'') ) ; ?>" id="newpass" name="newpass" maxlength="64" size="32" /><?php display_div_generate_password(); ?></td>
<td><input type="password" class="int" value="<?php ehe( (isset($newpass)?$newpass:'') ) ; ?>" id="newpass" name="newpass" maxlength="64" size="32" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#newpass"); ?></td>
</tr>
<tr class="trbtn"><td colspan="2">
<input type="submit" value="<?php __("Add this account to the allowed list"); ?>" class="inb" />

View File

@ -63,9 +63,11 @@ if (isset($error) && $error) echo "<p class=\"error\">$error</p>";
$q = $quota->getquota("dom");
if ($q["u"]>0) {
?>
<p>
<fieldset>
<legend>
<?php __("Do you want to point this domain to another domain already installed in your account?"); ?>
<br />
</legend>
<input type="radio" id="newisslave0" name="newisslave" value="0"<?php cbox($newisslave==0); ?>/><label for="newisslave0"><?php __("No: This domain will have its own folder."); ?></label>
<br />
<input type="radio" id="newisslave1" name="newisslave" value="1"<?php cbox($newisslave==1); ?>/><label for="newisslave1"><?php __("Yes, redirect this new domain to this one:"); ?> </label> <select name="slavedom" id="slavedom" class="inl">
@ -78,8 +80,7 @@ $dl=$dom->get_domain_list($cuid);
}
eoption($ddl,"slavedom");
?></select>
<br />
</p>
</fieldset>
<?php } ?>
<p>

View File

@ -70,6 +70,23 @@ function dnsoff() {
if (document.forms["fdns"].emailoff.disabled!=null)
document.forms["fdns"].emailoff.disabled=false;
}
function destruction_alert() {
// On ne se pose pas de question si le DNS est deja sur NON
if (<?php echo (int)$r["dns"]; ?>!=1) {
return true;
}
if (document.forms["fdns"].email[1].checked) {
//return confirm('<?php __("Are you sur you want to do this and DELETE ALL the mailboxes, messages and aliases on this domain ?"); ?>');
if ( confirm('<?php __("Are you sur you want to do this and DELETE ALL the mailboxes, messages and aliases on this domain ?"); ?>') ) {
return confirm('<?php __("Realy ?"); ?>');
} else {
return false;
}
} else {
return true;
}
}
</script>
<h3><?php printf(_("Editing subdomains of %s"),$domain); ?></h3>
<hr id="topbar"/>
@ -184,7 +201,7 @@ if (!$r['noerase']) {
<hr />
<h3><?php __("DNS & Email parameters"); ?></h3>
<form action="dom_editdns.php?domain=<?php echo urlencode($r["name"]) ?>" method="post" id="fdns" name="fdns">
<form action="dom_editdns.php?domain=<?php echo urlencode($r["name"]) ?>" method="post" id="fdns" name="fdns" onSubmit="return destruction_alert();">
<table class="tlist">
<tr>

View File

@ -49,7 +49,7 @@ if (!$isinvited && $dt[strtolower($type)]["enable"] != "ALL" ) {
}
if (!$noread) {
if (!isset($noread) || !$noread) {
if (!$r=$dom->get_sub_domain_all($domain,$sub,$type,$value)) {
$error=$err->errstr();
}

View File

@ -82,7 +82,7 @@ if (isset($error) && $error) {
</tr>
<tr>
<th><label for="pass"><?php __("Password"); ?></label></th>
<td><input type="password" class="int" name="pass" id="pass" size="20" maxlength="64" value=""/><?php display_div_generate_password(); ?></td>
<td><input type="password" class="int" name="pass" id="pass" size="20" maxlength="64" value=""/><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#pass","#passconf"); ?></td>
</tr>
<tr>
<th><label for="passconf"><?php __("Confirm password"); ?></label></th>

View File

@ -104,7 +104,7 @@ for($i=0;$i<count($r);$i++){
</tr>
<tr>
<td><label for="password"><?php __("Password"); ?></label></td>
<td><input type="password" class="int" name="password" id="password" value="" size="20" maxlength="64" /><?php display_div_generate_password(); ?></td>
<td><input type="password" class="int" name="password" id="password" value="" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#password","#passwordconf"); ?></td>
</tr>
<tr>
<td><label for="passwordconf"><?php __("Confirm password"); ?></label></td>

View File

@ -51,7 +51,7 @@ if (isset($error) && $error) {
<input type="hidden" name="user" value="<?php echo $user ?>">
<?php __("Folder"); ?></td><td><code><?php echo $dir; ?></code></td></tr>
<tr><td><?php __("User"); ?></td><td><code><?php echo $user; ?></code></td></tr>
<tr><td><label for="newpass"><?php __("New password"); ?></label></td><td><input type="password" class="int" name="newpass" id="newpass" value="" size="20" maxlength="64" /><?php display_div_generate_password(); ?></td></tr>
<tr><td><label for="newpass"><?php __("New password"); ?></label></td><td><input type="password" class="int" name="newpass" id="newpass" value="" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#newpass","#newpassconf"); ?></td></tr>
<tr><td><label for="newpassconf"><?php __("Confirm password"); ?></label></td><td><input type="password" class="int" name="newpassconf" id="newpassconf" value="" size="20" maxlength="64" /></td></tr>
<tr><td colspan="2"><input type="submit" class="inb" value="<?php __("Change the password"); ?>" /></td></tr>
</table>

View File

@ -226,10 +226,11 @@ function generate_password(len){
return password;
}
function generate_password_html(id, size) {
$("#"+id).html("<input id='inp"+id+"' type='textbox' size=8 readonly='readonly' value='"+generate_password(size)+"' />&nbsp;<a href='javascript:generate_password_html("+id+","+size+");'><img src='/images/refresh.png' alt='Refresh'/></a>");
function generate_password_html(id, size, field1, field2) {
$("#"+id).html("<input id='inp"+id+"' type='textbox' size=8 readonly='readonly' value='"+generate_password(size)+"' />&nbsp;<a href='javascript:generate_password_html("+id+","+size+",\""+field1+"\",\""+field2+"\");'><img src='/images/refresh.png' alt='Refresh'/></a>");
$("#inp"+id).focus();
$("#inp"+id).select();
if (field1 != "") { $(field1).val( $("#inp"+id).val() ); }
if (field2 != "") { $(field2).val( $("#inp"+id).val() ); }
}

View File

@ -92,7 +92,7 @@ if (isset($error)) {
</p>
<div id="poptbl">
<table class="tedit" >
<tr><td><label for="pass"><?php __("Enter a POP/IMAP password"); ?></label></td><td><input type="password" class="int" name="pass" id="pass" value="" size="20" maxlength="32" /><?php display_div_generate_password(); ?></td></tr>
<tr><td><label for="pass"><?php __("Enter a POP/IMAP password"); ?></label></td><td><input type="password" class="int" name="pass" id="pass" value="" size="20" maxlength="32" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#pass","#passconf"); ?></td></tr>
<tr><td><label for="passconf"><?php __("Confirm password"); ?></label></td><td><input type="password" class="int" name="passconf" id="passconf" value="" size="20" maxlength="32" /></td></tr>
<tr><td><label for="quotamb"><?php __("Maximum allowed size of this Mailbox"); ?></label></td><td><input type="text" class="int intleft" style="text-align: right" name="quotamb" id="quotamb" value="<?php ehe($quotamb); ?>" size="7" maxlength="6" /><span class="int intright"><?php __("MB"); ?></span></td></tr>
</table>

View File

@ -68,8 +68,8 @@ if (!$mem->user["canpass"]) {
<form method="post" action="mem_passwd.php" name="main" id="main">
<table border="1" cellspacing="0" cellpadding="4" class="tedit" >
<tr><th><?php __("Old password"); ?></th><td><input type="password" class="int" name="oldpass" value="<?php isset($oldpass) ? : $oldpass=""; echo $oldpass; ?>" size="20" maxlength="128" /></td></tr>
<tr><th><?php __("New password"); ?> (1)</th><td><input type="password" class="int" name="newpass" value="<?php isset($newpass) ? : $newpass=""; echo $newpass; ?>" size="20" maxlength="60" /><?php display_div_generate_password(); ?></td></tr>
<tr><th><?php __("New password"); ?> (2)</th><td><input type="password" class="int" name="newpass2" value="<?php isset($newpass2) ? : $newpass2=""; echo $newpass2;?>" size="20" maxlength="61" /></td></tr>
<tr><th><?php __("New password"); ?> (1)</th><td><input type="password" class="int" id="newpass" name="newpass" value="<?php isset($newpass) ? : $newpass=""; echo $newpass; ?>" size="20" maxlength="60" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#newpass","#newpass2"); ?></td></tr>
<tr><th><?php __("New password"); ?> (2)</th><td><input type="password" class="int" id="newpass2" name="newpass2" value="<?php isset($newpass2) ? : $newpass2=""; echo $newpass2;?>" size="20" maxlength="61" /></td></tr>
<tr class="trbtn"><td colspan="3"><input type="submit" class="inb" name="submit" value="<?php __("Change my password"); ?>" /></td></tr>
</table>
</form>

View File

@ -61,7 +61,7 @@ getFields($fields);
</tr>
<tr>
<th><label for="password"><?php __("Password"); ?></label></th>
<td><input type="password" class="int" name="password" id="password" size="26"/><?php display_div_generate_password(); ?></td>
<td><input type="password" class="int" name="password" id="password" size="26"/><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#password","#passconf"); ?></td>
</tr>
<tr>
<th><label for="password"><?php __("Confirm password"); ?></label></th>

View File

@ -53,7 +53,7 @@ $r=$mysql->get_user_dblist($id);
<table cellspacing="0" cellpadding="4">
<tr>
<td><label for="password"><?php __("Password"); ?></label></td>
<td><input type="password" class="int" name="password" id="password" value="" size="20" maxlength="64" /><?php display_div_generate_password(); ?></td>
<td><input type="password" class="int" name="password" id="password" value="" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#password","#passwordconf"); ?></td>
</tr>
<tr>
<td><label for="passwordconf"><?php __("Confirm password"); ?></label></td>

View File

@ -600,9 +600,11 @@ function create_pass($length = 8){
}
function display_div_generate_password($pass_size=8) {
define("DEFAULT_PASS_SIZE", 8);
function display_div_generate_password($pass_size=DEFAULT_PASS_SIZE, $fields_to_fill1="", $fields_to_fill2="") {
$id=rand(1,1000);
echo "<div id='$id' style='display:none;'><a href=\"javascript:generate_password_html('$id',$pass_size);\">";
echo "<div id='$id' style='display:none;'><a href=\"javascript:generate_password_html('$id',$pass_size,'$fields_to_fill1','$fields_to_fill2');\">";
__("Clic here to generate a password");
echo "</a></div>";
echo "<script type='text/javascript'>$('#'+$id).show();</script>";

View File

@ -106,21 +106,22 @@ class m_hta {
*/
function ListDir(){
global$err,$mem,$L_ALTERNC_LOC;
$err->log("hta","listdir");
$sortie=array();
$absolute="$L_ALTERNC_LOC/html/".substr($mem->user["login"],0,1)."/".$mem->user["login"];
exec("find $absolute -name .htpasswd|sort",$sortie);
if(!count($sortie)){
$err->raise("hta",_("No protected folder"));
return false;
}
$pattern="/^".preg_quote($L_ALTERNC_LOC,"/")."\/html\/.\/[^\/]*\/(.*)\/\.htpasswd/";
for($i=0;$i<count($sortie);$i++){
preg_match($pattern,$sortie[$i],$matches);
$r[$i]=$matches[1]."/";
}
return $r;
global$err,$mem,$L_ALTERNC_LOC;
$err->log("hta","listdir");
$sortie=array();
$absolute="$L_ALTERNC_LOC/html/".substr($mem->user["login"],0,1)."/".$mem->user["login"];
exec("find $absolute -name .htpasswd|sort",$sortie);
if(!count($sortie)){
$err->raise("hta",_("No protected folder"));
return false;
}
$pattern="/^".preg_quote($L_ALTERNC_LOC,"/")."\/html\/.\/[^\/]*\/(.*)\/\.htpasswd/";
for($i=0;$i<count($sortie);$i++){
preg_match($pattern,$sortie[$i],$matches);
$tmpm=isset($matches[1])?$matches[1]:'';
$r[$i]=$tmpm."/";
}
return $r;
}
/*---------------------------------------------------------------------------*/