[geeklog-cvs] Geeklog-1.x/public_html/admin/install index.php, 1.7, 1.8

Oliver ospiess at qs1489.pair.com
Wed Aug 29 02:55:06 EDT 2007


Update of /usr/home/geeklog2/cvsroot/geeklog/Geeklog-1.x/public_html/admin/install
In directory qs1489.pair.com:/tmp/cvs-serv10093/install

Modified Files:
	index.php 
Log Message:
de-cluttering the admin lists by outsourcing the top menu into a separate function. It has nothing to do with the list itself as such and can be used in other places now also to preserve formatting and move further HTML into a single template

Index: index.php
===================================================================
RCS file: /usr/home/geeklog2/cvsroot/geeklog/Geeklog-1.x/public_html/admin/install/index.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** index.php	29 Aug 2007 02:11:35 -0000	1.7
--- index.php	29 Aug 2007 06:55:04 -0000	1.8
***************
*** 122,126 ****
          case 1:
              require_once($dbconfig_path); // Get the current DB info
!             
              // Set all the form values either with their defaults or with received POST data.
              // The only instance where you'd get POST data would be if the user has to
--- 122,126 ----
          case 1:
              require_once($dbconfig_path); // Get the current DB info
! 
              // Set all the form values either with their defaults or with received POST data.
              // The only instance where you'd get POST data would be if the user has to
***************
*** 317,321 ****
                                          <input type="hidden" name="site_mail" value="' . urlencode($site_mail) . '" />
                                          <input type="hidden" name="noreply_mail" value="' . urlencode($noreply_mail) . '" />';
!         
                              // If using MySQL check to see if InnoDB is supported
                              if ($innodb && !INST_innodbSupported()) {
--- 317,321 ----
                                          <input type="hidden" name="site_mail" value="' . urlencode($site_mail) . '" />
                                          <input type="hidden" name="noreply_mail" value="' . urlencode($noreply_mail) . '" />';
! 
                              // If using MySQL check to see if InnoDB is supported
                              if ($innodb && !INST_innodbSupported()) {
***************
*** 386,390 ****
                                          <input type="submit" name="submit" class="submit" value="Upgrade >>" />
                                          </form>' . LB;
!     
                                      $curv = $old_versions[count($old_versions) - 1];
                                  } else {
--- 386,390 ----
                                          <input type="submit" name="submit" class="submit" value="Upgrade >>" />
                                          </form>' . LB;
! 
                                      $curv = $old_versions[count($old_versions) - 1];
                                  } else {
***************
*** 410,414 ****
                          header('Location: index.php?mode=install');
                      }
!         
                      // Check whether to use InnoDB tables
                      $use_innodb = false;
--- 410,414 ----
                          header('Location: index.php?mode=install');
                      }
! 
                      // Check whether to use InnoDB tables
                      $use_innodb = false;
***************
*** 416,420 ****
                          $use_innodb = true;
                      }
!         
                      // We need all this just to do one DB query
                      require_once($dbconfig_path);
--- 416,420 ----
                          $use_innodb = true;
                      }
! 
                      // We need all this just to do one DB query
                      require_once($dbconfig_path);
