navigation  interaction  search

 other resources

Changeset 57

Show
Ignore:
Timestamp:
11/17/05 20:53:39
Author:
brieb
Message:

- Moved non MySQL settings to new settings table.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/changelog.txt

    r54 r57  
    2929- Added UPC to products. 
    3030- Fixed compatibilty problem with MySQL 5 and reserved words. 
     31- Modified Snapshot to load snapshot sections from each individual module. 
     32- Moved non MySQL settings to new settings table. 
    3133 
    3234phpBMS v0.602/ BMS module v0.602 
  • trunk/choicelist.php

    r51 r57  
    4242                $querystatement="DELETE FROM choices WHERE listname=\"".$listname."\" "; 
    4343                $queryresult=mysql_query($querystatement,$dblink); 
    44                 if(!$querystatement)  
     44                if(!$queryresult)  
    4545                        reportError(100,"SQL Statement Could not be executed."); 
    4646                else 
  • trunk/defaultsettings.php

    r10 r57  
    11<?php /* ] 
    2 [ General ] 
    3 application_name                = "phpBMS" 
    4 encryption_seed                 = "freeble" 
    5 record_limit                    = "50" 
    6 default_load_page               = "modules/base/snapshot.php" 
    7  
    8 [ Invoice ] 
    9 invoice_default_printinstruc    = "Thank You For Your Order." 
    10  
    11 [ mySQL ] 
    12 mysql_server                    = "localhost" 
    13 mysql_database                  = "phpbms" 
    14 mysql_user                      = "bms" 
    15 mysql_userpass                  = "bmspass" 
    16  
    17 [ Company ] 
    18 company_name                    = "Kreotek LLC" 
    19 company_address                 = "481 Rio Rancho Blvd. NE" 
    20 company_csz                     = "Rio Rancho, NM 87124" 
    21 company_phone                   = "505.994.6388" 
    22  
    23 [ Shipping ] 
    24 shipping_markup                 = "1.1" 
    25 shipping_postalcode             = "87124" 
    26  
    27 [ Display ] 
    28 stylesheet                      = "mozilla" 
     2mysql_server    = "localhost" 
     3mysql_database  = "phpbms" 
     4mysql_user              = "bms" 
     5mysql_userpass  = "bmspass" 
    296 end] */ ?> 
  • trunk/include/session.php

    r51 r57  
    4444} 
    4545 
     46function loadSettings(){ 
     47        global $dblink; 
     48         
     49        $querystatement="SELECT name,value FROM settings"; 
     50        $queryresult=mysql_query($querystatement,$dblink); 
     51        if(!$queryresult) reportError(100,("Could not retrieve settings. If you have not ran the update script for phpBMS,  
     52                                                                                please run it before logging in. Error Details:<br />".mysql_error($dblink)." ".$querystatement)); 
     53        while($therecord=mysql_fetch_array($queryresult)) 
     54                $_SESSION[$therecord["name"]]=$therecord["value"]; 
     55} 
     56 
    4657//This function loads any variables written 
    4758// in settings.php into session variables. 
    4859//========================================= 
    49 function loadSettings() { 
     60function loadMysqlSettings() { 
    5061         
    5162        $path=""; 
     
    7182                                        if($endpos!=false) 
    7283                                                $value=substr($value,$startpos+1,$endpos-$startpos-1); 
    73                                         $_SESSION[$key]=$value; 
     84                                        if(strpos($key,"mysql_")===0) 
     85                                                $_SESSION[$key]=$value; 
    7486                                } 
    7587                        } 
     
    110122        session_start(); 
    111123        error_reporting(E_ALL); 
    112         if (!isset($_SESSION["app_path"])) $mainpath=loadSettings(); 
     124        if (!isset($_SESSION["app_path"])) $mainpath=loadMysqlSettings(); 
    113125        else $mainpath=$_SESSION["app_path"]; 
    114126         
     
    129141                        if (!mysql_select_db($_SESSION["mysql_database"],$dblink))  
    130142                                reportError(500,"Could not open database.  Please check your settings.",true,$mainpath); 
    131                 }        
     143                } 
     144                if(!isset($_SESSION["app_name"])) 
     145                        loadSettings(); 
    132146        }//end if 
    133147         
  • trunk/install/createtables.sql

    r54 r57  
    204204  KEY user (userid) 
    205205) TYPE=MyISAM; 
     206 
     207CREATE TABLE `settings` ( 
     208  `id` int(11) NOT NULL auto_increment, 
     209  `name` varchar(64) NOT NULL default '', 
     210  `value` varchar(255) default '', 
     211  PRIMARY KEY  (`id`) 
     212) TYPE=MyISAM;  
  • trunk/install/install.php

    r51 r57  
    9696 
    9797<body> 
    98 <div class="bodyline" style="padding:4px;"> 
     98<div align="center"><div class="bodyline" style="width:740px" align="left"> 
    9999        <h1>phpBMS Installation Instructions</h1> 
    100100        <h2>Application Requirements</h2> 
     101        <div class="box"> 
    101102        <ul> 
    102103                <li>MySQL 3.23.58 or higher</li> 
     
    104105                <li>Web Server (Tested using Apache and IIS.)</li> 
    105106        </ul> 
    106          
    107  
    108  
    109         <h2>Setting Up The Database</h2> 
     107        </div> 
     108         
     109 
     110 
     111        <h2>Set Up The Database</h2> 
    110112         
    111113        <div class="box"> 
    112114        <h3>Step 1 - Set Database Connection Information</h3> 
    113115        <div style="margin-left:10px;"> 
    114                 There are two ways to provide the connection information phpBMS will need to interact with the MySQL database. 
    115                 Providing the information by filling in the fields below can be quicker, but if phpBMS is not being hosted securely,  
    116                 the MySQL login information can be compromised.</div> 
    117  
    118         <div style="float:right;width:40%;padding-top:0"> 
    119                 <h4 style="margin-left:0;margin-bottom:1px;">Results</h4> 
    120                 <div> 
    121                         <textarea name="results" id="updatesettingsresults" style="width:100%;font-family:'Courier New', Courier, mono;font-size:11px;" rows="12"></textarea> 
    122                 </div> 
    123         </div> 
    124         <h4 style="margin-right:42%">A) Enter Connection Information</h4> 
    125          
    126         <div style="margin-left:25px;margin-right:42%;"> 
    127                 <div>Enter The mySQL connection information and then click the &quot;Create Settings&quot; button. This will create the settings file required to run phpBMS. It will also copy some other default files used throughout the program (logo picture used on reports, etc..)</div> 
    128                 <div><em style="color:red;">(insecure if not done through SSL)</em></div> 
    129                 <div> 
    130                         MySQL Server<br> 
    131                         <input type="text" name="mysqlserver" id="mysqlserver" size="32" value="localhost"> 
    132                 </div> 
    133                 <div> 
    134                         MySQL Database<br> 
    135                         <input type="text" name="mysqldb" id="mysqldb" size="32" value="phpbms"><br> 
    136                         <em class=small>(If the database has not been created yet, it will be in step two.)</em> 
    137                 </div> 
    138                 <div> 
    139                         MySQL User<br> 
    140                         <input type="text" name="mysqluser" id="mysqluser" size="32" value=""> 
    141                 </div> 
    142                 <div> 
    143                         MySQL Password<br> 
    144                         <input type="password" name="mysqluserpass" id="mysqluserpass" size="32" value=""> 
    145                 </div> 
    146                 <div><input type="button" value="Create Settings" class="Buttons" onClick="runCommand('updatesettings')"></div> 
    147         </div> 
    148          
    149         <h4>B) Or, Manually Create the settings.php File</h4> 
     116                This step will require you to manually create the settings file. that is used by PHP to connect to your MySQL database. </div> 
     117 
     118         
     119         
     120        <h4> Create the settings.php File</h4> 
    150121        <div style="margin-left:25px;">          
    151         Copy the file <strong>defaultsettings.php</strong> and create the file <strong>settings.php</strong>. Make sure to modify the MySQL settings in the <strong>settings.php</strong> file. You can also modify any other settings at this time but the four 
    152         settings that are essential to connecting to the database are: 
     122        Make a copy the file <strong>defaultsettings.php</strong> (located in the web application root) and name the new file <strong>settings.php</strong>. Next, modify the following prarameters: 
    153123        <ul class="small"> 
    154                 <li><strong>mysql_server</strong>: the mysql server location (in most cases, this should be the same location as the web server, or &quot;localhost &quot;)<br><br> 
    155                         <em style="color:red;">Note:  If your database server is different then your web server,  data security issues can occur.</em><br> 
    156                         &nbsp; 
     124                <li><strong>mysql_server</strong>: the mysql server location (in most cases, this should be the same location as the web server, or &quot;localhost&quot;)<br> 
     125                        <div class="small" style=" color:#DF0005"><strong>Note:</strong> If your database server is different then your web server,  make sure you take any necessary security precautions.</div> 
    157126                        </li> 
    158                 <li><strong>mysql_database</strong>: the name of the database to be used by phpBMS. If it has not been created yet, step two will create it.<br> 
     127                <li><strong>mysql_database</strong>: the name of the database to be used by phpBMS. If it has not been created yet, step two will create it if your mysql user has rights o create the database. <br> 
    159128                        &nbsp;</li> 
    160129                <li><strong>mysql_user</strong>: the name of the user PHP will use to access the database.<br> 
    161130                        &nbsp;</li> 
    162                 <li><strong>mysql_userpass</strong>:    the     password for the user used     to access the database.</li> 
     131                <li><strong>mysql_userpass</strong>:    the     password for the user that access the database.</li> 
    163132        </ul> 
    164133        </div> 
     
    172141        <h4 style="margin-right:42%">Test the Database Connection</h4> 
    173142        <div style="margin-left:25px;margin-right:42%"> 
    174                 Once the database connection information has been entered, test the connection.  If connection fails, check 
    175                 to make sure the settings are correct
     143                Once the <strong>settings.php</strong> file has been created and the database connection information has been entered, test the connection.  If connection fails, check 
     144                to make sure the <strong>settings.php</strong> is setup correctly
    176145        </div> 
    177146        <div style="margin-left:25px;margin-right:42%"><input type="button" value="Test Connection" class="Buttons" onClick="runCommand('testconnection')"><br>&nbsp;</div> 
    178147        </div> 
    179  
     148        <div>&nbsp;</div> 
    180149 
    181150        <div class="box"> 
     
    192161                        If you have already created the MySQL database, skip to step three.  If not, click the "Create Database" button.   
    193162                        This will attempt to create the database set above. 
    194                </div> 
     163The    user that you specified in the settings.php file must have rights to create the database. </div> 
    195164                <div><input type="button" value="Create Database" class="Buttons" onClick="runCommand('createdatabase')"></div> 
    196                 <div class=small><strong>Note:</strong> Some ISPs limit the number of mySQL databases you are allowed, or control database creation through a web application, or on a request basis. If you have any questions, contact your ISP.</div> 
     165                <div class="small" style=" color:#DF0005"><strong>Note:</strong> Some ISPs limit the number of mySQL databases you are allowed, or control database creation through a web application, or on a request basis. If you have any questions, contact your ISP.</div> 
    197166                <div>&nbsp;</div>                
    198167                <div>&nbsp;</div> 
    199168        </div> 
    200169        </div>   
    201          
     170                <div>&nbsp;</div> 
     171 
    202172        <div class="box" style="clear:right"> 
    203173        <div style="float:right;width:40%;padding-top:0;"> 
    204174                <h3 style="margin-left:0;margin-bottom:1px;">Results</h3> 
    205175                <div> 
    206                         <textarea name="results" id="populatedataresults" style="width:98%;font-family:'Courier New', Courier, mono;font-size:11px;" rows="10"></textarea> 
    207                 </div> 
    208         </div> 
    209          
    210         <h3 style="margin-right:42%">Step 3 - Create Base Tables and Populate Default Information </h3> 
     176                        <textarea name="results" id="populatedataresults" style="width:98%;font-family:'Courier New', Courier, mono;font-size:11px;" rows="12"></textarea> 
     177                </div> 
     178        </div> 
     179         
     180        <h3 style="margin-right:42%">Step 3 - Create Default Information </h3> 
    211181        <div style="margin-left:10px;margin-right:42%"> 
    212182                <div> 
    213                         Next, phpBMS needs to create the base level tables and populate the tables with the basic information needed to  
     183                        Next, phpBMS needs to create the base level tables and populate the tables with the basic information that phpBMS needs to  
    214184                        work. 
    215185                </div> 
     
    223193                        password: <strong>phpbms</strong> 
    224194                </div> 
    225                 <div><em style="color:red;"><strong>Note:</strong> Change the password after the first successful login.</em></div> 
     195                <div class="small" style=" color:#DF0005"><strong>Note:</strong> Make sure to change the encryptions seed and password after the first successful login.</div> 
    226196                <div>&nbsp;</div> 
    227197        </div> 
     
    229199         
    230200         
    231         <h2 style="clear:both;">Installing Additional Modules </h2> 
    232         <div> 
    233                 The base phpBMS system contains only the basic framework, administration and notes capabilities.  
    234                 Client and product management, invoicing and mass emailing capabilities are contained in a separate 
    235                 BMS module.  Modules are stored in the "modules" folder. To install the BMS module, proceed to step 4. 
    236         </div> 
    237          
    238         <div class="box"> 
     201        <h2 style="clear:both;">Install Additional Modules </h2> 
     202        <div class="box"> 
     203<div> 
     204                The base phpBMS system contains <strong>only</strong> the bare framework, administration, and note/task/event capabilities.  
     205                Additional modules will add functionality such as client/prospect and product management, quote/order/invoice control, and mass e-mailing. The modules are installed separately in the next step. </div>         
    239206        <div style="float:right;width:40%;padding-top:0;"> 
    240207                <h3 style="margin-left:0;margin-bottom:1px;">Results</h3> 
    241208                <div> 
    242                         <textarea name="results" id="moduleresults" style="width:100%;font-family:'Courier New', Courier, mono;font-size:11px;" rows="10"></textarea> 
     209                        <textarea name="results" id="moduleresults" style="width:98%;font-family:'Courier New', Courier, mono;font-size:11px;" rows="10"></textarea> 
    243210                </div> 
    244211        </div> 
    245212        <h3 style="margin-right:42%;">Step 4 - Install Additional Modules</h3> 
    246213        <div style="margin-left:10px;margin-right:42%"> 
    247                 <div>To install a module, choose the module form the list and click the "Install Module" button.</div> 
     214                <div>To install a module, highlight the module form the list and click the "Install Module" button.</div> 
    248215                <div> 
    249216                        Select a module to install<br> 
     
    259226        </div> 
    260227 
    261         <h2>Securing The Application</h2> 
    262         <div
     228        <h2>Secure The Application</h2> 
     229        <div class="box"
    263230                phpBMS can contain sensitive information, log in information and sensitive credit card information that could be exposed to the internet insecurely. 
    264231                We recommend performing the following actions to secure phpBMS 
    265                     <ul> 
     232:                    
     233                        <ul> 
    266234                        <li> 
    267235                                <strong>Delete Installation/Disable Folders</strong> - Once the installation process has been completed for the base system and the BMS modules, 
    268                                 Either delete the installation folders, or make them inaccessible from the web server.<br>&nbsp; 
     236                                Either delete the installation folders, or make them inaccessible by the web server and php.<br> 
     237                                &nbsp; 
    269238                        </li> 
    270239                        <li> 
     
    275244                </ul> 
    276245        </div> 
    277         <h2>Completing The Installation</h2> 
    278         <div>If phpBMS was installed successfully, go to the log in screen, use the administrative user name password to log in and complete the installation process</div> 
    279         <div><input type="button" id="login" name="login" value="Go to Log In Screen" class="Buttons" onClick="document.location='../'"></div> 
    280          
    281 </div> 
     246        <h2>Complete the Installation</h2> 
     247        <div class="box"> 
     248                If all of the above actions completed successfully, phpBMS was installed successfully. Go to the log in screen, use the administrative user name password (above) and log in to finish the installation process. After logging in, you may want to go to the administration section, and set up the basic settings for your application as well as change the admininstrative username and password. 
     249                        <div><input type="button" id="login" name="login" value="Go to Log In Screen" class="Buttons" onClick="document.location='../'"></div> 
     250        </div> 
     251         
     252         
     253</div></div> 
    282254</body> 
    283255</html> 
  • trunk/install/installxml.php

    r51 r57  
    115115} 
    116116 
    117 function writeSettings($server,$database,$user,$userpass){ 
    118         $settings["mysql_server"]=$server; 
    119         $settings["mysql_database"]=$database;   
    120         $settings["mysql_user"]=$user;   
    121         $settings["mysql_userpass"]=$userpass;   
    122  
    123         $settingsfile = @ fopen("../settings.php","r"); 
    124         if(!$settingsfile) return "Could not open settings.php file for reading";  
    125  
    126         //create an array of all lines 
    127         while( !feof($settingsfile)) { 
    128                 $newfile[]=fgets($settingsfile,1024); 
    129         } 
    130         fclose($settingsfile); 
    131          
    132         $newfile[]="\n"; 
    133         foreach($settings as $settingname=>$settingvalue) { 
    134                 $infile=false; 
    135                 //next loop through the file, and if the setting is their, replace it 
    136                 for($i=0;$i<count($newfile);$i++){ 
    137                         if (strpos(("D".$newfile[$i]),$settingname)==1) { 
    138                                 $tabnumber=intval(5-strlen($settingname)/8); 
    139                                 $newfile[$i]=$settingname.str_repeat(chr(9),$tabnumber)."= \"".str_replace(chr(10),"\\n",$settingvalue)."\"\n"; 
    140                                 $infile=true; 
    141                                 break; 
    142                         } 
    143                 } 
    144         } 
    145         if(end($newfile)=="\n") array_pop($newfile); 
    146         //now write the new file 
    147         $settingsfile=NULL; 
    148         $settingsfile = @ fopen("../settings.php","w"); 
    149         if(!$settingsfile) return "Could not open settings file for writing."; 
    150         for($i=0;$i<count($newfile);$i++){ 
    151                  fwrite($settingsfile,$newfile[$i],1024); 
    152         } 
    153         //fclose($settingsfile); 
    154          
    155         return "settings.php file updated successfully"; 
    156 }//end function 
    157  
    158 function createDefaultFiles(){ 
    159         $thereturn="Copying Default Files Successful\n"; 
    160         if(!copy("../defaultsettings.php","../settings.php")) 
    161                 $thereturn="Error Copying Default Settings File."; 
    162         if(!copy("../report/defaultlogo.png","../report/logo.png")) 
    163                 $thereturn="Error Copying Default Logo Picture File."; 
    164         return $thereturn; 
    165 } 
    166117 
    167118                $thereturn="Error Processing: No Command Given"; 
     
    170121 
    171122                        switch($_GET["command"]){ 
    172                                 case "updatesettings": 
    173                                         $thereturn=createDefaultFiles(); 
    174                                         $thereturn.=writeSettings($_GET["ms"],$_GET["mdb"],$_GET["mu"],$_GET["mup"]); 
    175                                 break; 
    176  
    177123 
    178124                                case "testconnection": 
     
    222168                                        $thereturn.=importData("tablesearchablefields"); 
    223169                                        $thereturn.=importData("users"); 
     170                                        $thereturn.=importData("settings"); 
    224171                                        $thereturn.="\nDone Importing Data\n===========================\n"; 
    225172                         
  • trunk/install/updatev0.61.sql

    r54 r57  
    1111UPDATE tablefindoptions SET search ="notes.type='EV' AND notes.createdby = {{$_SESSION['userinfo']['id']}} AND ((notes.startdate = curdate()) OR notes.`repeat`=1)" WHERE id=88 
    1212UPDATE tablefindoptions SET search ="notes.type='EV' AND notes.createdby = {{$_SESSION['userinfo']['id']}} AND ((notes.startdate = date_sub(curdate(),INTERVAL 1 DAY)) OR notes.`repeat`=1)" WHERE id=89 
     13 
     14CREATE TABLE `settings` (`id` int(11) NOT NULL auto_increment, `name` varchar(64) NOT NULL default '',`value` varchar(255) default '', PRIMARY KEY  (`id`)) TYPE=MyISAM;  
  • trunk/install/updatexml.php

    r54 r57  
    8888        function processSQLfile($filename){ 
    8989                global $dblink; 
    90                  
     90                                
    9191                $thefile = fopen($filename,"r"); 
    9292                if(!$thefile) { 
     
    166166        function runUpdate($currentVersion,$newVersion){ 
    167167                global $dblink; 
     168                global $vars; 
    168169                 
    169170                $thereturn=""; 
     
    248249                                        $queryresult=mysql_query($querystatement,$dblink); 
    249250                                        $thereturn.=" - modified base record in modules table\n"; 
     251                                         
     252                                        foreach($vars as $key=>$value){ 
     253                                                if (strpos($key,"mysql_")!==0){ 
     254                                                        $querystatement="INSERT INTO settings (name,value) VALUES (\"".$key."\",\"".$value."\")"; 
     255                                                        $queryresult=mysql_query($querystatement,$dblink); 
     256                                                } 
     257                                        } 
     258                                        $thereturn.="Moved non-mysql settings to new settings table.\n"; 
    250259                                         
    251260                                        $thereturn.="Update to 0.61 Finished\n\n"; 
  • trunk/modules/base/adminsettings.php

    r56 r57  
    100100                <legend>My<span style="text-transform:capitalize;">SQL</span></legend> 
    101101                <div class="small important"> 
    102                         <em>Changing the MySQL settings may break the web application. Be very careful when changing these settings.</em> 
     102                        <em>MysSQL settings must be updated manually by editing the settings.php file</em> 
    103103                </div> 
    104104                <label for="smysql_server"> 
    105                         server name <em>(usually localhost)</em><br /> 
    106                         <?PHP field_text("smysql_server",$_SESSION["mysql_server"],1,"mySQL server name cannot be blank.","",Array("size"=>"32","maxlength"=>"128")); ?
     105                        server name<br /> 
     106                        <input size="32" maxlength="128" value="<?php echo htmlQuotes($_SESSION["mysql_server"])?>" readonly class="uneditable"/
    107107                </label> 
    108108                <label for="smysql_database"> 
    109                         database name <em>(usually phpbms)</em><br /> 
    110                         <?PHP field_text("smysql_database",$_SESSION["mysql_database"],1,"mySQL database name cannot be blank.","",Array("size"=>"32","maxlength"=>"128")); ?
     109                        database name<br /> 
     110                        <input size="32" maxlength="128" value="<?php echo htmlQuotes($_SESSION["mysql_database"])?>" readonly class="uneditable"/
    111111                </label> 
    112112                <label for="smysql_user"> 
    113113                        mysql username<br /> 
    114                         <input id="smysql_user" name="smysql_user" type="text" size="32" maxlength="128" value="<?php echo htmlQuotes($_SESSION["mysql_user"])?>" /> 
     114                        <input size="32" maxlength="128" value="<?php echo htmlQuotes($_SESSION["mysql_user"])?>" readonly class="uneditable"/> 
    115115                </label> 
    116116                <label for="smysql_userpass"> 
    117117                        mysql user password<br /> 
    118                         <input id="smysql_userpass" name="smysql_userpass" type="text" size="32" maxlength="128" value="<?php echo $_SESSION["mysql_userpass"] ?>" /> 
     118                        <input size="32" maxlength="128" value="<?php echo htmlQuotes($_SESSION["mysql_userpass"])?>" readonly class="uneditable"/> 
    119119                </label> 
    120120        </fieldset> 
  • trunk/modules/base/include/adminsettings_include.php

    r51 r57  
    3838// any settings you want saved 
    3939//========================================= 
    40 function write_settings($settings) { 
    41         $settingsfile = fopen("../../settings.php","r") or die ("Couldn't open Settings File"); 
    42         //create an array of all lines 
    43         while( !feof($settingsfile)) { 
    44                 $newfile[]=fgets($settingsfile,1024); 
     40function updateSettings($settings) { 
     41        global $dblink; 
     42         
     43        foreach($settings as $key=>$value){ 
     44                $querystatement="UPDATE settings set value=\"".$value."\" WHERE name=\"".$key."\""; 
     45                $queryresult=mysql_query($querystatement,$dblink); 
     46                if(!$queryresult) reportError(mysql_error($dblink)." - ".$querystatement);               
    4547        } 
    46         fclose($settingsfile); 
    47          
    48         $newfile[]="\n"; 
    49         foreach($settings as $settingname=>$settingvalue) { 
    50                 $infile=false; 
    51                 //next loop through the file, and if the setting is their, replace it 
    52                 for($i=0;$i<count($newfile);$i++){ 
    53                         if (strpos(("D".$newfile[$i]),$settingname)==1) { 
    54                                 $tabnumber=intval(5-strlen($settingvalue)/8); 
    55                                 $newfile[$i]=$settingname.str_repeat(chr(9),$tabnumber)."= \"".str_replace(chr(10),"\\n",$settingvalue)."\"\n"; 
    56                                 $infile=true; 
    57                                 break; 
    58                         } 
    59                 }// 
    60                 if(!$infile) { 
    61                         $tabnumber=intval(5-strlen($settingname)/8); 
    62                         $newfile[]=$settingname.str_repeat(chr(9),$tabnumber)."= \"".str_replace(chr(10),"\\n",$settingvalue)."\"\n"; 
    63                 } 
    64         } 
    65                  
    66         if(end($newfile)=="\n") array_pop($newfile); 
    67         //now write the new file 
    68         $settingsfile = fopen("../../settings.php","w") or die ("Couldn't open Settings File"); 
    69         for($i=0;$i<count($newfile);$i++){ 
    70                  fwrite($settingsfile,$newfile[$i],1024); 
    71         } 
    72         fclose($settingsfile);   
    7348}//end function 
    7449 
     
    7752        $writesettings=Array(); 
    7853        foreach($variables as $key=>$value){ 
    79                 if($key!="command" && $key!="printedlogo"){ 
     54                if($key!="command" && $key!="printedlogo" && strpos($key,"mysql_")!==0){ 
    8055                        if($_SESSION[substr($key,1)]!=$value){ 
    8156                                $writesettings[substr($key,1)]=$value; 
     
    9469 
    9570        // if changes, process settings 
    96         if(count($writesettings)>0) { write_settings($writesettings);} 
     71        if(count($writesettings)>0) 
     72                updateSettings($writesettings); 
    9773         
    9874        // deal with logo graphic. 
  • trunk/modules/bms/install/install.php

    r51 r57  
    144144        $thereturn.=importData("tablesearchablefields"); 
    145145        $thereturn.=importData("usersearches"); 
     146        $thereturn.=importData("settings"); 
    146147 
    147148        $thereturn.="Done Importing Data\n===========================\n"; 
Copyright © 2006-2007 Kreotek, LLC. All Rights reserved.