Changeset 1184

Show
Ignore:
Timestamp:
10/24/06 13:10:44 (2 years ago)
Author:
jm3
Message:
  • minor interface tweak to user page
  • tag/link ratio now a spam-limiting factor
  • forgotten passwords can no longer be mailed to snuffed users
  • new users are no longer featured on the site homepage (having to do this really sucks, but spammers are abusing it.)
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • feedmelinks/import/do-random-checks.inc.php

    r1172 r1184  
    11<% 
    2         # 3. randomly sample (both contiguous run and scatter) the links to 
    3         # check 4 uniqueness against other links in the imported bookmarks 
    4         # file as well as uniqueness against the users existing FML links 
    5         # (to detect possible linkspammers) 
     2        # 3. randomly sample (both contiguous run and scatter) the links to: 
     3        #  
     4        #   * check 4 uniqueness against other links in the imported bookmarks 
     5        #   * check for uniqueness against the users existing FML links 
    66 
    77        $p = 10; # % 
  • feedmelinks/import/ready-to-import.php

    r1175 r1184  
    1616    $dir        = $b["dir"]; 
    1717    $path       = $b["path"]; 
    18      
     18 
    1919                $max_allowed_links = 1000; 
    20     $max_allowed_tags = 500; 
     20    $max_allowed_tags  = 300; 
     21    $max_tags_to_links_ratio = 0.3; 
    2122 
    2223                $parser = get_xsl_parser(); 
     
    2728                $result = exec( $cmd ); 
    2829                if( preg_match( "/SUCCESS/", $result )) { 
    29                          
    3030                        # extract whatever delimeter the perl used from the result XML: 
    3131                        $delimeter = preg_replace( '/^[^"]+"([^"]+).*/', "\${1}", $result ); 
     
    3636                        $ls = sizeof( $links ); 
    3737                        $ts = sizeof( $tags ); 
    38                          
    39                         if( ($ls < $max_allowed_links && $ts < $max_allowed_tags) || is_privileged_importer( $u ) ) { 
     38 
     39                        if(  
     40                                        ( 
     41                                                $ls < $max_allowed_links  
     42                                                && $ts < $max_allowed_tags 
     43                                                && ($max_allowed_tags / $max_allowed_links) < $max_tags_to_links_ratio 
     44                                        ) 
     45                                        || is_privileged_importer( $u ) )  
     46                        { 
     47 
    4048                                #tell( "Debugging Check:", "We found " . $ls . " links and " . $ts . " tags, which is allowed. Proceeding." ); 
    4149 
     
    4755 
    4856                        } else { 
    49                                 fatal( "Wow! You have a very nice collection of links. Because you have approximately " . $ls . " links and " . $ts . " tags, which is more than the average user, your import has bene 'flagged for review' by our team to make sure everything is imported correctly. A notice has been sent to the team and they will be in contact with you shortly to finish the import process. <p />Thanks very much,<p /> -- <a href='http://jm3.net/'><b>John Manoogian III</b></a><br /> &nbsp; &nbsp;<a href='http://codeswami.com'>Code Swami</a>: Feed Me Links" ); 
     57                                fatal( "Wow! You have a very nice collection of links. Because you have approximately " . $ls . " links and " . $ts . " tags, your import has bene 'flagged for review' by our team to make sure everything is imported correctly. A notice has been sent to the team and they will be in contact with you shortly to finish the import process. <p />Thanks very much,<p /> -- <a href='http://jm3.net/'><b>John Manoogian III</b></a><br /> &nbsp; &nbsp;<a href='http://codeswami.com'>Code Swami</a>: Feed Me Links" ); 
    5058 
    51                                 # FIXME: missing mail call here. 
    5259                                $headers = ""; 
    5360 
     
    6572                } else { 
    6673                        fatal( "$result : couldn't parse result of $bin/import-bookmarks.pl $dir/$file_name" ); 
    67                        
     74               
    6875 
    6976                include_once( "$modules/footer.inc.php" ); 
  • feedmelinks/misc/forgot-password.php

    r927 r1184  
    77        $messages   = ""; 
    88 
    9         if( $userId || $email ) { 
     9        if( ($userId || $email) && !snuffed( $userId )) { 
    1010                mysql_connect(); 
    1111                mysql_selectdb( getDBName() ); 
    12                  
     12 
    1313                if( $userId ) { 
    1414                        # check for id 
     
    4242                        $mailSuccess = mail( $email, $subject, $body, $headers); 
    4343                        #echo "mailSuccessL $mailSuccess<br />"; 
     44                        log_mesg_to( "sent password reminder to $email ($userId)", "mail" ); 
    4445 
    4546                        $messages = "emailing your password to " . ( $userId ? "$userId's email address" : $email ) . "...<br /><h2>Email sent!</h2>"; 
     
    4849                        $messages = "That $label was not found. Please check your spelling<br />(and make sure that you still exist.)"; 
    4950                } 
    50  
    5151        } 
    5252%> 
    5353 
    54 <title> Feed Me My Password, Dammit! </title> 
     54<title> Feed Me My Password, please! </title> 
    5555 
    5656<% if( $messages ) { %> 
  • feedmelinks/modules/highest-linking-users.inc.php

    r395 r1184  
    33 
    44        $limit = $limit ? $limit : 7; 
    5         $qs = "SELECT COUNT(*) AS lc, submitter AS u FROM links GROUP BY submitter ORDER BY lc DESC LIMIT $limit;"; 
     5        $qs = "SELECT COUNT(*) AS lc, submitter AS u FROM links WHERE isPrivate IS NULL GROUP BY submitter ORDER BY lc DESC LIMIT $limit;"; 
    66 
    77        $con = mysql_connect(); 
  • feedmelinks/modules/utils.inc.php

    r1178 r1184  
    24062406} 
    24072407 
     2408# this depends on the next being a closure: function is_banned( $u, $mesg ) { } 
     2409 
    24082410function addUser( $argUserId, $argEmail, $argPassword, $argName ) { 
    24092411 
     
    24112413        $ip = get_ip(); 
    24122414        $q = run_query( getQuery( "multiple_accounts_from_this_ip", $ip )); 
    2413  
    24142415        $num_rows = mysql_num_rows($q); 
    24152416        if( $num_rows > 1 ) { 
    2416                 fire( "Possible spammer-birth in progress!", "Multiple accounts being requested from the same IP ($ip) -- user: $argUserId, $argEmail" ); 
     2417                fire( "Possible spammer-birth in progress!", "Multiple accounts being requested from the same IP ($ip) -- user: http://feedmelinks.com/u/$argUserId, $argEmail" ); 
    24172418                log_mesg_to( "WARN. potential spammer $argUserId ($argEmail) creating multiple accounts from the same IP", "global" ); 
    24182419                $q = run_query( getQuery( "log_ip", $argUserId, $argEmail, $ip )); 
    24192420                return; 
    2420         } else { 
    2421                 # if not, log this IP in case we see it again: 
     2421        } else { # if not, log this IP in case we see it again: 
    24222422                $q = run_query( getQuery( "log_ip", $argUserId, $argEmail, $ip )); 
    24232423        } 
  • feedmelinks/modules/view-link.inc.php

    r1177 r1184  
    9898        </div> 
    9999 
    100 <% if( getNumSimilarUrls( $link, $l )) { %> 
    101  
    102         <div class="linkbox" style="border: 1px solid #bbbbbb; margin-top: 5px;"> 
    103                 <%= getSimilarlyLinkingUsers( $link, $l, 5 ) %><br /> 
    104         </div> 
    105  
    106 <% } %> 
    107  
    108100        <div class="linkbox" style="border: 1px solid #bbbbbb; margin-top: 5px;"> 
    109101        &nbsp; <a accesskey="f" href="/search?q=<%= urlencode( str_replace ( " ", "%", $name) ) %>"><img src="/img/mag-glass.png" height="20"  
  • feedmelinks/portal-uncached.php

    r1170 r1184  
    234234        </div> 
    235235 
    236         <div id="newUsers" class="box"> 
     236        <!-- <div id="newUsers" class="box"> 
    237237                <div class="subhead"> 
    238238                        new users  
    239239                        <span class="note">(with at least 2 links)</span> 
    240240                </div> 
    241                 <% include_once( "$modules/recent-users.inc.php"); %> 
    242         </div> 
     241                disabled for now 
     242                <% #include_once( "$modules/recent-users.inc.php"); %> 
     243        </div> 
     244        --> 
    243245 
    244246        <div id="hallOfFame" class="box"> 
  • feedmelinks/users.php

    r1182 r1184  
    114114                <form name="snuff_user_form" action="/admin/snuff" method="POST"> 
    115115                        <input type="hidden" name="user" value="<%= $userId %>" /> 
    116                         <input type="submit" style="background-color: firebrick;" value="End this user's pathetic life?" /> 
     116                        <input type="submit" style="background-color: pink;" value="End this user's pathetic life?" /> 
    117117                </form> 
    118118        </p>