***************
*** 424,428 ****
                      // Check if GL is already installed
                      if (INST_checkTableExists('vars')) {
!         
                          $display .= '<p>' . $LANG_INSTALL[63] . '</p>
                              <ol>
--- 424,428 ----
                      // Check if GL is already installed
                      if (INST_checkTableExists('vars')) {
! 
                          $display .= '<p>' . $LANG_INSTALL[63] . '</p>
                              <ol>
***************
*** 430,434 ****
                                  <li>' . $LANG_INSTALL[65] . '</li>
                              </ol>
!         
                              <div style="margin-left: auto; margin-right: auto; width: 125px">
                                  <div style="position: absolute">
--- 430,434 ----
                                  <li>' . $LANG_INSTALL[65] . '</li>
                              </ol>
! 
                              <div style="margin-left: auto; margin-right: auto; width: 125px">
                                  <div style="position: absolute">
***************
*** 442,446 ****
                                      </form>
                                  </div>
!         
                                  <div style="position: relative; left: 55px; top: 5px">
                                      <form action="index.php" method="post">
--- 442,446 ----
                                      </form>
                                  </div>
! 
                                  <div style="position: relative; left: 55px; top: 5px">
                                      <form action="index.php" method="post">
***************
*** 452,456 ****
                              </div>
                              ' . LB;
!         
                      } else {
  
--- 452,456 ----
                              </div>
                              ' . LB;
! 
                      } else {
  
***************
*** 462,468 ****
                              $site_mail      = isset($_POST['site_mail']) ? $_POST['site_mail'] : (isset($_GET['site_mail']) ? $_GET['site_mail'] : '') ;
                              $noreply_mail   = isset($_POST['noreply_mail']) ? $_POST['noreply_mail'] : (isset($_GET['noreply_mail']) ? $_GET['noreply_mail'] : '') ;
!         
!                             // Insert the form data into the conf_values table
!                             require_once($_CONF['path_system'] . 'classes/config.class.php'); 
                              $config = config::create();
                              $config->set('site_name', urldecode($site_name));
--- 462,469 ----
                              $site_mail      = isset($_POST['site_mail']) ? $_POST['site_mail'] : (isset($_GET['site_mail']) ? $_GET['site_mail'] : '') ;
                              $noreply_mail   = isset($_POST['noreply_mail']) ? $_POST['noreply_mail'] : (isset($_GET['noreply_mail']) ? $_GET['noreply_mail'] : '') ;
! 
!                             // Insert the form data into the conf_values table
! 
!                             require_once($_CONF['path_system'] . 'classes/config.class.php');
                              $config = config::create();
                              $config->set('site_name', urldecode($site_name));
***************
*** 480,492 ****
                              $config->set('path_themes', $html_path . 'layout/');
                              $config->set('rdf_file', $html_path . 'backend/geeklog.rss');
!                             $config->set('path_pear', $_CONF['path_system'] . 'pear/');
                              $config->set('default_photo', urldecode($site_url) . '/default.jpg');
!         
                              // Now we're done with the installation so redirect the user to success.php
                              header('Location: success.php?type=install&language=' . $language);
                          } else {
!                             $display .= "<h2>" . $LANG_INSTALL[67] . "</h2><p>" . $LANG_INSTALL[68] . "</p>"; 
                          }
!         
                      }
                      break;
--- 481,494 ----
                              $config->set('path_themes', $html_path . 'layout/');
                              $config->set('rdf_file', $html_path . 'backend/geeklog.rss');
!                             $config->set('path_pear', $_CONF['path_system'] . 'pear/');
! 
                              $config->set('default_photo', urldecode($site_url) . '/default.jpg');
! 
                              // Now we're done with the installation so redirect the user to success.php
                              header('Location: success.php?type=install&language=' . $language);
                          } else {
!                             $display .= "<h2>" . $LANG_INSTALL[67] . "</h2><p>" . $LANG_INSTALL[68] . "</p>";
                          }
! 
                      }
                      break;
***************
*** 529,533 ****
                          $site_mail      = isset($_POST['site_mail']) ? $_POST['site_mail'] : (isset($_GET['site_mail']) ? $_GET['site_mail'] : '') ;
                          $noreply_mail   = isset($_POST['noreply_mail']) ? $_POST['noreply_mail'] : (isset($_GET['noreply_mail']) ? $_GET['noreply_mail'] : '') ;
!                         require_once($_CONF['path_system'] . 'classes/config.class.php'); 
                          $config = config::create();
                          $config->set('site_name', urldecode($site_name));
--- 531,535 ----
                          $site_mail      = isset($_POST['site_mail']) ? $_POST['site_mail'] : (isset($_GET['site_mail']) ? $_GET['site_mail'] : '') ;
                          $noreply_mail   = isset($_POST['noreply_mail']) ? $_POST['noreply_mail'] : (isset($_GET['noreply_mail']) ? $_GET['noreply_mail'] : '') ;
!                         require_once($_CONF['path_system'] . 'classes/config.class.php');
                          $config = config::create();
                          $config->set('site_name', urldecode($site_name));
***************
*** 536,541 ****
                          $config->set('site_admin_url', urldecode($site_admin_url));
                          $config->set('site_mail', urldecode($site_mail));
