[xoops-cvslog 4522] CVS update: xoops2jp/html/install/class

Back to archive index

Minahito minah****@users*****
2006年 9月 17日 (日) 11:53:48 JST


Index: xoops2jp/html/install/class/settingmanager.php
diff -u xoops2jp/html/install/class/settingmanager.php:1.2.8.4 xoops2jp/html/install/class/settingmanager.php:1.2.8.5
--- xoops2jp/html/install/class/settingmanager.php:1.2.8.4	Fri Sep 15 17:48:38 2006
+++ xoops2jp/html/install/class/settingmanager.php	Sun Sep 17 11:53:48 2006
@@ -29,7 +29,7 @@
 * setting manager for XOOPS installer
 *
 * @author Haruki Setoyama  <haruk****@plane*****>
-* @version $Id: settingmanager.php,v 1.2.8.4 2006/09/15 08:48:38 minahito Exp $
+* @version $Id: settingmanager.php,v 1.2.8.5 2006/09/17 02:53:48 minahito Exp $
 * @access public
 **/
 class setting_manager {
@@ -43,6 +43,8 @@
     var $db_pconnect;
     var $root_path;
     var $xoops_url;
+	
+	var $salt;
 
     var $sanitizer;
 
@@ -54,7 +56,17 @@
         }else{
             $this->database = 'mysql';
             $this->dbhost = 'localhost';
-            $this->prefix = 'xoops';
+			
+			//
+			// Generate prefix
+			//
+			srand(microtime() * 10000);
+			do {
+				$this->prefix = substr(md5(rand()), 0, 6);
+			} while (!preg_match("/^[a-z]/", $this->prefix));
+			
+			$this->salt = substr(md5(rand()), 5, 8);
+			
             $this->db_pconnect = 0;
 
             $this->root_path = str_replace('\\','/',getcwd()); // "
@@ -96,6 +108,8 @@
             $this->root_path = $this->sanitizer->stripSlashesGPC($_POST['root_path']);
         if(isset($_POST['xoops_url']))
             $this->xoops_url = $this->sanitizer->stripSlashesGPC($_POST['xoops_url']);
+        if(isset($_POST['salt']))
+            $this->salt = $this->sanitizer->stripSlashesGPC($_POST['salt']);
     }
 
     function readConstant(){
@@ -117,6 +131,8 @@
             $this->root_path = XOOPS_ROOT_PATH;
         if(defined('XOOPS_URL'))
             $this->xoops_url = XOOPS_URL;
+		if(defined('XOOPS_SALT'))
+			$this->salt = XOOPS_SALT;
     }
 
     function checkData(){
@@ -132,6 +148,9 @@
         if ( empty($this->prefix) ) {
             $error[] = sprintf(_INSTALL_L57, _INSTALL_L30);
         }
+        if ( empty($this->salt) ) {
+            $error[] = sprintf(_INSTALL_L57, _INSTALL_LANG_SALT);
+        }
         if ( empty($this->root_path) ) {
             $error[] = sprintf(_INSTALL_L57, _INSTALL_L55);
         }
@@ -176,6 +195,7 @@
         $ret .= $this->editform_sub(_INSTALL_L52, _INSTALL_L68, 'dbpass', $this->sanitizer->htmlSpecialChars($this->dbpass));
         $ret .= $this->editform_sub(_INSTALL_L29, _INSTALL_L64, 'dbname', $this->sanitizer->htmlSpecialChars($this->dbname));
         $ret .= $this->editform_sub(_INSTALL_L30, _INSTALL_L63, 'prefix', $this->sanitizer->htmlSpecialChars($this->prefix));
+        $ret .= $this->editform_sub(_INSTALL_LANG_XOOPS_SALT, _INSTALL_LANG_XOOPS_SALT_DESC, 'salt', $this->sanitizer->htmlSpecialChars($this->salt));
 
         $ret .= '<tr valign="top" align="left">
                     <td class="head">
@@ -238,6 +258,10 @@
                         <td class="bg1">'.$this->sanitizer->htmlSpecialChars($this->prefix).'</td>
                     </tr>
                     <tr>
+                        <td class="bg3"><b>'._INSTALL_LANG_XOOPS_SALT.'</b></td>
+                        <td class="bg1">'.$this->sanitizer->htmlSpecialChars($this->salt).'</td>
+                    </tr>
+                    <tr>
                         <td class="bg3"><b>'._INSTALL_L54.'</b></td>
                         <td class="bg1">'.$yesno.'</td>
                     </tr>
@@ -256,6 +280,7 @@
             <input type="hidden" name="dbpass" value="'.$this->sanitizer->htmlSpecialChars($this->dbpass).'" />
             <input type="hidden" name="dbname" value="'.$this->sanitizer->htmlSpecialChars($this->dbname).'" />
             <input type="hidden" name="prefix" value="'.$this->sanitizer->htmlSpecialChars($this->prefix).'" />
+            <input type="hidden" name="salt" value="'.$this->sanitizer->htmlSpecialChars($this->salt).'" />
             <input type="hidden" name="db_pconnect" value="'.intval($this->db_pconnect).'" />
             <input type="hidden" name="root_path" value="'.$this->sanitizer->htmlSpecialChars($this->root_path).'" />
             <input type="hidden" name="xoops_url" value="'.$this->sanitizer->htmlSpecialChars($this->xoops_url).'" />


xoops-cvslog メーリングリストの案内
Back to archive index