Update of /cvsroot/phpslash/phpslash-ft/public_html
In directory sc8-pr-cvs1:/tmp/cvs-serv6541/phpslash-ft/public_html
Modified Files:
db_xfer.php3.disabled config-dist.php3
Log Message:
author migration bugs
Index: db_xfer.php3.disabled
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/public_html/db_xfer.php3.disabled,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** db_xfer.php3.disabled 10 Jan 2003 18:36:08 -0000 1.20
--- db_xfer.php3.disabled 11 Jan 2003 04:48:50 -0000 1.21
***************
*** 1,4 ****
<?php
! // $Id: dbxfer.php3
/*
--- 1,4 ----
<?php
! // $Id: dbxfer.php
/*
***************
*** 10,14 ****
*/
! require("config.php3");
/* Array of availible functions. Please update if need be*/
--- 10,14 ----
*/
! require("config.php");
/* Array of availible functions. Please update if need be*/
***************
*** 72,84 ****
$db->query($q);
while($db->next_record()) {
! $content .= getMessage("User: ". $db->Record['author_name']);
!
$perms_ary = explode(",", $db->Record['perms']);
! if($auth->get_userperms($db->Record[author_id])) {
$content .= getMessage("User already migrated: ". $db->Record['author_name']);
continue;
}
! if(array_key_exists("root", $perms_ary)) {
$lut_id = generateID("psl_author_group_lut_seq");
$lut_insert = "INSERT INTO psl_author_group_lut
(lut_id,
--- 72,95 ----
$db->query($q);
while($db->next_record()) {
! $author_id = $db->Record['author_id'];
! $content .= getMessage("User: ". $db->Record['author_name']."(".$author_id .")");
$perms_ary = explode(",", $db->Record['perms']);
! $has_root = '';
! while ( list( $key, $val ) = each( $perms_ary ) ) {
! if($val == 'root') {
! $has_root = true;
! }
! }
! $q2 = "select * from psl_author_group_lut where author_id = ".
! $db->Record[author_id];
! $db2->query($q2);
! $db2->next_record();
! if($db2->Record[author_id]) {
$content .= getMessage("User already migrated: ". $db->Record['author_name']);
continue;
}
! if($has_root) {
$lut_id = generateID("psl_author_group_lut_seq");
+ $group_id = getGroupId('root');
$lut_insert = "INSERT INTO psl_author_group_lut
(lut_id,
***************
*** 86,96 ****
group_id)
VALUES ('$lut_id',
! '$db->Record[author_id]',
! 'root')";
$db2->query($lut_insert);
$content .= getMessage("Added to root group");
} else {
while ( list( $key, $val ) = each( $perms_ary ) ) {
$lut_id = generateID("psl_author_group_lut_seq");
$lut_insert = "INSERT INTO psl_author_group_lut
(lut_id,
--- 97,110 ----
group_id)
VALUES ('$lut_id',
! '$author_id',
! '$group_id')";
$db2->query($lut_insert);
$content .= getMessage("Added to root group");
+ $has_root = '';
} else {
+ reset($perms_ary);
while ( list( $key, $val ) = each( $perms_ary ) ) {
$lut_id = generateID("psl_author_group_lut_seq");
+ $group_id = getGroupId($val);
$lut_insert = "INSERT INTO psl_author_group_lut
(lut_id,
***************
*** 98,104 ****
group_id)
VALUES ('$lut_id',
! '$db->Record[author_id]',
! '$val')";
! $this->db2->query($lut_insert);
$content .= getMessage("Added to ". $val ." group");
}
--- 112,118 ----
group_id)
VALUES ('$lut_id',
! '$author_id',
! '$group_id')";
! $db2->query($lut_insert);
$content .= getMessage("Added to ". $val ." group");
}
***************
*** 141,144 ****
--- 155,183 ----
}
+
+ /**
+ * getGroupId - return id assign to name
+ *
+ * when given a name, getGroupId returns the id
+ *
+ * @param string name
+ * @access public
+ * return group_id
+ */
+ function getGroupId($name) {
+ if (!$name) {
+ return false;
+ } else {
+ $db = pslNew("slashDB");
+ $q = "SELECT group_id
+ FROM psl_group
+ WHERE group_name = '$name'";
+ $db->query($q);
+ $db->next_record();
+ return $db->f("group_id");
+ }
+ }
+
+
function xfer_blocktypes() {
Index: config-dist.php3
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/public_html/config-dist.php3,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** config-dist.php3 10 Jan 2003 19:50:25 -0000 1.28
--- config-dist.php3 11 Jan 2003 04:48:50 -0000 1.29
***************
*** 258,262 ****
$JPCACHE_DEBUG = 0; // Turn debugging on/off
$JPCACHE_IGNORE_DOMAIN= 1; // Ignore domain name in request(single site)
! $JPCACHE_ON = 0; // Turn caching on/off
$JPCACHE_USE_GZIP = 0; // Whether or not to use GZIP
$JPCACHE_POST = 1; // Should POST's be cached
--- 258,262 ----
$JPCACHE_DEBUG = 0; // Turn debugging on/off
$JPCACHE_IGNORE_DOMAIN= 1; // Ignore domain name in request(single site)
! $JPCACHE_ON = 1; // Turn caching on/off
$JPCACHE_USE_GZIP = 0; // Whether or not to use GZIP
$JPCACHE_POST = 1; // Should POST's be cached
|