Changeset 1047
- Timestamp:
- 09/09/04 00:01:32 (4 years ago)
- Files:
-
- trunk/alternc-awstats.conf (added)
- trunk/awstats.sql (modified) (1 diff)
- trunk/awstats.template.conf (modified) (1 diff)
- trunk/bureau/admin/aws_pass.php (modified) (1 diff)
- trunk/bureau/admin/aws_users.php (modified) (1 diff)
- trunk/bureau/class/m_aws.php (modified) (12 diffs)
- trunk/debian/dirs (modified) (2 diffs)
- trunk/debian/postinst (modified) (2 diffs)
- trunk/debian/postrm (modified) (1 diff)
- trunk/debian/rules (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/awstats.sql
r1034 r1047 12 12 `uid` int(10) unsigned NOT NULL, 13 13 `login` varchar(128) NOT NULL, 14 `pass` varchar(3 2) NOT NULL,14 `pass` varchar(38) NOT NULL, 15 15 PRIMARY KEY (`login`), 16 16 INDEX (`uid`) trunk/awstats.template.conf
r1046 r1047 170 170 # Default: 0 171 171 # 172 AllowAccessFromWebToAuthenticatedUsersOnly= 0172 AllowAccessFromWebToAuthenticatedUsersOnly=1 173 173 174 174 # This parameter give the list of all authorized authenticated users to view trunk/bureau/admin/aws_pass.php
r1046 r1047 60 60 <tr><th> 61 61 <?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; ?>" /> 63 63 </td></tr> 64 64 <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 48 48 <select class="inl" name="prefixe"><?php $aws->select_prefix_list($prefixe); ?></select> <b>_</b> <input type="text" class="int" name="login" id="login" value="<?php echo $login; ?>" size="20" maxlength="64" /> 49 49 </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> 51 51 <tr><td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Create this new awstat account."); ?>" /></td></tr> 52 52 </table> trunk/bureau/class/m_aws.php
r1046 r1047 42 42 */ 43 43 var $CONFDIR="/etc/awstats"; 44 44 var $HTAFILE="/etc/alternc/awstats.htpasswd"; 45 45 var $CACHEDIR="/var/cache/awstats"; 46 46 … … 228 228 } 229 229 $this->_createconf($c["hostname"]); 230 $this->_createhtpasswd(); 230 231 return true; 231 232 } else return false; … … 280 281 } 281 282 $this->_createconf($hostname); 283 $this->_createhtpasswd(); 282 284 mkdir($CACHEDIR."/".$hostname,0777); 283 285 return true; … … 341 343 } 342 344 $db->query("DELETE FROM aws_users WHERE uid='$cuid' AND login='$login';"); 345 $this->_createhtpasswd(); 343 346 return true; 344 347 } … … 357 360 return false; 358 361 } 359 $pass= _md5cr($pass);362 $pass=crypt($pass); 360 363 $db->query("INSERT INTO aws_users (uid,login,pass) VALUES ('$cuid','$login','$pass');"); 364 $this->_createhtpasswd(); 361 365 return true; 362 366 } … … 377 381 $pass=_md5cr($pass); 378 382 $db->query("UPDATE aws_users SET pass='$pass' WHERE login='$login';"); 383 $this->_createhtpasswd(); 379 384 return true; 380 385 } … … 404 409 } 405 410 $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 } 407 415 return true; 408 416 } … … 418 426 } 419 427 $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 } 421 432 return true; 422 433 } … … 445 456 } 446 457 $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 } 448 462 return true; 449 463 } … … 462 476 $this->_delconf($i); 463 477 } 478 $this->_createhtpasswd(); 464 479 $db->query("DELETE FROM aws_access WHERE uid='$cuid'"); 465 480 $db->query("DELETE FROM aws_users WHERE uid='$cuid';"); … … 490 505 $this->_delconf($i[0]); 491 506 } 507 $this->_createhtpasswd(); 492 508 return true; 493 509 } … … 574 590 } 575 591 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 576 604 } /* CLASSE m_aws */ 577 605 trunk/debian/dirs
r1037 r1047 1 etc/apache 1 2 etc/alternc 2 3 var/cache/awstats … … 10 11 usr/share/doc/alternc-awstats 11 12 usr/share/lintian/overrides 12 usr/share/awstats/icon/ 13 usr/share/awstats/icon/other/ 13 14 etc/awstats trunk/debian/postinst
r1046 r1047 13 13 sed -e "s/\*\*\*ALTERNC_ALIASES\*\*\*/&\\ 14 14 # ***AWSTATS*** \\ 15 Alias \/awstats-icons\/ \/usr\/share\/awstats\/icons\/" <$1 >$1.alternc_awstats15 Include \"\/etc\/apache\/alternc-awstats.conf\"/" <$1 >$1.alternc_awstats 16 16 mv -f $1.alternc_awstats $1 17 17 fi … … 42 42 echo "Configuring apache" 43 43 configure /etc/apache/httpd.conf 44 configure /usr/share/alternc/1.0/install/etc/apache-ssl/httpd.conf 44 45 echo "Configuring apache-ssl" 45 46 configure /etc/apache-ssl/httpd.conf 47 configure /usr/share/alternc/1.0/install/etc/apache/httpd.conf 46 48 /usr/share/alternc/install/dopo.sh || true 47 49 /etc/init.d/apache reload || true 50 ln /usr/lib/cgi-bin/awstats.pl /var/alternc/cgi-bin/ -sf 48 51 49 52 # that's not very nice, but we need it 50 53 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 51 57 52 58 # Finally, add this module to the AlternC's menu : trunk/debian/postrm
r1046 r1047 10 10 # 1. on déplace le fichier 11 11 rm -f $1.alternc_awstats 12 cat $1 | grep -v "\*\*\*AWSTATS\*\*\*" | grep -v " Alias /awstats-icon/" >$1.alternc_awstats12 cat $1 | grep -v "\*\*\*AWSTATS\*\*\*" | grep -v "Alias /awstats-icon/" >$1.alternc_awstats 13 13 mv -f $1.alternc_awstats $1 14 14 fi trunk/debian/rules
r1038 r1047 57 57 find debian/alternc-awstats/ -depth -name CVS -type d -exec rm -rf {} \; 58 58 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/ 60 61 install -m 0755 -g www-data -o www-data alternc-awstats debian/alternc-awstats/usr/lib/alternc/ 61 62 install -m 0755 -g www-data -o www-data awstats.cache.php debian/alternc-awstats/usr/lib/alternc/
