Changeset 45


Ignore:
Timestamp:
02/21/06 23:29:17 (7 years ago)
Author:
anarcat
Message:

[project @ alternc: changeset 2003-04-17 21:39:56 by benjamin]

  • PLEINS de modif pendant les vacances :
  • Ajout des commentaires doxygen dans m_stats
  • Corrections des fonctions alternc_* dans les classes pour conformité
  • Ajout du paramètre "admlst" qui dit comment chaque admin veut voir apparaitre la liste des membres (long/court)
  • D'autres modifs que j'ai surement oubliées...

Original author: benjamin
Date: 2003-04-17 21:39:57

Files:
11 edited

Legend:

Unmodified
Added
Removed
  • bureau/admin/adm_list.php

    r1 r45  
    11<?php 
    22/* 
    3  $Id: adm_list.php,v 1.1.1.1 2003/03/26 17:41:29 root Exp $ 
     3 $Id: adm_list.php,v 1.2 2003/04/17 21:39:56 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    5656<br> 
    5757<form method="post" action="adm_dodel.php"> 
     58<?php  
     59 
     60// Depending on the admin's choice, let's show a short list or a long list. 
     61 
     62if ($mem->user["admlist"]==0) { // Normal (large) mode 
     63?> 
    5864<table cellspacing="0" cellpadding="4"> 
    5965<tr><th colspan="4">&nbsp;</th><th><?php __("Username"); ?></th><th><?php echo _("Surname")." "._("First Name")."<br>("._("Email address").")"; ?></th></tr> 
     
    8692<?php 
    8793        } 
     94 
     95} // Normal Mode 
     96 
     97if ($mem->user["admlist"]==1) { // Short mode 
     98?> 
     99<table cellspacing="0" cellpadding="4"> 
     100<tr> 
     101        <th colspan="2">&nbsp;</th><th><?php __("Username"); ?></th> 
     102        <th width="1" bgcolor="black"><img src="icon/pix.gif" width="1" height="1" border="0" alt=""></th> 
     103        <th colspan="2">&nbsp;</th><th><?php __("Username"); ?></th> 
     104</tr> 
     105<?php 
     106reset($r); 
     107$col=1; 
     108for($z=0;$z<round(count($r)/2);$z++) 
     109        { 
     110        $col=3-$col; 
     111$val=$r[$z]; 
     112?> 
     113        <tr class="lst<?php echo $col; ?>"> 
     114<?php if ($val["su"]) { ?> 
     115                        <td>&nbsp;</td> 
     116<?php } else { ?> 
     117 <td align="center"><input type="checkbox" class="inc" name="d[]" value="<?php echo $val["uid"]; ?>"></td> 
     118<?php } ?> 
     119                <td align="center"> 
     120                <a href="adm_edit.php?uid=<?php echo $val["uid"] ?>"><?php __("E"); ?></a> 
     121                <a href="adm_quotaedit.php?uid=<?php echo $val["uid"] ?>"><?php __("Q"); ?></a> 
     122                <?php 
     123                if (!$val["enabled"]) 
     124                        echo "<img src=\"icon/encrypted.png\" width=\"16\" height=\"16\" alt=\""._("Locked Account")."\">"; 
     125                else { 
     126                ?> 
     127                        <a href="adm_login.php?id=<?php echo $val["uid"];?>" target="_parent"><?php __("C"); ?></a> 
     128                <?php } ?> 
     129                </td> 
     130                <td <?php if ($val["su"]) echo "style=\"color: red\""; ?>><?php echo $val["login"] ?></td> 
     131<td width="1" bgcolor="black"></td> 
     132<?php 
     133$val=$r[$z+round(count($r)/2)]; 
     134if (is_array($val)) { 
     135?> 
     136<?php if ($val["su"]) { ?> 
     137                        <td>&nbsp;</td> 
     138<?php } else { ?> 
     139 <td align="center"><input type="checkbox" class="inc" name="d[]" value="<?php echo $val["uid"]; ?>"></td> 
     140<?php } ?> 
     141                <td align="center"> 
     142                <a href="adm_edit.php?uid=<?php echo $val["uid"] ?>"><?php __("E"); ?></a> 
     143                <a href="adm_quotaedit.php?uid=<?php echo $val["uid"] ?>"><?php __("Q"); ?></a> 
     144                <?php 
     145                if (!$val["enabled"]) 
     146                        echo "<img src=\"icon/encrypted.png\" width=\"16\" height=\"16\" alt=\""._("Locked Account")."\">"; 
     147                else { 
     148                ?> 
     149                        <a href="adm_login.php?id=<?php echo $val["uid"];?>" target="_parent"><?php __("C"); ?></a> 
     150                <?php } ?> 
     151                </td> 
     152                <td <?php if ($val["su"]) echo "style=\"color: red\""; ?>><?php echo $val["login"] ?></td> 
     153        </tr> 
     154<?php 
     155        } else echo "<td colspan=\"3\"></td></tr>"; 
     156} // for loop 
     157} // Short Mode 
     158 
     159 
    88160?> 
    89161<tr><td colspan="6"><input type="submit" class="inb" name="submit" value="<?php __("Delete checked accounts"); ?>"></td></tr> 
  • bureau/admin/ftp_list.php

    r1 r45  
    11<?php 
    22/* 
    3  $Id: ftp_list.php,v 1.1.1.1 2003/03/26 17:41:29 root Exp $ 
     3 $Id: ftp_list.php,v 1.2 2003/04/17 21:39:56 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    6868        <tr  class="lst<?php echo $col; ?>"> 
    6969                <td align="center"><input type="checkbox" class="inc" name="del_<?php echo $val["id"]; ?>" value="<?php echo $val["id"]; ?>"></td> 
    70                 <td><a href="ftp_edit.php?id=<?php echo $val["id"] ?>">Modifier</a></td> 
     70                <td><a href="ftp_edit.php?id=<?php echo $val["id"] ?>"><?php __("Edit"); ?></a></td> 
    7171                <td><?php echo $val["login"] ?></td> 
    7272                <td><?php ecif($val["pass"],$val["pass"],_("<-No Password->")); ?></td> 
  • bureau/admin/mem_param.php

    r1 r45  
    11<?php 
    22/* 
    3  $Id: mem_param.php,v 1.1.1.1 2003/03/26 17:41:29 root Exp $ 
     3 $Id: mem_param.php,v 1.2 2003/04/17 21:39:56 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    9191</form> 
    9292<p>&nbsp;</p> 
     93<?php 
     94if (!$mem->user["su"]) { 
     95<hr> 
     96<p> 
     97<?php __("Admin preferences"); ?> :  
     98</p> 
     99<form method="post" action="mem_admin.php"> 
     100<table border="1" cellspacing="0" cellpadding="4"> 
     101<tr><th><?php __("Admin list view"); ?></th><td><select name="admlist"> 
     102<option value="0"<?php if $mem->user["admlist"]==0) echo " SELECTED"; ?>><?php __("Large view"); ?></option> 
     103<option value="1"<?php if $mem->user["admlist"]==1) echo " 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> 
     106</table> 
     107</form> 
     108<p>&nbsp;</p> 
     109<?php } ?> 
    93110<hr> 
    94111</body> 
  • bureau/class/m_bro.php

    r1 r45  
    11<?php 
    22/* 
    3  $Id: m_bro.php,v 1.1.1.1 2003/03/26 17:41:29 root Exp $ 
     3 $Id: m_bro.php,v 1.2 2003/04/17 21:39:56 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 LICENSE 
     
    129129    } 
    130130    if (is_array($c)) { 
    131       usort ($c, "__sort_filelist_name"); 
     131      usort ($c, array("m_bro","_sort_filelist_name")); 
    132132      return $c; 
    133133    } else { 
     
    603603 
    604604  /* ----------------------------------------------------------------- */ 
     605  /** Fonction de tri perso utilisé par filelist. 
     606   * @access private 
     607   */ 
     608  function _sort_filelist_name($a,$b) { 
     609    if ($a["type"] && !$b["type"]) return 1; 
     610    if ($b["type"] && !$a["type"]) return -1; 
     611    return $a["name"]>$b["name"]; 
     612  } 
     613 
     614  /* ----------------------------------------------------------------- */ 
    605615  /** Efface $file et tous ses sous-dossiers s'il s'agit d'un dossier 
    606616   * A UTILISER AVEC PRECAUTION !!! 
     
    629639} /* Classe BROUTEUR */ 
    630640 
    631 /* ----------------------------------------------------------------- */ 
    632 /** Fonction de tri perso utilisé par filelist. 
    633  * @access private 
    634  */ 
    635 function __sort_filelist_name($a,$b) { 
    636   if ($a["type"] && !$b["type"]) return 1; 
    637   if ($b["type"] && !$a["type"]) return -1; 
    638   return $a["name"]>$b["name"]; 
    639 } 
    640  
    641641?> 
  • bureau/class/m_ftp.php

    r1 r45  
    11<?php 
    22/* 
    3  $Id: m_ftp.php,v 1.1.1.1 2003/03/26 17:41:29 root Exp $ 
     3 $Id: m_ftp.php,v 1.2 2003/04/17 21:39:56 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 LICENSE 
     
    295295   * @access private 
    296296   */ 
    297   function del_dom($dom) { 
     297  function alternc_del_domain($dom) { 
    298298    global $db,$quota,$err; 
    299299    $err->log("ftp","del_dom",$dom); 
     
    325325   * @access private 
    326326   */ 
    327   function checkquota($id=-1) { 
     327  function alternc_quota_check($id=-1) { 
    328328    global $db,$err,$quota; 
    329329    $err->log("ftp","checkquota"); 
  • bureau/class/m_mailman.php

    r1 r45  
    11<?php 
    22/* 
    3  $Id: m_mailman.php,v 1.1.1.1 2003/03/26 17:41:29 root Exp $ 
     3 $Id: m_mailman.php,v 1.2 2003/04/17 21:39:56 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    199199      fonction appelée par m_domains 
    200200  *****************************************************************************/ 
    201   function del_dom($dom) { 
     201  function alternc_del_domain($dom) { 
    202202    global $err; 
    203     $err->log("mailman","del_dom",$dom); 
     203    $err->log("mailman","del_domain",$dom); 
    204204 
    205205    // Suppression des listes du domaine 
     
    213213 
    214214  /*****************************************************************************/ 
    215   function add_dom($dom) { 
     215  function alternc_add_domain($dom) { 
    216216    global $err; 
    217     $err->log("mailman","del_dom",$dom); 
     217    $err->log("mailman","del_domain",$dom); 
    218218    return true; 
    219219  } 
  • bureau/class/m_quota.php

    r1 r45  
    11<?php 
    22/* 
    3  $Id: m_quota.php,v 1.1.1.1 2003/03/26 17:41:29 root Exp $ 
     3 $Id: m_quota.php,v 1.2 2003/04/17 21:39:56 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    177177    $err->log("quota","checkquota",$id); 
    178178    if ($id==-1) $id=$this->uid; 
    179     // FTP 
    180     if (is_object($GLOBALS["ft"])) { 
    181       $GLOBALS["ft"]->checkquota($id); 
    182     } 
    183     // Stats 
    184     if (is_object($GLOBALS["st"])) { 
    185       $GLOBALS["st"]->checkquota($id); 
    186     } 
    187     // Domaines 
    188     if (is_object($GLOBALS["dm"])) { 
    189       $GLOBALS["dm"]->checkquota($id); 
    190     } 
    191     // ml 
    192     if (is_object($GLOBALS["ml"])) { 
    193       $GLOBALS["ml"]->checkquota($id); 
    194     } 
     179    // Check quotas for all classes :  
     180    for($i=0;$i<count($classes);$i++) { 
     181      if (method_exists($GLOBALS[$classes[$i]],"alternc_quota_check")) { 
     182        $GLOBALS[$classes[$i]]->alternc_quota_check($uid); 
     183        } 
     184      } 
    195185  } 
    196186 
  • bureau/class/m_stats.php

    r1 r45  
    11<?php 
    22/* 
    3  $Id: m_stats.php,v 1.1.1.1 2003/03/26 17:41:29 root Exp $ 
     3 $Id: m_stats.php,v 1.2 2003/04/17 21:39:56 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    2828 ---------------------------------------------------------------------- 
    2929*/ 
     30/** 
     31* Classe de gestion des statistiques web webalizer / apache des hébergés 
     32*  
     33* Cette classe permet de gérer les statistiques web générées par webalizer 
     34* dans la langue de votre choix, ainsi que les fichiers logs bruts d'apache.<br> 
     35* Copyleft {@link http://alternc.net/ AlternC Team} 
     36*  
     37* @copyright    AlternC-Team 2002-11-01 http://alternc.net/ 
     38*  
     39*/ 
    3040class m_stats { 
    3141 
    32   var $uid=0;         /* Membre actuellement connecté */ 
     42  /** Membre actuellement connecté */ 
     43  var $uid=0; 
     44 
    3345  var $alternc_quota_name="stats"; 
     46  
     47  /** Emplacement des fichiers de conf webalizer 
     48   * @access private  
     49   */ 
    3450  var $CONFDIR="/etc/webalizer/"; 
     51 
     52  /** Emplacement du fichier patron pour recopie. 
     53   * @access private  
     54   */ 
    3555  var $TEMPLATEFILE="/etc/webalizer/template.conf"; 
     56 
     57  /** Nom des langues disponibles */ 
    3658  var $langname=array( 
    3759                      "FR"=>"Français", 
     
    3961                      ); 
    4062 
    41   /* **************************************************************************** 
    42      m_stats([$mid]) Constructeur de la classe m_stats 
    43   *****************************************************************************/ 
     63  /* ----------------------------------------------------------------- */ 
     64  /** 
     65   * Constructeur 
     66   */ 
    4467  function m_stats($membre=0) { 
    4568    $this->uid=$membre; 
    4669  } 
    4770   
    48   /* **************************************************************************** 
    49      get_list() retourne un tableau contenant les jeux de stats d'un membre. 
    50      Le tableau est de la forme 
    51      $r[0-n]["id"] = numéros du jeu 
    52      $r[0-n]["hostname"]= domaine concerné 
    53      $r[0-n]["dir"]= Répertoire destination (dans le dossier du membre) 
    54      $r[0-n]["lang"]= Langue de production des statistiques 
    55   *****************************************************************************/ 
     71  /* ----------------------------------------------------------------- */ 
     72  /** 
     73   * Retourne un tableau contenant les jeux de statistiques d'un membre. 
     74   * 
     75   * @return array retourne un tableau indexé de tableaux associatif de la  
     76   *  forme :  
     77   *  $r[0-n]["id"] = numéros du jeu 
     78   *  $r[0-n]["hostname"]= domaine concerné 
     79   *  $r[0-n]["dir"]= Répertoire destination (dans le dossier du membre) 
     80   *  $r[0-n]["lang"]= Langue de production des statistiques 
     81   */ 
    5682  function get_list() { 
    5783    global $db,$err; 
     
    77103  } 
    78104 
    79   /* **************************************************************************** 
    80      get_stats_details($login) retourne un tableau contenant les details d'un 
    81      jeu de statistiques gere par le membre. 
    82      $id est un id de jeu de stats. Retourne un tableau associatif sous la forme : 
    83      "id" = numéros du jeu 
    84      "hostname"= domaine concerné 
    85      "dir"= Répertoire destination (dans le dossier du membre) 
    86      "lang"= Langue de production des statistiques 
    87   *****************************************************************************/ 
     105  /* ----------------------------------------------------------------- */ 
     106  /** 
     107   * Retourne un tableau contenant les détails d'un jeu de statistiques 
     108   *  d'un membre. 
     109   * 
     110   * @param integer $id Numéro du jeu de stats dont on veut les infos. 
     111   * @return array retourne un tableau associatif de la forme :  
     112   *  $r["id"] = numéros du jeu 
     113   *  $r["hostname"]= domaine concerné 
     114   *  $r["dir"]= Répertoire destination (dans le dossier du membre) 
     115   *  $r["lang"]= Langue de production des statistiques 
     116   */ 
    88117  function get_stats_details($id) { 
    89118    global $db,$err; 
     
    108137 
    109138 
    110   /* **************************************************************************** 
    111      host_list() retourne la liste des domaines / sous-domaines autorisés pour le membre. 
    112   *****************************************************************************/ 
     139  /* ----------------------------------------------------------------- */ 
     140  /** Retourne la liste des domaines / sous-domaines autorisés pour le membre. 
     141   *  
     142   * @return array retourne un tableau indexé des domaines / sous-domaines utilisables. 
     143   */ 
    113144  function host_list() { 
    114145    global $db,$err; 
     
    125156  } 
    126157 
    127  
    128   /* **************************************************************************** 
    129      select_host_list() affiche des options select de la liste des noms de domaines autorisés pour 
    130      le membre. sous forme de champs d'options (select) 
    131   *****************************************************************************/ 
     158  /* ----------------------------------------------------------------- */ 
     159  /**  
     160   * Affiche des options select de la liste des noms de domaines autorisés pour 
     161   * le membre. sous forme de champs d'options (select) 
     162   */ 
    132163  function select_host_list($current) { 
    133164    global $db,$err; 
     
    141172  } 
    142173 
    143  
    144   /* **************************************************************************** 
    145      select_lang_list() affiche des options select de la liste des langues autorisés pour 
    146      le membre. sous forme de champs d'options (select) 
    147   *****************************************************************************/ 
     174  /* ----------------------------------------------------------------- */ 
     175  /**  
     176   * Affiche des options select de la liste des langues autorisées pour 
     177   * le membre. sous forme de champs d'options (select) 
     178   */ 
    148179  function select_lang_list($current) { 
    149180    reset($this->langname); 
     
    155186  } 
    156187 
    157   /* **************************************************************************** 
    158      put_stats_details($id,$dir,$lang) Modifie un jeu de statistiques existant 
    159      $id est le numéro du jeu de statistiques 
    160      $dir est un chemin relatif à "/var/alternc/html/u/user" 
    161   *****************************************************************************/ 
     188  /* ----------------------------------------------------------------- */ 
     189  /**  
     190   * Modifie un jeu de statistiques existant 
     191   * @param integer $id est le numéro du jeu de statistiques 
     192   * @param string $dir est un chemin relatif à "/var/alternc/html/u/user" 
     193   */ 
    162194  function put_stats_details($id,$dir,$stlang) { 
    163195    global $db,$err,$bro,$mem; 
     
    185217  } 
    186218 
    187   /* **************************************************************************** 
    188      delete_stats($id) Efface un jeu de statistiques existant 
    189      $id est un id de jeu de statistiques 
    190   *****************************************************************************/ 
     219  /* ----------------------------------------------------------------- */ 
     220  /**  
     221   * Efface un jeu de statistiques existant. 
     222   * @param integer $id est le numéro du jeu de statistiques à supprimer 
     223   * @return string le nom du domaine du jeu ainsi effacé, ou FALSE si une erreur est survenue. 
     224   */ 
    191225  function delete_stats($id) { 
    192226    global $db,$err,$quota; 
     
    204238  } 
    205239 
    206   /* **************************************************************************** 
    207      add_stats($hostname,$dir,$lang) Cree un nouveau jeu de statistiques 
    208      $dir est le chemin d'accès racine du compte ftp dans le compte du membre 
    209      $lang est la langue choisie 
    210      $hostname est le nom de domaine sur lequel on fait des stats 
    211      retourne true ou false 
    212   *****************************************************************************/ 
     240  /* ----------------------------------------------------------------- */ 
     241  /**  
     242   * Cree un nouveau jeu de statistiques 
     243   * @param string $dir est le chemin d'accès racine du compte ftp dans le compte du membre 
     244   * @param string $lang est la langue choisie 
     245   * @param string $hostname est le nom de domaine sur lequel on fait des stats 
     246   * @return boolean TRUE si le jeu de stats a été créé avec succès, FALSE sinon. 
     247   */ 
    213248  function add_stats($hostname,$dir,$lang) { 
    214249    global $db,$err,$quota,$bro,$mem; 
     
    242277  } 
    243278 
    244   function add_dom($dom) { 
    245     // on ne fait rien, les créations de domaine, ca ne nous concerne pas ... 
    246     return true; 
    247   } 
    248  
    249   function del_dom($dom) { 
     279  /* ----------------------------------------------------------------- */ 
     280  /**  
     281   * Fonction appellée par m_dom lorsqu'un domaine est supprimé. 
     282   * @param string $dom est le domaine à supprimer. 
     283   */ 
     284  function alternc_del_domain($dom) { 
    250285    global $db,$quota,$err; 
    251286    $err->log("stats","del_dom",$dom); 
     
    284319 
    285320  /* Recalcule le quota complet de l'utilisateur courant, ou de l'utilisateur $id */ 
    286   function checkquota($id=-1) { 
     321  function alternc_quota_check($id=-1) { 
    287322    global $db,$err,$quota; 
    288323    $err->log("stats","checkquota"); 
  • bureau/class/m_sympa.php

    r1 r45  
    11<?php 
    22/* 
    3  $Id: m_sympa.php,v 1.1.1.1 2003/03/26 17:41:29 root Exp $ 
     3 $Id: m_sympa.php,v 1.2 2003/04/17 21:39:56 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 LICENSE 
     
    10571057   * @access private 
    10581058   */ 
    1059   function checkquota($id=-1) { 
     1059  function alternc_quota_check($id=-1) { 
    10601060    global $db,$err,$quota; 
    10611061    if (!$id==-1) $id=$this->uid; 
     
    10761076     fonction appelée par m_domains 
    10771077  *****************************************************************************/ 
    1078   function del_dom($dom) { 
     1078  function alternc_del_domain($dom) { 
    10791079    global $err; 
    10801080    $err->log("sympa","del_dom",$dom); 
     
    11281128   * @access private 
    11291129   */ 
    1130   function add_dom($dom) { 
     1130  function alternc_add_domain($dom) { 
    11311131    global $err; 
    1132     $err->log("sympa","del_dom",$dom); 
     1132    $err->log("sympa","add_dom",$dom); 
    11331133    //connexion ldap 
    11341134    if (!$this->_connectldap()) { 
  • bureau/locales/fr_FR/LC_MESSAGES/mem.po

    r1 r45  
    22# Copyright (c) 2002 the AlternC Development Team 
    33# <tech@alternc.org> 
    4 # $Id: mem.po,v 1.1.1.1 2003/03/26 17:41:29 root Exp $ 
     4# $Id: mem.po,v 1.2 2003/04/17 21:39:57 benjamin Exp $ 
    55 
    66msgid "err_mem_1" 
     
    3939msgstr "Aide" 
    4040 
     41msgid "Admin preferences" 
     42msgstr "Préférences d'administrateur" 
     43 
     44msgid "Members list view" 
     45msgstr "Vue de la liste des membres" 
     46 
     47msgid "Large view" 
     48msgstr "Vue large" 
     49 
     50msgid "Short view" 
     51msgstr "Vue étroite" 
     52 
     53msgid "Change my admin preferences" 
     54msgstr "Modifier mes préférences d'administration" 
     55 
  • todo

    r6 r45  
     1 
     2A FAIRE URGEMMENT :  
     3 
     4- Dans m_mysql, implémenter alternc_add_member et alternc_del_member ainsi que alternc_quota_check 
     5- Dans m_cron, affiner un peu le bastringue ;) 
     6 
     7 
     8A faire plus tard (voire déjà fait...) :  
    19 
    210- Statistiques calculées sur les logs de visite des sites (mes zolis scripts shells) 
Note: See TracChangeset for help on using the changeset viewer.