cvs: pearweb /sql .cvsignore addacls.php addusers.php data.php

From: Date: Fri, 16 Nov 2001 00:50:12 +0000
Subject: cvs: pearweb /sql .cvsignore addacls.php addusers.php data.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-1331@lists.php.net to get a copy of this message
ssb Thu Nov 15 19:50:12 2001 EDT Added files: /pearweb/sql addacls.php Modified files: /pearweb/sql .cvsignore addusers.php data.php Log: * populate CVS ACL table Index: pearweb/sql/.cvsignore diff -u pearweb/sql/.cvsignore:1.1 pearweb/sql/.cvsignore:1.2 --- pearweb/sql/.cvsignore:1.1 Sun Dec 12 07:44:32 1999 +++ pearweb/sql/.cvsignore Thu Nov 15 19:50:11 2001 @@ -1,2 +1,3 @@ *.res *.out +passwd Index: pearweb/sql/addusers.php diff -u pearweb/sql/addusers.php:1.5 pearweb/sql/addusers.php:1.6 --- pearweb/sql/addusers.php:1.5 Mon Nov 12 15:32:54 2001 +++ pearweb/sql/addusers.php Thu Nov 15 19:50:11 2001 @@ -37,7 +37,12 @@ $users[$tmp[0]]['admin'] = $tmp[4]; } -if (is_resource($fp = @fopen("cvsusers", "r"))) { +$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)); Index: pearweb/sql/data.php diff -u pearweb/sql/data.php:1.6 pearweb/sql/data.php:1.7 --- pearweb/sql/data.php:1.6 Mon Nov 12 09:04:17 2001 +++ pearweb/sql/data.php Thu Nov 15 19:50:11 2001 @@ -10,6 +10,7 @@ include "./addusers.php"; include "./addcategories.php"; include "./addpackages.php"; +include "./addacls.php"; function error_handler($obj) { print "Error when adding users: "; Index: pearweb/sql/addacls.php +++ pearweb/sql/addacls.php <?php $acl_paths = array(); $acl_users = array(); $fp = @fopen("avail", "r"); if (empty($fp)) { $fp = @fopen("../../CVSROOT/avail", "r"); } if (is_resource($fp)) { while ($line = fgets($fp, 10240)) { if (substr($line, 0, 6) != "avail|") { continue; } list(,$user,$path) = explode("|", trim($line)); $ua = explode(",", $user); $pa = explode(",", $path); foreach ($ua as $u) { foreach ($pa as $p) { $acl_paths[$p][$u] = true; $acl_users[$u][$p] = true; } } } print "Setting up CVS ACLs..."; $sth = $dbh->prepare("INSERT INTO cvs_acl (handle,path,access) ". "VALUES(?,?,?)"); $ent = 0; foreach ($acl_paths as $path => $acldata) { foreach ($acldata as $user => $foo) { $dbh->execute($sth, array($user, $path, 1)); $ent++; } } print "$ent entries\n"; } ?>

« previous php.pear.cvs (#1331) next »