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

Dirk Haun dhaun at qs1489.pair.com
Sun Dec 30 16:01:54 EST 2007


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

Modified Files:
	index.php 
Log Message:
Changed the wrong &/& which broke the install (sorry); re-established settings the Admin account's email address and homepage from the site_mail / site_url setting


Index: index.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/admin/install/index.php,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** index.php	30 Dec 2007 20:24:46 -0000	1.26
--- index.php	30 Dec 2007 21:01:52 -0000	1.27
***************
*** 308,313 ****
                          require_once $siteconfig_path;
                          require_once $_CONF['path_system'] . 'lib-database.php';
!                         $req_string = 'index.php?mode=' . $install_type . '&step=3&dbconfig_path=' . $dbconfig_path
!                                     . '&language=' . $language
                                      . '&site_name=' . urlencode($site_name)
                                      . '&site_slogan=' . urlencode($site_slogan)
--- 308,313 ----
                          require_once $siteconfig_path;
                          require_once $_CONF['path_system'] . 'lib-database.php';
!                         $req_string = 'index.php?mode=' . $install_type . '&step=3&dbconfig_path=' . $dbconfig_path
!                                     . '&language=' . $language
                                      . '&site_name=' . urlencode($site_name)
                                      . '&site_slogan=' . urlencode($site_slogan)
***************
*** 477,484 ****
                              $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');
!                             require_once('config-install.php');
                              install_config();
  
--- 477,486 ----
                              $noreply_mail   = isset($_POST['noreply_mail']) ? $_POST['noreply_mail'] : (isset($_GET['noreply_mail']) ? $_GET['noreply_mail'] : '') ;
  
+                             INST_personalizeAdminAccount($site_mail, $site_url);
+ 
                              // Insert the form data into the conf_values table
  
!                             require_once $_CONF['path_system'] . 'classes/config.class.php';
!                             require_once 'config-install.php';
                              install_config();
  
***************
*** 821,838 ****
      }
  
  
!     if ($_DB_dbms == 'mysql' || $_DB_dbms == 'mssql') {
  
          // let's try and personalize the Admin account a bit ...
  
!         if (strpos ($_CONF['site_mail'], 'example.com') === false) {
!             DB_query ("UPDATE {$_TABLES['users']} SET email = '" . addslashes ($_CONF['site_mail']) . "' WHERE uid = 2");
          }
!         if (strpos ($_CONF['site_url'], 'example.com') === false) {
!             DB_query ("UPDATE {$_TABLES['users']} SET homepage = '" . addslashes ($_CONF['site_url']) . "' WHERE uid = 2");
          }
      }
- 
-     return true;
  }
  
--- 823,857 ----
      }
  
+     return true;
+ }
  
! 
! /**
!  * On a fresh install, set the Admin's account email and homepage
!  *
!  * @param   string  $site_mail  email address, e.g. the site email
!  * @param   string  $site_url   the site's URL
!  * @return  void
!  *
!  */
! function INST_personalizeAdminAccount($site_mail, $site_url)
! {
!     global $_TABLES, $_DB_dbms;
! 
!     if (($_DB_dbms == 'mysql') || ($_DB_dbms == 'mssql')) {
  
          // let's try and personalize the Admin account a bit ...
  
!         if (!empty($site_mail)) {
!             if (strpos($site_mail, 'example.com') === false) {
!                 DB_query("UPDATE {$_TABLES['users']} SET email = '" . addslashes($site_mail) . "' WHERE uid = 2");
!             }
          }
!         if (!empty($site_url)) {
!             if (strpos($site_url, 'example.com') === false) {
!                 DB_query("UPDATE {$_TABLES['users']} SET homepage = '" . addslashes($site_url) . "' WHERE uid = 2");
!             }
          }
      }
  }
  
***************
*** 1762,1766 ****
  
              // Continue to the next step: Fresh install or Upgrade
!             header('Location: index.php?mode=' . $_GET['op'] . '&dbconfig_path=' . urlencode($_PATH['db-config.php']) . '&language=' . $language);
  
          }
--- 1781,1785 ----
  
              // Continue to the next step: Fresh install or Upgrade
!             header('Location: index.php?mode=' . $_GET['op'] . '&dbconfig_path=' . urlencode($_PATH['db-config.php']) . '&language=' . $language);
  
          }




More information about the geeklog-cvs mailing list