[Linpha-cvs] SF.net SVN: linpha: [4782] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <bz...@us...> - 2007-11-06 18:01:44
|
Revision: 4782 http://linpha.svn.sourceforge.net/linpha/?rev=4782&view=rev Author: bzrudi Date: 2007-11-06 10:01:42 -0800 (Tue, 06 Nov 2007) Log Message: ----------- "/install remove message" Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/docs/dev/TODO.txt trunk/linpha2/install/step11_finish.php trunk/linpha2/lib/include/integrity.php Removed Paths: ------------- trunk/linpha2/install/sql/sql.data.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2007-11-06 17:20:31 UTC (rev 4781) +++ trunk/linpha2/ChangeLog 2007-11-06 18:01:42 UTC (rev 4782) @@ -1,7 +1,8 @@ 2007-11-06 bzrudi * moved sql.data.php out of install folder into /lib/include to make sure we can delete /install folder after installation. - * Add check for /install directory to integrity.php and abort if exist. + * Add check for /install directory to integrity.php and abort if exist. + (only print notice when linpha is installed public) 2007-11-05 flo * worked some more on the map plugin Modified: trunk/linpha2/docs/dev/TODO.txt =================================================================== --- trunk/linpha2/docs/dev/TODO.txt 2007-11-06 17:20:31 UTC (rev 4781) +++ trunk/linpha2/docs/dev/TODO.txt 2007-11-06 18:01:42 UTC (rev 4782) @@ -55,10 +55,6 @@ - Installer - define final installer behaviour - - if installation is complete, the user must delete the install/ folder ? - (install/ignore_delete_install_msg.txt) - -> we need to move the sql scripts to the /lib folder because we need them - in the admin - maintenance - db part - user have to delete var/sql/config.sql.php before another installation can continue ? -> otherwise it would be possible to overwrite the current installation, (and to delete cache folders) - DONT add feature to drop tables if they already exists @@ -133,7 +129,11 @@ - what if the user specify wrongly the album folder as the cache folder...?? - what if a hacker gets access to the install and specify '/' as cache folder...?? -> only delete content of tmp, cache and sql folders if they are not changed (default values) - - take care of exiftool support +- if installation is complete, the user must delete the install/ folder ? + (install/ignore_delete_install_msg.txt) +- take care of exiftool support +- we need to move the sql scripts to the /lib folder because we need them + in the admin - maintenance - db part - Basket (finish) - Support for the Icons - Search (copy from linpha1) Deleted: trunk/linpha2/install/sql/sql.data.php =================================================================== --- trunk/linpha2/install/sql/sql.data.php 2007-11-06 17:20:31 UTC (rev 4781) +++ trunk/linpha2/install/sql/sql.data.php 2007-11-06 18:01:42 UTC (rev 4782) @@ -1,344 +0,0 @@ -<?php -/* -* Copyright (c) 2005 Heiko Rutenbeck <bz...@tu...> -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -/** - * linpha installer - * @package Installation - */ - -/** - * config table - */ -$options = array( - 'sys_db_version' => '3', - - 'sys_im_bracket_support' => $_SESSION['sys_im_bracket_support'], - 'sys_im_imagemagick_path' => $_SESSION['sys_im_convert_path'], - 'sys_im_use_imagemagick' => $_SESSION['sys_im_use_convert'], - 'sys_im_video_thumbnail' => '1', - - 'sys_import_autoimport' => '1', - 'sys_import_exif' => '1', - 'sys_import_exif_autorot' => '1', - 'sys_import_use_exiftool' => '0', - 'sys_import_use_emb_thumb' => '0', - 'sys_import_exiftool_avail' => '0', - 'sys_import_files_ignored' => 'Thumbs.db,ZbThumbnail.info,_vti_cnf,_derived,Picasa.ini,Cdlabel.alb', - 'sys_import_fileext_ignored' => 'thm,doc,txt', - - 'sys_image_exif' => '1', - 'sys_image_iptc' => '0', - 'sys_image_xmp' => '0', - 'sys_lang' => $_SESSION['language'], - 'sys_lang_autolang' => '1', - 'sys_path_album_dir' => $_SESSION['album_dir'], - 'sys_path_cache_dir' => $_SESSION['cache_dir'], - 'sys_path_tmp_dir' => $_SESSION['tmp_dir'], - - 'sys_basket_mail_max_size' => (1024*1024*2), - 'sys_basket_mail_smpthost' => 'localhost', - 'sys_basket_download_limit' => '0', - - 'sys_style_datetime_dates' => '%a %m/%d/%Y', - 'sys_style_datetime_times' => '%I:%M:%S %p', - - 'sys_style_home_showbrowsebydate' => '1', - 'sys_style_home_nrrandomimages' => '4', - 'sys_style_home_newimagesnr' => '4', - 'sys_style_home_newimagesage' => '7', - 'sys_style_home_showalbums' => '1', - 'sys_style_home_usedefaultwelcometext' => '1', - 'sys_style_home_firstsortorder' => 'nameasc', - - 'sys_style_thumb_size_max' => '200', - 'sys_style_thumb_size_display' => '150', - 'sys_style_thumb_showsubfoldersseparate' => '0', - 'sys_style_thumb_selectsizes' => '50,75,100,150,200,250,300,400,500', - 'sys_style_thumb_selectnrimages' => 'auto,10,25,50,100,200,all', - 'sys_style_thumb_nojsnrrows' => '3', - 'sys_style_thumb_nojsnrcols' => '4', - - 'sys_style_image_quality' => '75', - 'sys_style_image_width' => '700', - 'sys_style_image_height' => '525', - 'sys_style_image_nrprevnextthumbs' => '3', - 'sys_style_image_useeffects' => '1', - - 'sys_style_layout_color_bodybg' => 'DDDDDD', // the blue design - 'sys_style_layout_color_elembg' => '87CEFA', - 'sys_style_layout_color_font' => '000000', - 'sys_style_layout_color_albumsbg' => 'D5FCF4', - 'sys_style_layout_color_links' => '005388', - 'sys_style_layout_color_linkshover' => '666666', - 'sys_style_layout_color_fields' => 'CCCCCC', - - 'sys_style_layout_theme' => 'default', - 'sys_style_layout_template' => 'default', - 'sys_style_layout_title' => 'Linpha 2.0', - - 'sys_style_others_sortorder' => 'nameasc', - - 'sys_user_autologin' => '1', - - - 'plugins_log_filename' => 'var/linpha.log', - 'plugins_log_syslog_enable' => '0', - 'plugins_log_syslog_add_events' => '', - 'plugins_log_email_enable' => '0', - 'plugins_log_email_add_events' => '', - 'plugins_log_email_to' => 'LinPHA Logger<log@'.$_SERVER["HTTP_HOST"].'>', - 'plugins_log_email_headers' => 'From:LinPHA Logger<noreply@'.$_SERVER["HTTP_HOST"].'>', - 'plugins_log_email_subject' => 'Linpha Log', - - 'plugins_filemanager_enable' => '0', - 'plugins_filemanager_nruploads' => '5', - - 'plugins_maps_defaultMarkerZoom' => '10', - 'plugins_maps_mapType' => 'google', - 'plugins_maps_google_key' => 'ABQIAAAAAXCMfho4_sqSSh0VqMB80xT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSfO_6bbb_ScfT_zPgcnJMKyGltOg', // key for http://localhost - -); - -$options_user_overrideable = Array( - 'sys_lang', - 'sys_lang_autolang', - 'sys_style_others_sortorder', - 'sys_style_template', - 'sys_style_home_showbrowsebydate', - 'sys_style_home_nrrandomimages', - 'sys_style_home_showalbums', - 'sys_style_home_firstsortorder', - 'sys_style_thumb_size_display', - 'sys_style_thumb_showsubfoldersseparate', - 'sys_style_thumb_nojsnrrows', - 'sys_style_thumb_nojsnrcols', - 'sys_style_image_width', - 'sys_style_image_height', - 'sys_style_image_nrprevnextthumbs' => '3', - 'sys_style_image_useeffects' => '1', - - 'sys_style_layout_color_bodybg' => 'DDDDDD', // the blue design - 'sys_style_layout_color_elembg' => '87CEFA', - 'sys_style_layout_color_font' => '000000', - 'sys_style_layout_color_albumsbg' => 'D5FCF4', - 'sys_style_layout_color_links' => '005388', - 'sys_style_layout_color_linkshover' => '666666', - 'sys_style_layout_color_fields' => 'CCCCCC', - - 'sys_style_layout_theme' => 'default', - 'sys_style_layout_template' => 'default', -); - -/** - * create sql executes for all option entries - */ -while( list($name, $value) = each($options) ) -{ - if(in_array($name,$options_user_overrideable)) { - $override = 1; - } else { - $override = 0; - } - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."config (option_name, option_value, override, user_id) " . - "VALUES ('".$name."', '".$value."', '".$override."', '0')"; -} - -/** - * groups - */ -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."groups (group_name) VALUES ('admin')"; - -/** - * permissions - */ -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (photos_id, perm_type, permission) " . - "VALUES (0, 'read', ';public;')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (photos_id, perm_type, permission) " . - "VALUES (0, 'write', ';;')"; - - -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('basket_print', '')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('basket_mail', '')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('basket_download', '')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('metadata_comments', ';public;')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('metadata_deletecomments', '')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('metadata_edit', '')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('watermark', '')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('stats', '')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('download', '')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('plugins_maps_setMarkers', '')"; - - -/** - * MetaData - * see http://linpha.sourceforge.net/wiki/index.php/Tables_linpha_meta_fields for the definition - */ - /** - * special fields - * flag_nr 1 - */ - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('filename', 0, 1)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('imagesize', 0, 1)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('dimension', 0, 1)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('thumbnail', 0, 1)"; - - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('time_add', 0, 1)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('time_mod', 0, 1)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('time_exif', 0, 1)"; - - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('stats_numbers', 0, 1)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('stats_views', 0, 1)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('stats_downloads', 0, 1)"; - - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('first_comment', 0, 1)"; - /** - * workaround for i18n - * they wouldn't get detected otherwise... - * some are defined in linpha.metadata.php - */ - i18n("Filename"); i18n("Imagesize"); i18n("Dimension"); i18n("Thumbnail"); - - - /** - * builtin fields - * flag_nr 5 (builtin enabled) - */ - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('description', 1, 5)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('category', 2, 5)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('persons', 2, 5)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('date', 3, 5)"; - /** - * workaround for i18n - * they wouldn't get detected otherwise... - * some are defined in linpha.metadata.php - */ - i18n("Description"); i18n("Category"); i18n("Persons"); i18n("Date"); - - - /** - * image fields - * flag_nr 10 - */ - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_filename', 0, 10)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_imagesize', 0, 10)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_dimension', 0, 10)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_description', 0, 10)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_category', 0, 10)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_persons', 0, 10)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_time_exif', 0, 10)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_stats_views', 0, 10)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_stats_downloads', 0, 10)"; - - - /** - * video fields - * flag_nr 11 - */ - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('??', 0, 11)"; - - /** - * album fields - * flag_nr 12 - */ - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_time_add', 0, 12)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_stats_numbers', 0, 12)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_description', 0, 12)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_persons', 0, 12)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_first_comment', 0, 12)"; - - - /** - * thumbnails fields - * flag_nr 13 - */ - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_thumbnail', 0, 13)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_filename', 0, 13)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_description', 0, 13)"; - - /** - * thumbnails in detail view fields - * flag_nr 14 - */ - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_thumbnail', 0, 14)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_filename', 0, 14)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_description', 0, 14)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_imagesize', 0, 14)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_dimension', 0, 14)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('exif_datetimeoriginal', 0, 14)"; - - /** - * slideshow fields - * flag_nr 15 - */ - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_filename', 0, 15)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_description', 0, 15)"; - -?> - Modified: trunk/linpha2/install/step11_finish.php =================================================================== --- trunk/linpha2/install/step11_finish.php 2007-11-06 17:20:31 UTC (rev 4781) +++ trunk/linpha2/install/step11_finish.php 2007-11-06 18:01:42 UTC (rev 4782) @@ -192,6 +192,12 @@ echo "<br /><br /><hr /><br />"; echo "<h2>".i18n_install("Congratulations")."</h2><br />"; echo i18n_install("Installation Finished!"); + +if($_POST['sys_public_installation']) +{ + echo "<b><br>".i18n_install("For security reasons you have to remove the /install directory before continuing!")."</b>"; +} + ?> <script language="JavaScript" type='text/javascript'> <!-- @@ -202,4 +208,4 @@ session_destroy(); include_once(LINPHA_DIR.'/install/footer.php'); -?> \ No newline at end of file +?> Modified: trunk/linpha2/lib/include/integrity.php =================================================================== --- trunk/linpha2/lib/include/integrity.php 2007-11-06 17:20:31 UTC (rev 4781) +++ trunk/linpha2/lib/include/integrity.php 2007-11-06 18:01:42 UTC (rev 4782) @@ -30,12 +30,16 @@ * check folders */ $folders = array("install", "album", "tmp", "cache"); + $install_type_public = $GLOBALS['linpha']->sql->config->value['sys_public_installation']; foreach($folders AS $directory) { $dir = LinSql::getPath($directory); - - if( $directory == "install" && file_exists($dir) ) + + /** + * Install directory check only on public installation + */ + if( $directory == "install" && file_exists($dir) && $install_type_public == true) { throw new Exception(i18n("For security reasons, the LinPHA $dir " . "directory needs to be removed!")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |