cvs: pearweb /public_html export.php /sql .cvsignore addusers.php
| From: | Stig Bakken | Date: | Fri, 16 Nov 2001 01:07:08 +0000 |
| Subject: | cvs: pearweb /public_html export.php /sql .cvsignore addusers.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-1332@lists.php.net to get a copy of this message | ||
ssb Thu Nov 15 20:07:08 2001 EDT
Added files:
/pearweb/public_html export.php
Modified files:
/pearweb/sql .cvsignore addusers.php
Log:
* added user/acl export script
Index: pearweb/sql/.cvsignore
diff -u pearweb/sql/.cvsignore:1.2 pearweb/sql/.cvsignore:1.3
--- pearweb/sql/.cvsignore:1.2 Thu Nov 15 19:50:11 2001
+++ pearweb/sql/.cvsignore Thu Nov 15 20:07:08 2001
@@ -1,3 +1,4 @@
*.res
*.out
passwd
+cvsusers
Index: pearweb/sql/addusers.php
diff -u pearweb/sql/addusers.php:1.6 pearweb/sql/addusers.php:1.7
--- pearweb/sql/addusers.php:1.6 Thu Nov 15 19:50:11 2001
+++ pearweb/sql/addusers.php Thu Nov 15 20:07:08 2001
@@ -38,14 +38,11 @@
}
$fp = @fopen("cvsusers", "r");
-if (empty($fp)) {
- $fp = @fopen("../../CVSROOT/cvsusers", "r");
-}
-
if (is_resource($fp)) {
while ($line = fgets($fp, 1024)) {
if (!trim($line)) continue;
list($user,$name,$email) = explode(":", trim($line));
+ print "user=$user email=$email name=$name\n";
$name = preg_replace('/\s\s+/', ' ', $name);
$users[$user]['user'] = $user;
$users[$user]['name'] = $name;
@@ -54,7 +51,8 @@
fclose($fp);
}
-if (is_resource($fp = @fopen("passwd", "r"))) {
+$fp = @fopen("passwd", "r");
+if (is_resource($fp)) {
while ($line = fgets($fp, 1024)) {
if (!trim($line)) continue;
list($user,$pw,$groups) = explode(":", trim($line));
Index: pearweb/public_html/export.php
+++ pearweb/public_html/export.php
<?php
if ($what == "avail") {
header("Content-type: text/plain");
print "unavail\n";
$sth = $dbh->query("SELECT handle,path FROM cvs_acl");
while ($sth->fetchInto($row, DB_FETCHMODE_ORDERED) === DB_OK) {
$acl_paths[$row[1]][$row[0]] = true;
}
foreach ($acl_paths as $path => $acldata) {
$users = implode(",", array_keys($acldata));
print "avail|$users|$path\n";
}
} elseif ($what == "cvsusers") {
header("Content-type: text/plain");
$sth = $dbh->query("SELECT handle,name,email FROM users");
while ($sth->fetchInto($row, DB_FETCHMODE_ORDERED)) {
print implode(":", $row) . "\n";
}
} elseif ($what == "passwd") {
header("Content-type: text/plain");
$sth = $dbh->query("SELECT handle,password FROM users");
while ($sth->fetchInto($row, DB_FETCHMODE_ORDERED)) {
print implode(":", $row) . ":cvs\n";
}
}
?>