https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112631
Revision: 112631
Author: reedy
Date: 2012-02-28 20:36:33 +0000 (Tue, 28 Feb 2012)
Log Message:
-----------
Updated from formey
Dropped trailing ?>
Modified Paths:
--------------
trunk/tools/subversion/users.php
Modified: trunk/tools/subversion/users.php
===================================================================
--- trunk/tools/subversion/users.php 2012-02-28 20:14:39 UTC (rev 112630)
+++ trunk/tools/subversion/users.php 2012-02-28 20:36:33 UTC (rev 112631)
@@ -1,56 +1,57 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
- <title>Wikimedia Subversion user list</title>
- </head>
-
- <body>
- <h1>Wikimedia Subversion user list</h1>
- <table border="1">
- <tr>
- <th>Username</th>
- <th>Real name</th>
- <th>Ready for git?</th>
- </tr>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
+<head>
+ <title>Wikimedia Subversion user list</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+</head>
+<body>
+<h1>Wikimedia Subversion user list</h1>
+<table border="1">
+ <tr>
+ <th>Username</th>
+ <th>Real name</th>
+ <th>Ready for git?</th>
+ </tr>
<?php
$time = microtime( true );
-$lines = file( '/etc/passwd' );
+exec( "getent passwd", $lines );
exec( "HOME=/tmp /usr/bin/svn up /var/cache/svnusers 2>&1", $output, $retval );
if ( $retval ) {
$error = implode( "\n", $output );
} else {
$error = false;
}
+$committed = file( '/home/demon/commit' );
foreach ( $lines as $line ) {
$parts = explode( ':', trim( $line ) );
- if ( !isset( $parts[2] ) || $parts[2] < 501 ) {
+ if ( !isset( $parts[2] ) || $parts[2] < 500 ) {
continue;
}
$userInfo = getUserInfo( $parts[0] );
$encUsername = htmlspecialchars( $parts[0] );
$userInfo = array_map( 'htmlspecialchars', $userInfo );
- $readyForGit = isset( $userInfo['name'] ) && isset( $userInfo['email']
) ? 'Y' : 'N';
$link = $userInfo['url'] ? "<a
href=\"{$userInfo['url']}\">$encUsername</a>" : $encUsername;
+ $readyForGit = isset( $userInfo['name'] ) && isset( $userInfo['email']
) ? 'Y' : 'N';
+ $haveCommitted = in_array( $parts[0], $committed ) ? 'Y' : 'N';
$rows[$parts[0]] = <<<EOT
- <tr id="$encUsername">
- <td>$link</td>
- <td>{$userInfo['name']}</td>
- <td>$readyForGit</td>
- </tr>
+<tr id="$encUsername">
+<td>$link</td>
+<td>{$userInfo['name']}</td>
+<td>$readyForGit</td>
+</tr>
EOT;
}
ksort( $rows );
-echo implode( '', $rows );
-echo " </table>\n";
-echo " <!-- Request time: " . ( microtime( true ) - $time ) . " -->\n";
+echo implode( '', $rows ) . "</table>\n";
+echo "<!-- Request time: " . ( microtime( true ) - $time ) . " -->\n";
if ( $retval ) {
- echo " <p>Error: " . htmlspecialchars( $error ) . "</p>\n";
+ echo "<p>Error: " . htmlspecialchars( $error ) . "</p>\n";
}
+echo "</html>\n";
function getUserInfo( $userName ) {
$userInfo = array(
@@ -69,8 +70,3 @@
}
return $userInfo;
}
-
-?>
-
- </body>
-</html>
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs