Esempio n. 1
0
                if (is_correct_file_permission($perm_file)) {
                    $permission[$perm_file] = 'ok';
                } else {
                    $permission[$perm_file] = '<b>' . CHMOD_WARNING . '</b>';
                    $success = false;
                }
            }
        }
        $page = 'permissions.php';
    }
} elseif (isset($_POST['configurations'])) {
    $_POST['admin_username'] = openld_trim($_POST['admin_username']);
    $_POST['admin_password'] = openld_trim($_POST['admin_password']);
    $_POST['admin_email'] = strtolower(openld_trim($_POST['admin_email']));
    $_POST['site_title'] = openld_trim($_POST['site_title']);
    $_POST['site_description'] = openld_trim($_POST['site_description']);
    $error->check_new_username_vs_password(check_if_null($_POST['admin_username']), check_if_null($_POST['admin_password']));
    $error->check_email(check_if_null($_POST['admin_email']), false);
    //$error->check_admin_title(check_if_null($_POST['site_title']));
    //$error->check_admin_description(check_if_null($_POST['site_description']));
    $error->check_site_path(check_if_null($_POST['site_domain']));
    $error->string_control('ext_error', check_if_null($_POST['db_extension']), EXTENSION_ERROR);
    $error->string_control('host_error', check_if_null($_POST['db_host']), HOST_ERROR);
    $error->string_control('name_error', check_if_null($_POST['db_name']), NAME_ERROR);
    $error->string_control('username_error', check_if_null($_POST['db_username']), USERNAME_ERROR);
    $error->string_control('password_error', check_if_null($_POST['db_password']), PASSWORD_ERROR);
    $error->string_control('prefix_error', check_if_null($_POST['db_prefix']), PREFIX_ERROR);
    switch ($_POST['db_extension']) {
        case 'mysqli':
        case 'mysqli_innodb':
            if (!function_exists('mysqli_connect')) {
Esempio n. 2
0
 function get_table_info($table_name, $no_prefix = false)
 {
     // Grab table info
     $result = $this->query('SELECT sql FROM sqlite_master WHERE tbl_name = \'' . ($no_prefix ? '' : $this->prefix) . $this->escape($table_name) . '\' ORDER BY type DESC') or error(__FILE__, __LINE__);
     $num_rows = $this->num_rows($result);
     if ($num_rows == 0) {
         return;
     }
     $table = array();
     $table['indices'] = array();
     while ($cur_index = $this->fetch_assoc($result)) {
         if (!isset($table['sql'])) {
             $table['sql'] = $cur_index['sql'];
         } else {
             $table['indices'][] = $cur_index['sql'];
         }
     }
     // Work out the columns in the table currently
     $table_lines = explode("\n", $table['sql']);
     $table['columns'] = array();
     foreach ($table_lines as $table_line) {
         $table_line = openld_trim($table_line);
         if (substr($table_line, 0, 12) == 'CREATE TABLE') {
             continue;
         } else {
             if (substr($table_line, 0, 11) == 'PRIMARY KEY') {
                 $table['primary_key'] = $table_line;
             } else {
                 if (substr($table_line, 0, 6) == 'UNIQUE') {
                     $table['unique'] = $table_line;
                 } else {
                     if (substr($table_line, 0, strpos($table_line, ' ')) != '') {
                         $table['columns'][substr($table_line, 0, strpos($table_line, ' '))] = openld_trim(substr($table_line, strpos($table_line, ' ')));
                     }
                 }
             }
         }
     }
     return $table;
 }
Esempio n. 3
0
function openld_trim_array($array)
{
    return is_array($array) ? array_map('openld_trim_array', $array) : openld_trim($array);
}