Пример #1
0
                                                    <tbody>  
                                                        <tr>
                                                            <td><div class="btn rounded btn-success icon16 <?php 
if ($requirements['php_version']) {
    ?>
 btn-success i-checkmark-3<?php 
} else {
    ?>
btn-danger i-close<?php 
}
?>
"></div><?php 
if ($requirements['php_version']) {
    ?>
 PHP <?php 
    echo get_php_version();
} else {
    ?>
At least version 5.0 required<?php 
}
?>
</td>
                                                            <td><div class="btn rounded btn-success icon16 i-checkmark-3"></div>Image Manipulation Available</td>
                                                        </tr>
                                                        
                                                        <tr>
                                                            <td><div class="btn rounded btn-success icon16 i-checkmark-3"></div> JavaScript Enabled</td>
                                                            <td><div class="btn rounded btn-success icon16  <?php 
if ($requirements['mod_rewrite']) {
    ?>
 btn-success i-checkmark-3<?php 
Пример #2
0
function get_table_content_mysql($table, $crlf)
{
    global $site_db;
    $result = $site_db->query("SELECT * FROM {$table}");
    if ($result && $site_db->get_numrows($result)) {
        echo $crlf . "#" . $crlf . "# Table Data for " . $table . $crlf . "#" . $crlf;
        $column_list = "";
        $num_fields = $site_db->get_numfields($result);
        for ($i = 0; $i < $num_fields; $i++) {
            $column_list .= ($column_list != "" ? ", " : "") . $site_db->get_fieldname($result, $i);
        }
    }
    while ($row = $site_db->fetch_array($result)) {
        $dump = "INSERT INTO " . $table . " (" . $column_list . ") VALUES (";
        for ($i = 0; $i < $num_fields; $i++) {
            $dump .= $i > 0 ? ", " : "";
            if (!isset($row[$i])) {
                $dump .= "NULL";
            } elseif ($row[$i] == "0" || $row[$i] != "") {
                $type = $site_db->get_fieldtype($result, $i);
                if ($type == "tinyint" || $type == "smallint" || $type == "mediumint" || $type == "int" || $type == "bigint") {
                    $dump .= $row[$i];
                } else {
                    $search_array = array('\\', '\'', "", "\n", "\r", "");
                    $replace_array = array('\\\\', '\\\'', '\\0', '\\n', '\\r', '\\Z');
                    if (get_php_version() >= 40005) {
                        $row[$i] = str_replace($search_array, $replace_array, $row[$i]);
                    } else {
                        for ($i = 0; $i < sizeof($search_array); $i++) {
                            $row[$i] = str_replace($search_array[$i], $replace_array[$i], $row[$i]);
                        }
                    }
                    $dump .= "'" . $row[$i] . "'";
                }
            } else {
                $dump .= "''";
            }
        }
        $dump .= ');';
        echo $dump . $crlf;
    }
    echo $crlf;
    return true;
}
Пример #3
0
 function upload()
 {
     if (isset($_FILES['upstall_file'])) {
         if (isset($_FILES['upstall_file']['error']) && $_FILES['upstall_file']['error'] == UPLOAD_ERR_OK && is_uploaded_file($_FILES['upstall_file']['tmp_name'])) {
             $old_mask = umask(0);
             // Change the mask so ftp user can change it if they need to.
             if (!move_uploaded_file($_FILES['upstall_file']['tmp_name'], BIT_ROOT_PATH . "temp/upstall_package.zip")) {
                 // Move to our own temp dir under a static name to prevent expoits. I tried doing all the work in the tmp dir but php does nto suppert that type of stuff
                 return "Unable to move file to UpStall tmp dir";
             }
             $parts = explode(".", $_FILES['upstall_file']['name']);
             // break up the file name
             $ext = $parts[count($parts) - 1];
             // to get the extension
             $parts = explode("_", $parts[0]);
             //
             if ($parts[0] != "bitweaver" || $parts[1] != "bit" || $parts[count($parts) - 1] != "package") {
                 return " This is not a valid package name ";
             }
             if ($_FILES['upstall_file']['type'] == "application/zip" && $ext == "zip") {
                 $zip = new ZipArchive();
                 if ($zip->open(BIT_ROOT_PATH . "temp/upstall_package.zip") === TRUE) {
                     if ($zip->extractTo(BIT_ROOT_PATH)) {
                         $zip->close();
                         unlink(BIT_ROOT_PATH . "temp/upstall_package.zip");
                     } else {
                         $zip->close();
                         unlink(BIT_ROOT_PATH . "temp/upstall_package.zip");
                         return " Extracting files failed! ";
                     }
                 } else {
                     unlink(BIT_ROOT_PATH . "temp/upstall_package.zip");
                     return " Unable to open zip file for extraction. ";
                 }
             } else {
                 return " File Rejected! Wrong Filetype: " . $_FILES['upstall_file']['type'] . "</div>";
             }
             umask($old_mask);
         } else {
             if ($_FILES['upstall_file']['error'] == UPLOAD_ERR_INI_SIZE) {
                 return "The uploaded file exceeds the upload_max_filesize directive in php.ini ";
             } else {
                 if ($_FILES['upstall_file']['error'] == UPLOAD_ERR_FORM_SIZE) {
                     return "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form. ";
                 } else {
                     if ($_FILES['upstall_file']['error'] == UPLOAD_ERR_PARTIAL) {
                         return "The uploaded file was only partially uploaded. ";
                     } else {
                         if ($_FILES['upstall_file']['error'] == UPLOAD_ERR_NO_FILE) {
                             return "No file was uploaded. ";
                         } else {
                             if (get_php_version() >= 40310 && $_FILES['upstall_file']['error'] == UPLOAD_ERR_NO_TMP_DIR) {
                                 return "Missing a temporary folder.";
                             } else {
                                 if (get_php_version() >= 50100 && $_FILES['upstall_file']['error'] == UPLOAD_ERR_CANT_WRITE) {
                                     return "Failed to write file to disk.";
                                 } else {
                                     if (get_php_version() >= 50200 && $_FILES['upstall_file']['error'] == UPLOAD_ERR_EXTENSION) {
                                         return "File upload stopped by extension.";
                                     } else {
                                         return " There was an error and we have no idea what happened! ";
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     } else {
         return "There was no file to upload.";
     }
     return null;
 }
Пример #4
0
//-----------------------------------------------------
include_once ROOT_PATH . 'includes/captcha_utils.php';
//-----------------------------------------------------
//--- CSRF protection ---------------------------------
//-----------------------------------------------------
include_once ROOT_PATH . 'includes/csrf_utils.php';
//-----------------------------------------------------
//--- GZip Compression --------------------------------
//-----------------------------------------------------
$do_gzip_compress = 0;
if ($config['gz_compress'] == 1 && !isset($nozip)) {
    if (get_php_version() >= 40004) {
        if (extension_loaded("zlib")) {
            ob_start("ob_gzhandler");
        }
    } elseif (get_php_version() > 40000) {
        if (preg_match("/gzip/i", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"]) || preg_match("/x-gzip/i", $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"])) {
            if (extension_loaded("zlib")) {
                $do_gzip_compress = 1;
                ob_start();
                ob_implicit_flush(0);
            }
        }
    }
}
if (defined("GET_CACHES")) {
    $config['cat_order'] = empty($config['cat_order']) ? 'cat_order, cat_name' : $config['cat_order'];
    $config['cat_sort'] = empty($config['cat_sort']) ? 'ASC' : $config['cat_sort'];
    $sql = "SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment\n          FROM " . CATEGORIES_TABLE . "\n          ORDER BY " . $config['cat_order'] . " " . $config['cat_sort'];
    $result = $site_db->query($sql);
    while ($row = $site_db->fetch_array($result)) {
Пример #5
0
$page_start = microtime();
/* Required includes */
require_once $include_path . 'lib' . $fd . 'misc_functions.php';
/* various helpers */
require_once $include_path . 'lib' . $fd . 'utility_classes.php';
/* base classes    */
require_once $include_path . 'lib' . $fd . 'url_action_class.php';
/* GET processing  */
require_once $include_path . 'lib' . $fd . 'imap_class.php';
/* IMAP routines   */
require_once $include_path . 'lib' . $fd . 'site_page_class.php';
/* print functions */
/* Read in the site configuration file */
$conf = get_config($hm2_config);
/* Get the PHP version */
$phpversion = get_php_version();
/* Get the current page URL. */
$sticky_url = get_page_url();
/* Generate a unique page id. */
$page_id = md5(uniqid(rand(), 1));
/* Define the current version. */
$hastymail_version = 'Hastymail2 1.1';
/* Data structures used by different parts of the program
----------------------------------------------------------------*/
/* Available languages. Translation files are located in the
   lang directory. They are named such that they match the keys
   of this array, but with ".php" extensions (lang/en_US.php).
   This array also defines the contents of the Language dropdown
   on the options page.
*/
$langs = array('bg_BG' => 'Bulgarian', 'ca_ES' => 'Catalan', 'zh_CN' => 'Chinese', 'nl_NL' => 'Dutch', 'en_US' => 'English', 'fi_FI' => 'Finnish', 'fr_FR' => 'French', 'de_DE' => 'German', 'gr_GR' => 'Greek', 'hu_HU' => 'Hungarian', 'it_IT' => 'Italian', 'ja_JP' => 'Japanese', 'pl_PL' => 'Polish', 'ro_RO' => 'Romanian', 'ru_RU' => 'Russian', 'es_ES' => 'Spanish', 'tr_TR' => 'Turkish', 'uk_UA' => 'Ukranian');