'; } } if( strlen( $dirName ) ) { $sError = 'error'; $errorMessage .= 'Next directories have inappropriate permissions:
' . $dirName; } foreach ( $reversalFiles as $file ) { if ( isRWAccessible ('../'.$file) ) { //$passOk = false; $fileName .= ' ' . $file . ';
'; } } if( strlen( $fileName ) ) { $sError = 'error'; $errorMessage .= 'Next files have inappropriate permissions:
' . $fileName; } if( strlen( $errorMessage ) ) { $ret .= showPermissions ( $errorMessage ); } else { $ret .= loadDolphin(); } break; case 'step5': $ret .= showPermissions(); break; case 'step4': $errorMessage = ''; foreach ( $aGeneral as $key => $value ) { if ( !strlen($value['check']) ) continue; $funcbody = $value['check']; $func = create_function('$arg0', $funcbody); if ( !$func($_POST[$key]) ) { $errorMessage .= "Please, input valid data to {$value['name']} field
"; $error_arr[$key] = 1; $passOk = false; unset($_POST[$key]); } else $error_arr[$key] = 0; $config_arr[$key]['def'] = $_POST[$key]; } if( strlen( $errorMessage ) ) { $sError = 'error'; $ret .= installGeneralInfo( $errorMessage ); } else { $ret .= installFinish(); } break; case 'step3': $errorMessage = ''; foreach ( $aDbConf as $key => $value ) { if ( !strlen($value['check']) ) continue; $funcbody = $value['check']; $func = create_function('$arg0', $funcbody); if ( !$func($_POST[$key]) ) { $errorMessage .= "Please, input valid data to {$value['name']} field
"; $error_arr[$key] = 1; $passOk = false; unset($_POST[$key]); } else $error_arr[$key] = 0; $config_arr[$key]['def'] = $_POST[$key]; } if( strlen( $errorMessage ) ) { $sError = 'error'; $ret .= installDBConf( $errorMessage ); } else { $ret .= installGeneralInfo(); } break; case 'step2': $errorMessage = ''; foreach ( $confFirst as $key => $value ) { if ( !strlen($value['check']) ) continue; $funcbody = $value['check']; $func = create_function('$arg0', $funcbody); if ( !$func($_POST[$key]) ) { $errorMessage .= "Please, input valid data to {$value['name']} field
"; $error_arr[$key] = 1; $passOk = false; unset($_POST[$key]); } else $error_arr[$key] = 0; $config_arr[$key]['def'] = $_POST[$key]; } if( strlen( $errorMessage ) ) { $sError = 'error'; $ret .= installStepFirst( $errorMessage ); } else { $ret .= installDBConf(); } break; case 'step1': $dirName = ''; $errorMessage = ''; foreach ($permDirectories as $dir) { if ( !isFullAccessible('../'.$dir) ) { //$passOk = false; $dirName .= ' ' . $dir . ';
'; } } foreach ($aRayFolders as $dir) { if ( !isFullAccessible('../'.$dir) ) { //$passOk = false; $dirName .= ' ' . $dir . ';
'; } } if( strlen( $dirName ) ) { $sError = 'error'; $errorMessage .= 'Next directories have inappropriate permissions:
' . $dirName; } foreach ($permFiles as $file) { if ( !isRWAccessible('../'.$file) ) { //$passOk = false; $fileName .= ' ' . $file . ';
'; } } foreach( $aRayFiles as $file ) { if (strpos($file,'ffmpeg') === FALSE) { if ( !isRWAccessible('../'.$file) ) { //$passOk = false; $fileName .= ' ' . $file . ';
'; } } else { if ( !isFullAccessible('../'.$file) ) { //$passOk = false; $fileName .= ' ' . $file . ';
'; } } } if( strlen( $fileName ) ) { $sError = 'error'; $errorMessage .= 'Next files have inappropriate permissions:
' . $fileName; } if( strlen( $errorMessage ) ) { $ret .= PreInstall( $errorMessage ); } else { $ret .= installStepFirst(); } break; case 'preInstall': $ret .= PreInstall(); break; default: $ret .= StartInstall(); } return $ret; } function installFinish( $errorMessage = '' ) { global $aConf, $confFirst, $aDbConf, $aGeneral; global $reversalDirectories, $reversalFiles; $sAdminName = $_REQUEST['admin_username']; $sAdminPassword = $_REQUEST['admin_password']; $resRunSQL = RunSQL( $sAdminName, $sAdminPassword ); $sRet = ''; if( 'done' == $resRunSQL ) { $sRet = '
'; } else { $text = 'Warning!!! can not get write access to config file ' . $aConf['dolFile'] . '. Here is config file
'; $ret .= printInstallError( $text ); $trans = get_html_translation_table(HTML_ENTITIES); $templ = strtr($aConf['headerTempl'], $trans); $ret .= ''; } $fp = fopen ( $aConf['periodicFile'], 'w'); if ( $fp ) { fputs ( $fp, $aConf['periodicTempl'] ); fclose ( $fp ); chmod( $aConf['dolFile'], 0666 ); //$ret .='Config file was successfully written to ' . $aConf['periodicFile'] . '
'; $ret .= '
'; $ret .= '
'; $ret .= printInstallError( $text ); $trans = get_html_translation_table(HTML_ENTITIES); $templ = strtr($aConf['periodicTempl'], $trans); $ret .= ''; } @rewriteFile( '[path_to]', $_POST['dir_root'], $aConf['cmdFile'] ); @rewriteFile( '[path_to]', $_POST['dir_root'], $aConf['notifiesFile'] ); @rewriteFile( '[path_to]', $_POST['dir_root'], $aConf['cupidFile'] ); //@rewriteFile( '[path_to]', $_POST['dir_root'], $aConf['tagsFile'] ); @rewriteFile( '[path_to]', $_POST['dir_root'], $aConf['rayHeader'] ); $ret .= $sRet; $ret .= '
Directories | Current Level | Desired Level |
' . $dir . ' | '; $ret .= ''; if ( isFullAccessible('../'.$dir) ) { $ret .= '' . getPermissions( '../' . $dir ) . 'Writable'; } else { $ret .= '' . getPermissions( '../' . $dir ) . 'Non-writable'; } $ret .= ' | '; $ret .= ''; $ret .= '755Non-writable'; $ret .= ' | '; $ret .= '
Files | Current Level | Desired Level |
' . $file . ' | '; $ret .= ''; if ( isRWAccessible('../'.$file) ) { $ret .= '' . getPermissions( '../' . $file ) . 'Writable'; } else { $ret .= '' . getPermissions( '../' . $file ) . 'Non-writable'; } $ret .= ' | '; $ret .= ''; $ret .= '644Non-writable'; $ret .= ' | '; $ret .= '
Directories | Current Level | Desired Level |
' . $dir . ' | '; $ret .= ''; if ( isFullAccessible('../'.$dir) ) { $ret .= '' . getPermissions( '../' . $dir ) . 'Writable'; } else { $ret .= '' . getPermissions( '../' . $dir ) . 'Non-writable'; } $ret .= ' | '; $ret .= ''; $ret .= '777Writable'; $ret .= ' | '; $ret .= '
Files | Current Level | Desired Level |
' . $file . ' | '; $ret .= ''; if ( isRWAccessible('../'.$file) ) { $ret .= '' . getPermissions( '../' . $file ) . 'Writable'; } else { $ret .= '' . getPermissions( '../' . $file ) . 'Non-writable'; } $ret .= ' | '; $ret .= ''; $ret .= '666Writable'; $ret .= ' | '; $ret .= '
Ray Folders | Current Level | Desired Level |
' . $dir . ' | '; $ret .= ''; if ( isFullAccessible('../'.$dir) ) { $ret .= '' . getPermissions( '../' . $dir ) . 'Writable'; } else { $ret .= '' . getPermissions( '../' . $dir ) . 'Non-writable'; } $ret .= ' | '; $ret .= ''; $ret .= '777Writable'; $ret .= ' | '; $ret .= '
Ray Files | Current Level | Desired Level |
' . $file . ' | '; $ret .= ''; if ( strpos($file,'ffmpeg') === FALSE ) { if ( isRWAccessible('../'.$file) ) { $ret .= '' . getPermissions( '../' . $file ) . 'Writable'; } else { $ret .= '' . getPermissions( '../' . $file ) . 'Non-writable'; } } else { if ( isFullAccessible('../'.$file) ) { $ret .= '' . getPermissions( '../' . $file ) . 'Executable'; } else { $ret .= '' . getPermissions( '../' . $file ) . 'Unexecutable'; $bError = TRUE; } } $ret .= ' | '; $ret .= ''; if ( strpos($file,'ffmpeg') === FALSE ) { $ret .= '666Writable'; } else { $ret .= '777Executable'; } $ret .= ' | '; $ret .= '
'; $ret .= 'Click the button below to create your own community.'; $ret .= '
' . mysql_error() . '
'; $s_sql = ""; } mysql_query ( "UPDATE `Admins` SET `Name`='{$sAdminName}', `Password`=md5( '{$sAdminPassword}' ) WHERE `Name`='admin'", $link ); if ( !$res ) $errorMes .= 'Error while executing: ' . $s_sql . '
' . mysql_error() . '
'; fclose($f); $enable_gd_value = extension_loaded( 'gd' ) ? 'on' : ''; if ( !(mysql_query ( "UPDATE `GlParams` SET `VALUE`='$enable_gd_value' WHERE `Name`='enable_gd'", $link ) ) ) $ret .= "Error: ".mysql_error()."
"; mysql_close($link); $errorMes .= $ret; if( strlen( $errorMes ) ) { return printInstallError( $errorMes ); } else { return 'done'; } // return $ret."Truncating tables finished.
"; } // set error reporting level error_reporting(E_ALL & ~E_NOTICE); ?>