Xaraya / Postnuke CVS Notices - Message

Note: this list is kept only as a demonstration for CVSNotice. For the latest CVS notices, see the Xaraya and Postnuke sites

View Statistics - Next Notice - Previous Notice

Directory filter : [ all ] / postnuke_modules / New_pnadmin / html / modules / admin [ view in CVS ]

Date Directory [filter] File(s) [view] Author [filter]
14 Aug 2002 20:09:48postnuke_modules/New_pnadmin/html/modules/adminpninit.php,1.3,1.4Richard Cave
 Fixed errors in generating id for INSERT

Update of /home/cvsroot/postnuke_modules/New_pnadmin/html/modules/admin
In directory ns7.hostnuke.net:/tmp/cvs-serv24417/New_pnadmin/html/modules/admin

Modified Files:
	pninit.php 
Log Message:
Fixed errors in generating id for INSERT


Index: pninit.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/New_pnadmin/html/modules/admin/pninit.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** pninit.php	10 Aug 2002 00:31:51 -0000	1.3
--- pninit.php	14 Aug 2002 20:09:45 -0000	1.4
***************
*** 118,127 ****
          $UseLock        = $lockID[$newTabName];
          $default        = $defaultID[$newTabName];
          $infotype_cols = &$pntable['group'];
  
          // Generate id
!         $groupID = $dbconn->GenId($infotype_cols['id']);
  
!         $query = "INSERT INTO ".$pntable['group_table'].
              " (". $infotype_cols['id'].",". $infotype_cols['lock'].",".$infotype_cols['order'].",". $infotype_cols['name'].",". $infotype_cols['default']." )".
              " VALUES ('".$groupID."','".$UseLock."','".$sortOrder."','".$newTabName."','".$default."')";
--- 118,128 ----
          $UseLock        = $lockID[$newTabName];
          $default        = $defaultID[$newTabName];
+         $table          = $pntable['group_table'];
          $infotype_cols = &$pntable['group'];
  
          // Generate id
!         $groupID = $dbconn->GenId( $table );
  
!         $query = "INSERT INTO ".$table.
              " (". $infotype_cols['id'].",". $infotype_cols['lock'].",".$infotype_cols['order'].",". $infotype_cols['name'].",". $infotype_cols['default']." )".
              " VALUES ('".$groupID."','".$UseLock."','".$sortOrder."','".$newTabName."','".$default."')";