!                         $config->set('noreply_mail', urldecode($noreply_mail));
!                         $config->set('default_photo', urldecode($site_url) . '/default.jpg');
  
                          // Great, installation is complete, redirect to success page
--- 538,545 ----
                          $config->set('site_admin_url', urldecode($site_admin_url));
                          $config->set('site_mail', urldecode($site_mail));
!                         $config->set('noreply_mail', urldecode($noreply_mail));
! 
!                         $config->set('default_photo', urldecode($site_url) . '/default.jpg');
! 
  
                          // Great, installation is complete, redirect to success page
***************
*** 577,584 ****
  
  /**
!  * Returns an HTML formatted string containing a list of which files 
   * have incorrect permissions.
   *
!  * @param   array   $files  List of files to check 
   * @return  string          HTML and permission warning message.
   *
--- 581,588 ----
  
  /**
!  * Returns an HTML formatted string containing a list of which files
   * have incorrect permissions.
   *
!  * @param   array   $files  List of files to check
   * @return  string          HTML and permission warning message.
   *
***************
*** 673,678 ****
      // Should always include a test for the current version so that we can
      // warn the user if they try to run the update again.
! 
!     switch ($_DB_dbms) {
          case 'mysql':
              $test = array(
--- 677,684 ----
      // Should always include a test for the current version so that we can
      // warn the user if they try to run the update again.
! 
! 
!     switch ($_DB_dbms) {
! 
          case 'mysql':
              $test = array(
***************
*** 686,697 ****
                  // It's hard to (reliably) test for 1.3.7 - let's just hope nobody uses
                  // such an old version any more ...
!             );
!             break;
!         case 'mssql':
  	    $test = array(
                  '1.4.2'  => array("DESCRIBE {$_TABLES['storysubmission']} bodytext",''),
                  '1.4.1'  => array("SELECT ft_name FROM {$_TABLES['features']} WHERE ft_name = 'syndication.edit'", 'syndication.edit'),
!             );        
!             break;
      }
  
--- 692,708 ----
                  // It's hard to (reliably) test for 1.3.7 - let's just hope nobody uses
                  // such an old version any more ...
!             );
! 
!             break;
! 
!         case 'mssql':
! 
  	    $test = array(
                  '1.4.2'  => array("DESCRIBE {$_TABLES['storysubmission']} bodytext",''),
                  '1.4.1'  => array("SELECT ft_name FROM {$_TABLES['features']} WHERE ft_name = 'syndication.edit'", 'syndication.edit'),
!             );
! 
!             break;
! 
      }
  
***************
*** 699,703 ****
      foreach ($test as $v => $qarray) {
          $result = DB_query ($qarray[0], 1);
!         if ($result === false) {
              // error - continue with next test
          } else if (DB_numRows ($result) > 0) {
--- 710,715 ----
      foreach ($test as $v => $qarray) {
          $result = DB_query ($qarray[0], 1);
!         if ($result === false) {
! 
              // error - continue with next test
          } else if (DB_numRows ($result) > 0) {
***************
*** 1186,1190 ****
  
              create_ConfValues();
!             require_once( $_CONF['path_system'] . 'classes/config.class.php'); 
              $config = config::create();
  
--- 1198,1202 ----
  
              create_ConfValues();
!             require_once( $_CONF['path_system'] . 'classes/config.class.php');
              $config = config::create();
  
***************
*** 1192,1196 ****
                  // Read the values from config.php and use them to populate conf_values
  
!                 $tmp_path = $_CONF['path']; // We'll need this to remember what the correct path is. 
                                              // Including config.php will overwrite all our $_CONF values.
                  require($tmp_path . 'config.php');
--- 1204,1208 ----
                  // Read the values from config.php and use them to populate conf_values
  
!                 $tmp_path = $_CONF['path']; // We'll need this to remember what the correct path is.
                                              // Including config.php will overwrite all our $_CONF values.
                  require($tmp_path . 'config.php');
***************
*** 1214,1225 ****
  
              if (INST_pluginExists('polls')) {
! //                upgrade_PollsPlugin();
              }
              if (INST_pluginExists('staticpages')) {
                  upgrade_StaticpagesPlugin();
              }
!             upgrade_PollsPlugin();
!             upgrade_StaticpagesPlugin();
!             upgrade_LinksPlugin();
              $current_gl_version = '1.4.2';
              $_SQL = '';
--- 1226,1237 ----
  
              if (INST_pluginExists('polls')) {
!                 upgrade_PollsPlugin();
              }
              if (INST_pluginExists('staticpages')) {
                  upgrade_StaticpagesPlugin();
              }
!             if (INST_pluginExists('links')) {
!                 upgrade_LinksPlugin();
!             }
              $current_gl_version = '1.4.2';
              $_SQL = '';
***************
*** 1245,1258 ****
   *
   */
