Changeset 2618
- Timestamp:
- 11/30/09 20:20:25 (3 years ago)
- File:
-
- 1 edited
-
alternc-awstats/trunk/bureau/class/m_aws.php (modified) (33 diffs)
Legend:
- Unmodified
- Added
- Removed
-
alternc-awstats/trunk/bureau/class/m_aws.php
r1861 r2618 38 38 class m_aws { 39 39 40 40 41 /** Where are the awstats configuration files : 41 42 * @access private … … 45 46 var $CACHEDIR="/var/cache/awstats"; 46 47 48 47 49 /** Where is the template for conf files : 48 50 * @access private … … 50 52 var $TEMPLATEFILE="/etc/alternc/templates/awstats/awstats.template.conf"; 51 53 54 52 55 /* ----------------------------------------------------------------- */ 53 56 /** … … 56 59 function m_aws() { 57 60 } 61 58 62 59 63 /* ----------------------------------------------------------------- */ … … 65 69 } 66 70 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 67 81 /* ----------------------------------------------------------------- */ 68 82 /** … … 72 86 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.")); 73 87 } 88 74 89 75 90 /* ----------------------------------------------------------------- */ … … 110 125 } 111 126 } 127 112 128 113 129 /* ----------------------------------------------------------------- */ … … 150 166 } 151 167 168 152 169 /* ----------------------------------------------------------------- */ 153 170 /** Return the list of domains / subdomains allowed for this member … … 168 185 return $r; 169 186 } 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 174 192 */ 175 193 function prefix_list() { … … 184 202 } 185 203 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 191 211 * @return boolean TRUE. 192 212 */ … … 201 221 } 202 222 223 203 224 /* ----------------------------------------------------------------- */ 204 225 /** … … 216 237 } 217 238 239 218 240 /* ----------------------------------------------------------------- */ 219 241 /** … … 232 254 return $r; 233 255 } 256 234 257 235 258 /* ----------------------------------------------------------------- */ … … 255 278 } 256 279 280 257 281 /* ----------------------------------------------------------------- */ 258 282 /** 259 * Efface un jeu de statistiques existant.260 * @param integer $id est le numéro du jeu de statistiques à supprimer261 * @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 262 286 */ 263 287 function delete_stats($id) { … … 278 302 } 279 303 304 280 305 /* ----------------------------------------------------------------- */ 281 306 /** 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 285 313 */ 286 314 function add_stats($hostname,$users="", $hostaliases,$public) { … … 321 349 } 322 350 351 323 352 /* ----------------------------------------------------------------- */ 324 353 function list_login() { … … 336 365 return $res; 337 366 } 367 338 368 339 369 /* ----------------------------------------------------------------- */ … … 365 395 } 366 396 397 367 398 /* ----------------------------------------------------------------- */ 368 399 /* Check that a login exists ($exists=1) or doesn't exist ($exists=0) */ … … 378 409 } 379 410 411 380 412 /* ----------------------------------------------------------------- */ 381 413 function del_login($login) { … … 391 423 } 392 424 425 393 426 /* ----------------------------------------------------------------- */ 394 427 function add_login($login,$pass) { … … 410 443 } 411 444 445 412 446 /* ----------------------------------------------------------------- */ 413 447 function change_pass($login,$pass) { … … 428 462 return true; 429 463 } 464 430 465 431 466 /* ----------------------------------------------------------------- */ … … 459 494 return true; 460 495 } 496 497 461 498 /* ----------------------------------------------------------------- */ 462 499 function delete_allowed_login($id,$noconf=0) { … … 476 513 return true; 477 514 } 515 516 478 517 /* ----------------------------------------------------------------- */ 479 518 function deny_login($login,$id,$noconf=0) { // deny user $login to access stats $id. … … 506 545 return true; 507 546 } 547 508 548 509 549 /* ----------------------------------------------------------------- */ … … 526 566 } 527 567 568 528 569 /* ----------------------------------------------------------------- */ 529 570 /** 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 532 573 */ 533 574 function alternc_del_domain($dom) { … … 540 581 $t[]=array($db->f("hostname"),$db->f("id")); 541 582 } 542 // on détruit les jeux de stats associés au préfixe correspondant :543 583 foreach ($t as $i) { 544 584 $db->query("DELETE FROM aws WHERE uid='$cuid' AND hostname='".$i[0]."';"); … … 550 590 } 551 591 592 552 593 /* ----------------------------------------------------------------- */ 553 594 /** 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. 556 598 */ 557 599 function alternc_get_quota($name) { … … 564 606 } else return false; 565 607 } 608 566 609 567 610 /* ----------------------------------------------------------------- */ … … 589 632 } 590 633 591 /* ----------------------------------------------------------------- */ 592 /** Effacement du fichier de conf awstats du domaine $hostname 634 635 /* ----------------------------------------------------------------- */ 636 /** Delete the awstats configuration file for a statistic set. 593 637 * @access private 594 638 */ … … 602 646 } 603 647 604 /* ----------------------------------------------------------------- */ 605 /** Création du fichier de configuration awstat du domaine $id 648 649 /* ----------------------------------------------------------------- */ 650 /** Create a configuration file for a statistic set. 606 651 * if nochk==1, does not check the owner of the stat set (for admin only) 607 652 * @access private … … 637 682 } 638 683 684 685 /* ----------------------------------------------------------------- */ 639 686 function _createhtpasswd() { 640 687 global $db; … … 649 696 } 650 697 698 651 699 /* ----------------------------------------------------------------- */ 652 700 /**
Note: See TracChangeset
for help on using the changeset viewer.
