cvs: php-master-web /fetch cvsforwarding.php /manage users.php

From: Date: Sat, 04 May 2002 15:32:55 +0000
Subject: cvs: php-master-web /fetch cvsforwarding.php /manage users.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-10032@lists.php.net to get a copy of this message
jimw Sat May 4 11:32:55 2002 EDT Modified files: /php-master-web/fetch cvsforwarding.php /php-master-web/manage users.php Log: allow opting in to spam protection for php.net mail aliases Index: php-master-web/fetch/cvsforwarding.php diff -u php-master-web/fetch/cvsforwarding.php:1.9 php-master-web/fetch/cvsforwarding.php:1.10 --- php-master-web/fetch/cvsforwarding.php:1.9 Sun Apr 21 13:58:50 2002 +++ php-master-web/fetch/cvsforwarding.php Sat May 4 11:32:54 2002 @@ -7,10 +7,12 @@ // Connect and generate the list from the DB if (@mysql_pconnect("localhost","nobody","")) { if (@mysql_select_db("php3")) { - $res = @mysql_query("SELECT username,email FROM users WHERE email != '' AND cvsaccess"); + $res = @mysql_query("SELECT username,email,spamprotect FROM users WHERE email != '' AND cvsaccess"); if ($res) { while ($row = @mysql_fetch_array($res)) { - echo "$row[username]@: $row[email];\n"; + echo "$row[username]@php.net: ", + ($row['spamprotect'] ? "|/local/bin/automoderate," : ""), + "$row[email];\n"; } } } Index: php-master-web/manage/users.php diff -u php-master-web/manage/users.php:1.22 php-master-web/manage/users.php:1.23 --- php-master-web/manage/users.php:1.22 Sun Apr 21 13:58:51 2002 +++ php-master-web/manage/users.php Sat May 4 11:32:54 2002 @@ -109,6 +109,7 @@ $in[passwd] = crypt($in[rawpasswd],substr(md5(time()),0,2)); } $cvsaccess = $in[cvsaccess] ? 1 : 0; + $spamprotect = $in[spamprotect] ? 1 : 0; if ($id) { # update main table data @@ -117,6 +118,7 @@ . ($in[passwd] ? ",passwd='$in[passwd]'" : "") . ($in[username] ? ",username='$in[username]'" : "") . (is_admin($user) ? ",cvsaccess=$cvsaccess" : "") + . ",spamprotect=$spamprotect" . " WHERE userid=$id"; query($query); } @@ -128,7 +130,8 @@ $query = "INSERT users SET name='$in[name]',email='$in[email]'" . ($in[username] ? ",username='$in[username]'" : "") . ($in[passwd] ? ",passwd='$in[passwd]'" : "") - . (is_admin($user) ? ",cvsaccess=$cvsaccess" : ""); + . (is_admin($user) ? ",cvsaccess=$cvsaccess" : "") + . ",spamprotect=$spamprotect"; query($query); $nid = mysql_insert_id(); @@ -187,6 +190,10 @@ <td><input type="checkbox" name="in[cvsaccess]"<?php echo $row[cvsaccess] ? " checked" : "";?> /></td> </tr> <?php }?> +<tr> + <th align="right">Use spam protection?</th> + <td><input type="checkbox" name="in[spamprotect]"<?php echo $row[spamprotect] ? " checked" : "";?> /></td> +</tr> <tr> <td><input type="submit" value="<?php echo $id ? "Change" : "Add";?>" /> </tr>

« previous php.mirrors (#10032) next »