! function INST_pluginExists($plugin) 
  {
      global $_DB, $_TABLES;
      $result = DB_query("SELECT `pi_name` FROM {$_TABLES['plugins']} WHERE `pi_name` = '$plugin'");
      if (DB_numRows($result) > 0) {
!         return true; 
      } else {
!         return false;    
      }
! }  
  
  
--- 1257,1270 ----
   *
   */
! function INST_pluginExists($plugin)
  {
      global $_DB, $_TABLES;
      $result = DB_query("SELECT `pi_name` FROM {$_TABLES['plugins']} WHERE `pi_name` = '$plugin'");
      if (DB_numRows($result) > 0) {
!         return true;
      } else {
!         return false;
      }
! }
  
  
***************
*** 1391,1401 ****
                  // If the file/directory is not located in the default location
                  // or in public_html have the user enter its location.
!                 $form_fields .= '<p><label>db-config.php</label> <input type="text" name="dbconfig_path" value="/path/to/' 
                              . $dbconfig_file . '" size="25" /></p>'  . LB;
                  $num_errors++;
              } else {
                  // See whether the file/directory is located in the default place or in public_html
!                 $dbconfig_path = file_exists($gl_path . $dbconfig_file) 
!                                     ? $gl_path . $dbconfig_file 
                                      : $gl_path . 'public_html' . $dbconfig_file;
              }
--- 1403,1413 ----
                  // If the file/directory is not located in the default location
                  // or in public_html have the user enter its location.
!                 $form_fields .= '<p><label>db-config.php</label> <input type="text" name="dbconfig_path" value="/path/to/'
                              . $dbconfig_file . '" size="25" /></p>'  . LB;
                  $num_errors++;
              } else {
                  // See whether the file/directory is located in the default place or in public_html
!                 $dbconfig_path = file_exists($gl_path . $dbconfig_file)
!                                     ? $gl_path . $dbconfig_file
                                      : $gl_path . 'public_html' . $dbconfig_file;
              }
***************
*** 1454,1458 ****
              require_once($_PATH['db-config.php']);  // We need db-config.php the current DB information
              require_once($siteconfig_path);         // We need siteconfig.php for core $_CONF values.
!     
              $gl_path                = str_replace('db-config.php', '', $_PATH['db-config.php']);
              $log_path               = $gl_path . 'logs/';
--- 1466,1470 ----
              require_once($_PATH['db-config.php']);  // We need db-config.php the current DB information
              require_once($siteconfig_path);         // We need siteconfig.php for core $_CONF values.
! 
              $gl_path                = str_replace('db-config.php', '', $_PATH['db-config.php']);
              $log_path               = $gl_path . 'logs/';
***************
*** 1461,1467 ****
              $data_path              = $gl_path . (file_exists($gl_path . 'data') ? 'data/' : 'public_html/data/');
              $failed                 = 0; // number of failed tests
!             $display_permissions    = '<br /><p><label class="file-permission-list"><b>' . $LANG_INSTALL[10] 
                                      . '</b></label> <b>' . $LANG_INSTALL[11] . '</b></p>' . LB;
!             $_PERMS                 = array('db-config.php', 'siteconfig.php', 'error.log', 'access.log', 
                                              'rdf', 'userphotos', 'articles', 'topics', 'backups', 'data');
  
--- 1473,1479 ----
              $data_path              = $gl_path . (file_exists($gl_path . 'data') ? 'data/' : 'public_html/data/');
              $failed                 = 0; // number of failed tests
