Changeset 2618


Ignore:
Timestamp:
11/30/09 20:20:25 (3 years ago)
Author:
benjamin
Message:

english translation of comments + misc cleanup + start of policy management code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • alternc-awstats/trunk/bureau/class/m_aws.php

    r1861 r2618  
    3838class m_aws { 
    3939 
     40 
    4041  /** Where are the awstats configuration files :  
    4142   * @access private  
     
    4546  var $CACHEDIR="/var/cache/awstats"; 
    4647 
     48 
    4749  /** Where is the template for conf files : 
    4850   * @access private  
     
    5052  var $TEMPLATEFILE="/etc/alternc/templates/awstats/awstats.template.conf"; 
    5153 
     54 
    5255  /* ----------------------------------------------------------------- */ 
    5356  /** 
     
    5659  function m_aws() { 
    5760  } 
     61 
    5862 
    5963  /* ----------------------------------------------------------------- */ 
     
    6569  }  
    6670 
     71 
     72  /* ----------------------------------------------------------------- */   
     73  /** 
     74   * Password kind used in this class (hook for admin class) 
     75   */ 
     76  function alternc_password_policy() { 
     77    return array("aws"=>"Awstats Web Statistics"); 
     78  } 
     79 
     80 
    6781  /* ----------------------------------------------------------------- */ 
    6882  /** 
     
    7286    return array("aws"=>_("The stats module allows any user to ask for statistics about his web site. Statistics are web pages generated daily based on the visits of the day before. Awstats is the soft used to produce those stats. The statistics are then protected by a login and a password.")); 
    7387  }  
     88 
    7489 
    7590  /* ----------------------------------------------------------------- */ 
     
    110125    } 
    111126  } 
     127 
    112128 
    113129  /* ----------------------------------------------------------------- */ 
     
    150166  } 
    151167 
     168 
    152169  /* ----------------------------------------------------------------- */ 
    153170  /** Return the list of domains / subdomains allowed for this member 
     
    168185    return $r; 
    169186  } 
    170   /* ----------------------------------------------------------------- */ 
    171   /** Retourne la liste des prefixes utilisables par le compte courant 
    172    * @return array tableau contenant la liste des prefixes (domaines + login) 
    173    *  du compte actuel. 
     187 
     188 
     189  /* ----------------------------------------------------------------- */ 
     190  /** Returns the list of prefixes that can be used on current account 
     191   * @return array an arry with the list of domains + the login of the account 
    174192   */ 
    175193  function prefix_list() { 
     
    184202  } 
    185203 
    186   /* ----------------------------------------------------------------- */ 
    187   /** Affiche (ECHO) la liste des prefixes disponibles sous forme de champs d'option 
    188    * Les champs sont affichés sous la forme <option>prefixe</option>... 
    189    * La valeur $current se voit affublée de la balise SELECTED. 
    190    * @param string $current Prefixe sélectionné par défaut 
     204 
     205  /* ----------------------------------------------------------------- */ 
     206  /** Echoes <option> tags of all the domains hosted on the account + the login of the account 
     207   * They can be used as a root for the login that may have access to web statistics 
     208   * hosted on an account 
     209   * $current will be the selected value. 
     210   * @param string $current The default selected value 
    191211   * @return boolean TRUE. 
    192212   */ 
     
    201221  } 
    202222 
     223 
    203224  /* ----------------------------------------------------------------- */ 
    204225  /**  
     
    216237  } 
    217238 
     239 
    218240  /* ----------------------------------------------------------------- */ 
    219241  /**  
     
    232254    return $r; 
    233255  } 
     256 
    234257 
    235258  /* ----------------------------------------------------------------- */ 
     
    255278  } 
    256279 
     280 
    257281  /* ----------------------------------------------------------------- */ 
    258282  /**  
    259    * Efface un jeu de statistiques existant. 
    260    * @param integer $id est le numéro du jeu de statistiques à supprimer 
    261    * @return string le nom du domaine du jeu ainsi effacé, ou FALSE si une erreur est survenue. 
     283   * Delete a statistic set. 
     284   * @param integer $id The statistic set ID 
     285   * @return string the domain name of the deleted statistic set, or FALSE if an error occurred 
    262286   */ 
    263287  function delete_stats($id) { 
     
    278302  } 
    279303 
     304 
    280305  /* ----------------------------------------------------------------- */ 
    281306  /**  
    282    * Cree un nouveau jeu de statistiques 
    283    * @param string $hostname est le nom de domaine sur lequel on fait des stats 
    284    * @return boolean TRUE si le jeu de stats a été créé avec succès, FALSE sinon. 
     307   * Create a new statistic set 
     308   * @param string $hostname The domain name 
     309   * @param $uers array the array of users that will be allowed 
     310   * @param $hostaliases array an array of host aliases 
     311   * @param $public boolean Shall this statistic set be public ?  
     312   * @return boolean TRUE if the set has been created 
    285313   */ 
    286314  function add_stats($hostname,$users="", $hostaliases,$public) { 
     
    321349  } 
    322350 
     351 
    323352  /* ----------------------------------------------------------------- */ 
    324353  function list_login() { 
     
    336365    return $res; 
    337366  } 
     367 
    338368 
    339369  /* ----------------------------------------------------------------- */ 
     
    365395  } 
    366396 
     397 
    367398  /* ----------------------------------------------------------------- */ 
    368399  /* Check that a login exists ($exists=1) or doesn't exist ($exists=0) */ 
     
    378409  } 
    379410 
     411 
    380412  /* ----------------------------------------------------------------- */ 
    381413  function del_login($login) { 
     
    391423  } 
    392424 
     425 
    393426  /* ----------------------------------------------------------------- */ 
    394427  function add_login($login,$pass) { 
     
    410443  } 
    411444 
     445 
    412446  /* ----------------------------------------------------------------- */ 
    413447  function change_pass($login,$pass) { 
     
    428462    return true; 
    429463  } 
     464 
    430465 
    431466  /* ----------------------------------------------------------------- */ 
     
    459494    return true; 
    460495  } 
     496 
     497 
    461498  /* ----------------------------------------------------------------- */ 
    462499  function delete_allowed_login($id,$noconf=0) { 
     
    476513    return true; 
    477514  } 
     515 
     516 
    478517  /* ----------------------------------------------------------------- */ 
    479518  function deny_login($login,$id,$noconf=0) { // deny user $login to access stats $id. 
     
    506545    return true; 
    507546  } 
     547 
    508548 
    509549  /* ----------------------------------------------------------------- */ 
     
    526566  } 
    527567 
     568 
    528569  /* ----------------------------------------------------------------- */ 
    529570  /**  
    530    * Fonction appellée par m_dom lorsqu'un domaine est supprimé. 
    531    * @param string $dom est le domaine à supprimer. 
     571   * This function is called on each class when a domain name is uninstalled 
     572   * @param string $dom the domain to uninstall 
    532573   */ 
    533574  function alternc_del_domain($dom) { 
     
    540581      $t[]=array($db->f("hostname"),$db->f("id")); 
    541582    } 
    542     // on détruit les jeux de stats associés au préfixe correspondant : 
    543583    foreach ($t as $i) { 
    544584      $db->query("DELETE FROM aws WHERE uid='$cuid' AND hostname='".$i[0]."';"); 
     
    550590  } 
    551591 
     592 
    552593  /* ----------------------------------------------------------------- */ 
    553594  /**  
    554    * Recalcule le quota complet de l'utilisateur courant, ou de l'utilisateur $id 
    555    * @param integer $id Numéro de l'utilisateur (facultatif) 
     595   * This function is called when we are asked to compute the used quota 
     596   * for a service 
     597   * @param integer $id The userid whose quota should be computed. 
    556598   */ 
    557599  function alternc_get_quota($name) { 
     
    564606    } else return false; 
    565607  } 
     608 
    566609 
    567610  /* ----------------------------------------------------------------- */ 
     
    589632  } 
    590633 
    591   /* ----------------------------------------------------------------- */ 
    592   /** Effacement du fichier de conf awstats du domaine $hostname 
     634 
     635  /* ----------------------------------------------------------------- */ 
     636  /** Delete the awstats configuration file for a statistic set. 
    593637   * @access private 
    594638   */ 
     
    602646  } 
    603647 
    604   /* ----------------------------------------------------------------- */ 
    605   /** Création du fichier de configuration awstat du domaine $id 
     648 
     649  /* ----------------------------------------------------------------- */ 
     650  /** Create a configuration file for a statistic set. 
    606651   * if nochk==1, does not check the owner of the stat set (for admin only) 
    607652   * @access private 
     
    637682  } 
    638683 
     684 
     685  /* ----------------------------------------------------------------- */ 
    639686  function _createhtpasswd() { 
    640687    global $db; 
     
    649696  } 
    650697 
     698 
    651699  /* ----------------------------------------------------------------- */ 
    652700  /** 
Note: See TracChangeset for help on using the changeset viewer.