File:  [mozdev] / admin / www / dismember.html
Revision 1.9: download - view: text, annotated - select for diffs - revision graph
Wed Mar 12 01:45:26 2003 UTC (14 years, 7 months ago) by cdn
Branches: MAIN
CVS tags: HEAD
missing function

<?php

// $Id: dismember.html,v 1.9 2003/03/12 01:45:26 cdn Exp $

  require(PHP_INC.CONNECT);

// stolen from b2
  
function zeroise($number,$threshold) { // function to add leading zeros when necessary
        $l=strlen($number);
        if ($l<$threshold)
                for ($i=0; $i<($threshold-$l); $i=$i+1) { $number='0'.$number;  }
        return($number);
}

function antispambot($emailaddy, $mailto=0) {
        $emailNOSPAMaddy = '';
        srand ((float) microtime() * 1000000);
        for ($i = 0; $i < strlen($emailaddy); $i = $i + 1) {
                $j = floor(rand(0, 1+$mailto));
                if ($j==0) {
                        $emailNOSPAMaddy .= '&#'.ord(substr($emailaddy,$i,1)).';';
                } elseif ($j==1) {
                        $emailNOSPAMaddy .= substr($emailaddy,$i,1);
                } elseif ($j==2) {
                        $emailNOSPAMaddy .= '%'.zeroise(dechex(ord(substr($emailaddy, $i, 1))), 2);
                }
        }
        $emailNOSPAMaddy = str_replace('@','&#64;',$emailNOSPAMaddy);
        return $emailNOSPAMaddy;
}

// /stolen from b2
  
//  $project = 'flibble';

  $query          = " SELECT *
                      FROM project_privs
                      WHERE project='$project' and commit_priv='Y'
                      ORDER BY username DESC
                    ";

  $query          = "SELECT u.name as name, u.email as email, u.loginID as id, r.name as role
                     FROM project_privs as p, User as u, Role as r, UserRole as ur
                     WHERE p.project='$project'
                     AND p.commit_priv='Y'
                     AND u.loginID=p.username
                     AND ur.userID=u.userID
                     AND r.roleID=ur.roleID";

  $my_result      = mysql_query($query, $connect);

  $e              = mysql_error();
  if($e)
    print  "ERROR:latest_bugs: $e";

  $row            = mysql_num_rows($my_result);

  print '<table class="BZ-table" cellspacing="2" cellpadding="2" border="0">' . "\n";
  print "<thead>\n<tr>\n";
   print '<th class="BZ-th-bug">who</th>' . "\n\n";
  
   print '<th class="BZ-th-desc">id</th>' . "\n\n";
   print '<th class="BZ-th-desc">level</th>' . "\n\n";
  print "</tr>\n</thead>\n";
  
  print "<tbody>\n";
  for($i=0; $i<$row; $i++) {
  
  $name =  mysql_result($my_result, $i, 'name');
  $id =  mysql_result($my_result, $i, 'id');
  $role =  mysql_result($my_result, $i, 'role');
  $email =  mysql_result($my_result, $i, 'email');

    print "<tr>\n<td>\n";
  print '<a href="mailto:' . antispambot(stripslashes($email)) . '">' . $name . '</a>';
    print "\n</td>\n<td>\n";
  print $id;
    print "\n</td>\n<td>\n";
  print $role;
    print "</td>\n</tr>\n";
  
  }
  print "</tbody>\n";
  print "</table>\n";

//phpinfo();
  
?>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>