!             $display_permissions    = '<br /><p><label class="file-permission-list"><b>' . $LANG_INSTALL[10]
                                      . '</b></label> <b>' . $LANG_INSTALL[11] . '</b></p>' . LB;
!             $_PERMS                 = array('db-config.php', 'siteconfig.php', 'error.log', 'access.log',
                                              'rdf', 'userphotos', 'articles', 'topics', 'backups', 'data');
  
***************
*** 1470,1475 ****
                  // Permissions are incorrect
                  $_PERMS['rdf']          = sprintf("%3o", @fileperms($_CONF['rdf_file']) & 0777);
!                 $display_permissions    .= '<p><label class="file-permission-list"><code>' . $_CONF['rdf_file'] 
!                                         . '</code></label><span class="error">' . $LANG_INSTALL[12] . ' 777</span> (' . $LANG_INSTALL[13] . ' ' 
                                          . $_PERMS['rdf'] . ') </p>' . LB;
                  $failed++;
--- 1482,1487 ----
                  // Permissions are incorrect
                  $_PERMS['rdf']          = sprintf("%3o", @fileperms($_CONF['rdf_file']) & 0777);
!                 $display_permissions    .= '<p><label class="file-permission-list"><code>' . $_CONF['rdf_file']
!                                         . '</code></label><span class="error">' . $LANG_INSTALL[12] . ' 777</span> (' . $LANG_INSTALL[13] . ' '
                                          . $_PERMS['rdf'] . ') </p>' . LB;
                  $failed++;
***************
*** 1478,1482 ****
                  fclose ($file);
              }
!     
              // backups directory
              if ($_CONF['allow_mysqldump'] == 1) {
--- 1490,1494 ----
                  fclose ($file);
              }
! 
              // backups directory
              if ($_CONF['allow_mysqldump'] == 1) {
***************
*** 1485,1490 ****
                      // Permissions are incorrect
                      $_PERMS['backups']      = sprintf("%3o", @fileperms($gl_path . 'backups/') & 0777);
!                     $display_permissions    .= '<p><label class="file-permission-list"><code>' . $gl_path 
!                                             . 'backups/</code></label><span class="error">' . $LANG_INSTALL[14] 
                                              . ' 777</span> (' . $LANG_INSTALL[13] . ' ' . $_PERMS['backups'] . ') </p>' . LB;
                      $failed++;
--- 1497,1502 ----
                      // Permissions are incorrect
                      $_PERMS['backups']      = sprintf("%3o", @fileperms($gl_path . 'backups/') & 0777);
!                     $display_permissions    .= '<p><label class="file-permission-list"><code>' . $gl_path
!                                             . 'backups/</code></label><span class="error">' . $LANG_INSTALL[14]
                                              . ' 777</span> (' . $LANG_INSTALL[13] . ' ' . $_PERMS['backups'] . ') </p>' . LB;
                      $failed++;
***************
*** 1494,1504 ****
                  }
              }
!     
              // data directory
              if (!$file = @fopen($data_path . 'test.txt', 'w')) {
                  // Permissions are incorrect
                  $_PERMS['data']         = sprintf("%3o", @fileperms($data_path) & 0777);
!                 $display_permissions    .= '<p><label class="file-permission-list"><code>' . $data_path 
!                                         . '</code></label><span class="error">' . $LANG_INSTALL[14] 
                                          . ' 777</span> (' . $LANG_INSTALL[13] . ' ' . $_PERMS['data'] . ') </p>' . LB;
                  $failed++;
--- 1506,1516 ----
                  }
              }
