Changeset 1284
- Timestamp:
- Apr 27, 2006, 11:08:50 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r1278 r1284 1607 1607 else 1608 1608 { 1609 $insert{'status'} = boolean_to_string($conf['newcat_default_status']);1609 $insert{'status'} = $conf['newcat_default_status']; 1610 1610 } 1611 1611 } … … 1613 1613 { 1614 1614 $insert{'visible'} = boolean_to_string($conf['newcat_default_visible']); 1615 $insert{'status'} = boolean_to_string($conf['newcat_default_status']);1615 $insert{'status'} = $conf['newcat_default_status']; 1616 1616 $insert{'global_rank'} = $insert{'rank'}; 1617 1617 } -
trunk/admin/site_update.php
r1278 r1284 253 253 ? false 254 254 : boolean_to_string($conf['newcat_default_uploadable']), 255 'status' => boolean_to_string($conf{'newcat_default_status'}),255 'status' => $conf{'newcat_default_status'}, 256 256 'visible' => boolean_to_string($conf{'newcat_default_visible'}), 257 257 ); -
trunk/include/common.inc.php
r1119 r1284 163 163 // since basic gallery information is not available 164 164 // 165 $query = ' 166 SELECT param,value 167 FROM '.CONFIG_TABLE.' 168 ;'; 169 if (!($result = pwg_query($query))) 170 { 171 die("Could not query config information"); 172 } 173 174 while ( $row =mysql_fetch_array( $result ) ) 175 { 176 if ( isset( $row['value'] ) ) 177 { 178 $conf[$row['param']] = $row['value']; 179 } 180 else 181 { 182 $conf[$row['param']] = ''; 183 } 184 // If the field is true or false, the variable is transformed into a 185 // boolean value. 186 if ( $conf[$row['param']] == 'true' or $conf[$row['param']] == 'false' ) 187 { 188 $conf[$row['param']] = get_boolean( $conf[$row['param']] ); 189 } 190 } 165 load_conf_from_db(); 191 166 192 167 include(PHPWG_ROOT_PATH.'include/user.inc.php'); -
trunk/include/functions.inc.php
r1221 r1284 882 882 } 883 883 884 /** 885 * Add configuration parameters from database to global $conf array 886 * 887 * @return void 888 */ 889 function load_conf_from_db() 890 { 891 global $conf; 892 893 $query = ' 894 SELECT param,value 895 FROM '.CONFIG_TABLE.' 896 ;'; 897 $result = pwg_query($query); 898 899 if (mysql_num_rows($result) == 0) 900 { 901 die('No configuration data'); 902 } 903 904 while ($row = mysql_fetch_array($result)) 905 { 906 $conf[ $row['param'] ] = isset($row['value']) ? $row['value'] : ''; 907 908 // If the field is true or false, the variable is transformed into a 909 // boolean value. 910 if ($conf[$row['param']] == 'true' or $conf[$row['param']] == 'false') 911 { 912 $conf[ $row['param'] ] = get_boolean($conf[ $row['param'] ]); 913 } 914 } 915 } 884 916 ?> -
trunk/include/functions_user.inc.php
r1231 r1284 447 447 list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();')); 448 448 449 if ($user_id == $conf['webmaster_id']) 450 { 451 $status = 'webmaster'; 452 } 453 else if ($user_id == $conf['guest_id']) 454 { 455 $status = 'guest'; 456 } 457 else 458 { 459 $status = 'normal'; 460 } 461 449 462 $insert = 450 463 array( 451 464 'user_id' => $user_id, 452 'status' => $ user_id == $conf['webmaster_id'] ? 'admin' : 'normal',465 'status' => $status, 453 466 'template' => $conf['default_template'], 454 467 'nb_image_line' => $conf['nb_image_line'], … … 461 474 'maxheight' => $conf['default_maxheight'], 462 475 'registration_date' => $dbnow, 463 'enabled_high' => $conf['newuser_default_enabled_high'] 476 'enabled_high' => 477 boolean_to_string($conf['newuser_default_enabled_high']), 464 478 ); 465 479 -
trunk/install.php
r1221 r1284 248 248 $html_content = htmlentities( $file_content, ENT_QUOTES ); 249 249 $html_content = nl2br( $html_content ); 250 $template->assign_block_vars('error_copy', 251 array('FILE_CONTENT'=>$html_content)); 250 $template->assign_block_vars( 251 'error_copy', 252 array( 253 'FILE_CONTENT' => $html_content, 254 ) 255 ); 252 256 } 253 257 @fputs($fp, $file_content, strlen($file_content)); … … 269 273 $query = ' 270 274 UPDATE '.CONFIG_TABLE.' 271 SET value = \''.$admin_mail.'\'272 WHERE param = \'mail_webmaster\'273 ;';274 mysql_query($query);275 276 $query = '277 UPDATE '.CONFIG_TABLE.'278 275 SET value = \''.$language.'\' 279 276 WHERE param = \'default_language\' 280 277 ;'; 281 278 mysql_query($query); 282 283 $query = '284 INSERT 285 INTO '.SITES_TABLE.' 286 (id, galleries_url)287 VALUES288 (1, \''.PHPWG_ROOT_PATH.'galleries/\')289 ;';290 m ysql_query($query);279 280 // fill $conf global array 281 load_conf_from_db(); 282 283 $insert = array( 284 'id' => 1, 285 'galleries_url' => PHPWG_ROOT_PATH.'galleries/', 286 ); 287 mass_inserts(SITES_TABLE, array_keys($insert), array($insert)); 291 288 292 289 // webmaster admin user 293 $query = ' 294 INSERT INTO '.USERS_TABLE.' 295 (id,username,password,mail_address) 296 VALUES 297 (1,\''.$admin_name.'\',\''.md5($admin_pass1).'\',\''.$admin_mail.'\') 298 ;'; 299 mysql_query($query); 300 301 $query = ' 302 INSERT INTO '.USER_INFOS_TABLE.' 303 (user_id,status,language,enabled_high) 304 VALUES 305 (1, \'webmaster\', \''.$language.'\',\''.$conf['newuser_default_enabled_high'].'\') 306 ;'; 307 mysql_query($query); 290 $inserts = array( 291 array( 292 'id' => 1, 293 'username' => $admin_name, 294 'password' => md5($admin_pass1), 295 'mail_address' => $admin_mail, 296 ), 297 array( 298 'id' => 2, 299 'username' => 'guest', 300 ), 301 ); 302 mass_inserts(USERS_TABLE, array_keys($inserts[0]), $inserts); 303 304 create_user_infos(1); 305 create_user_infos(2); 308 306 309 307 $query = ' 310 308 UPDATE '.USER_INFOS_TABLE.' 311 SET feed_id = \''.find_available_feed_id().'\' 312 WHERE user_id = 1 313 ;'; 314 mysql_query($query); 315 316 // guest user 317 $query = ' 318 INSERT INTO '.USERS_TABLE.' 319 (id,username,password,mail_address) 320 VALUES 321 (2,\'guest\',\'\',\'\') 322 ;'; 323 mysql_query($query); 324 325 $query = ' 326 INSERT INTO '.USER_INFOS_TABLE.' 327 (user_id,status,language,enabled_high) 328 VALUES 329 (2, \'guest\', \''.$language.'\',\'false\') 309 SET language = \''.$language.'\' 330 310 ;'; 331 311 mysql_query($query);
Note: See TracChangeset
for help on using the changeset viewer.