Changeset 1803


Ignore:
Timestamp:
04/29/07 22:45:51 (6 years ago)
Author:
franck
Message:

Le bureau ne dépend plus de register_globals (tester en register_globals off et error_reporting E_ALL)
Ajout de jQuery pour le menu et pour les futurs développements JS
Ajout d'une demande de suppression pour les listes mailmans
... je sais plus :)

Location:
alternc/branches/franck-desktop/bureau/admin
Files:
33 added
114 edited

Legend:

Unmodified
Added
Removed
  • alternc/branches/franck-desktop/bureau/admin/adm_add.php

    r1797 r1803  
    3939 
    4040$fields = array ( 
     41        "login"     => array ("request", "string", ""), 
     42        "pass"      => array ("request", "string", ""), 
     43        "passconf"  => array ("request", "string", ""), 
    4144        "canpass"   => array ("request", "integer", 1), 
     45        "prenom"    => array ("request", "string", ""), 
     46        "nom"       => array ("request", "string", ""), 
     47        "nmail"     => array ("request", "string", ""), 
    4248); 
    4349getFields($fields); 
     
    5258<form method="post" action="adm_doadd.php"> 
    5359<table border="1" cellspacing="0" cellpadding="4"> 
    54 <tr><th><label for="login"><?php __("Username"); ?></label></th><td> 
    55         <input type="text" class="int" name="login" id="login" value="<?php echo $login; ?>" size="20" maxlength="64" /> 
    56 </td></tr> 
    57 <tr> 
    58         <th><label for="pass"><?php __("Initial password"); ?></label></th> 
    59         <td><input type="password" id="pass" name="pass" class="int" value="<?php echo $pass; ?>" size="20" maxlength="64" /></td> 
     60        <tr> 
     61                <th><label for="login"><?php __("Username"); ?></label></th> 
     62                <td><input type="text" class="int" name="login" id="login" value="<?php echo $login; ?>" size="20" maxlength="64" /></td> 
     63        </tr> 
     64        <tr> 
     65                <th><label for="pass"><?php __("Initial password"); ?></label></th> 
     66                <td><input type="password" id="pass" name="pass" class="int" value="<?php echo $pass; ?>" size="20" maxlength="64" /></td> 
     67        </tr> 
     68        <tr> 
     69                <th><label for="passconf"><?php __("Confirm password"); ?></label></th> 
     70                <td><input type="password" id="passconf" name="passconf" class="int" value="<?php echo $passconf; ?>" size="20" maxlength="64" /></td> 
     71        </tr> 
     72        <tr> 
     73                <th><label for="canpass"><?php __("Can he change its password"); ?></label></th> 
     74                <td> 
     75                        <select class="inl" name="canpass" id="canpass"> 
     76<?php 
     77 
     78for($i = 0; $i < count($bro->l_icons); $i++) 
     79{ 
     80        echo "<option value=\"" . $i . "\""; 
     81        if ($canpass == $i) 
     82                echo " selected=\"selected\""; 
     83        echo ">" . _($bro->l_icons[$i]) . "</option>"; 
     84} 
     85 
     86?> 
     87                        </select> 
     88                </td> 
     89        </tr> 
     90        <tr> 
     91                <th><label for="nom"><?php echo _("Surname")."</label> / <label for=\"prenom\">"._("First Name"); ?></label></th> 
     92                <td><input class="int" type="text" id="nom" name="nom" value="<?php echo $nom; ?>" size="20" maxlength="128" />&nbsp;/&nbsp;<input type="text" name="prenom" id="prenom" value="<?php echo $prenom; ?>" class="int" size="20" maxlength="128" /></td> 
     93        </tr> 
     94        <tr> 
     95                <th><label for="nmail"><?php __("Email address"); ?></label></th> 
     96                <td><input type="text" name="nmail" id="nmail" class="int" value="<?php echo $nmail; ?>" size="30" maxlength="128" /></td> 
     97        </tr> 
     98        <tr> 
     99                <th><label for="type"><?php __("Account type"); ?></label></th> 
     100                <td> 
     101                        <select name="type" id="type" class="inl"> 
     102<?php 
     103 
     104$db->query("SELECT DISTINCT(type) FROM defquotas ORDER BY type"); 
     105while($db->next_record()) 
     106{ 
     107        $type = $db->f("type"); 
     108        echo "<option value=\"" . $type . "\""; 
     109        if ($type == "default") 
     110                echo " selected=\"selected\""; 
     111        echo ">" . $type . "</option>"; 
     112} 
     113 
     114?> 
     115                        </select> 
     116                </td> 
    60117</tr> 
    61 <tr> 
    62         <th><label for="passconf"><?php __("Confirm password"); ?></label></th> 
    63         <td><input type="password" id="passconf" name="passconf" class="int" value="<?php echo $passconf; ?>" size="20" maxlength="64" /></td> 
    64 </tr> 
    65 <tr> 
    66         <th><label for="canpass"><?php __("Can he change its password"); ?></label></th> 
    67         <td><select class="inl" name="canpass" id="canpass"> 
    68         <?php 
    69         for($i=0;$i<count($bro->l_icons);$i++) { 
    70           echo "<option"; 
    71           if ($canpass==$i) echo " selected=\"selected\""; 
    72           echo " value=\"$i\">"._($bro->l_icons[$i])."</option>"; 
    73         } 
    74 ?></select> 
    75         </td> 
    76 </tr> 
    77 <tr> 
    78         <th><label for="nom"><?php echo _("Surname")."</label> / <label for=\"prenom\">"._("First Name"); ?></label></th> 
    79         <td><input class="int" type="text" id="nom" name="nom" value="<?php echo $nom; ?>" size="20" maxlength="128" />&nbsp;/&nbsp;<input type="text" name="prenom" id="prenom" value="<?php echo $prenom; ?>" class="int" size="20" maxlength="128" /></td> 
    80 </tr> 
    81 <tr> 
    82         <th><label for="nmail"><?php __("Email address"); ?></label></th> 
    83         <td><input type="text" name="nmail" id="nmail" class="int" value="<?php echo $nmail; ?>" size="30" maxlength="128" /></td> 
    84 </tr> 
    85 <tr> 
    86         <th><label for="type"><?php __("Account type"); ?></label></th> 
    87         <td><select name="type" id="type" class="inl"> 
    88         <?php 
    89         $db->query("SELECT distinct(type) FROM defquotas ORDER by type"); 
    90         while($db->next_record()) { 
    91           $type = $db->f("type"); 
    92           echo "<option value=\"$type\""; 
    93           if($type == 'default') 
    94             echo " selected"; 
    95           echo ">$type</option>"; 
    96         } 
    97 ?></select> 
    98 </tr> 
    99 <? if (variable_get('hosting_tld')) { ?> 
    100 <tr> 
    101         <th colspan="2"><label><input type="checkbox" name="create_dom" value="1" /> 
    102         <?php print _("Create the domain username.").variable_get('hosting_tld'); ?></label></th> 
     118<?php if (variable_get("hosting_tld")) { ?> 
     119        <tr> 
     120                <th colspan="2"><label><input type="checkbox" name="create_dom" value="1" /><?php print _("Create the domain username.") . variable_get("hosting_tld"); ?></label></th> 
     121                </tr> 
     122        <tr> 
     123<?php } ?> 
     124                <td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Create a new member"); ?>" /></td> 
    103125        </tr> 
    104 <tr> 
    105 <? } ?> 
    106         <td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Create a new member"); ?>" /></td> 
    107 </tr> 
    108126</table> 
    109127</form> 
  • alternc/branches/franck-desktop/bureau/admin/adm_defquotas.php

    r1802 r1803  
    8888<h4><?php echo _("Accounts of type"). " \"" . $qname . "\"" ?></h4> 
    8989<table border="0" cellpadding="4" cellspacing="0"> 
    90 <tr><th><?php __("Quotas") ?></th><th><?php __("Default Value"); ?></th></tr> 
     90        <tr> 
     91                <th><?php __("Quotas") ?></th> 
     92                <th><?php __("Default Value"); ?></th> 
     93        </tr> 
    9194<?php 
    9295 
     
    97100 
    98101?> 
    99 <tr class="lst<?php echo $col; ?>"> 
    100 <td><label for="<?php echo $key; ?>"><?php echo $aqname; ?></label></td> 
    101 <td><input type="text" class="int" size="16" maxlength="16" name="<?php echo $key; ?>" id="<?php echo $key; ?>" value="<?php echo $q[$aqtype]; ?>" /></td></tr> 
     102        <tr class="lst<?php echo $col; ?>"> 
     103                <td><label for="<?php echo $key; ?>"><?php echo $aqname; ?></label></td> 
     104                <td><input type="text" class="int" size="16" maxlength="16" name="<?php echo $key; ?>" id="<?php echo $key; ?>" value="<?php echo isset($q[$aqtype]) ? $q[$aqtype] : ""; ?>" /></td> 
     105        </tr> 
    102106<?php 
    103107 
  • alternc/branches/franck-desktop/bureau/admin/adm_doadd.php

    r802 r1803  
    3232require_once("../class/config.php"); 
    3333 
    34 if (!$admin->enabled) { 
     34$fields = array ( 
     35        "login"      => array ("request", "string", ""), 
     36        "pass"       => array ("request", "string", ""), 
     37        "passconf"   => array ("request", "string", ""), 
     38        "canpass"    => array ("request", "integer", 1), 
     39        "prenom"     => array ("request", "string", ""), 
     40        "nom"        => array ("request", "string", ""), 
     41        "nmail"      => array ("request", "string", ""), 
     42        "create_dom" => array ("request", "string", ""), 
     43        "type"       => array ("request", "string", ""), 
     44); 
     45getFields($fields); 
     46 
     47if (!$admin->enabled) 
     48{ 
    3549        __("This page is restricted to authorized staff"); 
    3650        exit; 
    3751} 
    3852 
    39 if ($pass != $passconf) { 
     53if ($pass != $passconf) 
     54{ 
    4055        $error = _("Passwords do not match"); 
    41         include("adm_add.php"); 
     56        include ("adm_add.php"); 
    4257        exit(); 
    4358} 
    44 if (!($u=$admin->add_mem($login, $pass, $nom, $prenom, $nmail, $canpass, $type))) { 
    45         $error=$err->errstr(); 
     59 
     60if (!($u = $admin->add_mem($login, $pass, $nom, $prenom, $nmail, $canpass, $type))) 
     61{ 
     62        $error = $err->errstr(); 
    4663        include ("adm_add.php"); 
    4764        exit; 
    48 } else { 
    49  
     65} 
     66else 
     67{ 
    5068  // Add here all what you want when an account is created ! 
    5169  $mem->su($u); 
    52    
     70 
    5371  /* 
    5472   * 0 = pas d'hébergement dns, en effet, pas besoin vu que les 
     
    6078   * 1 = force = ne tient pas compte du whois ou des droits de tld 
    6179   */ 
    62   if ($create_dom) { 
    63     if (variable_get("hosting_tld")) { 
    64       # make sure we don't have multiple dots there 
    65       $dom->lock(); 
    66       $dom->add_domain($login.".".preg_replace("/^\.\.*/", "", variable_get("hosting_tld")),0,1,1); 
    67       $dom->unlock(); 
    68     } else { 
    69       $err->log("no 'hosting_tld' variable defined in `variables` table, not creating domain"); 
    70     } 
    71   } 
    72   $ftp->add_ftp($login,"",$pass,"/"); 
    73   $mem->unsu(); 
    74   
    75  $error=_("The new member has been successfully created"); 
     80        if ($create_dom) 
     81        { 
     82                if (variable_get("hosting_tld")) 
     83                { 
     84                        # make sure we don't have multiple dots there 
     85                        $dom->lock(); 
     86                        $dom->add_domain($login . "." . preg_replace("/^\.\.*/", "", variable_get("hosting_tld")), 0, 1, 1); 
     87                        $dom->unlock(); 
     88                } 
     89                else 
     90                { 
     91                        $err->log("no 'hosting_tld' variable defined in `variables` table, not creating domain"); 
     92                } 
     93        } 
    7694 
    77  include("adm_list.php"); 
    78  exit; 
     95        $ftp->add_ftp($login, "", $pass, "/"); 
     96        $mem->unsu(); 
     97 
     98        $error = _("The new member has been successfully created"); 
     99 
     100        include("adm_list.php"); 
     101        exit; 
    79102} 
     103 
    80104?> 
  • alternc/branches/franck-desktop/bureau/admin/adm_dodefquotas.php

    r1797 r1803  
    3232require_once("../class/config.php"); 
    3333 
    34 if (!$admin->enabled) { 
     34if (!$admin->enabled) 
     35{ 
    3536        __("This page is restricted to authorized staff"); 
    3637        exit(); 
    3738} 
    3839 
    39 if($_POST["action"] == "add") { 
    40   $type = $_POST['type']; 
     40$fields = array ( 
     41        "action"      => array ("request", "string", ""), 
     42        "type"        => array ("request", "string", ""), 
     43        "del_confirm" => array ("request", "string", ""), 
     44); 
     45getFields($fields); 
    4146 
    42   if($quota->addtype($type)) { 
    43     $error=_("Account type"). " \"$type\" "._("added"); 
    44   } else { 
    45     $error=_("Account type"). " \"$type\" "._("could not be added"); 
     47if ($action == "add") 
     48{ 
     49        if($quota->addtype($type)) 
     50        { 
     51                $error = _("Account type"). " \"" . $type . "\" " . _("added"); 
     52        } 
     53        else 
     54        { 
     55                $error = _("Account type"). " \"" . $type . "\" " . _("could not be added"); 
     56        } 
     57        include("adm_defquotas.php"); 
     58        exit(); 
     59} 
     60else if ($action == "delete") 
     61{ 
     62        if (empty($type)) 
     63        { 
     64                include("adm_defquotas.php"); 
     65                exit(); 
     66        } 
     67 
     68        if ($del_confirm == "y") 
     69        { 
     70                if($type) 
     71                { 
     72                        if($quota->deltype($type)) 
     73                        { 
     74                                $error = _("Account type"). " \"" . $type . "\" " . _("deleted"); 
     75                        } 
     76                        else 
     77                        { 
     78                                $error = _("Account type") . " \"" . $type . "\" " . _("could not be deleted"); 
     79                        } 
     80                } 
     81                include("adm_defquotas.php"); 
     82                exit(); 
     83        } 
     84        else 
     85        { 
     86                include_once("head.php"); 
     87?> 
     88<h3><?php printf(_("Deleting quota %s"), $type); ?></h3> 
     89 
     90<form action="adm_dodefquotas.php" method="post"> 
     91<input type="hidden" name="action" value="delete" /> 
     92<input type="hidden" name="type" value="<?php echo $type ?>" /> 
     93<input type="hidden" name="del_confirm" value="y" /> 
     94<p class="error"><?php __("WARNING : Confirm the deletion of the quota"); ?></p> 
     95<p><?php echo $type; ?></p> 
     96<blockquote> 
     97        <input type="submit" class="inb" name="confirm" value="<?php __("Yes"); ?>" />&nbsp;&nbsp; 
     98        <input type="button" class="inb" name="cancel" value="<?php __("No"); ?>" onclick="document.location='adm_defquotas.php';" /> 
     99</blockquote> 
     100</form> 
     101<script type="text/javascript"> 
     102deploy("menu-adm"); 
     103</script> 
     104<?php 
     105 
     106                include_once("foot.php"); 
     107                exit(); 
    46108  } 
    47   include("adm_defquotas.php"); 
    48 } else if($_POST["action"] == "delete") { 
    49   if($_POST["del_confirm"] == "y"){ 
    50     if($_POST['type']) { 
    51       if($quota->deltype($_POST['type'])) { 
    52         $error=_("Account type"). " \"$type\" "._("deleted"); 
    53       } else { 
    54         $error=_("Account type"). " \"$type\" "._("could not be deleted"); 
    55       } 
    56     } 
    57     include("adm_defquotas.php"); 
    58   }else{ 
    59     include_once("head.php"); 
    60     ?> 
    61     <h3><?php printf(_("Deleting quota %s"),$_POST["type"]); ?> : </h3> 
     109} 
     110else if ($action == "modify") 
     111{ 
     112        reset($_POST); 
     113        $c = array(); 
     114        foreach ($_POST as $key => $val) 
     115        { 
     116                if($key == "action") 
     117                continue; 
    62118 
    63     <form action="adm_dodefquotas.php" method="post"> 
    64       <input type="hidden" name="action" value="delete" /> 
    65       <input type="hidden" name="type" value="<?php echo $_POST["type"] ?>" /> 
    66       <input type="hidden" name="del_confirm" value="y" /> 
    67       <p class="error"><?php __("WARNING : Confirm the deletion of the quota"); ?></p> 
    68       <p><?php echo $_POST["type"]; ?></p> 
    69       <blockquote> 
    70         <input type="submit" class="inb" name="confirm" value="<?php __("Yes"); ?>" />&nbsp;&nbsp; 
    71         <input type="button" class="inb" name="cancel" value="<?php __("No"); ?>" onclick="document.location='adm_defquotas.php';" /> 
    72       </blockquote> 
    73     </form> 
    74                 <script type="text/javascript"> 
    75                 deploy("menu-adm"); 
    76                 </script> 
    77                 <?php include_once("foot.php"); ?> 
    78     <?php 
    79   } 
    80 } else if($_POST["action"] == "modify") { 
    81   reset($_POST); 
    82   $c=array(); 
    83   foreach($_POST as $key => $val) { 
    84     if($key == "action") 
    85       continue; 
     119                list($type, $q) = explode(":", $key, 2); 
     120                $c[$type][$q] = abs(intval($val)); 
     121        } 
    86122 
    87     list($type, $q) = explode(":", $key, 2); 
    88     $c[$type][$q] = abs(intval($val)); 
    89   } 
     123        if ($quota->setdefaults($c)) 
     124        { 
     125                $error = _("Default quotas successfully changed"); 
     126        } 
     127        else 
     128        { 
     129                $error = _("Default quotas could not be set."); 
     130        } 
     131        include("adm_defquotas.php"); 
     132        exit(); 
     133} 
    90134 
    91   if($quota->setdefaults($c)) { 
    92     $error=_("Default quotas successfully changed"); 
    93   } else { 
    94     $error=_("Default quotas could not be set."); 
    95   } 
    96   include("adm_panel.php"); 
    97 } 
    98135?> 
  • alternc/branches/franck-desktop/bureau/admin/adm_doedit.php

    r982 r1803  
    3232require_once("../class/config.php"); 
    3333 
    34 if (!$admin->enabled) { 
    35   __("This page is restricted to authorized staff"); 
    36   exit(); 
    37 } 
    38 if (!$admin->checkcreator($uid)) { 
     34if (!$admin->enabled) 
     35{ 
    3936  __("This page is restricted to authorized staff"); 
    4037  exit(); 
    4138} 
    4239 
    43 if ($pass != $passconf) { 
    44   $error = _("Passwords do not match"); 
    45   include("adm_edit.php"); 
     40$fields = array ( 
     41        "uid"        => array ("request", "integer", 0), 
     42        "enabled"    => array ("request", "integer", 0), 
     43        "pass"       => array ("request", "string", ""), 
     44        "passconf"   => array ("request", "string", ""), 
     45        "canpass"    => array ("request", "integer", 1), 
     46        "prenom"     => array ("request", "string", ""), 
     47        "nom"        => array ("request", "string", ""), 
     48        "nmail"      => array ("request", "string", ""), 
     49        "duration"   => array ("request", "integer", 0), 
     50); 
     51getFields($fields); 
     52 
     53if (!$admin->checkcreator($uid)) 
     54{ 
     55  __("This page is restricted to authorized staff"); 
    4656  exit(); 
    4757} 
    4858 
    49 if (!$admin->update_mem($uid, $nmail, $nom, $prenom, $pass, $enabled, $canpass, $type, $duration)){ 
    50   $error=$err->errstr(); 
    51   include("adm_edit.php"); 
    52 } else { 
    53   $error=_("The member has been successfully edited"); 
    54   include("adm_list.php"); 
     59if ($pass != $passconf) 
     60{ 
     61        $error = _("Passwords do not match"); 
     62        include ("adm_edit.php"); 
     63        exit(); 
    5564} 
     65 
     66if (!$admin->update_mem($uid, $nmail, $nom, $prenom, $pass, $enabled, $canpass, $type, $duration)) 
     67{ 
     68        $error = $err->errstr(); 
     69        include ("adm_edit.php"); 
     70} 
     71else 
     72{ 
     73        $error = _("The member has been successfully edited"); 
     74        include ("adm_list.php"); 
     75} 
     76 
    5677?> 
  • alternc/branches/franck-desktop/bureau/admin/adm_doms.php

    r1797 r1803  
    6161 
    6262<tr class="lst<?php echo $col; ?>"> 
    63 <td><a href="adm_domlock.php?domain=<?php echo urlencode($c[$i][domaine]); ?>"><?php 
    64    if ($c[$i][noerase]) __("Unlock"); else __("Lock");  ?></a></td> 
    65 <td><?php echo $c[$i][domaine]; ?></td> 
    66 <td><?php echo $c[$i][login]; ?></td> 
    67                                     <td><?php if ($c[$i][noerase]) { 
     63<td><a href="adm_domlock.php?domain=<?php echo urlencode($c[$i]["domaine"]); ?>"><?php 
     64   if ($c[$i]["noerase"]) __("Unlock"); else __("Lock");  ?></a></td> 
     65<td><?php echo $c[$i]["domaine"]; ?></td> 
     66<td><?php echo $c[$i]["login"]; ?></td> 
     67                                    <td><?php if ($c[$i]["noerase"]) { 
    6868                        echo "<img src=\"icon/encrypted.png\" width=\"16\" height=\"16\" alt=\""._("Locked Domain")."\" />"; 
    6969                                    } ?></td> 
  • alternc/branches/franck-desktop/bureau/admin/adm_dorenew.php

    r982 r1803  
    3131require_once("../class/config.php"); 
    3232 
    33 if (!$admin->enabled) { 
    34   __("This page is restricted to authorized staff"); 
    35   exit(); 
    36 } 
    37 if (!$admin->checkcreator($uid)) { 
    38   __("This page is restricted to authorized staff"); 
    39   exit(); 
     33$fields = array ( 
     34        "uid"      => array ("request", "integer", 0), 
     35        "periods"  => array ("request", "integer", 0), 
     36); 
     37getFields($fields); 
     38 
     39if (!$admin->enabled) 
     40{ 
     41        __("This page is restricted to authorized staff"); 
     42        exit(); 
    4043} 
    4144 
    42 if (!$admin->renew_mem($_REQUEST['uid'], $_REQUEST['periods'])){ 
    43   $error=$err->errstr(); 
    44   include("adm_edit.php"); 
    45 } else { 
    46   $error=_("The member has been successfully renewed"); 
    47   include("adm_list.php"); 
     45if (!$admin->checkcreator($uid)) 
     46{ 
     47        __("This page is restricted to authorized staff"); 
     48        exit(); 
    4849} 
     50 
     51if (!$admin->renew_mem($uid, $periods)) 
     52{ 
     53        $error = $err->errstr(); 
     54        include ("adm_edit.php"); 
     55} 
     56else 
     57{ 
     58        $error = _("The member has been successfully renewed"); 
     59        include ("adm_list.php"); 
     60} 
     61 
    4962?> 
  • alternc/branches/franck-desktop/bureau/admin/adm_edit.php

    r1797 r1803  
    3939 
    4040$fields = array ( 
    41         "uid"    => array ("request", "integer", 0), 
     41        "uid"        => array ("request", "integer", 0), 
     42        "enabled"    => array ("request", "integer", 0), 
     43        "pass"       => array ("request", "string", ""), 
     44        "passconf"   => array ("request", "string", ""), 
     45        "canpass"    => array ("request", "integer", 1), 
     46        "prenom"     => array ("request", "string", ""), 
     47        "nom"        => array ("request", "string", ""), 
     48        "nmail"      => array ("request", "string", ""), 
     49        "duration"   => array ("request", "integer", 0), 
     50        "periods"    => array ("request", "integer", 1), 
    4251); 
    4352getFields($fields); 
    4453 
    45 if (!$admin->checkcreator($uid)) { 
     54if (!$admin->checkcreator($uid)) 
     55{ 
    4656        __("This page is restricted to authorized staff"); 
    4757        exit(); 
    4858} 
    4959 
    50 if (!$r=$admin->get($uid)) { 
    51         $error=$err->errstr(); 
     60if (!$r = $admin->get($uid)) 
     61{ 
     62        $error = $err->errstr(); 
    5263} 
    5364 
     
    5566<h3><?php __("Member Edition"); ?></h3> 
    5667<?php 
    57         if ($error) { 
    58                 echo "<p class=\"error\">$error</p>"; 
    59         } 
     68 
     69if ($error) 
     70{ 
     71        echo "<p class=\"error\">" . $error . "</p>"; 
     72} 
     73 
    6074?> 
    6175<form method="post" action="adm_doedit.php"> 
     
    111125        <td><select name="type" id="type"> 
    112126        <?php 
    113         $db->query("SELECT distinct(type) FROM defquotas ORDER by type"); 
     127        $db->query("SELECT DISTINCT(type) FROM defquotas ORDER BY type"); 
    114128        while($db->next_record()) { 
    115129          $type = $db->f("type"); 
     
    131145</table> 
    132146</form> 
    133  
     147<br /> 
    134148<?php if($r['duration']) { ?> 
    135 <p> 
    136149<form method="post" action="adm_dorenew.php"> 
    137150<input type="hidden" name="uid" value="<?php echo $uid ?>" /> 
    138151<table border="1" cellspacing="0" cellpadding="4"> 
    139 <tr> 
    140         <th><label for="periods"><?php __("Renew for") ?></label></th> 
    141         <td><input name="periods" id="periods" type="text" size="2" value="1"/><?php echo ' ' . _('period(s)') ?></td> 
    142 </tr> 
    143 <tr> 
    144         <td colspan="2" align="center"><input type="submit" class="inb" name="submit" value="<?php __("Renew"); ?>" /> 
    145 </td> 
    146 </tr> 
     152        <tr> 
     153                <th><label for="periods"><?php __("Renew for") ?></label></th> 
     154                <td><input name="periods" id="periods" type="text" size="2" value="<?php echo $periods; ?>" /><?php echo ' ' . _('period(s)') ?></td> 
     155        </tr> 
     156        <tr> 
     157                <td colspan="2" align="center"><input type="submit" class="inb" name="submit" value="<?php __("Renew"); ?>" /></td> 
     158        </tr> 
    147159</table> 
    148160</form> 
    149 </p> 
    150161<?php } /* Renouvellement */ ?> 
    151162 
    152163<p> 
    153164<?php 
    154         if ($mem->user[uid]==2000) { // PATCHBEN only admin can change su/nosu :) 
     165        if ($mem->user["uid"]==2000) { // PATCHBEN only admin can change su/nosu :) 
    155166if ($r["su"]) { 
    156167?> 
  • alternc/branches/franck-desktop/bureau/admin/adm_list.php

    r1797 r1803  
    3434include_once("head.php"); 
    3535 
    36 if (!$admin->enabled) { 
     36if (!$admin->enabled) 
     37{ 
    3738        __("This page is restricted to authorized staff"); 
    3839        exit(); 
     
    4142$fields = array ( 
    4243        "show"    => array ("request", "string", ""), 
     44        "letter"  => array ("request", "string", ""), 
    4345); 
    4446getFields($fields); 
     
    5052} 
    5153 
    52 $r=$admin->get_list($show ? 1 : 0); 
     54$r = $admin->get_list($show ? 1 : 0, $letter); 
    5355 
    5456?> 
    5557<h3><?php __("Member list"); ?></h3> 
    5658<?php 
    57         if ($error) { 
    58           echo "<p class=\"error\">$error</p>"; 
    59         } 
     59 
     60if ($error) 
     61          echo "<p class=\"error\">" . $error . "</p>"; 
     62 
    6063?> 
    6164<p> 
     
    6669if ($cuid == 2000) 
    6770{ 
    68         if (!$show) { 
    69                 echo '<a href="adm_list.php?show=all">' . _('List all the accounts') . '</a>'; 
    70         } else { 
    71                 echo '<a href="adm_list.php">' . _('List only my accounts') . '</a>'; 
    72         } 
     71        if (!$show) 
     72                echo "<a href=\"adm_list.php?show=all\">" . _("List all the accounts") . "</a>"; 
     73        else 
     74                echo "<a href=\"adm_list.php\">" . _("List only my accounts") . "</a>"; 
    7375} 
    7476 
     
    7981</p> 
    8082<?php 
    81 if (!is_array($r)) { 
    82   echo "<p class=\"error\">"._("No account defined for now")."</p>"; 
    83 } else { 
    84 ?> 
    85  
     83 
     84if (!is_array($r)) 
     85{ 
     86  echo "<p class=\"error\">" . _("No account defined for now") . "</p>"; 
     87} 
     88else 
     89{ 
     90        $letters = $admin->get_letters(); 
     91 
     92        for ($i = 0; $i < count($letters); $i++) 
     93        { 
     94                $val = $letters[$i]; 
     95                echo "<a class=\"letter" . ($letter == $val ? " letterover" : "") . "\" href=\"adm_list.php?letter=" . $val . "\">" . strtoupper($val) . "</a>&nbsp;"; 
     96        } 
     97        echo "<a class=\"letter" . (empty($letter) ? " letterover" : "") . "\" href=\"adm_list.php\">" . sprintf(_("All")) . "</a>"; 
     98 
     99?> 
    86100<form method="post" action="adm_dodel.php"> 
    87101<?php 
     
    90104 
    91105if ($mem->user["admlist"]==0) { // Normal (large) mode 
     106 
    92107?> 
    93108<table cellspacing="0" cellpadding="4"> 
    94 <tr> 
    95 <th colspan="5">&nbsp;</th> 
    96 <th><?php __("Username"); ?></th> 
    97 <th><?php echo _("Surname")." "._("First Name")."<br />("._("Email address").")"; ?></th> 
    98 <th><?php __("Account type") ?></th> 
    99 <th><?php __("Last login"); ?></th> 
    100 <th><?php __("Last fail"); ?></th> 
    101 <th><?php __("Last ip"); ?></th> 
    102 <th><?php __('Expiry') ?></th> 
    103 </tr> 
     109        <tr> 
     110                <th colspan="4">&nbsp;</th> 
     111                <th><?php __("Username"); ?></th> 
     112                <th><?php echo _("Surname")." "._("First Name")."<br />("._("Email address").")"; ?></th> 
     113                <th><?php __("Account type") ?></th> 
     114                <th><?php __("Last login"); ?></th> 
     115                <th><?php __("Last fail"); ?></th> 
     116                <th><?php __("Last ip"); ?></th> 
     117                <th><?php __('Expiry') ?></th> 
     118        </tr> 
    104119<?php 
    105120reset($r); 
    106121 
     122/* 
     123                <td align="center"><a href="adm_deactivate.php?uid=<?php echo $val["uid"] ?>"><img src="images/enabled<?php echo $altImg; ?>.png" alt="<?php __("Deactivate"); ?>" /></a></td> 
     124*/ 
     125 
    107126$col=1; 
     127$i = 0; 
    108128while (list($key,$val)=each($r)) 
    109129        { 
    110130        $col=3-$col; 
     131        $altImg = ($i % 2 == 0 ? "" : "alt"); 
     132        $i++; 
    111133?> 
    112134        <tr class="lst<?php echo $col; ?>"> 
     
    116138 <td align="center"><input type="checkbox" class="inc" name="d[]" value="<?php echo $val["uid"]; ?>" /></td> 
    117139<?php } ?> 
    118                 <td align="center"><a href="adm_edit.php?uid=<?php echo $val["uid"] ?>"><?php __("Edit"); ?></a></td> 
    119                 <td align="center"><a href="adm_quotaedit.php?uid=<?php echo $val["uid"] ?>"><?php __("Quotas"); ?></a></td> 
    120                 <td align="center"><a href="adm_deactivate.php?uid=<?php echo $val["uid"] ?>"><?php __("Deactivate"); ?></a></td> 
     140                <td align="center"><a href="adm_edit.php?uid=<?php echo $val["uid"] ?>"><img src="images/edit<?php echo $altImg; ?>.png" alt="<?php echo _("Edit"); ?>" /></a></td> 
     141                <td align="center"><a href="adm_quotaedit.php?uid=<?php echo $val["uid"] ?>"><img src="images/quota<?php echo $altImg; ?>.png" alt="<?php echo _("Quotas"); ?>" /></a></td> 
    121142                <td align="center"><?php 
    122143                if (!$val["enabled"]) 
    123                         echo "<img src=\"icon/encrypted.png\" width=\"16\" height=\"16\" alt=\""._("Locked Account")."\" />"; 
    124                 else { 
     144                        echo "<img src=\"images/lock" . $altImg . ".png\" alt=\"" . _("Locked Account") . "\" />"; 
     145                else 
     146                { 
    125147                  if($admin->checkcreator($val['uid'])) { 
    126148                ?> 
    127                         <a href="adm_login.php?id=<?php echo $val["uid"];?>" target="_parent"><?php __("Connect as"); ?></a> 
     149                        <a href="adm_login.php?id=<?php echo $val["uid"];?>" target="_parent"><img src="images/connect<?php echo $altImg; ?>.png" alt="<?php __("Connect as"); ?>" /></a> 
    128150                <?php } } ?> 
    129151                </td> 
     
    237259</table> 
    238260</form> 
     261<?php printf("<p>" . _("%s account(s)") . "</p>", count($r)); ?> 
    239262<?php } ?> 
    240263<script type="text/javascript"> 
  • alternc/branches/franck-desktop/bureau/admin/adm_login.php

    r1797 r1803  
    6868<?php 
    6969 
    70         if ($error) 
    71         { 
    72                 echo "<p class=\"error\">$error</p>"; 
    73                 include_once("foot.php"); 
    74                 exit(); 
    75         } 
     70if ($error) 
     71{ 
     72        echo "<p class=\"error\">" . $error . "</p>"; 
     73        include_once ("foot.php"); 
     74        exit(); 
     75} 
     76 
    7677?> 
    7778<script type="text/javascript"> 
    78 deploy("menu-ftp"); 
     79deploy("menu-adm"); 
    7980</script> 
    8081<?php include_once("foot.php"); ?> 
  • alternc/branches/franck-desktop/bureau/admin/adm_mxaccount.php

    r1797 r1803  
    3535} 
    3636 
     37$fields = array ( 
     38        "delaccount"   => array ("request", "string", ""), 
     39 
     40        "newlogin"   => array ("request", "string", ""), 
     41        "newpass"    => array ("request", "string", ""), 
     42); 
     43getFields($fields); 
     44 
    3745if ($delaccount) { 
    3846        // Delete an account 
     
    4553        if ($mail->add_slave_account($newlogin,$newpass)) { 
    4654                $error=_("The requested account address has been created. It is now allowed."); 
    47                 unset($newlogin); unset($newpass); 
     55                $newlogin = ""; 
     56                $newpass = ""; 
    4857        } 
    4958} 
  • alternc/branches/franck-desktop/bureau/admin/adm_slaveaccount.php

    r1797 r1803  
    5353        if ($dom->add_slave_account($newlogin,$newpass)) { 
    5454                $error=_("The requested account address has been created. It is now allowed."); 
    55                 unset($newlogin); unset($newpass); 
     55                $newlogin = ""; 
     56                $newpass = ""; 
    5657        } 
    5758} 
  • alternc/branches/franck-desktop/bureau/admin/adm_slaveip.php

    r1797 r1803  
    4343getFields($fields); 
    4444 
    45 if ($delip) { 
     45if ($delip) 
     46{ 
    4647        // Delete an ip address/class 
    47         if ($dom->del_slave_ip($delip)) { 
    48                 $error=_("The requested ip address has been deleted. It will be denied in one hour."); 
     48        if ($dom->del_slave_ip($delip)) 
     49        { 
     50                $error = _("The requested ip address has been deleted. It will be denied in one hour."); 
    4951        } 
    5052} 
    51 if ($newip) { 
     53if ($newip) 
     54{ 
    5255        // Add an ip address/class 
    53         if ($dom->add_slave_ip($newip,$newclass)) { 
    54                 $error=_("The requested ip address has been added to the list. It will be allowed in one hour."); 
    55                 unset($newip); unset($newclass); 
     56        if ($dom->add_slave_ip($newip,$newclass)) 
     57        { 
     58                $error = _("The requested ip address has been added to the list. It will be allowed in one hour."); 
     59                $newip = ""; 
     60                $newclass = ""; 
    5661        } 
    5762} 
     
    6267<h3><?php __("Manage allowed ip for slave zone transfers"); ?></h3> 
    6368<?php 
    64         if ($error) { 
    65           echo "<p class=\"error\">$error</p>"; 
    66         } 
    6769 
    68 $c=$dom->enum_slave_ip(); 
     70if ($error) 
     71{ 
     72        echo "<p class=\"error\">" . $error . "</p>"; 
     73} 
    6974 
    70 if (is_array($c)) { 
     75$c = $dom->enum_slave_ip(); 
     76 
     77if (is_array($c)) 
     78{ 
    7179 
    7280?> 
     
    8492 
    8593<tr class="lst<?php echo $col; ?>"> 
    86 <td class="center"><a href="adm_slaveip.php?delip=<?php echo urlencode($c[$i][ip]); ?>"><img src="images/delete.png" alt="<?php __("Delete"); ?>" /></a></td> 
     94<td class="center"><a href="adm_slaveip.php?delip=<?php echo urlencode($c[$i]["ip"]); ?>"><img src="images/delete.png" alt="<?php __("Delete"); ?>" /></a></td> 
    8795<td><?php echo $c[$i]["ip"]."/".$c[$i]["class"]; ?></td> 
    8896</tr> 
  • alternc/branches/franck-desktop/bureau/admin/adm_tld.php

    r1797 r1803  
    3030require_once("../class/config.php"); 
    3131 
    32 if (!$admin->enabled) { 
     32if (!$admin->enabled) 
     33{ 
    3334        __("This page is restricted to authorized staff"); 
    3435        exit(); 
    3536} 
    3637 
    37 if (is_array($sel)) { 
    38         $error=""; 
    39         for($i=0;$i<count($sel);$i++) { 
    40                 if (!$admin->deltld($sel[$i])) { 
    41                         $error.=_("Some TLD cannot be deleted...")." : ".$sel[$i]."<br />"; 
     38$fields = array ( 
     39        "sel"        => array ("request", "array", array()), 
     40); 
     41getFields($fields); 
     42 
     43if (is_array($sel) && !empty($sel)) 
     44{ 
     45        $error = ""; 
     46        for ($i = 0; $i < count($sel); $i++) 
     47        { 
     48                if (!$admin->deltld($sel[$i])) 
     49                { 
     50                        $error .= _("Some TLD cannot be deleted...")." : " . $sel[$i] . "<br />"; 
    4251                } 
    4352        } 
    44         if (!$error) $error=_("The requested TLD has been deleted"); 
     53        if (!$error) 
     54                $error = _("The requested TLD has been deleted"); 
    4555} 
    4656 
     
    5060<h3><?php __("Manage allowed domains (TLD)"); ?></h3> 
    5161<?php 
    52         if ($error) { 
    53           echo "<p class=\"error\">$error</p>"; 
    54         } 
    5562 
    56 $c=$admin->listtld(); 
     63if ($error) 
     64{ 
     65  echo "<p class=\"error\">" .$error . "</p>"; 
     66} 
     67 
     68$c = $admin->listtld(); 
    5769 
    5870?> 
     
    6375<form method="post" action="adm_tld.php"> 
    6476<table border="0" cellpadding="4" cellspacing="0"> 
    65 <tr><th><?php __("Action"); ?></th><th><?php __("TLD"); ?></th><th><?php __("Allowed Mode"); ?></th></tr> 
     77        <tr> 
     78                <th><?php __("Action"); ?></th> 
     79                <th><?php __("TLD"); ?></th> 
     80                <th><?php __("Allowed Mode"); ?></th> 
     81        </tr> 
    6682<?php 
    67 $col=1; 
    68 for($i=0;$i<count($c);$i++) { 
    69  $col=3-$col; 
     83 
     84$col = 1; 
     85for ($i = 0; $i < count($c); $i++) 
     86{ 
     87        $col = 3 - $col; 
     88        $altImg = ($i % 2 == 0 ? "" : "alt"); 
    7089?> 
     90        <tr class="lst<?php echo $col; ?>"> 
     91                <td><input id="sel<?php echo $i; ?>" type="checkbox" name="sel[]" class="inc" value="<?php echo $c[$i]["tld"]; ?>" />&nbsp;<a href="adm_tldedit.php?tld=<?php echo urlencode($c[$i]["tld"]); ?>"><img style="padding-bottom: 5px" src="images/edit<?php echo $altImg; ?>.png" alt="<?php __("Edit"); ?>" /></a></td> 
     92                <td><label for="sel<?php echo $i; ?>"><?php echo $c[$i]["tld"]; ?></label></td> 
     93                <td><?php __($admin->tldmode[$c[$i]["mode"]]); ?></td> 
     94</tr> 
     95<?php 
    7196 
    72 <tr class="lst<?php echo $col; ?>"> 
    73 <td><input id="sel<?php echo $i; ?>" type="checkbox" name="sel[]" class="inc" value="<?php echo $c[$i]["tld"]; ?>" />&nbsp;<a href="adm_tldedit.php?tld=<?php echo urlencode($c[$i]["tld"]); ?>"><img style="padding-bottom: 5px" src="images/edit.png" alt="<?php __("Edit"); ?>" /></a></td> 
    74 <td><label for="sel<?php echo $i; ?>"><?php echo $c[$i]["tld"]; ?></label></td> 
    75 <td><?php __($admin->tldmode[$c[$i]["mode"]]); ?></td></tr> 
     97} 
    7698 
    77 <?php 
    78 } 
    7999?> 
    80 <tr><td colspan="3"><input type="submit" class="inb" value="<?php __("Delete the checked TLD"); ?>" /></td></tr> 
     100        <tr> 
     101                <td colspan="3"><input type="submit" class="inb" value="<?php __("Delete the checked TLD"); ?>" /></td> 
     102        </tr> 
    81103</table> 
    82104</form> 
  • alternc/branches/franck-desktop/bureau/admin/adm_tldadd.php

    r1797 r1803  
    3737include_once ("head.php"); 
    3838 
     39$fields = array ( 
     40        "tld"      => array ("request", "string", ""), 
     41        "mode"     => array ("request", "integer", 0), 
     42); 
     43getFields($fields); 
     44 
    3945?> 
    4046<h3><?php __("Manage allowed domains (TLD)"); ?></h3> 
  • alternc/branches/franck-desktop/bureau/admin/adm_tlddoadd.php

    r1 r1803  
    3535} 
    3636 
    37 if (!$admin->addtld($tld,$mode)) { 
    38         $error=$err->errstr(); 
    39         include("adm_tldadd.php"); 
    40         exit(); 
    41 } else { 
    42         $error=_("The TLD has been successfully added"); 
    43         include("adm_tld.php"); 
     37$fields = array ( 
     38        "tld"      => array ("request", "string", ""), 
     39        "mode"     => array ("request", "integer", 0), 
     40); 
     41getFields($fields); 
     42 
     43if (!$admin->addtld($tld, $mode)) 
     44{ 
     45        $error = $err->errstr(); 
     46        include ("adm_tldadd.php"); 
    4447        exit(); 
    4548} 
     49else 
     50{ 
     51        $error = _("The TLD has been successfully added"); 
     52        include ("adm_tld.php"); 
     53        exit(); 
     54} 
     55 
    4656?> 
  • alternc/branches/franck-desktop/bureau/admin/adm_variables.php

    r1797 r1803  
    3737$conf = variable_init(); 
    3838foreach ($conf as $name => $val) { 
    39   if (isset($$name)) { 
    40     variable_set($name, $$name); 
     39  if (isset($_REQUEST[$name])) { 
     40    variable_set($name, $_REQUEST[$name]); 
    4141  } 
    4242} 
     
    6565 <tr class="lst<?php echo $col; ?>"> 
    6666 <td><?php echo $vars['name']; ?></td> 
    67  <td><input type="text" name="<?php echo $vars['name']?>" value="<?php echo $vars['value']?>" /></td> 
     67 <td><input type="text" name="<?php echo $vars['name']?>" value="<?php echo addslashes($vars['value']); ?>" /></td> 
    6868 <td><?php echo $vars['comment']; ?></td> 
    6969 </tr> 
  • alternc/branches/franck-desktop/bureau/admin/aws_add.php

    r1797 r1803  
    3131 
    3232$fields = array ( 
    33         "id" => array ("request", "integer", 0), 
     33        "id"       => array ("request", "integer", 0), 
     34        "hostname" => array ("request", "string", ""), 
    3435); 
    3536getFields($fields); 
    3637 
    37 if (!$id && !$quota->cancreate("aws")) { 
    38         $error=_("You cannot add any new statistics, your quota is over."); 
     38if (!$id && !$quota->cancreate("aws")) 
     39{ 
     40        $error = _("You cannot add any new statistics, your quota is over."); 
    3941} 
    4042 
    4143include_once("head.php"); 
     44 
    4245?> 
    4346<h3><?php if (!$id) { __("New Statistics"); } else { __("Edit Statistics"); } ?></h3> 
    4447<?php 
    45         if ($error) { 
    46                 echo "<p class=\"error\">$error</p></body></html>"; 
    47                 exit(); 
    48         } 
     48 
     49if ($error) 
     50{ 
     51        echo "<p class=\"error\">" . $error . "</p>"; 
     52        echo "</body>"; 
     53        echo "</html>"; 
     54        exit(); 
     55} 
     56 
    4957?> 
    5058<form method="post" action="<?php if (!$id) echo "aws_doadd.php"; else echo "aws_doedit"; ?>" id="main" name="main"> 
  • alternc/branches/franck-desktop/bureau/admin/aws_doadd.php

    r1797 r1803  
    3030require_once("../class/config.php"); 
    3131 
    32 $r=$aws->add_stats($hostname,$awsusers); 
    33 if (!$r) { 
    34         $error=$err->errstr(); 
    35         include("aws_add.php"); 
    36         exit(); 
    37 } else { 
    38         $error=_("The statistics has been successfully created"); 
    39         include("aws_list.php"); 
     32$fields = array ( 
     33        "hostname" => array ("request", "string", ""), 
     34        "awsusers" => array ("request", "array", array()), 
     35); 
     36getFields($fields); 
     37 
     38$r = $aws->add_stats($hostname, $awsusers); 
     39if (!$r) 
     40{ 
     41        $error = $err->errstr(); 
     42        include ("aws_add.php"); 
    4043        exit(); 
    4144} 
     45else 
     46{ 
     47        $error = _("The statistics has been successfully created"); 
     48        include ("aws_list.php"); 
     49        exit(); 
     50} 
     51 
    4252?> 
  • alternc/branches/franck-desktop/bureau/admin/aws_doedit.php

    r1797 r1803  
    3030require_once("../class/config.php"); 
    3131 
    32 if (!$id) { 
    33         $error=_("No Statistics selected!"); 
    34 } else { 
    35         $r=$aws->put_stats_details($id,$awsusers); 
    36         if (!$r) { 
    37                 $error=$err->errstr(); 
    38                 include("aws_edit.php"); 
     32$fields = array ( 
     33        "id"       => array ("request", "integer", 0), 
     34        "awsusers" => array ("request", "array", array()), 
     35); 
     36getFields($fields); 
     37 
     38if (!$id) 
     39{ 
     40        $error = _("No Statistics selected!"); 
     41} 
     42else 
     43{ 
     44        $r = $aws->put_stats_details($id, $awsusers); 
     45        if (!$r) 
     46        { 
     47                $error = $err->errstr(); 
     48                include ("aws_edit.php"); 
    3949                exit(); 
    40         } else { 
    41                 $error=_("The Statistics has been successfully changed"); 
    42                 include("aws_list.php"); 
     50        } 
     51        else 
     52        { 
     53                $error = _("The Statistics has been successfully changed"); 
     54                include ("aws_list.php"); 
    4355                exit(); 
    4456        } 
    4557} 
     58 
    4659?> 
  • alternc/branches/franck-desktop/bureau/admin/aws_edit.php

    r1797 r1803  
    3535getFields($fields); 
    3636 
    37 if (!$id) { 
    38         $error=_("No Statistics selected!"); 
    39 } else { 
    40         $r=$aws->get_stats_details($id); 
    41         if (!$r) { 
    42                 $error=$err->errstr(); 
     37if (!$id) 
     38{ 
     39        $error = _("No Statistics selected!"); 
     40} 
     41else 
     42{ 
     43        $r = $aws->get_stats_details($id); 
     44        if (!$r) 
     45        { 
     46                $error = $err->errstr(); 
    4347        } 
    4448} 
    4549 
    46 $id=$r["id"]; 
    47 $hostname=$r["hostname"]; 
    48 $awsusers=$r["users"]; 
     50$_REQUEST["id"] = $r["id"]; 
     51$_REQUEST["hostname"] = $r["hostname"]; 
    4952 
    50 include("aws_add.php"); 
     53include ("aws_add.php"); 
    5154exit(); 
    5255 
  • alternc/branches/franck-desktop/bureau/admin/aws_list.php

    r1797 r1803  
    5959<tr><th colspan="2">&nbsp;</th><th><?php __("Domain name"); ?></th><th>Allowed Users</th><th><?php __("View"); ?></th></tr> 
    6060<?php 
     61 
    6162reset($r); 
    62 $col=1; 
    63 while (list($key,$val)=each($r)) 
    64         { 
    65         $col=3-$col; 
     63$col = 1; 
     64$i = 0; 
     65while (list($key, $val) = each($r)) 
     66{ 
     67        $col = 3 - $col; 
     68        $altImg = ($i % 2 == 0 ? "" : "alt"); 
     69        $i++; 
    6670?> 
    6771        <tr class="lst<?php echo $col; ?>"> 
    6872                <td><input type="checkbox" class="inc" id="del_<?php echo $val["id"]; ?>" name="del_<?php echo $val["id"]; ?>" value="<?php echo $val["id"]; ?>" /></td> 
    69                 <td><a href="aws_edit.php?id=<?php echo $val["id"] ?>"><img src="images/edit.png" alt="<?php __("Edit"); ?>" title="<?php __("Edit"); ?>" /></a></td> 
     73                <td><a href="aws_edit.php?id=<?php echo $val["id"] ?>"><img src="images/edit<?php echo $altImg; ?>.png" alt="<?php __("Edit"); ?>" title="<?php __("Edit"); ?>" /></a></td> 
    7074                <td><label for="del_<?php echo $val["id"]; ?>"><?php echo $val["hostname"] ?></label></td> 
    7175                <td><?php echo $val["users"] ?></td> 
  • alternc/branches/franck-desktop/bureau/admin/aws_pass.php

    r1797 r1803  
    3737getFields($fields); 
    3838 
    39 if (!$aws->login_exists($login)) { 
    40         $error=$err->errstr(); 
     39if (!$aws->login_exists($login)) 
     40{ 
     41        $error = $err->errstr(); 
    4142        include("aws_users.php"); 
    4243        exit(); 
    4344} 
    4445 
    45 if ($pass) { 
    46         if (!$aws->change_pass($login,$pass)) { 
    47                 $error=$err->errstr(); 
    48         } else { 
    49                 include("aws_users.php"); 
     46if ($pass) 
     47{ 
     48        if (!$aws->change_pass($login, $pass)) 
     49        { 
     50                $error = $err->errstr(); 
     51        } 
     52        else 
     53        { 
     54                include ("aws_users.php"); 
    5055                exit(); 
    5156        } 
     
    5762<h3><?php __("Change a user's password"); ?></h3> 
    5863<?php 
    59 if ($error) { 
     64 
     65if ($error) 
     66{ 
     67 
    6068?> 
    6169<p class="error"><?php echo $error ?></p> 
    62 <?php } ?> 
     70<?php 
    6371 
     72} 
     73 
     74?> 
    6475<form method="post" action="aws_pass.php" name="main"> 
    6576<table border="1" cellspacing="0" cellpadding="4"> 
    66 <tr><th> 
    67 <?php __("Username"); ?></th><td> 
    68         <code><?php echo $login; ?></code> <input type="hidden" name="login" value="<?php echo $login; ?>" /> 
    69 </td></tr> 
    70 <tr><th><label for="pass"><?php __("New Password"); ?></label></th><td><input type="text" class="int" name="pass" id="pass" value="<?php echo $pass; ?>" size="20" maxlength="64" /></td></tr> 
    71 <tr><td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Change this user's password"); ?>" /></td></tr> 
     77        <tr> 
     78                <th><?php __("Username"); ?></th> 
     79                <td><code><?php echo $login; ?></code> <input type="hidden" name="login" value="<?php echo $login; ?>" /></td> 
     80        </tr> 
     81        <tr> 
     82                <th><label for="pass"><?php __("New Password"); ?></label></th> 
     83                <td><input type="password" class="int" name="pass" id="pass" value="<?php echo $pass; ?>" size="20" maxlength="64" /></td> 
     84        </tr> 
     85        <tr> 
     86                <td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Change this user's password"); ?>" /></td> 
     87        </tr> 
    7288</table> 
    7389</form> 
    74 <?php include_once("foot.php"); ?> 
     90<?php 
     91 
     92include_once("foot.php"); 
     93 
     94?> 
  • alternc/branches/franck-desktop/bureau/admin/aws_users.php

    r1797 r1803  
    3131include_once("head.php"); 
    3232 
    33 $nologin=false; 
    34 if (!$r=$aws->list_login()) { 
    35         $nologin=true; 
    36         $error=$err->errstr(); 
     33$fields = array ( 
     34        "prefixe" => array ("request", "string", ""), 
     35); 
     36getFields($fields); 
     37 
     38$nologin = false; 
     39if (!$r = $aws->list_login()) 
     40{ 
     41        $nologin = true; 
     42        $error = $err->errstr(); 
    3743} 
    3844 
     
    4248<form method="post" action="aws_useradd.php" name="main"> 
    4349<table border="1" cellspacing="0" cellpadding="4"> 
    44 <tr><th> 
    45 <label for="login"><?php __("Username"); ?></label></th><td> 
    46         <select class="inl" name="prefixe"><?php $aws->select_prefix_list($prefixe); ?></select>&nbsp;<b>_</b>&nbsp;<input type="text" class="int" name="login" id="login" value="" size="20" maxlength="64" /> 
    47 </td></tr> 
    48 <tr><th><label for="pass"><?php __("Password"); ?></label></th><td><input type="text" class="int" name="pass" id="pass" value="" size="20" maxlength="64" /></td></tr> 
    49 <tr><td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Create this new awstat account."); ?>" /></td></tr> 
     50        <tr> 
     51                <th><label for="login"><?php __("Username"); ?></label></th> 
     52                <td> 
     53                        <select class="inl" name="prefixe"><?php $aws->select_prefix_list($prefixe); ?></select>&nbsp;<b>_</b>&nbsp;<input type="text" class="int" name="login" id="login" value="" size="20" maxlength="64" /> 
     54                </td> 
     55        </tr> 
     56        <tr> 
     57                <th><label for="pass"><?php __("Password"); ?></label></th> 
     58                <td><input type="password" class="int" name="pass" id="pass" value="" size="20" maxlength="64" /></td> 
     59        </tr> 
     60        <tr> 
     61                <td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Create this new awstat account."); ?>" /></td> 
     62        </tr> 
    5063</table> 
    5164</form> 
     65<?php 
     66 
     67if ($error) 
     68{ 
     69 
     70?> 
     71<p class="error"><?php echo $error ?></p> 
    5272 
    5373<?php 
    5474 
     75} 
    5576 
    56 if ($error) { 
     77if (!$nologin) 
     78{ 
     79 
    5780?> 
    58 <p class="error"><?php echo $error ?></p> 
    59 <?php } 
    60  
    61 if (!$nologin) { 
    62 ?> 
    63  
    64  
    6581<form method="post" action="aws_userdel.php"> 
    6682<table cellspacing="0" cellpadding="4"> 
    67 <tr><th colspan="2">&nbsp;</th><th><?php __("Username"); ?></th></tr> 
     83        <tr> 
     84                <th colspan="2">&nbsp;</th> 
     85                <th><?php __("Username"); ?></th> 
     86        </tr> 
    6887<?php 
    69 $col=1; 
    70 foreach ($r as $val) { 
    71         $col=3-$col; 
     88 
     89$col = 1; 
     90foreach ($r as $val) 
     91{ 
     92        $col = 3 - $col; 
    7293?> 
    7394        <tr class="lst<?php echo $col; ?>"> 
     
    7798        </tr> 
    7899<?php 
    79         } 
     100 
     101} 
     102 
    80103?> 
    81 <tr><td colspan="5"><input type="submit" name="submit" class="inb" value="<?php __("Delete checked accounts"); ?>" /></td></tr> 
     104        <tr> 
     105                <td colspan="5"><input type="submit" name="submit" class="inb" value="<?php __("Delete checked accounts"); ?>" /></td> 
     106        </tr> 
    82107</table> 
    83108</form> 
    84109<?php 
    85  } 
     110 
     111} 
     112 
     113include_once("foot.php"); 
     114 
    86115?> 
    87 <?php include_once("foot.php"); ?> 
  • alternc/branches/franck-desktop/bureau/admin/bro_editor.php

    r1797 r1803  
    3030require_once("../class/config.php"); 
    3131 
     32$fields = array ( 
     33        "R"         => array ("request", "string", ""), 
     34        "file"      => array ("request", "string", ""), 
     35        "texte"     => array ("request", "string", ""), 
     36        "cancel"    => array ("request", "string", ""), 
     37        "saveret"   => array ("request", "string", ""), 
     38        "save"      => array ("request", "string", ""), 
     39); 
     40getFields($fields); 
     41 
    3242$file=ssla($file); 
    3343$texte=ssla($texte); 
     
    5969</p> 
    6070<form action="bro_editor.php" method="post"><br /> 
    61 <div id="resizer" style="left: 0px; top: 0px; z-index: 54; width: 646px; height: 252px; cursor: auto;"><textarea class="int" style="font-family: <?php echo $p["editor_font"]; ?>; font-size: <?php echo $p["editor_size"]; ?>; width: 90%; height: 90%;" cols="<?php echo $p["editsizex"]; ?>" rows="<?php echo $p["editsizey"]; ?>" name="texte"><?php 
     71<div id="resizer" style="left: 0px; top: 0px; z-index: 54; width: <?php echo $p["editsizex"]; ?>px; height: <?php echo $p["editsizey"]; ?>px; cursor: auto;"><textarea class="int" style="font-family: <?php echo $p["editor_font"]; ?>; font-size: <?php echo $p["editor_size"]; ?>; width: 90%; height: 90%;" cols="<?php echo $p["editsizex"]; ?>" rows="<?php echo $p["editsizey"]; ?>" name="texte"><?php 
    6272$bro->content($R,$file); 
    6373?></textarea><img src="/admin/icon/winresize.gif" alt="shift+click and drag to resize textarea" title="shift+click and drag to resize textarea" height="20" width="20" /></div><br /> 
  • alternc/branches/franck-desktop/bureau/admin/bro_main.php

    r1802 r1803  
    2929 ---------------------------------------------------------------------- 
    3030*/ 
    31 require_once("../class/config.php"); 
     31require_once ("../class/config.php"); 
    3232include_once ("head.php"); 
    3333 
    34 $p=$bro->GetPrefs(); 
    35 if (!$R && $p["golastdir"]) { 
    36   $R=$p["lastdir"]; 
    37 } 
    38 $R=$bro->convertabsolute($R,1); 
     34$fields = array ( 
     35        "R"           => array ("request", "string", ""), 
     36        "formu"       => array ("request", "integer", 0), 
     37        "nomfich"     => array ("request", "string", ""), 
     38        "o"           => array ("request", "array", array()), 
     39        "d"           => array ("request", "array", array()), 
     40        "actmove"     => array ("request", "string", ""), 
     41        "actmoveto"   => array ("request", "string", ""), 
     42        "actrename"   => array ("request", "string", ""), 
     43        "actdel"      => array ("request", "string", ""), 
     44        "del_confirm" => array ("request", "string", ""), 
     45        "cancel"      => array ("request", "string", ""), 
     46); 
     47getFields($fields); 
     48 
     49$p = $bro->GetPrefs(); 
     50if (!$R && $p["golastdir"]) 
     51{ 
     52        $R = $p["lastdir"]; 
     53} 
     54 
     55$R = $bro->convertabsolute($R, 1); 
     56 
    3957// on fait ? 
    40 if ($formu) { 
    41   switch ($formu) { 
    42   case 1:  // Créer le répertoire $R.$nomfich 
    43     if (!$bro->CreateDir($R,$nomfich)) { 
    44       echo $err->errstr(); 
    45     } 
    46     $p=$bro->GetPrefs(); 
    47     break; 
    48   case 6: // Créer le fichier $R.$nomfich 
    49     if (!$bro->CreateFile($R,$nomfich)) { 
    50       echo $err->errstr(); 
    51     } 
    52     $p=$bro->GetPrefs(); 
    53     if ($p["createfile"]==1) { 
    54       $file=$nomfich; 
    55       include("bro_editor.php"); 
    56       exit(); 
    57     } 
    58     break; 
    59   case 2:  // act vaut Supprimer Copier ou Renommer. 
    60     if ($actdel) { 
    61       if($del_confirm == _("Yes")) { 
    62         if (!$bro->DeleteFile($d,$R)) { 
    63           print $err->errstr(); 
    64         } 
    65       } 
    66       else if (!$cancel) 
    67       { 
    68  
    69 ?> 
    70   <h3><?php printf(_("Deleting files and/or directories")); ?></h3> 
    71   <form action="bro_main.php" method="post"> 
    72     <input type="hidden" name="formu" value="2" /> 
    73     <input type="hidden" name="actdel" value="1" /> 
    74     <input type="hidden" name="R" value="<?php echo $R?>" /> 
    75     <p class="error"><?php __("WARNING : Confirm the deletion of this files"); ?></p> 
    76 <?php foreach($d as $file){ ?> 
    77         <p><?php echo stripslashes($file); ?></p> 
    78         <input type="hidden" name="d[]" value="<?php echo htmlentities(stripslashes($file)); ?>" /> 
     58if ($formu) 
     59{ 
     60        switch ($formu) 
     61        { 
     62                case 1:  // Créer le répertoire $R.$nomfich 
     63                        if (!$bro->CreateDir($R, $nomfich)) 
     64                        { 
     65                                echo $err->errstr(); 
     66                        } 
     67                        $p = $bro->GetPrefs(); 
     68                break; 
     69 
     70                case 6: // Créer le fichier $R.$nomfich 
     71                        if (!$bro->CreateFile($R,$nomfich)) 
     72                        { 
     73                                echo $err->errstr(); 
     74                        } 
     75                        $p = $bro->GetPrefs(); 
     76                        if ($p["createfile"] == 1) 
     77                        { 
     78                                $file = $nomfich; 
     79                                include ("bro_editor.php"); 
     80                                exit(); 
     81                        } 
     82                break; 
     83                case 2:  // act vaut Supprimer Copier ou Renommer. 
     84                        if ($actdel) 
     85                        { 
     86                                if ($del_confirm == _("Yes")) 
     87                                { 
     88                                        if (!$bro->DeleteFile($d, $R)) 
     89                                        { 
     90                                                echo $err->errstr(); 
     91                                        } 
     92                                } 
     93                                else if (!$cancel) 
     94                                { 
     95 
     96?> 
     97<h3><?php printf(_("Deleting files and/or directories")); ?></h3> 
     98<form action="bro_main.php" method="post"> 
     99<input type="hidden" name="formu" value="2" /> 
     100<input type="hidden" name="actdel" value="1" /> 
     101<input type="hidden" name="R" value="<?php echo $R?>" /> 
     102<p class="error"><?php __("WARNING : Confirm the deletion of this files"); ?></p> 
     103<?php foreach ($d as $file) { ?> 
     104<p><?php echo stripslashes($file); ?></p> 
     105<input type="hidden" name="d[]" value="<?php echo htmlentities(stripslashes($file)); ?>" /> 
    79106<?php } ?> 
    80     <blockquote> 
    81       <input type="submit" class="inb" name="del_confirm" value="<?php __("Yes"); ?>" />&nbsp;&nbsp; 
    82       <input type="submit" class="inb" name="cancel" value="<?php __("No"); ?>" /> 
    83     </blockquote> 
    84   </form> 
     107<blockquote> 
     108        <input type="submit" class="inb" name="del_confirm" value="<?php __("Yes"); ?>" />&nbsp;&nbsp; 
     109        <input type="submit" class="inb" name="cancel" value="<?php __("No"); ?>" /> 
     110</blockquote> 
     111</form> 
    85112<?php 
    86                                 include_once("foot.php"); 
    87         die(); 
    88       } 
    89     } 
    90     if ($actmove) { 
    91       if (!$bro->MoveFile($d,$R,$actmoveto)) { 
    92         echo $err->errstr(); 
    93       } 
    94     } 
    95     break; 
    96   case 4:  // Renommage Effectif... 
    97     if (!$bro->RenameFile($R,$o,$d)) { // Rename $R (directory) $o (old) $d (new) names 
    98       echo $err->errstr(); 
    99     } 
    100     break; 
    101   case 3:  // Upload de fichier... 
    102     if (!$bro->UploadFile($R)) { 
    103       echo $err->errstr(); 
    104     } 
     113                                        include_once("foot.php"); 
     114                                        die(); 
     115                                } 
     116                        } 
     117                        if ($actmove) 
     118                        { 
     119                                if (!$bro->MoveFile($d, $R, $actmoveto)) 
     120                                { 
     121                                        echo $err->errstr(); 
     122                                } 
     123                        } 
    105124                break; 
    106   } 
     125                case 4:  // Renommage Effectif... 
     126                        if (!$bro->RenameFile($R, $o, $d)) // Rename $R (directory) $o (old) $d (new) names 
     127                        { 
     128                                echo $err->errstr(); 
     129                        } 
     130                break; 
     131                case 3:  // Upload de fichier... 
     132                        if (!$bro->UploadFile($R)) 
     133                        { 
     134                                echo $err->errstr(); 
     135                        } 
     136                break; 
     137        } 
    107138} 
    108139 
    109140/* Creation de la liste des fichiers courants */ 
    110 $c=$bro->filelist($R); 
    111 if ($c===false) $error=$err->errstr(); 
     141$c = $bro->filelist($R); 
     142if ($c === false) 
     143        $error = $err->errstr(); 
    112144 
    113145?> 
  • alternc/branches/franck-desktop/bureau/admin/bro_pref.php

    r1797 r1803  
    3030require_once("../class/config.php"); 
    3131 
    32 if ($submit) { 
     32$fields = array ( 
     33        "submit"          => array ("request", "string", ""), 
     34        "editsizex"       => array ("request", "string", ""), 
     35        "editsizey"       => array ("request", "string", ""), 
     36        "listmode"        => array ("request", "string", ""), 
     37        "showicons"       => array ("request", "string", ""), 
     38        "downfmt"         => array ("request", "string", ""), 
     39        "createfile"      => array ("request", "string", ""), 
     40        "showtype"        => array ("request", "string", ""), 
     41        "editor_font"     => array ("request", "string", ""), 
     42        "editor_size"     => array ("request", "string", ""), 
     43        "golastdir"       => array ("request", "string", ""), 
     44); 
     45getFields($fields); 
     46 
     47if ($submit) 
     48{ 
    3349        $bro->SetPrefs($editsizex, $editsizey, $listmode, $showicons, $downfmt, $createfile, $showtype, $editor_font, $editor_size, $golastdir); 
    34         $error=_("Your preferences have been updated."); 
    35         include("bro_main.php"); 
     50        $error = _("Your preferences have been updated."); 
     51        include ("bro_main.php"); 
    3652        exit; 
    3753} 
    38 $p=$bro->GetPrefs(); 
     54 
     55$p = $bro->GetPrefs(); 
    3956 
    4057include_once("head.php"); 
    4158 
    42 ?> 
    43 <?php if ($error) echo "<font color=\"red\">$error</font><br />"; ?> 
     59if ($error) 
     60        echo "<p class=\"error\">" . $error . "</p>"; 
     61 
     62?> 
    4463<h3><?php __("File editor preferences"); ?></h3> 
    4564<form action="bro_pref.php" method="post"> 
    46  
    4765<table cellpadding="6" border="1" cellspacing="0"> 
    48 <tr><td colspan="2"><h4><?php __("File editor preferences"); ?></h4></td></tr> 
    49 <tr><td><?php __("Horizontal window size"); ?></td><td><select class="inl" name="editsizex"> 
    50 <?php 
    51 for($i=10;$i<=200;$i+=10) { 
    52         echo "<option"; 
    53         if ($p["editsizex"]==$i) echo " selected"; 
    54         echo ">$i"; 
    55 } 
    56 ?></select></td></tr> 
    57 <tr><td><?php __("Vertical window size"); ?></td><td><select class="inl" name="editsizey"> 
    58 <?php 
    59 for($i=4;$i<=60;$i+=2) { 
    60         echo "<option"; 
    61         if ($p["editsizey"]==$i) echo " selected"; 
    62         echo ">$i"; 
    63 } 
    64 ?></select></td></tr> 
    65 <tr><td><?php __("File editor font name"); ?></td><td><select class="inl" name="editor_font"> 
    66 <?php 
    67 for($i=0;$i<count($bro->l_editor_font);$i++) { 
    68         echo "<option"; 
    69         if ($p["editor_font"]==$bro->l_editor_font[$i]) echo " selected"; 
    70         echo ">"._($bro->l_editor_font[$i]); 
    71 } 
    72 ?></select></td></tr> 
    73 <tr><td><?php __("File editor font size"); ?></td><td><select class="inl" name="editor_size"> 
    74 <?php 
    75 for($i=0;$i<count($bro->l_editor_size);$i++) { 
    76         echo "<option"; 
    77         if ($p["editor_size"]==$bro->l_editor_size[$i]) echo " selected"; 
    78         echo ">"._($bro->l_editor_size[$i]); 
    79 } 
    80 ?></select></td></tr> 
     66        <tr> 
     67                <td colspan="2"><h4><?php __("File editor preferences"); ?></h4></td> 
     68        </tr> 
     69        <tr> 
     70                <td><?php __("Horizontal window size"); ?></td> 
     71                <td><select class="inl" name="editsizex"> 
     72<?php 
     73 
     74for ($i = 400; $i <= 1000; $i += 100) 
     75{ 
     76        echo "<option value=\"" . $i . "\""; 
     77        if ($p["editsizex"] == $i) echo " selected=\"selected\""; 
     78        echo ">" . $i . "</option>"; 
     79} 
     80 
     81?> 
     82</select></td> 
     83</tr> 
     84<tr> 
     85<td><?php __("Vertical window size"); ?></td> 
     86<td><select class="inl" name="editsizey"> 
     87<?php 
     88 
     89for ($i = 200; $i <= 500; $i += 50) 
     90{ 
     91        echo "<option value=\"" . $i . "\""; 
     92        if ($p["editsizey"] == $i) 
     93                echo " selected=\"selected\""; 
     94        echo ">" . $i . "</option>"; 
     95} 
     96 
     97?> 
     98</select></td> 
     99</tr> 
     100<tr> 
     101<td><?php __("File editor font name"); ?></td> 
     102<td><select class="inl" name="editor_font"> 
     103<?php 
     104 
     105for ($i = 0; $i < count($bro->l_editor_font); $i++) 
     106{ 
     107        echo "<option value=\"" . $bro->l_editor_font[$i] . "\""; 
     108        if ($p["editor_font"] == $bro->l_editor_font[$i]) 
     109                echo " selected=\"selected\""; 
     110        echo ">" . _($bro->l_editor_font[$i]) . "</option>"; 
     111} 
     112 
     113?> 
     114</select></td> 
     115</tr> 
     116<tr> 
     117<td><?php __("File editor font size"); ?></td> 
     118<td><select class="inl" name="editor_size"> 
     119<?php 
     120 
     121for ($i = 0; $i < count($bro->l_editor_size); $i++) 
     122{ 
     123        echo "<option value=\"" . $bro->l_editor_size[$i] . "\""; 
     124        if ($p["editor_size"] == $bro->l_editor_size[$i]) 
     125                echo " selected=\"selected\""; 
     126        echo ">" . _($bro->l_editor_size[$i]) . "</option>"; 
     127} 
     128 
     129?> 
     130</select> 
     131</td> 
     132</tr> 
    81133</table> 
     134 
    82135<p>&nbsp;</p> 
    83136 
    84137<table cellpadding="6" border="1" cellspacing="0"> 
    85 <tr><td colspan="2"><h4><?php __("File browser preferences"); ?></h4></td></tr> 
    86 <tr><td><?php __("File list view"); ?></td><td><select class="inl" name="listmode"> 
    87 <?php 
    88 for($i=0;$i<count($bro->l_mode);$i++) { 
    89         echo "<option"; 
    90         if ($p["listmode"]==$i) echo " selected"; 
    91         echo " value=\"$i\">"._($bro->l_mode[$i])."</option>"; 
    92 } 
    93 ?></select></td></tr> 
    94 <tr><td><?php __("Downloading file format"); ?></td><td><select class="inl" name="downfmt"> 
    95 <?php 
    96 for($i=0;$i<count($bro->l_tgz);$i++) { 
    97         echo "<option"; 
    98         if ($p["downfmt"]==$i) echo " selected"; 
    99         echo " value=\"$i\">"._($bro->l_tgz[$i])."</option>"; 
    100 } 
    101 ?></select></td></tr> 
    102 <tr><td><?php __("What to do after creating a file"); ?></td><td><select class="inl" name="createfile"> 
    103 <?php 
    104 for($i=0;$i<count($bro->l_createfile);$i++) { 
    105         echo "<option"; 
    106         if ($p["createfile"]==$i) echo " selected"; 
    107         echo " value=\"$i\">"._($bro->l_createfile[$i])."</option>"; 
    108 } 
    109 ?></select></td></tr> 
    110 <tr><td><?php __("Show icons?"); ?></td><td><select class="inl" name="showicons"> 
    111 <?php 
    112 for($i=0;$i<count($bro->l_icons);$i++) { 
    113         echo "<option"; 
    114         if ($p["showicons"]==$i) echo " selected"; 
    115         echo " value=\"$i\">"._($bro->l_icons[$i])."</option>"; 
    116 } 
    117 ?></select></td></tr> 
    118 <tr><td><?php __("Show file types?"); ?></td><td><select class="inl" name="showtype"> 
    119 <?php 
    120 for($i=0;$i<count($bro->l_icons);$i++) { 
    121         echo "<option"; 
    122         if ($p["showtype"]==$i) echo " selected"; 
    123         echo " value=\"$i\">"._($bro->l_icons[$i])."</option>"; 
    124 } 
    125 ?></select></td></tr> 
    126 <tr><td><?php __("Remember last visited directory?"); ?></td><td><select class="inl" name="golastdir"> 
    127 <?php 
    128 for($i=0;$i<count($bro->l_icons);$i++) { 
    129         echo "<option"; 
    130         if ($p["golastdir"]==$i) echo " selected"; 
    131         echo " value=\"$i\">"._($bro->l_icons[$i])."</option>"; 
    132 } 
    133 ?></select></td></tr> 
    134  
     138        <tr> 
     139                <td colspan="2"><h4><?php __("File browser preferences"); ?></h4></td> 
     140        </tr> 
     141        <tr> 
     142                <td><?php __("File list view"); ?></td> 
     143                <td><select class="inl" name="listmode"> 
     144<?php 
     145 
     146for ($i = 0; $i < count($bro->l_mode); $i++) 
     147{ 
     148        echo "<option value=\"" . $i . "\""; 
     149        if ($p["listmode"] == $i) 
     150                echo " selected=\"selected\""; 
     151        echo ">" . _($bro->l_mode[$i]) . "</option>"; 
     152} 
     153 
     154?> 
     155                        </select> 
     156                </td> 
     157        </tr> 
     158        <tr> 
     159                <td><?php __("Downloading file format"); ?></td> 
     160                <td><select class="inl" name="downfmt"> 
     161<?php 
     162 
     163for($i = 0; $i <count($bro->l_tgz); $i++) 
     164{ 
     165        echo "<option value=\"" . $i . "\""; 
     166        if ($p["downfmt"] == $i) 
     167                echo " selected=\"selected\""; 
     168        echo ">" . _($bro->l_tgz[$i]) . "</option>"; 
     169} 
     170 
     171?> 
     172                        </select> 
     173                </td> 
     174        </tr> 
     175        <tr> 
     176                <td><?php __("What to do after creating a file"); ?></td> 
     177                <td><select class="inl" name="createfile"> 
     178<?php 
     179 
     180for($i = 0; $i < count($bro->l_createfile); $i++) 
     181{ 
     182        echo "<option value=\"" . $i . "\""; 
     183        if ($p["createfile"] == $i) 
     184                echo " selected=\"selected\""; 
     185        echo ">" . _($bro->l_createfile[$i]) . "</option>"; 
     186} 
     187 
     188?> 
     189                        </select> 
     190                </td> 
     191        </tr> 
     192        <tr> 
     193                <td><?php __("Show icons?"); ?></td> 
     194                <td><select class="inl" name="showicons"> 
     195<?php 
     196 
     197for($i = 0; $i < count($bro->l_icons); $i++) 
     198{ 
     199        echo "<option value=\"" . $i . "\""; 
     200        if ($p["showicons"] == $i) 
     201                echo " selected=\"selected\""; 
     202        echo ">" . _($bro->l_icons[$i]) . "</option>"; 
     203} 
     204 
     205?> 
     206                        </select> 
     207                </td> 
     208        </tr> 
     209        <tr> 
     210                <td><?php __("Show file types?"); ?></td> 
     211                <td><select class="inl" name="showtype"> 
     212<?php 
     213 
     214for($i = 0; $i < count($bro->l_icons); $i++) 
     215{ 
     216        echo "<option value=\"" . $i . "\""; 
     217        if ($p["showtype"] == $i) 
     218                echo " selected=\"selected\""; 
     219        echo ">" . _($bro->l_icons[$i]) . "</option>"; 
     220} 
     221 
     222?> 
     223                        </select> 
     224                </td> 
     225        </tr> 
     226        <tr> 
     227                <td><?php __("Remember last visited directory?"); ?></td> 
     228                <td><select class="inl" name="golastdir"> 
     229<?php 
     230 
     231for($i = 0; $i < count($bro->l_icons); $i++) 
     232{ 
     233        echo "<option value=\"" . $i . "\""; 
     234        if ($p["golastdir"] == $i) 
     235                echo " selected=\"selected\""; 
     236        echo ">" . _($bro->l_icons[$i]) . "</option>"; 
     237} 
     238 
     239?> 
     240                        </select> 
     241                </td> 
     242        </tr> 
    135243</table> 
    136244<p><input type="submit" name="submit" class="inb" value="<?php __("Change my settings"); ?>" /></p> 
  • alternc/branches/franck-desktop/bureau/admin/bro_tgzdown.php

    r398 r1803  
    3030require_once("../class/config.php"); 
    3131 
    32 $p=$bro->GetPrefs(); 
    33 switch ($p["downfmt"]) { 
     32$fields = array ( 
     33        "dir"     => array ("request", "string", ""), 
     34); 
     35getFields($fields); 
     36 
     37$p = $bro->GetPrefs(); 
     38switch ($p["downfmt"]) 
     39{ 
    3440        case 0: 
    3541                $bro->DownloadTGZ($dir); 
     
    4551                break; 
    4652} 
     53 
    4754?> 
  • alternc/branches/franck-desktop/bureau/admin/browseforfolder.php

    r517 r1803  
    1414} 
    1515 
    16 requires : ife($test,$iftrue,$iffalse) function :  
     16requires : ife($test,$iftrue,$iffalse) function : 
    1717 
    1818function ife($test,$true,$false="") { 
     
    4343        $c=opendir($root.$rot); 
    4444        $i=0; $tmp = array(); 
    45         while ($r=readdir($c)) {  
     45        while ($r=readdir($c)) { 
    4646                if (is_dir($root.$rot."/".$r) && $r!="." && $r!="..") { $tmp[$i++]=$r; } 
    4747        } 
    48         sort($tmp);      
     48        sort($tmp); 
    4949        foreach ($tmp as $r) { 
    5050                        /* Ajout */ 
     
    6767$root="/var/alternc/html/".substr($mem->user["login"],0,1)."/".$mem->user["login"]."/"; 
    6868// pour utiliser 'la ou est browseforfolder', mettre dirname($HTTP_SERVER_VARS["PATH_TRANSLATED"]); 
     69 
     70$fields = array ( 
     71        "file"   => array ("request", "string", ""), 
     72        "caller" => array ("request", "string", ""), 
     73        "select" => array ("request", "string", ""), 
     74        "curdir" => array ("request", "string", ""), 
     75); 
     76getFields($fields); 
    6977 
    7078if (substr($file,0,1)!="/") $file="/".$file; 
  • alternc/branches/franck-desktop/bureau/admin/dom_add.php

    r1797 r1803  
    3232include_once("head.php"); 
    3333 
    34 if (!isset($dns)) $dns="1"; 
     34$fields = array ( 
     35        "newdomain"  => array ("request", "string", ""), 
     36        "dns"        => array ("request", "integer", 1), 
     37); 
     38getFields($fields); 
    3539 
    3640?> 
     
    6973?> 
    7074<script type="text/javascript"> 
    71 document.forms['main'].newdomain.focus(); 
    7275deploy("menu-dom"); 
    7376</script> 
  • alternc/branches/franck-desktop/bureau/admin/dom_doadd.php

    r1797 r1803  
    3333$fields = array ( 
    3434        "newdomain"    => array ("post", "string", ""), 
    35         "dns"          => array ("post", "string", ""), 
     35        "dns"          => array ("post", "integer", 0), 
    3636); 
    3737getFields($fields); 
     
    5050<h3><?php __("Add a domain"); ?></h3> 
    5151<p> 
    52 <?php printf(_("Your new domain %s has been successfully installed"),$newdomain); ?><br /> 
    53 <a href="main.php" target="_top"><?php __("Click here to continue"); ?></a><br /> 
     52<?php printf(_("Your new domain %s has been successfully installed"),$newdomain); ?> 
     53</p> 
     54<p> 
     55<a href="main.php" target="_top"><?php __("Click here to continue"); ?></a> 
     56</p> 
    5457<?php $mem->show_help("add_domain"); ?> 
    55 <br /> 
    5658<?php 
    57         if (is_array($dom->dns)) { 
    58                 echo "<br />"._("Whois result on the domain")." : <pre>"; 
    59                 reset($dom->dns); 
    60                 while (list($key,$val)=each($dom->dns)) { 
    61                         echo "nameserver: $val\n"; 
    62                 } 
    63                 echo "</pre>"; 
     59 
     60if (is_array($dom->dns)) 
     61{ 
     62        echo "<p>"; 
     63        echo _("Whois result on the domain") . " : <pre>"; 
     64        reset($dom->dns); 
     65        while (list($key, $val) = each($dom->dns)) 
     66        { 
     67                echo "nameserver: " . $val . "\n"; 
    6468        } 
     69        echo "</pre>"; 
     70        echo "</p>"; 
     71} 
     72 
     73 
     74include_once("foot.php"); 
     75 
    6576?> 
    66 </p> 
    67 <?php include_once("foot.php"); ?> 
  • alternc/branches/franck-desktop/bureau/admin/dom_edit.php

    r1797 r1803  
    7272<table cellspacing="0" cellpadding="3"> 
    7373<?php 
    74 $col=1; 
    75 for($i=0;$i<$r["nsub"];$i++) { 
    76         $col=3-$col; 
     74 
     75$col = 1; 
     76for ($i = 0; $i < $r["nsub"] ; $i++) 
     77{ 
     78        $col = 3 - $col; 
     79        $altImg = ($i % 2 == 0 ? "" : "alt"); 
     80 
    7781?> 
    7882        <tr class="lst<?php echo $col; ?>"> 
    7983                <td class="center"> 
    80                         <a href="dom_subedit.php?domain=<?php echo urlencode($r["name"]) ?>&amp;sub=<?php  echo urlencode($r["sub"][$i]["name"]) ?>"><img src="images/edit.png" alt="<?php __("Edit"); ?>" /></a>&nbsp;<a href="dom_subdel.php?domain=<?php echo urlencode($r["name"]) ?>&amp;sub=<?php  echo urlencode($r["sub"][$i]["name"]) ?>"><img src="images/delete.png" alt="<?php __("Delete"); ?>" /></a> 
     84                        <a href="dom_subedit.php?domain=<?php echo urlencode($r["name"]) ?>&amp;sub=<?php  echo urlencode($r["sub"][$i]["name"]) ?>"><img src="images/edit<?php echo $altImg; ?>.png" alt="<?php __("Edit"); ?>" /></a>&nbsp;<a href="dom_subdel.php?domain=<?php echo urlencode($r["name"]) ?>&amp;sub=<?php  echo urlencode($r["sub"][$i]["name"]) ?>"><img src="images/delete<?php echo $altImg; ?>.png" alt="<?php __("Delete"); ?>" /></a> 
    8185                </td> 
    8286                <td><a href="http://<?php ecif($r["sub"][$i]["name"],$r["sub"][$i]["name"]."."); echo $r["name"] ?>" target="_blank"><?php ecif($r["sub"][$i]["name"],$r["sub"][$i]["name"]."."); echo $r["name"] ?></a></td> 
     
    135139 --> 
    136140<?php 
    137 if (!$r[noerase]) { 
     141if (!$r["noerase"]) { 
    138142?> 
    139143 
  • alternc/branches/franck-desktop/bureau/admin/dom_subdel.php

    r1797 r1803  
    4444 
    4545?> 
    46 <h3><?php printf(_("Deleting subdomain %s"),"http://".ife($sub,$sub.".").$domain); ?> : </h3> 
     46<h3><?php printf(_("Deleting subdomain %s"),"http://".ife($sub,$sub.".").$domain); ?></h3> 
    4747<?php 
    4848        if ($error) { 
  • alternc/branches/franck-desktop/bureau/admin/dom_subdodel.php

    r1797 r1803  
    4646 
    4747?> 
    48 <h3>Suppression du sous-domaine http://<?php ecif($sub,$sub."."); echo $domain; ?> : </h3> 
     48<h3>Suppression du sous-domaine http://<?php ecif($sub,$sub."."); echo $domain; ?></h3> 
    4949<?php 
    5050        if ($error) { 
  • alternc/branches/franck-desktop/bureau/admin/dom_subdoedit.php

    r1 r1803  
    3030require_once("../class/config.php"); 
    3131 
     32$fields = array ( 
     33        "domain"        => array ("request", "string", ""), 
     34        "sub"           => array ("request", "string", ""), 
     35        "type"          => array ("request", "integer", 0), 
     36        "sub_local"     => array ("request", "string", ""), 
     37        "sub_url"       => array ("request", "string", ""), 
     38        "sub_ip"        => array ("request", "string", ""), 
     39        "action"        => array ("request", "string", ""), 
     40); 
     41getFields($fields); 
     42 
    3243$dom->lock(); 
    3344 
  • alternc/branches/franck-desktop/bureau/admin/dom_subedit.php

    r1797 r1803  
    4444 
    4545?> 
    46 <h3>Edition du sous-domaine http://<?php ecif($sub,$sub."."); echo $domain; ?> : </h3> 
     46<h3>Edition du sous-domaine http://<?php ecif($sub,$sub."."); echo $domain; ?></h3> 
    4747<?php 
    4848        if ($error) { 
  • alternc/branches/franck-desktop/bureau/admin/foot.php

    r1797 r1803  
    33</tr> 
    44</table> 
     5<?php endBox(); ?> 
    56</div> <!-- div global --> 
     7<?php 
     8 
     9$tempsFin = microtimeFloat(); 
     10$temps = round($tempsFin - $tempsDebut, 4); 
     11 
     12if ($customErrorHandler) 
     13{ 
     14        $message = $queryCount . " queries<br />Generated in " . $temps . "s<br />Mem. Usage: " . format_size(memory_get_usage()); 
     15 
     16        displayPhpError($message); 
     17} 
     18 
     19?> 
    620</body> 
    721</html> 
  • alternc/branches/franck-desktop/bureau/admin/ftp_add.php

    r1797 r1803  
    3131include_once("head.php"); 
    3232 
    33 if (!$quota->cancreate("ftp")) { 
    34         $error=_("You cannot add any new ftp account, your quota is over."); 
    35         $fatal=1; 
     33if (!$quota->cancreate("ftp")) 
     34{ 
     35        $error = _("You cannot add any new ftp account, your quota is over."); 
     36        $fatal = 1; 
    3637} 
     38 
     39$fields = array ( 
     40        "id"         => array ("request", "integer", 0), 
     41        "prefixe"    => array ("request", "string", ""), 
     42        "login"      => array ("request", "string", ""), 
     43        "pass"       => array ("request", "string", ""), 
     44        "passconf"   => array ("request", "string", ""), 
     45        "dir"        => array ("request", "string", ""), 
     46); 
     47getFields($fields); 
    3748 
    3849?> 
    3950<h3><?php __("Create a new ftp account"); ?></h3> 
    4051<?php 
    41         if ($error) { 
    42                 echo "<p class=\"error\">$error</p>"; 
    43                 if ($fatal) { 
    44 ?> 
    45 <script type="text/javascript"> 
    46 deploy("menu-ftp"); 
    47 </script> 
    48 <?php include_once("foot.php"); ?> 
    49 <?php 
    50                         exit(); 
    51                 } 
    52         } 
     52 
     53if ($error) 
     54{ 
     55        echo "<p class=\"error\">" . $error . "</p>"; 
     56} 
     57 
    5358?> 
    5459<form method="post" action="ftp_doadd.php" name="main"> 
    5560<table border="1" cellspacing="0" cellpadding="4"> 
    56 <tr><th><input type="hidden" name="id" value="<?php echo $id ?>" /> 
    57 <label for="login"><?php __("Username"); ?></label></th><td> 
    58         <select class="inl" name="prefixe"><?php $ftp->select_prefix_list($prefixe); ?></select>&nbsp;<b>_</b>&nbsp;<input type="text" class="int" name="login" id="login" value="<?php echo $login; ?>" size="20" maxlength="64" /> 
    59 </td></tr> 
    60 <tr><th><label for="pass"><?php __("Password"); ?></label></th><td><input type="password" class="int" name="pass" id="pass" value="<?php echo $pass; ?>" size="20" maxlength="64" /></td></tr> 
    61 <tr><th><label for="passconf"><?php __("Confirm password"); ?></label></th><td><input type="password" class="int" name="passconf" id="passconf" value="<?php echo $passconf; ?>" size="20" maxlength="64" /></td></tr> 
    62 <tr><th><label for="dir"><?php __("Folder"); ?></label></th><td><input type="text" class="int" name="dir" id="dir" value="<?php echo $dir; ?>" size="20" maxlength="255" /> 
    63 <script type="text/javascript"> 
    64 <!-- 
    65   document.write("&nbsp;<input type=\"button\" name=\"bff\" onclick=\"browseforfolder('main.dir');\" value=\" ... \" class=\"inb\">"); 
    66 //  --> 
    67 </script> 
    68 </td></tr> 
    69 <tr><td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Create this new FTP account."); ?>" /></td></tr> 
     61        <tr> 
     62                <th><input type="hidden" name="id" value="<?php echo $id ?>" /><label for="login"><?php __("Username"); ?></label></th> 
     63                <td><select class="inl" name="prefixe"><?php $ftp->select_prefix_list($prefixe); ?></select>&nbsp;<b>_</b>&nbsp;<input type="text" class="int" name="login" id="login" value="<?php echo $login; ?>" size="20" maxlength="64" /></td> 
     64        </tr> 
     65        <tr> 
     66                <th><label for="pass"><?php __("Password"); ?></label></th> 
     67                <td><input type="password" class="int" name="pass" id="pass" value="<?php echo $pass; ?>" size="20" maxlength="64" /></td> 
     68        </tr> 
     69        <tr> 
     70                <th><label for="passconf"><?php __("Confirm password"); ?></label></th> 
     71                <td><input type="password" class="int" name="passconf" id="passconf" value="<?php echo $passconf; ?>" size="20" maxlength="64" /></td> 
     72        </tr> 
     73        <tr> 
     74                <th><label for="dir"><?php __("Folder"); ?></label></th> 
     75                <td> 
     76                        <input type="text" class="int" name="dir" id="dir" value="<?php echo $dir; ?>" size="20" maxlength="255" /> 
     77                        <script type="text/javascript"> 
     78                        <!-- 
     79                                document.write("&nbsp;<input type=\"button\" name=\"bff\" onclick=\"browseforfolder('main.dir');\" value=\" ... \" class=\"inb\">"); 
     80                        //  --> 
     81                        </script> 
     82                        </td> 
     83        </tr> 
     84        <tr> 
     85                <td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Create this new FTP account."); ?>" /></td> 
     86        </tr> 
    7087</table> 
    7188</form> 
  • alternc/branches/franck-desktop/bureau/admin/ftp_del.php

    r102 r1803  
    3030require_once("../class/config.php"); 
    3131 
    32 $error=""; 
    3332// On parcours les POST_VARS et on repere les del_. 
    3433reset($_POST); 
  • alternc/branches/franck-desktop/bureau/admin/ftp_doadd.php

    r798 r1803  
    3030require_once("../class/config.php"); 
    3131 
     32$fields = array ( 
     33        "id"         => array ("request", "integer", 0), 
     34        "prefixe"    => array ("request", "string", ""), 
     35        "login"      => array ("request", "string", ""), 
     36        "pass"       => array ("request", "string", ""), 
     37        "passconf"   => array ("request", "string", ""), 
     38        "dir"        => array ("request", "string", ""), 
     39); 
     40getFields($fields); 
     41 
    3242if ($pass != $passconf) { 
    3343        $error = _("Passwords do not match"); 
  • alternc/branches/franck-desktop/bureau/admin/ftp_doedit.php

    r1797 r1803  
    3030require_once("../class/config.php"); 
    3131 
     32$fields = array ( 
     33        "id"         => array ("request", "integer", 0), 
     34        "prefixe"    => array ("request", "string", ""), 
     35        "login"      => array ("request", "string", ""), 
     36        "pass"       => array ("request", "string", ""), 
     37        "passconf"   => array ("request", "string", ""), 
     38        "rep"        => array ("request", "string", ""), 
     39); 
     40getFields($fields); 
     41 
    3242if (!$id) { 
    3343        $error=_("No account selected!"); 
     
    5666<div align="center"><h3><?php __("Editing an FTP account"); ?></h3></div> 
    5767<?php 
    58         if ($error) { 
    59                 echo "<p class=\"error\">$error</p>"; 
    60         } 
     68 
     69if ($error) 
     70{ 
     71        echo "<p class=\"error\">" . $error . "</p>"; 
     72} 
    6173?> 
    6274<script type="text/javascript"> 
  • alternc/branches/franck-desktop/bureau/admin/ftp_edit.php

    r1797 r1803  
    3333$fields = array ( 
    3434        "id"    => array ("request", "integer", ""), 
     35        "prefixe"    => array ("request", "string", ""), 
     36        "login"      => array ("request", "string", ""), 
     37        "pass"       => array ("request", "string", ""), 
     38        "passconf"   => array ("request", "string", ""), 
     39        "rep"        => array ("request", "string", ""), 
    3540); 
    3641getFields($fields); 
     
    4853<h3><?php __("Editing an FTP account"); ?></h3> 
    4954<?php 
    50         if ($error) { 
    51                 echo "<p class=\"error\">$error</p>"; 
    52                 include_once("foot.php"); 
    53                 exit(); 
    54         } 
     55 
     56if ($error) 
     57{ 
     58        echo "<p class=\"error\">" . $error . "</p>"; 
     59} 
     60 
    5561?> 
    5662<form method="post" action="ftp_doedit.php" name="main"> 
    5763<table border="1" cellspacing="0" cellpadding="4"> 
    58 <tr><th><input type="hidden" name="id" value="<?php echo $id ?>" /> 
    59 <label for="login"><?php __("Username"); ?></label></th><td> 
    60         <select class="inl" name="prefixe"><?php $ftp->select_prefix_list($r["prefixe"]); ?></select>&nbsp;<b>_</b>&nbsp;<input type="text" class="int" name="login" id="login" value="<?php echo $r["login"]; ?>" size="20" maxlength="64" /> 
    61 </td></tr> 
    62 <tr><th><label for="pass"><?php __("Password"); ?></label></th><td><input type="password" class="int" name="pass" id="pass" size="20" maxlength="64" value="********"/></td></tr> 
    63 <tr><th><label for="passconf"><?php __("Confirm password"); ?></label></th><td><input type="password" class="int" name="passconf" id="passconf" size="20" maxlength="64" value="********"/></td></tr> 
    64 <tr><th><label for="rep"><?php __("Folder"); ?></label></th><td><input type="text" class="int" name="rep" id="rep" value="<?php echo $r["dir"]; ?>" size="20" maxlength="64" /> 
    65  
    66 <script type="text/javascript"> 
    67 <!-- 
    68   document.write("&nbsp;<input type=\"button\" name=\"bff\" onclick=\"browseforfolder('main.rep');\" value=\" ... \" class=\"inb\">"); 
    69 //  --> 
    70 </script> 
    71 </td></tr> 
    72  
    73 <tr><td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Change this FTP account"); ?>" /></td></tr> 
     64        <tr> 
     65                <th><input type="hidden" name="id" value="<?php echo $id ?>" /><label for="login"><?php __("Username"); ?></label></th> 
     66                <td> 
     67                        <select class="inl" name="prefixe"><?php $ftp->select_prefix_list($r["prefixe"]); ?></select>&nbsp;<b>_</b>&nbsp;<input type="text" class="int" name="login" id="login" value="<?php echo $r["login"]; ?>" size="20" maxlength="64" /> 
     68                </td> 
     69        </tr> 
     70        <tr> 
     71                <th><label for="pass"><?php __("Password"); ?></label></th> 
     72                <td><input type="password" class="int" name="pass" id="pass" size="20" maxlength="64" value="********"/></td> 
     73        </tr> 
     74        <tr> 
     75                <th><label for="passconf"><?php __("Confirm password"); ?></label></th> 
     76                <td><input type="password" class="int" name="passconf" id="passconf" size="20" maxlength="64" value="********"/></td> 
     77        </tr> 
     78        <tr> 
     79                <th><label for="rep"><?php __("Folder"); ?></label></th> 
     80                <td> 
     81                        <input type="text" class="int" name="rep" id="rep" value="<?php echo $r["dir"]; ?>" size="20" maxlength="64" /> 
     82                        <script type="text/javascript"> 
     83                        <!-- 
     84                                document.write("&nbsp;<input type=\"button\" name=\"bff\" onclick=\"browseforfolder('main.rep');\" value=\" ... \" class=\"inb\">"); 
     85                        //  --> 
     86                        </script> 
     87                </td> 
     88        </tr> 
     89        <tr> 
     90                <td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Change this FTP account"); ?>" /></td> 
     91        </tr> 
    7492</table> 
    7593</form> 
  • alternc/branches/franck-desktop/bureau/admin/ftp_list.php

    r1797 r1803  
    6666<tr><th colspan="2">&nbsp;</th><th><?php __("Username"); ?></th><th><?php __("Folder"); ?></th></tr> 
    6767<?php 
     68 
    6869reset($r); 
    69 $col=1; 
    70 while (list($key,$val)=each($r)) 
    71         { 
    72         $col=3-$col; 
     70$col = 1; 
     71$i = 0; 
     72while (list($key, $val) = each($r)) 
     73{ 
     74        $col = 3 - $col; 
     75        $altImg = ($i % 2 == 0 ? "" : "alt"); 
     76        $i++; 
    7377?> 
    7478        <tr class="lst<?php echo $col; ?>"> 
    7579                <td align="center"><input type="checkbox" class="inc" id="del_<?php echo $val["id"]; ?>" name="del_<?php echo $val["id"]; ?>" value="<?php echo $val["id"]; ?>" /></td> 
    76                 <td class="center"><a href="ftp_edit.php?id=<?php echo $val["id"] ?>"><img src="images/edit.png" alt="<?php __("Edit"); ?>" /></a></td> 
     80                <td class="center"><a href="ftp_edit.php?id=<?php echo $val["id"] ?>"><img src="images/edit<?php echo $altImg; ?>.png" alt="<?php __("Edit"); ?>" /></a></td> 
    7781                <td><label for="del_<?php echo $val["id"]; ?>"><?php echo $val["login"] ?></label></td> 
    7882                <td><code>/<?php echo $val["dir"] ?></code></td> 
     
    8993<a href="ftp_add.php"><?php __("Create a new ftp account"); ?></a> 
    9094</p> 
    91 <?php   } 
     95<?php 
     96 
     97} 
    9298 
    9399$mem->show_help("ftp_list"); 
     100 
    94101?> 
    95102<script type="text/javascript"> 
  • alternc/branches/franck-desktop/bureau/admin/head.php

    r1797 r1803  
    3333<head> 
    3434<title>Bureau</title> 
     35<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
    3536<link rel="stylesheet" href="styles/style.css" type="text/css" /> 
    36 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
     37<link rel="stylesheet" href="styles/boxes.css" type="text/css" /> 
     38<script type="text/javascript" src="/admin/js/jquery.js"></script> 
    3739<script type="text/javascript" src="/admin/js/alternc.js"></script> 
    3840<script type="text/javascript" src="/admin/js/wz_dragdrop.js"></script> 
     
    4042<body> 
    4143<div id="global"> 
     44<?php startBox("mainBox"); ?> 
    4245<table> 
    4346<tr> 
  • alternc/branches/franck-desktop/bureau/admin/hta_add.php

    r1797 r1803  
    3131include_once("head.php"); 
    3232 
     33$fields = array ( 
     34        "value" => array ("request", "string", ""), 
     35); 
     36getFields($fields); 
     37 
    3338?> 
    3439<h3><?php __("Protect a folder"); ?></h3> 
  • alternc/branches/franck-desktop/bureau/admin/hta_adduser.php

    r1797 r1803  
    3939<h3><?php printf(_("Adding a username in %s"),$dir); ?></h3> 
    4040<?php 
    41         if ($error) { 
    42                 echo "<p class=\"error\">$error</p>"; 
    43         } 
     41 
     42if ($error) 
     43{ 
     44        echo "<p class=\"error\">" . $error . "</p>"; 
     45} 
     46 
    4447?> 
    45  
    4648<form method="post" action="hta_doadduser.php"> 
    4749<table border="1" cellspacing="0" cellpadding="4"> 
  • alternc/branches/franck-desktop/bureau/admin/hta_del.php

    r145 r1803  
    3030require_once("../class/config.php"); 
    3131 
    32 $error=""; 
    33 // On parcours les POST_VARS et on repere les del_. 
    34 reset($_POST); 
    35 while (list($key,$val)=each($_POST)) { 
    36         if (substr($key,0,4)=="del_") { 
    37                 // Effacement du dossier $val 
    38                 $r=$hta->DelDir($val); 
    39                 if (!$r) { 
    40                         $error.=$err->errstr()."<br />"; 
    41                 } else { 
    42                         $error.=sprintf(_("The protected folder %s has been successfully unprotected"),$val)."<br />"; 
    43                 } 
     32$fields = array ( 
     33        "d"    => array ("request", "array", array()), 
     34); 
     35getFields($fields); 
     36 
     37if (!is_array($d)) 
     38{ 
     39        $tmp = array($d); 
     40        $d = $tmp; 
     41} 
     42reset($d); 
     43 
     44while (list($key, $val) = each($d)) 
     45{ 
     46        $r = $hta->DelDir($val); 
     47        if (!$r) 
     48        { 
     49                $error .= $err->errstr() . "<br />"; 
     50        } 
     51        else 
     52        { 
     53                $error .= sprintf(_("The protected folder %s has been successfully unprotected"), $val) . "<br />"; 
    4454        } 
    4555} 
    46 include("hta_list.php"); 
     56 
     57include ("hta_list.php"); 
    4758exit(); 
     59 
    4860?> 
  • alternc/branches/franck-desktop/bureau/admin/hta_doadd.php

    r1 r1803  
    3030require_once("../class/config.php"); 
    3131 
     32$fields = array ( 
     33        "dir" => array ("request", "string", ""), 
     34); 
     35getFields($fields); 
    3236 
    33 if(!$hta->CreateDir($dir)) { 
    34         $error=$err->errstr(); 
    35         include("hta_add.php"); 
     37if(!$hta->CreateDir($dir)) 
     38{ 
     39        $error = $err->errstr(); 
     40        include ("hta_add.php"); 
    3641        exit(); 
    3742} 
    3843 
    39 include("hta_list.php"); 
     44include ("hta_list.php"); 
    4045exit(); 
    4146 
  • alternc/branches/franck-desktop/bureau/admin/hta_doadduser.php

    r798 r1803  
    3030require_once("../class/config.php"); 
    3131 
    32 if ($password != $passwordconf) { 
     32$fields = array ( 
     33        "password"      => array ("request", "string", ""), 
     34        "passwordconf"  => array ("request", "string", ""), 
     35        "user"          => array ("request", "string", ""), 
     36        "dir"           => array ("request", "string", ""), 
     37); 
     38getFields($fields); 
     39 
     40if ($password != $passwordconf) 
     41{ 
    3342        $error = _("Passwords do not match"); 
    34         include("hta_adduser.php"); 
    35         exit(); 
    36 } 
    37  
    38 if (!$password) { 
    39         $error=_("Please enter a password"); 
    4043        include ("hta_adduser.php"); 
    4144        exit(); 
    4245} 
    4346 
    44 if (!$hta->add_user($user, $password,$dir)) { 
    45         $error=$err->errstr(); 
     47if (!$password) 
     48{ 
     49        $error = _("Please enter a password"); 
    4650        include ("hta_adduser.php"); 
    47         } else { 
     51        exit(); 
     52} 
     53 
     54if (!$hta->add_user($user, $password, $dir)) 
     55{ 
     56        $error = $err->errstr(); 
     57        include ("hta_adduser.php"); 
     58} 
     59else 
     60{ 
    4861        include ("hta_edit.php"); 
    4962} 
     63 
    5064?> 
  • alternc/branches/franck-desktop/bureau/admin/hta_doedituser.php

    r1797 r1803  
    3838); 
    3939 
    40 if ($newpass != $newpassconf) { 
     40if ($newpass != $newpassconf) 
     41{ 
    4142        $error = _("Passwords do not match"); 
    42         include("hta_edituser.php"); 
     43        include ("hta_edituser.php"); 
    4344        exit(); 
    4445} 
    4546 
    46 if (!$hta->change_pass($user,$newpass,$dir)) { 
    47                 $error=$err->errstr(); 
     47if (!$hta->change_pass($user, $newpass, $dir)) 
     48{ 
     49        $error = $err->errstr(); 
    4850} 
    4951 
    5052?> 
    51 <h3><?php printf(_("Change the user %s in the protected folder %s"),$user,$dir); ?></h3> 
     53<h3><?php printf(_("Change the user %s in the protected folder %s"), $user, $dir); ?></h3> 
    5254<?php 
    53         if ($error) { 
    54                 echo "<p class=\"error\">$error</p>"; 
    55         } 
    56         else { 
    57                 echo "<p>".sprintf(_("The password of the user %s has been successfully changed"),$user)."</p>"; 
    58         } 
    59         echo "<p><a href=\"hta_edit?dir=$dir\">"._("Click here to continue")."</a></p>"; 
     55 
     56if ($error) 
     57{ 
     58        echo "<p class=\"error\">" . $error . "</p>"; 
     59} 
     60else 
     61{ 
     62        echo "<p>" . sprintf(_("The password of the user %s has been successfully changed"), $user) . "</p>"; 
     63} 
     64 
     65echo "<p><a href=\"hta_edit?dir=" . urlencode($dir) . "\">" . _("Click here to continue") . "</a></p>"; 
     66 
     67include_once("foot.php"); 
     68 
    6069?> 
    61 <?php include_once("foot.php"); ?> 
  • alternc/branches/franck-desktop/bureau/admin/hta_edit.php

    r1797 r1803  
    3636getFields($fields); 
    3737 
    38 if (!$dir) { 
    39         $error=_("No folder selected!"); 
    40 } else { 
    41         $r=$hta->get_hta_detail($dir); 
    42         if (!$r) { 
    43                 $error=$err->errstr(); 
     38if (!$dir) 
     39{ 
     40        $error = _("No folder selected!"); 
     41} 
     42else 
     43{ 
     44        $r = $hta->get_hta_detail($dir); 
     45        if (!$r) 
     46        { 
     47                $error = $err->errstr(); 
    4448        } 
    4549} 
     
    4852<h3><?php printf(_("List of authorized user in folder %s"),$dir); ?></h3> 
    4953<?php 
    50         if (!count($r)) { 
    51                 echo "<p class=\"error\">".sprintf(_("No authorized user in %s"),$dir)."</p>"; 
    52                 echo "<a href=\"hta_adduser.php?dir=$dir\">"._("Add a username")."</a><br />"; 
    53                 echo "<br /><small><a href=\"bro_main.php?R=$dir\">"._("File browser")."</a><br /></small>"; 
    54                 include_once("foot.php"); 
    55                 exit(); 
    56         } 
     54 
     55if (!count($r)) 
     56{ 
     57        echo "<p class=\"error\">" . sprintf(_("No authorized user in %s"), $dir) . "</p>"; 
     58        echo "<a href=\"hta_adduser.php?dir=" . urlencode($dir) . "\">" . _("Add a username") . "</a><br />"; 
     59        echo "<br /><small><a href=\"bro_main.php?R=" . urlencode($dir) . "\">" . _("File browser") . "</a><br /></small>"; 
     60        include_once("foot.php"); 
     61        exit(); 
     62} 
    5763reset($r); 
    5864 
     
    6571        </tr> 
    6672<?php 
     73 
    6774$col=1; 
     75for ($i = 0; $i < count($r); $i++) 
     76{ 
     77        $col = 3 - $col; 
     78        $altImg = ($i % 2 == 0 ? "" : "alt"); 
    6879 
    69 for($i=0;$i<count($r);$i++){ 
    70         $col=3-$col; 
    7180?> 
    7281        <tr class="lst<?php echo $col; ?>"> 
    7382                <td align="center"><input type="checkbox" class="inc" name="d[]"" value="<?php echo $r[$i]?>" /></td> 
    74                 <td><a href="hta_edituser.php?user=<?php echo $r[$i]?>&amp;dir=<?php echo $dir?>"><img src="images/edit.png" alt="<?php __("Edit"); ?>" /></a></td> 
     83                <td><a href="hta_edituser.php?user=<?php echo $r[$i]?>&amp;dir=<?php echo $dir?>"><img src="images/edit<?php echo $altImg; ?>.png" alt="<?php __("Edit"); ?>" /></a></td> 
    7584                <td><?php echo $r[$i]; ?></td> 
    7685        </tr> 
    7786<?php 
     87 
    7888} 
     89 
    7990?> 
    80 <tr><td colspan="3"><input type="submit" class="inb" name="submit" value="<?php __("Delete the checked users"); ?>" /></td></tr> 
     91        <tr> 
     92                <td colspan="3"><input type="submit" class="inb" name="submit" value="<?php __("Delete the checked users"); ?>" /></td> 
     93        </tr> 
    8194</table> 
    8295</form> 
    8396 
    8497<p> 
    85 <a href="hta_adduser.php?dir=<?php echo $dir ?>"><?php __("Add a username"); ?></a> 
     98<a href="hta_adduser.php?dir=<?php echo urlencode($dir) ?>"><?php __("Add a username"); ?></a> 
    8699</p> 
    87100<p> 
    88 <small><a href="bro_main.php?R=<?php echo $dir ?>"><?php __("File browser"); ?></a></small> 
     101<small><a href="bro_main.php?R=<?php echo urlencode($dir) ?>"><?php __("File browser"); ?></a></small> 
    89102</p> 
    90103<?php include_once("foot.php"); ?> 
  • alternc/branches/franck-desktop/bureau/admin/hta_edituser.php

    r1797 r1803  
    3838 
    3939?> 
    40 <h3><?php printf(_("Editing user %s in the protected folder %s"),$user,$dir); ?></h3> 
     40<h3><?php printf(_("Editing user %s in the protected folder %s"), $user, $dir); ?></h3> 
    4141<?php 
    42         if ($error) { 
    43                 echo "<p class=\"error\">$error</p>"; 
    44         } 
     42 
     43if ($error) 
     44{ 
     45        echo "<p class=\"error\">" . $error . "</p>"; 
     46} 
     47 
    4548?> 
    4649<form method="post" action="hta_doedituser.php"> 
    4750<table border="1" cellspacing="0" cellpadding="4"> 
    48 <tr><td><input type="hidden" name="dir" value="<?php echo $dir ?>"> 
    49 <input type="hidden" name="user" value="<?php echo $user ?>"> 
    50 <?php __("Folder"); ?></td><td><code><?php echo $dir; ?></code></td></tr> 
    51 <tr><td><?php __("User"); ?></td><td><code><?php echo $user; ?></code></td></tr> 
    52 <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" /></td></tr> 
    53 <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> 
    54 <tr><td colspan="2"><input type="submit" class="inb" value="<?php __("Change the password"); ?>" /></td></tr> 
     51        <tr> 
     52                <td> 
     53                        <input type="hidden" name="dir" value="<?php echo $dir ?>"> 
     54                        <input type="hidden" name="user" value="<?php echo $user ?>"> 
     55                        <?php __("Folder"); ?> 
     56                </td> 
     57                <td><code><?php echo $dir; ?></code></td> 
     58        </tr> 
     59        <tr> 
     60                <td><?php __("User"); ?></td> 
     61                <td><code><?php echo $user; ?></code></td> 
     62        </tr> 
     63        <tr> 
     64                <td><label for="newpass"><?php __("New password"); ?></label></td> 
     65                <td><input type="password" class="int" name="newpass" id="newpass" value="" size="20" maxlength="64" /></td> 
     66        </tr> 
     67        <tr> 
     68                <td><label for="newpassconf"><?php __("Confirm password"); ?></label></td> 
     69                <td><input type="password" class="int" name="newpassconf" id="newpassconf" value="" size="20" maxlength="64" /></td> 
     70        </tr> 
     71        <tr> 
     72                <td colspan="2"><input type="submit" class="inb" value="<?php __("Change the password"); ?>" /></td> 
     73        </tr> 
    5574</table> 
    5675</form> 
    57 <?php include_once("foot.php"); ?> 
     76<?php 
     77 
     78include_once("foot.php"); 
     79 
     80?> 
  • alternc/branches/franck-desktop/bureau/admin/hta_list.php

    r1797 r1803  
    3131include_once("head.php"); 
    3232 
    33 if (!$r=$hta->ListDir()) { 
    34         $error=$err->errstr(); 
     33if (!$r = $hta->ListDir()) 
     34{ 
     35        $error = $err->errstr(); 
    3536} 
    36 else { 
     37else 
     38{ 
    3739        reset($r); 
    3840} 
     
    4143<h3><?php __("Protected folders list"); ?></h3> 
    4244<?php 
    43         if ($error) { 
    44                 echo "<p class=\"error\">$error</p>"; 
    45         } 
    4645 
    47         if (!is_array($r)) { 
    48                 echo "<p><a href=\"hta_add.php\">"._("Protect a folder")."</a><br />"; 
    49                 $mem->show_help("hta_list"); 
    50                 echo "</p>"; 
    51                 include_once("foot.php"); 
    52                 exit(); 
    53         } 
     46if ($error) 
     47{ 
     48        echo "<p class=\"error\">" . $error . "</p>"; 
     49} 
     50 
     51if (!is_array($r)) 
     52{ 
     53        echo "<p><a href=\"hta_add.php\">" . _("Protect a folder") . "</a><br />"; 
     54        $mem->show_help("hta_list"); 
     55        echo "</p>"; 
     56        include_once("foot.php"); 
     57        exit(); 
     58} 
    5459 
    5560?> 
     61<p> 
     62<?php 
    5663 
    57 <p> 
    58 <?php __("help_hta_list"); 
     64__("help_hta_list"); 
    5965$mem->show_help("hta_list2"); 
     66 
    6067?> 
    6168</p> 
     
    6370<form method="post" action="hta_del.php"> 
    6471<table cellspacing="0" cellpadding="4"> 
    65 <tr><th colspan="2">&nbsp;</th><th><?php __("Folder"); ?></th></tr> 
     72        <tr> 
     73                <th colspan="2">&nbsp;</th> 
     74                <th><?php __("Folder"); ?></th> 
     75        </tr> 
    6676<?php 
    67 $col=1; 
    6877 
     78$col = 1; 
    6979 
    70 for($i=0;$i<count($r);$i++){ 
    71         $col=3-$col; 
     80for ($i = 0; $i < count($r); $i++) 
     81{ 
     82        $col = 3 - $col; 
     83        $altImg = ($i % 2 == 0 ? "" : "alt"); 
     84 
    7285?> 
    7386        <tr  class="lst<?php echo $col; ?>"> 
    7487                <td align="center"><input type="checkbox" class="inc" name="del_<?php echo $r[$i] ?>" value="<?php echo $r[$i] ?>" /></td> 
    75                 <td><a href="hta_edit.php?dir=<?php echo $r[$i]?>"><img src="images/edit.png" alt="<?php __("Edit"); ?>" /></a></td> 
     88                <td><a href="hta_edit.php?dir=<?php echo $r[$i]?>"><img src="images/edit<?php echo $altImg; ?>.png" alt="<?php __("Edit"); ?>" /></a></td> 
    7689                <td><code><?php echo "$r[$i]"?></code></td> 
    7790        </tr> 
    78     <?php 
    79         } 
     91<?php 
     92 
     93} 
     94 
    8095?> 
    81 <tr><td colspan="3"><input type="submit" class="inb" name="submit" value="<?php __("Unprotect the checked folders"); ?>" /></td></tr> 
     96        <tr> 
     97                <td colspan="3"><input type="submit" class="inb" name="submit" value="<?php __("Unprotect the checked folders"); ?>" /></td> 
     98        </tr> 
    8299</table> 
    83100</form> 
  • alternc/branches/franck-desktop/bureau/admin/index.php

    r1797 r1803  
    3737 
    3838$H = getenv("HTTP_HOST"); 
     39 
    3940?> 
    4041<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
  • alternc/branches/franck-desktop/bureau/admin/js/alternc.js

    r1797 r1803  
    1010function deploy(menu) 
    1111{ 
    12         for (var i = 0; i < menulist.length; i++) 
     12//      for (var i = 0; i < menulist.length; i++) 
     13//      { 
     14//              if (checkObj(menulist[i])) 
     15//              { 
     16//                      var div_content = new getObj(menulist[i]); 
     17//                      var div_img = new getObj("img-" + menulist[i]); 
     18// 
     19//                      div_content.style.display = "none"; 
     20//                      div_img.obj.src = "/admin/images/plus.png"; 
     21//              } 
     22//      } 
     23 
     24        var divImg = new getObj("img-" + menu); 
     25 
     26        if ($("#" + menu).css("display") == "block") 
    1327        { 
    14                 if (checkObj(menulist[i])) 
    15                 { 
    16                         var div_content = new getObj(menulist[i]); 
    17                         var div_img = new getObj("img-" + menulist[i]); 
     28                $("#" + menu).animate({ 
     29                   height: 'toggle', opacity: 'hide' 
     30                }, "fast"); 
     31                divImg.obj.src = "/admin/images/plus.png"; 
     32        } 
     33        else 
     34        { 
     35                $("#" + menu).animate({ 
     36                   height: 'toggle', opacity: 'show' 
     37                }, "fast"); 
     38                divImg.obj.src = "/admin/images/minus.png"; 
     39        } 
    1840 
    19                         div_content.style.display = "none"; 
    20                         div_img.obj.src = "/admin/images/plus.png"; 
    21                 } 
    22         } 
     41        return; 
    2342 
    2443        if (menu == 0) 
     
    2645 
    2746        var div_content = new getObj(menu); 
    28         var div_img = new getObj("img-" + menu); 
     47        var divImg = new getObj("img-" + menu); 
    2948 
    3049        if (menu_opened == menu) 
    3150        { 
    32                 div_content.style.display = "none"; 
     51//              div_content.style.display = "none"; 
     52                $("#" + menu).animate({ 
     53                   height: 'toggle', opacity: 'hide' 
     54                }, "fast"); 
    3355                div_img.obj.src = "/admin/images/plus.png"; 
    3456                menu_opened = ""; 
     
    3658        else 
    3759        { 
    38                 div_content.style.display = "block"; 
    39                 div_img.obj.src = "/admin/images/minus.png"; 
     60//              div_content.style.display = "block"; 
     61                $("#" + menu).animate({ 
     62                   height: 'toggle', opacity: 'show' 
     63                }, "fast"); 
     64                div_img.obj.src = "/admin/images/minus.png"; 
    4065                menu_opened = menu; 
    4166        } 
     
    106131  } 
    107132} 
    108  
  • alternc/branches/franck-desktop/bureau/admin/login.php

    r1797 r1803  
    3030require_once("../class/config.php"); 
    3131 
    32 if (!$mem->checkid()) 
     32$fields = array ( 
     33        "username"  => array ("request", "string", ""), 
     34        "password"  => array ("request", "string", ""), 
     35        "restrictip" => array ("request", "integer", 0), 
     36); 
     37getFields($fields); 
     38 
     39if (!$mem->checkid($username, $password, $restrictip)) 
    3340{ 
    3441        $error = $err->errstr(); 
  • alternc/branches/franck-desktop/bureau/admin/mail_add.php

    r1797 r1803  
    3535        "domain"    => array ("request", "string", ""), 
    3636        "many"      => array ("request", "integer", 0), 
     37 
     38        "email"     => array ("request", "string", ""), 
     39        "pop"       => array ("request", "integer", 0), 
     40        "pass"      => array ("request", "string", ""), 
     41        "passconf"  => array ("request", "string", ""), 
     42        "alias"     => array ("request", "string", ""), 
    3743); 
    3844getFields($fields); 
    3945 
    4046?> 
    41 <h3><?php printf(_("Add a mail to the domain %s"),"http://$domain"); ?> : </h3> 
     47<h3><?php printf(_("Add a mail to the domain %s"),"http://$domain"); ?></h3> 
    4248<?php 
    4349if ($error) { 
     
    4854<form action="mail_doadd.php" method="post"> 
    4955<table border="1" cellspacing="0" cellpadding="4"> 
    50         <tr><td><input type="hidden" name="domain" value="<?php echo $domain ?>" /> 
    51 <label for="email"><?php __("Email address"); ?></label></td><td><input class="int" type="text" name="email" id="email" value="<?php echo $email ?>" size="20" maxlength="32" />@<?php echo $domain ?></td></tr> 
    52         <tr><td><label for="ispop"><?php __("Is it a POP account?"); ?></label></td><td><input id="ispop" class="inc" type="checkbox" name="pop" value="1" <?php if ($pop=="1") echo "checked=\"checked\""; ?> /></td></tr> 
    53         <tr><td><label for="pass"><?php __("POP password"); ?></label></td><td><input class="int" type="password" name="pass" id="pass" value="<?php echo $pass; ?>" size="20" maxlength="32" /></td></tr> 
    54         <tr><td><label for="passconf"><?php __("Confirm password"); ?></label></td><td><input class="int" type="password" name="passconf" id="passconf" value="<?php echo $pass; ?>" size="20" maxlength="32" /></td></tr> 
    55         <tr><td><label for="alias"><?php __("Other recipients"); ?></label></td><td>(<?php __("One email per line"); ?>)<br /><textarea class="int" cols="32" rows="5" name="alias" id="alias"><?php echo $alias; ?></textarea></td></tr> 
    56         <tr><td colspan="2"><input type="hidden" name="many" value="<?php echo intval($many); ?>" /><input type="submit" class="inb" name="submit" value="<?php __("Create this mailbox"); ?>" /></td></tr> 
     56        <tr> 
     57                <td><input type="hidden" name="domain" value="<?php echo $domain ?>" /> 
     58<label for="email"><?php __("Email address"); ?></label></td> 
     59                <td><input class="int" type="text" name="email" id="email" value="<?php echo $email ?>" size="20" maxlength="32" />@<?php echo $domain ?></td> 
     60        </tr> 
     61        <tr> 
     62                <td><label for="ispop"><?php __("Is it a POP account?"); ?></label></td> 
     63                <td><input id="ispop" class="inc" type="checkbox" name="pop" value="1" <?php if ($pop=="1") echo "checked=\"checked\""; ?> /></td> 
     64        </tr> 
     65        <tr> 
     66                <td><label for="pass"><?php __("POP password"); ?></label></td> 
     67                <td><input class="int" type="password" name="pass" id="pass" value="<?php echo $pass; ?>" size="20" maxlength="32" /></td> 
     68        </tr> 
     69        <tr> 
     70                <td><label for="passconf"><?php __("Confirm password"); ?></label></td> 
     71                <td><input class="int" type="password" name="passconf" id="passconf" value="<?php echo $pass; ?>" size="20" maxlength="32" /></td> 
     72        </tr> 
     73        <tr> 
     74                <td><label for="alias"><?php __("Other recipients"); ?></label></td> 
     75                <td>(<?php __("One email per line"); ?>)<br /><textarea class="int" cols="32" rows="5" name="alias" id="alias"><?php echo $alias; ?></textarea></td> 
     76        </tr> 
     77        <tr> 
     78                <td colspan="2"><input type="hidden" name="many" value="<?php echo intval($many); ?>" /><input type="submit" class="inb" name="submit" value="<?php __("Create this mailbox"); ?>" /></td> 
     79        </tr> 
    5780</table> 
    5881</form> 
  • alternc/branches/franck-desktop/bureau/admin/mail_del.php

    r1797 r1803  
    3030require_once("../class/config.php"); 
    3131 
     32include_once ("head.php"); 
     33 
     34$fields = array ( 
     35        "d"    => array ("request", "array", array()), 
     36); 
     37getFields($fields); 
     38 
    3239if (!is_array($d)) 
    3340{ 
    34         $d[] = $d; 
     41        $tmp = array($d); 
     42        $d = $tmp; 
    3543} 
    3644reset($d); 
    37  
    38 include_once ("head.php"); 
    3945 
    4046?> 
     
    5763<p><input type="submit" class="inb" name="submit" value="<?php __("Delete the selected mailboxes"); ?>" /> - <input type="button" name="cancel" id="cancel" onclick="window.history.go(-1);" class="inb" value="<?php __("Don't delete accounts and go back to the mail list"); ?>"/> 
    5864</p> 
     65</form> 
    5966 
    6067<script type="text/javascript"> 
  • alternc/branches/franck-desktop/bureau/admin/mail_doadd.php

    r1797 r1803  
    3030require_once("../class/config.php"); 
    3131 
    32 if ($pass != $passconf) { 
     32$fields = array ( 
     33        "domain"    => array ("request", "string", ""), 
     34        "many"      => array ("request", "integer", 0), 
     35 
     36        "email"     => array ("request", "string", ""), 
     37        "pop"       => array ("request", "integer", 0), 
     38        "pass"      => array ("request", "string", ""), 
     39        "passconf"  => array ("request", "string", ""), 
     40        "alias"     => array ("request", "string", ""), 
     41); 
     42getFields($fields); 
     43 
     44if ($pass != $passconf) 
     45{ 
    3346        $error = _("Passwords do not match"); 
    3447        include("mail_add.php"); 
     
    3649} 
    3750 
    38 if (!$mail->add_mail($domain,$email,$pop,$pass,$alias)) { 
    39         $error=$err->errstr(); 
    40         $addok=0; 
     51if (!$mail->add_mail($domain, $email, $pop, $pass, $alias)) 
     52{ 
     53        $error = $err->errstr(); 
     54        $addok = 0; 
    4155        include ("mail_add.php"); 
    42 } else { 
    43         $addok=1; 
    44         $error=sprintf (_("The mailbox <b>%s</b> has been successfully created"),"$email@$domain"); 
    45         if ($many) { 
    46                 unset($email,$pass,$alias); 
    47                 include("mail_add.php"); 
    48         } else { 
    49                 include("mail_list.php"); 
     56} 
     57else 
     58{ 
     59        $addok = 1; 
     60        $error = sprintf (_("The mailbox <b>%s</b> has been successfully created"),"$email@$domain"); 
     61        if ($many) 
     62        { 
     63                unset($_REQUEST["email"], $_REQUEST["pop"], $_REQUEST["pass"], $_REQUEST["passconf"], $_REQUEST["alias"]); 
     64                include ("mail_add.php"); 
     65        } 
     66        else 
     67        { 
     68                include ("mail_list.php"); 
    5069        } 
    5170        exit(); 
  • alternc/branches/franck-desktop/bureau/admin/mail_dodel.php

    r1797 r1803  
    3030require_once("../class/config.php"); 
    3131 
     32$fields = array ( 
     33        "d"    => array ("request", "array", array()), 
     34); 
     35getFields($fields); 
     36 
    3237if (!is_array($d)) 
    3338{ 
    34         $d[] = $d; 
     39        $tmp = array($d); 
     40        $d = $tmp; 
    3541} 
     42reset($d); 
    3643 
    3744include_once("head.php"); 
     
    4249<?php 
    4350 
    44 reset($d); 
    4551while (list($key, $val) = each($d)) 
    4652{ 
    4753        if (!$mail->del_mail($val)) 
    4854        { 
    49                 $error .= sprintf(_("The mailbox <b>%s</b> does not exist!") . "<br />", $val); 
     55                $error = sprintf(_("The mailbox <b>%s</b> does not exist!") . "<br />", $val); 
    5056                echo $error; 
    5157        } 
    5258        else 
    5359        { 
    54                 $error .= sprintf(_("The mailbox <b>%s</b> has been deleted!") . "<br />", $val); 
     60                $error = sprintf(_("The mailbox <b>%s</b> has been deleted!") . "<br />", $val); 
    5561                echo $error; 
    5662        } 
  • alternc/branches/franck-desktop/bureau/admin/mail_doedit.php

    r798 r1803  
    3030require_once("../class/config.php"); 
    3131 
    32 $error_edit=""; 
     32$error_edit = ""; 
    3333 
    34 if ($pass != $passconf) { 
     34$fields = array ( 
     35        "email"     => array ("request", "string", ""), 
     36        "domain"    => array ("request", "string", ""), 
     37        "pop"       => array ("request", "integer", 0), 
     38        "pass"      => array ("request", "string", ""), 
     39        "passconf"  => array ("request", "string", ""), 
     40        "alias"     => array ("request", "string", ""), 
     41); 
     42getFields($fields); 
     43 
     44if ($pass != $passconf) 
     45{ 
    3546        $error = _("Passwords do not match"); 
    3647        include ("mail_edit.php"); 
     
    3849} 
    3950 
    40 if (!$mail->put_mail_details($email,$pop,$pass,$alias)) { 
    41         $error_edit=$err->errstr(); 
    42             $addok=0; 
    43                 include ("mail_edit.php"); 
    44  
    45 } else { 
    46             $ok=sprintf(_("The mailbox <b>%s</b> has been successfully changed"),$email)."<br />"; 
    47             $addok=1; 
    48             $t=explode("@",$email); 
    49             $email=$t[0]; 
    50             $error=$ok; 
    51             include("mail_list.php"); 
    52             exit(); 
     51if (!$mail->put_mail_details($email, $pop, $pass, $alias)) 
     52{ 
     53        $error_edit = $err->errstr(); 
     54        $addok = 0; 
     55        include ("mail_edit.php"); 
     56} 
     57else 
     58{ 
     59        $ok = sprintf(_("The mailbox <b>%s</b> has been successfully changed"), $email) . "<br />"; 
     60        $addok = 1; 
     61        $t = explode("@", $email); 
     62        $email = $t[0]; 
     63        $error = $ok; 
     64        include ("mail_list.php"); 
     65        exit(); 
    5366} 
    5467?> 
  • alternc/branches/franck-desktop/bureau/admin/mail_edit.php

    r1797 r1803  
    3737getFields($fields); 
    3838 
    39 if (!$res=$mail->get_mail_details($email)) 
     39if (!$res = $mail->get_mail_details($email)) 
    4040{ 
    41         $error=$err->errstr(); 
     41        $error = $err->errstr(); 
    4242        echo $error; 
    4343} 
     
    4646 
    4747?> 
    48 <h3><?php printf(_("Edit a mailbox of the domain %s"),"http://$domain"); ?> : </h3> 
     48<h3><?php printf(_("Edit a mailbox of the domain %s"),"http://$domain"); ?></h3> 
    4949<?php 
    50 if ($error_edit) { 
    51         echo "<p class=\"error\">$error_edit</p>"; 
    52         $error_edit=""; 
    5350 
    54 } else { 
    55         $pop=$res["pop"]; 
    56         $pass=$res["password"]; 
    57         $alias=$res["alias"]; 
    58 } ?> 
     51if ($error) 
     52        echo "<p class=\"error\">" . $error . "</p>"; 
    5953 
     54if (isset($error_edit)) 
     55{ 
     56        echo "<p class=\"error\">" . $error_edit . "</p>"; 
     57        $error_edit = ""; 
     58 
     59} 
     60else 
     61{ 
     62        $pop = $res["pop"]; 
     63        $alias = $res["alias"]; 
     64 
     65} 
     66?> 
    6067<form action="mail_doedit.php" method="post"> 
    6168<table border="1" cellspacing="0" cellpadding="4"> 
    62         <tr><th colspan="2"><input type="hidden" name="email" value="<?php echo $email; ?>" /> 
    63 <input type="hidden" name="domain" value="<?php echo $domain; ?>" /> 
    64 <?php printf(_("Edit the mailbox %s"),$email); ?></th></tr> 
    65         <tr><td><label for="ispop"><?php __("Is it a POP account?"); ?></label></td><td><input id="ispop" type="checkbox" class="inc" name="pop" value="1" <?php if ($pop=="1") echo "checked=\"checked\""; ?> /></td></tr> 
    66         <tr><td><label for="pass"><?php __("POP password"); ?></label></td><td><input type="password" class="int" name="pass" id="pass" value="<?php echo $pass; ?>" size="20" maxlength="32" /></td></tr> 
    67         <tr><td><label for="passconf"><?php __("Confirm password"); ?></label></td><td><input type="password" class="int" name="passconf" id="passconf" value="<?php echo $pass; ?>" size="20" maxlength="32" /></td></tr> 
    68         <tr><td><label for="alias"><?php __("Other recipients"); ?></label></td><td>(<?php __("One email per line"); ?>)<br /><textarea class="int" cols="32" rows="5" name="alias" id="alias"><?php echo $alias; ?></textarea></td></tr> 
    69         <tr><td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Change this mailbox"); ?>" /></td></tr> 
     69        <tr> 
     70                <th colspan="2"> 
     71                        <input type="hidden" name="email" value="<?php echo $email; ?>" /> 
     72                        <input type="hidden" name="domain" value="<?php echo $domain; ?>" /> 
     73                        <?php printf(_("Edit the mailbox %s"), $email); ?> 
     74                </th> 
     75        </tr> 
     76        <tr> 
     77                <td><label for="ispop"><?php __("Is it a POP account?"); ?></label></td> 
     78                <td><input id="ispop" type="checkbox" class="inc" name="pop" value="1" <?php if ($pop == "1") echo "checked=\"checked\""; ?> /></td> 
     79        </tr> 
     80        <tr> 
     81                <td><label for="pass"><?php __("POP password"); ?></label></td> 
     82                <td><input type="password" class="int" name="pass" id="pass" value="" size="20" maxlength="32" /></td> 
     83        </tr> 
     84        <tr> 
     85                <td><label for="passconf"><?php __("Confirm password"); ?></label></td> 
     86                <td><input type="password" class="int" name="passconf" id="passconf" value="" size="20" maxlength="32" /></td> 
     87        </tr> 
     88        <tr> 
     89                <td><label for="alias"><?php __("Other recipients"); ?></label></td> 
     90                <td>(<?php __("One email per line"); ?>)<br /><textarea class="int" cols="32" rows="5" name="alias" id="alias"><?php echo $alias; ?></textarea></td> 
     91        </tr> 
     92        <tr> 
     93                <td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Change this mailbox"); ?>" /></td> 
     94        </tr> 
    7095</table> 
    7196</form> 
     
    7499</small></p> 
    75100<?php 
     101 
    76102} 
     103 
    77104?> 
    78105<script type="text/javascript"> 
  • alternc/branches/franck-desktop/bureau/admin/mail_list.php

    r1802 r1803  
    3838getFields($fields); 
    3939 
    40 if(!$domain) 
     40if (!$domain) 
    4141{ 
    4242        include("main.php"); 
     
    4444} 
    4545 
    46 if(!$res=$mail->enum_doms_mails($domain,1,$letter)) 
     46if (!$res = $mail->enum_doms_mails($domain, 1, $letter)) 
    4747{ 
    48   $error=$err->errstr(); 
     48        $error = $err->errstr(); 
    4949 
    5050?> 
    5151<h3><?php printf(_("Mailbox list of the domain %s"), $domain); ?></h3> 
    5252<?php 
    53 if ($error) { 
    54   echo "<p class=\"error\">$error</p>"; 
    55 } 
    56 echo "<p><a href=\"mail_add.php?domain=" . $domain . "\">".sprintf(_("Add a mailbox on <b>%s</b>"), $domain)."</a><br />"; 
    57 echo "   <a href=\"mail_add.php?many=1&amp;domain=" . $domain . "\">".sprintf(_("Add many mailboxes on <b>%s</b>"), $domain)."</a></p>"; 
     53 
     54        if ($error) 
     55                echo "<p class=\"error\">" . $error . "</p>"; 
     56 
     57        echo "<p><a href=\"mail_add.php?domain=" . $domain . "\">" . sprintf(_("Add a mailbox on <b>%s</b>"), $domain) . "</a><br />"; 
     58        echo "<a href=\"mail_add.php?many=1&amp;domain=" . $domain . "\">" . sprintf(_("Add many mailboxes on <b>%s</b>"), $domain) . "</a></p>"; 
    5859 
    5960} 
     
    6465<h3><?php printf(_("Mailbox list of the domain %s"), $domain); ?></h3> 
    6566<?php 
    66 if ($error) { 
    67   echo "<p class=\"error\">$error</p>"; 
    68 } 
    6967 
    70 echo "<p><a href=\"mail_add.php?domain=" . $domain . "\">".sprintf(_("Add a mailbox on <b>%s</b>"), $domain)."</a><br />"; 
    71 echo "   <a href=\"mail_add.php?many=1&amp;domain=" . $domain . "\">".sprintf(_("Add many mailboxes on <b>%s</b>"), $domain)."</a></p>"; 
     68        if ($error) 
     69                echo "<p class=\"error\">" . $error . "</p>"; 
    7270 
    73 if(!$letters=$mail->enum_doms_mails_letters($domain)) 
    74   $error=$err->errstr(); 
    75 else{ 
    76   for($i=0;$i<count($letters);$i++){ 
    77     $val=$letters[$i]; 
    78     echo "   <a href=\"mail_list.php?domain=$domain&amp;letter=$val\">$val&nbsp;</a>"; 
    79   } 
    80   echo "   <a href=\"mail_list.php?domain=$domain\">".sprintf(_("All"))."</a>"; 
    81 } 
     71        echo "<p><a href=\"mail_add.php?domain=" . $domain . "\">".sprintf(_("Add a mailbox on <b>%s</b>"), $domain)."</a><br />"; 
     72        echo "   <a href=\"mail_add.php?many=1&amp;domain=" . $domain . "\">".sprintf(_("Add many mailboxes on <b>%s</b>"), $domain)."</a></p>"; 
    8273 
     74        if (!$letters = $mail->enum_doms_mails_letters($domain)) 
     75                $error = $err->errstr(); 
     76        else 
     77        { 
     78                for ($i = 0; $i < count($letters); $i++) 
     79                { 
     80                        $val = $letters[$i]; 
     81                        echo "<a class=\"letter" . ($letter == $val ? " letterover" : "") . "\" href=\"mail_list.php?domain=" . $domain . "&amp;letter=" . $val . "\">" . strtoupper($val) . "</a>&nbsp;"; 
     82                } 
     83                echo "<a class=\"letter" . (empty($letter) ? " letterover" : "") . "\" href=\"mail_list.php?domain=" . $domain . "\">" . sprintf(_("All")) . "</a>"; 
     84        } 
    8385 
    8486?> 
     
    8688 
    8789<table cellspacing="0" cellpadding="4"> 
     90        <tr> 
     91                <th><input type="hidden" name="domain" value="<?php echo $domain ?>" /><?php __("Delete"); ?></th> 
     92                <th><?php __("Email address"); ?></th> 
     93                <th><?php __("Action"); ?></th> 
     94                <th><?php __("Size"); ?></th> 
     95        </tr> 
     96<?php 
    8897 
    89 <tr><th><input type="hidden" name="domain" value="<?php echo $domain ?>" /> 
    90 <?php __("Delete"); ?></th><th><?php __("Email address"); ?></th><th><?php __("Action"); ?></th><th><?php __("Size"); ?></th></tr> 
     98$totalSize = 0; 
     99$col = 1; 
     100for ($i = 0; $i < $res["count"]; $i++) 
     101{ 
     102        $col = 3 - $col; 
     103        $val = $res[$i]; 
     104        $altImg = ($i % 2 == 0 ? "" : "alt"); 
     105        $totalSize += intval($val["size"]); 
     106 
     107        echo "<tr class=\"lst" . $col . "\">"; 
     108        echo "<td align=\"center\"><input class=\"inc\" type=\"checkbox\" id=\"del_" . $i . "\" name=\"d[]\" value=\"" . $val["mail"] . "\" /></td>"; 
     109        echo "<td><label for=\"del_" . $i . "\">" . $val["mail"] . "</label></td>"; 
     110        echo "<td class=\"center\"><a href=\"mail_edit.php?email=" . urlencode($val["mail"]) . "&amp;domain=" . urlencode($domain) . "\"><img src=\"images/edit" . $altImg . ".png\" alt=\"" . _("Edit") . "\" /></a>&nbsp;<a href=\"mail_del.php?d[]=" . urlencode($val["mail"]) . "&amp;domain=" . urlencode($domain) . "\"><img src=\"images/delete" . $altImg . ".png\" alt=\"" . _("Delete") . "\" /></a></td>"; 
     111 
     112        if ($val["pop"]) 
     113                echo "<td>" . format_size($val["size"]) . "</td>"; 
     114        else 
     115                echo "<td>&nbsp;</td>"; 
     116 
     117        echo "</tr>"; 
     118} 
     119 
     120?> 
     121        <tr class="lst<?php echo (3 - $col); ?>"> 
     122                <td colspan="3" style="text-align: right; font-weight: bold;">Total</td> 
     123                <td><?php echo format_size($totalSize); ?></td> 
     124        </tr> 
     125        <tr> 
     126                <td colspan="4"><input type="submit" class="inb" name="submit" value="<?php __("Delete the selected mailboxes"); ?>" /></td> 
     127        </tr> 
     128</table> 
     129</form> 
    91130<?php 
    92 $col=1; 
    93 for($i=0;$i<$res["count"];$i++) { 
    94         $col=3-$col; 
    95         $val=$res[$i]; 
    96         echo "<tr class=\"lst$col\">"; 
    97         echo "<td align=\"center\"><input class=\"inc\" type=\"checkbox\" id=\"del_$i\" name=\"d[]\" value=\"".$val["mail"]."\" /></td> 
    98         <td><label for=\"del_$i\">".$val["mail"]."</label></td> 
    99         <td class=\"center\"><a href=\"mail_edit.php?email=".urlencode($val["mail"])."&amp;domain=".urlencode($domain)."\"><img src=\"images/edit.png\" alt=\""._("Edit")."\" /></a></td>"; 
    100         if ($val["pop"]) { 
    101                 echo "<td>".format_size($val["size"])."</td>"; 
    102         } else { 
    103                 echo "<td>&nbsp;</td>"; 
    104         } 
    105         echo "</tr>"; 
    106131 
    107132} 
    108 ?> 
    109 <tr><td colspan="5"><input type="submit" class="inb" name="submit" value="<?php __("Delete the selected mailboxes"); ?>" /></td></tr> 
    110 </table> 
    111 </form> 
    112133 
    113 <?php 
    114 } 
    115134?> 
    116135<script type="text/javascript"> 
  • alternc/branches/franck-desktop/bureau/admin/main.php

    r1797 r1803  
    3333 
    3434include_once("menu.php"); 
     35 
     36$mode = 0; 
    3537 
    3638// Show last login information : 
  • alternc/branches/franck-desktop/bureau/admin/mem_admin.php

    r1797 r1803  
    3131 
    3232$fields = array ( 
    33         "admlist"    => array ("request", "string", ""), 
     33        "admlist"    => array ("request", "integer", 0), 
    3434); 
    3535getFields($fields); 
    3636 
    37 if (!$mem->adminpref($admlist)) { 
    38         $error=$err->errstr(); 
    39 } else { 
    40         $error=_("Your administrator preferences has been successfully changed."); 
     37if (!$mem->adminpref($admlist)) 
     38{ 
     39        $error = $err->errstr(); 
     40} 
     41else 
     42{ 
     43        $error = _("Your administrator preferences has been successfully changed."); 
    4144} 
    4245 
     
    4649<h3><?php __("Admin preferences"); ?></h3> 
    4750<?php 
    48         if ($error) { 
    49                 echo "<p class=\"error\">$error</p>"; 
    50         } 
     51 
     52if ($error) 
     53{ 
     54        echo "<p class=\"error\">" . $error . "</p>"; 
     55} 
     56 
     57include_once("foot.php"); 
     58 
    5159?> 
    52 <script type="text/javascript"> 
    53 deploy("menu-adm"); 
    54 </script> 
    55 <?php include_once("foot.php"); ?> 
  • alternc/branches/franck-desktop/bureau/admin/mem_logout.php

    r1797 r1803  
    4242<body> 
    4343<h3 style="text-align: center"><?php __("Disconnected"); ?></h3> 
    44  
    4544<?php __("You have been logged out of your administration desktop."); ?><br /> 
    4645<a href="index.php"><?php __("Click here to log in"); ?></a> 
  • alternc/branches/franck-desktop/bureau/admin/mem_param.php

    r1797 r1803  
    3232include_once("head.php"); 
    3333 
    34 if ($help_setting) { 
     34$fields = array ( 
     35        "help_setting" => array ("request", "string", ""), 
     36        "showhelp"     => array ("request", "integer", 0), 
     37 
     38        "oldpass"      => array ("request", "string", ""), 
     39        "newpass"      => array ("request", "string", ""), 
     40        "newpass2"     => array ("request", "string", ""), 
     41 
     42        "newmail"      => array ("request", "string", ""), 
     43); 
     44getFields($fields); 
     45 
     46 
     47if ($help_setting) 
     48{ 
    3549        $mem->set_help_param($showhelp); 
    36         $error=_("Your help setting has been updated."); 
     50        $error = _("Your help setting has been updated."); 
    3751} 
    3852 
     
    4054<div align="center"><h3><?php __("Settings of your account"); ?></h3></div> 
    4155<?php 
    42         if ($error) { 
    43                 echo "<font color=red>$error</font>"; 
    44                 include_once("foot.php"); 
    45                 exit(); 
    46         } 
     56 
     57if ($error) 
     58{ 
     59        echo "<p class=\"error\">" . $error . "</p>"; 
     60        include_once ("foot.php"); 
     61        exit(); 
     62} 
     63 
    4764?> 
    4865<hr /> 
     
    5168<?php 
    5269 
    53 if (!$mem->user["canpass"]) { 
    54   __("You cannot change your password"); 
    55   echo "</p>"; 
     70if (!$mem->user["canpass"]) 
     71{ 
     72        __("You cannot change your password"); 
     73        echo "</p>"; 
     74} 
     75else 
     76{ 
     77        __("help_chg_passwd"); 
    5678 
    57 } else { 
    58  
    59  __("help_chg_passwd"); ?> 
     79?> 
    6080</p> 
    6181<form method="post" action="mem_passwd.php"> 
    6282<table border="1" cellspacing="0" cellpadding="4"> 
    63 <tr><th><?php __("Old password"); ?></th><td><input type="password" class="int" name="oldpass" value="<?php echo $oldpass; ?>" size="20" maxlength="128" /></td></tr> 
    64 <tr><th><?php __("New password"); ?> (1)</th><td><input type="password" class="int" name="newpass" value="<?php echo $newpass; ?>" size="20" maxlength="60" /></td></tr> 
    65 <tr><th><?php __("New password"); ?> (2)</th><td><input type="password" class="int" name="newpass2" value="<?php echo $newpass2; ?>" size="20" maxlength="61" /></td></tr> 
    66 <tr><td align="center" colspan="3"><input type="submit" class="inb" name="submit" value="<?php __("Change my password"); ?>" /></td></tr> 
     83        <tr> 
     84                <th><?php __("Old password"); ?></th> 
     85                <td><input type="password" class="int" name="oldpass" value="<?php echo $oldpass; ?>" size="20" maxlength="128" /></td> 
     86        </tr> 
     87        <tr> 
     88                <th><?php __("New password"); ?> (1)</th> 
     89                <td><input type="password" class="int" name="newpass" value="<?php echo $newpass; ?>" size="20" maxlength="60" /></td> 
     90        </tr> 
     91        <tr> 
     92                <th><?php __("New password"); ?> (2)</th> 
     93                <td><input type="password" class="int" name="newpass2" value="<?php echo $newpass2; ?>" size="20" maxlength="61" /></td> 
     94        </tr> 
     95        <tr> 
     96                <td align="center" colspan="3"><input type="submit" class="inb" name="submit" value="<?php __("Change my password"); ?>" /></td> 
     97        </tr> 
    6798</table> 
    6899</form> 
     
    71102<hr /> 
    72103<form method="post" action="mem_chgmail.php"> 
    73         <table border="1" cellspacing="0" cellpadding="4"> 
    74                 <tr><td colspan="2"><?php __("Change the email of the account"); ?><br /> 
    75                 <?php __("help_chg_mail"); ?></td></tr> 
    76                 <tr><th><?php __("Current mailbox"); ?></th><td><big><code><?php echo $mem->user["mail"]; ?></code></big></td></tr> 
    77                 <tr><th><?php __("New mailbox"); ?></th><td><input type="text" class="int" name="newmail" value="<?php echo $newmail; ?>" size="40" maxlength="128" /></td></tr> 
    78                 <tr><td style="text-align: center" colspan="3"><input type="submit" class="inb" name="submit" value="<?php __("Change my mail"); ?>" /></td></tr> 
    79         </table> 
     104<table border="1" cellspacing="0" cellpadding="4"> 
     105        <tr> 
     106                <td colspan="2"><?php __("Change the email of the account"); ?><br /><?php __("help_chg_mail"); ?></td> 
     107        </tr> 
     108        <tr> 
     109                <th><?php __("Current mailbox"); ?></th> 
     110                <td><big><code><?php echo $mem->user["mail"]; ?></code></big></td> 
     111        </tr> 
     112        <tr> 
     113                <th><?php __("New mailbox"); ?></th> 
     114                <td><input type="text" class="int" name="newmail" value="<?php echo $newmail; ?>" size="40" maxlength="128" /></td> 
     115        </tr> 
     116        <tr> 
     117                <td style="text-align: center" colspan="3"><input type="submit" class="inb" name="submit" value="<?php __("Change my mail"); ?>" /></td> 
     118        </tr> 
     119</table> 
    80120</form> 
    81121<p>&nbsp;</p> 
    82122<hr /> 
    83123<form method="post" action="mem_param.php"> 
    84         <table border="1" cellspacing="0" cellpadding="4"> 
    85                 <tr><td colspan="2"><?php __("Online help settings"); ?><br /> 
    86                 <?php __("help_help_settings"); ?></td></tr> 
    87                 <tr><th><label for="showhelp"><?php __("Do you want to see the help texts and links on each page?"); ?></label></th><td><input type="checkbox" class="inc" id="showhelp" name="showhelp" value="1" <?php if ($mem->get_help_param()) echo "checked=\"checked\""; ?> /></td></tr> 
    88                 <tr><td align="center" colspan="3"><input type="submit" class="inb" name="help_setting" value="<?php __("Change these settings"); ?>" /></td></tr> 
    89         </table> 
     124<table border="1" cellspacing="0" cellpadding="4"> 
     125        <tr> 
     126                <td colspan="2"><?php __("Online help settings"); ?><br /><?php __("help_help_settings"); ?></td> 
     127        </tr> 
     128        <tr> 
     129                <th><label for="showhelp"><?php __("Do you want to see the help texts and links on each page?"); ?></label></th> 
     130                <td><input type="checkbox" class="inc" id="showhelp" name="showhelp" value="1" <?php if ($mem->get_help_param()) echo "checked=\"checked\""; ?> /></td> 
     131        </tr> 
     132        <tr> 
     133                <td align="center" colspan="3"><input type="submit" class="inb" name="help_setting" value="<?php __("Change these settings"); ?>" /></td> 
     134        </tr> 
     135</table> 
    90136</form> 
    91137<p>&nbsp;</p> 
    92138<?php 
    93 if ($mem->user["su"]) { 
     139 
     140if ($mem->user["su"]) 
     141{ 
     142 
    94143?> 
    95144<hr /> 
     
    99148<form method="post" action="mem_admin.php"> 
    100149<table border="1" cellspacing="0" cellpadding="4"> 
    101 <tr><th><?php __("Members list view"); ?></th><td><select name="admlist" class="inl"> 
    102 <option value="0"<?php if ($mem->user["admlist"]==0) echo " selected=\"selected\""; ?>><?php __("Large view"); ?></option> 
    103 <option value="1"<?php if ($mem->user["admlist"]==1) echo " selected=\"selected\""; ?>><?php __("Short view"); ?></option> 
    104 </select></td></tr> 
    105 <tr><td align="center" colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Change my admin preferences"); ?>" /></td></tr> 
     150        <tr> 
     151                <th><?php __("Members list view"); ?></th> 
     152        <td> 
     153                <select name="admlist" class="inl"> 
     154                        <option value="0"<?php if ($mem->user["admlist"]==0) echo " selected=\"selected\""; ?>><?php __("Large view"); ?></option> 
     155                        <option value="1"<?php if ($mem->user["admlist"]==1) echo " selected=\"selected\""; ?>><?php __("Short view"); ?></option> 
     156                </select> 
     157                </td> 
     158        </tr> 
     159        <tr> 
     160                <td align="center" colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Change my admin preferences"); ?>" /></td> 
     161        </tr> 
    106162</table> 
    107163</form> 
  • alternc/branches/franck-desktop/bureau/admin/menu.php

    r1797 r1803  
    3030require_once("../class/config.php"); 
    3131 
     32$currentMenu = ""; 
     33$currentPage = end(explode("/", $_SERVER["PHP_SELF"])); 
     34if (ereg("^(dom|mail|ftp|sql|adm)", $currentPage, $regs)) 
     35        $currentMenu = "menu-" . $regs[1]; 
     36 
    3237?> 
    3338<h3>Menu <?php echo $mem->user["login"]; ?></h3> 
    3439 
    3540<div class="menu-box"> 
    36         <div class="menu-title"><img src="images/home.png" alt="Accueil / Informations" />&nbsp;<a href="main.php">Accueil / Informations</a></div> 
     41<div class="menu-top"></div> 
     42<div class="menu-title"><img src="images/home.png" alt="<?php echo _("Front page / Informations"); ?>" />&nbsp;<a href="main.php"><?php echo _("Front page / Informations"); ?></a></div> 
     43<div class="menu-bottom"></div> 
    3744</div> 
    3845<?php 
     
    5057?> 
    5158<script type="text/javascript"> 
    52 deploy(0); 
     59// deploy(0); 
    5360</script> 
    5461<p class="center"><a href="http://alternc.org"><img src="alternc.png" width="120" height="82" border="0" alt="AlternC" /></a> 
  • alternc/branches/franck-desktop/bureau/admin/menu_adm.php

    r1797 r1803  
    3535if ($mem->checkRight()) { ?> 
    3636<div class="menu-box"> 
     37<div class="menu-top"></div> 
    3738<div class="menu-title" onclick="javascript:deploy('menu-adm');"> 
    3839<script type="text/javascript"> 
    3940<!-- 
    40         document.write('<img src="images/plus.png" alt="" style="float: right; padding: 4px; border: 0px;" id="img-menu-adm" />'); 
     41        document.write('<img src="images/plus.png" alt="" class="imgDeploy" id="img-menu-adm" />'); 
    4142//--> 
    4243</script> 
    43 <img src="images/admin.png" alt="Administration" />&nbsp;<span style="color: red;">Administration</span></div> 
    44 <div class="menu-content" id ="menu-adm"> 
     44<img src="images/admin.png" alt="Administration" />&nbsp;<span style="color: red;">Administration</span> 
     45</div> 
     46<div class="menu-bottom"></div> 
     47<div class="menu-content" id="menu-adm" style="display: none;"> 
    4548<ul> 
    46 <li><a href="adm_list.php"><span style="color: red;"><?php __("Manage the members"); ?></span></a></li> 
    47 <li><a href="quotas_users.php?mode=4"><span style="color: red;"><?php __("Quotas utilisateurs"); ?></span></a></li> 
     49<li><a href="adm_list.php"><img src="images/members.png" alt="<?php __("Manage the members"); ?>" />&nbsp;<span style="color: red;"><?php __("Manage the members"); ?></span></a></li> 
     50<li><a href="adm_usersquota.php?mode=4"><img src="images/quotamenu.png" alt="<?php __("Quotas utilisateurs"); ?>" />&nbsp;<span style="color: red;"><?php __("Quotas utilisateurs"); ?></span></a></li> 
    4851<?php if ($cuid == 2000) { ?> 
    49 <li><a href="adm_panel.php"><span style="color: red;"><?php __("Admin Control Panel"); ?></span></a></li> 
    50 <li><a href="/admin/sql/?server=2"><span style="color: red;"><?php __("General SQL Admin"); ?></span></a></li> 
     52<li><a href="adm_panel.php"><img src="images/configure.png" alt="<?php __("Admin Control Panel"); ?>" />&nbsp;<span style="color: red;"><?php __("Admin Control Panel"); ?></span></a></li> 
     53<li><a href="/admin/sql/?server=2"><img src="images/mysqlmenu.png" alt="<?php __("General SQL Admin"); ?>" />&nbsp;<span style="color: red;"><?php __("General SQL Admin"); ?></span></a></li> 
    5154<?php } ?> 
    5255</ul> 
  • alternc/branches/franck-desktop/bureau/admin/menu_aide.php

    r1797 r1803  
    3030?> 
    3131<div class="menu-box"> 
     32<div class="menu-top"></div> 
    3233<div class="menu-title"><img src="images/help.png" alt="<?php __("Online help"); ?>" />&nbsp;<a href="http://doc.alternc.org/user/" target="help"><?php __("Online help"); ?></a></div> 
     34<div class="menu-bottom"></div> 
    3335</div> 
  • alternc/branches/franck-desktop/bureau/admin/menu_aws.php

    r1797 r1803  
    3636?> 
    3737<div class="menu-box"> 
     38<div class="menu-top"></div> 
    3839<div class="menu-title"><img src="images/stat.png" alt="<?php __("Web Statistics"); ?>" />&nbsp;<a href="aws_list.php"><?php __("Web Statistics"); ?></a> (<?= $q["u"]; ?>/<?= $q["t"]; ?>)</div> 
     40<div class="menu-bottom"></div> 
    3941</div> 
    4042<?php } ?> 
  • alternc/branches/franck-desktop/bureau/admin/menu_brouteur.php

    r1797 r1803  
    3232?> 
    3333<div class="menu-box"> 
     34<div class="menu-top"></div> 
    3435<div class="menu-title"><img src="images/folder.png" alt="<?php __("File browser"); ?>" />&nbsp;<a href="bro_main.php"><?php __("File browser"); ?></a></div> 
     36<div class="menu-bottom"></div> 
    3537</div> 
  • alternc/branches/franck-desktop/bureau/admin/menu_dom.php

    r1797 r1803  
    3737?> 
    3838<div class="menu-box"> 
    39 <div class="menu-title" id="test" onclick="javascript:deploy('menu-dom');"> 
     39<div class="menu-top"></div> 
     40<div class="menu-title" onclick="javascript:deploy('menu-dom');"> 
    4041<script type="text/javascript"> 
    4142<!-- 
    42         document.write('<img src="images/plus.png" alt="" style="float: right; padding: 4px; border: 0px;" id="img-menu-dom" />'); 
     43        document.write('<img src="images/plus.png" alt="" class="imgDeploy" id="img-menu-dom" />'); 
    4344//--> 
    4445</script> 
    4546<img src="images/dom.png" alt="<?php __("Domains"); ?>" />&nbsp;<?php __("Domains"); ?> (<?= $q["u"]; ?>/<?= $q["t"]; ?>)</div> 
    46 <div class="menu-content" id="menu-dom"> 
     47<div class="menu-bottom"></div> 
     48<div class="menu-content" id="menu-dom" style="display: none;"> 
    4749<ul> 
    4850<?php if ($quota->cancreate("dom")) { ?> 
  • alternc/branches/franck-desktop/bureau/admin/menu_ftp.php

    r1797 r1803  
    3333$q = $quota->getquota("ftp"); 
    3434 
    35 if ($q["t"] > 0) {  
     35if ($q["t"] > 0) { 
    3636 
    3737?> 
    3838<div class="menu-box"> 
     39<div class="menu-top"></div> 
    3940<div class="menu-title" onclick="javascript:deploy('menu-ftp');"> 
    4041<script type="text/javascript"> 
    4142<!-- 
    42         document.write('<img src="images/plus.png" alt="" style="float: right; padding: 4px; border: 0px;" id="img-menu-ftp" />'); 
     43        document.write('<img src="images/plus.png" alt="" class="imgDeploy" id="img-menu-ftp" />'); 
    4344//--> 
    4445</script> 
    45 <img src="images/ftp.png" alt="<?php __("FTP accounts"); ?>" />&nbsp;<?php __("FTP accounts"); ?> <?php if (!$quota->cancreate("ftp")) { echo '<span class="full">'; } ?>(<?= $q["u"]; ?>/<?= $q["t"]; ?>)<?php if (!$quota->cancreate("ftp")) { echo '</span>'; } ?></div> 
    46 <div class="menu-content" id="menu-ftp"> 
     46<img src="images/ftp.png" alt="<?php __("FTP accounts"); ?>" />&nbsp;<?php __("FTP accounts"); ?>&nbsp;<?php if (!$quota->cancreate("ftp")) { echo '<span class="full">'; } ?>(<?php echo $q["u"]; ?>/<?php echo $q["t"]; ?>)<?php if (!$quota->cancreate("ftp")) { echo '</span>'; } ?></div> 
     47<div class="menu-bottom"></div> 
     48<div class="menu-content" id="menu-ftp" style="display: none;"> 
    4749<ul> 
    4850<?php if ($quota->cancreate("ftp")) { ?> 
  • alternc/branches/franck-desktop/bureau/admin/menu_mail.php

    r1797 r1803  
    3737?> 
    3838<div class="menu-box"> 
     39<div class="menu-top"></div> 
    3940<div class="menu-title" onclick="javascript:deploy('menu-mail');"> 
    4041<script type="text/javascript"> 
    4142<!-- 
    42         document.write('<img src="images/plus.png" alt="" style="float: right; padding: 4px; border: 0px;" id="img-menu-mail" />'); 
     43        document.write('<img src="images/plus.png" alt="" class="imgDeploy" id="img-menu-mail" />'); 
    4344//--> 
    4445</script> 
    4546<img src="images/mail.png" alt="<?php __("Mailboxes"); ?>" />&nbsp;<?php __("Mailboxes"); ?> (<?= $q["u"]; ?>/<?= $q["t"]; ?>)</div> 
    46 <div class="menu-content" id="menu-mail"> 
     47<div class="menu-bottom"></div> 
     48<div class="menu-content" id="menu-mail" style="display: none;"> 
    4749<ul> 
    4850<?php 
    49          
     51 
    5052/* Enumeration des domaines en mail : */ 
    5153$domain = $mail->enum_domains(); 
     
    5355while (list($key, $val) = each($domain)) { 
    5456$res = $mail->enum_doms_mails($val, 1); 
    55          
     57 
    5658?> 
    5759        <li><a href="mail_list.php?domain=<?php echo urlencode($val) ?>"><?php echo $val ?> (<?= $res["count"]; ?>)</a></li> 
  • alternc/branches/franck-desktop/bureau/admin/menu_mailman.php

    r1797 r1803  
    3232$q = $quota->getquota("mailman"); 
    3333 
    34 if (isset($q["t"]) && $q["t"] > 0) {  
     34if (isset($q["t"]) && $q["t"] > 0) { 
    3535?> 
    3636<div class="menu-box"> 
     37<div class="menu-top"></div> 
    3738<div class="menu-title"><img src="images/mailman.png" alt="<?php __("Mailing lists"); ?>" />&nbsp;<a href="mman_list.php"><?php __("Mailing lists"); ?></a> (<?= $q["u"]; ?>/<?= $q["t"]; ?>)<br /><small><?php __("(with mailman)"); ?></small></div> 
     39<div class="menu-bottom"></div> 
    3840</div> 
    3941<?php } ?> 
  • alternc/branches/franck-desktop/bureau/admin/menu_mem.php

    r1797 r1803  
    3030?> 
    3131<div class="menu-box"> 
     32<div class="menu-top"></div> 
    3233<div class="menu-title"><img src="images/config.png" alt="<?php __("Settings"); ?>" />&nbsp;<a href="mem_param.php"><?php __("Settings"); ?></a></div> 
     34<div class="menu-bottom"></div> 
    3335</div> 
    3436<div class="menu-box"> 
     37<div class="menu-top"></div> 
    3538<div class="menu-title"><img src="images/exit.png" alt="<?php __("Logout"); ?>" />&nbsp;<a href="mem_logout.php" target="_parent"><?php __("Logout"); ?></a></div> 
     39<div class="menu-bottom"></div> 
    3640</div> 
  • alternc/branches/franck-desktop/bureau/admin/menu_quota.php

    r1797 r1803  
    3030?> 
    3131<div class="menu-box"> 
     32<div class="menu-top"></div> 
    3233<div class="menu-title"><img src="images/quota.png" alt="<?php __("Show my quotas"); ?>" />&nbsp;<a href="quota_show.php"><?php __("Show my quotas"); ?></a></div> 
     34<div class="menu-bottom"></div> 
    3335</div> 
  • alternc/branches/franck-desktop/bureau/admin/menu_sql.php

    r1797 r1803  
    3232?> 
    3333<div class="menu-box"> 
     34<div class="menu-top"></div> 
    3435<div class="menu-title" onclick="javascript:deploy('menu-sql');"> 
    3536<script type="text/javascript"> 
    3637<!-- 
    37         document.write('<img src="images/plus.png" alt="" style="float: right; padding: 4px; border: 0px;" id="img-menu-sql" />'); 
     38        document.write('<img src="images/plus.png" alt="" class="imgDeploy" id="img-menu-sql" />'); 
    3839//--> 
    3940</script> 
    4041<img src="images/mysql.png" alt="MySQL" />&nbsp;MySQL (<?= $q["u"]; ?>/<?= $q["t"]; ?>)</div> 
    41 <div class="menu-content" id="menu-sql"> 
     42<div class="menu-bottom"></div> 
     43<div class="menu-content" id="menu-sql" style="display: none;"> 
    4244<ul> 
    4345<li><a href="sql_users_list.php"><?php __("MySQL Users") ?></a></li> 
  • alternc/branches/franck-desktop/bureau/admin/menu_sta2.php

    r1797 r1803  
    3535?> 
    3636<div class="menu-box"> 
     37<div class="menu-top"></div> 
    3738<div class="menu-title"><img src="images/stat.png" alt="<?php __("Raw web statistics"); ?>" />&nbsp;<a href="sta2_list.php"><?php __("Raw web statistics"); ?></a> (<?= $q["u"]; ?>/<?= $q["t"]; ?>)</div> 
     39<div class="menu-bottom"></div> 
    3840</div> 
    3941<?php } ?> 
  • alternc/branches/franck-desktop/bureau/admin/menu_web.php

    r1797 r1803  
    3232?> 
    3333<div class="menu-box"> 
     34<div class="menu-top"></div> 
    3435<div class="menu-title"><img src="images/password.png" alt="<?php __("Protected folders"); ?>" />&nbsp;<a href="hta_list.php"><?php __("Protected folders"); ?></a></div> 
     36<div class="menu-bottom"></div> 
    3537</div> 
  • alternc/branches/franck-desktop/bureau/admin/menu_webalizer.php

    r1797 r1803  
    3535?> 
    3636<div class="menu-box"> 
     37<div class="menu-top"></div> 
    3738<div class="menu-title"><img src="images/stat.png" alt="<?php __("Web Statistics"); ?>" />&nbsp;<a href="webalizer_list.php"><?php __("Web Statistics"); ?></a></div> 
     39<div class="menu-bottom"></div> 
    3840</div> 
    3941<?php } ?> 
  • alternc/branches/franck-desktop/bureau/admin/mman_add.php

    r1797 r1803  
    3131include_once("head.php"); 
    3232 
    33 if (!$quota->cancreate("mailman")) { 
    34         $error=$err->errstr(); 
     33if (!$quota->cancreate("mailman")) 
     34{ 
     35        $error = $err->errstr(); 
    3536} 
     37 
     38$fields = array ( 
     39        "id"          => array ("request", "integer", 0), 
     40        "login"       => array ("request", "string", ""), 
     41        "domain"      => array ("request", "string", ""), 
     42        "owner"       => array ("request", "string", ""), 
     43        "pass"        => array ("request", "string", ""), 
     44); 
     45getFields($fields); 
    3646 
    3747?> 
    3848<h3><?php __("Mailing lists"); ?></h3> 
    3949<?php 
    40         if ($error) { 
    41                 echo "<p class=\"error\">$error</p>"; 
    42                 include_once("foot.php"); 
    43                 exit(); 
    44         } 
     50 
     51if ($error) 
     52{ 
     53        echo "<p class=\"error\">" . $error . "</p>"; 
     54        include_once("foot.php"); 
     55        exit(); 
     56} 
     57 
    4558?> 
    4659<form method="post" action="mman_doadd.php"> 
    4760<input type="hidden" name="id" value="<?php echo $id ?>" /> 
    4861<table> 
    49 <tr><th><label for="login"><?php __("Email address"); ?></label></th><td> 
    50         <input type="text" class="int" id="login" name="login" value="<?php echo $login; ?>" size="20" maxlength="64" /><b>&nbsp;@&nbsp;</b><select class="inl" name="domain"><?php $mailman->select_prefix_list($domain); ?></select> 
    51 </td></tr> 
    52 <tr><th><label for="owner"><?php __("Owner"); ?> *</label></th><td> 
    53         Email : <input type="text" class="int" id="owner" name="owner" value="<?php echo $owner; ?>" size="20" maxlength="64" /> 
    54         </td></tr> 
    55 <tr><th><label for="pass"><?php __("Initial list password"); ?> </label></th><td> 
    56         <input type="text" class="int" id="pass" name="pass" value="<?php echo $pass; ?>" size="20" maxlength="64" /> 
    57         </td></tr> 
    58 <tr><td colspan="2"> 
    59   <input type="submit" class="inb" name="submit" value="<?php __("Create the list."); ?>"/> 
    60 </td></tr> 
     62        <tr> 
     63                <th><label for="login"><?php __("Email address"); ?></label></th> 
     64                <td> 
     65                        <input type="text" class="int" id="login" name="login" value="<?php echo $login; ?>" size="20" maxlength="64" /><b>&nbsp;@&nbsp;</b><select class="inl" name="domain"><?php $mailman->select_prefix_list($domain); ?></select> 
     66                </td> 
     67        </tr> 
     68        <tr> 
     69        <th><label for="owner"><?php __("Owner"); ?> *</label></th> 
     70                <td> 
     71                        Email : <input type="text" class="int" id="owner" name="owner" value="<?php echo $owner; ?>" size="20" maxlength="64" /> 
     72                </td> 
     73                </tr> 
     74        <tr> 
     75                <th><label for="pass"><?php __("Initial list password"); ?> </label></th> 
     76                <td> 
     77                        <input type="text" class="int" id="pass" name="pass" value="<?php echo $pass; ?>" size="20" maxlength="64" /> 
     78                </td> 
     79        </tr> 
     80        <tr> 
     81                <td colspan="2"> 
     82                        <input type="submit" class="inb" name="submit" value="<?php __("Create the list."); ?>"/> 
     83                </td> 
     84        </tr> 
    6185</table> 
    6286</form> 
  • alternc/branches/franck-desktop/bureau/admin/mman_del.php

    r1797 r1803  
    3030require_once("../class/config.php"); 
    3131 
    32 $stchange=(!$quota->cancreate("mailman")); 
     32$stchange = (!$quota->cancreate("mailman")); 
    3333 
    34 $error=""; 
    35 // On parcours les POST_VARS et on repere les del_. 
    36 reset($_POST); 
    37 while (list($key,$val)=each($_POST)) { 
    38         if (substr($key,0,4)=="del_") { 
    39                 // Effacement de la ml $val 
    40                 $r=$mailman->delete_lst($val); 
    41                 if (!$r) { 
    42                         $error.=$err->errstr()."<br>"; 
    43                 } else { 
    44                         $error.=sprintf(_("The list %s has been successfully deleted."),$r)."<br>"; 
    45                 } 
    46         } 
     34$fields = array ( 
     35        "d"    => array ("request", "array", array()), 
     36); 
     37getFields($fields); 
     38 
     39if (!is_array($d)) 
     40{ 
     41        $tmp = array($d); 
     42        $d = $tmp; 
    4743} 
    48 include("mman_list.php"); 
     44reset($d); 
     45 
     46if (empty($d)) 
     47{ 
     48        include ("mman_list.php"); 
     49        exit(); 
     50} 
     51 
     52include_once ("head.php"); 
     53 
     54?> 
     55<h3><?php __("Deleting mailman lists"); ?></h3> 
     56<p><?php __("Please confirm the deletion of the following mailman lists:"); ?></p> 
     57<form action="mman_dodel.php" method="post"> 
     58<?php 
     59 
     60foreach ($d as $id) 
     61{ 
     62        echo "<input type=\"hidden\" name=\"d[]\" value=\"" . $id . "\" />"; 
     63        echo $mailman->get_lst($id) . "<br />"; 
     64} 
     65 
     66?> 
     67<p><input type="submit" class="inb" name="confirm" value="<?php __("Delete the selected mailman lists"); ?>" /> - <input type="submit" name="cancel" id="cancel" class="inb" value="<?php __("Don't delete lists and go back to the mailman list"); ?>" /> 
     68</p> 
     69</form> 
     70<?php 
     71 
     72include_once ("foot.php"); 
    4973exit(); 
     74 
    5075?> 
  • alternc/branches/franck-desktop/bureau/admin/mman_doadd.php

    r1797 r1803  
    3030require_once("../class/config.php"); 
    3131 
    32 $r=$mailman->add_lst($domain,$login,$owner,$pass); 
    33 if (!$r) { 
    34         $error=$err->errstr(); 
    35         include("mman_add.php"); 
    36         exit(); 
    37 } else { 
    38         $error=_("The mailing list has been successfully created."); 
    39         include("mman_list.php"); 
     32$fields = array ( 
     33        "id"          => array ("request", "string", ""), 
     34        "login"       => array ("request", "string", ""), 
     35        "domain"      => array ("request", "string", ""), 
     36        "owner"       => array ("request", "string", ""), 
     37        "pass"        => array ("request", "string", ""), 
     38); 
     39getFields($fields); 
     40 
     41$r = $mailman->add_lst($domain, $login, $owner, $pass); 
     42if (!$r) 
     43{ 
     44        $error = $err->errstr(); 
     45        include ("mman_add.php"); 
    4046        exit(); 
    4147} 
     48else 
     49{ 
     50        $error = _("The mailing list has been successfully created."); 
     51        include ("mman_list.php"); 
     52        exit(); 
     53} 
     54 
    4255?> 
  • alternc/branches/franck-desktop/bureau/admin/mman_list.php

    r1797 r1803  
    6666                ?> 
    6767                <tr class="lst<?php echo $col; ?>"> 
    68                         <td align="center"><input type="checkbox" class="inc" name="del_<?php echo $val["id"]; ?>" value="<?php echo $val["id"]; ?>" /></td> 
     68                        <td align="center"><input type="checkbox" class="inc" name="d[]" value="<?php echo $val["id"]; ?>" /></td> 
    6969                        <td><?php echo $val["list"]."@".$val["domain"] ?></td> 
    7070                        <td>&nbsp;<a href="https://<?php echo $val["domain"]; ?>/cgi-bin/mailman/listinfo/<?php echo $val["name"] ?>"><?php __("Public page"); ?></a>&nbsp;</td> 
  • alternc/branches/franck-desktop/bureau/admin/mman_members.php

    r1797 r1803  
    3030require_once("../class/config.php"); 
    3131 
     32$fields = array ( 
     33        "id"          => array ("request", "integer", 0), 
     34); 
     35getFields($fields); 
     36 
    3237header("content-type: text/plain"); 
    3338header("content-disposition: attachment; filename=list.txt"); 
  • alternc/branches/franck-desktop/bureau/admin/quota_show.php

    r1797 r1803  
    3232 
    3333?> 
    34 <h3><?php __("Account's quotas"); ?> : </h3> 
     34<h3><?php __("Account's quotas"); ?></h3> 
    3535<?php 
    3636$q=$quota->getquota(); 
  • alternc/branches/franck-desktop/bureau/admin/quota_show_all.php

    r1797 r1803  
    4848} 
    4949 
     50$class = ""; 
     51 
    5052$class = ($class== 'lst1' ? 'lst2' : 'lst1'); 
    5153echo "<table><tr class=\"$class\">"; 
     
    7981                $error = $err->errstr(); 
    8082        } 
     83        $quota_utilise = array(); 
     84        $tot = array(); 
    8185        foreach($sequence as $key) 
    8286        { 
     87                if (!isset($quota_utilise[$key])) 
     88                        $quota_utilise[$key] = 0; 
     89 
     90                if (!isset($tot[$key])) 
     91                        $tot[$key] = 0; 
     92 
    8393                $q = $quots[$key]; 
    8494                if ($q['u'] > $q['t']) 
  • alternc/branches/franck-desktop/bureau/admin/quotas_users.php

    r1797 r1803  
    2626</p> 
    2727<p> 
    28 <a href="quotas_users.php?mode=4">Global</a><br /><br /> 
     28<a href="adm_usersquota.php?mode=4">Global</a><br /><br /> 
    2929Détail: 
    3030<?php if ($mode==0) { ?> 
    31 <a href="quotas_users.php?mode=1&amp;sd=<?php echo $sd; ?>&amp;usr=<?php echo $usr; ?>">En pourcentage</a> 
    32 <a href="quotas_users.php?mode=2&amp;sd=<?php echo $sd; ?>&amp;usr=<?php echo $usr; ?>">En graphique</a> 
     31<a href="adm_usersquota.php?mode=1&amp;sd=<?php echo $sd; ?>&amp;usr=<?php echo $usr; ?>">En pourcentage</a> 
     32<a href="adm_usersquota.php?mode=2&amp;sd=<?php echo $sd; ?>&amp;usr=<?php echo $usr; ?>">En graphique</a> 
    3333   <?php } elseif ($mode==1) { ?> 
    34 <a href="quotas_users.php?mode=0&amp;sd=<?php echo $sd; ?>&amp;usr=<?php echo $usr; ?>">En Mo</a> 
    35 <a href="quotas_users.php?mode=2&amp;sd=<?php echo $sd; ?>&amp;usr=<?php echo $usr; ?>">En graphique</a> 
     34<a href="adm_usersquota.php?mode=0&amp;sd=<?php echo $sd; ?>&amp;usr=<?php echo $usr; ?>">En Mo</a> 
     35<a href="adm_usersquota.php?mode=2&amp;sd=<?php echo $sd; ?>&amp;usr=<?php echo $usr; ?>">En graphique</a> 
    3636   <?php } else { ?> 
    37 <a href="quotas_users.php?mode=0&amp;sd=<?php echo $sd; ?>&amp;usr=<?php echo $usr; ?>">En Mo</a> 
    38 <a href="quotas_users.php?mode=1&amp;sd=<?php echo $sd; ?>&amp;usr=<?php echo $usr; ?>">En pourcentage</a> 
     37<a href="adm_usersquota.php?mode=0&amp;sd=<?php echo $sd; ?>&amp;usr=<?php echo $usr; ?>">En Mo</a> 
     38<a href="adm_usersquota.php?mode=1&amp;sd=<?php echo $sd; ?>&amp;usr=<?php echo $usr; ?>">En pourcentage</a> 
    3939 <?php } ?> 
    4040 
    4141<?php if ($mode != 4) { ?> 
    4242<?php if ($usr==0) { if ($sd==0) { ?> 
    43 <a href="quotas_users.php?mode=<?php echo $mode; ?>&amp;sd=1&amp;usr=<?php echo $usr; ?>">Afficher les domaines</a> 
     43<a href="adm_usersquota.php?mode=<?php echo $mode; ?>&amp;sd=1&amp;usr=<?php echo $usr; ?>">Afficher les domaines</a> 
    4444   <?php } else { ?> 
    45 <a href="quotas_users.php?mode=<?php echo $mode; ?>&amp;sd=0&amp;usr=<?php echo $usr; ?>">Cacher les domaines</a> 
     45<a href="adm_usersquota.php?mode=<?php echo $mode; ?>&amp;sd=0&amp;usr=<?php echo $usr; ?>">Cacher les domaines</a> 
    4646 <?php } } ?> 
    4747<?php if ($usr) { ?> 
    48 <a href="quotas_users.php?mode=<?php echo $mode; ?>&amp;sd=<? echo $sd; ?>">Tous les comptes</a> 
     48<a href="adm_usersquota.php?mode=<?php echo $mode; ?>&amp;sd=<? echo $sd; ?>">Tous les comptes</a> 
    4949<?php } ?> 
    5050<?php } ?> 
     
    249249 
    250250  // On affiche le compte et ses domaines : 
    251   echo "<b><a href=\"quotas_users.php?mode=".$mode."&sd=".$sd."&usr=".$c["uid"]."\">".$c["login"]."</a></b><br />\n"; 
     251  echo "<b><a href=\"adm_usersquota.php?mode=".$mode."&sd=".$sd."&usr=".$c["uid"]."\">".$c["login"]."</a></b><br />\n"; 
    252252  $s=mysql_query("SELECT * FROM domaines WHERE compte='".$c["uid"]."';"); 
    253253  $dc=0; // Domain Count 
  • alternc/branches/franck-desktop/bureau/admin/sql_add.php

    r1797 r1803  
    3131include_once("head.php"); 
    3232 
    33 if (!$quota->cancreate("mysql")) { 
    34         $error=_("err_mysql_1"); 
    35         $fatal=1; 
     33if (!$quota->cancreate("mysql")) 
     34{ 
     35        $error = _("err_mysql_1"); 
     36        $fatal = 1; 
    3637} 
     38 
     39$fields = array ( 
     40        "dbn" => array ("request", "string", ""), 
     41); 
     42getFields($fields); 
    3743 
    3844?> 
    3945<h3><?php __("Create a new database"); ?></h3> 
    4046<?php 
    41         if ($error) { 
    42                 echo "<p class=\"error\">$error</p>"; 
    43                 if ($fatal) { 
    44                         include_once("foot.php"); 
    45                         exit(); 
    46                 } 
     47 
     48if ($error) 
     49{ 
     50        echo "<p class=\"error\">" . $error . "</p>"; 
     51        if (isset($fatal)) 
     52        { 
     53                include_once("foot.php"); 
     54                exit(); 
    4755        } 
     56} 
     57 
    4858?> 
    4959<form method="post" action="sql_doadd.php" id="main"> 
    5060<table border="1" cellspacing="0" cellpadding="4"> 
    51 <tr><th><label for="dbn"><?php __("Database"); ?></label></th><td> 
    52         <?php echo $mem->user["login"]; ?>&nbsp;<b>_</b>&nbsp;<input type="text" class="int" name="dbn" id="dbn" value="<?php echo $dbn; ?>" size="20" maxlength="30" /> 
    53 </td></tr> 
    54 <tr><td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Create this new database."); ?>" /></td></tr> 
     61        <tr> 
     62                <th><label for="dbn"><?php __("Database"); ?></label></th> 
     63                <td> 
     64                        <?php echo $mem->user["login"]; ?>&nbsp;<b>_</b>&nbsp;<input type="text" class="int" name="dbn" id="dbn" value="<?php echo $dbn; ?>" size="20" maxlength="30" /> 
     65                </td> 
     66        </tr> 
     67        <tr> 
     68                <td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Create this new database."); ?>" /></td> 
     69        </tr> 
    5570</table> 
    5671</form> 
  • alternc/branches/franck-desktop/bureau/admin/sql_del.php

    r1797 r1803  
    3131include_once ("head.php"); 
    3232 
    33 if ($confirm=="y") { 
    34   reset($_POST); 
    35   while (list($key,$val)=each($_POST)) { 
    36     if (substr($key,0,4)=="del_") { 
    37       // Effacement de la base $val 
    38       $r=$mysql->del_db($val); 
    39       if (!$r) { 
    40         $error.=$err->errstr()."<br />"; 
    41       } else { 
    42         $error.=sprintf(_("The database %s has been successfully deleted"),$mem->user["login"].(($val)?"_":"").$val)."<br />"; 
    43       } 
    44     } 
    45   } 
    46   include("sql_list.php"); 
    47   exit(); 
     33$fields = array ( 
     34        "confirm" => array ("request", "string", ""), 
     35        "cancel"  => array ("request", "string", ""), 
     36        "d"       => array ("request", "array", array()), 
     37); 
     38getFields($fields); 
     39 
     40if ($cancel) 
     41{ 
     42        include ("sql_list.php"); 
     43        exit(); 
     44} 
     45 
     46if ($confirm == "y") 
     47{ 
     48        foreach ($d as $val) 
     49        { 
     50                $r = $mysql->del_db($val); 
     51                if (!$r) 
     52                { 
     53                        $error .= $err->errstr() . "<br />"; 
     54                } 
     55                else 
     56                { 
     57                        $error .= sprintf(_("The database %s has been successfully deleted"), $mem->user["login"] . (($val) ? "_" : "") . $val) . "<br />"; 
     58                } 
     59        } 
     60 
     61        include ("sql_list.php"); 
     62        exit(); 
    4863} 
    4964 
    5065?> 
    5166<h3><?php __("MySQL Databases"); ?></h3> 
    52 <p class="error"><?php __("WARNING"); ?></big><br /><?php __("Confirm the deletion of the following SQL databases"); ?><br /> 
     67<p class="error"><?php __("WARNING"); ?><br /><?php __("Confirm the deletion of the following SQL databases"); ?><br /> 
    5368<?php __("This will delete all the tables currently in those db."); ?></p> 
    5469<form method="post" action="sql_del.php" id="main"> 
     
    5671<input type="hidden" name="confirm" value="y" /> 
    5772<?php 
    58 reset($_POST); 
    59 while (list($key,$val)=each($_POST)) { 
    60   if (substr($key,0,4)=="del_") { 
    61     echo "<input type=\"hidden\" name=\"$key\" value=\"$val\" />".$mem->user["login"].(($val)?"_":"")."$val<br />\n"; 
    62   } 
     73 
     74foreach ($d as $val) 
     75{ 
     76        echo "<input type=\"hidden\" name=\"d[]\" value=\"" . $val . "\" />" . $mem->user["login"] . (($val) ? "_" : "") . $val . "<br />\n"; 
    6377} 
    6478 
    6579?> 
    6680<br /> 
    67 <input type="submit" class="inb" name="sub" value="<?php __("Yes"); ?>" /> - <input type="button" class="inb" name="non" value="<?php __("No"); ?>" onclick="history.back()" /> 
     81<input type="submit" class="inb" name="sub" value="<?php __("Yes"); ?>" /> - <input type="submit" class="inb" name="cancel" value="<?php __("No"); ?>" /> 
    6882</p> 
    6983</form> 
     84<script type="text/javascript"> 
     85deploy("menu-sql"); 
     86</script> 
    7087<?php include_once("foot.php"); ?>> 
  • alternc/branches/franck-desktop/bureau/admin/sql_doadd.php

    r104 r1803  
    3030require_once("../class/config.php"); 
    3131 
     32$fields = array ( 
     33        "dbn" => array ("request", "string", ""), 
     34); 
     35getFields($fields); 
    3236 
    33 if (!$quota->cancreate("mysql")) { 
    34         $error=_("err_mysql_1"); 
    35         include("sql_add.php"); 
     37if (!$quota->cancreate("mysql")) 
     38{ 
     39        $error = _("err_mysql_1"); 
     40        include ("sql_add.php"); 
    3641        exit; 
    3742} 
    3843 
    39 if (!$mysql->add_db($dbn)) { 
    40   $error=$err->errstr(); 
    41   include("sql_add.php"); 
     44if (!$mysql->add_db($dbn)) 
     45{ 
     46  $error = $err->errstr(); 
     47  include ("sql_add.php"); 
    4248  exit; 
    4349} 
  • alternc/branches/franck-desktop/bureau/admin/sql_getparam.php

    r1797 r1803  
    3131include_once("head.php"); 
    3232 
    33 if (!$r=$mysql->get_dblist()) { 
    34         $error=$err->errstr(); 
     33if (!$r = $mysql->get_dblist()) 
     34{ 
     35        $error = $err->errstr(); 
    3536} 
    3637 
     
    3839<h3><?php __("MySQL Databases"); ?></h3> 
    3940<?php 
    40         if ($error) { 
    41                 echo "<p class=\"error\">$error</p><p>&nbsp;</p>"; 
    42         } 
     41 
     42if ($error) 
     43{ 
     44        echo "<p class=\"error\">" . $error . "</p><p>&nbsp;</p>"; 
     45} 
    4346 
    4447?> 
  • alternc/branches/franck-desktop/bureau/admin/sql_list.php

    r1797 r1803  
    3131include_once("head.php"); 
    3232 
    33 $r=$mysql->get_dblist(); 
     33$r = $mysql->get_dblist(); 
    3434 
    3535?> 
    3636<h3><?php __("MySQL Databases"); ?></h3> 
    3737<?php 
    38         if ($error) { 
    39                 echo "<p class=\"error\">$error</p><p>&nbsp;</p>"; 
    40         } 
    4138 
    42 if ($r) { 
     39if ($error) 
     40{ 
     41        echo "<p class=\"error\">" . $error . "</p><p>&nbsp;</p>"; 
     42} 
    4343 
    44 echo "<p>"._("help_sql_list_ok")."</p>"; 
     44if ($r) 
     45{ 
     46        echo "<p>" . _("help_sql_list_ok") . "</p>"; 
     47 
    4548?> 
    46  
    4749<form method="post" action="sql_del.php"> 
    4850<table cellspacing="0" cellpadding="4"> 
    49    <tr><th>&nbsp;</th><th><?php __("Database"); ?></th><th><?php __("Backup"); ?></th><th><?php __("Restore"); ?></th><th><?php __("Size"); ?></th></tr> 
     51        <tr> 
     52                <th>&nbsp;</th> 
     53                <th><?php __("Database"); ?></th> 
     54                <th><?php __("Backup"); ?></th> 
     55                <th><?php __("Restore"); ?></th> 
     56                <th><?php __("Size"); ?></th> 
     57        </tr> 
     58<?php 
    5059 
    51 <?php 
    52 $col=1; 
    53 for($i=0;$i<count($r);$i++) { 
    54   $val=$r[$i]; 
    55  $col=3-$col; 
     60$col = 1; 
     61for($i = 0; $i < count($r); $i++) 
     62{ 
     63        $val = $r[$i]; 
     64        $col = 3 - $col; 
     65 
    5666?> 
    5767        <tr  class="lst<?php echo $col; ?>"> 
    58                 <td align="center"><input type="checkbox" class="inc" id="del_<?php echo $val["name"]; ?>" name="del_<?php echo $val["name"]; ?>" value="<?php echo $val["name"]; ?>" /></td> 
    59            <td><label for="del_<?php echo $val["name"]; ?>"><?php echo $val["db"]; ?></label></td> 
     68                <td align="center"><input type="checkbox" class="inc" id="del_<?php echo $val["name"]; ?>" name="d[]" value="<?php echo $val["name"]; ?>" /></td> 
     69                <td><label for="del_<?php echo $val["name"]; ?>"><?php echo $val["db"]; ?></label></td> 
    6070                <td><a href="sql_bck.php?id=<?php echo $val["name"] ?>"><?php __("Backup"); ?></a></td> 
    6171                <td><a href="sql_restore.php?id=<?php echo $val["name"] ?>"><?php __("Restore"); ?></a></td> 
     
    6474<?php 
    6575 
     76} 
    6677 
    67  } 
    6878?> 
    69 <tr><td colspan="5"> 
    70    <input type="submit" name="sub" value="<?php __("Delete the checked databases"); ?>" class="inb" /> 
    71 </td></tr> 
     79        <tr> 
     80                <td colspan="5"> 
     81                        <input type="submit" name="sub" value="<?php __("Delete the checked databases"); ?>" class="inb" /> 
     82                </td> 
     83        </tr> 
    7284</table> 
    7385</form> 
     
    7587<p>&nbsp;</p> 
    7688<p> 
    77 <?php if ($quota->cancreate("mysql")) { ?> 
    78  <a href="sql_add.php"><?php __("Create a new database"); ?></a><br /><br /> 
    79 <?php } ?> 
     89<?php 
     90 
     91if ($quota->cancreate("mysql")) 
     92{ 
     93 
     94?> 
     95<a href="sql_add.php"><?php __("Create a new database"); ?></a><br /><br /> 
     96<?php 
     97 
     98} 
     99 
     100?> 
    80101<a href="sql_passchg.php"><?php __("Change the SQL password"); ?></a><br /><br /> 
    81102<a href="sql_getparam.php"><?php __("Get the current SQL parameters"); ?></a><br /><br /> 
     103</p> 
     104<?php 
    82105 
    83 </p> 
    84  
    85 <?php 
    86         } else { 
    87   echo "<p>"._("help_sql_list_no")."</p>"; 
     106} 
     107else 
     108{ 
     109        echo "<p>" . _("help_sql_list_no") . "</p>"; 
    88110 
    89111?> 
    90112<form method="post" action="sql_addmain.php"> 
    91113<table cellspacing="0" cellpadding="4"> 
    92                 <tr  class="lst2"><th><?php __("Username"); ?></th><td><code><?php echo $mem->user["login"]; ?></code></td></tr> 
    93                 <tr  class="lst1"><th><label for="pass"><?php __("Password"); ?></label></th><td><code><input class="int" type="password" name="pass" id="pass" value="" /></code></td></tr> 
    94                 <tr  class="lst2"><th><?php __("SQL Server"); ?></th><td><code><?php echo $mysql->server; ?></code></td></tr> 
    95                 <tr  class="lst1"><th><?php __("Database"); ?></th><td><code><?php echo $mem->user["login"]; ?></code></td></tr> 
    96         <tr><td><input type="submit" class="inb" name="submit" value="<?php __("Create my main database"); ?>" /></td></tr> 
     114        <tr class="lst2"> 
     115                <th><?php __("Username"); ?></th> 
     116                <td><code><?php echo $mem->user["login"]; ?></code></td> 
     117        </tr> 
     118        <tr class="lst1"> 
     119                <th><label for="pass"><?php __("Password"); ?></label></th> 
     120                <td><code><input class="int" type="password" name="pass" id="pass" value="" /></code></td> 
     121        </tr> 
     122        <tr class="lst2"> 
     123                <th><?php __("SQL Server"); ?></th> 
     124                <td><code><?php echo $mysql->server; ?></code></td> 
     125        </tr> 
     126        <tr class="lst1"> 
     127                <th><?php __("Database"); ?></th> 
     128                <td><code><?php echo $mem->user["login"]; ?></code></td> 
     129        </tr> 
     130        <tr> 
     131                <td><input type="submit" class="inb" name="submit" value="<?php __("Create my main database"); ?>" /></td> 
     132        </tr> 
    97133</table> 
    98134</form> 
  • alternc/branches/franck-desktop/bureau/admin/sql_pass.php

    r876 r1803  
    3030require_once("../class/config.php"); 
    3131 
     32$fields = array ( 
     33        "pass" => array ("request", "string", ""), 
     34); 
     35getFields($fields); 
    3236 
    33 if (!$mysql->put_mysql_details($pass)) { 
    34         $error=$err->errstr(); 
    35         include("sql_passchg.php"); 
    36         exit(); 
    37 } else { 
    38         $error=_("Your password has been successfully changed."); 
    39         include("sql_list.php"); 
     37if (!$mysql->put_mysql_details($pass)) 
     38{ 
     39        $error = $err->errstr(); 
     40        include ("sql_passchg.php"); 
    4041        exit(); 
    4142} 
     43else 
     44{ 
     45        $error = _("Your password has been successfully changed."); 
     46        include ("sql_list.php"); 
     47        exit(); 
     48} 
     49 
    4250?> 
  • alternc/branches/franck-desktop/bureau/admin/sql_passchg.php

    r1797 r1803  
    3131include_once("head.php"); 
    3232 
    33 if (!$r=$mysql->get_dblist()) { 
    34         $error=$err->errstr(); 
     33if (!$r = $mysql->get_dblist()) 
     34{ 
     35        $error = $err->errstr(); 
    3536} 
     37 
     38$fields = array ( 
     39        "pass" => array ("request", "string", ""), 
     40); 
     41getFields($fields); 
    3642 
    3743?> 
    3844<h3><?php __("MySQL Databases"); ?></h3> 
    3945<?php 
    40         if ($error) { 
    41                 echo "<p class=\"error\">$error</p><p>&nbsp;</p>"; 
    42         } 
    4346 
    44 echo "<p>"._("Enter the new password of your SQL database and click 'change the password' to change it")."</p>"; 
     47if ($error) 
     48{ 
     49        echo "<p class=\"error\">" . $error . "</p><p>&nbsp;</p>"; 
     50} 
     51 
     52echo "<p>" . _("Enter the new password of your SQL database and click 'change the password' to change it") . "</p>"; 
     53 
    4554?> 
    46  
    4755<form method="post" action="sql_pass.php"> 
    4856<table cellspacing="0" cellpadding="4"> 
    49                 <tr class="lst2"><th><?php __("Username"); ?></th><td><code><?php echo $mem->user["login"]; ?></code></td></tr> 
    50                 <tr class="lst1"><th><label for="pass"><?php __("Password"); ?></label></th><td><code><input class="int" type="password" name="pass" id="pass" value="" /></code></td></tr> 
    51                 <tr class="lst2"><th><?php __("SQL Server"); ?></th><td><code><?php echo $mysql->server; ?></code></td></tr> 
    52                 <tr class="lst1"><th><?php __("Database"); ?></th><td><code><?php echo $r[0]["db"]; ?></code></td></tr> 
    53         <tr><td><input type="submit" class="inb" name="submit" value="<?php __("Change the password"); ?>" /></td></tr> 
     57        <tr class="lst2"> 
     58                <th><?php __("Username"); ?></th> 
     59                <td><code><?php echo $mem->user["login"]; ?></code></td> 
     60        </tr> 
     61        <tr class="lst1"> 
     62                <th><label for="pass"><?php __("Password"); ?></label></th> 
     63                <td><code><input class="int" type="password" name="pass" id="pass" value="" /></code></td> 
     64        </tr> 
     65        <tr class="lst2"> 
     66                <th><?php __("SQL Server"); ?></th> 
     67                <td><code><?php echo $mysql->server; ?></code></td> 
     68        </tr> 
     69        <tr class="lst1"> 
     70                <th><?php __("Database"); ?></th> 
     71                <td><code><?php echo $r[0]["db"]; ?></code></td></tr> 
     72        <tr> 
     73                <td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Change the password"); ?>" /></td> 
     74        </tr> 
    5475</table> 
    5576</form> 
  • alternc/branches/franck-desktop/bureau/admin/sql_users_add.php

    r1797 r1803  
    3131include_once("head.php"); 
    3232 
    33 if (!$quota->cancreate("mysql_users")) { 
    34         $error=_("err_mysql_20"); 
    35         $fatal=1; 
     33$fields = array ( 
     34        "usern"        => array ("request", "string", ""), 
     35); 
     36getFields($fields); 
     37 
     38if (!$quota->cancreate("mysql_users")) 
     39{ 
     40        $error = _("err_mysql_20"); 
     41        $fatal = 1; 
    3642} 
    3743 
     
    3945<h3><?php __("Create a new MySQL user"); ?></h3> 
    4046<?php 
    41         if ($error) { 
    42                 echo "<p class=\"error\">$error</p>"; 
    43                 if ($fatal) { 
     47 
     48if ($error) 
     49{ 
     50        echo "<p class=\"error\">" . $error . "</p>"; 
     51        if (isset($fatal)) 
     52        { 
     53 
    4454?> 
    4555<script type="text/javascript"> 
     
    4858<?php include_once("foot.php"); ?> 
    4959<?php 
    50                         exit(); 
    51                 } 
     60 
     61                exit(); 
    5262        } 
     63} 
     64 
    5365?> 
    5466<form method="post" action="sql_users_doadd.php" id="main"> 
     
    5668<tr> 
    5769  <th><label for="usern"><?php __("Username"); ?></label></th> 
    58   <td><?php echo $mem->user["login"]; ?>&nbsp;<b>_</b>&nbsp;<input type="text" class="int" name="usern" id="usern" value="" size="20" maxlength="30" /></td> 
     70  <td><?php echo $mem->user["login"]; ?>&nbsp;<b>_</b>&nbsp;<input type="text" class="int" name="usern" id="usern" value="<?php echo $usern; ?>" size="20" maxlength="30" /></td> 
    5971</tr> 
    6072<tr> 
  • alternc/branches/franck-desktop/bureau/admin/sql_users_del.php

    r1797 r1803  
    3030require_once("../class/config.php"); 
    3131 
    32 if ($confirm=="y") { 
    33   reset($_POST); 
    34   while (list($key,$val)=each($_POST)) { 
    35     if (substr($key,0,4)=="del_") { 
    36       // Effacement de la base $val 
    37       $r=$mysql->del_user($val); 
    38       if (!$r) { 
    39         $error.=$err->errstr()."<br />"; 
    40       } else { 
    41         $error.=sprintf(_("The user %s has been successfully deleted"),$mem->user["login"]."_$val")."<br />"; 
    42       } 
    43     } 
    44   } 
    45   include("sql_users_list.php"); 
    46   exit(); 
     32$fields = array ( 
     33        "confirm"           => array ("request", "string", ""), 
     34        "cancel"            => array ("request", "string", ""), 
     35        "d"                 => array ("request", "array", array()), 
     36); 
     37getFields($fields); 
     38 
     39if ($cancel) 
     40{ 
     41        include ("sql_users_list.php"); 
     42        exit(); 
     43} 
     44 
     45if ($confirm == "y") 
     46{ 
     47        foreach ($d as $val) 
     48        { 
     49                $r = $mysql->del_user($val); 
     50                if (!$r) 
     51                { 
     52                        $error .= $err->errstr() . "<br />"; 
     53                } 
     54                else 
     55                { 
     56                        $error .= sprintf(_("The user %s has been successfully deleted"), $mem->user["login"] . "_" . $val) . "<br />"; 
     57                } 
     58        } 
     59 
     60        include ("sql_users_list.php"); 
     61        exit(); 
    4762} 
    4863 
     
    5772<input type="hidden" name="confirm" value="y" /> 
    5873<?php 
    59 reset($_POST); 
    60 while (list($key,$val)=each($_POST)) { 
    61   if (substr($key,0,4)=="del_") { 
    62     echo "<input type=\"hidden\" name=\"$key\" value=\"$val\" />".$mem->user["login"]."_$val<br />\n"; 
    63   } 
    64 } 
     74 
     75foreach ($d as $val) 
     76        echo "<input type=\"hidden\" name=\"d[]\" value=\"" . $val . "\" />" . $mem->user["login"] . "_" . $val . "<br />\n"; 
    6577 
    6678?> 
    6779<br /> 
    68 <input type="submit" class="inb" name="sub" value="<?php __("Yes"); ?>" /> - <input type="button" class="inb" name="non" value="<?php __("No"); ?>" onclick="history.back()" /> 
     80<input type="submit" class="inb" name="sub" value="<?php __("Yes"); ?>" /> - <input type="submit" class="inb" name="cancel" value="<?php __("No"); ?>" /> 
    6981</p> 
    7082</form> 
  • alternc/branches/franck-desktop/bureau/admin/sql_users_doadd.php

    r1531 r1803  
    3030require_once("../class/config.php"); 
    3131 
     32$fields = array ( 
     33        "usern"        => array ("request", "string", ""), 
     34        "password"     => array ("request", "string", ""), 
     35        "passwordconf" => array ("request", "string", ""), 
     36); 
     37getFields($fields); 
    3238 
    33 if (!$quota->cancreate("mysql_users")) { 
    34 //      $error=_("err_mysql_1"); 
    35         include("sql_users_add.php"); 
     39if (!$quota->cancreate("mysql_users")) 
     40{ 
     41//      $error=_("err_mysql_1"); 
     42        include ("sql_users_add.php"); 
    3643        exit; 
    3744} 
    3845 
    39 if (!$mysql->add_user($usern,$password,$passconf)) { 
    40   $error=$err->errstr(); 
    41   include("sql_users_add.php"); 
     46if (!$mysql->add_user($usern, $password, $passconf)) 
     47{ 
     48  $error = $err->errstr(); 
     49  include ("sql_users_add.php"); 
    4250  exit; 
    4351} 
  • alternc/branches/franck-desktop/bureau/admin/sql_users_list.php

    r1797 r1803  
    3131include_once("head.php"); 
    3232 
    33 $r=$mysql->get_userslist(); 
    34 $rdb=$mysql->get_dblist(); 
     33$r = $mysql->get_userslist(); 
     34$rdb = $mysql->get_dblist(); 
    3535 
    3636?> 
    3737<h3><?php __("MySQL Users"); ?></h3> 
    3838<?php 
    39         if ($error) { 
    40                 echo "<p class=\"error\">$error</p><p>&nbsp;</p>"; 
    41         } 
    4239 
    43 if ($rdb) { 
    44   if($r){ 
    45 echo "<p>"._("help_sql_users_list_ok")."</p>"; 
     40if ($error) 
     41{ 
     42        echo "<p class=\"error\">" . $error . "</p><p>&nbsp;</p>"; 
     43} 
     44 
     45if ($rdb) 
     46{ 
     47        if($r) 
     48        { 
     49                echo "<p>"._("help_sql_users_list_ok")."</p>"; 
     50 
    4651?> 
    47  
    4852<form method="post" action="sql_users_del.php"> 
    4953<table cellspacing="0" cellpadding="4"> 
    50    <tr><th>&nbsp;</th><th><?php __("User"); ?></th><th><?php __("Rights"); ?></th></tr> 
    51 <?php 
    52 $col=1; 
    53 for($i=0;$i<count($r);$i++) { 
    54   $val=$r[$i]; 
    55   $col=3-$col; 
    56 ?> 
    57         <tr class="lst<?php echo $col; ?>"> 
    58           <td align="center"> 
    59             <input type="checkbox" class="inc" id="del_<?php echo $val["name"]; ?>" name="del_<?php echo $val["name"]; ?>" value="<?php echo $val["name"]; ?>" /> 
    60           </td> 
    61           <td><label for="del_<?php echo $val["name"]; ?>"><?php echo $mem->user["login"]."_".$val["name"]; ?></label></td> 
    62           <td><a href="sql_users_rights.php?id=<?php echo $val["name"] ?>"><?php __("Rights"); ?></a></td> 
     54        <tr> 
     55                <th>&nbsp;</th> 
     56                <th><?php __("User"); ?></th> 
     57                <th><?php __("Rights"); ?></th> 
    6358        </tr> 
    6459<?php 
    6560 
     61$col = 1; 
     62for($i = 0; $i < count($r); $i++) 
     63{ 
     64        $val = $r[$i]; 
     65        $col = 3 - $col; 
    6666 
    67  } 
    6867?> 
     68        <tr class="lst<?php echo $col; ?>"> 
     69                <td align="center"> 
     70                        <input type="checkbox" class="inc" id="del_<?php echo $val["name"]; ?>" name="d[]" value="<?php echo $val["name"]; ?>" /> 
     71                </td> 
     72                <td><label for="del_<?php echo $val["name"]; ?>"><?php echo $mem->user["login"]."_".$val["name"]; ?></label></td> 
     73                <td><a href="sql_users_rights.php?id=<?php echo $val["name"] ?>"><?php __("Rights"); ?></a></td> 
     74        </tr> 
     75<?php 
    6976 
    70 <tr><td colspan="5"> 
    71    <input type="submit" name="sub" value="<?php __("Delete the checked users"); ?>" class="inb" /> 
    72 </td></tr> 
     77} 
     78 
     79?> 
     80<tr> 
     81        <td colspan="5"> 
     82                <input type="submit" name="sub" value="<?php __("Delete the checked users"); ?>" class="inb" /> 
     83        </td> 
     84</tr> 
    7385</table> 
    7486</form> 
     
    7789 
    7890<?php 
    79   } 
    80   if ($quota->cancreate("mysql_users")) { 
     91 
     92} 
     93 
     94if ($quota->cancreate("mysql_users")) 
     95{ 
     96 
    8197?> 
    8298<p><a href="sql_users_add.php"><?php __("Create a new MySQL user"); ?></a><br /></p> 
  • alternc/branches/franck-desktop/bureau/admin/sta2_add_raw.php

    r1797 r1803  
    3030require_once("../class/config.php"); 
    3131 
    32 if (!$quota->cancreate("sta2")) { 
    33         $error=_("You cannot add any new statistics, your quota is over."); 
     32if (!$quota->cancreate("sta2")) 
     33{ 
     34        $error = _("You cannot add any new statistics, your quota is over."); 
    3435} 
    3536 
    3637include_once("head.php"); 
     38 
     39$fields = array ( 
     40        "id"       => array ("request", "integer", 0), 
     41        "hostname" => array ("request", "string", ""), 
     42        "folder"   => array ("request", "string", ""), 
     43); 
     44getFields($fields); 
     45 
    3746?> 
    3847<h3><?php __("New Raw Statistics (apache)"); ?></h3> 
    3948<?php 
    40         if ($error) { 
    41                 echo "<p class=\"error\">$error</p>"; 
    42                 include_once("foot.php"); 
    43                 exit(); 
    44         } 
     49 
     50if ($error) 
     51{ 
     52        echo "<p class=\"error\">" . $error . "</p>"; 
     53        include_once ("foot.php"); 
     54        exit(); 
     55} 
     56 
    4557?> 
    4658<form method="post" action="sta2_doadd_raw.php" id="main" name="main"> 
    4759<table border="1" cellspacing="0" cellpadding="4"> 
    48 <tr><th><input type="hidden" name="id" value="<?php echo $id ?>" /> 
    49         <label for="hostname"><?php __("Domain name"); ?></label></th><td> 
    50         <select class="inl" name="hostname" id="hostname"><?php $sta2->select_host_list($hostname); ?></select> 
    51 </td></tr> 
    52 <tr><th><label for="folder"><?php __("Folder"); ?></label></th><td><input type="text" class="int" name="folder" id="folder" value="<?php echo $folder; ?>" size="20" maxlength="255" /> 
    53 <script type="text/javascript"> 
    54 <!-- 
    55   document.write("&nbsp;<input type=\"button\" name=\"bff\" onclick=\"browseforfolder('main.folder');\" value=\" ... \" class=\"inb\" />"); 
    56 //  --> 
    57 </script> 
    58 </td></tr> 
    59 <tr><td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Create those raw statistics"); ?>" /></td></tr> 
     60        <tr> 
     61                <th> 
     62                        <input type="hidden" name="id" value="<?php echo $id ?>" /> 
     63                        <label for="hostname"><?php __("Domain name"); ?></label></th> 
     64                <td> 
     65                        <select class="inl" name="hostname" id="hostname"><?php $sta2->select_host_list($hostname); ?></select> 
     66                </td> 
     67        </tr> 
     68        <tr> 
     69                <th><label for="folder"><?php __("Folder"); ?></label></th> 
     70                <td><input type="text" class="int" name="folder" id="folder" value="<?php echo $folder; ?>" size="20" maxlength="255" /> 
     71                <script type="text/javascript"> 
     72                <!-- 
     73                document.write("&nbsp;<input type=\"button\" name=\"bff\" onclick=\"browseforfolder('main.folder');\" value=\" ... \" class=\"inb\" />"); 
     74                //  --> 
     75                </script> 
     76                </td> 
     77        </tr> 
     78        <tr> 
     79                <td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Create those raw statistics"); ?>" /></td> 
     80        </tr> 
    6081</table> 
    6182</form> 
    62 <?php $mem->show_help("sta2_add"); ?> 
    63 <?php include_once("foot.php"); ?> 
     83<?php 
     84 
     85$mem->show_help("sta2_add"); 
     86 
     87include_once("foot.php"); 
     88 
     89?> 
  • alternc/branches/franck-desktop/bureau/admin/sta2_del_raw.php

    r272 r1803  
    3030require_once("../class/config.php"); 
    3131 
    32 $error=""; 
     32$fields = array ( 
     33        "d"    => array ("request", "array", array()), 
     34); 
     35getFields($fields); 
     36 
     37if (!is_array($d)) 
     38{ 
     39        $tmp = array($d); 
     40        $d = $tmp; 
     41} 
     42reset($d); 
     43 
    3344// On parcours les POST_VARS et on repere les del_. 
    34 reset($_POST); 
    35 while (list($key,$val)=each($_POST)) { 
    36         if (substr($key,0,4)=="del_") { 
    37                 // Effacement du jeu de stats $val 
    38                 $r=$sta2->delete_stats_raw($val); 
    39                 if (!$r) { 
    40                         $error.=$err->errstr()."<br />"; 
    41                 } else { 
    42                         $error.=sprintf(_("The statistics %s has been successfully deleted (the stats files must be manually deleted)"),$r)."<br />"; 
    43                 } 
     45while (li