! 
              // data directory
              if (!$file = @fopen($data_path . 'test.txt', 'w')) {
                  // Permissions are incorrect
                  $_PERMS['data']         = sprintf("%3o", @fileperms($data_path) & 0777);
!                 $display_permissions    .= '<p><label class="file-permission-list"><code>' . $data_path
!                                         . '</code></label><span class="error">' . $LANG_INSTALL[14]
                                          . ' 777</span> (' . $LANG_INSTALL[13] . ' ' . $_PERMS['data'] . ') </p>' . LB;
                  $failed++;
***************
*** 1512,1517 ****
              if (!$dbconfig_file = @fopen($_PATH['db-config.php'], 'a')) {
                  $_PERMS['db-config.php'] = sprintf("%3o", @fileperms($_PATH['db-config.php']) & 0777);
!                 $display_permissions    .= '<p><label class="file-permission-list"><code>' . $_PATH['db-config.php'] 
!                                         . '</code></label><span class="error">' . $LANG_INSTALL[12] . ' 777</span> (' 
                                          . $LANG_INSTALL[13] . ' ' . $_PERMS['db-config.php'] . ')</p>' . LB ;
                  $failed++;
--- 1524,1529 ----
              if (!$dbconfig_file = @fopen($_PATH['db-config.php'], 'a')) {
                  $_PERMS['db-config.php'] = sprintf("%3o", @fileperms($_PATH['db-config.php']) & 0777);
!                 $display_permissions    .= '<p><label class="file-permission-list"><code>' . $_PATH['db-config.php']
!                                         . '</code></label><span class="error">' . $LANG_INSTALL[12] . ' 777</span> ('
                                          . $LANG_INSTALL[13] . ' ' . $_PERMS['db-config.php'] . ')</p>' . LB ;
                  $failed++;
***************
*** 1519,1529 ****
                  fclose($dbconfig_file);
              }
!     
              // articles directory
              if (!$file = @fopen($_CONF['path_images'] . 'articles/test.gif', 'w')) {
                  // Permissions are incorrect
                  $_PERMS['articles']     = sprintf("%3o", @fileperms($_CONF['path_images'] . 'articles/') & 0777);
!                 $display_permissions    .= '<p><label class="file-permission-list"><code>' . $_CONF['path_images'] 
!                                         . 'articles/</code></label><span class="error">' . $LANG_INSTALL[14] 
                                          . ' 777</span> (' . $LANG_INSTALL[13] . ' ' . $_PERMS['articles'] . ') </p>' . LB;
                  $failed++;
--- 1531,1541 ----
                  fclose($dbconfig_file);
              }
! 
              // articles directory
              if (!$file = @fopen($_CONF['path_images'] . 'articles/test.gif', 'w')) {
                  // Permissions are incorrect
                  $_PERMS['articles']     = sprintf("%3o", @fileperms($_CONF['path_images'] . 'articles/') & 0777);
!                 $display_permissions    .= '<p><label class="file-permission-list"><code>' . $_CONF['path_images']
!                                         . 'articles/</code></label><span class="error">' . $LANG_INSTALL[14]
                                          . ' 777</span> (' . $LANG_INSTALL[13] . ' ' . $_PERMS['articles'] . ') </p>' . LB;
                  $failed++;
***************
*** 1533,1543 ****
                  unlink($_CONF['path_images'] . 'articles/test.gif');
              }
!     
              // topics directory
              if (!$file = @fopen($_CONF['path_images'] . 'topics/test.gif', 'w')) {
                  // Permissions are incorrect
                  $_PERMS['topics']       = sprintf("%3o", @fileperms($_CONF['path_images'] . 'topics/') & 0777);
!                 $display_permissions    .= '<p><label class="file-permission-list"><code>' . $_CONF['path_images'] 
!                                         . 'topics/</code></label><span class="error">' . $LANG_INSTALL[14] 
                                          . ' 777</span> (' . $LANG_INSTALL[13] . ' ' . $_PERMS['topics'] . ') </p>' . LB;
                  $failed++;
--- 1545,1555 ----
                  unlink($_CONF['path_images'] . 'articles/test.gif');
              }
! 
              // topics directory
              if (!$file = @fopen($_CONF['path_images'] . 'topics/test.gif', 'w')) {
                  // Permissions are incorrect
                  $_PERMS['topics']       = sprintf("%3o", @fileperms($_CONF['path_images'] . 'topics/') & 0777);
!                 $display_permissions    .= '<p><label class="file-permission-list"><code>' . $_CONF['path_images']
!                                         . 'topics/</code></label><span class="error">' . $LANG_INSTALL[14]
                                          . ' 777</span> (' . $LANG_INSTALL[13] . ' ' . $_PERMS['topics'] . ') </p>' . LB;
                  $failed++;
***************
*** 1547,1557 ****
                  unlink($_CONF['path_images'] . 'topics/test.gif');
              }
!     
              // userphotos directory
              if (!$file = @fopen($_CONF['path_images'] . 'userphotos/test.gif', 'w')) {
                  // Permissions are incorrect
                  $_PERMS['userphoto']    = sprintf("%3o", @fileperms($_CONF['path_images'] . 'userphotos/') & 0777);
!                 $display_permissions    .= '<p><label class="file-permission-list"><code>' . $_CONF['path_images'] 
!                                         . 'userphotos/</code></label><span class="error">' . $LANG_INSTALL[14] 
                                          . ' 777</span> (' . $LANG_INSTALL[13] . ' ' . $_PERMS['userphoto'] . ') </p>' . LB;
              } else {
--- 1559,1569 ----
                  unlink($_CONF['path_images'] . 'topics/test.gif');
              }
! 
              // userphotos directory
              if (!$file = @fopen($_CONF['path_images'] . 'userphotos/test.gif', 'w')) {
                  // Permissions are incorrect
                  $_PERMS['userphoto']    = sprintf("%3o", @fileperms($_CONF['path_images'] . 'userphotos/') & 0777);
!                 $display_permissions    .= '<p><label class="file-permission-list"><code>' . $_CONF['path_images']
!                                         . 'userphotos/</code></label><span class="error">' . $LANG_INSTALL[14]
                                          . ' 777</span> (' . $LANG_INSTALL[13] . ' ' . $_PERMS['userphoto'] . ') </p>' . LB;
              } else {
***************
*** 1560,1570 ****
                  unlink($_CONF['path_images'] . 'userphotos/test.gif');
              }
!     
              // logs
              if (!$err_file = @fopen($log_path . 'error.log', 'a')) {
                  // Permissions are incorrect
                  $_PERMS['error.log']    = sprintf("%3o", @fileperms($log_path) & 0775);
!                 $display_permissions    .= '<p><label class="file-permission-list"><code>' . $log_path . '</code></label><span class="error">' 
!                                         . $LANG_INSTALL[14] . ' 775</span> (' . $LANG_INSTALL[13] . ' ' 
                                          . ($_PERMS['error.log'] == 0 ? $LANG_INSTALL[22] : $_PERMS['error.log']) . ')</p>' . LB ;
                  $failed++;
--- 1572,1582 ----
                  unlink($_CONF['path_images'] . 'userphotos/test.gif');
              }
! 
              // logs
              if (!$err_file = @fopen($log_path . 'error.log', 'a')) {
                  // Permissions are incorrect
                  $_PERMS['error.log']    = sprintf("%3o", @fileperms($log_path) & 0775);
!                 $display_permissions    .= '<p><label class="file-permission-list"><code>' . $log_path . '</code></label><span class="error">'
!                                         . $LANG_INSTALL[14] . ' 775</span> (' . $LANG_INSTALL[13] . ' '
                                          . ($_PERMS['error.log'] == 0 ? $LANG_INSTALL[22] : $_PERMS['error.log']) . ')</p>' . LB ;
                  $failed++;
***************
*** 1577,1582 ****
              if (!$siteconfig_file = @fopen($_PATH['public_html/'] . 'siteconfig.php', 'a')) {
                  $_PERMS['siteconfig.php'] = sprintf("%3o", @fileperms($_PATH['public_html/'] . 'siteconfig.php') & 0777);
!                 $display_permissions    .= '<p><label class="file-permission-list"><code>' . $_PATH['public_html/'] 
!                                         . 'siteconfig.php</code></label><span class="error">' . $LANG_INSTALL[12] 
                                          . ' 777</span> (' . $LANG_INSTALL[13] . ' ' . $_PERMS['siteconfig.php'] . ')</p>' . LB ;
                  $failed++;
--- 1589,1594 ----
              if (!$siteconfig_file = @fopen($_PATH['public_html/'] . 'siteconfig.php', 'a')) {
                  $_PERMS['siteconfig.php'] = sprintf("%3o", @fileperms($_PATH['public_html/'] . 'siteconfig.php') & 0777);
!                 $display_permissions    .= '<p><label class="file-permission-list"><code>' . $_PATH['public_html/']
!                                         . 'siteconfig.php</code></label><span class="error">' . $LANG_INSTALL[12]
                                          . ' 777</span> (' . $LANG_INSTALL[13] . ' ' . $_PERMS['siteconfig.php'] . ')</p>' . LB ;
                  $failed++;
***************
*** 1584,1593 ****
                  fclose($siteconfig_file);
              }
!     
!     
              $display .= $LANG_INSTALL[9] . '<br /><br />' . LB;
!     
              if ($failed) {
!     
                  $display .= '
                  <p>' . $LANG_INSTALL[19] . '</p>
--- 1596,1605 ----
                  fclose($siteconfig_file);
              }
! 
! 
              $display .= $LANG_INSTALL[9] . '<br /><br />' . LB;
! 
              if ($failed) {
! 
                  $display .= '
                  <p>' . $LANG_INSTALL[19] . '</p>
***************
*** 1595,1601 ****
                  ' . $LANG_INSTALL[21] . '</p>
                  <br /><br />' . LB;
!     
              }
!     
              // Set up the request string
              $req_string = 'index.php?mode=write_paths'
--- 1607,1613 ----
                  ' . $LANG_INSTALL[21] . '</p>
                  <br /><br />' . LB;
! 
              }
! 
              // Set up the request string
              $req_string = 'index.php?mode=write_paths'
***************
*** 1603,1607 ****
                          . '&public_html_path=' . urlencode($_PATH['public_html/'])
                          . '&language=' . $language;
!     
              $display .= '
              <div class="install-type-container-outer">
--- 1615,1619 ----
                          . '&public_html_path=' . urlencode($_PATH['public_html/'])
                          . '&language=' . $language;
! 
              $display .= '
              <div class="install-type-container-outer">
***************
*** 1623,1638 ****
  
          // Get the paths from the previous page
!         $_PATH = array('db-config.php' => urldecode(isset($_GET['dbconfig_path']) 
!                                                     ? $_GET['dbconfig_path'] 
                                                      : $_POST['dbconfig_path']),
!                         'public_html/' => urldecode(isset($_GET['public_html_path']) 
!                                                     ? $_GET['public_html_path'] 
                                                      : $_POST['public_html_path']));
          $dbconfig_path = str_replace('db-config.php', '', $_PATH['db-config.php'] );
  
!         if (!INST_checkIfWritable(array($_PATH['db-config.php'], 
                                              $_PATH['public_html/'] . 'siteconfig.php'))) { // Can't write to db-config.php or siteconfig.php
  
!             $display .= INST_permissionWarning(array($_PATH['db-config.php'], 
                                                        $_PATH['public_html/'] . 'siteconfig.php'));
  
--- 1635,1650 ----
  
          // Get the paths from the previous page
!         $_PATH = array('db-config.php' => urldecode(isset($_GET['dbconfig_path'])
!                                                     ? $_GET['dbconfig_path']
                                                      : $_POST['dbconfig_path']),
!                         'public_html/' => urldecode(isset($_GET['public_html_path'])
!                                                     ? $_GET['public_html_path']
                                                      : $_POST['public_html_path']));
          $dbconfig_path = str_replace('db-config.php', '', $_PATH['db-config.php'] );
  
!         if (!INST_checkIfWritable(array($_PATH['db-config.php'],
                                              $_PATH['public_html/'] . 'siteconfig.php'))) { // Can't write to db-config.php or siteconfig.php
  
!             $display .= INST_permissionWarning(array($_PATH['db-config.php'],
                                                        $_PATH['public_html/'] . 'siteconfig.php'));
  
***************
*** 1647,1652 ****
              // $_CONF['path']
              require_once($siteconfig_path);
!             $siteconfig_data = str_replace("\$_CONF['path'] = '{$_CONF['path']}';", 
!                                 "\$_CONF['path'] = '" . str_replace('db-config.php', '', $_PATH['db-config.php']) . "';", 
                                  $siteconfig_data);
  
--- 1659,1664 ----
              // $_CONF['path']
              require_once($siteconfig_path);
!             $siteconfig_data = str_replace("\$_CONF['path'] = '{$_CONF['path']}';",
!                                 "\$_CONF['path'] = '" . str_replace('db-config.php', '', $_PATH['db-config.php']) . "';",
                                  $siteconfig_data);
  




More information about the geeklog-cvs mailing list