function check_requirements() { $errors = array(); // Check that the session variable can be read if (!isset($_SESSION['plogger_session'])) { $save_path = ini_get('session.save_path'); // Check that session.save_path is set (not set by default on PHP5) if (empty($save_path)) { if (!defined('SESSION_SAVE_PATH')) { $sample_text = ' (' . sprintf(plog_tr('see %s if your %s does not contain this variable'), 'plog-config-sample.php', 'plog-config.php') . ')'; } else { $sample_text = ''; } $errors[] = sprintf(plog_tr('The PHP %s variable is not set in your php.ini file.'), '<strong>session.save_path</strong>') . ' ' . sprintf(plog_tr('You can attempt to set this by adding a writable directory path to the %s variable in %s or contact your webhost on how to set this system variable.'), '<strong>SESSION_SAVE_PATH</strong>', 'plog-config.php' . $sample_text); } else { $errors[] = sprintf(plog_tr('PHP session cookies are not being set. Please check that session cookies are enabled on your browser or verify that your %s variable is set up correctly.'), '<strong>session.save_path</strong>') . ' ' . sprintf(plog_tr('You can attempt to set this by adding a writable directory path to the %s variable in %s or contact your webhost on how to set this system variable.'), '<strong>SESSION_SAVE_PATH</strong>', 'plog-config.php' . $sample_text); } } // Check that the GD library is available if (gd_missing()) { $errors[] = plog_tr('PHP GD module was not detected.'); } // Check that MySQL functions are available if (!function_exists('mysql_connect')) { $errors[] = plog_tr('PHP MySQL module was not detected.'); } // Make sure we have permission to read these folders/files $files_to_read = array('./plog-admin', './plog-admin/css', './plog-admin/images', './plog-content/images', './plog-content/thumbs', './plog-content/uploads', './plog-includes', './plog-includes/lib'); foreach ($files_to_read as $file) { if (!is_readable(PLOGGER_DIR . $file)) { $errors[] = sprintf(plog_tr('The path %s is not readable by the web server.'), '<strong>' . realpath(PLOGGER_DIR . $file) . '</strong>'); } } // Workaround for upgrading from beta1 since there are conflicting function in plog-functions.php and beta1 plog-connect.php if (function_exists('is_safe_mode')) { // If safe mode enabled, we will use the FTP workarounds to deal with folder permissions if (!is_safe_mode()) { // Make sure we have permission to write to these folders $files_to_write = array('./plog-content/images', './plog-content/thumbs'); $i = 0; foreach ($files_to_write as $file) { if (!is_writable(PLOGGER_DIR . $file)) { $errors[] = sprintf(plog_tr('The path %s is not writable by the web server.'), '<strong>' . realpath(PLOGGER_DIR . $file) . '</strong>'); } else { if (is_open_perms(realpath(PLOGGER_DIR . $file))) { $_SESSION['plogger_close_perms'][basename($file)] = realpath(PLOGGER_DIR . $file); } } } if (isset($_SESSION['plogger_close_perms'])) { if (!is_writable(PLOGGER_DIR . 'plog-content/')) { $errors[] = sprintf(plog_tr('Please temporarily CHMOD the %s directory to 0777 to allow Plogger to create initial directories for increased security. You will be prompted to CHMOD the directory back to 0755 after installation is complete.'), '<strong>plog-content/</strong>'); } } } } return $errors; }
<h3 style="text-indent: 10px; margin-bottom: 15px;">' . plog_tr('-- OR --') . '</h3> <div> <input tabindex="60" onclick="var k=document.getElementsByName(\'new_album_name\');k[0].focus();" type="radio" name="destination_radio" accesskey="b" value="new" /> <label for="new_album_name" style="display: inline;">' . plog_tr('Create a New Al<em>b</em>um') . '</label> <label class="no-margin-bottom" for="new_album_name" style="font-weight: normal;">' . plog_tr('New Album Name') . ':</label> <input class="no-margin-top" tabindex="70" style="width: 79%;" onclick="var k=document.getElementsByName(\'destination_radio\');k[1].checked=true;" type="text" id="new_album_name" name="new_album_name" /> <label class="no-margin-bottom" for="collections_menu" style="font-weight: normal;">' . plog_tr('In Collection') . ':</label> ' . generate_collections_menu() . ' </div> <p class="align-left no-margin-top no-margin-bottom" style="text-indent: 5px;"><input class="submit" type="submit" name="upload" value="' . plog_tr('Upload') . '" /></p> </td> </tr> </table> </form>' . "\n"; $output_error = "\n\t" . '<h1>' . plog_tr('Upload Images') . '</h1> <p class="actions">' . sprintf(plog_tr('Before you can begin uploading images to your gallery, you must create at least <strong>one collection</strong> AND <strong>one album</strong> within that collection. Move over to the <a href="%s">Manage</a> tab to begin creating your gallery structure.'), 'plog-manage.php') . '</p>'; require_once PLOGGER_DIR . 'plog-admin/includes/install-functions.php'; if (gd_missing()) { $output_error = "\n\t" . '<h1>' . plog_tr('Upload Images') . '</h1> <p class="errors">' . plog_tr('PHP GD extension is not installed, it is required to upload images.') . '</p>'; display($output_error, 'upload'); } else { $num_albums = count_albums(); if ($num_albums > 0) { display($output, 'upload'); } else { display($output_error, 'upload'); } }
function check_requirements() { $errors = array(); if (gd_missing()) { $errors[] = "PHP GD module was not detected."; } if (!function_exists('mysql_connect')) { $errors[] = "PHP MySQL module was not detected."; } $files_to_read = array("./", "./admin", "./css", "./images", "./lib", "./thumbs", "./uploads"); foreach ($files_to_read as $file) { if (!is_readable(PLOGGER_DIR . $file)) { $errors[] = "The path " . realpath(PLOGGER_DIR . $file) . " (" . $file . ") is not readable."; } } $files_to_write = array("./", "./thumbs", "./images", "./uploads"); foreach ($files_to_write as $file) { if (!is_writable(PLOGGER_DIR . $file)) { $errors[] = 'The path ' . realpath(PLOGGER_DIR . $file) . ' is not writable by the Web server.'; } } return $errors; }