Changeset 1047

Show
Ignore:
Timestamp:
09/09/04 00:01:32 (4 years ago)
Author:
anonymous
Message:

- correction du password 32 -> 38 caract�res (MD5 arrgg !)
- correction du conf template : allow only authenticated web users
- misc corrections web

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/awstats.sql

    r1034 r1047  
    1212  `uid` int(10) unsigned NOT NULL, 
    1313  `login` varchar(128) NOT NULL, 
    14   `pass` varchar(32) NOT NULL, 
     14  `pass` varchar(38) NOT NULL, 
    1515  PRIMARY KEY (`login`), 
    1616  INDEX (`uid`) 
  • trunk/awstats.template.conf

    r1046 r1047  
    170170# Default: 0 
    171171# 
    172 AllowAccessFromWebToAuthenticatedUsersOnly=0 
     172AllowAccessFromWebToAuthenticatedUsersOnly=1 
    173173 
    174174# This parameter give the list of all authorized authenticated users to view 
  • trunk/bureau/admin/aws_pass.php

    r1046 r1047  
    6060<tr><th> 
    6161<?php __("Username"); ?></th><td> 
    62         <code><?php echo $login; ?></code> 
     62        <code><?php echo $login; ?></code> <input type="hidden" name="login" value="<?php echo $login; ?>" /> 
    6363</td></tr> 
    6464<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> 
  • trunk/bureau/admin/aws_users.php

    r1046 r1047  
    4848        <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="<?php echo $login; ?>" size="20" maxlength="64" /> 
    4949</td></tr> 
    50 <tr><th><label for="pass"><?php __("Password"); ?></label></th><td><input type="text" class="int" name="pass" id="pass" value="<?php echo $pass; ?>" size="20" maxlength="64" /></td></tr> 
     50<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> 
    5151<tr><td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Create this new awstat account."); ?>" /></td></tr> 
    5252</table> 
  • trunk/bureau/class/m_aws.php

    r1046 r1047  
    4242   */ 
    4343  var $CONFDIR="/etc/awstats"; 
    44  
     44  var $HTAFILE="/etc/alternc/awstats.htpasswd"; 
    4545  var $CACHEDIR="/var/cache/awstats"; 
    4646 
     
    228228      } 
    229229      $this->_createconf($c["hostname"]); 
     230      $this->_createhtpasswd(); 
    230231      return true; 
    231232    } else return false; 
     
    280281      } 
    281282      $this->_createconf($hostname); 
     283      $this->_createhtpasswd(); 
    282284      mkdir($CACHEDIR."/".$hostname,0777); 
    283285      return true; 
     
    341343    } 
    342344    $db->query("DELETE FROM aws_users WHERE uid='$cuid' AND login='$login';"); 
     345    $this->_createhtpasswd(); 
    343346    return true; 
    344347  } 
     
    357360      return false; 
    358361    } 
    359     $pass=_md5cr($pass); 
     362    $pass=crypt($pass); 
    360363    $db->query("INSERT INTO aws_users (uid,login,pass) VALUES ('$cuid','$login','$pass');"); 
     364    $this->_createhtpasswd(); 
    361365    return true; 
    362366  } 
     
    377381    $pass=_md5cr($pass); 
    378382    $db->query("UPDATE aws_users SET pass='$pass' WHERE login='$login';"); 
     383    $this->_createhtpasswd(); 
    379384    return true; 
    380385  } 
     
    404409    } 
    405410    $db->query("INSERT INTO aws_access (uid,id,login) VALUES ('$cuid','$id','$login');"); 
    406     if (!$noconf) { $this->_createconf($id); } 
     411    if (!$noconf) {  
     412      $this->_createconf($id);  
     413      $this->_createhtpasswd(); 
     414    } 
    407415    return true; 
    408416  } 
     
    418426    } 
    419427    $db->query("DELETE FROM aws_access WHERE id='$id';"); 
    420     if (!$noconf) { $this->_createconf($id); } 
     428    if (!$noconf) {  
     429      $this->_createconf($id);  
     430      $this->_createhtpasswd(); 
     431    } 
    421432    return true; 
    422433  } 
     
    445456    } 
    446457    $db->query("DELETE FROM aws_access WHERE id='$id' AND login='$login';"); 
    447     if (!$noconf) { $this->_createconf($id); } 
     458    if (!$noconf) {  
     459      $this->_createconf($id);  
     460      $this->_createhtpasswd(); 
     461    } 
    448462    return true; 
    449463  } 
     
    462476      $this->_delconf($i); 
    463477    } 
     478    $this->_createhtpasswd(); 
    464479    $db->query("DELETE FROM aws_access WHERE uid='$cuid'"); 
    465480    $db->query("DELETE FROM aws_users WHERE uid='$cuid';"); 
     
    490505      $this->_delconf($i[0]); 
    491506    } 
     507    $this->_createhtpasswd(); 
    492508    return true; 
    493509  } 
     
    574590  } 
    575591 
     592  function _createhtpasswd() { 
     593    global $db; 
     594    $f=fopen($this->HTAFILE,"wb"); 
     595    if ($f) { 
     596      $db->query("SELECT login,pass FROM aws_users;"); 
     597      while ($db->next_record()) { 
     598        fputs($f,$db->f("login").":".$db->f("pass")."\n"); 
     599      } 
     600      fclose($f); 
     601    } 
     602  } 
     603 
    576604} /* CLASSE m_aws */ 
    577605 
  • trunk/debian/dirs

    r1037 r1047  
     1etc/apache 
    12etc/alternc 
    23var/cache/awstats 
     
    1011usr/share/doc/alternc-awstats 
    1112usr/share/lintian/overrides 
    12 usr/share/awstats/icon/ 
     13usr/share/awstats/icon/other/ 
    1314etc/awstats 
  • trunk/debian/postinst

    r1046 r1047  
    1313        sed -e "s/\*\*\*ALTERNC_ALIASES\*\*\*/&\\ 
    1414            # ***AWSTATS*** \\ 
    15         Alias \/awstats-icons\/ \/usr\/share\/awstats\/icons\/ " <$1 >$1.alternc_awstats 
     15        Include \"\/etc\/apache\/alternc-awstats.conf\"/" <$1 >$1.alternc_awstats 
    1616        mv -f $1.alternc_awstats $1 
    1717    fi 
     
    4242    echo "Configuring apache" 
    4343    configure /etc/apache/httpd.conf 
     44    configure /usr/share/alternc/1.0/install/etc/apache-ssl/httpd.conf 
    4445    echo "Configuring apache-ssl" 
    4546    configure /etc/apache-ssl/httpd.conf 
     47    configure /usr/share/alternc/1.0/install/etc/apache/httpd.conf 
    4648    /usr/share/alternc/install/dopo.sh || true 
    4749    /etc/init.d/apache reload || true 
     50    ln /usr/lib/cgi-bin/awstats.pl /var/alternc/cgi-bin/ -sf  
    4851 
    4952    # that's not very nice, but we need it 
    5053    chown www-data /etc/awstats 
     54    touch /etc/alternc/awstats.htpasswd 
     55    chown 33 /etc/alternc/awstats.htpasswd 
     56    chmod 777 /etc/alternc/awstats.htpasswd 
    5157 
    5258    # Finally, add this module to the AlternC's menu :  
  • trunk/debian/postrm

    r1046 r1047  
    1010        # 1. on déplace le fichier 
    1111        rm -f $1.alternc_awstats 
    12         cat $1 | grep -v "\*\*\*AWSTATS\*\*\*" | grep -v "     Alias /awstats-icon/"  >$1.alternc_awstats 
     12        cat $1 | grep -v "\*\*\*AWSTATS\*\*\*" | grep -v "Alias /awstats-icon/"  >$1.alternc_awstats 
    1313        mv -f $1.alternc_awstats $1  
    1414    fi 
  • trunk/debian/rules

    r1038 r1047  
    5757        find debian/alternc-awstats/ -depth -name CVS -type d -exec rm -rf {} \; 
    5858 
    59         install -m 0755 -g www-data -o www-data awstats_alternc.png debian/alternc-awstats/usr/share/awstats/icon/ 
     59        install -m 0755 -g www-data -o www-data alternc-awstats.conf debian/alternc-awstats/etc/apache/ 
     60        install -m 0755 -g www-data -o www-data awstats_alternc.png debian/alternc-awstats/usr/share/awstats/icon/other/ 
    6061        install -m 0755 -g www-data -o www-data alternc-awstats debian/alternc-awstats/usr/lib/alternc/ 
    6162        install -m 0755 -g www-data -o www-data awstats.cache.php debian/alternc-awstats/usr/lib/alternc/