[Easymod-cvs] easymod2/mods/easymod/em_includes em_ftp.php, 1.17, 1.18 em_functions.php, 1.23, 1.24
Status: Beta
Brought to you by:
wgeric
From: Eric F. <wg...@us...> - 2007-02-22 03:32:32
|
Update of /cvsroot/easymod/easymod2/mods/easymod/em_includes In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv20896/em_includes Modified Files: em_ftp.php em_functions.php em_modio.php Log Message: - MODs can't edit files with 'config' in them. Makes it so can't edit config.php - Attempt to move a .htaccess file into place so that you can't browse the mods folder after installing EasyMOD - Removed the EasyMOD version check on install. Index: em_functions.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_functions.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** em_functions.php 8 Jun 2006 04:08:07 -0000 1.23 --- em_functions.php 22 Feb 2007 03:32:20 -0000 1.24 *************** *** 250,253 **** --- 250,262 ---- $edit->emftp = $command_file->emftp ; + // don't let mods edit config.php + if (stristr($filename, 'config')) + { + $edit->err_msg = $lang['EM_trace'] . ': open_files[6]'; + $edit->err_msg = '<b>' . $lang['EM_err_critical_error'] . '</b><br /><br />' . $lang['EM_error_edit_config']; + $file_list[] = $edit ; + return OPEN_FAIL_CRITICAL; + } + // open the file and update our command file actions if ( $edit->modio_open()) *************** *** 844,848 **** // assume the EM_test.txt file exists; now see if we can chmod it ! if ( chmod( 'EM_test.txt', 0777)) { $access_msg = $lang['EM_ok'] ; --- 853,857 ---- // assume the EM_test.txt file exists; now see if we can chmod it ! if ( chmod( 'EM_test.txt', 0755)) { $access_msg = $lang['EM_ok'] ; *************** *** 892,896 **** // check for server mkdir access ! if ( mkdir( 'EM_test_dir', 0777) ) { // clean up! --- 901,905 ---- // check for server mkdir access ! if ( mkdir( 'EM_test_dir', 0755) ) { // clean up! Index: em_modio.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_modio.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** em_modio.php 1 Oct 2006 22:09:24 -0000 1.11 --- em_modio.php 22 Feb 2007 03:32:20 -0000 1.12 *************** *** 132,137 **** { // use the mkdir command ! mkdir($dir_path, 0777); ! chmod($dir_path, 0777); } --- 132,137 ---- { // use the mkdir command ! mkdir($dir_path, 0755); ! chmod($dir_path, 0755); } *************** *** 182,187 **** { // use the mkdir command ! mkdir($dir_path, 0777); ! chmod($dir_path, 0777); } $dir_path .= '/' ; --- 182,187 ---- { // use the mkdir command ! mkdir($dir_path, 0755); ! chmod($dir_path, 0755); } $dir_path .= '/' ; *************** *** 211,216 **** if (!file_exists($dir_path)) { ! mkdir($dir_path, 0777); ! chmod($dir_path, 0777); } $dir_path .= '/' ; --- 211,216 ---- if (!file_exists($dir_path)) { ! mkdir($dir_path, 0755); ! chmod($dir_path, 0755); } $dir_path .= '/' ; *************** *** 359,363 **** if ($create_command) { ! chmod( $install_path . $this->path . trim($this->filename), 0777 ) ; } --- 359,363 ---- if ($create_command) { ! chmod( $install_path . $this->path . trim($this->filename), 0755 ) ; } *************** *** 365,369 **** else { ! chmod( $install_path . 'processed/' . $this->path . trim($this->filename) . '.txt', 0777 ) ; } } --- 365,369 ---- else { ! chmod( $install_path . 'processed/' . $this->path . trim($this->filename) . '.txt', 0755 ) ; } } *************** *** 601,609 **** // I lifted this list from the attachment MOD and it saved me a lot of time. Thank you Acyd Burn! $extensions = array('ace', 'ai', 'aif', 'aifc', 'aiff', 'ar', 'asf', 'asx', 'au', 'avi', 'doc', 'dot', 'gif', 'gtar', 'gz', 'ivf', 'jpeg', 'jpg', 'm3u', 'mid', 'midi', 'mlv', 'mp2', 'mp3', 'mp2v', 'mpa', 'mpe', 'mpeg', 'mpg', 'mpv2', 'pdf', 'png', 'ppt', 'ps', 'rar', 'rm', 'rmi', 'snd', 'swf', 'tga', 'tif', 'wav', 'wax', 'wm', 'wma', 'wmv', 'wmx', 'wvx', 'xls', 'zip') ; ! $is_binary = false ; // see if the extension is in our list of binary types // damn! i wanted to use array_key_exists, but that is a PHP 4 function :( ! for ($count=0; $count<count($extensions); $count++) { // its a binary so mark it as such --- 601,609 ---- // I lifted this list from the attachment MOD and it saved me a lot of time. Thank you Acyd Burn! $extensions = array('ace', 'ai', 'aif', 'aifc', 'aiff', 'ar', 'asf', 'asx', 'au', 'avi', 'doc', 'dot', 'gif', 'gtar', 'gz', 'ivf', 'jpeg', 'jpg', 'm3u', 'mid', 'midi', 'mlv', 'mp2', 'mp3', 'mp2v', 'mpa', 'mpe', 'mpeg', 'mpg', 'mpv2', 'pdf', 'png', 'ppt', 'ps', 'rar', 'rm', 'rmi', 'snd', 'swf', 'tga', 'tif', 'wav', 'wax', 'wm', 'wma', 'wmv', 'wmx', 'wvx', 'xls', 'zip') ; ! $is_binary = true ; // forcing binary for every file // see if the extension is in our list of binary types // damn! i wanted to use array_key_exists, but that is a PHP 4 function :( ! /*for ($count=0; $count<count($extensions); $count++) { // its a binary so mark it as such *************** *** 613,617 **** break ; } ! } --- 613,617 ---- break ; } ! }*/ Index: em_ftp.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/em_includes/em_ftp.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** em_ftp.php 9 Feb 2007 00:49:26 -0000 1.17 --- em_ftp.php 22 Feb 2007 03:32:20 -0000 1.18 *************** *** 299,305 **** { $emftp->ftp_chdir('em_includes'); ! $emftp->emftp_chmod('em_includes', '0777'); $emftp->ftp_chdir('cache'); ! $emftp->emftp_chmod('cache', '0777'); } --- 299,305 ---- { $emftp->ftp_chdir('em_includes'); ! $emftp->emftp_chmod('em_includes', '0755'); $emftp->ftp_chdir('cache'); ! $emftp->emftp_chmod('cache', '0755'); } *************** *** 1195,1199 **** if ( $result ) { ! $this->emftp_chmod($dir_name, '0777'); } return $result; --- 1195,1199 ---- if ( $result ) { ! $this->emftp_chmod($dir_name, '0755'); } return $result; *************** *** 1202,1206 **** { $result = @ftp_mkdir( $this->ftp_conn_id, $dir_name) ; ! $this->emftp_chmod($dir_name, '0777'); // return $result ; ///////////// --- 1202,1206 ---- { $result = @ftp_mkdir( $this->ftp_conn_id, $dir_name) ; ! $this->emftp_chmod($dir_name, '0755'); // return $result ; ///////////// |