Post by ogun » Mon Nov 18, 2013 10:39 pm

During installation, if your database user doesn't have the right permissions then you see a blank page after completing the form on step 3. It'd be better if there was an error message.

I made a very quick/dirty grants check to get the ball rolling in case anyone else wants to add a proper one to either the controller/step_3 or model/install:

Code: Select all

// In model/install.php after the line beginning "$db = new DB('mysql', $data['db_host'],..."
ini_set('display_errors', 1);
error_reporting(E_ALL);
// Check user permissions
function array_simplify($array) {
    $new_array = array();
    foreach($array as $key => $value) {
        $new_array[$key] = reset($value);
    }
    return $new_array;
}
$required = array('CREATE','DROP','INSERT','UPDATE');
$query = $db->query("SHOW GRANTS");
$x = array_simplify($query->rows);
foreach($x as $grant) {
    if(substr($grant,0,20) == "GRANT ALL PRIVILEGES") $required = array();
    foreach($required as $nkey => $n) if(strpos($grant,$n)) unset($required[$nkey]);            
}
if(count($required)) {
    echo 'You need to grant these permissions for your SQL user:';
    print_r($required);
    exit;        
}

Active Member

Posts

Joined
Tue Aug 14, 2007 6:04 am
Who is online

Users browsing this forum: No registered users and 2 guests