Advertisement
Guest User

SAFE MODE INSTALL

a guest
Sep 18th, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 68.44 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4. * ***********************************************************************************************
  5. * Project: yappa-ng (yet another php photo album - next generation)
  6. * Filename: safe_mode_install.php
  7. * Type: Standalone Monolythic Script
  8. * Module: Safe Mode Installation Tool for yappa-ng
  9. * Subcategory: Part 2 (Final)
  10. * Description: This Safe Mode Install-Tool is the second step in the setup process
  11. * if the Server runs in "safe_mode" enabled mode
  12. * Please read the INSTALL.html (section: safe_mode Install) for instructions on how to use it!
  13. * ***********************************************************************************************
  14. * Author: Fritz Berger <wizard@zirkon.at>
  15. * Copyright: 2004 Fritz Berger
  16. * Homepage: http://www.zirkon.at/zirkon/scripts/yappa-ng/yappa-ng_main_eng.html
  17. * ***********************************************************************************************
  18. * $Header: /cvsroot/yappa-ng/yappa-ng/safe_mode_install.php,v 1.15 2005/04/25 18:01:48 zirkon13 Exp $
  19. * ***********************************************************************************************
  20. *
  21. * This program is free software; you can redistribute it and/or modify
  22. * it under the terms of the GNU General Public License as published by
  23. * the Free Software Foundation; either version 2 of the License, or
  24. * (at your option) any later version.
  25. *
  26. * This program is distributed in the hope that it will be useful,
  27. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  28. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  29. * GNU General Public License for more details.
  30. *
  31. * You should have received a copy of the GNU General Public License
  32. * along with this program; if not, write to the Free Software
  33. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  34. *
  35. */
  36.  
  37.  
  38. /*
  39. * ***********************************************************************************************
  40. * ***
  41. * *** DECLARATIONS
  42. * ***
  43. * ***********************************************************************************************
  44. */
  45.  
  46. /* for security!!!
  47. * Do not forget to remove before official release!
  48. */
  49. // $STOP = TRUE;
  50.  
  51. if($STOP) {
  52. print "<BR><BR><h1>Security STOP is enabled!</h1><BR><BR>To disable you have to go into the sourcecode and remove the line<BR><BR>";
  53. print "\$STOP = TRUE;";
  54. exit;
  55. }
  56.  
  57.  
  58. /*
  59. * *******************************************************************
  60. * Setting of Error reporting within the Setup-Tool!
  61. *
  62. * Syntax
  63. * error_reporting(E_ALL & ~(E_WARNING | E_NOTICE | ...));
  64. *
  65. * Standard: error_reporting(E_ALL & ~(E_WARNING | E_NOTICE ));
  66. * Enable real ERRORS only!
  67. * Debugging: error_reporting(E_ALL);
  68. * Enable Errrors, Warnings and the Notice of undefined variables
  69. * *******************************************************************
  70. */
  71. error_reporting(E_ALL);
  72. //error_reporting(E_ALL & ~(E_WARNING | E_NOTICE));
  73.  
  74.  
  75. /*
  76. * *******************************************************************
  77. * Install-Tool Revision!
  78. *
  79. * This string will be shown in HTML-title!
  80. * - it will be in the bookmarks if this tool gets bookmarked
  81. * - it will be in the description of the browser
  82. * *******************************************************************
  83. */
  84. $install_tool_revision = "1.1";
  85.  
  86.  
  87.  
  88. /*
  89. * ***********************************************************************************************
  90. * ***
  91. * *** FUNCTIONS
  92. * ***
  93. * ***********************************************************************************************
  94. */
  95.  
  96. /*
  97. * ***********************************************************************************************
  98. * function writeHTMLheader()
  99. *
  100. * This function writes the HTML-Header.
  101. *
  102. * Complete startup of HTML including DOCTYPE, meta-tags and style types
  103. * ***********************************************************************************************
  104. */
  105. function writeHTMLheader() {
  106.  
  107. global $setup_tool_revision;
  108. global $sm_install_DEMO;
  109. global $install_tool_revision;
  110. global $config;
  111.  
  112. ?>
  113. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  114. "http://www.w3.org/TR/html4/loose.dtd">
  115.  
  116. <html>
  117.  
  118. <head>
  119. <title>yappa-ng Safe Mode Install-Tool <?php print $install_tool_revision; ?></title>
  120. <link rel="SHORTCUT ICON" href="images/favicon.ico">
  121. <meta http-equiv="expires" content="0">
  122. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  123. <meta name="author" content="Fritz Berger">
  124. <meta name="description" content="yappa-ng Safe Mode Install-Tool (Yet Another PHP Photo Album - Next Generation)">
  125. <style type="text/css">
  126. <!--
  127. body { font-family: verdana, arial, helvetica, sans-serif; font-size: 80%; background-color: #DAE9FC; margin-left:20px; margin-right:50px; margin-top:0; margin-bottom:0; }
  128. .Heading { font-family: Arial, Geneva, Helvetica, sans-serif; font-size: 200%; font-weight:bold; color: #000000; margin-bottom:5px; }
  129. .links { font-family: Arial, Geneva, Helvetica, sans-serif; font-size: 70%; color: #000000; margin-bottom:5px; }
  130. .Description { font-size: 120%; font-weight:bold; color: #0000FF; margin-top:10px; }
  131. .mainComment { font-family: Arial, Geneva, Helvetica, sans-serif; font-size: 100%; font-weight:bold; color: #000000; margin-bottom:0px; }
  132. .Comments { font-family: Arial, Geneva, Helvetica, sans-serif; font-size: 100%; font-style:italic; color: #000000; }
  133. .thumbnailCell { background-color: #DAE9FC; }
  134. .hint { font-family: Arial, Geneva, Helvetica, sans-serif; font-size: 120%; font-weight:bold; color: #008000; }
  135. .errormsg { font-family: Arial, Geneva, Helvetica, sans-serif; font-size: 120%; font-weight:bold; color: #FF0000; }
  136. .errordesc { font-family: Arial, Geneva, Helvetica, sans-serif; font-size: 100%; font-weight:bold; color: #FF0000; }
  137. .gratulation { font-family: Arial, Geneva, Helvetica, sans-serif; font-size: 150%; font-weight:bold; color: #008000; }
  138.  
  139. -->
  140. </style>
  141.  
  142. </head>
  143.  
  144. <body>
  145.  
  146. <form action="<?php echo $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING']; ?>" enctype="multipart/form-data" method="post">
  147. <input type="hidden" name="MAX_FILE_SIZE" value="500000">
  148.  
  149. <a name="top"></a>
  150. <table cellspacing="0" cellpadding="5" border="0" width="100%">
  151. <tr valign="top">
  152. <td class="thumbnailCell">
  153. <table width="100%" border="0" cellspacing="0" cellpadding="3">
  154. <tr><td width="5%">&nbsp;</td><td width="10%">&nbsp;</td><td width="10%">&nbsp;</td><td width="20%">&nbsp;</td><td width="20%">&nbsp;</td><td width="35%">&nbsp;</td>
  155. <tr><td colspan=6 align="center" class="Heading">Welcome to Part 2 of the yappa-ng<br>&quot;Safe Mode Install-Tool&quot;</td></tr>
  156. <tr><td colspan="6" align="center" class="Comments">Be sure to read the Install Instructions on Safe Mode Installation in the
  157. <a href="http://www.zirkon.at/yappa-ng_demo/docs/INSTALL.html#safe_mode" target="_blank">INSTALL Manual</a> (external link!)</td></tr>
  158. <tr><td colspan="6">&nbsp;</td></tr>
  159. <tr><td colspan="6">&nbsp;</td></tr>
  160. <tr><td colspan="6" align="center" class="Comments">You are installing into the directory: <?php print $config['source_root']; ?>!!</td></tr>
  161. <tr><td colspan="6">&nbsp;</td></tr>
  162. <tr><td colspan="6">&nbsp;</td></tr>
  163. <tr><td colspan="6" align="center" class="Comments">This Install Tool is the second step to be able to install yappa-ng on a server with
  164. the Safe Mode restrictions enabled.<br>
  165. Now when you read this, you should have run the startscript &quot;safe_mode_start.php&quot; and this script should be located on the webserver where you want to install yappa-ng in a directory where the yappa-ng subdirectory
  166. with the complete installation will be situated. This yappa-ng subdirectory was created in the first step with the &quot;safe_mode_start.php&quot; tool.</td></tr>
  167. <tr><td colspan="6">&nbsp;</td></tr>
  168. <tr><td class="errormsg">IMPORTANT: </td><td colspan=5 class="errordesc">Be sure to delete this little script after usage (or if you do not need it, but unzipped it nevertheless)!
  169. ANYBODY can upload any PHP script to the server with this script! There is no passwordprotection for this script. There is no uploadrestriction and there are no securitychecks like in the yappa-ng upload section.
  170. The only purpose for this script is to create the needed subdirectories and upload the needed files.
  171. If this is done its useless but dangerous! <br>DELETE IT!</td></tr>
  172. <tr><td colspan="6">&nbsp;</td></tr>
  173. <tr><td colspan="6" align="left">
  174. <?php
  175. }
  176.  
  177.  
  178. /*
  179. * ***********************************************************************************************
  180. * function writeHTMLsubmit($name, $text)
  181. *
  182. * This function writes the HTML-Submit Button and closes the HTML-document.
  183. *
  184. * $name = name of the form input. this string is the text in the issubmitted function
  185. * $text = text of the submit-button
  186. * ***********************************************************************************************
  187. */
  188. function writeHTMLsubmit($name, $text) {
  189. ?>
  190. <tr><td colspan="6">&nbsp;</td></tr>
  191. <tr><td colspan="6" align="center">
  192. <input type="hidden" name="<?php print $name; ?>" value="true">
  193. <input type="submit" name="submit" value="<?php print $text; ?>">
  194. </td></tr>
  195. </table>
  196. </td></tr>
  197. </table>
  198. </form>
  199. </body>
  200. </HTML>
  201. <?php
  202. }
  203.  
  204.  
  205.  
  206. /*
  207. * ***********************************************************************************************
  208. * function initialize_config()
  209. *
  210. * This function initializes the config-file with default values.
  211. *
  212. * This function gets only called if the setup.php is not able to locate the config.inc.php
  213. * AND you pushed the button to Initialize the config file new!
  214. * The Setup-Tool password does NOT get set. First thing after the initialization is you get asked for the pwd.
  215. * ***********************************************************************************************
  216. */
  217. function initialize_config()
  218. {
  219. global $config;
  220. global $config_source_root;
  221.  
  222. $config = array();
  223.  
  224. // The config-file does not exist so we make a first initialisation.
  225.  
  226. // PART 1 -> MAIN SYSTEM SETUP -------------------------------------------------------------
  227. $config['source_root'] = $config_source_root;
  228. $config['photo_root'] = singleslash($config['source_root'] . "/photos");
  229. $config['cache_root'] = singleslash($config['source_root'] . "/cache");
  230.  
  231. $config['maintenance_mode'] = FALSE;
  232. $config['resize_cache'] = TRUE;
  233. $config['restrict_cache'] = FALSE;
  234. $config['image_module'] = 'gd';
  235. $config['convert_path'] = '/usr/bin/convert';
  236. $config['gd_truecolor'] = 'yes';
  237.  
  238. // PART 2 -> Title and Links -------------------------------------------------------------
  239. $config['title'] = 'yappa-ng Photo Gallery';
  240. $config['slogan'] = 'The&nbsp;Online&nbsp;Photo&nbsp;Gallery&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>for Original Photos and Photo Hostings';
  241. $config['site_root_name'] = 'ZIRKON Box:';
  242. $config['site_root_url'] = 'http://www.zirkon.at';
  243. $config['site_root_target'] = '_self';
  244. $config['site_link1_name'] = "";
  245. $config['site_link1_url'] = "";
  246. $config['site_link1_target'] = '_top';
  247. $config['site_link2_name'] = "";
  248. $config['site_link2_url'] = "";
  249. $config['site_link2_target'] = '_top';
  250. $config['site_link3_name'] = 'yappa-ng Sourcecode';
  251. $config['site_link3_url'] = 'http://www.zirkon.at/zirkon/scripts/yappa-ng/yappa-ng_main_eng.html';
  252. $config['site_link3_target'] = '_top';
  253. $config['site_link4_name'] = "yappa-ng ToolBox";
  254. $config['site_link4_url'] = "toolbox.php";
  255. $config['site_link4_target'] = '_blank';
  256. $config['site_link5_name'] = 'yappa-ng All Over The World';
  257. $config['site_link5_url'] = 'http://www.zirkon.at/zirkon/scripts/yappa-ng/yappa-ng_link_collection.html';
  258. $config['site_link5_target'] = '_self';
  259.  
  260. // PART 3 -> Configuration of Images -------------------------------------------------------------
  261. $config['resize_quality'] = 60;
  262. $config['thumb_width'] = 100;
  263. $config['thumb_height'] = 100;
  264. $config['thumb_border_width'] = 150;
  265. $config['thumb_border_height'] = 130;
  266. $config['resize_mini'] = '50x50';
  267. $config['resize_options'] = array( "640x640", "800x800", "1024x1024", "1600x1600", "original" );
  268. $config['resize_default'] = '640x640';
  269. $config['album_sort_by'] = 'name';
  270. $config['album_sort_order'] = 'a';
  271. $config['display_albumhits'] = 'yes';
  272. $config['permitted_filetypes'] = array( "jpg", "jpeg", "jpe", "gif", "png", "mov", "mpg", "mpeg", "avi" );
  273. $config['show_left_navbar_border'] = TRUE;
  274. $config['show_exif'] = TRUE;
  275.  
  276. // PART 4 -> Language Settings -------------------------------------------------------------
  277. $config['lang_default'] = 'English';
  278. $config['lang_support'] = 'yes';
  279. $config['autodetect_language'] = 'yes';
  280. $config['lang_intuitive'] = 'standard';
  281.  
  282. // PART 5 -> Themes Settings -------------------------------------------------------------
  283. $config['themes_installed'] = array (
  284. 'zirkon',
  285. 'riders',
  286. 'silver',
  287. 'passport',
  288. 'hot',
  289. 'wood',
  290. 'bash',
  291. );
  292. $config['theme_default'] = 'zirkon';
  293. $config['theme_support'] = 'yes';
  294. $config['header_size'] = 'yes';
  295.  
  296. // PART 6 -> Admin-Related Settings -------------------------------------------------------------
  297. $config['upload_limit'] = '1500000';
  298. $config['upload_number'] = '8';
  299. $config['show_info'] = 'yes';
  300. $config['use_initialize'] = 'yes';
  301. $config['permit_ahref'] = 'no';
  302. $config['permit_newalbum'] = 'yes';
  303. //$config['permit_video_global'] = TRUE;
  304. $config['permit_uploaduser'] = 'yes';
  305. $config['use_overall'] = 'yes';
  306. $config['show_album_desc_prev'] = 'no';
  307. $config['rate_album'] = TRUE;
  308. $config['rate_album_checkIP'] = TRUE;
  309. $config['rate_image'] = TRUE;
  310. $config['rate_image_checkIP'] = TRUE;
  311. $config['rate_show_albumpreview'] = TRUE;
  312.  
  313. // PART 7 -> Miscellaneous -------------------------------------------------------------
  314. $config['basic_errorcheck'] = TRUE;
  315. $config['error_rep'] = '3';
  316. $config['safe_mode_installation'] = TRUE;
  317.  
  318. // PART A -> Externally set and changed (ToolBox,...) ----------------------------------
  319. $config['loglevel'] = '63';
  320.  
  321. }
  322.  
  323.  
  324.  
  325. /*
  326. * ***********************************************************************************************
  327. * function save_config()
  328. *
  329. * This function saves the config-file to the harddisk.
  330. * Output filename: config.inc.php
  331. * Location of outputfile: same directory as the setup.php is located
  332. * The file-format is an "Include file":
  333. * - to be compatible to yappa-ng versions previous to Release 2.1.1
  334. * - to make it possible to edit the config.inc.php manually if its needed
  335. * - easy to debug
  336. * - extension .php and the PHP-language markers at the beginning
  337. * and the end of the file should prevent to view it with the browser.
  338. * (It gets parsed from PHP - not shown!) This enhances security!
  339. *
  340. * If writing of the config-file is not possible cry for help and exit
  341. * ***********************************************************************************************
  342. */
  343. function save_config()
  344. {
  345. global $config;
  346.  
  347. $config_filename = "config.inc.php";
  348. $config_help = "<?php \n \n";
  349. $config_help .= "// Global yappa-ng Configuration File!!! \n \n";
  350. $config_help .= "// SAFE MODE enabled!!! \n \n";
  351. $config_help .= "// Written by Safe mode Install Tool (ymd-H:m:s = " . date("ymd-H:i:s") . ") \n// \n";
  352. $config_help .= "// DO NOT EDIT THIS FILE !! \n// This file is created automatically! \n// Please run the \"setup.php\" script! \n \n";
  353. $config_help .= "// If you do want to edit the config manually \n// - rename the file config.inc.php.orig file to config.inc.php \n// - edit the new config.inc.php \n \n";
  354. $config_help .= "// No support if you manipulate this file config.inc.php manually!!! \n \n";
  355.  
  356. // PART 1 -> MAIN SYSTEM SETUP -------------------------------------------------------------
  357. $config_help .= "// PART 1 -> MAIN SYSTEM SETUP ------------------------------------------------------------- \n \n";
  358. if ($config['maintenance_mode']) {
  359. $msg = 'TRUE';
  360. } else {
  361. $msg = 'FALSE';
  362. }
  363. $config_help .= "\$config['maintenance_mode'] = " . $msg . "; \n";
  364. $config_help .= "\$config['source_root'] = \"" . str_replace('\\',"/",$config['source_root']) . "\"; \n";
  365. $config_help .= "\$config['photo_root'] = \"" . str_replace('\\',"/",$config['photo_root']) . "\"; \n";
  366. if ($config['resize_cache']) {
  367. $msg = 'TRUE';
  368. } else {
  369. $msg = 'FALSE';
  370. }
  371. $config_help .= "\$config['resize_cache'] = " . $msg . "; \n";
  372. if ($config['restrict_cache']) {
  373. $msg = 'TRUE';
  374. } else {
  375. $msg = 'FALSE';
  376. }
  377. $config_help .= "\$config['restrict_cache'] = " . $msg . "; \n";
  378. $config_help .= "\$config['cache_root'] = \"" . str_replace("\\","/",$config['cache_root'] ). "\"; \n";
  379. $config_help .= "\$config['image_module'] = \"" . $config['image_module'] . "\"; \n";
  380. $config_help .= "\$config['convert_path'] = \"" . $config['convert_path'] . "\"; \n";
  381. $config_help .= "\$config['gd_truecolor'] = \"" . $config['gd_truecolor'] . "\"; \n \n";
  382.  
  383. // PART 2 -> Title and Links -------------------------------------------------------------
  384. $config_help .= "// PART 2 -> Title and Links ------------------------------------------------------------- \n \n";
  385. $config_help .= "\$config['title'] = \"" . $config['title'] . "\"; \n";
  386. $config_help .= "\$config['slogan'] = \"" . $config['slogan'] . "\"; \n";
  387. $config_help .= "\$config['site_root_name'] = \"" . $config['site_root_name'] . "\"; \n";
  388. $config_help .= "\$config['site_root_url'] = \"" . $config['site_root_url'] . "\"; \n";
  389. $config_help .= "\$config['site_root_target'] = \"" . $config['site_root_target'] . "\"; \n";
  390. $config_help .= "\$config['site_link1_name'] = \"" . $config['site_link1_name'] . "\"; \n";
  391. $config_help .= "\$config['site_link1_url'] = \"" . $config['site_link1_url'] . "\"; \n";
  392. $config_help .= "\$config['site_link1_target'] = \"" . $config['site_link1_target'] . "\"; \n";
  393. $config_help .= "\$config['site_link2_name'] = \"" . $config['site_link2_name'] . "\"; \n";
  394. $config_help .= "\$config['site_link2_url'] = \"" . $config['site_link2_url'] . "\"; \n";
  395. $config_help .= "\$config['site_link2_target'] = \"" . $config['site_link2_target'] . "\"; \n";
  396. $config_help .= "\$config['site_link3_name'] = \"" . $config['site_link3_name'] . "\"; \n";
  397. $config_help .= "\$config['site_link3_url'] = \"" . $config['site_link3_url'] . "\"; \n";
  398. $config_help .= "\$config['site_link3_target'] = \"" . $config['site_link3_target'] . "\"; \n";
  399. $config_help .= "\$config['site_link4_name'] = \"" . $config['site_link4_name'] . "\"; \n";
  400. $config_help .= "\$config['site_link4_url'] = \"" . $config['site_link4_url'] . "\"; \n";
  401. $config_help .= "\$config['site_link4_target'] = \"" . $config['site_link4_target'] . "\"; \n";
  402. $config_help .= "\$config['site_link5_name'] = \"" . $config['site_link5_name'] . "\"; \n";
  403. $config_help .= "\$config['site_link5_url'] = \"" . $config['site_link5_url'] . "\"; \n";
  404. $config_help .= "\$config['site_link5_target'] = \"" . $config['site_link5_target'] . "\"; \n \n";
  405.  
  406. // PART 3 -> Configuration of Images -------------------------------------------------------------
  407. $config_help .= "// PART 3 -> Configuration of Images ------------------------------------------------------------- \n \n";
  408. $config_help .= "\$config['resize_quality'] = " . $config['resize_quality'] . "; \n";
  409. $config_help .= "\$config['thumb_width'] = " . $config['thumb_width'] . "; \n";
  410. $config_help .= "\$config['thumb_height'] = " . $config['thumb_width'] . "; \n";
  411. $config_help .= "\$config['thumb_border_width'] = " . $config['thumb_border_width'] . "; \n";
  412. $config_help .= "\$config['thumb_border_height'] = " . $config['thumb_border_height'] . "; \n";
  413. $config_help .= "\$config['resize_mini'] = \"" . $config['resize_mini'] . "\"; \n";
  414. $config_help .= "\$config['resize_options'] = array( ";
  415. $l_help = 0;
  416. foreach ($config['resize_options'] as $value) {
  417. if ($l_help == 0) {
  418. $config_help .= "\"" . $value . "\"";
  419. $l_help = 1;
  420. } else {
  421. $config_help .= ", \"" . $value . "\"";
  422. }
  423. }
  424. $config_help .= " ); \n";
  425. $config_help .= "\$config['resize_default'] = \"" . $config['resize_default'] . "\"; \n";
  426. $config_help .= "\$config['permitted_filetypes'] = array( ";
  427. $l_help = 0;
  428. foreach ($config['permitted_filetypes'] as $value) {
  429. if ($l_help == 0) {
  430. $config_help .= "\"" . $value . "\"";
  431. $l_help = 1;
  432. } else {
  433. $config_help .= ", \"" . $value . "\"";
  434. }
  435. }
  436. $config_help .= " ); \n";
  437. $config_help .= "\$config['album_sort_by'] = \"" . $config['album_sort_by'] . "\"; \n";
  438. $config_help .= "\$config['album_sort_order'] = \"" . $config['album_sort_order'] . "\"; \n \n";
  439. $config_help .= "\$config['display_albumhits'] = \"" . $config['display_albumhits'] . "\"; \n";
  440. if ($config['show_left_navbar_border']) {
  441. $msg = 'TRUE';
  442. } else {
  443. $msg = 'FALSE';
  444. }
  445. $config_help .= "\$config['show_left_navbar_border'] = " . $msg . "; \n";
  446. if ($config['show_exif']) {
  447. $msg = 'TRUE';
  448. } else {
  449. $msg = 'FALSE';
  450. }
  451. $config_help .= "\$config['show_exif'] = " . $msg . "; \n";
  452.  
  453. // PART 4 -> Language Settings -------------------------------------------------------------
  454. $config_help .= "// PART 4 -> Language Settings ------------------------------------------------------------- \n \n";
  455. $config_help .= "\$config['lang_default'] = \"" . $config['lang_default'] . "\"; \n";
  456. $config_help .= "\$config['lang_support'] = \"" . $config['lang_support'] . "\"; \n";
  457. $config_help .= "\$config['autodetect_language'] = \"" . $config['autodetect_language'] . "\"; \n";
  458. $config_help .= "\$config['lang_intuitive'] = \"" . $config['lang_intuitive'] . "\"; \n \n";
  459.  
  460. // PART 5 -> Themes Settings -------------------------------------------------------------
  461. $config_help .= "// PART 5 -> Themes Settings ------------------------------------------------------------- \n \n";
  462. $config_help .= "\$config['themes_installed'] = array( ";
  463. $l_help = 0;
  464. foreach ($config['themes_installed'] as $value) {
  465. if ($l_help == 0) {
  466. $config_help .= "\"" . $value . "\"";
  467. $l_help = 1;
  468. } else {
  469. $config_help .= ", \"" . $value . "\"";
  470. }
  471. }
  472. $config_help .= " ); \n";
  473. $config_help .= "\$config['theme_default'] = \"" . $config['theme_default'] . "\"; \n";
  474. $config_help .= "\$config['theme_support'] = \"" . $config['theme_support'] . "\"; \n \n";
  475. $config_help .= "\$config['header_size'] = \"" . $config['header_size'] . "\"; \n \n";
  476.  
  477. // PART 6 -> Admin-Related Settings -------------------------------------------------------------
  478. $config_help .= "// PART 6 -> Admin-Related Settings ------------------------------------------------------------- \n \n";
  479. $config_help .= "\$config['upload_limit'] = \"" . $config['upload_limit'] . "\"; \n";
  480. $config_help .= "\$config['upload_number'] = \"" . $config['upload_number'] . "\"; \n";
  481. $config_help .= "\$config['show_info'] = \"" . $config['show_info'] . "\"; \n";
  482. $config_help .= "\$config['use_initialize'] = \"" . $config['use_initialize'] . "\"; \n";
  483. $config_help .= "\$config['permit_ahref'] = \"" . $config['permit_ahref'] . "\"; \n";
  484. $config_help .= "\$config['permit_newalbum'] = \"" . $config['permit_newalbum'] . "\"; \n";
  485. /*if ($config['permit_video_global']) {
  486. $msg = 'TRUE';
  487. } else {
  488. $msg = 'FALSE';
  489. }
  490. $config_help .= "\$config['permit_video_global'] = " . $msg . "; \n";
  491. */
  492. $config_help .= "\$config['permit_uploaduser'] = \"" . $config['permit_uploaduser'] . "\"; \n";
  493. $config_help .= "\$config['use_overall'] = \"" . $config['use_overall'] . "\"; \n \n";
  494. $config_help .= "\$config['show_album_desc_prev'] = \"" . $config['show_album_desc_prev'] . "\"; \n \n";
  495. if ($config['rate_album']) {
  496. $msg = 'TRUE';
  497. } else {
  498. $msg = 'FALSE';
  499. }
  500. $config_help .= "\$config['rate_album'] = " . $msg . "; \n";
  501. if ($config['rate_album_checkIP']) {
  502. $msg = 'TRUE';
  503. } else {
  504. $msg = 'FALSE';
  505. }
  506. $config_help .= "\$config['rate_album_checkIP'] = " . $msg . "; \n";
  507. if ($config['rate_image']) {
  508. $msg = 'TRUE';
  509. } else {
  510. $msg = 'FALSE';
  511. }
  512. $config_help .= "\$config['rate_image'] = " . $msg . "; \n";
  513. if ($config['rate_image_checkIP']) {
  514. $msg = 'TRUE';
  515. } else {
  516. $msg = 'FALSE';
  517. }
  518. $config_help .= "\$config['rate_image_checkIP'] = " . $msg . "; \n";
  519. if ($config['rate_show_albumpreview']) {
  520. $msg = 'TRUE';
  521. } else {
  522. $msg = 'FALSE';
  523. }
  524. $config_help .= "\$config['rate_show_albumpreview'] = " . $msg . "; \n\n";
  525.  
  526. // PART 7 -> Miscellaneous -------------------------------------------------------------
  527. $config_help .= "// PART 7 -> Miscellaneus ------------------------------------------------------------- \n \n";
  528. // $config_help .= "\$config['setup_pwd'] = \"" . $config['setup_pwd'] . "\"; \n";
  529. if ($config['basic_errorcheck']) {
  530. $msg = 'TRUE';
  531. } else {
  532. $msg = 'FALSE';
  533. }
  534. $config_help .= "\$config['basic_errorcheck'] = " . $msg . "; \n";
  535. $config_help .= "\$config['error_rep'] = \"" . $config['error_rep'] . "\"; \n\n";
  536. if ($config['safe_mode_installation']) {
  537. $msg = 'TRUE';
  538. } else {
  539. $msg = 'FALSE';
  540. }
  541. $config_help .= "\$config['safe_mode_installation'] = " . $msg . "; \n\n";
  542.  
  543.  
  544. // PART A -> Externally set and changed (ToolBox,...) ----------------------------------
  545. $config_help .= "// PART A -> Externally set and changed (ToolBox,...) ---------------------\n \n";
  546. $config_help .= "\$config['loglevel'] = \"" . $config['loglevel'] . "\"; \n\n";
  547.  
  548. $config_help .= "define(\"SecCheck\", 1); \n\n";
  549.  
  550. $config_help .= "require(\"config_mimetypes.inc.php\"); \n";
  551. $config_help .= "require(\"config_private.inc.php\"); \n\n";
  552.  
  553.  
  554. $config_help .= "\n // End of global yappa-ng configuration file!! \n \n";
  555.  
  556. $config_help .= " \n?>";
  557.  
  558. $config_path = singleslash($config['source_root'] . "/" . $config_filename);
  559.  
  560. $fd = fopen($config_path, "w");
  561. if ($fd) {
  562. // everything ok
  563. flock($fd, 2); // get an exclusive lock
  564. fwrite($fd, $config_help);
  565. flock($fd, 3); // release the lock
  566. fclose($fd);
  567. } else {
  568. $config['errorcount']++;
  569. // config_file not written
  570. // cry for help and exit
  571. ?>
  572. Could not write the config-file!<br>
  573. Please make sure the directory where the setup.php is located <b>is writeable for the webserver</b>!<br>
  574. Exiting...<br>
  575. <?php exit;
  576. }
  577. }
  578.  
  579.  
  580. /*
  581. * ***********************************************************************************************
  582. * function check_cache_root()
  583. *
  584. * This function checks the submitted path for cache_root.
  585. *
  586. * If not available - create it
  587. * ***********************************************************************************************
  588. */
  589. function check_cache_root()
  590. {
  591. global $config;
  592.  
  593. /* check for the cache root ******************************************************************************************************* */
  594. if (!@is_dir($config['cache_root'])) {
  595. if (!(mkdir ($config['cache_root'], intval("0777", 8)))) {
  596. // directory not created!
  597. $config['errorcount']++;
  598. $return_value["check"] = 1;
  599. return $return_value;
  600. } else {
  601. @chmod($config['cache_root'], intval("0777", 8));
  602. }
  603. }
  604. sleep(1);
  605. clearstatcache();
  606. /* check AGAIN for the cache_root */
  607. if (!@is_dir($config['cache_root'])) { ?>
  608. <tr><td colspan="6"><a name="bottom">&bnsp;</a></td></tr>
  609. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Cannot find the directory: &quot;<?php print $config["cache_root"]; ?>&quot; !!!</td></tr>
  610. <tr><td>&nbsp;</td><td colspan=5 class="Comments">Please specify another directory and hit &quot;Submit cache_root&quot;</td></tr>
  611. <?php
  612. $config['errorcount']++;
  613. writeHTMLsubmit("SubmittedFinal", "Submit cache_root!");
  614. exit;
  615. }
  616. /* make a testfile in cache_root */
  617. $testfilename = $config['cache_root'] . "/test.txt";
  618. $testfilecontent = "ok: This is a TestFile, but I am NOT overwritten!!!";
  619. $fd = fopen($testfilename, "w");
  620. if ($fd) {
  621. // testfile created successfully
  622. flock($fd, 2); // get an exclusive lock
  623. fwrite($fd, $testfilecontent);
  624. flock($fd, 3); // release the lock
  625. fclose($fd);
  626. } else { ?>
  627. <tr><td colspan="6"><a name="bottom">&bnsp;</a></td></tr>
  628. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">I cannot write into the directory: &quot;<?php print $config["cache_root"]; ?>&quot;,</td></tr>
  629. <tr><td>&nbsp;</td><td colspan=5 class="Comments">Please make sure the cache_root directory is writeable for the webserver!</td></tr>
  630. <?php
  631. $config['errorcount']++;
  632. writeHTMLsubmit("SubmittedFinal", "Submit cache_root!");
  633. exit;
  634. }
  635. /* overwrite the testfile */
  636. $testfilecontent = "ok: This is the overwritten TestFile!";
  637. $fd = fopen($testfilename, "w");
  638. if ($fd) {
  639. // testfile overwritten successfully
  640. flock($fd, 2); // get an exclusive lock
  641. fwrite($fd, $testfilecontent);
  642. flock($fd, 3); // release the lock
  643. fclose($fd);
  644. } else { ?>
  645. <tr><td colspan="6"><a name="bottom">&bnsp;</a></td></tr>
  646. <tr><td class="errormsg">Warning: </td><td colspan=5 class="errordesc">I could not overwrite the testfile: &quot;<?php print $testfilename; ?>&quot;,</td></tr>
  647. <?php
  648. }
  649. /* read the content of the same testfile */
  650. $testfilecontent = " ";
  651. $fd = fopen($testfilename, "rt");
  652. if ($fd) {
  653. // testfile opened for read successfully
  654. $data = "";
  655. while(!feof($fd)) {
  656. $data = fgets($fd, 1024);
  657. $testfilecontent = $testfilecontent . $data;
  658. }
  659. fclose($fd);
  660. } else { ?>
  661. <tr><td colspan="6"><a name="bottom">&bnsp;</a></td></tr>
  662. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">I could not read the testfile: &quot;<?php print $testfilename; ?>&quot;,</td></tr>
  663. <?php
  664. $config['errorcount']++;
  665. writeHTMLsubmit("SubmittedFinal", "Submit cache_root!");
  666. exit;
  667. }
  668. /* delete testfile */
  669. unlink ($testfilename);
  670. clearstatcache();
  671. if (file_exists($testfilename)) { ?>
  672. <tr><td colspan="6"><a name="bottom">&bnsp;</a></td></tr>
  673. <tr><td class="errormsg">Warning: </td><td colspan=5 class="errordesc">I could not delete the testfile: &quot;<?php print $testfilename; ?>&quot;,</td></tr>
  674. <?php
  675. }
  676. }
  677.  
  678.  
  679.  
  680. /*
  681. * ***********************************************************************************************
  682. * function make_needed_dirs()
  683. *
  684. * This function creates the needed dirs!
  685. * ***********************************************************************************************
  686. */
  687. function make_needed_dirs()
  688. {
  689. global $config;
  690.  
  691.  
  692. $dirname = singleslash($config['source_root'] . "/languages");
  693. if (!@is_dir($dirname)) {
  694. if (!(mkdir ($dirname, intval("0777", 8)))) {
  695. // directory not created!
  696. $return_value["check"] = 1;
  697. return $return_value;
  698. } else {
  699. @chmod($dirname, intval("0777", 8));
  700. }
  701. }
  702. $dirname = singleslash($config['source_root'] . "/themes");
  703. if (!@is_dir($dirname)) {
  704. if (!(mkdir ($dirname, intval("0777", 8)))) {
  705. // directory not created!
  706. $return_value["check"] = 1;
  707. return $return_value;
  708. } else {
  709. @chmod($dirname, intval("0777", 8));
  710. }
  711. }
  712. $dirname = singleslash($config['source_root'] . "/images");
  713. if (!@is_dir($dirname)) {
  714. if (!(mkdir ($dirname, intval("0777", 8)))) {
  715. // directory not created!
  716. $return_value["check"] = 1;
  717. return $return_value;
  718. } else {
  719. @chmod($dirname, intval("0777", 8));
  720. }
  721. }
  722. $dirname = singleslash($config['source_root'] . "/admin_modules");
  723. if (!@is_dir($dirname)) {
  724. if (!(mkdir ($dirname, intval("0777", 8)))) {
  725. // directory not created!
  726. $return_value["check"] = 1;
  727. return $return_value;
  728. } else {
  729. @chmod($dirname, intval("0777", 8));
  730. }
  731. }
  732. $dirname = singleslash($config['source_root'] . "/docs");
  733. if (!@is_dir($dirname)) {
  734. if (!(mkdir ($dirname, intval("0777", 8)))) {
  735. // directory not created!
  736. $return_value["check"] = 1;
  737. return $return_value;
  738. } else {
  739. @chmod($dirname, intval("0777", 8));
  740. }
  741. }
  742. $dirname = singleslash($config['source_root'] . "/toolbox_modules");
  743. if (!@is_dir($dirname)) {
  744. if (!(mkdir ($dirname, intval("0777", 8)))) {
  745. // directory not created!
  746. $return_value["check"] = 1;
  747. return $return_value;
  748. } else {
  749. @chmod($dirname, intval("0777", 8));
  750. }
  751. }
  752. $dirname = singleslash($config['source_root'] . "/install");
  753. if (!@is_dir($dirname)) {
  754. if (!(mkdir ($dirname, intval("0777", 8)))) {
  755. // directory not created!
  756. $return_value["check"] = 1;
  757. return $return_value;
  758. } else {
  759. @chmod($dirname, intval("0777", 8));
  760. }
  761. }
  762. $dirname = singleslash($config['source_root'] . "/src");
  763. if (!@is_dir($dirname)) {
  764. if (!(mkdir ($dirname, intval("0777", 8)))) {
  765. // directory not created!
  766. $return_value["check"] = 1;
  767. return $return_value;
  768. } else {
  769. @chmod($dirname, intval("0777", 8));
  770. }
  771. }
  772. $dirname = singleslash($config['source_root'] . "/exifer");
  773. if (!@is_dir($dirname)) {
  774. if (!(mkdir ($dirname, intval("0777", 8)))) {
  775. // directory not created!
  776. $return_value["check"] = 1;
  777. return $return_value;
  778. } else {
  779. @chmod($dirname, intval("0777", 8));
  780. }
  781. }
  782. $dirname = singleslash($config['source_root'] . "/exifer/makers");
  783. if (!@is_dir($dirname)) {
  784. if (!(mkdir ($dirname, intval("0777", 8)))) {
  785. // directory not created!
  786. $return_value["check"] = 1;
  787. return $return_value;
  788. } else {
  789. @chmod($dirname, intval("0777", 8));
  790. }
  791. }
  792. }
  793.  
  794.  
  795.  
  796. /*
  797. * ***********************************************************************************************
  798. * function upload_needed_files()
  799. *
  800. * This function uploads the needed files:
  801. *
  802.  
  803. * yappa-ng/index.php
  804. * yappa-ng/setup.php
  805. * yappa-ng/show.php
  806. * yappa-ng/slideshow.php
  807. * yappa-ng/toolbox.php
  808. * yappa-ng/toolbox_logview.php
  809. * yappa-ng/photos/sample/yappa-ng_DEMO.jpg
  810. * ***********************************************************************************************
  811. */
  812. function upload_needed_files()
  813. {
  814. global $config;
  815.  
  816.  
  817. // upload yappa-ng/check_setup.php
  818. $dirname = $config['source_root'];
  819. if (($_FILES['fupload']['name']['check']) && ($_FILES['fupload']['size']['check'] != "0")) {
  820. $l_dest_filename = $_FILES['fupload']['name']['check'];
  821. if($l_dest_filename != "check_setup.php") {
  822. // error - wrong filename!
  823. ?>
  824. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Wrong filename! You should upload the file check_setup.php!</td></tr>
  825. <?php
  826. } else {
  827. $dest = singleslash($dirname . "/check_setup.php");
  828. if (!copy($_FILES['fupload']['tmp_name']['check'], $dest)) {
  829. // copy error!
  830. ?>
  831. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Could not upload the file check_setup.php!</td></tr>
  832. <tr><td>&nbsp;</td><td colspan=5 class="Comments">Something is very wrong!!</td></tr>
  833. <?php
  834. } else {
  835. //upload ok!
  836. ?>
  837. <tr><td class="hint">ok: </td><td colspan=5 class="Comments">Upload of check_setup.php successful!</td></tr>
  838. <?php
  839. if (!@chmod($dest, intval("0666", 8))) {
  840. // fehler!
  841. }
  842. }
  843. }
  844. }
  845.  
  846. // upload yappa-ng/index.php
  847. $dirname = $config['source_root'];
  848. if (($_FILES['fupload']['name']['index']) && ($_FILES['fupload']['size']['index'] != "0")) {
  849. $l_dest_filename = $_FILES['fupload']['name']['index'];
  850. if($l_dest_filename != "index.php") {
  851. // error - wrong filename!
  852. ?>
  853. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Wrong filename! You should upload the file index.php!</td></tr>
  854. <?php
  855. } else {
  856. $dest = singleslash($dirname . "/index.php");
  857. if (!copy($_FILES['fupload']['tmp_name']['index'], $dest)) {
  858. // copy error!
  859. ?>
  860. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Could not upload the file index.php!</td></tr>
  861. <tr><td>&nbsp;</td><td colspan=5 class="Comments">Something is very wrong!!</td></tr>
  862. <?php
  863. } else {
  864. //upload ok!
  865. ?>
  866. <tr><td class="hint">ok: </td><td colspan=5 class="Comments">Upload of index.php successful!</td></tr>
  867. <?php
  868. if (!@chmod($dest, intval("0666", 8))) {
  869. // fehler!
  870. }
  871. }
  872. }
  873. }
  874.  
  875. // upload yappa-ng/setup.php
  876. $dirname = $config['source_root'];
  877. if (($_FILES['fupload']['name']['setup']) && ($_FILES['fupload']['size']['setup'] != "0")) {
  878. $l_dest_filename = $_FILES['fupload']['name']['setup'];
  879. if($l_dest_filename != "setup.php") {
  880. // error - wrong filename!
  881. ?>
  882. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Wrong filename! You should upload the file setup.php!</td></tr>
  883. <?php
  884. } else {
  885. $dest = singleslash($dirname . "/setup.php");
  886. if (!copy($_FILES['fupload']['tmp_name']['setup'], $dest)) {
  887. // copy error!
  888. ?>
  889. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Could not upload the file setup.php!</td></tr>
  890. <tr><td>&nbsp;</td><td colspan=5 class="Comments">Something is very wrong!!</td></tr>
  891. <?php
  892. } else {
  893. //upload ok!
  894. ?>
  895. <tr><td class="hint">ok: </td><td colspan=5 class="Comments">Upload of setup.php successful!</td></tr>
  896. <?php
  897. if (!@chmod($dest, intval("0666", 8))) {
  898. // fehler!
  899. }
  900. }
  901. }
  902. }
  903.  
  904. // upload yappa-ng/show.php
  905. $dirname = $config['source_root'];
  906. if (($_FILES['fupload']['name']['show']) && ($_FILES['fupload']['size']['show'] != "0")) {
  907. $l_dest_filename = $_FILES['fupload']['name']['show'];
  908. if($l_dest_filename != "show.php") {
  909. // error - wrong filename!
  910. ?>
  911. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Wrong filename! You should upload the file show.php!</td></tr>
  912. <?php
  913. } else {
  914. $dest = singleslash($dirname . "/show.php");
  915. if (!copy($_FILES['fupload']['tmp_name']['show'], $dest)) {
  916. // copy error!
  917. ?>
  918. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Could not upload the file show.php!</td></tr>
  919. <tr><td>&nbsp;</td><td colspan=5 class="Comments">Something is very wrong!!</td></tr>
  920. <?php
  921. } else {
  922. //upload ok!
  923. ?>
  924. <tr><td class="hint">ok: </td><td colspan=5 class="Comments">Upload of show.php successful!</td></tr>
  925. <?php
  926. if (!@chmod($dest, intval("0666", 8))) {
  927. // fehler!
  928. }
  929. }
  930. }
  931. }
  932.  
  933. // upload yappa-ng/slideshow.php
  934. $dirname = $config['source_root'];
  935. if (($_FILES['fupload']['name']['slideshow']) && ($_FILES['fupload']['size']['slideshow'] != "0")) {
  936. $l_dest_filename = $_FILES['fupload']['name']['slideshow'];
  937. if($l_dest_filename != "slideshow.php") {
  938. // error - wrong filename!
  939. ?>
  940. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Wrong filename! You should upload the file slideshow.php!</td></tr>
  941. <?php
  942. } else {
  943. $dest = singleslash($dirname . "/slideshow.php");
  944. if (!copy($_FILES['fupload']['tmp_name']['slideshow'], $dest)) {
  945. // copy error!
  946. ?>
  947. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Could not upload the file slideshow.php!</td></tr>
  948. <tr><td>&nbsp;</td><td colspan=5 class="Comments">Something is very wrong!!</td></tr>
  949. <?php
  950. } else {
  951. //upload ok!
  952. ?>
  953. <tr><td class="hint">ok: </td><td colspan=5 class="Comments">Upload of slideshow.php successful!</td></tr>
  954. <?php
  955. if (!@chmod($dest, intval("0666", 8))) {
  956. // fehler!
  957. }
  958. }
  959. }
  960. }
  961.  
  962. // upload yappa-ng/toolbox.php
  963. $dirname = $config['source_root'];
  964. if (($_FILES['fupload']['name']['toolbox']) && ($_FILES['fupload']['size']['toolbox'] != "0")) {
  965. $l_dest_filename = $_FILES['fupload']['name']['toolbox'];
  966. if($l_dest_filename != "toolbox.php") {
  967. // error - wrong filename!
  968. ?>
  969. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Wrong filename! You should upload the file toolbox.php!</td></tr>
  970. <?php
  971. } else {
  972. $dest = singleslash($dirname . "/toolbox.php");
  973. if (!copy($_FILES['fupload']['tmp_name']['toolbox'], $dest)) {
  974. // copy error!
  975. ?>
  976. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Could not upload the file toolbox.php!</td></tr>
  977. <tr><td>&nbsp;</td><td colspan=5 class="Comments">Something is very wrong!!</td></tr>
  978. <?php
  979. } else {
  980. //upload ok!
  981. ?>
  982. <tr><td class="hint">ok: </td><td colspan=5 class="Comments">Upload of toolbox.php successful!</td></tr>
  983. <?php
  984. if (!@chmod($dest, intval("0666", 8))) {
  985. // fehler!
  986. }
  987. }
  988. }
  989. }
  990.  
  991.  
  992. // upload yappa-ng/toolbox_logview.php
  993. $dirname = $config['source_root'];
  994. if (($_FILES['fupload']['name']['toollog']) && ($_FILES['fupload']['size']['toollog'] != "0")) {
  995. $l_dest_filename = $_FILES['fupload']['name']['toollog'];
  996. if($l_dest_filename != "toolbox_logview.php") {
  997. // error - wrong filename!
  998. ?>
  999. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Wrong filename! You should upload the file toolbox_logview.php!</td></tr>
  1000. <?php
  1001. } else {
  1002. $dest = singleslash($dirname . "/toolbox_logview.php");
  1003. if (!copy($_FILES['fupload']['tmp_name']['toollog'], $dest)) {
  1004. // copy error!
  1005. ?>
  1006. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Could not upload the file toolbox_logview.php!</td></tr>
  1007. <tr><td>&nbsp;</td><td colspan=5 class="Comments">Something is very wrong!!</td></tr>
  1008. <?php
  1009. } else {
  1010. //upload ok!
  1011. ?>
  1012. <tr><td class="hint">ok: </td><td colspan=5 class="Comments">Upload of toolbox_logview.php successful!</td></tr>
  1013. <?php
  1014. if (!@chmod($dest, intval("0666", 8))) {
  1015. // fehler!
  1016. }
  1017. }
  1018. }
  1019. }
  1020. // upload yappa-ng/cache/yappa-ng_DEMO.jpg
  1021. $dirname = $config['cache_root'];
  1022. if (($_FILES['fupload']['name']['demo']) && ($_FILES['fupload']['size']['demo'] != "0")) {
  1023. $l_dest_filename = $_FILES['fupload']['name']['demo'];
  1024. if($l_dest_filename != "yappa-ng_DEMO.jpg") {
  1025. // error - wrong filename!
  1026. ?>
  1027. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Wrong filename! You should upload the file yappa-ng_DEMO.jpg!</td></tr>
  1028. <?php
  1029. } else {
  1030. $dest = singleslash($dirname . "/yappa-ng_DEMO.jpg");
  1031. if (!copy($_FILES['fupload']['tmp_name']['demo'], $dest)) {
  1032. // copy error!
  1033. ?>
  1034. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Could not upload the file yappa-ng_DEMO.jpg!</td></tr>
  1035. <tr><td>&nbsp;</td><td colspan=5 class="Comments">Something is very wrong!!</td></tr>
  1036. <?php
  1037. } else {
  1038. //upload ok!
  1039. ?>
  1040. <tr><td class="hint">ok: </td><td colspan=5 class="Comments">Upload of yappa-ng_DEMO.jpg successful!</td></tr>
  1041. <?php
  1042. if (!@chmod($dest, intval("0666", 8))) {
  1043. // fehler!
  1044. }
  1045. }
  1046. }
  1047. }
  1048. // upload yappa-ng/cache/error_image.jpg
  1049. $dirname = $config['cache_root'];
  1050. if (($_FILES['fupload']['name']['errimg']) && ($_FILES['fupload']['size']['errimg'] != "0")) {
  1051. $l_dest_filename = $_FILES['fupload']['name']['errimg'];
  1052. if($l_dest_filename != "error_image.jpg") {
  1053. // error - wrong filename!
  1054. ?>
  1055. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Wrong filename! You should upload the file error_image.jpg!</td></tr>
  1056. <?php
  1057. } else {
  1058. $dest = singleslash($dirname . "/error_image.jpg");
  1059. if (!copy($_FILES['fupload']['tmp_name']['errimg'], $dest)) {
  1060. // copy error!
  1061. ?>
  1062. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Could not upload the file error_image.jpg!</td></tr>
  1063. <tr><td>&nbsp;</td><td colspan=5 class="Comments">Something is very wrong!!</td></tr>
  1064. <?php
  1065. } else {
  1066. //upload ok!
  1067. ?>
  1068. <tr><td class="hint">ok: </td><td colspan=5 class="Comments">Upload of error_image.jpg successful!</td></tr>
  1069. <?php
  1070. if (!@chmod($dest, intval("0666", 8))) {
  1071. // fehler!
  1072. }
  1073. }
  1074. }
  1075. }
  1076. // upload yappa-ng/languages/lang_*
  1077. $dirname = singleslash($config['source_root'] . "/languages");
  1078. if (($_FILES['fupload']['name']['lang1']) && ($_FILES['fupload']['size']['lang1'] != "0")) {
  1079. $l_dest_filename = $_FILES['fupload']['name']['lang1'];
  1080. if(strpos($l_dest_filename, "lang_") === false) {
  1081. // error - wrong filename!
  1082. ?>
  1083. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Wrong filename! You should upload a languagefile (beginning with &quot;lang_&quot; )!</td></tr>
  1084. <?php
  1085. } else {
  1086. $dest = singleslash($dirname . "/" . $_FILES['fupload']['name']['lang1']);
  1087. if (!copy($_FILES['fupload']['tmp_name']['lang1'], $dest)) {
  1088. // copy error!
  1089. ?>
  1090. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Could not upload the file <?php print $_FILES['fupload']['name']['lang1']; ?>!</td></tr>
  1091. <tr><td>&nbsp;</td><td colspan=5 class="Comments">Something is very wrong!!</td></tr>
  1092. <?php
  1093. } else {
  1094. //upload ok!
  1095. ?>
  1096. <tr><td class="hint">ok: </td><td colspan=5 class="Comments">Upload of <?php print $_FILES['fupload']['name']['lang1']; ?> successful!</td></tr>
  1097. <?php
  1098. if (!@chmod($dest, intval("0666", 8))) {
  1099. // fehler!
  1100. }
  1101. }
  1102. }
  1103. }
  1104.  
  1105. // upload yappa-ng/languages/lang_*
  1106. $dirname = singleslash($config['source_root'] . "/languages");
  1107. if (($_FILES['fupload']['name']['lang2']) && ($_FILES['fupload']['size']['lang2'] != "0")) {
  1108. $l_dest_filename = $_FILES['fupload']['name']['lang2'];
  1109. if(strpos($l_dest_filename, "lang_") === false) {
  1110. // error - wrong filename!
  1111. ?>
  1112. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Wrong filename! You should upload a languagefile (beginning with &quot;lang_&quot; )!</td></tr>
  1113. <?php
  1114. } else {
  1115. $dest = singleslash($dirname . "/" . $_FILES['fupload']['name']['lang2']);
  1116. if (!copy($_FILES['fupload']['tmp_name']['lang2'], $dest)) {
  1117. // copy error!
  1118. ?>
  1119. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Could not upload the file <?php print $_FILES['fupload']['name']['lang2']; ?>!</td></tr>
  1120. <tr><td>&nbsp;</td><td colspan=5 class="Comments">Something is very wrong!!</td></tr>
  1121. <?php
  1122. } else {
  1123. //upload ok!
  1124. ?>
  1125. <tr><td class="hint">ok: </td><td colspan=5 class="Comments">Upload of <?php print $_FILES['fupload']['name']['lang2']; ?> successful!</td></tr>
  1126. <?php
  1127. if (!@chmod($dest, intval("0666", 8))) {
  1128. // fehler!
  1129. }
  1130. }
  1131. }
  1132. }
  1133.  
  1134. // upload yappa-ng/languages/lang_*
  1135. $dirname = singleslash($config['source_root'] . "/languages");
  1136. if (($_FILES['fupload']['name']['lang3']) && ($_FILES['fupload']['size']['lang3'] != "0")) {
  1137. $l_dest_filename = $_FILES['fupload']['name']['lang3'];
  1138. if(strpos($l_dest_filename, "lang_") === false) {
  1139. // error - wrong filename!
  1140. ?>
  1141. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Wrong filename! You should upload a languagefile (beginning with &quot;lang_&quot; )!</td></tr>
  1142. <?php
  1143. } else {
  1144. $dest = singleslash($dirname . "/" . $_FILES['fupload']['name']['lang3']);
  1145. if (!copy($_FILES['fupload']['tmp_name']['lang3'], $dest)) {
  1146. // copy error!
  1147. ?>
  1148. <tr><td class="errormsg">Error: </td><td colspan=5 class="errordesc">Could not upload the file <?php print $_FILES['fupload']['name']['lang3']; ?>!</td></tr>
  1149. <tr><td>&nbsp;</td><td colspan=5 class="Comments">Something is very wrong!!</td></tr>
  1150. <?php
  1151. } else {
  1152. //upload ok!
  1153. ?>
  1154. <tr><td class="hint">ok: </td><td colspan=5 class="Comments">Upload of <?php print $_FILES['fupload']['name']['lang3']; ?> successful!</td></tr>
  1155. <?php
  1156. if (!@chmod($dest, intval("0666", 8))) {
  1157. // fehler!
  1158. }
  1159. }
  1160. }
  1161. }
  1162.  
  1163.  
  1164.  
  1165. }
  1166.  
  1167.  
  1168. /*
  1169. * ***********************************************************************************************
  1170. * function check_dir($dirname, $error_count)
  1171. *
  1172. * This function checks if a dir exists and gives the statement
  1173. * ***********************************************************************************************
  1174. */
  1175. function check_dir($dirname, $error_count)
  1176. {
  1177. if(is_dir($dirname)) { ?>
  1178. <tr><td class="hint">ok: </td><td colspan=5 class="Comments">Directory: <?php print $dirname; ?> found!</td></tr>
  1179. <?php } else {
  1180. $error_count++;
  1181. ?>
  1182. <tr><td class="errormsg">Error: </td><td colspan=5 class="Comments">Directory: <?php print $dirname; ?> NOT found!</td></tr>
  1183. <?php }
  1184. return $error_count;
  1185. }
  1186.  
  1187.  
  1188. /*
  1189. * ***********************************************************************************************
  1190. * function check_file($filename, $error_count)
  1191. *
  1192. * This function checks if a file exists and gives the statement
  1193. * ***********************************************************************************************
  1194. */
  1195. function check_file($filename, $error_count)
  1196. {
  1197. if(file_exists($filename)) { ?>
  1198. <tr><td class="hint">ok: </td><td colspan=5 class="Comments">File: <?php print $filename; ?> found!</td></tr>
  1199. <?php } else {
  1200. $error_count++;
  1201. ?>
  1202. <tr><td class="errormsg">Error: </td><td colspan=5 class="Comments">File: <?php print $filename; ?> NOT found!</td></tr>
  1203. <?php }
  1204. return $error_count;
  1205. }
  1206.  
  1207. /*
  1208. * ***********************************************************************************************
  1209. * function check_configuration()
  1210. *
  1211. * This function checks the needed:
  1212. *
  1213. * created directories:
  1214. * yappa-ng
  1215. * yappa-ng/cache
  1216. * yappa-ng/languages
  1217. * yappa-ng/themes
  1218. * yappa-ng/images
  1219. * yappa-ng/admin_modules
  1220. * yappa-ng/docs
  1221. * yappa-ng/install
  1222. * yappa-ng/toolbox_modules
  1223. * yappa-ng/exifer
  1224. * yappa-ng/exifer/makers
  1225. *
  1226. * ***********************************************************************************************
  1227. */
  1228.  
  1229. function check_installation()
  1230. {
  1231. global $config;
  1232. global $config_album;
  1233.  
  1234. $error_count = 0;
  1235.  
  1236. ?>
  1237.  
  1238. <tr><td colspan="6">&nbsp;</td></tr>
  1239. <tr><td colspan=6 class="MainComment">Final check of all files and directories.</td></tr>
  1240. <tr><td colspan=6 class="Comments">
  1241. Last check for all files and directories. If you see an error here please investigate and correct!
  1242. </td></tr>
  1243. <tr><td colspan="6">&nbsp;</td></tr>
  1244. <?php
  1245.  
  1246. // directories
  1247. print "<tr><td colspan='6'>Checking created directories</td></tr>";
  1248.  
  1249. // directory yappa-ng
  1250. $dirname = $config['source_root'];
  1251. $error_count = check_dir($dirname, $error_count);
  1252.  
  1253. // directory yappa-ng/cache
  1254. $dirname = singleslash($config['source_root'] . "/cache");
  1255. $error_count = check_dir($dirname, $error_count);
  1256.  
  1257. // directory yappa-ng/languages
  1258. $dirname = singleslash($config['source_root'] . "/languages");
  1259. $error_count = check_dir($dirname, $error_count);
  1260.  
  1261. // directory yappa-ng/themes
  1262. $dirname = singleslash($config['source_root'] . "/themes");
  1263. $error_count = check_dir($dirname, $error_count);
  1264.  
  1265. // directory yappa-ng/admin_modules
  1266. $dirname = singleslash($config['source_root'] . "/admin_modules");
  1267. $error_count = check_dir($dirname, $error_count);
  1268.  
  1269. // directory yappa-ng/images
  1270. $dirname = singleslash($config['source_root'] . "/images");
  1271. $error_count = check_dir($dirname, $error_count);
  1272.  
  1273. // directory yappa-ng/docs
  1274. $dirname = singleslash($config['source_root'] . "/docs");
  1275. $error_count = check_dir($dirname, $error_count);
  1276.  
  1277. // directory yappa-ng/install
  1278. $dirname = singleslash($config['source_root'] . "/install");
  1279. $error_count = check_dir($dirname, $error_count);
  1280.  
  1281. // directory yappa-ng/toolbox_modules
  1282. $dirname = singleslash($config['source_root'] . "/toolbox_modules");
  1283. $error_count = check_dir($dirname, $error_count);
  1284.  
  1285. // directory yappa-ng/src
  1286. $dirname = singleslash($config['source_root'] . "/src");
  1287. $error_count = check_dir($dirname, $error_count);
  1288.  
  1289. // directory yappa-ng/src
  1290. $dirname = singleslash($config['source_root'] . "/exifer");
  1291. $error_count = check_dir($dirname, $error_count);
  1292.  
  1293. // directory yappa-ng/src
  1294. $dirname = singleslash($config['source_root'] . "/exifer/makers");
  1295. $error_count = check_dir($dirname, $error_count);
  1296.  
  1297.  
  1298. // uploaded files
  1299. print "<tr><td colspan='6'>Checking uploaded files</td></tr>";
  1300.  
  1301. // file yappa-ng/check_setup.php
  1302. $filename = singleslash($config['source_root'] . "/check_setup.php");
  1303. $error_count = check_file($filename, $error_count);
  1304.  
  1305. // file yappa-ng/index.php");
  1306. $filename = singleslash($config['source_root'] . "/index.php");
  1307. $error_count = check_file($filename, $error_count);
  1308.  
  1309. // file yappa-ng/setup.php
  1310. $filename = singleslash($config['source_root'] . "/setup.php");
  1311. $error_count = check_file($filename, $error_count);
  1312.  
  1313. // file yappa-ng/show.php
  1314. $filename = singleslash($config['source_root'] . "/show.php");
  1315. $error_count = check_file($filename, $error_count);
  1316.  
  1317. // file yappa-ng/slideshow.php
  1318. $filename = singleslash($config['source_root'] . "/slideshow.php");
  1319. $error_count = check_file($filename, $error_count);
  1320.  
  1321. // file yappa-ng/toolbox.php
  1322. $filename = singleslash($config['source_root'] . "/toolbox.php");
  1323. $error_count = check_file($filename, $error_count);
  1324.  
  1325. // file yappa-ng/toolbox_logview.php
  1326. $filename = singleslash($config['source_root'] . "/toolbox_logview.php");
  1327. $error_count = check_file($filename, $error_count);
  1328.  
  1329. // file yappa-ng/cache/yappa-ng_DEMO.jpg
  1330. $filename = singleslash($config['cache_root'] . "/yappa-ng_DEMO.jpg");
  1331. $error_count = check_file($filename, $error_count);
  1332.  
  1333. // file yappa-ng/cache/error_image.jpg
  1334. $filename = singleslash($config['cache_root'] . "/error_image.jpg");
  1335. $error_count = check_file($filename, $error_count);
  1336.  
  1337. return $error_count;
  1338. }
  1339.  
  1340.  
  1341.  
  1342. /*
  1343. * ***********************************************************************************************
  1344. * function gd2_info()
  1345. *
  1346. * This is an alternate method for the gd_info() function
  1347. * which exists on PHP >= 4.3.0 !
  1348. * This function is a slightly modified version of the one found on PHP.net
  1349. * in the PHP Manual posted by johnschaefer at gmx dot de
  1350. * (search for function gd_info and go down to the usercomments)
  1351. * Input: - (Parses the phpinfo - function)
  1352. * Output: Infos on the GD-Library
  1353. * ***********************************************************************************************
  1354. */
  1355. function gd2_info() {
  1356. $gd_array = array(
  1357. "GD Version" => "",
  1358. "FreeType Support" => 0,
  1359. "FreeType Support" => 0,
  1360. "FreeType Linkage" => "",
  1361. "T1Lib Support" => 0,
  1362. "GIF Read Support" => 0,
  1363. "GIF Create Support" => 0,
  1364. "JPG Support" => 0,
  1365. "PNG Support" => 0,
  1366. "WBMP Support" => 0,
  1367. "XBM Support" => 0
  1368. );
  1369. $gif_support = 0;
  1370.  
  1371. ob_start();
  1372. eval("phpinfo();");
  1373. $l_php_info = ob_get_contents();
  1374. //ob_end_flush();
  1375. ob_end_clean();
  1376.  
  1377. foreach(explode("\n", $l_php_info) as $line) {
  1378. if(strpos($line, "GD Version")!==false) {
  1379. $gd_array["GD Version"] = trim(str_replace("GD Version", "", strip_tags($line)));
  1380. }
  1381. if(strpos($line, "FreeType Support")!==false) {
  1382. $gd_array["FreeType Support"] = trim(str_replace("FreeType Support", "", strip_tags($line)));
  1383. }
  1384. if(strpos($line, "FreeType Linkage")!==false) {
  1385. $gd_array["FreeType Linkage"] = trim(str_replace("FreeType Linkage", "", strip_tags($line)));
  1386. }
  1387. if(strpos($line, "T1Lib Support")!==false) {
  1388. $gd_array["T1Lib Support"] = trim(str_replace("T1Lib Support", "", strip_tags($line)));
  1389. }
  1390. if(strpos($line, "GIF Read Support")!==false) {
  1391. $gd_array["GIF Read Support"] = trim(str_replace("GIF Read Support", "", strip_tags($line)));
  1392. }
  1393. if(strpos($line, "GIF Create Support")!==false) {
  1394. $gd_array["GIF Create Support"] = trim(str_replace("GIF Create Support", "", strip_tags($line)));
  1395. }
  1396. if(strpos($line, "GIF Support")!==false) {
  1397. $gif_support = trim(str_replace("GIF Support", "", strip_tags($line)));
  1398. }
  1399. if(strpos($line, "JPG Support")!==false) {
  1400. $gd_array["JPG Support"] = trim(str_replace("JPG Support", "", strip_tags($line)));
  1401. }
  1402. if(strpos($line, "PNG Support")!==false) {
  1403. $gd_array["PNG Support"] = trim(str_replace("PNG Support", "", strip_tags($line)));
  1404. }
  1405. if(strpos($line, "WBMP Support")!==false) {
  1406. $gd_array["WBMP Support"] = trim(str_replace("WBMP Support", "", strip_tags($line)));
  1407. }
  1408. if(strpos($line, "XBM Support")!==false) {
  1409. $gd_array["XBM Support"] = trim(str_replace("XBM Support", "", strip_tags($line)));
  1410. }
  1411. }
  1412.  
  1413. if($gif_support==="enabled") {
  1414. $gd_array["GIF Read Support"] = 1;
  1415. $gd_array["GIF Create Support"] = 1;
  1416. }
  1417.  
  1418. if($gd_array["FreeType Support"]==="enabled") {
  1419. $gd_array["FreeType Support"] = 1;
  1420. }
  1421.  
  1422. if($gd_array["T1Lib Support"]==="enabled") {
  1423. $gd_array["T1Lib Support"] = 1;
  1424. }
  1425.  
  1426. if($gd_array["GIF Read Support"]==="enabled") {
  1427. $gd_array["GIF Read Support"] = 1;
  1428. }
  1429.  
  1430. if($gd_array["GIF Create Support"]==="enabled") {
  1431. $gd_array["GIF Create Support"] = 1;
  1432. }
  1433.  
  1434. if($gd_array["JPG Support"]==="enabled") {
  1435. $gd_array["JPG Support"] = 1;
  1436. }
  1437.  
  1438. if($gd_array["PNG Support"]==="enabled") {
  1439. $gd_array["PNG Support"] = 1;
  1440. }
  1441.  
  1442. if($gd_array["WBMP Support"]==="enabled") {
  1443. $gd_array["WBMP Support"] = 1;
  1444. }
  1445.  
  1446. if($gd_array["XBM Support"]==="enabled") {
  1447. $gd_array["XBM Support"] = 1;
  1448. }
  1449.  
  1450. return $gd_array;
  1451. }
  1452.  
  1453.  
  1454. /*
  1455. * ***********************************************************************************************
  1456. * function singleslash($path)
  1457. *
  1458. * This is to prevent multiple slashes or Windows style backslashes
  1459. * Input: a path or url
  1460. * Output: a path or url without doubleslashes and slashes only
  1461. * ***********************************************************************************************
  1462. */
  1463. function singleslash($path) {
  1464. $path = str_replace("\\","/",$path );
  1465. $l_single_slash = str_replace("///","/",$path);
  1466. $path = str_replace("//","/",$l_single_slash);
  1467.  
  1468. $l_single_slash = str_replace("%2F%2F%2F","%2F",$path);
  1469. $single_slash = str_replace("%2F%2F","%2F",$l_single_slash);
  1470. return $single_slash;
  1471. }
  1472.  
  1473. /*
  1474. * ***********************************************************************************************
  1475. * function singlebackslash($path)
  1476. *
  1477. * This is to prevent multiple backslashes
  1478. *
  1479. * setup.php v1.0 had a bug with backslashes. Could happen, that there where multiple
  1480. * backslashes (doubling every save!!)
  1481. * This function not only takes care of double-backslashes but removes ALL of them!
  1482. *
  1483. * Input: a path or url
  1484. * Output: a path or url without multiple backslashes
  1485. * ***********************************************************************************************
  1486. */
  1487. function singlebackslash($path) {
  1488. $check = TRUE;
  1489. $check = TRUE;
  1490. while ($check) {
  1491. $l_dummy = strpos($path,"\\\\");
  1492. if ($l_dummy === FALSE) {
  1493. $check = FALSE;
  1494. } else {
  1495. $path = str_replace("\\\\","\\",$path);
  1496. }
  1497. }
  1498.  
  1499. return $path;
  1500. }
  1501.  
  1502.  
  1503. /*
  1504. * ***********************************************************************************************
  1505. * function strip_slashes($path)
  1506. *
  1507. * This is to check PHP-setting of magic_quotes_gpc()
  1508. * If its "On" then strip the slashes - else leave it alone!
  1509. * Input: a path or url
  1510. * Output: a path or url with corrected stripslashes
  1511. * ***********************************************************************************************
  1512. */
  1513. function strip_slashes($path) {
  1514. if (get_magic_quotes_gpc()) {
  1515. $path = stripslashes($path);
  1516. }
  1517. return $path;
  1518. }
  1519.  
  1520.  
  1521.  
  1522. /*
  1523. * ***********************************************************************************************
  1524. * function remTrailSlash($path)
  1525. *
  1526. * This is to strip trailing slashes from paths
  1527. * Input: a path or url and a count (should be zero (=0)!!!)
  1528. * Output: a path or url without trailing slashes
  1529. * ***********************************************************************************************
  1530. */
  1531. function remTrailSlash($path, $count) {
  1532. // remove automatically added slashes if magic_quotes_gpc=On and loop is first round ($count=0)
  1533. if (get_magic_quotes_gpc() && ($count = 0)) {
  1534. $path = stripslashes($path);
  1535. }
  1536. $count=1;
  1537. // remove all leading and trailing whitespace
  1538. $path = trim($path);
  1539. // this is the path
  1540. $path_clean = $path;
  1541. $len = strlen($path);
  1542. $last_char = substr($path,($len - 1),1);
  1543. // check if the last character is a slash or backslash
  1544. if (($last_char == "/") or ($last_char == "\\")) {
  1545. // remove last character
  1546. $path = substr($path,0,($len - 1));
  1547. // call function again to take a look at the now last character
  1548. $path_clean = remTrailSlash($path, $count);
  1549. }
  1550. return $path_clean;
  1551. }
  1552.  
  1553.  
  1554.  
  1555. /*
  1556. * ***********************************************************************************************
  1557. * ***
  1558. * *** START INITIALIZING
  1559. * ***
  1560. * ***********************************************************************************************
  1561. */
  1562.  
  1563. if (empty($_SERVER['QUERY_STRING'])) {
  1564. print "<BR><BR><h1>No QUERY_STRING!</h1><BR><BR>Please call this Tool from the &quot;safe_mode_start.php&quot;!<BR><BR>";
  1565. exit();
  1566. }
  1567.  
  1568. if (empty($_GET['installpath'])) {
  1569. $l_query_string = str_replace("%2F", "/", $_SERVER['QUERY_STRING']);
  1570. $l_query_string = str_replace("?", "", $l_query_string);
  1571. $config_source_root = str_replace("installpath=", "", $l_query_string);
  1572. if($l_query_string == $config_source_root) {
  1573. print "<BR><BR><h1>Wrong QUERY_STRING!</h1><BR><BR>Please call this Tool from the &quot;safe_mode_start.php&quot;!<BR><BR>";
  1574. print "<BR><BR>The QUERY_STRING sent is: " . $_SERVER['QUERY_STRING'] . "<BR>";
  1575. exit();
  1576. }
  1577. } else {
  1578. $config_source_root = $_GET['installpath'];
  1579. }
  1580.  
  1581.  
  1582.  
  1583.  
  1584. initialize_config();
  1585.  
  1586. $config['errorcount'] = 0;
  1587. //}
  1588.  
  1589.  
  1590. /*
  1591. * ***********************************************************************************************
  1592. * ***
  1593. * *** START HTML OUTPUT
  1594. * ***
  1595. * ***********************************************************************************************
  1596. */
  1597.  
  1598. writeHTMLheader();
  1599.  
  1600. ?>
  1601. &nbsp;</td></tr>
  1602. <?php
  1603.  
  1604. /* check for safemode */
  1605. if (ini_get('safe_mode')) { ?>
  1606. <tr><td colspan=6 class="mainComment">The PHP-Installation on this Server is running in &quot;Safe Mode&quot;!</td></tr>
  1607. <?php
  1608. if (ini_get('safe_mode_exec_dir')) { ?>
  1609. <tr><td colspan=6 class="Comments">The Safe Mode Execution Directory is set to: <?php ini_get('safe_mode_exec_dir'); ?></td></tr>
  1610. <?php }
  1611. if (ini_get('safe_mode_gid')) { ?>
  1612. <tr><td colspan=6 class="Comments">The GroupID related to the Safe Mode setting is set! ?></td></tr>
  1613. <?php }
  1614. if (ini_get('safe_mode_include_dir')) { ?>
  1615. <tr><td colspan=6 class="Comments">The Safe mode Include Directory is set to: <?php ini_get('safe_mode_include_dir'); ?></td></tr>
  1616. <?php }
  1617. if (ini_get('open_basedir')) { ?>
  1618. <tr><td colspan=6 class="mainComment">The PHP-Installation on this Server has the &quot;Open Basedir&quot; PHP directive enabled!</td></tr>
  1619. <tr><td colspan=6 class="Comments">All of the files used with yappa-ng have to be within the directory <?php print ini_get('open_basedir'); ?>
  1620. Please read the appropriate section of the <a href="docs/INSTALL.html#open_basedir" target="_blank">INSTALL Manual</a>!</td></tr>
  1621. <?php } ?>
  1622. <tr><td colspan="6">&nbsp;</td></tr>
  1623. <tr><td colspan=6 class="Comments">If you want to know more about &quot;Safe Mode&quot; and what it means to you and the yappa-ng Setup
  1624. take a view at the <a href="docs/INSTALL.html#safe_mode" target="_blank">INSTALL Manual</a>!</td></tr>
  1625. <tr><td colspan="6">&nbsp;</td></tr>
  1626. <tr><td colspan="6">&nbsp;</td></tr>
  1627. <?php
  1628. } else { ?>
  1629. <tr><td colspan=6 class="mainComment">The PHP-Installation on this Server is <b>NOT</b>running in &quot;Safe Mode&quot;!</td></tr>
  1630. <tr><td colspan=6 class="Comments">You do not need this script! Please run the standard installation routine
  1631. as described in the <a href="docs/INSTALL.html" target="_blank">INSTALL Manual</a>!</td></tr>
  1632. <?php
  1633. //exit;
  1634. }
  1635.  
  1636.  
  1637.  
  1638. ?>
  1639. <tr><td colspan="6">&nbsp;</td></tr>
  1640.  
  1641.  
  1642. <?php
  1643. if (isset($_POST['SubmittedFinal'])) {
  1644. if ($_POST['SubmittedFinal']) {
  1645. $answer = check_cache_root();
  1646. }
  1647. } ?>
  1648. <tr><td colspan="6">&nbsp;</td></tr>
  1649. <tr><td colspan="6">&nbsp;</td></tr>
  1650. <tr><td colspan=6 class="Description">Uploading files</td></tr>
  1651. <tr><td colspan=6 class="MainComment">Upload of some needed files.</td></tr>
  1652. <tr><td colspan=6 class="Comments">
  1653. Here you upload all files which are called directly and are not included into another file.
  1654. And you upload the yappa-ng_DEMO.jpg image which you need for checking if something does not run as expected!
  1655. Please search for the files to upload them to the webserver.<br>
  1656. After hitting the &quot;Submit&quot; button this part of the installation will be finished! :-)
  1657. </td></tr>
  1658. <tr><td colspan="6">&nbsp;</td></tr>
  1659. <tr><td colspan="6">&nbsp;</td></tr>
  1660.  
  1661. <tr><td>&nbsp;</td><td nowrap>Upload file check_setup.php: </td><td colspan="4" align="left"><input type=file size=30 name="fupload[check]"></td></tr>
  1662. <tr><td>&nbsp;</td><td nowrap>Upload file index.php: </td><td colspan="4" align="left"><input type=file size=30 name="fupload[index]"></td></tr>
  1663. <tr><td>&nbsp;</td><td nowrap>Upload file setup.php: </td><td colspan="4" align="left"><input type=file size=30 name="fupload[setup]"></td></tr>
  1664. <tr><td>&nbsp;</td><td nowrap>Upload file show.php: </td><td colspan="4" align="left"><input type=file size=30 name="fupload[show]"></td></tr>
  1665. <tr><td>&nbsp;</td><td nowrap>Upload file slideshow.php: </td><td colspan="4" align="left"><input type=file size=30 name="fupload[slideshow]"></td></tr>
  1666. <tr><td>&nbsp;</td><td nowrap>Upload file toolbox.php: </td><td colspan="4" align="left"><input type=file size=30 name="fupload[toolbox]"></td></tr>
  1667. <tr><td>&nbsp;</td><td nowrap>Upload file toolbox_logview.php: </td><td colspan="4" align="left"><input type=file size=30 name="fupload[toollog]"></td></tr>
  1668. <tr><td>&nbsp;</td><td nowrap>Upload file yappa-ng_DEMO.jpg: </td><td colspan="3" align="left"><input type=file size=30 name="fupload[demo]"></td><td align='left'>&nbsp;(located in the &quot;yappa-ng/install&quot; directory)</td></tr>
  1669. <tr><td>&nbsp;</td><td nowrap>Upload file error_image.jpg: </td><td colspan="3" align="left"><input type=file size=30 name="fupload[errimg]"></td><td align='left'>&nbsp;(located in the &quot;yappa-ng/install&quot; directory)</td></tr>
  1670. <tr><td colspan="6">Upload the languages you want. Upload and submit as often as you want!</td></tr>
  1671. <tr><td>&nbsp;</td><td nowrap>Upload file Language 1: </td><td colspan="3" align="left"><input type=file size=30 name="fupload[lang1]"></td><td align='left'>&nbsp;(languages/lang_???.inc.php)</td></tr>
  1672. <tr><td>&nbsp;</td><td nowrap>Upload file Language 2: </td><td colspan="3" align="left"><input type=file size=30 name="fupload[lang2]"></td><td align='left'>&nbsp;(???-> eng=English, ger=German, esp=espanol,...)</td></tr>
  1673. <tr><td>&nbsp;</td><td nowrap>Upload file Language 3: </td><td colspan="3" align="left"><input type=file size=30 name="fupload[lang3]"></td><td align='left'>&nbsp;(languages/lang_???.inc.php)</td></tr>
  1674. <tr><td colspan="6"><b>Do NOT forget to upload the rest of the language related files (language_selection.inc.php and languages_translated.inc.php) with FTP or cut&paste or ... in the next step!!!!!!</b></td></tr>
  1675. <tr><td colspan="6">&nbsp;</td></tr>
  1676. <tr><td colspan="6">&nbsp;</td></tr>
  1677.  
  1678. <?php
  1679. /* ok - if you got until here - go on */
  1680. if (isset($_POST['SubmittedFinal'])) {
  1681. if ($_POST['SubmittedFinal']) {
  1682. $answer = make_needed_dirs();
  1683. //$answer = make_needed_files();
  1684. $answer = upload_needed_files();
  1685. $answer = save_config();
  1686. }
  1687.  
  1688. }
  1689. $answer = 1;
  1690. if (isset($_POST['SubmittedFinal'])) {
  1691. if ($_POST['SubmittedFinal']) {
  1692. $answer = check_installation();
  1693.  
  1694. }
  1695.  
  1696. } ?>
  1697.  
  1698. <tr><td colspan="6">&nbsp;</td></tr>
  1699. <?php
  1700. if ($answer == 0) { ?>
  1701. <tr><td colspan="6"><a name="bottom">&nbsp;</a></td></tr>
  1702. <tr><td colspan="6">&nbsp;</td></tr>
  1703. <tr><td class="gratulation">Gratulation! </td><td colspan="5" class="hint">Step 2 (of 4 steps) is finished! :-)</td></tr>
  1704. <tr><td colspan="6">&nbsp;</td></tr>
  1705. <tr><td class="hint">Step 3: </td><td colspan="5" class="Comments">Now FTP (or copy&paste or move) <b>ALL</b> files of the yappa-ng release (including all subdirectories!) into the directory <?php print $config['source_root']; ?>!<br>
  1706. <b>Please make sure that you do not overwrite any files!!!</b><br>
  1707. Be sure to keep exactly the directory structure as it is in the release package!!!</td></tr>
  1708. <tr><td colspan="6">&nbsp;</td></tr>
  1709. <tr><td class="hint">Step 4: </td><td colspan="5" class="Comments">The last step is to point your browser to the file &quot;setup.php&quot; script and run it! Follow all instructions provided there!</td></tr>
  1710. <tr><td>&nbsp;</td><td colspan="5" class="errormsg">Do not change any pathnames in the &quot;Part 1 Main&quot; - Section of the Setup Tool!! All these paths have been created now during step 1 and 2 !!!</td></tr>
  1711. <tr><td colspan="6">&nbsp;</td></tr>
  1712. <tr><td colspan="6">&nbsp;</td></tr>
  1713. <tr><td class="errormsg" colspan="6">Do not forget to delete the files &quot;safe_mode_start.php&quot; and &quot;safe_mode_install.php&quot;!!!</td></tr>
  1714. <tr><td colspan="6">&nbsp;</td></tr>
  1715. <tr><td colspan="6">&nbsp;</td></tr>
  1716. <tr><td class="gratulation" colspan="5" >Have Fun!!!! </td></tr>
  1717. <?php
  1718. exit;
  1719. } else { ?>
  1720. <tr><td colspan="6">&nbsp;</td></tr>
  1721. <tr><td class="errormsg">Not finished! </td><td colspan=5 class="errordesc">Please go on until all checks are green and the &quot;Submit&quot; button disappears!</td></tr>
  1722.  
  1723. <?php
  1724. writeHTMLsubmit("SubmittedFinal", "Submit All");
  1725. exit;
  1726. }
  1727.  
  1728.  
  1729.  
  1730. /*
  1731. * ***********************************************************************************************
  1732. *
  1733. * END of Part2 of the Safe Mode installation procedure!
  1734. *
  1735. * ***********************************************************************************************
  1736. */
  1737. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement