Example #1
0
function test_bug_attachments_allow_flags()
{
    $t_pass = true;
    $t_own_view = config_get_global('allow_view_own_attachments');
    $t_own_download = config_get_global('allow_download_own_attachments');
    $t_own_delete = config_get_global('allow_delete_own_attachments');
    if ($t_own_delete == ON && $t_own_download == FALSE) {
        $t_pass = false;
    } else {
        if ($t_own_download == ON && $t_own_view == OFF) {
            $t_pass = false;
        }
    }
    print_test_row('Bug attachments allow own flags (allow_view_own_attachments, ' . 'allow_download_own_attachments, allow_delete_own_attachments)', $t_pass);
    return $t_pass;
}
Example #2
0
function test_database_utf8()
{
    if (!db_is_mysql()) {
        return;
    }
    // table collation/character set check
    $result = db_query_bound('SHOW TABLE STATUS');
    while ($row = db_fetch_array($result)) {
        if ($row['Comment'] !== 'VIEW') {
            print_test_row('Checking Table Collation is utf8 for ' . $row['Name'] . '....', substr($row['Collation'], 0, 5) === 'utf8_', $row['Collation']);
        }
    }
    foreach (db_get_table_list() as $t_table) {
        if (db_table_exists($t_table)) {
            $result = db_query_bound('SHOW FULL FIELDS FROM ' . $t_table);
            while ($row = db_fetch_array($result)) {
                if ($row['Collation'] === null) {
                    continue;
                }
                print_test_row('Checking Non-null Column Collation in ' . $t_table . ' is utf8 for ' . $row['Field'] . '....', substr($row['Collation'], 0, 5) === 'utf8_', $row['Collation'] . ' ( ' . $row['Type'] . ')');
            }
        }
    }
}