***************
*** 129,145 ****
          $resultIns = $dbconn->Execute( $query );
          if ($resultIns == false) {
!             pnSessionSetVar('errormsg', "INSERT into ".$pntable['group_table']." table failed.");
              return false;
          }else{
              // Get the newly generated id
!             $groupID = $dbconn->PO_Insert_ID( $pntable, $infotype_cols['id'] );
  
              // New table - not to be confused with above id from group table
!             $infotype_cols = &$pntable['members'];
  
              for($i = 0;$i < count($listODModIDs);$i++){
                  $modID = $listODModIDs[$i];
  
!                 $query = "INSERT INTO ".$pntable['member_table'].
                      " (". $infotype_cols['gid'].")".",". $infotype_cols['mid'].
                      " VALUES ('".$groupID."','".$modID."')";
--- 130,147 ----
          $resultIns = $dbconn->Execute( $query );
          if ($resultIns == false) {
!             pnSessionSetVar('errormsg', "INSERT into ".$table." table failed.");
              return false;
          }else{
              // Get the newly generated id
!             $groupID = $dbconn->PO_Insert_ID( $table, $infotype_cols['id'] );
  
              // New table - not to be confused with above id from group table
!             $table          = $pntable['member_table'];
!             $infotype_cols  = &$pntable['members'];
  
              for($i = 0;$i < count($listODModIDs);$i++){
                  $modID = $listODModIDs[$i];
  
!                 $query = "INSERT INTO ".$table.
                      " (". $infotype_cols['gid'].")".",". $infotype_cols['mid'].
                      " VALUES ('".$groupID."','".$modID."')";
***************
*** 147,151 ****
                  $resultInsSub = $dbconn->Execute( $query );
                  if ($resultInsSub == false) {
!                     pnSessionSetVar('errormsg', "INSERT into ".$pntable['member_table']." table failed.");
                      return false;
                  }
--- 149,153 ----
                  $resultInsSub = $dbconn->Execute( $query );
                  if ($resultInsSub == false) {
!                     pnSessionSetVar('errormsg', "INSERT into ".$table." table failed.");
                      return false;
                  }
***************
*** 156,159 ****
--- 158,162 ----
      // Create a Misc tab where all other modules should be stored.
      //
+     $table          = $pntable['group_table'];
      $infotype_cols = &$pntable['group'];
      $newTabName = "Misc";
***************
*** 162,168 ****
  
      // Generate id
!     $miscID = $dbconn->GenId($infotype_cols['id']);
  
!     $query = "INSERT INTO ".$pntable['group_table'].
          " (". $infotype_cols['id'].",". $infotype_cols['lock'].",".$infotype_cols['order'].",". $infotype_cols['name'].",". $infotype_cols['default'].")".
          " VALUES ('".$miscID."','".$default."','".(count($tabNames)+1)."','".$newTabName."','".$default."')";
--- 165,171 ----
  
      // Generate id
!     $miscID = $dbconn->GenId( $table );
  
!     $query = "INSERT INTO ".$table.
          " (". $infotype_cols['id'].",". $infotype_cols['lock'].",".$infotype_cols['order'].",". $infotype_cols['name'].",". $infotype_cols['default'].")".
          " VALUES ('".$miscID."','".$default."','".(count($tabNames)+1)."','".$newTabName."','".$default."')";
***************
*** 170,181 ****
      $resultIns = $dbconn->Execute( $query );
      if ($resultIns == false) {
!         pnSessionSetVar('errormsg', "INSERT into ".$pntable['group_table']." table failed.");
          return false;
      }else{
          // Get the newly generated id
!         $miscID = $dbconn->PO_Insert_ID( $pntable, $infotype_cols['id'] );
      
          // ----------------------------------------------------------------------------------------
          // Modules in group
          $infotype_cols  = &$pntable['members'];
          $query = "SELECT ".$column['pn_id']." FROM ".pnConfigGetVar('prefix')."_modules WHERE pn_admin_capable='1'";
--- 173,185 ----
      $resultIns = $dbconn->Execute( $query );
      if ($resultIns == false) {
!         pnSessionSetVar('errormsg', "INSERT into ".$table." table failed.");
          return false;
      }else{
          // Get the newly generated id
!         $miscID = $dbconn->PO_Insert_ID( $table, $infotype_cols['id'] );
      
          // ----------------------------------------------------------------------------------------
          // Modules in group
+         $table          = $pntable['member_table'];
          $infotype_cols  = &$pntable['members'];
          $query = "SELECT ".$column['pn_id']." FROM ".pnConfigGetVar('prefix')."_modules WHERE pn_admin_capable='1'";
***************
*** 190,194 ****
  
              if(isInAGroup($modID) < 1){
!                 $query  = "INSERT INTO ".$pntable['member_table'].
                      " (". $infotype_cols['gid'].",". $infotype_cols['mid'].")".
                      " VALUES ('".$miscID."','".$modID."')";
--- 194,198 ----
  
              if(isInAGroup($modID) < 1){
!                 $query  = "INSERT INTO ".$table.
                      " (". $infotype_cols['gid'].",". $infotype_cols['mid'].")".
                      " VALUES ('".$miscID."','".$modID."')";
***************
*** 196,200 ****
                  $resultInsSub = $dbconn->Execute( $query );
                  if ($resultInsSub == false) {
!                     pnSessionSetVar('errormsg', "INSERT into ".$pntable['member_table']." table failed.");
                      return false;
                  }
--- 200,204 ----
                  $resultInsSub = $dbconn->Execute( $query );
                  if ($resultInsSub == false) {
!                     pnSessionSetVar('errormsg', "INSERT into ".$table." table failed.");
                      return false;
                  }


Directory filter : [ all ] / postnuke_modules / New_pnadmin / html / modules / admin [ view in CVS ]

View Statistics - Next Notice - Previous Notice


Visit Developer Site - Browse CVS Repository Syndicate via backend.rss
(max. once per hour please)
Powered by CVSNotice 0.1.3