| <?php |
| require_once "/home/data/httpd/eclipse-php-classes/system/dbconnection_bugs_ro.class.php"; |
| |
| function check_email_as_webtools_committer( $email ) { |
| $found = FALSE; |
| $ds = ldap_connect("main"); |
| ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); |
| if ($ds) { |
| $r = @ldap_bind($ds); # anonymous bind |
| if( $r ) { |
| $sr=ldap_search($ds, "ou=people,dc=eclipse,dc=org", "(mail=$email)"); |
| $sr2=ldap_search($ds, "cn=webtools,ou=group,dc=eclipse,dc=org", "(member=*)"); |
| $info = ldap_get_entries($ds, $sr); |
| $info2 = ldap_get_entries($ds, $sr2); |
| $uid = "DOESNOTEXIST"; |
| $i = 0; |
| for ($ii=0; $ii<$info[$i]["count"]; $ii++){ |
| $data = $info[$i][$ii]; |
| #echo $data."($i.$ii): ".$info[$i][$data][0]."<br>"; |
| if( $data == "uid" ) { |
| $uid = $info[$i][$data][0]; |
| } |
| } |
| $i = 0; |
| for ($ii=0; $ii<$info2[$i]["count"]; $ii++){ |
| $data = $info2[$i][$ii]; |
| echo $data."($i.$ii): ".$info2[$i][$data][0]."<br>"; |
| if( $data == "member" ) { |
| for($j = 0; $j<$info2[$i][$data]["count"]; $j++ ) { |
| $attr = $info2[$i][$data][$j]; |
| #echo " ". $attr . "<br>"; |
| if( strstr( $attr, $uid ) ) { |
| $found = true; |
| } |
| } |
| } |
| } |
| |
| } |
| } |
| ldap_close($ds); |
| return $found; |
| } |
| |
| function check_email_as_eclipse_account( $email ) { |
| $found = FALSE; |
| $ds = ldap_connect("main"); |
| ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); |
| if ($ds) { |
| $r = @ldap_bind($ds); # anonymous bind |
| if( $r ) { |
| $sr=ldap_search($ds, "ou=people,dc=eclipse,dc=org", "(mail=$email)"); |
| $info = ldap_get_entries($ds, $sr); |
| $i = 0; |
| for ($ii=0; $ii<$info[$i]["count"]; $ii++){ |
| $data = $info[$i][$ii]; |
| #echo $data."($i.$ii): ".$info[$i][$data][0]."<br>"; |
| if( $data == "uid" ) { |
| $found = true; |
| } |
| } |
| |
| } |
| } |
| ldap_close($ds); |
| return $found; |
| } |
| |
| function count_loc( $data ) { |
| $count = substr_count( $data, "\n" ); |
| return $count; |
| } |
| |
| ini_set("display_errors", "true"); |
| error_reporting (E_ALL); |
| |
| $dbc = new DBConnectionBugs(); |
| $dbh = $dbc->connect(); |
| |
| $sql_info = "SELECT * |
| FROM products |
| ORDER BY id"; |
| |
| $rs = mysql_query($sql_info, $dbh); |
| |
| $output_file = "ipbugquerys.csv"; |
| |
| @ini_set('zlib.output_compression', 'Off'); |
| header('Pragma: public'); |
| header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT'); |
| header('Cache-Control: no-store, no-cache, must-revalidate'); |
| header('Cache-Control: pre-check=0, post-check=0, max-age=0'); |
| header('Content-Transfer-Encoding: none'); |
| |
| // This should work for IE & Opera |
| //header('Content-Type: application/octetstream; name="' . $output_file . '"'); |
| |
| // This should work for the rest |
| //header('Content-Type: application/octet-stream; name="' . $output_file . '"'); |
| //header('Content-Disposition: inline; filename="' . $output_file . '"'); |
| |
| echo "Bug Query Page: List Product Ids and Names in Bugzilla database<br />"; |
| |
| echo "n product id name<br />"; |
| |
| echo "rs: ". $rs . "<br />"; |
| |
| $debug_count = 0; |
| |
| while( ($debug_count < 1000) && ($myrow = mysql_fetch_assoc($rs)) ) { |
| |
| $debug_count++; |
| |
| echo $debug_count . ","; |
| echo $myrow['id']; |
| echo " "; |
| echo $myrow['name']; |
| echo "<br />"; |
| |
| } |
| |
| $dbc->disconnect(); |
| |
| $rs = null; |
| $dbh = null; |
| $dbc = null; |
| |
| exit(); |
| ?> |